@diagrammo/dgmo 0.63.0 → 0.64.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.
Files changed (99) hide show
  1. package/README.md +2 -2
  2. package/dist/advanced.js +48 -45
  3. package/dist/block.js +7 -7
  4. package/dist/{charts-d3-M76E4TZU.js → charts-d3-ZTXJWEHI.js} +4 -4
  5. package/dist/{chunk-BIWMOFSE.js → chunk-2KOBOIB2.js} +2 -2
  6. package/dist/{chunk-KHTKMVKT.js → chunk-67D4MN2H.js} +2 -2
  7. package/dist/{chunk-TJCHULP5.js → chunk-7GUYGQR4.js} +2 -2
  8. package/dist/{chunk-2LN5C6FH.js → chunk-7T3A2UK3.js} +10 -6
  9. package/dist/{chunk-W32HMBPW.js → chunk-B6AONGTI.js} +3 -3
  10. package/dist/{chunk-DY4VJYG7.js → chunk-C6DMG2V6.js} +3 -3
  11. package/dist/{chunk-MD2KWAXJ.js → chunk-CDMF7P5A.js} +2 -2
  12. package/dist/{chunk-HBSKE3ML.js → chunk-CZUSH6NI.js} +3 -3
  13. package/dist/{chunk-USHDV2AF.js → chunk-DB2KQ5DN.js} +3 -3
  14. package/dist/{chunk-34HQALZ5.js → chunk-DN5HEDE4.js} +3 -3
  15. package/dist/{chunk-PUFWYDWP.js → chunk-FRC4LDTQ.js} +3 -3
  16. package/dist/{chunk-MRD4QWFK.js → chunk-I24O2RWT.js} +2 -2
  17. package/dist/{chunk-VWCGN2ST.js → chunk-I2ATN25N.js} +3 -3
  18. package/dist/{chunk-SSR6JAR3.js → chunk-IGIJZHB6.js} +2 -2
  19. package/dist/{chunk-3HYRJAXO.js → chunk-IX6N5MCY.js} +3 -3
  20. package/dist/{chunk-AKD3YZ54.js → chunk-KPX2OWZR.js} +3 -3
  21. package/dist/{chunk-L26ZAPNJ.js → chunk-KZ3PCDUJ.js} +2 -2
  22. package/dist/{chunk-UZ3JPYD3.js → chunk-L4IN4OBB.js} +3 -3
  23. package/dist/{chunk-RZRMSNO7.js → chunk-LMXAB4YM.js} +3 -3
  24. package/dist/{chunk-X4FCKGK2.js → chunk-LYTEVE2N.js} +3 -3
  25. package/dist/{chunk-NQH2Q2RR.js → chunk-M4HYPDER.js} +3 -3
  26. package/dist/{chunk-L57TSE53.js → chunk-MHI6W6XS.js} +3 -3
  27. package/dist/{chunk-ZXLXAOCM.js → chunk-MQHOKBJ6.js} +3 -3
  28. package/dist/{chunk-U22TKD3L.js → chunk-NIZM3LAG.js} +4 -4
  29. package/dist/{chunk-A34FVVVI.js → chunk-NKRCPBTJ.js} +2 -2
  30. package/dist/{chunk-XXDEQSW4.js → chunk-OBKM6GIJ.js} +3 -3
  31. package/dist/{chunk-BPINSP65.js → chunk-OMTBYLKN.js} +4 -4
  32. package/dist/{chunk-UKZ7K5GS.js → chunk-RBAW7VUG.js} +4 -3
  33. package/dist/{chunk-KK5LQIN7.js → chunk-RBBJIHNL.js} +4 -4
  34. package/dist/{chunk-DUHKYKI7.js → chunk-RQL25P3U.js} +4 -4
  35. package/dist/{chunk-MR2XKW35.js → chunk-S5RWWISJ.js} +2 -2
  36. package/dist/{chunk-BGITRLTR.js → chunk-SMCUX42K.js} +2 -2
  37. package/dist/{chunk-PTKCX5ZE.js → chunk-SPHC4RYF.js} +3 -3
  38. package/dist/{chunk-TRP7PC5Z.js → chunk-SVR3YFM3.js} +3 -3
  39. package/dist/{chunk-YVI3JL3S.js → chunk-T4QXHE34.js} +4 -4
  40. package/dist/{chunk-SV7F363F.js → chunk-TAJ2XFTT.js} +3 -3
  41. package/dist/{chunk-SBOG6R6A.js → chunk-V3UQSKWJ.js} +3 -3
  42. package/dist/{chunk-QRHA7WIU.js → chunk-VOJOARA6.js} +42 -42
  43. package/dist/{chunk-2PTK46E2.js → chunk-WDJ4HAGO.js} +2 -2
  44. package/dist/{chunk-QFNRHY62.js → chunk-XUN3MIO3.js} +2 -2
  45. package/dist/{chunk-L4B4GRVS.js → chunk-YHTKDIF2.js} +3 -3
  46. package/dist/{chunk-IMXG673Y.js → chunk-YLK3JNWP.js} +2 -2
  47. package/dist/{chunk-GCVTU64J.js → chunk-Z2ADWRSW.js} +3 -3
  48. package/dist/{chunk-6KFWC4CO.js → chunk-Z5ID35YP.js} +4 -2
  49. package/dist/{flowchart-renderer-BCVCIZHF.js → flowchart-renderer-EXMRHFTQ.js} +3 -3
  50. package/dist/index.js +7 -7
  51. package/dist/{renderer-XIJO7DYS.js → renderer-2ARNFXSC.js} +4 -4
  52. package/dist/{renderer-NKVIQA3C.js → renderer-2E7LQC32.js} +3 -3
  53. package/dist/{renderer-CU6BEHHV.js → renderer-7OOC2ZO2.js} +3 -3
  54. package/dist/{renderer-UTXVIAS7.js → renderer-BYWLJDT4.js} +4 -4
  55. package/dist/{renderer-AVR3LBTS.js → renderer-C6KOE774.js} +4 -4
  56. package/dist/{renderer-M7YOXAGC.js → renderer-DMVUBKP7.js} +3 -3
  57. package/dist/{renderer-5HYDLCMX.js → renderer-FCO42JLK.js} +4 -4
  58. package/dist/{renderer-HPQJRSON.js → renderer-H6AQ4UIR.js} +4 -4
  59. package/dist/{renderer-BBBN7QNX.js → renderer-HLWEJQJW.js} +3 -3
  60. package/dist/{renderer-HGWKAXS6.js → renderer-IN3UPTZS.js} +3 -3
  61. package/dist/{renderer-TDFRMG3O.js → renderer-KK2534AF.js} +3 -3
  62. package/dist/{renderer-TTMBG2N6.js → renderer-KOWVTTYR.js} +4 -4
  63. package/dist/{renderer-PKST5W6U.js → renderer-KPEQ72FY.js} +5 -5
  64. package/dist/{renderer-DRLZELXM.js → renderer-LO4FXQHP.js} +4 -4
  65. package/dist/{renderer-KHVAM4IY.js → renderer-LSBXYOID.js} +4 -4
  66. package/dist/{renderer-K3TH5PP7.js → renderer-M3PQKXK2.js} +5 -5
  67. package/dist/{renderer-AMCTCBV3.js → renderer-M43ROWET.js} +4 -4
  68. package/dist/{renderer-Q2YHQQSN.js → renderer-NHFRVCDC.js} +4 -4
  69. package/dist/{renderer-JL7L5Y5M.js → renderer-OA7FSZ4A.js} +3 -3
  70. package/dist/{renderer-CHHYNEK7.js → renderer-OB77AT7V.js} +4 -4
  71. package/dist/{renderer-35F3XMZH.js → renderer-OYTERGAO.js} +4 -4
  72. package/dist/{renderer-4VDSMPYU.js → renderer-PM7JPC3J.js} +5 -5
  73. package/dist/{renderer-XDL6PRLN.js → renderer-QEHUJHRK.js} +4 -4
  74. package/dist/{renderer-2DKA5QXA.js → renderer-QR5343AR.js} +3 -3
  75. package/dist/{renderer-JBF2PAVP.js → renderer-T5CUGSXP.js} +4 -4
  76. package/dist/{renderer-CXAL2FYB.js → renderer-WN47AMUM.js} +4 -4
  77. package/dist/{renderer-ZHBFOSK5.js → renderer-WR3FA3FF.js} +4 -4
  78. package/dist/{renderer-RN5ZFIEK.js → renderer-XLEYPLVL.js} +4 -4
  79. package/dist/{renderer-DJ5DP3RH.js → renderer-XLPNUOYA.js} +4 -4
  80. package/dist/{renderer-RJT3MOUU.js → renderer-YBEZ5V2H.js} +3 -3
  81. package/dist/{renderer-KKNXTTFE.js → renderer-YELZR4QT.js} +6 -6
  82. package/dist/{renderer-5SN6N5VN.js → renderer-YLM4CGBG.js} +4 -4
  83. package/dist/{renderer-726UVOKE.js → renderer-ZNTLBQ45.js} +4 -4
  84. package/dist/{renderer-radial-4J2KO4GZ.js → renderer-radial-XWAKJACV.js} +4 -4
  85. package/dist/{state-renderer-MCWCZ76U.js → state-renderer-LIESKSBO.js} +4 -4
  86. package/package.json +1 -1
  87. package/dist/advanced.d.ts +0 -6771
  88. package/dist/auto.css +0 -557
  89. package/dist/auto.js +0 -886
  90. package/dist/block.d.ts +0 -142
  91. package/dist/chart-meta-D98NbYDp.d.ts +0 -238
  92. package/dist/chart-meta.d.ts +0 -2
  93. package/dist/cloud-reference.d.ts +0 -96
  94. package/dist/completion-registry.d.ts +0 -129
  95. package/dist/dgmo-router-Dd5PTjxl.d.ts +0 -540
  96. package/dist/element.js +0 -889
  97. package/dist/index.d.ts +0 -207
  98. package/dist/live-link-resolve.d.ts +0 -73
  99. package/dist/themes-DiUAG4Bf.d.ts +0 -631
