@diagrammo/dgmo 0.47.0 → 0.48.0

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 (319) hide show
  1. package/dist/auto.js +1 -1
  2. package/dist/auto.mjs +1 -1
  3. package/dist/element.js +1 -1
  4. package/dist/element.mjs +1 -1
  5. package/package.json +19 -70
  6. package/dist/advanced.cjs +0 -71648
  7. package/dist/advanced.d.cts +0 -5719
  8. package/dist/auto.cjs +0 -70648
  9. package/dist/auto.d.cts +0 -54
  10. package/dist/block.cjs +0 -70208
  11. package/dist/block.d.cts +0 -115
  12. package/dist/editor.cjs +0 -526
  13. package/dist/editor.d.cts +0 -26
  14. package/dist/element.cjs +0 -70530
  15. package/dist/element.d.cts +0 -62
  16. package/dist/highlight.cjs +0 -852
  17. package/dist/highlight.d.cts +0 -49
  18. package/dist/index.cjs +0 -70491
  19. package/dist/index.d.cts +0 -160
  20. package/dist/pert.cjs +0 -325
  21. package/dist/pert.d.cts +0 -559
  22. package/dist/themes-1-CuKpeH.d.cts +0 -908
  23. package/src/advanced.ts +0 -873
  24. package/src/arc/parser.ts +0 -15
  25. package/src/arc/renderer.ts +0 -633
  26. package/src/auto/index.ts +0 -621
  27. package/src/auto/shared.ts +0 -370
  28. package/src/auto/styles.ts +0 -73
  29. package/src/block/layout.ts +0 -198
  30. package/src/block/parser.ts +0 -427
  31. package/src/block/renderer.ts +0 -484
  32. package/src/block/types.ts +0 -67
  33. package/src/boxes-and-lines/collapse.ts +0 -96
  34. package/src/boxes-and-lines/focus.ts +0 -257
  35. package/src/boxes-and-lines/label-placement.ts +0 -339
  36. package/src/boxes-and-lines/layout-grouped.ts +0 -912
  37. package/src/boxes-and-lines/layout-layered.ts +0 -722
  38. package/src/boxes-and-lines/layout-search.ts +0 -1678
  39. package/src/boxes-and-lines/layout.ts +0 -398
  40. package/src/boxes-and-lines/parser.ts +0 -1181
  41. package/src/boxes-and-lines/renderer.ts +0 -1465
  42. package/src/boxes-and-lines/types.ts +0 -66
  43. package/src/c4/layout.ts +0 -2441
  44. package/src/c4/parser.ts +0 -1158
  45. package/src/c4/renderer.ts +0 -2008
  46. package/src/c4/types.ts +0 -89
  47. package/src/chart-type-registry.ts +0 -529
  48. package/src/chart-types.ts +0 -225
  49. package/src/chart.ts +0 -685
  50. package/src/charts-d3/bar.ts +0 -338
  51. package/src/charts-d3/chord.ts +0 -140
  52. package/src/charts-d3/function.ts +0 -147
  53. package/src/charts-d3/funnel.ts +0 -104
  54. package/src/charts-d3/heatmap.ts +0 -145
  55. package/src/charts-d3/index.ts +0 -337
  56. package/src/charts-d3/interactions.ts +0 -477
  57. package/src/charts-d3/line.ts +0 -344
  58. package/src/charts-d3/mount.ts +0 -151
  59. package/src/charts-d3/pie.ts +0 -117
  60. package/src/charts-d3/polar.ts +0 -89
  61. package/src/charts-d3/radar.ts +0 -0
  62. package/src/charts-d3/sankey.ts +0 -0
  63. package/src/charts-d3/scatter.ts +0 -185
  64. package/src/charts-d3/shared.ts +0 -208
  65. package/src/class/layout.ts +0 -326
  66. package/src/class/parser.ts +0 -635
  67. package/src/class/renderer.ts +0 -793
  68. package/src/class/types.ts +0 -58
  69. package/src/cli-banner.ts +0 -106
  70. package/src/cli.ts +0 -1080
  71. package/src/colors-diagnostics.ts +0 -35
  72. package/src/colors.ts +0 -379
  73. package/src/completion-types.ts +0 -27
  74. package/src/completion.ts +0 -2668
  75. package/src/cycle/layout.ts +0 -1026
  76. package/src/cycle/parser.ts +0 -387
  77. package/src/cycle/renderer.ts +0 -653
  78. package/src/cycle/types.ts +0 -101
  79. package/src/d3.ts +0 -1434
  80. package/src/data-chart-parser.ts +0 -1007
  81. package/src/dgmo-router.ts +0 -296
  82. package/src/diagnostics-registry.ts +0 -108
  83. package/src/diagnostics.ts +0 -0
  84. package/src/dimensions.ts +0 -20
  85. package/src/directives-registry.ts +0 -396
  86. package/src/editor/dgmo.grammar +0 -76
  87. package/src/editor/dgmo.grammar.d.ts +0 -2
  88. package/src/editor/dgmo.grammar.js +0 -18
  89. package/src/editor/dgmo.grammar.terms.d.ts +0 -5
  90. package/src/editor/dgmo.grammar.terms.js +0 -35
  91. package/src/editor/highlight-api.ts +0 -596
  92. package/src/editor/highlight.ts +0 -36
  93. package/src/editor/index.ts +0 -27
  94. package/src/editor/keywords.ts +0 -128
  95. package/src/editor/tokens.ts +0 -30
  96. package/src/element/index.ts +0 -432
  97. package/src/embed/css.ts +0 -312
  98. package/src/embed/escape.ts +0 -15
  99. package/src/embed/index.ts +0 -280
  100. package/src/er/classify.ts +0 -228
  101. package/src/er/layout.ts +0 -530
  102. package/src/er/parser.ts +0 -750
  103. package/src/er/renderer.ts +0 -725
  104. package/src/er/types.ts +0 -52
  105. package/src/error-card.ts +0 -269
  106. package/src/event-line/diagnostics.ts +0 -117
  107. package/src/event-line/parser.ts +0 -643
  108. package/src/event-line/renderer.ts +0 -1742
  109. package/src/event-line/types.ts +0 -74
  110. package/src/fonts.ts +0 -3
  111. package/src/gantt/calculator.ts +0 -979
  112. package/src/gantt/parser.ts +0 -1641
  113. package/src/gantt/renderer.ts +0 -3787
  114. package/src/gantt/resolver.ts +0 -172
  115. package/src/gantt/types.ts +0 -206
  116. package/src/graph/diagnostics.ts +0 -64
  117. package/src/graph/edge-spline.ts +0 -29
  118. package/src/graph/flowchart-parser.ts +0 -759
  119. package/src/graph/flowchart-renderer.ts +0 -817
  120. package/src/graph/layout.ts +0 -472
  121. package/src/graph/notes.ts +0 -21
  122. package/src/graph/state-collapse.ts +0 -78
  123. package/src/graph/state-parser.ts +0 -574
  124. package/src/graph/state-renderer.ts +0 -653
  125. package/src/graph/types.ts +0 -65
  126. package/src/index.ts +0 -261
  127. package/src/infra/compute.ts +0 -1385
  128. package/src/infra/layout.ts +0 -888
  129. package/src/infra/parser.ts +0 -1234
  130. package/src/infra/renderer.ts +0 -2534
  131. package/src/infra/roles.ts +0 -75
  132. package/src/infra/types.ts +0 -216
  133. package/src/infra/validation.ts +0 -201
  134. package/src/journey-map/layout.ts +0 -490
  135. package/src/journey-map/parser.ts +0 -557
  136. package/src/journey-map/renderer.ts +0 -1580
  137. package/src/journey-map/types.ts +0 -47
  138. package/src/kanban/mutations.ts +0 -175
  139. package/src/kanban/parser.ts +0 -509
  140. package/src/kanban/renderer.ts +0 -1449
  141. package/src/kanban/types.ts +0 -39
  142. package/src/label-layout.ts +0 -368
  143. package/src/map/colorize.ts +0 -54
  144. package/src/map/completion.ts +0 -316
  145. package/src/map/context-labels.ts +0 -609
  146. package/src/map/data/PROVENANCE.json +0 -1
  147. package/src/map/data/README.md +0 -40
  148. package/src/map/data/airport-collisions.json +0 -1
  149. package/src/map/data/airports.json +0 -1
  150. package/src/map/data/gazetteer.json +0 -1
  151. package/src/map/data/lakes.json +0 -1
  152. package/src/map/data/mountain-ranges.json +0 -1
  153. package/src/map/data/na-lakes.json +0 -1
  154. package/src/map/data/na-land.json +0 -1
  155. package/src/map/data/region-names.json +0 -1
  156. package/src/map/data/rivers.json +0 -1
  157. package/src/map/data/types.ts +0 -121
  158. package/src/map/data/us-states.json +0 -1
  159. package/src/map/data/water-bodies.json +0 -1
  160. package/src/map/data/world-coarse.json +0 -1
  161. package/src/map/data/world-detail.json +0 -1
  162. package/src/map/diagnostics.ts +0 -134
  163. package/src/map/dimensions.ts +0 -150
  164. package/src/map/geo-query.ts +0 -295
  165. package/src/map/geo.ts +0 -438
  166. package/src/map/invert.ts +0 -111
  167. package/src/map/layout.ts +0 -5069
  168. package/src/map/legend-band.ts +0 -127
  169. package/src/map/load-data.ts +0 -186
  170. package/src/map/parser.ts +0 -783
  171. package/src/map/renderer.ts +0 -1445
  172. package/src/map/resolved-types.ts +0 -160
  173. package/src/map/resolver.ts +0 -1146
  174. package/src/map/types.ts +0 -194
  175. package/src/mindmap/collapse.ts +0 -67
  176. package/src/mindmap/layout.ts +0 -649
  177. package/src/mindmap/parser.ts +0 -430
  178. package/src/mindmap/renderer.ts +0 -637
  179. package/src/mindmap/text-wrap.ts +0 -218
  180. package/src/mindmap/types.ts +0 -56
  181. package/src/org/collapse.ts +0 -151
  182. package/src/org/layout.ts +0 -1262
  183. package/src/org/parser.ts +0 -519
  184. package/src/org/renderer.ts +0 -866
  185. package/src/org/resolver.ts +0 -636
  186. package/src/palettes/atlas.ts +0 -77
  187. package/src/palettes/blueprint.ts +0 -73
  188. package/src/palettes/catppuccin.ts +0 -84
  189. package/src/palettes/color-utils.ts +0 -443
  190. package/src/palettes/index.ts +0 -67
  191. package/src/palettes/nord.ts +0 -67
  192. package/src/palettes/registry.ts +0 -114
  193. package/src/palettes/slate.ts +0 -73
  194. package/src/palettes/tidewater.ts +0 -73
  195. package/src/palettes/tokyo-night.ts +0 -86
  196. package/src/palettes/types.ts +0 -88
  197. package/src/pert/analyzer.ts +0 -1183
  198. package/src/pert/diagnostics.ts +0 -110
  199. package/src/pert/index.ts +0 -43
  200. package/src/pert/internal.ts +0 -252
  201. package/src/pert/layout.ts +0 -971
  202. package/src/pert/monte-carlo.ts +0 -446
  203. package/src/pert/parser.ts +0 -1606
  204. package/src/pert/renderer.ts +0 -4009
  205. package/src/pert/share-normalize.ts +0 -62
  206. package/src/pert/types.ts +0 -604
  207. package/src/pyramid/parser.ts +0 -185
  208. package/src/pyramid/renderer.ts +0 -768
  209. package/src/pyramid/types.ts +0 -28
  210. package/src/quadrant/parser.ts +0 -18
  211. package/src/quadrant/renderer.ts +0 -638
  212. package/src/raci/diagnostics.ts +0 -213
  213. package/src/raci/index.ts +0 -23
  214. package/src/raci/mutations.ts +0 -321
  215. package/src/raci/parser.ts +0 -699
  216. package/src/raci/renderer.ts +0 -1627
  217. package/src/raci/types.ts +0 -82
  218. package/src/raci/variants.ts +0 -320
  219. package/src/render.ts +0 -268
  220. package/src/ring/parser.ts +0 -212
  221. package/src/ring/renderer.ts +0 -490
  222. package/src/ring/types.ts +0 -27
  223. package/src/sequence/collapse.ts +0 -174
  224. package/src/sequence/parser.ts +0 -1596
  225. package/src/sequence/participant-inference.ts +0 -152
  226. package/src/sequence/renderer.ts +0 -3168
  227. package/src/sequence/tag-resolution.ts +0 -164
  228. package/src/sharing.ts +0 -211
  229. package/src/sitemap/collapse.ts +0 -100
  230. package/src/sitemap/layout.ts +0 -925
  231. package/src/sitemap/parser.ts +0 -755
  232. package/src/sitemap/renderer.ts +0 -828
  233. package/src/sitemap/types.ts +0 -42
  234. package/src/slope/parser.ts +0 -18
  235. package/src/slope/renderer.ts +0 -378
  236. package/src/swimlane/diagnostics.ts +0 -94
  237. package/src/swimlane/layout.ts +0 -597
  238. package/src/swimlane/parser.ts +0 -613
  239. package/src/swimlane/renderer.ts +0 -681
  240. package/src/swimlane/types.ts +0 -151
  241. package/src/tech-radar/interactive.ts +0 -1129
  242. package/src/tech-radar/layout.ts +0 -197
  243. package/src/tech-radar/parser.ts +0 -436
  244. package/src/tech-radar/renderer.ts +0 -1239
  245. package/src/tech-radar/shared.ts +0 -151
  246. package/src/tech-radar/types.ts +0 -86
  247. package/src/themes.ts +0 -22
  248. package/src/timeline/parser.ts +0 -472
  249. package/src/timeline/renderer.ts +0 -3024
  250. package/src/timeline/types.ts +0 -33
  251. package/src/timeline/viz-parser.ts +0 -21
  252. package/src/treemap/diagnostics.ts +0 -62
  253. package/src/treemap/layout-radial.ts +0 -233
  254. package/src/treemap/layout.ts +0 -189
  255. package/src/treemap/parser.ts +0 -463
  256. package/src/treemap/renderer-radial.ts +0 -438
  257. package/src/treemap/renderer.ts +0 -572
  258. package/src/treemap/treemap-shared.ts +0 -309
  259. package/src/treemap/types.ts +0 -60
  260. package/src/utils/arrow-markers.ts +0 -51
  261. package/src/utils/arrows-diagnostics.ts +0 -62
  262. package/src/utils/arrows.ts +0 -227
  263. package/src/utils/brand.ts +0 -61
  264. package/src/utils/card.ts +0 -183
  265. package/src/utils/collapse-engine/tree-edges.ts +0 -115
  266. package/src/utils/collapse-engine/tree.ts +0 -117
  267. package/src/utils/d3-helpers.ts +0 -219
  268. package/src/utils/d3-types.ts +0 -9
  269. package/src/utils/description-helpers.ts +0 -38
  270. package/src/utils/duration.ts +0 -312
  271. package/src/utils/export-container.ts +0 -41
  272. package/src/utils/expr-eval.ts +0 -27
  273. package/src/utils/fit-canvas.ts +0 -64
  274. package/src/utils/hover-styles.ts +0 -673
  275. package/src/utils/inline-markdown.ts +0 -96
  276. package/src/utils/legend-constants.ts +0 -48
  277. package/src/utils/legend-d3.ts +0 -618
  278. package/src/utils/legend-integration.ts +0 -107
  279. package/src/utils/legend-layout.ts +0 -776
  280. package/src/utils/legend-svg.ts +0 -214
  281. package/src/utils/legend-types.ts +0 -272
  282. package/src/utils/name-normalize.ts +0 -163
  283. package/src/utils/note-box/constants.ts +0 -25
  284. package/src/utils/note-box/index.ts +0 -11
  285. package/src/utils/note-box/metrics.ts +0 -90
  286. package/src/utils/note-box/svg.ts +0 -331
  287. package/src/utils/notes/bounds.ts +0 -30
  288. package/src/utils/notes/build.ts +0 -131
  289. package/src/utils/notes/index.ts +0 -18
  290. package/src/utils/notes/model.ts +0 -19
  291. package/src/utils/notes/parse.ts +0 -131
  292. package/src/utils/notes/place.ts +0 -177
  293. package/src/utils/notes/resolve.ts +0 -88
  294. package/src/utils/number-format.ts +0 -36
  295. package/src/utils/parsing.ts +0 -953
  296. package/src/utils/reserved-key-registry.ts +0 -239
  297. package/src/utils/safe-href.ts +0 -38
  298. package/src/utils/scaling.ts +0 -97
  299. package/src/utils/svg-embed.ts +0 -251
  300. package/src/utils/tag-groups.ts +0 -607
  301. package/src/utils/text-measure.ts +0 -122
  302. package/src/utils/time-ticks.ts +0 -253
  303. package/src/utils/title-constants.ts +0 -24
  304. package/src/utils/visual-conventions.ts +0 -61
  305. package/src/utils/wrapped-desc.ts +0 -87
  306. package/src/venn/parser.ts +0 -18
  307. package/src/venn/renderer.ts +0 -1047
  308. package/src/version-control/diagnostics.ts +0 -67
  309. package/src/version-control/parser.ts +0 -544
  310. package/src/version-control/renderer.ts +0 -724
  311. package/src/version-control/types.ts +0 -100
  312. package/src/visualizations/parse.ts +0 -1560
  313. package/src/visualizations/types.ts +0 -262
  314. package/src/wireframe/layout.ts +0 -479
  315. package/src/wireframe/parser.ts +0 -1114
  316. package/src/wireframe/renderer.ts +0 -1318
  317. package/src/wireframe/types.ts +0 -110
  318. package/src/wordcloud/parser.ts +0 -18
  319. package/src/wordcloud/renderer.ts +0 -357
