@diagrammo/dgmo 0.8.20 → 0.8.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/cli.cjs +92 -90
  2. package/dist/editor.cjs +13 -1
  3. package/dist/editor.cjs.map +1 -1
  4. package/dist/editor.js +13 -1
  5. package/dist/editor.js.map +1 -1
  6. package/dist/highlight.cjs +13 -1
  7. package/dist/highlight.cjs.map +1 -1
  8. package/dist/highlight.js +13 -1
  9. package/dist/highlight.js.map +1 -1
  10. package/dist/index.cjs +4144 -940
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +318 -84
  13. package/dist/index.d.ts +318 -84
  14. package/dist/index.js +4132 -938
  15. package/dist/index.js.map +1 -1
  16. package/docs/guide/chart-mindmap.md +198 -0
  17. package/docs/guide/chart-sequence.md +23 -1
  18. package/docs/guide/chart-wireframe.md +100 -0
  19. package/docs/guide/index.md +8 -0
  20. package/docs/language-reference.md +137 -2
  21. package/package.json +1 -1
  22. package/src/boxes-and-lines/collapse.ts +21 -3
  23. package/src/boxes-and-lines/layout.ts +51 -9
  24. package/src/boxes-and-lines/parser.ts +8 -1
  25. package/src/boxes-and-lines/renderer.ts +121 -23
  26. package/src/boxes-and-lines/types.ts +1 -0
  27. package/src/completion.ts +26 -0
  28. package/src/d3.ts +153 -32
  29. package/src/dgmo-router.ts +6 -0
  30. package/src/editor/keywords.ts +12 -0
  31. package/src/graph/layout.ts +73 -9
  32. package/src/graph/state-collapse.ts +78 -0
  33. package/src/graph/state-renderer.ts +139 -34
  34. package/src/index.ts +28 -0
  35. package/src/kanban/renderer.ts +303 -57
  36. package/src/mindmap/collapse.ts +88 -0
  37. package/src/mindmap/layout.ts +605 -0
  38. package/src/mindmap/parser.ts +379 -0
  39. package/src/mindmap/renderer.ts +543 -0
  40. package/src/mindmap/text-wrap.ts +207 -0
  41. package/src/mindmap/types.ts +55 -0
  42. package/src/render.ts +18 -21
  43. package/src/sequence/renderer.ts +129 -18
  44. package/src/sharing.ts +2 -0
  45. package/src/sitemap/layout.ts +35 -12
  46. package/src/utils/export-container.ts +3 -2
  47. package/src/utils/legend-d3.ts +1 -0
  48. package/src/utils/legend-layout.ts +2 -2
  49. package/src/utils/parsing.ts +2 -0
  50. package/src/wireframe/layout.ts +460 -0
  51. package/src/wireframe/parser.ts +956 -0
  52. package/src/wireframe/renderer.ts +1293 -0
  53. package/src/wireframe/types.ts +110 -0
package/dist/index.d.cts CHANGED
@@ -88,6 +88,84 @@ declare function parseInArrowLabel(rawLabel: string, lineNumber: number): ParseI
88
88
  */
89
89
  declare function matchColorParens(content: string): string | null;
90
90
 
