@diagrammo/dgmo 0.86.0 → 0.87.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 (73) hide show
  1. package/dist/advanced.d.ts +0 -18
  2. package/dist/advanced.js +36 -35
  3. package/dist/block.js +5 -17
  4. package/dist/{chunk-FAV4RDVT.js → chunk-2A4DQAXG.js} +1 -1
  5. package/dist/{chunk-JIPUBFAM.js → chunk-5KGM44TG.js} +2 -2
  6. package/dist/{chunk-QJ2JOLFN.js → chunk-6I5UN4FD.js} +2 -2
  7. package/dist/{chunk-PKXKWHDW.js → chunk-AUS7V54P.js} +1 -1
  8. package/dist/{chunk-BF7JAFJI.js → chunk-B7CU2HW5.js} +2 -2
  9. package/dist/{chunk-X2VEJ5NT.js → chunk-BMUWF77V.js} +2 -2
  10. package/dist/{chunk-BP4BT5TH.js → chunk-CLQIXD2C.js} +1 -1
  11. package/dist/{chunk-QJFT5MAH.js → chunk-DSG6GBUQ.js} +2 -2
  12. package/dist/{chunk-EWSESGC2.js → chunk-EJS3K44P.js} +117 -78
  13. package/dist/{chunk-VEE777MD.js → chunk-FBKPSU3A.js} +3 -3
  14. package/dist/{chunk-5JO443MB.js → chunk-HAH5X345.js} +1 -1
  15. package/dist/{chunk-HBCAY3KR.js → chunk-HTNLLT34.js} +1 -1
  16. package/dist/{chunk-HUMQIRJK.js → chunk-HTPZDZKQ.js} +2 -2
  17. package/dist/{chunk-VPVWG2GH.js → chunk-J7Q4VPBJ.js} +1 -1
  18. package/dist/{chunk-3CQS3CIO.js → chunk-LL6D3MES.js} +1 -1
  19. package/dist/{chunk-QPE646M2.js → chunk-LPXC4I4R.js} +18 -1
  20. package/dist/{chunk-ERYHC4KJ.js → chunk-LSQGJN5H.js} +1 -1
  21. package/dist/{chunk-E6S2K6O2.js → chunk-N7XRBWXA.js} +2 -2
  22. package/dist/{chunk-WMIKC5XO.js → chunk-NPWVOFB3.js} +1 -1
  23. package/dist/{chunk-MYHPRQHR.js → chunk-O6MMQQLF.js} +3 -3
  24. package/dist/{chunk-GYORDNOM.js → chunk-P5V63L35.js} +1 -1
  25. package/dist/{chunk-4YA5XW43.js → chunk-PJQZWJ5I.js} +50 -28
  26. package/dist/{chunk-BHZE36F7.js → chunk-PUVTFUNH.js} +1 -1
  27. package/dist/{chunk-ETBXIKK6.js → chunk-Q2U5635V.js} +1 -1
  28. package/dist/{chunk-TW6WMZFW.js → chunk-QT3KDDXK.js} +156 -7
  29. package/dist/{chunk-ZGHV4QLK.js → chunk-RJNZHFNG.js} +1 -1
  30. package/dist/{chunk-FWNJDD4U.js → chunk-S7W75MIM.js} +3 -20
  31. package/dist/{chunk-C6FZZFYD.js → chunk-WZ23JJ7U.js} +1 -1
  32. package/dist/{chunk-LIYWJ6DV.js → chunk-XIFK423U.js} +108 -13
  33. package/dist/{chunk-4ELXLATB.js → chunk-XUDGZJTJ.js} +2 -2
  34. package/dist/{chunk-H6AFNCN3.js → chunk-XVSJYAK7.js} +1 -1
  35. package/dist/{chunk-LHBMQJC3.js → chunk-XWYR5T52.js} +2 -2
  36. package/dist/{chunk-QNKHJ5CK.js → chunk-YK4N6TBN.js} +4 -2
  37. package/dist/{chunk-XFMQSFS4.js → chunk-YMG7JDEY.js} +16 -6
  38. package/dist/chunk-Z6DXWULM.js +23 -0
  39. package/dist/{chunk-PBEH52A2.js → chunk-ZNNVI5SR.js} +1 -1
  40. package/dist/{flowchart-renderer-H72L7BEC.js → flowchart-renderer-THC6Y7EH.js} +7 -6
  41. package/dist/index.d.ts +68 -1
  42. package/dist/index.js +75 -7
  43. package/dist/{layout-QIPCNUSB.js → layout-BOVTLAOT.js} +7 -6
  44. package/dist/{layout-6JARW64V.js → layout-EHTYSMV4.js} +6 -5
  45. package/dist/{layout-YELNBVPC.js → layout-P6DTD4RT.js} +6 -5
  46. package/dist/{layout-T6TAB5OI.js → layout-RANVNAKI.js} +3 -3
  47. package/dist/{layout-FMKSENGL.js → layout-XUW444O5.js} +5 -4
  48. package/dist/{layout-search-AW5VBDCV.js → layout-search-VKSBUCDM.js} +57 -28
  49. package/dist/{renderer-AI2MD52D.js → renderer-222OTVQV.js} +3 -2
  50. package/dist/{renderer-UUWR7NGF.js → renderer-2KVQGGTT.js} +4 -3
  51. package/dist/{renderer-E5EKGIX2.js → renderer-2OOPQ4CH.js} +4 -3
  52. package/dist/{renderer-RLSR7N6I.js → renderer-3CTUWCO7.js} +5 -4
  53. package/dist/{renderer-CZJ4AMYV.js → renderer-3FF4QVGW.js} +3 -2
  54. package/dist/{renderer-R6VJDZFO.js → renderer-4BHOELCE.js} +4 -3
  55. package/dist/{renderer-425QUIYO.js → renderer-4BIMRO4X.js} +4 -3
  56. package/dist/{renderer-5JVVJBAS.js → renderer-A4LMOBZL.js} +8 -7
  57. package/dist/{renderer-3AOOLHJU.js → renderer-A6ACVK4X.js} +3 -2
  58. package/dist/{renderer-ML2CLU25.js → renderer-DCFQDBGJ.js} +4 -3
  59. package/dist/{renderer-ADX4DWRJ.js → renderer-ELYPDPNF.js} +3 -2
  60. package/dist/{renderer-RH4U3UVM.js → renderer-LODEVN3V.js} +3 -2
  61. package/dist/{renderer-E7WF75GY.js → renderer-NHPKNNBD.js} +5 -4
  62. package/dist/{renderer-JEEGPLMM.js → renderer-R34GJL7U.js} +8 -7
  63. package/dist/{renderer-2BWRW23Z.js → renderer-RENDISO5.js} +1 -1
  64. package/dist/{renderer-VKAJ52UO.js → renderer-SDUSBCJI.js} +3 -2
  65. package/dist/{renderer-RUGMKHX5.js → renderer-WH2HWE5Z.js} +3 -2
  66. package/dist/{renderer-V6LLASGN.js → renderer-X5A5VIRD.js} +5 -4
  67. package/dist/{renderer-EWJS2RAZ.js → renderer-YDAVCRTP.js} +3 -2
  68. package/dist/{state-renderer-DDVJ43HR.js → state-renderer-5IQ4OJUI.js} +7 -6
  69. package/gallery/fixtures/journey-map.dgmo +28 -0
  70. package/gallery/fixtures/mindmap.dgmo +31 -0
  71. package/gallery/fixtures/pert.dgmo +27 -0
  72. package/gallery/fixtures/wireframe.dgmo +30 -0
  73. package/package.json +2 -2
