@diagrammo/dgmo 0.48.1 → 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.
Files changed (216) hide show
  1. package/.cursorrules +8 -3
  2. package/.github/copilot-instructions.md +8 -3
  3. package/.windsurfrules +8 -3
  4. package/SKILL.md +8 -3
  5. package/dist/advanced.d.ts +444 -1
  6. package/dist/advanced.js +208 -146
  7. package/dist/auto.css +74 -5
  8. package/dist/auto.js +213 -107
  9. package/dist/auto.mjs +6906 -831
  10. package/dist/block.css +74 -5
  11. package/dist/block.d.ts +13 -5
  12. package/dist/block.js +148 -62
  13. package/dist/{charts-d3-QOZHKTCT.js → charts-d3-EW3YQTEA.js} +9 -8
  14. package/dist/chunk-26RVGM44.js +331 -0
  15. package/dist/{chunk-44CM72SQ.js → chunk-2WMBWZY2.js} +3 -3
  16. package/dist/{chunk-L66GEFB6.js → chunk-35BBZDFE.js} +4 -4
  17. package/dist/{chunk-4GRI7MEB.js → chunk-3BIAFYD2.js} +6 -6
  18. package/dist/chunk-3NFJWFNP.js +1474 -0
  19. package/dist/{chunk-76OWZ3BA.js → chunk-4BD7EVPK.js} +2 -2
  20. package/dist/{chunk-MITI6NOL.js → chunk-4FIV4K4Z.js} +9 -9
  21. package/dist/chunk-4HVNZ7WF.js +574 -0
  22. package/dist/{chunk-X5LCYCL5.js → chunk-4NQ3IKUM.js} +2 -2
  23. package/dist/{chunk-PWIHZ6NJ.js → chunk-4UDKKGHH.js} +4 -4
  24. package/dist/{chunk-6NYWYNBI.js → chunk-4XK3FLFB.js} +3 -3
  25. package/dist/chunk-4YNP6O47.js +607 -0
  26. package/dist/{chunk-3MQQNXPD.js → chunk-5FGDJIJX.js} +3 -3
  27. package/dist/{chunk-WCT3NYCV.js → chunk-5LWQH6QV.js} +1 -1
  28. package/dist/chunk-5XCM7UUW.js +261 -0
  29. package/dist/{chunk-RYEGFMUO.js → chunk-5ZZLLBFK.js} +2 -2
  30. package/dist/{chunk-EB6FPQUP.js → chunk-65RTDUZH.js} +3 -3
  31. package/dist/chunk-6CLKNXVP.js +664 -0
  32. package/dist/{chunk-H6PI3KJT.js → chunk-6IUAK7RZ.js} +2 -2
  33. package/dist/{chunk-ZGR7ULFJ.js → chunk-6SA7FJE4.js} +31 -19
  34. package/dist/{chunk-LIOHW36Z.js → chunk-6VE3VLWM.js} +3 -3
  35. package/dist/{chunk-AN2MOO5T.js → chunk-7OVSJI2V.js} +3 -3
  36. package/dist/{chunk-YAA6IID3.js → chunk-7UEMZREK.js} +2 -2
  37. package/dist/{chunk-FCIIHT24.js → chunk-7VLUGEMJ.js} +7 -7
  38. package/dist/{chunk-VOKGH627.js → chunk-AHGF2YYA.js} +13 -3
  39. package/dist/{chunk-3R5POCTZ.js → chunk-AJ2PEY7J.js} +6 -6
  40. package/dist/{chunk-PBHE5UG6.js → chunk-ALRHIR6I.js} +46 -12
  41. package/dist/{chunk-7JEGTRLD.js → chunk-B57V3DWN.js} +3 -3
  42. package/dist/{chunk-ILKORZ3H.js → chunk-BCT5G2VN.js} +7 -7
  43. package/dist/{chunk-TYS6CSS5.js → chunk-BCYVE3N5.js} +2 -2
  44. package/dist/{chunk-ZBWMSD5N.js → chunk-BGJV5ATD.js} +4 -4
  45. package/dist/{chunk-G2H74XJZ.js → chunk-BPIJLRYE.js} +8 -8
  46. package/dist/{chunk-YGJTDXVR.js → chunk-C4GQDB5L.js} +2 -2
  47. package/dist/{chunk-Y2ZE3MSG.js → chunk-C63UWAKM.js} +2 -2
  48. package/dist/{chunk-QEBUY5NY.js → chunk-CEHZOPGM.js} +4 -4
  49. package/dist/{chunk-725LDASD.js → chunk-CLD2OKV7.js} +2 -2
  50. package/dist/{chunk-5QXL4NYS.js → chunk-CLR4A2N2.js} +10 -5
  51. package/dist/{chunk-WBRZJOEC.js → chunk-CMCR5WBW.js} +3 -3
  52. package/dist/{chunk-SML67VPV.js → chunk-D5AVQCDN.js} +3 -3
  53. package/dist/{chunk-2LACINWN.js → chunk-DDTJ5N7Q.js} +9 -9
  54. package/dist/{chunk-FITOLXSX.js → chunk-EOFPYPAU.js} +26 -2
  55. package/dist/{chunk-B65G5DNL.js → chunk-EYN7VFKL.js} +3 -3
  56. package/dist/{chunk-4OHACBGX.js → chunk-F2L5GCQ4.js} +2 -2
  57. package/dist/{chunk-RVMRZAPB.js → chunk-F743CM2N.js} +3 -3
  58. package/dist/{chunk-3JLKYGBQ.js → chunk-F7BFXWNQ.js} +2 -2
  59. package/dist/{chunk-WCSOJFU3.js → chunk-FMKTYMP4.js} +3 -3
  60. package/dist/{chunk-RTLBSQ3G.js → chunk-FUCAB3KQ.js} +3 -3
  61. package/dist/{chunk-SGZYXELT.js → chunk-GB3YZTAM.js} +9 -6
  62. package/dist/{chunk-QLCCJEJI.js → chunk-HBVD67XG.js} +2 -2
  63. package/dist/{chunk-PBAHEPLQ.js → chunk-HGN652MU.js} +7 -6
  64. package/dist/{chunk-3SMGIJDD.js → chunk-HHXOONLX.js} +13 -1
  65. package/dist/{chunk-QOOUC2J5.js → chunk-HQCHYB5F.js} +2 -2
  66. package/dist/chunk-IAEC4KLA.js +492 -0
  67. package/dist/{chunk-J5FIXQRT.js → chunk-IBC35BTK.js} +4 -4
  68. package/dist/{chunk-NURGB5Z4.js → chunk-IFK3GIUW.js} +2 -2
  69. package/dist/{chunk-FANX6UJR.js → chunk-IHLSHCPZ.js} +11 -11
  70. package/dist/{chunk-GMR5MFHJ.js → chunk-IUK7AGD4.js} +2 -2
  71. package/dist/chunk-IVKC4GID.js +32 -0
  72. package/dist/{chunk-OJR3MQYV.js → chunk-JFPY3UJ7.js} +296 -57
  73. package/dist/{chunk-5MLYVTYM.js → chunk-K6HNAY5V.js} +2 -2
  74. package/dist/{chunk-P235SVAH.js → chunk-KQAEKMIX.js} +2 -2
  75. package/dist/{chunk-7DTWEFUE.js → chunk-KUBBJ2CD.js} +10 -10
  76. package/dist/{chunk-BUVJFRPY.js → chunk-KV6Y2HE6.js} +4 -4
  77. package/dist/{chunk-OURHMODR.js → chunk-LG4TWW4U.js} +13 -13
  78. package/dist/{chunk-XAKEUMEJ.js → chunk-LVHPTBO3.js} +3 -3
  79. package/dist/{chunk-ERLBPDGU.js → chunk-MJCG5K2O.js} +2 -2
  80. package/dist/{chunk-THXCFRTU.js → chunk-N4J5KGWG.js} +12 -12
  81. package/dist/{chunk-MZSBFAPJ.js → chunk-NVT6C2VE.js} +9 -9
  82. package/dist/{chunk-AELOBFW5.js → chunk-O5MQPK7E.js} +3 -3
  83. package/dist/{chunk-JM4LEPY3.js → chunk-O7NUCTFU.js} +2 -2
  84. package/dist/{chunk-JED6ZDEE.js → chunk-O7WP4ZD4.js} +2 -2
  85. package/dist/{chunk-ZO27FGJS.js → chunk-PH5X4GIP.js} +2 -2
  86. package/dist/{chunk-B7JUCQUA.js → chunk-PU3AUQPA.js} +4 -4
  87. package/dist/{chunk-A4VFQH5G.js → chunk-PZFVK3IH.js} +52 -7
  88. package/dist/chunk-QQJUTGQH.js +135 -0
  89. package/dist/{chunk-HSH73DP6.js → chunk-RI4NIMFP.js} +99 -39
  90. package/dist/{chunk-33LCUH4H.js → chunk-RTERS6S5.js} +3 -3
  91. package/dist/{chunk-T3UBLACL.js → chunk-SCQ5VPUF.js} +19 -5
  92. package/dist/chunk-SGHSY3LU.js +377 -0
  93. package/dist/{chunk-SRTU6HMQ.js → chunk-SJEGO2QL.js} +8 -8
  94. package/dist/chunk-SQDFK5ZQ.js +273 -0
  95. package/dist/{chunk-UC7TFHUM.js → chunk-SVDWQGX2.js} +296 -121
  96. package/dist/{chunk-Z5CGSFJB.js → chunk-T7IKPCMI.js} +4 -4
  97. package/dist/chunk-TC3YWBFO.js +233 -0
  98. package/dist/{chunk-EVCVDTXE.js → chunk-TLKMTQYL.js} +3 -3
  99. package/dist/{chunk-IJZFN3HM.js → chunk-TWQUYVP3.js} +4 -4
  100. package/dist/{chunk-IZMRON6C.js → chunk-UVCXZEGU.js} +2 -2
  101. package/dist/{chunk-CKNVO24D.js → chunk-UWDO3O52.js} +2 -2
  102. package/dist/{chunk-RJE5JTVK.js → chunk-VC3TR4NL.js} +7 -7
  103. package/dist/{chunk-CI2G3OEB.js → chunk-X2CH42BN.js} +9 -9
  104. package/dist/{chunk-6HO5ZTXK.js → chunk-XCC2RENT.js} +2 -2
  105. package/dist/chunk-XHVV4NVW.js +51 -0
  106. package/dist/{chunk-ZJEL4H2R.js → chunk-XJ7J6WOO.js} +9 -9
  107. package/dist/{chunk-ULOEATBZ.js → chunk-XKTN7CZF.js} +106 -29
  108. package/dist/{chunk-IPWPWM6R.js → chunk-YM2BSPYW.js} +111 -10
  109. package/dist/{chunk-BUPDIHML.js → chunk-YRVLP7UU.js} +3 -3
  110. package/dist/{chunk-T2OE3YQB.js → chunk-YTN572Q2.js} +3 -3
  111. package/dist/{chunk-WVAJFAIA.js → chunk-YYX3SU6H.js} +3 -3
  112. package/dist/{chunk-MO5YHHMQ.js → chunk-ZDUQGL3N.js} +2 -2
  113. package/dist/{chunk-Y3J7VR52.js → chunk-ZNQX6QWH.js} +30 -2
  114. package/dist/{chunk-UWN33VNX.js → chunk-ZREZOIGS.js} +8 -8
  115. package/dist/{chunk-6SM5NJQH.js → chunk-ZTLWVRNS.js} +4 -4
  116. package/dist/{chunk-RUNNI6VE.js → chunk-ZXL6MB4R.js} +3 -3
  117. package/dist/cli.cjs +159 -122
  118. package/dist/dgmo-router-ODKPEJ3P.js +79 -0
  119. package/dist/dimensions-WSIJXT5Q.js +22 -0
  120. package/dist/editor.js +4 -1
  121. package/dist/element.js +214 -108
  122. package/dist/element.mjs +6906 -831
  123. package/dist/{flowchart-parser-ZNSKIBVR.js → flowchart-parser-IVZN7CQN.js} +4 -4
  124. package/dist/{flowchart-renderer-SNDSII4D.js → flowchart-renderer-GMI2U3DD.js} +9 -9
  125. package/dist/highlight.js +7 -1
  126. package/dist/index.d.ts +5 -1
  127. package/dist/index.js +193 -232
  128. package/dist/{layout-HRBZPFCN.js → layout-34CLNICW.js} +5 -5
  129. package/dist/{layout-5RA6QWR6.js → layout-4Z5JM7PT.js} +6 -6
  130. package/dist/layout-6RDJHS6E.js +9 -0
  131. package/dist/{layout-7QXCNOVS.js → layout-7H4H46CS.js} +3 -3
  132. package/dist/{layout-46N4JJYK.js → layout-7SKMFYHL.js} +5 -5
  133. package/dist/{layout-HWDSRX5E.js → layout-D42XE4RE.js} +6 -6
  134. package/dist/{layout-EE6GE46Y.js → layout-DC4TVXER.js} +5 -5
  135. package/dist/layout-FGQWRYYW.js +14 -0
  136. package/dist/layout-GZ2CWONU.js +14 -0
  137. package/dist/layout-HQMBPJVS.js +10 -0
  138. package/dist/{layout-UM5F4DJB.js → layout-K2ZN3Q42.js} +5 -5
  139. package/dist/{layout-S2QBYSK2.js → layout-NXG63LWH.js} +3 -3
  140. package/dist/{layout-N76NR4ZO.js → layout-PUQCB6AN.js} +7 -7
  141. package/dist/{layout-HYZPWAK5.js → layout-QNUQLEHU.js} +3 -3
  142. package/dist/layout-S3EK4IYO.js +14 -0
  143. package/dist/{layout-search-OYV77HHS.js → layout-search-QS44PI5R.js} +6 -6
  144. package/dist/{parser-KNSQSKQO.js → parser-4BKIFG2C.js} +5 -5
  145. package/dist/{parser-OV7NOBW6.js → parser-4ROBKVUR.js} +4 -4
  146. package/dist/parser-667RGSUW.js +13 -0
  147. package/dist/{parser-IXSZZQHY.js → parser-BL7Z72EY.js} +4 -4
  148. package/dist/{parser-AQETEVRW.js → parser-CLMFZWCC.js} +4 -4
  149. package/dist/{parser-XKRP7QKP.js → parser-D6ONJQFR.js} +3 -3
  150. package/dist/{parser-2EWECDSA.js → parser-DERPY5KC.js} +4 -4
  151. package/dist/{parser-4OGOBJJ4.js → parser-GFSOPDB7.js} +4 -4
  152. package/dist/{parser-2MFP2H2E.js → parser-HVJFTOXL.js} +3 -3
  153. package/dist/{parser-VQP2UJ6W.js → parser-IKZFTLOJ.js} +3 -3
  154. package/dist/parser-J3P2D6IP.js +13 -0
  155. package/dist/{parser-PQ3POX45.js → parser-JD7OQ2E6.js} +4 -4
  156. package/dist/{parser-O5J4VBII.js → parser-K647FRI4.js} +3 -3
  157. package/dist/{parser-NGU3ETO6.js → parser-KPMN5KKE.js} +4 -4
  158. package/dist/{parser-4FL2CMDG.js → parser-MBJSBTL5.js} +4 -4
  159. package/dist/{parser-TFZFBVWN.js → parser-MCJWF5G3.js} +3 -3
  160. package/dist/{parser-NRAI6O25.js → parser-MRBPXXIV.js} +4 -4
  161. package/dist/{parser-6BTRLKRZ.js → parser-OBQG655V.js} +4 -4
  162. package/dist/{parser-3STE62GB.js → parser-QJYS7KQQ.js} +4 -4
  163. package/dist/{parser-XDVELHRK.js → parser-SMBJO3XN.js} +4 -4
  164. package/dist/{parser-TRTHDFPP.js → parser-TITK4YW6.js} +5 -5
  165. package/dist/{parser-I6KXEYFK.js → parser-TNYX5S7E.js} +4 -4
  166. package/dist/{parser-Y6WTBU76.js → parser-UBGPTIZD.js} +3 -3
  167. package/dist/parser-UGA23PYK.js +14 -0
  168. package/dist/{parser-N5O4IHUN.js → parser-WISPH7LW.js} +4 -4
  169. package/dist/{parser-CFZD5IBL.js → parser-XWUDFJ7P.js} +4 -4
  170. package/dist/parser-ZKF5K2H2.js +15 -0
  171. package/dist/{parser-ZSDPZYQP.js → parser-ZYC3XGNS.js} +4 -4
  172. package/dist/{renderer-AWWAF6XD.js → renderer-4IUPINAE.js} +10 -10
  173. package/dist/renderer-6L3NBEY5.js +24 -0
  174. package/dist/{renderer-ZRNG54CW.js → renderer-6T3KK4S3.js} +11 -11
  175. package/dist/{renderer-KQB7UGDS.js → renderer-7RH2SI3B.js} +3 -3
  176. package/dist/{renderer-6EEZHMH4.js → renderer-A5VFZQQK.js} +9 -9
  177. package/dist/{renderer-5MYBMBYO.js → renderer-BB5PREMY.js} +5 -5
  178. package/dist/{renderer-BYCNMBF7.js → renderer-CGW7QPNA.js} +10 -10
  179. package/dist/{renderer-QIWVHWZO.js → renderer-DAXMXIKD.js} +3 -3
  180. package/dist/{renderer-7MVLWWQD.js → renderer-DKESNMU5.js} +9 -9
  181. package/dist/{renderer-ZTR3DER3.js → renderer-HVCU2C3Z.js} +3 -3
  182. package/dist/{renderer-VACVQYML.js → renderer-LWGJFT3D.js} +8 -8
  183. package/dist/{renderer-PGX2TKVS.js → renderer-MFJ7HY2H.js} +8 -8
  184. package/dist/{renderer-B2OMQIQG.js → renderer-MJDDU27W.js} +15 -15
  185. package/dist/{renderer-4JHRUBE6.js → renderer-QL5KO6SK.js} +10 -10
  186. package/dist/{renderer-W4M6QLIJ.js → renderer-QNHUXCRL.js} +14 -14
  187. package/dist/{renderer-ZGNTUWC4.js → renderer-ROV756WT.js} +8 -8
  188. package/dist/{renderer-YY2OSF6E.js → renderer-SQ3JUAI7.js} +9 -9
  189. package/dist/renderer-THD6V5TL.js +22 -0
  190. package/dist/{renderer-5NDVNDAZ.js → renderer-TPIBXNOS.js} +9 -9
  191. package/dist/{renderer-RPOA5YPZ.js → renderer-TYXRHMRI.js} +13 -13
  192. package/dist/{renderer-N43WR5GV.js → renderer-UZF3JROD.js} +11 -11
  193. package/dist/{renderer-6W5462RB.js → renderer-V3JEMWMM.js} +9 -9
  194. package/dist/{renderer-JGBKUCZD.js → renderer-VFUVRNLK.js} +4 -4
  195. package/dist/{renderer-Z7I3W2PP.js → renderer-VICQ4WNY.js} +8 -8
  196. package/dist/renderer-W5RMOURB.js +21 -0
  197. package/dist/renderer-XEKIRPI6.js +23 -0
  198. package/dist/{renderer-CLJHQPBJ.js → renderer-YHXPN3GF.js} +12 -12
  199. package/dist/renderer-radial-MHO2VDXN.js +21 -0
  200. package/dist/{resolver-NOAA7ID7.js → resolver-FHBCO3PL.js} +3 -3
  201. package/dist/{state-parser-Z2V23ATR.js → state-parser-RX3GXOIB.js} +4 -4
  202. package/dist/{state-renderer-B4DQBM6M.js → state-renderer-AJUKGNWU.js} +9 -9
  203. package/docs/ai-integration.md +8 -3
  204. package/docs/language-reference.md +179 -5
  205. package/gallery/fixtures/family.dgmo +23 -0
  206. package/gallery/fixtures/sketch.dgmo +22 -0
  207. package/package.json +1 -1
  208. package/dist/chunk-ODZVHU3R.js +0 -153
  209. package/dist/dgmo-router-X35VLZLM.js +0 -73
  210. package/dist/dimensions-J3FHIMJ6.js +0 -22
  211. package/dist/layout-5T6RH5M6.js +0 -14
  212. package/dist/layout-G23F7LDH.js +0 -9
  213. package/dist/layout-OB3RI63S.js +0 -14
  214. package/dist/parser-JAL2HD4I.js +0 -13
  215. package/dist/renderer-SMIBCRVB.js +0 -24
  216. package/dist/renderer-radial-C32GPJQ7.js +0 -21
