@diagrammo/dgmo 0.97.0 → 0.98.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 (86) hide show
  1. package/dist/advanced.d.ts +7 -1
  2. package/dist/advanced.js +49 -45
  3. package/dist/block.js +15 -15
  4. package/dist/chart-meta.js +8 -8
  5. package/dist/{chunk-XEMCNQQW.js → chunk-3EDV56HL.js} +5 -5
  6. package/dist/{chunk-3HL6NSSQ.js → chunk-3F74NDUY.js} +1 -1
  7. package/dist/{chunk-LRTSTDJ6.js → chunk-42AZPI2W.js} +31 -7
  8. package/dist/{chunk-W46OMHOK.js → chunk-4PZP6URA.js} +21 -27
  9. package/dist/{chunk-6YBZFOTA.js → chunk-6Q46GMKH.js} +11 -48
  10. package/dist/{chunk-D7KZE2XJ.js → chunk-6YRTBI2F.js} +18 -62
  11. package/dist/{chunk-IAM3IDL4.js → chunk-A3N4UHHL.js} +1 -1
  12. package/dist/{chunk-QLNLRZ37.js → chunk-AHUBG6GR.js} +16 -9
  13. package/dist/{chunk-Q6V342WS.js → chunk-BTFB7W5Z.js} +1 -1
  14. package/dist/{chunk-CUOMNKYW.js → chunk-BWVJTYTJ.js} +2 -2
  15. package/dist/{chunk-DRY4W4W6.js → chunk-CES7REQM.js} +10 -47
  16. package/dist/{chunk-WXGFB2O2.js → chunk-D6XR22KO.js} +1 -1
  17. package/dist/{chunk-SNDCXT5R.js → chunk-D7FHY6DO.js} +1 -1
  18. package/dist/{chunk-CLW45YKE.js → chunk-DA2GIHAY.js} +36 -4
  19. package/dist/{chunk-A5LFM62B.js → chunk-DYI73PFY.js} +2 -2
  20. package/dist/{chunk-YFWIFKRQ.js → chunk-ENXENGW5.js} +1 -1
  21. package/dist/{chunk-26EVL454.js → chunk-F4DGHT3F.js} +20 -0
  22. package/dist/{chunk-YCIBBVI2.js → chunk-FDVUD3PR.js} +2 -2
  23. package/dist/{chunk-VKT3BVRO.js → chunk-FTRW6YGU.js} +2 -2
  24. package/dist/{chunk-74XR7Z3I.js → chunk-G36XKXWT.js} +5 -3
  25. package/dist/{chunk-PSNRB75I.js → chunk-GMJBBFKC.js} +1 -1
  26. package/dist/{chunk-VOO65FKC.js → chunk-GNQYARON.js} +11 -48
  27. package/dist/{chunk-MJ725XHD.js → chunk-GNWCMWTO.js} +43 -43
  28. package/dist/{chunk-J7JF4QKA.js → chunk-H7XXQSYA.js} +24 -24
  29. package/dist/{chunk-F2OAZHOX.js → chunk-IMBFWXHF.js} +2 -2
  30. package/dist/{chunk-ZCKVTZHD.js → chunk-KKJG3LBY.js} +1 -1
  31. package/dist/{chunk-7ASVGFW3.js → chunk-NHN6GBG7.js} +1 -1
  32. package/dist/{chunk-V3ICBS2O.js → chunk-NXOIH5JK.js} +3 -8
  33. package/dist/{chunk-NOZMRPXI.js → chunk-O5APWRZN.js} +105 -86
  34. package/dist/{chunk-ZRW4B4KF.js → chunk-PRYAVMU6.js} +2 -2
  35. package/dist/{chunk-2FMOLWX4.js → chunk-Q6OKTHYL.js} +7 -7
  36. package/dist/{chunk-2SZILMQT.js → chunk-QGSQ2LMB.js} +1 -1
  37. package/dist/{chunk-JULBDTNU.js → chunk-S5VZLZUQ.js} +2 -2
  38. package/dist/{chunk-NN5RUHXV.js → chunk-TGQQD2KC.js} +1 -1
  39. package/dist/{chunk-4TK26YHH.js → chunk-UWWQECLC.js} +1 -1
  40. package/dist/{chunk-6SDEXSJY.js → chunk-VHVQT4EW.js} +1 -1
  41. package/dist/chunk-VTGGPBLW.js +14 -0
  42. package/dist/{chunk-44RLIAYC.js → chunk-VUBCCY65.js} +18 -62
  43. package/dist/{chunk-PT5VFY3B.js → chunk-VYEIMHL5.js} +1 -1
  44. package/dist/{chunk-7TEAFIEJ.js → chunk-XPOEE2RW.js} +1 -1
  45. package/dist/{chunk-GLLYHYGT.js → chunk-Y24QPREP.js} +1 -1
  46. package/dist/{chunk-EEIGHOJR.js → chunk-YCIOLYWL.js} +1 -1
  47. package/dist/{chunk-H7DZYHQF.js → chunk-Z6V73LD6.js} +1 -1
  48. package/dist/{chunk-6S2H6EKN.js → chunk-ZXPSNBZC.js} +3 -3
  49. package/dist/{dgmo-router-RSYWR5IS.js → dgmo-router-RXV7BNPN.js} +10 -10
  50. package/dist/{flowchart-parser-UI5VZNGJ.js → flowchart-parser-JAZRKKKJ.js} +3 -3
  51. package/dist/{flowchart-renderer-IYWPKPCF.js → flowchart-renderer-JED3RESY.js} +9 -9
  52. package/dist/index.d.ts +1 -1
  53. package/dist/index.js +15 -15
  54. package/dist/{layout-R6ULGQJK.js → layout-6QXAC2WA.js} +2 -1
  55. package/dist/{layout-7C2QZCEZ.js → layout-DJOZCSAP.js} +6 -6
  56. package/dist/{layout-G3RVKEC4.js → layout-LCHMEGTV.js} +6 -6
  57. package/dist/{layout-6VY3DHYD.js → layout-VHBM32OD.js} +3 -3
  58. package/dist/{layout-WBH5IHYK.js → layout-ZDMJL4KO.js} +6 -6
  59. package/dist/{layout-search-DSIDKKQO.js → layout-search-UZYZE4PR.js} +4 -4
  60. package/dist/{parser-E4B7HJT2.js → parser-3KMY23A2.js} +1 -1
  61. package/dist/{parser-IU6425JW.js → parser-ASXY2CPV.js} +3 -3
  62. package/dist/{parser-RSWZGQA7.js → parser-GBB5MYAN.js} +3 -3
  63. package/dist/{parser-IZYIXDJX.js → parser-ZSBMGGTD.js} +3 -3
  64. package/dist/{renderer-HIB6LZWZ.js → renderer-37LMEGLD.js} +2 -2
  65. package/dist/{renderer-XMJ6XZGL.js → renderer-3EIZRVO3.js} +3 -3
  66. package/dist/{renderer-HLDRRFZB.js → renderer-4LK2RFHD.js} +2 -2
  67. package/dist/{renderer-2V5NVI3V.js → renderer-4WD4ZIEH.js} +4 -3
  68. package/dist/{renderer-TCTZZ5Y6.js → renderer-67PNYODC.js} +2 -2
  69. package/dist/{renderer-CNDB4JTZ.js → renderer-6VBL2DWH.js} +3 -3
  70. package/dist/{renderer-6IAXRZLK.js → renderer-CUEMI3PI.js} +11 -11
  71. package/dist/{renderer-WIBVOPRC.js → renderer-D6BEC6LI.js} +2 -2
  72. package/dist/{renderer-BXVTYE27.js → renderer-DT2PP7NJ.js} +2 -2
  73. package/dist/{renderer-ITJ67HXO.js → renderer-GHYW6Y3A.js} +2 -2
  74. package/dist/{renderer-E5E3OJ42.js → renderer-HRUKL4T6.js} +2 -2
  75. package/dist/{renderer-4PKYVOYL.js → renderer-KVC7Z4T2.js} +8 -8
  76. package/dist/{renderer-UIHCYXBY.js → renderer-QVUPRQ4L.js} +3 -2
  77. package/dist/{renderer-JLOKFKOZ.js → renderer-RBAMFLZQ.js} +2 -2
  78. package/dist/{renderer-66SCERH7.js → renderer-SGRZKIMS.js} +3 -3
  79. package/dist/{renderer-ASPBBACI.js → renderer-TJPBVNVG.js} +3 -2
  80. package/dist/{renderer-COV2DXTM.js → renderer-WK2BPXND.js} +8 -8
  81. package/dist/{renderer-DXCATVLO.js → renderer-ZG7WOBBN.js} +3 -3
  82. package/dist/{renderer-M2467III.js → renderer-ZRPL5COW.js} +2 -2
  83. package/dist/{state-parser-2PQRH5JE.js → state-parser-LSFAJFMV.js} +3 -3
  84. package/dist/{state-renderer-YP6HWLJR.js → state-renderer-QTDBFB4F.js} +10 -10
  85. package/docs/language-reference.md +1 -1
  86. package/package.json +1 -1
