@diagrammo/dgmo 0.53.0 → 0.54.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.
- package/dist/advanced.d.ts +36 -0
- package/dist/advanced.js +159 -154
- package/dist/auto.js +142 -128
- package/dist/auto.mjs +775 -466
- package/dist/block.js +62 -60
- package/dist/chart-meta.js +50 -47
- package/dist/{charts-d3-DH2XA45I.js → charts-d3-25E4VWXO.js} +9 -8
- package/dist/chunk-2CW5ZTNH.js +58 -0
- package/dist/{chunk-PKNNHU7H.js → chunk-2NYXI35Z.js} +17 -10
- package/dist/{chunk-W5KMNC5U.js → chunk-2NZOHEP4.js} +9 -10
- package/dist/{chunk-6DCOIN4W.js → chunk-3FRO35WW.js} +768 -2
- package/dist/{chunk-6AUZPPAV.js → chunk-3KHJJP3J.js} +2 -2
- package/dist/{chunk-X3RXGSCZ.js → chunk-3SBHODJ4.js} +11 -11
- package/dist/{chunk-KUSAVOWZ.js → chunk-3SEEP2JM.js} +3 -3
- package/dist/{chunk-QWIBT6DS.js → chunk-47JNEKJA.js} +10 -10
- package/dist/{chunk-LHILKFDP.js → chunk-4T6OCSJ2.js} +9 -9
- package/dist/{chunk-XQ4KN6JQ.js → chunk-4ZIKWVSQ.js} +16 -15
- package/dist/{chunk-GMAH572Z.js → chunk-5VXU6MND.js} +2 -2
- package/dist/{chunk-HORZ5H2L.js → chunk-5XSNLXU5.js} +17 -17
- package/dist/{chunk-BFDVEO5R.js → chunk-62Y27T4C.js} +2 -2
- package/dist/{chunk-R5NH5BZG.js → chunk-6KL7TFLS.js} +6 -6
- package/dist/{chunk-UVDCHR4E.js → chunk-6OYDOQ2Q.js} +2 -2
- package/dist/{chunk-QI3BOLQB.js → chunk-7K6NDSXH.js} +4 -4
- package/dist/{chunk-27STWBOK.js → chunk-7SP4C6EV.js} +6 -8
- package/dist/{chunk-I46X5VUA.js → chunk-7TF3QOOD.js} +25 -1
- package/dist/{chunk-FGDSTT3F.js → chunk-7U4OR7CD.js} +2 -2
- package/dist/{chunk-VKNCC2GX.js → chunk-7UPFTBOW.js} +13 -13
- package/dist/{chunk-FT7TPPZ5.js → chunk-A3BDLDYG.js} +12 -12
- package/dist/{chunk-AZNXGWDC.js → chunk-ADCHLNWT.js} +7 -7
- package/dist/{chunk-CMVZWP32.js → chunk-AHTTKERF.js} +2 -2
- package/dist/{chunk-GAWKIIPO.js → chunk-AJFHNS67.js} +7 -7
- package/dist/{chunk-Q7AH665U.js → chunk-AQEYUVGJ.js} +111 -35
- package/dist/{chunk-BR7AYN76.js → chunk-B7N5KYXQ.js} +12 -12
- package/dist/chunk-BEOAKGNA.js +484 -0
- package/dist/{chunk-GABSL6TH.js → chunk-BM7MG6HT.js} +3 -3
- package/dist/{chunk-UKP5HWB5.js → chunk-BWYFIVZF.js} +4 -4
- package/dist/{chunk-7GUF6SDR.js → chunk-BZJIITYM.js} +9 -9
- package/dist/{chunk-RW5PEJ7D.js → chunk-C2UORMIA.js} +3 -3
- package/dist/{chunk-FXCB7H5O.js → chunk-CCGWX6AO.js} +2 -2
- package/dist/{chunk-AHXIMHDQ.js → chunk-COJW2NEY.js} +9 -9
- package/dist/{chunk-XY3UDKKH.js → chunk-COVYNAKJ.js} +4 -4
- package/dist/{chunk-GQ644SPD.js → chunk-CSHFU6LT.js} +14 -14
- package/dist/{chunk-JTMSWEIW.js → chunk-DLU643TF.js} +4 -4
- package/dist/{chunk-QAALSCKI.js → chunk-DPGQ5UMO.js} +12 -12
- package/dist/{chunk-I64ECJX3.js → chunk-EAI6XJ7D.js} +3 -3
- package/dist/{chunk-DWUMPMV2.js → chunk-EPRF3ZRV.js} +2 -2
- package/dist/{chunk-AIMLCDAO.js → chunk-EQOMY4PY.js} +2 -2
- package/dist/{chunk-XEAQDIMF.js → chunk-F7XM366V.js} +6 -6
- package/dist/{chunk-SG4PRYO3.js → chunk-FFVFZLRT.js} +49 -18
- package/dist/{chunk-LC3FFD43.js → chunk-FR6UFVSV.js} +12 -12
- package/dist/{chunk-6HTRCTAS.js → chunk-FVMKCZHF.js} +6 -4
- package/dist/{chunk-FUKNRLIJ.js → chunk-GK32ZFZY.js} +6 -6
- package/dist/{chunk-6KY7OCZC.js → chunk-GKYHWJXI.js} +3 -3
- package/dist/{chunk-NNYFQOTK.js → chunk-GQ5ECRP4.js} +10 -8
- package/dist/{chunk-PT4SW76W.js → chunk-HAA25PLC.js} +9 -9
- package/dist/{chunk-J7HI6G3G.js → chunk-HFEOOQ46.js} +6 -6
- package/dist/{chunk-KKHCNSKK.js → chunk-I47VHSPS.js} +5 -5
- package/dist/{chunk-YG2BEIQU.js → chunk-ICKXIMBA.js} +11 -11
- package/dist/{chunk-A44USUV7.js → chunk-ICZ7M6IZ.js} +23 -17
- package/dist/{chunk-HE5J53SZ.js → chunk-IOIMQHQ6.js} +3 -3
- package/dist/{chunk-3BEKKRH5.js → chunk-IYNKLCAZ.js} +8 -8
- package/dist/{chunk-774C2FF3.js → chunk-J7HQPVYH.js} +2 -2
- package/dist/{chunk-UFQJMOVZ.js → chunk-KBVOVDYP.js} +6 -6
- package/dist/{chunk-JHOAH4TI.js → chunk-KDK5EKUR.js} +2 -2
- package/dist/{chunk-VIRANCNY.js → chunk-KINOX74I.js} +14 -14
- package/dist/{chunk-VJHBSPGF.js → chunk-KQ3FNRGR.js} +3 -3
- package/dist/{chunk-U7NKYLX2.js → chunk-KQYQECWQ.js} +13 -13
- package/dist/{chunk-GMIJ35PW.js → chunk-KS5ZSM5T.js} +13 -13
- package/dist/{chunk-FLDC7ZAK.js → chunk-KV4HLIJE.js} +2 -2
- package/dist/{chunk-PYO4TJJ3.js → chunk-LPJ6H5X4.js} +11 -11
- package/dist/{chunk-LQHVDZYC.js → chunk-LRSW4JLE.js} +4 -4
- package/dist/{chunk-VRRDUYOK.js → chunk-M24VXUFG.js} +3 -3
- package/dist/{chunk-22OQWBWD.js → chunk-M3H7ZE6C.js} +10 -10
- package/dist/{chunk-MA3HJZHB.js → chunk-MTZOXISJ.js} +7 -7
- package/dist/{chunk-GWQJKTFS.js → chunk-N7BSBAVP.js} +94 -94
- package/dist/{chunk-65V6IRFN.js → chunk-NUTWTV6G.js} +10 -10
- package/dist/{chunk-HNBY6CNV.js → chunk-O576GYAP.js} +2 -2
- package/dist/{chunk-3CZLWOCI.js → chunk-OJ435DQZ.js} +3 -3
- package/dist/{chunk-BD3WGY4T.js → chunk-OR3R27CU.js} +2 -2
- package/dist/{chunk-2QC4HXCY.js → chunk-OSXQKC3S.js} +8 -10
- package/dist/{chunk-4RGZFA7H.js → chunk-Q5IHQ4NW.js} +11 -1
- package/dist/{chunk-ALYZ3MAA.js → chunk-QBYP2FBZ.js} +8 -476
- package/dist/{chunk-4ASVFYB2.js → chunk-R5BGGBFF.js} +5 -5
- package/dist/{chunk-YR43LJT5.js → chunk-RIEAN4D5.js} +15 -12
- package/dist/{chunk-P3H7QVDH.js → chunk-RRGKMJYL.js} +6 -6
- package/dist/{chunk-XG4NWFPY.js → chunk-S7FOIURR.js} +13 -13
- package/dist/{chunk-NNUMX6WX.js → chunk-S7YFT3PO.js} +40 -15
- package/dist/{chunk-SQCBSFT5.js → chunk-SBOAZ7YK.js} +51 -263
- package/dist/{chunk-VGNIDAPQ.js → chunk-SSHS42QG.js} +4 -4
- package/dist/{chunk-SGPFVDUL.js → chunk-T3FAJAJT.js} +6 -6
- package/dist/{chunk-AN2DQB3G.js → chunk-T7Y554OK.js} +12 -12
- package/dist/chunk-TGOMHUOV.js +218 -0
- package/dist/{chunk-W2DINCHL.js → chunk-TJN2OIVG.js} +31 -16
- package/dist/{chunk-CK2GMDXD.js → chunk-TLNVYWPA.js} +2 -2
- package/dist/{chunk-CQFNIIQN.js → chunk-U4IN6AHE.js} +2 -2
- package/dist/{chunk-HOXKNRON.js → chunk-UEU6IYKY.js} +2 -2
- package/dist/{chunk-UK6DKJLD.js → chunk-UIT7E6UF.js} +4 -4
- package/dist/{chunk-IQJCVREL.js → chunk-VMSBMIHW.js} +6 -6
- package/dist/{chunk-FFXCKZOU.js → chunk-VQFDBNYF.js} +3 -3
- package/dist/{chunk-PV2QO7QL.js → chunk-W6PCFRPL.js} +2 -2
- package/dist/{chunk-UQRIKAMH.js → chunk-WKNAJ4BR.js} +13 -13
- package/dist/{chunk-4WGMGKCZ.js → chunk-WW4BQ744.js} +11 -11
- package/dist/{chunk-ZXUAPTCK.js → chunk-WWHECSYZ.js} +2 -2
- package/dist/{chunk-4K42RUGC.js → chunk-XWODFBHJ.js} +43 -12
- package/dist/{chunk-VAO6ANGC.js → chunk-YENNFS5F.js} +9 -9
- package/dist/cli.cjs +160 -146
- package/dist/completion-registry.d.ts +129 -0
- package/dist/completion-registry.js +1270 -0
- package/dist/{compute-G55RG53N.js → compute-JAP5E2E4.js} +2 -2
- package/dist/dgmo-router-TGZWFIZO.js +88 -0
- package/dist/{dimensions-K6PGYYGT.js → dimensions-L6BXQXXL.js} +8 -8
- package/dist/editor.js +18 -0
- package/dist/element.js +142 -128
- package/dist/element.mjs +775 -466
- package/dist/{flowchart-parser-LALR6J6F.js → flowchart-parser-UKYOW3VM.js} +5 -5
- package/dist/{flowchart-renderer-DXYB5YRF.js → flowchart-renderer-DCFKUDDR.js} +9 -9
- package/dist/highlight.js +18 -0
- package/dist/index.js +65 -62
- package/dist/{layout-WCAIKGZG.js → layout-25Y3VDYF.js} +5 -5
- package/dist/layout-4SPLI4HG.js +15 -0
- package/dist/{layout-E6HR6PXH.js → layout-A6OIGZN2.js} +3 -3
- package/dist/{layout-3BVDMKXI.js → layout-CH4HFFRD.js} +4 -4
- package/dist/{layout-ZE5DRJWX.js → layout-G2ABQJQZ.js} +4 -4
- package/dist/{layout-3V2A4MUE.js → layout-ITLPDG6M.js} +6 -5
- package/dist/{layout-WSMPBQ4Q.js → layout-NF4EWFLT.js} +3 -3
- package/dist/layout-NY7MHJCL.js +15 -0
- package/dist/{layout-4IHCMWZN.js → layout-QBNAMEOA.js} +4 -4
- package/dist/{layout-OL2XFJXA.js → layout-SP7HJWKA.js} +3 -3
- package/dist/{layout-search-34DPZD43.js → layout-search-LUI475P3.js} +9 -4
- package/dist/{legend-constants-P5EQWRQQ.js → legend-constants-B77VKB3R.js} +7 -2
- package/dist/{parser-5QPFOB5F.js → parser-2UWWNTFL.js} +4 -4
- package/dist/{parser-CKA3QMAG.js → parser-3RXYQSA7.js} +5 -5
- package/dist/{parser-GKP2MHHL.js → parser-5C3PEZK3.js} +3 -3
- package/dist/{parser-275KP7JO.js → parser-66RYGJRB.js} +5 -6
- package/dist/{parser-7JHWEWXM.js → parser-6GN5YJBJ.js} +4 -4
- package/dist/{parser-XVPTRWZ4.js → parser-6MQM7WT3.js} +4 -4
- package/dist/{parser-7JVIDLLR.js → parser-7UI6UQ7B.js} +4 -4
- package/dist/{parser-5HQXCNOS.js → parser-B2A7XOAK.js} +3 -3
- package/dist/{parser-UWRX52PC.js → parser-CCNJKDDA.js} +4 -4
- package/dist/{parser-CRKLXGW7.js → parser-ESHNUFME.js} +4 -4
- package/dist/{parser-EXNBDNGY.js → parser-F4FEU57T.js} +3 -3
- package/dist/{parser-IVGHXLZP.js → parser-FHRMFUNX.js} +4 -3
- package/dist/{parser-XNKJCMMA.js → parser-FPCWDYQV.js} +4 -4
- package/dist/{parser-ZQDQTB4X.js → parser-FY3YFFBS.js} +5 -5
- package/dist/{parser-VOERD6XR.js → parser-GML6V2KZ.js} +4 -4
- package/dist/{parser-3CODK6RG.js → parser-HA3PF5FL.js} +4 -4
- package/dist/{parser-GN2MM5CC.js → parser-KTYF6WO5.js} +3 -3
- package/dist/{parser-ZGNXYFPS.js → parser-LTA2BOZO.js} +3 -3
- package/dist/{parser-FOOFEJQU.js → parser-LU7UAKNB.js} +4 -4
- package/dist/{parser-NNIL3HXU.js → parser-MHKYQPC2.js} +3 -3
- package/dist/{parser-IKWK2ZU3.js → parser-MVSYFK63.js} +4 -5
- package/dist/{parser-3VSWEKBF.js → parser-O7YQYFEN.js} +4 -4
- package/dist/{parser-YSLNDFLV.js → parser-OPIXXUY4.js} +4 -5
- package/dist/{parser-RNLTBIJ6.js → parser-S4EJPNVN.js} +4 -4
- package/dist/{parser-G26MTBFS.js → parser-T3D7BV6O.js} +3 -3
- package/dist/{parser-3KIGEEJM.js → parser-VVE4THG3.js} +4 -4
- package/dist/{parser-5FGJSQNS.js → parser-WPPJGB4R.js} +4 -4
- package/dist/{parser-27Z76SN3.js → parser-X5XLFY4Z.js} +4 -4
- package/dist/{parser-6B6SSZT7.js → parser-XCPMEB2Z.js} +3 -3
- package/dist/{parser-6PPHAXXH.js → parser-XRDUX2AR.js} +5 -5
- package/dist/{parser-FF4BMRSB.js → parser-YPWYT46P.js} +4 -4
- package/dist/{parser-4E4I3GNT.js → parser-YULS5MLD.js} +4 -4
- package/dist/{renderer-ZBTEX2JK.js → renderer-2DME63VZ.js} +4 -4
- package/dist/{renderer-RLMOTXZ6.js → renderer-3VY3VXJE.js} +13 -13
- package/dist/{renderer-6WRYVM5R.js → renderer-4A32DX5L.js} +8 -8
- package/dist/{renderer-UPF7NRTI.js → renderer-4K5YYX5R.js} +11 -11
- package/dist/{renderer-HIFQVEJA.js → renderer-6CFML5G3.js} +9 -9
- package/dist/{renderer-7NQSTQMQ.js → renderer-7HMZ5OCJ.js} +4 -4
- package/dist/{renderer-NE5W7CQP.js → renderer-B7Y6I7JX.js} +6 -5
- package/dist/{renderer-LVZAHRP6.js → renderer-C3RI4OPJ.js} +11 -12
- package/dist/{renderer-COLQFSFV.js → renderer-CJ56SUMF.js} +9 -9
- package/dist/{renderer-WFSUBKUL.js → renderer-COJZZ4F6.js} +8 -8
- package/dist/{renderer-SQ54MDSA.js → renderer-FXMGCSRP.js} +9 -9
- package/dist/{renderer-TYHGXAVT.js → renderer-G4UOW3RH.js} +4 -4
- package/dist/{renderer-YUXGXGSW.js → renderer-HQ4JFZOV.js} +9 -9
- package/dist/{renderer-JTCX6PCG.js → renderer-LHVCKEWF.js} +9 -9
- package/dist/{renderer-WNFXYYGL.js → renderer-OZX5KGQM.js} +8 -8
- package/dist/{renderer-CWEFGEIC.js → renderer-P3YQES7B.js} +13 -13
- package/dist/{renderer-UKXW2QPE.js → renderer-PLVIARM7.js} +9 -8
- package/dist/{renderer-5MPN7CXZ.js → renderer-RA4PTAMF.js} +5 -5
- package/dist/{renderer-JCZG6AYU.js → renderer-RMAM2SOJ.js} +10 -10
- package/dist/{renderer-JWGQSTMR.js → renderer-SES7QZYL.js} +14 -14
- package/dist/{renderer-KARQF3F3.js → renderer-TQ5QDZOE.js} +8 -8
- package/dist/{renderer-6EN5XXJZ.js → renderer-V5SNTPAM.js} +10 -10
- package/dist/{renderer-QD2SJF2I.js → renderer-WVD6G2TS.js} +9 -9
- package/dist/{renderer-AK2WO4EI.js → renderer-X2LYSMLU.js} +4 -4
- package/dist/{renderer-VMH6L6CP.js → renderer-Y3NXZINM.js} +8 -8
- package/dist/{renderer-XTXSOK3L.js → renderer-YEFOOULC.js} +10 -10
- package/dist/{renderer-YUKPS27O.js → renderer-YP3P6UVT.js} +8 -8
- package/dist/{renderer-D3BRNOMV.js → renderer-YVMETH6V.js} +11 -11
- package/dist/{renderer-2C6DJRYN.js → renderer-Z4GNKNXO.js} +8 -8
- package/dist/{renderer-radial-WF6VOUOD.js → renderer-radial-VYBZAXXE.js} +9 -9
- package/dist/{state-parser-L7DHZIQO.js → state-parser-VIW2WNA5.js} +5 -5
- package/dist/{state-renderer-TFEUOP4H.js → state-renderer-H22AQD3U.js} +12 -12
- package/package.json +5 -1
- package/dist/chunk-YJVA3QUU.js +0 -734
- package/dist/dgmo-router-B4S23EBH.js +0 -86
- package/dist/layout-3M5UYJHY.js +0 -14
- package/dist/layout-KPQWJNAG.js +0 -14
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RECOGNIZED_COLOR_NAMES,
|
|
3
|
+
invalidColorDiagnostic,
|
|
4
|
+
resolveColor,
|
|
5
|
+
resolveColorWithDiagnostic
|
|
6
|
+
} from "./chunk-ZKPPI6BF.js";
|
|
7
|
+
import {
|
|
8
|
+
METADATA_DIAGNOSTIC_CODES,
|
|
9
|
+
emptyMetadataValueMessage,
|
|
10
|
+
makeDgmoError,
|
|
11
|
+
suggest
|
|
12
|
+
} from "./chunk-4W2PE66Q.js";
|
|
13
|
+
|
|
1
14
|
// src/directives-registry.ts
|
|
2
15
|
var DIRECTIVES_REGISTRY = [
|
|
3
16
|
// ── Universal date handling (§ BL-121) ───────────────────
|
|
@@ -240,6 +253,23 @@ var DIRECTIVES_REGISTRY = [
|
|
|
240
253
|
// ── Color / notes (cross-chart) ──────────────────────────
|
|
241
254
|
{ token: "color", category: "directive" },
|
|
242
255
|
{ token: "no-notes", category: "directive" },
|
|
256
|
+
// ── Emphasis family (§1.11, decision #49) ────────────────
|
|
257
|
+
// `highlight <Name>…` / `dim <Name>…` — the figure/ground axis, orthogonal
|
|
258
|
+
// to color (§1.5) and to the chart-wide `fill-*` family (§1.9). Both are
|
|
259
|
+
// chart-level directives taking a name list, validated inline by each
|
|
260
|
+
// adopting parser (no extractable Set), so the registry is their single
|
|
261
|
+
// declaration site for highlighting.
|
|
262
|
+
//
|
|
263
|
+
// `highlight` shipped on `family` long before this entry existed and was
|
|
264
|
+
// never registered — it had completions but highlighted as plain text. Both
|
|
265
|
+
// tokens are registered together so the whole family lights up at once.
|
|
266
|
+
//
|
|
267
|
+
// Supported on `sankey` and `family` today; every further chart type is a
|
|
268
|
+
// separate decision. Registering them globally is correct regardless: the
|
|
269
|
+
// Lezer specializer is context-free (it cannot know the chart type), and the
|
|
270
|
+
// same is already true of every other chart-scoped token here.
|
|
271
|
+
{ token: "highlight", category: "directive" },
|
|
272
|
+
{ token: "dim", category: "directive" },
|
|
243
273
|
// ── RACI ─────────────────────────────────────────────────
|
|
244
274
|
{ token: "roles", category: "directive" },
|
|
245
275
|
// ── Cycle ────────────────────────────────────────────────
|
|
@@ -343,6 +373,7 @@ function tokensWhere(pred) {
|
|
|
343
373
|
for (const e of DIRECTIVES_REGISTRY) if (pred(e)) out.add(e.token);
|
|
344
374
|
return out;
|
|
345
375
|
}
|
|
376
|
+
var ALL_REGISTRY_TOKENS = tokensWhere(() => true);
|
|
346
377
|
var INFRA_TOP_LEVEL_OPTION_SET = tokensWhere(
|
|
347
378
|
(e) => !!e.infra?.includes("top-level")
|
|
348
379
|
);
|
|
@@ -376,6 +407,690 @@ var REGISTRY_NON_HIGHLIGHT_TOKENS = tokensWhere(
|
|
|
376
407
|
(e) => !!e.noHighlight
|
|
377
408
|
);
|
|
378
409
|
|
|
410
|
+
// src/utils/reserved-key-registry.ts
|
|
411
|
+
function staticRegistry(keys) {
|
|
412
|
+
return { keys: new Set(keys), tagAliases: /* @__PURE__ */ new Set() };
|
|
413
|
+
}
|
|
414
|
+
function withTagAliases(base, aliases) {
|
|
415
|
+
return { keys: base.keys, tagAliases: aliases };
|
|
416
|
+
}
|
|
417
|
+
function isReservedKey(registry, key) {
|
|
418
|
+
return registry.keys.has(key) || registry.tagAliases.has(key);
|
|
419
|
+
}
|
|
420
|
+
var SEQUENCE_REGISTRY = staticRegistry([
|
|
421
|
+
"color",
|
|
422
|
+
"description",
|
|
423
|
+
"role",
|
|
424
|
+
"collapsed",
|
|
425
|
+
// Participant layout-order override (§2.2). Colon-keyed `position: N`.
|
|
426
|
+
"position"
|
|
427
|
+
]);
|
|
428
|
+
var INFRA_REGISTRY = staticRegistry([
|
|
429
|
+
"color",
|
|
430
|
+
"description",
|
|
431
|
+
"collapsed",
|
|
432
|
+
"icon"
|
|
433
|
+
]);
|
|
434
|
+
var MAP_REGISTRY = staticRegistry([
|
|
435
|
+
"heat",
|
|
436
|
+
"size",
|
|
437
|
+
"width",
|
|
438
|
+
"label",
|
|
439
|
+
"style",
|
|
440
|
+
// `clock` (BL-122): the time-card control. Bare (`poi Denver clock`) → a card
|
|
441
|
+
// with the zone auto-derived from the place; valued (`clock: Europe/Oslo`) →
|
|
442
|
+
// that IANA id or fixed offset (`clock: UTC+9`) as the zone, for bare-coord
|
|
443
|
+
// pins or to override a city. Reserved so the valued form peels off the POI
|
|
444
|
+
// name cleanly; the BARE flag is peeled separately in handlePoi (no colon).
|
|
445
|
+
"clock"
|
|
446
|
+
// `surface:` was removed in the 2026-06-02 defaults-on review — it is no longer
|
|
447
|
+
// a recognized metadata key (the route/edge surface feature was cut; §24B.7).
|
|
448
|
+
// A stray `surface: water` is no longer captured as a reserved key.
|
|
449
|
+
]);
|
|
450
|
+
var ORG_REGISTRY = staticRegistry([
|
|
451
|
+
"color",
|
|
452
|
+
"description",
|
|
453
|
+
"role",
|
|
454
|
+
"location",
|
|
455
|
+
"email",
|
|
456
|
+
"phone"
|
|
457
|
+
]);
|
|
458
|
+
var C4_REGISTRY = staticRegistry([
|
|
459
|
+
"color",
|
|
460
|
+
"description",
|
|
461
|
+
"tech",
|
|
462
|
+
"type",
|
|
463
|
+
"collapsed"
|
|
464
|
+
]);
|
|
465
|
+
var ER_REGISTRY = staticRegistry([
|
|
466
|
+
"color",
|
|
467
|
+
"description",
|
|
468
|
+
"domain"
|
|
469
|
+
]);
|
|
470
|
+
var EVENT_LINE_REGISTRY = staticRegistry([
|
|
471
|
+
"color"
|
|
472
|
+
]);
|
|
473
|
+
var KANBAN_REGISTRY = staticRegistry([
|
|
474
|
+
"color",
|
|
475
|
+
"description",
|
|
476
|
+
"wip",
|
|
477
|
+
"assignee",
|
|
478
|
+
"due",
|
|
479
|
+
"collapsed"
|
|
480
|
+
// `[Column] collapsed: true` view-state marker
|
|
481
|
+
]);
|
|
482
|
+
var SITEMAP_REGISTRY = staticRegistry([
|
|
483
|
+
"color",
|
|
484
|
+
"description",
|
|
485
|
+
"status"
|
|
486
|
+
]);
|
|
487
|
+
var GANTT_REGISTRY = staticRegistry([
|
|
488
|
+
"color",
|
|
489
|
+
"description",
|
|
490
|
+
"duration",
|
|
491
|
+
"offset",
|
|
492
|
+
"progress",
|
|
493
|
+
"start",
|
|
494
|
+
"collapsed"
|
|
495
|
+
// `[Group] collapsed: true` view-state marker
|
|
496
|
+
]);
|
|
497
|
+
var PERT_REGISTRY = staticRegistry([
|
|
498
|
+
"color",
|
|
499
|
+
"description",
|
|
500
|
+
"confidence",
|
|
501
|
+
"collapsed"
|
|
502
|
+
]);
|
|
503
|
+
var BOXES_AND_LINES_REGISTRY = staticRegistry([
|
|
504
|
+
"color",
|
|
505
|
+
"description",
|
|
506
|
+
"heat"
|
|
507
|
+
]);
|
|
508
|
+
var STATE_REGISTRY = staticRegistry([]);
|
|
509
|
+
var SKETCH_REGISTRY = staticRegistry([
|
|
510
|
+
"shape",
|
|
511
|
+
"at",
|
|
512
|
+
"collapsed"
|
|
513
|
+
]);
|
|
514
|
+
var TIMELINE_REGISTRY = staticRegistry([
|
|
515
|
+
"color",
|
|
516
|
+
"description",
|
|
517
|
+
"duration"
|
|
518
|
+
]);
|
|
519
|
+
var MINDMAP_REGISTRY = staticRegistry([
|
|
520
|
+
"color",
|
|
521
|
+
"description",
|
|
522
|
+
"collapsed"
|
|
523
|
+
]);
|
|
524
|
+
var TECH_RADAR_REGISTRY = staticRegistry([
|
|
525
|
+
"color",
|
|
526
|
+
"description",
|
|
527
|
+
"quadrant",
|
|
528
|
+
"ring",
|
|
529
|
+
"trend"
|
|
530
|
+
]);
|
|
531
|
+
var CYCLE_REGISTRY = staticRegistry([
|
|
532
|
+
"color",
|
|
533
|
+
"description",
|
|
534
|
+
"width",
|
|
535
|
+
"span"
|
|
536
|
+
]);
|
|
537
|
+
var JOURNEY_MAP_REGISTRY = staticRegistry([
|
|
538
|
+
"color",
|
|
539
|
+
"description",
|
|
540
|
+
"score",
|
|
541
|
+
"emotion",
|
|
542
|
+
"pain",
|
|
543
|
+
"opportunity",
|
|
544
|
+
"thought"
|
|
545
|
+
]);
|
|
546
|
+
var PYRAMID_REGISTRY = staticRegistry([
|
|
547
|
+
"color",
|
|
548
|
+
"description"
|
|
549
|
+
]);
|
|
550
|
+
var RING_REGISTRY = staticRegistry([
|
|
551
|
+
"color",
|
|
552
|
+
"description"
|
|
553
|
+
]);
|
|
554
|
+
var TREEMAP_REGISTRY = staticRegistry(["heat"]);
|
|
555
|
+
var RACI_REGISTRY = staticRegistry([
|
|
556
|
+
"color",
|
|
557
|
+
"description"
|
|
558
|
+
]);
|
|
559
|
+
var FAMILY_PERSON_REGISTRY = staticRegistry([
|
|
560
|
+
"sex",
|
|
561
|
+
"b",
|
|
562
|
+
"d",
|
|
563
|
+
"bp",
|
|
564
|
+
"dp",
|
|
565
|
+
"occupation",
|
|
566
|
+
"military",
|
|
567
|
+
"education",
|
|
568
|
+
"religion",
|
|
569
|
+
"burial"
|
|
570
|
+
]);
|
|
571
|
+
var FAMILY_UNION_REGISTRY = staticRegistry(["m"]);
|
|
572
|
+
|
|
573
|
+
// src/utils/parsing.ts
|
|
574
|
+
var RECOGNIZED_COLOR_SET = new Set(
|
|
575
|
+
RECOGNIZED_COLOR_NAMES
|
|
576
|
+
);
|
|
577
|
+
var ALL_CHART_TYPES = /* @__PURE__ */ new Set([
|
|
578
|
+
// data charts
|
|
579
|
+
"bar",
|
|
580
|
+
"line",
|
|
581
|
+
"pie",
|
|
582
|
+
"polar-area",
|
|
583
|
+
"radar",
|
|
584
|
+
"scatter",
|
|
585
|
+
"sankey",
|
|
586
|
+
"function",
|
|
587
|
+
"heatmap",
|
|
588
|
+
"funnel",
|
|
589
|
+
// visualizations
|
|
590
|
+
"slope",
|
|
591
|
+
"wordcloud",
|
|
592
|
+
"arc",
|
|
593
|
+
"timeline",
|
|
594
|
+
"event-line",
|
|
595
|
+
"venn",
|
|
596
|
+
"quadrant",
|
|
597
|
+
// diagrams
|
|
598
|
+
"body",
|
|
599
|
+
"sequence",
|
|
600
|
+
"flowchart",
|
|
601
|
+
"class",
|
|
602
|
+
"er",
|
|
603
|
+
"org",
|
|
604
|
+
"kanban",
|
|
605
|
+
"c4",
|
|
606
|
+
"state",
|
|
607
|
+
"sitemap",
|
|
608
|
+
"infra",
|
|
609
|
+
"gantt",
|
|
610
|
+
"pert",
|
|
611
|
+
"boxes-and-lines",
|
|
612
|
+
"swimlane",
|
|
613
|
+
"version-control",
|
|
614
|
+
"mindmap",
|
|
615
|
+
"wireframe",
|
|
616
|
+
"tech-radar",
|
|
617
|
+
"cycle",
|
|
618
|
+
"journey-map",
|
|
619
|
+
"pyramid",
|
|
620
|
+
"ring",
|
|
621
|
+
"treemap",
|
|
622
|
+
"block",
|
|
623
|
+
"goal",
|
|
624
|
+
"countdown",
|
|
625
|
+
"clock",
|
|
626
|
+
"sketch",
|
|
627
|
+
"raci",
|
|
628
|
+
"map",
|
|
629
|
+
"family",
|
|
630
|
+
"bracket"
|
|
631
|
+
]);
|
|
632
|
+
function measureIndent(line) {
|
|
633
|
+
let indent = 0;
|
|
634
|
+
for (const ch of line) {
|
|
635
|
+
if (ch === " ") indent++;
|
|
636
|
+
else if (ch === " ") indent += 4;
|
|
637
|
+
else break;
|
|
638
|
+
}
|
|
639
|
+
return indent;
|
|
640
|
+
}
|
|
641
|
+
function extractColor(label, palette, diagnostics, line) {
|
|
642
|
+
const lastSpaceIdx = Math.max(
|
|
643
|
+
label.lastIndexOf(" "),
|
|
644
|
+
label.lastIndexOf(" ")
|
|
645
|
+
);
|
|
646
|
+
if (lastSpaceIdx < 0) return { label };
|
|
647
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
648
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) {
|
|
649
|
+
if (diagnostics && line !== void 0) {
|
|
650
|
+
const diag = invalidColorDiagnostic(trailing, line);
|
|
651
|
+
if (diag) diagnostics.push(diag);
|
|
652
|
+
}
|
|
653
|
+
return { label };
|
|
654
|
+
}
|
|
655
|
+
let color;
|
|
656
|
+
if (diagnostics && line !== void 0) {
|
|
657
|
+
color = resolveColorWithDiagnostic(trailing, line, diagnostics, palette);
|
|
658
|
+
} else {
|
|
659
|
+
color = resolveColor(trailing, palette) ?? void 0;
|
|
660
|
+
}
|
|
661
|
+
return {
|
|
662
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
663
|
+
...color !== void 0 && { color }
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
var OPTION_NOCOLON_RE = /^([a-z][a-z0-9-]*)\s+(.+)$/i;
|
|
667
|
+
var GLOBAL_BOOLEANS = /* @__PURE__ */ new Set([
|
|
668
|
+
"fill-tint",
|
|
669
|
+
"fill-solid",
|
|
670
|
+
"fill-outline",
|
|
671
|
+
"no-title",
|
|
672
|
+
"no-notes",
|
|
673
|
+
"no-legend"
|
|
674
|
+
]);
|
|
675
|
+
function legendSuppressed(options) {
|
|
676
|
+
return options["no-legend"] === "on";
|
|
677
|
+
}
|
|
678
|
+
var FILL_FAMILY_TOKENS = /* @__PURE__ */ new Set([
|
|
679
|
+
"fill-tint",
|
|
680
|
+
"fill-solid",
|
|
681
|
+
"fill-outline"
|
|
682
|
+
]);
|
|
683
|
+
function fillModeFromToken(token) {
|
|
684
|
+
switch (token.trim().toLowerCase()) {
|
|
685
|
+
case "fill-solid":
|
|
686
|
+
return "solid";
|
|
687
|
+
case "fill-outline":
|
|
688
|
+
return "outline";
|
|
689
|
+
case "fill-tint":
|
|
690
|
+
return "tint";
|
|
691
|
+
default:
|
|
692
|
+
return null;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
function fillModeFromOptions(options) {
|
|
696
|
+
if (options["fill-solid"] === "on") return "solid";
|
|
697
|
+
if (options["fill-outline"] === "on") return "outline";
|
|
698
|
+
return void 0;
|
|
699
|
+
}
|
|
700
|
+
function recognizeGlobalBoolean(token) {
|
|
701
|
+
const t = token.trim().toLowerCase();
|
|
702
|
+
return GLOBAL_BOOLEANS.has(t) ? t : null;
|
|
703
|
+
}
|
|
704
|
+
function tryParseSharedOption(line, options) {
|
|
705
|
+
const key = recognizeGlobalBoolean(line);
|
|
706
|
+
if (key) {
|
|
707
|
+
if (FILL_FAMILY_TOKENS.has(key)) {
|
|
708
|
+
for (const t of FILL_FAMILY_TOKENS) delete options[t];
|
|
709
|
+
}
|
|
710
|
+
options[key] = "on";
|
|
711
|
+
return true;
|
|
712
|
+
}
|
|
713
|
+
return false;
|
|
714
|
+
}
|
|
715
|
+
function parseFirstLine(line) {
|
|
716
|
+
const trimmed = line.trim();
|
|
717
|
+
if (!trimmed || trimmed.startsWith("//")) return null;
|
|
718
|
+
const spaceIdx = trimmed.indexOf(" ");
|
|
719
|
+
if (spaceIdx === -1) {
|
|
720
|
+
const ct = trimmed.toLowerCase();
|
|
721
|
+
return ALL_CHART_TYPES.has(ct) ? { chartType: ct, title: void 0 } : null;
|
|
722
|
+
}
|
|
723
|
+
const firstToken = trimmed.substring(0, spaceIdx).toLowerCase();
|
|
724
|
+
if (!ALL_CHART_TYPES.has(firstToken)) return null;
|
|
725
|
+
return {
|
|
726
|
+
chartType: firstToken,
|
|
727
|
+
title: trimmed.substring(spaceIdx + 1).trim() || void 0
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
var CHART_TYPE_TOKEN_RE = /^[A-Za-z][A-Za-z0-9-]*$/;
|
|
731
|
+
var TITLE_LIKE_RE = /^[A-Za-z][A-Za-z\s'&,.\-—–]*$/;
|
|
732
|
+
function detectBadChartTypeDeclaration(line, knownOptionKeys) {
|
|
733
|
+
const trimmed = line.trim();
|
|
734
|
+
if (!trimmed || trimmed.includes(":")) return null;
|
|
735
|
+
const spaceIdx = trimmed.indexOf(" ");
|
|
736
|
+
const token = spaceIdx === -1 ? trimmed : trimmed.substring(0, spaceIdx);
|
|
737
|
+
if (!CHART_TYPE_TOKEN_RE.test(token)) return null;
|
|
738
|
+
const lower = token.toLowerCase();
|
|
739
|
+
if (knownOptionKeys.has(lower) || ALL_REGISTRY_TOKENS.has(lower)) return null;
|
|
740
|
+
if (spaceIdx === -1) return /\d/.test(token) ? null : token;
|
|
741
|
+
const rest = trimmed.substring(spaceIdx + 1).trim();
|
|
742
|
+
if (!rest || !TITLE_LIKE_RE.test(rest)) return null;
|
|
743
|
+
return token;
|
|
744
|
+
}
|
|
745
|
+
function normalizeNumericToken(token) {
|
|
746
|
+
if (!token.includes(",") && !token.includes("_")) return null;
|
|
747
|
+
if (token.includes(",") && token.includes("_")) return null;
|
|
748
|
+
let sign = "";
|
|
749
|
+
let unsigned = token;
|
|
750
|
+
if (unsigned.startsWith("-")) {
|
|
751
|
+
sign = "-";
|
|
752
|
+
unsigned = unsigned.substring(1);
|
|
753
|
+
}
|
|
754
|
+
if (!unsigned) return null;
|
|
755
|
+
if (unsigned.includes(",")) {
|
|
756
|
+
if (/^\d{1,3}(,\d{3})+$/.test(unsigned))
|
|
757
|
+
return sign + unsigned.replace(/,/g, "");
|
|
758
|
+
if (/^\d{1,3}(,\d{3})+\.\d+$/.test(unsigned))
|
|
759
|
+
return sign + unsigned.replace(/,/g, "");
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
if (/^\d+(_\d+)+$/.test(unsigned)) return sign + unsigned.replace(/_/g, "");
|
|
763
|
+
if (/^\d+(_\d+)*\.\d+$/.test(unsigned) && unsigned.includes("_"))
|
|
764
|
+
return sign + unsigned.replace(/_/g, "");
|
|
765
|
+
return null;
|
|
766
|
+
}
|
|
767
|
+
function stripQuotes(token) {
|
|
768
|
+
if (token.length >= 2) {
|
|
769
|
+
if (token[0] === '"' && token[token.length - 1] === '"' || token[0] === "'" && token[token.length - 1] === "'") {
|
|
770
|
+
return token.substring(1, token.length - 1);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return token;
|
|
774
|
+
}
|
|
775
|
+
function tokenizeQuoteAware(input) {
|
|
776
|
+
const tokens = [];
|
|
777
|
+
let i = 0;
|
|
778
|
+
while (i < input.length) {
|
|
779
|
+
if (input[i] === " " || input[i] === " ") {
|
|
780
|
+
i++;
|
|
781
|
+
continue;
|
|
782
|
+
}
|
|
783
|
+
if (input[i] === '"' || input[i] === "'") {
|
|
784
|
+
const quote = input[i];
|
|
785
|
+
const start2 = i;
|
|
786
|
+
i++;
|
|
787
|
+
while (i < input.length && input[i] !== quote) i++;
|
|
788
|
+
if (i < input.length) i++;
|
|
789
|
+
tokens.push(input.substring(start2, i));
|
|
790
|
+
continue;
|
|
791
|
+
}
|
|
792
|
+
const start = i;
|
|
793
|
+
while (i < input.length && input[i] !== " " && input[i] !== " ") i++;
|
|
794
|
+
tokens.push(input.substring(start, i));
|
|
795
|
+
}
|
|
796
|
+
return tokens;
|
|
797
|
+
}
|
|
798
|
+
function collectIndentedValues(lines, startIndex) {
|
|
799
|
+
const values = [];
|
|
800
|
+
const lineNumbers = [];
|
|
801
|
+
let j = startIndex + 1;
|
|
802
|
+
for (; j < lines.length; j++) {
|
|
803
|
+
const raw = lines[j];
|
|
804
|
+
const trimmed = raw.trim();
|
|
805
|
+
if (!trimmed) continue;
|
|
806
|
+
if (trimmed.startsWith("//")) continue;
|
|
807
|
+
if (raw[0] !== " " && raw[0] !== " ") break;
|
|
808
|
+
values.push(trimmed.replace(/,\s*$/, ""));
|
|
809
|
+
lineNumbers.push(j + 1);
|
|
810
|
+
}
|
|
811
|
+
return { values, lineNumbers, newIndex: j - 1 };
|
|
812
|
+
}
|
|
813
|
+
function parseSeriesNames(value, lines, lineIndex, palette, diagnostics) {
|
|
814
|
+
let rawNames;
|
|
815
|
+
let series;
|
|
816
|
+
let newIndex = lineIndex;
|
|
817
|
+
let nameLineNumbers = [];
|
|
818
|
+
if (value) {
|
|
819
|
+
series = value;
|
|
820
|
+
rawNames = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
821
|
+
nameLineNumbers = rawNames.map(() => lineIndex + 1);
|
|
822
|
+
} else {
|
|
823
|
+
const collected = collectIndentedValues(lines, lineIndex);
|
|
824
|
+
newIndex = collected.newIndex;
|
|
825
|
+
rawNames = collected.values;
|
|
826
|
+
nameLineNumbers = collected.lineNumbers;
|
|
827
|
+
series = rawNames.join(", ");
|
|
828
|
+
}
|
|
829
|
+
const isHeader = (s) => {
|
|
830
|
+
const tok = s.split(/\s+/, 1)[0];
|
|
831
|
+
if (tok === "y-label") return "left";
|
|
832
|
+
if (tok === "y-right-label") return "right";
|
|
833
|
+
return null;
|
|
834
|
+
};
|
|
835
|
+
if (rawNames.some((r) => isHeader(r) !== null)) {
|
|
836
|
+
const names2 = [];
|
|
837
|
+
const nameColors2 = [];
|
|
838
|
+
const axes = [];
|
|
839
|
+
const memberLineNumbers = [];
|
|
840
|
+
let leftLabel;
|
|
841
|
+
let rightLabel;
|
|
842
|
+
let currentAxis = "left";
|
|
843
|
+
for (let i = 0; i < rawNames.length; i++) {
|
|
844
|
+
const raw = rawNames[i];
|
|
845
|
+
const side = isHeader(raw);
|
|
846
|
+
if (side !== null) {
|
|
847
|
+
const label = raw.slice(raw.indexOf(" ") + 1).trim();
|
|
848
|
+
currentAxis = side;
|
|
849
|
+
if (side === "left") leftLabel = label || leftLabel;
|
|
850
|
+
else rightLabel = label || rightLabel;
|
|
851
|
+
continue;
|
|
852
|
+
}
|
|
853
|
+
const extracted = extractColor(
|
|
854
|
+
raw,
|
|
855
|
+
palette,
|
|
856
|
+
diagnostics,
|
|
857
|
+
nameLineNumbers[i]
|
|
858
|
+
);
|
|
859
|
+
names2.push(extracted.label);
|
|
860
|
+
nameColors2.push(extracted.color);
|
|
861
|
+
axes.push(currentAxis);
|
|
862
|
+
memberLineNumbers.push(nameLineNumbers[i]);
|
|
863
|
+
}
|
|
864
|
+
return {
|
|
865
|
+
series: names2.join(", "),
|
|
866
|
+
names: names2,
|
|
867
|
+
nameColors: nameColors2,
|
|
868
|
+
nameLineNumbers: memberLineNumbers,
|
|
869
|
+
newIndex,
|
|
870
|
+
axes,
|
|
871
|
+
...leftLabel !== void 0 && { leftLabel },
|
|
872
|
+
...rightLabel !== void 0 && { rightLabel }
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
const names = [];
|
|
876
|
+
const nameColors = [];
|
|
877
|
+
for (let i = 0; i < rawNames.length; i++) {
|
|
878
|
+
const raw = rawNames[i];
|
|
879
|
+
const extracted = extractColor(
|
|
880
|
+
raw,
|
|
881
|
+
palette,
|
|
882
|
+
diagnostics,
|
|
883
|
+
nameLineNumbers[i]
|
|
884
|
+
);
|
|
885
|
+
nameColors.push(extracted.color);
|
|
886
|
+
names.push(extracted.label);
|
|
887
|
+
}
|
|
888
|
+
if (names.length === 1) {
|
|
889
|
+
series = names[0];
|
|
890
|
+
}
|
|
891
|
+
return { series, names, nameColors, nameLineNumbers, newIndex };
|
|
892
|
+
}
|
|
893
|
+
function peelTrailingColorName(label) {
|
|
894
|
+
const lastSpaceIdx = Math.max(
|
|
895
|
+
label.lastIndexOf(" "),
|
|
896
|
+
label.lastIndexOf(" ")
|
|
897
|
+
);
|
|
898
|
+
if (lastSpaceIdx < 0) return { label };
|
|
899
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
900
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { label };
|
|
901
|
+
return {
|
|
902
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
903
|
+
colorName: trailing
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
function peelTrailingCollapsedFlag(text) {
|
|
907
|
+
const t = text.trimEnd();
|
|
908
|
+
if (t === "collapsed") return { rest: "", collapsed: true };
|
|
909
|
+
if (/[ \t]collapsed$/.test(t)) {
|
|
910
|
+
return {
|
|
911
|
+
rest: t.slice(0, t.length - "collapsed".length).trimEnd().replace(/,\s*$/, ""),
|
|
912
|
+
collapsed: true
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
return { rest: text, collapsed: false };
|
|
916
|
+
}
|
|
917
|
+
function peelRampColors(label) {
|
|
918
|
+
const peelOne = (s) => {
|
|
919
|
+
const idx = Math.max(s.lastIndexOf(" "), s.lastIndexOf(" "));
|
|
920
|
+
if (idx < 0) return { rest: s };
|
|
921
|
+
const trailing = s.substring(idx + 1);
|
|
922
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { rest: s };
|
|
923
|
+
return { rest: s.substring(0, idx).trimEnd(), color: trailing };
|
|
924
|
+
};
|
|
925
|
+
const first = peelOne(label);
|
|
926
|
+
if (first.color === void 0) return { label };
|
|
927
|
+
const second = peelOne(first.rest);
|
|
928
|
+
if (second.color === void 0) {
|
|
929
|
+
return { label: first.rest, high: first.color };
|
|
930
|
+
}
|
|
931
|
+
return { label: second.rest, low: second.color, high: first.color };
|
|
932
|
+
}
|
|
933
|
+
var RESERVED_KEY_RE = /^[A-Za-z][A-Za-z0-9_-]*$/;
|
|
934
|
+
var AS_ALIAS_RE = /\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11})$/;
|
|
935
|
+
function scanTokens(line) {
|
|
936
|
+
const tokens = [];
|
|
937
|
+
let i = 0;
|
|
938
|
+
while (i < line.length) {
|
|
939
|
+
if (line[i] === " " || line[i] === " ") {
|
|
940
|
+
i++;
|
|
941
|
+
continue;
|
|
942
|
+
}
|
|
943
|
+
if (line[i] === '"' || line[i] === "'") {
|
|
944
|
+
const quote = line[i];
|
|
945
|
+
const start2 = i;
|
|
946
|
+
i++;
|
|
947
|
+
while (i < line.length && line[i] !== quote) i++;
|
|
948
|
+
if (i < line.length) i++;
|
|
949
|
+
tokens.push({
|
|
950
|
+
text: line.substring(start2, i),
|
|
951
|
+
start: start2,
|
|
952
|
+
end: i,
|
|
953
|
+
quoted: true
|
|
954
|
+
});
|
|
955
|
+
continue;
|
|
956
|
+
}
|
|
957
|
+
const start = i;
|
|
958
|
+
while (i < line.length && line[i] !== " " && line[i] !== " ") i++;
|
|
959
|
+
tokens.push({
|
|
960
|
+
text: line.substring(start, i),
|
|
961
|
+
start,
|
|
962
|
+
end: i,
|
|
963
|
+
quoted: false
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
return tokens;
|
|
967
|
+
}
|
|
968
|
+
function findMetadataCutOffset(line, tokens, registry) {
|
|
969
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
970
|
+
const tok = tokens[i];
|
|
971
|
+
if (tok.quoted) continue;
|
|
972
|
+
const inlineColon = tok.text.indexOf(":");
|
|
973
|
+
if (inlineColon > 0) {
|
|
974
|
+
const keyPart = tok.text.substring(0, inlineColon);
|
|
975
|
+
if (RESERVED_KEY_RE.test(keyPart) && isReservedKey(registry, keyPart.toLowerCase())) {
|
|
976
|
+
return tok.start;
|
|
977
|
+
}
|
|
978
|
+
} else if (inlineColon < 0) {
|
|
979
|
+
if (RESERVED_KEY_RE.test(tok.text) && isReservedKey(registry, tok.text.toLowerCase())) {
|
|
980
|
+
const tail = line.substring(tok.end).replace(/^[ \t]+/, "");
|
|
981
|
+
if (tail.startsWith(":")) {
|
|
982
|
+
return tok.start;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
return -1;
|
|
988
|
+
}
|
|
989
|
+
function parseMetadataRegion(region, aliasMap, diagnostics, line) {
|
|
990
|
+
const meta = {};
|
|
991
|
+
let i = 0;
|
|
992
|
+
while (i < region.length) {
|
|
993
|
+
while (i < region.length && (region[i] === " " || region[i] === " " || region[i] === ","))
|
|
994
|
+
i++;
|
|
995
|
+
if (i >= region.length) break;
|
|
996
|
+
const keyStart = i;
|
|
997
|
+
while (i < region.length && region[i] !== ":" && region[i] !== ",") i++;
|
|
998
|
+
if (i >= region.length || region[i] !== ":") break;
|
|
999
|
+
const rawKey = region.substring(keyStart, i).trim().toLowerCase();
|
|
1000
|
+
if (!rawKey) break;
|
|
1001
|
+
i++;
|
|
1002
|
+
while (i < region.length && (region[i] === " " || region[i] === " ")) i++;
|
|
1003
|
+
let value;
|
|
1004
|
+
if (i < region.length && (region[i] === '"' || region[i] === "'")) {
|
|
1005
|
+
const quote = region[i];
|
|
1006
|
+
i++;
|
|
1007
|
+
const vStart = i;
|
|
1008
|
+
while (i < region.length && region[i] !== quote) i++;
|
|
1009
|
+
value = region.substring(vStart, i);
|
|
1010
|
+
if (i < region.length) i++;
|
|
1011
|
+
while (i < region.length && (region[i] === " " || region[i] === " "))
|
|
1012
|
+
i++;
|
|
1013
|
+
} else {
|
|
1014
|
+
const vStart = i;
|
|
1015
|
+
while (i < region.length && region[i] !== ",") i++;
|
|
1016
|
+
value = region.substring(vStart, i).trim();
|
|
1017
|
+
}
|
|
1018
|
+
const key = aliasMap.get(rawKey) ?? rawKey;
|
|
1019
|
+
if (!value) {
|
|
1020
|
+
if (diagnostics && line !== void 0) {
|
|
1021
|
+
diagnostics.push(
|
|
1022
|
+
makeDgmoError(
|
|
1023
|
+
line,
|
|
1024
|
+
emptyMetadataValueMessage(rawKey),
|
|
1025
|
+
"warning",
|
|
1026
|
+
METADATA_DIAGNOSTIC_CODES.EMPTY_METADATA_VALUE
|
|
1027
|
+
)
|
|
1028
|
+
);
|
|
1029
|
+
}
|
|
1030
|
+
continue;
|
|
1031
|
+
}
|
|
1032
|
+
meta[key] = value;
|
|
1033
|
+
}
|
|
1034
|
+
return meta;
|
|
1035
|
+
}
|
|
1036
|
+
function cutUnionMetadata(line, registry) {
|
|
1037
|
+
return findMetadataCutOffset(line, scanTokens(line), registry);
|
|
1038
|
+
}
|
|
1039
|
+
function splitNameAndMeta(line, registry, aliasMap = /* @__PURE__ */ new Map(), palette, diagnostics, lineNumber, options = {}) {
|
|
1040
|
+
const tokens = scanTokens(line);
|
|
1041
|
+
const cutOffset = findMetadataCutOffset(line, tokens, registry);
|
|
1042
|
+
let nameRegion;
|
|
1043
|
+
let metaRegion;
|
|
1044
|
+
if (cutOffset === -1) {
|
|
1045
|
+
nameRegion = line.trim();
|
|
1046
|
+
metaRegion = "";
|
|
1047
|
+
} else {
|
|
1048
|
+
nameRegion = line.substring(0, cutOffset).trimEnd();
|
|
1049
|
+
metaRegion = line.substring(cutOffset);
|
|
1050
|
+
}
|
|
1051
|
+
const colorResult = peelTrailingColorName(nameRegion);
|
|
1052
|
+
let postColorName = colorResult.label;
|
|
1053
|
+
let alias;
|
|
1054
|
+
if (options.peelAlias !== false) {
|
|
1055
|
+
const aliasMatch = postColorName.match(AS_ALIAS_RE);
|
|
1056
|
+
if (aliasMatch) {
|
|
1057
|
+
alias = aliasMatch[1];
|
|
1058
|
+
postColorName = postColorName.substring(0, aliasMatch.index).trimEnd();
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
const meta = metaRegion.length > 0 ? parseMetadataRegion(metaRegion, aliasMap, diagnostics, lineNumber) : {};
|
|
1062
|
+
void palette;
|
|
1063
|
+
return {
|
|
1064
|
+
name: postColorName,
|
|
1065
|
+
meta,
|
|
1066
|
+
...colorResult.colorName !== void 0 && {
|
|
1067
|
+
color: colorResult.colorName
|
|
1068
|
+
},
|
|
1069
|
+
...alias !== void 0 && { alias }
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
var POTENTIAL_META_RE = /\b([\w-]+)\s*:/;
|
|
1073
|
+
function warnUnknownMetaKeys(meta, registry, warn, nameToScan) {
|
|
1074
|
+
const candidates = Array.from(registry.keys);
|
|
1075
|
+
for (const key of Object.keys(meta)) {
|
|
1076
|
+
if (isReservedKey(registry, key)) continue;
|
|
1077
|
+
const hint = suggest(key, candidates);
|
|
1078
|
+
warn(`Unknown metadata key "${key}".${hint ? " " + hint : ""}`);
|
|
1079
|
+
}
|
|
1080
|
+
if (nameToScan) {
|
|
1081
|
+
const m = nameToScan.match(POTENTIAL_META_RE);
|
|
1082
|
+
if (m) {
|
|
1083
|
+
const key = m[1].toLowerCase();
|
|
1084
|
+
if (!isReservedKey(registry, key)) {
|
|
1085
|
+
const hint = suggest(key, candidates);
|
|
1086
|
+
if (hint) {
|
|
1087
|
+
warn(`Unknown metadata key "${key}". ${hint}`);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
379
1094
|
export {
|
|
380
1095
|
INFRA_TOP_LEVEL_OPTION_SET,
|
|
381
1096
|
INFRA_BEHAVIOR_KEY_SET,
|
|
@@ -387,6 +1102,57 @@ export {
|
|
|
387
1102
|
REGISTRY_CONTROL_TOKENS,
|
|
388
1103
|
REGISTRY_STATUS_TOKENS,
|
|
389
1104
|
REGISTRY_MODIFIER_TOKENS,
|
|
390
|
-
REGISTRY_COLON_KEY_TOKENS
|
|
1105
|
+
REGISTRY_COLON_KEY_TOKENS,
|
|
1106
|
+
withTagAliases,
|
|
1107
|
+
isReservedKey,
|
|
1108
|
+
SEQUENCE_REGISTRY,
|
|
1109
|
+
INFRA_REGISTRY,
|
|
1110
|
+
MAP_REGISTRY,
|
|
1111
|
+
ORG_REGISTRY,
|
|
1112
|
+
C4_REGISTRY,
|
|
1113
|
+
ER_REGISTRY,
|
|
1114
|
+
EVENT_LINE_REGISTRY,
|
|
1115
|
+
KANBAN_REGISTRY,
|
|
1116
|
+
SITEMAP_REGISTRY,
|
|
1117
|
+
GANTT_REGISTRY,
|
|
1118
|
+
PERT_REGISTRY,
|
|
1119
|
+
BOXES_AND_LINES_REGISTRY,
|
|
1120
|
+
STATE_REGISTRY,
|
|
1121
|
+
SKETCH_REGISTRY,
|
|
1122
|
+
TIMELINE_REGISTRY,
|
|
1123
|
+
MINDMAP_REGISTRY,
|
|
1124
|
+
TECH_RADAR_REGISTRY,
|
|
1125
|
+
CYCLE_REGISTRY,
|
|
1126
|
+
JOURNEY_MAP_REGISTRY,
|
|
1127
|
+
PYRAMID_REGISTRY,
|
|
1128
|
+
RING_REGISTRY,
|
|
1129
|
+
TREEMAP_REGISTRY,
|
|
1130
|
+
RACI_REGISTRY,
|
|
1131
|
+
FAMILY_PERSON_REGISTRY,
|
|
1132
|
+
FAMILY_UNION_REGISTRY,
|
|
1133
|
+
ALL_CHART_TYPES,
|
|
1134
|
+
measureIndent,
|
|
1135
|
+
extractColor,
|
|
1136
|
+
OPTION_NOCOLON_RE,
|
|
1137
|
+
GLOBAL_BOOLEANS,
|
|
1138
|
+
legendSuppressed,
|
|
1139
|
+
FILL_FAMILY_TOKENS,
|
|
1140
|
+
fillModeFromToken,
|
|
1141
|
+
fillModeFromOptions,
|
|
1142
|
+
tryParseSharedOption,
|
|
1143
|
+
parseFirstLine,
|
|
1144
|
+
detectBadChartTypeDeclaration,
|
|
1145
|
+
normalizeNumericToken,
|
|
1146
|
+
stripQuotes,
|
|
1147
|
+
tokenizeQuoteAware,
|
|
1148
|
+
collectIndentedValues,
|
|
1149
|
+
parseSeriesNames,
|
|
1150
|
+
peelTrailingColorName,
|
|
1151
|
+
peelTrailingCollapsedFlag,
|
|
1152
|
+
peelRampColors,
|
|
1153
|
+
parseMetadataRegion,
|
|
1154
|
+
cutUnionMetadata,
|
|
1155
|
+
splitNameAndMeta,
|
|
1156
|
+
warnUnknownMetaKeys
|
|
391
1157
|
};
|
|
392
|
-
//# sourceMappingURL=chunk-
|
|
1158
|
+
//# sourceMappingURL=chunk-3FRO35WW.js.map
|