@diagrammo/dgmo 0.48.2 → 0.50.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 (244) hide show
  1. package/.cursorrules +12 -3
  2. package/.github/copilot-instructions.md +12 -3
  3. package/.windsurfrules +12 -3
  4. package/SKILL.md +12 -3
  5. package/dist/advanced.d.ts +851 -1
  6. package/dist/advanced.js +601 -177
  7. package/dist/auto.css +63 -0
  8. package/dist/auto.js +220 -110
  9. package/dist/auto.mjs +45920 -33167
  10. package/dist/block.css +63 -0
  11. package/dist/block.d.ts +13 -5
  12. package/dist/block.js +239 -62
  13. package/dist/{charts-d3-QOZHKTCT.js → charts-d3-DKUD7MQE.js} +9 -8
  14. package/dist/{chunk-3MQQNXPD.js → chunk-2C56LEML.js} +3 -3
  15. package/dist/{chunk-L66GEFB6.js → chunk-2JJ2KNPI.js} +4 -4
  16. package/dist/{chunk-6SM5NJQH.js → chunk-2QYTMIRR.js} +4 -4
  17. package/dist/{chunk-RJE5JTVK.js → chunk-3G6TMNVF.js} +7 -7
  18. package/dist/{chunk-MO5YHHMQ.js → chunk-3LKM6FMW.js} +2 -2
  19. package/dist/{chunk-76OWZ3BA.js → chunk-3P2DKJCG.js} +2 -2
  20. package/dist/chunk-3TDRHT4J.js +1043 -0
  21. package/dist/chunk-3XPUDB7B.js +420 -0
  22. package/dist/{chunk-2LACINWN.js → chunk-3ZPC476N.js} +7 -7
  23. package/dist/{chunk-G2H74XJZ.js → chunk-4BMJQFNK.js} +8 -8
  24. package/dist/{chunk-THXCFRTU.js → chunk-4S723I74.js} +9 -9
  25. package/dist/{chunk-6NYWYNBI.js → chunk-4XK3FLFB.js} +3 -3
  26. package/dist/chunk-5JSWBPZZ.js +607 -0
  27. package/dist/{chunk-WCT3NYCV.js → chunk-5LWQH6QV.js} +1 -1
  28. package/dist/{chunk-7DTWEFUE.js → chunk-5Z736BSU.js} +8 -8
  29. package/dist/{chunk-ERLBPDGU.js → chunk-6BFZKBGD.js} +2 -2
  30. package/dist/{chunk-6HO5ZTXK.js → chunk-6IAA2QQ2.js} +2 -2
  31. package/dist/{chunk-H6PI3KJT.js → chunk-6IUAK7RZ.js} +2 -2
  32. package/dist/{chunk-RTLBSQ3G.js → chunk-6M5PJFQG.js} +3 -3
  33. package/dist/{chunk-Z5CGSFJB.js → chunk-6X4AKWLF.js} +4 -4
  34. package/dist/{chunk-OJR3MQYV.js → chunk-6ZT4U37Q.js} +291 -52
  35. package/dist/{chunk-5QXL4NYS.js → chunk-7G2ER4CY.js} +10 -5
  36. package/dist/chunk-7PQYTZMA.js +681 -0
  37. package/dist/{chunk-OURHMODR.js → chunk-7RB5Q6MB.js} +11 -11
  38. package/dist/{chunk-YAA6IID3.js → chunk-7UEMZREK.js} +2 -2
  39. package/dist/{chunk-AN2MOO5T.js → chunk-A3WQVFBS.js} +3 -3
  40. package/dist/{chunk-VOKGH627.js → chunk-AHGF2YYA.js} +13 -3
  41. package/dist/{chunk-CI2G3OEB.js → chunk-ASS5YYIZ.js} +12 -12
  42. package/dist/{chunk-TYS6CSS5.js → chunk-BCYVE3N5.js} +2 -2
  43. package/dist/chunk-BDXC7MDK.js +2395 -0
  44. package/dist/chunk-BTUTZMPT.js +482 -0
  45. package/dist/{chunk-YGJTDXVR.js → chunk-C4GQDB5L.js} +2 -2
  46. package/dist/{chunk-Y2ZE3MSG.js → chunk-C63UWAKM.js} +2 -2
  47. package/dist/{chunk-725LDASD.js → chunk-CLD2OKV7.js} +2 -2
  48. package/dist/{chunk-WBRZJOEC.js → chunk-CMCR5WBW.js} +3 -3
  49. package/dist/{chunk-IZMRON6C.js → chunk-CVV36CWI.js} +2 -2
  50. package/dist/chunk-DMJJ3CEQ.js +254 -0
  51. package/dist/{chunk-MZSBFAPJ.js → chunk-EJTKV7CY.js} +9 -9
  52. package/dist/{chunk-FITOLXSX.js → chunk-EOFPYPAU.js} +26 -2
  53. package/dist/{chunk-X5LCYCL5.js → chunk-ER5SCQWQ.js} +5 -5
  54. package/dist/{chunk-4OHACBGX.js → chunk-F2L5GCQ4.js} +2 -2
  55. package/dist/{chunk-FCIIHT24.js → chunk-F5UDBSJY.js} +7 -7
  56. package/dist/{chunk-3JLKYGBQ.js → chunk-F7BFXWNQ.js} +2 -2
  57. package/dist/{chunk-FANX6UJR.js → chunk-FAL7NOK3.js} +11 -11
  58. package/dist/{chunk-BUPDIHML.js → chunk-FB2WHOEQ.js} +4 -4
  59. package/dist/chunk-FL4IOQ37.js +379 -0
  60. package/dist/{chunk-LIOHW36Z.js → chunk-GBE54KY6.js} +6 -5
  61. package/dist/{chunk-RUNNI6VE.js → chunk-GL5UZ6NY.js} +3 -3
  62. package/dist/{chunk-4GRI7MEB.js → chunk-GPWHQ5FJ.js} +6 -6
  63. package/dist/chunk-GROQGHCT.js +960 -0
  64. package/dist/{chunk-SGZYXELT.js → chunk-H73FP42Q.js} +9 -6
  65. package/dist/{chunk-PBAHEPLQ.js → chunk-HGN652MU.js} +7 -6
  66. package/dist/{chunk-3SMGIJDD.js → chunk-HHXOONLX.js} +13 -1
  67. package/dist/{chunk-QOOUC2J5.js → chunk-HQCHYB5F.js} +2 -2
  68. package/dist/{chunk-AELOBFW5.js → chunk-I4IFRCUB.js} +3 -3
  69. package/dist/{chunk-GMR5MFHJ.js → chunk-I7F2A35O.js} +2 -2
  70. package/dist/{chunk-T2OE3YQB.js → chunk-IA3FJYWR.js} +3 -3
  71. package/dist/chunk-IAEC4KLA.js +492 -0
  72. package/dist/chunk-IVKC4GID.js +32 -0
  73. package/dist/{chunk-HSH73DP6.js → chunk-JFYIP7XU.js} +139 -39
  74. package/dist/{chunk-CKNVO24D.js → chunk-JZNMXEIV.js} +2 -2
  75. package/dist/chunk-KJXIHOVL.js +940 -0
  76. package/dist/chunk-L2ZTFHAY.js +331 -0
  77. package/dist/{chunk-B7JUCQUA.js → chunk-M5RXSRO2.js} +4 -4
  78. package/dist/{chunk-ULOEATBZ.js → chunk-NFFIKVNO.js} +106 -29
  79. package/dist/{chunk-PZMETGLY.js → chunk-NISQC5KW.js} +358 -122
  80. package/dist/chunk-O4VUFXIH.js +574 -0
  81. package/dist/{chunk-RVMRZAPB.js → chunk-O76UD6VJ.js} +3 -3
  82. package/dist/{chunk-JM4LEPY3.js → chunk-O7NUCTFU.js} +2 -2
  83. package/dist/{chunk-JED6ZDEE.js → chunk-O7WP4ZD4.js} +2 -2
  84. package/dist/{chunk-EVCVDTXE.js → chunk-OHQEMBLI.js} +3 -3
  85. package/dist/{chunk-ZBWMSD5N.js → chunk-ONA5KPV3.js} +4 -4
  86. package/dist/{chunk-Y3J7VR52.js → chunk-OTAL43EH.js} +34 -2
  87. package/dist/{chunk-WCSOJFU3.js → chunk-OTP5KVLO.js} +3 -3
  88. package/dist/{chunk-RYEGFMUO.js → chunk-PGEGPSCZ.js} +2 -2
  89. package/dist/{chunk-ZO27FGJS.js → chunk-PH5X4GIP.js} +2 -2
  90. package/dist/{chunk-ZJEL4H2R.js → chunk-PJUGRJHJ.js} +9 -9
  91. package/dist/{chunk-ZGR7ULFJ.js → chunk-PLZI6KPM.js} +26 -14
  92. package/dist/{chunk-3R5POCTZ.js → chunk-PMN3Q7RJ.js} +6 -6
  93. package/dist/{chunk-YGJZWZTY.js → chunk-PZFVK3IH.js} +2 -2
  94. package/dist/chunk-Q4V4XQWV.js +158 -0
  95. package/dist/chunk-QDFNCATJ.js +325 -0
  96. package/dist/{chunk-QEBUY5NY.js → chunk-QFQ35BTO.js} +4 -4
  97. package/dist/chunk-QQJUTGQH.js +135 -0
  98. package/dist/{chunk-PWIHZ6NJ.js → chunk-QUJGFNFN.js} +4 -4
  99. package/dist/{chunk-J5FIXQRT.js → chunk-R56LASIN.js} +4 -4
  100. package/dist/{chunk-SRTU6HMQ.js → chunk-RV26LTUU.js} +8 -8
  101. package/dist/chunk-RV6A2B5S.js +354 -0
  102. package/dist/{chunk-EB6FPQUP.js → chunk-S5GRONXL.js} +3 -3
  103. package/dist/{chunk-5MLYVTYM.js → chunk-SCHXJTZL.js} +2 -2
  104. package/dist/{chunk-T3UBLACL.js → chunk-SCQ5VPUF.js} +19 -5
  105. package/dist/{chunk-PBHE5UG6.js → chunk-SGFZZAUO.js} +46 -12
  106. package/dist/{chunk-BUVJFRPY.js → chunk-SU2VBK4L.js} +4 -4
  107. package/dist/{chunk-SML67VPV.js → chunk-T4BRO3Z6.js} +3 -3
  108. package/dist/{chunk-NURGB5Z4.js → chunk-TSA237IM.js} +2 -2
  109. package/dist/chunk-TWCLK2GA.js +273 -0
  110. package/dist/{chunk-IJZFN3HM.js → chunk-TWQUYVP3.js} +4 -4
  111. package/dist/{chunk-DKEPS5LH.js → chunk-U2HGPLZS.js} +36 -2
  112. package/dist/{chunk-B65G5DNL.js → chunk-URSQLCTR.js} +3 -3
  113. package/dist/{chunk-ILKORZ3H.js → chunk-UUS2GIJZ.js} +7 -7
  114. package/dist/{chunk-XAKEUMEJ.js → chunk-UXOSVCLJ.js} +4 -4
  115. package/dist/{chunk-QLCCJEJI.js → chunk-WCUHAQKB.js} +2 -2
  116. package/dist/{chunk-WVAJFAIA.js → chunk-WWN566I7.js} +257 -101
  117. package/dist/{chunk-IPWPWM6R.js → chunk-X2NMFTG3.js} +111 -10
  118. package/dist/{chunk-UWN33VNX.js → chunk-XCLHOZAM.js} +10 -10
  119. package/dist/{chunk-P235SVAH.js → chunk-XDXNDSKO.js} +2 -2
  120. package/dist/chunk-XHVV4NVW.js +51 -0
  121. package/dist/{chunk-33LCUH4H.js → chunk-XMVQ5F4M.js} +4 -4
  122. package/dist/{chunk-MITI6NOL.js → chunk-YA7D2N2O.js} +11 -11
  123. package/dist/{chunk-7JEGTRLD.js → chunk-YB3FW24O.js} +3 -3
  124. package/dist/chunk-YNRDWYZP.js +295 -0
  125. package/dist/{chunk-44CM72SQ.js → chunk-YZLMKW4T.js} +3 -3
  126. package/dist/chunk-Z6XJQ6KO.js +452 -0
  127. package/dist/cli.cjs +179 -133
  128. package/dist/clock.d.ts +10 -0
  129. package/dist/clock.js +235 -0
  130. package/dist/countdown.d.ts +12 -0
  131. package/dist/countdown.js +450 -0
  132. package/dist/dgmo-router-QOMFCOOV.js +84 -0
  133. package/dist/dimensions-P5FSX2QN.js +22 -0
  134. package/dist/editor.js +43 -2
  135. package/dist/element.js +220 -110
  136. package/dist/element.mjs +45920 -33167
  137. package/dist/{flowchart-parser-ZNSKIBVR.js → flowchart-parser-OE4WHLTF.js} +4 -4
  138. package/dist/{flowchart-renderer-SNDSII4D.js → flowchart-renderer-GPCSMTOR.js} +8 -8
  139. package/dist/highlight.d.ts +17 -1
  140. package/dist/highlight.js +163 -6
  141. package/dist/index.d.ts +5 -1
  142. package/dist/index.js +199 -233
  143. package/dist/{layout-HRBZPFCN.js → layout-34CLNICW.js} +5 -5
  144. package/dist/layout-46366KBT.js +10 -0
  145. package/dist/{layout-HWDSRX5E.js → layout-5BG6DFCU.js} +6 -6
  146. package/dist/layout-6RDJHS6E.js +9 -0
  147. package/dist/{layout-7QXCNOVS.js → layout-7H4H46CS.js} +3 -3
  148. package/dist/{layout-46N4JJYK.js → layout-7SKMFYHL.js} +5 -5
  149. package/dist/{layout-EE6GE46Y.js → layout-DC4TVXER.js} +5 -5
  150. package/dist/layout-FGQWRYYW.js +14 -0
  151. package/dist/{layout-S2QBYSK2.js → layout-NXG63LWH.js} +3 -3
  152. package/dist/{layout-N76NR4ZO.js → layout-PUQCB6AN.js} +7 -7
  153. package/dist/{layout-HYZPWAK5.js → layout-QNUQLEHU.js} +3 -3
  154. package/dist/{layout-UM5F4DJB.js → layout-T3OZU5QW.js} +5 -5
  155. package/dist/layout-TJIWF7EM.js +14 -0
  156. package/dist/layout-VYELEAW7.js +14 -0
  157. package/dist/{layout-5RA6QWR6.js → layout-WZHNDT2O.js} +6 -6
  158. package/dist/{layout-search-OYV77HHS.js → layout-search-QS44PI5R.js} +6 -6
  159. package/dist/{parser-6BTRLKRZ.js → parser-45DENHFZ.js} +4 -4
  160. package/dist/{parser-TFZFBVWN.js → parser-4AI5ZN5F.js} +3 -3
  161. package/dist/{parser-XDVELHRK.js → parser-4P36TUVD.js} +4 -4
  162. package/dist/{parser-ZSDPZYQP.js → parser-5AURY4A6.js} +4 -4
  163. package/dist/{parser-N5O4IHUN.js → parser-A2BEFMGK.js} +4 -4
  164. package/dist/parser-B5FVS7O6.js +11 -0
  165. package/dist/{parser-NGU3ETO6.js → parser-C2HF2C2E.js} +4 -4
  166. package/dist/parser-CSFUN3CT.js +14 -0
  167. package/dist/{parser-TRTHDFPP.js → parser-D3QT6GWN.js} +5 -5
  168. package/dist/parser-D5637H5H.js +15 -0
  169. package/dist/{parser-VQP2UJ6W.js → parser-DFFEDKHH.js} +3 -3
  170. package/dist/parser-DOKMZXVZ.js +13 -0
  171. package/dist/parser-FMPCVFRK.js +15 -0
  172. package/dist/{parser-Y6WTBU76.js → parser-HYRTF3DO.js} +3 -3
  173. package/dist/{parser-I6KXEYFK.js → parser-I2UIJKVQ.js} +4 -4
  174. package/dist/{parser-O5J4VBII.js → parser-IBWNAPY4.js} +3 -3
  175. package/dist/{parser-PQ3POX45.js → parser-KUQWRPIT.js} +4 -4
  176. package/dist/{parser-2MFP2H2E.js → parser-LWKKBNSA.js} +3 -3
  177. package/dist/{parser-OV7NOBW6.js → parser-O4QFCUW7.js} +5 -5
  178. package/dist/{parser-IXSZZQHY.js → parser-PGMQDD4G.js} +4 -4
  179. package/dist/{parser-3STE62GB.js → parser-Q4QKCIWQ.js} +4 -4
  180. package/dist/parser-QTOB4KFL.js +14 -0
  181. package/dist/{parser-2EWECDSA.js → parser-QYYM4QVW.js} +4 -4
  182. package/dist/{parser-4OGOBJJ4.js → parser-RZMQP7MM.js} +4 -4
  183. package/dist/parser-RZPVAQVX.js +11 -0
  184. package/dist/parser-SOUJOEYI.js +13 -0
  185. package/dist/{parser-4FL2CMDG.js → parser-UQE5OWZI.js} +5 -5
  186. package/dist/{parser-NRAI6O25.js → parser-WAV5JRPT.js} +4 -4
  187. package/dist/{parser-KNSQSKQO.js → parser-YLKYBRIT.js} +5 -5
  188. package/dist/{parser-XKRP7QKP.js → parser-YS7TOS2K.js} +3 -3
  189. package/dist/{parser-AQETEVRW.js → parser-ZSOWUBML.js} +5 -5
  190. package/dist/{parser-CFZD5IBL.js → parser-ZTBATMLX.js} +4 -4
  191. package/dist/{renderer-VACVQYML.js → renderer-35HSIDMZ.js} +8 -8
  192. package/dist/{renderer-5MYBMBYO.js → renderer-4ITCHBT7.js} +5 -5
  193. package/dist/{renderer-CLJHQPBJ.js → renderer-67NPCBIS.js} +11 -11
  194. package/dist/{renderer-5NDVNDAZ.js → renderer-6GHYK7DX.js} +9 -9
  195. package/dist/{renderer-Z7I3W2PP.js → renderer-6RNGHC5Z.js} +8 -8
  196. package/dist/renderer-72LGR2YF.js +14 -0
  197. package/dist/{renderer-KQB7UGDS.js → renderer-7RH2SI3B.js} +3 -3
  198. package/dist/renderer-7SWMIFMM.js +21 -0
  199. package/dist/renderer-BBCEFILK.js +24 -0
  200. package/dist/{renderer-JGBKUCZD.js → renderer-BSW7SRIZ.js} +4 -4
  201. package/dist/{renderer-BYCNMBF7.js → renderer-BY533UWU.js} +11 -11
  202. package/dist/{renderer-6W5462RB.js → renderer-BZSBPTZJ.js} +9 -9
  203. package/dist/{renderer-7MVLWWQD.js → renderer-CXUC4KAD.js} +9 -9
  204. package/dist/{renderer-QIWVHWZO.js → renderer-DAXMXIKD.js} +3 -3
  205. package/dist/renderer-FZUKFUNZ.js +23 -0
  206. package/dist/renderer-G2NLGNKF.js +17 -0
  207. package/dist/renderer-GO3FE3RA.js +24 -0
  208. package/dist/{renderer-ZGNTUWC4.js → renderer-HPGR6USK.js} +8 -8
  209. package/dist/{renderer-UV6MI64M.js → renderer-HVCU2C3Z.js} +3 -3
  210. package/dist/renderer-ICJN2SA2.js +24 -0
  211. package/dist/{renderer-AWWAF6XD.js → renderer-INEXO7B6.js} +10 -10
  212. package/dist/{renderer-YY2OSF6E.js → renderer-KDYCFRBX.js} +8 -8
  213. package/dist/renderer-KY4KQBTF.js +19 -0
  214. package/dist/{renderer-B2OMQIQG.js → renderer-LBN65V45.js} +13 -13
  215. package/dist/{renderer-N43WR5GV.js → renderer-MGBWOCXG.js} +10 -10
  216. package/dist/{renderer-PGX2TKVS.js → renderer-O4JKUGKO.js} +8 -8
  217. package/dist/{renderer-4JHRUBE6.js → renderer-OOGFODWP.js} +10 -10
  218. package/dist/{renderer-6EEZHMH4.js → renderer-Q6ZKPLS6.js} +9 -9
  219. package/dist/{renderer-RPOA5YPZ.js → renderer-SZQ326M5.js} +12 -12
  220. package/dist/{renderer-ZRNG54CW.js → renderer-TKG6LS4U.js} +11 -11
  221. package/dist/{renderer-W4M6QLIJ.js → renderer-TQMZGDAX.js} +13 -13
  222. package/dist/renderer-radial-JELMHQ24.js +21 -0
  223. package/dist/{resolver-NOAA7ID7.js → resolver-FHBCO3PL.js} +3 -3
  224. package/dist/{state-parser-Z2V23ATR.js → state-parser-3REXRK3R.js} +4 -4
  225. package/dist/{state-renderer-B4DQBM6M.js → state-renderer-XYLNRWXR.js} +8 -8
  226. package/docs/ai-integration.md +12 -3
  227. package/docs/language-reference.md +429 -24
  228. package/gallery/fixtures/body.dgmo +17 -0
  229. package/gallery/fixtures/bracket.dgmo +30 -0
  230. package/gallery/fixtures/clock.dgmo +8 -0
  231. package/gallery/fixtures/countdown.dgmo +3 -0
  232. package/gallery/fixtures/family.dgmo +23 -0
  233. package/gallery/fixtures/goal.dgmo +4 -0
  234. package/gallery/fixtures/sketch.dgmo +22 -0
  235. package/package.json +12 -4
  236. package/dist/chunk-ODZVHU3R.js +0 -153
  237. package/dist/dgmo-router-X35VLZLM.js +0 -73
  238. package/dist/dimensions-J3FHIMJ6.js +0 -22
  239. package/dist/layout-5T6RH5M6.js +0 -14
  240. package/dist/layout-G23F7LDH.js +0 -9
  241. package/dist/layout-OB3RI63S.js +0 -14
  242. package/dist/parser-JAL2HD4I.js +0 -13
  243. package/dist/renderer-SMIBCRVB.js +0 -24
  244. package/dist/renderer-radial-C32GPJQ7.js +0 -21