@@ -10,8 +10,9 @@ import {
10
10
  } from "./chunk-24YPR5EH.js";
11
11
  import {
12
12
  renderCollapseBar,
13
+ renderContainerCard,
13
14
  renderNodeCard
14
- } from "./chunk-LRTSTDJ6.js";
15
+ } from "./chunk-42AZPI2W.js";
15
16
  import {
16
17
  TITLE_FONT_SIZE,
17
18
  TITLE_FONT_WEIGHT
@@ -39,7 +40,7 @@ import {
39
40
  } from "./chunk-VVL2KKG4.js";
40
41
  import {
41
42
  parseOrg
42
- } from "./chunk-YCIBBVI2.js";
43
+ } from "./chunk-FDVUD3PR.js";
43
44
  import {
44
45
  FONT_FAMILY
45
46
  } from "./chunk-ICLB27PZ.js";
@@ -57,9 +58,6 @@ import {
57
58
  LEGEND_EYE_SIZE,
58
59
  LEGEND_HEIGHT
59
60
  } from "./chunk-OZXKW5NA.js";
60
- import {
61
- measureText
62
- } from "./chunk-PU5X3P3T.js";
63
61
  import {
64
62
  contrastText,
65
63
  groupFill,
@@ -210,28 +208,24 @@ function renderOrg(container, parsed, layout, palette, isDark, onClickItem, expo
210
208
  }
211
209
  const fill = containerFill(palette, isDark, colorOff ? void 0 : c.color);
212
210
  const stroke = containerStroke(palette, colorOff ? void 0 : c.color);
213
- cG.append("rect").attr("x", 0).attr("y", 0).attr("width", c.width).attr("height", c.height).attr("rx", sContainerRadius).attr("fill", fill).attr("stroke", stroke).attr("stroke-opacity", 0.35).attr("stroke-width", sNodeStrokeWidth);
214
- cG.append("text").attr("x", c.width / 2).attr("y", sContainerHeaderHeight / 2).attr("dominant-baseline", "central").attr("text-anchor", "middle").attr("fill", palette.text).attr("font-size", sContainerLabelFontSize).attr("font-weight", "bold").text(c.label);
215
- const metaEntries = Object.entries(c.metadata);
216
- if (metaEntries.length > 0) {
217
- const metaDisplayKeys = metaEntries.map(
218
- ([k]) => displayNames.get(k) ?? k
219
- );
220
- const maxKeyWidth = Math.max(
221
- ...metaDisplayKeys.map(
222
- (k) => measureText(`${k}: `, sContainerMetaFontSize)
223
- )
224
- );
225
- const valueX = 10 + maxKeyWidth;
226
- const metaStartY = sContainerHeaderHeight + sContainerMetaFontSize - 2;
227
- for (let i = 0; i < metaEntries.length; i++) {
228
- const [, value] = metaEntries[i];
229
- const displayKey = metaDisplayKeys[i];
230
- const rowY = metaStartY + i * sContainerMetaLineHeight;
231
- cG.append("text").attr("x", 10).attr("y", rowY).attr("fill", palette.textMuted).attr("font-size", sContainerMetaFontSize).text(`${displayKey}: `);
232
- cG.append("text").attr("x", valueX).attr("y", rowY).attr("fill", palette.text).attr("font-size", sContainerMetaFontSize).text(value);
233
- }
234
- }
211
+ renderContainerCard(cG, {
212
+ width: c.width,
213
+ height: c.height,
214
+ rx: sContainerRadius,
215
+ fill,
216
+ stroke,
217
+ strokeWidth: sNodeStrokeWidth,
218
+ label: c.label,
219
+ labelColor: palette.text,
220
+ labelFontSize: sContainerLabelFontSize,
221
+ headerHeight: sContainerHeaderHeight,
222
+ rows: Object.entries(c.metadata).map(
223
+ ([k, value]) => [displayNames.get(k) ?? k, value, palette.text]
224
+ ),
225
+ keyColor: palette.textMuted,
226
+ metaFontSize: sContainerMetaFontSize,
227
+ metaLineHeight: sContainerMetaLineHeight
228
+ });
235
229
  if (c.hasChildren) {
236
230
  renderCollapseBar(cG, {
237
231
  expanded: !c.hiddenCount,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  layoutERDiagram
3
- } from "./chunk-F2OAZHOX.js";
3
+ } from "./chunk-IMBFWXHF.js";
4
4
  import {
5
5
  serializeSvg
6
6
  } from "./chunk-YLKPRT6U.js";
@@ -28,14 +28,10 @@ import {
28
28
  } from "./chunk-VVL2KKG4.js";
29
29
  import {
30
30
  parseERDiagram
31
- } from "./chunk-PSNRB75I.js";
31
+ } from "./chunk-GMJBBFKC.js";
32
32
  import {
33
- NOTE_BADGE_RADIUS,
34
- noteConnectorPoints,
35
- renderNoteBadge,
36
- renderNoteBox,
37
- renderNoteConnector
38
- } from "./chunk-CLW45YKE.js";
33
+ renderNodeNote
34
+ } from "./chunk-DA2GIHAY.js";
39
35
  import {
40
36
  FONT_FAMILY
41
37
  } from "./chunk-ICLB27PZ.js";