@@ -2150,24 +2150,6 @@ declare function layoutBoxesAndLines(parsed: ParsedBoxesAndLines, collapseInfo?:
2150
2150
  /** Progress hook (interactive path). When set, the search yields between
2151
2151
  * candidates so the UI can paint a "trying X of Y" indicator. */
2152
2152
  onProgress?: (done: number, total: number, phase: string) => void;
2153
- /** Wall-clock deadline on candidate generation, in ms. Defaults to
2154
- * `DEFAULT_SEARCH_BUDGET_MS`; **0 or less means no deadline at all**.
2155
- *
2156
- * 🔴 A test that asserts WHICH labels the search managed to place must
2157
- * pass 0. The search is the one part of layout whose OUTPUT depends on
2158
- * how much time it got, so a test pinning an exact result is otherwise
2159
- * measuring the machine — and fails on a busy one while the code is
2160
- * fine. `layout-search.ts` has said a non-positive budget is "what the
2161
- * snapshot tests want" since the backstop was added, but nothing
2162
- * forwarded it here, so no test could ask. Found when a full release's
2163
- * gate refused dgmo on 2026-09-20: the OAUTH fixture needs ~2.5s a pass
2164
- * and runs the search twice, so under the suite's own parallel load it
2165
- * crossed the 5s backstop and five labels came out unplaced.
2166
- *
2167
- * This is the escape hatch for tests only. A real caller still gets the
2168
- * deadline, and it still costs them placed labels on a busy machine —
2169
- * that half is the search backstop firing on ordinary diagrams (#868). */
2170
- budgetMs?: number;
2171
2153
  }): Promise<BLLayoutResult>;
2172
2154
 
