@diagrammo/dgmo 0.92.1 → 0.94.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 (174) hide show
  1. package/dist/advanced.d.ts +103 -38
  2. package/dist/advanced.js +457 -423
  3. package/dist/block.d.ts +2 -2
  4. package/dist/block.js +75 -70
  5. package/dist/{chart-meta-BBqLnv5q.d.ts → chart-meta-BbjsRY7o.d.ts} +2 -2
  6. package/dist/chart-meta.d.ts +3 -3
  7. package/dist/chart-meta.js +25 -19
  8. package/dist/{chart-types-CbXlZFLd.d.ts → chart-types-Cppnp31G.d.ts} +173 -4
  9. package/dist/{charts-d3-QUUDVETP.js → charts-d3-SZV2SFTM.js} +7 -6
  10. package/dist/{chunk-ADNIO3XY.js → chunk-2FDQEQID.js} +5 -5
  11. package/dist/{chunk-QUGC7GWB.js → chunk-2HSHWPTO.js} +15 -15
  12. package/dist/{chunk-L5NW3PVL.js → chunk-2I4UQG7W.js} +1 -1
  13. package/dist/{chunk-2YAFDND3.js → chunk-2MS623GW.js} +4 -6
  14. package/dist/{chunk-73EYNV4O.js → chunk-2XMTZ5JR.js} +4 -6
  15. package/dist/{chunk-ZJAK6C7Y.js → chunk-3PP746YM.js} +6 -1
  16. package/dist/{chunk-MDVJYRJT.js → chunk-3TWBMU7K.js} +22 -22
  17. package/dist/{chunk-FTUMRSGT.js → chunk-3ZP3QC47.js} +8 -288
  18. package/dist/{chunk-J2E7EUER.js → chunk-4EX4OKGZ.js} +86 -23
  19. package/dist/{chunk-Y2V5AEVG.js → chunk-4SP6OUO7.js} +1952 -1824
  20. package/dist/{chunk-HIWHIYLD.js → chunk-4TEPDQHJ.js} +19 -19
  21. package/dist/{chunk-DEFBUZWV.js → chunk-5HAYT43L.js} +70 -54
  22. package/dist/{chunk-6WVX4KNP.js → chunk-5ZUZZDW5.js} +97 -297
  23. package/dist/{chunk-X5BUX2GK.js → chunk-6JCTW74W.js} +7 -5
  24. package/dist/{chunk-Q6W2K33N.js → chunk-6XLMTAEX.js} +1 -1
  25. package/dist/{chunk-ONYO5WJW.js → chunk-7IOZ6JE4.js} +21 -21
  26. package/dist/chunk-7SXV7NUS.js +416 -0
  27. package/dist/{chunk-NPWVOFB3.js → chunk-7WEYXYLC.js} +1 -1
  28. package/dist/{chunk-GE7ICBX6.js → chunk-AM42TLSZ.js} +102 -97
  29. package/dist/{chunk-WLLO3PZ3.js → chunk-AYUSD4Z6.js} +45 -19
  30. package/dist/{chunk-45QUTYPD.js → chunk-B25IWGDH.js} +69 -20
  31. package/dist/{chunk-JKST4RTT.js → chunk-BH2SF4TT.js} +6 -6
  32. package/dist/{chunk-6OIMUSDX.js → chunk-C6G36F5S.js} +9 -9
  33. package/dist/{chunk-DRFGIOZ6.js → chunk-CIHHTS5B.js} +4 -6
  34. package/dist/chunk-CYTFO2LF.js +209 -0
  35. package/dist/{chunk-Q2UFOKPB.js → chunk-DDIOWNHS.js} +22 -22
  36. package/dist/{chunk-Q6ZQX2HX.js → chunk-DLJJOCIT.js} +4 -6
  37. package/dist/{chunk-26BBJUBW.js → chunk-DNM3XZCK.js} +4 -6
  38. package/dist/{chunk-AUS7V54P.js → chunk-ERT7XDQW.js} +1 -1
  39. package/dist/{chunk-7ENDOHAA.js → chunk-FMAVHTYB.js} +919 -927
  40. package/dist/{chunk-URQIWIKX.js → chunk-FWVE373X.js} +4 -4
  41. package/dist/{chunk-VOR32OHN.js → chunk-G3HZ4PGE.js} +13 -15
  42. package/dist/{chunk-RBFJT23E.js → chunk-GWQRTA5W.js} +6 -6
  43. package/dist/chunk-GXCDD6NG.js +24 -0
  44. package/dist/{chunk-3PFMGNOM.js → chunk-HHVIE45A.js} +26 -11
  45. package/dist/{chunk-MXAP37W6.js → chunk-HI6R27YA.js} +16 -7
  46. package/dist/{chunk-QQPNCXAO.js → chunk-I37S3EZE.js} +18 -18
  47. package/dist/{chunk-YITHYQCL.js → chunk-IGJEKO2P.js} +8 -8
  48. package/dist/{chunk-BZX7QCXJ.js → chunk-IHN6WDEY.js} +15 -15
  49. package/dist/{chunk-QT3KDDXK.js → chunk-IN7XI6NO.js} +0 -7
  50. package/dist/{chunk-4QLGGQNO.js → chunk-IZHGT5HD.js} +44 -18
  51. package/dist/{chunk-5SSTVFPX.js → chunk-JT2BG7LM.js} +5 -7
  52. package/dist/{chunk-2BJW7FSF.js → chunk-KBEWVCK3.js} +1 -1
  53. package/dist/{chunk-DUPZ2BBY.js → chunk-KBHT5XEY.js} +143 -6
  54. package/dist/{chunk-V4D2ZQBE.js → chunk-KRPLP5LP.js} +6 -1
  55. package/dist/{chunk-QKY6W4NA.js → chunk-KSZB7TIY.js} +25 -25
  56. package/dist/{chunk-6ZL2XYM7.js → chunk-MLY5ALOV.js} +6 -6
  57. package/dist/{chunk-VSOZZYLK.js → chunk-NERQSSYD.js} +20 -9
  58. package/dist/{chunk-OQW4ETJX.js → chunk-NM5V5EKY.js} +6 -1
  59. package/dist/{chunk-EBSFSOJC.js → chunk-NOQB4KMV.js} +22 -22
  60. package/dist/{chunk-6BNNLVAR.js → chunk-NPDVWFAQ.js} +6 -1
  61. package/dist/{chunk-FSJ3ZA6N.js → chunk-OSSTOSXU.js} +12 -12
  62. package/dist/chunk-P7TRFL4P.js +54 -0
  63. package/dist/{chunk-A4PNWAUW.js → chunk-PGSGJLUR.js} +6 -1
  64. package/dist/{chunk-S7W75MIM.js → chunk-QKPOIJBT.js} +23 -5
  65. package/dist/{chunk-YO6AQU4A.js → chunk-QPQWY5RU.js} +12 -12
  66. package/dist/{chunk-NREU4JFE.js → chunk-RBVFNUAL.js} +6 -8
  67. package/dist/{chunk-5EBYPETE.js → chunk-RESEJSCV.js} +3 -5
  68. package/dist/{chunk-BRSM6Z34.js → chunk-RITTLIDJ.js} +14 -14
  69. package/dist/{chunk-MX4SZLSV.js → chunk-S5Y3OO3V.js} +16 -8
  70. package/dist/{chunk-O5WUZGPV.js → chunk-TASRGDYP.js} +18 -18
  71. package/dist/{chunk-HXULJZA2.js → chunk-TDAGJJPZ.js} +6 -1
  72. package/dist/chunk-UCHZJJIT.js +421 -0
  73. package/dist/{chunk-42UJ23H3.js → chunk-UIEKW4SG.js} +1 -0
  74. package/dist/{chunk-WFA6IULY.js → chunk-URRAWU5D.js} +5 -0
  75. package/dist/{chunk-IGKFOHBG.js → chunk-VBMRZCMQ.js} +13 -13
  76. package/dist/{chunk-JRWUHLRP.js → chunk-VDY2GR6U.js} +51 -8
  77. package/dist/{chunk-EJS3K44P.js → chunk-VGAMBOOC.js} +5 -3
  78. package/dist/{chunk-B5PEKSRH.js → chunk-VSAKEMDD.js} +6 -1
  79. package/dist/chunk-WTTIODDV.js +9 -0
  80. package/dist/{chunk-JLU52ZDT.js → chunk-XJQ6Z3FO.js} +10 -10
  81. package/dist/{chunk-KTGZDMDX.js → chunk-XKCRKD2B.js} +140 -53
  82. package/dist/{chunk-LRP5FXST.js → chunk-YQMIKX54.js} +61 -24
  83. package/dist/{chunk-H5UEVW6Q.js → chunk-ZD3QCNB7.js} +1 -1
  84. package/dist/clock.js +168 -0
  85. package/dist/completion-registry.js +3 -1
  86. package/dist/countdown.js +36 -395
  87. package/dist/{dgmo-router-4UAPPIKN.js → dgmo-router-E5O7RJSW.js} +50 -43
  88. package/dist/{dimensions-SCNVYLRF.js → dimensions-DS6FWLRY.js} +3 -3
  89. package/dist/{d3-BThYBTQk.d.ts → export-context-Ceh3wr0E.d.ts} +2 -8
  90. package/dist/{flowchart-parser-NA75YQ77.js → flowchart-parser-NZXASOZG.js} +8 -3
  91. package/dist/{flowchart-renderer-6MGGX4RC.js → flowchart-renderer-PTCRIANF.js} +17 -19
  92. package/dist/index.d.ts +8 -7
  93. package/dist/index.js +80 -74
  94. package/dist/{layout-MBVBAMPA.js → layout-3TSVAGWH.js} +2 -2
  95. package/dist/layout-ISSBWBH7.js +24 -0
  96. package/dist/layout-IT4ZTV6C.js +24 -0
  97. package/dist/{layout-BNLFQHSB.js → layout-U3AH6M7J.js} +9 -10
  98. package/dist/layout-VC3MXRB4.js +29 -0
  99. package/dist/layout-VDCJOZSH.js +11 -0
  100. package/dist/{layout-search-PMYL3VWS.js → layout-search-BBX2BMEF.js} +11 -12
  101. package/dist/{palettes-IN7ZFRJM.js → palettes-4Y7CL2QL.js} +4 -2
  102. package/dist/{parser-QYISOAGR.js → parser-4RFY7D52.js} +8 -3
  103. package/dist/{parser-3MK56JZC.js → parser-4Y6PODW6.js} +2 -2
  104. package/dist/{parser-GX5YLRIP.js → parser-7QKQ4P4P.js} +8 -3
  105. package/dist/{parser-2NWH5JUS.js → parser-A3AN76RQ.js} +2 -1
  106. package/dist/{parser-LCJ76UXS.js → parser-BT4NI6JY.js} +5 -1
  107. package/dist/{parser-FXDS4JDK.js → parser-F7NDRPMA.js} +2 -2
  108. package/dist/{parser-BES6LV3G.js → parser-GDLKUBTO.js} +5 -1
  109. package/dist/{parser-SEUTXN6U.js → parser-KJPPUN4D.js} +2 -2
  110. package/dist/{parser-SIKL4PLF.js → parser-KMKVFET2.js} +5 -1
  111. package/dist/{parser-5LW5JDYG.js → parser-NL73FSFI.js} +5 -1
  112. package/dist/{parser-VA7ZQQTA.js → parser-NUU3DVW4.js} +5 -1
  113. package/dist/{parser-XZUKNZPB.js → parser-R3LPEQIT.js} +7 -1
  114. package/dist/{parser-X23GRTQJ.js → parser-RCIEKN7Y.js} +5 -1
  115. package/dist/{parser-L6RWDXQN.js → parser-TAYRTCPR.js} +8 -3
  116. package/dist/redraw-AHW7EUUF.js +1698 -0
  117. package/dist/redraw-STZ4WJAI.js +73 -0
  118. package/dist/{renderer-LM4ICK6I.js → renderer-2LYX6NHN.js} +4 -5
  119. package/dist/{renderer-NHTR7IRR.js → renderer-3NLDX7DQ.js} +4 -5
  120. package/dist/{renderer-TO2NVJP3.js → renderer-4SE7R22T.js} +50 -45
  121. package/dist/{renderer-3IHQI4A4.js → renderer-53B523PM.js} +11 -10
  122. package/dist/{renderer-3JY6JAQJ.js → renderer-7OGGV327.js} +5 -6
  123. package/dist/{renderer-2FVUPBGV.js → renderer-AM7P4LN7.js} +1 -1
  124. package/dist/{renderer-5VKPB4LL.js → renderer-BXD5KVSR.js} +5 -5
  125. package/dist/{renderer-OAR5VPH4.js → renderer-DAZWHNLI.js} +2 -2
  126. package/dist/{renderer-WIU5BJUK.js → renderer-DDWDCM2K.js} +2 -2
  127. package/dist/{renderer-3QAFDXEY.js → renderer-FMTLSOCX.js} +16 -12
  128. package/dist/{renderer-JEJT3YET.js → renderer-HX6ICPDX.js} +2 -3
  129. package/dist/{renderer-NDA2FFYB.js → renderer-ISQJ2ELA.js} +5 -5
  130. package/dist/{renderer-XGG2UNXT.js → renderer-IXBOT6DU.js} +3 -4
  131. package/dist/{renderer-S3YCLJKL.js → renderer-J3GPDK73.js} +20 -22
  132. package/dist/{renderer-DVNMCYHZ.js → renderer-J7ZSTJUE.js} +15 -15
  133. package/dist/{renderer-ALWVK3EJ.js → renderer-JJ4QW3SK.js} +6 -6
  134. package/dist/{renderer-RUSFL7WU.js → renderer-JYHA6R2D.js} +8 -7
  135. package/dist/{renderer-5TZVFQ7K.js → renderer-KJ3V5BYP.js} +7 -8
  136. package/dist/{renderer-RSK6QFWN.js → renderer-LNP23NSM.js} +7 -9
  137. package/dist/{renderer-ZHGHTSNG.js → renderer-M5DUMITP.js} +13 -12
  138. package/dist/{renderer-O6DY46AV.js → renderer-MWZC7TMD.js} +7 -7
  139. package/dist/{renderer-DC7C5Q3G.js → renderer-NOYLNVTI.js} +2 -2
  140. package/dist/{renderer-ISSDGK54.js → renderer-O6RP52CQ.js} +3 -3
  141. package/dist/{renderer-ZGY7P4BM.js → renderer-OUDHH5MV.js} +19 -22
  142. package/dist/{renderer-QGIHLZOJ.js → renderer-PHLCYVSN.js} +9 -10
  143. package/dist/{renderer-VPIELEE5.js → renderer-QTPWRRJ7.js} +8 -9
  144. package/dist/{renderer-LQP3AGEJ.js → renderer-RUSQJFFC.js} +3 -4
  145. package/dist/{renderer-MM27BSBO.js → renderer-TINHO2IO.js} +3 -4
  146. package/dist/{renderer-7ZZG5HR3.js → renderer-UTEEJDGB.js} +9 -9
  147. package/dist/{renderer-J5FKF423.js → renderer-W4MUMXJE.js} +7 -4
  148. package/dist/{renderer-XO57LTU4.js → renderer-WPN2SXGT.js} +5 -5
  149. package/dist/{renderer-ZZ6MWVB7.js → renderer-XCLARXCK.js} +4 -4
  150. package/dist/{renderer-J666LZXJ.js → renderer-XOWDERU2.js} +8 -8
  151. package/dist/{state-parser-TIR2ORJY.js → state-parser-KPVW5CRI.js} +8 -3
  152. package/dist/{state-renderer-G6SUXU4J.js → state-renderer-ZVEI265C.js} +18 -21
  153. package/dist/{tag-groups-DsoVpAY-.d.ts → tag-groups-DydewK3D.d.ts} +2 -173
  154. package/dist/{themes-DRNjxX7Q.d.ts → themes-DzIH3Hjv.d.ts} +3 -2
  155. package/docs/ai-integration.md +1 -1
  156. package/docs/language-reference.md +23 -2
  157. package/gallery/fixtures/whiteboard.dgmo +3 -0
  158. package/package.json +2 -6
  159. package/dist/chunk-3Y63RFJL.js +0 -75
  160. package/dist/chunk-5DH3KYFH.js +0 -20
  161. package/dist/chunk-O753JUEZ.js +0 -67
  162. package/dist/chunk-RJNZHFNG.js +0 -51
  163. package/dist/chunk-Z6DXWULM.js +0 -23
  164. package/dist/layout-5USEVQBY.js +0 -25
  165. package/dist/layout-J3AGFZZ7.js +0 -10
  166. package/dist/layout-S3RLVPH4.js +0 -25
  167. package/dist/layout-WRG4APSJ.js +0 -32
  168. package/dist/{chunk-DGUGE67L.js → chunk-CDYV46JE.js} +3 -3
  169. package/dist/{chunk-TKAB3FTK.js → chunk-DRQSB72S.js} +11 -11
  170. package/dist/{chunk-ZKP77MB3.js → chunk-FVTYJUXR.js} +5 -5
  171. package/dist/{chunk-MA42PIGJ.js → chunk-H5NVCOEJ.js} +4 -4
  172. package/dist/{chunk-BEA4D7OS.js → chunk-IXHWS2HI.js} +3 -3
  173. package/dist/{chunk-SOHZDW6N.js → chunk-UXNA2H2V.js} +3 -3
  174. package/dist/{chunk-NO3UX6AP.js → chunk-V2NQV7VL.js} +4 -4
