@diagrammo/dgmo 0.64.1 → 0.66.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 (150) hide show
  1. package/LICENSE +1 -1
  2. package/dist/advanced.d.ts +6773 -0
  3. package/dist/advanced.js +71 -71
  4. package/dist/block.d.ts +159 -0
  5. package/dist/block.js +21 -16
  6. package/dist/chart-meta-CpicJ1kj.d.ts +239 -0
  7. package/dist/chart-meta.d.ts +3 -0
  8. package/dist/chart-meta.js +3 -3
  9. package/dist/{charts-d3-ZTXJWEHI.js → charts-d3-I6OE5K3B.js} +9 -9
  10. package/dist/{chunk-C6DMG2V6.js → chunk-27YPE7NO.js} +28 -12
  11. package/dist/{chunk-RBAW7VUG.js → chunk-2EPV7CLY.js} +5 -7
  12. package/dist/{chunk-SCJ7CAJF.js → chunk-3HOCNSPD.js} +2 -2
  13. package/dist/{chunk-VOJOARA6.js → chunk-3OT63FS4.js} +82 -77
  14. package/dist/{chunk-Z2ADWRSW.js → chunk-3PSPUYT5.js} +3 -3
  15. package/dist/{chunk-RBBJIHNL.js → chunk-4IE42ODL.js} +11 -11
  16. package/dist/{chunk-SMCUX42K.js → chunk-4TM7MWU4.js} +7 -6
  17. package/dist/{chunk-H3HFC3SQ.js → chunk-5GM6BZO7.js} +3 -3
  18. package/dist/{chunk-7T3A2UK3.js → chunk-5T7K6QND.js} +15 -16
  19. package/dist/{chunk-NKRCPBTJ.js → chunk-6BOPYGJC.js} +6 -6
  20. package/dist/{chunk-MHI6W6XS.js → chunk-6IUL6LER.js} +10 -7
  21. package/dist/{chunk-S5RWWISJ.js → chunk-7L53J53J.js} +4 -4
  22. package/dist/{chunk-WDJ4HAGO.js → chunk-A6CTYC7O.js} +2 -2
  23. package/dist/{chunk-CDMF7P5A.js → chunk-BBCKUAUR.js} +2 -2
  24. package/dist/{chunk-AA4M6F2P.js → chunk-BBY57XAA.js} +3 -3
  25. package/dist/{chunk-NKRVFQGO.js → chunk-BDI25HWH.js} +18 -6
  26. package/dist/{chunk-SVR3YFM3.js → chunk-C666LP3O.js} +20 -15
  27. package/dist/{chunk-KRTO7NRK.js → chunk-D2WHS23S.js} +2 -2
  28. package/dist/{chunk-LYTEVE2N.js → chunk-DBF4IM4U.js} +20 -15
  29. package/dist/{chunk-PCWPYOT4.js → chunk-ET4R3AU5.js} +4 -4
  30. package/dist/{chunk-2KOBOIB2.js → chunk-FBD5ASMB.js} +2 -2
  31. package/dist/{chunk-ES66QH6J.js → chunk-FG24NXKN.js} +2 -2
  32. package/dist/{chunk-3CIOJ5YJ.js → chunk-FJ57274M.js} +3 -1
  33. package/dist/{chunk-6BVIZW5N.js → chunk-FLFBY5GN.js} +14 -12
  34. package/dist/{chunk-XUN3MIO3.js → chunk-G64OVYUT.js} +2 -2
  35. package/dist/{chunk-RQL25P3U.js → chunk-G7QZF6T3.js} +9 -9
  36. package/dist/{chunk-IGIJZHB6.js → chunk-GC7CBX6C.js} +6 -6
  37. package/dist/{chunk-B6AONGTI.js → chunk-GDQN2TPX.js} +21 -14
  38. package/dist/{chunk-CZUSH6NI.js → chunk-GMLSYNFP.js} +10 -9
  39. package/dist/{chunk-R6HCNSP6.js → chunk-GOW5VO6M.js} +2 -2
  40. package/dist/{chunk-SPHC4RYF.js → chunk-GXOMKWQ5.js} +10 -9
  41. package/dist/{chunk-MQHOKBJ6.js → chunk-IJ4FUFTR.js} +5 -5
  42. package/dist/{chunk-V3UQSKWJ.js → chunk-IJSFEU4J.js} +9 -9
  43. package/dist/{chunk-LSFZDBAP.js → chunk-IKHV5IJB.js} +2 -2
  44. package/dist/{chunk-LMXAB4YM.js → chunk-IZ6RWMBM.js} +9 -9
  45. package/dist/{chunk-6VJCURWU.js → chunk-J2EXBAPZ.js} +4 -5
  46. package/dist/{chunk-IX6N5MCY.js → chunk-JCL4K7AK.js} +12 -11
  47. package/dist/{chunk-OBKM6GIJ.js → chunk-JTUDM7S4.js} +10 -10
  48. package/dist/{chunk-CVVICCSB.js → chunk-L65WI4HO.js} +4 -4
  49. package/dist/{chunk-67D4MN2H.js → chunk-LK6LTSLH.js} +2 -2
  50. package/dist/{chunk-KOHIF4LD.js → chunk-MBODBL7C.js} +6 -5
  51. package/dist/chunk-MTGGOCND.js +638 -0
  52. package/dist/{chunk-VJARCVMH.js → chunk-MU3CJPJF.js} +2 -2
  53. package/dist/{chunk-RKTIIU7Z.js → chunk-N6XI5VTA.js} +4 -4
  54. package/dist/{chunk-ODUT5WMC.js → chunk-NVOU7N6C.js} +2 -2
  55. package/dist/{chunk-DB2KQ5DN.js → chunk-O274UTXH.js} +5 -5
  56. package/dist/{chunk-T4QXHE34.js → chunk-OWUWLZJT.js} +13 -11
  57. package/dist/{chunk-LDVUPGWC.js → chunk-OWVDD5EC.js} +2 -2
  58. package/dist/{chunk-M4HYPDER.js → chunk-P5OCINCI.js} +8 -8
  59. package/dist/{chunk-YLK3JNWP.js → chunk-QNCXONBR.js} +2 -2
  60. package/dist/{chunk-I2ATN25N.js → chunk-R4XM44BW.js} +25 -16
  61. package/dist/{chunk-37EHGTQ2.js → chunk-R7S5542V.js} +4 -4
  62. package/dist/{chunk-DJCZWQ2A.js → chunk-RTTZIX34.js} +4 -4
  63. package/dist/{chunk-OMTBYLKN.js → chunk-TPKNA2U5.js} +9 -7
  64. package/dist/{chunk-DN5HEDE4.js → chunk-TT5B36WO.js} +16 -20
  65. package/dist/{chunk-SF3JAWMY.js → chunk-TWILCDUE.js} +3 -3
  66. package/dist/{chunk-NIZM3LAG.js → chunk-UINRIO77.js} +10 -10
  67. package/dist/{chunk-5H2LIQIH.js → chunk-UJXCDF4E.js} +4 -4
  68. package/dist/{chunk-Z5ID35YP.js → chunk-UTCPNJND.js} +2 -4
  69. package/dist/{chunk-U42ZEK7L.js → chunk-V4BYBIBU.js} +24 -15
  70. package/dist/{chunk-L4IN4OBB.js → chunk-VLI5SYXW.js} +7 -7
  71. package/dist/{chunk-43E26CDA.js → chunk-VS2M72PF.js} +4 -4
  72. package/dist/{chunk-KZ3PCDUJ.js → chunk-VV6HZQ5K.js} +2 -2
  73. package/dist/{chunk-Z5BTSBWW.js → chunk-WF2HDQPG.js} +4 -4
  74. package/dist/{chunk-JU2VMFYC.js → chunk-X26BF4T2.js} +2 -2
  75. package/dist/{chunk-TAJ2XFTT.js → chunk-XKMCL2YJ.js} +19 -16
  76. package/dist/{chunk-7GUYGQR4.js → chunk-XVEPB2UU.js} +4 -4
  77. package/dist/{chunk-YHTKDIF2.js → chunk-YGFNITPC.js} +11 -11
  78. package/dist/{chunk-I24O2RWT.js → chunk-YJOOIOSR.js} +84 -14
  79. package/dist/{chunk-KPX2OWZR.js → chunk-YKWHUPBP.js} +13 -14
  80. package/dist/{chunk-FRC4LDTQ.js → chunk-YMYPFX4O.js} +36 -30
  81. package/dist/cloud-reference.d.ts +96 -0
  82. package/dist/completion-registry.d.ts +129 -0
  83. package/dist/d3-Bfhj-XBX.d.ts +496 -0
  84. package/dist/{dgmo-router-QWRF7ZKM.js → dgmo-router-464FE256.js} +4 -4
  85. package/dist/dgmo-router-EAW7XiBE.d.ts +280 -0
  86. package/dist/{dimensions-ES6O2T4H.js → dimensions-RD3Y7FCF.js} +7 -7
  87. package/dist/{flowchart-renderer-EXMRHFTQ.js → flowchart-renderer-6JKM2FA4.js} +7 -7
  88. package/dist/index.d.ts +210 -0
  89. package/dist/index.js +15 -15
  90. package/dist/{layout-HBWT2G23.js → layout-4LNMXLVK.js} +3 -3
  91. package/dist/{layout-UU4VJTOP.js → layout-62ERBWCM.js} +3 -3
  92. package/dist/{layout-N6X46MWG.js → layout-6SKHNQYO.js} +4 -4
  93. package/dist/{layout-OH4VQ3OI.js → layout-7JULRP4Y.js} +4 -4
  94. package/dist/{layout-QTZO6CW5.js → layout-FA37VP7V.js} +4 -4
  95. package/dist/layout-IN53LAE6.js +9 -0
  96. package/dist/{layout-H4H4OFE4.js → layout-IO6ORC5T.js} +3 -3
  97. package/dist/{layout-54P3DAXY.js → layout-LVMWK4QY.js} +5 -5
  98. package/dist/{layout-WCOEZPOI.js → layout-MNOTDWXW.js} +4 -4
  99. package/dist/{layout-2T2VCCTM.js → layout-RD7GDM4I.js} +5 -5
  100. package/dist/{layout-SKQMIXTG.js → layout-SBQTN2YM.js} +4 -4
  101. package/dist/{layout-5E2NQZNM.js → layout-SGYR6HBX.js} +3 -3
  102. package/dist/{layout-W3ZBJOIK.js → layout-WIMQIHBU.js} +5 -5
  103. package/dist/{layout-search-AJ6VUVUI.js → layout-search-C44CJQOB.js} +5 -5
  104. package/dist/{legend-constants-QQU3QYBF.js → legend-constants-RGINV5SF.js} +3 -3
  105. package/dist/live-link-resolve.d.ts +73 -0
  106. package/dist/{parser-KSIYWKYF.js → parser-CSKF2KNO.js} +8 -4
  107. package/dist/{parser-2BGDJJ2L.js → parser-WLL63XH7.js} +2 -2
  108. package/dist/{renderer-XLEYPLVL.js → renderer-2UIQVKXK.js} +8 -8
  109. package/dist/{renderer-KOWVTTYR.js → renderer-3GG2DEFQ.js} +7 -7
  110. package/dist/{renderer-XLPNUOYA.js → renderer-6NDYVZXQ.js} +10 -10
  111. package/dist/{renderer-2ARNFXSC.js → renderer-6ST44AVP.js} +10 -10
  112. package/dist/{renderer-YLM4CGBG.js → renderer-ALP46W2X.js} +8 -8
  113. package/dist/{renderer-HLWEJQJW.js → renderer-BEVY3UP5.js} +5 -5
  114. package/dist/{renderer-H6AQ4UIR.js → renderer-BXPWSNTJ.js} +13 -13
  115. package/dist/{renderer-BYWLJDT4.js → renderer-EWTETTII.js} +8 -8
  116. package/dist/{renderer-KK2534AF.js → renderer-FHXAWDNI.js} +4 -4
  117. package/dist/{renderer-OB77AT7V.js → renderer-FI4IKF4I.js} +7 -7
  118. package/dist/{renderer-DMVUBKP7.js → renderer-GHYH6DLG.js} +4 -4
  119. package/dist/{renderer-LSBXYOID.js → renderer-GYYJ4APT.js} +10 -10
  120. package/dist/{renderer-M43ROWET.js → renderer-JFOHE3YB.js} +9 -9
  121. package/dist/{renderer-OA7FSZ4A.js → renderer-L5QGQTLV.js} +3 -3
  122. package/dist/{renderer-7OOC2ZO2.js → renderer-L7S6YVM6.js} +4 -4
  123. package/dist/{renderer-YELZR4QT.js → renderer-LCHVBTV4.js} +12 -12
  124. package/dist/{renderer-IN3UPTZS.js → renderer-M4DAYNWC.js} +3 -3
  125. package/dist/{renderer-WN47AMUM.js → renderer-NXIK3LOA.js} +8 -8
  126. package/dist/{renderer-QR5343AR.js → renderer-OWUXQDHM.js} +3 -3
  127. package/dist/{renderer-FCO42JLK.js → renderer-PJNJOCLB.js} +8 -8
  128. package/dist/{renderer-OYTERGAO.js → renderer-QQBUBD66.js} +9 -9
  129. package/dist/{renderer-PM7JPC3J.js → renderer-REFE3YFH.js} +11 -11
  130. package/dist/{renderer-C6KOE774.js → renderer-RL2JGVPC.js} +10 -10
  131. package/dist/{renderer-ZNTLBQ45.js → renderer-RVFPPKWN.js} +9 -9
  132. package/dist/{renderer-QEHUJHRK.js → renderer-SFQHFPC5.js} +10 -10
  133. package/dist/{renderer-LO4FXQHP.js → renderer-T4CMBGA5.js} +8 -8
  134. package/dist/{renderer-NHFRVCDC.js → renderer-T66477EQ.js} +9 -9
  135. package/dist/{renderer-M3PQKXK2.js → renderer-TJD6A3AK.js} +13 -13
  136. package/dist/{renderer-2E7LQC32.js → renderer-URPIVAPI.js} +3 -3
  137. package/dist/{renderer-T5CUGSXP.js → renderer-WENGQEX6.js} +7 -7
  138. package/dist/{renderer-WR3FA3FF.js → renderer-WR6J7NKH.js} +8 -8
  139. package/dist/{renderer-YBEZ5V2H.js → renderer-X3V2G4UL.js} +3 -3
  140. package/dist/{renderer-KPEQ72FY.js → renderer-YAW4VHAI.js} +11 -11
  141. package/dist/{renderer-radial-XWAKJACV.js → renderer-radial-HOUGPUPW.js} +7 -7
  142. package/dist/{state-renderer-LIESKSBO.js → state-renderer-JJSQJZEL.js} +11 -11
  143. package/dist/tag-groups-NUA2F1I5.d.ts +263 -0
  144. package/dist/themes-Dem5xalq.d.ts +139 -0
  145. package/docs/ai-integration.md +1 -1
  146. package/docs/language-reference.md +5 -0
  147. package/gallery/fixtures/er.dgmo +1 -1
  148. package/package.json +5 -3
  149. package/dist/chunk-4ASYQ347.js +0 -185
  150. package/dist/layout-5XGYNYVT.js +0 -9
