How syfxlin/tiptap-starter-kit works
Main Components
• Core Library: At the center, have the StarterKit initializer (src/index.ts) which configures Tiptap with the available extensions.
• Extensions: Represent each major group:
• Extensions (src/extensions): This folder includes user-interface extensions like BlockMenu, ClickMenu, Clipboard, FloatMenu, Markdown, Node-View, StarterKit composition, and Uploader.
• Marks (src/marks): Provides text formatting marks such as Bold, Italic, Underline, Code, Link, etc.
• Utilities and Styles:
• Styles (src/styles.less): Styling related to the editor.
• Documentation & Demo:
• Docs (docs folder) include guidelines, detailed extension descriptions, and configuration details.
• Demo (demo/index.ts) shows an example usage and integration scenario.
• Configuration/CI:
• Configuration files (e.g., .github/workflows, package.json, tsconfig.json) show how the project is built, tested, and deployed.
Relationships & Interactions
• The StarterKit module (core initializer) integrates all of the extensions, marks, and nodes into Tiptap’s editor instance.
• Each extension (e.g., Markdown, FloatMenu, etc.) works as an independent plugin that can be configured (as shown in the usage example in README).
• The extensions communicate with the core editor and may interact with each other (for example, calculating positions or sharing UI elements).
Architectural Patterns and Design Principles
• Modularity: The system is highly modular with separate folders for extensions, nodes, and marks.
• Extensibility: It’s built to be configurable. The README usage example shows that users can enable/disable or configure specific extensions.
• Clean Separation: There is a clear separation between core functionality, UI components (extension views and menus), and configuration/documentation.
• Dependency Injection: The integrations for Tiptap core and its plug-ins are configured at initialization, allowing for great flexibility in usage across projects.