2173
2155
  interface BLRenderOptions {
package/dist/advanced.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  layoutBracket,
3
3
  renderBracket,
4
4
  renderBracketForExport
5
- } from "./chunk-ETBXIKK6.js";
5
+ } from "./chunk-Q2U5635V.js";
6
6
  import {
7
7
  renderRaci,
8
8
  renderRaciForExport
@@ -16,11 +16,11 @@ import {
16
16
  computeActivations,
17
17
  groupMessagesBySection,
18
18
  renderSequenceDiagram
19
- } from "./chunk-XFMQSFS4.js";
19
+ } from "./chunk-YMG7JDEY.js";
20
20
  import {
21
21
  renderRing,
22
22
  renderRingForExport
23
- } from "./chunk-QJ2JOLFN.js";
23
+ } from "./chunk-6I5UN4FD.js";
24
24
  import {
25
25
  layoutTreemapRadial,
26
26
  renderTreemapRadial,
@@ -43,12 +43,12 @@ import {
43
43
  import {
44
44
  renderGoal,
45
45
  renderGoalForExport
46
- } from "./chunk-H6AFNCN3.js";
46
+ } from "./chunk-XVSJYAK7.js";
47
47
  import "./chunk-LNO3ASX5.js";
48
48
  import {
49
49
  renderCountdown,
50
50
  renderCountdownForExport
51
- } from "./chunk-JIPUBFAM.js";
51
+ } from "./chunk-5KGM44TG.js";
52
52
  import {
53
53
  renderClock,
54
54
  renderClockForExport
@@ -60,11 +60,11 @@ import {
60
60
  renderQuadrantFocusForExport,
61
61
  renderTechRadar,
62
62
  renderTechRadarForExport
63
- } from "./chunk-QNKHJ5CK.js";
63
+ } from "./chunk-YK4N6TBN.js";
64
64
  import {
65
65
  renderJourneyMap,
66
66
  renderJourneyMapForExport
67
- } from "./chunk-E6S2K6O2.js";
67
+ } from "./chunk-N7XRBWXA.js";
68
68
  import {
69
69
  layoutJourneyMap
70
70
  } from "./chunk-DOXBS7F5.js";
@@ -72,7 +72,7 @@ import {
72
72
  computeCycleLayout,
73
73
  renderCycle,
74
74
  renderCycleForExport
75
- } from "./chunk-QJFT5MAH.js";
75
+ } from "./chunk-DSG6GBUQ.js";
76
76
  import {
77
77
  resolveMap
78
78
  } from "./chunk-3AX6MCI6.js";
@@ -100,20 +100,20 @@ import {
100
100
  import {
101
101
  renderPyramid,
102
102
  renderPyramidForExport
103
- } from "./chunk-X2VEJ5NT.js";
103
+ } from "./chunk-BMUWF77V.js";
104
104
  import {
105
105
  collectDiagramRoles,
106
106
  computeInfraLegendGroups,
107
107
  inferRoles,
108
108
  parseAndLayoutInfra,
109
109
  renderInfra
110
- } from "./chunk-ERYHC4KJ.js";
110
+ } from "./chunk-LSQGJN5H.js";
111
111
  import {
112
112
  measurePertAnalysisBlock,
113
113
  renderPert,
114
114
  renderPertAnalysisBlock,
115
115
  renderPertForExport
116
- } from "./chunk-GYORDNOM.js";
116
+ } from "./chunk-P5V63L35.js";
117
117
  import {
118
118
  analyzePert,
119
119
  buildSimulationContext,
@@ -138,7 +138,7 @@ import {
138
138
  import {
139
139
  renderState,
140
140
  renderStateForExport
141
- } from "./chunk-BF7JAFJI.js";
141
+ } from "./chunk-B7CU2HW5.js";
142
142
  import {
143
143
  collapseStateGroups
144
144
  } from "./chunk-SQ7IY53Q.js";
@@ -156,7 +156,7 @@ import {
156
156
  renderC4ContextForExport,
157
157
  renderC4Deployment,
158
158
  renderC4DeploymentForExport
159
- } from "./chunk-C6FZZFYD.js";
159
+ } from "./chunk-WZ23JJ7U.js";
160
160
  import {
161
161
  layoutC4Components,
162
162
  layoutC4Containers,
@@ -167,11 +167,11 @@ import {
167
167
  import {
168
168
  renderFlowchart,
169
169
  renderFlowchartForExport
170
- } from "./chunk-4ELXLATB.js";
170
+ } from "./chunk-XUDGZJTJ.js";
171
171
  import "./chunk-26EVL454.js";
172
172
  import {
173
173
  layoutGraph
174
- } from "./chunk-PBEH52A2.js";
174
+ } from "./chunk-ZNNVI5SR.js";
175
175
  import {
176
176
  computeInfra
177
177
  } from "./chunk-ICZ7M6IZ.js";
@@ -180,7 +180,7 @@ import {
180
180
  } from "./chunk-3FCSOYN4.js";
