@diagrammo/dgmo 0.53.0 → 0.55.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 +112 -9
- package/dist/advanced.js +188 -160
- package/dist/auto.js +147 -132
- package/dist/auto.mjs +2352 -746
- package/dist/block.js +65 -62
- package/dist/chart-meta.js +52 -49
- package/dist/{charts-d3-DH2XA45I.js → charts-d3-KZ6V4OP2.js} +10 -8
- package/dist/chunk-2CW5ZTNH.js +58 -0
- package/dist/{chunk-MA3HJZHB.js → chunk-2HX6ZGY7.js} +7 -7
- package/dist/{chunk-YG2BEIQU.js → chunk-2R6HG6D5.js} +11 -11
- package/dist/{chunk-65V6IRFN.js → chunk-2ZJXKJSI.js} +106 -60
- package/dist/{chunk-PYO4TJJ3.js → chunk-32HUNA33.js} +60 -18
- package/dist/{chunk-UK6DKJLD.js → chunk-3BFXELBL.js} +51 -4
- package/dist/{chunk-RW5PEJ7D.js → chunk-3BZJ5KD5.js} +7 -3
- package/dist/{chunk-FT7TPPZ5.js → chunk-3FUTFYSP.js} +65 -26
- package/dist/{chunk-QAALSCKI.js → chunk-4MZCJV4M.js} +12 -12
- package/dist/{chunk-ZXUAPTCK.js → chunk-4R5KIPNX.js} +2 -2
- package/dist/{chunk-QWIBT6DS.js → chunk-5D5VHDJM.js} +49 -14
- package/dist/{chunk-U7NKYLX2.js → chunk-5H5GWWA4.js} +55 -19
- package/dist/{chunk-P3H7QVDH.js → chunk-5K5XBEXT.js} +11 -6
- package/dist/{chunk-PT4SW76W.js → chunk-6NJWBMJV.js} +49 -14
- package/dist/{chunk-I46X5VUA.js → chunk-7TF3QOOD.js} +25 -1
- package/dist/{chunk-6DCOIN4W.js → chunk-A2ARDILY.js} +783 -3
- package/dist/{chunk-CK2GMDXD.js → chunk-A2PTRSAO.js} +2 -2
- package/dist/{chunk-APKUAJ2L.js → chunk-A2RUBBVT.js} +14 -1
- package/dist/{chunk-GMIJ35PW.js → chunk-A4UJP4IS.js} +68 -20
- package/dist/{chunk-LQHVDZYC.js → chunk-AKE6C2D7.js} +4 -4
- package/dist/{chunk-W5KMNC5U.js → chunk-ASPS5O6F.js} +9 -10
- package/dist/{chunk-FLDC7ZAK.js → chunk-AU75JHSR.js} +6 -3
- package/dist/chunk-BEOAKGNA.js +484 -0
- package/dist/{chunk-XY3UDKKH.js → chunk-COVYNAKJ.js} +4 -4
- package/dist/{chunk-4ASVFYB2.js → chunk-DS4MDEQ7.js} +5 -5
- package/dist/{chunk-7JDTNFAK.js → chunk-EFUQENO5.js} +76 -32
- package/dist/{chunk-BULHGPHK.js → chunk-EMSOFHEN.js} +2 -2
- package/dist/{chunk-3BEKKRH5.js → chunk-ETTDF3S2.js} +49 -11
- package/dist/{chunk-JHOAH4TI.js → chunk-ETYF5QZR.js} +2 -2
- package/dist/{chunk-AHXIMHDQ.js → chunk-F5ZNUMSY.js} +53 -14
- package/dist/{chunk-I64ECJX3.js → chunk-FBP33UM6.js} +3 -3
- package/dist/{chunk-VIRANCNY.js → chunk-FGAMFJNJ.js} +58 -20
- package/dist/{chunk-774C2FF3.js → chunk-GRXPFBYC.js} +24 -3
- package/dist/{chunk-NNYFQOTK.js → chunk-GTO5VCYG.js} +10 -8
- package/dist/{chunk-RJ5LBZ5U.js → chunk-HES4K6DV.js} +13 -13
- package/dist/{chunk-AZNXGWDC.js → chunk-HGKOVKAX.js} +7 -7
- package/dist/{chunk-DWUMPMV2.js → chunk-HLGOG44K.js} +2 -2
- package/dist/{chunk-VJHBSPGF.js → chunk-HUTP35XT.js} +5 -4
- package/dist/{chunk-3CZLWOCI.js → chunk-HX7QNHC6.js} +3 -3
- package/dist/{chunk-R5NH5BZG.js → chunk-IALX52TR.js} +6 -6
- package/dist/{chunk-A44USUV7.js → chunk-ICZ7M6IZ.js} +23 -17
- package/dist/{chunk-27STWBOK.js → chunk-IF4KYSJZ.js} +10 -8
- package/dist/{chunk-HORZ5H2L.js → chunk-IG6J7JWH.js} +61 -22
- package/dist/{chunk-VRRDUYOK.js → chunk-IIUYKQ5J.js} +3 -3
- package/dist/{chunk-GMAH572Z.js → chunk-INTAQV2Y.js} +2 -2
- package/dist/{chunk-6AUZPPAV.js → chunk-ITXL2KU5.js} +2 -2
- package/dist/{chunk-KKHCNSKK.js → chunk-IWG2ECAO.js} +5 -5
- package/dist/{chunk-GQ644SPD.js → chunk-JGCEFKZP.js} +14 -14
- package/dist/{chunk-HNBY6CNV.js → chunk-JQLSFZZP.js} +2 -2
- package/dist/{chunk-CMVZWP32.js → chunk-JR7Q6GHE.js} +2 -2
- package/dist/{chunk-LHILKFDP.js → chunk-KC3WBBI7.js} +9 -9
- package/dist/{chunk-GABSL6TH.js → chunk-KK3L5NVK.js} +3 -3
- package/dist/{chunk-LC3FFD43.js → chunk-L2DIXZUT.js} +98 -48
- package/dist/{chunk-4WGMGKCZ.js → chunk-LCRPGGGS.js} +11 -11
- package/dist/{chunk-6KY7OCZC.js → chunk-LKGQ46P4.js} +3 -3
- package/dist/{chunk-HE5J53SZ.js → chunk-LW7STMYZ.js} +3 -3
- package/dist/{chunk-BD3WGY4T.js → chunk-M53MDBIW.js} +2 -2
- package/dist/{chunk-AN2DQB3G.js → chunk-MEH4TJEX.js} +12 -12
- package/dist/{chunk-SGPFVDUL.js → chunk-MNS2ENXF.js} +6 -6
- package/dist/{chunk-FXCB7H5O.js → chunk-MSWIBF6J.js} +2 -2
- package/dist/{chunk-BR7AYN76.js → chunk-NL7FUIVD.js} +12 -12
- package/dist/{chunk-AIMLCDAO.js → chunk-NN5TF4OV.js} +2 -2
- package/dist/{chunk-7GUF6SDR.js → chunk-NPPUZ4SK.js} +9 -9
- package/dist/{chunk-4K42RUGC.js → chunk-NYOOPQFD.js} +47 -12
- package/dist/{chunk-FFXCKZOU.js → chunk-O4CZDTQA.js} +3 -3
- package/dist/{chunk-6HTRCTAS.js → chunk-P5XXIVEU.js} +6 -4
- package/dist/{chunk-XEAQDIMF.js → chunk-PC4YLEKA.js} +6 -6
- package/dist/{chunk-Q7AH665U.js → chunk-PCVXXPYU.js} +121 -38
- package/dist/{chunk-W2DINCHL.js → chunk-PKUWYPI5.js} +207 -24
- package/dist/{chunk-PV2QO7QL.js → chunk-PSIDVCBA.js} +2 -2
- package/dist/{chunk-YR43LJT5.js → chunk-PV7ND5WL.js} +58 -15
- package/dist/{chunk-QI3BOLQB.js → chunk-Q5CMQVWF.js} +4 -4
- package/dist/{chunk-4RGZFA7H.js → chunk-Q5IHQ4NW.js} +11 -1
- package/dist/{chunk-SG4PRYO3.js → chunk-QQXFYTLC.js} +391 -60
- package/dist/{chunk-GWQJKTFS.js → chunk-QZYGRDMM.js} +118 -99
- package/dist/{chunk-CQFNIIQN.js → chunk-RKBCKCSF.js} +2 -2
- package/dist/{chunk-FUKNRLIJ.js → chunk-RSBH2C7O.js} +6 -6
- package/dist/{chunk-2QC4HXCY.js → chunk-RYNCWA5X.js} +11 -10
- package/dist/{chunk-NNUMX6WX.js → chunk-RZWIPDZ2.js} +40 -15
- package/dist/{chunk-VKNCC2GX.js → chunk-S52F62GW.js} +13 -13
- package/dist/{chunk-UQRIKAMH.js → chunk-SCOHNGPG.js} +59 -18
- package/dist/{chunk-VGNIDAPQ.js → chunk-SSHS42QG.js} +4 -4
- package/dist/chunk-TGOMHUOV.js +218 -0
- package/dist/{chunk-UKP5HWB5.js → chunk-UBQU2BY6.js} +4 -4
- package/dist/{chunk-IQJCVREL.js → chunk-UES4P7FN.js} +6 -6
- package/dist/chunk-US3P2DQO.js +87 -0
- package/dist/{chunk-GAWKIIPO.js → chunk-UXXLE6AH.js} +8 -8
- package/dist/{chunk-22OQWBWD.js → chunk-VMWSZCAK.js} +12 -11
- package/dist/{chunk-XG4NWFPY.js → chunk-VVIRAGID.js} +13 -13
- package/dist/{chunk-X3RXGSCZ.js → chunk-VXTUWXFB.js} +54 -15
- package/dist/{chunk-J7HI6G3G.js → chunk-W4TSD3IP.js} +6 -6
- package/dist/{chunk-FGDSTT3F.js → chunk-WB3NA3JJ.js} +2 -2
- package/dist/{chunk-KUSAVOWZ.js → chunk-WITOJZGL.js} +8 -4
- package/dist/{chunk-UVDCHR4E.js → chunk-WVGNXDEE.js} +2 -2
- package/dist/{chunk-HOXKNRON.js → chunk-X3X4LZDC.js} +2 -2
- package/dist/{chunk-SQCBSFT5.js → chunk-XKKH2DPG.js} +51 -263
- package/dist/{chunk-NR5HCAUD.js → chunk-XSVWUOUZ.js} +1 -1
- package/dist/{chunk-BFDVEO5R.js → chunk-Y4BBGFKY.js} +2 -2
- package/dist/{chunk-VAO6ANGC.js → chunk-YP2T5YUP.js} +14 -9
- package/dist/{chunk-PKNNHU7H.js → chunk-YXKNXIWA.js} +19 -11
- package/dist/{chunk-UFQJMOVZ.js → chunk-ZGIBV36U.js} +6 -6
- package/dist/{chunk-XQ4KN6JQ.js → chunk-ZP265ICS.js} +16 -15
- package/dist/{chunk-JTMSWEIW.js → chunk-ZWVKTWK6.js} +4 -4
- package/dist/{chunk-ALYZ3MAA.js → chunk-ZXNHHO6D.js} +8 -476
- package/dist/cli.cjs +166 -149
- package/dist/clock.js +34 -1
- package/dist/completion-registry.d.ts +129 -0
- package/dist/completion-registry.js +1278 -0
- package/dist/{compute-G55RG53N.js → compute-JAP5E2E4.js} +2 -2
- package/dist/dgmo-router-T4HGLIGA.js +88 -0
- package/dist/{dimensions-K6PGYYGT.js → dimensions-3JINHSYK.js} +8 -8
- package/dist/editor.js +28 -1
- package/dist/element.js +148 -133
- package/dist/element.mjs +2352 -746
- package/dist/{flowchart-parser-LALR6J6F.js → flowchart-parser-M7KKTLX7.js} +5 -5
- package/dist/{flowchart-renderer-DXYB5YRF.js → flowchart-renderer-FFEQFQEU.js} +9 -9
- package/dist/highlight.js +28 -1
- package/dist/index.js +77 -64
- package/dist/{layout-ZE5DRJWX.js → layout-3ZZBKUQC.js} +4 -4
- package/dist/{layout-3BVDMKXI.js → layout-AUKTWGYL.js} +4 -4
- package/dist/{layout-4IHCMWZN.js → layout-CRLTSFYQ.js} +4 -4
- package/dist/{layout-WCAIKGZG.js → layout-FNZDJGKF.js} +5 -5
- package/dist/layout-GHWRJKZQ.js +15 -0
- package/dist/{layout-3V2A4MUE.js → layout-LGXOKUCD.js} +6 -5
- package/dist/{layout-WSMPBQ4Q.js → layout-NF4EWFLT.js} +3 -3
- package/dist/{layout-OL2XFJXA.js → layout-SP7HJWKA.js} +3 -3
- package/dist/{layout-E6HR6PXH.js → layout-UR7CYAHL.js} +3 -3
- package/dist/layout-UTMEVFHN.js +15 -0
- package/dist/{layout-search-34DPZD43.js → layout-search-U2H4ORFJ.js} +14 -7
- package/dist/{legend-constants-P5EQWRQQ.js → legend-constants-B77VKB3R.js} +7 -2
- package/dist/{parser-6PPHAXXH.js → parser-2AXPSKWB.js} +5 -5
- package/dist/{parser-5HQXCNOS.js → parser-2AZ2KQTO.js} +4 -4
- package/dist/{parser-3KIGEEJM.js → parser-2LF33IS2.js} +4 -4
- package/dist/{parser-NNIL3HXU.js → parser-3QJ2Z4H4.js} +3 -3
- package/dist/parser-5GCQFSTQ.js +13 -0
- package/dist/{parser-6B6SSZT7.js → parser-62OHBRU5.js} +3 -3
- package/dist/{parser-VOERD6XR.js → parser-7LYJFZCP.js} +4 -4
- package/dist/{parser-ZGNXYFPS.js → parser-BMOTF72G.js} +3 -3
- package/dist/{parser-IVGHXLZP.js → parser-CIFLYZYP.js} +4 -3
- package/dist/{parser-GN2MM5CC.js → parser-D2UL2G5U.js} +3 -3
- package/dist/{parser-GKP2MHHL.js → parser-DM2APTKB.js} +3 -3
- package/dist/{parser-27Z76SN3.js → parser-DYYTPLBL.js} +4 -4
- package/dist/{parser-5FGJSQNS.js → parser-GOUGUTPU.js} +4 -4
- package/dist/{parser-G26MTBFS.js → parser-HGVUVD6J.js} +3 -3
- package/dist/{parser-EXNBDNGY.js → parser-IEJD3CZB.js} +3 -3
- package/dist/{parser-ZQDQTB4X.js → parser-JBEWNLAV.js} +5 -5
- package/dist/{parser-5QPFOB5F.js → parser-JMXPHNZD.js} +4 -4
- package/dist/{parser-4E4I3GNT.js → parser-JMXSQY3K.js} +4 -4
- package/dist/{parser-FF4BMRSB.js → parser-LUXS7J32.js} +4 -4
- package/dist/{parser-3VSWEKBF.js → parser-M5BUHULF.js} +4 -4
- package/dist/{parser-IKWK2ZU3.js → parser-MESRHUS4.js} +4 -5
- package/dist/{parser-3CODK6RG.js → parser-OOYNI2UT.js} +4 -4
- package/dist/{parser-YSLNDFLV.js → parser-PVBUAVRR.js} +4 -5
- package/dist/{parser-CKA3QMAG.js → parser-QKRBSQLJ.js} +5 -5
- package/dist/{parser-UWRX52PC.js → parser-S6NWSIJO.js} +4 -4
- package/dist/{parser-RNLTBIJ6.js → parser-SFEK6Q7Z.js} +4 -4
- package/dist/{parser-7JVIDLLR.js → parser-SUV52NQW.js} +4 -4
- package/dist/{parser-CRKLXGW7.js → parser-SZHGLOOZ.js} +4 -4
- package/dist/{parser-275KP7JO.js → parser-TO7IENWL.js} +5 -6
- package/dist/{parser-XNKJCMMA.js → parser-TVAMC7CQ.js} +4 -4
- package/dist/{parser-FOOFEJQU.js → parser-VAW46R57.js} +4 -4
- package/dist/{parser-XVPTRWZ4.js → parser-XDSPOXSE.js} +4 -4
- package/dist/pert.d.ts +2 -0
- package/dist/{renderer-D3BRNOMV.js → renderer-3PWLOJPD.js} +11 -11
- package/dist/{renderer-7NQSTQMQ.js → renderer-5EMHIQL5.js} +4 -4
- package/dist/{renderer-ZBTEX2JK.js → renderer-5PODNLYP.js} +4 -4
- package/dist/{renderer-6WRYVM5R.js → renderer-AQJIQ2XU.js} +9 -8
- package/dist/{renderer-JCZG6AYU.js → renderer-BEW3AYFT.js} +10 -10
- package/dist/{renderer-YUKPS27O.js → renderer-C3UYAXA6.js} +10 -8
- package/dist/{renderer-AK2WO4EI.js → renderer-CENXCMWG.js} +4 -4
- package/dist/{renderer-HIFQVEJA.js → renderer-CXM3ARYN.js} +10 -9
- package/dist/{renderer-JTCX6PCG.js → renderer-DW6TEBLA.js} +10 -9
- package/dist/{renderer-VMH6L6CP.js → renderer-FE5M6SEZ.js} +10 -9
- package/dist/{renderer-TYHGXAVT.js → renderer-FXK6ZL3P.js} +4 -4
- package/dist/{renderer-UPF7NRTI.js → renderer-G5ESLCJB.js} +12 -11
- package/dist/{renderer-CWEFGEIC.js → renderer-HTDS4FED.js} +14 -13
- package/dist/{renderer-XTXSOK3L.js → renderer-IO4KCFVL.js} +10 -10
- package/dist/{renderer-SQ54MDSA.js → renderer-IRAFJNTK.js} +10 -9
- package/dist/{renderer-JWGQSTMR.js → renderer-MFTTFW32.js} +15 -14
- package/dist/{renderer-2C6DJRYN.js → renderer-MPXI4FVL.js} +8 -8
- package/dist/{renderer-5MPN7CXZ.js → renderer-NVBEMQ6L.js} +5 -5
- package/dist/{renderer-7ZNVOVFG.js → renderer-OOGDCR6K.js} +3 -3
- package/dist/{renderer-COLQFSFV.js → renderer-Q5P72O4A.js} +9 -9
- package/dist/{renderer-WCWI4I6A.js → renderer-QZESC66H.js} +2 -2
- package/dist/{renderer-NE5W7CQP.js → renderer-RDBUXW7P.js} +6 -5
- package/dist/{renderer-6EN5XXJZ.js → renderer-S4XB3JR2.js} +11 -11
- package/dist/{renderer-WFSUBKUL.js → renderer-SIWEEWJ5.js} +9 -8
- package/dist/{renderer-LVZAHRP6.js → renderer-TKTM2SL4.js} +12 -12
- package/dist/{renderer-QD2SJF2I.js → renderer-TXTTV4HA.js} +10 -9
- package/dist/{renderer-YUXGXGSW.js → renderer-UZIU4AHK.js} +10 -9
- package/dist/{renderer-RLMOTXZ6.js → renderer-V72VJIGG.js} +14 -13
- package/dist/{renderer-UKXW2QPE.js → renderer-VEGOEZOI.js} +10 -8
- package/dist/{renderer-WNFXYYGL.js → renderer-W6I6T2TA.js} +8 -8
- package/dist/{renderer-KARQF3F3.js → renderer-WSHJRR2T.js} +8 -8
- package/dist/{renderer-radial-WF6VOUOD.js → renderer-radial-AG75PBYD.js} +9 -9
- package/dist/{resolver-WFKZYBJ2.js → resolver-ZSFQQRTH.js} +3 -3
- package/dist/{state-parser-L7DHZIQO.js → state-parser-KIPZGIB4.js} +5 -5
- package/dist/{state-renderer-TFEUOP4H.js → state-renderer-U6OSJG52.js} +13 -12
- package/docs/language-reference.md +2 -1
- 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
- package/dist/parser-7JHWEWXM.js +0 -13
|
@@ -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) ───────────────────
|
|
@@ -128,6 +141,15 @@ var DIRECTIVES_REGISTRY = [
|
|
|
128
141
|
// most types via GLOBAL_BOOLEANS in utils/parsing; gantt derives its boolean
|
|
129
142
|
// Set from here, and map from `map: true`.
|
|
130
143
|
{ token: "no-legend", category: "directive", gantt: ["boolean"], map: true },
|
|
144
|
+
// `legend-inline`: universal §1.9 boolean (decision #50) — the top-center-
|
|
145
|
+
// legend data charts (bar/line/radar/scatter/function) render the title and
|
|
146
|
+
// legend on one line; every other chart accepts it as a harmless no-op.
|
|
147
|
+
{
|
|
148
|
+
token: "legend-inline",
|
|
149
|
+
category: "directive",
|
|
150
|
+
gantt: ["boolean"],
|
|
151
|
+
map: true
|
|
152
|
+
},
|
|
131
153
|
// ══════════════════════════════════════════════════════════
|
|
132
154
|
// Highlight-only vocab (no extractable parser Set).
|
|
133
155
|
// ══════════════════════════════════════════════════════════
|
|
@@ -240,6 +262,23 @@ var DIRECTIVES_REGISTRY = [
|
|
|
240
262
|
// ── Color / notes (cross-chart) ──────────────────────────
|
|
241
263
|
{ token: "color", category: "directive" },
|
|
242
264
|
{ token: "no-notes", category: "directive" },
|
|
265
|
+
// ── Emphasis family (§1.11, decision #49) ────────────────
|
|
266
|
+
// `highlight <Name>…` / `dim <Name>…` — the figure/ground axis, orthogonal
|
|
267
|
+
// to color (§1.5) and to the chart-wide `fill-*` family (§1.9). Both are
|
|
268
|
+
// chart-level directives taking a name list, validated inline by each
|
|
269
|
+
// adopting parser (no extractable Set), so the registry is their single
|
|
270
|
+
// declaration site for highlighting.
|
|
271
|
+
//
|
|
272
|
+
// `highlight` shipped on `family` long before this entry existed and was
|
|
273
|
+
// never registered — it had completions but highlighted as plain text. Both
|
|
274
|
+
// tokens are registered together so the whole family lights up at once.
|
|
275
|
+
//
|
|
276
|
+
// Supported on `sankey` and `family` today; every further chart type is a
|
|
277
|
+
// separate decision. Registering them globally is correct regardless: the
|
|
278
|
+
// Lezer specializer is context-free (it cannot know the chart type), and the
|
|
279
|
+
// same is already true of every other chart-scoped token here.
|
|
280
|
+
{ token: "highlight", category: "directive" },
|
|
281
|
+
{ token: "dim", category: "directive" },
|
|
243
282
|
// ── RACI ─────────────────────────────────────────────────
|
|
244
283
|
{ token: "roles", category: "directive" },
|
|
245
284
|
// ── Cycle ────────────────────────────────────────────────
|
|
@@ -249,7 +288,7 @@ var DIRECTIVES_REGISTRY = [
|
|
|
249
288
|
{ token: "persona", category: "directive" },
|
|
250
289
|
// ── Function ─────────────────────────────────────────────
|
|
251
290
|
{ token: "x", category: "directive" },
|
|
252
|
-
{ token: "
|
|
291
|
+
{ token: "fill", category: "directive" },
|
|
253
292
|
// ── Wordcloud ────────────────────────────────────────────
|
|
254
293
|
{ token: "max", category: "directive" },
|
|
255
294
|
{ token: "size", category: "directive" },
|
|
@@ -343,6 +382,7 @@ function tokensWhere(pred) {
|
|
|
343
382
|
for (const e of DIRECTIVES_REGISTRY) if (pred(e)) out.add(e.token);
|
|
344
383
|
return out;
|
|
345
384
|
}
|
|
385
|
+
var ALL_REGISTRY_TOKENS = tokensWhere(() => true);
|
|
346
386
|
var INFRA_TOP_LEVEL_OPTION_SET = tokensWhere(
|
|
347
387
|
(e) => !!e.infra?.includes("top-level")
|
|
348
388
|
);
|
|
@@ -376,6 +416,694 @@ var REGISTRY_NON_HIGHLIGHT_TOKENS = tokensWhere(
|
|
|
376
416
|
(e) => !!e.noHighlight
|
|
377
417
|
);
|
|
378
418
|
|
|
419
|
+
// src/utils/reserved-key-registry.ts
|
|
420
|
+
function staticRegistry(keys) {
|
|
421
|
+
return { keys: new Set(keys), tagAliases: /* @__PURE__ */ new Set() };
|
|
422
|
+
}
|
|
423
|
+
function withTagAliases(base, aliases) {
|
|
424
|
+
return { keys: base.keys, tagAliases: aliases };
|
|
425
|
+
}
|
|
426
|
+
function isReservedKey(registry, key) {
|
|
427
|
+
return registry.keys.has(key) || registry.tagAliases.has(key);
|
|
428
|
+
}
|
|
429
|
+
var SEQUENCE_REGISTRY = staticRegistry([
|
|
430
|
+
"color",
|
|
431
|
+
"description",
|
|
432
|
+
"role",
|
|
433
|
+
"collapsed",
|
|
434
|
+
// Participant layout-order override (§2.2). Colon-keyed `position: N`.
|
|
435
|
+
"position"
|
|
436
|
+
]);
|
|
437
|
+
var INFRA_REGISTRY = staticRegistry([
|
|
438
|
+
"color",
|
|
439
|
+
"description",
|
|
440
|
+
"collapsed",
|
|
441
|
+
"icon"
|
|
442
|
+
]);
|
|
443
|
+
var MAP_REGISTRY = staticRegistry([
|
|
444
|
+
"heat",
|
|
445
|
+
"size",
|
|
446
|
+
"width",
|
|
447
|
+
"label",
|
|
448
|
+
"style",
|
|
449
|
+
// `clock` (BL-122): the time-card control. Bare (`poi Denver clock`) → a card
|
|
450
|
+
// with the zone auto-derived from the place; valued (`clock: Europe/Oslo`) →
|
|
451
|
+
// that IANA id or fixed offset (`clock: UTC+9`) as the zone, for bare-coord
|
|
452
|
+
// pins or to override a city. Reserved so the valued form peels off the POI
|
|
453
|
+
// name cleanly; the BARE flag is peeled separately in handlePoi (no colon).
|
|
454
|
+
"clock"
|
|
455
|
+
// `surface:` was removed in the 2026-06-02 defaults-on review — it is no longer
|
|
456
|
+
// a recognized metadata key (the route/edge surface feature was cut; §24B.7).
|
|
457
|
+
// A stray `surface: water` is no longer captured as a reserved key.
|
|
458
|
+
]);
|
|
459
|
+
var ORG_REGISTRY = staticRegistry([
|
|
460
|
+
"color",
|
|
461
|
+
"description",
|
|
462
|
+
"role",
|
|
463
|
+
"location",
|
|
464
|
+
"email",
|
|
465
|
+
"phone"
|
|
466
|
+
]);
|
|
467
|
+
var C4_REGISTRY = staticRegistry([
|
|
468
|
+
"color",
|
|
469
|
+
"description",
|
|
470
|
+
"tech",
|
|
471
|
+
"type",
|
|
472
|
+
"collapsed"
|
|
473
|
+
]);
|
|
474
|
+
var ER_REGISTRY = staticRegistry([
|
|
475
|
+
"color",
|
|
476
|
+
"description",
|
|
477
|
+
"domain"
|
|
478
|
+
]);
|
|
479
|
+
var EVENT_LINE_REGISTRY = staticRegistry([
|
|
480
|
+
"color"
|
|
481
|
+
]);
|
|
482
|
+
var KANBAN_REGISTRY = staticRegistry([
|
|
483
|
+
"color",
|
|
484
|
+
"description",
|
|
485
|
+
"wip",
|
|
486
|
+
"assignee",
|
|
487
|
+
"due",
|
|
488
|
+
"collapsed"
|
|
489
|
+
// `[Column] collapsed: true` view-state marker
|
|
490
|
+
]);
|
|
491
|
+
var SITEMAP_REGISTRY = staticRegistry([
|
|
492
|
+
"color",
|
|
493
|
+
"description",
|
|
494
|
+
"status"
|
|
495
|
+
]);
|
|
496
|
+
var GANTT_REGISTRY = staticRegistry([
|
|
497
|
+
"color",
|
|
498
|
+
"description",
|
|
499
|
+
"duration",
|
|
500
|
+
"offset",
|
|
501
|
+
"progress",
|
|
502
|
+
"start",
|
|
503
|
+
"collapsed"
|
|
504
|
+
// `[Group] collapsed: true` view-state marker
|
|
505
|
+
]);
|
|
506
|
+
var PERT_REGISTRY = staticRegistry([
|
|
507
|
+
"color",
|
|
508
|
+
"description",
|
|
509
|
+
"confidence",
|
|
510
|
+
"collapsed"
|
|
511
|
+
]);
|
|
512
|
+
var BOXES_AND_LINES_REGISTRY = staticRegistry([
|
|
513
|
+
"color",
|
|
514
|
+
"description",
|
|
515
|
+
"heat"
|
|
516
|
+
]);
|
|
517
|
+
var STATE_REGISTRY = staticRegistry([]);
|
|
518
|
+
var SKETCH_REGISTRY = staticRegistry([
|
|
519
|
+
"shape",
|
|
520
|
+
"at",
|
|
521
|
+
"collapsed"
|
|
522
|
+
]);
|
|
523
|
+
var TIMELINE_REGISTRY = staticRegistry([
|
|
524
|
+
"color",
|
|
525
|
+
"description",
|
|
526
|
+
"duration"
|
|
527
|
+
]);
|
|
528
|
+
var MINDMAP_REGISTRY = staticRegistry([
|
|
529
|
+
"color",
|
|
530
|
+
"description",
|
|
531
|
+
"collapsed"
|
|
532
|
+
]);
|
|
533
|
+
var TECH_RADAR_REGISTRY = staticRegistry([
|
|
534
|
+
"color",
|
|
535
|
+
"description",
|
|
536
|
+
"quadrant",
|
|
537
|
+
"ring",
|
|
538
|
+
"trend"
|
|
539
|
+
]);
|
|
540
|
+
var CYCLE_REGISTRY = staticRegistry([
|
|
541
|
+
"color",
|
|
542
|
+
"description",
|
|
543
|
+
"width",
|
|
544
|
+
"span"
|
|
545
|
+
]);
|
|
546
|
+
var JOURNEY_MAP_REGISTRY = staticRegistry([
|
|
547
|
+
"color",
|
|
548
|
+
"description",
|
|
549
|
+
"score",
|
|
550
|
+
"emotion",
|
|
551
|
+
"pain",
|
|
552
|
+
"opportunity",
|
|
553
|
+
"thought"
|
|
554
|
+
]);
|
|
555
|
+
var PYRAMID_REGISTRY = staticRegistry([
|
|
556
|
+
"color",
|
|
557
|
+
"description"
|
|
558
|
+
]);
|
|
559
|
+
var RING_REGISTRY = staticRegistry([
|
|
560
|
+
"color",
|
|
561
|
+
"description"
|
|
562
|
+
]);
|
|
563
|
+
var TREEMAP_REGISTRY = staticRegistry(["heat"]);
|
|
564
|
+
var RACI_REGISTRY = staticRegistry([
|
|
565
|
+
"color",
|
|
566
|
+
"description"
|
|
567
|
+
]);
|
|
568
|
+
var FAMILY_PERSON_REGISTRY = staticRegistry([
|
|
569
|
+
"sex",
|
|
570
|
+
"b",
|
|
571
|
+
"d",
|
|
572
|
+
"bp",
|
|
573
|
+
"dp",
|
|
574
|
+
"occupation",
|
|
575
|
+
"military",
|
|
576
|
+
"education",
|
|
577
|
+
"religion",
|
|
578
|
+
"burial"
|
|
579
|
+
]);
|
|
580
|
+
var FAMILY_UNION_REGISTRY = staticRegistry(["m"]);
|
|
581
|
+
|
|
582
|
+
// src/utils/parsing.ts
|
|
583
|
+
var RECOGNIZED_COLOR_SET = new Set(
|
|
584
|
+
RECOGNIZED_COLOR_NAMES
|
|
585
|
+
);
|
|
586
|
+
var ALL_CHART_TYPES = /* @__PURE__ */ new Set([
|
|
587
|
+
// data charts
|
|
588
|
+
"bar",
|
|
589
|
+
"line",
|
|
590
|
+
"pie",
|
|
591
|
+
"polar-area",
|
|
592
|
+
"radar",
|
|
593
|
+
"scatter",
|
|
594
|
+
"sankey",
|
|
595
|
+
"function",
|
|
596
|
+
"heatmap",
|
|
597
|
+
"funnel",
|
|
598
|
+
// visualizations
|
|
599
|
+
"slope",
|
|
600
|
+
"wordcloud",
|
|
601
|
+
"arc",
|
|
602
|
+
"timeline",
|
|
603
|
+
"event-line",
|
|
604
|
+
"venn",
|
|
605
|
+
"quadrant",
|
|
606
|
+
// diagrams
|
|
607
|
+
"body",
|
|
608
|
+
"sequence",
|
|
609
|
+
"flowchart",
|
|
610
|
+
"class",
|
|
611
|
+
"er",
|
|
612
|
+
"org",
|
|
613
|
+
"kanban",
|
|
614
|
+
"c4",
|
|
615
|
+
"state",
|
|
616
|
+
"sitemap",
|
|
617
|
+
"infra",
|
|
618
|
+
"gantt",
|
|
619
|
+
"pert",
|
|
620
|
+
"boxes-and-lines",
|
|
621
|
+
"swimlane",
|
|
622
|
+
"version-control",
|
|
623
|
+
"mindmap",
|
|
624
|
+
"wireframe",
|
|
625
|
+
"tech-radar",
|
|
626
|
+
"cycle",
|
|
627
|
+
"journey-map",
|
|
628
|
+
"pyramid",
|
|
629
|
+
"ring",
|
|
630
|
+
"treemap",
|
|
631
|
+
"block",
|
|
632
|
+
"goal",
|
|
633
|
+
"countdown",
|
|
634
|
+
"clock",
|
|
635
|
+
"sketch",
|
|
636
|
+
"raci",
|
|
637
|
+
"map",
|
|
638
|
+
"family",
|
|
639
|
+
"bracket"
|
|
640
|
+
]);
|
|
641
|
+
function measureIndent(line) {
|
|
642
|
+
let indent = 0;
|
|
643
|
+
for (const ch of line) {
|
|
644
|
+
if (ch === " ") indent++;
|
|
645
|
+
else if (ch === " ") indent += 4;
|
|
646
|
+
else break;
|
|
647
|
+
}
|
|
648
|
+
return indent;
|
|
649
|
+
}
|
|
650
|
+
function extractColor(label, palette, diagnostics, line) {
|
|
651
|
+
const lastSpaceIdx = Math.max(
|
|
652
|
+
label.lastIndexOf(" "),
|
|
653
|
+
label.lastIndexOf(" ")
|
|
654
|
+
);
|
|
655
|
+
if (lastSpaceIdx < 0) return { label };
|
|
656
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
657
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) {
|
|
658
|
+
if (diagnostics && line !== void 0) {
|
|
659
|
+
const diag = invalidColorDiagnostic(trailing, line);
|
|
660
|
+
if (diag) diagnostics.push(diag);
|
|
661
|
+
}
|
|
662
|
+
return { label };
|
|
663
|
+
}
|
|
664
|
+
let color;
|
|
665
|
+
if (diagnostics && line !== void 0) {
|
|
666
|
+
color = resolveColorWithDiagnostic(trailing, line, diagnostics, palette);
|
|
667
|
+
} else {
|
|
668
|
+
color = resolveColor(trailing, palette) ?? void 0;
|
|
669
|
+
}
|
|
670
|
+
return {
|
|
671
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
672
|
+
...color !== void 0 && { color }
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
var OPTION_NOCOLON_RE = /^([a-z][a-z0-9-]*)\s+(.+)$/i;
|
|
676
|
+
var GLOBAL_BOOLEANS = /* @__PURE__ */ new Set([
|
|
677
|
+
"fill-tint",
|
|
678
|
+
"fill-solid",
|
|
679
|
+
"fill-outline",
|
|
680
|
+
"no-title",
|
|
681
|
+
"no-notes",
|
|
682
|
+
"no-legend",
|
|
683
|
+
"legend-inline"
|
|
684
|
+
]);
|
|
685
|
+
function legendSuppressed(options) {
|
|
686
|
+
return options["no-legend"] === "on";
|
|
687
|
+
}
|
|
688
|
+
function legendInlineRequested(options) {
|
|
689
|
+
return options["legend-inline"] === "on";
|
|
690
|
+
}
|
|
691
|
+
var FILL_FAMILY_TOKENS = /* @__PURE__ */ new Set([
|
|
692
|
+
"fill-tint",
|
|
693
|
+
"fill-solid",
|
|
694
|
+
"fill-outline"
|
|
695
|
+
]);
|
|
696
|
+
function fillModeFromToken(token) {
|
|
697
|
+
switch (token.trim().toLowerCase()) {
|
|
698
|
+
case "fill-solid":
|
|
699
|
+
return "solid";
|
|
700
|
+
case "fill-outline":
|
|
701
|
+
return "outline";
|
|
702
|
+
case "fill-tint":
|
|
703
|
+
return "tint";
|
|
704
|
+
default:
|
|
705
|
+
return null;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
function fillModeFromOptions(options) {
|
|
709
|
+
if (options["fill-solid"] === "on") return "solid";
|
|
710
|
+
if (options["fill-outline"] === "on") return "outline";
|
|
711
|
+
return void 0;
|
|
712
|
+
}
|
|
713
|
+
function recognizeGlobalBoolean(token) {
|
|
714
|
+
const t = token.trim().toLowerCase();
|
|
715
|
+
return GLOBAL_BOOLEANS.has(t) ? t : null;
|
|
716
|
+
}
|
|
717
|
+
function tryParseSharedOption(line, options) {
|
|
718
|
+
const key = recognizeGlobalBoolean(line);
|
|
719
|
+
if (key) {
|
|
720
|
+
if (FILL_FAMILY_TOKENS.has(key)) {
|
|
721
|
+
for (const t of FILL_FAMILY_TOKENS) delete options[t];
|
|
722
|
+
}
|
|
723
|
+
options[key] = "on";
|
|
724
|
+
return true;
|
|
725
|
+
}
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
function parseFirstLine(line) {
|
|
729
|
+
const trimmed = line.trim();
|
|
730
|
+
if (!trimmed || trimmed.startsWith("//")) return null;
|
|
731
|
+
const spaceIdx = trimmed.indexOf(" ");
|
|
732
|
+
if (spaceIdx === -1) {
|
|
733
|
+
const ct = trimmed.toLowerCase();
|
|
734
|
+
return ALL_CHART_TYPES.has(ct) ? { chartType: ct, title: void 0 } : null;
|
|
735
|
+
}
|
|
736
|
+
const firstToken = trimmed.substring(0, spaceIdx).toLowerCase();
|
|
737
|
+
if (!ALL_CHART_TYPES.has(firstToken)) return null;
|
|
738
|
+
return {
|
|
739
|
+
chartType: firstToken,
|
|
740
|
+
title: trimmed.substring(spaceIdx + 1).trim() || void 0
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
var CHART_TYPE_TOKEN_RE = /^[A-Za-z][A-Za-z0-9-]*$/;
|
|
744
|
+
var TITLE_LIKE_RE = /^[A-Za-z][A-Za-z\s'&,.\-—–]*$/;
|
|
745
|
+
function detectBadChartTypeDeclaration(line, knownOptionKeys) {
|
|
746
|
+
const trimmed = line.trim();
|
|
747
|
+
if (!trimmed || trimmed.includes(":")) return null;
|
|
748
|
+
const spaceIdx = trimmed.indexOf(" ");
|
|
749
|
+
const token = spaceIdx === -1 ? trimmed : trimmed.substring(0, spaceIdx);
|
|
750
|
+
if (!CHART_TYPE_TOKEN_RE.test(token)) return null;
|
|
751
|
+
const lower = token.toLowerCase();
|
|
752
|
+
if (knownOptionKeys.has(lower) || ALL_REGISTRY_TOKENS.has(lower)) return null;
|
|
753
|
+
if (spaceIdx === -1) return /\d/.test(token) ? null : token;
|
|
754
|
+
const rest = trimmed.substring(spaceIdx + 1).trim();
|
|
755
|
+
if (!rest || !TITLE_LIKE_RE.test(rest)) return null;
|
|
756
|
+
return token;
|
|
757
|
+
}
|
|
758
|
+
function normalizeNumericToken(token) {
|
|
759
|
+
if (!token.includes(",") && !token.includes("_")) return null;
|
|
760
|
+
if (token.includes(",") && token.includes("_")) return null;
|
|
761
|
+
let sign = "";
|
|
762
|
+
let unsigned = token;
|
|
763
|
+
if (unsigned.startsWith("-")) {
|
|
764
|
+
sign = "-";
|
|
765
|
+
unsigned = unsigned.substring(1);
|
|
766
|
+
}
|
|
767
|
+
if (!unsigned) return null;
|
|
768
|
+
if (unsigned.includes(",")) {
|
|
769
|
+
if (/^\d{1,3}(,\d{3})+$/.test(unsigned))
|
|
770
|
+
return sign + unsigned.replace(/,/g, "");
|
|
771
|
+
if (/^\d{1,3}(,\d{3})+\.\d+$/.test(unsigned))
|
|
772
|
+
return sign + unsigned.replace(/,/g, "");
|
|
773
|
+
return null;
|
|
774
|
+
}
|
|
775
|
+
if (/^\d+(_\d+)+$/.test(unsigned)) return sign + unsigned.replace(/_/g, "");
|
|
776
|
+
if (/^\d+(_\d+)*\.\d+$/.test(unsigned) && unsigned.includes("_"))
|
|
777
|
+
return sign + unsigned.replace(/_/g, "");
|
|
778
|
+
return null;
|
|
779
|
+
}
|
|
780
|
+
function stripQuotes(token) {
|
|
781
|
+
if (token.length >= 2) {
|
|
782
|
+
if (token[0] === '"' && token[token.length - 1] === '"' || token[0] === "'" && token[token.length - 1] === "'") {
|
|
783
|
+
return token.substring(1, token.length - 1);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
return token;
|
|
787
|
+
}
|
|
788
|
+
function tokenizeQuoteAware(input) {
|
|
789
|
+
const tokens = [];
|
|
790
|
+
let i = 0;
|
|
791
|
+
while (i < input.length) {
|
|
792
|
+
if (input[i] === " " || input[i] === " ") {
|
|
793
|
+
i++;
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
if (input[i] === '"' || input[i] === "'") {
|
|
797
|
+
const quote = input[i];
|
|
798
|
+
const start2 = i;
|
|
799
|
+
i++;
|
|
800
|
+
while (i < input.length && input[i] !== quote) i++;
|
|
801
|
+
if (i < input.length) i++;
|
|
802
|
+
tokens.push(input.substring(start2, i));
|
|
803
|
+
continue;
|
|
804
|
+
}
|
|
805
|
+
const start = i;
|
|
806
|
+
while (i < input.length && input[i] !== " " && input[i] !== " ") i++;
|
|
807
|
+
tokens.push(input.substring(start, i));
|
|
808
|
+
}
|
|
809
|
+
return tokens;
|
|
810
|
+
}
|
|
811
|
+
function collectIndentedValues(lines, startIndex) {
|
|
812
|
+
const values = [];
|
|
813
|
+
const lineNumbers = [];
|
|
814
|
+
let j = startIndex + 1;
|
|
815
|
+
for (; j < lines.length; j++) {
|
|
816
|
+
const raw = lines[j];
|
|
817
|
+
const trimmed = raw.trim();
|
|
818
|
+
if (!trimmed) continue;
|
|
819
|
+
if (trimmed.startsWith("//")) continue;
|
|
820
|
+
if (raw[0] !== " " && raw[0] !== " ") break;
|
|
821
|
+
values.push(trimmed.replace(/,\s*$/, ""));
|
|
822
|
+
lineNumbers.push(j + 1);
|
|
823
|
+
}
|
|
824
|
+
return { values, lineNumbers, newIndex: j - 1 };
|
|
825
|
+
}
|
|
826
|
+
function parseSeriesNames(value, lines, lineIndex, palette, diagnostics) {
|
|
827
|
+
let rawNames;
|
|
828
|
+
let series;
|
|
829
|
+
let newIndex = lineIndex;
|
|
830
|
+
let nameLineNumbers = [];
|
|
831
|
+
if (value) {
|
|
832
|
+
series = value;
|
|
833
|
+
rawNames = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
834
|
+
nameLineNumbers = rawNames.map(() => lineIndex + 1);
|
|
835
|
+
} else {
|
|
836
|
+
const collected = collectIndentedValues(lines, lineIndex);
|
|
837
|
+
newIndex = collected.newIndex;
|
|
838
|
+
rawNames = collected.values;
|
|
839
|
+
nameLineNumbers = collected.lineNumbers;
|
|
840
|
+
series = rawNames.join(", ");
|
|
841
|
+
}
|
|
842
|
+
const isHeader = (s) => {
|
|
843
|
+
const tok = s.split(/\s+/, 1)[0];
|
|
844
|
+
if (tok === "y-label") return "left";
|
|
845
|
+
if (tok === "y-right-label") return "right";
|
|
846
|
+
return null;
|
|
847
|
+
};
|
|
848
|
+
if (rawNames.some((r) => isHeader(r) !== null)) {
|
|
849
|
+
const names2 = [];
|
|
850
|
+
const nameColors2 = [];
|
|
851
|
+
const axes = [];
|
|
852
|
+
const memberLineNumbers = [];
|
|
853
|
+
let leftLabel;
|
|
854
|
+
let rightLabel;
|
|
855
|
+
let currentAxis = "left";
|
|
856
|
+
for (let i = 0; i < rawNames.length; i++) {
|
|
857
|
+
const raw = rawNames[i];
|
|
858
|
+
const side = isHeader(raw);
|
|
859
|
+
if (side !== null) {
|
|
860
|
+
const label = raw.slice(raw.indexOf(" ") + 1).trim();
|
|
861
|
+
currentAxis = side;
|
|
862
|
+
if (side === "left") leftLabel = label || leftLabel;
|
|
863
|
+
else rightLabel = label || rightLabel;
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
const extracted = extractColor(
|
|
867
|
+
raw,
|
|
868
|
+
palette,
|
|
869
|
+
diagnostics,
|
|
870
|
+
nameLineNumbers[i]
|
|
871
|
+
);
|
|
872
|
+
names2.push(extracted.label);
|
|
873
|
+
nameColors2.push(extracted.color);
|
|
874
|
+
axes.push(currentAxis);
|
|
875
|
+
memberLineNumbers.push(nameLineNumbers[i]);
|
|
876
|
+
}
|
|
877
|
+
return {
|
|
878
|
+
series: names2.join(", "),
|
|
879
|
+
names: names2,
|
|
880
|
+
nameColors: nameColors2,
|
|
881
|
+
nameLineNumbers: memberLineNumbers,
|
|
882
|
+
newIndex,
|
|
883
|
+
axes,
|
|
884
|
+
...leftLabel !== void 0 && { leftLabel },
|
|
885
|
+
...rightLabel !== void 0 && { rightLabel }
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
const names = [];
|
|
889
|
+
const nameColors = [];
|
|
890
|
+
for (let i = 0; i < rawNames.length; i++) {
|
|
891
|
+
const raw = rawNames[i];
|
|
892
|
+
const extracted = extractColor(
|
|
893
|
+
raw,
|
|
894
|
+
palette,
|
|
895
|
+
diagnostics,
|
|
896
|
+
nameLineNumbers[i]
|
|
897
|
+
);
|
|
898
|
+
nameColors.push(extracted.color);
|
|
899
|
+
names.push(extracted.label);
|
|
900
|
+
}
|
|
901
|
+
if (names.length === 1) {
|
|
902
|
+
series = names[0];
|
|
903
|
+
}
|
|
904
|
+
return { series, names, nameColors, nameLineNumbers, newIndex };
|
|
905
|
+
}
|
|
906
|
+
function peelTrailingColorName(label) {
|
|
907
|
+
const lastSpaceIdx = Math.max(
|
|
908
|
+
label.lastIndexOf(" "),
|
|
909
|
+
label.lastIndexOf(" ")
|
|
910
|
+
);
|
|
911
|
+
if (lastSpaceIdx < 0) return { label };
|
|
912
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
913
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { label };
|
|
914
|
+
return {
|
|
915
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
916
|
+
colorName: trailing
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
function peelTrailingCollapsedFlag(text) {
|
|
920
|
+
const t = text.trimEnd();
|
|
921
|
+
if (t === "collapsed") return { rest: "", collapsed: true };
|
|
922
|
+
if (/[ \t]collapsed$/.test(t)) {
|
|
923
|
+
return {
|
|
924
|
+
rest: t.slice(0, t.length - "collapsed".length).trimEnd().replace(/,\s*$/, ""),
|
|
925
|
+
collapsed: true
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
return { rest: text, collapsed: false };
|
|
929
|
+
}
|
|
930
|
+
function peelRampColors(label) {
|
|
931
|
+
const peelOne = (s) => {
|
|
932
|
+
const idx = Math.max(s.lastIndexOf(" "), s.lastIndexOf(" "));
|
|
933
|
+
if (idx < 0) return { rest: s };
|
|
934
|
+
const trailing = s.substring(idx + 1);
|
|
935
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { rest: s };
|
|
936
|
+
return { rest: s.substring(0, idx).trimEnd(), color: trailing };
|
|
937
|
+
};
|
|
938
|
+
const first = peelOne(label);
|
|
939
|
+
if (first.color === void 0) return { label };
|
|
940
|
+
const second = peelOne(first.rest);
|
|
941
|
+
if (second.color === void 0) {
|
|
942
|
+
return { label: first.rest, high: first.color };
|
|
943
|
+
}
|
|
944
|
+
return { label: second.rest, low: second.color, high: first.color };
|
|
945
|
+
}
|
|
946
|
+
var RESERVED_KEY_RE = /^[A-Za-z][A-Za-z0-9_-]*$/;
|
|
947
|
+
var AS_ALIAS_RE = /\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11})$/;
|
|
948
|
+
function scanTokens(line) {
|
|
949
|
+
const tokens = [];
|
|
950
|
+
let i = 0;
|
|
951
|
+
while (i < line.length) {
|
|
952
|
+
if (line[i] === " " || line[i] === " ") {
|
|
953
|
+
i++;
|
|
954
|
+
continue;
|
|
955
|
+
}
|
|
956
|
+
if (line[i] === '"' || line[i] === "'") {
|
|
957
|
+
const quote = line[i];
|
|
958
|
+
const start2 = i;
|
|
959
|
+
i++;
|
|
960
|
+
while (i < line.length && line[i] !== quote) i++;
|
|
961
|
+
if (i < line.length) i++;
|
|
962
|
+
tokens.push({
|
|
963
|
+
text: line.substring(start2, i),
|
|
964
|
+
start: start2,
|
|
965
|
+
end: i,
|
|
966
|
+
quoted: true
|
|
967
|
+
});
|
|
968
|
+
continue;
|
|
969
|
+
}
|
|
970
|
+
const start = i;
|
|
971
|
+
while (i < line.length && line[i] !== " " && line[i] !== " ") i++;
|
|
972
|
+
tokens.push({
|
|
973
|
+
text: line.substring(start, i),
|
|
974
|
+
start,
|
|
975
|
+
end: i,
|
|
976
|
+
quoted: false
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
return tokens;
|
|
980
|
+
}
|
|
981
|
+
function findMetadataCutOffset(line, tokens, registry) {
|
|
982
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
983
|
+
const tok = tokens[i];
|
|
984
|
+
if (tok.quoted) continue;
|
|
985
|
+
const inlineColon = tok.text.indexOf(":");
|
|
986
|
+
if (inlineColon > 0) {
|
|
987
|
+
const keyPart = tok.text.substring(0, inlineColon);
|
|
988
|
+
if (RESERVED_KEY_RE.test(keyPart) && isReservedKey(registry, keyPart.toLowerCase())) {
|
|
989
|
+
return tok.start;
|
|
990
|
+
}
|
|
991
|
+
} else if (inlineColon < 0) {
|
|
992
|
+
if (RESERVED_KEY_RE.test(tok.text) && isReservedKey(registry, tok.text.toLowerCase())) {
|
|
993
|
+
const tail = line.substring(tok.end).replace(/^[ \t]+/, "");
|
|
994
|
+
if (tail.startsWith(":")) {
|
|
995
|
+
return tok.start;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
return -1;
|
|
1001
|
+
}
|
|
1002
|
+
function parseMetadataRegion(region, aliasMap, diagnostics, line) {
|
|
1003
|
+
const meta = {};
|
|
1004
|
+
let i = 0;
|
|
1005
|
+
while (i < region.length) {
|
|
1006
|
+
while (i < region.length && (region[i] === " " || region[i] === " " || region[i] === ","))
|
|
1007
|
+
i++;
|
|
1008
|
+
if (i >= region.length) break;
|
|
1009
|
+
const keyStart = i;
|
|
1010
|
+
while (i < region.length && region[i] !== ":" && region[i] !== ",") i++;
|
|
1011
|
+
if (i >= region.length || region[i] !== ":") break;
|
|
1012
|
+
const rawKey = region.substring(keyStart, i).trim().toLowerCase();
|
|
1013
|
+
if (!rawKey) break;
|
|
1014
|
+
i++;
|
|
1015
|
+
while (i < region.length && (region[i] === " " || region[i] === " ")) i++;
|
|
1016
|
+
let value;
|
|
1017
|
+
if (i < region.length && (region[i] === '"' || region[i] === "'")) {
|
|
1018
|
+
const quote = region[i];
|
|
1019
|
+
i++;
|
|
1020
|
+
const vStart = i;
|
|
1021
|
+
while (i < region.length && region[i] !== quote) i++;
|
|
1022
|
+
value = region.substring(vStart, i);
|
|
1023
|
+
if (i < region.length) i++;
|
|
1024
|
+
while (i < region.length && (region[i] === " " || region[i] === " "))
|
|
1025
|
+
i++;
|
|
1026
|
+
} else {
|
|
1027
|
+
const vStart = i;
|
|
1028
|
+
while (i < region.length && region[i] !== ",") i++;
|
|
1029
|
+
value = region.substring(vStart, i).trim();
|
|
1030
|
+
}
|
|
1031
|
+
const key = aliasMap.get(rawKey) ?? rawKey;
|
|
1032
|
+
if (!value) {
|
|
1033
|
+
if (diagnostics && line !== void 0) {
|
|
1034
|
+
diagnostics.push(
|
|
1035
|
+
makeDgmoError(
|
|
1036
|
+
line,
|
|
1037
|
+
emptyMetadataValueMessage(rawKey),
|
|
1038
|
+
"warning",
|
|
1039
|
+
METADATA_DIAGNOSTIC_CODES.EMPTY_METADATA_VALUE
|
|
1040
|
+
)
|
|
1041
|
+
);
|
|
1042
|
+
}
|
|
1043
|
+
continue;
|
|
1044
|
+
}
|
|
1045
|
+
meta[key] = value;
|
|
1046
|
+
}
|
|
1047
|
+
return meta;
|
|
1048
|
+
}
|
|
1049
|
+
function cutUnionMetadata(line, registry) {
|
|
1050
|
+
return findMetadataCutOffset(line, scanTokens(line), registry);
|
|
1051
|
+
}
|
|
1052
|
+
function splitNameAndMeta(line, registry, aliasMap = /* @__PURE__ */ new Map(), palette, diagnostics, lineNumber, options = {}) {
|
|
1053
|
+
const tokens = scanTokens(line);
|
|
1054
|
+
const cutOffset = findMetadataCutOffset(line, tokens, registry);
|
|
1055
|
+
let nameRegion;
|
|
1056
|
+
let metaRegion;
|
|
1057
|
+
if (cutOffset === -1) {
|
|
1058
|
+
nameRegion = line.trim();
|
|
1059
|
+
metaRegion = "";
|
|
1060
|
+
} else {
|
|
1061
|
+
nameRegion = line.substring(0, cutOffset).trimEnd();
|
|
1062
|
+
metaRegion = line.substring(cutOffset);
|
|
1063
|
+
}
|
|
1064
|
+
const colorResult = peelTrailingColorName(nameRegion);
|
|
1065
|
+
let postColorName = colorResult.label;
|
|
1066
|
+
let alias;
|
|
1067
|
+
if (options.peelAlias !== false) {
|
|
1068
|
+
const aliasMatch = postColorName.match(AS_ALIAS_RE);
|
|
1069
|
+
if (aliasMatch) {
|
|
1070
|
+
alias = aliasMatch[1];
|
|
1071
|
+
postColorName = postColorName.substring(0, aliasMatch.index).trimEnd();
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
const meta = metaRegion.length > 0 ? parseMetadataRegion(metaRegion, aliasMap, diagnostics, lineNumber) : {};
|
|
1075
|
+
void palette;
|
|
1076
|
+
return {
|
|
1077
|
+
name: postColorName,
|
|
1078
|
+
meta,
|
|
1079
|
+
...colorResult.colorName !== void 0 && {
|
|
1080
|
+
color: colorResult.colorName
|
|
1081
|
+
},
|
|
1082
|
+
...alias !== void 0 && { alias }
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
var POTENTIAL_META_RE = /\b([\w-]+)\s*:/;
|
|
1086
|
+
function warnUnknownMetaKeys(meta, registry, warn, nameToScan) {
|
|
1087
|
+
const candidates = Array.from(registry.keys);
|
|
1088
|
+
for (const key of Object.keys(meta)) {
|
|
1089
|
+
if (isReservedKey(registry, key)) continue;
|
|
1090
|
+
const hint = suggest(key, candidates);
|
|
1091
|
+
warn(`Unknown metadata key "${key}".${hint ? " " + hint : ""}`);
|
|
1092
|
+
}
|
|
1093
|
+
if (nameToScan) {
|
|
1094
|
+
const m = nameToScan.match(POTENTIAL_META_RE);
|
|
1095
|
+
if (m) {
|
|
1096
|
+
const key = m[1].toLowerCase();
|
|
1097
|
+
if (!isReservedKey(registry, key)) {
|
|
1098
|
+
const hint = suggest(key, candidates);
|
|
1099
|
+
if (hint) {
|
|
1100
|
+
warn(`Unknown metadata key "${key}". ${hint}`);
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
|
|
379
1107
|
export {
|
|
380
1108
|
INFRA_TOP_LEVEL_OPTION_SET,
|
|
381
1109
|
INFRA_BEHAVIOR_KEY_SET,
|
|
@@ -387,6 +1115,58 @@ export {
|
|
|
387
1115
|
REGISTRY_CONTROL_TOKENS,
|
|
388
1116
|
REGISTRY_STATUS_TOKENS,
|
|
389
1117
|
REGISTRY_MODIFIER_TOKENS,
|
|
390
|
-
REGISTRY_COLON_KEY_TOKENS
|
|
1118
|
+
REGISTRY_COLON_KEY_TOKENS,
|
|
1119
|
+
withTagAliases,
|
|
1120
|
+
isReservedKey,
|
|
1121
|
+
SEQUENCE_REGISTRY,
|
|
1122
|
+
INFRA_REGISTRY,
|
|
1123
|
+
MAP_REGISTRY,
|
|
1124
|
+
ORG_REGISTRY,
|
|
1125
|
+
C4_REGISTRY,
|
|
1126
|
+
ER_REGISTRY,
|
|
1127
|
+
EVENT_LINE_REGISTRY,
|
|
1128
|
+
KANBAN_REGISTRY,
|
|
1129
|
+
SITEMAP_REGISTRY,
|
|
1130
|
+
GANTT_REGISTRY,
|
|
1131
|
+
PERT_REGISTRY,
|
|
1132
|
+
BOXES_AND_LINES_REGISTRY,
|
|
1133
|
+
STATE_REGISTRY,
|
|
1134
|
+
SKETCH_REGISTRY,
|
|
1135
|
+
TIMELINE_REGISTRY,
|
|
1136
|
+
MINDMAP_REGISTRY,
|
|
1137
|
+
TECH_RADAR_REGISTRY,
|
|
1138
|
+
CYCLE_REGISTRY,
|
|
1139
|
+
JOURNEY_MAP_REGISTRY,
|
|
1140
|
+
PYRAMID_REGISTRY,
|
|
1141
|
+
RING_REGISTRY,
|
|
1142
|
+
TREEMAP_REGISTRY,
|
|
1143
|
+
RACI_REGISTRY,
|
|
1144
|
+
FAMILY_PERSON_REGISTRY,
|
|
1145
|
+
FAMILY_UNION_REGISTRY,
|
|
1146
|
+
ALL_CHART_TYPES,
|
|
1147
|
+
measureIndent,
|
|
1148
|
+
extractColor,
|
|
1149
|
+
OPTION_NOCOLON_RE,
|
|
1150
|
+
GLOBAL_BOOLEANS,
|
|
1151
|
+
legendSuppressed,
|
|
1152
|
+
legendInlineRequested,
|
|
1153
|
+
FILL_FAMILY_TOKENS,
|
|
1154
|
+
fillModeFromToken,
|
|
1155
|
+
fillModeFromOptions,
|
|
1156
|
+
tryParseSharedOption,
|
|
1157
|
+
parseFirstLine,
|
|
1158
|
+
detectBadChartTypeDeclaration,
|
|
1159
|
+
normalizeNumericToken,
|
|
1160
|
+
stripQuotes,
|
|
1161
|
+
tokenizeQuoteAware,
|
|
1162
|
+
collectIndentedValues,
|
|
1163
|
+
parseSeriesNames,
|
|
1164
|
+
peelTrailingColorName,
|
|
1165
|
+
peelTrailingCollapsedFlag,
|
|
1166
|
+
peelRampColors,
|
|
1167
|
+
parseMetadataRegion,
|
|
1168
|
+
cutUnionMetadata,
|
|
1169
|
+
splitNameAndMeta,
|
|
1170
|
+
warnUnknownMetaKeys
|
|
391
1171
|
};
|
|
392
|
-
//# sourceMappingURL=chunk-
|
|
1172
|
+
//# sourceMappingURL=chunk-A2ARDILY.js.map
|