@@ -1,28 +1,28 @@
1
1
  import {
2
2
  renderCollapseBar,
3
3
  renderNodeCard
4
- } from "./chunk-H3HFC3SQ.js";
4
+ } from "./chunk-5GM6BZO7.js";
5
5
  import {
6
6
  CARD_RADIUS,
7
7
  CONTAINER_RADIUS
8
- } from "./chunk-3CIOJ5YJ.js";
8
+ } from "./chunk-FJ57274M.js";
9
9
  import {
10
10
  layoutInlineHeader
11
- } from "./chunk-6VJCURWU.js";
11
+ } from "./chunk-J2EXBAPZ.js";
12
12
  import {
13
13
  renderIntegratedLegend
14
- } from "./chunk-RBAW7VUG.js";
14
+ } from "./chunk-2EPV7CLY.js";
15
15
  import {
16
16
  getLegendExtent,
17
17
  getMaxLegendReservedHeight
18
- } from "./chunk-ES66QH6J.js";
18
+ } from "./chunk-FG24NXKN.js";
19
19
  import {
20
20
  FONT_FAMILY
21
- } from "./chunk-Z5ID35YP.js";
21
+ } from "./chunk-UTCPNJND.js";
22
22
  import {
23
23
  measureText,
24
24
  wrapTextToWidth
25
- } from "./chunk-4ASYQ347.js";
25
+ } from "./chunk-MTGGOCND.js";
26
26
  import {
27
27
  resolveActiveTagGroup,
28
28
  resolveTagColor,
@@ -39,14 +39,12 @@ import {
39
39
  import * as d3 from "d3-selection";
40
40
 
41
41
  // src/sketch/markdown-card.ts
42
- var BOLD_WIDTH_FACTOR = 1.06;
43
42
  var INDENT_PX = 12;
44
43
  var BULLET_HANG_PX = 12;
45
44
  var ELLIPSIS = "\u2026";
46
45
  var BULLET = "\u2022";
47
46
  function segWidth(seg, fontSize) {
48
- const w = measureText(seg.text, fontSize);
49
- return seg.bold ? w * BOLD_WIDTH_FACTOR : w;
47
+ return measureText(seg.text, fontSize, { bold: seg.bold });
50
48
  }
51
49
  function parseInline(text) {
52
50
  const segments = [];
@@ -287,15 +285,16 @@ var CARD_LABEL_MIN = 11;
287
285
  var CARD_META_FONT = 12;
288
286
  var CARD_TITLE_MAX = 30;
289
287
  function fitWrapped(label, maxWidth, maxFont = CARD_LABEL_MAX, minFont = CARD_LABEL_MIN, maxLines = 2) {
288
+ const BOLD = { hardBreak: true, bold: true };
290
289
  for (let fs = maxFont; fs >= minFont; fs--) {
291
- const lines2 = wrapTextToWidth(label, fs, maxWidth, { hardBreak: true });
290
+ const lines2 = wrapTextToWidth(label, fs, maxWidth, BOLD);
292
291
  if (lines2.length <= maxLines) return { lines: lines2, fontSize: fs };
293
292
  }
294
- const lines = wrapTextToWidth(label, minFont, maxWidth, { hardBreak: true });
293
+ const lines = wrapTextToWidth(label, minFont, maxWidth, BOLD);
295
294
  if (lines.length <= maxLines) return { lines, fontSize: minFont };
296
295
  const kept = lines.slice(0, maxLines);
297
296
  let last = kept[maxLines - 1];
298
- while (last.length > 1 && measureText(`${last}\u2026`, minFont) > maxWidth)
297
+ while (last.length > 1 && measureText(`${last}\u2026`, minFont, { bold: true }) > maxWidth)
299
298
  last = last.slice(0, -1);
300
299
  kept[maxLines - 1] = `${last}\u2026`;
301
300
  return { lines: kept, fontSize: minFont };
@@ -1128,4 +1127,4 @@ export {
1128
1127
  sketchEdgeGeometry,
1129
1128
  renderSketchForExport
1130
1129
  };
1131
- //# sourceMappingURL=chunk-KPX2OWZR.js.map
1130
+ //# sourceMappingURL=chunk-YKWHUPBP.js.map
@@ -3,10 +3,10 @@ import {
3
3
  layoutJourneyMap,
4
4
  scoreToColor,
5
5
  scoreToCurveY
6
- } from "./chunk-KRTO7NRK.js";
6
+ } from "./chunk-D2WHS23S.js";
7
7
  import {
8
8
  wrapNoteBody
9
- } from "./chunk-VJARCVMH.js";
9
+ } from "./chunk-MU3CJPJF.js";
10
10
  import {
11
11
  NOTE_BULLET_INDENT
12
12
  } from "./chunk-5DH3KYFH.js";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-WGC42WJU.js";
16
16
  import {
17
17
  CARD_RADIUS
18
- } from "./chunk-3CIOJ5YJ.js";
18
+ } from "./chunk-FJ57274M.js";
19
19
  import {
20
20
  ScaleContext
21
21
  } from "./chunk-YYVTBZZC.js";
@@ -24,15 +24,15 @@ import {
24
24
  } from "./chunk-RU2HHHYA.js";
25
25
  import {
26
26
  renderIntegratedLegend
27
- } from "./chunk-RBAW7VUG.js";
27
+ } from "./chunk-2EPV7CLY.js";
28
28
  import {
29
29
  FONT_FAMILY
30
- } from "./chunk-Z5ID35YP.js";
30
+ } from "./chunk-UTCPNJND.js";
31
31
  import {
32
32
  measureText,
33
33
  truncateText,
34
34
  wrapTextToWidth
35
- } from "./chunk-4ASYQ347.js";
35
+ } from "./chunk-MTGGOCND.js";
36
36
  import {
37
37
  parseJourneyMap
38
38
  } from "./chunk-NSJK7F2V.js";