@@ -478,46 +474,13 @@ function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem
478
474
  }
479
475
  }
480
476
  if (node.note) {
481
- if (node.note.collapsed) {
482
- renderNoteBadge(
483
- nodeG,
484
- {
485
- x: w / 2 - NOTE_BADGE_RADIUS - 3,
486
- y: -h / 2 + NOTE_BADGE_RADIUS + 3
487
- },
488
- palette,
489
- {
490
- isDark,
491
- ...node.note.color && { color: node.note.color },
492
- lineNumber: node.note.lineNumber,
493
- endLineNumber: node.note.endLineNumber
494
- }
495
- );
496
- } else {
497
- const [cx1, cy1, cx2, cy2] = noteConnectorPoints(
498
- { width: w, height: h },
499
- node.note
500
- );
501
- renderNoteConnector(nodeG, cx1, cy1, cx2, cy2, palette);
502
- renderNoteBox(
503
- nodeG,
504
- {
505
- x: node.note.x,
506
- y: node.note.y,
507
- width: node.note.width,
508
- height: node.note.height
509
- },
510
- node.note.lines,
511
- palette,
512
- {
513
- isDark,
514
- ...node.note.color && { color: node.note.color },
515
- lineNumber: node.note.lineNumber,
516
- endLineNumber: node.note.endLineNumber,
517
- interactive: true
518
- }
519
- );
520
- }
477
+ renderNodeNote(
478
+ nodeG,
479
+ { width: w, height: h },
480
+ node.note,
481
+ palette,
482
+ isDark
483
+ );
521
484
  }