package/dist/block.d.cts DELETED
@@ -1,115 +0,0 @@
1
- /**
2
- * Canonical stylesheet for the standard DGMO embed block (BL-114).
3
- *
4
- * Shipped two ways: `dist/block.css` (extracted at build time by
5
- * tsup.config.ts, same regex mechanism as auto.css) for `<link>`/import
6
- * consumers, and the `BLOCK_CSS` string export for embedders that inject a
7
- * `<style>` tag.
8
- *
9
- * Dark mode keys off `[data-theme="dark"]`. Hosts with a different signal
10
- * (`html.dark`, `body.theme-dark`) rewrite the selector at their build step —
11
- * fumadocs-dgmo/nextra-dgmo's build-css.mjs is the reference adapter.
12
- *
13
- * The `.dgmo-tok-*` role colors mirror LIGHT_ROLE_STYLES (light) and
14
- * NORD_ROLE_STYLES (dark) from editor/highlight-api.ts. A parity test
15
- * (tests/block.test.ts) guards against drift — update both when either
16
- * changes.
17
- *
18
- * IMPORTANT: keep this a single pure template literal — the build extracts it
19
- * with a regex, so no interpolation or computed values.
20
- */
21
- declare const BLOCK_CSS: string;
22
-
23
- /**
24
- * Standard DGMO embed block (BL-114) — the ONE canonical
25
- * "diagram + source chrome" HTML builder shared by every embed surface:
26
- * remark-dgmo (and through it the astro/docusaurus/fumadocs/nextra/vitepress
27
- * wrappers), the `/auto` script-tag drop-in, `<dgmo-diagram>`, dgmo-mcp HTML
28
- * reports, the marketing site, and the Obsidian plugin.
29
- *
30
- * Chrome contract (user-approved 2026-07-05): the diagram is the star. A slim
31
- * icon toolbar sits in a reserved row below the SVG, invisible until the
32
- * block is hovered/focused or the source is open. Three wordless icon
33
- * buttons — `</>` toggles the hidden source panel, copy, open-in-editor. No
34
- * disclosure triangle, no text labels. The toolbar IS the <summary> of a
35
- * native <details>, so show/hide works with zero JavaScript; copy needs a
36
- * small delegated click handler (remark-dgmo's `bindDgmo` is the reference).
37
- *
38
- * Markup vocabulary: `figure.dgmo` (`--diagram`/`--showcase`/`--error`),
39
- * `.dgmo-light`/`.dgmo-dark` (dual color-mode) or `.dgmo-svg` (single),
40
- * `details.dgmo-source-wrap > summary.dgmo-toolbar`, `.dgmo-source-inner`,
41
- * `pre.dgmo-pre > span.dgmo-code` with `.dgmo-tok-<role>` token spans. While
42
- * the source is open the wrapper gets one shared frame (`:has()` rule) so
43
- * diagram + code read as a single unit. No visible caption — `title` becomes
44
- * the wrapper's aria-label. Styles ship as `BLOCK_CSS` / `dist/block.css`.
45
- */
46
-
47
- /** Default hosted editor used by "Open in editor" links. */
48
- declare const EDITOR_BASE_URL = "https://online.diagrammo.app";
49
- type BlockMode = 'diagram' | 'showcase';
50
- /**
51
- * Color-mode strategy for the emitted SVG(s).
52
- * - `auto` — render twice (light + dark) and let CSS flip visibility.
53
- * - `light` / `dark` / `transparent` — single render with that theme.
54
- */
55
- type BlockColorMode = 'auto' | 'light' | 'dark' | 'transparent';
56
- interface DgmoBlockOptions {
57
- /** `diagram` (default): SVG only. `showcase`: SVG + source chrome. */
58
- mode?: BlockMode;
59
- /** Palette name. Default `slate`; unknown names warn + fall back. */
60
- palette?: string;
61
- /** Default `auto` (dual light/dark render). */
62
- colorMode?: BlockColorMode;
63
- /** Default: true in showcase mode, false in diagram mode. */
64
- showSource?: boolean;
65
- /** Default: true in showcase mode, false in diagram mode. */
66
- showCopy?: boolean;
67
- /** Default: true in showcase mode, false in diagram mode. */
68
- showOpenInEditor?: boolean;
69
- /** Base URL for the open-in-editor link. Default: online.diagrammo.app. */
70
- editorBaseUrl?: string;
71
- /** Outer wrapper element. Default `figure`. */
72
- wrapper?: 'figure' | 'div';
73
- /** Base class for the wrapper (styling hook). Default `dgmo`. */
74
- className?: string;
75
- /** Extra classes appended to every emitted wrapper (compat shims). */
76
- legacyClassNames?: string[];
77
- /**
78
- * Accessible name for the block (`aria-label` on the wrapper). NOT rendered
79
- * visually — the chart's visible title belongs in the DGMO source itself.
80
- */
81
- title?: string;
82
- /** Receives palette-fallback warnings. Default: console.warn. */
83
- onWarn?: (message: string) => void;
84
- }
85
- interface DgmoBlockResult {
86
- html: string;
87
- diagnostics: Array<{
88
- message: string;
89
- line?: number;
90
- severity?: string;
91
- }>;
92
- }
93
- /**
94
- * Render one ```dgmo source block to the standard embed HTML. Async because
95
- * it runs the full dgmo render pipeline (once per color mode).
96
- *
97
- * Render errors are NOT caught here — callers decide between throwing,
98
- * `errorBlockHtml()`, or their own fallback.
99
- */
100
- declare function renderDgmoBlock(source: string, options?: DgmoBlockOptions): Promise<DgmoBlockResult>;
101
- /**
102
- * Assemble the standard block around already-rendered SVG markup. Exposed for
103
- * surfaces that render through their own pipeline (e.g. dgmo-mcp's
104
- * renderPipeline) but must emit the canonical chrome. `svgsHtml` must be the
105
- * `.dgmo-light`+`.dgmo-dark` (or `.dgmo-svg`) wrapper divs.
106
- */
107
- declare function buildDgmoBlockHtml(source: string, svgsHtml: string, options?: DgmoBlockOptions): string;
108
- /**
109
- * Standard error card for a block that failed to parse/render. Same shape on
110
- * every surface: `.dgmo--error` with `role="alert"`, message + offending
111
- * source.
112
- */
113
- declare function errorBlockHtml(err: unknown, source: string, options?: Pick<DgmoBlockOptions, 'className' | 'legacyClassNames'>): string;
114
-
115
- export { BLOCK_CSS, type BlockColorMode, type BlockMode, type DgmoBlockOptions, type DgmoBlockResult, EDITOR_BASE_URL, buildDgmoBlockHtml, errorBlockHtml, renderDgmoBlock };
package/dist/editor.cjs DELETED
@@ -1,526 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/editor/index.ts
21
- var editor_exports = {};
22
- __export(editor_exports, {
23
- CHART_TYPES: () => CHART_TYPES,
24
- METADATA_KEYS: () => METADATA_KEYS,
25
- dgmoExtension: () => dgmoExtension,
26
- dgmoHighlighting: () => dgmoHighlighting,
27
- dgmoLanguage: () => dgmoLanguage,
28
- dgmoLanguageSupport: () => dgmoLanguageSupport,
29
- dgmoParser: () => dgmoParser
30
- });
31
- module.exports = __toCommonJS(editor_exports);
32
- var import_language = require("@codemirror/language");
33
-
34
- // src/editor/dgmo.grammar.js
35
- var import_lr = require("@lezer/lr");
36
-
37
- // src/editor/dgmo.grammar.terms.js
38
- var ChartType = 1;
39
- var TagKeyword = 2;
40
- var DirectiveKeyword = 3;
41
- var ControlKeyword = 4;
42
- var ModifierKeyword = 5;
43
-
44
- // src/directives-registry.ts
45
- var DIRECTIVES_REGISTRY = [
46
- // ── Infra ────────────────────────────────────────────────
47
- // Top-level SLO options that are ALSO accepted as node colon-properties
48
- // (dual membership). Highlight bare (kept in DIRECTIVE_KEYWORDS) — their
49
- // rarer colon form stays keyword, an accepted minor false-positive.
50
- {
51
- token: "slo-availability",
52
- category: "directive",
53
- infra: ["top-level", "behavior"]
54
- },
55
- {
56
- token: "slo-p90-latency-ms",
57
- category: "directive",
58
- infra: ["top-level", "behavior"]
59
- },
60
- {
61
- token: "slo-warning-margin",
62
- category: "directive",
63
- infra: ["top-level", "behavior"]
64
- },
65
- // Top-level-only options (space-separated, bare).
66
- { token: "default-latency-ms", category: "directive", infra: ["top-level"] },
67
- { token: "default-uptime", category: "directive", infra: ["top-level"] },
68
- { token: "default-rps", category: "directive", infra: ["top-level"] },
69
- // `active-tag` is shared with gantt + map (see below).
70
- // Node behavior colon-keys — highlight as propertyName.
71
- { token: "latency-ms", colonKey: true, infra: ["behavior"] },
72
- { token: "uptime", colonKey: true, infra: ["behavior"] },
73
- { token: "instances", colonKey: true, infra: ["behavior"] },
74
- { token: "max-rps", colonKey: true, infra: ["behavior"] },
75
- { token: "cache-hit", colonKey: true, infra: ["behavior"] },
76
- { token: "firewall-block", colonKey: true, infra: ["behavior"] },
77
- { token: "ratelimit-rps", colonKey: true, infra: ["behavior"] },
78
- { token: "buffer", colonKey: true, infra: ["behavior"] },
79
- { token: "drain-rate", colonKey: true, infra: ["behavior"] },
80
- { token: "retention-hours", colonKey: true, infra: ["behavior"] },
81
- { token: "partitions", colonKey: true, infra: ["behavior"] },
82
- { token: "concurrency", colonKey: true, infra: ["behavior"] },
83
- { token: "duration-ms", colonKey: true, infra: ["behavior"] },
84
- { token: "cold-start-ms", colonKey: true, infra: ["behavior"] },
85
- { token: "cb-error-threshold", colonKey: true, infra: ["behavior"] },
86
- { token: "cb-latency-threshold-ms", colonKey: true, infra: ["behavior"] },
87
- // Edge-only colon-key.
88
- { token: "rps", colonKey: true, infra: ["edge"] },
89
- // ── Gantt ────────────────────────────────────────────────
90
- { token: "start", category: "directive", gantt: ["option"] },
91
- {
92
- token: "today-marker",
93
- category: "directive",
94
- gantt: ["option", "boolean"]
95
- },
96
- {
97
- token: "critical-path",
98
- category: "directive",
99
- gantt: ["option", "boolean"]
100
- },
101
- { token: "sprint-length", category: "directive", gantt: ["option"] },
102
- { token: "sprint-number", category: "directive", gantt: ["option"] },
103
- { token: "sprint-start", category: "directive", gantt: ["option"] },
104
- { token: "solid-fill", category: "directive", gantt: ["boolean"] },
105
- // `chart` is a wireframe element keyword (CONTROL); gantt also accepts it as
106
- // an option. Highlight family is control.
107
- { token: "chart", category: "control", gantt: ["option"] },
108
- // `dependencies` is ON by default → almost never written bare (authors write
109
- // `no-dependencies`, which DOES highlight). Bare word collides with prose and
110
- // the specializer is context-free, so it stays plain. Present for parser
111
- // Set derivation only.
112
- { token: "dependencies", noHighlight: true, gantt: ["option", "boolean"] },
113
- // ── Map ──────────────────────────────────────────────────
114
- // Per-element value→channel ramps (decision #20): the directive names the
115
- // visual channel — `region-heat` (colour), `poi-size` (marker area),
116
- // `flow-width` (stroke). The per-element key mirrors it (`heat:`/`size:`/`width:`).
117
- { token: "region-heat", category: "directive", map: true },
118
- { token: "poi-size", category: "directive", map: true },
119
- { token: "flow-width", category: "directive", map: true },
120
- { token: "locale", category: "directive", map: true },
121
- { token: "caption", category: "directive", map: true },
122
- { token: "no-legend", category: "directive", map: true },
123
- { token: "no-coastline", category: "directive", map: true },
124
- { token: "no-relief", category: "directive", map: true },
125
- { token: "no-context-labels", category: "directive", map: true },
126
- { token: "no-region-labels", category: "directive", map: true },
127
- { token: "no-region-heat-value", category: "directive", map: true },
128
- { token: "no-poi-labels", category: "directive", map: true },
129
- { token: "no-colorize", category: "directive", map: true },
130
- { token: "no-cities", category: "directive", map: true },
131
- { token: "no-cluster-pois", category: "directive", map: true },
132
- // ── Shared across types ──────────────────────────────────
133
- // `active-tag`: infra top-level option + gantt option + map directive.
134
- {
135
- token: "active-tag",
136
- category: "directive",
137
- infra: ["top-level"],
138
- gantt: ["option"],
139
- map: true
140
- },
141
- // `title`: gantt option (also a general data-chart directive, hand-listed).
142
- { token: "title", category: "directive", gantt: ["option"] },
143
- // `sort`: gantt option (also general, hand-listed).
144
- { token: "sort", category: "directive", gantt: ["option"] },
145
- // `lane-by <group>`: swimlane axis (view-state). NB not `swimlane` — that's a
146
- // chart type. Kanban reads it via its own KNOWN_OPTIONS; gantt via the switch.
147
- { token: "lane-by", category: "directive", gantt: ["option"] },
148
- // `no-title`: gantt boolean + map directive (also general, hand-listed).
149
- { token: "no-title", category: "directive", gantt: ["boolean"], map: true },
150
- // ══════════════════════════════════════════════════════════
151
- // Highlight-only vocab (no extractable parser Set).
152
- // ══════════════════════════════════════════════════════════
153
- // These chart types validate their directives with inline checks rather than
154
- // a literal Set, so there is no parser literal to delete — the registry is
155
- // simply their single declaration site for highlighting. Grouped by chart
156
- // type. Categories route to the specializer-read sets in keywords.ts.
157
- // ── Gantt (extras beyond the option/boolean Sets) ────────
158
- { token: "era", category: "directive" },
159
- { token: "marker", category: "directive" },
160
- { token: "holiday", category: "directive" },
161
- { token: "workweek", category: "directive" },
162
- { token: "no-dependencies", category: "directive" },
163
- // ── Tech-radar ───────────────────────────────────────────
164
- { token: "rings", category: "directive" },
165
- { token: "show-blip-legend", category: "directive" },
166
- { token: "trend", category: "directive" },
167
- // ── Tags / shared directives ─────────────────────────────
168
- { token: "tags", category: "directive" },
169
- { token: "import", category: "directive" },
170
- { token: "hide", category: "directive" },
171
- { token: "direction", category: "directive" },
172
- // ── Boxes-and-lines ──────────────────────────────────────
173
- // `heat <Label> [low] [high]` is the value→colour ramp directive, but `heat`
174
- // is NOT registered as a directive keyword: it is dual-use with the `heat:`
175
- // metadata key (decision #20), and a token in DIRECTIVE_KEYWORDS would block the
176
- // ATTRIBUTE_KEYS colon-gate from reclassifying `heat:` as a propertyName. So
177
- // `heat` lives only in the reserved-key registry + ATTRIBUTE_KEYS and highlights
178
- // as a property in both positions — exactly the treemap `heat` precedent.
179
- { token: "show-values", category: "directive" },
180
- // ── Swimlane ─────────────────────────────────────────────
181
- { token: "lane", category: "directive" },
182
- // ── ER ───────────────────────────────────────────────────
183
- { token: "notation", category: "directive" },
184
- // ── Class ────────────────────────────────────────────────
185
- { token: "extends", category: "directive" },
186
- { token: "implements", category: "directive" },
187
- { token: "abstract", category: "directive" },
188
- { token: "interface", category: "directive" },
189
- { token: "enum", category: "directive" },
190
- // ── C4 ───────────────────────────────────────────────────
191
- { token: "containers", category: "directive" },
192
- { token: "components", category: "directive" },
193
- { token: "deployment", category: "directive" },
194
- { token: "technology", category: "directive" },
195
- // ── Infra (directives beyond the option/behavior Sets) ───
196
- { token: "sub-node-label", category: "directive" },
197
- { token: "show-sub-node-count", category: "directive" },
198
- { token: "animate", category: "directive" },
199
- // ── Sequence ─────────────────────────────────────────────
200
- { token: "activations", category: "directive" },
201
- { token: "no-activations", category: "directive" },
202
- // ── Map element leaders (not in DIRECTIVE_SET) ───────────
203
- { token: "poi", category: "directive" },
204
- { token: "route", category: "directive" },
205
- // ── Data charts ──────────────────────────────────────────
206
- { token: "stacked", category: "directive" },
207
- { token: "no-name", category: "directive" },
208
- { token: "no-value", category: "directive" },
209
- { token: "no-percent", category: "directive" },
210
- { token: "series", category: "directive" },
211
- { token: "orientation", category: "directive" },
212
- { token: "x-label", category: "directive" },
213
- { token: "y-label", category: "directive" },
214
- { token: "size-label", category: "directive" },
215
- { token: "columns", category: "directive" },
216
- { token: "rows", category: "directive" },
217
- { token: "labels", category: "directive" },
218
- { token: "rotate", category: "directive" },
219
- { token: "scale", category: "directive" },
220
- { token: "values", category: "directive" },
221
- { token: "orientation-horizontal", category: "directive" },
222
- // ── Slope ────────────────────────────────────────────────
223
- { token: "period", category: "directive" },
224
- // ── Quadrant ─────────────────────────────────────────────
225
- { token: "x-axis", category: "directive" },
226
- { token: "y-axis", category: "directive" },
227
- { token: "top-right", category: "directive" },
228
- { token: "top-left", category: "directive" },
229
- { token: "bottom-right", category: "directive" },
230
- { token: "bottom-left", category: "directive" },
231
- // ── Layout (cross-chart) ─────────────────────────────────
232
- { token: "direction-tb", category: "directive" },
233
- { token: "direction-lr", category: "directive" },
234
- { token: "orientation-vertical", category: "directive" },
235
- // ── Pyramid ──────────────────────────────────────────────
236
- { token: "inverted", category: "directive" },
237
- // ── Color / notes (cross-chart) ──────────────────────────
238
- { token: "color", category: "directive" },
239
- { token: "no-notes", category: "directive" },
240
- // ── RACI ─────────────────────────────────────────────────
241
- { token: "roles", category: "directive" },
242
- // ── Cycle ────────────────────────────────────────────────
243
- { token: "direction-counterclockwise", category: "directive" },
244
- { token: "circle-nodes", category: "directive" },
245
- // ── Journey-map ──────────────────────────────────────────
246
- { token: "persona", category: "directive" },
247
- // ── Function ─────────────────────────────────────────────
248
- { token: "x", category: "directive" },
249
- { token: "shade", category: "directive" },
250
- // ── Wordcloud ────────────────────────────────────────────
251
- { token: "max", category: "directive" },
252
- { token: "size", category: "directive" },
253
- // ── Arc ──────────────────────────────────────────────────
254
- { token: "order", category: "directive" },
255
- // ── PERT ─────────────────────────────────────────────────
256
- { token: "time-unit", category: "directive" },
257
- { token: "default-confidence", category: "directive" },
258
- { token: "node-detail", category: "directive" },
259
- { token: "trials", category: "directive" },
260
- { token: "seed", category: "directive" },
261
- { token: "scrubber-trials", category: "directive" },
262
- { token: "start-date", category: "directive" },
263
- { token: "end-date", category: "directive" },
264
- // ── Control-flow + wireframe element keywords (CONTROL) ──
265
- { token: "if", category: "control" },
266
- { token: "else", category: "control" },
267
- { token: "loop", category: "control" },
268
- { token: "parallel", category: "control" },
269
- { token: "note", category: "control" },
270
- { token: "nav", category: "control" },
271
- { token: "tabs", category: "control" },
272
- { token: "table", category: "control" },
273
- { token: "image", category: "control" },
274
- { token: "modal", category: "control" },
275
- { token: "skeleton", category: "control" },
276
- { token: "alert", category: "control" },
277
- { token: "progress", category: "control" },
278
- { token: "mobile", category: "control" },
279
- // ── Kanban status keywords (STATUS) ──────────────────────
280
- { token: "na", category: "status" },
281
- { token: "todo", category: "status" },
282
- { token: "wip", category: "status" },
283
- { token: "done", category: "status" },
284
- { token: "blocked", category: "status" },
285
- { token: "in-progress", category: "status" },
286
- { token: "backlog", category: "status" },
287
- { token: "ready", category: "status" },
288
- // ── Modifiers + ER column types/modifiers (MODIFIER) ─────
289
- { token: "as", category: "modifier" },
290
- { token: "alias", category: "modifier" },
291
- { token: "aka", category: "modifier" },
292
- { token: "position", category: "modifier" },
293
- { token: "default", category: "modifier" },
294
- { token: "pk", category: "modifier" },
295
- { token: "fk", category: "modifier" },
296
- { token: "nullable", category: "modifier" },
297
- { token: "unique", category: "modifier" },
298
- { token: "int", category: "modifier" },
299
- { token: "varchar", category: "modifier" },
300
- { token: "text", category: "modifier" },
301
- { token: "boolean", category: "modifier" },
302
- { token: "date", category: "modifier" },
303
- { token: "timestamp", category: "modifier" },
304
- { token: "float", category: "modifier" },
305
- { token: "decimal", category: "modifier" }
306
- ];
307
- function tokensWhere(pred) {
308
- const out = /* @__PURE__ */ new Set();
309
- for (const e of DIRECTIVES_REGISTRY) if (pred(e)) out.add(e.token);
310
- return out;
311
- }
312
- var INFRA_TOP_LEVEL_OPTION_SET = tokensWhere(
313
- (e) => !!e.infra?.includes("top-level")
314
- );
315
- var INFRA_BEHAVIOR_KEY_SET = tokensWhere(
316
- (e) => !!e.infra?.includes("behavior")
317
- );
318
- var INFRA_EDGE_ONLY_KEY_SET = tokensWhere(
319
- (e) => !!e.infra?.includes("edge")
320
- );
321
- var GANTT_OPTION_SET = tokensWhere(
322
- (e) => !!e.gantt?.includes("option")
323
- );
324
- var GANTT_BOOLEAN_SET = tokensWhere(
325
- (e) => !!e.gantt?.includes("boolean")
326
- );
327
- var MAP_DIRECTIVE_KEY_SET = tokensWhere((e) => e.map === true);
328
- var REGISTRY_DIRECTIVE_TOKENS = tokensWhere(
329
- (e) => e.category === "directive" && !e.colonKey && !e.noHighlight
330
- );
331
- var REGISTRY_CONTROL_TOKENS = tokensWhere(
332
- (e) => e.category === "control" && !e.colonKey && !e.noHighlight
333
- );
334
- var REGISTRY_STATUS_TOKENS = tokensWhere(
335
- (e) => e.category === "status" && !e.colonKey && !e.noHighlight
336
- );
337
- var REGISTRY_MODIFIER_TOKENS = tokensWhere(
338
- (e) => e.category === "modifier" && !e.colonKey && !e.noHighlight
339
- );
340
- var REGISTRY_COLON_KEY_TOKENS = tokensWhere((e) => !!e.colonKey);
341
- var REGISTRY_NON_HIGHLIGHT_TOKENS = tokensWhere(
342
- (e) => !!e.noHighlight
343
- );
344
-
345
- // src/editor/keywords.ts
346
- var CHART_TYPES = /* @__PURE__ */ new Set([
347
- // Diagram types
348
- "sequence",
349
- "flowchart",
350
- "class",
351
- "er",
352
- "org",
353
- "kanban",
354
- "c4",
355
- "state",
356
- "sitemap",
357
- "infra",
358
- "gantt",
359
- "pert",
360
- "boxes-and-lines",
361
- "swimlane",
362
- "version-control",
363
- "wireframe",
364
- "tech-radar",
365
- "mindmap",
366
- "journey-map",
367
- "pyramid",
368
- "ring",
369
- "treemap",
370
- "block",
371
- "raci",
372
- "cycle",
373
- // Data chart types
374
- "bar",
375
- "line",
376
- "pie",
377
- "polar-area",
378
- "radar",
379
- "scatter",
380
- "sankey",
381
- "function",
382
- "heatmap",
383
- "funnel",
384
- // Visualization types
385
- "slope",
386
- "wordcloud",
387
- "arc",
388
- "timeline",
389
- "event-line",
390
- "venn",
391
- "quadrant",
392
- "map"
393
- ]);
394
- var METADATA_KEYS = /* @__PURE__ */ new Set([
395
- "title",
396
- "series",
397
- // Bar layout headers + pie/line directives (consolidation #23–#26)
398
- "stack",
399
- "group",
400
- "hole",
401
- "fill",
402
- "layout",
403
- "orientation",
404
- "x-label",
405
- "y-label",
406
- "y-right-label",
407
- "size-label",
408
- "x",
409
- "columns",
410
- "rows",
411
- "labels",
412
- "rotate",
413
- "max",
414
- "size",
415
- "order",
416
- "sort",
417
- "scale",
418
- "values",
419
- "notation",
420
- "x-axis",
421
- "y-axis",
422
- "top-right",
423
- "top-left",
424
- "bottom-right",
425
- "bottom-left",
426
- // Tech-radar pipe metadata
427
- "quadrant",
428
- "ring",
429
- "trend",
430
- // Map (§24B) reserved metadata keys
431
- "value",
432
- "label",
433
- "style",
434
- // Treemap color-by-value metric key
435
- "heat"
436
- ]);
437
- var TAG_KEYWORD = "tag";
438
- var DIRECTIVE_KEYWORDS = /* @__PURE__ */ new Set([...REGISTRY_DIRECTIVE_TOKENS]);
439
- var CONTROL_KEYWORDS = /* @__PURE__ */ new Set([...REGISTRY_CONTROL_TOKENS]);
440
- var STATUS_KEYWORDS = /* @__PURE__ */ new Set([...REGISTRY_STATUS_TOKENS]);
441
- var MODIFIER_KEYWORDS = /* @__PURE__ */ new Set([...REGISTRY_MODIFIER_TOKENS]);
442
-
443
- // src/editor/tokens.ts
444
- function specializeKeyword(value) {
445
- if (CHART_TYPES.has(value)) return ChartType;
446
- if (value === TAG_KEYWORD) return TagKeyword;
447
- if (DIRECTIVE_KEYWORDS.has(value)) return DirectiveKeyword;
448
- if (CONTROL_KEYWORDS.has(value)) return ControlKeyword;
449
- if (STATUS_KEYWORDS.has(value)) return ModifierKeyword;
450
- if (MODIFIER_KEYWORDS.has(value)) return ModifierKeyword;
451
- return -1;
452
- }
453
-
454
- // src/editor/dgmo.grammar.js
455
- var parser = import_lr.LRParser.deserialize({
456
- version: 14,
457
- states: "!WQVQPOOOOQO'#DU'#DUOOQO'#DP'#DPO%]QPO'#CdOOQO'#DO'#DOQVQPOOOOQO-E6}-E6}OOQO,59O,59OOOQO-E6|-E6|",
458
- stateData: "&Q~OvOS~OPPOQPORPOSPOTPOVSOXPOYPOZPO[PO]PO^PO_PO`POaPObPOcPOdPOePOfPOgPOhPOiPOjPOkPOlPOmPOnPOoPOpPOqPOwSO~OPPOQPORPOSPOTPOXPOYPOZPO[PO]PO^PO_PO`POaPObPOcPOdPOePOfPOgPOhPOiPOjPOkPOlPOmPOnPOoPOpPOqPO~OwVO~P#]OVXYZ[]^_`ghijklmnabcdefopqk~",
459
- goto: "!byPPPPPPPPzPPPPPPPPPPPPPPPPPPPPPPPPP!O!UPPPP!]TSOTQTORWTSROTRURVQORT",
460
- nodeNames: "\u26A0 ChartType TagKeyword DirectiveKeyword ControlKeyword ModifierKeyword Document Comment ContentLine SyncArrow AsyncArrow Duration DateLiteral Percentage Number SectionMarker Url OpenBracket CloseBracket OpenParen CloseParen OpenAngle CloseAngle Pipe Colon Comma Plus Dash Tilde Star Question QuotedString Identifier Punct",
461
- maxTerm: 40,
462
- skippedNodes: [0],
463
- repeatNodeCount: 2,
464
- tokenData: "<v~RzOX#uXY#zYZ$VZp#upq#zqr#urs$[st#uux#uxy%eyz%lz{%s{|%z|}&R}!O&Y!O!P#u!P!Q&i!Q!['Y![!]/{!]!^#u!^!_0S!_!`0Z!`!a0h!a!b0o!b!c#u!c!}0v!}#O3|#O#P#u#P#Q4R#Q#R#u#R#S0v#S#T#u#T#[0v#[#]4Y#]#o0v#o#p#u#p#q<Y#q#r#u#r#s<a#s;'S#u;'S;=`<p<%lO#u~#zOq~~$PQv~XY#zpq#z~$[Ow~~$aUq~OY$sZr$srs%Ys;'S$s;'S;=`%_<%lO$s~$vUOY$sZr$srs%Ys;'S$s;'S;=`%_<%lO$s~%_Oo~~%bP;=`<%l$s~%lOc~q~~%sOd~q~~%zOm~q~~&ROj~q~~&YOi~q~~&aPk~q~!`!a&d~&iOX~~&nPq~!P!Q&q~&vSV~OY&qZ;'S&q;'S;=`'S<%lO&q~'VP;=`<%l&q~'a]^~q~uv(Y|}(_!O!P)[!Q![*{#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~(_O]~~(bP!Q![(e~(hP!Q![(k~(nP!Q![(q~(vQ^~|}(_!O!P(|~)PP!Q![)S~)XP^~!Q![)S~)_P!Q![)b~)gY^~uv(Y!Q![)b#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~*YP#W#X*]~*bPZ~!a!b*e~*jOZ~~*oQZ~!a!b*e#]#^*u~*xP#b#c*]~+Q]^~uv(Y|}(_!O!P)[!Q![+y#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~,O]^~uv(Y|}(_!O!P)[!Q![,w#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~,|]^~uv(Y}!O-u!O!P)[!Q![.l#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~-xP!Q![-{~.OP!Q![.R~.WP[~}!O.Z~.^P!Q![.a~.dP!Q![.g~.lO[~~.q[^~uv(Y!O!P)[!Q![.l#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~/jP!Q![/m~/rR^~!O!P(|!Q![/m#R#S/g~0SOh~q~~0ZOe~q~~0`Pq~!_!`0c~0hO_~~0oOf~q~~0vOn~q~~0}_p~q~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#o1|~2R_p~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#o1|~3T]qr1|st1|vw1|wx1|{|1|!O!P1|!P!Q1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#o1|~4ROa~~4YOb~q~~4aap~q~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#h1|#h#i5f#i#o1|~5kap~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#h1|#h#i6p#i#o1|~6uap~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#d1|#d#e7z#e#o1|~8Pbp~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|![!]9X!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#g1|#g#h;R#h#o1|~9[P!P!Q9_~9bP!P!Q9e~9hYOX:WZp:Wqy:Wz|:W}!`:W!a#P:W#Q#p:W#q;'S:W;'S;=`:{<%lO:W~:]Y`~OX:WZp:Wqy:Wz|:W}!`:W!a#P:W#Q#p:W#q;'S:W;'S;=`:{<%lO:W~;OP;=`<%l:W~;W`p~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|![!]9X!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#o1|~<aOg~q~~<hPl~q~!`!a<k~<pOY~~<sP;=`<%l#u",
465
- tokenizers: [0],
466
- topRules: { "Document": [0, 6] },
467
- specialized: [{ term: 32, get: (value, stack) => specializeKeyword(value, stack) << 1, external: specializeKeyword }],
468
- tokenPrec: 204
469
- });
470
-
471
- // src/editor/highlight.ts
472
- var import_highlight = require("@lezer/highlight");
473
- var dgmoHighlighting = (0, import_highlight.styleTags)({
474
- Comment: import_highlight.tags.lineComment,
475
- ChartType: import_highlight.tags.typeName,
476
- TagKeyword: import_highlight.tags.definitionKeyword,
477
- DirectiveKeyword: import_highlight.tags.keyword,
478
- ControlKeyword: import_highlight.tags.controlKeyword,
479
- ModifierKeyword: import_highlight.tags.modifier,
480
- SyncArrow: import_highlight.tags.operator,
481
- AsyncArrow: import_highlight.tags.operator,
482
- Duration: import_highlight.tags.number,
483
- DateLiteral: import_highlight.tags.number,
484
- Number: import_highlight.tags.number,
485
- Percentage: import_highlight.tags.number,
486
- SectionMarker: import_highlight.tags.heading,
487
- OpenBracket: import_highlight.tags.squareBracket,
488
- CloseBracket: import_highlight.tags.squareBracket,
489
- OpenParen: import_highlight.tags.paren,
490
- CloseParen: import_highlight.tags.paren,
491
- OpenAngle: import_highlight.tags.angleBracket,
492
- CloseAngle: import_highlight.tags.angleBracket,
493
- Url: import_highlight.tags.url,
494
- QuotedString: import_highlight.tags.string,
495
- Pipe: import_highlight.tags.separator,
496
- Colon: import_highlight.tags.separator,
497
- Plus: import_highlight.tags.separator,
498
- Comma: import_highlight.tags.punctuation,
499
- Dash: import_highlight.tags.operator,
500
- Tilde: import_highlight.tags.operator,
501
- Star: import_highlight.tags.operator,
502
- Question: import_highlight.tags.operator,
503
- Punct: import_highlight.tags.punctuation
504
- });
505
-
506
- // src/editor/index.ts
507
- var dgmoParser = parser.configure({
508
- props: [dgmoHighlighting]
509
- });
510
- var dgmoLanguage = import_language.LRLanguage.define({
511
- name: "dgmo",
512
- parser: dgmoParser
513
- });
514
- var dgmoLanguageSupport = new import_language.LanguageSupport(dgmoLanguage);
515
- var dgmoExtension = dgmoLanguageSupport;
516
- // Annotate the CommonJS export names for ESM import in node:
517
- 0 && (module.exports = {
518
- CHART_TYPES,
519
- METADATA_KEYS,
520
- dgmoExtension,
521
- dgmoHighlighting,
522
- dgmoLanguage,
523
- dgmoLanguageSupport,
524
- dgmoParser
525
- });
526
- //# sourceMappingURL=editor.cjs.map
package/dist/editor.d.cts DELETED
@@ -1,26 +0,0 @@
1
- import * as _lezer_lr from '@lezer/lr';
2
- import { LanguageSupport, LRLanguage } from '@codemirror/language';
3
- import { NodePropSource } from '@lezer/common';
4
-
5
- /** All supported DGMO chart types. */
6
- declare const CHART_TYPES: Set<string>;
7
- /** Metadata keys recognized across chart types. */
8
- declare const METADATA_KEYS: Set<string>;
9
-
10
- /** Maps grammar node names to semantic highlight tags. */
11
- declare const dgmoHighlighting: NodePropSource;
12
-
13
- /** The raw Lezer parser for DGMO. */
14
- declare const dgmoParser: _lezer_lr.LRParser;
15
- /** LRLanguage wrapper for CodeMirror. */
16
- declare const dgmoLanguage: LRLanguage;
17
- /** Full language support (language + extensions). */
18
- declare const dgmoLanguageSupport: LanguageSupport;
19
- /**
20
- * Drop-in replacement for the old dgmoExtension.
21
- * Consumers should add indentationMarkers() separately if desired
22
- * (from @replit/codemirror-indentation-markers).
23
- */
24
- declare const dgmoExtension: LanguageSupport;
25
-
26
- export { CHART_TYPES, METADATA_KEYS, dgmoExtension, dgmoHighlighting, dgmoLanguage, dgmoLanguageSupport, dgmoParser };