package/dist/block.css CHANGED
@@ -109,15 +109,84 @@
109
109
  opacity: 1;
110
110
  }
111
111
 
112
- /* === Open state: frame the whole block ===
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
+
175
+ /* === Frame the whole block ===
113
176
  * When the source panel is open, diagram + toolbar + code get one shared
114
- * border so the code visibly belongs to the chart above it, not to the
115
- * surrounding prose. Closed blocks stay frameless. */
116
- .dgmo:has(> .dgmo-source-wrap[open]) {
117
- border: 1px solid rgba(127, 127, 127, 0.3);
177
+ * border so the code visibly belongs to the chart above it. The frame box
178
+ * (border + padding) is RESERVED at all times — with the border transparent
179
+ * while closed — so opening the panel only paints the border in. It never
180
+ * reflows the diagram or shifts the toolbar: the SVG box and toolbar position
181
+ * are identical open vs closed. */
182
+ .dgmo:has(> .dgmo-source-wrap) {
183
+ border: 1px solid transparent;
118
184
  border-radius: 0.6em;
119
185
  padding: 0.75em 0.75em 0.5em;
120
186
  }
187
+ .dgmo:has(> .dgmo-source-wrap[open]) {
188
+ border-color: rgba(127, 127, 127, 0.3);
189
+ }
121
190
 
122
191
  /* === Source panel (hidden until toggled) === */
123
192
  .dgmo-source-inner {
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. Three wordless icon
33
- * buttons — `</>` toggles the hidden source panel, copy, open-in-editor. No
34
- * disclosure triangle, no text labels. The toolbar IS the <summary> of a
35
- * native <details>, so show/hide works with zero JavaScript; copy needs a
36
- * small delegated click handler (remark-dgmo's `bindDgmo` is the reference).
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
- } from "./chunk-ODZVHU3R.js";
2
+ normalizeSvgForEmbed,
3
+ renderErrorCard
4
+ } from "./chunk-26RVGM44.js";
4
5
  import {
5
6
  encodeDiagramUrl,
6
7
  render
7
- } from "./chunk-UC7TFHUM.js";
8
- import "./chunk-PBAHEPLQ.js";
9
- import "./chunk-OJR3MQYV.js";
10
- import "./chunk-UWN33VNX.js";
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-YAA6IID3.js";
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-QOOUC2J5.js";
19
- import "./chunk-WCT3NYCV.js";
20
- import "./chunk-HSH73DP6.js";
21
- import "./chunk-P235SVAH.js";
22
- import "./chunk-6HO5ZTXK.js";
23
- import "./chunk-44CM72SQ.js";
24
- import "./chunk-76OWZ3BA.js";
25
- import "./chunk-MO5YHHMQ.js";
26
- import "./chunk-WCSOJFU3.js";
27
- import "./chunk-7JEGTRLD.js";
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-RYEGFMUO.js";
30
- import "./chunk-33LCUH4H.js";
31
- import "./chunk-XAKEUMEJ.js";
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-BUVJFRPY.js";
41
- import "./chunk-WVAJFAIA.js";
42
- import "./chunk-EB6FPQUP.js";
43
- import "./chunk-EVCVDTXE.js";
44
- import "./chunk-NURGB5Z4.js";
45
- import "./chunk-L66GEFB6.js";
46
- import "./chunk-RVMRZAPB.js";
47
- import "./chunk-AN2MOO5T.js";
48
- import "./chunk-RTLBSQ3G.js";
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-5QXL4NYS.js";
52
- import "./chunk-GMR5MFHJ.js";
53
- import "./chunk-ERLBPDGU.js";
54
- import "./chunk-AELOBFW5.js";
55
- import "./chunk-B65G5DNL.js";
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-SML67VPV.js";
68
+ import "./chunk-D5AVQCDN.js";
62
69
  import "./chunk-C3Z4DX3V.js";
63
- import "./chunk-QLCCJEJI.js";
64
- import "./chunk-LIOHW36Z.js";
70
+ import "./chunk-HBVD67XG.js";
71
+ import "./chunk-6VE3VLWM.js";
65
72
  import "./chunk-I46X5VUA.js";
66
- import "./chunk-3MQQNXPD.js";
73
+ import "./chunk-5FGDJIJX.js";
67
74
  import "./chunk-NXMESY4J.js";
68
- import "./chunk-RUNNI6VE.js";
69
- import "./chunk-5MLYVTYM.js";
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-Y3J7VR52.js";
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,15 +596,84 @@ var BLOCK_CSS = `
583
596
  opacity: 1;
584
597
  }
585
598
 
586
- /* === Open state: frame the whole block ===
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
+
662
+ /* === Frame the whole block ===
587
663
  * When the source panel is open, diagram + toolbar + code get one shared
588
- * border so the code visibly belongs to the chart above it, not to the
589
- * surrounding prose. Closed blocks stay frameless. */
590
- .dgmo:has(> .dgmo-source-wrap[open]) {
591
- border: 1px solid rgba(127, 127, 127, 0.3);
664
+ * border so the code visibly belongs to the chart above it. The frame box
665
+ * (border + padding) is RESERVED at all times \u2014 with the border transparent
666
+ * while closed \u2014 so opening the panel only paints the border in. It never
667
+ * reflows the diagram or shifts the toolbar: the SVG box and toolbar position
668
+ * are identical open vs closed. */
669
+ .dgmo:has(> .dgmo-source-wrap) {
670
+ border: 1px solid transparent;
592
671
  border-radius: 0.6em;
593
672
  padding: 0.75em 0.75em 0.5em;
594
673
  }
674
+ .dgmo:has(> .dgmo-source-wrap[open]) {
675
+ border-color: rgba(127, 127, 127, 0.3);
676
+ }
595
677
 
596
678
  /* === Source panel (hidden until toggled) === */
597
679
  .dgmo-source-inner {
@@ -775,6 +857,7 @@ function resolveBlockOptions(opts) {
775
857
  colorMode: opts.colorMode ?? "auto",
776
858
  showSource: opts.showSource ?? showcase,
777
859
  showCopy: opts.showCopy ?? showcase,
860
+ showExpand: opts.showExpand ?? showcase,
778
861
  showOpenInEditor: opts.showOpenInEditor ?? showcase,
779
862
  editorBaseUrl: opts.editorBaseUrl ?? EDITOR_BASE_URL,
780
863
  wrapper: opts.wrapper ?? "figure",
@@ -787,23 +870,24 @@ function resolveBlockOptions(opts) {
787
870
  async function renderDgmoBlock(source, options = {}) {
788
871
  const opts = resolveBlockOptions(options);
789
872
  const trimmed = source.trim();
790
- const paletteId = resolvePaletteOrFallback(opts.palette, opts.onWarn).id;
873
+ const palette = resolvePaletteOrFallback(opts.palette, opts.onWarn);
791
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
+ };
792
881
  let svgsHtml;
793
882
  if (opts.colorMode === "auto") {
794
883
  const [light, dark] = await Promise.all([
795
- render(trimmed, { palette: paletteId, theme: "light" }),
796
- render(trimmed, { palette: paletteId, theme: "dark" })
884
+ renderTheme("light"),
885
+ renderTheme("dark")
797
886
  ]);
798
- diagnostics.push(...light.diagnostics, ...dark.diagnostics);
799
- 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>`;
800
888
  } else {
801
- const result = await render(trimmed, {
802
- palette: paletteId,
803
- theme: opts.colorMode
804
- });
805
- diagnostics.push(...result.diagnostics);
806
- 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>`;
807
891
  }
808
892
  return { html: assembleBlock(trimmed, svgsHtml, opts), diagnostics };
809
893
  }
@@ -837,9 +921,11 @@ function assembleBlock(source, svgsHtml, opts) {
837
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>`;
838
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>`;
839
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>`;
840
925
  function sourceDisclosure(source, opts) {
841
926
  if (!opts.showSource) return "";
842
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>` : "";
843
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>` : "";
844
930
  let openButton = "";
845
931
  if (opts.showOpenInEditor) {
@@ -849,7 +935,7 @@ function sourceDisclosure(source, opts) {
849
935
  }
850
936
  }
851
937
  const sourceHtml = highlightedSource(source);
852
- 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>`;
853
939
  }
854
940
  function highlightedSource(source) {
855
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-OJR3MQYV.js";
5
+ } from "./chunk-JFPY3UJ7.js";
6
+ import "./chunk-HGN652MU.js";
7
+ import "./chunk-KQAEKMIX.js";
6
8
  import "./chunk-U6EQI3U6.js";
7
- import "./chunk-YAA6IID3.js";
9
+ import "./chunk-7UEMZREK.js";
8
10
  import "./chunk-A4GOY3PE.js";
9
11
  import "./chunk-6KFWC4CO.js";
10
- import "./chunk-QOOUC2J5.js";
11
- import "./chunk-WCT3NYCV.js";
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-QLCCJEJI.js";
16
- import "./chunk-Y3J7VR52.js";
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-QOZHKTCT.js.map
26
+ //# sourceMappingURL=charts-d3-EW3YQTEA.js.map