How typecellos/blocknote works
BlockNote is a React-based, block-oriented rich-text editor. An application creates an editor and renders it through a themed view; users edit structured blocks and inline content, with menus and controls exposing editing actions. The core also supports importing and exporting content, comments, collaboration, and version history, while optional packages add AI, diagram, and math features. The source index and excerpts show editor-to-block and React-controller relationships; several other capability links are documented by the README, but their internal wiring was not sampled.
Main entry points: BlockNoteEditor.ts BlockNote editor · defaultBlocks.ts Default block types · BlockManager.ts Block operations · BlockNoteView.tsx Themed editor view
Components 20
Editor core
- BlockNote editor
packages/core/src/editor/BlockNoteEditor.ts - Document schema
packages/core/src/schema/schema.ts - Default block types
packages/core/src/blocks/defaultBlocks.ts - Block operations
packages/core/src/editor/managers/BlockManager.ts - Block manipulation commands
packages/core/src/api/blockManipulation/commands - Content parsing and export
packages/core/src/api
React interface
- React editor API
packages/react/src/hooks/useBlockNoteEditor.ts - Themed editor view
packages/mantine/src/BlockNoteView.tsx - Formatting and link toolbars
packages/react/src/components/LinkToolbar/LinkToolbarController.tsx - Suggestion menus
packages/react/src/components/SuggestionMenu/SuggestionMenuController.tsx - Table handles
packages/react/src/components/TableHandles/TableHandlesController.tsx
Collaboration and history
- Comments
packages/core/src/comments/extension.ts - Yjs collaboration
packages/core/src/y/extensions/YSync.ts - Version history
packages/core/src/extensions/Versioning/Versioning.ts
Editor extensions
- Extension system
packages/core/src/editor/managers/ExtensionManager/index.ts
Optional features
- AI editing
packages/xl-ai/src/components/AIMenu/AIMenuController.tsx - Diagram blocks
packages/diagram-block/src/block/helpers/render/DiagramBlockPreviewWithPopup.tsx - Math blocks
packages/math-block/src/block/helpers/render/MathBlockPreviewWithPopup.tsx - Extended export formats
packages/xl-docx-exporter/src/docx/docxExporter.ts
Other components
- Application user
Connections 19
- Application user → Themed editor view: edits in
- Themed editor view → BlockNote editor: renders
- React editor API → BlockNote editor: retrieves
packages/react/src/hooks/useBlockNoteEditor.ts - BlockNote editor → Default block types: configures
packages/core/src/editor/BlockNoteEditor.ts - Default block types → Document schema: builds from
packages/core/src/blocks/defaultBlocks.ts - BlockNote editor → Block operations: exposes
packages/core/src/editor/BlockNoteEditor.ts - Block operations → Block manipulation commands: invokes
packages/core/src/editor/managers/BlockManager.ts - BlockNote editor → Extension system: registers
packages/core/src/editor/BlockNoteEditor.ts - BlockNote editor → Content parsing and export: supports
packages/core/src/editor/BlockNoteEditor.ts - Application user → Formatting and link toolbars: formats with
- Application user → Suggestion menus: chooses from
- Application user → Table handles: manipulates tables
- BlockNote editor → Comments: supports
- BlockNote editor → Yjs collaboration: collaborates through
- BlockNote editor → Version history: supports
- BlockNote editor → AI editing: extends with
- BlockNote editor → Diagram blocks: embeds
- BlockNote editor → Math blocks: embeds
- BlockNote editor → Extended export formats: exports through