# hades0050/nuxt-block-editor architecture

> Architecture diagram of the GitHub repository hades0050/nuxt-block-editor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hades0050/nuxt-block-editor
- Repository: https://github.com/hades0050/nuxt-block-editor

## Overview

nuxt-block-editor is a Nuxt/Vue content-block editor. Users edit, fill, or read a grid of typed blocks; content is modeled and serialized, rendered through specialized editors, and form values can be collected or inserted via binding keys. The README documents rich text, nested tabs/tree content, media, canvas, localization, and code highlighting; unsampled UI details are represented at their exact enclosing paths. Edges cite shown calls or README statements; optional external-service behavior is not inferred.

Main entry points: [`src/runtime/components/block-editor/index.vue`](https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/components/block-editor/index.vue) (Block editor), [`src/runtime/components/block-editor/boxes`](https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor/boxes) (Block renderers), [`src/model/content/Content.ts`](https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/content/Content.ts) (Content container), [`src/model/utils/dataBinding.ts`](https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/utils/dataBinding.ts) (Data binding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor["Editor runtime"]
  node_blockeditor["Block editor<br/>[index.vue]"]
  node_grid["Grid layout<br/>[useGridstack.ts]"]
  node_blockui["Block controls"]
  node_blockviews["Block renderers"]
  node_settings["Block settings<br/>[BoxSettings.vue]"]
  node_i18n["Localization<br/>[useEditorI18n.ts]"]
  node_editorlogic["Editor state<br/>[useBlockEditor.ts]"]
end

subgraph group_model["Content model"]
  node_content["Content container<br/>[Content.ts]"]
  node_boxmodels["Typed blocks"]
  node_factory["Block factory<br/>[BoxFactory.ts]"]
  node_items["Nested items<br/>[TreeNode.ts]"]
  node_templates["Templates"]
end

subgraph group_forms["Forms and binding"]
  node_formfields["Form fields"]
  node_binding["Data binding<br/>[dataBinding.ts]"]
  node_fieldviews["Field renderers"]
end

subgraph group_extensions["Rich text and integrations"]
  node_richtext["Rich text"]
  node_canvas["Canvas drawing"]
  node_external["External service block"]
end

node_user(("Editor user"))
node_gridstack["Gridstack"]
node_shiki["Shiki"]
node_tiptap["TipTap"]
node_konva["Konva"]

node_user -->|"edits content"| node_blockeditor
node_blockeditor -->|"uses state"| node_editorlogic
node_blockeditor -->|"configures layout"| node_grid
node_grid -->|"initializes grid"| node_gridstack
node_blockeditor -.->|"renders controls"| node_blockui
node_blockeditor -.->|"renders blocks"| node_blockviews
node_blockeditor -->|"offers settings"| node_settings
node_blockeditor -->|"provides locale"| node_i18n
node_blockeditor -->|"edits model"| node_content
node_content -->|"deserializes via"| node_factory
node_factory -->|"creates types"| node_boxmodels
node_content -->|"stores blocks"| node_boxmodels
node_boxmodels -->|"holds nested items"| node_items
node_items -->|"contains nested content"| node_content
node_blockviews -.->|"renders form blocks"| node_fieldviews
node_fieldviews -.->|"edits values"| node_formfields
node_blockeditor -->|"exposes data actions"| node_binding
node_binding -->|"walks content"| node_content
node_binding -->|"reads and fills"| node_formfields
node_blockviews -.->|"renders text editor"| node_richtext
node_richtext -->|"uses editor"| node_tiptap
node_blockviews -.->|"renders canvas"| node_canvas
node_canvas -->|"draws with"| node_konva
node_blockviews -->|"highlights code"| node_shiki
node_blockviews -.->|"supports template content"| node_templates
node_blockviews -.->|"renders service block"| node_external

click node_blockeditor "https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/components/block-editor/index.vue"
click node_grid "https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/composables/useGridstack.ts"
click node_blockui "https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor"
click node_blockviews "https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor/boxes"
click node_settings "https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/components/block-editor/settings/BoxSettings.vue"
click node_i18n "https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/composables/useEditorI18n.ts"
click node_editorlogic "https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/composables/useBlockEditor.ts"
click node_content "https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/content/Content.ts"
click node_boxmodels "https://github.com/hades0050/nuxt-block-editor/tree/main/src/model/boxes"
click node_factory "https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/factory/BoxFactory.ts"
click node_items "https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/items/TreeNode.ts"
click node_templates "https://github.com/hades0050/nuxt-block-editor/tree/main/src/model/template"
click node_formfields "https://github.com/hades0050/nuxt-block-editor/tree/main/src/model/form-values"
click node_binding "https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/utils/dataBinding.ts"
click node_fieldviews "https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor/boxes/data"
click node_richtext "https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor/boxes/content/text"
click node_canvas "https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor/boxes/media/canvas"
click node_external "https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/components/block-editor/boxes/structure/ExternalService.vue"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_blockeditor,node_grid,node_blockui,node_blockviews,node_settings,node_i18n,node_editorlogic,node_user toneBlue
class node_content,node_boxmodels,node_factory,node_items,node_templates toneAmber
class node_formfields,node_binding,node_fieldviews toneMint
class node_richtext,node_canvas,node_external toneRose
class node_gridstack,node_shiki,node_tiptap,node_konva toneIndigo
```

## Components

### Editor runtime

- [Block editor](https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/components/block-editor/index.vue): `src/runtime/components/block-editor/index.vue`
- [Grid layout](https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/composables/useGridstack.ts): `src/runtime/composables/useGridstack.ts`
- [Block controls](https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor): `src/runtime/components/block-editor`
- [Block renderers](https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor/boxes): `src/runtime/components/block-editor/boxes`
- [Block settings](https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/components/block-editor/settings/BoxSettings.vue): `src/runtime/components/block-editor/settings/BoxSettings.vue`
- [Localization](https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/composables/useEditorI18n.ts): `src/runtime/composables/useEditorI18n.ts`
- [Editor state](https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/composables/useBlockEditor.ts): `src/runtime/composables/useBlockEditor.ts`

### Content model

- [Content container](https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/content/Content.ts): `src/model/content/Content.ts`
- [Typed blocks](https://github.com/hades0050/nuxt-block-editor/tree/main/src/model/boxes): `src/model/boxes`
- [Block factory](https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/factory/BoxFactory.ts): `src/model/factory/BoxFactory.ts`
- [Nested items](https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/items/TreeNode.ts): `src/model/items/TreeNode.ts`
- [Templates](https://github.com/hades0050/nuxt-block-editor/tree/main/src/model/template): `src/model/template`

### Forms and binding

- [Form fields](https://github.com/hades0050/nuxt-block-editor/tree/main/src/model/form-values): `src/model/form-values`
- [Data binding](https://github.com/hades0050/nuxt-block-editor/blob/main/src/model/utils/dataBinding.ts): `src/model/utils/dataBinding.ts`
- [Field renderers](https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor/boxes/data): `src/runtime/components/block-editor/boxes/data`

### Rich text and integrations

- [Rich text](https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor/boxes/content/text): `src/runtime/components/block-editor/boxes/content/text`
- [Canvas drawing](https://github.com/hades0050/nuxt-block-editor/tree/main/src/runtime/components/block-editor/boxes/media/canvas): `src/runtime/components/block-editor/boxes/media/canvas`
- [External service block](https://github.com/hades0050/nuxt-block-editor/blob/main/src/runtime/components/block-editor/boxes/structure/ExternalService.vue): `src/runtime/components/block-editor/boxes/structure/ExternalService.vue`

### Other components

- **Editor user**
- **Gridstack**
- **Shiki**
- **TipTap**
- **Konva**

## Connections

- Editor user → Block editor: edits content
- Block editor → Editor state: uses state (evidence: `src/runtime/components/block-editor/index.vue`)
- Block editor → Grid layout: configures layout (evidence: `src/runtime/components/block-editor/index.vue`)
- Grid layout → Gridstack: initializes grid (evidence: `src/runtime/composables/useGridstack.ts`)
- Block editor → Block controls: renders controls
- Block editor → Block renderers: renders blocks
- Block editor → Block settings: offers settings (evidence: `src/runtime/components/block-editor/settings/BoxSettings.vue`)
- Block editor → Localization: provides locale (evidence: `src/runtime/components/block-editor/index.vue`)
- Block editor → Content container: edits model
- Content container → Block factory: deserializes via (evidence: `src/model/content/Content.ts`)
- Block factory → Typed blocks: creates types (evidence: `src/model/factory/BoxFactory.ts`)
- Content container → Typed blocks: stores blocks (evidence: `src/model/content/Content.ts`)
- Typed blocks → Nested items: holds nested items (evidence: `src/model/boxes/BoxTabs.ts`)
- Nested items → Content container: contains nested content (evidence: `src/model/items/TreeNode.ts`)
- Block renderers → Field renderers: renders form blocks
- Field renderers → Form fields: edits values
- Block editor → Data binding: exposes data actions
- Data binding → Content container: walks content (evidence: `src/model/utils/dataBinding.ts`)
- Data binding → Form fields: reads and fills (evidence: `src/model/utils/dataBinding.ts`)
- Block renderers → Rich text: renders text editor
- Rich text → TipTap: uses editor
- Block renderers → Canvas drawing: renders canvas (evidence: `src/runtime/components/block-editor/boxes/media/canvas/useCanvasDraw.ts`)
- Canvas drawing → Konva: draws with
- Block renderers → Shiki: highlights code
- Block renderers → Templates: supports template content
- Block renderers → External service block: renders service block
