orcasvn-react-diagrams 0.2.3 → 0.2.5

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 (63) hide show
  1. package/CHANGELOG.md +36 -3
  2. package/README.md +17 -11
  3. package/ai/api-contract.json +50 -2
  4. package/ai/manifest.json +1 -1
  5. package/dist/cjs/examples.js +4133 -2458
  6. package/dist/cjs/index.js +1111 -146
  7. package/dist/cjs/types/api/createDiagramEditor.d.ts +3 -1
  8. package/dist/cjs/types/api/types.d.ts +27 -1
  9. package/dist/cjs/types/displaybox/demos/LinkColorPoolDemoTab.d.ts +3 -0
  10. package/dist/cjs/types/displaybox/demos/SimpleDemo.d.ts +4 -1
  11. package/dist/cjs/types/displaybox/demos/labelStyleDemo.d.ts +2 -0
  12. package/dist/cjs/types/displaybox/demos/linkColorPoolDemo.d.ts +2 -0
  13. package/dist/cjs/types/displaybox/demos/portPositionLimitsDemo.d.ts +2 -0
  14. package/dist/cjs/types/displaybox/types.d.ts +3 -1
  15. package/dist/cjs/types/displaybox/useDemoEditor.d.ts +4 -2
  16. package/dist/cjs/types/engine/AutoLayoutService.d.ts +15 -1
  17. package/dist/cjs/types/engine/DiagramEngine.d.ts +14 -1
  18. package/dist/cjs/types/engine/LinkRoutingService.d.ts +9 -1
  19. package/dist/cjs/types/renderer/konva/KonvaInteraction.d.ts +4 -0
  20. package/dist/cjs/types/renderer/konva/KonvaNodeFactory.d.ts +11 -0
  21. package/dist/cjs/types/renderer/konva/KonvaRenderer.d.ts +2 -0
  22. package/dist/cjs/types/strategies/ObstacleRouter.d.ts +4 -0
  23. package/dist/cjs/types/strategies/RouterStrategy.d.ts +10 -0
  24. package/dist/esm/examples.js +4133 -2458
  25. package/dist/esm/examples.js.map +1 -1
  26. package/dist/esm/index.js +1111 -146
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/types/api/createDiagramEditor.d.ts +3 -1
  29. package/dist/esm/types/api/types.d.ts +27 -1
  30. package/dist/esm/types/displaybox/demos/LinkColorPoolDemoTab.d.ts +3 -0
  31. package/dist/esm/types/displaybox/demos/SimpleDemo.d.ts +4 -1
  32. package/dist/esm/types/displaybox/demos/labelStyleDemo.d.ts +2 -0
  33. package/dist/esm/types/displaybox/demos/linkColorPoolDemo.d.ts +2 -0
  34. package/dist/esm/types/displaybox/demos/portPositionLimitsDemo.d.ts +2 -0
  35. package/dist/esm/types/displaybox/types.d.ts +3 -1
  36. package/dist/esm/types/displaybox/useDemoEditor.d.ts +4 -2
  37. package/dist/esm/types/engine/AutoLayoutService.d.ts +15 -1
  38. package/dist/esm/types/engine/DiagramEngine.d.ts +14 -1
  39. package/dist/esm/types/engine/LinkRoutingService.d.ts +9 -1
  40. package/dist/esm/types/renderer/konva/KonvaInteraction.d.ts +4 -0
  41. package/dist/esm/types/renderer/konva/KonvaNodeFactory.d.ts +11 -0
  42. package/dist/esm/types/renderer/konva/KonvaRenderer.d.ts +2 -0
  43. package/dist/esm/types/strategies/ObstacleRouter.d.ts +4 -0
  44. package/dist/esm/types/strategies/RouterStrategy.d.ts +10 -0
  45. package/dist/examples.d.ts +39 -1
  46. package/dist/index.d.ts +42 -2
  47. package/docs/API_CONTRACT.md +36 -1
  48. package/docs/CAPABILITIES.md +5 -0
  49. package/docs/DOCUMENTATION_WORKFLOW.md +3 -1
  50. package/package.json +11 -11
  51. package/src/displaybox/demos/AutoLayoutDemoTab.tsx +196 -83
  52. package/src/displaybox/demos/LinkColorPoolDemoTab.tsx +49 -0
  53. package/src/displaybox/demos/ObstacleRoutingDemoTab.tsx +52 -30
  54. package/src/displaybox/demos/SimpleDemo.tsx +18 -13
  55. package/src/displaybox/demos/autoLayoutDemo.ts +48 -13
  56. package/src/displaybox/demos/index.tsx +37 -15
  57. package/src/displaybox/demos/labelStyleDemo.ts +101 -0
  58. package/src/displaybox/demos/linkColorPoolDemo.ts +122 -0
  59. package/src/displaybox/demos/obstacleRoutingDemo.ts +288 -176
  60. package/src/displaybox/demos/portPositionLimitsDemo.ts +211 -0
  61. package/src/displaybox/demos/routingDemo.ts +5 -5
  62. package/src/displaybox/demos/shared.ts +17 -12
  63. package/src/displaybox/types.ts +10 -8
