@diagrammo/dgmo 0.65.0 → 0.67.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.
@@ -1,264 +1,4 @@
1
- type DgmoSeverity = 'error' | 'warning';
2
- interface DgmoError {
3
- line: number;
4
- column?: number;
5
- message: string;
6
- severity: DgmoSeverity;
7
- /**
8
- * Optional stable diagnostic code (e.g. 'E_ARROW_SUBSTRING_IN_LABEL').
9
- * Additive; pre-existing diagnostics omit this field and existing
10
- * substring-on-`.message` assertions keep working unchanged.
11
- */
12
- code?: string;
13
- }
14
- declare function makeDgmoError(line: number, message: string, severity?: DgmoSeverity, code?: string): DgmoError;
15
- /** Runtime params passed to `emit()` and forwarded to a message builder. */
16
- type DiagnosticParams = Record<string, unknown>;
17
- /**
18
- * Parameter type for a `DiagnosticSpec.message` builder body. Typed loosely
19
- * (`any`) on purpose: builders are hand-authored interpolation bags keyed by
20
- * ad-hoc names, and dgmo's tsconfig enables `noPropertyAccessFromIndexSignature`
21
- * (which forbids `p.name` dot-access on a `Record<string, unknown>`). Using
22
- * `any` here keeps builder bodies readable (`p.name`) instead of forcing
23
- * `p['name']` bracket access at every interpolation site.
24
- */
25
- type DiagnosticMessageParams = any;
26
- interface DiagnosticSpec {
27
- /** Stable diagnostic code, e.g. `'E_MAP_UNKNOWN_PLACE'`. */
28
- code: string;
29
- /** Severity — must agree with the `E_`/`W_`/`I_` code prefix. */
30
- severity: DgmoSeverity;
31
- /** Owning chart type (`'map'`, `'swimlane'`, …) or `null` for universal/global codes. */
32
- chartType: string | null;
33
- /** Short human label for the catalog UI. */
34
- title: string;
35
- /**
36
- * Canonical message wording. A plain string for static messages, or a
37
- * builder `(params) => string` when the message interpolates runtime
38
- * values. The builder must tolerate being called with `{}` so the
39
- * catalog can show a representative message without live params.
40
- */
41
- message: string | ((params: DiagnosticMessageParams) => string);
42
- /** Optional fix guidance shown alongside the message. */
43
- hint?: string;
44
- /** Minimal `.dgmo` source that triggers this diagnostic (for docs/console). */
45
- example?: string;
46
- }
47
- /** Optional extras when emitting (currently just an explicit column). */
48
- interface EmitOptions {
49
- column?: number;
50
- }
51
- /**
52
- * Emit a diagnostic from its `DiagnosticSpec`. The code, severity, and
53
- * canonical wording all come from the spec — call sites supply only the
54
- * line and the interpolation params, so the code/severity can never drift
55
- * out of sync with the declared spec. Replaces the per-parser
56
- * `push`/`err`/`fail` wrappers that each re-declared this shape.
57
- */
58
- declare function emit(spec: DiagnosticSpec, line: number, params?: DiagnosticParams, opts?: EmitOptions): DgmoError;
59
- declare function formatDgmoError(err: DgmoError): string;
60
-
61
- /**
62
- * Compact view state schema (ADR-6).
63
- * All fields optional. Only non-default values are encoded.
64
- * `tag: null` means "user chose none"; absent `tag` means "use DSL default" (ADR-5).
65
- */
66
- interface CompactViewState {
67
- tag?: string | null;
68
- cs?: number[];
69
- cg?: string[];
70
- swim?: string | null;
71
- cl?: string[];
72
- cc?: string[];
73
- rm?: string;
74
- htv?: Record<string, string[]>;
75
- ha?: string[];
76
- sem?: boolean;
77
- cm?: boolean;
78
- c4l?: string;
79
- c4s?: string;
80
- c4c?: string;
81
- rps?: number;
82
- spd?: number;
83
- io?: Record<string, number>;
84
- hd?: boolean;
85
- cbd?: boolean;
86
- rq?: string;
87
- an?: boolean;
88
- fl?: boolean;
89
- }
90
- interface DecodedDiagramUrl {
91
- dsl: string;
92
- viewState: CompactViewState;
93
- palette?: string;
94
- theme?: 'light' | 'dark';
95
- filename?: string;
96
- }
97
- interface EncodeDiagramUrlOptions {
98
- baseUrl?: string;
99
- viewState?: CompactViewState;
100
- palette?: string;
101
- theme?: 'light' | 'dark';
102
- filename?: string;
103
- }
104
- type EncodeDiagramUrlResult = {
105
- url: string;
106
- error?: undefined;
107
- } | {
108
- url?: undefined;
109
- error: 'too-large';
110
- compressedSize: number;
111
- limit: number;
112
- };
113
- /**
114
- * Encode a CompactViewState to a compressed string for URL embedding.
115
- * Returns empty string if state has no keys (ADR-4).
116
- */
117
- declare function encodeViewState(state: CompactViewState): string;
118
- /**
119
- * Decode a compressed view state string back to CompactViewState.
120
- * Returns empty object on failure (no crash).
121
- */
122
- declare function decodeViewState(encoded: string): CompactViewState;
123
- /**
124
- * Compress a DGMO DSL string into a shareable URL.
125
- * Returns `{ url }` on success, or `{ error: 'too-large', compressedSize, limit }` if the
126
- * compressed payload exceeds the 8 KB limit.
127
- */
128
- declare function encodeDiagramUrl(dsl: string, options?: EncodeDiagramUrlOptions): EncodeDiagramUrlResult;
129
- /**
130
- * Decode a DGMO DSL string and view state from a URL query string or hash.
131
- * Accepts any of:
132
- * - `?dgmo=<payload>&vs=<state>`
133
- * - `#dgmo=<payload>&vs=<state>` (backwards compat)
134
- * - `dgmo=<payload>`
135
- * - `<bare payload>`
136
- *
137
- * Returns `{ dsl, viewState }`. The DSL is empty string on invalid input.
138
- */
139
- declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
140
-
141
- /**
142
- * Color definitions for a single mode (light or dark).
143
- * 10 semantic UI colors + 9 named accent colors = 19 total.
144
- *
145
- * `readonly` on every field (and the nested `colors` map) by design —
146
- * palettes flow from the registry into every renderer; nothing in the
147
- * pipeline should ever mutate a palette in place.
148
- */
149
- interface PaletteColors {
150
- /** Main background (#eceff4 light / #2e3440 dark for Nord) */
151
- readonly bg: string;
152
- /** Cards, panels (#e5e9f0 / #3b4252) */
153
- readonly surface: string;
154
- /** Popovers, dropdowns (#e5e9f0 / #434c5e) */
155
- readonly overlay: string;
156
- /** Borders, dividers, muted (#d8dee9 / #4c566a) */
157
- readonly border: string;
158
- /** Primary text (#2e3440 / #eceff4) */
159
- readonly text: string;
160
- /** Secondary/diminished text (#4c566a / #d8dee9) */
161
- readonly textMuted: string;
162
- /**
163
- * Light-mode arg for `contrastText()` when text is rendered on a
164
- * tinted shape fill (e.g. `shapeFill()` output). Must guarantee
165
- * ≥ 4.5:1 WCAG AA against any `shapeFill()` the palette can produce.
166
- * Distinct from `colors.white` because palette-aesthetic anchors don't
167
- * always meet contrast requirements (TD-5).
168
- */
169
- readonly textOnFillLight: string;
170
- /** Dark-mode counterpart to `textOnFillLight`. */
171
- readonly textOnFillDark: string;
172
- /** Primary accent — buttons, links */
173
- readonly primary: string;
174
- /** Secondary accent */
175
- readonly secondary: string;
176
- /** Tertiary accent */
177
- readonly accent: string;
178
- /** Error/danger */
179
- readonly destructive: string;
180
- /**
181
- * Used for: inline annotations (red), pie charts, cScale,
182
- * series rotation, journey actors, Gantt tasks.
183
- */
184
- readonly colors: {
185
- readonly red: string;
186
- readonly orange: string;
187
- readonly yellow: string;
188
- readonly green: string;
189
- readonly blue: string;
190
- readonly purple: string;
191
- readonly teal: string;
192
- readonly cyan: string;
193
- readonly gray: string;
194
- readonly black: string;
195
- readonly white: string;
196
- };
197
- }
198
- /**
199
- * Complete palette definition. One object per color scheme.
200
- * This is what palette authors create — the single artifact for NFR1.
201
- *
202
- * Palettes are immutable from the consumer's perspective; the registry
203
- * hands out the same frozen-shape object on every `getPalette(id)`.
204
- */
205
- interface PaletteConfig {
206
- /** Registry key: 'nord', 'slate', 'catppuccin' */
207
- readonly id: string;
208
- /** Display name: 'Nord', 'Slate', 'Catppuccin' */
209
- readonly name: string;
210
- /** Light mode color definitions */
211
- readonly light: PaletteColors;
212
- /** Dark mode color definitions */
213
- readonly dark: PaletteColors;
214
- }
215
-
216
- /** A single entry inside a tag group: `Value color` */
217
- interface TagEntry {
218
- readonly value: string;
219
- readonly color: string;
220
- /**
221
- * The color NAME the author wrote (one of the recognized palette names),
222
- * when the entry declared an explicit color. Absent for bare/auto-colored
223
- * entries. `color` above is always the RESOLVED hex (auto and explicit are
224
- * indistinguishable there); this preserves the authored-vs-auto distinction
225
- * so a GUI editor can round-trip an explicit color through a reparse.
226
- */
227
- readonly authoredColor?: string;
228
- readonly lineNumber: number;
229
- }
230
- /**
231
- * A tag group block: heading + entries.
232
- *
233
- * Parser internals build via `Writable<TagGroup>` from `utils/brand.ts`;
234
- * once returned to a chart-type parser, consumers see the readonly view.
235
- */
236
- interface TagGroup {
237
- readonly name: string;
238
- readonly alias?: string;
239
- readonly entries: readonly TagEntry[];
240
- /** Default value for nodes without explicit metadata. First entry unless another is marked `default`. */
241
- readonly defaultValue?: string;
242
- readonly lineNumber: number;
243
- }
244
- /**
245
- * DOM-safe key for a tag group — used wherever the group name becomes a
246
- * `data-tag-*` attribute suffix, an entity metadata key, or an `active-tag`
247
- * match target. For a single-identifier name (the only form the parser used to
248
- * accept) this is exactly `name.toLowerCase()`, so swapping it in for existing
249
- * diagrams is byte-identical. A quoted multi-word name (`tag "Trust Zone" as tz`)
250
- * slugs to a hyphenated identifier (`trust-zone`) so it never produces an
251
- * invalid DOM attribute name; the original `name` is kept for the legend label.
252
- */
253
- declare function tagAttrKey(name: string): string;
254
- /**
255
- * The categorical name cycle used to auto-assign colors to bare tag values,
256
- * in deterministic order. Aliased to the shared {@link CATEGORICAL_COLOR_ORDER}
257
- * (RGB-seeded, max-contrast, neutrals excluded) so tag swatches and data-chart
258
- * series colors share one canonical rotation. If a group has more colorless
259
- * entries than free categorical names, the cycle wraps.
260
- */
261
- declare const autoTagColorCycle: readonly string[];
1
+ import { P as PaletteConfig, D as DgmoError } from './tag-groups-NUA2F1I5.js';
262
2
 