@@ -8,14 +8,22 @@ import {
8
8
  isCutShort
9
9
  } from "./chunk-B5DHFFZP.js";
10
10
  import {
11
- renderInlineText
12
- } from "./chunk-S7W75MIM.js";
11
+ parseMindmap
12
+ } from "./chunk-XIUGSUE4.js";
13
+ import {
14
+ extractExportSvg,
15
+ runInExportContainer
16
+ } from "./chunk-TOHTKLKE.js";
13
17
  import {
14
18
  ScaleContext
15
19
  } from "./chunk-24YPR5EH.js";
16
20
  import {
17
- renderIntegratedLegend
18
- } from "./chunk-NMS5XSLX.js";
21
+ layoutInlineHeader
22
+ } from "./chunk-UIEKW4SG.js";
23
+ import {
24
+ TITLE_FONT_SIZE,
25
+ TITLE_FONT_WEIGHT
26
+ } from "./chunk-VLC6WNRD.js";
19
27
  import {
20
28
  CARD_RADIUS,
21
29
  COLLAPSE_BAR_HEIGHT,
@@ -24,29 +32,21 @@ import {
24
32
  NODE_STROKE_WIDTH
25
33
  } from "./chunk-XCKNFFKM.js";
26
34
  import {
27
- extractExportSvg,
28
- runInExportContainer
29
- } from "./chunk-TOHTKLKE.js";
30
- import {
31
- layoutInlineHeader
32
- } from "./chunk-42UJ23H3.js";
35
+ renderIntegratedLegend
36
+ } from "./chunk-NMS5XSLX.js";
33
37
  import {
34
38
  getLegendExtent,
35
39
  getMaxLegendReservedHeight
36
40
  } from "./chunk-JILEYZ2V.js";