181
181
  import {
182
182
  layoutSwimlane
183
- } from "./chunk-PKXKWHDW.js";
183
+ } from "./chunk-AUS7V54P.js";
184
184
  import {
185
185
  renderSwimlaneForExport
186
186
  } from "./chunk-BT2WH2XT.js";
@@ -198,24 +198,24 @@ import {
198
198
  import {
199
199
  renderMindmap,
200
200
  renderMindmapForExport
201
- } from "./chunk-3CQS3CIO.js";
201
+ } from "./chunk-LL6D3MES.js";
202
202
  import {
203
203
  layoutMindmap
204
204
  } from "./chunk-UIUXIDBX.js";
205
205
  import {
206
206
  renderClassDiagram,
207
207
  renderClassDiagramForExport
208
- } from "./chunk-LHBMQJC3.js";
208
+ } from "./chunk-XWYR5T52.js";
209
209
  import {
210
210
  layoutClassDiagram
211
- } from "./chunk-BP4BT5TH.js";
211
+ } from "./chunk-CLQIXD2C.js";
212
212
  import {
213
213
  renderERDiagram,
214
214
  renderERDiagramForExport
215
- } from "./chunk-HUMQIRJK.js";
215
+ } from "./chunk-HTPZDZKQ.js";
216
216
  import {
217
217
  layoutERDiagram
218
- } from "./chunk-FAV4RDVT.js";
218
+ } from "./chunk-2A4DQAXG.js";
219
219
  import {
220
220
  SKETCH_AUTO_LAYOUT_DEFAULTS,
221
221
  SKETCH_FOOT_H,
@@ -245,17 +245,17 @@ import {
245
245
  import {
246
246
  renderBoxesAndLines,
247
247
  renderBoxesAndLinesForExport
248
- } from "./chunk-MYHPRQHR.js";
249
- import "./chunk-5JO443MB.js";
248
+ } from "./chunk-O6MMQQLF.js";
249
+ import "./chunk-HAH5X345.js";
250
250
  import "./chunk-XBJJP2HN.js";
251
251
  import {
252
252
  layoutBoxesAndLines
253
- } from "./chunk-LIYWJ6DV.js";
254
- import "./chunk-EWSESGC2.js";
255
- import "./chunk-TW6WMZFW.js";
256
- import "./chunk-HBCAY3KR.js";
253
+ } from "./chunk-XIFK423U.js";
254
+ import "./chunk-EJS3K44P.js";
255
+ import "./chunk-QT3KDDXK.js";
256
+ import "./chunk-HTNLLT34.js";
257
257
  import "./chunk-6EK55ART.js";
258
- import "./chunk-ZGHV4QLK.js";
258
+ import "./chunk-RJNZHFNG.js";
259
259
  import "./chunk-5DH3KYFH.js";
260
260
  import {
261
261
  renderVersionControl,
@@ -282,26 +282,26 @@ import "./chunk-BS7SV7C3.js";
282
282
  import {
283
283
  renderSitemap,
284
284
  renderSitemapForExport
285
- } from "./chunk-BHZE36F7.js";
285
+ } from "./chunk-PUVTFUNH.js";
286
286
  import {
287
287
  computeCardArchive,
288
288
  computeCardMove,
289
289
  isArchiveColumn,
290
290
  renderKanban,
291
291
  renderKanbanForExport
292
- } from "./chunk-VPVWG2GH.js";
292
+ } from "./chunk-J7Q4VPBJ.js";
293
293
  import {
294
294
  clearEventLineMuted,
295
295
  focusEventLine,
296
296
  renderEventLine,
297
297
  renderEventLineForExport
298
- } from "./chunk-VEE777MD.js";
299
- import "./chunk-WMIKC5XO.js";
298
+ } from "./chunk-FBKPSU3A.js";
299
+ import "./chunk-NPWVOFB3.js";
300
300
  import "./chunk-R2K5L4UA.js";
