@diagrammo/dgmo 0.47.0 → 0.48.1
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.
- package/dist/advanced.js +11 -11
- package/dist/auto.js +16 -16
- package/dist/auto.mjs +41 -12
- package/dist/block.js +4 -4
- package/dist/{chunk-FNB3PNGF.js → chunk-7DTWEFUE.js} +3 -3
- package/dist/{chunk-2DXMZRWJ.js → chunk-B65G5DNL.js} +8 -1
- package/dist/{chunk-RZCF2VVM.js → chunk-B7JUCQUA.js} +3 -1
- package/dist/{chunk-DU7W62N5.js → chunk-FANX6UJR.js} +3 -3
- package/dist/{chunk-6FZYCKXB.js → chunk-HSH73DP6.js} +2 -2
- package/dist/{chunk-P4RH4OSP.js → chunk-ILKORZ3H.js} +2 -2
- package/dist/{chunk-Y5QGVTVC.js → chunk-JTSMEYIZ.js} +7 -3
- package/dist/{chunk-RCERWOJR.js → chunk-ODZVHU3R.js} +1 -2
- package/dist/{chunk-DZAQBW35.js → chunk-SGZYXELT.js} +3 -7
- package/dist/{chunk-CUVHQHZ7.js → chunk-THXCFRTU.js} +3 -3
- package/dist/{chunk-IH6ZMVQ5.js → chunk-UC7TFHUM.js} +29 -11
- package/dist/{chunk-EMS2SK26.js → chunk-ZBWMSD5N.js} +3 -1
- package/dist/cli.cjs +15 -15
- package/dist/{dgmo-router-DZCIDUO5.js → dgmo-router-X35VLZLM.js} +3 -3
- package/dist/element.js +16 -16
- package/dist/element.mjs +41 -12
- package/dist/{flowchart-renderer-ZAEOL4DX.js → flowchart-renderer-SNDSII4D.js} +2 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -4
- package/dist/{parser-FUSKFGZN.js → parser-2EWECDSA.js} +2 -2
- package/dist/{renderer-UWA5XS74.js → renderer-4JHRUBE6.js} +3 -3
- package/dist/{renderer-WZRREQ2P.js → renderer-5MYBMBYO.js} +2 -2
- package/dist/{renderer-TOCOVLHS.js → renderer-B2OMQIQG.js} +3 -3
- package/dist/{renderer-2XQQQ6QR.js → renderer-N43WR5GV.js} +3 -3
- package/dist/{renderer-T7YKC5VP.js → renderer-ZRNG54CW.js} +3 -3
- package/dist/{state-renderer-RFYHSP4K.js → state-renderer-B4DQBM6M.js} +2 -2
- package/package.json +23 -71
- package/dist/advanced.cjs +0 -71648
- package/dist/advanced.d.cts +0 -5719
- package/dist/auto.cjs +0 -70648
- package/dist/auto.d.cts +0 -54
- package/dist/block.cjs +0 -70208
- package/dist/block.d.cts +0 -115
- package/dist/editor.cjs +0 -526
- package/dist/editor.d.cts +0 -26
- package/dist/element.cjs +0 -70530
- package/dist/element.d.cts +0 -62
- package/dist/highlight.cjs +0 -852
- package/dist/highlight.d.cts +0 -49
- package/dist/index.cjs +0 -70491
- package/dist/index.d.cts +0 -160
- package/dist/pert.cjs +0 -325
- package/dist/pert.d.cts +0 -559
- package/dist/themes-1-CuKpeH.d.cts +0 -908
- package/src/advanced.ts +0 -873
- package/src/arc/parser.ts +0 -15
- package/src/arc/renderer.ts +0 -633
- package/src/auto/index.ts +0 -621
- package/src/auto/shared.ts +0 -370
- package/src/auto/styles.ts +0 -73
- package/src/block/layout.ts +0 -198
- package/src/block/parser.ts +0 -427
- package/src/block/renderer.ts +0 -484
- package/src/block/types.ts +0 -67
- package/src/boxes-and-lines/collapse.ts +0 -96
- package/src/boxes-and-lines/focus.ts +0 -257
- package/src/boxes-and-lines/label-placement.ts +0 -339
- package/src/boxes-and-lines/layout-grouped.ts +0 -912
- package/src/boxes-and-lines/layout-layered.ts +0 -722
- package/src/boxes-and-lines/layout-search.ts +0 -1678
- package/src/boxes-and-lines/layout.ts +0 -398
- package/src/boxes-and-lines/parser.ts +0 -1181
- package/src/boxes-and-lines/renderer.ts +0 -1465
- package/src/boxes-and-lines/types.ts +0 -66
- package/src/c4/layout.ts +0 -2441
- package/src/c4/parser.ts +0 -1158
- package/src/c4/renderer.ts +0 -2008
- package/src/c4/types.ts +0 -89
- package/src/chart-type-registry.ts +0 -529
- package/src/chart-types.ts +0 -225
- package/src/chart.ts +0 -685
- package/src/charts-d3/bar.ts +0 -338
- package/src/charts-d3/chord.ts +0 -140
- package/src/charts-d3/function.ts +0 -147
- package/src/charts-d3/funnel.ts +0 -104
- package/src/charts-d3/heatmap.ts +0 -145
- package/src/charts-d3/index.ts +0 -337
- package/src/charts-d3/interactions.ts +0 -477
- package/src/charts-d3/line.ts +0 -344
- package/src/charts-d3/mount.ts +0 -151
- package/src/charts-d3/pie.ts +0 -117
- package/src/charts-d3/polar.ts +0 -89
- package/src/charts-d3/radar.ts +0 -0
- package/src/charts-d3/sankey.ts +0 -0
- package/src/charts-d3/scatter.ts +0 -185
- package/src/charts-d3/shared.ts +0 -208
- package/src/class/layout.ts +0 -326
- package/src/class/parser.ts +0 -635
- package/src/class/renderer.ts +0 -793
- package/src/class/types.ts +0 -58
- package/src/cli-banner.ts +0 -106
- package/src/cli.ts +0 -1080
- package/src/colors-diagnostics.ts +0 -35
- package/src/colors.ts +0 -379
- package/src/completion-types.ts +0 -27
- package/src/completion.ts +0 -2668
- package/src/cycle/layout.ts +0 -1026
- package/src/cycle/parser.ts +0 -387
- package/src/cycle/renderer.ts +0 -653
- package/src/cycle/types.ts +0 -101
- package/src/d3.ts +0 -1434
- package/src/data-chart-parser.ts +0 -1007
- package/src/dgmo-router.ts +0 -296
- package/src/diagnostics-registry.ts +0 -108
- package/src/diagnostics.ts +0 -0
- package/src/dimensions.ts +0 -20
- package/src/directives-registry.ts +0 -396
- package/src/editor/dgmo.grammar +0 -76
- package/src/editor/dgmo.grammar.d.ts +0 -2
- package/src/editor/dgmo.grammar.js +0 -18
- package/src/editor/dgmo.grammar.terms.d.ts +0 -5
- package/src/editor/dgmo.grammar.terms.js +0 -35
- package/src/editor/highlight-api.ts +0 -596
- package/src/editor/highlight.ts +0 -36
- package/src/editor/index.ts +0 -27
- package/src/editor/keywords.ts +0 -128
- package/src/editor/tokens.ts +0 -30
- package/src/element/index.ts +0 -432
- package/src/embed/css.ts +0 -312
- package/src/embed/escape.ts +0 -15
- package/src/embed/index.ts +0 -280
- package/src/er/classify.ts +0 -228
- package/src/er/layout.ts +0 -530
- package/src/er/parser.ts +0 -750
- package/src/er/renderer.ts +0 -725
- package/src/er/types.ts +0 -52
- package/src/error-card.ts +0 -269
- package/src/event-line/diagnostics.ts +0 -117
- package/src/event-line/parser.ts +0 -643
- package/src/event-line/renderer.ts +0 -1742
- package/src/event-line/types.ts +0 -74
- package/src/fonts.ts +0 -3
- package/src/gantt/calculator.ts +0 -979
- package/src/gantt/parser.ts +0 -1641
- package/src/gantt/renderer.ts +0 -3787
- package/src/gantt/resolver.ts +0 -172
- package/src/gantt/types.ts +0 -206
- package/src/graph/diagnostics.ts +0 -64
- package/src/graph/edge-spline.ts +0 -29
- package/src/graph/flowchart-parser.ts +0 -759
- package/src/graph/flowchart-renderer.ts +0 -817
- package/src/graph/layout.ts +0 -472
- package/src/graph/notes.ts +0 -21
- package/src/graph/state-collapse.ts +0 -78
- package/src/graph/state-parser.ts +0 -574
- package/src/graph/state-renderer.ts +0 -653
- package/src/graph/types.ts +0 -65
- package/src/index.ts +0 -261
- package/src/infra/compute.ts +0 -1385
- package/src/infra/layout.ts +0 -888
- package/src/infra/parser.ts +0 -1234
- package/src/infra/renderer.ts +0 -2534
- package/src/infra/roles.ts +0 -75
- package/src/infra/types.ts +0 -216
- package/src/infra/validation.ts +0 -201
- package/src/journey-map/layout.ts +0 -490
- package/src/journey-map/parser.ts +0 -557
- package/src/journey-map/renderer.ts +0 -1580
- package/src/journey-map/types.ts +0 -47
- package/src/kanban/mutations.ts +0 -175
- package/src/kanban/parser.ts +0 -509
- package/src/kanban/renderer.ts +0 -1449
- package/src/kanban/types.ts +0 -39
- package/src/label-layout.ts +0 -368
- package/src/map/colorize.ts +0 -54
- package/src/map/completion.ts +0 -316
- package/src/map/context-labels.ts +0 -609
- package/src/map/data/PROVENANCE.json +0 -1
- package/src/map/data/README.md +0 -40
- package/src/map/data/airport-collisions.json +0 -1
- package/src/map/data/airports.json +0 -1
- package/src/map/data/gazetteer.json +0 -1
- package/src/map/data/lakes.json +0 -1
- package/src/map/data/mountain-ranges.json +0 -1
- package/src/map/data/na-lakes.json +0 -1
- package/src/map/data/na-land.json +0 -1
- package/src/map/data/region-names.json +0 -1
- package/src/map/data/rivers.json +0 -1
- package/src/map/data/types.ts +0 -121
- package/src/map/data/us-states.json +0 -1
- package/src/map/data/water-bodies.json +0 -1
- package/src/map/data/world-coarse.json +0 -1
- package/src/map/data/world-detail.json +0 -1
- package/src/map/diagnostics.ts +0 -134
- package/src/map/dimensions.ts +0 -150
- package/src/map/geo-query.ts +0 -295
- package/src/map/geo.ts +0 -438
- package/src/map/invert.ts +0 -111
- package/src/map/layout.ts +0 -5069
- package/src/map/legend-band.ts +0 -127
- package/src/map/load-data.ts +0 -186
- package/src/map/parser.ts +0 -783
- package/src/map/renderer.ts +0 -1445
- package/src/map/resolved-types.ts +0 -160
- package/src/map/resolver.ts +0 -1146
- package/src/map/types.ts +0 -194
- package/src/mindmap/collapse.ts +0 -67
- package/src/mindmap/layout.ts +0 -649
- package/src/mindmap/parser.ts +0 -430
- package/src/mindmap/renderer.ts +0 -637
- package/src/mindmap/text-wrap.ts +0 -218
- package/src/mindmap/types.ts +0 -56
- package/src/org/collapse.ts +0 -151
- package/src/org/layout.ts +0 -1262
- package/src/org/parser.ts +0 -519
- package/src/org/renderer.ts +0 -866
- package/src/org/resolver.ts +0 -636
- package/src/palettes/atlas.ts +0 -77
- package/src/palettes/blueprint.ts +0 -73
- package/src/palettes/catppuccin.ts +0 -84
- package/src/palettes/color-utils.ts +0 -443
- package/src/palettes/index.ts +0 -67
- package/src/palettes/nord.ts +0 -67
- package/src/palettes/registry.ts +0 -114
- package/src/palettes/slate.ts +0 -73
- package/src/palettes/tidewater.ts +0 -73
- package/src/palettes/tokyo-night.ts +0 -86
- package/src/palettes/types.ts +0 -88
- package/src/pert/analyzer.ts +0 -1183
- package/src/pert/diagnostics.ts +0 -110
- package/src/pert/index.ts +0 -43
- package/src/pert/internal.ts +0 -252
- package/src/pert/layout.ts +0 -971
- package/src/pert/monte-carlo.ts +0 -446
- package/src/pert/parser.ts +0 -1606
- package/src/pert/renderer.ts +0 -4009
- package/src/pert/share-normalize.ts +0 -62
- package/src/pert/types.ts +0 -604
- package/src/pyramid/parser.ts +0 -185
- package/src/pyramid/renderer.ts +0 -768
- package/src/pyramid/types.ts +0 -28
- package/src/quadrant/parser.ts +0 -18
- package/src/quadrant/renderer.ts +0 -638
- package/src/raci/diagnostics.ts +0 -213
- package/src/raci/index.ts +0 -23
- package/src/raci/mutations.ts +0 -321
- package/src/raci/parser.ts +0 -699
- package/src/raci/renderer.ts +0 -1627
- package/src/raci/types.ts +0 -82
- package/src/raci/variants.ts +0 -320
- package/src/render.ts +0 -268
- package/src/ring/parser.ts +0 -212
- package/src/ring/renderer.ts +0 -490
- package/src/ring/types.ts +0 -27
- package/src/sequence/collapse.ts +0 -174
- package/src/sequence/parser.ts +0 -1596
- package/src/sequence/participant-inference.ts +0 -152
- package/src/sequence/renderer.ts +0 -3168
- package/src/sequence/tag-resolution.ts +0 -164
- package/src/sharing.ts +0 -211
- package/src/sitemap/collapse.ts +0 -100
- package/src/sitemap/layout.ts +0 -925
- package/src/sitemap/parser.ts +0 -755
- package/src/sitemap/renderer.ts +0 -828
- package/src/sitemap/types.ts +0 -42
- package/src/slope/parser.ts +0 -18
- package/src/slope/renderer.ts +0 -378
- package/src/swimlane/diagnostics.ts +0 -94
- package/src/swimlane/layout.ts +0 -597
- package/src/swimlane/parser.ts +0 -613
- package/src/swimlane/renderer.ts +0 -681
- package/src/swimlane/types.ts +0 -151
- package/src/tech-radar/interactive.ts +0 -1129
- package/src/tech-radar/layout.ts +0 -197
- package/src/tech-radar/parser.ts +0 -436
- package/src/tech-radar/renderer.ts +0 -1239
- package/src/tech-radar/shared.ts +0 -151
- package/src/tech-radar/types.ts +0 -86
- package/src/themes.ts +0 -22
- package/src/timeline/parser.ts +0 -472
- package/src/timeline/renderer.ts +0 -3024
- package/src/timeline/types.ts +0 -33
- package/src/timeline/viz-parser.ts +0 -21
- package/src/treemap/diagnostics.ts +0 -62
- package/src/treemap/layout-radial.ts +0 -233
- package/src/treemap/layout.ts +0 -189
- package/src/treemap/parser.ts +0 -463
- package/src/treemap/renderer-radial.ts +0 -438
- package/src/treemap/renderer.ts +0 -572
- package/src/treemap/treemap-shared.ts +0 -309
- package/src/treemap/types.ts +0 -60
- package/src/utils/arrow-markers.ts +0 -51
- package/src/utils/arrows-diagnostics.ts +0 -62
- package/src/utils/arrows.ts +0 -227
- package/src/utils/brand.ts +0 -61
- package/src/utils/card.ts +0 -183
- package/src/utils/collapse-engine/tree-edges.ts +0 -115
- package/src/utils/collapse-engine/tree.ts +0 -117
- package/src/utils/d3-helpers.ts +0 -219
- package/src/utils/d3-types.ts +0 -9
- package/src/utils/description-helpers.ts +0 -38
- package/src/utils/duration.ts +0 -312
- package/src/utils/export-container.ts +0 -41
- package/src/utils/expr-eval.ts +0 -27
- package/src/utils/fit-canvas.ts +0 -64
- package/src/utils/hover-styles.ts +0 -673
- package/src/utils/inline-markdown.ts +0 -96
- package/src/utils/legend-constants.ts +0 -48
- package/src/utils/legend-d3.ts +0 -618
- package/src/utils/legend-integration.ts +0 -107
- package/src/utils/legend-layout.ts +0 -776
- package/src/utils/legend-svg.ts +0 -214
- package/src/utils/legend-types.ts +0 -272
- package/src/utils/name-normalize.ts +0 -163
- package/src/utils/note-box/constants.ts +0 -25
- package/src/utils/note-box/index.ts +0 -11
- package/src/utils/note-box/metrics.ts +0 -90
- package/src/utils/note-box/svg.ts +0 -331
- package/src/utils/notes/bounds.ts +0 -30
- package/src/utils/notes/build.ts +0 -131
- package/src/utils/notes/index.ts +0 -18
- package/src/utils/notes/model.ts +0 -19
- package/src/utils/notes/parse.ts +0 -131
- package/src/utils/notes/place.ts +0 -177
- package/src/utils/notes/resolve.ts +0 -88
- package/src/utils/number-format.ts +0 -36
- package/src/utils/parsing.ts +0 -953
- package/src/utils/reserved-key-registry.ts +0 -239
- package/src/utils/safe-href.ts +0 -38
- package/src/utils/scaling.ts +0 -97
- package/src/utils/svg-embed.ts +0 -251
- package/src/utils/tag-groups.ts +0 -607
- package/src/utils/text-measure.ts +0 -122
- package/src/utils/time-ticks.ts +0 -253
- package/src/utils/title-constants.ts +0 -24
- package/src/utils/visual-conventions.ts +0 -61
- package/src/utils/wrapped-desc.ts +0 -87
- package/src/venn/parser.ts +0 -18
- package/src/venn/renderer.ts +0 -1047
- package/src/version-control/diagnostics.ts +0 -67
- package/src/version-control/parser.ts +0 -544
- package/src/version-control/renderer.ts +0 -724
- package/src/version-control/types.ts +0 -100
- package/src/visualizations/parse.ts +0 -1560
- package/src/visualizations/types.ts +0 -262
- package/src/wireframe/layout.ts +0 -479
- package/src/wireframe/parser.ts +0 -1114
- package/src/wireframe/renderer.ts +0 -1318
- package/src/wireframe/types.ts +0 -110
- package/src/wordcloud/parser.ts +0 -18
- 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 };
|