@@ -0,0 +1,450 @@
1
+ // src/countdown/resolve.ts
2
+ var DAY_MS = 864e5;
3
+ var WEEK_MS = 7 * DAY_MS;
4
+ function ordinalWord(n) {
5
+ const abs = Math.abs(n);
6
+ const tens = abs % 100;
7
+ let suffix = "th";
8
+ if (tens < 11 || tens > 13) {
9
+ const ones = abs % 10;
10
+ suffix = ones === 1 ? "st" : ones === 2 ? "nd" : ones === 3 ? "rd" : "th";
11
+ }
12
+ return `${n}${suffix}`;
13
+ }
14
+ function applyOrdinalTemplate(template, n) {
15
+ return template.replace(/\bNth\b/g, ordinalWord(n)).replace(/\bN\b/g, String(n));
16
+ }
17
+ function dayStart(ms) {
18
+ const d = new Date(ms);
19
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
20
+ }
21
+ function nthWeekdayOfMonth(year, month, weekday, nth, hour, minute) {
22
+ if (nth < 0) {
23
+ const last = new Date(year, month + 1, 0).getDate();
24
+ for (let d = last; d >= 1; d--) {
25
+ if (new Date(year, month, d).getDay() === weekday) {
26
+ return new Date(year, month, d, hour, minute).getTime();
27
+ }
28
+ }
29
+ return null;
30
+ }
31
+ const firstDow = new Date(year, month, 1).getDay();
32
+ const offset = (weekday - firstDow + 7) % 7;
33
+ const day = 1 + offset + (nth - 1) * 7;
34
+ if (day > new Date(year, month + 1, 0).getDate()) return null;
35
+ return new Date(year, month, day, hour, minute).getTime();
36
+ }
37
+ function resolveNext(rule, now) {
38
+ const nowD = new Date(now);
39
+ const { hour, minute } = rule;
40
+ const passes = rule.allDay ? (t) => dayStart(t) >= dayStart(now) : (t) => t > now;
41
+ const dayExists = (y, m, d) => new Date(y, m, d).getMonth() === m;
42
+ switch (rule.kind) {
43
+ case "month-day": {
44
+ const month = rule.month;
45
+ const day = rule.day;
46
+ for (let y = nowD.getFullYear(); ; y++) {
47
+ if (!dayExists(y, month, day)) continue;
48
+ const t = new Date(y, month, day, hour, minute).getTime();
49
+ if (passes(t)) return t;
50
+ }
51
+ }
52
+ case "nth-weekday":
53
+ case "last-weekday": {
54
+ const weekday = rule.weekday;
55
+ const nth = rule.kind === "last-weekday" ? -1 : rule.nth;
56
+ let y = nowD.getFullYear();
57
+ let m = nowD.getMonth();
58
+ for (let i = 0; i < 24; i++) {
59
+ const t = nthWeekdayOfMonth(y, m, weekday, nth, hour, minute);
60
+ if (t !== null && passes(t)) return t;
61
+ m++;
62
+ if (m > 11) {
63
+ m = 0;
64
+ y++;
65
+ }
66
+ }
67
+ return now + WEEK_MS;
68
+ }
69
+ case "weekly": {
70
+ const weekday = rule.weekday;
71
+ for (let i = 0; i < 8; i++) {
72
+ const d = new Date(
73
+ nowD.getFullYear(),
74
+ nowD.getMonth(),
75
+ nowD.getDate() + i,
76
+ hour,
77
+ minute
78
+ );
79
+ if (d.getDay() === weekday && passes(d.getTime())) return d.getTime();
80
+ }
81
+ return now + WEEK_MS;
82
+ }
83
+ case "interval": {
84
+ const n = rule.intervalN ?? 1;
85
+ const anchor = rule.anchorMs ?? now;
86
+ if (rule.intervalUnit === "month") {
87
+ const a = new Date(anchor);
88
+ const day = a.getDate();
89
+ for (let k = 0; ; k++) {
90
+ const y = a.getFullYear();
91
+ const m = a.getMonth() + k * n;
92
+ const yy = y + Math.floor(m / 12);
93
+ const mm = (m % 12 + 12) % 12;
94
+ if (!dayExists(yy, mm, day)) continue;
95
+ const t2 = new Date(yy, mm, day, hour, minute).getTime();
96
+ if (passes(t2)) return t2;
97
+ }
98
+ }
99
+ const step = (rule.intervalUnit === "week" ? WEEK_MS : DAY_MS) * n;
100
+ let t = anchor;
101
+ if (!passes(t)) {
102
+ const k = Math.max(0, Math.floor((now - anchor) / step));
103
+ t = anchor + k * step;
104
+ while (!passes(t)) t += step;
105
+ }
106
+ return t;
107
+ }
108
+ }
109
+ }
110
+ function ordinalFor(resolvedMs, since) {
111
+ return new Date(resolvedMs).getFullYear() - since;
112
+ }
113
+ function roundBy(value, mode) {
114
+ return mode === "down" ? Math.floor(value) : mode === "nearest" ? Math.round(value) : Math.ceil(value);
115
+ }
116
+ function pad2(n) {
117
+ return n < 10 ? "0" + n : String(n);
118
+ }
119
+ function plural(n, unit) {
120
+ return `${n} ${unit}${n === 1 ? "" : "s"}`;
121
+ }
122
+ function formatCount(remainingMs, opts) {
123
+ const { units, round, fields } = opts;
124
+ if (units === "days")
125
+ return plural(roundBy(remainingMs / DAY_MS, round), "day");
126
+ if (units === "weeks")
127
+ return plural(roundBy(remainingMs / WEEK_MS, round), "week");
128
+ const totalSec = Math.floor(remainingMs / 1e3);
129
+ if (units === "clock") {
130
+ const h2 = Math.floor(totalSec / 3600);
131
+ const m2 = Math.floor(totalSec % 3600 / 60);
132
+ const s2 = totalSec % 60;
133
+ return `${pad2(h2)}:${pad2(m2)}:${pad2(s2)}`;
134
+ }
135
+ if (units === "words") {
136
+ const days2 = Math.ceil(remainingMs / DAY_MS);
137
+ if (days2 <= 0) return "now";
138
+ if (days2 === 1) return "tomorrow";
139
+ if (days2 < 14) return `${days2} days`;
140
+ if (days2 < 60) return `${Math.round(days2 / 7)} weeks`;
141
+ return `${Math.round(days2 / 30)} months`;
142
+ }
143
+ const days = Math.floor(totalSec / 86400);
144
+ const h = Math.floor(totalSec % 86400 / 3600);
145
+ const m = Math.floor(totalSec % 3600 / 60);
146
+ const s = totalSec % 60;
147
+ const has = (f) => fields.includes(f);
148
+ const clockParts = [];
149
+ if (has("h")) clockParts.push(pad2(h));
150
+ if (has("m")) clockParts.push(pad2(m));
151
+ if (has("s")) clockParts.push(pad2(s));
152
+ const clock = clockParts.join(":");
153
+ const dayPrefix = has("d") && days > 0 ? `${days}d${clock ? " " : ""}` : "";
154
+ return dayPrefix + clock || plural(days, "day");
155
+ }
156
+ function formatWordsDetail(remainingMs) {
157
+ const totalMin = Math.floor(Math.max(0, remainingMs) / 6e4);
158
+ const d = Math.floor(totalMin / 1440);
159
+ const h = Math.floor(totalMin % 1440 / 60);
160
+ const m = totalMin % 60;
161
+ const parts = [];
162
+ if (d > 0) parts.push(`${d} day${d === 1 ? "" : "s"}`);
163
+ if (d > 0 || h > 0) parts.push(`${h} hour${h === 1 ? "" : "s"}`);
164
+ parts.push(`${m} minute${m === 1 ? "" : "s"}`);
165
+ return parts.join(" ");
166
+ }
167
+ function breakdown(nowMs, targetMs) {
168
+ const n = new Date(nowMs);
169
+ const t = new Date(targetMs);
170
+ let y = t.getFullYear() - n.getFullYear();
171
+ let mo = t.getMonth() - n.getMonth();
172
+ let d = t.getDate() - n.getDate();
173
+ let h = t.getHours() - n.getHours();
174
+ let mi = t.getMinutes() - n.getMinutes();
175
+ let s = t.getSeconds() - n.getSeconds();
176
+ if (s < 0) {
177
+ s += 60;
178
+ mi--;
179
+ }
180
+ if (mi < 0) {
181
+ mi += 60;
182
+ h--;
183
+ }
184
+ if (h < 0) {
185
+ h += 24;
186
+ d--;
187
+ }
188
+ if (d < 0) {
189
+ d += new Date(t.getFullYear(), t.getMonth(), 0).getDate();
190
+ mo--;
191
+ }
192
+ if (mo < 0) {
193
+ mo += 12;
194
+ y--;
195
+ }
196
+ return { years: y, months: mo, days: d, hours: h, minutes: mi, seconds: s };
197
+ }
198
+ function humanUnits(nowMs, targetMs) {
199
+ const b = breakdown(nowMs, targetMs);
200
+ return [
201
+ [b.years, "year"],
202
+ [b.months, "month"],
203
+ [b.days, "day"],
204
+ [b.hours, "hour"],
205
+ [b.minutes, "minute"]
206
+ ];
207
+ }
208
+ function formatHuman(nowMs, targetMs) {
209
+ const units = humanUnits(nowMs, targetMs);
210
+ let i = 0;
211
+ while (i < units.length - 1 && units[i][0] === 0) i++;
212
+ const rest = units.slice(i);
213
+ const say = (arr) => arr.map(([n, u]) => `${n} ${u}${n === 1 ? "" : "s"}`).join(", ");
214
+ const primary = rest.slice(0, 2).filter((p, idx) => p[0] > 0 || idx === 0);
215
+ const secondary = rest.slice(2).filter((p) => p[0] > 0);
216
+ return { big: say(primary) || "now", sub: say(secondary) };
217
+ }
218
+ function formatCompound(nowMs, targetMs, maxUnits = 2) {
219
+ const all = humanUnits(nowMs, targetMs);
220
+ let i = 0;
221
+ while (i < all.length - 1 && all[i][0] === 0) i++;
222
+ const chosen = all.slice(i, i + maxUnits).filter((p, idx) => p[0] > 0 || idx === 0);
223
+ if (!chosen.length) return "now";
224
+ return chosen.map(([n, u]) => `${n} ${u}${n === 1 ? "" : "s"}`).join(", ");
225
+ }
226
+ var WEEKDAY_ABBR = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
227
+ var MONTH_ABBR = [
228
+ "Jan",
229
+ "Feb",
230
+ "Mar",
231
+ "Apr",
232
+ "May",
233
+ "Jun",
234
+ "Jul",
235
+ "Aug",
236
+ "Sep",
237
+ "Oct",
238
+ "Nov",
239
+ "Dec"
240
+ ];
241
+ function formatDate(ms) {
242
+ const d = new Date(ms);
243
+ return `${WEEKDAY_ABBR[d.getDay()]} ${MONTH_ABBR[d.getMonth()]} ${d.getDate()} ${d.getFullYear()}`;
244
+ }
245
+ function formatFooter(resolvedMs, hasTime) {
246
+ const parts = [formatDate(resolvedMs)];
247
+ if (hasTime) {
248
+ const d = new Date(resolvedMs);
249
+ parts.push(`${pad2(d.getHours())}:${pad2(d.getMinutes())}`);
250
+ }
251
+ return parts.join(" \xB7 ");
252
+ }
253
+
254
+ // src/countdown/ticker.ts
255
+ var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
256
+ function dayStartLocal(ms) {
257
+ const d = new Date(ms);
258
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
259
+ }
260
+ function dayDeltaLocal(aMs, bMs) {
261
+ const a = new Date(aMs);
262
+ const b = new Date(bMs);
263
+ const a0 = new Date(a.getFullYear(), a.getMonth(), a.getDate()).getTime();
264
+ const b0 = new Date(b.getFullYear(), b.getMonth(), b.getDate()).getTime();
265
+ return Math.round((b0 - a0) / DAY_MS);
266
+ }
267
+ function pad22(n) {
268
+ return n < 10 ? "0" + n : String(n);
269
+ }
270
+ function polar(cx, cy, r, deg) {
271
+ const a = (deg - 90) * Math.PI / 180;
272
+ return [cx + r * Math.cos(a), cy + r * Math.sin(a)];
273
+ }
274
+ function arcPath(cx, cy, r, frac) {
275
+ frac = Math.max(0, Math.min(0.9999, frac));
276
+ const [x0, y0] = polar(cx, cy, r, 0);
277
+ const [x1, y1] = polar(cx, cy, r, frac * 360);
278
+ return `M ${x0} ${y0} A ${r} ${r} 0 ${frac > 0.5 ? 1 : 0} 1 ${x1} ${y1}`;
279
+ }
280
+ function updateGauges(svg, remaining) {
281
+ const rem = Math.abs(remaining);
282
+ const vals = {
283
+ h: Math.floor(rem / 36e5),
284
+ m: Math.floor(rem % 36e5 / 6e4),
285
+ s: Math.floor(rem % 6e4 / 1e3)
286
+ };
287
+ const fracs = {
288
+ h: vals["h"] % 24 / 24,
289
+ m: vals["m"] / 60,
290
+ s: vals["s"] / 60
291
+ };
292
+ svg.querySelectorAll("[data-dgmo-gauge-val]").forEach((el) => {
293
+ const k = el.getAttribute("data-dgmo-gauge-val");
294
+ const v = pad22(vals[k] ?? 0);
295
+ if (el.textContent !== v) el.textContent = v;
296
+ });
297
+ svg.querySelectorAll("[data-dgmo-gauge-arc]").forEach((el) => {
298
+ const k = el.getAttribute("data-dgmo-gauge-arc");
299
+ const cx = Number(el.getAttribute("data-cx"));
300
+ const cy = Number(el.getAttribute("data-cy"));
301
+ const r = Number(el.getAttribute("data-r"));
302
+ const f = fracs[k] ?? 0;
303
+ el.setAttribute("d", f > 1e-3 ? arcPath(cx, cy, r, f) : "");
304
+ });
305
+ const cap = svg.querySelector("[data-dgmo-gauge-caption]");
306
+ if (cap) {
307
+ const t = remaining >= 0 ? "TO GO" : "AGO";
308
+ if (cap.textContent !== t) cap.textContent = t;
309
+ }
310
+ }
311
+ function targetToMs(target) {
312
+ const s = target.trim();
313
+ if (DATE_ONLY_RE.test(s)) {
314
+ const p = s.split("-").map(Number);
315
+ return new Date(p[0], p[1] - 1, p[2]).getTime();
316
+ }
317
+ const t = new Date(s).getTime();
318
+ return Number.isFinite(t) ? t : null;
319
+ }
320
+ function readRule(node) {
321
+ const kind = node.getAttribute("data-dgmo-recur-kind");
322
+ if (!kind) return null;
323
+ const num = (name) => {
324
+ const v = node.getAttribute(name);
325
+ return v === null ? void 0 : Number(v);
326
+ };
327
+ return {
328
+ kind,
329
+ month: num("data-dgmo-recur-month"),
330
+ day: num("data-dgmo-recur-day"),
331
+ nth: num("data-dgmo-recur-nth"),
332
+ weekday: num("data-dgmo-recur-weekday"),
333
+ hour: num("data-dgmo-recur-hour") ?? 0,
334
+ minute: num("data-dgmo-recur-minute") ?? 0,
335
+ allDay: node.getAttribute("data-dgmo-recur-allday") !== "0",
336
+ intervalN: num("data-dgmo-recur-interval-n"),
337
+ intervalUnit: node.getAttribute("data-dgmo-recur-interval-unit") ?? void 0,
338
+ anchorMs: num("data-dgmo-recur-anchor")
339
+ };
340
+ }
341
+ function sameLocalDay(a, b) {
342
+ const x = new Date(a);
343
+ const y = new Date(b);
344
+ return x.getFullYear() === y.getFullYear() && x.getMonth() === y.getMonth() && x.getDate() === y.getDate();
345
+ }
346
+ function readFields(node) {
347
+ const raw = node.getAttribute("data-dgmo-countdown-fields");
348
+ if (!raw) return ["d", "h", "m", "s"];
349
+ return raw.split(",").filter((f) => ["d", "h", "m", "s"].includes(f));
350
+ }
351
+ function updateNode(node, now) {
352
+ const rule = readRule(node);
353
+ const units = node.getAttribute("data-dgmo-countdown-units") || "days";
354
+ const round = node.getAttribute("data-dgmo-countdown-round") || "up";
355
+ const fields = readFields(node);
356
+ const onDay = node.getAttribute("data-dgmo-countdown-onday");
357
+ const title = node.getAttribute("data-dgmo-countdown-title");
358
+ let resolvedMs;
359
+ let expiredNow = false;
360
+ if (rule) {
361
+ resolvedMs = resolveNext(rule, now);
362
+ } else {
363
+ const target = node.getAttribute("data-dgmo-countdown");
364
+ resolvedMs = target ? targetToMs(target) : null;
365
+ if (resolvedMs !== null && resolvedMs - now <= 0) expiredNow = true;
366
+ }
367
+ if (resolvedMs === null) return;
368
+ const remaining = resolvedMs - now;
369
+ const sinceAttr = node.getAttribute("data-dgmo-countdown-since");
370
+ const custom = node.getAttribute("data-dgmo-countdown-expired");
371
+ const hasTime = node.getAttribute("data-dgmo-countdown-hastime") === "1";
372
+ const frozen = expiredNow && custom !== null;
373
+ const clockFinale = hasTime && !frozen && dayDeltaLocal(now, resolvedMs) <= 0;
374
+ let text;
375
+ if (frozen) {
376
+ text = custom;
377
+ } else if (clockFinale) {
378
+ const clock = formatCount(Math.abs(remaining), {
379
+ units: "clock",
380
+ round,
381
+ fields
382
+ });
383
+ text = remaining < 0 ? `${clock} ago` : clock;
384
+ } else if (expiredNow) {
385
+ if (units === "compound" || units === "human")
386
+ text = `${formatCompound(resolvedMs, now)} ago`;
387
+ else {
388
+ const elapsed = -remaining;
389
+ text = elapsed <= 0 ? "Now!" : `${formatCount(elapsed, { units, round, fields })} ago`;
390
+ }
391
+ } else if (rule && sameLocalDay(resolvedMs, now)) {
392
+ text = onDay ?? "Today!";
393
+ } else if (units === "human") {
394
+ text = hasTime ? formatHuman(now, resolvedMs).big : formatHuman(dayStartLocal(now), dayStartLocal(resolvedMs)).big;
395
+ } else if (units === "compound") {
396
+ text = formatCompound(now, resolvedMs);
397
+ } else {
398
+ text = formatCount(Math.max(0, remaining), { units, round, fields });
399
+ }
400
+ if (node.textContent !== text) node.textContent = text;
401
+ node.setAttribute(
402
+ "aria-label",
403
+ title ? `${title}: ${text}` : expiredNow ? text : `${text} remaining`
404
+ );
405
+ const svg = node.ownerSVGElement ?? node.closest("svg");
406
+ if (!svg) return;
407
+ const footer = svg.querySelector("[data-dgmo-countdown-footer]");
408
+ if (footer && !expiredNow) {
409
+ const hasTime2 = node.getAttribute("data-dgmo-countdown-hastime") === "1";
410
+ footer.textContent = formatFooter(resolvedMs, hasTime2);
411
+ }
412
+ const eyebrowEl = svg.querySelector("[data-dgmo-countdown-eyebrow]");
413
+ if (eyebrowEl && sinceAttr) {
414
+ const tpl = node.getAttribute("data-dgmo-countdown-since-label") || "Nth";
415
+ eyebrowEl.textContent = applyOrdinalTemplate(
416
+ tpl,
417
+ ordinalFor(resolvedMs, Number(sinceAttr))
418
+ );
419
+ }
420
+ const detail = svg.querySelector("[data-dgmo-countdown-detail]");
421
+ if (detail && !expiredNow && !clockFinale) {
422
+ if (units === "words") {
423
+ detail.textContent = formatWordsDetail(Math.max(0, remaining));
424
+ } else if (units === "human" && remaining > 0) {
425
+ detail.textContent = hasTime ? formatCount(remaining, { units: "clock", round, fields }) : formatHuman(dayStartLocal(now), dayStartLocal(resolvedMs)).sub;
426
+ }
427
+ }
428
+ if (clockFinale) updateGauges(svg, remaining);
429
+ const stamp = svg.querySelector("[data-dgmo-countdown-asof]");
430
+ if (stamp && stamp.parentNode) stamp.parentNode.removeChild(stamp);
431
+ }
432
+ function tickCountdowns(root = document) {
433
+ if (typeof document === "undefined") return;
434
+ const now = Date.now();
435
+ root.querySelectorAll("[data-dgmo-countdown]").forEach((node) => updateNode(node, now));
436
+ }
437
+ var intervalStarted = false;
438
+ function startCountdowns(root = document) {
439
+ if (typeof window === "undefined" || typeof document === "undefined") return;
440
+ tickCountdowns(root);
441
+ if (intervalStarted) return;
442
+ intervalStarted = true;
443
+ window.setInterval(() => tickCountdowns(document), 1e3);
444
+ }
445
+ export {
446
+ DAY_MS,
447
+ startCountdowns,
448
+ tickCountdowns
449
+ };
450
+ //# sourceMappingURL=countdown.js.map
@@ -0,0 +1,84 @@
1
+ import {
2
+ CHART_TYPE_DESCRIPTIONS,
3
+ chartTypeParsers,
4
+ getAllChartTypes,
5
+ getRenderCategory,
6
+ isExtendedChartType,
7
+ knownChartTypeIds,
8
+ looksLikeC4,
9
+ looksLikeGantt,
10
+ parseDgmo,
11
+ parseDgmoChartType
12
+ } from "./chunk-JFYIP7XU.js";
13
+ import "./chunk-Q4V4XQWV.js";
14
+ import "./chunk-BTUTZMPT.js";
15
+ import "./chunk-YNRDWYZP.js";
16
+ import "./chunk-3XPUDB7B.js";
17
+ import "./chunk-FL4IOQ37.js";
18
+ import "./chunk-PGEGPSCZ.js";
19
+ import "./chunk-DMJJ3CEQ.js";
20
+ import "./chunk-BDXC7MDK.js";
21
+ import "./chunk-XDXNDSKO.js";
22
+ import "./chunk-OHQEMBLI.js";
23
+ import "./chunk-TSA237IM.js";
24
+ import "./chunk-6IAA2QQ2.js";
25
+ import "./chunk-YZLMKW4T.js";
26
+ import "./chunk-3P2DKJCG.js";
27
+ import "./chunk-3LKM6FMW.js";
28
+ import "./chunk-OTP5KVLO.js";
29
+ import "./chunk-YB3FW24O.js";
30
+ import "./chunk-NNAAJVBU.js";
31
+ import "./chunk-XMVQ5F4M.js";
32
+ import "./chunk-UXOSVCLJ.js";
33
+ import "./chunk-FB2WHOEQ.js";
34
+ import "./chunk-U2HGPLZS.js";
35
+ import "./chunk-SU2VBK4L.js";
36
+ import "./chunk-5JSWBPZZ.js";
37
+ import "./chunk-XHVV4NVW.js";
38
+ import "./chunk-WWN566I7.js";
39
+ import "./chunk-O4VUFXIH.js";
40
+ import "./chunk-QQJUTGQH.js";
41
+ import "./chunk-S5GRONXL.js";
42
+ import "./chunk-2JJ2KNPI.js";
43
+ import "./chunk-O76UD6VJ.js";
44
+ import "./chunk-A3WQVFBS.js";
45
+ import "./chunk-6M5PJFQG.js";
46
+ import "./chunk-L3UHP6TD.js";
47
+ import "./chunk-USZW2HHU.js";
48
+ import "./chunk-7G2ER4CY.js";
49
+ import "./chunk-I7F2A35O.js";
50
+ import "./chunk-6BFZKBGD.js";
51
+ import "./chunk-I4IFRCUB.js";
52
+ import "./chunk-URSQLCTR.js";
53
+ import "./chunk-IYULMRBE.js";
54
+ import "./chunk-R3XI2VC7.js";
55
+ import "./chunk-P6T66CCZ.js";
56
+ import "./chunk-T4BRO3Z6.js";
57
+ import "./chunk-C3Z4DX3V.js";
58
+ import "./chunk-WCUHAQKB.js";
59
+ import "./chunk-GBE54KY6.js";
60
+ import "./chunk-I46X5VUA.js";
61
+ import "./chunk-2C56LEML.js";
62
+ import "./chunk-NXMESY4J.js";
63
+ import "./chunk-GL5UZ6NY.js";
64
+ import "./chunk-SCHXJTZL.js";
65
+ import "./chunk-FMDSF3OV.js";
66
+ import "./chunk-FFUN5D66.js";
67
+ import "./chunk-NOTA6TEI.js";
68
+ import "./chunk-OTAL43EH.js";
69
+ import "./chunk-TLVIHFRO.js";
70
+ import "./chunk-CXK4DZH3.js";
71
+ import "./chunk-5WRI5ZAA.js";
72
+ export {
73
+ CHART_TYPE_DESCRIPTIONS,
74
+ chartTypeParsers,
75
+ getAllChartTypes,
76
+ getRenderCategory,
77
+ isExtendedChartType,
78
+ knownChartTypeIds,
79
+ looksLikeC4,
80
+ looksLikeGantt,
81
+ parseDgmo,
82
+ parseDgmoChartType
83
+ };
84
+ //# sourceMappingURL=dgmo-router-QOMFCOOV.js.map
@@ -0,0 +1,22 @@
1
+ import {
2
+ mapContentAspect,
3
+ mapExportDimensions
4
+ } from "./chunk-JZNMXEIV.js";
5
+ import "./chunk-X2NMFTG3.js";
6
+ import "./chunk-I5IGB56C.js";
7
+ import "./chunk-HGN652MU.js";
8
+ import "./chunk-7UEMZREK.js";
9
+ import "./chunk-A4GOY3PE.js";
10
+ import "./chunk-HQCHYB5F.js";
11
+ import "./chunk-5LWQH6QV.js";
12
+ import "./chunk-P6T66CCZ.js";
13
+ import "./chunk-WCUHAQKB.js";
14
+ import "./chunk-OTAL43EH.js";
15
+ import "./chunk-TLVIHFRO.js";
16
+ import "./chunk-CXK4DZH3.js";
17
+ import "./chunk-5WRI5ZAA.js";
18
+ export {
19
+ mapContentAspect,
20
+ mapExportDimensions
21
+ };
22
+ //# sourceMappingURL=dimensions-P5FSX2QN.js.map
package/dist/editor.js CHANGED
@@ -139,6 +139,17 @@ var DIRECTIVES_REGISTRY = [
139
139
  { token: "import", category: "directive" },
140
140
  { token: "hide", category: "directive" },
141
141
  { token: "direction", category: "directive" },
142
+ // ── Clock ────────────────────────────────────────────────
143
+ // The board's flat directives — highlight-only (the parser validates them
144
+ // inline, no extractable Set). `no-title` + `direction` are already listed
145
+ // above (shared). Values (analog is a bare flag; color-by's
146
+ // place|work|daylight|time|none) highlight as plain tokens.
147
+ { token: "analog", category: "directive" },
148
+ { token: "hours", category: "directive" },
149
+ { token: "days", category: "directive" },
150
+ { token: "no-sun", category: "directive" },
151
+ { token: "time-24", category: "directive" },
152
+ { token: "color-by", category: "directive" },
142
153
  // ── Boxes-and-lines ──────────────────────────────────────
143
154
  // `heat <Label> [low] [high]` is the value→colour ramp directive, but `heat`
144
155
  // is NOT registered as a directive keyword: it is dual-use with the `heat:`
@@ -231,6 +242,17 @@ var DIRECTIVES_REGISTRY = [
231
242
  { token: "scrubber-trials", category: "directive" },
232
243
  { token: "start-date", category: "directive" },
233
244
  { token: "end-date", category: "directive" },
245
+ // ── Goal ─────────────────────────────────────────────────
246
+ // Mode flags, value-key leaders, and opt-outs. `now`/`target` collide with
247
+ // label prose ("start now", "on target"), but the arrow-label demotion pass
248
+ // (see highlight-api LABEL_WORD_NODES) treats any keyword-bearing label as
249
+ // text and demotes them, so they highlight only as line leaders.
250
+ { token: "thermometer", category: "directive" },
251
+ { token: "gauge", category: "directive" },
252
+ { token: "now", category: "directive" },
253
+ { token: "target", category: "directive" },
254
+ { token: "no-note", category: "directive" },
255
+ { token: "no-auto-color", category: "directive" },
234
256
  // ── Control-flow + wireframe element keywords (CONTROL) ──
235
257
  { token: "if", category: "control" },
236
258
  { token: "else", category: "control" },
@@ -272,7 +294,19 @@ var DIRECTIVES_REGISTRY = [
272
294
  { token: "date", category: "modifier" },
273
295
  { token: "timestamp", category: "modifier" },
274
296
  { token: "float", category: "modifier" },
275
- { token: "decimal", category: "modifier" }
297
+ { token: "decimal", category: "modifier" },
298
+ // ── Bracket ──────────────────────────────────────────────
299
+ // `beats` / `vs` are the infix match keywords; the rest are line directives.
300
+ // (`seed` and `no-legend` already appear above — shared, not re-listed.)
301
+ { token: "beats", category: "control" },
302
+ { token: "vs", category: "control" },
303
+ { token: "rounds", category: "directive" },
304
+ { token: "accent", category: "directive" },
305
+ { token: "no-round", category: "modifier" },
306
+ { token: "no-rounds", category: "modifier" },
307
+ { token: "single-elim", category: "modifier" },
308
+ { token: "double-elim", category: "modifier" },
309
+ { token: "seeded", category: "modifier" }
276
310
  ];
277
311
  function tokensWhere(pred) {
278
312
  const out = /* @__PURE__ */ new Set();
@@ -320,10 +354,12 @@ var CHART_TYPES = /* @__PURE__ */ new Set([
320
354
  "class",
321
355
  "er",
322
356
  "org",
357
+ "family",
323
358
  "kanban",
324
359
  "c4",
325
360
  "state",
326
361
  "sitemap",
362
+ "bracket",
327
363
  "infra",
328
364
  "gantt",
329
365
  "pert",
@@ -338,6 +374,10 @@ var CHART_TYPES = /* @__PURE__ */ new Set([
338
374
  "ring",
339
375
  "treemap",
340
376
  "block",
377
+ "goal",
378
+ "countdown",
379
+ "clock",
380
+ "sketch",
341
381
  "raci",
342
382
  "cycle",
343
383
  // Data chart types
@@ -359,7 +399,8 @@ var CHART_TYPES = /* @__PURE__ */ new Set([
359
399
  "event-line",
360
400
  "venn",
361
401
  "quadrant",
362
- "map"
402
+ "map",
403
+ "body"
363
404
  ]);
364
405
  var METADATA_KEYS = /* @__PURE__ */ new Set([
365
406
  "title",