37
41
  import {
38
- TITLE_FONT_SIZE,
39
- TITLE_FONT_WEIGHT
40
- } from "./chunk-VLC6WNRD.js";
42
+ preprocessDescriptionLine
43
+ } from "./chunk-IYULMRBE.js";
44
+ import {
45
+ renderInlineText
46
+ } from "./chunk-QKPOIJBT.js";
41
47
  import {
42
48
  FONT_FAMILY
43
49
  } from "./chunk-ICLB27PZ.js";
44
- import {
45
- parseMindmap
46
- } from "./chunk-XIUGSUE4.js";
47
- import {
48
- preprocessDescriptionLine
49
- } from "./chunk-IYULMRBE.js";
50
50
  import {
51
51
  tagAttrKey
52
52
  } from "./chunk-4SACN2C5.js";
@@ -1,3 +1,18 @@
1
+ import {
2
+ WHITEBOARD_COLORS,
3
+ WHITEBOARD_ELEMENT_KEYWORDS,
4
+ WHITEBOARD_NOTE_COLOR,
5
+ WHITEBOARD_NOTE_HEIGHT,
6
+ WHITEBOARD_NOTE_WIDTH,
7
+ isWhiteboardColor,
8
+ isWhiteboardShapeKind
9
+ } from "./chunk-P7TRFL4P.js";
10
+ import {
11
+ extractPaletteDirective
12
+ } from "./chunk-CYTFO2LF.js";
13
+ import {
14
+ matchTagBlockHeading
15
+ } from "./chunk-4SACN2C5.js";
1
16
  import {
2
17
  parseFirstLine,
3
18
  recognizeGlobalBoolean
@@ -20,7 +35,8 @@ var WHITEBOARD_DIAGNOSTIC_CODES = {
20
35
  BAD_INK: "W_WHITEBOARD_BAD_INK",
21
36
  BAD_IMAGE_REF: "W_WHITEBOARD_BAD_IMAGE_REF",
22
37
  EMPTY_TEXT: "W_WHITEBOARD_EMPTY_TEXT",
23
- UNEXPECTED_BODY: "W_WHITEBOARD_UNEXPECTED_BODY"
38
+ UNEXPECTED_BODY: "W_WHITEBOARD_UNEXPECTED_BODY",
39
+ BAD_TAG_ENTRY: "W_WHITEBOARD_BAD_TAG_ENTRY"
24
40
  };
25
41
  var s = (v) => typeof v === "string" || typeof v === "number" ? String(v) : "?";
26
42
  var WHITEBOARD_DIAGNOSTICS = [
@@ -122,6 +138,15 @@ var WHITEBOARD_DIAGNOSTICS = [
122
138
  message: (p) => `${s(p.element)} takes no indented lines \u2014 ${s(p.count)} ignored`,
123
139
  hint: "Only shapes, notes, arrows, lines and text have a label that can run over indented lines. Unindent the line if it is meant as its own element.",
124
140
  example: "whiteboard\nimage board.assets/a.webp at: 0 0, size: 320 200\n caption"
141
+ },
142
+ {
143
+ code: WHITEBOARD_DIAGNOSTIC_CODES.BAD_TAG_ENTRY,
144
+ severity: "warning",
145
+ chartType: "whiteboard",
146
+ title: "Tag entry without a colour",
147
+ message: (p) => `Tag entry "${s(p.entry)}" names no colour \u2014 ignored (end it with one of: red, green, blue, teal, purple, orange, yellow, cyan, gray)`,
148
+ hint: "A whiteboard tag entry gives a colour a meaning, so it ends with the colour it names: `Blocked red`.",
149
+ example: "whiteboard\ntag Meaning\n Blocked"
125
150
  }
126
151
  ];
127
152
  var BY_CODE = new Map(WHITEBOARD_DIAGNOSTICS.map((d) => [d.code, d]));
@@ -319,47 +344,6 @@ function decodeInk(encoded) {
319
344
  return { points, error: null };
320
345
  }
321
346
 
322
- // src/whiteboard/types.ts
323
- var WHITEBOARD_COLORS = [
324
- "ink",
325
- "red",
326
- "green",
327
- "blue",
328
- "teal",
329
- "purple",
330
- "orange",
331
- "yellow",
332
- "cyan",
333
- "gray"
334
- ];
335
- var WHITEBOARD_SHAPE_KINDS = [
336
- "rectangle",
337
- "ellipse",
338
- "database",
339
- "queue"
340
- ];
341
- var WHITEBOARD_ELEMENT_KEYWORDS = [
342
- ...WHITEBOARD_SHAPE_KINDS,
343
- "note",
344
- "arrow",
345
- "line",
346
- "text",
347
- "image",
348
- "ink"
349
- ];
350
- var WHITEBOARD_STROKE_STYLES = ["solid", "dashed"];
351
- var WHITEBOARD_FILLS = ["tint", "solid", "outline"];
352
- var WHITEBOARD_HEADS = ["end", "both"];
353
- var WHITEBOARD_NOTE_WIDTH = 160;
354
- var WHITEBOARD_NOTE_HEIGHT = 99;
355
- var WHITEBOARD_NOTE_COLOR = "yellow";
356
- function isWhiteboardColor(value) {
357
- return WHITEBOARD_COLORS.includes(value);
358
- }
359
- function isWhiteboardShapeKind(value) {
360
- return WHITEBOARD_SHAPE_KINDS.includes(value);
361
- }
362
-
363
347
  // src/whiteboard/parser.ts
364
348
  var WHITEBOARD_COORD_MAX = 1e6;
365
349
  var META_KEY_RE = /(^|\s)([a-z][a-z-]*):(?=\s|$)/;
@@ -451,6 +435,7 @@ function parseWhiteboard(content, _palette) {
451
435
  titleLineNumber: null,
452
436
  elements,
453
437
  options,
438
+ tagGroups: [],
454
439
  diagnostics: [],
455
440
  error: null
456
441
  };
@@ -559,7 +544,9 @@ function parseWhiteboard(content, _palette) {
559
544
  });
