@diagrammo/dgmo 0.48.2 → 0.49.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/.cursorrules +8 -3
- package/.github/copilot-instructions.md +8 -3
- package/.windsurfrules +8 -3
- package/SKILL.md +8 -3
- package/dist/advanced.d.ts +444 -1
- package/dist/advanced.js +208 -146
- package/dist/auto.css +63 -0
- package/dist/auto.js +202 -102
- package/dist/auto.mjs +6849 -824
- package/dist/block.css +63 -0
- package/dist/block.d.ts +13 -5
- package/dist/block.js +137 -57
- package/dist/{charts-d3-QOZHKTCT.js → charts-d3-EW3YQTEA.js} +9 -8
- package/dist/chunk-26RVGM44.js +331 -0
- package/dist/{chunk-44CM72SQ.js → chunk-2WMBWZY2.js} +3 -3
- package/dist/{chunk-L66GEFB6.js → chunk-35BBZDFE.js} +4 -4
- package/dist/{chunk-4GRI7MEB.js → chunk-3BIAFYD2.js} +6 -6
- package/dist/chunk-3NFJWFNP.js +1474 -0
- package/dist/{chunk-76OWZ3BA.js → chunk-4BD7EVPK.js} +2 -2
- package/dist/{chunk-MITI6NOL.js → chunk-4FIV4K4Z.js} +9 -9
- package/dist/chunk-4HVNZ7WF.js +574 -0
- package/dist/{chunk-X5LCYCL5.js → chunk-4NQ3IKUM.js} +2 -2
- package/dist/{chunk-PWIHZ6NJ.js → chunk-4UDKKGHH.js} +4 -4
- package/dist/{chunk-6NYWYNBI.js → chunk-4XK3FLFB.js} +3 -3
- package/dist/chunk-4YNP6O47.js +607 -0
- package/dist/{chunk-3MQQNXPD.js → chunk-5FGDJIJX.js} +3 -3
- package/dist/{chunk-WCT3NYCV.js → chunk-5LWQH6QV.js} +1 -1
- package/dist/chunk-5XCM7UUW.js +261 -0
- package/dist/{chunk-RYEGFMUO.js → chunk-5ZZLLBFK.js} +2 -2
- package/dist/{chunk-EB6FPQUP.js → chunk-65RTDUZH.js} +3 -3
- package/dist/chunk-6CLKNXVP.js +664 -0
- package/dist/{chunk-H6PI3KJT.js → chunk-6IUAK7RZ.js} +2 -2
- package/dist/{chunk-ZGR7ULFJ.js → chunk-6SA7FJE4.js} +31 -19
- package/dist/{chunk-LIOHW36Z.js → chunk-6VE3VLWM.js} +3 -3
- package/dist/{chunk-AN2MOO5T.js → chunk-7OVSJI2V.js} +3 -3
- package/dist/{chunk-YAA6IID3.js → chunk-7UEMZREK.js} +2 -2
- package/dist/{chunk-FCIIHT24.js → chunk-7VLUGEMJ.js} +7 -7
- package/dist/{chunk-VOKGH627.js → chunk-AHGF2YYA.js} +13 -3
- package/dist/{chunk-3R5POCTZ.js → chunk-AJ2PEY7J.js} +6 -6
- package/dist/{chunk-PBHE5UG6.js → chunk-ALRHIR6I.js} +46 -12
- package/dist/{chunk-7JEGTRLD.js → chunk-B57V3DWN.js} +3 -3
- package/dist/{chunk-ILKORZ3H.js → chunk-BCT5G2VN.js} +7 -7
- package/dist/{chunk-TYS6CSS5.js → chunk-BCYVE3N5.js} +2 -2
- package/dist/{chunk-ZBWMSD5N.js → chunk-BGJV5ATD.js} +4 -4
- package/dist/{chunk-G2H74XJZ.js → chunk-BPIJLRYE.js} +8 -8
- package/dist/{chunk-YGJTDXVR.js → chunk-C4GQDB5L.js} +2 -2
- package/dist/{chunk-Y2ZE3MSG.js → chunk-C63UWAKM.js} +2 -2
- package/dist/{chunk-QEBUY5NY.js → chunk-CEHZOPGM.js} +4 -4
- package/dist/{chunk-725LDASD.js → chunk-CLD2OKV7.js} +2 -2
- package/dist/{chunk-5QXL4NYS.js → chunk-CLR4A2N2.js} +10 -5
- package/dist/{chunk-WBRZJOEC.js → chunk-CMCR5WBW.js} +3 -3
- package/dist/{chunk-SML67VPV.js → chunk-D5AVQCDN.js} +3 -3
- package/dist/{chunk-2LACINWN.js → chunk-DDTJ5N7Q.js} +9 -9
- package/dist/{chunk-FITOLXSX.js → chunk-EOFPYPAU.js} +26 -2
- package/dist/{chunk-B65G5DNL.js → chunk-EYN7VFKL.js} +3 -3
- package/dist/{chunk-4OHACBGX.js → chunk-F2L5GCQ4.js} +2 -2
- package/dist/{chunk-RVMRZAPB.js → chunk-F743CM2N.js} +3 -3
- package/dist/{chunk-3JLKYGBQ.js → chunk-F7BFXWNQ.js} +2 -2
- package/dist/{chunk-WCSOJFU3.js → chunk-FMKTYMP4.js} +3 -3
- package/dist/{chunk-RTLBSQ3G.js → chunk-FUCAB3KQ.js} +3 -3
- package/dist/{chunk-SGZYXELT.js → chunk-GB3YZTAM.js} +9 -6
- package/dist/{chunk-QLCCJEJI.js → chunk-HBVD67XG.js} +2 -2
- package/dist/{chunk-PBAHEPLQ.js → chunk-HGN652MU.js} +7 -6
- package/dist/{chunk-3SMGIJDD.js → chunk-HHXOONLX.js} +13 -1
- package/dist/{chunk-QOOUC2J5.js → chunk-HQCHYB5F.js} +2 -2
- package/dist/chunk-IAEC4KLA.js +492 -0
- package/dist/{chunk-J5FIXQRT.js → chunk-IBC35BTK.js} +4 -4
- package/dist/{chunk-NURGB5Z4.js → chunk-IFK3GIUW.js} +2 -2
- package/dist/{chunk-FANX6UJR.js → chunk-IHLSHCPZ.js} +11 -11
- package/dist/{chunk-GMR5MFHJ.js → chunk-IUK7AGD4.js} +2 -2
- package/dist/chunk-IVKC4GID.js +32 -0
- package/dist/{chunk-OJR3MQYV.js → chunk-JFPY3UJ7.js} +296 -57
- package/dist/{chunk-5MLYVTYM.js → chunk-K6HNAY5V.js} +2 -2
- package/dist/{chunk-P235SVAH.js → chunk-KQAEKMIX.js} +2 -2
- package/dist/{chunk-7DTWEFUE.js → chunk-KUBBJ2CD.js} +10 -10
- package/dist/{chunk-BUVJFRPY.js → chunk-KV6Y2HE6.js} +4 -4
- package/dist/{chunk-OURHMODR.js → chunk-LG4TWW4U.js} +13 -13
- package/dist/{chunk-XAKEUMEJ.js → chunk-LVHPTBO3.js} +3 -3
- package/dist/{chunk-ERLBPDGU.js → chunk-MJCG5K2O.js} +2 -2
- package/dist/{chunk-THXCFRTU.js → chunk-N4J5KGWG.js} +12 -12
- package/dist/{chunk-MZSBFAPJ.js → chunk-NVT6C2VE.js} +9 -9
- package/dist/{chunk-AELOBFW5.js → chunk-O5MQPK7E.js} +3 -3
- package/dist/{chunk-JM4LEPY3.js → chunk-O7NUCTFU.js} +2 -2
- package/dist/{chunk-JED6ZDEE.js → chunk-O7WP4ZD4.js} +2 -2
- package/dist/{chunk-ZO27FGJS.js → chunk-PH5X4GIP.js} +2 -2
- package/dist/{chunk-B7JUCQUA.js → chunk-PU3AUQPA.js} +4 -4
- package/dist/{chunk-YGJZWZTY.js → chunk-PZFVK3IH.js} +2 -2
- package/dist/chunk-QQJUTGQH.js +135 -0
- package/dist/{chunk-HSH73DP6.js → chunk-RI4NIMFP.js} +99 -39
- package/dist/{chunk-33LCUH4H.js → chunk-RTERS6S5.js} +3 -3
- package/dist/{chunk-T3UBLACL.js → chunk-SCQ5VPUF.js} +19 -5
- package/dist/chunk-SGHSY3LU.js +377 -0
- package/dist/{chunk-SRTU6HMQ.js → chunk-SJEGO2QL.js} +8 -8
- package/dist/chunk-SQDFK5ZQ.js +273 -0
- package/dist/{chunk-PZMETGLY.js → chunk-SVDWQGX2.js} +296 -121
- package/dist/{chunk-Z5CGSFJB.js → chunk-T7IKPCMI.js} +4 -4
- package/dist/chunk-TC3YWBFO.js +233 -0
- package/dist/{chunk-EVCVDTXE.js → chunk-TLKMTQYL.js} +3 -3
- package/dist/{chunk-IJZFN3HM.js → chunk-TWQUYVP3.js} +4 -4
- package/dist/{chunk-IZMRON6C.js → chunk-UVCXZEGU.js} +2 -2
- package/dist/{chunk-CKNVO24D.js → chunk-UWDO3O52.js} +2 -2
- package/dist/{chunk-RJE5JTVK.js → chunk-VC3TR4NL.js} +7 -7
- package/dist/{chunk-CI2G3OEB.js → chunk-X2CH42BN.js} +9 -9
- package/dist/{chunk-6HO5ZTXK.js → chunk-XCC2RENT.js} +2 -2
- package/dist/chunk-XHVV4NVW.js +51 -0
- package/dist/{chunk-ZJEL4H2R.js → chunk-XJ7J6WOO.js} +9 -9
- package/dist/{chunk-ULOEATBZ.js → chunk-XKTN7CZF.js} +106 -29
- package/dist/{chunk-IPWPWM6R.js → chunk-YM2BSPYW.js} +111 -10
- package/dist/{chunk-BUPDIHML.js → chunk-YRVLP7UU.js} +3 -3
- package/dist/{chunk-T2OE3YQB.js → chunk-YTN572Q2.js} +3 -3
- package/dist/{chunk-WVAJFAIA.js → chunk-YYX3SU6H.js} +3 -3
- package/dist/{chunk-MO5YHHMQ.js → chunk-ZDUQGL3N.js} +2 -2
- package/dist/{chunk-Y3J7VR52.js → chunk-ZNQX6QWH.js} +30 -2
- package/dist/{chunk-UWN33VNX.js → chunk-ZREZOIGS.js} +8 -8
- package/dist/{chunk-6SM5NJQH.js → chunk-ZTLWVRNS.js} +4 -4
- package/dist/{chunk-RUNNI6VE.js → chunk-ZXL6MB4R.js} +3 -3
- package/dist/cli.cjs +159 -122
- package/dist/dgmo-router-ODKPEJ3P.js +79 -0
- package/dist/dimensions-WSIJXT5Q.js +22 -0
- package/dist/editor.js +4 -1
- package/dist/element.js +203 -103
- package/dist/element.mjs +6849 -824
- package/dist/{flowchart-parser-ZNSKIBVR.js → flowchart-parser-IVZN7CQN.js} +4 -4
- package/dist/{flowchart-renderer-SNDSII4D.js → flowchart-renderer-GMI2U3DD.js} +9 -9
- package/dist/highlight.js +7 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +193 -232
- package/dist/{layout-HRBZPFCN.js → layout-34CLNICW.js} +5 -5
- package/dist/{layout-5RA6QWR6.js → layout-4Z5JM7PT.js} +6 -6
- package/dist/layout-6RDJHS6E.js +9 -0
- package/dist/{layout-7QXCNOVS.js → layout-7H4H46CS.js} +3 -3
- package/dist/{layout-46N4JJYK.js → layout-7SKMFYHL.js} +5 -5
- package/dist/{layout-HWDSRX5E.js → layout-D42XE4RE.js} +6 -6
- package/dist/{layout-EE6GE46Y.js → layout-DC4TVXER.js} +5 -5
- package/dist/layout-FGQWRYYW.js +14 -0
- package/dist/layout-GZ2CWONU.js +14 -0
- package/dist/layout-HQMBPJVS.js +10 -0
- package/dist/{layout-UM5F4DJB.js → layout-K2ZN3Q42.js} +5 -5
- package/dist/{layout-S2QBYSK2.js → layout-NXG63LWH.js} +3 -3
- package/dist/{layout-N76NR4ZO.js → layout-PUQCB6AN.js} +7 -7
- package/dist/{layout-HYZPWAK5.js → layout-QNUQLEHU.js} +3 -3
- package/dist/layout-S3EK4IYO.js +14 -0
- package/dist/{layout-search-OYV77HHS.js → layout-search-QS44PI5R.js} +6 -6
- package/dist/{parser-KNSQSKQO.js → parser-4BKIFG2C.js} +5 -5
- package/dist/{parser-OV7NOBW6.js → parser-4ROBKVUR.js} +4 -4
- package/dist/parser-667RGSUW.js +13 -0
- package/dist/{parser-IXSZZQHY.js → parser-BL7Z72EY.js} +4 -4
- package/dist/{parser-AQETEVRW.js → parser-CLMFZWCC.js} +4 -4
- package/dist/{parser-XKRP7QKP.js → parser-D6ONJQFR.js} +3 -3
- package/dist/{parser-2EWECDSA.js → parser-DERPY5KC.js} +4 -4
- package/dist/{parser-4OGOBJJ4.js → parser-GFSOPDB7.js} +4 -4
- package/dist/{parser-2MFP2H2E.js → parser-HVJFTOXL.js} +3 -3
- package/dist/{parser-VQP2UJ6W.js → parser-IKZFTLOJ.js} +3 -3
- package/dist/parser-J3P2D6IP.js +13 -0
- package/dist/{parser-PQ3POX45.js → parser-JD7OQ2E6.js} +4 -4
- package/dist/{parser-O5J4VBII.js → parser-K647FRI4.js} +3 -3
- package/dist/{parser-NGU3ETO6.js → parser-KPMN5KKE.js} +4 -4
- package/dist/{parser-4FL2CMDG.js → parser-MBJSBTL5.js} +4 -4
- package/dist/{parser-TFZFBVWN.js → parser-MCJWF5G3.js} +3 -3
- package/dist/{parser-NRAI6O25.js → parser-MRBPXXIV.js} +4 -4
- package/dist/{parser-6BTRLKRZ.js → parser-OBQG655V.js} +4 -4
- package/dist/{parser-3STE62GB.js → parser-QJYS7KQQ.js} +4 -4
- package/dist/{parser-XDVELHRK.js → parser-SMBJO3XN.js} +4 -4
- package/dist/{parser-TRTHDFPP.js → parser-TITK4YW6.js} +5 -5
- package/dist/{parser-I6KXEYFK.js → parser-TNYX5S7E.js} +4 -4
- package/dist/{parser-Y6WTBU76.js → parser-UBGPTIZD.js} +3 -3
- package/dist/parser-UGA23PYK.js +14 -0
- package/dist/{parser-N5O4IHUN.js → parser-WISPH7LW.js} +4 -4
- package/dist/{parser-CFZD5IBL.js → parser-XWUDFJ7P.js} +4 -4
- package/dist/parser-ZKF5K2H2.js +15 -0
- package/dist/{parser-ZSDPZYQP.js → parser-ZYC3XGNS.js} +4 -4
- package/dist/{renderer-AWWAF6XD.js → renderer-4IUPINAE.js} +10 -10
- package/dist/renderer-6L3NBEY5.js +24 -0
- package/dist/{renderer-ZRNG54CW.js → renderer-6T3KK4S3.js} +11 -11
- package/dist/{renderer-KQB7UGDS.js → renderer-7RH2SI3B.js} +3 -3
- package/dist/{renderer-6EEZHMH4.js → renderer-A5VFZQQK.js} +9 -9
- package/dist/{renderer-5MYBMBYO.js → renderer-BB5PREMY.js} +5 -5
- package/dist/{renderer-BYCNMBF7.js → renderer-CGW7QPNA.js} +10 -10
- package/dist/{renderer-QIWVHWZO.js → renderer-DAXMXIKD.js} +3 -3
- package/dist/{renderer-7MVLWWQD.js → renderer-DKESNMU5.js} +9 -9
- package/dist/{renderer-UV6MI64M.js → renderer-HVCU2C3Z.js} +3 -3
- package/dist/{renderer-VACVQYML.js → renderer-LWGJFT3D.js} +8 -8
- package/dist/{renderer-PGX2TKVS.js → renderer-MFJ7HY2H.js} +8 -8
- package/dist/{renderer-B2OMQIQG.js → renderer-MJDDU27W.js} +15 -15
- package/dist/{renderer-4JHRUBE6.js → renderer-QL5KO6SK.js} +10 -10
- package/dist/{renderer-W4M6QLIJ.js → renderer-QNHUXCRL.js} +14 -14
- package/dist/{renderer-ZGNTUWC4.js → renderer-ROV756WT.js} +8 -8
- package/dist/{renderer-YY2OSF6E.js → renderer-SQ3JUAI7.js} +9 -9
- package/dist/renderer-THD6V5TL.js +22 -0
- package/dist/{renderer-5NDVNDAZ.js → renderer-TPIBXNOS.js} +9 -9
- package/dist/{renderer-RPOA5YPZ.js → renderer-TYXRHMRI.js} +13 -13
- package/dist/{renderer-N43WR5GV.js → renderer-UZF3JROD.js} +11 -11
- package/dist/{renderer-6W5462RB.js → renderer-V3JEMWMM.js} +9 -9
- package/dist/{renderer-JGBKUCZD.js → renderer-VFUVRNLK.js} +4 -4
- package/dist/{renderer-Z7I3W2PP.js → renderer-VICQ4WNY.js} +8 -8
- package/dist/renderer-W5RMOURB.js +21 -0
- package/dist/renderer-XEKIRPI6.js +23 -0
- package/dist/{renderer-CLJHQPBJ.js → renderer-YHXPN3GF.js} +12 -12
- package/dist/renderer-radial-MHO2VDXN.js +21 -0
- package/dist/{resolver-NOAA7ID7.js → resolver-FHBCO3PL.js} +3 -3
- package/dist/{state-parser-Z2V23ATR.js → state-parser-RX3GXOIB.js} +4 -4
- package/dist/{state-renderer-B4DQBM6M.js → state-renderer-AJUKGNWU.js} +9 -9
- package/docs/ai-integration.md +8 -3
- package/docs/language-reference.md +179 -5
- package/gallery/fixtures/family.dgmo +23 -0
- package/gallery/fixtures/sketch.dgmo +22 -0
- package/package.json +1 -1
- package/dist/chunk-ODZVHU3R.js +0 -153
- package/dist/dgmo-router-X35VLZLM.js +0 -73
- package/dist/dimensions-J3FHIMJ6.js +0 -22
- package/dist/layout-5T6RH5M6.js +0 -14
- package/dist/layout-G23F7LDH.js +0 -9
- package/dist/layout-OB3RI63S.js +0 -14
- package/dist/parser-JAL2HD4I.js +0 -13
- package/dist/renderer-SMIBCRVB.js +0 -24
- package/dist/renderer-radial-C32GPJQ7.js +0 -21
package/dist/block.css
CHANGED
|
@@ -109,6 +109,69 @@
|
|
|
109
109
|
opacity: 1;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
/* === Full-screen lightbox ===
|
|
113
|
+
* The expand button clones the visible diagram into a native <dialog> that
|
|
114
|
+
* the client shows with showModal(): top-layer, so it escapes any transformed
|
|
115
|
+
* or overflow-clipped ancestor (docs sidebars) and fills the whole viewport.
|
|
116
|
+
* Escape / backdrop-click / the close button dismiss it. The <dialog> itself
|
|
117
|
+
* fills the viewport with a transparent background (so a click landing on it
|
|
118
|
+
* — outside the centered card — reads as a backdrop dismiss); the dim comes
|
|
119
|
+
* from ::backdrop. */
|
|
120
|
+
.dgmo-lightbox {
|
|
121
|
+
width: 100vw;
|
|
122
|
+
height: 100vh;
|
|
123
|
+
max-width: 100vw;
|
|
124
|
+
max-height: 100vh;
|
|
125
|
+
margin: 0;
|
|
126
|
+
padding: 0;
|
|
127
|
+
border: 0;
|
|
128
|
+
background: transparent;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
}
|
|
131
|
+
.dgmo-lightbox[open] {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
}
|
|
136
|
+
.dgmo-lightbox::backdrop {
|
|
137
|
+
background: rgba(0, 0, 0, 0.72);
|
|
138
|
+
}
|
|
139
|
+
.dgmo-lightbox-svg {
|
|
140
|
+
width: 95vw;
|
|
141
|
+
max-width: 95vw;
|
|
142
|
+
max-height: 95vh;
|
|
143
|
+
overflow: auto;
|
|
144
|
+
border-radius: 0.5em;
|
|
145
|
+
box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
|
|
146
|
+
}
|
|
147
|
+
.dgmo-lightbox-svg > svg {
|
|
148
|
+
display: block;
|
|
149
|
+
width: 100%;
|
|
150
|
+
height: auto;
|
|
151
|
+
max-width: 100%;
|
|
152
|
+
}
|
|
153
|
+
.dgmo-lightbox-close {
|
|
154
|
+
position: fixed;
|
|
155
|
+
top: max(1rem, env(safe-area-inset-top));
|
|
156
|
+
right: max(1rem, env(safe-area-inset-right));
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
width: 2.4em;
|
|
161
|
+
height: 2.4em;
|
|
162
|
+
border: 0;
|
|
163
|
+
border-radius: 50%;
|
|
164
|
+
background: rgba(0, 0, 0, 0.5);
|
|
165
|
+
color: #fff;
|
|
166
|
+
font-size: 1.25rem;
|
|
167
|
+
line-height: 1;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
transition: background-color 0.15s ease;
|
|
170
|
+
}
|
|
171
|
+
.dgmo-lightbox-close:hover {
|
|
172
|
+
background: rgba(0, 0, 0, 0.75);
|
|
173
|
+
}
|
|
174
|
+
|
|
112
175
|
/* === Frame the whole block ===
|
|
113
176
|
* When the source panel is open, diagram + toolbar + code get one shared
|
|
114
177
|
* border so the code visibly belongs to the chart above it. The frame box
|
package/dist/block.d.ts
CHANGED
|
@@ -29,11 +29,13 @@ declare const BLOCK_CSS: string;
|
|
|
29
29
|
*
|
|
30
30
|
* Chrome contract (user-approved 2026-07-05): the diagram is the star. A slim
|
|
31
31
|
* icon toolbar sits in a reserved row below the SVG, invisible until the
|
|
32
|
-
* block is hovered/focused or the source is open.
|
|
33
|
-
* buttons — `</>` toggles the hidden source panel,
|
|
34
|
-
* disclosure triangle, no text labels. The toolbar
|
|
35
|
-
* native <details>, so show/hide works with zero
|
|
36
|
-
*
|
|
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).
|
|
37
39
|
*
|
|
38
40
|
* Markup vocabulary: `figure.dgmo` (`--diagram`/`--showcase`/`--error`),
|
|
39
41
|
* `.dgmo-light`/`.dgmo-dark` (dual color-mode) or `.dgmo-svg` (single),
|
|
@@ -64,6 +66,12 @@ interface DgmoBlockOptions {
|
|
|
64
66
|
showSource?: boolean;
|
|
65
67
|
/** Default: true in showcase mode, false in diagram mode. */
|
|
66
68
|
showCopy?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Show the expand (full-screen) toolbar button. Default: true in showcase
|
|
71
|
+
* mode, false in diagram mode. Needs the client lightbox handler to do
|
|
72
|
+
* anything (mirrored across surfaces); markup-only surfaces can omit it.
|
|
73
|
+
*/
|
|
74
|
+
showExpand?: boolean;
|
|
67
75
|
/** Default: true in showcase mode, false in diagram mode. */
|
|
68
76
|
showOpenInEditor?: boolean;
|
|
69
77
|
/** Base URL for the open-in-editor link. Default: online.diagrammo.app. */
|
package/dist/block.js
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
|
-
normalizeSvgForEmbed
|
|
3
|
-
|
|
2
|
+
normalizeSvgForEmbed,
|
|
3
|
+
renderErrorCard
|
|
4
|
+
} from "./chunk-26RVGM44.js";
|
|
4
5
|
import {
|
|
5
6
|
encodeDiagramUrl,
|
|
6
7
|
render
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-SVDWQGX2.js";
|
|
9
|
+
import "./chunk-RI4NIMFP.js";
|
|
10
|
+
import "./chunk-5ZZLLBFK.js";
|
|
11
|
+
import "./chunk-TC3YWBFO.js";
|
|
12
|
+
import "./chunk-JFPY3UJ7.js";
|
|
13
|
+
import "./chunk-HGN652MU.js";
|
|
14
|
+
import "./chunk-KQAEKMIX.js";
|
|
15
|
+
import "./chunk-ZREZOIGS.js";
|
|
11
16
|
import "./chunk-YRYKTYMQ.js";
|
|
12
|
-
import "./chunk-U6EQI3U6.js";
|
|
13
|
-
import "./chunk-PWIHZ6NJ.js";
|
|
14
17
|
import "./chunk-YYVTBZZC.js";
|
|
15
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-U6EQI3U6.js";
|
|
19
|
+
import "./chunk-3NFJWFNP.js";
|
|
20
|
+
import "./chunk-4UDKKGHH.js";
|
|
21
|
+
import "./chunk-7UEMZREK.js";
|
|
16
22
|
import "./chunk-A4GOY3PE.js";
|
|
17
23
|
import "./chunk-6KFWC4CO.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-HQCHYB5F.js";
|
|
25
|
+
import "./chunk-5LWQH6QV.js";
|
|
26
|
+
import "./chunk-TLKMTQYL.js";
|
|
27
|
+
import "./chunk-IFK3GIUW.js";
|
|
28
|
+
import "./chunk-XCC2RENT.js";
|
|
29
|
+
import "./chunk-2WMBWZY2.js";
|
|
30
|
+
import "./chunk-4BD7EVPK.js";
|
|
31
|
+
import "./chunk-ZDUQGL3N.js";
|
|
32
|
+
import "./chunk-FMKTYMP4.js";
|
|
33
|
+
import "./chunk-B57V3DWN.js";
|
|
28
34
|
import "./chunk-NNAAJVBU.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-BUPDIHML.js";
|
|
35
|
+
import "./chunk-RTERS6S5.js";
|
|
36
|
+
import "./chunk-LVHPTBO3.js";
|
|
37
|
+
import "./chunk-YRVLP7UU.js";
|
|
33
38
|
import {
|
|
34
39
|
REGISTRY_COLON_KEY_TOKENS,
|
|
35
40
|
REGISTRY_CONTROL_TOKENS,
|
|
@@ -37,40 +42,42 @@ import {
|
|
|
37
42
|
REGISTRY_MODIFIER_TOKENS,
|
|
38
43
|
REGISTRY_STATUS_TOKENS
|
|
39
44
|
} from "./chunk-DKEPS5LH.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-KV6Y2HE6.js";
|
|
46
|
+
import "./chunk-4YNP6O47.js";
|
|
47
|
+
import "./chunk-XHVV4NVW.js";
|
|
48
|
+
import "./chunk-YYX3SU6H.js";
|
|
49
|
+
import "./chunk-4HVNZ7WF.js";
|
|
50
|
+
import "./chunk-QQJUTGQH.js";
|
|
51
|
+
import "./chunk-65RTDUZH.js";
|
|
52
|
+
import "./chunk-35BBZDFE.js";
|
|
53
|
+
import "./chunk-F743CM2N.js";
|
|
54
|
+
import "./chunk-7OVSJI2V.js";
|
|
55
|
+
import "./chunk-FUCAB3KQ.js";
|
|
49
56
|
import "./chunk-L3UHP6TD.js";
|
|
50
57
|
import "./chunk-USZW2HHU.js";
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-CLR4A2N2.js";
|
|
59
|
+
import "./chunk-IUK7AGD4.js";
|
|
60
|
+
import "./chunk-MJCG5K2O.js";
|
|
61
|
+
import "./chunk-O5MQPK7E.js";
|
|
62
|
+
import "./chunk-EYN7VFKL.js";
|
|
56
63
|
import "./chunk-IYULMRBE.js";
|
|
57
64
|
import {
|
|
58
65
|
resolvePaletteOrFallback
|
|
59
66
|
} from "./chunk-R3XI2VC7.js";
|
|
60
67
|
import "./chunk-P6T66CCZ.js";
|
|
61
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-D5AVQCDN.js";
|
|
62
69
|
import "./chunk-C3Z4DX3V.js";
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
70
|
+
import "./chunk-HBVD67XG.js";
|
|
71
|
+
import "./chunk-6VE3VLWM.js";
|
|
65
72
|
import "./chunk-I46X5VUA.js";
|
|
66
|
-
import "./chunk-
|
|
73
|
+
import "./chunk-5FGDJIJX.js";
|
|
67
74
|
import "./chunk-NXMESY4J.js";
|
|
68
|
-
import "./chunk-
|
|
69
|
-
import "./chunk-
|
|
75
|
+
import "./chunk-ZXL6MB4R.js";
|
|
76
|
+
import "./chunk-K6HNAY5V.js";
|
|
70
77
|
import "./chunk-FMDSF3OV.js";
|
|
71
78
|
import "./chunk-FFUN5D66.js";
|
|
72
79
|
import "./chunk-NOTA6TEI.js";
|
|
73
|
-
import "./chunk-
|
|
80
|
+
import "./chunk-ZNQX6QWH.js";
|
|
74
81
|
import "./chunk-TLVIHFRO.js";
|
|
75
82
|
import "./chunk-CXK4DZH3.js";
|
|
76
83
|
import "./chunk-5WRI5ZAA.js";
|
|
@@ -93,6 +100,7 @@ var CHART_TYPES = /* @__PURE__ */ new Set([
|
|
|
93
100
|
"class",
|
|
94
101
|
"er",
|
|
95
102
|
"org",
|
|
103
|
+
"family",
|
|
96
104
|
"kanban",
|
|
97
105
|
"c4",
|
|
98
106
|
"state",
|
|
@@ -111,6 +119,7 @@ var CHART_TYPES = /* @__PURE__ */ new Set([
|
|
|
111
119
|
"ring",
|
|
112
120
|
"treemap",
|
|
113
121
|
"block",
|
|
122
|
+
"sketch",
|
|
114
123
|
"raci",
|
|
115
124
|
"cycle",
|
|
116
125
|
// Data chart types
|
|
@@ -132,7 +141,8 @@ var CHART_TYPES = /* @__PURE__ */ new Set([
|
|
|
132
141
|
"event-line",
|
|
133
142
|
"venn",
|
|
134
143
|
"quadrant",
|
|
135
|
-
"map"
|
|
144
|
+
"map",
|
|
145
|
+
"body"
|
|
136
146
|
]);
|
|
137
147
|
var TAG_KEYWORD = "tag";
|
|
138
148
|
var DIRECTIVE_KEYWORDS = /* @__PURE__ */ new Set([...REGISTRY_DIRECTIVE_TOKENS]);
|
|
@@ -300,6 +310,9 @@ var ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
|
300
310
|
"value",
|
|
301
311
|
"label",
|
|
302
312
|
"style",
|
|
313
|
+
// Sketch (§31): shape morph + half-slot coordinate keys
|
|
314
|
+
"shape",
|
|
315
|
+
"at",
|
|
303
316
|
// Treemap + boxes-and-lines + map colour-by-value channel key
|
|
304
317
|
"heat",
|
|
305
318
|
// Infra node behavior + edge colon-keys (§4) come from the single-source
|
|
@@ -583,6 +596,69 @@ var BLOCK_CSS = `
|
|
|
583
596
|
opacity: 1;
|
|
584
597
|
}
|
|
585
598
|
|
|
599
|
+
/* === Full-screen lightbox ===
|
|
600
|
+
* The expand button clones the visible diagram into a native <dialog> that
|
|
601
|
+
* the client shows with showModal(): top-layer, so it escapes any transformed
|
|
602
|
+
* or overflow-clipped ancestor (docs sidebars) and fills the whole viewport.
|
|
603
|
+
* Escape / backdrop-click / the close button dismiss it. The <dialog> itself
|
|
604
|
+
* fills the viewport with a transparent background (so a click landing on it
|
|
605
|
+
* \u2014 outside the centered card \u2014 reads as a backdrop dismiss); the dim comes
|
|
606
|
+
* from ::backdrop. */
|
|
607
|
+
.dgmo-lightbox {
|
|
608
|
+
width: 100vw;
|
|
609
|
+
height: 100vh;
|
|
610
|
+
max-width: 100vw;
|
|
611
|
+
max-height: 100vh;
|
|
612
|
+
margin: 0;
|
|
613
|
+
padding: 0;
|
|
614
|
+
border: 0;
|
|
615
|
+
background: transparent;
|
|
616
|
+
overflow: hidden;
|
|
617
|
+
}
|
|
618
|
+
.dgmo-lightbox[open] {
|
|
619
|
+
display: flex;
|
|
620
|
+
align-items: center;
|
|
621
|
+
justify-content: center;
|
|
622
|
+
}
|
|
623
|
+
.dgmo-lightbox::backdrop {
|
|
624
|
+
background: rgba(0, 0, 0, 0.72);
|
|
625
|
+
}
|
|
626
|
+
.dgmo-lightbox-svg {
|
|
627
|
+
width: 95vw;
|
|
628
|
+
max-width: 95vw;
|
|
629
|
+
max-height: 95vh;
|
|
630
|
+
overflow: auto;
|
|
631
|
+
border-radius: 0.5em;
|
|
632
|
+
box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
|
|
633
|
+
}
|
|
634
|
+
.dgmo-lightbox-svg > svg {
|
|
635
|
+
display: block;
|
|
636
|
+
width: 100%;
|
|
637
|
+
height: auto;
|
|
638
|
+
max-width: 100%;
|
|
639
|
+
}
|
|
640
|
+
.dgmo-lightbox-close {
|
|
641
|
+
position: fixed;
|
|
642
|
+
top: max(1rem, env(safe-area-inset-top));
|
|
643
|
+
right: max(1rem, env(safe-area-inset-right));
|
|
644
|
+
display: inline-flex;
|
|
645
|
+
align-items: center;
|
|
646
|
+
justify-content: center;
|
|
647
|
+
width: 2.4em;
|
|
648
|
+
height: 2.4em;
|
|
649
|
+
border: 0;
|
|
650
|
+
border-radius: 50%;
|
|
651
|
+
background: rgba(0, 0, 0, 0.5);
|
|
652
|
+
color: #fff;
|
|
653
|
+
font-size: 1.25rem;
|
|
654
|
+
line-height: 1;
|
|
655
|
+
cursor: pointer;
|
|
656
|
+
transition: background-color 0.15s ease;
|
|
657
|
+
}
|
|
658
|
+
.dgmo-lightbox-close:hover {
|
|
659
|
+
background: rgba(0, 0, 0, 0.75);
|
|
660
|
+
}
|
|
661
|
+
|
|
586
662
|
/* === Frame the whole block ===
|
|
587
663
|
* When the source panel is open, diagram + toolbar + code get one shared
|
|
588
664
|
* border so the code visibly belongs to the chart above it. The frame box
|
|
@@ -781,6 +857,7 @@ function resolveBlockOptions(opts) {
|
|
|
781
857
|
colorMode: opts.colorMode ?? "auto",
|
|
782
858
|
showSource: opts.showSource ?? showcase,
|
|
783
859
|
showCopy: opts.showCopy ?? showcase,
|
|
860
|
+
showExpand: opts.showExpand ?? showcase,
|
|
784
861
|
showOpenInEditor: opts.showOpenInEditor ?? showcase,
|
|
785
862
|
editorBaseUrl: opts.editorBaseUrl ?? EDITOR_BASE_URL,
|
|
786
863
|
wrapper: opts.wrapper ?? "figure",
|
|
@@ -793,23 +870,24 @@ function resolveBlockOptions(opts) {
|
|
|
793
870
|
async function renderDgmoBlock(source, options = {}) {
|
|
794
871
|
const opts = resolveBlockOptions(options);
|
|
795
872
|
const trimmed = source.trim();
|
|
796
|
-
const
|
|
873
|
+
const palette = resolvePaletteOrFallback(opts.palette, opts.onWarn);
|
|
797
874
|
const diagnostics = [];
|
|
875
|
+
const renderTheme = async (theme) => {
|
|
876
|
+
const r = await render(trimmed, { palette: palette.id, theme });
|
|
877
|
+
diagnostics.push(...r.diagnostics);
|
|
878
|
+
const errors = r.diagnostics.filter((d) => d.severity === "error");
|
|
879
|
+
return errors.length ? renderErrorCard(errors, trimmed, palette, theme) : r.svg;
|
|
880
|
+
};
|
|
798
881
|
let svgsHtml;
|
|
799
882
|
if (opts.colorMode === "auto") {
|
|
800
883
|
const [light, dark] = await Promise.all([
|
|
801
|
-
|
|
802
|
-
|
|
884
|
+
renderTheme("light"),
|
|
885
|
+
renderTheme("dark")
|
|
803
886
|
]);
|
|
804
|
-
|
|
805
|
-
svgsHtml = `<div class="${escapeAttr(innerClasses(opts, "dgmo-light"))}">${normalizeSvgForEmbed(light.svg)}</div><div class="${escapeAttr(innerClasses(opts, "dgmo-dark"))}">${normalizeSvgForEmbed(dark.svg)}</div>`;
|
|
887
|
+
svgsHtml = `<div class="${escapeAttr(innerClasses(opts, "dgmo-light"))}">${normalizeSvgForEmbed(light)}</div><div class="${escapeAttr(innerClasses(opts, "dgmo-dark"))}">${normalizeSvgForEmbed(dark)}</div>`;
|
|
806
888
|
} else {
|
|
807
|
-
const
|
|
808
|
-
|
|
809
|
-
theme: opts.colorMode
|
|
810
|
-
});
|
|
811
|
-
diagnostics.push(...result.diagnostics);
|
|
812
|
-
svgsHtml = `<div class="${escapeAttr(innerClasses(opts, "dgmo-svg"))}">${normalizeSvgForEmbed(result.svg)}</div>`;
|
|
889
|
+
const svg = await renderTheme(opts.colorMode);
|
|
890
|
+
svgsHtml = `<div class="${escapeAttr(innerClasses(opts, "dgmo-svg"))}">${normalizeSvgForEmbed(svg)}</div>`;
|
|
813
891
|
}
|
|
814
892
|
return { html: assembleBlock(trimmed, svgsHtml, opts), diagnostics };
|
|
815
893
|
}
|
|
@@ -843,9 +921,11 @@ function assembleBlock(source, svgsHtml, opts) {
|
|
|
843
921
|
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>`;
|
|
844
922
|
var COPY_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"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5V3a1.5 1.5 0 0 0-1.5-1.5H3A1.5 1.5 0 0 0 1.5 3v6A1.5 1.5 0 0 0 3 10.5h2.5"/></svg>`;
|
|
845
923
|
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>`;
|
|
924
|
+
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>`;
|
|
846
925
|
function sourceDisclosure(source, opts) {
|
|
847
926
|
if (!opts.showSource) return "";
|
|
848
927
|
const toggle = `<span class="dgmo-toggle" title="View DGMO source">${CODE_ICON}</span>`;
|
|
928
|
+
const expandButton = opts.showExpand ? `<button type="button" class="dgmo-toolbar-btn dgmo-expand" aria-label="View full screen" title="Expand">${EXPAND_ICON}</button>` : "";
|
|
849
929
|
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>` : "";
|
|
850
930
|
let openButton = "";
|
|
851
931
|
if (opts.showOpenInEditor) {
|
|
@@ -855,7 +935,7 @@ function sourceDisclosure(source, opts) {
|
|
|
855
935
|
}
|
|
856
936
|
}
|
|
857
937
|
const sourceHtml = highlightedSource(source);
|
|
858
|
-
return `<details class="dgmo-source-wrap"><summary class="dgmo-toolbar" aria-label="View DGMO source">${toggle}${copyButton}${openButton}</summary><div class="dgmo-source-inner">${sourceHtml}</div></details>`;
|
|
938
|
+
return `<details class="dgmo-source-wrap"><summary class="dgmo-toolbar" aria-label="View DGMO source">${toggle}${expandButton}${copyButton}${openButton}</summary><div class="dgmo-source-inner">${sourceHtml}</div></details>`;
|
|
859
939
|
}
|
|
860
940
|
function highlightedSource(source) {
|
|
861
941
|
const tokens = highlightDgmo(source);
|
|
@@ -2,18 +2,19 @@ import {
|
|
|
2
2
|
D3_DATA_CHART_TYPES,
|
|
3
3
|
renderDataChartD3,
|
|
4
4
|
supportsD3DataChart
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JFPY3UJ7.js";
|
|
6
|
+
import "./chunk-HGN652MU.js";
|
|
7
|
+
import "./chunk-KQAEKMIX.js";
|
|
6
8
|
import "./chunk-U6EQI3U6.js";
|
|
7
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-7UEMZREK.js";
|
|
8
10
|
import "./chunk-A4GOY3PE.js";
|
|
9
11
|
import "./chunk-6KFWC4CO.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-P235SVAH.js";
|
|
12
|
+
import "./chunk-HQCHYB5F.js";
|
|
13
|
+
import "./chunk-5LWQH6QV.js";
|
|
13
14
|
import "./chunk-R3XI2VC7.js";
|
|
14
15
|
import "./chunk-P6T66CCZ.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-HBVD67XG.js";
|
|
17
|
+
import "./chunk-ZNQX6QWH.js";
|
|
17
18
|
import "./chunk-TLVIHFRO.js";
|
|
18
19
|
import "./chunk-CXK4DZH3.js";
|
|
19
20
|
import "./chunk-5WRI5ZAA.js";
|
|
@@ -22,4 +23,4 @@ export {
|
|
|
22
23
|
renderDataChartD3,
|
|
23
24
|
supportsD3DataChart
|
|
24
25
|
};
|
|
25
|
-
//# sourceMappingURL=charts-d3-
|
|
26
|
+
//# sourceMappingURL=charts-d3-EW3YQTEA.js.map
|