522
485
  }
523
486
  if (hasTagLegend) {
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  edgeSplinePath,
3
+ renderGraphTitle,
3
4
  selfLoopArcPath
4
- } from "./chunk-26EVL454.js";
5
+ } from "./chunk-F4DGHT3F.js";
5
6
  import {
6
7
  layoutGraph
7
- } from "./chunk-6S2H6EKN.js";
8
+ } from "./chunk-ZXPSNBZC.js";
8
9
  import {
9
10
  appendArrowheadMarkers
10
11
  } from "./chunk-XBJJP2HN.js";
@@ -19,13 +20,12 @@ import {
19
20
  } from "./chunk-24YPR5EH.js";
20
21
  import {
21
22
  renderCollapseBar
22
- } from "./chunk-LRTSTDJ6.js";
23
+ } from "./chunk-42AZPI2W.js";
23
24
  import {
24
25
  layoutInlineHeader
25
26
  } from "./chunk-REKLKGR6.js";
26
27
  import {
27
28
  TITLE_FONT_SIZE,
28
- TITLE_FONT_WEIGHT,
29
29
  TITLE_Y
30
30
  } from "./chunk-GULGSH2Z.js";
31
31
  import {
@@ -44,14 +44,10 @@ import {
44
44
  } from "./chunk-VVL2KKG4.js";
45
45
  import {
46
46
  parseState
47
- } from "./chunk-WXGFB2O2.js";
47
+ } from "./chunk-D6XR22KO.js";
48
48
  import {
49
- NOTE_BADGE_RADIUS,
50
- noteConnectorPoints,
51
- renderNoteBadge,
52
- renderNoteBox,
53
- renderNoteConnector
54
- } from "./chunk-CLW45YKE.js";
49
+ renderNodeNote
50
+ } from "./chunk-DA2GIHAY.js";
55
51
  import {
56
52
  FONT_FAMILY
57
53
  } from "./chunk-ICLB27PZ.js";
@@ -187,20 +183,16 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
187
183
  colors: edgeColors
188
184
  });