91
+ /**
92
+ * Compact view state schema (ADR-6).
93
+ * All fields optional. Only non-default values are encoded.
94
+ * `tag: null` means "user chose none"; absent `tag` means "use DSL default" (ADR-5).
95
+ */
96
+ interface CompactViewState {
97
+ tag?: string | null;
98
+ cs?: number[];
99
+ cg?: string[];
100
+ swim?: string | null;
101
+ cl?: string[];
102
+ cc?: string[];
103
+ rm?: string;
104
+ htv?: Record<string, string[]>;
105
+ ha?: string[];
106
+ enl?: number[];
107
+ sem?: boolean;
108
+ cm?: boolean;
109
+ c4l?: string;
110
+ c4s?: string;
111
+ c4c?: string;
112
+ rps?: number;
113
+ spd?: number;
114
+ io?: Record<string, number>;
115
+ hd?: boolean;
116
+ cbd?: boolean;
117
+ }
118
+ interface DecodedDiagramUrl {
119
+ dsl: string;
120
+ viewState: CompactViewState;
121
+ palette?: string;
122
+ theme?: 'light' | 'dark';
123
+ filename?: string;
124
+ }
125
+ interface EncodeDiagramUrlOptions {
126
+ baseUrl?: string;
127
+ viewState?: CompactViewState;
128
+ palette?: string;
129
+ theme?: 'light' | 'dark';
130
+ filename?: string;
131
+ }
132
+ type EncodeDiagramUrlResult = {
133
+ url: string;
134
+ error?: undefined;
135
+ } | {
136
+ url?: undefined;
137
+ error: 'too-large';
138
+ compressedSize: number;
139
+ limit: number;
140
+ };
141
+ /**
142
+ * Encode a CompactViewState to a compressed string for URL embedding.
143
+ * Returns empty string if state has no keys (ADR-4).
144
+ */
145
+ declare function encodeViewState(state: CompactViewState): string;
146
+ /**
147
+ * Decode a compressed view state string back to CompactViewState.
148
+ * Returns empty object on failure (no crash).
149
+ */
150
+ declare function decodeViewState(encoded: string): CompactViewState;
151
+ /**
152
+ * Compress a DGMO DSL string into a shareable URL.
153
+ * Returns `{ url }` on success, or `{ error: 'too-large', compressedSize, limit }` if the
154
+ * compressed payload exceeds the 8 KB limit.
155
+ */
156
+ declare function encodeDiagramUrl(dsl: string, options?: EncodeDiagramUrlOptions): EncodeDiagramUrlResult;
157
+ /**
158
+ * Decode a DGMO DSL string and view state from a URL query string or hash.
159
+ * Accepts any of:
160
+ * - `?dgmo=<payload>&vs=<state>`
161
+ * - `#dgmo=<payload>&vs=<state>` (backwards compat)
162
+ * - `dgmo=<payload>`
163
+ * - `<bare payload>`
164
+ *
165
+ * Returns `{ dsl, viewState }`. The DSL is empty string on invalid input.
166
+ */
167
+ declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
168
+
91
169
  /**
92
170
  * Render DGMO source to an SVG string.
93
171
  *
@@ -120,6 +198,8 @@ declare function render(content: string, options?: {
120
198
  activeGroup?: string;
121
199
  hiddenAttributes?: string[];
122
200
  };
201
+ /** View state for export — controls interactive state (collapse, swimlanes, etc.) */
202
+ viewState?: CompactViewState;
123
203
  }): Promise<{
124
204
  svg: string;
125
205
  diagnostics: DgmoError[];
@@ -244,6 +324,13 @@ declare function tint(hex: string, amount: number): string;
244
324
  * amount: 0 = original, 1 = base
245
325
  */
246
326
  declare function shade(hex: string, base: string, amount: number): string;
327
+ /**
328
+ * Blend two hex colors by percentage.
329
+ * `pct` = 0 → 100% of `b`, `pct` = 100 → 100% of `a`.
330
+ *
331
+ * Used by all renderers for tinted fills and strokes.
332
+ */
333
+ declare function mix(a: string, b: string, pct: number): string;
247
334
  /**
248
335
  * Pick a text color that contrasts against `bg`.
249
336
  * Returns `darkText` when background is light (luminance > 0.179),
@@ -886,12 +973,7 @@ declare function renderQuadrant(container: HTMLDivElement, parsed: ParsedVisuali
886
973
  * Renders a D3 chart to an SVG string for export.
887
974
  * Creates a detached DOM element, renders into it, extracts the SVG, then cleans up.
888
975
  */
889
- declare function renderForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette?: PaletteColors, orgExportState?: {
890
- collapsedNodes?: Set<string>;
891
- activeTagGroup?: string | null;
892
- hiddenAttributes?: Set<string>;
893
- swimlaneTagGroup?: string | null;
894
- }, options?: {
976
+ declare function renderForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette?: PaletteColors, viewState?: CompactViewState, options?: {
895
977
  c4Level?: 'context' | 'containers' | 'components' | 'deployment';
896
978
  c4System?: string;
897
979
  c4Container?: string;
@@ -1187,11 +1269,18 @@ interface LayoutGroup {
1187
1269
  label: string;
1188
1270
  color?: string;
1189
1271
  lineNumber: number;
1272
+ collapsed?: boolean;
1190
1273
  x: number;
1191
1274
  y: number;
1192
1275
  width: number;
1193
1276
  height: number;
1194
1277
  }
1278
+ interface LayoutOptions {
1279
+ /** Map of group ID → number of child nodes (for collapsed groups) */
1280
+ collapsedChildCounts?: Map<string, number>;
1281
+ /** Original groups before collapse (includes collapsed ones) */
1282
+ originalGroups?: GraphGroup[];
1283
+ }
1195
1284
  interface LayoutResult {
1196
1285
  nodes: LayoutNode[];
1197
1286
  edges: LayoutEdge[];
@@ -1199,7 +1288,7 @@ interface LayoutResult {
1199
1288
  width: number;
1200
1289
  height: number;
1201
1290
  }
1202
- declare function layoutGraph(graph: ParsedGraph): LayoutResult;
1291
+ declare function layoutGraph(graph: ParsedGraph, options?: LayoutOptions): LayoutResult;
1203
1292
 
1204
1293
  declare function renderState(container: HTMLDivElement, graph: ParsedGraph, layout: LayoutResult, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: {
1205
1294
  width?: number;
@@ -1207,6 +1296,23 @@ declare function renderState(container: HTMLDivElement, graph: ParsedGraph, layo
1207
1296
  }): void;
1208
1297
  declare function renderStateForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
1209
1298
 
1299
+ interface StateCollapseResult {
1300
+ parsed: ParsedGraph;
1301
+ collapsedChildCounts: Map<string, number>;
1302
+ originalGroups: GraphGroup[];
1303
+ }
1304
+ /**
1305
+ * Pure transform: returns a new ParsedGraph with collapsed groups
1306
+ * removed from the diagram content.
1307
+ *
1308
+ * - Children of collapsed groups removed from nodes
1309
+ * - Edges redirected: endpoints in collapsed groups → group ID
1310
+ * - Internal edges (both in same collapsed group) dropped
1311
+ * - Duplicate edges (same source, target, label) deduplicated
1312
+ * - Collapsed groups removed from groups[] (layout handles as nodes)
1313
+ */
1314
+ declare function collapseStateGroups(parsed: ParsedGraph, collapsedGroups: Set<string>): StateCollapseResult;
1315
+
1210
1316
  type ClassModifier = 'abstract' | 'interface' | 'enum';
1211
1317
  type MemberVisibility = 'public' | 'private' | 'protected';
1212
1318
  type RelationshipType = 'extends' | 'implements' | 'composes' | 'aggregates' | 'depends' | 'associates';
@@ -1539,6 +1645,9 @@ interface KanbanInteractiveOptions {
1539
1645
  activeTagGroup?: string | null;
1540
1646
  currentSwimlaneGroup?: string | null;
1541
1647
  onSwimlaneChange?: (group: string | null) => void;
1648
+ collapsedLanes?: Set<string>;
1649
+ collapsedColumns?: Set<string>;
1650
+ compactMeta?: boolean;
1542
1651
  }
1543
1652
  declare function renderKanban(container: HTMLElement, parsed: ParsedKanban, palette: PaletteColors, isDark: boolean, options?: KanbanInteractiveOptions): void;
1544
1653
  declare function renderKanbanForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
@@ -1739,6 +1848,7 @@ interface BLGroup {
1739
1848
  children: string[];
1740
1849
  lineNumber: number;
1741
1850
  metadata: Record<string, string>;
1851
+ parentGroup?: string;
1742
1852
  }
1743
1853
  interface ParsedBoxesAndLines {
1744
1854
  type: 'boxes-and-lines';
@@ -1820,6 +1930,7 @@ declare function renderBoxesAndLinesForExport(container: HTMLDivElement, parsed:
1820
1930
  height: number;
1821
1931
  };
1822
1932
  activeTagGroup?: string | null;
1933
+ hiddenTagValues?: Map<string, Set<string>>;
1823
1934
  }): void;
1824
1935
 
1825
1936
  interface BLCollapseResult {
@@ -2466,6 +2577,205 @@ interface CollapsedOrgResult {
2466
2577
  }
2467
2578
  declare function collapseOrgTree(original: ParsedOrg, collapsedIds: Set<string>): CollapsedOrgResult;
2468
2579
 
2580
+ interface MindmapNode {
2581
+ id: string;
2582
+ label: string;
2583
+ description?: string;
2584
+ metadata: Record<string, string>;
2585
+ children: MindmapNode[];
2586
+ parentId: string | null;
2587
+ lineNumber: number;
2588
+ color?: string;
2589
+ collapsed?: boolean;
2590
+ }
2591
+ interface ParsedMindmap {
2592
+ title: string | null;
2593
+ titleLineNumber: number | null;
2594
+ roots: MindmapNode[];
2595
+ tagGroups: TagGroup[];
2596
+ options: Record<string, string>;
2597
+ diagnostics: DgmoError[];
2598
+ error: string | null;
2599
+ }
2600
+ interface MindmapLayoutNode {
2601
+ id: string;
2602
+ label: string;
2603
+ description?: string;
2604
+ metadata: Record<string, string>;
2605
+ lineNumber: number;
2606
+ color?: string;
2607
+ x: number;
2608
+ y: number;
2609
+ width: number;
2610
+ height: number;
2611
+ depth: number;
2612
+ angle: number;
2613
+ radius: number;
2614
+ hiddenCount?: number;
2615
+ hasChildren?: boolean;
2616
+ }
2617
+ interface MindmapLayoutEdge {
2618
+ sourceId: string;
2619
+ targetId: string;
2620
+ path: string;
2621
+ }
2622
+ interface MindmapLayoutResult {
2623
+ nodes: MindmapLayoutNode[];
2624
+ edges: MindmapLayoutEdge[];
2625
+ width: number;
2626
+ height: number;
2627
+ }
2628
+
2629
+ declare function parseMindmap(content: string, palette?: PaletteColors): ParsedMindmap;
2630
+
2631
+ declare function layoutMindmap(parsed: ParsedMindmap, palette: PaletteColors, options?: {
2632
+ interactive?: boolean;
2633
+ hiddenCounts?: Map<string, number>;
2634
+ activeTagGroup?: string | null;
2635
+ hideDescriptions?: boolean;
2636
+ }): MindmapLayoutResult;
2637
+
2638
+ declare function renderMindmap(container: HTMLDivElement, parsed: ParsedMindmap, layout: MindmapLayoutResult, palette: PaletteColors, isDark: boolean, onClickItem?: (lineNumber: number) => void, exportDims?: {
2639
+ width?: number;
2640
+ height?: number;
2641
+ }, onToggleNode?: (nodeId: string) => void, hideDescriptions?: boolean, activeTagGroup?: string | null, options?: {
2642
+ colorByDepth?: boolean;
2643
+ onToggleColorByDepth?: (active: boolean) => void;
2644
+ onToggleDescriptions?: (active: boolean) => void;
2645
+ controlsExpanded?: boolean;
2646
+ onToggleControlsExpand?: () => void;
2647
+ }): void;
2648
+ declare function renderMindmapForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
2649
+
2650
+ interface CollapsedMindmapResult {
2651
+ /** Roots with collapsed subtrees pruned (deep-cloned, never mutates original) */
2652
+ roots: MindmapNode[];
2653
+ /** nodeId → count of hidden descendants */
2654
+ hiddenCounts: Map<string, number>;
2655
+ }
2656
+ declare function collapseMindmapTree(roots: MindmapNode[], collapsedIds: Set<string>): CollapsedMindmapResult;
2657
+
2658
+ /**
2659
+ * All wireframe element types.
2660
+ * Visual-mnemonic elements are inferred from bracket syntax;
2661
+ * keyword elements use a small vocabulary (9 keywords).
2662
+ */
2663
+ type WireframeElementType = 'group' | 'textInput' | 'button' | 'dropdown' | 'checkbox' | 'radio' | 'heading' | 'divider' | 'text' | 'listItem' | 'nav' | 'tabs' | 'table' | 'image' | 'modal' | 'skeleton' | 'alert' | 'progress' | 'chart';
2664
+ /**
2665
+ * Single flat interface for all wireframe elements (ADR-8).
2666
+ * No separate WireframeGroup — all elements carry group fields
2667
+ * with sensible defaults (isContainer=false, orientation='vertical', isSkeleton=false).
2668
+ */
2669
+ interface WireframeElement {
2670
+ id: string;
2671
+ type: WireframeElementType;
2672
+ /** Display label / placeholder text / heading text */
2673
+ label: string;
2674
+ /** Child elements (non-empty only when isContainer=true) */
2675
+ children: WireframeElement[];
2676
+ /** Pipe metadata key-value pairs */
2677
+ metadata: Record<string, string>;
2678
+ /** State keywords: disabled, active, ghost, destructive, etc. */
2679
+ states: string[];
2680
+ /** Free-text annotations from pipe metadata */
2681
+ annotations: string[];
2682
+ /** 1-based line number in source */
2683
+ lineNumber: number;
2684
+ /** Measured indentation (column) */
2685
+ indent: number;
2686
+ /** True when element has children (set during parse via indent stack) */
2687
+ isContainer: boolean;
2688
+ /** Stacking direction for group children */
2689
+ orientation: 'vertical' | 'horizontal';
2690
+ /** True when inside a skeleton block */
2691
+ isSkeleton: boolean;
2692
+ /** Heading level: 1 for `#`, 2 for `##` */
2693
+ headingLevel?: number;
2694
+ /** Dropdown options (for type='dropdown') */
2695
+ options?: string[];
2696
+ /** Checked state (for type='checkbox') */
2697
+ checked?: boolean;
2698
+ /** Selected state (for type='radio') */
2699
+ selected?: boolean;
2700
+ /** Image hint: 'default' | 'round' | 'wide' */
2701
+ imageHint?: 'default' | 'round' | 'wide';
2702
+ /** Progress value 0-100 (for type='progress') */
2703
+ progressValue?: number;
2704
+ /** Chart hint: 'line' | 'bar' | 'pie' */
2705
+ chartHint?: 'line' | 'bar' | 'pie';
2706
+ /** Table dimensions for skeleton shorthand (for type='table') */
2707
+ tableRows?: number;
2708
+ tableCols?: number;
2709
+ /** Table header row labels (for type='table') */
2710
+ tableHeaders?: string[];
2711
+ /** Table data rows — each row is an array of cell content strings (for type='table') */
2712
+ tableData?: string[][];
2713
+ /** Inline elements on the same line (multi-element line) */
2714
+ inlineElements?: WireframeElement[];
2715
+ /** Label element for label-field pairing */
2716
+ labelFor?: WireframeElement;
2717
+ /** Color from tag system */
2718
+ color?: string;
2719
+ /** Field variant: password, textarea */
2720
+ fieldVariant?: 'password' | 'textarea';
2721
+ }
2722
+ /** Form factor / layout mode */
2723
+ type WireframeFormFactor = 'desktop' | 'mobile';
2724
+ interface ParsedWireframe {
2725
+ title: string | null;
2726
+ titleLineNumber: number | null;
2727
+ formFactor: WireframeFormFactor;
2728
+ /** Top-level elements (roots of the hierarchy) */
2729
+ roots: WireframeElement[];
2730
+ /** Modal elements (rendered separately below main) */
2731
+ modals: WireframeElement[];
2732
+ tagGroups: TagGroup[];
2733
+ options: Record<string, string>;
2734
+ diagnostics: DgmoError[];
2735
+ error: string | null;
2736
+ }
2737
+
2738
+ declare function parseWireframe(content: string): ParsedWireframe;
2739
+
2740
+ interface WireframeLayoutNode {
2741
+ id: string;
2742
+ x: number;
2743
+ y: number;
2744
+ width: number;
2745
+ height: number;
2746
+ element: WireframeElement;
2747
+ children: WireframeLayoutNode[];
2748
+ /** For label-field pairs: the x offset where fields align */
2749
+ fieldAlignX?: number;
2750
+ }
2751
+ interface WireframeLayout {
2752
+ width: number;
2753
+ height: number;
2754
+ titleHeight: number;
2755
+ nodes: WireframeLayoutNode[];
2756
+ modalNodes: WireframeLayoutNode[];
2757
+ }
2758
+ declare function layoutWireframe(parsed: ParsedWireframe, _options?: Record<string, string>, overrideWidth?: number, showGroupLabels?: boolean): WireframeLayout;
2759
+
2760
+ interface WireframeRenderOptions {
2761
+ exportDims?: {
2762
+ width?: number;
2763
+ height?: number;
2764
+ };
2765
+ theme?: string;
2766
+ onClickItem?: (lineNumber: number) => void;
2767
+ /** Controls group state */
2768
+ controlsExpanded?: boolean;
2769
+ fitWidth?: boolean;
2770
+ showGroupLabels?: boolean;
2771
+ onControlsExpand?: () => void;
2772
+ onControlsToggle?: (id: string, active: boolean) => void;
2773
+ }
2774
+ declare function renderWireframe(container: HTMLDivElement, parsed: ParsedWireframe, layout: WireframeLayout, palette: PaletteColors, isDark: boolean, _onClickItem?: (lineNumber: number) => void, exportDims?: {
2775
+ width?: number;
2776
+ height?: number;
2777
+ }, theme?: string, options?: WireframeRenderOptions): void;
2778
+
2469
2779
  /**
2470
2780
  * Async or sync file reader. Receives an absolute path, returns content.
2471
2781
  * Throwing means "file not found".
@@ -2649,82 +2959,6 @@ declare function resolveColorWithDiagnostic(color: string, line: number, diagnos
2649
2959
  /** @deprecated Use getSeriesColors(palette) from '@/lib/palettes' instead. */
2650
2960
  declare const seriesColors: string[];
2651
2961
 
2652
- /**
2653
- * Compact view state schema (ADR-6).
2654
- * All fields optional. Only non-default values are encoded.
2655
- * `tag: null` means "user chose none"; absent `tag` means "use DSL default" (ADR-5).
2656
- */
2657
- interface CompactViewState {
2658
- tag?: string | null;
2659
- cs?: number[];
2660
- cg?: string[];
2661
- swim?: string | null;
2662
- cl?: string[];
2663
- cc?: string[];
2664
- rm?: string;
2665
- htv?: Record<string, string[]>;
2666
- ha?: string[];
2667
- enl?: number[];
2668
- sem?: boolean;
2669
- cm?: boolean;
2670
- c4l?: string;
2671
- c4s?: string;
2672
- c4c?: string;
2673
- rps?: number;
2674
- spd?: number;
2675
- io?: Record<string, number>;
2676
- }
2677
- interface DecodedDiagramUrl {
2678
- dsl: string;
2679
- viewState: CompactViewState;
2680
- palette?: string;
2681
- theme?: 'light' | 'dark';
2682
- filename?: string;
2683
- }
2684
- interface EncodeDiagramUrlOptions {
2685
- baseUrl?: string;
2686
- viewState?: CompactViewState;
2687
- palette?: string;
2688
- theme?: 'light' | 'dark';
2689
- filename?: string;
2690
- }
2691
- type EncodeDiagramUrlResult = {
2692
- url: string;
2693
- error?: undefined;
2694
- } | {
2695
- url?: undefined;
2696
- error: 'too-large';
2697
- compressedSize: number;
2698
- limit: number;
2699
- };
2700
- /**
2701
- * Encode a CompactViewState to a compressed string for URL embedding.
2702
- * Returns empty string if state has no keys (ADR-4).
2703
- */
2704
- declare function encodeViewState(state: CompactViewState): string;
2705
- /**
2706
- * Decode a compressed view state string back to CompactViewState.
2707
- * Returns empty object on failure (no crash).
2708
- */
2709
- declare function decodeViewState(encoded: string): CompactViewState;
2710
- /**
2711
- * Compress a DGMO DSL string into a shareable URL.
2712
- * Returns `{ url }` on success, or `{ error: 'too-large', compressedSize, limit }` if the
2713
- * compressed payload exceeds the 8 KB limit.
2714
- */
2715
- declare function encodeDiagramUrl(dsl: string, options?: EncodeDiagramUrlOptions): EncodeDiagramUrlResult;
2716
- /**
2717
- * Decode a DGMO DSL string and view state from a URL query string or hash.
2718
- * Accepts any of:
2719
- * - `?dgmo=<payload>&vs=<state>`
2720
- * - `#dgmo=<payload>&vs=<state>` (backwards compat)
2721
- * - `dgmo=<payload>`
2722
- * - `<bare payload>`
2723
- *
2724
- * Returns `{ dsl, viewState }`. The DSL is empty string on invalid input.
2725
- */
2726
- declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
2727
-
2728
2962
  /**
2729
2963
  * Shared parser utilities — extracted from individual parsers to eliminate
2730
2964
  * duplication of measureIndent, extractColor, header regexes, and
@@ -2744,4 +2978,4 @@ declare function parseFirstLine(line: string): {
2744
2978
  title: string | undefined;
2745
2979
  } | null;
2746
2980
 
2747
- export { ALL_CHART_TYPES, ARROW_DIAGNOSTIC_CODES, type Activation, type ArcLink, type ArcNodeGroup, type BLCollapseResult, type BLEdge, type BLGroup, type BLLayoutEdge, type BLLayoutGroup, type BLLayoutNode, type BLLayoutResult, type BLNode, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type CollapsedSitemapResult, type CollapsedView, type CompactViewState, type ComputedInfraEdge, type ComputedInfraModel, type ComputedInfraNode, type ContextRelationship, type D3ExportDimensions, type DecodedDiagramUrl, type DgmoError, type DgmoSeverity, type DiagramSymbols, type DirectiveSpec, type DirectiveValueSpec, type Duration, type DurationUnit, ENTITY_TYPES, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type ExtendedChartType, type ExtractFn, type GanttDependency, type GanttEra, type GanttGroup, type GroupRow as GanttGroupRow, type GanttHolidays, type GanttInteractiveOptions, type LaneHeaderRow as GanttLaneHeaderRow, type GanttMarker, type GanttNode, type GanttOptions, type GanttParallelBlock, type Row as GanttRow, type GanttTask, type TaskRow as GanttTaskRow, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, INFRA_BEHAVIOR_KEYS, type ImportSource, type InfraAvailabilityPercentiles, type InfraBehaviorKey, type InfraCbState, type InfraComputeParams, type InfraDiagnostic, type InfraEdge, type InfraGroup, type InfraLatencyPercentiles, type InfraLayoutEdge, type InfraLayoutGroup, type InfraLayoutNode, type InfraLayoutResult, type InfraLegendGroup, type InfraNode, type InfraPlaybackState, type InfraProperty, type InfraRole, type InfraTagGroup, type InlineSpan, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, LEGEND_HEIGHT, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type LegendCallbacks, type LegendConfig, type LegendControl, type LegendGroupData, type LegendHandle, type LegendLayout, type LegendMode, type LegendPalette, type LegendPosition, type LegendState, METADATA_KEY_SET, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, PIPE_METADATA, type PaletteColors, type PaletteConfig, type ParseInArrowLabelResult, type ParsedBoxesAndLines, type ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedKanban, type ParsedOrg, type ParsedSequenceDgmo, type ParsedSitemap, type ParsedVisualization, type ParticipantType, type PipeKeySpec, RECOGNIZED_COLOR_NAMES, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderCategory, type RenderStep, type ResolveImportsResult, type ResolvedGroup, type ResolvedSchedule, type ResolvedTask, type ScatterLabelPoint, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, type SitemapContainerBounds, type SitemapDirection, type SitemapEdge, type SitemapLayoutEdge, type SitemapLayoutNode, type SitemapLayoutResult, type SitemapLegendEntry, type SitemapLegendGroup, type SitemapNode, type TagEntry, type TagGroup, type VisualizationType, addDurationToDate, applyCollapseProjection, applyGroupOrdering, applyPositionOverrides, boldPalette, buildExtendedChartOption, buildNoteMessageMap, buildRenderSequence, buildSimpleChartOption, buildTagLaneRowList, calculateSchedule, catppuccinPalette, collapseBoxesAndLines, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeLegendLayout, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, decodeViewState, draculaPalette, encodeDiagramUrl, encodeViewState, extractDiagramSymbols, extractTagDeclarations, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getLegendReservedHeight, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, isArchiveColumn, isExtendedChartType, isRecognizedColorName, isSequenceBlock, isSequenceNote, isValidHex, layoutBoxesAndLines, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, matchColorParens, monokaiPalette, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseBoxesAndLines, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInArrowLabel, parseInfra, parseInlineMarkdown, parseKanban, parseOrg, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderBoxesAndLines, renderBoxesAndLinesForExport, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderKanban, renderKanbanForExport, renderLegendD3, renderLegendSvg, renderLegendSvgFromConfig, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSitemap, renderSitemapForExport, renderSlopeChart, renderState, renderStateForExport, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveColorWithDiagnostic, resolveOrgImports, resolveTaskName, rollUpContextRelationships, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette, truncateBareUrl, validateComputed, validateInfra, validateLabelCharacters };
2981
+ export { ALL_CHART_TYPES, ARROW_DIAGNOSTIC_CODES, type Activation, type ArcLink, type ArcNodeGroup, type BLCollapseResult, type BLEdge, type BLGroup, type BLLayoutEdge, type BLLayoutGroup, type BLLayoutNode, type BLLayoutResult, type BLNode, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedMindmapResult, type CollapsedOrgResult, type CollapsedSitemapResult, type CollapsedView, type CompactViewState, type ComputedInfraEdge, type ComputedInfraModel, type ComputedInfraNode, type ContextRelationship, type D3ExportDimensions, type DecodedDiagramUrl, type DgmoError, type DgmoSeverity, type DiagramSymbols, type DirectiveSpec, type DirectiveValueSpec, type Duration, type DurationUnit, ENTITY_TYPES, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type ExtendedChartType, type ExtractFn, type GanttDependency, type GanttEra, type GanttGroup, type GroupRow as GanttGroupRow, type GanttHolidays, type GanttInteractiveOptions, type LaneHeaderRow as GanttLaneHeaderRow, type GanttMarker, type GanttNode, type GanttOptions, type GanttParallelBlock, type Row as GanttRow, type GanttTask, type TaskRow as GanttTaskRow, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, INFRA_BEHAVIOR_KEYS, type ImportSource, type InfraAvailabilityPercentiles, type InfraBehaviorKey, type InfraCbState, type InfraComputeParams, type InfraDiagnostic, type InfraEdge, type InfraGroup, type InfraLatencyPercentiles, type InfraLayoutEdge, type InfraLayoutGroup, type InfraLayoutNode, type InfraLayoutResult, type InfraLegendGroup, type InfraNode, type InfraPlaybackState, type InfraProperty, type InfraRole, type InfraTagGroup, type InlineSpan, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, LEGEND_HEIGHT, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutOptions, type LayoutResult, type LegendCallbacks, type LegendConfig, type LegendControl, type LegendGroupData, type LegendHandle, type LegendLayout, type LegendMode, type LegendPalette, type LegendPosition, type LegendState, METADATA_KEY_SET, type MemberVisibility, type MindmapLayoutEdge, type MindmapLayoutNode, type MindmapLayoutResult, type MindmapNode, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, PIPE_METADATA, type PaletteColors, type PaletteConfig, type ParseInArrowLabelResult, type ParsedBoxesAndLines, type ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedKanban, type ParsedMindmap, type ParsedOrg, type ParsedSequenceDgmo, type ParsedSitemap, type ParsedVisualization, type ParsedWireframe, type ParticipantType, type PipeKeySpec, RECOGNIZED_COLOR_NAMES, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderCategory, type RenderStep, type ResolveImportsResult, type ResolvedGroup, type ResolvedSchedule, type ResolvedTask, type ScatterLabelPoint, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, type SitemapContainerBounds, type SitemapDirection, type SitemapEdge, type SitemapLayoutEdge, type SitemapLayoutNode, type SitemapLayoutResult, type SitemapLegendEntry, type SitemapLegendGroup, type SitemapNode, type StateCollapseResult, type TagEntry, type TagGroup, type VisualizationType, type WireframeElement, type WireframeElementType, type WireframeFormFactor, type WireframeLayout, type WireframeLayoutNode, addDurationToDate, applyCollapseProjection, applyGroupOrdering, applyPositionOverrides, boldPalette, buildExtendedChartOption, buildNoteMessageMap, buildRenderSequence, buildSimpleChartOption, buildTagLaneRowList, calculateSchedule, catppuccinPalette, collapseBoxesAndLines, collapseMindmapTree, collapseOrgTree, collapseSitemapTree, collapseStateGroups, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeLegendLayout, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, decodeViewState, draculaPalette, encodeDiagramUrl, encodeViewState, extractDiagramSymbols, extractTagDeclarations, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getLegendReservedHeight, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, isArchiveColumn, isExtendedChartType, isRecognizedColorName, isSequenceBlock, isSequenceNote, isValidHex, layoutBoxesAndLines, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutMindmap, layoutOrg, layoutSitemap, layoutWireframe, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, matchColorParens, mix, monokaiPalette, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseBoxesAndLines, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInArrowLabel, parseInfra, parseInlineMarkdown, parseKanban, parseMindmap, parseOrg, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, parseWireframe, registerExtractor, registerPalette, render, renderArcDiagram, renderBoxesAndLines, renderBoxesAndLinesForExport, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderKanban, renderKanbanForExport, renderLegendD3, renderLegendSvg, renderLegendSvgFromConfig, renderMindmap, renderMindmapForExport, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSitemap, renderSitemapForExport, renderSlopeChart, renderState, renderStateForExport, renderTimeline, renderVenn, renderWireframe, renderWordCloud, resolveColor, resolveColorWithDiagnostic, resolveOrgImports, resolveTaskName, rollUpContextRelationships, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette, truncateBareUrl, validateComputed, validateInfra, validateLabelCharacters };