package/CHANGELOG.md CHANGED
@@ -2,6 +2,42 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.2.5] - 2026-05-10
6
+
7
+ ### Added
8
+ - Auto-layout `grid` mode with template rows/columns (`gridTemplate`) and weighted track sizing support.
9
+ - Auto-layout parent resize policy (`autoResize`) with `grow` and `grow-shrink` modes.
10
+ - Explicit auto-layout child size aliases (`childMinWidth`, `childMaxWidth`, `childMinHeight`, `childMaxHeight`).
11
+ - Grid auto-layout child resize behavior that locks horizontal child resizing while preserving vertical child resizing and parent resize responsiveness.
12
+ - Direct resize handling for non-manual layout parents that preserves explicit resized parent bounds for the resize cycle before child reflow.
13
+ - Optional redraw-time link route refresh policy (`linkRouteRefreshPolicy`) for two-endpoint-change checks.
14
+ - Cross-parent first common-ancestor corridor preference for auto-routed links across parent branches.
15
+ - Optional random link color assignment policy (`linkColorPoolPolicy`) with built-in default 20-color pool.
16
+
17
+ ### Fixed
18
+ - Stabilized `element-hover` nested hover-control ownership near child boundaries to prevent child/parent control flicker.
19
+
20
+ ### Docs
21
+ - Updated `README.md` release highlights for `v0.2.5`.
22
+ - Updated public API and machine-readable contract docs for new `v0.2.5` config and layout options.
23
+
24
+ ## [0.2.4] - 2026-05-06
25
+
26
+ ### Added
27
+ - Directional parent-child attach mode support for hierarchy-aware linking flows.
28
+
29
+ ### Changed
30
+ - Unified child-port movement restrictions across all engine entry points (move, add, load, link-session creation, resize reprojection).
31
+ - Border-host port constraints now resolve deterministically when combined with `positionLimits`, while preserving border placement invariants.
32
+ - Routing stub behavior for sibling external links and parent-child links updated for consistent obstacle routing outcomes.
33
+
34
+ ### Fixed
35
+ - Manual link points now translate correctly when moving an element subtree.
36
+ - Multi-anchor nested routing demo behavior corrected for stable path previews.
37
+
38
+ ### Docs
39
+ - Updated release highlights in `README.md` for `v0.2.4`.
40
+
5
41
  ## [0.2.3] - 2026-05-03
6
42
 
7
43
  ### Added
@@ -12,7 +48,6 @@ All notable changes to this project are documented in this file.
12
48
 
13
49
  ### Changed
14
50
  - Asymmetric SVG-path multi-anchor transform/orientation behavior for deterministic border-side placement.
15
- - DisplayBox demo coverage consolidated for auto-layout and vertex-control scenarios.
16
51
  - Vertex-control session logs in demo flows improved for collapse/scroll stability.
17
52
 
18
53
  ### Fixed
@@ -32,7 +67,6 @@ All notable changes to this project are documented in this file.
32
67
  - Discrete port anchor constraints with anchor-based movement support.
33
68
  - Shape hover controls for edge and vertex targets with configurable trigger modes.
34
69
  - Ellipse midpoint control enumeration support.
35
- - DisplayBox demos for discrete anchors, hover controls, and ellipse midpoints.
36
70
 
37
71
  ### Changed
38
72
  - Refactored built-in shape behavior to class-based implementations.
@@ -48,4 +82,3 @@ All notable changes to this project are documented in this file.
48
82
  - Improved shape-aware endpoint edge detection for link routing.
49
83
 
50
84
  ### Docs
51
- - Refreshed DisplayBox verification coverage for shape class and rotation behavior.
package/README.md CHANGED
@@ -30,17 +30,23 @@ editor.addElement({
30
30
  });
