A custom Tiptap-based WYSIWYG editor for creating interactive Grafana tutorials. This prototype demonstrates how to use Tiptap/ProseMirror to author tutorial content with special interactive markup.
-
Compact Google Docs-Style Toolbar: Single-row toolbar following familiar design conventions
-
Rich Text Editing: Full WYSIWYG editor with formatting options (bold, italic, headings, lists, etc.)
-
Interactive Markup: Specialized forms for each interactive action type:
- 7 Action Types: Button, Highlight, Form Fill, Navigate, Hover, Multistep, Sequence
- Dedicated Forms: Each action type has its own configuration component
- Popover Interface: Clean, non-intrusive UI for setting attributes
- Interactive Comments & Spans: Special marks for tutorial hints and inline actions
-
Extensible Architecture: Easy to add new interactive action types
-
Live HTML Preview: Split-screen view with formatted HTML output
-
Custom Extensions: Tiptap extensions that preserve all interactive attributes
For detailed toolbar usage, see TOOLBAR_GUIDE.md
npm installnpm run devOpen the URL shown in your terminal (typically http://localhost:5173)
- Use the Heading dropdown to set text style (Normal, H1-H4)
- Use Format dropdown for code, blockquote, or horizontal rules
- Click B (Bold) or I (Italic) for text formatting
- Use the List dropdown (•) to create bullet or numbered lists
- Create or select a list item
- Click the ⚡ (lightning bolt) button
- Choose an action type from the popover:
- 🔘 Button - Click a button
- ✨ Highlight - Highlight an element
- 📝 Form Fill - Fill an input
- 🧭 Navigate - Go to a page
- 👆 Hover - Reveal on hover
- 📋 Multistep - Multiple actions
- 📑 Sequence - Section with steps
- Fill in the form fields (selector, requirements, etc.)
- Click Apply
- 💬 Comment: Select text and click to add hints/explanations
- 🏷️ Span: Select text and click to create inline interactive elements
The right panel shows the formatted HTML output with proper indentation. Click "Copy HTML" to copy it to your clipboard for use in tutorial files.
src/
├── components/
│ ├── TiptapEditor.tsx # Main editor component
│ ├── TiptapEditor.css # Editor styling
│ ├── Toolbar.tsx # Compact Google Docs-style toolbar
│ ├── Toolbar.css # Toolbar styling
│ ├── InteractiveSettingsPopover.tsx # Popover for interactive settings
│ ├── dropdowns/ # Reusable dropdown components
│ │ ├── DropdownMenu.tsx # Generic dropdown wrapper
│ │ ├── HeadingDropdown.tsx # Heading selection
│ │ ├── FormatDropdown.tsx # Format options
│ │ └── ListDropdown.tsx # List type selection
│ └── interactive-forms/ # Forms for each action type
│ ├── types.ts # Shared TypeScript interfaces
│ ├── ButtonActionForm.tsx # Button click configuration
│ ├── HighlightActionForm.tsx # Element highlight configuration
│ ├── FormFillActionForm.tsx # Form fill configuration
│ ├── NavigateActionForm.tsx # Navigation configuration
│ ├── HoverActionForm.tsx # Hover action configuration
│ ├── MultistepActionForm.tsx # Multistep configuration
│ └── SequenceActionForm.tsx # Sequence/section configuration
├── extensions/
│ ├── InteractiveListItem.ts # Custom list item with data-* attributes
│ ├── InteractiveSpan.ts # Custom span mark for interactive elements
│ └── InteractiveComment.ts # Custom mark for interactive comments
├── App.tsx # Main app with two-column layout
├── App.css # App layout styling
└── main.tsx # App entry point
This project includes three custom Tiptap extensions:
-
InteractiveListItem: Extends the default ListItem node to support:
classattribute (for "interactive" class)data-targetactiondata-reftargetdata-requirementsdata-doit
-
InteractiveSpan: A custom mark that renders as
<span class="interactive">with support for:idattributedata-targetactiondata-reftargetdata-requirements
-
InteractiveComment: A simple mark that renders as
<span class="interactive-comment">
Based on the Grafana Interactive Tutorials system, this editor supports:
- Action Types: button, highlight, formfill, navigate, hover, multistep, sequence
- Requirements: exists-reftarget, navmenu-open, on-page:path, etc.
- Show-only Mode:
data-doit="false"for educational explanations - Interactive Comments: Hints and explanations within tutorial steps
- React + TypeScript: UI framework
- Vite: Build tool and dev server
- Tiptap: Rich text editor framework
- ProseMirror: Underlying editor engine
MIT