189
185
  if (showTitle) {
190
- const titleEl = svg.append("text").attr("class", "chart-title").attr("x", header.titleX).attr("y", sTitleY).attr("text-anchor", header.titleAnchor).attr("fill", palette.text).attr("font-size", sTitleFontSize).attr("font-weight", TITLE_FONT_WEIGHT).style(
191
- "cursor",
192
- onClickItem && graph.titleLineNumber ? "pointer" : "default"
193
- ).text(graph.title);
194
- if (graph.titleLineNumber) {
195
- titleEl.attr("data-line-number", graph.titleLineNumber);
196
- if (onClickItem) {
197
- titleEl.on("click", () => onClickItem(graph.titleLineNumber)).on("mouseenter", function() {
198
- d3Selection.select(this).attr("opacity", 0.7);
199
- }).on("mouseleave", function() {
200
- d3Selection.select(this).attr("opacity", 1);
201
- });
202
- }
203
- }
186
+ renderGraphTitle(svg, {
187
+ title: graph.title ?? "",
188
+ titleLineNumber: graph.titleLineNumber,
189
+ x: header.titleX,
190
+ y: sTitleY,
191
+ anchor: header.titleAnchor,
192
+ fontSize: sTitleFontSize,
193
+ color: palette.text,
194
+ onClickItem
195
+ });
204
196
  }
205
197
  if (hasLegend) {
206
198
  const legendG = svg.append("g").attr(
@@ -411,43 +403,7 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
411
403
  ).attr("font-size", sNodeFontSize).text(node.label);
412
404
  }
413
405
  if (hasNote && node.note) {
414
- if (node.note.collapsed) {
415
- renderNoteBadge(
416
- nodeG,
417
- {
418
- x: node.width / 2 - NOTE_BADGE_RADIUS - 3,
419
- y: -node.height / 2 + NOTE_BADGE_RADIUS + 3
420
- },
421
- palette,
422
- {
423
- isDark,
424
- ...node.note.color && { color: node.note.color },
425
- lineNumber: node.note.lineNumber,
426
- endLineNumber: node.note.endLineNumber
427
- }
428
- );
429
- } else {
430
- const [cx1, cy1, cx2, cy2] = noteConnectorPoints(node, node.note);
431
- renderNoteConnector(nodeG, cx1, cy1, cx2, cy2, palette);
432
- renderNoteBox(
433
- nodeG,
434
- {
435
- x: node.note.x,
436
- y: node.note.y,
437
- width: node.note.width,
438
- height: node.note.height
439
- },
440
- node.note.lines,
441
- palette,
442
- {
443
- isDark,
444
- ...node.note.color && { color: node.note.color },
445
- lineNumber: node.note.lineNumber,
446
- endLineNumber: node.note.endLineNumber,
447
- interactive: true
448
- }
449
- );
450
- }
406
+ renderNodeNote(nodeG, node, node.note, palette, isDark);
451
407
  }
452
408
  }
453
409
  }
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  resolveNotes,
9
9
  tryCollectNote
10
- } from "./chunk-4TK26YHH.js";
10
+ } from "./chunk-UWWQECLC.js";
11
11
  import {
12
12
  displayName,
13
13
  normalizeName
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-KTGJQJB3.js";
4
4
  import {
5
5
  parseDgmoChartType
6
- } from "./chunk-XEMCNQQW.js";
6
+ } from "./chunk-3EDV56HL.js";
7
7
  import {
8
8
  parseSitemap
9
9
  } from "./chunk-KMB754DO.js";
10
10
  import {
11
11
  parseOrg
12
- } from "./chunk-YCIBBVI2.js";
12
+ } from "./chunk-FDVUD3PR.js";
13
13
 
14
14
  // src/utils/collapse-marker.ts
15
15
  var MARKER_VALUE = /collapsed:\s*\S+/;
@@ -81,7 +81,8 @@ function applyIndentedGroupCollapsedMarkerAtLine(text, headerLineNumber, collaps
81
81
  return lines.join("\n");
82
82
  }
