@diagrammo/dgmo 0.89.0 → 0.90.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/README.md +1 -1
- package/dist/advanced.d.ts +435 -15
- package/dist/advanced.js +356 -197
- package/dist/block.d.ts +1 -1
- package/dist/block.js +86 -63
- package/dist/{calculator-35YVW4QO.js → calculator-PX3JHKAS.js} +2 -2
- package/dist/{chart-meta-Bev5Ebjr.d.ts → chart-meta-B_WTMP0y.d.ts} +1 -1
- package/dist/chart-meta.d.ts +2 -2
- package/dist/chart-meta.js +17 -16
- package/dist/{chart-types-Bf8C5QQW.d.ts → chart-types-V2NcgN5O.d.ts} +4 -0
- package/dist/{charts-d3-KEQSUWKP.js → charts-d3-QW4ERNUE.js} +8 -7
- package/dist/{chunk-ECMA6XE2.js → chunk-2EDJPHXQ.js} +9 -9
- package/dist/{chunk-7WGCQE2E.js → chunk-2ZVLI6GQ.js} +1 -1
- package/dist/{chunk-UWKRPQZO.js → chunk-3BQCSQQJ.js} +16 -13
- package/dist/{chunk-7C2RAGPT.js → chunk-3HBR3YAN.js} +12 -12
- package/dist/chunk-3UR4F7FE.js +14 -0
- package/dist/{chunk-NIUO2TNR.js → chunk-4HG4PYHM.js} +197 -203
- package/dist/{chunk-NSR2CGV6.js → chunk-4IYJOXGS.js} +10 -10
- package/dist/{chunk-BOO24UMJ.js → chunk-4YO7VJTP.js} +1 -1
- package/dist/{chunk-YMFQLWZ2.js → chunk-54YUDXGP.js} +1 -1
- package/dist/{chunk-UG2XG57E.js → chunk-5M52RPAS.js} +2 -2
- package/dist/{chunk-QIOYTQDZ.js → chunk-5M6PMV5Z.js} +9 -9
- package/dist/{chunk-S2WE7TVK.js → chunk-5MDQMB6A.js} +1 -1
- package/dist/{chunk-WPL5PFXE.js → chunk-5TZPIKNV.js} +5 -5
- package/dist/{chunk-LFKSHDVI.js → chunk-62VWZ3SE.js} +5 -4
- package/dist/{chunk-PMNITNPR.js → chunk-64KSPLU2.js} +2 -1
- package/dist/{chunk-VEPIAUSK.js → chunk-6BQSDF77.js} +1 -5
- package/dist/{chunk-HUNDJTTH.js → chunk-A5EE66RQ.js} +1 -1
- package/dist/{chunk-JVZ7KFAX.js → chunk-AAC3XQWV.js} +2 -2
- package/dist/{chunk-7KPHRTND.js → chunk-AHWA36O7.js} +1 -1
- package/dist/{chunk-FKZ2Y3Q5.js → chunk-C4W62JZO.js} +2 -2
- package/dist/{chunk-C4FRGZGX.js → chunk-CDT33RHG.js} +1 -1
- package/dist/{chunk-B3S76BZO.js → chunk-COPSI54O.js} +3 -3
- package/dist/{chunk-GUTZCRBT.js → chunk-CUY56BK4.js} +2 -2
- package/dist/{chunk-HSRQDWV7.js → chunk-CYF2X3CG.js} +2 -11
- package/dist/{chunk-NGC3IZRY.js → chunk-DNMICILX.js} +2 -2
- package/dist/{chunk-N4BBSDWI.js → chunk-DXPT2HPH.js} +140 -151
- package/dist/{chunk-TAP2NZEU.js → chunk-EB7AEM2H.js} +13 -13
- package/dist/{chunk-3AQJNY65.js → chunk-EEYQFJVK.js} +149 -43
- package/dist/{chunk-SLQT3JP3.js → chunk-EK7JYFCL.js} +1 -1
- package/dist/{chunk-3C2FWS2J.js → chunk-EWERNTOX.js} +1 -1
- package/dist/{chunk-4AJKOUBO.js → chunk-FDRHBQUG.js} +17 -15
- package/dist/{chunk-FJNXXGTR.js → chunk-FS2LZBHG.js} +2 -2
- package/dist/{chunk-LPYYZCSI.js → chunk-G5BGW4BX.js} +1 -1
- package/dist/{chunk-IQ6P3HDE.js → chunk-GQVXYRPC.js} +2 -2
- package/dist/{chunk-MHAYUS65.js → chunk-GXP344YZ.js} +3 -3
- package/dist/{chunk-HAMF4F3P.js → chunk-GYBKG4Z6.js} +5 -5
- package/dist/{chunk-Q6SQISHT.js → chunk-HIVJBESO.js} +306 -68
- package/dist/{chunk-ID2K3IHI.js → chunk-HLE5QGZJ.js} +1 -1
- package/dist/{chunk-L5AFONQU.js → chunk-HX2KJEPD.js} +1 -1
- package/dist/{chunk-SOPM5PLO.js → chunk-I6FWHICD.js} +13 -13
- package/dist/{chunk-3RYBTEF5.js → chunk-I74AQRVD.js} +6 -12
- package/dist/{chunk-NRPELUB6.js → chunk-ICYPGWOV.js} +2 -2
- package/dist/chunk-IHK3Y2HG.js +781 -0
- package/dist/{chunk-RXIKESRI.js → chunk-IMHNZITR.js} +2 -2
- package/dist/{chunk-DPSMX4EY.js → chunk-IRVQT4GR.js} +3 -3
- package/dist/{chunk-AZ24RI5L.js → chunk-J3ODKAWN.js} +2 -2
- package/dist/{chunk-BB6QKWHZ.js → chunk-JRQ4LBQI.js} +10 -10
- package/dist/{chunk-MY6GUH26.js → chunk-JX4RCC6B.js} +2 -2
- package/dist/{chunk-XUCQVKLQ.js → chunk-K4GUO7FV.js} +4 -4
- package/dist/{chunk-J64NZ6NF.js → chunk-KSZHIAI2.js} +1 -1
- package/dist/{chunk-CUYHST3B.js → chunk-LBRHDWEA.js} +1 -1
- package/dist/{chunk-GSYZZFI5.js → chunk-LC5LY5V2.js} +2 -2
- package/dist/{chunk-WP22MHH6.js → chunk-LNQDICFJ.js} +9 -9
- package/dist/{chunk-PIXJL77H.js → chunk-M6J25PAZ.js} +1 -1
- package/dist/{chunk-UQLHKLF4.js → chunk-MIVSVEK4.js} +8 -8
- package/dist/{chunk-6K7RODXG.js → chunk-MKFQ5E7J.js} +1 -1
- package/dist/{chunk-44GP7PD5.js → chunk-MPJQMMBZ.js} +12 -0
- package/dist/{chunk-WQ6G6FFM.js → chunk-NFWRIC2V.js} +1 -1
- package/dist/{chunk-7SX4IY6T.js → chunk-NJYA4QSN.js} +1 -1
- package/dist/{chunk-RU725VCJ.js → chunk-NMKLX57Y.js} +10 -35
- package/dist/{chunk-RPKBWJBB.js → chunk-NP2SE6MQ.js} +1 -1
- package/dist/{chunk-ITSBBQTH.js → chunk-NUYWNKHH.js} +2 -2
- package/dist/{chunk-DV2VEJCC.js → chunk-NWSPPGIE.js} +6 -6
- package/dist/{chunk-AYOVY75O.js → chunk-NY56FM55.js} +3 -3
- package/dist/{chunk-MFW6P7WH.js → chunk-OSIUWQ3N.js} +3 -3
- package/dist/{chunk-2GM7N5TV.js → chunk-OWJVSJLA.js} +9 -9
- package/dist/{chunk-GDJW64XE.js → chunk-OYKNMFUY.js} +1 -1
- package/dist/{chunk-4R6OMKXB.js → chunk-PIHAUVA4.js} +5 -5
- package/dist/{chunk-C7QRRTAW.js → chunk-PNCKZFPE.js} +2 -2
- package/dist/{chunk-DDPGEGHB.js → chunk-POBNN5DP.js} +2 -2
- package/dist/{chunk-XJ2TBXHA.js → chunk-PQ5NW3QZ.js} +8 -8
- package/dist/{chunk-FKLE6QA3.js → chunk-PXEUQ7EG.js} +12 -12
- package/dist/{chunk-WEF6MXFG.js → chunk-QOZ4RVQY.js} +8 -8
- package/dist/{chunk-LR6RRDWN.js → chunk-QRIW46LR.js} +5 -5
- package/dist/{chunk-7W4XLIVH.js → chunk-R2PTZ6QM.js} +10 -10
- package/dist/{chunk-M2BCY7H3.js → chunk-RCBHL2B5.js} +189 -136
- package/dist/{chunk-66YFDTT6.js → chunk-RJYFHEP4.js} +3 -3
- package/dist/{chunk-P3SKSKJI.js → chunk-RNXX2GOQ.js} +2 -2
- package/dist/{chunk-RGWYZR3S.js → chunk-RRBV4HIM.js} +2 -2
- package/dist/{chunk-44FTCIRI.js → chunk-RY5RRKYN.js} +8 -8
- package/dist/{chunk-Y7PSAHAY.js → chunk-S4LLHDGK.js} +3 -3
- package/dist/chunk-S7C32S2T.js +825 -0
- package/dist/{chunk-JRUEIRJB.js → chunk-SLO22FPS.js} +2 -2
- package/dist/{chunk-47E5UTXE.js → chunk-SMEVBJJJ.js} +2 -2
- package/dist/{chunk-QFHWYWQL.js → chunk-SVQDLYX7.js} +1 -1
- package/dist/{chunk-WP2RLGDI.js → chunk-TCX5PMEY.js} +1 -1
- package/dist/{chunk-EXKCRXPO.js → chunk-TQ644YGV.js} +12 -12
- package/dist/{chunk-WRCAH3UO.js → chunk-U762HK4D.js} +15 -15
- package/dist/{chunk-LYLNMN77.js → chunk-VCHYS3RD.js} +8 -3
- package/dist/{chunk-7UDAIP6W.js → chunk-WHRIN7N3.js} +1 -1
- package/dist/{chunk-ZUCXFXLD.js → chunk-X3WYJ5T7.js} +2 -2
- package/dist/{chunk-UKJLPA7R.js → chunk-X6IZP2BD.js} +1 -1
- package/dist/{chunk-LCJURK7L.js → chunk-Y6GQQ4Y2.js} +1 -1
- package/dist/{chunk-HTWH2XQL.js → chunk-YE7D2S75.js} +2 -2
- package/dist/{chunk-DZPHN2WN.js → chunk-YKGUSW6D.js} +10 -10
- package/dist/{chunk-K5XT7NHD.js → chunk-YWRZG6GN.js} +10 -10
- package/dist/{chunk-JQ57AWDL.js → chunk-ZJ4PYTCK.js} +1 -1
- package/dist/completion-registry.d.ts +6 -0
- package/dist/completion-registry.js +62 -6
- package/dist/{d3-B6524aaP.d.ts → d3-2S3PrXik.d.ts} +11 -0
- package/dist/dgmo-router-BJBXSZMV.js +94 -0
- package/dist/{dimensions-7MF7VSGS.js → dimensions-AMA2S7RO.js} +5 -5
- package/dist/editor.js +12 -0
- package/dist/{flowchart-parser-GG7XBLQH.js → flowchart-parser-ADZIFVCH.js} +3 -3
- package/dist/{flowchart-renderer-DZQZRL2F.js → flowchart-renderer-CAG6ZNJ6.js} +5 -5
- package/dist/highlight.js +12 -0
- package/dist/index.d.ts +26 -5
- package/dist/index.js +83 -56
- package/dist/{layout-EFEZ533S.js → layout-6OSF2UGP.js} +3 -3
- package/dist/{layout-IGAVGDME.js → layout-C6MKMOBI.js} +1 -1
- package/dist/{layout-XUW444O5.js → layout-QS2SESBU.js} +2 -2
- package/dist/{layout-PP36LUTA.js → layout-T2PGKQUQ.js} +3 -3
- package/dist/{layout-Q3RYSODA.js → layout-UFB2O4AO.js} +3 -3
- package/dist/{layout-MSSHF45T.js → layout-UPQGIT3N.js} +2 -2
- package/dist/{layout-6L3BIFEZ.js → layout-VQ2USZJ3.js} +3 -3
- package/dist/{layout-DXVAYF6W.js → layout-VRJ5YFUE.js} +2 -2
- package/dist/{palettes-WZAIQTEG.js → palettes-WQHELGVQ.js} +2 -1
- package/dist/{parser-KYPP2DX6.js → parser-223VOHSB.js} +4 -4
- package/dist/{parser-JOOAVBJI.js → parser-2PNV7UI3.js} +3 -3
- package/dist/{parser-GZ3LVF72.js → parser-3MGA2MTM.js} +2 -2
- package/dist/{parser-NOANDFJ4.js → parser-4AR25MAS.js} +2 -2
- package/dist/{parser-337TACHB.js → parser-4B2PIXHI.js} +3 -3
- package/dist/{parser-KZMJNKDW.js → parser-57YQEEMC.js} +2 -2
- package/dist/{parser-J4DVNL4W.js → parser-5ZD2NKGU.js} +4 -4
- package/dist/{parser-LANGKWRG.js → parser-6LMB7BQQ.js} +2 -2
- package/dist/parser-AL6YL7KM.js +12 -0
- package/dist/{parser-5655XSOR.js → parser-B2FWP7ZO.js} +3 -3
- package/dist/{parser-GEKPWSSK.js → parser-BJDQX4KV.js} +3 -3
- package/dist/{parser-UTXFJG4X.js → parser-CA5WC5HF.js} +3 -3
- package/dist/{parser-KZMALSB2.js → parser-E5HFYL7B.js} +4 -4
- package/dist/{parser-GCCWMBTU.js → parser-ESZ5J5IJ.js} +5 -4
- package/dist/{parser-256EIWB2.js → parser-FDXUQ5TI.js} +2 -2
- package/dist/{parser-AN3MGHRL.js → parser-FV6RGALQ.js} +3 -3
- package/dist/{parser-DGF3ZEO6.js → parser-HPR7G7F6.js} +3 -3
- package/dist/{parser-OKB64MMN.js → parser-I4HZVIHX.js} +3 -3
- package/dist/{parser-P4TOQYNN.js → parser-J3BM2AP2.js} +3 -3
- package/dist/{parser-NPXPJHWN.js → parser-JFNDS5E5.js} +3 -3
- package/dist/{parser-TL3JA4RI.js → parser-KFIK3EOO.js} +3 -3
- package/dist/{parser-IMM2JJX3.js → parser-LGUT7KKH.js} +4 -4
- package/dist/{parser-KFYRTGTC.js → parser-MYRGCK7Q.js} +4 -4
- package/dist/{parser-ZLKYDFI5.js → parser-NAUUUCI3.js} +3 -3
- package/dist/{parser-DHSFIUPU.js → parser-NJ5VEZA3.js} +3 -3
- package/dist/{parser-OVQTTTUJ.js → parser-OFTMA36M.js} +2 -2
- package/dist/{parser-AKBVJHMK.js → parser-OV2WDSEV.js} +3 -3
- package/dist/{parser-LGS65QPN.js → parser-Q3UAOLEZ.js} +2 -2
- package/dist/{parser-XYY5NHP4.js → parser-R6OETHWM.js} +2 -2
- package/dist/{parser-7OEE7QT6.js → parser-RARXAHC7.js} +2 -2
- package/dist/{parser-NGHQQGD2.js → parser-T2RVIRDG.js} +3 -3
- package/dist/{parser-WEVTMBJ5.js → parser-W2DWCCLO.js} +3 -3
- package/dist/{parser-HCGXNHHL.js → parser-WFY4ZJUW.js} +3 -3
- package/dist/{parser-SA3RAJFS.js → parser-WSONWDFN.js} +2 -2
- package/dist/{renderer-CHQZES6G.js → renderer-3N64GVNM.js} +2 -2
- package/dist/{renderer-JR2XNZAH.js → renderer-3QM2DK7I.js} +5 -5
- package/dist/{renderer-XHEMXBQM.js → renderer-3W5T3IU6.js} +5 -5
- package/dist/{renderer-2ZQ6DPVD.js → renderer-4Z7FRQ2A.js} +2 -2
- package/dist/{renderer-EAORWLVK.js → renderer-52CHSV6S.js} +7 -7
- package/dist/{renderer-ZXQXRNDR.js → renderer-6OOJNEQE.js} +6 -6
- package/dist/{renderer-IR5GGAPB.js → renderer-A3PMPUO6.js} +11 -7
- package/dist/{renderer-3AD4NDF5.js → renderer-AM4VZSBQ.js} +6 -6
- package/dist/{renderer-P4XCRNCY.js → renderer-B3CPMS5R.js} +6 -6
- package/dist/{renderer-VGQMJC5K.js → renderer-B4KE3NM4.js} +11 -10
- package/dist/renderer-COSJM7UG.js +80 -0
- package/dist/{renderer-NAA7D33G.js → renderer-FXCVH2M5.js} +10 -9
- package/dist/{renderer-J4OS77PK.js → renderer-GWH5ACJ5.js} +3 -3
- package/dist/{renderer-7HOSI6JJ.js → renderer-IG72UJHW.js} +4 -4
- package/dist/{renderer-QQHQY3GT.js → renderer-IO3D5E4E.js} +5 -5
- package/dist/{renderer-6OQM32X3.js → renderer-IPDCAACY.js} +3 -3
- package/dist/{renderer-VYWCMRWA.js → renderer-KK5BU5K2.js} +5 -5
- package/dist/{renderer-7MCC6GKH.js → renderer-LD2H7WGP.js} +2 -2
- package/dist/{renderer-DCJ4AQ3N.js → renderer-MK47ESCB.js} +5 -5
- package/dist/{renderer-BLHN3RCY.js → renderer-MRMFYYZT.js} +2 -2
- package/dist/{renderer-XFEZ5UBE.js → renderer-O5RQHGK2.js} +6 -6
- package/dist/{renderer-43ESBXVY.js → renderer-OA5D3ZKB.js} +6 -6
- package/dist/{renderer-YTEZK3GC.js → renderer-ON4PTUHJ.js} +7 -7
- package/dist/{renderer-JRVY7HAD.js → renderer-OPDSKCQS.js} +4 -4
- package/dist/{renderer-FCXRDYSJ.js → renderer-PLRMST57.js} +7 -7
- package/dist/{renderer-WB75JME5.js → renderer-PSMRAL72.js} +6 -6
- package/dist/{renderer-7L7J4DHO.js → renderer-PXGCR7N4.js} +7 -6
- package/dist/{renderer-CEIX5JPA.js → renderer-R7OYCJEA.js} +2 -2
- package/dist/{renderer-DBNDLKPE.js → renderer-SBXCPA3S.js} +7 -7
- package/dist/{renderer-4JE5ORRO.js → renderer-TMQNTUQS.js} +7 -7
- package/dist/renderer-TTKTBB4C.js +46 -0
- package/dist/{renderer-5GZNGZU5.js → renderer-UVFGW2O6.js} +9 -7
- package/dist/{renderer-7VQOKAII.js → renderer-W22GX72R.js} +6 -6
- package/dist/{renderer-radial-NA5DVBG4.js → renderer-radial-42LVSG74.js} +5 -5
- package/dist/{state-parser-FE3RF6XY.js → state-parser-ROKY5KSI.js} +4 -4
- package/dist/{state-renderer-4S2C2CHB.js → state-renderer-MMG23G4W.js} +8 -8
- package/dist/{themes-CzuBdx1T.d.ts → themes-Cm2YBcT8.d.ts} +38 -2
- package/docs/ai-integration.md +4 -3
- package/docs/language-reference.md +162 -12
- package/gallery/fixtures/sketch.dgmo +2 -2
- package/gallery/fixtures/whiteboard.dgmo +18 -0
- package/package.json +2 -1
- package/dist/dgmo-router-7WANZOBD.js +0 -92
- package/dist/renderer-TJJGFQGT.js +0 -78
- package/dist/{chunk-CX6OH5WP.js → chunk-A5PUOHIS.js} +3 -3
- package/dist/{chunk-5LE2CTLS.js → chunk-NTJ5HVV6.js} +3 -3
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BUILT_IN_PALETTE_IDS
|
|
3
|
+
} from "./chunk-3UR4F7FE.js";
|
|
1
4
|
import {
|
|
2
5
|
apcaContrast,
|
|
3
6
|
contrastRatio,
|
|
@@ -78,6 +81,197 @@ function getAvailablePalettes() {
|
|
|
78
81
|
);
|
|
79
82
|
}
|
|
80
83
|
|
|
84
|
+
// src/palettes/theme-file.ts
|
|
85
|
+
var CONTRAST_FLOOR = 4.5;
|
|
86
|
+
var SOLID_FLOOR_LC = 45;
|
|
87
|
+
var FILL_ACCENT_KEYS = [
|
|
88
|
+
"primary",
|
|
89
|
+
"secondary",
|
|
90
|
+
"accent",
|
|
91
|
+
"destructive"
|
|
92
|
+
];
|
|
93
|
+
var CONTRAST_EXEMPT = /* @__PURE__ */ new Set([
|
|
94
|
+
"black",
|
|
95
|
+
"white"
|
|
96
|
+
]);
|
|
97
|
+
function isRecord(value) {
|
|
98
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
99
|
+
}
|
|
100
|
+
function collectShapeErrors(value, mode, errors) {
|
|
101
|
+
if (!isRecord(value)) {
|
|
102
|
+
errors.push(
|
|
103
|
+
`${mode}: expected an object of colors, got ${describe(value)}`
|
|
104
|
+
);
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
const before = errors.length;
|
|
108
|
+
const fields = /* @__PURE__ */ new Set([...SEMANTIC_KEYS, "colors"]);
|
|
109
|
+
for (const key of Object.keys(value)) {
|
|
110
|
+
if (!fields.has(key)) {
|
|
111
|
+
errors.push(`${mode}.${key}: not a palette field`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
for (const key of SEMANTIC_KEYS) {
|
|
115
|
+
const hex = value[key];
|
|
116
|
+
if (typeof hex !== "string" || !isValidHex(hex)) {
|
|
117
|
+
errors.push(`${mode}.${key}: invalid hex ${describe(hex)}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const named = value["colors"];
|
|
121
|
+
if (!isRecord(named)) {
|
|
122
|
+
errors.push(
|
|
123
|
+
`${mode}.colors: expected an object of named colors, got ${describe(named)}`
|
|
124
|
+
);
|
|
125
|
+
} else {
|
|
126
|
+
const names = new Set(COLOR_KEYS);
|
|
127
|
+
for (const key of Object.keys(named)) {
|
|
128
|
+
if (!names.has(key)) {
|
|
129
|
+
errors.push(
|
|
130
|
+
`${mode}.colors.${key}: not a palette color \u2014 a theme sets the existing color names and cannot add one`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
for (const key of COLOR_KEYS) {
|
|
135
|
+
const hex = named[key];
|
|
136
|
+
if (typeof hex !== "string" || !isValidHex(hex)) {
|
|
137
|
+
errors.push(`${mode}.colors.${key}: invalid hex ${describe(hex)}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return errors.length === before;
|
|
142
|
+
}
|
|
143
|
+
function describe(value) {
|
|
144
|
+
if (value === void 0) return "nothing";
|
|
145
|
+
if (typeof value === "string") return `"${value}"`;
|
|
146
|
+
if (value === null) return "null";
|
|
147
|
+
return typeof value;
|
|
148
|
+
}
|
|
149
|
+
function intents(colors) {
|
|
150
|
+
const out = [];
|
|
151
|
+
for (const key of COLOR_KEYS) {
|
|
152
|
+
if (CONTRAST_EXEMPT.has(key)) continue;
|
|
153
|
+
out.push([`colors.${key}`, colors.colors[key]]);
|
|
154
|
+
}
|
|
155
|
+
for (const key of FILL_ACCENT_KEYS) out.push([key, colors[key]]);
|
|
156
|
+
return out;
|
|
157
|
+
}
|
|
158
|
+
function drawnToken(colors, bg) {
|
|
159
|
+
const drawn = contrastText(bg, colors.textOnFillLight, colors.textOnFillDark);
|
|
160
|
+
return drawn === colors.textOnFillDark ? "textOnFillDark" : "textOnFillLight";
|
|
161
|
+
}
|
|
162
|
+
function worstTintedFill(colors, isDark) {
|
|
163
|
+
let worst;
|
|
164
|
+
for (const [fill, intent] of intents(colors)) {
|
|
165
|
+
const fillHex = shapeFill(colors, intent, isDark);
|
|
166
|
+
const token = drawnToken(colors, fillHex);
|
|
167
|
+
const ratio = contrastRatio(colors[token], fillHex);
|
|
168
|
+
if (!worst || ratio < worst.ratio) {
|
|
169
|
+
worst = { ratio, token, fill, fillHex };
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return worst;
|
|
173
|
+
}
|
|
174
|
+
function worstSolidFill(colors) {
|
|
175
|
+
let worst;
|
|
176
|
+
for (const [fill, intent] of intents(colors)) {
|
|
177
|
+
const token = drawnToken(colors, intent);
|
|
178
|
+
const lc = Math.abs(apcaContrast(colors[token], intent));
|
|
179
|
+
if (!worst || lc < worst.lc) {
|
|
180
|
+
worst = { lc, token, fill, fillHex: intent };
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return worst;
|
|
184
|
+
}
|
|
185
|
+
function collectContrastErrors(colors, where, isDark, errors) {
|
|
186
|
+
const tinted = worstTintedFill(colors, isDark);
|
|
187
|
+
if (tinted.ratio < CONTRAST_FLOOR) {
|
|
188
|
+
errors.push(
|
|
189
|
+
`${where}: ${tinted.token} ${colors[tinted.token]} on the ${tinted.fill} fill ${tinted.fillHex} reaches only ${tinted.ratio.toFixed(2)}:1 \u2014 text on a fill needs ${CONTRAST_FLOOR.toFixed(1)}:1`
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function collectSolidErrors(colors, where, errors) {
|
|
194
|
+
const solid = worstSolidFill(colors);
|
|
195
|
+
if (solid.lc >= SOLID_FLOOR_LC) return;
|
|
196
|
+
errors.push(
|
|
197
|
+
`${where}: ${solid.token} ${colors[solid.token]} on the solid ${solid.fill} ${solid.fillHex} reaches only Lc ${solid.lc.toFixed(1)} \u2014 text on a solid fill needs Lc ${SOLID_FLOOR_LC}`
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
function validateThemeFile(input) {
|
|
201
|
+
const errors = [];
|
|
202
|
+
if (!isRecord(input)) {
|
|
203
|
+
return {
|
|
204
|
+
ok: false,
|
|
205
|
+
errors: [`expected a theme object, got ${describe(input)}`]
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const id = input["id"];
|
|
209
|
+
if (typeof id !== "string" || id.trim() === "") {
|
|
210
|
+
errors.push(`id: expected a non-empty string, got ${describe(id)}`);
|
|
211
|
+
} else if (BUILT_IN_PALETTE_IDS.has(id)) {
|
|
212
|
+
errors.push(
|
|
213
|
+
`id: "${id}" is a built-in palette \u2014 a theme file needs an id of its own`
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
const name = input["name"];
|
|
217
|
+
if (typeof name !== "string" || name.trim() === "") {
|
|
218
|
+
errors.push(`name: expected a non-empty string, got ${describe(name)}`);
|
|
219
|
+
}
|
|
220
|
+
const declared = input["mode"];
|
|
221
|
+
let mode = null;
|
|
222
|
+
if (declared !== void 0) {
|
|
223
|
+
if (declared === "light" || declared === "dark") {
|
|
224
|
+
mode = declared;
|
|
225
|
+
} else {
|
|
226
|
+
errors.push(
|
|
227
|
+
`mode: expected "light" or "dark", got ${describe(declared)}`
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (mode) {
|
|
232
|
+
const other = mode === "light" ? "dark" : "light";
|
|
233
|
+
if (input[other] !== void 0) {
|
|
234
|
+
errors.push(
|
|
235
|
+
`${other}: a theme declaring mode "${mode}" must not also define ${other} \u2014 drop the mode to define both`
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const wanted = mode ? [mode] : ["light", "dark"];
|
|
240
|
+
const modes = {};
|
|
241
|
+
for (const key of wanted) {
|
|
242
|
+
const value = input[key];
|
|
243
|
+
if (value === void 0) {
|
|
244
|
+
errors.push(
|
|
245
|
+
mode ? `${key}: a theme declaring mode "${mode}" has to define ${key}` : `${key}: a theme without a mode has to define both light and dark`
|
|
246
|
+
);
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
if (collectShapeErrors(value, key, errors)) modes[key] = value;
|
|
250
|
+
}
|
|
251
|
+
if (errors.length === 0) {
|
|
252
|
+
const light2 = modes.light ?? modes.dark;
|
|
253
|
+
const dark2 = modes.dark ?? modes.light;
|
|
254
|
+
const declaredMode = mode;
|
|
255
|
+
const label = (render) => declaredMode !== null && render !== declaredMode ? `${render} (a theme declaring mode "${declaredMode}" is used in ${render} mode too)` : render;
|
|
256
|
+
collectContrastErrors(light2, label("light"), false, errors);
|
|
257
|
+
collectContrastErrors(dark2, label("dark"), true, errors);
|
|
258
|
+
if (declaredMode !== null) {
|
|
259
|
+
collectSolidErrors(light2, declaredMode, errors);
|
|
260
|
+
} else {
|
|
261
|
+
collectSolidErrors(light2, "light", errors);
|
|
262
|
+
collectSolidErrors(dark2, "dark", errors);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (errors.length > 0) return { ok: false, errors };
|
|
266
|
+
const light = modes.light ?? modes.dark;
|
|
267
|
+
const dark = modes.dark ?? modes.light;
|
|
268
|
+
return {
|
|
269
|
+
ok: true,
|
|
270
|
+
palette: { id, name, light, dark },
|
|
271
|
+
mode
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
81
275
|
// src/palettes/atlas.ts
|
|
82
276
|
var atlasPalette = {
|
|
83
277
|
id: "atlas",
|
|
@@ -783,208 +977,6 @@ var tokyoNightPalette = {
|
|
|
783
977
|
};
|
|
784
978
|
registerPalette(tokyoNightPalette);
|
|
785
979
|
|
|
786
|
-
// src/palettes/theme-file.ts
|
|
787
|
-
var CONTRAST_FLOOR = 4.5;
|
|
788
|
-
var SOLID_FLOOR_LC = 45;
|
|
789
|
-
var FILL_ACCENT_KEYS = [
|
|
790
|
-
"primary",
|
|
791
|
-
"secondary",
|
|
792
|
-
"accent",
|
|
793
|
-
"destructive"
|
|
794
|
-
];
|
|
795
|
-
var CONTRAST_EXEMPT = /* @__PURE__ */ new Set([
|
|
796
|
-
"black",
|
|
797
|
-
"white"
|
|
798
|
-
]);
|
|
799
|
-
var BUILT_IN_IDS = new Set(
|
|
800
|
-
[
|
|
801
|
-
atlasPalette,
|
|
802
|
-
blueprintPalette,
|
|
803
|
-
catppuccinPalette,
|
|
804
|
-
nordPalette,
|
|
805
|
-
slatePalette,
|
|
806
|
-
tidewaterPalette,
|
|
807
|
-
tokyoNightPalette
|
|
808
|
-
].map((palette) => palette.id)
|
|
809
|
-
);
|
|
810
|
-
function isRecord(value) {
|
|
811
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
812
|
-
}
|
|
813
|
-
function collectShapeErrors(value, mode, errors) {
|
|
814
|
-
if (!isRecord(value)) {
|
|
815
|
-
errors.push(
|
|
816
|
-
`${mode}: expected an object of colors, got ${describe(value)}`
|
|
817
|
-
);
|
|
818
|
-
return false;
|
|
819
|
-
}
|
|
820
|
-
const before = errors.length;
|
|
821
|
-
const fields = /* @__PURE__ */ new Set([...SEMANTIC_KEYS, "colors"]);
|
|
822
|
-
for (const key of Object.keys(value)) {
|
|
823
|
-
if (!fields.has(key)) {
|
|
824
|
-
errors.push(`${mode}.${key}: not a palette field`);
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
for (const key of SEMANTIC_KEYS) {
|
|
828
|
-
const hex = value[key];
|
|
829
|
-
if (typeof hex !== "string" || !isValidHex(hex)) {
|
|
830
|
-
errors.push(`${mode}.${key}: invalid hex ${describe(hex)}`);
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
const named = value["colors"];
|
|
834
|
-
if (!isRecord(named)) {
|
|
835
|
-
errors.push(
|
|
836
|
-
`${mode}.colors: expected an object of named colors, got ${describe(named)}`
|
|
837
|
-
);
|
|
838
|
-
} else {
|
|
839
|
-
const names = new Set(COLOR_KEYS);
|
|
840
|
-
for (const key of Object.keys(named)) {
|
|
841
|
-
if (!names.has(key)) {
|
|
842
|
-
errors.push(
|
|
843
|
-
`${mode}.colors.${key}: not a palette color \u2014 a theme sets the existing color names and cannot add one`
|
|
844
|
-
);
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
for (const key of COLOR_KEYS) {
|
|
848
|
-
const hex = named[key];
|
|
849
|
-
if (typeof hex !== "string" || !isValidHex(hex)) {
|
|
850
|
-
errors.push(`${mode}.colors.${key}: invalid hex ${describe(hex)}`);
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
return errors.length === before;
|
|
855
|
-
}
|
|
856
|
-
function describe(value) {
|
|
857
|
-
if (value === void 0) return "nothing";
|
|
858
|
-
if (typeof value === "string") return `"${value}"`;
|
|
859
|
-
if (value === null) return "null";
|
|
860
|
-
return typeof value;
|
|
861
|
-
}
|
|
862
|
-
function intents(colors) {
|
|
863
|
-
const out = [];
|
|
864
|
-
for (const key of COLOR_KEYS) {
|
|
865
|
-
if (CONTRAST_EXEMPT.has(key)) continue;
|
|
866
|
-
out.push([`colors.${key}`, colors.colors[key]]);
|
|
867
|
-
}
|
|
868
|
-
for (const key of FILL_ACCENT_KEYS) out.push([key, colors[key]]);
|
|
869
|
-
return out;
|
|
870
|
-
}
|
|
871
|
-
function drawnToken(colors, bg) {
|
|
872
|
-
const drawn = contrastText(bg, colors.textOnFillLight, colors.textOnFillDark);
|
|
873
|
-
return drawn === colors.textOnFillDark ? "textOnFillDark" : "textOnFillLight";
|
|
874
|
-
}
|
|
875
|
-
function worstTintedFill(colors, isDark) {
|
|
876
|
-
let worst;
|
|
877
|
-
for (const [fill, intent] of intents(colors)) {
|
|
878
|
-
const fillHex = shapeFill(colors, intent, isDark);
|
|
879
|
-
const token = drawnToken(colors, fillHex);
|
|
880
|
-
const ratio = contrastRatio(colors[token], fillHex);
|
|
881
|
-
if (!worst || ratio < worst.ratio) {
|
|
882
|
-
worst = { ratio, token, fill, fillHex };
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
return worst;
|
|
886
|
-
}
|
|
887
|
-
function worstSolidFill(colors) {
|
|
888
|
-
let worst;
|
|
889
|
-
for (const [fill, intent] of intents(colors)) {
|
|
890
|
-
const token = drawnToken(colors, intent);
|
|
891
|
-
const lc = Math.abs(apcaContrast(colors[token], intent));
|
|
892
|
-
if (!worst || lc < worst.lc) {
|
|
893
|
-
worst = { lc, token, fill, fillHex: intent };
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
return worst;
|
|
897
|
-
}
|
|
898
|
-
function collectContrastErrors(colors, where, isDark, errors) {
|
|
899
|
-
const tinted = worstTintedFill(colors, isDark);
|
|
900
|
-
if (tinted.ratio < CONTRAST_FLOOR) {
|
|
901
|
-
errors.push(
|
|
902
|
-
`${where}: ${tinted.token} ${colors[tinted.token]} on the ${tinted.fill} fill ${tinted.fillHex} reaches only ${tinted.ratio.toFixed(2)}:1 \u2014 text on a fill needs ${CONTRAST_FLOOR.toFixed(1)}:1`
|
|
903
|
-
);
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
function collectSolidErrors(colors, where, errors) {
|
|
907
|
-
const solid = worstSolidFill(colors);
|
|
908
|
-
if (solid.lc >= SOLID_FLOOR_LC) return;
|
|
909
|
-
errors.push(
|
|
910
|
-
`${where}: ${solid.token} ${colors[solid.token]} on the solid ${solid.fill} ${solid.fillHex} reaches only Lc ${solid.lc.toFixed(1)} \u2014 text on a solid fill needs Lc ${SOLID_FLOOR_LC}`
|
|
911
|
-
);
|
|
912
|
-
}
|
|
913
|
-
function validateThemeFile(input) {
|
|
914
|
-
const errors = [];
|
|
915
|
-
if (!isRecord(input)) {
|
|
916
|
-
return {
|
|
917
|
-
ok: false,
|
|
918
|
-
errors: [`expected a theme object, got ${describe(input)}`]
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
const id = input["id"];
|
|
922
|
-
if (typeof id !== "string" || id.trim() === "") {
|
|
923
|
-
errors.push(`id: expected a non-empty string, got ${describe(id)}`);
|
|
924
|
-
} else if (BUILT_IN_IDS.has(id)) {
|
|
925
|
-
errors.push(
|
|
926
|
-
`id: "${id}" is a built-in palette \u2014 a theme file needs an id of its own`
|
|
927
|
-
);
|
|
928
|
-
}
|
|
929
|
-
const name = input["name"];
|
|
930
|
-
if (typeof name !== "string" || name.trim() === "") {
|
|
931
|
-
errors.push(`name: expected a non-empty string, got ${describe(name)}`);
|
|
932
|
-
}
|
|
933
|
-
const declared = input["mode"];
|
|
934
|
-
let mode = null;
|
|
935
|
-
if (declared !== void 0) {
|
|
936
|
-
if (declared === "light" || declared === "dark") {
|
|
937
|
-
mode = declared;
|
|
938
|
-
} else {
|
|
939
|
-
errors.push(
|
|
940
|
-
`mode: expected "light" or "dark", got ${describe(declared)}`
|
|
941
|
-
);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
if (mode) {
|
|
945
|
-
const other = mode === "light" ? "dark" : "light";
|
|
946
|
-
if (input[other] !== void 0) {
|
|
947
|
-
errors.push(
|
|
948
|
-
`${other}: a theme declaring mode "${mode}" must not also define ${other} \u2014 drop the mode to define both`
|
|
949
|
-
);
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
const wanted = mode ? [mode] : ["light", "dark"];
|
|
953
|
-
const modes = {};
|
|
954
|
-
for (const key of wanted) {
|
|
955
|
-
const value = input[key];
|
|
956
|
-
if (value === void 0) {
|
|
957
|
-
errors.push(
|
|
958
|
-
mode ? `${key}: a theme declaring mode "${mode}" has to define ${key}` : `${key}: a theme without a mode has to define both light and dark`
|
|
959
|
-
);
|
|
960
|
-
continue;
|
|
961
|
-
}
|
|
962
|
-
if (collectShapeErrors(value, key, errors)) modes[key] = value;
|
|
963
|
-
}
|
|
964
|
-
if (errors.length === 0) {
|
|
965
|
-
const light2 = modes.light ?? modes.dark;
|
|
966
|
-
const dark2 = modes.dark ?? modes.light;
|
|
967
|
-
const declaredMode = mode;
|
|
968
|
-
const label = (render) => declaredMode !== null && render !== declaredMode ? `${render} (a theme declaring mode "${declaredMode}" is used in ${render} mode too)` : render;
|
|
969
|
-
collectContrastErrors(light2, label("light"), false, errors);
|
|
970
|
-
collectContrastErrors(dark2, label("dark"), true, errors);
|
|
971
|
-
if (declaredMode !== null) {
|
|
972
|
-
collectSolidErrors(light2, declaredMode, errors);
|
|
973
|
-
} else {
|
|
974
|
-
collectSolidErrors(light2, "light", errors);
|
|
975
|
-
collectSolidErrors(dark2, "dark", errors);
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
if (errors.length > 0) return { ok: false, errors };
|
|
979
|
-
const light = modes.light ?? modes.dark;
|
|
980
|
-
const dark = modes.dark ?? modes.light;
|
|
981
|
-
return {
|
|
982
|
-
ok: true,
|
|
983
|
-
palette: { id, name, light, dark },
|
|
984
|
-
mode
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
|
|
988
980
|
// src/palettes/index.ts
|
|
989
981
|
var palettes = {
|
|
990
982
|
atlas: atlasPalette,
|
|
@@ -999,10 +991,13 @@ var palettes = {
|
|
|
999
991
|
export {
|
|
1000
992
|
DEFAULT_PALETTE_ID,
|
|
1001
993
|
isValidHex,
|
|
994
|
+
COLOR_KEYS,
|
|
995
|
+
SEMANTIC_KEYS,
|
|
1002
996
|
registerPalette,
|
|
1003
997
|
getPalette,
|
|
1004
998
|
resolvePaletteOrFallback,
|
|
1005
999
|
getAvailablePalettes,
|
|
1000
|
+
validateThemeFile,
|
|
1006
1001
|
atlasPalette,
|
|
1007
1002
|
blueprintPalette,
|
|
1008
1003
|
catppuccinPalette,
|
|
@@ -1010,6 +1005,5 @@ export {
|
|
|
1010
1005
|
slatePalette,
|
|
1011
1006
|
tidewaterPalette,
|
|
1012
1007
|
tokyoNightPalette,
|
|
1013
|
-
validateThemeFile,
|
|
1014
1008
|
palettes
|
|
1015
1009
|
};
|
|
@@ -7,6 +7,9 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
ScaleContext
|
|
9
9
|
} from "./chunk-24YPR5EH.js";
|
|
10
|
+
import {
|
|
11
|
+
renderIntegratedLegend
|
|
12
|
+
} from "./chunk-NJYA4QSN.js";
|
|
10
13
|
import {
|
|
11
14
|
ARROWHEAD_HEIGHT,
|
|
12
15
|
ARROWHEAD_WIDTH,
|
|
@@ -17,18 +20,15 @@ import {
|
|
|
17
20
|
import {
|
|
18
21
|
layoutInlineHeader
|
|
19
22
|
} from "./chunk-CNUN5GO6.js";
|
|
23
|
+
import {
|
|
24
|
+
getLegendExtent,
|
|
25
|
+
getMaxLegendReservedHeight
|
|
26
|
+
} from "./chunk-NS7L7YKH.js";
|
|
20
27
|
import {
|
|
21
28
|
TITLE_FONT_SIZE,
|
|
22
29
|
TITLE_FONT_WEIGHT,
|
|
23
30
|
TITLE_Y
|
|
24
31
|
} from "./chunk-VLC6WNRD.js";
|
|
25
|
-
import {
|
|
26
|
-
renderIntegratedLegend
|
|
27
|
-
} from "./chunk-7SX4IY6T.js";
|
|
28
|
-
import {
|
|
29
|
-
getLegendExtent,
|
|
30
|
-
getMaxLegendReservedHeight
|
|
31
|
-
} from "./chunk-NS7L7YKH.js";
|
|
32
32
|
import {
|
|
33
33
|
FONT_FAMILY
|
|
34
34
|
} from "./chunk-ICLB27PZ.js";
|
|
@@ -36,16 +36,16 @@ import {
|
|
|
36
36
|
isSequenceBlock,
|
|
37
37
|
isSequenceNote,
|
|
38
38
|
isSequenceSection
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-62VWZ3SE.js";
|
|
40
40
|
import {
|
|
41
41
|
resolveActiveTagGroup,
|
|
42
42
|
tagAttrKey
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-HX2KJEPD.js";
|
|
44
44
|
import {
|
|
45
45
|
fillModeFromOptions,
|
|
46
46
|
legendInlineRequested,
|
|
47
47
|
legendSuppressed
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-MPJQMMBZ.js";
|
|
49
49
|
import {
|
|
50
50
|
legendChromeColors
|
|
51
51
|
} from "./chunk-I6GGMCTV.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
tagAttrKey,
|
|
14
14
|
validateTagGroupNames,
|
|
15
15
|
validateTagValues
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HX2KJEPD.js";
|
|
17
17
|
import {
|
|
18
18
|
ALL_CHART_TYPES,
|
|
19
19
|
AliasRegistry,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
tryParseSharedOption,
|
|
28
28
|
warnUnknownMetaKeys,
|
|
29
29
|
withTagAliases
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-MPJQMMBZ.js";
|
|
31
31
|
import {
|
|
32
32
|
formatDgmoError,
|
|
33
33
|
makeDgmoError,
|
|
@@ -7,28 +7,28 @@ import {
|
|
|
7
7
|
mutedFill,
|
|
8
8
|
resolveCellColor,
|
|
9
9
|
resolveColorMode
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-A5EE66RQ.js";
|
|
11
|
+
import {
|
|
12
|
+
renderIntegratedLegend
|
|
13
|
+
} from "./chunk-NJYA4QSN.js";
|
|
11
14
|
import {
|
|
12
15
|
layoutInlineHeader
|
|
13
16
|
} from "./chunk-CNUN5GO6.js";
|
|
17
|
+
import {
|
|
18
|
+
getLegendExtent,
|
|
19
|
+
getMaxLegendReservedHeight
|
|
20
|
+
} from "./chunk-NS7L7YKH.js";
|
|
14
21
|
import {
|
|
15
22
|
TITLE_FONT_SIZE,
|
|
16
23
|
TITLE_FONT_WEIGHT,
|
|
17
24
|
TITLE_Y
|
|
18
25
|
} from "./chunk-VLC6WNRD.js";
|
|
19
|
-
import {
|
|
20
|
-
renderIntegratedLegend
|
|
21
|
-
} from "./chunk-7SX4IY6T.js";
|
|
22
|
-
import {
|
|
23
|
-
getLegendExtent,
|
|
24
|
-
getMaxLegendReservedHeight
|
|
25
|
-
} from "./chunk-NS7L7YKH.js";
|
|
26
26
|
import {
|
|
27
27
|
FONT_FAMILY
|
|
28
28
|
} from "./chunk-ICLB27PZ.js";
|
|
29
29
|
import {
|
|
30
30
|
tagAttrKey
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-HX2KJEPD.js";
|
|
32
32
|
import {
|
|
33
33
|
LEGEND_GROUP_GAP
|
|
34
34
|
} from "./chunk-I6GGMCTV.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryCollectNote
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KSZHIAI2.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveNotes
|
|
6
6
|
} from "./chunk-O753JUEZ.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
tagAttrKey,
|
|
21
21
|
validateTagGroupNames,
|
|
22
22
|
validateTagValues
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-HX2KJEPD.js";
|
|
24
24
|
import {
|
|
25
25
|
AliasRegistry,
|
|
26
26
|
ER_REGISTRY,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
tryParseSharedOption,
|
|
35
35
|
warnUnknownMetaKeys,
|
|
36
36
|
withTagAliases
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-MPJQMMBZ.js";
|
|
38
38
|
import {
|
|
39
39
|
resolveColorWithDiagnostic
|
|
40
40
|
} from "./chunk-2M4IGSCY.js";
|
|
@@ -244,12 +244,12 @@ function parseERDiagram(content, palette) {
|
|
|
244
244
|
if (tagBlockMatch.alias) {
|
|
245
245
|
metaAliasMap.set(
|
|
246
246
|
normalizeName(tagBlockMatch.alias),
|
|
247
|
-
tagBlockMatch.name
|
|
247
|
+
tagAttrKey(tagBlockMatch.name)
|
|
248
248
|
);
|
|
249
249
|
}
|
|
250
250
|
metaAliasMap.set(
|
|
251
251
|
normalizeName(tagBlockMatch.name),
|
|
252
|
-
tagBlockMatch.name
|
|
252
|
+
tagAttrKey(tagBlockMatch.name)
|
|
253
253
|
);
|
|
254
254
|
result.tagGroups.push(currentTagGroup);
|
|
255
255
|
continue;
|
|
@@ -15,9 +15,10 @@ import {
|
|
|
15
15
|
finalizeAutoTagColors,
|
|
16
16
|
matchTagBlockHeading,
|
|
17
17
|
stripDefaultModifier,
|
|
18
|
+
tagAttrKey,
|
|
18
19
|
validateTagGroupNames,
|
|
19
20
|
validateTagValues
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HX2KJEPD.js";
|
|
21
22
|
import {
|
|
22
23
|
AliasRegistry,
|
|
23
24
|
FILL_FAMILY_TOKENS,
|
|
@@ -31,7 +32,7 @@ import {
|
|
|
31
32
|
splitNameAndMeta,
|
|
32
33
|
warnUnknownMetaKeys,
|
|
33
34
|
withTagAliases
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-MPJQMMBZ.js";
|
|
35
36
|
import {
|
|
36
37
|
NAME_DIAGNOSTIC_CODES,
|
|
37
38
|
formatDgmoError,
|
|
@@ -511,12 +512,12 @@ function parseSequenceDgmo(content, palette) {
|
|
|
511
512
|
if (tagBlockMatch.alias) {
|
|
512
513
|
aliasMap.set(
|
|
513
514
|
tagBlockMatch.alias.toLowerCase(),
|
|
514
|
-
tagBlockMatch.name
|
|
515
|
+
tagAttrKey(tagBlockMatch.name)
|
|
515
516
|
);
|
|
516
517
|
}
|
|
517
518
|
aliasMap.set(
|
|
518
519
|
normalizeName(tagBlockMatch.name),
|
|
519
|
-
tagBlockMatch.name
|
|
520
|
+
tagAttrKey(tagBlockMatch.name)
|
|
520
521
|
);
|
|
521
522
|
result.tagGroups.push(newTagGroup);
|
|
522
523
|
continue;
|
|
@@ -352,7 +352,8 @@ function applySwimLanes(g, resolved, _memberToGroup, collapsedGroupIds) {
|
|
|
352
352
|
if (members.length > laneSlots[li]) laneSlots[li] = members.length;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
const
|
|
355
|
+
const firstNode = g.nodes()[0];
|
|
356
|
+
const slotSize = isLR ? DEFAULT_NODE_HEIGHT : (firstNode === void 0 ? void 0 : g.node(firstNode)?.width) ?? DEFAULT_NODE_HEIGHT;
|
|
356
357
|
const laneSize = new Array(numLanes).fill(0);
|
|
357
358
|
for (let i = 1; i < numLanes; i++) {
|
|
358
359
|
const slots = laneSlots[i];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SKETCH_DIAGNOSTIC_CODES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NWSPPGIE.js";
|
|
4
4
|
import {
|
|
5
5
|
makeDgmoError
|
|
6
6
|
} from "./chunk-BYU54C3S.js";
|
|
@@ -471,7 +471,6 @@ function layoutSketch(parsed, options = {}) {
|
|
|
471
471
|
nodes.push({
|
|
472
472
|
id: unit.node.id,
|
|
473
473
|
label: unit.node.label,
|
|
474
|
-
shape: unit.node.shape,
|
|
475
474
|
metadata: unit.node.metadata,
|
|
476
475
|
...unit.node.description && { description: unit.node.description },
|
|
477
476
|
lineNumber: unit.node.lineNumber,
|
|
@@ -487,7 +486,6 @@ function layoutSketch(parsed, options = {}) {
|
|
|
487
486
|
nodes.push({
|
|
488
487
|
id: unit.box.id,
|
|
489
488
|
label: unit.box.label,
|
|
490
|
-
shape: "rectangle",
|
|
491
489
|
metadata: unit.box.metadata,
|
|
492
490
|
lineNumber: unit.box.lineNumber,
|
|
493
491
|
slot: cardSpot,
|
|
@@ -509,7 +507,6 @@ function layoutSketch(parsed, options = {}) {
|
|
|
509
507
|
nodes.push({
|
|
510
508
|
id: child.node.id,
|
|
511
509
|
label: child.node.label,
|
|
512
|
-
shape: child.node.shape,
|
|
513
510
|
metadata: child.node.metadata,
|
|
514
511
|
...child.node.description && {
|
|
515
512
|
description: child.node.description
|
|
@@ -551,7 +548,6 @@ function layoutSketch(parsed, options = {}) {
|
|
|
551
548
|
nodes.push({
|
|
552
549
|
id: gc.node.id,
|
|
553
550
|
label: gc.node.label,
|
|
554
|
-
shape: gc.node.shape,
|
|
555
551
|
metadata: gc.node.metadata,
|
|
556
552
|
...gc.node.description && { description: gc.node.description },
|
|
557
553
|
boxLabel: innerBox.label,
|