301
301
  import {
302
302
  parseInlineMarkdown,
303
303
  truncateBareUrl
304
- } from "./chunk-FWNJDD4U.js";
304
+ } from "./chunk-S7W75MIM.js";
305
305
  import {
306
306
  renderBody,
307
307
  renderBodyForExport
@@ -312,6 +312,7 @@ import {
312
312
  searchMapLocations,
313
313
  themes
314
314
  } from "./chunk-SQAG3UXH.js";
315
+ import "./chunk-Z6DXWULM.js";
315
316
  import {
316
317
  DEFAULT_DIM_OPACITY,
317
318
  orderArcNodes,
@@ -322,7 +323,7 @@ import {
322
323
  renderSlopeChart,
323
324
  renderVenn,
324
325
  renderWordCloud
325
- } from "./chunk-4YA5XW43.js";
326
+ } from "./chunk-PJQZWJ5I.js";
326
327
  import "./chunk-D4M25W6R.js";
327
328
  import {
328
329
  CHART_TYPE_DESCRIPTIONS,
@@ -376,7 +377,7 @@ import "./chunk-2CW5ZTNH.js";
376
377
  import {
377
378
  formatDateLabel,
378
379
  renderTimeline
379
- } from "./chunk-QPE646M2.js";
380
+ } from "./chunk-LPXC4I4R.js";
380
381
  import {
381
382
  computeTimeTicks
382
383
  } from "./chunk-YRYKTYMQ.js";
package/dist/block.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-D3K4U3ZM.js";
5
5
  import {
6
6
  render
7
- } from "./chunk-4YA5XW43.js";
7
+ } from "./chunk-PJQZWJ5I.js";
8
8
  import {
9
9
  docsLink,
10
10
  renderErrorCard
@@ -20,7 +20,10 @@ import "./chunk-KMU65FYM.js";
20
20
  import "./chunk-EPDBWATV.js";
21
21
  import "./chunk-7UDAIP6W.js";
22
22
  import "./chunk-2CW5ZTNH.js";
23
- import "./chunk-QPE646M2.js";
23
+ import {
24
+ escapeAttr,
25
+ escapeHtml
26
+ } from "./chunk-LPXC4I4R.js";
24
27
  import "./chunk-YRYKTYMQ.js";
25
28
  import "./chunk-24YPR5EH.js";
26
29
  import "./chunk-XCKNFFKM.js";
@@ -559,21 +562,6 @@ function markTokensInRange(tokens, from, to, role) {
559
562
  }
560
563
  }
561
564
 