83
83
  for (let i = hIdx + 1; i < blockEnd; i++) {
84
- if (COLLAPSED_LINE.test(lines[i])) {
84
+ const l = lines[i];
85
+ if (INDENT(l) === childIndent && COLLAPSED_LINE.test(l)) {
85
86
  lines.splice(i, 1);
86
87
  return lines.join("\n");
87
88
  }
@@ -136,11 +137,12 @@ function foldSection(source, line, text, collapse) {
136
137
  const label = text.trim().replace(SECTION_MARKER, "");
137
138
  return applyCollapsedMarkerAtLine(source, line, label, collapse);
138
139
  }
139
- function foldGroupHeader(source, chartType, line, collapse) {
140
- if (chartType === "infra" && !collapse) {
141
- const next = applyIndentedGroupCollapsedMarkerAtLine(source, line, false);
142
- if (next !== source) return next;
143
- }
140
+ var INDENTED_MARKER_TYPES = /* @__PURE__ */ new Set([
141
+ "infra",
142
+ "org",
143
+ "sitemap"
144
+ ]);
145
+ function foldGroupHeader(source, line, collapse) {
144
146
  return applyGroupHeaderCollapsedMarkerAtLine(source, line, collapse);
145
147
  }
146
148
  function foldAtLine(source, line, collapse) {
@@ -153,7 +155,7 @@ function foldAtLine(source, line, collapse) {
153
155
  let next = null;
154
156
  if (GROUP_HEAD.test(trimmed)) {
155
157
  if (GROUP_HEADER_TYPES.has(chartType)) {
156
- next = foldGroupHeader(source, chartType, line, collapse);
158
+ next = foldGroupHeader(source, line, collapse);
157
159
  }
158
160
  } else if (chartType === "sequence") {
159
161
  if (SECTION_LINE.test(trimmed)) {
@@ -168,6 +170,11 @@ function foldAtLine(source, line, collapse) {
168
170
  next = applyCollapsedMarkerAtLine(source, line, label, collapse);
169
171
  }
170
172
  }
173
+ if (!collapse && INDENTED_MARKER_TYPES.has(chartType)) {
174
+ const base = next ?? source;
175
+ const lifted = applyIndentedGroupCollapsedMarkerAtLine(base, line, false);
176
+ if (lifted !== base) next = lifted;
177
+ }
171
178
  return next === null || next === source ? null : next;
172
179
  }
173
180
 
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-24YPR5EH.js";
4
4
  import {
5
5
  renderCollapseBar
6
- } from "./chunk-LRTSTDJ6.js";
6
+ } from "./chunk-42AZPI2W.js";
7
7
  import {
8
8
  TITLE_FONT_SIZE,
9
9
  TITLE_FONT_WEIGHT
@@ -10,7 +10,7 @@ import {
10
10
  buildPlacedNotes,
11
11
  noteCanvasShift,
12
12
  resolveNotes
13
- } from "./chunk-4TK26YHH.js";
13
+ } from "./chunk-UWWQECLC.js";
14
14
  import {
15
15
  measureText,
16
16
  wrapTextToWidth
@@ -105,7 +105,7 @@ function computeNodeSize(node, reserveValueRow) {
105
105
  return { width: w, height: Math.max(NODE_HEIGHT, totalHeight) };
106
106
  }
107
107
  async function layoutBoxesAndLines(parsed, collapseInfo, layoutOptions) {
108
- const { layoutBoxesAndLinesSearch } = await import("./layout-search-DSIDKKQO.js");
108
+ const { layoutBoxesAndLinesSearch } = await import("./layout-search-UZYZE4PR.js");
109
109
  const searchOpts = {
110
110
  ...layoutOptions?.hideDescriptions !== void 0 && {
111
111
  hideDescriptions: layoutOptions.hideDescriptions
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-24YPR5EH.js";
13
13
  import {
14
14
  renderCollapseBar
15
- } from "./chunk-LRTSTDJ6.js";
15
+ } from "./chunk-42AZPI2W.js";
16
16
  import {
17
17
  layoutInlineHeader
18
18
  } from "./chunk-REKLKGR6.js";
@@ -39,12 +39,8 @@ import {
39
39
  getMaxLegendReservedHeight
40
40
  } from "./chunk-VVL2KKG4.js";
41
41
  import {
42
- NOTE_BADGE_RADIUS,
43
- noteConnectorPoints,
44
- renderNoteBadge,
45
- renderNoteBox,
46
- renderNoteConnector
47
- } from "./chunk-CLW45YKE.js";
42
+ renderNodeNote
43
+ } from "./chunk-DA2GIHAY.js";
48
44
  import {
49
45
  wrapDescriptionLines
50
46
  } from "./chunk-7WEYXYLC.js";
@@ -715,46 +711,13 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
715
711
  nodeG.attr(FULL_TEXT_ATTR, fullNodeText(node.label, drawnDesc));
716
712
  }
717
713
  if (ln.note) {
718
- if (ln.note.collapsed) {
719
- renderNoteBadge(
720
- nodeG,
721
- {
722
- x: ln.width / 2 - NOTE_BADGE_RADIUS - 3,
723
- y: -ln.height / 2 + NOTE_BADGE_RADIUS + 3
724
- },
725
- palette,
726
- {
727
- isDark,
728
- ...ln.note.color && { color: ln.note.color },
729
- lineNumber: ln.note.lineNumber,
730
- endLineNumber: ln.note.endLineNumber
731
- }
732
- );
733
- } else {
734
- const [cx1, cy1, cx2, cy2] = noteConnectorPoints(
735
- { width: ln.width, height: ln.height },
736
- ln.note
737
- );
738
- renderNoteConnector(nodeG, cx1, cy1, cx2, cy2, palette);
739
- renderNoteBox(
740
- nodeG,
741
- {
742
- x: ln.note.x,
743
- y: ln.note.y,
744
- width: ln.note.width,
745
- height: ln.note.height
746
- },
747
- ln.note.lines,
748
- palette,
749
- {
750
- isDark,
751
- ...ln.note.color && { color: ln.note.color },
752
- lineNumber: ln.note.lineNumber,
753
- endLineNumber: ln.note.endLineNumber,
754
- interactive: true
755
- }
756
- );
757
- }
714
+ renderNodeNote(
715
+ nodeG,
716
+ { width: ln.width, height: ln.height },
717
+ ln.note,
718
+ palette,
719
+ isDark
720
+ );
758
721
  }
759
722
  }
760
723
  const labelLayer = diagramG.append("g").attr("class", "bl-edge-labels");
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  resolveNotes,
6
6
  tryCollectNote
7
- } from "./chunk-4TK26YHH.js";
7
+ } from "./chunk-UWWQECLC.js";
8
8
  import {
9
9
  displayName,
10
10
  normalizeName
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  resolveNotes,
6
6
  tryCollectNote
7
- } from "./chunk-4TK26YHH.js";
7
+ } from "./chunk-UWWQECLC.js";
8
8
  import {
9
9
  normalizeName
10
10
  } from "./chunk-NOTA6TEI.js";
@@ -164,6 +164,41 @@ function renderNoteBadge(parent, center, palette, opts) {
164
164
  g.append("line").attr("x1", -3.5).attr("y1", -0.5).attr("x2", 1.5).attr("y2", -0.5).attr("stroke", palette.textMuted).attr("stroke-width", 0.75).style("pointer-events", "none");
165
165
  return g;
166
166
  }
167
+ function renderNodeNote(nodeG, node, note, palette, isDark) {
168
+ const accent = note.color ? { color: note.color } : {};
169
+ if (note.collapsed) {
170
+ renderNoteBadge(
171
+ nodeG,
172
+ {
173
+ x: node.width / 2 - NOTE_BADGE_RADIUS - 3,
174
+ y: -node.height / 2 + NOTE_BADGE_RADIUS + 3
175
+ },
176
+ palette,
177
+ {
178
+ isDark,
179
+ ...accent,
180
+ lineNumber: note.lineNumber,
181
+ endLineNumber: note.endLineNumber
182
+ }
183
+ );
184
+ return;
185
+ }
186
+ const [x1, y1, x2, y2] = noteConnectorPoints(node, note);
187
+ renderNoteConnector(nodeG, x1, y1, x2, y2, palette);
188
+ renderNoteBox(
189
+ nodeG,
190
+ { x: note.x, y: note.y, width: note.width, height: note.height },
191
+ note.lines,
192
+ palette,
193
+ {
194
+ isDark,
195
+ ...accent,
196
+ lineNumber: note.lineNumber,
197
+ endLineNumber: note.endLineNumber,
198
+ interactive: true
199
+ }
200
+ );
201
+ }
167
202
 
168
203
  export {
169
204
  NOTE_FONT_SIZE,
@@ -171,9 +206,6 @@ export {
171
206
  NOTE_BULLET_INDENT,
172
207
  wrapNoteBody,
173
208
  noteBoxSize,
174
- renderNoteConnector,
175
209
  noteConnectorPoints,
176
- renderNoteBox,
177
- NOTE_BADGE_RADIUS,
178
- renderNoteBadge
210
+ renderNodeNote
179
211
  };
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  searchPlacement
3
- } from "./chunk-7ASVGFW3.js";
3
+ } from "./chunk-NHN6GBG7.js";
4
4
  import {
5
5
  buildPlacedNotes,
6
6
  noteCanvasShift,
7
7
  resolveNotes
8
- } from "./chunk-4TK26YHH.js";
8
+ } from "./chunk-UWWQECLC.js";
9
9
  import {
10
10
  measureText
11
11
  } from "./chunk-PU5X3P3T.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-6OSGENN5.js";
