@mermaid-wysiwyg/codemirror
v0.1.0
Published
CodeMirror 6 binding for mermaid-wysiwyg: two-way code sync, entity highlight decorations, shared undo authority.
Maintainers
Readme
@mermaid-wysiwyg/codemirror
CodeMirror 6 pane for mermaid-wysiwyg: two-way sync with the editing engine (canvas changes apply as exact minimal edits), entity selection as decorations, caret → entity selection, mermaid syntax highlighting, and ⌘Z routed to the engine's unified history — the same undo stack the canvas uses.
import { MermaidWysiwygEditor } from '@mermaid-wysiwyg/core'
import { MermaidCodeMirror } from '@mermaid-wysiwyg/codemirror'
const editor = new MermaidWysiwygEditor({ code: 'flowchart TD\n A --> B' })
new MermaidCodeMirror(hostElement, editor)