How htmujahid/shadcn-editor works
Main Components Structure
Frontend Application Layer:
• Next.js Application Structure
• App Router (app/ directory)
• Registry System (__registry__/ and registry/)
• Component Library (components/)
• UI Components (ui/)
Core Editor Layer:
• Editor Core
• Context Management
• Hooks
• Plugins System
• Node System
• Transformers
• UI Components
Theme System:
• Default Theme
• New York Theme
• Style Registry
Key Relationships to Highlight
┌─────────────────────────────────────────────────────┐
• Application Layer │
• ┤
• ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │
• Routes │ │ Components │ │ Hooks │ │
• ┘ └──────────────┘ └───────────────┘ │
• ┬─────────────────────────────┘
┌───────────────────────▼─────────────────────────────┐
• Editor Core │
• ┤
• ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │
• Plugins │ │ Nodes │ │ Transformers │ │
• ┘ └──────────────┘ └───────────────┘ │
• ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │
• Context │ │ Hooks │ │ Utils │ │
• ┘ └──────────────┘ └───────────────┘ │
• ┬─────────────────────────────┘
┌───────────────────────▼─────────────────────────────┐
• Theme System │
• ┤
• ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │
• Default │ │ New York │ │ Styles │ │
• ┘ └──────────────┘ └───────────────┘ │
• ┘
Important Elements
• User Input → Editor Core
• Editor Core → State Management
• State → Rendering Pipeline
• Theme System → UI Components
Integration Points:
• Plugin System connections
• Theme switching mechanism
• Registry system interaction
Additional Details
Component Relationships:
Editor Core
• Plugins System
• Text Formatting
• Block Formatting
• History
• Custom Plugins
• Node System
• Basic Nodes
• Custom Nodes
• Embeds
• Transformers
• Markdown
• HTML
• Custom Formats
Implementation Notes
• Use different line styles for different types of relationships
• Version information and dependencies
• Configuration flow
• Extensibility points
Key Interactions
• How the editor integrates with the Next.js application
• Plugin loading and initialization
• Demonstrate theme switching mechanism
• State management flow
• Nested components
• Custom styling
• Clear typography
• Export in high resolution