263
3
  /** Validate that a hex string is well-formed (#RGB or #RRGGBB). */
264
4
  declare function isValidHex(value: string): boolean;
@@ -537,4 +277,4 @@ declare function parseDgmo(content: string): {
537
277
  chartType: string | null;
538
278
  };
539
279
 
540
- export { isExtendedChartType as A, isValidHex as B, type CompactViewState as C, type DiagnosticSpec as D, type EmitOptions as E, knownChartTypeIds as F, makeDgmoError as G, parseDgmoChartType as H, registerPalette as I, tagAttrKey as J, type PaletteConfig as P, type RenderCategory as R, type TagGroup as T, type DgmoError as a, type ChartTypeId as b, type ChartTypeMeta as c, type DgmoSeverity as d, type DiagnosticParams as e, type PaletteColors as f, chartTypes as g, emit as h, formatDgmoError as i, getPalette as j, type TagEntry as k, CHART_TYPE_DESCRIPTIONS as l, type DecodedDiagramUrl as m, type EncodeDiagramUrlOptions as n, type EncodeDiagramUrlResult as o, parseDgmo as p, autoTagColorCycle as q, resolvePaletteOrFallback as r, chartTypeParsers as s, decodeDiagramUrl as t, decodeViewState as u, encodeDiagramUrl as v, encodeViewState as w, getAllChartTypes as x, getAvailablePalettes as y, getRenderCategory as z };
280
+ export { type ChartTypeId as C, type RenderCategory as R, type ChartTypeMeta as a, CHART_TYPE_DESCRIPTIONS as b, chartTypes as c, chartTypeParsers as d, getAllChartTypes as e, getAvailablePalettes as f, getPalette as g, getRenderCategory as h, isExtendedChartType as i, isValidHex as j, knownChartTypeIds as k, parseDgmoChartType as l, registerPalette as m, parseDgmo as p, resolvePaletteOrFallback as r };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
- import { D as DiagnosticSpec, P as PaletteConfig, C as CompactViewState, a as DgmoError } from './dgmo-router-Dd5PTjxl.js';
2
- export { b as ChartTypeId, c as ChartTypeMeta, d as DgmoSeverity, e as DiagnosticParams, E as EmitOptions, f as PaletteColors, g as chartTypes, h as emit, i as formatDgmoError, j as getPalette, r as resolvePaletteOrFallback, p as validate } from './dgmo-router-Dd5PTjxl.js';
3
- import { T as Theme, M as MapDataSource } from './themes-DiUAG4Bf.js';
4
- export { G as Gazetteer, a as GazetteerEntry, b as MapCompletionOptions, c as MapData, d as MapLocationMatch, e as MapPlaceCompletion, f as MapRegionCompletion, R as RegionName, g as RegionNames, h as completeMapPlaces, i as completeMapRegions, p as palettes, s as searchMapLocations, t as themes } from './themes-DiUAG4Bf.js';
1
+ import { b as DiagnosticSpec, P as PaletteConfig, C as CompactViewState, D as DgmoError } from './tag-groups-NUA2F1I5.js';
2
+ export { c as DgmoSeverity, d as DiagnosticParams, E as EmitOptions, a as PaletteColors, e as emit, f as formatDgmoError } from './tag-groups-NUA2F1I5.js';
3
+ export { C as ChartTypeId, a as ChartTypeMeta, c as chartTypes, g as getPalette, r as resolvePaletteOrFallback, p as validate } from './dgmo-router-EAW7XiBE.js';
4
+ import { T as Theme } from './themes-Dem5xalq.js';
5
+ export { M as MapCompletionOptions, a as MapLocationMatch, b as MapPlaceCompletion, c as MapRegionCompletion, d as completeMapPlaces, e as completeMapRegions, p as palettes, s as searchMapLocations, t as themes } from './themes-Dem5xalq.js';
6
+ import { M as MapDataSource } from './d3-Bfhj-XBX.js';
7
+ export { G as Gazetteer, a as GazetteerEntry, b as MapData, R as RegionName, c as RegionNames } from './d3-Bfhj-XBX.js';
5
8
 