4
4
  import {
5
5
  parseDgmoChartType
6
- } from "./chunk-XEMCNQQW.js";
6
+ } from "./chunk-3EDV56HL.js";
7
7
  import {
8
8
  FONT_FAMILY,
9
9
  MONO_FAMILY
@@ -1,3 +1,22 @@
1
+ import {
2
+ TITLE_FONT_WEIGHT
3
+ } from "./chunk-GULGSH2Z.js";
4
+
5
+ // src/graph/title.ts
6
+ import * as d3Selection from "d3-selection";
7
+ function renderGraphTitle(svg, opts) {
8
+ const { titleLineNumber, onClickItem } = opts;
9
+ const titleEl = svg.append("text").attr("class", "chart-title").attr("x", opts.x).attr("y", opts.y).attr("text-anchor", opts.anchor).attr("fill", opts.color).attr("font-size", opts.fontSize).attr("font-weight", TITLE_FONT_WEIGHT).style("cursor", onClickItem && titleLineNumber ? "pointer" : "default").text(opts.title);
10
+ if (!titleLineNumber) return;
11
+ titleEl.attr("data-line-number", titleLineNumber);
12
+ if (!onClickItem) return;
13
+ titleEl.on("click", () => onClickItem(titleLineNumber)).on("mouseenter", function() {
14
+ d3Selection.select(this).attr("opacity", 0.7);
15
+ }).on("mouseleave", function() {
16
+ d3Selection.select(this).attr("opacity", 1);
17
+ });
18
+ }
19
+
1
20
  // src/graph/edge-spline.ts
2
21
  import * as d3Shape from "d3-shape";
3
22
  var lineGenerator = d3Shape.line().x((d) => d.x).y((d) => d.y).curve(d3Shape.curveBasis);
@@ -42,6 +61,7 @@ function selfLoopArcPath(points) {
42
61
  }
43
62
 
44
63
  export {
64
+ renderGraphTitle,
45
65
  edgeSplinePath,
46
66
  selfLoopArcPath
47
67
  };
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-BYU54C3S.js";
33
33
 
34
34
  // src/org/parser.ts
35
- var CONTAINER_RE = /^\[([^\]]+)\](?:\s+collapsed:\s*(\S+))?$/;
35
+ var CONTAINER_RE = /^\[([^\]]+)\](?:\s+collapsed:\s*(\S+)|\s+(collapsed))?$/;
36
36
  var METADATA_RE = /^([^:]+):\s*(.+)$/;
