@kekonic/diagrams-ui 1.0.0-rc.4

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.
@@ -0,0 +1,223 @@
1
+ //#region src/shiki/kdiagram.d.ts
2
+ /**
3
+ * TextMate grammar for KDiagram — used by Shiki (docs) and Monaco (studio).
4
+ * Operators stay in sync with `@kekonic/diagrams-core` EDGE_OPS.
5
+ *
6
+ * Soft-keyword rule: kinds, atoms, and animation cues are position-scoped so
7
+ * node ids like `worker` / group ids like `parallel` stay plain identifiers.
8
+ */
9
+ declare const kdiagramLanguage: {
10
+ name: string;
11
+ scopeName: string;
12
+ aliases: string[];
13
+ patterns: {
14
+ include: string;
15
+ }[];
16
+ repository: {
17
+ comments: {
18
+ patterns: ({
19
+ name: string;
20
+ match: string;
21
+ begin?: undefined;
22
+ end?: undefined;
23
+ } | {
24
+ name: string;
25
+ begin: string;
26
+ end: string;
27
+ match?: undefined;
28
+ })[];
29
+ }; /** `diagram|state {` or a quoted title — title string is optional. */
30
+ "diagram-header": {
31
+ name: string;
32
+ begin: string;
33
+ end: string;
34
+ beginCaptures: {
35
+ 0: {
36
+ name: string;
37
+ };
38
+ };
39
+ patterns: {
40
+ include: string;
41
+ }[];
42
+ }; /** Full sequence block so fragment/activate words stay scoped. */
43
+ "sequence-block": {
44
+ name: string;
45
+ begin: string;
46
+ beginCaptures: {
47
+ 1: {
48
+ name: string;
49
+ };
50
+ 2: {
51
+ name: string;
52
+ };
53
+ 3: {
54
+ name: string;
55
+ };
56
+ };
57
+ end: string;
58
+ endCaptures: {
59
+ 0: {
60
+ name: string;
61
+ };
62
+ };
63
+ patterns: {
64
+ include: string;
65
+ }[];
66
+ };
67
+ "sequence-keywords": {
68
+ name: string;
69
+ match: string;
70
+ };
71
+ /**
72
+ * Full animation block so cue words stay scoped (node id `flow` / group
73
+ * `parallel` must not light up as keywords in the rest of the diagram).
74
+ */
75
+ "animation-block": {
76
+ name: string;
77
+ begin: string;
78
+ beginCaptures: {
79
+ 1: {
80
+ name: string;
81
+ };
82
+ 2: {
83
+ name: string;
84
+ };
85
+ 3: {
86
+ name: string;
87
+ };
88
+ };
89
+ end: string;
90
+ endCaptures: {
91
+ 0: {
92
+ name: string;
93
+ };
94
+ };
95
+ patterns: {
96
+ include: string;
97
+ }[];
98
+ };
99
+ "animation-parallel": {
100
+ name: string;
101
+ begin: string;
102
+ beginCaptures: {
103
+ 1: {
104
+ name: string;
105
+ };
106
+ 2: {
107
+ name: string;
108
+ };
109
+ };
110
+ end: string;
111
+ endCaptures: {
112
+ 0: {
113
+ name: string;
114
+ };
115
+ };
116
+ patterns: {
117
+ include: string;
118
+ }[];
119
+ };
120
+ "animation-cues": {
121
+ name: string;
122
+ match: string;
123
+ };
124
+ "columns-block": {
125
+ name: string;
126
+ begin: string;
127
+ end: string;
128
+ beginCaptures: {
129
+ 0: {
130
+ name: string;
131
+ };
132
+ };
133
+ patterns: ({
134
+ include: string;
135
+ name?: undefined;
136
+ begin?: undefined;
137
+ end?: undefined;
138
+ beginCaptures?: undefined;
139
+ patterns?: undefined;
140
+ } | {
141
+ name: string;
142
+ begin: string;
143
+ end: string;
144
+ beginCaptures: {
145
+ 1: {
146
+ name: string;
147
+ };
148
+ 2: {
149
+ name: string;
150
+ };
151
+ };
152
+ patterns: ({
153
+ include: string;
154
+ name?: undefined;
155
+ match?: undefined;
156
+ } | {
157
+ name: string;
158
+ match: string;
159
+ include?: undefined;
160
+ })[];
161
+ include?: undefined;
162
+ })[];
163
+ };
164
+ strings: {
165
+ name: string;
166
+ begin: string;
167
+ end: string;
168
+ patterns: {
169
+ name: string;
170
+ match: string;
171
+ }[];
172
+ };
173
+ operators: {
174
+ name: string;
175
+ match: string;
176
+ };
177
+ keywords: {
178
+ name: string;
179
+ match: string;
180
+ }; /** Kinds only in `id: kind` / property value position — not as edge endpoints. */
181
+ kinds: {
182
+ name: string;
183
+ match: string;
184
+ };
185
+ "column-flags": {
186
+ name: string;
187
+ match: string;
188
+ };
189
+ "sql-types": {
190
+ name: string;
191
+ match: string;
192
+ }; /** Enum-like values after `key:` — not bare ids named `high` / `pack`. */
193
+ atoms: {
194
+ name: string;
195
+ match: string;
196
+ }; /** `direction LR` / `density compact` (no colon). */
197
+ "direction-atoms": {
198
+ name: string;
199
+ match: string;
200
+ };
201
+ properties: {
202
+ name: string;
203
+ match: string;
204
+ };
205
+ numbers: {
206
+ name: string;
207
+ match: string;
208
+ };
209
+ colors: {
210
+ name: string;
211
+ match: string;
212
+ };
213
+ punctuation: {
214
+ name: string;
215
+ match: string;
216
+ };
217
+ };
218
+ };
219
+ /** Snapshot for tests — must match lexer EDGE_OPS. */
220
+ declare const KDIAGRAM_EDGE_OPS: ("<->" | "<.." | "<~" | "<=" | "<-" | "x-" | "=>" | "~>" | "..>" | "-->" | "-x" | "->" | "--")[];
221
+ //#endregion
222
+ export { KDIAGRAM_EDGE_OPS, kdiagramLanguage as default, kdiagramLanguage };
223
+ //# sourceMappingURL=kdiagram.d.mts.map
@@ -0,0 +1,381 @@
1
+ import { BUILTIN_KIND_LIST, EDGE_OPS } from "@kekonic/diagrams-core";
2
+ //#region src/shiki/kdiagram.ts
3
+ /**
4
+ * TextMate grammar for KDiagram — used by Shiki (docs) and Monaco (studio).
5
+ * Operators stay in sync with `@kekonic/diagrams-core` EDGE_OPS.
6
+ *
7
+ * Soft-keyword rule: kinds, atoms, and animation cues are position-scoped so
8
+ * node ids like `worker` / group ids like `parallel` stay plain identifiers.
9
+ */
10
+ function edgeOpsPatternLocal() {
11
+ return EDGE_OPS.map((op) => op.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
12
+ }
13
+ /** Statement intros — safe-ish globally (parser treats them as soft keywords). */
14
+ const keywords = [
15
+ "kdiagram",
16
+ "direction",
17
+ "density",
18
+ "group",
19
+ "boundary",
20
+ "zone",
21
+ "swimlane",
22
+ "layout",
23
+ "edges",
24
+ "style",
25
+ "render",
26
+ "presentation",
27
+ "is",
28
+ "for",
29
+ "edge",
30
+ "svg"
31
+ ];
32
+ /** Only highlighted inside `animation "…" { … }` (and nested `parallel { }`). */
33
+ const animationCues = [
34
+ "dim",
35
+ "activate",
36
+ "pulse",
37
+ "flow",
38
+ "wait",
39
+ "loop"
40
+ ];
41
+ /** Only highlighted inside `sequence "…" { … }`. */
42
+ const sequenceKeywords = [
43
+ "activate",
44
+ "deactivate",
45
+ "create",
46
+ "destroy",
47
+ "note",
48
+ "autonumber",
49
+ "alt",
50
+ "alternate",
51
+ "else",
52
+ "otherwise",
53
+ "opt",
54
+ "optional",
55
+ "loop",
56
+ "par",
57
+ "parallel",
58
+ "and",
59
+ "also",
60
+ "critical",
61
+ "break",
62
+ "section",
63
+ "box",
64
+ "divider",
65
+ "over",
66
+ "left",
67
+ "right",
68
+ "of"
69
+ ];
70
+ /** Escape regex metacharacters in kind ids (none today, but keep safe). */
71
+ const kinds = [...BUILTIN_KIND_LIST].map((k) => k.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
72
+ const atoms = [
73
+ "LR",
74
+ "RL",
75
+ "TD",
76
+ "BT",
77
+ "TB",
78
+ "down",
79
+ "right",
80
+ "true",
81
+ "false",
82
+ "compact",
83
+ "normal",
84
+ "spacious",
85
+ "flat",
86
+ "compound",
87
+ "auto",
88
+ "straight",
89
+ "balanced",
90
+ "basic",
91
+ "metro",
92
+ "rounded",
93
+ "orthogonal",
94
+ "bezier",
95
+ "jumps",
96
+ "smart",
97
+ "gap",
98
+ "gaps",
99
+ "none",
100
+ "tight",
101
+ "wide",
102
+ "on",
103
+ "off",
104
+ "high",
105
+ "low",
106
+ "yes",
107
+ "no",
108
+ "dark",
109
+ "light",
110
+ "pack",
111
+ "stack",
112
+ "flow",
113
+ "row",
114
+ "grid",
115
+ "stretch",
116
+ "start",
117
+ "middle",
118
+ "end",
119
+ "begin",
120
+ "center",
121
+ "target",
122
+ "source"
123
+ ];
124
+ const columnFlags = [
125
+ "PK",
126
+ "FK",
127
+ "UK",
128
+ "NN",
129
+ "PRIMARY",
130
+ "FOREIGN",
131
+ "UNIQUE",
132
+ "NOTNULL",
133
+ "NOT_NULL"
134
+ ];
135
+ const sqlTypes = [
136
+ "uuid",
137
+ "text",
138
+ "int",
139
+ "integer",
140
+ "bigint",
141
+ "smallint",
142
+ "bool",
143
+ "boolean",
144
+ "real",
145
+ "float",
146
+ "double",
147
+ "numeric",
148
+ "decimal",
149
+ "money",
150
+ "date",
151
+ "time",
152
+ "timestamp",
153
+ "timestamptz",
154
+ "timetz",
155
+ "json",
156
+ "jsonb",
157
+ "bytea",
158
+ "blob",
159
+ "varchar",
160
+ "char",
161
+ "serial",
162
+ "bigserial"
163
+ ];
164
+ /** Association `--` must not steal CSS custom props (`--icon-color`); keep `-->` intact. */
165
+ const operatorsPattern = `(${edgeOpsPatternLocal().replace(/\|--$/, "|--(?![A-Za-z0-9_-])")})`;
166
+ const kindAlt = kinds.join("|");
167
+ const atomAlt = atoms.join("|");
168
+ const cueAlt = animationCues.join("|");
169
+ const kdiagramLanguage = {
170
+ name: "kdiagram",
171
+ scopeName: "source.kdiagram",
172
+ aliases: ["fm"],
173
+ patterns: [
174
+ { include: "#comments" },
175
+ { include: "#diagram-header" },
176
+ { include: "#sequence-block" },
177
+ { include: "#animation-block" },
178
+ { include: "#columns-block" },
179
+ { include: "#strings" },
180
+ { include: "#operators" },
181
+ { include: "#properties" },
182
+ { include: "#keywords" },
183
+ { include: "#kinds" },
184
+ { include: "#column-flags" },
185
+ { include: "#atoms" },
186
+ { include: "#direction-atoms" },
187
+ { include: "#numbers" },
188
+ { include: "#colors" },
189
+ { include: "#punctuation" }
190
+ ],
191
+ repository: {
192
+ comments: { patterns: [{
193
+ name: "comment.line.double-slash.kdiagram",
194
+ match: "//.*$"
195
+ }, {
196
+ name: "comment.block.kdiagram",
197
+ begin: "/\\*",
198
+ end: "\\*/"
199
+ }] },
200
+ /** `diagram|state {` or a quoted title — title string is optional. */
201
+ "diagram-header": {
202
+ name: "meta.diagram.kdiagram",
203
+ begin: "\\b(diagram|state)\\b",
204
+ end: "(?=\\{)|$",
205
+ beginCaptures: { 0: { name: "keyword.control.kdiagram" } },
206
+ patterns: [{ include: "#strings" }]
207
+ },
208
+ /** Full sequence block so fragment/activate words stay scoped. */
209
+ "sequence-block": {
210
+ name: "meta.sequence.kdiagram",
211
+ begin: "(\\bsequence\\b)(?:\\s+(\"(?:\\\\.|[^\"\\\\])*\"))?\\s*(\\{)",
212
+ beginCaptures: {
213
+ 1: { name: "keyword.control.kdiagram" },
214
+ 2: { name: "string.quoted.double.kdiagram" },
215
+ 3: { name: "punctuation.kdiagram" }
216
+ },
217
+ end: "\\}",
218
+ endCaptures: { 0: { name: "punctuation.kdiagram" } },
219
+ patterns: [
220
+ { include: "#comments" },
221
+ { include: "#animation-block" },
222
+ { include: "#strings" },
223
+ { include: "#operators" },
224
+ { include: "#sequence-keywords" },
225
+ { include: "#properties" },
226
+ { include: "#keywords" },
227
+ { include: "#kinds" },
228
+ { include: "#atoms" },
229
+ { include: "#numbers" },
230
+ { include: "#punctuation" }
231
+ ]
232
+ },
233
+ "sequence-keywords": {
234
+ name: "keyword.control.kdiagram",
235
+ match: `\\b(${sequenceKeywords.join("|")})\\b`
236
+ },
237
+ /**
238
+ * Full animation block so cue words stay scoped (node id `flow` / group
239
+ * `parallel` must not light up as keywords in the rest of the diagram).
240
+ */
241
+ "animation-block": {
242
+ name: "meta.animation.kdiagram",
243
+ begin: "(\\banimation\\b)(?:\\s+(\"(?:\\\\.|[^\"\\\\])*\"))?\\s*(\\{)",
244
+ beginCaptures: {
245
+ 1: { name: "keyword.control.kdiagram" },
246
+ 2: { name: "string.quoted.double.kdiagram" },
247
+ 3: { name: "punctuation.kdiagram" }
248
+ },
249
+ end: "\\}",
250
+ endCaptures: { 0: { name: "punctuation.kdiagram" } },
251
+ patterns: [
252
+ { include: "#comments" },
253
+ { include: "#strings" },
254
+ { include: "#operators" },
255
+ { include: "#animation-parallel" },
256
+ { include: "#animation-cues" },
257
+ { include: "#keywords" },
258
+ { include: "#numbers" },
259
+ { include: "#punctuation" }
260
+ ]
261
+ },
262
+ "animation-parallel": {
263
+ name: "meta.animation.parallel.kdiagram",
264
+ begin: "(\\bparallel\\b)\\s*(\\{)",
265
+ beginCaptures: {
266
+ 1: { name: "keyword.control.kdiagram" },
267
+ 2: { name: "punctuation.kdiagram" }
268
+ },
269
+ end: "\\}",
270
+ endCaptures: { 0: { name: "punctuation.kdiagram" } },
271
+ patterns: [
272
+ { include: "#comments" },
273
+ { include: "#strings" },
274
+ { include: "#operators" },
275
+ { include: "#animation-cues" },
276
+ { include: "#keywords" },
277
+ { include: "#numbers" },
278
+ { include: "#punctuation" }
279
+ ]
280
+ },
281
+ "animation-cues": {
282
+ name: "keyword.control.kdiagram",
283
+ match: `\\b(${cueAlt})\\b`
284
+ },
285
+ "columns-block": {
286
+ name: "meta.columns.kdiagram",
287
+ begin: "\\bcolumns\\b\\s*:?\\s*\\{",
288
+ end: "\\}",
289
+ beginCaptures: { 0: { name: "keyword.control.kdiagram" } },
290
+ patterns: [
291
+ { include: "#comments" },
292
+ {
293
+ name: "meta.column.definition.kdiagram",
294
+ begin: "\\b([A-Za-z_][\\w-]*)\\s*(:)",
295
+ end: "(?=//)|$",
296
+ beginCaptures: {
297
+ 1: { name: "variable.other.property.kdiagram" },
298
+ 2: { name: "punctuation.separator.key-value.kdiagram" }
299
+ },
300
+ patterns: [
301
+ { include: "#operators" },
302
+ { include: "#column-flags" },
303
+ { include: "#sql-types" },
304
+ { include: "#strings" },
305
+ {
306
+ name: "variable.other.column-ref.kdiagram",
307
+ match: "\\b[A-Za-z_][\\w-]*(?=\\.[A-Za-z_])"
308
+ },
309
+ {
310
+ name: "variable.other.column-ref.kdiagram",
311
+ match: "(?<=\\.)[A-Za-z_][\\w-]*"
312
+ }
313
+ ]
314
+ },
315
+ { include: "#punctuation" }
316
+ ]
317
+ },
318
+ strings: {
319
+ name: "string.quoted.double.kdiagram",
320
+ begin: "\"",
321
+ end: "\"",
322
+ patterns: [{
323
+ name: "constant.character.escape.kdiagram",
324
+ match: "\\\\."
325
+ }]
326
+ },
327
+ operators: {
328
+ name: "keyword.operator.kdiagram",
329
+ match: operatorsPattern
330
+ },
331
+ keywords: {
332
+ name: "keyword.control.kdiagram",
333
+ match: `\\b(${keywords.join("|")})\\b`
334
+ },
335
+ /** Kinds only in `id: kind` / property value position — not as edge endpoints. */
336
+ kinds: {
337
+ name: "entity.name.type.kdiagram",
338
+ match: `(?<=:)\\s*(${kindAlt})\\b`
339
+ },
340
+ "column-flags": {
341
+ name: "constant.language.constraint.kdiagram",
342
+ match: `\\b(${columnFlags.join("|")})\\b`
343
+ },
344
+ "sql-types": {
345
+ name: "storage.type.kdiagram",
346
+ match: `\\b(${sqlTypes.join("|")})\\b`
347
+ },
348
+ /** Enum-like values after `key:` — not bare ids named `high` / `pack`. */
349
+ atoms: {
350
+ name: "constant.language.kdiagram",
351
+ match: `(?<=:)\\s*(${atomAlt})\\b`
352
+ },
353
+ /** `direction LR` / `density compact` (no colon). */
354
+ "direction-atoms": {
355
+ name: "constant.language.kdiagram",
356
+ match: `(?<=\\b(?:direction|density)\\s+)(${atomAlt})\\b`
357
+ },
358
+ properties: {
359
+ name: "variable.other.property.kdiagram",
360
+ match: "(?:--[a-zA-Z_][\\w-]*|\\b[a-zA-Z_][\\w-]*)(?=\\s*:)"
361
+ },
362
+ numbers: {
363
+ name: "constant.numeric.kdiagram",
364
+ match: "\\b\\d+(\\.\\d+)?(?:ms|s)?\\b"
365
+ },
366
+ colors: {
367
+ name: "constant.other.color.kdiagram",
368
+ match: "#[0-9a-fA-F]{3}(?:[0-9a-fA-F]{5}|[0-9a-fA-F]{3}|[0-9a-fA-F])?\\b"
369
+ },
370
+ punctuation: {
371
+ name: "punctuation.kdiagram",
372
+ match: "[{}()\\[\\];,*]"
373
+ }
374
+ }
375
+ };
376
+ /** Snapshot for tests — must match lexer EDGE_OPS. */
377
+ const KDIAGRAM_EDGE_OPS = [...EDGE_OPS];
378
+ //#endregion
379
+ export { KDIAGRAM_EDGE_OPS, kdiagramLanguage as default, kdiagramLanguage };
380
+
381
+ //# sourceMappingURL=kdiagram.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kdiagram.mjs","names":[],"sources":["../../src/shiki/kdiagram.ts"],"sourcesContent":["/**\n * TextMate grammar for KDiagram — used by Shiki (docs) and Monaco (studio).\n * Operators stay in sync with `@kekonic/diagrams-core` EDGE_OPS.\n *\n * Soft-keyword rule: kinds, atoms, and animation cues are position-scoped so\n * node ids like `worker` / group ids like `parallel` stay plain identifiers.\n */\n\nimport { BUILTIN_KIND_LIST, EDGE_OPS } from \"@kekonic/diagrams-core\";\n\nfunction edgeOpsPatternLocal(): string {\n return EDGE_OPS.map((op) => op.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\");\n}\n\n/** Statement intros — safe-ish globally (parser treats them as soft keywords). */\nconst keywords = [\n \"kdiagram\",\n \"direction\",\n \"density\",\n \"group\",\n \"boundary\",\n \"zone\",\n \"swimlane\",\n \"layout\",\n \"edges\",\n \"style\",\n \"render\",\n \"presentation\",\n \"is\",\n \"for\",\n \"edge\",\n \"svg\",\n];\n\n/** Only highlighted inside `animation \"…\" { … }` (and nested `parallel { }`). */\nconst animationCues = [\"dim\", \"activate\", \"pulse\", \"flow\", \"wait\", \"loop\"];\n\n/** Only highlighted inside `sequence \"…\" { … }`. */\nconst sequenceKeywords = [\n \"activate\",\n \"deactivate\",\n \"create\",\n \"destroy\",\n \"note\",\n \"autonumber\",\n \"alt\",\n \"alternate\",\n \"else\",\n \"otherwise\",\n \"opt\",\n \"optional\",\n \"loop\",\n \"par\",\n \"parallel\",\n \"and\",\n \"also\",\n \"critical\",\n \"break\",\n \"section\",\n \"box\",\n \"divider\",\n \"over\",\n \"left\",\n \"right\",\n \"of\",\n];\n\n/** Escape regex metacharacters in kind ids (none today, but keep safe). */\nconst kinds = [...BUILTIN_KIND_LIST].map((k) => k.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"));\n\nconst atoms = [\n \"LR\",\n \"RL\",\n \"TD\",\n \"BT\",\n \"TB\",\n \"down\",\n \"right\",\n \"true\",\n \"false\",\n \"compact\",\n \"normal\",\n \"spacious\",\n \"flat\",\n \"compound\",\n \"auto\",\n \"straight\",\n \"balanced\",\n \"basic\",\n \"metro\",\n \"rounded\",\n \"orthogonal\",\n \"bezier\",\n \"jumps\",\n \"smart\",\n \"gap\",\n \"gaps\",\n \"none\",\n \"tight\",\n \"wide\",\n \"on\",\n \"off\",\n \"high\",\n \"low\",\n \"yes\",\n \"no\",\n \"dark\",\n \"light\",\n \"pack\",\n \"stack\",\n \"flow\",\n \"row\",\n \"grid\",\n \"stretch\",\n \"start\",\n \"middle\",\n \"end\",\n \"begin\",\n \"center\",\n \"target\",\n \"source\",\n];\n\nconst columnFlags = [\"PK\", \"FK\", \"UK\", \"NN\", \"PRIMARY\", \"FOREIGN\", \"UNIQUE\", \"NOTNULL\", \"NOT_NULL\"];\n\nconst sqlTypes = [\n \"uuid\",\n \"text\",\n \"int\",\n \"integer\",\n \"bigint\",\n \"smallint\",\n \"bool\",\n \"boolean\",\n \"real\",\n \"float\",\n \"double\",\n \"numeric\",\n \"decimal\",\n \"money\",\n \"date\",\n \"time\",\n \"timestamp\",\n \"timestamptz\",\n \"timetz\",\n \"json\",\n \"jsonb\",\n \"bytea\",\n \"blob\",\n \"varchar\",\n \"char\",\n \"serial\",\n \"bigserial\",\n];\n\n/** Association `--` must not steal CSS custom props (`--icon-color`); keep `-->` intact. */\nconst operatorsPattern = `(${edgeOpsPatternLocal().replace(/\\|--$/, \"|--(?![A-Za-z0-9_-])\")})`;\n\nconst kindAlt = kinds.join(\"|\");\nconst atomAlt = atoms.join(\"|\");\nconst cueAlt = animationCues.join(\"|\");\nconst sequenceAlt = sequenceKeywords.join(\"|\");\n\nexport const kdiagramLanguage = {\n name: \"kdiagram\",\n scopeName: \"source.kdiagram\",\n aliases: [\"fm\"],\n patterns: [\n { include: \"#comments\" },\n { include: \"#diagram-header\" },\n { include: \"#sequence-block\" },\n { include: \"#animation-block\" },\n { include: \"#columns-block\" },\n { include: \"#strings\" },\n { include: \"#operators\" },\n { include: \"#properties\" },\n { include: \"#keywords\" },\n { include: \"#kinds\" },\n { include: \"#column-flags\" },\n { include: \"#atoms\" },\n { include: \"#direction-atoms\" },\n { include: \"#numbers\" },\n { include: \"#colors\" },\n { include: \"#punctuation\" },\n ],\n repository: {\n comments: {\n patterns: [\n { name: \"comment.line.double-slash.kdiagram\", match: \"//.*$\" },\n {\n name: \"comment.block.kdiagram\",\n begin: \"/\\\\*\",\n end: \"\\\\*/\",\n },\n ],\n },\n /** `diagram|state {` or a quoted title — title string is optional. */\n \"diagram-header\": {\n name: \"meta.diagram.kdiagram\",\n begin: \"\\\\b(diagram|state)\\\\b\",\n end: \"(?=\\\\{)|$\",\n beginCaptures: {\n 0: { name: \"keyword.control.kdiagram\" },\n },\n patterns: [{ include: \"#strings\" }],\n },\n /** Full sequence block so fragment/activate words stay scoped. */\n \"sequence-block\": {\n name: \"meta.sequence.kdiagram\",\n begin: '(\\\\bsequence\\\\b)(?:\\\\s+(\"(?:\\\\\\\\.|[^\"\\\\\\\\])*\"))?\\\\s*(\\\\{)',\n beginCaptures: {\n 1: { name: \"keyword.control.kdiagram\" },\n 2: { name: \"string.quoted.double.kdiagram\" },\n 3: { name: \"punctuation.kdiagram\" },\n },\n end: \"\\\\}\",\n endCaptures: {\n 0: { name: \"punctuation.kdiagram\" },\n },\n patterns: [\n { include: \"#comments\" },\n { include: \"#animation-block\" },\n { include: \"#strings\" },\n { include: \"#operators\" },\n { include: \"#sequence-keywords\" },\n { include: \"#properties\" },\n { include: \"#keywords\" },\n { include: \"#kinds\" },\n { include: \"#atoms\" },\n { include: \"#numbers\" },\n { include: \"#punctuation\" },\n ],\n },\n \"sequence-keywords\": {\n name: \"keyword.control.kdiagram\",\n match: `\\\\b(${sequenceAlt})\\\\b`,\n },\n /**\n * Full animation block so cue words stay scoped (node id `flow` / group\n * `parallel` must not light up as keywords in the rest of the diagram).\n */\n \"animation-block\": {\n name: \"meta.animation.kdiagram\",\n begin: '(\\\\banimation\\\\b)(?:\\\\s+(\"(?:\\\\\\\\.|[^\"\\\\\\\\])*\"))?\\\\s*(\\\\{)',\n beginCaptures: {\n 1: { name: \"keyword.control.kdiagram\" },\n 2: { name: \"string.quoted.double.kdiagram\" },\n 3: { name: \"punctuation.kdiagram\" },\n },\n end: \"\\\\}\",\n endCaptures: {\n 0: { name: \"punctuation.kdiagram\" },\n },\n patterns: [\n { include: \"#comments\" },\n { include: \"#strings\" },\n { include: \"#operators\" },\n { include: \"#animation-parallel\" },\n { include: \"#animation-cues\" },\n { include: \"#keywords\" },\n { include: \"#numbers\" },\n { include: \"#punctuation\" },\n ],\n },\n \"animation-parallel\": {\n name: \"meta.animation.parallel.kdiagram\",\n begin: \"(\\\\bparallel\\\\b)\\\\s*(\\\\{)\",\n beginCaptures: {\n 1: { name: \"keyword.control.kdiagram\" },\n 2: { name: \"punctuation.kdiagram\" },\n },\n end: \"\\\\}\",\n endCaptures: {\n 0: { name: \"punctuation.kdiagram\" },\n },\n patterns: [\n { include: \"#comments\" },\n { include: \"#strings\" },\n { include: \"#operators\" },\n { include: \"#animation-cues\" },\n { include: \"#keywords\" },\n { include: \"#numbers\" },\n { include: \"#punctuation\" },\n ],\n },\n \"animation-cues\": {\n name: \"keyword.control.kdiagram\",\n match: `\\\\b(${cueAlt})\\\\b`,\n },\n \"columns-block\": {\n name: \"meta.columns.kdiagram\",\n begin: \"\\\\bcolumns\\\\b\\\\s*:?\\\\s*\\\\{\",\n end: \"\\\\}\",\n beginCaptures: {\n 0: { name: \"keyword.control.kdiagram\" },\n },\n patterns: [\n { include: \"#comments\" },\n {\n name: \"meta.column.definition.kdiagram\",\n begin: \"\\\\b([A-Za-z_][\\\\w-]*)\\\\s*(:)\",\n end: \"(?=//)|$\",\n beginCaptures: {\n 1: { name: \"variable.other.property.kdiagram\" },\n 2: { name: \"punctuation.separator.key-value.kdiagram\" },\n },\n patterns: [\n { include: \"#operators\" },\n { include: \"#column-flags\" },\n { include: \"#sql-types\" },\n { include: \"#strings\" },\n {\n name: \"variable.other.column-ref.kdiagram\",\n match: \"\\\\b[A-Za-z_][\\\\w-]*(?=\\\\.[A-Za-z_])\",\n },\n {\n name: \"variable.other.column-ref.kdiagram\",\n match: \"(?<=\\\\.)[A-Za-z_][\\\\w-]*\",\n },\n ],\n },\n { include: \"#punctuation\" },\n ],\n },\n strings: {\n name: \"string.quoted.double.kdiagram\",\n begin: '\"',\n end: '\"',\n patterns: [{ name: \"constant.character.escape.kdiagram\", match: \"\\\\\\\\.\" }],\n },\n operators: {\n name: \"keyword.operator.kdiagram\",\n match: operatorsPattern,\n },\n keywords: {\n name: \"keyword.control.kdiagram\",\n match: `\\\\b(${keywords.join(\"|\")})\\\\b`,\n },\n /** Kinds only in `id: kind` / property value position — not as edge endpoints. */\n kinds: {\n name: \"entity.name.type.kdiagram\",\n match: `(?<=:)\\\\s*(${kindAlt})\\\\b`,\n },\n \"column-flags\": {\n name: \"constant.language.constraint.kdiagram\",\n match: `\\\\b(${columnFlags.join(\"|\")})\\\\b`,\n },\n \"sql-types\": {\n name: \"storage.type.kdiagram\",\n match: `\\\\b(${sqlTypes.join(\"|\")})\\\\b`,\n },\n /** Enum-like values after `key:` — not bare ids named `high` / `pack`. */\n atoms: {\n name: \"constant.language.kdiagram\",\n match: `(?<=:)\\\\s*(${atomAlt})\\\\b`,\n },\n /** `direction LR` / `density compact` (no colon). */\n \"direction-atoms\": {\n name: \"constant.language.kdiagram\",\n match: `(?<=\\\\b(?:direction|density)\\\\s+)(${atomAlt})\\\\b`,\n },\n properties: {\n name: \"variable.other.property.kdiagram\",\n match: \"(?:--[a-zA-Z_][\\\\w-]*|\\\\b[a-zA-Z_][\\\\w-]*)(?=\\\\s*:)\",\n },\n numbers: {\n name: \"constant.numeric.kdiagram\",\n // Durations: `200ms`, `1.4s` — unit optional so plain numbers still match.\n match: \"\\\\b\\\\d+(\\\\.\\\\d+)?(?:ms|s)?\\\\b\",\n },\n colors: {\n name: \"constant.other.color.kdiagram\",\n match: \"#[0-9a-fA-F]{3}(?:[0-9a-fA-F]{5}|[0-9a-fA-F]{3}|[0-9a-fA-F])?\\\\b\",\n },\n punctuation: {\n name: \"punctuation.kdiagram\",\n match: \"[{}()\\\\[\\\\];,*]\",\n },\n },\n};\n\n/** Snapshot for tests — must match lexer EDGE_OPS. */\nexport const KDIAGRAM_EDGE_OPS = [...EDGE_OPS];\n\nexport default kdiagramLanguage;\n"],"mappings":";;;;;;;;;AAUA,SAAS,sBAA8B;CACrC,OAAO,SAAS,KAAK,OAAO,GAAG,QAAQ,uBAAuB,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;AACjF;;AAGA,MAAM,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAM,gBAAgB;CAAC;CAAO;CAAY;CAAS;CAAQ;CAAQ;AAAM;;AAGzE,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAM,QAAQ,CAAC,GAAG,iBAAiB,CAAC,CAAC,KAAK,MAAM,EAAE,QAAQ,uBAAuB,MAAM,CAAC;AAExF,MAAM,QAAQ;CACZ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,cAAc;CAAC;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