# Three editor integrations

Share the workbench and renderer while structured document and Markdown hosts own persistence.

Neither the standalone renderer nor the workbench depends on these products. Classic, Block and MSFE / MD Editor integrate the same public functionality; each product owns its document format and persistence.

| Host | Integration | Persisted content |
| --- | --- | --- |
| Classic | Insertion entry from `@quirekit/classic-text-diagram` | Complete object in a `textDiagram` atom, with source and PNG |
| Block | Default preset installs `@quirekit/extension-text-diagram`; block insertion opens the workbench | The same structured node |
| MSFE / MD Editor | `Mermaid` / `TextDiagrams` own fences; MD Editor adds the dialog | Standard `mermaid`, `plantuml` / `puml`, `dot` / `graphviz` fences |

## Classic and Block

`@quirekit/extension-text-diagram` provides the schema, commands, mapped editing target and preview. `@quirekit/classic-text-diagram` adds Classic toolbar wiring. Block's preset already provides the host dialog callback; set the preset's `textDiagram: false` to disable it.

Each host commits through document commands as one undoable action. Cancelling leaves content unchanged. Deletion, read-only changes or baseline conflicts reject stale saves and keep the draft. Never edit node-view DOM directly from the workbench.

Editor integrations have their own license tiers: the text-diagram Canvas extension is AGPL and the Classic integration is a QuireKit commercial component. The independent renderer and workbench remain MIT.

## MSFE and MD Editor

Standalone MSFE hosts install `Mermaid` and `TextDiagrams` from `@quirekit/msfe-markdown-extras`. The first owns `mermaid`; the second owns PlantUML and DOT aliases. Unknown DSLs remain source, without engine guessing.

MD Editor installs these by default. Insert → Text diagram opens the workbench. `features.extras.mermaid` and `features.extras.textDiagram` control the two groups separately. Saving produces standard fences; editing fence source in the host also updates the preview.

The [MSFE diagrams guide](http://127.0.0.1:3210/en/extensions/diagrams) owns fences, configuration and the custom ECharts example. [MD Editor integration](http://127.0.0.1:3210/en/guide/md-editor) covers product configuration. These are fixed-port local preview links.

## Export boundaries

Preview images can participate in fixed layout. Structured Word export displays PNG and retains source through controlled metadata. It does not create native editable Word UML shapes or connectors. Re-editing depends on retaining that metadata; plain PNG cannot recover its original source. Markdown export conversion remains the owning product's responsibility.