37
37
  var KNOWN_OPTIONS = /* @__PURE__ */ new Set([
38
38
  "sub-node-label",
@@ -238,7 +238,7 @@ function parseOrg(content, palette) {
238
238
  // The same-line collapse marker (capture 2, §6.4.1). Goes into metadata
239
239
  // rather than the typed field so the one post-parse lift handles every
240
240
  // route — same-line here, indented under the header, or under a person.
241
- metadata: containerMatch[2] !== void 0 ? { collapsed: containerMatch[2] } : {},
241
+ metadata: containerMatch[2] !== void 0 ? { collapsed: containerMatch[2] } : containerMatch[3] !== void 0 ? { collapsed: "true" } : {},
242
242
  children: [],
243
243
  parentId: null,
244
244
  isContainer: true,
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-24YPR5EH.js";
19
19
  import {
20
20
  renderCollapseBar
21
- } from "./chunk-LRTSTDJ6.js";
21
+ } from "./chunk-42AZPI2W.js";
22
22
  import {
23
23
  CARD_RADIUS,
24
24
  CONTAINER_RADIUS,
@@ -31,7 +31,7 @@ import {
31
31
  import {
32
32
  NOTE_BULLET_INDENT,
33
33
  wrapNoteBody
34
- } from "./chunk-CLW45YKE.js";
34
+ } from "./chunk-DA2GIHAY.js";
35
35
  import {
36
36
  renderInlineText
37
37
  } from "./chunk-QKPOIJBT.js";
@@ -1,12 +1,14 @@
1
1
  import {
2
- CYLINDER_RY,
3
- QUEUE_CAP,
4
2
  collectCardMetadata,
5
3
  layoutC4Components,
6
4
  layoutC4Containers,
7
5
  layoutC4Context,
8
6
  layoutC4Deployment
9
- } from "./chunk-V3ICBS2O.js";
7
+ } from "./chunk-NXOIH5JK.js";
8
+ import {
9
+ CYLINDER_RY,
10
+ QUEUE_CAP
11
+ } from "./chunk-VTGGPBLW.js";
10
12
  import {
11
13
  appendArrowheadMarkers,
12
14
  appendReverseArrowheadMarkers
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  resolveNotes,
6
6
  tryCollectNote
7
- } from "./chunk-4TK26YHH.js";
7
+ } from "./chunk-UWWQECLC.js";
8
8
  import {
9
9
  displayName,
10
10
  normalizeName