562
- // src/embed/escape.ts
563
- var HTML_ENTITIES = {
564
- "&": "&amp;",
565
- "<": "&lt;",
566
- ">": "&gt;",
567
- '"': "&quot;",
568
- "'": "&#39;"
569
- };
570
- function escapeHtml(s) {
571
- return s.replace(/[&<>"']/g, (ch) => HTML_ENTITIES[ch] ?? ch);
572
- }
573
- function escapeAttr(s) {
574
- return s.replace(/[&<>"']/g, (ch) => HTML_ENTITIES[ch] ?? ch);
575
- }
576
-
577
565
  // src/embed/css.ts
578
566
  var BLOCK_CSS = `
579
567
  /* @diagrammo/dgmo block \u2014 standard embed chrome.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildPlacedNotes
3
- } from "./chunk-HBCAY3KR.js";
3
+ } from "./chunk-HTNLLT34.js";
4
4
  import {
5
5
  noteCanvasShift
6
6
  } from "./chunk-6EK55ART.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  wrapDescriptionLines
3
- } from "./chunk-WMIKC5XO.js";
3
+ } from "./chunk-NPWVOFB3.js";
4
4
  import {
5
5
  renderInlineText,
6
6
  stripInlineMarkdown
7
- } from "./chunk-FWNJDD4U.js";
7
+ } from "./chunk-S7W75MIM.js";
8
8
  import {
9
9
  FONT_FAMILY
10
10
  } from "./chunk-ICLB27PZ.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  wrapDescriptionLines
3
- } from "./chunk-WMIKC5XO.js";
3
+ } from "./chunk-NPWVOFB3.js";
4
4
  import {
5
5
  renderInlineText
6
- } from "./chunk-FWNJDD4U.js";
6
+ } from "./chunk-S7W75MIM.js";
7
7
  import {
8
8
  ScaleContext
9
9
  } from "./chunk-24YPR5EH.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  acyclicOrient
3
- } from "./chunk-EWSESGC2.js";
3
+ } from "./chunk-EJS3K44P.js";
4
4
 
5
5
  // src/swimlane/layout.ts
6
6
  var MARGIN = 30;
@@ -4,14 +4,14 @@ import {
4
4
  } from "./chunk-26EVL454.js";
5
5
  import {
6
6
  layoutGraph
7
- } from "./chunk-PBEH52A2.js";
7
+ } from "./chunk-ZNNVI5SR.js";
8
8
  import {
9
9
  NOTE_BADGE_RADIUS,
10
10
  noteConnectorPoints,
11
11
  renderNoteBadge,
12
12
  renderNoteBox,
13
13
  renderNoteConnector
14
- } from "./chunk-5JO443MB.js";
14
+ } from "./chunk-HAH5X345.js";
15
15
  import {
16
16
  appendArrowheadMarkers
17
17
  } from "./chunk-XBJJP2HN.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  wrapDescriptionLines
3
- } from "./chunk-WMIKC5XO.js";
3
+ } from "./chunk-NPWVOFB3.js";
4
4
  import {
5
5
  renderInlineText
6
- } from "./chunk-FWNJDD4U.js";
6
+ } from "./chunk-S7W75MIM.js";
7
7
  import {
8
8
  ScaleContext
9
9
  } from "./chunk-24YPR5EH.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildPlacedNotes
3
- } from "./chunk-HBCAY3KR.js";
3
+ } from "./chunk-HTNLLT34.js";
4
4
  import {
5
5
  noteCanvasShift
6
6
  } from "./chunk-6EK55ART.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  wrapDescriptionLines
3
- } from "./chunk-WMIKC5XO.js";
3
+ } from "./chunk-NPWVOFB3.js";
4
4
  import {
5
5
  renderInlineText
6
- } from "./chunk-FWNJDD4U.js";
6
+ } from "./chunk-S7W75MIM.js";
7
7
  import {
8
8
  ScaleContext
9
9
  } from "./chunk-24YPR5EH.js";
@@ -4,7 +4,10 @@ import {
4
4
  NODE_HEIGHT,
5
5
  NODE_WIDTH,
6
6
  measureEdgeLabel
7
- } from "./chunk-TW6WMZFW.js";
7
+ } from "./chunk-QT3KDDXK.js";
8
+ import {
9
+ measureText
10
+ } from "./chunk-KAO7JL4I.js";
8
11
 
9
12
  // src/boxes-and-lines/edge-clip.ts
10
13
  function rectBorderPoint(rect, toward) {
@@ -48,6 +51,8 @@ var DUMMY_THICK = 10;
48
51
  var MARGIN = 40;
49
52
  var GROUP_PAD = 16;
50
53
  var GROUP_LABEL_ZONE = 32;
54
+ var GROUP_TITLE_FONT_SIZE = 14;
55
+ var TITLE_CLEAR = 6;
51
56
  var GROUP_GAP = 24;
52
57
  var TIER_GAP = GROUP_LABEL_ZONE + 2 * GROUP_PAD;
53
58
  var W_REAL_REAL = 1;
@@ -556,6 +561,70 @@ function groupedTierCandidates(parsed, sizes, opts) {
556
561
  });
557
562
  const chainById = /* @__PURE__ */ new Map();
558
563
  for (const ch of chains) chainById.set(ch.edgeIdx, ch.chain);
564
+ const nodeBox = new Map(
565
+ layoutNodes.map((n) => [
566
+ n.label,
567
+ {
568
+ l: n.x - n.width / 2,
569
+ r: n.x + n.width / 2,
570
+ t: n.y - n.height / 2,
571
+ b: n.y + n.height / 2
572
+ }
573
+ ])
574
+ );
575
+ const depthOf = (label) => {
576
+ let d = 0;
577
+ let cur = label;
578
+ const guard = /* @__PURE__ */ new Set();
579
+ while (cur && !guard.has(cur)) {
580
+ guard.add(cur);
581
+ cur = groupByLabel.get(cur)?.parentGroup;
582
+ if (cur) d++;
583
+ }
584
+ return d;
585
+ };
586
+ const childGroups = /* @__PURE__ */ new Map();
587
+ for (const g of parsed.groups)
588
+ if (g.parentGroup)
589
+ (childGroups.get(g.parentGroup) ?? childGroups.set(g.parentGroup, []).get(g.parentGroup)).push(g.label);
590
+ const rectByGroup = /* @__PURE__ */ new Map();
591
+ const ordered = [...parsed.groups].sort(
592
+ (a, b) => depthOf(b.label) - depthOf(a.label)
593
+ );
594
+ const layoutGroups = [];
595
+ for (const grp of ordered) {
596
+ let l = Infinity, r = -Infinity, t = Infinity, bm = -Infinity;
597
+ const acc2 = (box) => {
598
+ l = Math.min(l, box.l);
599
+ r = Math.max(r, box.r);
600
+ t = Math.min(t, box.t);
601
+ bm = Math.max(bm, box.b);
602
+ };
603
+ for (const c of grp.children) {
604
+ const nb = nodeBox.get(c);
605
+ if (nb) acc2(nb);
606
+ }
607
+ for (const sub of childGroups.get(grp.label) ?? []) {
608
+ const sr = rectByGroup.get(sub);
609
+ if (sr) acc2(sr);
610
+ }
611
+ if (!Number.isFinite(l)) continue;
612
+ const x0 = l - GROUP_PAD;
613
+ const x1 = r + GROUP_PAD;
614
+ const y0 = t - GROUP_LABEL_ZONE;
615
+ const y1 = bm + GROUP_PAD;
616
+ rectByGroup.set(grp.label, { l: x0, r: x1, t: y0, b: y1 });
617
+ layoutGroups.push({
618
+ label: grp.label,
619
+ lineNumber: grp.lineNumber,
620
+ x: (x0 + x1) / 2,
621
+ y: (y0 + y1) / 2,
622
+ width: x1 - x0,
623
+ height: y1 - y0,
624
+ collapsed: false,
625
+ childCount: grp.children.length
626
+ });
627
+ }
559
628
  let minCross = Infinity, maxCross = -Infinity;
560
629
  for (const n of node.values()) {
561
630
  if (n.dummy) continue;
@@ -574,35 +643,69 @@ function groupedTierCandidates(parsed, sizes, opts) {
574
643
  side: sideOf(b),
575
644
  span: Math.abs(node.get(b.src).rank - node.get(b.tgt).rank)
576
645
  })).sort((a, b) => a.side - b.side || a.span - b.span);
577
- const sideCounts = /* @__PURE__ */ new Map();
578
- for (const b of backSorted)
579
- sideCounts.set(b.side, (sideCounts.get(b.side) ?? 0) + 1);
580
646
  const laneCounter = /* @__PURE__ */ new Map();
581
647
  const backPoints = /* @__PURE__ */ new Map();
648
+ const faceKey = (id, side) => `${id}\0${side}`;
649
+ const faceCount = /* @__PURE__ */ new Map();
650
+ for (const b of backSorted)
651
+ for (const id of [b.src, b.tgt])
652
+ faceCount.set(
653
+ faceKey(id, b.side),
654
+ (faceCount.get(faceKey(id, b.side)) ?? 0) + 1
655
+ );
656
+ const faceSeen = /* @__PURE__ */ new Map();
657
+ const portSlot = (id, side) => {
658
+ const key = faceKey(id, side);
659
+ const j = faceSeen.get(key) ?? 0;
660
+ faceSeen.set(key, j + 1);
661
+ return 2 * (j + 1) / (faceCount.get(key) + 1) - 1;
662
+ };
663
+ const titleStrips = layoutGroups.map((g) => {
664
+ const tw = measureText(g.label, GROUP_TITLE_FONT_SIZE, { bold: true });
665
+ const x0 = g.x - tw / 2 - TITLE_CLEAR;
666
+ const x1 = g.x + tw / 2 + TITLE_CLEAR;
667
+ const y0 = g.y - g.height / 2;
668
+ const y1 = y0 + GROUP_LABEL_ZONE;
669
+ return isTB ? { c0: x0, c1: x1, r0: y0, r1: y1 } : { c0: y0, c1: y1, r0: x0, r1: x1 };
670
+ });
671
+ const stubHitsTitle = (r, ca, cb) => titleStrips.some(
672
+ (t) => r > t.r0 && r < t.r1 && Math.min(ca, cb) < t.c1 && Math.max(ca, cb) > t.c0
673
+ );
674
+ const gapMid = (rank, dir) => {
675
+ const nb = rank + dir;
676
+ if (nb < 0 || nb > maxRank) return void 0;
677
+ const a = bandCenter[rank] + dir * bandDepth[rank] / 2;
678
+ const b = bandCenter[nb] - dir * bandDepth[nb] / 2;
679
+ return (a + b) / 2;
680
+ };
582
681
  for (const b of backSorted) {
583
682
  const s = b.side;
584
683
  const k = laneCounter.get(s) ?? 0;
585
684
  laneCounter.set(s, k + 1);
586
- const K = sideCounts.get(s);
587
685
  const src = node.get(b.src);
588
686
  const tgt = node.get(b.tgt);
589
687
  const laneC = s > 0 ? maxCross + GAP + k * LANE : minCross - GAP - k * LANE;
590
688
  const srcCtr = bandCenter[src.rank];
591
689
  const tgtCtr = bandCenter[tgt.rank];
592
- const frac = K > 1 ? (k + 1) / (K + 1) : 0;
593
- const srcR = srcCtr - frac * faceLim(src.depth);
594
- const tgtR = tgtCtr + frac * faceLim(tgt.depth);
690
+ const dir = srcCtr >= tgtCtr ? 1 : -1;
691
+ const srcR = srcCtr + dir * portSlot(b.src, s) * faceLim(src.depth);
692
+ const tgtR = tgtCtr - dir * portSlot(b.tgt, s) * faceLim(tgt.depth);
595
693
  const m = (c, rr) => isTB ? { x: c, y: rr } : { x: rr, y: c };
596
694
  const off = 10;
597
695
  const srcEdgeC = src.cross + s * (src.thick / 2 + off);
598
696
  const tgtEdgeC = tgt.cross + s * (tgt.thick / 2 + off);
697
+ const end = (n, ctr, r, edgeC, toward) => {
698
+ if (stubHitsTitle(r, n.cross, laneC)) {
699
+ const g = gapMid(n.rank, toward);
700
+ if (g !== void 0 && !stubHitsTitle(g, n.cross, laneC))
701
+ return [m(n.cross, ctr), m(n.cross, g), m(laneC, g)];
702
+ }
703
+ return [m(n.cross, ctr), m(edgeC, r), m(laneC, r)];
704
+ };
705
+ const toTgt = tgt.rank >= src.rank ? 1 : -1;
599
706
  backPoints.set(b.edgeIdx, [
600
- m(src.cross, srcCtr),
601
- m(srcEdgeC, srcR),
602
- m(laneC, srcR),
603
- m(laneC, tgtR),
604
- m(tgtEdgeC, tgtR),
605
- m(tgt.cross, tgtCtr)
707
+ ...end(src, srcCtr, srcR, srcEdgeC, toTgt),
708
+ ...end(tgt, tgtCtr, tgtR, tgtEdgeC, -toTgt).reverse()
606
709
  ]);
607
710
  }
608
711
  const flatPoints = /* @__PURE__ */ new Map();
@@ -659,70 +762,6 @@ function groupedTierCandidates(parsed, sizes, opts) {
659
762
  metadata: e.metadata
660
763
  });
661
764
  }
662
- const nodeBox = new Map(
663
- layoutNodes.map((n) => [
664
- n.label,
665
- {
666
- l: n.x - n.width / 2,
667
- r: n.x + n.width / 2,
668
- t: n.y - n.height / 2,
669
- b: n.y + n.height / 2
670
- }
671
- ])
672
- );
673
- const depthOf = (label) => {
674
- let d = 0;
675
- let cur = label;
676
- const guard = /* @__PURE__ */ new Set();
677
- while (cur && !guard.has(cur)) {
678
- guard.add(cur);
679
- cur = groupByLabel.get(cur)?.parentGroup;
680
- if (cur) d++;
681
- }
682
- return d;
683
- };
684
- const childGroups = /* @__PURE__ */ new Map();
685
- for (const g of parsed.groups)
686
- if (g.parentGroup)
687
- (childGroups.get(g.parentGroup) ?? childGroups.set(g.parentGroup, []).get(g.parentGroup)).push(g.label);
688
- const rectByGroup = /* @__PURE__ */ new Map();
689
- const ordered = [...parsed.groups].sort(
690
- (a, b) => depthOf(b.label) - depthOf(a.label)
691
- );
692
- const layoutGroups = [];
693
- for (const grp of ordered) {
694
- let l = Infinity, r = -Infinity, t = Infinity, bm = -Infinity;
695
- const acc2 = (box) => {
696
- l = Math.min(l, box.l);
697
- r = Math.max(r, box.r);
698
- t = Math.min(t, box.t);
699
- bm = Math.max(bm, box.b);
700
- };
701
- for (const c of grp.children) {
702
- const nb = nodeBox.get(c);
703
- if (nb) acc2(nb);
704
- }
705
- for (const sub of childGroups.get(grp.label) ?? []) {
706
- const sr = rectByGroup.get(sub);
707
- if (sr) acc2(sr);
708
- }
709
- if (!Number.isFinite(l)) continue;
710
- const x0 = l - GROUP_PAD;
711
- const x1 = r + GROUP_PAD;
712
- const y0 = t - GROUP_LABEL_ZONE;
713
- const y1 = bm + GROUP_PAD;
714
- rectByGroup.set(grp.label, { l: x0, r: x1, t: y0, b: y1 });
715
- layoutGroups.push({
716
- label: grp.label,
717
- lineNumber: grp.lineNumber,
718
- x: (x0 + x1) / 2,
719
- y: (y0 + y1) / 2,
720
- width: x1 - x0,
721
- height: y1 - y0,
722
- collapsed: false,
723
- childCount: grp.children.length
724
- });
725
- }
726
765
  let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
727
766
  const ext = (x0, y0, x1, y1) => {
728
767
  minX = Math.min(minX, x0);
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  wrapDescriptionLines
3
- } from "./chunk-WMIKC5XO.js";
3
+ } from "./chunk-NPWVOFB3.js";
4
4
  import {
5
5
  renderNodeCard
6
6
  } from "./chunk-R2K5L4UA.js";
7
7
  import {
8
8
  renderInlineText
9
- } from "./chunk-FWNJDD4U.js";
9
+ } from "./chunk-S7W75MIM.js";
10
10
  import {
11
11
  formatDateLabel
12
- } from "./chunk-QPE646M2.js";
12
+ } from "./chunk-LPXC4I4R.js";
13
13
  import {
14
14
  CARD_RADIUS,
15
15
  HAIRLINE_DASH,
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-5DH3KYFH.js";
9
9
  import {
10
10
  renderInlineText
11
- } from "./chunk-FWNJDD4U.js";
11
+ } from "./chunk-S7W75MIM.js";
12
12
  import {
13
13
  mix
14
14
  } from "./chunk-7HWY4QAJ.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-6EK55ART.js";
4
4
  import {
5
5
  noteBoxSize
6
- } from "./chunk-ZGHV4QLK.js";
6
+ } from "./chunk-RJNZHFNG.js";
7
7
 
8
8
  // src/utils/notes/build.ts
9
9
  function buildPlacedNotes(anchors, noteByNode, direction, collapsedNotes) {