@@ -65,6 +65,7 @@ var COLUMN_RADIUS = 8;
65
65
  var COLUMN_HEADER_HEIGHT = 36;
66
66
  var COLUMN_PADDING = 12;
67
67
  var FONT_SIZE_TITLE = 18;
68
+ var PERSONA_PANEL_WIDTH = 280;
68
69
  var FONT_SIZE_PHASE = 13;
69
70
  var FONT_SIZE_STEP = 12;
70
71
  var FONT_SIZE_META = 10;
@@ -115,7 +116,16 @@ function renderJourneyMap(container, parsed, palette, isDark, options) {
115
116
  if (parsed.titleLineNumber) {
116
117
  titleG.attr("data-line-number", parsed.titleLineNumber);
117
118
  }
118
- titleG.append("text").attr("x", PADDING).attr("y", PADDING + FONT_SIZE_TITLE).attr("font-size", FONT_SIZE_TITLE).attr("font-weight", "bold").attr("fill", palette.text).text(parsed.title);
119
+ const personaPanelX = parsed.persona ? layout.totalWidth - PADDING - PERSONA_PANEL_WIDTH : layout.totalWidth;
120
+ const titleMaxW = Math.max(
121
+ 0,
122
+ Math.min(personaPanelX - PADDING, layout.totalWidth - PADDING) - PADDING
123
+ );
124
+ titleG.append("text").attr("x", PADDING).attr("y", PADDING + FONT_SIZE_TITLE).attr("font-size", FONT_SIZE_TITLE).attr("font-weight", "bold").attr("fill", palette.text).text(
125
+ truncateText(parsed.title, FONT_SIZE_TITLE, titleMaxW, {
126
+ bold: true
127
+ })
128
+ );
119
129
  if (onNavigateToLine && parsed.titleLineNumber) {
120
130
  titleG.style("cursor", "pointer").on("click", () => {
121
131
  onNavigateToLine(parsed.titleLineNumber);
@@ -127,7 +137,7 @@ function renderJourneyMap(container, parsed, palette, isDark, options) {
127
137
  const personaG = svg.append("g").attr("class", "journey-persona").attr("data-line-number", parsed.persona.lineNumber);
128
138
  const titleRowH = CARD_HEADER_HEIGHT;
129
139
  const silhouetteZone = 60;
130
- const panelWidth = 280;
140
+ const panelWidth = PERSONA_PANEL_WIDTH;
131
141
  const textAreaWidth = panelWidth - silhouetteZone - CARD_PADDING_X;
132
142
  const descLineH = 14;
133
143
  const descLines = parsed.persona.description ? wrapNoteBody(parsed.persona.description, textAreaWidth, FONT_SIZE_META) : [];
@@ -164,7 +174,9 @@ function renderJourneyMap(container, parsed, palette, isDark, options) {
164
174
  fillMode
165
175
  );
166
176
  personaG.append("rect").attr("x", panelX).attr("y", panelY).attr("width", panelWidth).attr("height", panelHeight).attr("rx", CARD_RADIUS).attr("fill", "none").attr("stroke", personaColor).attr("stroke-width", CARD_STROKE_WIDTH);
167
- personaG.append("text").attr("x", textX).attr("y", panelY + CARD_PADDING_Y + FONT_SIZE_STEP).attr("font-size", FONT_SIZE_STEP).attr("font-weight", "500").attr("fill", onPersonaText).text(parsed.persona.name);
177
+ personaG.append("text").attr("x", textX).attr("y", panelY + CARD_PADDING_Y + FONT_SIZE_STEP).attr("font-size", FONT_SIZE_STEP).attr("font-weight", "500").attr("fill", onPersonaText).text(
178
+ truncateText(parsed.persona.name, FONT_SIZE_STEP, textAreaWidth)
179
+ );
168
180
  for (let li = 0; li < descLines.length; li++) {
169
181
  const line2 = descLines[li];
170
182
  const indent = line2.kind === "plain" ? 0 : NOTE_BULLET_INDENT;
@@ -372,11 +384,11 @@ function renderJourneyMap(container, parsed, palette, isDark, options) {
372
384
  palette.textOnFillLight,
373
385
  palette.textOnFillDark
374
386
  );
375
- phaseG.append("text").attr("x", pl.x + COLUMN_PADDING).attr("y", pl.y + COLUMN_HEADER_HEIGHT / 2 + FONT_SIZE_PHASE / 2 - 2).attr("font-size", FONT_SIZE_PHASE).attr("font-weight", "bold").attr("fill", onHeaderText).text(
376
- isCollapsed ? truncateText2(
387
+ phaseG.append("text").attr("x", pl.x + COLUMN_PADDING).attr("y", pl.y + COLUMN_HEADER_HEIGHT / 2).attr("dominant-baseline", "central").attr("font-size", FONT_SIZE_PHASE).attr("font-weight", "bold").attr("fill", onHeaderText).text(
388
+ isCollapsed ? truncateText(
377
389
  pl.phase.name,
378
- pl.width - COLUMN_PADDING * 2,
379
- FONT_SIZE_PHASE
390
+ FONT_SIZE_PHASE,
391
+ pl.width - COLUMN_PADDING * 2
380
392
  ) : pl.phase.name
381
393
  );
382
394
  if (onPhaseToggle) {
@@ -445,7 +457,7 @@ function renderJourneyMap(container, parsed, palette, isDark, options) {
445
457
  }
446
458
  const textX = listX + CARD_PADDING_X + COLLAPSED_FACE_R * 2 + 6;
447
459
  const maxTextW = cardW - CARD_PADDING_X * 2 - COLLAPSED_FACE_R * 2 - 6;
448
- itemG.append("text").attr("x", textX).attr("y", itemY + COLLAPSED_CARD_H / 2 + FONT_SIZE_META / 2 - 1).attr("font-size", FONT_SIZE_META).attr("fill", palette.text).text(truncateText2(step.title, maxTextW, FONT_SIZE_META));
460
+ itemG.append("text").attr("x", textX).attr("y", itemY + COLLAPSED_CARD_H / 2).attr("dominant-baseline", "central").attr("font-size", FONT_SIZE_META).attr("fill", palette.text).text(truncateText(step.title, FONT_SIZE_META, maxTextW));
449
461
  if (onNavigateToLine) {
450
462
  itemG.style("cursor", "pointer").on("click", (event) => {
451
463
  event.stopPropagation();
@@ -540,7 +552,7 @@ function renderJourneyMap(container, parsed, palette, isDark, options) {
540
552
  const fcx = parseFloat(faceEl.attr("data-cx") ?? "0");
541
553
  const fcy = parseFloat(faceEl.attr("data-cy") ?? "0");
542
554
  const score = parseInt(faceEl.attr("data-score") ?? "3", 10);
543
- const lines = wrapText(thoughtText, THOUGHT_MAX_W, THOUGHT_FONT);
555
+ const lines = wrapTextToWidth(thoughtText, THOUGHT_FONT, THOUGHT_MAX_W);
544
556
  const textW = Math.min(
545
557
  THOUGHT_MAX_W,
546
558
  Math.max(...lines.map((l) => measureText(l, THOUGHT_FONT)))
@@ -690,10 +702,10 @@ function renderStepCard(parent, sl, palette, isDark, activeGroup, tagGroups, onN
690
702
  }
691
703
  let metaY = cy + titleBlockH + CARD_META_LINE_HEIGHT;
692
704
  if (sl.step.description) {
693
- const descLines = wrapText(
705
+ const descLines = wrapTextToWidth(
694
706
  sl.step.description,
695
- sl.width - CARD_PADDING_X * 2,
696
- FONT_SIZE_META
707
+ FONT_SIZE_META,
708
+ sl.width - CARD_PADDING_X * 2
697
709
  );
698
710
  for (const line2 of descLines) {
699
711
  stepG.append("text").attr("x", cx + CARD_PADDING_X).attr("y", metaY).attr("font-size", FONT_SIZE_META).attr("fill", onCardText).text(line2);
@@ -707,7 +719,7 @@ function renderStepCard(parent, sl, palette, isDark, activeGroup, tagGroups, onN
707
719
  for (const anno of cardAnnotations) {
708
720
  const annoColor = annotationColor(anno.type, palette);
709
721
  const iconPaths = annotationIconPaths(anno.type);
710
- const annoLines = wrapText(anno.text, annoTextW, FONT_SIZE_META);
722
+ const annoLines = wrapTextToWidth(anno.text, FONT_SIZE_META, annoTextW);
711
723
  const iconColor = fillMode === "solid" ? onCardText : annoColor;
712
724
  renderAnnotationIcon(
713
725
  stepG,
@@ -741,7 +753,7 @@ function renderStepCard(parent, sl, palette, isDark, activeGroup, tagGroups, onN
741
753
  palette.textOnFillLight,
742
754
  palette.textOnFillDark
743
755
  );
744
- stepG.append("text").attr("x", cx + sl.width / 2).attr("y", stripY + TAG_STRIP_HEIGHT / 2 + FONT_SIZE_META / 2 - 1).attr("text-anchor", "middle").attr("font-size", FONT_SIZE_META).attr("fill", stripTextColor).text(value);
756
+ stepG.append("text").attr("x", cx + sl.width / 2).attr("y", stripY + TAG_STRIP_HEIGHT / 2).attr("dominant-baseline", "central").attr("text-anchor", "middle").attr("font-size", FONT_SIZE_META).attr("fill", stripTextColor).text(value);
745
757
  }
746
758
  if (onNavigateToLine) {
747
759
  stepG.style("cursor", "pointer").on("click", (event) => {
@@ -791,20 +803,14 @@ var EMOTION_LABEL_MAX_WIDTH = 180;
791
803
  var EMOTION_LABEL_FONT_SIZE = FONT_SIZE_META;
792
804
  function addEmotionLabel(faceG, pt, palette) {
793
805
  if (!pt.emotionLabel) return;
794
- const text = truncateText2(
806
+ const text = truncateText(
795
807
  pt.emotionLabel,
796
- EMOTION_LABEL_MAX_WIDTH,
797
- EMOTION_LABEL_FONT_SIZE
808
+ EMOTION_LABEL_FONT_SIZE,
809
+ EMOTION_LABEL_MAX_WIDTH
798
810
  );
799
811
  const y = pt.y + FACE_RADIUS + 5 + EMOTION_LABEL_FONT_SIZE;
800
812
  faceG.append("text").attr("class", "journey-emotion-label").attr("x", pt.x).attr("y", y).attr("text-anchor", "middle").attr("font-family", FONT_FAMILY).attr("font-size", EMOTION_LABEL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.text).attr("stroke", palette.bg).attr("stroke-width", 3).attr("stroke-linejoin", "round").attr("stroke-opacity", 0.8).attr("paint-order", "stroke").attr("pointer-events", "none").text(text);
801
813
  }
802
- function wrapText(text, maxWidth, fontSize) {
803
- return wrapTextToWidth(text, fontSize, maxWidth);
804
- }
805
- function truncateText2(text, maxWidth, fontSize) {
806
- return truncateText(text, fontSize, maxWidth);
807
- }
808
814
  function annotationColor(type, palette) {
809
815
  switch (type) {
810
816
  case "pain":
@@ -871,4 +877,4 @@ export {
871
877
  renderJourneyMap,
872
878
  renderJourneyMapForExport
873
879
  };
874
- //# sourceMappingURL=chunk-FRC4LDTQ.js.map
880
+ //# sourceMappingURL=chunk-YMYPFX4O.js.map
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Live links — the shared resolver (Diagrammo Cloud story 10.6).
3
+ *
4
+ * A live link points at a diagram living in Diagrammo Cloud instead of at bytes
5
+ * pasted into a document. The point of it is CURRENCY: a linked diagram is
6
+ * never stale, which is true for a team of one and needs no distribution to be
7
+ * worth having.
8
+ *
9
+ * There are three SPELLINGS and exactly ONE parser, because each spelling is
10
+ * native to where it gets typed:
11
+ *
12
+ * | Surface | Form |
13
+ * |------------------------|-----------------------------|
14
+ * | docs frameworks | `live-link abc123` in a fence|
15
+ * | Obsidian, desktop app | `![[live-link:abc123]]` |
16
+ * | anywhere taking a URL | the plain URL |
17
+ *
18
+ * The keyword was `cloud` until 2026-08-01 (decision #53). `cloud` named where
19
+ * the thing lives; `live-link` names what it is, and it is the publish dialog's
20
+ * own phrase, so one word now spans both sides of the exchange. Pre-1.0 there
21
+ * is no dual-accept window — `cloud abc123` simply stops resolving. The module
22
+ * and its package subpath keep the old name deliberately: renaming a subpath
23
+ * export breaks the app's `pnpm dev` while the production build stays green.
24
+ *
25
+ * 🔴 EVERY future modifier must land in all three (A9), and
26
+ * `cloud-reference.test.ts` asserts parity across the forms from ONE table so a
27
+ * modifier cannot ship into a single spelling. If you are adding a modifier and
28
+ * only touching one branch below, the tests are about to tell you so.
29
+ *
30
+ * A reference ALWAYS FLOATS — it resolves to the current revision, which is the
31
+ * whole point (a referenced diagram is never stale). A date pin (`@2026-03-12`)
32
+ * was designed and then dropped on 2026-07-30: the server retains a bounded
33
+ * number of versions and prunes on every push, so a pin would fail on exactly
34
+ * the diagrams that are edited most. Anything carrying a modifier therefore
35
+ * parses to NULL rather than silently floating — a document that asked to be
36
+ * frozen must not quietly get the latest instead.
37
+ *
38
+ * This module is deliberately dependency-free and does no I/O: it is imported by
39
+ * every wrapper and by the CLI, and a parser that reached the network would make
40
+ * each of them harder to test than the thing they are testing.
41
+ */
42
+ /** Default origin of the Cloud API. Overridable for self-host / staging / tests. */
43
+ declare const CLOUD_API_BASE = "https://api.diagrammo.app";
44
+ /** Where human-facing share links live — the URLs people actually copy. */
45
+ declare const CLOUD_APP_BASE = "https://online.diagrammo.app";
46
+ /** A parsed reference. An id, and — for now — deliberately nothing else. */
47
+ interface CloudReference {
48
+ id: string;
49
+ }
50
+ /**
51
+ * Parse any of the three spellings, wherever it appears.
52
+ *
53
+ * 🔴 **A `dgmo` fence must NOT use this — use `parseCloudReferenceFence`.** The
54
+ * embed spelling is host markdown, and inside a fence the content is DGMO, so
55
+ * accepting `![[live-link:<id>]]` there is a category error: markdown nested in
56
+ * a code fence that is itself in markdown. It was accepted until 2026-08-05 and
57
+ * the showcase content taught it. Removed rather than deprecated — pre-1.0.
58
+ *
59
+ * This union survives for a host scanning raw note text, where any of the three
60
+ * may legitimately turn up. Returns null for anything that is not a reference,
61
+ * so it must not throw and must not guess.
62
+ */
63
+ declare function parseCloudReference(text: string): CloudReference | null;
64
+ /**
65
+ * What may appear as the whole body of a `dgmo` fence: the keyword form, or a
66
+ * plain link somebody pasted. **Not** the embed spelling — see above.
67
+ */
68
+ declare function parseCloudReferenceFence(text: string): CloudReference | null;
69
+ /**
70
+ * The note spelling — `![[live-link:<id>]]` — which extends the
71
+ * `![[foo.dgmo]]` transclusion Obsidian and the desktop app already understand.
72
+ * Takes the text as TYPED, brackets included, because that is the thing being
73
+ * recognised; a host holding only the inside of the brackets puts them back.
74
+ */
75
+ declare function parseCloudReferenceEmbed(text: string): CloudReference | null;
76
+ /** The URL spelling, split out because hosts that only take URLs need just this. */
77
+ declare function parseCloudReferenceUrl(text: string): CloudReference | null;
78
+ interface ResolveUrlOptions {
79
+ /** Origin of the Cloud API. */
80
+ base?: string;
81
+ }
82
+ /** The URL to fetch a reference's source from. Always the current revision. */
83
+ declare function referenceSourceUrl(ref: CloudReference, options?: ResolveUrlOptions): string;
84
+ /** The human share link for a reference — what a "view this in Diagrammo" link points at. */
85
+ declare function referenceShareUrl(ref: CloudReference, options?: {
86
+ base?: string;
87
+ }): string;
88
+ /** The shape of a source response, so consumers don't re-declare it per wrapper. */
89
+ interface CloudReferenceSource {
90
+ id: string;
91
+ source: string;
92
+ dgmoVersion: string;
93
+ updatedAt: number;
94
+ }
95
+
96
+ export { CLOUD_API_BASE, CLOUD_APP_BASE, type CloudReference, type CloudReferenceSource, type ResolveUrlOptions, parseCloudReference, parseCloudReferenceEmbed, parseCloudReferenceFence, parseCloudReferenceUrl, referenceShareUrl, referenceSourceUrl };
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Static completion registries — the LIGHT completion surface
3
+ * (`@diagrammo/dgmo/completion`).
4
+ *
5
+ * Pure data: chart-type directive registries, structural keywords, entity-type
6
+ * vocabularies, the reference-grammar descriptor, closed value enums, pipe /
7
+ * same-line metadata keys, and the derived metadata key set.
8
+ *
9
+ * Split out of `./completion` (which additionally owns the symbol *extractors*)
10
+ * so editor front-ends can import the registries without dragging the chart
11
+ * parsers — notably `body/parser`, whose figure-asset catalog is ~290 KB — onto
12
+ * their startup path. Same rationale and rule as `./chart-meta`: only symbols
13
+ * whose transitive imports are parser-constant-only live here.
14
+ *
15
+ * Closed enum sets (`ALL_MARKERS`, wireframe `STATE_KEYWORDS` /
16
+ * `GROUP_ONLY_METADATA`) are imported from their owning parsers — never
17
+ * hand-copied — so completion can't drift from the grammar (one-oracle rule).
18
+ */
19
+ /** Specification for a single directive: description + optional enumerated values. */
20
+ interface DirectiveValueSpec {
21
+ description: string;
22
+ values?: string[];
23
+ }
24
+ /** Specification for a chart type's directives. */
25
+ interface DirectiveSpec {
26
+ directives: Record<string, DirectiveValueSpec>;
27
+ }
28
+ /** Chart-type → directive specifications. Every chart type has at least palette + theme. */
29
+ declare const COMPLETION_REGISTRY: Map<string, DirectiveSpec>;
30
+ declare const CHART_TYPES: ReadonlyArray<{
31
+ name: string;
32
+ description: string;
33
+ }>;
34
+ /**
35
+ * Entity types for `Name is a <type>` declarations, keyed by chart type.
36
+ * Values are sourced from parser constants (VALID_PARTICIPANT_TYPES,
37
+ * C4_IS_A_RE).
38
+ */
39
+ declare const ENTITY_TYPES: Map<string, string[]>;
40
+ /**
41
+ * Chart-type-specific structural keywords offered on an empty/start-of-line in
42
+ * the data zone (block openers like `loop`, section headers like `containers`,
43
+ * the `tag` block declaration, etc.). This is the single source of truth for
44
+ * the editor's structural-keyword popup — every entry MUST be a token the
45
+ * corresponding parser actually recognizes (validated by the
46
+ * completion-conformance suite). Do NOT add removed/diagnostic-only tokens
47
+ * (e.g. cycle's `no-descriptions`) or tokens the parser ignores.
48
+ *
49
+ * Chart types not listed here have no structural keywords (most data charts).
50
+ */
51
+ declare const STRUCTURAL_KEYWORDS: Map<string, string[]>;
52
+ /**
53
+ * Chart types that support `tag` block declarations (and thus the
54
+ * `alias`/`default` sub-keywords inside a tag block). Derived from
55
+ * STRUCTURAL_KEYWORDS so the two can never drift — a chart supports tag blocks
56
+ * iff it offers the `tag` keyword.
57
+ */
58
+ declare const TAG_SUPPORTING_TYPES: ReadonlySet<string>;
59
+ /** Whether a chart type has a reference position (arrow/operator → a prior
60
+ * declaration) and which operators open it. The single oracle that drives
61
+ * the library extractor audit, the app's entity-trigger map, and the
62
+ * conformance drift-guard — so the three can never disagree. v1 models
63
+ * reference-after-operator only (NOT metadata-target references). */
64
+ interface ReferenceGrammar {
65
+ hasReferenceGrammar: boolean;
66
+ /** Literal operator tokens that introduce a reference (e.g. `->`, `<->`,
67
+ * `~>`, `+`). The app derives its trigger regex from these (allowing the
68
+ * labeled `-label->` / `~label~>` variants where applicable). */
69
+ referenceOperators: string[];
70
+ }
71
+ /**
72
+ * Per-type reference grammar. Grounded in each parser's arrow/operator
73
+ * grammar — NOT hand-typed blind. Types with no reference position (org,
74
+ * kanban, mindmap, all data charts, the radial/visualization types) declare
75
+ * `hasReferenceGrammar: false`. `map` references (`route A ~> B`) are owned by
76
+ * the app's bespoke geo-completion path, so it stays `false` here to avoid
77
+ * double-handling.
78
+ */
79
+ declare const REFERENCE_GRAMMAR: Map<string, ReferenceGrammar>;
80
+ /**
81
+ * RACI marker alphabet (slot-7 enum in the role-assignment value position).
82
+ * Consumed by editor completion. The chart type is always `raci`; the variant
83
+ * (RACI / RASCI / DACI) is inferred from the markers used, so completion offers
84
+ * the full union (R / A / S / C / I / D) sourced from `raci/variants.ts`'s
85
+ * `ALL_MARKERS` — the marker set can never drift from the parser.
86
+ */
87
+ declare const RACI_MARKER_ALPHABETS: ReadonlyMap<string, readonly string[]>;
88
+ /**
89
+ * Closed set of wireframe element state flags (slot-7 trailing enum, e.g.
90
+ * `(Submit) primary destructive`). Sourced from the wireframe parser's
91
+ * `STATE_KEYWORDS` — exported there and consumed here, never re-typed.
92
+ */
93
+ declare const WIREFRAME_FLAGS: readonly string[];
94
+ /**
95
+ * The subset of `WIREFRAME_FLAGS` that only make sense on group elements
96
+ * (`[...]`). Editor completion drops these for non-group elements (buttons
97
+ * `(...)`, dropdowns `{...}`). Sourced from the wireframe parser's
98
+ * `GROUP_ONLY_METADATA` — exported there and consumed here, never re-typed.
99
+ */
100
+ declare const WIREFRAME_GROUP_ONLY_FLAGS: readonly string[];
101
+ /** Specification for a single pipe metadata key. */
102
+ interface PipeKeySpec {
103
+ description: string;
104
+ values?: string[];
105
+ }
106
+ /**
107
+ * Pipe metadata keys for inline `| key value` on data lines.
108
+ * Keyed by chart type → { context-name: keys }.
109
+ *
110
+ * Contexts are open-ended. The two universal ones are:
111
+ * - `node` — the default for any non-arrow line
112
+ * - `edge` — lines containing an arrow (`->`, `--`)
113
+ *
114
+ * Charts with richer line types declare additional contexts:
115
+ * - raci: `role`, `phase`, `assignment`
116
+ * - ring / pyramid: `layer`
117
+ * - tech-radar: `quadrant`, `blip`
118
+ * - journey-map: `step`
119
+ *
120
+ * IMPORTANT: NEVER add 'sequence' here. The `|` character in sequence
121
+ * diagrams separates display names from identifiers and tag metadata.
122
+ * Adding sequence would trigger false pipe-metadata completions on every `|`.
123
+ */
124
+ type PipeContextMap = Record<string, Record<string, PipeKeySpec>>;
125
+ declare const PIPE_METADATA: Map<string, PipeContextMap>;
126
+ /** All known directive keys, derived from COMPLETION_REGISTRY. Includes implicit keys. */
127
+ declare const METADATA_KEY_SET: ReadonlySet<string>;
128
+
129
+ export { CHART_TYPES, COMPLETION_REGISTRY, type DirectiveSpec, type DirectiveValueSpec, ENTITY_TYPES, METADATA_KEY_SET, PIPE_METADATA, type PipeContextMap, type PipeKeySpec, RACI_MARKER_ALPHABETS, REFERENCE_GRAMMAR, type ReferenceGrammar, STRUCTURAL_KEYWORDS, TAG_SUPPORTING_TYPES, WIREFRAME_FLAGS, WIREFRAME_GROUP_ONLY_FLAGS };