package/dist/block.d.ts DELETED
@@ -1,142 +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. Four wordless icon
33
- * buttons — `</>` toggles the hidden source panel, expand (full-screen),
34
- * copy, open-in-editor. No disclosure triangle, no text labels. The toolbar
35
- * IS the <summary> of a native <details>, so show/hide works with zero
36
- * JavaScript; copy and expand need a small delegated click handler
37
- * (remark-dgmo's `bindDgmo` is the reference — expand's lightbox helper is
38
- * mirrored across every client surface, same as copy).
39
- *
40
- * Markup vocabulary: `figure.dgmo` (`--diagram`/`--showcase`/`--error`),
41
- * `.dgmo-light`/`.dgmo-dark` (dual color-mode) or `.dgmo-svg` (single),
42
- * `details.dgmo-source-wrap > summary.dgmo-toolbar`, `.dgmo-source-inner`,
43
- * `pre.dgmo-pre > span.dgmo-code` with `.dgmo-tok-<role>` token spans. While
44
- * the source is open the wrapper gets one shared frame (`:has()` rule) so
45
- * diagram + code read as a single unit. No visible caption — `title` becomes
46
- * the wrapper's aria-label. Styles ship as `BLOCK_CSS` / `dist/block.css`.
47
- */
48
-
49
- /** Default hosted editor used by "Open in editor" links. */
50
- declare const EDITOR_BASE_URL = "https://online.diagrammo.app";
51
- type BlockMode = 'diagram' | 'showcase';
52
- /**
53
- * Color-mode strategy for the emitted SVG(s).
54
- * - `auto` — render twice (light + dark) and let CSS flip visibility.
55
- * - `light` / `dark` / `transparent` — single render with that theme.
56
- */
57
- type BlockColorMode = 'auto' | 'light' | 'dark' | 'transparent';
58
- interface DgmoBlockOptions {
59
- /** `diagram` (default): SVG only. `showcase`: SVG + source chrome. */
60
- mode?: BlockMode;
61
- /** Palette name. Default `slate`; unknown names warn + fall back. */
62
- palette?: string;
63
- /** Default `auto` (dual light/dark render). */
64
- colorMode?: BlockColorMode;
65
- /**
66
- * Embed background. `auto` (default) strips the theme's opaque root
67
- * background so the diagram blends into the host page — except for
68
- * background-meaningful types like `map`, which stay opaque. `transparent` /
69
- * `opaque` force the choice regardless of type (the embedder opt-out).
70
- */
71
- background?: 'auto' | 'transparent' | 'opaque';
72
- /** Default: true in showcase mode, false in diagram mode. */
73
- showSource?: boolean;
74
- /** Default: true in showcase mode, false in diagram mode. */
75
- showCopy?: boolean;
76
- /**
77
- * Show the expand (full-screen) toolbar button. Default: true in showcase
78
- * mode, false in diagram mode. Needs the client lightbox handler to do
79
- * anything (mirrored across surfaces); markup-only surfaces can omit it.
80
- */
81
- showExpand?: boolean;
82
- /** Default: true in showcase mode, false in diagram mode. */
83
- showOpenInEditor?: boolean;
84
- /** Base URL for the open-in-editor link. Default: online.diagrammo.app. */
85
- editorBaseUrl?: string;
86
- /** Outer wrapper element. Default `figure`. */
87
- wrapper?: 'figure' | 'div';
88
- /** Base class for the wrapper (styling hook). Default `dgmo`. */
89
- className?: string;
90
- /** Extra classes appended to every emitted wrapper (compat shims). */
91
- legacyClassNames?: string[];
92
- /**
93
- * Accessible name for the block (`aria-label` on the wrapper). NOT rendered
94
- * visually — the chart's visible title belongs in the DGMO source itself.
95
- */
96
- title?: string;
97
- /**
98
- * Extra `data-*` attributes for the outer wrapper, as bare names → values
99
- * (`{ 'dgmo-ref': 'dgm_01H…' }` emits `data-dgmo-ref="dgm_01H…"`).
100
- *
101
- * Exists so a surface can mark a block for its own client code without
102
- * string-patching the emitted HTML — remark-dgmo's cloud references stamp the
103
- * diagram id and the revision they were baked from here, and its client script
104
- * reads them back to decide whether a refresh is even worth a fetch. Values are
105
- * attribute-escaped; a key that isn't a plain identifier is dropped rather than
106
- * trusted, since these end up in markup verbatim.
107
- */
108
- dataAttributes?: Record<string, string>;
109
- /** Receives palette-fallback warnings. Default: console.warn. */
110
- onWarn?: (message: string) => void;
111
- }
112
- interface DgmoBlockResult {
113
- html: string;
114
- diagnostics: Array<{
115
- message: string;
116
- line?: number;
117
- severity?: string;
118
- }>;
119
- }
120
- /**
121
- * Render one ```dgmo source block to the standard embed HTML. Async because
122
- * it runs the full dgmo render pipeline (once per color mode).
123
- *
124
- * Render errors are NOT caught here — callers decide between throwing,
125
- * `errorBlockHtml()`, or their own fallback.
126
- */
127
- declare function renderDgmoBlock(source: string, options?: DgmoBlockOptions): Promise<DgmoBlockResult>;
128
- /**
129
- * Assemble the standard block around already-rendered SVG markup. Exposed for
130
- * surfaces that render through their own pipeline (e.g. dgmo-mcp's
131
- * renderPipeline) but must emit the canonical chrome. `svgsHtml` must be the
132
- * `.dgmo-light`+`.dgmo-dark` (or `.dgmo-svg`) wrapper divs.
133
- */
134
- declare function buildDgmoBlockHtml(source: string, svgsHtml: string, options?: DgmoBlockOptions): string;
135
- /**
136
- * Standard error card for a block that failed to parse/render. Same shape on
137
- * every surface: `.dgmo--error` with `role="alert"`, message + offending
138
- * source.
139
- */
140
- declare function errorBlockHtml(err: unknown, source: string, options?: Pick<DgmoBlockOptions, 'className' | 'legacyClassNames'>): string;
141
-
142
- export { BLOCK_CSS, type BlockColorMode, type BlockMode, type DgmoBlockOptions, type DgmoBlockResult, EDITOR_BASE_URL, buildDgmoBlockHtml, errorBlockHtml, renderDgmoBlock };
@@ -1,238 +0,0 @@
1
- import { f as PaletteColors, T as TagGroup, a as DgmoError } from './dgmo-router-Dd5PTjxl.js';
2
-
3
- /** Convert hex (#RRGGBB or #RGB) to { h, s, l } with h in degrees, s/l as percentages. */
4
- declare function hexToHSL(hex: string): {
5
- h: number;
6
- s: number;
7
- l: number;
8
- };
9
- /** Convert { h (degrees), s (%), l (%) } back to #RRGGBB hex string. */
10
- declare function hslToHex(h: number, s: number, l: number): string;
11
- /** Convert hex to "H S% L%" string for CSS custom properties. */
12
- declare function hexToHSLString(hex: string): string;
13
- /**
14
- * Blend a color toward white (light mode quadrant fills).
15
- * amount: 0 = original, 1 = white
16
- */
17
- declare function tint(hex: string, amount: number): string;
18
- /**
19
- * Blend a color toward a dark base (dark mode quadrant fills).
20
- * amount: 0 = original, 1 = base
21
- */
22
- declare function shade(hex: string, base: string, amount: number): string;
23
- /**
24
- * Blend two hex colors by percentage.
25
- * `pct` = 0 → 100% of `b`, `pct` = 100 → 100% of `a`.
26
- *
27
- * Used by all renderers for tinted fills and strokes.
28
- */
29
- declare function mix(a: string, b: string, pct: number): string;
30
- /**
31
- * Pick `lightText` or `darkText` for placement on top of `bg`.
32
- *
33
- * Three-tier decision:
34
- * 1. **High-luminance fill (luminance > 0.55)** → `darkText`. Yellows, peaches,
35
- * light cyans — dark text reads better and a light cream on light yellow is
36
- * unreadable.
37
- * 2. **Pastel fill (min RGB channel ≥ 100, luminance ≤ 0.55)** → defer to WCAG
38
- * ratio. Pastels have no near-zero channel and tend to read as "soft" —
39
- * dark text usually wins by ratio (catppuccin dark mauve `#cba6f7` min 166,
40
- * ratio 9.35:1; tokyo-night dark red `#f7768e` min 118, ratio 7.86:1; and
41
- * tokyo-night green `#9ece6a` min 106, ratio 11.4:1 all correctly pick dark).
42
- * 3. **Saturated fill (min RGB < 100, luminance ≤ 0.55)** → `lightText`. At least
43
- * one channel near zero signals true saturation — gruvbox dark green
44
- * `#b8bb26` (min 38), blueprint blue `#1f5e8c` (min 31), bold red/blue
45
- * (min 0), solarized blue `#268bd2` (min 38). The user consistently
46
- * prefers light text on these for visual punch.
47
- *
48
- * `min RGB` discriminates pastel-vs-saturated more reliably than `max-min`
49
- * (vibrance): tokyo-night and catppuccin dark are pastels with high max RGB,
50
- * so vibrance alone misclassifies them as "saturated."
51
- *
52
- * Tinted fills (luminance ~0.7+ in light themes / ~0.02–0.14 in dark themes)
53
- * are unambiguous in either branch; only fill-solid output shifts here.
54
- */
55
- declare function contrastText(bg: string, lightText: string, darkText: string): string;
56
- declare function shapeFill(palette: PaletteColors, intent: string, isDark: boolean, opts?: {
57
- mode?: 'solid' | 'outline' | undefined;
58
- }): string;
59
- /**
60
- * Derive the 8-color series rotation from a palette's named colors, in the
61
- * shared {@link CATEGORICAL_COLOR_ORDER} (RGB-seeded, max-contrast). Tag
62
- * swatches and chart series colors thus share one canonical rotation.
63
- */
64
- declare function getSeriesColors(palette: PaletteColors): string[];
65
-
66
- interface OrgNode {
67
- readonly id: string;
68
- readonly label: string;
69
- readonly metadata: Readonly<Record<string, string>>;
70
- readonly children: readonly OrgNode[];
71
- readonly parentId: string | null;
72
- readonly isContainer: boolean;
73
- readonly lineNumber: number;
74
- readonly color?: string;
75
- }
76
- interface ParsedOrg {
77
- readonly title: string | null;
78
- readonly titleLineNumber: number | null;
79
- readonly roots: readonly OrgNode[];
80
- readonly tagGroups: readonly TagGroup[];
81
- readonly options: Readonly<Record<string, string>>;
82
- /**
83
- * Resolved layout direction (§7.5). `direction-lr` / `direction-tb` are a
84
- * mutually-exclusive boolean pair (§1.9, last one wins). Defaults to 'TB',
85
- * which is the orientation org charts have always rendered.
86
- */
87
- readonly direction: 'LR' | 'TB';
88
- readonly diagnostics: readonly DgmoError[];
89
- readonly error: string | null;
90
- }
91
- declare function parseOrg(content: string, palette?: PaletteColors): ParsedOrg;
92
-
93
- /**
94
- * Substitute `start-date now` with the host-local resolved date.
95
- * Pass the result to `encodeDiagramUrl` so the share-link captures
96
- * the resolved date, not the literal token.
97
- *
98
- * Lines without `start-date now` (explicit-date lines, comments,
99
- * other directives, activity lines containing the word "now") pass
100
- * through verbatim.
101
- */
102
- declare function normalizePertSourceForShare(dsl: string): string;
103
-
104
- /**
105
- * Shared parser utilities — extracted from individual parsers to eliminate
106
- * duplication of measureIndent, extractColor, header regexes, and
107
- * pipe-metadata parsing.
108
- */
109
-
110
- /**
111
- * Complete set of recognized chart type identifiers.
112
- *
113
- * Derived from `chart-types.ts`, which is a leaf module — importing the
114
- * chart-type *registry* here would be circular, since the registry imports
115
- * every parser and 34 parsers import this file.
116
- */
117
- declare const ALL_CHART_TYPES: ReadonlySet<string>;
118
- /**
119
- * Cross-chart fill treatment (spec §1.9 fill family). Absent ⇒ the canonical
120
- * 25% tint (`fill-tint` is the explicit spelling of that default).
121
- */
122
- type FillMode = 'solid' | 'outline';
123
- /**
124
- * Parse the first non-empty, non-comment line to extract chart type and optional title.
125
- * The first token is matched against `ALL_CHART_TYPES`; the remainder is the title.
126
- *
127
- * Returns `null` if the first token is not a recognized chart type.
128
- */
129
- declare function parseFirstLine(line: string): {
130
- chartType: string;
131
- title: string | undefined;
132
- } | null;
133
-
134
- /** Marker alphabet member for any variant. */
135
- type RaciMarker = 'R' | 'A' | 'S' | 'C' | 'I' | 'D';
136
- /** Variant identifier — selects alphabet + constraint rule set. */
137
- type RaciVariant = 'raci' | 'rasci' | 'daci';
138
- /**
139
- * One `Role: <markers>` line under a task.
140
- *
141
- * `id` is the normalized role key — used by mutations to look up the
142
- * cell and by validation to detect unknown roles. `displayName` is the
143
- * first-seen casing/spacing for rendering.
144
- */
145
- interface RaciRoleAssignment {
146
- readonly id: string;
147
- readonly displayName: string;
148
- readonly markers: readonly RaciMarker[];
149
- readonly lineNumber: number;
150
- readonly endLineNumber: number;
151
- }
152
- /** One task — flush-left under a phase or directly under the chart. */
153
- interface RaciTask {
154
- readonly id: string;
155
- readonly displayName: string;
156
- readonly description: string;
157
- readonly roleAssignments: readonly RaciRoleAssignment[];
158
- readonly lineNumber: number;
159
- readonly endLineNumber: number;
160
- }
161
- /** Optional `[Phase Label]` group header — one level deep. */
162
- interface RaciPhase {
163
- readonly id: string;
164
- readonly displayName: string;
165
- /** Optional palette color from a `[Label](color)` suffix on the bracket. */
166
- readonly color?: string;
167
- readonly tasks: readonly RaciTask[];
168
- readonly lineNumber: number;
169
- readonly endLineNumber: number;
170
- }
171
- /** Top-level parse result. */
172
- interface ParsedRaci {
173
- readonly type: 'raci';
174
- /** Optional title from the chart-type header line. */
175
- readonly title?: string;
176
- readonly titleLineNumber?: number;
177
- /** Variant selected by directive, or by chart-type id when absent. */
178
- readonly variant: RaciVariant;
179
- /**
180
- * Canonical column order. Populated either from an explicit
181
- * `roles:` directive or, when absent, from first-seen role usage.
182
- */
183
- readonly roles: readonly string[];
184
- /** Display name for each role (parallel to `roles`). */
185
- readonly roleDisplayNames: readonly string[];
186
- /**
187
- * Optional per-role palette color from the `Cap blue` trailing-token
188
- * suffix in the roles block (or the long pipe form `Cap | color: blue`).
189
- * Parallel to `roles`; entries default to `undefined` (renderer falls
190
- * back to the neutral column tint).
191
- */
192
- readonly roleColors: ReadonlyArray<string | undefined>;
193
- readonly phases: readonly RaciPhase[];
194
- /** Tasks declared without a parent phase. */
195
- readonly tasksWithoutPhase: readonly RaciTask[];
196
- readonly options: Readonly<Record<string, string>>;
197
- readonly diagnostics: readonly DgmoError[];
198
- readonly error: string | null;
199
- }
200
-
201
- /**
202
- * Parse RACI/RASCI/DACI source. The leading chart-type id (if a
203
- * recognized variant id) acts as a hint for default variant when the
204
- * `variant` directive is absent.
205
- */
206
- declare function parseRaci(content: string, palette?: PaletteColors): ParsedRaci;
207
-
208
- /**
209
- * Async or sync file reader. Receives an absolute path, returns content.
210
- * Throwing means "file not found".
211
- */
212
- type ReadFileFn = (path: string) => string | Promise<string>;
213
- /** Tracks the original source file and line for an imported line. */
214
- interface ImportSource {
215
- /** Absolute path of the file this line originates from */
216
- filePath: string;
217
- /** 1-based line number in the original (pre-resolution) source file */
218
- sourceLine: number;
219
- }
220
- interface ResolveImportsResult {
221
- content: string;
222
- diagnostics: DgmoError[];
223
- /** resolvedLine (1-based index) → originalLine (1-based) or null for inserted lines */
224
- lineMap: (number | null)[];
225
- /** resolvedLine (1-based index) → import source info or null for non-imported lines */
226
- importSourceMap: (ImportSource | null)[];
227
- }
228
- /**
229
- * Pre-processes org chart content, resolving `tags` and `import` directives.
230
- *
231
- * @param content - Raw .dgmo file content
232
- * @param filePath - Absolute path of the file (for relative path resolution)
233
- * @param readFileFn - Function to read files (sync or async)
234
- * @returns Merged content with all imports resolved + diagnostics
235
- */
236
- declare function resolveOrgImports(content: string, filePath: string, readFileFn: ReadFileFn): Promise<ResolveImportsResult>;
237
-
238
- export { ALL_CHART_TYPES as A, type FillMode as F, type ImportSource as I, type OrgNode as O, type ParsedOrg as P, type RaciMarker as R, type ParsedRaci as a, type RaciVariant as b, type RaciTask as c, type RaciPhase as d, type RaciRoleAssignment as e, type ReadFileFn as f, type ResolveImportsResult as g, contrastText as h, getSeriesColors as i, hexToHSL as j, hexToHSLString as k, hslToHex as l, mix as m, normalizePertSourceForShare as n, parseOrg as o, parseFirstLine as p, parseRaci as q, resolveOrgImports as r, shade as s, shapeFill as t, tint as u };
@@ -1,2 +0,0 @@
1
- export { b as ChartTypeId, c as ChartTypeMeta, C as CompactViewState, m as DecodedDiagramUrl, n as EncodeDiagramUrlOptions, o as EncodeDiagramUrlResult, f as PaletteColors, g as chartTypes, t as decodeDiagramUrl, u as decodeViewState, v as encodeDiagramUrl, w as encodeViewState, y as getAvailablePalettes, j as getPalette, H as parseDgmoChartType } from './dgmo-router-Dd5PTjxl.js';
2
- export { A as ALL_CHART_TYPES, O as OrgNode, P as ParsedOrg, k as hexToHSLString, n as normalizePertSourceForShare, p as parseFirstLine, o as parseOrg, q as parseRaci, r as resolveOrgImports } from './chart-meta-D98NbYDp.js';
@@ -1,96 +0,0 @@
1
- /**
2
- * Live links — the shared resolver (Diagrammo Cloud story 10.6).
3
- *
4
- * A live link points at a diagram living in Diagrammo Cloud instead of at bytes
5
- * pasted into a document. The point of it is CURRENCY: a linked diagram is
6
- * never stale, which is true for a team of one and needs no distribution to be
7
- * worth having.
8
- *
9
- * There are three SPELLINGS and exactly ONE parser, because each spelling is
10
- * native to where it gets typed:
11
- *
12
- * | Surface | Form |
13
- * |------------------------|-----------------------------|
14
- * | docs frameworks | `live-link abc123` in a fence|
15
- * | Obsidian, desktop app | `![[live-link:abc123]]` |
16
- * | anywhere taking a URL | the plain URL |
17
- *
18
- * The keyword was `cloud` until 2026-08-01 (decision #53). `cloud` named where
19
- * the thing lives; `live-link` names what it is, and it is the publish dialog's
20
- * own phrase, so one word now spans both sides of the exchange. Pre-1.0 there
21
- * is no dual-accept window — `cloud abc123` simply stops resolving. The module
22
- * and its package subpath keep the old name deliberately: renaming a subpath
23
- * export breaks the app's `pnpm dev` while the production build stays green.
24
- *
25
- * 🔴 EVERY future modifier must land in all three (A9), and
26
- * `cloud-reference.test.ts` asserts parity across the forms from ONE table so a
27
- * modifier cannot ship into a single spelling. If you are adding a modifier and
28
- * only touching one branch below, the tests are about to tell you so.
29
- *
30
- * A reference ALWAYS FLOATS — it resolves to the current revision, which is the
31
- * whole point (a referenced diagram is never stale). A date pin (`@2026-03-12`)
32
- * was designed and then dropped on 2026-07-30: the server retains a bounded
33
- * number of versions and prunes on every push, so a pin would fail on exactly
34
- * the diagrams that are edited most. Anything carrying a modifier therefore
35
- * parses to NULL rather than silently floating — a document that asked to be
36
- * frozen must not quietly get the latest instead.
37
- *
38
- * This module is deliberately dependency-free and does no I/O: it is imported by
39
- * every wrapper and by the CLI, and a parser that reached the network would make
40
- * each of them harder to test than the thing they are testing.
41
- */
42
- /** Default origin of the Cloud API. Overridable for self-host / staging / tests. */
43
- declare const CLOUD_API_BASE = "https://api.diagrammo.app";
44
- /** Where human-facing share links live — the URLs people actually copy. */
45
- declare const CLOUD_APP_BASE = "https://online.diagrammo.app";
46
- /** A parsed reference. An id, and — for now — deliberately nothing else. */
47
- interface CloudReference {
48
- id: string;
49
- }
50
- /**
51
- * Parse any of the three spellings, wherever it appears.
52
- *
53
- * 🔴 **A `dgmo` fence must NOT use this — use `parseCloudReferenceFence`.** The
54
- * embed spelling is host markdown, and inside a fence the content is DGMO, so
55
- * accepting `![[live-link:<id>]]` there is a category error: markdown nested in
56
- * a code fence that is itself in markdown. It was accepted until 2026-08-05 and
57
- * the showcase content taught it. Removed rather than deprecated — pre-1.0.
58
- *
59
- * This union survives for a host scanning raw note text, where any of the three
60
- * may legitimately turn up. Returns null for anything that is not a reference,
61
- * so it must not throw and must not guess.
62
- */
63
- declare function parseCloudReference(text: string): CloudReference | null;
64
- /**
65
- * What may appear as the whole body of a `dgmo` fence: the keyword form, or a
66
- * plain link somebody pasted. **Not** the embed spelling — see above.
67
- */
68
- declare function parseCloudReferenceFence(text: string): CloudReference | null;
69
- /**
70
- * The note spelling — `![[live-link:<id>]]` — which extends the
71
- * `![[foo.dgmo]]` transclusion Obsidian and the desktop app already understand.
72
- * Takes the text as TYPED, brackets included, because that is the thing being
73
- * recognised; a host holding only the inside of the brackets puts them back.
74
- */
75
- declare function parseCloudReferenceEmbed(text: string): CloudReference | null;
76
- /** The URL spelling, split out because hosts that only take URLs need just this. */
77
- declare function parseCloudReferenceUrl(text: string): CloudReference | null;
78
- interface ResolveUrlOptions {
79
- /** Origin of the Cloud API. */
80
- base?: string;
81
- }
82
- /** The URL to fetch a reference's source from. Always the current revision. */
83
- declare function referenceSourceUrl(ref: CloudReference, options?: ResolveUrlOptions): string;
84
- /** The human share link for a reference — what a "view this in Diagrammo" link points at. */
85
- declare function referenceShareUrl(ref: CloudReference, options?: {
86
- base?: string;
87
- }): string;
88
- /** The shape of a source response, so consumers don't re-declare it per wrapper. */
89
- interface CloudReferenceSource {
90
- id: string;
91
- source: string;
92
- dgmoVersion: string;
93
- updatedAt: number;
94
- }
95
-
96
- export { CLOUD_API_BASE, CLOUD_APP_BASE, type CloudReference, type CloudReferenceSource, type ResolveUrlOptions, parseCloudReference, parseCloudReferenceEmbed, parseCloudReferenceFence, parseCloudReferenceUrl, referenceShareUrl, referenceSourceUrl };
@@ -1,129 +0,0 @@
1
- /**
2
- * Static completion registries — the LIGHT completion surface
3
- * (`@diagrammo/dgmo/completion`).
4
- *
5
- * Pure data: chart-type directive registries, structural keywords, entity-type
6
- * vocabularies, the reference-grammar descriptor, closed value enums, pipe /
7
- * same-line metadata keys, and the derived metadata key set.
8
- *
9
- * Split out of `./completion` (which additionally owns the symbol *extractors*)
10
- * so editor front-ends can import the registries without dragging the chart
11
- * parsers — notably `body/parser`, whose figure-asset catalog is ~290 KB — onto
12
- * their startup path. Same rationale and rule as `./chart-meta`: only symbols
13
- * whose transitive imports are parser-constant-only live here.
14
- *
15
- * Closed enum sets (`ALL_MARKERS`, wireframe `STATE_KEYWORDS` /
16
- * `GROUP_ONLY_METADATA`) are imported from their owning parsers — never
17
- * hand-copied — so completion can't drift from the grammar (one-oracle rule).
18
- */
19
- /** Specification for a single directive: description + optional enumerated values. */
20
- interface DirectiveValueSpec {
21
- description: string;
22
- values?: string[];
23
- }
24
- /** Specification for a chart type's directives. */
25
- interface DirectiveSpec {
26
- directives: Record<string, DirectiveValueSpec>;
27
- }
28
- /** Chart-type → directive specifications. Every chart type has at least palette + theme. */
29
- declare const COMPLETION_REGISTRY: Map<string, DirectiveSpec>;
30
- declare const CHART_TYPES: ReadonlyArray<{
31
- name: string;
32
- description: string;
33
- }>;
34
- /**
35
- * Entity types for `Name is a <type>` declarations, keyed by chart type.
36
- * Values are sourced from parser constants (VALID_PARTICIPANT_TYPES,
37
- * C4_IS_A_RE).
38
- */
39
- declare const ENTITY_TYPES: Map<string, string[]>;
40
- /**
41
- * Chart-type-specific structural keywords offered on an empty/start-of-line in
42
- * the data zone (block openers like `loop`, section headers like `containers`,
43
- * the `tag` block declaration, etc.). This is the single source of truth for
44
- * the editor's structural-keyword popup — every entry MUST be a token the
45
- * corresponding parser actually recognizes (validated by the
46
- * completion-conformance suite). Do NOT add removed/diagnostic-only tokens
47
- * (e.g. cycle's `no-descriptions`) or tokens the parser ignores.
48
- *
49
- * Chart types not listed here have no structural keywords (most data charts).
50
- */
51
- declare const STRUCTURAL_KEYWORDS: Map<string, string[]>;
52
- /**
53
- * Chart types that support `tag` block declarations (and thus the
54
- * `alias`/`default` sub-keywords inside a tag block). Derived from
55
- * STRUCTURAL_KEYWORDS so the two can never drift — a chart supports tag blocks
56
- * iff it offers the `tag` keyword.
57
- */
58
- declare const TAG_SUPPORTING_TYPES: ReadonlySet<string>;
59
- /** Whether a chart type has a reference position (arrow/operator → a prior
60
- * declaration) and which operators open it. The single oracle that drives
61
- * the library extractor audit, the app's entity-trigger map, and the
62
- * conformance drift-guard — so the three can never disagree. v1 models
63
- * reference-after-operator only (NOT metadata-target references). */
64
- interface ReferenceGrammar {
65
- hasReferenceGrammar: boolean;
66
- /** Literal operator tokens that introduce a reference (e.g. `->`, `<->`,
67
- * `~>`, `+`). The app derives its trigger regex from these (allowing the
68
- * labeled `-label->` / `~label~>` variants where applicable). */
69
- referenceOperators: string[];
70
- }
71
- /**
72
- * Per-type reference grammar. Grounded in each parser's arrow/operator
73
- * grammar — NOT hand-typed blind. Types with no reference position (org,
74
- * kanban, mindmap, all data charts, the radial/visualization types) declare
75
- * `hasReferenceGrammar: false`. `map` references (`route A ~> B`) are owned by
76
- * the app's bespoke geo-completion path, so it stays `false` here to avoid
77
- * double-handling.
78
- */
79
- declare const REFERENCE_GRAMMAR: Map<string, ReferenceGrammar>;
80
- /**
81
- * RACI marker alphabet (slot-7 enum in the role-assignment value position).
82
- * Consumed by editor completion. The chart type is always `raci`; the variant
83
- * (RACI / RASCI / DACI) is inferred from the markers used, so completion offers
84
- * the full union (R / A / S / C / I / D) sourced from `raci/variants.ts`'s
85
- * `ALL_MARKERS` — the marker set can never drift from the parser.
86
- */
87
- declare const RACI_MARKER_ALPHABETS: ReadonlyMap<string, readonly string[]>;
88
- /**
89
- * Closed set of wireframe element state flags (slot-7 trailing enum, e.g.
90
- * `(Submit) primary destructive`). Sourced from the wireframe parser's
91
- * `STATE_KEYWORDS` — exported there and consumed here, never re-typed.
92
- */
93
- declare const WIREFRAME_FLAGS: readonly string[];
94
- /**
95
- * The subset of `WIREFRAME_FLAGS` that only make sense on group elements
96
- * (`[...]`). Editor completion drops these for non-group elements (buttons
97
- * `(...)`, dropdowns `{...}`). Sourced from the wireframe parser's
98
- * `GROUP_ONLY_METADATA` — exported there and consumed here, never re-typed.
99
- */
100
- declare const WIREFRAME_GROUP_ONLY_FLAGS: readonly string[];
101
- /** Specification for a single pipe metadata key. */
102
- interface PipeKeySpec {
103
- description: string;
104
- values?: string[];
105
- }
106
- /**
107
- * Pipe metadata keys for inline `| key value` on data lines.
108
- * Keyed by chart type → { context-name: keys }.
109
- *
110
- * Contexts are open-ended. The two universal ones are:
111
- * - `node` — the default for any non-arrow line
112
- * - `edge` — lines containing an arrow (`->`, `--`)
113
- *
114
- * Charts with richer line types declare additional contexts:
115
- * - raci: `role`, `phase`, `assignment`
116
- * - ring / pyramid: `layer`
117
- * - tech-radar: `quadrant`, `blip`
118
- * - journey-map: `step`
119
- *
120
- * IMPORTANT: NEVER add 'sequence' here. The `|` character in sequence
121
- * diagrams separates display names from identifiers and tag metadata.
122
- * Adding sequence would trigger false pipe-metadata completions on every `|`.
123
- */
124
- type PipeContextMap = Record<string, Record<string, PipeKeySpec>>;
125
- declare const PIPE_METADATA: Map<string, PipeContextMap>;
126
- /** All known directive keys, derived from COMPLETION_REGISTRY. Includes implicit keys. */
127
- declare const METADATA_KEY_SET: ReadonlySet<string>;
128
-
129
- export { CHART_TYPES, COMPLETION_REGISTRY, type DirectiveSpec, type DirectiveValueSpec, ENTITY_TYPES, METADATA_KEY_SET, PIPE_METADATA, type PipeContextMap, type PipeKeySpec, RACI_MARKER_ALPHABETS, REFERENCE_GRAMMAR, type ReferenceGrammar, STRUCTURAL_KEYWORDS, TAG_SUPPORTING_TYPES, WIREFRAME_FLAGS, WIREFRAME_GROUP_ONLY_FLAGS };