@diagrammo/dgmo 0.50.1 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced.d.ts +6640 -0
- package/dist/advanced.js +207 -161
- package/dist/{analyzer-UYKBXAKR.js → analyzer-BJ54GIFB.js} +3 -3
- package/dist/auto.css +31 -8
- package/dist/auto.d.ts +60 -0
- package/dist/auto.js +169 -133
- package/dist/auto.mjs +2245 -1030
- package/dist/block.css +28 -8
- package/dist/block.d.ts +130 -0
- package/dist/block.js +103 -68
- package/dist/{charts-d3-LR6D3D7A.js → charts-d3-7E4B4IMW.js} +9 -9
- package/dist/{chunk-6IAA2QQ2.js → chunk-2EQMXBBQ.js} +2 -2
- package/dist/{chunk-XJLKLU4D.js → chunk-2ILHQOL3.js} +3 -3
- package/dist/{chunk-SXRTRMEE.js → chunk-2UJSV2VT.js} +3 -3
- package/dist/{chunk-LE4MYMLI.js → chunk-32XPAAET.js} +5 -5
- package/dist/{chunk-NU3XLTGP.js → chunk-332ZR4QU.js} +4 -4
- package/dist/{chunk-F7BFXWNQ.js → chunk-3JLKYGBQ.js} +2 -2
- package/dist/{chunk-QROYX7TT.js → chunk-3LV2NCB6.js} +3 -3
- package/dist/{chunk-ZAD4HV2G.js → chunk-3ODS2VGL.js} +99 -99
- package/dist/{chunk-3XGZF2QJ.js → chunk-3YSQZ75W.js} +6 -6
- package/dist/{chunk-FJUNPCYI.js → chunk-467TVMQL.js} +2 -2
- package/dist/{chunk-HHXOONLX.js → chunk-4B5YISOR.js} +38 -1
- package/dist/{chunk-6HJBFVLO.js → chunk-4QZ43D7I.js} +3 -3
- package/dist/{chunk-4S52SK6G.js → chunk-4VWJ4LW2.js} +15 -8
- package/dist/chunk-4XFBQT5O.js +35 -0
- package/dist/{chunk-2C56LEML.js → chunk-5F5ELR3V.js} +3 -3
- package/dist/{chunk-EAMEADTV.js → chunk-5PDTIBLV.js} +83 -21
- package/dist/{chunk-C2CVAM3U.js → chunk-5PZT4DQG.js} +160 -87
- package/dist/{chunk-IAEC4KLA.js → chunk-5QKQSSPO.js} +2 -2
- package/dist/{chunk-5OWVC2A6.js → chunk-5SVOCD5W.js} +6 -6
- package/dist/{chunk-VBYSIOOY.js → chunk-5WPNFSXP.js} +3 -3
- package/dist/{chunk-4MJ7M6YL.js → chunk-5X6YQA2J.js} +7 -7
- package/dist/{chunk-JJUOHGX2.js → chunk-65WJYYKJ.js} +4 -4
- package/dist/{chunk-3UIKSPFB.js → chunk-6BQFET7X.js} +3 -3
- package/dist/{chunk-U2HGPLZS.js → chunk-6H7O2OPM.js} +14 -1
- package/dist/{chunk-DZXYF2F5.js → chunk-6K2M4VSR.js} +3 -3
- package/dist/{chunk-PGEGPSCZ.js → chunk-6MNGECP2.js} +2 -2
- package/dist/{chunk-3XPUDB7B.js → chunk-6NFYEQDX.js} +266 -38
- package/dist/{chunk-4XK3FLFB.js → chunk-6NYWYNBI.js} +3 -3
- package/dist/{chunk-TWQUYVP3.js → chunk-7DF4J4RL.js} +4 -4
- package/dist/{chunk-H73FP42Q.js → chunk-7DYOELRK.js} +3 -3
- package/dist/{chunk-L3UHP6TD.js → chunk-7L4UJOY6.js} +1 -2
- package/dist/{chunk-QJP6PG7F.js → chunk-AB7INMR5.js} +9 -9
- package/dist/{chunk-3LKM6FMW.js → chunk-AE7II3E3.js} +2 -2
- package/dist/{chunk-BTUTZMPT.js → chunk-AFIEPDLX.js} +97 -42
- package/dist/chunk-APKUAJ2L.js +220 -0
- package/dist/{chunk-X6EZPSW6.js → chunk-AXW3M6OQ.js} +7 -7
- package/dist/{chunk-66RUL3XF.js → chunk-B63YB7X3.js} +5 -5
- package/dist/{chunk-DSWVNQVS.js → chunk-BGP54HVR.js} +4 -59
- package/dist/{chunk-3NODSS6A.js → chunk-BYJBIALT.js} +7 -7
- package/dist/{chunk-3YPY3OXD.js → chunk-CC4YRBWV.js} +2 -2
- package/dist/{chunk-HLJVEAOF.js → chunk-DY7XLRHK.js} +8 -33
- package/dist/{chunk-OMNGQPEZ.js → chunk-E7Y3SYKW.js} +3 -3
- package/dist/{chunk-HTMN2Z6U.js → chunk-EDA6C7MV.js} +50 -7
- package/dist/{chunk-7L3R6I3U.js → chunk-ENRS56GC.js} +3 -3
- package/dist/{chunk-2KGXHFYK.js → chunk-EXOQP75F.js} +7 -7
- package/dist/{chunk-BBGDM4NQ.js → chunk-F3FYUFUH.js} +26 -8
- package/dist/{chunk-GL5UZ6NY.js → chunk-FC5I2KXV.js} +3 -3
- package/dist/{chunk-VVW3F3MD.js → chunk-FTBZV6NE.js} +9 -9
- package/dist/{chunk-7QKLIMRZ.js → chunk-G3PF3S7P.js} +41 -46
- package/dist/{chunk-J6K7RP6P.js → chunk-GD6L76WD.js} +3 -3
- package/dist/{chunk-I2WKW7C7.js → chunk-GGHRAITI.js} +3 -3
- package/dist/{chunk-YIA4LEX4.js → chunk-GNSFLJAA.js} +96 -4
- package/dist/{chunk-IUMPEA64.js → chunk-GROLTAWZ.js} +4 -4
- package/dist/{chunk-Q4V4XQWV.js → chunk-GTWKD3QT.js} +2 -2
- package/dist/{chunk-F2L5GCQ4.js → chunk-GU46PPT3.js} +3 -3
- package/dist/{chunk-6IUAK7RZ.js → chunk-H6PI3KJT.js} +2 -2
- package/dist/{chunk-SCQ5VPUF.js → chunk-HFMYN6N2.js} +2 -2
- package/dist/{chunk-GKC3HILQ.js → chunk-I2QZFCS2.js} +27 -4
- package/dist/{chunk-MCZ5LBZD.js → chunk-IE477RQZ.js} +7 -7
- package/dist/{chunk-3Y2DRD7S.js → chunk-IEDMFNU7.js} +3 -3
- package/dist/{chunk-M5RXSRO2.js → chunk-IEWG6J7C.js} +4 -4
- package/dist/{chunk-P7CE7LXL.js → chunk-IUJODQKX.js} +6 -6
- package/dist/{chunk-NWED7CYO.js → chunk-IUO34HKW.js} +6 -6
- package/dist/{chunk-NX4EQS3U.js → chunk-J76PIKAT.js} +2 -2
- package/dist/{chunk-O7WP4ZD4.js → chunk-JED6ZDEE.js} +2 -2
- package/dist/{chunk-6BFZKBGD.js → chunk-JJXGQIRV.js} +2 -2
- package/dist/{chunk-O7NUCTFU.js → chunk-JM4LEPY3.js} +2 -2
- package/dist/{chunk-VDOOQZUD.js → chunk-JSSX2SX4.js} +4 -4
- package/dist/{chunk-SQLNBA64.js → chunk-KFNWFNAA.js} +3 -3
- package/dist/{chunk-VVZRV54S.js → chunk-KJGG2JKQ.js} +143 -82
- package/dist/{chunk-OTAL43EH.js → chunk-LV4BETUU.js} +8 -2
- package/dist/{chunk-VUJGMJE6.js → chunk-MVN25IF6.js} +4 -4
- package/dist/{chunk-CLD2OKV7.js → chunk-MX2EY5Y7.js} +2 -2
- package/dist/{chunk-Y4RNXEAO.js → chunk-ND76YJCN.js} +139 -25
- package/dist/{chunk-KFZYNWWO.js → chunk-NEQ6GJXB.js} +4 -4
- package/dist/{chunk-PFHVU7UA.js → chunk-NI3XQBPB.js} +2 -2
- package/dist/{chunk-WW32K72E.js → chunk-OJTXTQA2.js} +9 -9
- package/dist/{chunk-YNRDWYZP.js → chunk-OQKP2X3D.js} +170 -51
- package/dist/{chunk-AHGF2YYA.js → chunk-OTOHI4JO.js} +2 -2
- package/dist/{chunk-HEVYAHLW.js → chunk-OU7HLO7I.js} +4 -4
- package/dist/{chunk-GBE54KY6.js → chunk-OZPBJM5Q.js} +3 -3
- package/dist/{chunk-EOFPYPAU.js → chunk-P3NRSSUU.js} +51 -11
- package/dist/{chunk-TSA237IM.js → chunk-PZDBOK2Q.js} +2 -2
- package/dist/{chunk-3P2DKJCG.js → chunk-Q62FEYK3.js} +2 -2
- package/dist/{chunk-DFTFPYUD.js → chunk-QHI5XVUJ.js} +7 -7
- package/dist/{chunk-HQCHYB5F.js → chunk-QOOUC2J5.js} +2 -2
- package/dist/{chunk-XDXNDSKO.js → chunk-QZPEGJOM.js} +5 -2
- package/dist/{chunk-TN35C5KM.js → chunk-RAHVMKBG.js} +2 -2
- package/dist/chunk-RBDIYLA5.js +267 -0
- package/dist/{chunk-OTQKUHRS.js → chunk-RBHWPDBB.js} +3 -3
- package/dist/{chunk-BH3UYK36.js → chunk-RLFVAKEO.js} +3 -3
- package/dist/{chunk-3LH5CLP4.js → chunk-RXKTSFDL.js} +150 -5
- package/dist/{chunk-RZ6YKEUJ.js → chunk-TK2VQQX2.js} +6 -6
- package/dist/{chunk-I7F2A35O.js → chunk-TMACGPW5.js} +25 -47
- package/dist/{chunk-5GJYGP5Z.js → chunk-TRM2J7ZN.js} +8 -8
- package/dist/{chunk-BCYVE3N5.js → chunk-TYS6CSS5.js} +2 -2
- package/dist/{chunk-7PQYTZMA.js → chunk-U5SI5NIM.js} +95 -232
- package/dist/{chunk-KHEYDLMT.js → chunk-VB4UJ3H2.js} +2 -2
- package/dist/{chunk-HGN652MU.js → chunk-VL2O2F3W.js} +2 -2
- package/dist/{chunk-ONA5KPV3.js → chunk-VNSXLA6G.js} +4 -4
- package/dist/{chunk-CMCR5WBW.js → chunk-WBRZJOEC.js} +3 -3
- package/dist/{chunk-5LWQH6QV.js → chunk-WCT3NYCV.js} +1 -1
- package/dist/{chunk-T4VOVZT5.js → chunk-WJ7RW65H.js} +4 -4
- package/dist/{chunk-SCHXJTZL.js → chunk-WQLMU7VG.js} +2 -2
- package/dist/{chunk-C4GQDB5L.js → chunk-WRNFDFPU.js} +2 -2
- package/dist/{chunk-66NVRO4K.js → chunk-X7EC3L2H.js} +7 -7
- package/dist/{chunk-QXKWYZNR.js → chunk-XEQXCIBC.js} +3 -3
- package/dist/{chunk-C63UWAKM.js → chunk-Y2ZE3MSG.js} +2 -2
- package/dist/{chunk-FA6K3FWM.js → chunk-Y6GBQTBK.js} +6 -6
- package/dist/{chunk-7UEMZREK.js → chunk-YAA6IID3.js} +2 -2
- package/dist/{chunk-PZFVK3IH.js → chunk-YGJZWZTY.js} +2 -2
- package/dist/{chunk-7TV5Y53Y.js → chunk-ZJ3LS7DW.js} +3 -3
- package/dist/{chunk-PH5X4GIP.js → chunk-ZO27FGJS.js} +2 -2
- package/dist/cli.cjs +163 -147
- package/dist/clock.js +91 -5
- package/dist/countdown.js +208 -82
- package/dist/dgmo-router-Y2VEX46B.js +86 -0
- package/dist/dimensions-F7B5C4BJ.js +22 -0
- package/dist/editor.js +14 -1
- package/dist/element.d.ts +68 -0
- package/dist/element.js +170 -134
- package/dist/element.mjs +2209 -1015
- package/dist/{flowchart-parser-OE4WHLTF.js → flowchart-parser-MY53QWTZ.js} +4 -4
- package/dist/{flowchart-renderer-GPCSMTOR.js → flowchart-renderer-AQSMEMYF.js} +8 -8
- package/dist/highlight.js +14 -1
- package/dist/index.d.ts +185 -0
- package/dist/index.js +57 -53
- package/dist/{layout-7SKMFYHL.js → layout-46N4JJYK.js} +5 -5
- package/dist/layout-4DIUOX2T.js +14 -0
- package/dist/{layout-7H4H46CS.js → layout-7QXCNOVS.js} +3 -3
- package/dist/{layout-NXG63LWH.js → layout-AM2JWW3X.js} +4 -4
- package/dist/{layout-7MZ5NF2N.js → layout-CBCLPMSG.js} +5 -5
- package/dist/{layout-DC4TVXER.js → layout-EE6GE46Y.js} +5 -5
- package/dist/{layout-FGQWRYYW.js → layout-F4WO357A.js} +3 -3
- package/dist/layout-G23F7LDH.js +9 -0
- package/dist/{layout-QNUQLEHU.js → layout-HYZPWAK5.js} +3 -3
- package/dist/{layout-FWODLIMP.js → layout-JDJAEQ3P.js} +6 -6
- package/dist/layout-MUPRALE5.js +14 -0
- package/dist/{layout-34CLNICW.js → layout-OAC4PEAC.js} +5 -5
- package/dist/{layout-5BG6DFCU.js → layout-YVTNOTN4.js} +6 -6
- package/dist/{layout-PUQCB6AN.js → layout-ZDOSXL5G.js} +7 -7
- package/dist/{layout-search-QS44PI5R.js → layout-search-55FU6HD3.js} +6 -157
- package/dist/map-data/gazetteer.json +1 -1
- package/dist/{parser-36HVKU5U.js → parser-2Q2T4C3B.js} +6 -5
- package/dist/{parser-B5FVS7O6.js → parser-3A42DZ72.js} +3 -3
- package/dist/{parser-CSFUN3CT.js → parser-4RFTKAQX.js} +5 -4
- package/dist/{parser-IJBMRXMC.js → parser-57ILIFZ2.js} +5 -5
- package/dist/{parser-DFFEDKHH.js → parser-5A2UWU6B.js} +3 -3
- package/dist/{parser-H3XEPFPV.js → parser-5PDYJGWA.js} +4 -4
- package/dist/{parser-O4HIUN6G.js → parser-6BJEXUFX.js} +4 -4
- package/dist/{parser-MTOMTWTD.js → parser-6ZKABF5S.js} +6 -5
- package/dist/{parser-WAV5JRPT.js → parser-AIMHGJRR.js} +4 -4
- package/dist/{parser-TXND652E.js → parser-AZJ25OKK.js} +4 -4
- package/dist/{parser-4AI5ZN5F.js → parser-B77S5SZM.js} +3 -3
- package/dist/{parser-IBWNAPY4.js → parser-BEPSWJAD.js} +3 -3
- package/dist/{parser-D5VILGN2.js → parser-BKI42XBQ.js} +4 -4
- package/dist/{parser-LWKKBNSA.js → parser-C3D7MVXY.js} +3 -3
- package/dist/{parser-HYRTF3DO.js → parser-CDG7CHV5.js} +3 -3
- package/dist/{parser-CVMEDULU.js → parser-CZOJ7XQ6.js} +4 -4
- package/dist/{parser-AXKBDGNO.js → parser-E2RL6JYF.js} +5 -5
- package/dist/{parser-PSA4UBSP.js → parser-EH5VE7ZN.js} +4 -4
- package/dist/{parser-K3XXLMUW.js → parser-FQ6GZFMR.js} +4 -4
- package/dist/{parser-RV4M6AS2.js → parser-GKLZKEIK.js} +4 -4
- package/dist/{parser-MPCE5JBG.js → parser-H6ABKHZZ.js} +4 -4
- package/dist/{parser-RZPVAQVX.js → parser-I6GGFKOQ.js} +4 -3
- package/dist/{parser-W4PQUGX3.js → parser-JA7JQ7NF.js} +4 -4
- package/dist/{parser-5OXGPNBF.js → parser-KKTJ6M3Y.js} +5 -5
- package/dist/parser-OK22AC6Y.js +14 -0
- package/dist/{parser-4NO6VZ6S.js → parser-OK2ILHRT.js} +4 -4
- package/dist/{parser-YS7TOS2K.js → parser-OUTPNJWC.js} +3 -3
- package/dist/{parser-KCR2WS3V.js → parser-PORDUX5E.js} +4 -4
- package/dist/{parser-VKOJM7KS.js → parser-SRVFR7PM.js} +4 -4
- package/dist/{parser-TGQZJ5OT.js → parser-UKFFZCFJ.js} +4 -4
- package/dist/{parser-JJR52VAT.js → parser-UMWPLORP.js} +5 -5
- package/dist/{parser-AGVYTQXV.js → parser-Z4TZV2CB.js} +4 -4
- package/dist/{renderer-A5VE5BCI.js → renderer-2AUFT3E2.js} +8 -8
- package/dist/{renderer-FPE3J5VZ.js → renderer-2HTNBIF2.js} +11 -11
- package/dist/{renderer-R2WNIC2C.js → renderer-3K3IB7D5.js} +8 -8
- package/dist/{renderer-2AZ5HJFK.js → renderer-3YNIWF5I.js} +4 -4
- package/dist/{renderer-PJM35LJN.js → renderer-3YPZHMOU.js} +3 -3
- package/dist/{renderer-JCCHNECZ.js → renderer-4WR6WMVF.js} +9 -9
- package/dist/{renderer-HDCCZURL.js → renderer-66MERVQ2.js} +9 -9
- package/dist/{renderer-2QPMJ2DA.js → renderer-6RKQPNJI.js} +9 -9
- package/dist/{renderer-FYSVXL7M.js → renderer-ARMJBP6C.js} +11 -11
- package/dist/{renderer-6OKF44KS.js → renderer-CO2DW7S7.js} +13 -13
- package/dist/{renderer-BSR2O2H6.js → renderer-EDJ2O4S5.js} +13 -12
- package/dist/{renderer-CYB4LK3G.js → renderer-F7U3MFCV.js} +9 -9
- package/dist/{renderer-72LGR2YF.js → renderer-GD2COXVL.js} +4 -2
- package/dist/{renderer-B5TBNZJE.js → renderer-GQIESYEM.js} +8 -8
- package/dist/{renderer-ODUUOPVT.js → renderer-HCKJDFXD.js} +13 -13
- package/dist/{renderer-QAOBLRXV.js → renderer-HYGHO4SJ.js} +10 -10
- package/dist/{renderer-5DSEWF74.js → renderer-JC3RDUT7.js} +8 -8
- package/dist/{renderer-7RH2SI3B.js → renderer-KQB7UGDS.js} +3 -3
- package/dist/{renderer-45PSOL3E.js → renderer-NKJ24TEA.js} +5 -5
- package/dist/{renderer-AUW2BE6G.js → renderer-OYO67VZK.js} +9 -9
- package/dist/{renderer-DAXMXIKD.js → renderer-QIWVHWZO.js} +3 -3
- package/dist/{renderer-PSMMZCKH.js → renderer-QRWACQRI.js} +8 -8
- package/dist/{renderer-4ITCHBT7.js → renderer-QXGN5H3A.js} +5 -5
- package/dist/renderer-QXPP4TA2.js +27 -0
- package/dist/{renderer-KS7YZJE2.js → renderer-RGIYOTKJ.js} +10 -10
- package/dist/{renderer-FF24KZCI.js → renderer-RHT4MHFU.js} +8 -8
- package/dist/{renderer-PPIHO5FI.js → renderer-RYR3TJ46.js} +12 -11
- package/dist/{renderer-NGXZTRK6.js → renderer-SRKDNDFB.js} +8 -8
- package/dist/{renderer-SBS3YWU5.js → renderer-TGTUABCI.js} +8 -8
- package/dist/{renderer-7SD6MSBS.js → renderer-TXJFKPOG.js} +11 -11
- package/dist/{renderer-HVCU2C3Z.js → renderer-UV6MI64M.js} +3 -3
- package/dist/renderer-radial-FWABAZHB.js +21 -0
- package/dist/{resolver-FHBCO3PL.js → resolver-EMTGNR3D.js} +4 -3
- package/dist/{state-parser-3REXRK3R.js → state-parser-6T6CNMPX.js} +4 -4
- package/dist/{state-renderer-XYLNRWXR.js → state-renderer-AWZ3ECAX.js} +8 -8
- package/dist/themes-32xj5ZTW.d.ts +943 -0
- package/docs/language-reference.md +98 -10
- package/gallery/fixtures/clock.dgmo +3 -3
- package/gallery/fixtures/countdown-far.dgmo +2 -0
- package/gallery/fixtures/countdown-tz.dgmo +5 -0
- package/package.json +1 -1
- package/dist/dgmo-router-YTU3ENAX.js +0 -84
- package/dist/dimensions-OTBKC5M6.js +0 -22
- package/dist/layout-6RDJHS6E.js +0 -9
- package/dist/layout-J36454XU.js +0 -14
- package/dist/layout-LD6XTLD6.js +0 -14
- package/dist/parser-4WQQQXCG.js +0 -13
- package/dist/renderer-UYMQQCJK.js +0 -24
- package/dist/renderer-radial-F7X5F2VU.js +0 -21
package/dist/block.css
CHANGED
|
@@ -26,21 +26,25 @@
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/* === Toolbar ===
|
|
29
|
-
* The diagram is the star: the toolbar is
|
|
30
|
-
* (
|
|
31
|
-
*
|
|
32
|
-
* the
|
|
29
|
+
* The diagram is the star: the toolbar is an overlay pinned to the diagram's
|
|
30
|
+
* top-right corner (position:absolute — it reserves no layout space, so the
|
|
31
|
+
* block is exactly as tall as the chart). It stays fully transparent until
|
|
32
|
+
* the block is hovered or focused, or the source panel is open. It is the
|
|
33
|
+
* <summary> of the source <details>, so toggling works without any JS.
|
|
33
34
|
* No text labels, no disclosure triangle — three wordless icon buttons. */
|
|
34
35
|
.dgmo-source-wrap {
|
|
35
36
|
margin: 0;
|
|
36
37
|
}
|
|
37
38
|
.dgmo-toolbar {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 0.4em;
|
|
41
|
+
right: 0.4em;
|
|
42
|
+
z-index: 2;
|
|
38
43
|
display: flex;
|
|
39
44
|
align-items: center;
|
|
40
45
|
justify-content: flex-end;
|
|
41
46
|
gap: 0.25em;
|
|
42
|
-
|
|
43
|
-
padding: 0.15em 0;
|
|
47
|
+
padding: 0.15em;
|
|
44
48
|
opacity: 0;
|
|
45
49
|
transition: opacity 0.15s ease;
|
|
46
50
|
cursor: pointer;
|
|
@@ -143,6 +147,14 @@
|
|
|
143
147
|
overflow: auto;
|
|
144
148
|
border-radius: 0.5em;
|
|
145
149
|
box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
|
|
150
|
+
/* Opaque surface behind the enlarged diagram so a transparent embed doesn't
|
|
151
|
+
* show the page through it. The client overrides this inline with the block's
|
|
152
|
+
* own palette bg (data-dgmo-bg); this is the fallback for blocks that predate
|
|
153
|
+
* that attribute. */
|
|
154
|
+
background: #fff;
|
|
155
|
+
}
|
|
156
|
+
[data-theme="dark"] .dgmo-lightbox-svg {
|
|
157
|
+
background: #1e1e1e;
|
|
146
158
|
}
|
|
147
159
|
.dgmo-lightbox-svg > svg {
|
|
148
160
|
display: block;
|
|
@@ -177,9 +189,10 @@
|
|
|
177
189
|
* border so the code visibly belongs to the chart above it. The frame box
|
|
178
190
|
* (border + padding) is RESERVED at all times — with the border transparent
|
|
179
191
|
* while closed — so opening the panel only paints the border in. It never
|
|
180
|
-
* reflows the diagram
|
|
181
|
-
*
|
|
192
|
+
* reflows the diagram. position:relative anchors the overlay toolbar to
|
|
193
|
+
* this box. */
|
|
182
194
|
.dgmo:has(> .dgmo-source-wrap) {
|
|
195
|
+
position: relative;
|
|
183
196
|
border: 1px solid transparent;
|
|
184
197
|
border-radius: 0.6em;
|
|
185
198
|
padding: 0.75em 0.75em 0.5em;
|
|
@@ -222,6 +235,13 @@
|
|
|
222
235
|
font-size: 0.85em;
|
|
223
236
|
margin: 0.5em 0 0;
|
|
224
237
|
}
|
|
238
|
+
.dgmo-error-docs {
|
|
239
|
+
display: inline-block;
|
|
240
|
+
margin-top: 0.6em;
|
|
241
|
+
font-size: 0.9em;
|
|
242
|
+
font-weight: 600;
|
|
243
|
+
color: inherit;
|
|
244
|
+
}
|
|
225
245
|
|
|
226
246
|
/* === Source highlight roles ===
|
|
227
247
|
* Light values mirror LIGHT_ROLE_STYLES; dark overrides mirror
|
package/dist/block.d.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical stylesheet for the standard DGMO embed block (BL-114).
|
|
3
|
+
*
|
|
4
|
+
* Shipped two ways: `dist/block.css` (extracted at build time by
|
|
5
|
+
* tsup.config.ts, same regex mechanism as auto.css) for `<link>`/import
|
|
6
|
+
* consumers, and the `BLOCK_CSS` string export for embedders that inject a
|
|
7
|
+
* `<style>` tag.
|
|
8
|
+
*
|
|
9
|
+
* Dark mode keys off `[data-theme="dark"]`. Hosts with a different signal
|
|
10
|
+
* (`html.dark`, `body.theme-dark`) rewrite the selector at their build step —
|
|
11
|
+
* fumadocs-dgmo/nextra-dgmo's build-css.mjs is the reference adapter.
|
|
12
|
+
*
|
|
13
|
+
* The `.dgmo-tok-*` role colors mirror LIGHT_ROLE_STYLES (light) and
|
|
14
|
+
* NORD_ROLE_STYLES (dark) from editor/highlight-api.ts. A parity test
|
|
15
|
+
* (tests/block.test.ts) guards against drift — update both when either
|
|
16
|
+
* changes.
|
|
17
|
+
*
|
|
18
|
+
* IMPORTANT: keep this a single pure template literal — the build extracts it
|
|
19
|
+
* with a regex, so no interpolation or computed values.
|
|
20
|
+
*/
|
|
21
|
+
declare const BLOCK_CSS: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Standard DGMO embed block (BL-114) — the ONE canonical
|
|
25
|
+
* "diagram + source chrome" HTML builder shared by every embed surface:
|
|
26
|
+
* remark-dgmo (and through it the astro/docusaurus/fumadocs/nextra/vitepress
|
|
27
|
+
* wrappers), the `/auto` script-tag drop-in, `<dgmo-diagram>`, dgmo-mcp HTML
|
|
28
|
+
* reports, the marketing site, and the Obsidian plugin.
|
|
29
|
+
*
|
|
30
|
+
* Chrome contract (user-approved 2026-07-05): the diagram is the star. A slim
|
|
31
|
+
* icon toolbar sits in a reserved row below the SVG, invisible until the
|
|
32
|
+
* block is hovered/focused or the source is open. Four wordless icon
|
|
33
|
+
* buttons — `</>` toggles the hidden source panel, expand (full-screen),
|
|
34
|
+
* copy, open-in-editor. No disclosure triangle, no text labels. The toolbar
|
|
35
|
+
* IS the <summary> of a native <details>, so show/hide works with zero
|
|
36
|
+
* JavaScript; copy and expand need a small delegated click handler
|
|
37
|
+
* (remark-dgmo's `bindDgmo` is the reference — expand's lightbox helper is
|
|
38
|
+
* mirrored across every client surface, same as copy).
|
|
39
|
+
*
|
|
40
|
+
* Markup vocabulary: `figure.dgmo` (`--diagram`/`--showcase`/`--error`),
|
|
41
|
+
* `.dgmo-light`/`.dgmo-dark` (dual color-mode) or `.dgmo-svg` (single),
|
|
42
|
+
* `details.dgmo-source-wrap > summary.dgmo-toolbar`, `.dgmo-source-inner`,
|
|
43
|
+
* `pre.dgmo-pre > span.dgmo-code` with `.dgmo-tok-<role>` token spans. While
|
|
44
|
+
* the source is open the wrapper gets one shared frame (`:has()` rule) so
|
|
45
|
+
* diagram + code read as a single unit. No visible caption — `title` becomes
|
|
46
|
+
* the wrapper's aria-label. Styles ship as `BLOCK_CSS` / `dist/block.css`.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/** Default hosted editor used by "Open in editor" links. */
|
|
50
|
+
declare const EDITOR_BASE_URL = "https://online.diagrammo.app";
|
|
51
|
+
type BlockMode = 'diagram' | 'showcase';
|
|
52
|
+
/**
|
|
53
|
+
* Color-mode strategy for the emitted SVG(s).
|
|
54
|
+
* - `auto` — render twice (light + dark) and let CSS flip visibility.
|
|
55
|
+
* - `light` / `dark` / `transparent` — single render with that theme.
|
|
56
|
+
*/
|
|
57
|
+
type BlockColorMode = 'auto' | 'light' | 'dark' | 'transparent';
|
|
58
|
+
interface DgmoBlockOptions {
|
|
59
|
+
/** `diagram` (default): SVG only. `showcase`: SVG + source chrome. */
|
|
60
|
+
mode?: BlockMode;
|
|
61
|
+
/** Palette name. Default `slate`; unknown names warn + fall back. */
|
|
62
|
+
palette?: string;
|
|
63
|
+
/** Default `auto` (dual light/dark render). */
|
|
64
|
+
colorMode?: BlockColorMode;
|
|
65
|
+
/**
|
|
66
|
+
* Embed background. `auto` (default) strips the theme's opaque root
|
|
67
|
+
* background so the diagram blends into the host page — except for
|
|
68
|
+
* background-meaningful types like `map`, which stay opaque. `transparent` /
|
|
69
|
+
* `opaque` force the choice regardless of type (the embedder opt-out).
|
|
70
|
+
*/
|
|
71
|
+
background?: 'auto' | 'transparent' | 'opaque';
|
|
72
|
+
/** Default: true in showcase mode, false in diagram mode. */
|
|
73
|
+
showSource?: boolean;
|
|
74
|
+
/** Default: true in showcase mode, false in diagram mode. */
|
|
75
|
+
showCopy?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Show the expand (full-screen) toolbar button. Default: true in showcase
|
|
78
|
+
* mode, false in diagram mode. Needs the client lightbox handler to do
|
|
79
|
+
* anything (mirrored across surfaces); markup-only surfaces can omit it.
|
|
80
|
+
*/
|
|
81
|
+
showExpand?: boolean;
|
|
82
|
+
/** Default: true in showcase mode, false in diagram mode. */
|
|
83
|
+
showOpenInEditor?: boolean;
|
|
84
|
+
/** Base URL for the open-in-editor link. Default: online.diagrammo.app. */
|
|
85
|
+
editorBaseUrl?: string;
|
|
86
|
+
/** Outer wrapper element. Default `figure`. */
|
|
87
|
+
wrapper?: 'figure' | 'div';
|
|
88
|
+
/** Base class for the wrapper (styling hook). Default `dgmo`. */
|
|
89
|
+
className?: string;
|
|
90
|
+
/** Extra classes appended to every emitted wrapper (compat shims). */
|
|
91
|
+
legacyClassNames?: string[];
|
|
92
|
+
/**
|
|
93
|
+
* Accessible name for the block (`aria-label` on the wrapper). NOT rendered
|
|
94
|
+
* visually — the chart's visible title belongs in the DGMO source itself.
|
|
95
|
+
*/
|
|
96
|
+
title?: string;
|
|
97
|
+
/** Receives palette-fallback warnings. Default: console.warn. */
|
|
98
|
+
onWarn?: (message: string) => void;
|
|
99
|
+
}
|
|
100
|
+
interface DgmoBlockResult {
|
|
101
|
+
html: string;
|
|
102
|
+
diagnostics: Array<{
|
|
103
|
+
message: string;
|
|
104
|
+
line?: number;
|
|
105
|
+
severity?: string;
|
|
106
|
+
}>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Render one ```dgmo source block to the standard embed HTML. Async because
|
|
110
|
+
* it runs the full dgmo render pipeline (once per color mode).
|
|
111
|
+
*
|
|
112
|
+
* Render errors are NOT caught here — callers decide between throwing,
|
|
113
|
+
* `errorBlockHtml()`, or their own fallback.
|
|
114
|
+
*/
|
|
115
|
+
declare function renderDgmoBlock(source: string, options?: DgmoBlockOptions): Promise<DgmoBlockResult>;
|
|
116
|
+
/**
|
|
117
|
+
* Assemble the standard block around already-rendered SVG markup. Exposed for
|
|
118
|
+
* surfaces that render through their own pipeline (e.g. dgmo-mcp's
|
|
119
|
+
* renderPipeline) but must emit the canonical chrome. `svgsHtml` must be the
|
|
120
|
+
* `.dgmo-light`+`.dgmo-dark` (or `.dgmo-svg`) wrapper divs.
|
|
121
|
+
*/
|
|
122
|
+
declare function buildDgmoBlockHtml(source: string, svgsHtml: string, options?: DgmoBlockOptions): string;
|
|
123
|
+
/**
|
|
124
|
+
* Standard error card for a block that failed to parse/render. Same shape on
|
|
125
|
+
* every surface: `.dgmo--error` with `role="alert"`, message + offending
|
|
126
|
+
* source.
|
|
127
|
+
*/
|
|
128
|
+
declare function errorBlockHtml(err: unknown, source: string, options?: Pick<DgmoBlockOptions, 'className' | 'legacyClassNames'>): string;
|
|
129
|
+
|
|
130
|
+
export { BLOCK_CSS, type BlockColorMode, type BlockMode, type DgmoBlockOptions, type DgmoBlockResult, EDITOR_BASE_URL, buildDgmoBlockHtml, errorBlockHtml, renderDgmoBlock };
|
package/dist/block.js
CHANGED
|
@@ -1,91 +1,95 @@
|
|
|
1
1
|
import {
|
|
2
|
+
defaultEmbedBackground,
|
|
3
|
+
docsLink,
|
|
2
4
|
normalizeSvgForEmbed,
|
|
3
5
|
renderErrorCard
|
|
4
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GNSFLJAA.js";
|
|
5
7
|
import {
|
|
6
8
|
encodeDiagramUrl,
|
|
7
9
|
render
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-3ODS2VGL.js";
|
|
11
|
+
import "./chunk-B63YB7X3.js";
|
|
10
12
|
import "./chunk-YRYKTYMQ.js";
|
|
11
13
|
import "./chunk-YYVTBZZC.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-OU7HLO7I.js";
|
|
15
|
+
import "./chunk-KJGG2JKQ.js";
|
|
16
|
+
import "./chunk-GTWKD3QT.js";
|
|
17
|
+
import "./chunk-AFIEPDLX.js";
|
|
16
18
|
import {
|
|
17
19
|
monthIndex,
|
|
18
20
|
weekdayIndex
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-OQKP2X3D.js";
|
|
22
|
+
import "./chunk-6NFYEQDX.js";
|
|
23
|
+
import "./chunk-APKUAJ2L.js";
|
|
24
|
+
import "./chunk-XEQXCIBC.js";
|
|
25
|
+
import "./chunk-6MNGECP2.js";
|
|
26
|
+
import "./chunk-6BQFET7X.js";
|
|
24
27
|
import "./chunk-BDXC7MDK.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-4VWJ4LW2.js";
|
|
29
|
+
import "./chunk-VL2O2F3W.js";
|
|
27
30
|
import "./chunk-U6EQI3U6.js";
|
|
28
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-YAA6IID3.js";
|
|
29
32
|
import "./chunk-A4GOY3PE.js";
|
|
30
33
|
import "./chunk-6KFWC4CO.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-QOOUC2J5.js";
|
|
35
|
+
import "./chunk-WCT3NYCV.js";
|
|
36
|
+
import "./chunk-QZPEGJOM.js";
|
|
37
|
+
import "./chunk-GGHRAITI.js";
|
|
38
|
+
import "./chunk-PZDBOK2Q.js";
|
|
39
|
+
import "./chunk-2EQMXBBQ.js";
|
|
40
|
+
import "./chunk-4QZ43D7I.js";
|
|
41
|
+
import "./chunk-Q62FEYK3.js";
|
|
42
|
+
import "./chunk-AE7II3E3.js";
|
|
43
|
+
import "./chunk-2ILHQOL3.js";
|
|
44
|
+
import "./chunk-ENRS56GC.js";
|
|
42
45
|
import "./chunk-NNAAJVBU.js";
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-MVN25IF6.js";
|
|
47
|
+
import "./chunk-5PZT4DQG.js";
|
|
48
|
+
import "./chunk-I2QZFCS2.js";
|
|
46
49
|
import {
|
|
47
50
|
REGISTRY_COLON_KEY_TOKENS,
|
|
48
51
|
REGISTRY_CONTROL_TOKENS,
|
|
49
52
|
REGISTRY_DIRECTIVE_TOKENS,
|
|
50
53
|
REGISTRY_MODIFIER_TOKENS,
|
|
51
54
|
REGISTRY_STATUS_TOKENS
|
|
52
|
-
} from "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
+
} from "./chunk-6H7O2OPM.js";
|
|
56
|
+
import "./chunk-BGP54HVR.js";
|
|
57
|
+
import "./chunk-6K2M4VSR.js";
|
|
55
58
|
import "./chunk-XHVV4NVW.js";
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
59
|
+
import "./chunk-E7Y3SYKW.js";
|
|
60
|
+
import "./chunk-5WPNFSXP.js";
|
|
58
61
|
import "./chunk-QQJUTGQH.js";
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
62
|
+
import "./chunk-2UJSV2VT.js";
|
|
63
|
+
import "./chunk-332ZR4QU.js";
|
|
64
|
+
import "./chunk-RBHWPDBB.js";
|
|
65
|
+
import "./chunk-KFNWFNAA.js";
|
|
66
|
+
import "./chunk-5PDTIBLV.js";
|
|
67
|
+
import "./chunk-7L4UJOY6.js";
|
|
65
68
|
import "./chunk-USZW2HHU.js";
|
|
66
|
-
import "./chunk-
|
|
67
|
-
import "./chunk-
|
|
68
|
-
import "./chunk-
|
|
69
|
-
import "./chunk-
|
|
70
|
-
import "./chunk-
|
|
69
|
+
import "./chunk-EDA6C7MV.js";
|
|
70
|
+
import "./chunk-TMACGPW5.js";
|
|
71
|
+
import "./chunk-RBDIYLA5.js";
|
|
72
|
+
import "./chunk-JJXGQIRV.js";
|
|
73
|
+
import "./chunk-IEDMFNU7.js";
|
|
74
|
+
import "./chunk-3LV2NCB6.js";
|
|
71
75
|
import "./chunk-IYULMRBE.js";
|
|
72
76
|
import {
|
|
73
77
|
resolvePaletteOrFallback
|
|
74
78
|
} from "./chunk-R3XI2VC7.js";
|
|
75
79
|
import "./chunk-P6T66CCZ.js";
|
|
76
|
-
import "./chunk-
|
|
80
|
+
import "./chunk-RLFVAKEO.js";
|
|
77
81
|
import "./chunk-C3Z4DX3V.js";
|
|
78
|
-
import "./chunk-
|
|
79
|
-
import "./chunk-
|
|
82
|
+
import "./chunk-467TVMQL.js";
|
|
83
|
+
import "./chunk-OZPBJM5Q.js";
|
|
80
84
|
import "./chunk-I46X5VUA.js";
|
|
81
|
-
import "./chunk-
|
|
85
|
+
import "./chunk-5F5ELR3V.js";
|
|
82
86
|
import "./chunk-NXMESY4J.js";
|
|
83
|
-
import "./chunk-
|
|
84
|
-
import "./chunk-
|
|
87
|
+
import "./chunk-FC5I2KXV.js";
|
|
88
|
+
import "./chunk-WQLMU7VG.js";
|
|
85
89
|
import "./chunk-FMDSF3OV.js";
|
|
86
90
|
import "./chunk-FFUN5D66.js";
|
|
87
91
|
import "./chunk-NOTA6TEI.js";
|
|
88
|
-
import "./chunk-
|
|
92
|
+
import "./chunk-LV4BETUU.js";
|
|
89
93
|
import "./chunk-TLVIHFRO.js";
|
|
90
94
|
import "./chunk-CXK4DZH3.js";
|
|
91
95
|
import "./chunk-5WRI5ZAA.js";
|
|
@@ -183,7 +187,7 @@ var parser = LRParser.deserialize({
|
|
|
183
187
|
maxTerm: 40,
|
|
184
188
|
skippedNodes: [0],
|
|
185
189
|
repeatNodeCount: 2,
|
|
186
|
-
tokenData: "
|
|
190
|
+
tokenData: "={~RzOX#uXY#zYZ$VZp#upq#zqr#urs$[st#uux#uxy%eyz%lz{%s{|%z|}&R}!O&Y!O!P#u!P!Q&i!Q!['Y![!]1Q!]!^#u!^!_1X!_!`1`!`!a1m!a!b1t!b!c#u!c!}1{!}#O5R#O#P#u#P#Q5W#Q#R#u#R#S1{#S#T#u#T#[1{#[#]5_#]#o1{#o#p#u#p#q=_#q#r#u#r#s=f#s;'S#u;'S;=`=u<%lO#u~#zOq~~$PQv~XY#zpq#z~$[Ow~~$aUq~OY$sZr$srs%Ys;'S$s;'S;=`%_<%lO$s~$vUOY$sZr$srs%Ys;'S$s;'S;=`%_<%lO$s~%_Oo~~%bP;=`<%l$s~%lOc~q~~%sOd~q~~%zOm~q~~&ROj~q~~&YOi~q~~&aPk~q~!`!a&d~&iOX~~&nPq~!P!Q&q~&vSV~OY&qZ;'S&q;'S;=`'S<%lO&q~'VP;=`<%l&q~'a^^~q~uv(]|}(b!O!P)_!P!Q+O!Q![,Y#R#S0l#U#V*Y#W#X*`#[#]*`#a#b*m#e#f*`#g#h*`#k#l*`#m#n*`~(bO]~~(eP!Q![(h~(kP!Q![(n~(qP!Q![(t~(yQ^~|}(b!O!P)P~)SP!Q![)V~)[P^~!Q![)V~)bP!Q![)e~)jY^~uv(]!Q![)e#U#V*Y#W#X*`#[#]*`#a#b*m#e#f*`#g#h*`#k#l*`#m#n*`~*]P#W#X*`~*ePZ~!a!b*h~*mOZ~~*rQZ~!a!b*h#]#^*x~*{P#b#c*`~+RP!Q![+U~+ZQ[~!P!Q+a!Q![,Q~+dP!Q![+g~+jP!Q![+m~+rP[~!Q![+u~+xP!Q![+{~,QO[~~,VP[~!P!Q+a~,_^^~uv(]|}(b!O!P)_!P!Q+O!Q![-Z#R#S0l#U#V*Y#W#X*`#[#]*`#a#b*m#e#f*`#g#h*`#k#l*`#m#n*`~-`]^~uv(]|}(b!O!P)_!Q![.X#R#S0l#U#V*Y#W#X*`#[#]*`#a#b*m#e#f*`#g#h*`#k#l*`#m#n*`~.^]^~uv(]}!O/V!O!P)_!Q![/q#R#S0l#U#V*Y#W#X*`#[#]*`#a#b*m#e#f*`#g#h*`#k#l*`#m#n*`~/YP!Q![/]~/`P!Q![/c~/hP[~}!O/k~/nP!Q![+u~/v[^~uv(]!O!P)_!Q![/q#R#S0l#U#V*Y#W#X*`#[#]*`#a#b*m#e#f*`#g#h*`#k#l*`#m#n*`~0oP!Q![0r~0wR^~!O!P)P!Q![0r#R#S0l~1XOh~q~~1`Oe~q~~1ePq~!_!`1h~1mO_~~1tOf~q~~1{On~q~~2S_p~q~qr3Rst3Rvw3Rwx3R{|3R}!O4V!O!P3R!P!Q3R!Q![3R!_!`3R!a!b3R!b!c3R!c!}3R#R#S3R#T#o3R~3W_p~qr3Rst3Rvw3Rwx3R{|3R}!O4V!O!P3R!P!Q3R!Q![3R!_!`3R!a!b3R!b!c3R!c!}3R#R#S3R#T#o3R~4Y]qr3Rst3Rvw3Rwx3R{|3R!O!P3R!P!Q3R!_!`3R!a!b3R!b!c3R!c!}3R#R#S3R#T#o3R~5WOa~~5_Ob~q~~5fap~q~qr3Rst3Rvw3Rwx3R{|3R}!O4V!O!P3R!P!Q3R!Q![3R!_!`3R!a!b3R!b!c3R!c!}3R#R#S3R#T#h3R#h#i6k#i#o3R~6pap~qr3Rst3Rvw3Rwx3R{|3R}!O4V!O!P3R!P!Q3R!Q![3R!_!`3R!a!b3R!b!c3R!c!}3R#R#S3R#T#h3R#h#i7u#i#o3R~7zap~qr3Rst3Rvw3Rwx3R{|3R}!O4V!O!P3R!P!Q3R!Q![3R!_!`3R!a!b3R!b!c3R!c!}3R#R#S3R#T#d3R#d#e9P#e#o3R~9Ubp~qr3Rst3Rvw3Rwx3R{|3R}!O4V!O!P3R!P!Q3R!Q![3R![!]:^!_!`3R!a!b3R!b!c3R!c!}3R#R#S3R#T#g3R#g#h<W#h#o3R~:aP!P!Q:d~:gP!P!Q:j~:mYOX;]Zp;]qy;]z|;]}!`;]!a#P;]#Q#p;]#q;'S;];'S;=`<Q<%lO;]~;bY`~OX;]Zp;]qy;]z|;]}!`;]!a#P;]#Q#p;]#q;'S;];'S;=`<Q<%lO;]~<TP;=`<%l;]~<]`p~qr3Rst3Rvw3Rwx3R{|3R}!O4V!O!P3R!P!Q3R!Q![3R![!]:^!_!`3R!a!b3R!b!c3R!c!}3R#R#S3R#T#o3R~=fOg~q~~=mPl~q~!`!a=p~=uOY~~=xP;=`<%l#u",
|
|
187
191
|
tokenizers: [0],
|
|
188
192
|
topRules: { "Document": [0, 6] },
|
|
189
193
|
specialized: [{ term: 32, get: (value, stack) => specializeKeyword(value, stack) << 1, external: specializeKeyword }],
|
|
@@ -610,21 +614,25 @@ var BLOCK_CSS = `
|
|
|
610
614
|
}
|
|
611
615
|
|
|
612
616
|
/* === Toolbar ===
|
|
613
|
-
* The diagram is the star: the toolbar is
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
* the
|
|
617
|
+
* The diagram is the star: the toolbar is an overlay pinned to the diagram's
|
|
618
|
+
* top-right corner (position:absolute \u2014 it reserves no layout space, so the
|
|
619
|
+
* block is exactly as tall as the chart). It stays fully transparent until
|
|
620
|
+
* the block is hovered or focused, or the source panel is open. It is the
|
|
621
|
+
* <summary> of the source <details>, so toggling works without any JS.
|
|
617
622
|
* No text labels, no disclosure triangle \u2014 three wordless icon buttons. */
|
|
618
623
|
.dgmo-source-wrap {
|
|
619
624
|
margin: 0;
|
|
620
625
|
}
|
|
621
626
|
.dgmo-toolbar {
|
|
627
|
+
position: absolute;
|
|
628
|
+
top: 0.4em;
|
|
629
|
+
right: 0.4em;
|
|
630
|
+
z-index: 2;
|
|
622
631
|
display: flex;
|
|
623
632
|
align-items: center;
|
|
624
633
|
justify-content: flex-end;
|
|
625
634
|
gap: 0.25em;
|
|
626
|
-
|
|
627
|
-
padding: 0.15em 0;
|
|
635
|
+
padding: 0.15em;
|
|
628
636
|
opacity: 0;
|
|
629
637
|
transition: opacity 0.15s ease;
|
|
630
638
|
cursor: pointer;
|
|
@@ -727,6 +735,14 @@ var BLOCK_CSS = `
|
|
|
727
735
|
overflow: auto;
|
|
728
736
|
border-radius: 0.5em;
|
|
729
737
|
box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
|
|
738
|
+
/* Opaque surface behind the enlarged diagram so a transparent embed doesn't
|
|
739
|
+
* show the page through it. The client overrides this inline with the block's
|
|
740
|
+
* own palette bg (data-dgmo-bg); this is the fallback for blocks that predate
|
|
741
|
+
* that attribute. */
|
|
742
|
+
background: #fff;
|
|
743
|
+
}
|
|
744
|
+
[data-theme="dark"] .dgmo-lightbox-svg {
|
|
745
|
+
background: #1e1e1e;
|
|
730
746
|
}
|
|
731
747
|
.dgmo-lightbox-svg > svg {
|
|
732
748
|
display: block;
|
|
@@ -761,9 +777,10 @@ var BLOCK_CSS = `
|
|
|
761
777
|
* border so the code visibly belongs to the chart above it. The frame box
|
|
762
778
|
* (border + padding) is RESERVED at all times \u2014 with the border transparent
|
|
763
779
|
* while closed \u2014 so opening the panel only paints the border in. It never
|
|
764
|
-
* reflows the diagram
|
|
765
|
-
*
|
|
780
|
+
* reflows the diagram. position:relative anchors the overlay toolbar to
|
|
781
|
+
* this box. */
|
|
766
782
|
.dgmo:has(> .dgmo-source-wrap) {
|
|
783
|
+
position: relative;
|
|
767
784
|
border: 1px solid transparent;
|
|
768
785
|
border-radius: 0.6em;
|
|
769
786
|
padding: 0.75em 0.75em 0.5em;
|
|
@@ -806,6 +823,13 @@ var BLOCK_CSS = `
|
|
|
806
823
|
font-size: 0.85em;
|
|
807
824
|
margin: 0.5em 0 0;
|
|
808
825
|
}
|
|
826
|
+
.dgmo-error-docs {
|
|
827
|
+
display: inline-block;
|
|
828
|
+
margin-top: 0.6em;
|
|
829
|
+
font-size: 0.9em;
|
|
830
|
+
font-weight: 600;
|
|
831
|
+
color: inherit;
|
|
832
|
+
}
|
|
809
833
|
|
|
810
834
|
/* === Source highlight roles ===
|
|
811
835
|
* Light values mirror LIGHT_ROLE_STYLES; dark overrides mirror
|
|
@@ -952,6 +976,7 @@ function resolveBlockOptions(opts) {
|
|
|
952
976
|
mode,
|
|
953
977
|
palette: opts.palette ?? "slate",
|
|
954
978
|
colorMode: opts.colorMode ?? "auto",
|
|
979
|
+
background: opts.background ?? "auto",
|
|
955
980
|
showSource: opts.showSource ?? showcase,
|
|
956
981
|
showCopy: opts.showCopy ?? showcase,
|
|
957
982
|
showExpand: opts.showExpand ?? showcase,
|
|
@@ -969,8 +994,10 @@ async function renderDgmoBlock(source, options = {}) {
|
|
|
969
994
|
const trimmed = source.trim();
|
|
970
995
|
const palette = resolvePaletteOrFallback(opts.palette, opts.onWarn);
|
|
971
996
|
const diagnostics = [];
|
|
997
|
+
let chartType;
|
|
972
998
|
const renderTheme = async (theme) => {
|
|
973
999
|
const r = await render(trimmed, { palette: palette.id, theme });
|
|
1000
|
+
chartType = r.chartType;
|
|
974
1001
|
diagnostics.push(...r.diagnostics);
|
|
975
1002
|
const errors = r.diagnostics.filter((d) => d.severity === "error");
|
|
976
1003
|
return errors.length ? renderErrorCard(errors, trimmed, palette, theme) : r.svg;
|
|
@@ -981,10 +1008,13 @@ async function renderDgmoBlock(source, options = {}) {
|
|
|
981
1008
|
renderTheme("light"),
|
|
982
1009
|
renderTheme("dark")
|
|
983
1010
|
]);
|
|
984
|
-
|
|
1011
|
+
const background = opts.background === "auto" ? defaultEmbedBackground(chartType) : opts.background;
|
|
1012
|
+
svgsHtml = `<div class="${escapeAttr(innerClasses(opts, "dgmo-light"))}" data-dgmo-bg="${escapeAttr(palette.light.bg)}">${normalizeSvgForEmbed(light, { background })}</div><div class="${escapeAttr(innerClasses(opts, "dgmo-dark"))}" data-dgmo-bg="${escapeAttr(palette.dark.bg)}">${normalizeSvgForEmbed(dark, { background })}</div>`;
|
|
985
1013
|
} else {
|
|
986
1014
|
const svg = await renderTheme(opts.colorMode);
|
|
987
|
-
|
|
1015
|
+
const background = opts.background === "auto" ? defaultEmbedBackground(chartType) : opts.background;
|
|
1016
|
+
const paletteBg = palette[opts.colorMode === "dark" ? "dark" : "light"].bg;
|
|
1017
|
+
svgsHtml = `<div class="${escapeAttr(innerClasses(opts, "dgmo-svg"))}" data-dgmo-bg="${escapeAttr(paletteBg)}">${normalizeSvgForEmbed(svg, { background })}</div>`;
|
|
988
1018
|
}
|
|
989
1019
|
return { html: assembleBlock(trimmed, svgsHtml, opts), diagnostics };
|
|
990
1020
|
}
|
|
@@ -996,7 +1026,8 @@ function errorBlockHtml(err, source, options = {}) {
|
|
|
996
1026
|
const base = options.className ?? "dgmo";
|
|
997
1027
|
const legacy = (options.legacyClassNames ?? []).join(" ");
|
|
998
1028
|
const cls = legacy ? `${base} ${legacy} ${base}--error` : `${base} ${base}--error`;
|
|
999
|
-
|
|
1029
|
+
const docs = docsLink(source);
|
|
1030
|
+
return `<div class="${escapeAttr(cls)}" role="alert"><strong>dgmo render error:</strong> ${escapeHtml(msg)}<pre>${escapeHtml(source)}</pre><a class="${escapeAttr(base)}-error-docs" href="${escapeAttr(docs.url)}" target="_blank" rel="noopener noreferrer">${escapeHtml(docs.label)}</a></div>`;
|
|
1000
1031
|
}
|
|
1001
1032
|
function wrapperClasses(opts, variant) {
|
|
1002
1033
|
const base = `${opts.className} ${opts.className}--${variant}`;
|
|
@@ -1012,7 +1043,7 @@ function assembleBlock(source, svgsHtml, opts) {
|
|
|
1012
1043
|
const showcase = opts.mode === "showcase";
|
|
1013
1044
|
const variant = showcase ? "showcase" : "diagram";
|
|
1014
1045
|
const ariaAttr = opts.title ? ` aria-label="${escapeAttr(opts.title)}"` : "";
|
|
1015
|
-
const sourceHtml =
|
|
1046
|
+
const sourceHtml = sourceDisclosure(source, opts);
|
|
1016
1047
|
return `<${Wrapper} class="${escapeAttr(wrapperClasses(opts, variant))}"${ariaAttr}>` + svgsHtml + sourceHtml + `</${Wrapper}>`;
|
|
1017
1048
|
}
|
|
1018
1049
|
var CODE_ICON = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m10 4.5 4 3.5-4 3.5"/><path d="m6 4.5-4 3.5 4 3.5"/></svg>`;
|
|
@@ -1020,8 +1051,7 @@ var COPY_ICON = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" str
|
|
|
1020
1051
|
var EXTERNAL_ICON = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.5 2.5h4v4"/><path d="M13.5 2.5 7 9"/><path d="M12.5 9.5v3a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h3"/></svg>`;
|
|
1021
1052
|
var EXPAND_ICON = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.5 2.5h4v4"/><path d="M6.5 13.5h-4v-4"/><path d="M13.5 2.5 9 7"/><path d="M2.5 13.5 7 9"/></svg>`;
|
|
1022
1053
|
function sourceDisclosure(source, opts) {
|
|
1023
|
-
|
|
1024
|
-
const toggle = `<span class="dgmo-toggle" title="View DGMO source">${CODE_ICON}</span>`;
|
|
1054
|
+
const toggle = opts.showSource ? `<span class="dgmo-toggle" title="View DGMO source">${CODE_ICON}</span>` : "";
|
|
1025
1055
|
const expandButton = opts.showExpand ? `<button type="button" class="dgmo-toolbar-btn dgmo-expand" aria-label="View full screen" title="Expand">${EXPAND_ICON}</button>` : "";
|
|
1026
1056
|
const copyButton = opts.showCopy ? `<button type="button" class="dgmo-toolbar-btn dgmo-copy" aria-label="Copy DGMO source" title="Copy source" data-dgmo-source="${escapeAttr(source)}">${COPY_ICON}</button>` : "";
|
|
1027
1057
|
let openButton = "";
|
|
@@ -1031,8 +1061,13 @@ function sourceDisclosure(source, opts) {
|
|
|
1031
1061
|
openButton = `<a href="${escapeAttr(encoded.url)}" target="_blank" rel="noopener noreferrer" class="dgmo-toolbar-btn dgmo-open" aria-label="Open in online editor" title="Open in online editor">${EXTERNAL_ICON}</a>`;
|
|
1032
1062
|
}
|
|
1033
1063
|
}
|
|
1064
|
+
const buttons = `${toggle}${expandButton}${copyButton}${openButton}`;
|
|
1065
|
+
if (!buttons) return "";
|
|
1066
|
+
if (!opts.showSource) {
|
|
1067
|
+
return `<div class="dgmo-source-wrap"><div class="dgmo-toolbar">${buttons}</div></div>`;
|
|
1068
|
+
}
|
|
1034
1069
|
const sourceHtml = highlightedSource(source);
|
|
1035
|
-
return `<details class="dgmo-source-wrap"><summary class="dgmo-toolbar" aria-label="View DGMO source">${
|
|
1070
|
+
return `<details class="dgmo-source-wrap"><summary class="dgmo-toolbar" aria-label="View DGMO source">${buttons}</summary><div class="dgmo-source-inner">${sourceHtml}</div></details>`;
|
|
1036
1071
|
}
|
|
1037
1072
|
function highlightedSource(source) {
|
|
1038
1073
|
const tokens = highlightDgmo(source);
|
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
D3_DATA_CHART_TYPES,
|
|
3
3
|
renderDataChartD3,
|
|
4
4
|
supportsD3DataChart
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-4VWJ4LW2.js";
|
|
6
|
+
import "./chunk-VL2O2F3W.js";
|
|
7
7
|
import "./chunk-U6EQI3U6.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-YAA6IID3.js";
|
|
9
9
|
import "./chunk-A4GOY3PE.js";
|
|
10
10
|
import "./chunk-6KFWC4CO.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-QOOUC2J5.js";
|
|
12
|
+
import "./chunk-WCT3NYCV.js";
|
|
13
|
+
import "./chunk-QZPEGJOM.js";
|
|
14
14
|
import "./chunk-R3XI2VC7.js";
|
|
15
15
|
import "./chunk-P6T66CCZ.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-467TVMQL.js";
|
|
17
|
+
import "./chunk-LV4BETUU.js";
|
|
18
18
|
import "./chunk-TLVIHFRO.js";
|
|
19
19
|
import "./chunk-CXK4DZH3.js";
|
|
20
20
|
import "./chunk-5WRI5ZAA.js";
|
|
@@ -23,4 +23,4 @@ export {
|
|
|
23
23
|
renderDataChartD3,
|
|
24
24
|
supportsD3DataChart
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=charts-d3-
|
|
26
|
+
//# sourceMappingURL=charts-d3-7E4B4IMW.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
splitNameAndMeta,
|
|
6
6
|
tryParseSharedOption,
|
|
7
7
|
warnUnknownMetaKeys
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LV4BETUU.js";
|
|
9
9
|
import {
|
|
10
10
|
makeDgmoError,
|
|
11
11
|
makeFail
|
|
@@ -274,4 +274,4 @@ function parseCycle(content) {
|
|
|
274
274
|
export {
|
|
275
275
|
parseCycle
|
|
276
276
|
};
|
|
277
|
-
//# sourceMappingURL=chunk-
|
|
277
|
+
//# sourceMappingURL=chunk-2EQMXBBQ.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
tagAttrKey,
|
|
8
8
|
validateTagGroupNames,
|
|
9
9
|
validateTagValues
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-467TVMQL.js";
|
|
11
11
|
import {
|
|
12
12
|
TREEMAP_REGISTRY,
|
|
13
13
|
extractColor,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
stripQuotes,
|
|
19
19
|
warnUnknownMetaKeys,
|
|
20
20
|
withTagAliases
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-LV4BETUU.js";
|
|
22
22
|
import {
|
|
23
23
|
emit,
|
|
24
24
|
formatDgmoError,
|
|
@@ -377,4 +377,4 @@ export {
|
|
|
377
377
|
TREEMAP_DIAGNOSTICS,
|
|
378
378
|
parseTreemap
|
|
379
379
|
};
|
|
380
|
-
//# sourceMappingURL=chunk-
|
|
380
|
+
//# sourceMappingURL=chunk-2ILHQOL3.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
tagAttrKey,
|
|
11
11
|
validateTagGroupNames,
|
|
12
12
|
validateTagValues
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-467TVMQL.js";
|
|
14
14
|
import {
|
|
15
15
|
MINDMAP_REGISTRY,
|
|
16
16
|
OPTION_NOCOLON_RE,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
tryParseSharedOption,
|
|
22
22
|
warnUnknownMetaKeys,
|
|
23
23
|
withTagAliases
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-LV4BETUU.js";
|
|
25
25
|
import {
|
|
26
26
|
formatDgmoError,
|
|
27
27
|
makeDgmoError,
|
|
@@ -313,4 +313,4 @@ function findMetadataParent(indent, indentStack) {
|
|
|
313
313
|
export {
|
|
314
314
|
parseMindmap
|
|
315
315
|
};
|
|
316
|
-
//# sourceMappingURL=chunk-
|
|
316
|
+
//# sourceMappingURL=chunk-2UJSV2VT.js.map
|