560
545
  }
561
546
  };
562
- const lines = content.split("\n");
547
+ const directive = extractPaletteDirective(content);
548
+ result.diagnostics.push(...directive.diagnostics);
549
+ const lines = directive.content.split("\n");
563
550
  let firstLineSeen = false;
564
551
  for (let i = 0; i < lines.length; i++) {
565
552
  const lineNumber = i + 1;
@@ -587,6 +574,46 @@ function parseWhiteboard(content, _palette) {
587
574
  const sp = trimmed.search(/\s/);
588
575
  const word = (sp === -1 ? trimmed : trimmed.slice(0, sp)).toLowerCase();
589
576
  const rest = sp === -1 ? "" : trimmed.slice(sp + 1).trim();
577
+ if (word === "tag") {
578
+ const heading = matchTagBlockHeading(trimmed);
579
+ if (heading) {
580
+ const entries = [];
581
+ const addEntry = (raw, line) => {
582
+ const text = raw.trim();
583
+ const sp2 = text.lastIndexOf(" ");
584
+ const color = sp2 === -1 ? "" : text.slice(sp2 + 1);
585
+ const value = sp2 === -1 ? "" : text.slice(0, sp2).trim();
586
+ if (!value || !isWhiteboardColor(color) || color === "ink") {
587
+ warn(line, WHITEBOARD_DIAGNOSTIC_CODES.BAD_TAG_ENTRY, { entry: text });
588
+ return;
589
+ }
590
+ entries.push({
591
+ value,
592
+ color,
593
+ authoredColor: color,
594
+ lineNumber: line
595
+ });
596
+ };
597
+ for (const v of heading.inlineValues ?? []) addEntry(v, lineNumber);
598
+ const base = indentOf(lines[i]);
599
+ for (let j = i + 1; j < lines.length; j++) {
600
+ const raw = lines[j];
601
+ if (!raw.trim()) continue;
602
+ if (indentOf(raw) <= base) break;
603
+ i = j;
604
+ if (raw.trim().startsWith("//")) continue;
605
+ addEntry(raw, j + 1);
606
+ }
607
+ const group = {
608
+ name: heading.name,
609
+ ...heading.alias !== void 0 && { alias: heading.alias },
610
+ entries,
611
+ lineNumber
612
+ };
613
+ result.tagGroups.push(group);
614
+ continue;
615
+ }
616
+ }
590
617
  const { body, end } = collectBody(lines, i);
591
618
  i = end;
592
619
  const noBody = (element) => {
@@ -765,17 +792,6 @@ export {
765
792
  INK_PRESSURE_LEVELS,
766
793
  encodeInk,
767
794
  decodeInk,
768
- WHITEBOARD_COLORS,
769
- WHITEBOARD_SHAPE_KINDS,
770
- WHITEBOARD_ELEMENT_KEYWORDS,
771
- WHITEBOARD_STROKE_STYLES,
772
- WHITEBOARD_FILLS,
773
- WHITEBOARD_HEADS,
774
- WHITEBOARD_NOTE_WIDTH,
775
- WHITEBOARD_NOTE_HEIGHT,
776
- WHITEBOARD_NOTE_COLOR,
777
- isWhiteboardColor,
778
- isWhiteboardShapeKind,
779
795
  isWhiteboardImageRef,
780
796
  parseWhiteboard
781
797
  };