6
9
  /**
7
10
  * Make an SVG produced by `@diagrammo/dgmo`'s static `render()` suitable for
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-SQAG3UXH.js";
12
12
  import {
13
13
  render
14
- } from "./chunk-ZZXPYVS4.js";
14
+ } from "./chunk-HJ62AO3J.js";
15
15
  import {
16
16
  renderErrorCard
17
17
  } from "./chunk-7L53J53J.js";
@@ -5,8 +5,9 @@ import {
5
5
  buildRenderSequence,
6
6
  computeActivations,
7
7
  groupMessagesBySection,
8
- renderSequenceDiagram
9
- } from "./chunk-6IUL6LER.js";
8
+ renderSequenceDiagram,
9
+ summarizeSectionParticipation
10
+ } from "./chunk-WDLD5MU5.js";
10
11
  import "./chunk-NCT22MOD.js";
11
12
  import {
12
13
  parseInlineMarkdown,
@@ -39,6 +40,7 @@ export {
39
40
  groupMessagesBySection,
40
41
  parseInlineMarkdown,
41
42
  renderSequenceDiagram,
43
+ summarizeSectionParticipation,
42
44
  truncateBareUrl
43
45
  };
44
- //# sourceMappingURL=renderer-ALP46W2X.js.map
46
+ //# sourceMappingURL=renderer-KY6PADCM.js.map
@@ -0,0 +1,263 @@
1
+ type DgmoSeverity = 'error' | 'warning';
2
+ interface DgmoError {
3
+ line: number;
4
+ column?: number;
5
+ message: string;
6
+ severity: DgmoSeverity;
7
+ /**
8
+ * Optional stable diagnostic code (e.g. 'E_ARROW_SUBSTRING_IN_LABEL').
9
+ * Additive; pre-existing diagnostics omit this field and existing
10
+ * substring-on-`.message` assertions keep working unchanged.
11
+ */
12
+ code?: string;
13
+ }
14
+ declare function makeDgmoError(line: number, message: string, severity?: DgmoSeverity, code?: string): DgmoError;
15
+ /** Runtime params passed to `emit()` and forwarded to a message builder. */
16
+ type DiagnosticParams = Record<string, unknown>;
17
+ /**
18
+ * Parameter type for a `DiagnosticSpec.message` builder body. Typed loosely
19
+ * (`any`) on purpose: builders are hand-authored interpolation bags keyed by
20
+ * ad-hoc names, and dgmo's tsconfig enables `noPropertyAccessFromIndexSignature`
21
+ * (which forbids `p.name` dot-access on a `Record<string, unknown>`). Using
22
+ * `any` here keeps builder bodies readable (`p.name`) instead of forcing
23
+ * `p['name']` bracket access at every interpolation site.
24
+ */
25
+ type DiagnosticMessageParams = any;
26
+ interface DiagnosticSpec {
27
+ /** Stable diagnostic code, e.g. `'E_MAP_UNKNOWN_PLACE'`. */
28
+ code: string;
29
+ /** Severity — must agree with the `E_`/`W_`/`I_` code prefix. */
30
+ severity: DgmoSeverity;
31
+ /** Owning chart type (`'map'`, `'swimlane'`, …) or `null` for universal/global codes. */
32
+ chartType: string | null;
33
+ /** Short human label for the catalog UI. */
34
+ title: string;
35
+ /**
36
+ * Canonical message wording. A plain string for static messages, or a
37
+ * builder `(params) => string` when the message interpolates runtime
38
+ * values. The builder must tolerate being called with `{}` so the
39
+ * catalog can show a representative message without live params.
40
+ */
41
+ message: string | ((params: DiagnosticMessageParams) => string);
42
+ /** Optional fix guidance shown alongside the message. */
43
+ hint?: string;
44
+ /** Minimal `.dgmo` source that triggers this diagnostic (for docs/console). */
45
+ example?: string;
46
+ }
47
+ /** Optional extras when emitting (currently just an explicit column). */
48
+ interface EmitOptions {
49
+ column?: number;
50
+ }
51
+ /**
52
+ * Emit a diagnostic from its `DiagnosticSpec`. The code, severity, and
53
+ * canonical wording all come from the spec — call sites supply only the
54
+ * line and the interpolation params, so the code/severity can never drift
55
+ * out of sync with the declared spec. Replaces the per-parser
56
+ * `push`/`err`/`fail` wrappers that each re-declared this shape.
57
+ */
58
+ declare function emit(spec: DiagnosticSpec, line: number, params?: DiagnosticParams, opts?: EmitOptions): DgmoError;
59
+ declare function formatDgmoError(err: DgmoError): string;
60
+
61
+ /**
62
+ * Compact view state schema (ADR-6).
63
+ * All fields optional. Only non-default values are encoded.
64
+ * `tag: null` means "user chose none"; absent `tag` means "use DSL default" (ADR-5).
65
+ */
66
+ interface CompactViewState {
67
+ tag?: string | null;
68
+ cs?: number[];
69
+ cg?: string[];
70
+ swim?: string | null;
71
+ cl?: string[];
72
+ cc?: string[];
73
+ rm?: string;
74
+ htv?: Record<string, string[]>;
75
+ ha?: string[];
76
+ sem?: boolean;
77
+ cm?: boolean;
78
+ c4l?: string;
79
+ c4s?: string;
80
+ c4c?: string;
81
+ rps?: number;
82
+ spd?: number;
83
+ io?: Record<string, number>;
84
+ hd?: boolean;
85
+ cbd?: boolean;
86
+ rq?: string;
87
+ an?: boolean;
88
+ fl?: boolean;
89
+ }
90
+ interface DecodedDiagramUrl {
91
+ dsl: string;
92
+ viewState: CompactViewState;
93
+ palette?: string;
94
+ theme?: 'light' | 'dark';
95
+ filename?: string;
96
+ }
97
+ interface EncodeDiagramUrlOptions {
98
+ baseUrl?: string;
99
+ viewState?: CompactViewState;
100
+ palette?: string;
101
+ theme?: 'light' | 'dark';
102
+ filename?: string;
103
+ }
104
+ type EncodeDiagramUrlResult = {
105
+ url: string;
106
+ error?: undefined;
107
+ } | {
108
+ url?: undefined;
109
+ error: 'too-large';
110
+ compressedSize: number;
111
+ limit: number;
112
+ };
113
+ /**
114
+ * Encode a CompactViewState to a compressed string for URL embedding.
115
+ * Returns empty string if state has no keys (ADR-4).
116
+ */
117
+ declare function encodeViewState(state: CompactViewState): string;
118
+ /**
119
+ * Decode a compressed view state string back to CompactViewState.
120
+ * Returns empty object on failure (no crash).
121
+ */
122
+ declare function decodeViewState(encoded: string): CompactViewState;
123
+ /**
124
+ * Compress a DGMO DSL string into a shareable URL.
125
+ * Returns `{ url }` on success, or `{ error: 'too-large', compressedSize, limit }` if the
126
+ * compressed payload exceeds the 8 KB limit.
127
+ */
128
+ declare function encodeDiagramUrl(dsl: string, options?: EncodeDiagramUrlOptions): EncodeDiagramUrlResult;
129
+ /**
130
+ * Decode a DGMO DSL string and view state from a URL query string or hash.
131
+ * Accepts any of:
132
+ * - `?dgmo=<payload>&vs=<state>`
133
+ * - `#dgmo=<payload>&vs=<state>` (backwards compat)
134
+ * - `dgmo=<payload>`
135
+ * - `<bare payload>`
136
+ *
137
+ * Returns `{ dsl, viewState }`. The DSL is empty string on invalid input.
138
+ */
139
+ declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
140
+
141
+ /**
142
+ * Color definitions for a single mode (light or dark).
143
+ * 10 semantic UI colors + 9 named accent colors = 19 total.
144
+ *
145
+ * `readonly` on every field (and the nested `colors` map) by design —
146
+ * palettes flow from the registry into every renderer; nothing in the
147
+ * pipeline should ever mutate a palette in place.
148
+ */
149
+ interface PaletteColors {
150
+ /** Main background (#eceff4 light / #2e3440 dark for Nord) */
151
+ readonly bg: string;
152
+ /** Cards, panels (#e5e9f0 / #3b4252) */
153
+ readonly surface: string;
154
+ /** Popovers, dropdowns (#e5e9f0 / #434c5e) */
155
+ readonly overlay: string;
156
+ /** Borders, dividers, muted (#d8dee9 / #4c566a) */
157
+ readonly border: string;
158
+ /** Primary text (#2e3440 / #eceff4) */
159
+ readonly text: string;
160
+ /** Secondary/diminished text (#4c566a / #d8dee9) */
161
+ readonly textMuted: string;
162
+ /**
163
+ * Light-mode arg for `contrastText()` when text is rendered on a
164
+ * tinted shape fill (e.g. `shapeFill()` output). Must guarantee
165
+ * ≥ 4.5:1 WCAG AA against any `shapeFill()` the palette can produce.
166
+ * Distinct from `colors.white` because palette-aesthetic anchors don't
167
+ * always meet contrast requirements (TD-5).
168
+ */
169
+ readonly textOnFillLight: string;
170
+ /** Dark-mode counterpart to `textOnFillLight`. */
171
+ readonly textOnFillDark: string;
172
+ /** Primary accent — buttons, links */
173
+ readonly primary: string;
174
+ /** Secondary accent */
175
+ readonly secondary: string;
176
+ /** Tertiary accent */
177
+ readonly accent: string;
178
+ /** Error/danger */
179
+ readonly destructive: string;
180
+ /**
181
+ * Used for: inline annotations (red), pie charts, cScale,
182
+ * series rotation, journey actors, Gantt tasks.
183
+ */
184
+ readonly colors: {
185
+ readonly red: string;
186
+ readonly orange: string;
187
+ readonly yellow: string;
188
+ readonly green: string;
189
+ readonly blue: string;
190
+ readonly purple: string;
191
+ readonly teal: string;
192
+ readonly cyan: string;
193
+ readonly gray: string;
194
+ readonly black: string;
195
+ readonly white: string;
196
+ };
197
+ }
198
+ /**
199
+ * Complete palette definition. One object per color scheme.
200
+ * This is what palette authors create — the single artifact for NFR1.
201
+ *
202
+ * Palettes are immutable from the consumer's perspective; the registry
203
+ * hands out the same frozen-shape object on every `getPalette(id)`.
204
+ */
205
+ interface PaletteConfig {
206
+ /** Registry key: 'nord', 'slate', 'catppuccin' */
207
+ readonly id: string;
208
+ /** Display name: 'Nord', 'Slate', 'Catppuccin' */
209
+ readonly name: string;
210
+ /** Light mode color definitions */
211
+ readonly light: PaletteColors;
212
+ /** Dark mode color definitions */
213
+ readonly dark: PaletteColors;
214
+ }
215
+
216
+ /** A single entry inside a tag group: `Value color` */
217
+ interface TagEntry {
218
+ readonly value: string;
219
+ readonly color: string;
220
+ /**
221
+ * The color NAME the author wrote (one of the recognized palette names),
222
+ * when the entry declared an explicit color. Absent for bare/auto-colored
223
+ * entries. `color` above is always the RESOLVED hex (auto and explicit are
224
+ * indistinguishable there); this preserves the authored-vs-auto distinction
225
+ * so a GUI editor can round-trip an explicit color through a reparse.
226
+ */
227
+ readonly authoredColor?: string;
228
+ readonly lineNumber: number;
229
+ }
230
+ /**
231
+ * A tag group block: heading + entries.
232
+ *
233
+ * Parser internals build via `Writable<TagGroup>` from `utils/brand.ts`;
234
+ * once returned to a chart-type parser, consumers see the readonly view.
235
+ */
236
+ interface TagGroup {
237
+ readonly name: string;
238
+ readonly alias?: string;
239
+ readonly entries: readonly TagEntry[];
240
+ /** Default value for nodes without explicit metadata. First entry unless another is marked `default`. */
241
+ readonly defaultValue?: string;
242
+ readonly lineNumber: number;
243
+ }
244
+ /**
245
+ * DOM-safe key for a tag group — used wherever the group name becomes a
246
+ * `data-tag-*` attribute suffix, an entity metadata key, or an `active-tag`
247
+ * match target. For a single-identifier name (the only form the parser used to
248
+ * accept) this is exactly `name.toLowerCase()`, so swapping it in for existing
249
+ * diagrams is byte-identical. A quoted multi-word name (`tag "Trust Zone" as tz`)
250
+ * slugs to a hyphenated identifier (`trust-zone`) so it never produces an
251
+ * invalid DOM attribute name; the original `name` is kept for the legend label.
252
+ */
253
+ declare function tagAttrKey(name: string): string;
254
+ /**
255
+ * The categorical name cycle used to auto-assign colors to bare tag values,
256
+ * in deterministic order. Aliased to the shared {@link CATEGORICAL_COLOR_ORDER}
257
+ * (RGB-seeded, max-contrast, neutrals excluded) so tag swatches and data-chart
258
+ * series colors share one canonical rotation. If a group has more colorless
259
+ * entries than free categorical names, the cycle wraps.
260
+ */
261
+ declare const autoTagColorCycle: readonly string[];
262
+
263
+ export { type CompactViewState as C, type DgmoError as D, type EmitOptions as E, type PaletteConfig as P, type TagGroup as T, type PaletteColors as a, type DiagnosticSpec as b, type DgmoSeverity as c, type DiagnosticParams as d, emit as e, formatDgmoError as f, type TagEntry as g, type DecodedDiagramUrl as h, type EncodeDiagramUrlOptions as i, type EncodeDiagramUrlResult as j, autoTagColorCycle as k, decodeDiagramUrl as l, decodeViewState as m, encodeDiagramUrl as n, encodeViewState as o, makeDgmoError as p, tagAttrKey as t };