@diagrammo/dgmo 0.94.0 → 0.96.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 +97 -570
- package/dist/advanced.js +176 -352
- package/dist/block.d.ts +6 -0
- package/dist/block.js +59 -57
- package/dist/{calculator-BNH3GSJE.js → calculator-GIB7POFX.js} +2 -2
- package/dist/{chart-meta-BbjsRY7o.d.ts → chart-meta-uImk4eTn.d.ts} +1 -1
- package/dist/chart-meta.d.ts +2 -2
- package/dist/chart-meta.js +16 -16
- package/dist/{chart-types-Cppnp31G.d.ts → chart-types-CBVYiLqy.d.ts} +1 -5
- package/dist/{charts-d3-SZV2SFTM.js → charts-d3-IRP5VANE.js} +5 -5
- package/dist/{chunk-MLY5ALOV.js → chunk-2BYFNZVM.js} +2 -2
- package/dist/{chunk-OSSTOSXU.js → chunk-2M3K6GD2.js} +3 -6
- package/dist/{chunk-CDM6XMOT.js → chunk-34JOHSVE.js} +2 -2
- package/dist/chunk-35A3J4Z5.js +14 -0
- package/dist/{chunk-HI6R27YA.js → chunk-3W73ZP6W.js} +9 -4
- package/dist/{chunk-IHN6WDEY.js → chunk-4B45SNZH.js} +5 -5
- package/dist/{chunk-AULZD45V.js → chunk-5ARANBIE.js} +2 -2
- package/dist/{chunk-DDIOWNHS.js → chunk-5BG4OSWJ.js} +6 -6
- package/dist/{chunk-6JCTW74W.js → chunk-5G4DOOX2.js} +1 -1
- package/dist/{chunk-JT2BG7LM.js → chunk-5GU6C5WB.js} +3 -3
- package/dist/{chunk-EBIDNRSR.js → chunk-5H7SA5ZD.js} +1 -1
- package/dist/{chunk-CN4RDJDV.js → chunk-5LG526X7.js} +1 -1
- package/dist/{chunk-VDY2GR6U.js → chunk-67N26CER.js} +2 -2
- package/dist/{chunk-G3HZ4PGE.js → chunk-67RKJEKF.js} +6 -6
- package/dist/{chunk-D3K4U3ZM.js → chunk-6K2W3FH7.js} +8 -5
- package/dist/{chunk-C6G36F5S.js → chunk-7UWVHNPM.js} +4 -4
- package/dist/{chunk-FWVE373X.js → chunk-AQRSEQZV.js} +1 -1
- package/dist/{chunk-BQO24BDM.js → chunk-AUXUNV73.js} +1 -1
- package/dist/{chunk-3PP746YM.js → chunk-B2YVZ3QU.js} +1 -1
- package/dist/{chunk-QPQWY5RU.js → chunk-B5CEV7IR.js} +3 -3
- package/dist/{chunk-J7Q4AB23.js → chunk-B7BSRVNC.js} +2 -2
- package/dist/{chunk-IXHWS2HI.js → chunk-BD4O4D2A.js} +2 -2
- package/dist/{chunk-4TEPDQHJ.js → chunk-BUVLLK3D.js} +7 -7
- package/dist/{chunk-B25IWGDH.js → chunk-CD7VQCDL.js} +8 -8
- package/dist/{chunk-I37S3EZE.js → chunk-CP73WWLN.js} +371 -286
- package/dist/{chunk-GI5R5B3S.js → chunk-D7DGLJ7N.js} +2 -2
- package/dist/{chunk-3TWBMU7K.js → chunk-DKCVAQU3.js} +9 -9
- package/dist/{chunk-KBDMEOLI.js → chunk-DPNSDCR3.js} +1 -1
- package/dist/{chunk-BRGRIZQB.js → chunk-DWMQ24JR.js} +2 -2
- package/dist/{chunk-4XYZJTFO.js → chunk-EM5SA7NC.js} +11 -3
- package/dist/{chunk-AM42TLSZ.js → chunk-EMGNCG5C.js} +1 -1
- package/dist/{chunk-3KVUFHUJ.js → chunk-EPB3UEMD.js} +2 -2
- package/dist/{chunk-NXU4N5WT.js → chunk-EZ6BI5LL.js} +1 -1
- package/dist/{chunk-2ZW4NBYX.js → chunk-FBK32S4D.js} +1 -1
- package/dist/{chunk-2I4UQG7W.js → chunk-FHX373L5.js} +1 -1
- package/dist/{chunk-AQQUJEDN.js → chunk-FKJWZWNU.js} +1 -1
- package/dist/{chunk-TIIZIAGS.js → chunk-FUYEXLAN.js} +6 -13
- package/dist/{chunk-TASRGDYP.js → chunk-GEHK4UD5.js} +3 -3
- package/dist/{chunk-ZD3QCNB7.js → chunk-GLL237AP.js} +2 -2
- package/dist/{chunk-PGSGJLUR.js → chunk-GM2SLMQW.js} +2 -2
- package/dist/{chunk-NOQB4KMV.js → chunk-H7JVKUA5.js} +5 -5
- package/dist/{chunk-DNM3XZCK.js → chunk-H7RQG4PH.js} +2 -2
- package/dist/{chunk-7SXV7NUS.js → chunk-HH3DHNQA.js} +2 -2
- package/dist/{chunk-GWQRTA5W.js → chunk-HZX4QZGR.js} +1 -1
- package/dist/{chunk-KBEWVCK3.js → chunk-I2I2FKAK.js} +1 -1
- package/dist/{chunk-2HSHWPTO.js → chunk-I3ZRIMR7.js} +10 -10
- package/dist/{chunk-7IOZ6JE4.js → chunk-IKXQ6NVR.js} +7 -7
- package/dist/{chunk-XJQ6Z3FO.js → chunk-IQZSKWE5.js} +3 -3
- package/dist/{chunk-3GUEYQGL.js → chunk-ITDF3MWD.js} +3 -3
- package/dist/{chunk-JXGSTBW6.js → chunk-IU7XKZA6.js} +2 -2
- package/dist/{chunk-RITTLIDJ.js → chunk-IZFJZCF6.js} +4 -4
- package/dist/{chunk-DRQSB72S.js → chunk-JBAFAKGX.js} +7 -7
- package/dist/{chunk-VSAKEMDD.js → chunk-JCC3B2GS.js} +8 -2
- package/dist/{chunk-66JTY4AN.js → chunk-JRN2CRXJ.js} +1 -1
- package/dist/{chunk-2FDQEQID.js → chunk-K2SFH3GJ.js} +2 -2
- package/dist/{chunk-NM5V5EKY.js → chunk-K2WXMXI2.js} +1 -1
- package/dist/{chunk-XKCRKD2B.js → chunk-KDWEOT54.js} +24 -12
- package/dist/{chunk-PVWIBKV2.js → chunk-KQAPFIYF.js} +2 -2
- package/dist/{chunk-4SACN2C5.js → chunk-LGUFJ7Y2.js} +1 -1
- package/dist/{chunk-AYUSD4Z6.js → chunk-LRHPBWOY.js} +5 -5
- package/dist/{chunk-DLJJOCIT.js → chunk-M4ZUIW3J.js} +3 -3
- package/dist/{chunk-CIHHTS5B.js → chunk-MAYTYF5S.js} +3 -3
- package/dist/{chunk-5ZUZZDW5.js → chunk-MVUNMJKO.js} +46 -52
- package/dist/{chunk-KBHT5XEY.js → chunk-MYHR3PMH.js} +194 -35
- package/dist/{chunk-NBAAIRFP.js → chunk-NI4L6HEU.js} +4 -1
- package/dist/{chunk-A2A2I4Z4.js → chunk-O2HNVNKO.js} +2 -2
- package/dist/{chunk-2XMTZ5JR.js → chunk-OAZ6BIIB.js} +3 -3
- package/dist/{chunk-IZHGT5HD.js → chunk-OO4GUE4E.js} +3 -3
- package/dist/{chunk-KSZB7TIY.js → chunk-OYGJZA24.js} +8 -8
- package/dist/{chunk-H6BT45SN.js → chunk-P2GNNEMN.js} +1 -1
- package/dist/{chunk-5HAYT43L.js → chunk-P3PSLC2K.js} +22 -6
- package/dist/{chunk-HHVIE45A.js → chunk-P6LKX3IQ.js} +4 -4
- package/dist/{chunk-NMS5XSLX.js → chunk-PGD6CNWO.js} +1 -1
- package/dist/{chunk-NVZ7R4EK.js → chunk-PWZEJNO6.js} +3 -3
- package/dist/{chunk-NPDVWFAQ.js → chunk-QEU6VM4O.js} +1 -1
- package/dist/{chunk-UIEKW4SG.js → chunk-R5L5E3TC.js} +0 -1
- package/dist/{chunk-2WQ3YZMN.js → chunk-RGFVHYDP.js} +2 -2
- package/dist/{chunk-YQMIKX54.js → chunk-RIK6WUMO.js} +62 -29
- package/dist/{chunk-BH2SF4TT.js → chunk-RTRORHSP.js} +1 -1
- package/dist/{chunk-4SP6OUO7.js → chunk-RVOSA4RR.js} +845 -193
- package/dist/{chunk-LKZCUFOW.js → chunk-SCYVGPLI.js} +2 -2
- package/dist/{chunk-XIUGSUE4.js → chunk-SIABEREK.js} +6 -2
- package/dist/{chunk-P7TRFL4P.js → chunk-SQBCNEJB.js} +4 -1
- package/dist/{chunk-3ZP3QC47.js → chunk-THTYCJGF.js} +2 -2
- package/dist/{chunk-4EX4OKGZ.js → chunk-TIPNNOZC.js} +5 -5
- package/dist/{chunk-UZ7EZW3B.js → chunk-TO53KK2P.js} +6 -1
- package/dist/{chunk-2MS623GW.js → chunk-TPCP2UOI.js} +3 -3
- package/dist/{chunk-Y3SIQN4J.js → chunk-TUOZ6AXC.js} +2 -2
- package/dist/{chunk-KRPLP5LP.js → chunk-U6N547QA.js} +1 -1
- package/dist/{chunk-RESEJSCV.js → chunk-VJ7NLYFE.js} +2 -2
- package/dist/{chunk-UXNA2H2V.js → chunk-VLI6AWS3.js} +2 -2
- package/dist/{chunk-TDAGJJPZ.js → chunk-VNAPEZX2.js} +1 -1
- package/dist/{chunk-EBVVMUAA.js → chunk-VVTCUIPN.js} +1 -1
- package/dist/{chunk-FVTYJUXR.js → chunk-W5MMPPGX.js} +2 -2
- package/dist/{chunk-BQMHJ6OW.js → chunk-WGNP5ND2.js} +20 -12
- package/dist/{chunk-5OTA2PUH.js → chunk-WLGOIMTI.js} +2 -2
- package/dist/{chunk-IGJEKO2P.js → chunk-WTPS73RM.js} +4 -4
- package/dist/{chunk-R6EGUTIV.js → chunk-YFIUABSF.js} +2 -2
- package/dist/{chunk-7PJBJ2DU.js → chunk-YSGOXZBB.js} +1 -1
- package/dist/{chunk-ZECJ7Q6C.js → chunk-YVIPJGFG.js} +2 -2
- package/dist/{chunk-5KKZXA44.js → chunk-ZBOIYC2G.js} +4 -2
- package/dist/{chunk-RBVFNUAL.js → chunk-ZOKD5F7M.js} +2 -2
- package/dist/{collapse-BSPH3BFM.js → collapse-6X5S2S3G.js} +2 -1
- package/dist/completion-registry.js +6 -37
- package/dist/copy-image.d.ts +34 -0
- package/dist/copy-image.js +96 -0
- package/dist/countdown.js +1 -1
- package/dist/dgmo-router-EPBQKQW2.js +100 -0
- package/dist/{dimensions-DS6FWLRY.js → dimensions-DBCRBZIU.js} +4 -4
- package/dist/editor.js +2 -7
- package/dist/{flowchart-parser-NZXASOZG.js → flowchart-parser-SM5LHF2D.js} +4 -4
- package/dist/{flowchart-renderer-PTCRIANF.js → flowchart-renderer-PPS2GTTD.js} +10 -10
- package/dist/highlight.js +3 -8
- package/dist/index.d.ts +42 -6
- package/dist/index.js +62 -57
- package/dist/{layout-MXHR3P35.js → layout-3J72UULM.js} +3 -3
- package/dist/{layout-U3AH6M7J.js → layout-AF4KA5B2.js} +4 -4
- package/dist/{layout-IT4ZTV6C.js → layout-FCFUVCRI.js} +7 -7
- package/dist/{layout-KV27UW25.js → layout-H2KP5A6M.js} +1 -1
- package/dist/{layout-ND26WVX2.js → layout-IXQNVRBE.js} +3 -3
- package/dist/{layout-ISSBWBH7.js → layout-KELSNWBD.js} +7 -7
- package/dist/{layout-JTIRCKAW.js → layout-LNVIH45F.js} +3 -3
- package/dist/{layout-VC3MXRB4.js → layout-MPSH3YWE.js} +7 -7
- package/dist/{layout-HFBK5UEG.js → layout-PPIVGJXD.js} +2 -2
- package/dist/{layout-RH3N46HP.js → layout-R6G4MEO3.js} +4 -3
- package/dist/{layout-search-BBX2BMEF.js → layout-search-C2TYUH4L.js} +5 -5
- package/dist/{parser-BT4NI6JY.js → parser-2AXU2MHJ.js} +3 -3
- package/dist/{parser-3QIFY5IN.js → parser-4BOP77CD.js} +2 -2
- package/dist/{parser-TAYRTCPR.js → parser-4GHAYZKZ.js} +5 -5
- package/dist/{parser-LTRQASGB.js → parser-5HQPPVHJ.js} +3 -3
- package/dist/{parser-EAQPZX2B.js → parser-5RUD4A3X.js} +3 -3
- package/dist/{parser-BJ7RJNUM.js → parser-6WURFLOB.js} +3 -3
- package/dist/{parser-R3LPEQIT.js → parser-722KLLAQ.js} +4 -4
- package/dist/{parser-KMKVFET2.js → parser-B7SCN7FG.js} +2 -2
- package/dist/{parser-TUAEX6ML.js → parser-BNRX35NT.js} +3 -3
- package/dist/{parser-NL73FSFI.js → parser-BPYHIG24.js} +3 -3
- package/dist/{parser-3LT3ZUUC.js → parser-CRJYLOHA.js} +2 -2
- package/dist/{parser-NUU3DVW4.js → parser-DGLKH4NT.js} +2 -2
- package/dist/{parser-5UZV32ZI.js → parser-DRUGM3R6.js} +2 -2
- package/dist/{parser-KLCSFQ3J.js → parser-DWV2CYBS.js} +3 -3
- package/dist/{parser-2IKPQVKX.js → parser-F3JJNIFC.js} +3 -3
- package/dist/{parser-EFF22GYO.js → parser-F75WNYMK.js} +3 -3
- package/dist/{parser-RTWPFKXG.js → parser-GBQY3WOZ.js} +3 -3
- package/dist/{parser-F7NDRPMA.js → parser-GM5B2EPW.js} +3 -3
- package/dist/{parser-K2DI26SC.js → parser-H6HT2WFQ.js} +2 -2
- package/dist/{parser-PEZ7RN43.js → parser-HM6FEX5K.js} +3 -3
- package/dist/{parser-YG625J5H.js → parser-L7SI3PW4.js} +4 -4
- package/dist/{parser-GMQJISZ6.js → parser-LUJX7AXO.js} +2 -2
- package/dist/{parser-A3AN76RQ.js → parser-MWINQNQW.js} +3 -3
- package/dist/{parser-KJPPUN4D.js → parser-OHBBDCG4.js} +2 -2
- package/dist/{parser-4RFY7D52.js → parser-QWTECQEC.js} +5 -5
- package/dist/{parser-4TBSWULQ.js → parser-TTGZYLYD.js} +3 -3
- package/dist/{parser-6TDWUKM5.js → parser-UHKROC7Z.js} +3 -3
- package/dist/{parser-H5OODY5N.js → parser-W6NX3AIV.js} +3 -3
- package/dist/{parser-GDLKUBTO.js → parser-WIKXZP4X.js} +2 -2
- package/dist/{parser-4Y6PODW6.js → parser-XEJP37GQ.js} +3 -3
- package/dist/{parser-RCIEKN7Y.js → parser-Y7QXD2UR.js} +2 -2
- package/dist/{parser-7QKQ4P4P.js → parser-ZV756RMP.js} +5 -5
- package/dist/{parser-KKF6Y5MM.js → parser-ZWWQZ4XZ.js} +4 -3
- package/dist/{redraw-AHW7EUUF.js → redraw-BZ4GI6IC.js} +6 -4
- package/dist/{redraw-STZ4WJAI.js → redraw-LEOXS7C6.js} +3 -3
- package/dist/{renderer-J3GPDK73.js → renderer-2MCV75JQ.js} +12 -12
- package/dist/{renderer-TINHO2IO.js → renderer-2V2XY2V7.js} +4 -4
- package/dist/{renderer-PHLCYVSN.js → renderer-5AEDVLAA.js} +8 -7
- package/dist/{renderer-W4MUMXJE.js → renderer-5GP7YUS4.js} +3 -3
- package/dist/{renderer-FMTLSOCX.js → renderer-66NCRXSC.js} +6 -6
- package/dist/{renderer-AM7P4LN7.js → renderer-6HU44IGJ.js} +4 -4
- package/dist/{renderer-JJ4QW3SK.js → renderer-7C76HP5W.js} +6 -6
- package/dist/{renderer-O6RP52CQ.js → renderer-7RAMBMTH.js} +6 -6
- package/dist/{renderer-M5DUMITP.js → renderer-BYLQ37T2.js} +8 -8
- package/dist/{renderer-7OGGV327.js → renderer-CVCCW7UT.js} +4 -4
- package/dist/{renderer-QTPWRRJ7.js → renderer-D6EH5UQ6.js} +6 -6
- package/dist/renderer-E3334XLT.js +84 -0
- package/dist/{renderer-IXBOT6DU.js → renderer-F7YGMEGQ.js} +2 -2
- package/dist/{renderer-XCLARXCK.js → renderer-GKY55M4Z.js} +5 -5
- package/dist/{renderer-KJ3V5BYP.js → renderer-LFZKG2GR.js} +5 -5
- package/dist/{renderer-2LYX6NHN.js → renderer-LJPUCG3U.js} +5 -5
- package/dist/{renderer-DAZWHNLI.js → renderer-MGF2NNGG.js} +3 -3
- package/dist/{renderer-HX6ICPDX.js → renderer-MVBAQP3M.js} +4 -4
- package/dist/{renderer-XOWDERU2.js → renderer-MZIWP55B.js} +5 -5
- package/dist/{renderer-MWZC7TMD.js → renderer-N6PM5CSG.js} +7 -7
- package/dist/{renderer-ISQJ2ELA.js → renderer-N75E3UVY.js} +5 -5
- package/dist/{renderer-53B523PM.js → renderer-ONENGXFQ.js} +7 -7
- package/dist/{renderer-RUSQJFFC.js → renderer-PEJF6R2I.js} +2 -2
- package/dist/{renderer-36446HSH.js → renderer-QZJZIAT3.js} +2 -2
- package/dist/{renderer-UTEEJDGB.js → renderer-SYRH3B62.js} +6 -6
- package/dist/{renderer-LNP23NSM.js → renderer-TS5NHOQD.js} +6 -6
- package/dist/{renderer-J7ZSTJUE.js → renderer-VNJOZPSH.js} +7 -7
- package/dist/{renderer-OUDHH5MV.js → renderer-VNUDN6F5.js} +12 -12
- package/dist/{renderer-JYHA6R2D.js → renderer-VUXAAGUG.js} +5 -5
- package/dist/{renderer-BXD5KVSR.js → renderer-YJVQT7QG.js} +6 -6
- package/dist/{renderer-radial-WFUX3Z3C.js → renderer-radial-4R7AKETK.js} +5 -5
- package/dist/{state-parser-KPVW5CRI.js → state-parser-EQBBEKHR.js} +5 -5
- package/dist/{state-renderer-ZVEI265C.js → state-renderer-SOGZ2CNN.js} +12 -12
- package/dist/{themes-DzIH3Hjv.d.ts → themes-CbJL3w8L.d.ts} +1 -1
- package/docs/ai-integration.md +5 -6
- package/docs/language-reference.md +69 -105
- package/gallery/fixtures/whiteboard.dgmo +1 -0
- package/package.json +5 -1
- package/dist/chunk-6BQSDF77.js +0 -734
- package/dist/chunk-NWSPPGIE.js +0 -60
- package/dist/chunk-VBMRZCMQ.js +0 -1465
- package/dist/chunk-WZBZXZ6T.js +0 -636
- package/dist/dgmo-router-E5O7RJSW.js +0 -101
- package/dist/layout-D4L44NRG.js +0 -11
- package/dist/parser-YHDGKPZI.js +0 -14
- package/dist/renderer-4SE7R22T.js +0 -85
- package/dist/renderer-WPN2SXGT.js +0 -29
- package/gallery/fixtures/sketch.dgmo +0 -22
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderDataChartD3
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RIK6WUMO.js";
|
|
4
|
+
import {
|
|
5
|
+
readViewBox
|
|
6
|
+
} from "./chunk-6K2W3FH7.js";
|
|
4
7
|
import {
|
|
5
8
|
REGISTRY_BY_ID,
|
|
6
9
|
getRenderCategory,
|
|
@@ -12,7 +15,7 @@ import {
|
|
|
12
15
|
parseVenn,
|
|
13
16
|
parseVisualization,
|
|
14
17
|
parseWordcloud
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MVUNMJKO.js";
|
|
16
19
|
import {
|
|
17
20
|
parseChart,
|
|
18
21
|
parseFunctionChart,
|
|
@@ -20,16 +23,13 @@ import {
|
|
|
20
23
|
parseHeatmap,
|
|
21
24
|
parseSankey,
|
|
22
25
|
parseScatter
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
parsePyramid
|
|
26
|
-
} from "./chunk-3PP746YM.js";
|
|
26
|
+
} from "./chunk-P2GNNEMN.js";
|
|
27
27
|
import {
|
|
28
28
|
parseRing
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-K2WXMXI2.js";
|
|
30
30
|
import {
|
|
31
31
|
parseTreemap
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-EPB3UEMD.js";
|
|
33
33
|
import {
|
|
34
34
|
MAP_DX
|
|
35
35
|
} from "./chunk-EOYPX6SF.js";
|
|
@@ -38,43 +38,46 @@ import {
|
|
|
38
38
|
} from "./chunk-KMU65FYM.js";
|
|
39
39
|
import {
|
|
40
40
|
parseVersionControl
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-FBK32S4D.js";
|
|
42
42
|
import {
|
|
43
43
|
parseMap
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import {
|
|
46
|
-
parseSketch
|
|
47
|
-
} from "./chunk-WZBZXZ6T.js";
|
|
44
|
+
} from "./chunk-5ARANBIE.js";
|
|
48
45
|
import {
|
|
49
46
|
parseWhiteboard
|
|
50
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-P3PSLC2K.js";
|
|
51
48
|
import {
|
|
52
49
|
parseSwimlane
|
|
53
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-B7BSRVNC.js";
|
|
54
51
|
import {
|
|
55
52
|
parseMindmap
|
|
56
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-SIABEREK.js";
|
|
57
54
|
import {
|
|
58
55
|
parseTechRadar
|
|
59
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-VVTCUIPN.js";
|
|
57
|
+
import {
|
|
58
|
+
parsePyramid
|
|
59
|
+
} from "./chunk-B2YVZ3QU.js";
|
|
60
60
|
import {
|
|
61
61
|
parseKanban
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-SCYVGPLI.js";
|
|
63
63
|
import {
|
|
64
64
|
parseInfra
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-VLI6AWS3.js";
|
|
66
66
|
import {
|
|
67
67
|
parseJourneyMap
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-GM2SLMQW.js";
|
|
69
69
|
import {
|
|
70
70
|
parseGoal
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-YSGOXZBB.js";
|
|
72
|
+
import {
|
|
73
|
+
MIN_CANVAS_WIDTH
|
|
74
|
+
} from "./chunk-EPDBWATV.js";
|
|
72
75
|
import {
|
|
73
76
|
parseEventLine
|
|
74
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-ITDF3MWD.js";
|
|
75
78
|
import {
|
|
76
79
|
renderTimeline
|
|
77
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-GEHK4UD5.js";
|
|
78
81
|
import {
|
|
79
82
|
EXPORT_HEIGHT,
|
|
80
83
|
EXPORT_WIDTH,
|
|
@@ -89,49 +92,49 @@ import {
|
|
|
89
92
|
} from "./chunk-6XLMTAEX.js";
|
|
90
93
|
import {
|
|
91
94
|
parseTimelineDate
|
|
92
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-AUXUNV73.js";
|
|
93
96
|
import {
|
|
94
97
|
parseFamily
|
|
95
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-YFIUABSF.js";
|
|
96
99
|
import {
|
|
97
100
|
parseGantt
|
|
98
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-KQAPFIYF.js";
|
|
99
102
|
import {
|
|
100
103
|
parseClock
|
|
101
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-EZ6BI5LL.js";
|
|
102
105
|
import {
|
|
103
106
|
parseCountdown
|
|
104
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-I2I2FKAK.js";
|
|
105
108
|
import {
|
|
106
109
|
parseCycle
|
|
107
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-QEU6VM4O.js";
|
|
108
111
|
import {
|
|
109
112
|
parseBracket
|
|
110
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-RGFVHYDP.js";
|
|
111
114
|
import {
|
|
112
115
|
layoutBracket
|
|
113
116
|
} from "./chunk-ZI6WC24V.js";
|
|
114
117
|
import {
|
|
115
118
|
parseC4
|
|
116
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-BD4O4D2A.js";
|
|
117
120
|
import {
|
|
118
121
|
parseBlock
|
|
119
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-DWMQ24JR.js";
|
|
120
123
|
import {
|
|
121
124
|
isBlockNode
|
|
122
125
|
} from "./chunk-XSVWUOUZ.js";
|
|
123
126
|
import {
|
|
124
127
|
parseBody
|
|
125
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-IU7XKZA6.js";
|
|
126
129
|
import {
|
|
127
130
|
parseBoxesAndLines
|
|
128
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-OAZ6BIIB.js";
|
|
129
132
|
import {
|
|
130
133
|
ScaleContext
|
|
131
134
|
} from "./chunk-24YPR5EH.js";
|
|
132
135
|
import {
|
|
133
136
|
legendInlineSupported
|
|
134
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-R5L5E3TC.js";
|
|
135
138
|
import {
|
|
136
139
|
GRID_DASH,
|
|
137
140
|
scaleDash
|
|
@@ -141,38 +144,38 @@ import {
|
|
|
141
144
|
} from "./chunk-JILEYZ2V.js";
|
|
142
145
|
import {
|
|
143
146
|
parseRaci
|
|
144
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-U6N547QA.js";
|
|
145
148
|
import {
|
|
146
149
|
parseLiveLink
|
|
147
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-DPNSDCR3.js";
|
|
148
151
|
import {
|
|
149
152
|
parseSequenceDgmo
|
|
150
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-JCC3B2GS.js";
|
|
151
154
|
import {
|
|
152
155
|
parseOrg
|
|
153
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-WLGOIMTI.js";
|
|
154
157
|
import {
|
|
155
158
|
parseSitemap
|
|
156
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-YVIPJGFG.js";
|
|
157
160
|
import {
|
|
158
161
|
parsePert
|
|
159
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-34JOHSVE.js";
|
|
160
163
|
import {
|
|
161
164
|
parseFlowchart
|
|
162
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-H7RQG4PH.js";
|
|
163
166
|
import {
|
|
164
167
|
parseState
|
|
165
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-TPCP2UOI.js";
|
|
166
169
|
import {
|
|
167
170
|
choosePalette,
|
|
168
171
|
extractPaletteDirective
|
|
169
172
|
} from "./chunk-CYTFO2LF.js";
|
|
170
173
|
import {
|
|
171
174
|
parseERDiagram
|
|
172
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-MAYTYF5S.js";
|
|
173
176
|
import {
|
|
174
177
|
parseClassDiagram
|
|
175
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-M4ZUIW3J.js";
|
|
176
179
|
import {
|
|
177
180
|
getPalette
|
|
178
181
|
} from "./chunk-FMAVHTYB.js";
|
|
@@ -181,11 +184,11 @@ import {
|
|
|
181
184
|
} from "./chunk-ICLB27PZ.js";
|
|
182
185
|
import {
|
|
183
186
|
parseWireframe
|
|
184
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-D7DGLJ7N.js";
|
|
185
188
|
import {
|
|
186
189
|
resolveActiveTagGroup,
|
|
187
190
|
tagAttrKey
|
|
188
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-LGUFJ7Y2.js";
|
|
189
192
|
import {
|
|
190
193
|
measureText,
|
|
191
194
|
wrapTextToWidth
|
|
@@ -200,6 +203,686 @@ import {
|
|
|
200
203
|
makeDgmoError
|
|
201
204
|
} from "./chunk-BYU54C3S.js";
|
|
202
205
|
|
|
206
|
+
// src/utils/export-fit.ts
|
|
207
|
+
var EXPORT_FIT_PAD = 24;
|
|
208
|
+
var EXPORT_FIT_MIN_TRIM = EXPORT_FIT_PAD * 2;
|
|
209
|
+
var TEXT_WIDTH_SAFETY = 1.15;
|
|
210
|
+
var MARKER_ALLOWANCE = 12;
|
|
211
|
+
var DEFAULT_FONT_SIZE = 16;
|
|
212
|
+
var NON_RENDERING = /* @__PURE__ */ new Set([
|
|
213
|
+
"defs",
|
|
214
|
+
"clippath",
|
|
215
|
+
"mask",
|
|
216
|
+
"marker",
|
|
217
|
+
"pattern",
|
|
218
|
+
"symbol",
|
|
219
|
+
"lineargradient",
|
|
220
|
+
"radialgradient",
|
|
221
|
+
"filter",
|
|
222
|
+
"style",
|
|
223
|
+
"title",
|
|
224
|
+
"desc",
|
|
225
|
+
"metadata",
|
|
226
|
+
"script"
|
|
227
|
+
]);
|
|
228
|
+
var IDENTITY = [1, 0, 0, 1, 0, 0];
|
|
229
|
+
function multiply(p, q) {
|
|
230
|
+
return [
|
|
231
|
+
p[0] * q[0] + p[2] * q[1],
|
|
232
|
+
p[1] * q[0] + p[3] * q[1],
|
|
233
|
+
p[0] * q[2] + p[2] * q[3],
|
|
234
|
+
p[1] * q[2] + p[3] * q[3],
|
|
235
|
+
p[0] * q[4] + p[2] * q[5] + p[4],
|
|
236
|
+
p[1] * q[4] + p[3] * q[5] + p[5]
|
|
237
|
+
];
|
|
238
|
+
}
|
|
239
|
+
var NUM_RE = /[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g;
|
|
240
|
+
function nums(s) {
|
|
241
|
+
return (s.match(NUM_RE) ?? []).map(Number);
|
|
242
|
+
}
|
|
243
|
+
function parseTransform(value) {
|
|
244
|
+
let m = IDENTITY;
|
|
245
|
+
const re = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)\s*,?/gy;
|
|
246
|
+
let consumed = 0;
|
|
247
|
+
for (const t of value.matchAll(re)) {
|
|
248
|
+
consumed = (t.index ?? 0) + t[0].length;
|
|
249
|
+
const a = nums(t[2]);
|
|
250
|
+
let local;
|
|
251
|
+
switch (t[1]) {
|
|
252
|
+
case "matrix":
|
|
253
|
+
if (a.length !== 6) return null;
|
|
254
|
+
local = a;
|
|
255
|
+
break;
|
|
256
|
+
case "translate":
|
|
257
|
+
if (a.length < 1 || a.length > 2) return null;
|
|
258
|
+
local = [1, 0, 0, 1, a[0], a[1] ?? 0];
|
|
259
|
+
break;
|
|
260
|
+
case "scale":
|
|
261
|
+
if (a.length < 1 || a.length > 2) return null;
|
|
262
|
+
local = [a[0], 0, 0, a[1] ?? a[0], 0, 0];
|
|
263
|
+
break;
|
|
264
|
+
case "rotate": {
|
|
265
|
+
if (a.length !== 1 && a.length !== 3) return null;
|
|
266
|
+
const r = a[0] * Math.PI / 180;
|
|
267
|
+
const c = Math.cos(r);
|
|
268
|
+
const s = Math.sin(r);
|
|
269
|
+
const rot = [c, s, -s, c, 0, 0];
|
|
270
|
+
if (a.length === 3) {
|
|
271
|
+
const [, cx, cy] = a;
|
|
272
|
+
local = multiply(multiply([1, 0, 0, 1, cx, cy], rot), [
|
|
273
|
+
1,
|
|
274
|
+
0,
|
|
275
|
+
0,
|
|
276
|
+
1,
|
|
277
|
+
-cx,
|
|
278
|
+
-cy
|
|
279
|
+
]);
|
|
280
|
+
} else local = rot;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
case "skewX":
|
|
284
|
+
if (a.length !== 1) return null;
|
|
285
|
+
local = [1, 0, Math.tan(a[0] * Math.PI / 180), 1, 0, 0];
|
|
286
|
+
break;
|
|
287
|
+
default:
|
|
288
|
+
if (a.length !== 1) return null;
|
|
289
|
+
local = [1, Math.tan(a[0] * Math.PI / 180), 0, 1, 0, 0];
|
|
290
|
+
}
|
|
291
|
+
m = multiply(m, local);
|
|
292
|
+
}
|
|
293
|
+
return value.slice(consumed).trim() === "" ? m : null;
|
|
294
|
+
}
|
|
295
|
+
function pathBox(d) {
|
|
296
|
+
let i = 0;
|
|
297
|
+
const n = d.length;
|
|
298
|
+
const box = {
|
|
299
|
+
x0: Infinity,
|
|
300
|
+
y0: Infinity,
|
|
301
|
+
x1: -Infinity,
|
|
302
|
+
y1: -Infinity
|
|
303
|
+
};
|
|
304
|
+
const add = (x, y) => {
|
|
305
|
+
if (x < box.x0) box.x0 = x;
|
|
306
|
+
if (x > box.x1) box.x1 = x;
|
|
307
|
+
if (y < box.y0) box.y0 = y;
|
|
308
|
+
if (y > box.y1) box.y1 = y;
|
|
309
|
+
};
|
|
310
|
+
const skipSep = () => {
|
|
311
|
+
while (i < n && /[\s,]/.test(d[i])) i++;
|
|
312
|
+
};
|
|
313
|
+
const numAt = () => {
|
|
314
|
+
skipSep();
|
|
315
|
+
const m = /[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/y;
|
|
316
|
+
m.lastIndex = i;
|
|
317
|
+
const r = m.exec(d);
|
|
318
|
+
if (!r) return null;
|
|
319
|
+
i += r[0].length;
|
|
320
|
+
return Number(r[0]);
|
|
321
|
+
};
|
|
322
|
+
const flagAt = () => {
|
|
323
|
+
skipSep();
|
|
324
|
+
const c = d[i];
|
|
325
|
+
if (c !== "0" && c !== "1") return null;
|
|
326
|
+
i++;
|
|
327
|
+
return c === "1" ? 1 : 0;
|
|
328
|
+
};
|
|
329
|
+
const moreNumbers = () => {
|
|
330
|
+
skipSep();
|
|
331
|
+
return i < n && /[-+.\d]/.test(d[i]);
|
|
332
|
+
};
|
|
333
|
+
let cx = 0;
|
|
334
|
+
let cy = 0;
|
|
335
|
+
let sx = 0;
|
|
336
|
+
let sy = 0;
|
|
337
|
+
let cmd = "";
|
|
338
|
+
while (true) {
|
|
339
|
+
skipSep();
|
|
340
|
+
if (i >= n) break;
|
|
341
|
+
const c = d[i];
|
|
342
|
+
if (/[MmLlHhVvCcSsQqTtAaZz]/.test(c)) {
|
|
343
|
+
cmd = c;
|
|
344
|
+
i++;
|
|
345
|
+
} else if (!cmd || cmd === "Z" || cmd === "z" || !/[-+.\d]/.test(c)) {
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
const rel = cmd === cmd.toLowerCase();
|
|
349
|
+
const up = cmd.toUpperCase();
|
|
350
|
+
if (up === "Z") {
|
|
351
|
+
cx = sx;
|
|
352
|
+
cy = sy;
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
const arity = {
|
|
356
|
+
M: 2,
|
|
357
|
+
L: 2,
|
|
358
|
+
T: 2,
|
|
359
|
+
H: 1,
|
|
360
|
+
V: 1,
|
|
361
|
+
C: 6,
|
|
362
|
+
S: 4,
|
|
363
|
+
Q: 4,
|
|
364
|
+
A: 7
|
|
365
|
+
};
|
|
366
|
+
do {
|
|
367
|
+
const k = arity[up];
|
|
368
|
+
const a = [];
|
|
369
|
+
for (let j = 0; j < k; j++) {
|
|
370
|
+
const v = up === "A" && (j === 3 || j === 4) ? flagAt() : numAt();
|
|
371
|
+
if (v === null) return null;
|
|
372
|
+
a.push(v);
|
|
373
|
+
}
|
|
374
|
+
const ox = rel ? cx : 0;
|
|
375
|
+
const oy = rel ? cy : 0;
|
|
376
|
+
if (up === "H") {
|
|
377
|
+
cx = a[0] + ox;
|
|
378
|
+
} else if (up === "V") {
|
|
379
|
+
cy = a[0] + oy;
|
|
380
|
+
} else if (up === "A") {
|
|
381
|
+
const x2 = a[5] + ox;
|
|
382
|
+
const y2 = a[6] + oy;
|
|
383
|
+
arcExtent(cx, cy, a[0], a[1], a[2], a[3], a[4], x2, y2, add);
|
|
384
|
+
cx = x2;
|
|
385
|
+
cy = y2;
|
|
386
|
+
} else {
|
|
387
|
+
for (let j = 0; j + 1 < k; j += 2) add(a[j] + ox, a[j + 1] + oy);
|
|
388
|
+
cx = a[k - 2] + ox;
|
|
389
|
+
cy = a[k - 1] + oy;
|
|
390
|
+
}
|
|
391
|
+
add(cx, cy);
|
|
392
|
+
if (up === "M") {
|
|
393
|
+
sx = cx;
|
|
394
|
+
sy = cy;
|
|
395
|
+
}
|
|
396
|
+
} while (moreNumbers());
|
|
397
|
+
if (cmd === "M") cmd = "L";
|
|
398
|
+
else if (cmd === "m") cmd = "l";
|
|
399
|
+
}
|
|
400
|
+
return box.x0 <= box.x1 ? box : null;
|
|
401
|
+
}
|
|
402
|
+
function arcExtent(x1, y1, rxIn, ryIn, rotDeg, large, sweep, x2, y2, add) {
|
|
403
|
+
let rx = Math.abs(rxIn);
|
|
404
|
+
let ry = Math.abs(ryIn);
|
|
405
|
+
if (rx === 0 || ry === 0 || x1 === x2 && y1 === y2) return;
|
|
406
|
+
const phi = rotDeg * Math.PI / 180;
|
|
407
|
+
const cos = Math.cos(phi);
|
|
408
|
+
const sin = Math.sin(phi);
|
|
409
|
+
const dx = (x1 - x2) / 2;
|
|
410
|
+
const dy = (y1 - y2) / 2;
|
|
411
|
+
const xp = cos * dx + sin * dy;
|
|
412
|
+
const yp = -sin * dx + cos * dy;
|
|
413
|
+
const lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);
|
|
414
|
+
if (lambda > 1) {
|
|
415
|
+
rx *= Math.sqrt(lambda);
|
|
416
|
+
ry *= Math.sqrt(lambda);
|
|
417
|
+
}
|
|
418
|
+
const num = rx * rx * ry * ry - rx * rx * yp * yp - ry * ry * xp * xp;
|
|
419
|
+
const den = rx * rx * yp * yp + ry * ry * xp * xp;
|
|
420
|
+
const factor = (large === sweep ? -1 : 1) * Math.sqrt(Math.max(0, num / den || 0));
|
|
421
|
+
const cxp = factor * rx * yp / ry;
|
|
422
|
+
const cyp = -factor * ry * xp / rx;
|
|
423
|
+
const ccx = cos * cxp - sin * cyp + (x1 + x2) / 2;
|
|
424
|
+
const ccy = sin * cxp + cos * cyp + (y1 + y2) / 2;
|
|
425
|
+
const r = Math.max(rx, ry);
|
|
426
|
+
add(ccx - r, ccy - r);
|
|
427
|
+
add(ccx + r, ccy + r);
|
|
428
|
+
}
|
|
429
|
+
function attrOf(attrs, name) {
|
|
430
|
+
const m = new RegExp(`(?:^|\\s)${name}\\s*=\\s*("([^"]*)"|'([^']*)')`).exec(
|
|
431
|
+
attrs
|
|
432
|
+
);
|
|
433
|
+
return m ? m[2] ?? m[3] ?? "" : null;
|
|
434
|
+
}
|
|
435
|
+
function styleOf(attrs, prop2) {
|
|
436
|
+
const style = attrOf(attrs, "style");
|
|
437
|
+
if (!style) return null;
|
|
438
|
+
const m = new RegExp(`(?:^|;)\\s*${prop2}\\s*:\\s*([^;]+)`, "i").exec(style);
|
|
439
|
+
return m ? m[1].trim() : null;
|
|
440
|
+
}
|
|
441
|
+
function prop(attrs, name) {
|
|
442
|
+
return styleOf(attrs, name) ?? attrOf(attrs, name);
|
|
443
|
+
}
|
|
444
|
+
function lengthOf(v, basis, fontSize) {
|
|
445
|
+
if (v === null) return null;
|
|
446
|
+
const m = /^\s*([-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?)\s*(px|em|%|pt)?/.exec(v);
|
|
447
|
+
if (!m) return null;
|
|
448
|
+
const n = Number(m[1]);
|
|
449
|
+
switch (m[2]) {
|
|
450
|
+
case "em":
|
|
451
|
+
return n * fontSize;
|
|
452
|
+
case "%":
|
|
453
|
+
return n / 100 * basis;
|
|
454
|
+
case "pt":
|
|
455
|
+
return n * 4 / 3;
|
|
456
|
+
default:
|
|
457
|
+
return n;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
function firstLength(v, basis, fontSize) {
|
|
461
|
+
if (v === null) return null;
|
|
462
|
+
return lengthOf(v.trim().split(/[\s,]+/)[0] ?? "", basis, fontSize);
|
|
463
|
+
}
|
|
464
|
+
function verticalEm(baseline) {
|
|
465
|
+
switch (baseline) {
|
|
466
|
+
case "middle":
|
|
467
|
+
case "central":
|
|
468
|
+
case "mathematical":
|
|
469
|
+
return [0.65, 0.65];
|
|
470
|
+
case "hanging":
|
|
471
|
+
case "text-before-edge":
|
|
472
|
+
case "before-edge":
|
|
473
|
+
return [0.1, 1.25];
|
|
474
|
+
case "text-after-edge":
|
|
475
|
+
case "after-edge":
|
|
476
|
+
case "ideographic":
|
|
477
|
+
return [1.3, 0.1];
|
|
478
|
+
case "auto":
|
|
479
|
+
case "alphabetic":
|
|
480
|
+
case "baseline":
|
|
481
|
+
case "":
|
|
482
|
+
return [1, 0.3];
|
|
483
|
+
default:
|
|
484
|
+
return [1.3, 1.25];
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
var SHAPES = /* @__PURE__ */ new Set([
|
|
488
|
+
"rect",
|
|
489
|
+
"circle",
|
|
490
|
+
"ellipse",
|
|
491
|
+
"line",
|
|
492
|
+
"polygon",
|
|
493
|
+
"polyline",
|
|
494
|
+
"path"
|
|
495
|
+
]);
|
|
496
|
+
var NO_PAINT = /^(?:none|transparent)$/i;
|
|
497
|
+
function zero(v) {
|
|
498
|
+
return v !== null && Number(v) === 0;
|
|
499
|
+
}
|
|
500
|
+
function paintsNothing(attrs, frame) {
|
|
501
|
+
if (zero(prop(attrs, "opacity"))) return true;
|
|
502
|
+
const fill = prop(attrs, "fill");
|
|
503
|
+
const noFill = frame.tag === "line" || fill !== null && NO_PAINT.test(fill.trim()) || zero(prop(attrs, "fill-opacity"));
|
|
504
|
+
const noStroke = frame.stroke === null || NO_PAINT.test(frame.stroke.trim()) || zero(prop(attrs, "stroke-opacity")) || frame.strokeW === 0;
|
|
505
|
+
return noFill && noStroke;
|
|
506
|
+
}
|
|
507
|
+
function cssCanSetPaint(svg) {
|
|
508
|
+
for (const m of svg.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/g)) {
|
|
509
|
+
let css = m[1];
|
|
510
|
+
for (; ; ) {
|
|
511
|
+
const at = css.search(/@media\s*\(\s*hover\s*:\s*hover\s*\)\s*\{/);
|
|
512
|
+
if (at < 0) break;
|
|
513
|
+
let i = css.indexOf("{", at) + 1;
|
|
514
|
+
for (let depth = 1; i < css.length && depth > 0; i++) {
|
|
515
|
+
if (css[i] === "{") depth++;
|
|
516
|
+
else if (css[i] === "}") depth--;
|
|
517
|
+
}
|
|
518
|
+
css = css.slice(0, at) + css.slice(i);
|
|
519
|
+
}
|
|
520
|
+
for (const r of css.matchAll(/([^{}]*)\{([^{}]*)\}/g)) {
|
|
521
|
+
if (r[1].includes(":hover")) continue;
|
|
522
|
+
if (/(?:^|[;\s])(?:fill|stroke|opacity|fill-opacity|stroke-opacity)\s*:/.test(
|
|
523
|
+
r[2]
|
|
524
|
+
))
|
|
525
|
+
return true;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
return false;
|
|
529
|
+
}
|
|
530
|
+
function decodeText(raw) {
|
|
531
|
+
return raw.replace(/&(?:#\d+|#x[0-9a-f]+|[a-z]+);/gi, "M").replace(/\s+/g, " ");
|
|
532
|
+
}
|
|
533
|
+
function measureSvgContent(svg) {
|
|
534
|
+
const canvas = readViewBox(svg);
|
|
535
|
+
const cw = canvas?.width ?? 0;
|
|
536
|
+
const ch = canvas?.height ?? 0;
|
|
537
|
+
const out = { x0: Infinity, y0: Infinity, x1: -Infinity, y1: -Infinity };
|
|
538
|
+
let complete = true;
|
|
539
|
+
const addBox = (m, b, inflate) => {
|
|
540
|
+
const xs = [b.x0 - inflate, b.x1 + inflate];
|
|
541
|
+
const ys = [b.y0 - inflate, b.y1 + inflate];
|
|
542
|
+
for (const x of xs)
|
|
543
|
+
for (const y of ys) {
|
|
544
|
+
const tx = m[0] * x + m[2] * y + m[4];
|
|
545
|
+
const ty = m[1] * x + m[3] * y + m[5];
|
|
546
|
+
if (!Number.isFinite(tx) || !Number.isFinite(ty)) {
|
|
547
|
+
complete = false;
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
if (tx < out.x0) out.x0 = tx;
|
|
551
|
+
if (tx > out.x1) out.x1 = tx;
|
|
552
|
+
if (ty < out.y0) out.y0 = ty;
|
|
553
|
+
if (ty > out.y1) out.y1 = ty;
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
const pathsById = /* @__PURE__ */ new Map();
|
|
557
|
+
for (const m of svg.matchAll(/<path\b([^>]*)>/g)) {
|
|
558
|
+
const id = attrOf(m[1], "id");
|
|
559
|
+
const d = attrOf(m[1], "d");
|
|
560
|
+
if (id && d) pathsById.set(id, d);
|
|
561
|
+
}
|
|
562
|
+
const trustNoPaint = !cssCanSetPaint(svg);
|
|
563
|
+
const stack = [];
|
|
564
|
+
let text = null;
|
|
565
|
+
const flushChunk = () => {
|
|
566
|
+
if (!text || text.pieces.length === 0) return;
|
|
567
|
+
const right = Math.max(...text.pieces.map((p) => p.x1));
|
|
568
|
+
const w = right - text.chunkX;
|
|
569
|
+
const shift = text.chunkAnchor === "middle" ? -w / 2 : text.chunkAnchor === "end" ? -w : 0;
|
|
570
|
+
for (const p of text.pieces) {
|
|
571
|
+
const [up, down] = verticalEm(p.baseline);
|
|
572
|
+
addBox(
|
|
573
|
+
text.m,
|
|
574
|
+
{
|
|
575
|
+
x0: p.x0 + shift,
|
|
576
|
+
x1: p.x1 + shift,
|
|
577
|
+
y0: p.y - up * p.fontSize,
|
|
578
|
+
y1: p.y + down * p.fontSize
|
|
579
|
+
},
|
|
580
|
+
0
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
text.pieces = [];
|
|
584
|
+
};
|
|
585
|
+
const tagRe = /<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<[?!][^>]*>|<(\/?)([A-Za-z][\w:.-]*)((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>|([^<]+)/g;
|
|
586
|
+
for (const t of svg.matchAll(tagRe)) {
|
|
587
|
+
const [, close, rawName, attrs = "", selfClose, chars] = t;
|
|
588
|
+
const parent = stack[stack.length - 1];
|
|
589
|
+
if (chars !== void 0) {
|
|
590
|
+
if (!text || !parent || parent.skip) continue;
|
|
591
|
+
const s = decodeText(chars);
|
|
592
|
+
if (s.trim() === "") continue;
|
|
593
|
+
const fs = parent.fontSize;
|
|
594
|
+
let w = measureText(s, fs, { bold: parent.bold }) * TEXT_WIDTH_SAFETY;
|
|
595
|
+
if (parent.mono) w = Math.max(w, s.length * fs * 0.62);
|
|
596
|
+
text.pieces.push({
|
|
597
|
+
x0: text.curX,
|
|
598
|
+
x1: text.curX + w,
|
|
599
|
+
y: text.curY,
|
|
600
|
+
fontSize: fs,
|
|
601
|
+
baseline: parent.baseline
|
|
602
|
+
});
|
|
603
|
+
text.curX += w;
|
|
604
|
+
continue;
|
|
605
|
+
}
|
|
606
|
+
if (rawName === void 0) continue;
|
|
607
|
+
const name = rawName.toLowerCase();
|
|
608
|
+
if (close) {
|
|
609
|
+
for (let k = stack.length - 1; k >= 0; k--) {
|
|
610
|
+
if (stack[k].tag === name) {
|
|
611
|
+
stack.length = k;
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
if (name === "text" && text) {
|
|
616
|
+
flushChunk();
|
|
617
|
+
text = null;
|
|
618
|
+
}
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
const isRoot = stack.length === 0;
|
|
622
|
+
const base = parent ?? {
|
|
623
|
+
tag: "",
|
|
624
|
+
m: IDENTITY,
|
|
625
|
+
fontSize: DEFAULT_FONT_SIZE,
|
|
626
|
+
anchor: "start",
|
|
627
|
+
baseline: "",
|
|
628
|
+
bold: false,
|
|
629
|
+
mono: false,
|
|
630
|
+
strokeW: 1,
|
|
631
|
+
stroke: null,
|
|
632
|
+
skip: false
|
|
633
|
+
};
|
|
634
|
+
const skip = base.skip || NON_RENDERING.has(name);
|
|
635
|
+
let m = base.m;
|
|
636
|
+
if (!skip) {
|
|
637
|
+
if (/(?:^|[;\s"])transform\s*:/i.test(attrOf(attrs, "style") ?? "")) {
|
|
638
|
+
complete = false;
|
|
639
|
+
}
|
|
640
|
+
const tr = attrOf(attrs, "transform");
|
|
641
|
+
if (tr !== null && !isRoot) {
|
|
642
|
+
const local = parseTransform(tr);
|
|
643
|
+
if (local === null) complete = false;
|
|
644
|
+
else m = multiply(m, local);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
const fsRaw = prop(attrs, "font-size");
|
|
648
|
+
let fontSize = base.fontSize;
|
|
649
|
+
if (fsRaw !== null) {
|
|
650
|
+
const v = lengthOf(fsRaw, base.fontSize, base.fontSize);
|
|
651
|
+
fontSize = v !== null && v > 0 ? v : base.fontSize * 2;
|
|
652
|
+
}
|
|
653
|
+
const weight = prop(attrs, "font-weight");
|
|
654
|
+
const family = prop(attrs, "font-family");
|
|
655
|
+
const sw = lengthOf(prop(attrs, "stroke-width"), 1, fontSize);
|
|
656
|
+
const frame = {
|
|
657
|
+
tag: name,
|
|
658
|
+
m,
|
|
659
|
+
fontSize,
|
|
660
|
+
anchor: prop(attrs, "text-anchor") ?? base.anchor,
|
|
661
|
+
baseline: prop(attrs, "dominant-baseline") ?? prop(attrs, "alignment-baseline") ?? base.baseline,
|
|
662
|
+
bold: weight !== null ? /bold|bolder|[6-9]00/.test(weight) : base.bold,
|
|
663
|
+
mono: family !== null ? /mono|courier/i.test(family) : base.mono,
|
|
664
|
+
strokeW: sw !== null && sw >= 0 ? sw : base.strokeW,
|
|
665
|
+
stroke: prop(attrs, "stroke") ?? base.stroke,
|
|
666
|
+
skip
|
|
667
|
+
};
|
|
668
|
+
if (trustNoPaint && !skip && !isRoot && SHAPES.has(name) && paintsNothing(attrs, frame)) {
|
|
669
|
+
} else if (!skip && !isRoot) {
|
|
670
|
+
const num = (k, basis) => lengthOf(attrOf(attrs, k), basis, fontSize);
|
|
671
|
+
const inflate = frame.strokeW / 2 + (/marker-(?:start|mid|end)/.test(attrs) ? MARKER_ALLOWANCE : 0);
|
|
672
|
+
switch (name) {
|
|
673
|
+
case "rect":
|
|
674
|
+
case "image":
|
|
675
|
+
case "foreignobject":
|
|
676
|
+
case "svg": {
|
|
677
|
+
const cls = attrOf(attrs, "class") ?? "";
|
|
678
|
+
if (name === "rect" && /\bdgmo-canvas-bg\b/.test(cls)) break;
|
|
679
|
+
const x = num("x", cw) ?? 0;
|
|
680
|
+
const y = num("y", ch) ?? 0;
|
|
681
|
+
const w = num("width", cw);
|
|
682
|
+
const h = num("height", ch);
|
|
683
|
+
if (w === null || h === null) {
|
|
684
|
+
if (name !== "rect") complete = false;
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
addBox(m, { x0: x, y0: y, x1: x + w, y1: y + h }, inflate);
|
|
688
|
+
if (name === "svg") frame.skip = true;
|
|
689
|
+
break;
|
|
690
|
+
}
|
|
691
|
+
case "circle":
|
|
692
|
+
case "ellipse": {
|
|
693
|
+
const cx = num("cx", cw) ?? 0;
|
|
694
|
+
const cy = num("cy", ch) ?? 0;
|
|
695
|
+
const rx = name === "circle" ? num("r", cw) : num("rx", cw);
|
|
696
|
+
const ry = name === "circle" ? rx : num("ry", ch);
|
|
697
|
+
if (rx === null || ry === null) break;
|
|
698
|
+
addBox(
|
|
699
|
+
m,
|
|
700
|
+
{ x0: cx - rx, y0: cy - ry, x1: cx + rx, y1: cy + ry },
|
|
701
|
+
inflate
|
|
702
|
+
);
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
case "line": {
|
|
706
|
+
const x1 = num("x1", cw) ?? 0;
|
|
707
|
+
const y1 = num("y1", ch) ?? 0;
|
|
708
|
+
const x2 = num("x2", cw) ?? 0;
|
|
709
|
+
const y2 = num("y2", ch) ?? 0;
|
|
710
|
+
addBox(
|
|
711
|
+
m,
|
|
712
|
+
{
|
|
713
|
+
x0: Math.min(x1, x2),
|
|
714
|
+
y0: Math.min(y1, y2),
|
|
715
|
+
x1: Math.max(x1, x2),
|
|
716
|
+
y1: Math.max(y1, y2)
|
|
717
|
+
},
|
|
718
|
+
inflate
|
|
719
|
+
);
|
|
720
|
+
break;
|
|
721
|
+
}
|
|
722
|
+
case "polygon":
|
|
723
|
+
case "polyline": {
|
|
724
|
+
const p = nums(attrOf(attrs, "points") ?? "");
|
|
725
|
+
if (p.length < 2) break;
|
|
726
|
+
const b = {
|
|
727
|
+
x0: Infinity,
|
|
728
|
+
y0: Infinity,
|
|
729
|
+
x1: -Infinity,
|
|
730
|
+
y1: -Infinity
|
|
731
|
+
};
|
|
732
|
+
for (let k = 0; k + 1 < p.length; k += 2) {
|
|
733
|
+
b.x0 = Math.min(b.x0, p[k]);
|
|
734
|
+
b.x1 = Math.max(b.x1, p[k]);
|
|
735
|
+
b.y0 = Math.min(b.y0, p[k + 1]);
|
|
736
|
+
b.y1 = Math.max(b.y1, p[k + 1]);
|
|
737
|
+
}
|
|
738
|
+
addBox(m, b, inflate);
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
741
|
+
case "path": {
|
|
742
|
+
const d = attrOf(attrs, "d");
|
|
743
|
+
if (!d || d.trim() === "" || d.trim().toLowerCase() === "none") break;
|
|
744
|
+
const b = pathBox(d);
|
|
745
|
+
if (b === null) complete = false;
|
|
746
|
+
else addBox(m, b, inflate);
|
|
747
|
+
break;
|
|
748
|
+
}
|
|
749
|
+
case "use":
|
|
750
|
+
complete = false;
|
|
751
|
+
break;
|
|
752
|
+
case "text": {
|
|
753
|
+
flushChunk();
|
|
754
|
+
const x = firstLength(attrOf(attrs, "x"), cw, fontSize) ?? 0;
|
|
755
|
+
const y = firstLength(attrOf(attrs, "y"), ch, fontSize) ?? 0;
|
|
756
|
+
const dx = firstLength(attrOf(attrs, "dx"), cw, fontSize) ?? 0;
|
|
757
|
+
const dy = firstLength(attrOf(attrs, "dy"), ch, fontSize) ?? 0;
|
|
758
|
+
text = {
|
|
759
|
+
m,
|
|
760
|
+
curX: x + dx,
|
|
761
|
+
curY: y + dy,
|
|
762
|
+
chunkX: x + dx,
|
|
763
|
+
chunkAnchor: frame.anchor,
|
|
764
|
+
pieces: []
|
|
765
|
+
};
|
|
766
|
+
break;
|
|
767
|
+
}
|
|
768
|
+
case "tspan": {
|
|
769
|
+
if (!text) break;
|
|
770
|
+
const x = firstLength(attrOf(attrs, "x"), cw, fontSize);
|
|
771
|
+
const y = firstLength(attrOf(attrs, "y"), ch, fontSize);
|
|
772
|
+
const dx = firstLength(attrOf(attrs, "dx"), cw, fontSize) ?? 0;
|
|
773
|
+
const dy = firstLength(attrOf(attrs, "dy"), ch, fontSize) ?? 0;
|
|
774
|
+
if (x !== null || y !== null) {
|
|
775
|
+
flushChunk();
|
|
776
|
+
if (x !== null) text.curX = x;
|
|
777
|
+
if (y !== null) text.curY = y;
|
|
778
|
+
text.curX += dx;
|
|
779
|
+
text.curY += dy;
|
|
780
|
+
text.chunkX = text.curX;
|
|
781
|
+
text.chunkAnchor = frame.anchor;
|
|
782
|
+
} else {
|
|
783
|
+
text.curX += dx;
|
|
784
|
+
text.curY += dy;
|
|
785
|
+
}
|
|
786
|
+
break;
|
|
787
|
+
}
|
|
788
|
+
case "textpath": {
|
|
789
|
+
if (!text) break;
|
|
790
|
+
const href = (attrOf(attrs, "href") ?? attrOf(attrs, "xlink:href") ?? "").replace(/^#/, "");
|
|
791
|
+
const d = pathsById.get(href);
|
|
792
|
+
const b = d ? pathBox(d) : null;
|
|
793
|
+
if (b === null) complete = false;
|
|
794
|
+
else addBox(text.m, b, fontSize * 1.3);
|
|
795
|
+
frame.skip = true;
|
|
796
|
+
break;
|
|
797
|
+
}
|
|
798
|
+
default:
|
|
799
|
+
break;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
if (!selfClose) stack.push(frame);
|
|
803
|
+
else if (name === "text") {
|
|
804
|
+
flushChunk();
|
|
805
|
+
text = null;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
const box = out.x0 <= out.x1 && out.y0 <= out.y1 ? out : null;
|
|
809
|
+
return { box, complete };
|
|
810
|
+
}
|
|
811
|
+
function fmt(n) {
|
|
812
|
+
return String(Math.round(n * 1e3) / 1e3);
|
|
813
|
+
}
|
|
814
|
+
function setRootAttr(root, name, value) {
|
|
815
|
+
const re = new RegExp(`(\\s${name}=)"[^"]*"`);
|
|
816
|
+
return re.test(root) ? root.replace(re, `$1"${value}"`) : root.replace(/^<svg\b/, `<svg ${name}="${value}"`);
|
|
817
|
+
}
|
|
818
|
+
function fitSvgToContent(svg, opts = {}) {
|
|
819
|
+
const rootMatch = /<svg\b(?:[^>"']|"[^"]*"|'[^']*')*>/.exec(svg);
|
|
820
|
+
if (!rootMatch) return svg;
|
|
821
|
+
const root = rootMatch[0];
|
|
822
|
+
if (/\sdata-export-(?:width|height)=/.test(root)) return svg;
|
|
823
|
+
const canvas = readViewBox(svg);
|
|
824
|
+
if (!canvas) return svg;
|
|
825
|
+
const { box, complete } = measureSvgContent(svg);
|
|
826
|
+
if (!complete || !box) return svg;
|
|
827
|
+
const cx0 = canvas.x;
|
|
828
|
+
const cy0 = canvas.y;
|
|
829
|
+
const cx1 = canvas.x + canvas.width;
|
|
830
|
+
const cy1 = canvas.y + canvas.height;
|
|
831
|
+
let x0 = Math.max(cx0, Math.floor(box.x0 - EXPORT_FIT_PAD));
|
|
832
|
+
let x1 = Math.min(cx1, Math.ceil(box.x1 + EXPORT_FIT_PAD));
|
|
833
|
+
let y0 = Math.max(cy0, Math.floor(box.y0 - EXPORT_FIT_PAD));
|
|
834
|
+
let y1 = Math.min(cy1, Math.ceil(box.y1 + EXPORT_FIT_PAD));
|
|
835
|
+
if (x1 <= x0 || y1 <= y0) return svg;
|
|
836
|
+
const minW = Math.min(canvas.width, MIN_CANVAS_WIDTH);
|
|
837
|
+
if (x1 - x0 < minW) {
|
|
838
|
+
const grow = minW - (x1 - x0);
|
|
839
|
+
x0 = Math.max(cx0, x0 - Math.floor(grow / 2));
|
|
840
|
+
x1 = x0 + minW;
|
|
841
|
+
if (x1 > cx1) {
|
|
842
|
+
x1 = cx1;
|
|
843
|
+
x0 = cx1 - minW;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
const trimX = canvas.width - (x1 - x0) >= EXPORT_FIT_MIN_TRIM;
|
|
847
|
+
const trimY = canvas.height - (y1 - y0) >= EXPORT_FIT_MIN_TRIM;
|
|
848
|
+
if (!trimX && !trimY) return svg;
|
|
849
|
+
if (!trimX) {
|
|
850
|
+
x0 = cx0;
|
|
851
|
+
x1 = cx1;
|
|
852
|
+
}
|
|
853
|
+
if (!trimY) {
|
|
854
|
+
y0 = cy0;
|
|
855
|
+
y1 = cy1;
|
|
856
|
+
}
|
|
857
|
+
const w = x1 - x0;
|
|
858
|
+
const h = y1 - y0;
|
|
859
|
+
const rootW = Number(attrOf(root.slice(4), "width"));
|
|
860
|
+
const rootH = Number(attrOf(root.slice(4), "height"));
|
|
861
|
+
const sx = rootW > 0 ? rootW / canvas.width : 1;
|
|
862
|
+
const sy = rootH > 0 ? rootH / canvas.height : 1;
|
|
863
|
+
let outW = w * sx;
|
|
864
|
+
let outH = h * sy;
|
|
865
|
+
const scales = [];
|
|
866
|
+
if (opts.width && opts.width > 0 && Math.abs(rootW - opts.width) <= 1)
|
|
867
|
+
scales.push(opts.width / w);
|
|
868
|
+
if (opts.height && opts.height > 0 && Math.abs(rootH - opts.height) <= 1)
|
|
869
|
+
scales.push(opts.height / h);
|
|
870
|
+
if (scales.length > 0) {
|
|
871
|
+
const s = Math.min(...scales);
|
|
872
|
+
outW = w * s;
|
|
873
|
+
outH = h * s;
|
|
874
|
+
}
|
|
875
|
+
let newRoot = setRootAttr(root, "viewBox", `${x0} ${y0} ${w} ${h}`);
|
|
876
|
+
if (rootW > 0) newRoot = setRootAttr(newRoot, "width", fmt(outW));
|
|
877
|
+
if (rootH > 0) newRoot = setRootAttr(newRoot, "height", fmt(outH));
|
|
878
|
+
if (trimY) newRoot = newRoot.replace(/\sdata-content-height="[^"]*"/, "");
|
|
879
|
+
const body = svg.slice(rootMatch.index + root.length).replace(
|
|
880
|
+
/<rect\b[^>]*\bclass="[^"]*\bdgmo-canvas-bg\b[^"]*"[^>]*>/g,
|
|
881
|
+
(r) => r.replace(/(\sx=)"[^"]*"/, `$1"${x0}"`).replace(/(\sy=)"[^"]*"/, `$1"${y0}"`).replace(/(\swidth=)"[^"]*"/, `$1"${w}"`).replace(/(\sheight=)"[^"]*"/, `$1"${h}"`)
|
|
882
|
+
);
|
|
883
|
+
return svg.slice(0, rootMatch.index) + newRoot + body;
|
|
884
|
+
}
|
|
885
|
+
|
|
203
886
|
// src/arc/renderer.ts
|
|
204
887
|
import * as d3Scale from "d3-scale";
|
|
205
888
|
import * as d3Selection from "d3-selection";
|
|
@@ -2084,8 +2767,8 @@ async function exportArc(ctx) {
|
|
|
2084
2767
|
// src/block/export.ts
|
|
2085
2768
|
async function exportBlock(ctx) {
|
|
2086
2769
|
const { content, theme, palette } = ctx;
|
|
2087
|
-
const { parseBlock: parseBlock2 } = await import("./parser-
|
|
2088
|
-
const { renderBlockForExport } = await import("./renderer-
|
|
2770
|
+
const { parseBlock: parseBlock2 } = await import("./parser-BNRX35NT.js");
|
|
2771
|
+
const { renderBlockForExport } = await import("./renderer-N75E3UVY.js");
|
|
2089
2772
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2090
2773
|
const blockParsed = parseBlock2(content, effectivePalette);
|
|
2091
2774
|
if (blockParsed.error || blockParsed.top.rows.length === 0) return "";
|
|
@@ -2100,8 +2783,8 @@ async function exportBlock(ctx) {
|
|
|
2100
2783
|
// src/body/export.ts
|
|
2101
2784
|
async function exportBody(ctx) {
|
|
2102
2785
|
const { content, theme, palette } = ctx;
|
|
2103
|
-
const { parseBody: parseBody2 } = await import("./parser-
|
|
2104
|
-
const { renderBodyForExport } = await import("./renderer-
|
|
2786
|
+
const { parseBody: parseBody2 } = await import("./parser-HM6FEX5K.js");
|
|
2787
|
+
const { renderBodyForExport } = await import("./renderer-6HU44IGJ.js");
|
|
2105
2788
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2106
2789
|
const parsed = parseBody2(content, effectivePalette);
|
|
2107
2790
|
if (parsed.error) return "";
|
|
@@ -2120,7 +2803,7 @@ async function exportBody(ctx) {
|
|
|
2120
2803
|
// src/boxes-and-lines/export.ts
|
|
2121
2804
|
async function exportBoxesAndLines(ctx) {
|
|
2122
2805
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2123
|
-
const { parseBoxesAndLines: parseBoxesAndLines2 } = await import("./parser-
|
|
2806
|
+
const { parseBoxesAndLines: parseBoxesAndLines2 } = await import("./parser-ZV756RMP.js");
|
|
2124
2807
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2125
2808
|
const blParsed = parseBoxesAndLines2(content, effectivePalette);
|
|
2126
2809
|
if (blParsed.error || blParsed.nodes.length === 0) return "";
|
|
@@ -2131,8 +2814,8 @@ async function exportBoxesAndLines(ctx) {
|
|
|
2131
2814
|
blHiddenTagValues.set(k, new Set(v));
|
|
2132
2815
|
}
|
|
2133
2816
|
}
|
|
2134
|
-
const { renderBoxesAndLinesForExport } = await import("./renderer-
|
|
2135
|
-
const { layoutBoxesAndLines } = await import("./layout-
|
|
2817
|
+
const { renderBoxesAndLinesForExport } = await import("./renderer-TS5NHOQD.js");
|
|
2818
|
+
const { layoutBoxesAndLines } = await import("./layout-AF4KA5B2.js");
|
|
2136
2819
|
const blLayout = await layoutBoxesAndLines(blParsed);
|
|
2137
2820
|
const PADDING = 20;
|
|
2138
2821
|
const titleOffset = blParsed.title ? 40 : 0;
|
|
@@ -2163,8 +2846,8 @@ async function exportBoxesAndLines(ctx) {
|
|
|
2163
2846
|
// src/bracket/export.ts
|
|
2164
2847
|
async function exportBracket(ctx) {
|
|
2165
2848
|
const { content, theme, palette } = ctx;
|
|
2166
|
-
const { parseBracket: parseBracket2 } = await import("./parser-
|
|
2167
|
-
const { renderBracketForExport, bracketExportDimensions } = await import("./renderer-
|
|
2849
|
+
const { parseBracket: parseBracket2 } = await import("./parser-GBQY3WOZ.js");
|
|
2850
|
+
const { renderBracketForExport, bracketExportDimensions } = await import("./renderer-LJPUCG3U.js");
|
|
2168
2851
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2169
2852
|
const parsed = parseBracket2(content, effectivePalette);
|
|
2170
2853
|
if (parsed.error) return "";
|
|
@@ -2180,14 +2863,14 @@ async function exportBracket(ctx) {
|
|
|
2180
2863
|
// src/c4/export.ts
|
|
2181
2864
|
async function exportC4(ctx) {
|
|
2182
2865
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2183
|
-
const { parseC4: parseC42 } = await import("./parser-
|
|
2866
|
+
const { parseC4: parseC42 } = await import("./parser-XEJP37GQ.js");
|
|
2184
2867
|
const {
|
|
2185
2868
|
layoutC4Context,
|
|
2186
2869
|
layoutC4Containers,
|
|
2187
2870
|
layoutC4Components,
|
|
2188
2871
|
layoutC4Deployment
|
|
2189
|
-
} = await import("./layout-
|
|
2190
|
-
const { renderC4Context, renderC4Containers } = await import("./renderer-
|
|
2872
|
+
} = await import("./layout-LNVIH45F.js");
|
|
2873
|
+
const { renderC4Context, renderC4Containers } = await import("./renderer-D6EH5UQ6.js");
|
|
2191
2874
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2192
2875
|
const c4Parsed = parseC42(content, effectivePalette);
|
|
2193
2876
|
if (c4Parsed.error || c4Parsed.elements.length === 0) return "";
|
|
@@ -2223,9 +2906,9 @@ async function exportC4(ctx) {
|
|
|
2223
2906
|
// src/class/export.ts
|
|
2224
2907
|
async function exportClass(ctx) {
|
|
2225
2908
|
const { content, theme, palette, exportMode } = ctx;
|
|
2226
|
-
const { parseClassDiagram: parseClassDiagram2 } = await import("./parser-
|
|
2227
|
-
const { layoutClassDiagram } = await import("./layout-
|
|
2228
|
-
const { renderClassDiagram } = await import("./renderer-
|
|
2909
|
+
const { parseClassDiagram: parseClassDiagram2 } = await import("./parser-4GHAYZKZ.js");
|
|
2910
|
+
const { layoutClassDiagram } = await import("./layout-FCFUVCRI.js");
|
|
2911
|
+
const { renderClassDiagram } = await import("./renderer-VNUDN6F5.js");
|
|
2229
2912
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2230
2913
|
const classParsed = parseClassDiagram2(content, effectivePalette);
|
|
2231
2914
|
if (classParsed.error || classParsed.classes.length === 0) return "";
|
|
@@ -2252,7 +2935,7 @@ async function exportClass(ctx) {
|
|
|
2252
2935
|
// src/clock/export.ts
|
|
2253
2936
|
async function exportClock(ctx) {
|
|
2254
2937
|
const { content, theme, palette } = ctx;
|
|
2255
|
-
const { parseClock: parseClock2 } = await import("./parser-
|
|
2938
|
+
const { parseClock: parseClock2 } = await import("./parser-H6HT2WFQ.js");
|
|
2256
2939
|
const { renderClockForExport } = await import("./renderer-DDWDCM2K.js");
|
|
2257
2940
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2258
2941
|
const parsed = parseClock2(content, effectivePalette);
|
|
@@ -2268,7 +2951,7 @@ async function exportClock(ctx) {
|
|
|
2268
2951
|
// src/countdown/export.ts
|
|
2269
2952
|
async function exportCountdown(ctx) {
|
|
2270
2953
|
const { content, theme, palette } = ctx;
|
|
2271
|
-
const { parseCountdown: parseCountdown2 } = await import("./parser-
|
|
2954
|
+
const { parseCountdown: parseCountdown2 } = await import("./parser-OHBBDCG4.js");
|
|
2272
2955
|
const { renderCountdownForExport } = await import("./renderer-3NLDX7DQ.js");
|
|
2273
2956
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2274
2957
|
const parsed = parseCountdown2(content, effectivePalette);
|
|
@@ -2284,8 +2967,8 @@ async function exportCountdown(ctx) {
|
|
|
2284
2967
|
// src/cycle/export.ts
|
|
2285
2968
|
async function exportCycle(ctx) {
|
|
2286
2969
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2287
|
-
const { parseCycle: parseCycle2 } = await import("./parser-
|
|
2288
|
-
const { renderCycleForExport } = await import("./renderer-
|
|
2970
|
+
const { parseCycle: parseCycle2 } = await import("./parser-Y7QXD2UR.js");
|
|
2971
|
+
const { renderCycleForExport } = await import("./renderer-CVCCW7UT.js");
|
|
2289
2972
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2290
2973
|
const cycleParsed = parseCycle2(content);
|
|
2291
2974
|
if (cycleParsed.error || cycleParsed.nodes.length === 0) return "";
|
|
@@ -2305,9 +2988,9 @@ async function exportCycle(ctx) {
|
|
|
2305
2988
|
// src/er/export.ts
|
|
2306
2989
|
async function exportEr(ctx) {
|
|
2307
2990
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2308
|
-
const { parseERDiagram: parseERDiagram2 } = await import("./parser-
|
|
2309
|
-
const { layoutERDiagram } = await import("./layout-
|
|
2310
|
-
const { renderERDiagram } = await import("./renderer-
|
|
2991
|
+
const { parseERDiagram: parseERDiagram2 } = await import("./parser-QWTECQEC.js");
|
|
2992
|
+
const { layoutERDiagram } = await import("./layout-KELSNWBD.js");
|
|
2993
|
+
const { renderERDiagram } = await import("./renderer-2MCV75JQ.js");
|
|
2311
2994
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2312
2995
|
const erParsed = parseERDiagram2(content, effectivePalette);
|
|
2313
2996
|
if (erParsed.error || erParsed.tables.length === 0) return "";
|
|
@@ -2341,8 +3024,8 @@ async function exportEr(ctx) {
|
|
|
2341
3024
|
// src/event-line/export.ts
|
|
2342
3025
|
async function exportEventLine(ctx) {
|
|
2343
3026
|
const { content, theme, palette } = ctx;
|
|
2344
|
-
const { parseEventLine: parseEventLine2 } = await import("./parser-
|
|
2345
|
-
const { renderEventLineForExport } = await import("./renderer-
|
|
3027
|
+
const { parseEventLine: parseEventLine2 } = await import("./parser-L7SI3PW4.js");
|
|
3028
|
+
const { renderEventLineForExport } = await import("./renderer-VNJOZPSH.js");
|
|
2346
3029
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2347
3030
|
const parsed = parseEventLine2(content, effectivePalette);
|
|
2348
3031
|
if (parsed.error || parsed.events.length === 0) return "";
|
|
@@ -2362,9 +3045,9 @@ async function exportEventLine(ctx) {
|
|
|
2362
3045
|
// src/family/export.ts
|
|
2363
3046
|
async function exportFamily(ctx) {
|
|
2364
3047
|
const { content, theme, palette } = ctx;
|
|
2365
|
-
const { parseFamily: parseFamily2 } = await import("./parser-
|
|
3048
|
+
const { parseFamily: parseFamily2 } = await import("./parser-5RUD4A3X.js");
|
|
2366
3049
|
const { layoutFamily } = await import("./layout-3TSVAGWH.js");
|
|
2367
|
-
const { renderFamilyForExport } = await import("./renderer-
|
|
3050
|
+
const { renderFamilyForExport } = await import("./renderer-GKY55M4Z.js");
|
|
2368
3051
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2369
3052
|
const parsed = parseFamily2(content, effectivePalette);
|
|
2370
3053
|
if (parsed.error || parsed.persons.size === 0) return "";
|
|
@@ -2396,9 +3079,9 @@ async function exportFamily(ctx) {
|
|
|
2396
3079
|
// src/gantt/export.ts
|
|
2397
3080
|
async function exportGantt(ctx) {
|
|
2398
3081
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2399
|
-
const { parseGantt: parseGantt2 } = await import("./parser-
|
|
2400
|
-
const { calculateSchedule } = await import("./calculator-
|
|
2401
|
-
const { renderGantt } = await import("./renderer-
|
|
3082
|
+
const { parseGantt: parseGantt2 } = await import("./parser-MWINQNQW.js");
|
|
3083
|
+
const { calculateSchedule } = await import("./calculator-GIB7POFX.js");
|
|
3084
|
+
const { renderGantt } = await import("./renderer-VUXAAGUG.js");
|
|
2402
3085
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2403
3086
|
const ganttParsed = parseGantt2(content, effectivePalette);
|
|
2404
3087
|
const resolved = calculateSchedule(ganttParsed);
|
|
@@ -2441,8 +3124,8 @@ async function exportGantt(ctx) {
|
|
|
2441
3124
|
// src/goal/export.ts
|
|
2442
3125
|
async function exportGoal(ctx) {
|
|
2443
3126
|
const { content, theme, palette } = ctx;
|
|
2444
|
-
const { parseGoal: parseGoal2 } = await import("./parser-
|
|
2445
|
-
const { renderGoalForExport } = await import("./renderer-
|
|
3127
|
+
const { parseGoal: parseGoal2 } = await import("./parser-4BOP77CD.js");
|
|
3128
|
+
const { renderGoalForExport } = await import("./renderer-MVBAQP3M.js");
|
|
2446
3129
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2447
3130
|
const parsed = parseGoal2(content, effectivePalette);
|
|
2448
3131
|
if (parsed.error) return "";
|
|
@@ -2457,9 +3140,9 @@ async function exportGoal(ctx) {
|
|
|
2457
3140
|
// src/graph/export.ts
|
|
2458
3141
|
async function exportFlowchart(ctx) {
|
|
2459
3142
|
const { content, theme, palette } = ctx;
|
|
2460
|
-
const { parseFlowchart: parseFlowchart2 } = await import("./flowchart-parser-
|
|
2461
|
-
const { layoutGraph } = await import("./layout-
|
|
2462
|
-
const { renderFlowchart } = await import("./flowchart-renderer-
|
|
3143
|
+
const { parseFlowchart: parseFlowchart2 } = await import("./flowchart-parser-SM5LHF2D.js");
|
|
3144
|
+
const { layoutGraph } = await import("./layout-MPSH3YWE.js");
|
|
3145
|
+
const { renderFlowchart } = await import("./flowchart-renderer-PPS2GTTD.js");
|
|
2463
3146
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2464
3147
|
const fcParsed = parseFlowchart2(content, effectivePalette);
|
|
2465
3148
|
if (fcParsed.error || fcParsed.nodes.length === 0) return "";
|
|
@@ -2478,9 +3161,9 @@ async function exportFlowchart(ctx) {
|
|
|
2478
3161
|
}
|
|
2479
3162
|
async function exportState(ctx) {
|
|
2480
3163
|
const { content, theme, palette, viewState } = ctx;
|
|
2481
|
-
const { parseState: parseState2 } = await import("./state-parser-
|
|
2482
|
-
const { layoutGraph } = await import("./layout-
|
|
2483
|
-
const { renderState } = await import("./state-renderer-
|
|
3164
|
+
const { parseState: parseState2 } = await import("./state-parser-EQBBEKHR.js");
|
|
3165
|
+
const { layoutGraph } = await import("./layout-MPSH3YWE.js");
|
|
3166
|
+
const { renderState } = await import("./state-renderer-SOGZ2CNN.js");
|
|
2484
3167
|
const { collapseStateGroups } = await import("./state-collapse-SE2G4K4I.js");
|
|
2485
3168
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2486
3169
|
const stateParsed = parseState2(content, effectivePalette);
|
|
@@ -2519,10 +3202,10 @@ async function exportState(ctx) {
|
|
|
2519
3202
|
// src/infra/export.ts
|
|
2520
3203
|
async function exportInfra(ctx) {
|
|
2521
3204
|
const { content, theme, palette, viewState } = ctx;
|
|
2522
|
-
const { parseInfra: parseInfra2 } = await import("./parser-
|
|
3205
|
+
const { parseInfra: parseInfra2 } = await import("./parser-GM5B2EPW.js");
|
|
2523
3206
|
const { computeInfra } = await import("./compute-II4G44IK.js");
|
|
2524
3207
|
const { layoutInfra } = await import("./layout-2WESJYRE.js");
|
|
2525
|
-
const { renderInfra, computeInfraLegendGroups } = await import("./renderer-
|
|
3208
|
+
const { renderInfra, computeInfraLegendGroups } = await import("./renderer-SYRH3B62.js");
|
|
2526
3209
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2527
3210
|
const infraParsed = parseInfra2(content);
|
|
2528
3211
|
if (infraParsed.error || infraParsed.nodes.length === 0) return "";
|
|
@@ -2571,9 +3254,9 @@ async function exportInfra(ctx) {
|
|
|
2571
3254
|
// src/journey-map/export.ts
|
|
2572
3255
|
async function exportJourneyMap(ctx) {
|
|
2573
3256
|
const { content, theme, palette, exportMode } = ctx;
|
|
2574
|
-
const { parseJourneyMap: parseJourneyMap2 } = await import("./parser-
|
|
2575
|
-
const { renderJourneyMap } = await import("./renderer-
|
|
2576
|
-
const { layoutJourneyMap } = await import("./layout-
|
|
3257
|
+
const { parseJourneyMap: parseJourneyMap2 } = await import("./parser-BPYHIG24.js");
|
|
3258
|
+
const { renderJourneyMap } = await import("./renderer-ONENGXFQ.js");
|
|
3259
|
+
const { layoutJourneyMap } = await import("./layout-PPIVGJXD.js");
|
|
2577
3260
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2578
3261
|
const jmParsed = parseJourneyMap2(content, effectivePalette);
|
|
2579
3262
|
if (jmParsed.error || jmParsed.phases.length === 0 && jmParsed.steps.length === 0)
|
|
@@ -2595,8 +3278,8 @@ async function exportJourneyMap(ctx) {
|
|
|
2595
3278
|
// src/kanban/export.ts
|
|
2596
3279
|
async function exportKanban(ctx) {
|
|
2597
3280
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2598
|
-
const { parseKanban: parseKanban2 } = await import("./parser-
|
|
2599
|
-
const { renderKanban } = await import("./renderer-
|
|
3281
|
+
const { parseKanban: parseKanban2 } = await import("./parser-DWV2CYBS.js");
|
|
3282
|
+
const { renderKanban } = await import("./renderer-LFZKG2GR.js");
|
|
2600
3283
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2601
3284
|
const kanbanParsed = parseKanban2(content, effectivePalette);
|
|
2602
3285
|
if (kanbanParsed.error || kanbanParsed.columns.length === 0) return "";
|
|
@@ -2629,8 +3312,8 @@ async function exportKanban(ctx) {
|
|
|
2629
3312
|
// src/live-link/export.ts
|
|
2630
3313
|
async function exportLiveLink(ctx) {
|
|
2631
3314
|
const { content, theme, palette } = ctx;
|
|
2632
|
-
const { parseLiveLink: parseLiveLink2 } = await import("./parser-
|
|
2633
|
-
const { renderLiveLinkCard } = await import("./renderer-
|
|
3315
|
+
const { parseLiveLink: parseLiveLink2 } = await import("./parser-LUJX7AXO.js");
|
|
3316
|
+
const { renderLiveLinkCard } = await import("./renderer-E3334XLT.js");
|
|
2634
3317
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2635
3318
|
return renderLiveLinkCard(parseLiveLink2(content), effectivePalette, theme);
|
|
2636
3319
|
}
|
|
@@ -2647,10 +3330,10 @@ async function resolveMapDataSource(source) {
|
|
|
2647
3330
|
}
|
|
2648
3331
|
async function exportMap(ctx) {
|
|
2649
3332
|
const { content, theme, palette, options } = ctx;
|
|
2650
|
-
const { parseMap: parseMap2 } = await import("./parser-
|
|
3333
|
+
const { parseMap: parseMap2 } = await import("./parser-F75WNYMK.js");
|
|
2651
3334
|
const { resolveMap } = await import("./resolver-33K6MBCT.js");
|
|
2652
|
-
const { renderMapForExport } = await import("./renderer-
|
|
2653
|
-
const { mapExportDimensions } = await import("./dimensions-
|
|
3335
|
+
const { renderMapForExport } = await import("./renderer-YJVQT7QG.js");
|
|
3336
|
+
const { mapExportDimensions } = await import("./dimensions-DBCRBZIU.js");
|
|
2654
3337
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2655
3338
|
const mapParsed = parseMap2(content, effectivePalette);
|
|
2656
3339
|
const { data: mapData, reason } = await resolveMapDataSource(
|
|
@@ -2685,10 +3368,10 @@ async function exportMap(ctx) {
|
|
|
2685
3368
|
// src/mindmap/export.ts
|
|
2686
3369
|
async function exportMindmap(ctx) {
|
|
2687
3370
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2688
|
-
const { parseMindmap: parseMindmap2 } = await import("./parser-
|
|
2689
|
-
const { layoutMindmap } = await import("./layout-
|
|
2690
|
-
const { collapseMindmapTree } = await import("./collapse-
|
|
2691
|
-
const { renderMindmap } = await import("./renderer-
|
|
3371
|
+
const { parseMindmap: parseMindmap2 } = await import("./parser-ZWWQZ4XZ.js");
|
|
3372
|
+
const { layoutMindmap } = await import("./layout-R6G4MEO3.js");
|
|
3373
|
+
const { collapseMindmapTree } = await import("./collapse-6X5S2S3G.js");
|
|
3374
|
+
const { renderMindmap } = await import("./renderer-5AEDVLAA.js");
|
|
2692
3375
|
const isDark = ctx.isDark;
|
|
2693
3376
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2694
3377
|
const mmParsed = parseMindmap2(content, effectivePalette);
|
|
@@ -2740,10 +3423,10 @@ async function exportMindmap(ctx) {
|
|
|
2740
3423
|
// src/org/export.ts
|
|
2741
3424
|
async function exportOrg(ctx) {
|
|
2742
3425
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2743
|
-
const { parseOrg: parseOrg2, findOrgNodeIdByName } = await import("./parser-
|
|
2744
|
-
const { layoutOrg } = await import("./layout-
|
|
3426
|
+
const { parseOrg: parseOrg2, findOrgNodeIdByName } = await import("./parser-6WURFLOB.js");
|
|
3427
|
+
const { layoutOrg } = await import("./layout-3J72UULM.js");
|
|
2745
3428
|
const { collapseOrgTree, focusOrgTree, unionCollapsedOrgNodes } = await import("./collapse-VNYYXMUI.js");
|
|
2746
|
-
const { renderOrg, ancestorTrailReserve } = await import("./renderer-
|
|
3429
|
+
const { renderOrg, ancestorTrailReserve } = await import("./renderer-7C76HP5W.js");
|
|
2747
3430
|
const isDark = ctx.isDark;
|
|
2748
3431
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2749
3432
|
const orgParsed = parseOrg2(content, effectivePalette);
|
|
@@ -2806,10 +3489,10 @@ async function exportOrg(ctx) {
|
|
|
2806
3489
|
// src/pert/export.ts
|
|
2807
3490
|
async function exportPert(ctx) {
|
|
2808
3491
|
const { content, theme, palette, viewState } = ctx;
|
|
2809
|
-
const { parsePert: parsePert2 } = await import("./parser-
|
|
3492
|
+
const { parsePert: parsePert2 } = await import("./parser-F3JJNIFC.js");
|
|
2810
3493
|
const { analyzePert } = await import("./analyzer-G7PGOT3V.js");
|
|
2811
|
-
const { layoutPert } = await import("./layout-
|
|
2812
|
-
const { renderPert, measurePertAnalysisBlock } = await import("./renderer-
|
|
3494
|
+
const { layoutPert } = await import("./layout-H2KP5A6M.js");
|
|
3495
|
+
const { renderPert, measurePertAnalysisBlock } = await import("./renderer-N6PM5CSG.js");
|
|
2813
3496
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2814
3497
|
const pertParsed = parsePert2(content, { palette: effectivePalette });
|
|
2815
3498
|
if (pertParsed.error || pertParsed.activities.length === 0) return "";
|
|
@@ -2854,8 +3537,8 @@ async function exportPert(ctx) {
|
|
|
2854
3537
|
// src/pyramid/export.ts
|
|
2855
3538
|
async function exportPyramid(ctx) {
|
|
2856
3539
|
const { content, theme, palette } = ctx;
|
|
2857
|
-
const { parsePyramid: parsePyramid2 } = await import("./parser-
|
|
2858
|
-
const { renderPyramidForExport } = await import("./renderer-
|
|
3540
|
+
const { parsePyramid: parsePyramid2 } = await import("./parser-DGLKH4NT.js");
|
|
3541
|
+
const { renderPyramidForExport } = await import("./renderer-F7YGMEGQ.js");
|
|
2859
3542
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2860
3543
|
const pyramidParsed = parsePyramid2(content);
|
|
2861
3544
|
if (pyramidParsed.error || pyramidParsed.layers.length === 0) return "";
|
|
@@ -2891,8 +3574,8 @@ async function exportQuadrant(ctx) {
|
|
|
2891
3574
|
// src/raci/export.ts
|
|
2892
3575
|
async function exportRaci(ctx) {
|
|
2893
3576
|
const { content, theme, palette } = ctx;
|
|
2894
|
-
const { parseRaci: parseRaci2 } = await import("./parser-
|
|
2895
|
-
const { renderRaciForExport } = await import("./renderer-
|
|
3577
|
+
const { parseRaci: parseRaci2 } = await import("./parser-WIKXZP4X.js");
|
|
3578
|
+
const { renderRaciForExport } = await import("./renderer-5GP7YUS4.js");
|
|
2896
3579
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2897
3580
|
const raciParsed = parseRaci2(content, effectivePalette);
|
|
2898
3581
|
if (raciParsed.error) return "";
|
|
@@ -2907,8 +3590,8 @@ async function exportRaci(ctx) {
|
|
|
2907
3590
|
// src/ring/export.ts
|
|
2908
3591
|
async function exportRing(ctx) {
|
|
2909
3592
|
const { content, theme, palette } = ctx;
|
|
2910
|
-
const { parseRing: parseRing2 } = await import("./parser-
|
|
2911
|
-
const { renderRingForExport } = await import("./renderer-
|
|
3593
|
+
const { parseRing: parseRing2 } = await import("./parser-B7SCN7FG.js");
|
|
3594
|
+
const { renderRingForExport } = await import("./renderer-PEJF6R2I.js");
|
|
2912
3595
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2913
3596
|
const ringParsed = parseRing2(content);
|
|
2914
3597
|
if (ringParsed.error || ringParsed.layers.length === 0) return "";
|
|
@@ -2935,8 +3618,8 @@ async function exportVisualization(ctx) {
|
|
|
2935
3618
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2936
3619
|
const isDark = ctx.isDark;
|
|
2937
3620
|
const container = createExportContainer(ctx.width, ctx.height);
|
|
2938
|
-
const { parseSequenceDgmo: parseSequenceDgmo2 } = await import("./parser-
|
|
2939
|
-
const { renderSequenceDiagram } = await import("./renderer-
|
|
3621
|
+
const { parseSequenceDgmo: parseSequenceDgmo2 } = await import("./parser-2AXU2MHJ.js");
|
|
3622
|
+
const { renderSequenceDiagram } = await import("./renderer-66NCRXSC.js");
|
|
2940
3623
|
const seqParsed = parseSequenceDgmo2(content, effectivePalette);
|
|
2941
3624
|
if (seqParsed.error || seqParsed.participants.length === 0) return "";
|
|
2942
3625
|
const collapsedSections = viewState?.cs ? new Set(viewState.cs) : void 0;
|
|
@@ -2963,10 +3646,10 @@ async function exportVisualization(ctx) {
|
|
|
2963
3646
|
// src/sitemap/export.ts
|
|
2964
3647
|
async function exportSitemap(ctx) {
|
|
2965
3648
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2966
|
-
const { parseSitemap: parseSitemap2 } = await import("./parser-
|
|
2967
|
-
const { layoutSitemap } = await import("./layout-
|
|
3649
|
+
const { parseSitemap: parseSitemap2 } = await import("./parser-UHKROC7Z.js");
|
|
3650
|
+
const { layoutSitemap } = await import("./layout-IXQNVRBE.js");
|
|
2968
3651
|
const { collapseSitemapTree } = await import("./collapse-TCVK3RPO.js");
|
|
2969
|
-
const { renderSitemap } = await import("./renderer-
|
|
3652
|
+
const { renderSitemap } = await import("./renderer-MZIWP55B.js");
|
|
2970
3653
|
const isDark = ctx.isDark;
|
|
2971
3654
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2972
3655
|
const sitemapParsed = parseSitemap2(content, effectivePalette);
|
|
@@ -3014,42 +3697,6 @@ async function exportSitemap(ctx) {
|
|
|
3014
3697
|
return finalizeSvgExport(container, theme, effectivePalette);
|
|
3015
3698
|
}
|
|
3016
3699
|
|
|
3017
|
-
// src/sketch/export.ts
|
|
3018
|
-
async function exportSketch(ctx) {
|
|
3019
|
-
const { content, theme, viewState, exportMode } = ctx;
|
|
3020
|
-
const { parseSketch: parseSketch2 } = await import("./parser-YHDGKPZI.js");
|
|
3021
|
-
const effectivePalette = await resolveExportPalette(theme, ctx.palette);
|
|
3022
|
-
const parsed = parseSketch2(content, effectivePalette);
|
|
3023
|
-
if (parsed.error || parsed.nodes.length === 0 && parsed.boxes.length === 0) {
|
|
3024
|
-
return "";
|
|
3025
|
-
}
|
|
3026
|
-
const { layoutSketch } = await import("./layout-D4L44NRG.js");
|
|
3027
|
-
const { renderSketchForExport } = await import("./renderer-WPN2SXGT.js");
|
|
3028
|
-
const collapsedBoxes = viewState?.cg ? new Set(viewState.cg) : void 0;
|
|
3029
|
-
const skLayout = layoutSketch(parsed, {
|
|
3030
|
-
...collapsedBoxes !== void 0 && { collapsedBoxes }
|
|
3031
|
-
});
|
|
3032
|
-
const PADDING = 20;
|
|
3033
|
-
const titleOffset = parsed.title ? 40 : 0;
|
|
3034
|
-
const exportWidth = skLayout.width + PADDING * 2;
|
|
3035
|
-
const exportHeight = skLayout.height + PADDING * 2 + titleOffset;
|
|
3036
|
-
const container = createExportContainer(exportWidth, exportHeight);
|
|
3037
|
-
const skTagOverride = ctxTagOverride(ctx);
|
|
3038
|
-
renderSketchForExport(
|
|
3039
|
-
container,
|
|
3040
|
-
parsed,
|
|
3041
|
-
skLayout,
|
|
3042
|
-
effectivePalette,
|
|
3043
|
-
ctx.isDark,
|
|
3044
|
-
{
|
|
3045
|
-
...skTagOverride !== void 0 && { activeTagGroup: skTagOverride },
|
|
3046
|
-
...exportMode !== void 0 && { exportMode },
|
|
3047
|
-
...viewState?.hd !== void 0 && { hideDescriptions: viewState.hd }
|
|
3048
|
-
}
|
|
3049
|
-
);
|
|
3050
|
-
return finalizeSvgExport(container, theme, effectivePalette);
|
|
3051
|
-
}
|
|
3052
|
-
|
|
3053
3700
|
// src/slope/export.ts
|
|
3054
3701
|
async function exportSlope(ctx) {
|
|
3055
3702
|
const { content, theme, palette } = ctx;
|
|
@@ -3071,9 +3718,9 @@ async function exportSlope(ctx) {
|
|
|
3071
3718
|
// src/swimlane/export.ts
|
|
3072
3719
|
async function exportSwimlane(ctx) {
|
|
3073
3720
|
const { content, theme, palette } = ctx;
|
|
3074
|
-
const { parseSwimlane: parseSwimlane2 } = await import("./parser-
|
|
3721
|
+
const { parseSwimlane: parseSwimlane2 } = await import("./parser-W6NX3AIV.js");
|
|
3075
3722
|
const { layoutSwimlane } = await import("./layout-VDCJOZSH.js");
|
|
3076
|
-
const { renderSwimlaneForExport } = await import("./renderer-
|
|
3723
|
+
const { renderSwimlaneForExport } = await import("./renderer-MGF2NNGG.js");
|
|
3077
3724
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3078
3725
|
const swimParsed = parseSwimlane2(content, effectivePalette);
|
|
3079
3726
|
if (swimParsed.error || swimParsed.nodes.length === 0) return "";
|
|
@@ -3105,8 +3752,8 @@ async function exportSwimlane(ctx) {
|
|
|
3105
3752
|
// src/tech-radar/export.ts
|
|
3106
3753
|
async function exportTechRadar(ctx) {
|
|
3107
3754
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
3108
|
-
const { parseTechRadar: parseTechRadar2 } = await import("./parser-
|
|
3109
|
-
const { renderTechRadarForExport } = await import("./renderer-
|
|
3755
|
+
const { parseTechRadar: parseTechRadar2 } = await import("./parser-CRJYLOHA.js");
|
|
3756
|
+
const { renderTechRadarForExport } = await import("./renderer-2V2XY2V7.js");
|
|
3110
3757
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3111
3758
|
const radarParsed = parseTechRadar2(content);
|
|
3112
3759
|
if (radarParsed.error || radarParsed.quadrants.length === 0) return "";
|
|
@@ -3157,14 +3804,14 @@ async function exportTimeline(ctx) {
|
|
|
3157
3804
|
// src/treemap/export.ts
|
|
3158
3805
|
async function exportTreemap(ctx) {
|
|
3159
3806
|
const { content, theme, palette } = ctx;
|
|
3160
|
-
const { parseTreemap: parseTreemap2 } = await import("./parser-
|
|
3807
|
+
const { parseTreemap: parseTreemap2 } = await import("./parser-5HQPPVHJ.js");
|
|
3161
3808
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3162
3809
|
const treemapParsed = parseTreemap2(content, effectivePalette);
|
|
3163
3810
|
if (treemapParsed.error || treemapParsed.roots.length === 0) return "";
|
|
3164
3811
|
const container = createExportContainer(ctx.width, ctx.height);
|
|
3165
3812
|
const dims = { width: ctx.width, height: ctx.height };
|
|
3166
3813
|
if (treemapParsed.options.radial) {
|
|
3167
|
-
const { renderTreemapRadialForExport } = await import("./renderer-radial-
|
|
3814
|
+
const { renderTreemapRadialForExport } = await import("./renderer-radial-4R7AKETK.js");
|
|
3168
3815
|
renderTreemapRadialForExport(
|
|
3169
3816
|
container,
|
|
3170
3817
|
treemapParsed,
|
|
@@ -3173,7 +3820,7 @@ async function exportTreemap(ctx) {
|
|
|
3173
3820
|
dims
|
|
3174
3821
|
);
|
|
3175
3822
|
} else {
|
|
3176
|
-
const { renderTreemapForExport } = await import("./renderer-
|
|
3823
|
+
const { renderTreemapForExport } = await import("./renderer-7RAMBMTH.js");
|
|
3177
3824
|
renderTreemapForExport(
|
|
3178
3825
|
container,
|
|
3179
3826
|
treemapParsed,
|
|
@@ -3199,7 +3846,7 @@ async function exportVenn(ctx) {
|
|
|
3199
3846
|
// src/version-control/export.ts
|
|
3200
3847
|
async function exportVersionControl(ctx) {
|
|
3201
3848
|
const { content, theme, palette } = ctx;
|
|
3202
|
-
const { parseVersionControl: parseVersionControl2 } = await import("./parser-
|
|
3849
|
+
const { parseVersionControl: parseVersionControl2 } = await import("./parser-DRUGM3R6.js");
|
|
3203
3850
|
const { renderVersionControlForExport } = await import("./renderer-NOYLNVTI.js");
|
|
3204
3851
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3205
3852
|
const parsed = parseVersionControl2(content, effectivePalette);
|
|
@@ -3221,11 +3868,11 @@ async function exportVersionControl(ctx) {
|
|
|
3221
3868
|
// src/whiteboard/export.ts
|
|
3222
3869
|
async function exportWhiteboard(ctx) {
|
|
3223
3870
|
const { content, theme } = ctx;
|
|
3224
|
-
const { parseWhiteboard: parseWhiteboard2 } = await import("./parser-
|
|
3871
|
+
const { parseWhiteboard: parseWhiteboard2 } = await import("./parser-722KLLAQ.js");
|
|
3225
3872
|
const effectivePalette = await resolveExportPalette(theme, ctx.palette);
|
|
3226
3873
|
const parsed = parseWhiteboard2(content, effectivePalette);
|
|
3227
3874
|
if (parsed.error || parsed.elements.length === 0) return "";
|
|
3228
|
-
const { renderWhiteboard } = await import("./renderer-
|
|
3875
|
+
const { renderWhiteboard } = await import("./renderer-BYLQ37T2.js");
|
|
3229
3876
|
const container = createExportContainer(1, 1);
|
|
3230
3877
|
const resolveImage = ctx.options?.resolveImage;
|
|
3231
3878
|
const showNotes = ctx.options?.showNotes;
|
|
@@ -3239,9 +3886,9 @@ async function exportWhiteboard(ctx) {
|
|
|
3239
3886
|
// src/wireframe/export.ts
|
|
3240
3887
|
async function exportWireframe(ctx) {
|
|
3241
3888
|
const { content, theme, palette } = ctx;
|
|
3242
|
-
const { parseWireframe: parseWireframe2 } = await import("./parser-
|
|
3889
|
+
const { parseWireframe: parseWireframe2 } = await import("./parser-TTGZYLYD.js");
|
|
3243
3890
|
const { layoutWireframe } = await import("./layout-HF3PMI4H.js");
|
|
3244
|
-
const { renderWireframe } = await import("./renderer-
|
|
3891
|
+
const { renderWireframe } = await import("./renderer-QZJZIAT3.js");
|
|
3245
3892
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3246
3893
|
const wireframeParsed = parseWireframe2(content);
|
|
3247
3894
|
if (wireframeParsed.error || wireframeParsed.roots.length === 0 && wireframeParsed.modals.length === 0)
|
|
@@ -3288,7 +3935,6 @@ var DIAGRAM_EXPORT_HANDLERS = {
|
|
|
3288
3935
|
class: exportClass,
|
|
3289
3936
|
er: exportEr,
|
|
3290
3937
|
"boxes-and-lines": exportBoxesAndLines,
|
|
3291
|
-
sketch: exportSketch,
|
|
3292
3938
|
whiteboard: exportWhiteboard,
|
|
3293
3939
|
swimlane: exportSwimlane,
|
|
3294
3940
|
family: exportFamily,
|
|
@@ -3344,18 +3990,21 @@ function resolveArcChordOverride(content, detectedType, palette) {
|
|
|
3344
3990
|
}
|
|
3345
3991
|
async function renderForExport(content, theme, palette, viewState, options) {
|
|
3346
3992
|
const exportMode = options?.exportMode ?? false;
|
|
3347
|
-
const { parseDgmoChartType } = await import("./dgmo-router-
|
|
3993
|
+
const { parseDgmoChartType } = await import("./dgmo-router-EPBQKQW2.js");
|
|
3348
3994
|
const detectedTypeRaw = parseDgmoChartType(content);
|
|
3349
3995
|
const override = resolveArcChordOverride(content, detectedTypeRaw, palette);
|
|
3350
3996
|
const renderContent = override?.content ?? content;
|
|
3351
3997
|
const detectedType = override?.type ?? detectedTypeRaw;
|
|
3352
3998
|
if (detectedType !== null) {
|
|
3353
|
-
const { supportsD3DataChart, renderDataChartD3: renderDataChartD32 } = await import("./charts-d3-
|
|
3999
|
+
const { supportsD3DataChart, renderDataChartD3: renderDataChartD32 } = await import("./charts-d3-IRP5VANE.js");
|
|
3354
4000
|
if (supportsD3DataChart(detectedType)) {
|
|
3355
|
-
return
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
4001
|
+
return fitSvgToContent(
|
|
4002
|
+
await renderDataChartD32(renderContent, theme, palette, {
|
|
4003
|
+
...options?.width !== void 0 && { width: options.width },
|
|
4004
|
+
...options?.height !== void 0 && { height: options.height }
|
|
4005
|
+
}),
|
|
4006
|
+
exportFitRequest(options)
|
|
4007
|
+
);
|
|
3359
4008
|
}
|
|
3360
4009
|
}
|
|
3361
4010
|
const ctx = {
|
|
@@ -3376,7 +4025,16 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
3376
4025
|
height: options?.height && options.height > 0 ? Math.round(options.height) : EXPORT_HEIGHT
|
|
3377
4026
|
};
|
|
3378
4027
|
const handler = detectedType !== null ? DIAGRAM_EXPORT_HANDLERS[detectedType] : void 0;
|
|
3379
|
-
return (
|
|
4028
|
+
return fitSvgToContent(
|
|
4029
|
+
await (handler ?? exportVisualization)(ctx),
|
|
4030
|
+
exportFitRequest(options)
|
|
4031
|
+
);
|
|
4032
|
+
}
|
|
4033
|
+
function exportFitRequest(options) {
|
|
4034
|
+
return {
|
|
4035
|
+
...options?.width !== void 0 && { width: options.width },
|
|
4036
|
+
...options?.height !== void 0 && { height: options.height }
|
|
4037
|
+
};
|
|
3380
4038
|
}
|
|
3381
4039
|
|
|
3382
4040
|
// src/utils/hover-styles.ts
|
|
@@ -3720,17 +4378,6 @@ var HOVER_SPECS = {
|
|
|
3720
4378
|
emphasis: "dim",
|
|
3721
4379
|
legend: true
|
|
3722
4380
|
},
|
|
3723
|
-
sketch: {
|
|
3724
|
-
markSelector: ".sk-node",
|
|
3725
|
-
strategy: "connection",
|
|
3726
|
-
hoverSelector: ".sk-node",
|
|
3727
|
-
hoverAttr: "data-node-id",
|
|
3728
|
-
edgeSelector: ".sk-edge-group",
|
|
3729
|
-
fromAttr: "data-from",
|
|
3730
|
-
toAttr: "data-to",
|
|
3731
|
-
legend: true,
|
|
3732
|
-
emphasis: "dim"
|
|
3733
|
-
},
|
|
3734
4381
|
infra: {
|
|
3735
4382
|
markSelector: ".infra-node",
|
|
3736
4383
|
strategy: "connection",
|
|
@@ -4277,12 +4924,6 @@ function summarizeBoxesAndLines(content) {
|
|
|
4277
4924
|
const names = parsed.nodes.map((n) => n.label);
|
|
4278
4925
|
return `Boxes and lines diagram of ${namedCount(names, "box", "boxes")}, with ${plural(parsed.edges.length, "line", "lines")}.`;
|
|
4279
4926
|
}
|
|
4280
|
-
function summarizeSketch(content) {
|
|
4281
|
-
const parsed = parseSketch(content);
|
|
4282
|
-
if (parsed.error) return null;
|
|
4283
|
-
const names = parsed.nodes.map((n) => n.label);
|
|
4284
|
-
return `Sketch of ${namedCount(names, "shape", "shapes")}, with ${plural(parsed.edges.length, "connection", "connections")}.`;
|
|
4285
|
-
}
|
|
4286
4927
|
function summarizeWhiteboard(content) {
|
|
4287
4928
|
const parsed = parseWhiteboard(content);
|
|
4288
4929
|
if (parsed.error) return null;
|
|
@@ -4731,7 +5372,6 @@ var SUMMARIZERS = {
|
|
|
4731
5372
|
gantt: summarizeGantt,
|
|
4732
5373
|
pert: summarizePert,
|
|
4733
5374
|
"boxes-and-lines": summarizeBoxesAndLines,
|
|
4734
|
-
sketch: summarizeSketch,
|
|
4735
5375
|
whiteboard: summarizeWhiteboard,
|
|
4736
5376
|
swimlane: summarizeSwimlane,
|
|
4737
5377
|
family: summarizeFamily,
|
|
@@ -4916,10 +5556,19 @@ async function render(source, options) {
|
|
|
4916
5556
|
if (category === "data-chart") {
|
|
4917
5557
|
await acquireDom();
|
|
4918
5558
|
try {
|
|
4919
|
-
const
|
|
5559
|
+
const sizeRequest = {
|
|
4920
5560
|
...options?.width !== void 0 && { width: options.width },
|
|
4921
5561
|
...options?.height !== void 0 && { height: options.height }
|
|
4922
|
-
}
|
|
5562
|
+
};
|
|
5563
|
+
const raw = fitSvgToContent(
|
|
5564
|
+
await renderDataChartD3(
|
|
5565
|
+
renderContent,
|
|
5566
|
+
theme,
|
|
5567
|
+
paletteColors,
|
|
5568
|
+
sizeRequest
|
|
5569
|
+
),
|
|
5570
|
+
sizeRequest
|
|
5571
|
+
);
|
|
4923
5572
|
const svg2 = applyRootDesc(
|
|
4924
5573
|
applyRootA11y(
|
|
4925
5574
|
injectHoverStyles(raw, chartType, { bakeHover }),
|
|
@@ -4997,6 +5646,9 @@ async function render(source, options) {
|
|
|
4997
5646
|
}
|
|
4998
5647
|
|
|
4999
5648
|
export {
|
|
5649
|
+
EXPORT_FIT_PAD,
|
|
5650
|
+
measureSvgContent,
|
|
5651
|
+
fitSvgToContent,
|
|
5000
5652
|
orderArcNodes,
|
|
5001
5653
|
renderArcDiagram,
|
|
5002
5654
|
renderQuadrant,
|