31
31
  ```
32
32
 
33
- ## Release Highlights (v0.2.3)
34
-
35
- - Includes all completed `v0.2.1` and `v0.2.2` work, plus `v0.2.3` updates.
36
- - `v0.2.3` interaction and stability updates:
37
- - restored port-selection priority over vertex controls
38
- - suppressed occupied-vertex controls where ports already own the anchor
39
- - hardened invalid vertex-control link-drop cancellation to prevent re-entrant stack overflow
40
- - `v0.2.3` demo and behavior updates:
41
- - asymmetric multi-anchor demo now aligns initial external link endpoints deterministically
42
- - added multiple asymmetric SVG glyph variants for multi-anchor comparison
43
- - consolidated auto-layout demo coverage with label-visibility fixes
33
+ ## Release Highlights (v0.2.5)
34
+
35
+ - Includes all completed `v0.2.1` through `v0.2.4` work, plus `v0.2.5` updates.
36
+ - `v0.2.5` auto-layout updates:
37
+ - new `grid` mode with template rows/columns and weighted track layouts
38
+ - parent `autoResize` policy (`grow` and `grow-shrink`)
39
+ - explicit child size aliases (`childMinWidth`, `childMaxWidth`, `childMinHeight`, `childMaxHeight`)
40
+ - grid-child horizontal resize lock while preserving vertical resize and parent resize responsiveness
41
+ - `v0.2.5` routing updates:
42
+ - cross-parent links now prefer first common-ancestor corridor travel
43
+ - optional redraw-time reroute checks when both link endpoints changed (`linkRouteRefreshPolicy`)
44
+ - `v0.2.5` styling update:
45
+ - optional random link stroke assignment from configurable color pools (`linkColorPoolPolicy`)
46
+ - `v0.2.5` interaction update:
47
+ - stabilized nested `element-hover` controls near child boundaries to reduce child/parent flicker
48
+ - `v0.2.5` demo coverage updates:
49
+ - expanded DisplayBox scenarios for grid auto-layout behaviors, corridor routing, redraw policy, and color-pool link creation
44
50
  - Shape system upgrade:
45
51
  - class-based built-in shape behaviors
46
52
  - runtime removal of `boundaryKind` branching
@@ -29,7 +29,9 @@
29
29
  "onElementShapeHoverControlInteraction": "(event: ElementShapeHoverControlInteractionEvent) => void",
30
30
  "onElementShapeHoverControlActivated": "(event: ElementShapeHoverControlActivationEvent) => void",
31
31
  "onChange": "(event: EngineChangeEvent) => void",
32
- "onSelection": "(event: EngineSelectionEvent) => void"
32
+ "onSelection": "(event: EngineSelectionEvent) => void",
33
+ "linkRouteRefreshPolicy": "LinkRouteRefreshPolicy",
34
+ "linkColorPoolPolicy": "LinkColorPoolPolicy"
33
35
  },
34
36
  "defaults": {
35
37
  "width": 900,
@@ -46,7 +48,9 @@
46
48
  "router": "RouterStrategy",
47
49
  "snapper": "SnapStrategy",
48
50
  "shapeRegistry": "ShapeRegistry",
49
- "textMeasurer": "TextMeasurer"
51
+ "textMeasurer": "TextMeasurer",
52
+ "linkRouteRefreshPolicy": "LinkRouteRefreshPolicy",
53
+ "linkColorPoolPolicy": "LinkColorPoolPolicy"
50
54
  },
51
55
  "defaults": {
52
56
  "scheduler": "RenderScheduler",
@@ -151,6 +155,25 @@
151
155
  "padding": 12,
152
156
  "gap": 12,
153
157
  "align": "center"
158
+ },
159
+ "elementLayout": {
160
+ "mode": "'manual' | 'horizontal' | 'vertical' | 'grid'",
161
+ "optional": [
162
+ "padding",
163
+ "gap",
164
+ "align",
165
+ "autoResize",
166
+ "gridTemplate",
167
+ "childFitMainAxis",
168
+ "childFitCrossAxis",
169
+ "childMinWidth",
170
+ "childMaxWidth",
171
+ "childMinHeight",
172
+ "childMaxHeight",
173
+ "childFitMinSize",
174
+ "childFitMaxSize",
175
+ "labelReservedSpace"
176
+ ]
154
177
  }
155
178
  },
156
179
  "additionalContracts": {
@@ -187,6 +210,25 @@
187
210
  "drag-move",
188
211
  "drag-end"
189
212
  ]
213
+ },
214
+ "linkRouteRefreshPolicy": {
215
+ "mode": "'mutation-only' | 'redraw-two-endpoint-change'",
216
+ "includeManual": "boolean"
217
+ },
218
+ "linkColorPoolPolicy": {
219
+ "enabled": "boolean",
220
+ "colors": "string[]",
221
+ "defaultPoolSize": 20
222
+ },
223
+ "diagramImageExportOptions": {
224
+ "mimeType": "string",
225
+ "quality": "number",
226
+ "pixelRatio": "number",
227
+ "x": "number",
228
+ "y": "number",
229
+ "width": "number",
230
+ "height": "number",
231
+ "fitToContent": "boolean | { padding?: number }"
190
232
  }
191
233
  },
192
234
  "handleMethods": {
@@ -223,6 +265,12 @@
223
265
  "render"
224
266
  ],
225
267
  "editorOnly": [
268
+ "startLinkFromPort",
269
+ "updateLinkPreview",
270
+ "completeLinkToPort",
271
+ "completeLinkToElement",
272
+ "cancelLink",
273
+ "exportImage",
226
274
  "resize",
227
275
  "setElementShapeHoverControls",
228
276
  "destroy"
package/ai/manifest.json CHANGED
@@ -30,5 +30,5 @@
30
30
  "analysis/White paper/Overview.md",
31
31
  "analysis/White paper/Requirements-Functional.md"
32
32
  ],
33
- "updatedAt": "2026-04-25"
33
+ "updatedAt": "2026-05-10"
34
34
  }