orcasvn-react-diagrams 0.2.5 → 0.2.6

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 (53) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +15 -34
  3. package/ai/api-contract.json +38 -1
  4. package/ai/manifest.json +1 -1
  5. package/dist/cjs/examples.js +1252 -113
  6. package/dist/cjs/index.js +876 -81
  7. package/dist/cjs/types/api/createDiagramEditor.d.ts +2 -1
  8. package/dist/cjs/types/api/types.d.ts +26 -1
  9. package/dist/cjs/types/displaybox/demos/OffsetAnchorAvoidanceDemoTab.d.ts +3 -0
  10. package/dist/cjs/types/displaybox/demos/ZoomToFitElementsDemoTab.d.ts +3 -0
  11. package/dist/cjs/types/displaybox/demos/offsetAnchorAvoidanceDemo.d.ts +4 -0
  12. package/dist/cjs/types/displaybox/demos/textDemo.d.ts +3 -0
  13. package/dist/cjs/types/displaybox/demos/zoomToFitElementsDemo.d.ts +4 -0
  14. package/dist/cjs/types/engine/AutoLayoutService.d.ts +44 -1
  15. package/dist/cjs/types/engine/DiagramEngine.d.ts +12 -0
  16. package/dist/cjs/types/engine/LinkRoutingService.d.ts +1 -0
  17. package/dist/cjs/types/models/TextModel.d.ts +1 -0
  18. package/dist/cjs/types/renderer/konva/KonvaInteraction.d.ts +2 -0
  19. package/dist/esm/examples.js +1252 -113
  20. package/dist/esm/examples.js.map +1 -1
  21. package/dist/esm/index.js +876 -81
  22. package/dist/esm/index.js.map +1 -1
  23. package/dist/esm/types/api/createDiagramEditor.d.ts +2 -1
  24. package/dist/esm/types/api/types.d.ts +26 -1
  25. package/dist/esm/types/displaybox/demos/OffsetAnchorAvoidanceDemoTab.d.ts +3 -0
  26. package/dist/esm/types/displaybox/demos/ZoomToFitElementsDemoTab.d.ts +3 -0
  27. package/dist/esm/types/displaybox/demos/offsetAnchorAvoidanceDemo.d.ts +4 -0
  28. package/dist/esm/types/displaybox/demos/textDemo.d.ts +3 -0
  29. package/dist/esm/types/displaybox/demos/zoomToFitElementsDemo.d.ts +4 -0
  30. package/dist/esm/types/engine/AutoLayoutService.d.ts +44 -1
  31. package/dist/esm/types/engine/DiagramEngine.d.ts +12 -0
  32. package/dist/esm/types/engine/LinkRoutingService.d.ts +1 -0
  33. package/dist/esm/types/models/TextModel.d.ts +1 -0
  34. package/dist/esm/types/renderer/konva/KonvaInteraction.d.ts +2 -0
  35. package/dist/examples.d.ts +27 -1
  36. package/dist/index.d.ts +29 -2
  37. package/docs/API_CONTRACT.md +38 -3
  38. package/docs/CAPABILITIES.md +3 -0
  39. package/docs/COMMANDS_EVENTS.md +8 -0
  40. package/docs/DOCUMENTATION_WORKFLOW.md +2 -1
  41. package/docs/INTEGRATION_PLAYBOOK.md +3 -0
  42. package/docs/STATE_INVARIANTS.md +4 -0
  43. package/package.json +1 -1
  44. package/src/displaybox/demos/AutoLayoutDemoTab.tsx +337 -316
  45. package/src/displaybox/demos/EngineEventsDemoTab.tsx +12 -11
  46. package/src/displaybox/demos/OffsetAnchorAvoidanceDemoTab.tsx +30 -0
  47. package/src/displaybox/demos/TextLayoutDemoTab.tsx +18 -1
  48. package/src/displaybox/demos/ZoomToFitElementsDemoTab.tsx +29 -0
  49. package/src/displaybox/demos/autoLayoutDemo.ts +74 -73
  50. package/src/displaybox/demos/index.tsx +80 -64
  51. package/src/displaybox/demos/offsetAnchorAvoidanceDemo.ts +211 -0
  52. package/src/displaybox/demos/textDemo.ts +6 -2
  53. package/src/displaybox/demos/zoomToFitElementsDemo.ts +83 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.2.6] - 2026-05-14
6
+
7
+ ### Added
8
+ - Editor viewport helper `zoomToFitElements(options?)` with `padding`, `minZoom`, and `maxZoom` fit controls.
9
+ - Grid auto-layout opt-in child width topology editing through `layout.gridChildWidthResizeEnabled`.
10
+ - Dedicated `gridLayoutChanged` host event for resize-driven grid row split/redistribution changes.
11
+ - Per-text interaction policy via `TextData.interaction` with `movable` and `editable` controls for built-in text behavior.
12
+
13
+ ### Changed
14
+ - Grid auto-layout now keeps overflow rows on the established fallback model while deriving row occupancy from flat slot templates.
15
+ - Partial grid rows keep proportional occupied width when children are added, and direct child move/resize relayout now preserves parent width unless topology actually changes.
16
+ - Resize-handle interaction now applies bounds changes directly without routing through move semantics.
17
+ - Auto routing now preserves endpoint-host interior avoidance for offset attach anchors by treating projected border-equivalent endpoints like boundary endpoints.
18
+ - Built-in text drag and built-in double-click/tap editing now respect per-text interaction policy while leaving programmatic `moveTextTo(...)` and `updateText(...)` unchanged.
19
+
20
+ ### Fixed
21
+ - Prevented dramatic grid parent width growth when adding children into partially occupied derived rows.
22
+ - Prevented resize gestures that update top-left position from emitting move-specific behavior/events.
23
+
24
+ ### Docs
25
+ - Updated `README.md` release highlights for `v0.2.6`.
26
+ - Updated public API and machine-readable contract docs for `zoomToFitElements`, `ViewportFitOptions`, grid child width resize policy, `gridLayoutChanged`, and per-text interaction policy.
27
+
5
28
  ## [0.2.5] - 2026-05-10
6
29
 
7
30
  ### Added
package/README.md CHANGED
@@ -30,40 +30,21 @@ editor.addElement({
30
30
  });
31
31
  ```
32
32
 
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
50
- - Shape system upgrade:
51
- - class-based built-in shape behaviors
52
- - runtime removal of `boundaryKind` branching
53
- - additive rotation (`baseRotation` + instance rotation style)
54
- - Port movement enhancements:
55
- - shape-aware border projection
56
- - optional anchor-constrained movement (`portMovement.moveMode = 'anchors'`)
57
- - orientation support with host-border normals and resize reprojection
58
- - Shape hover controls:
59
- - generic control definitions with `targetKind` (`edge`, `vertex`, `midpoint`, `ellipse-midpoint`)
60
- - trigger modes (`element-hover`, `target-hover`)
61
- - interaction callbacks for click and drag lifecycle
62
- - Text layout improvements:
63
- - owner/fixed bounds modes, wrap and overflow controls, and layout padding
64
- - `textUpdated` lifecycle event with rendered display content
65
- - Additional lifecycle events:
66
- - `portDeleted`, `linkDeleted`, `textDeleted`
33
+ ## Release Highlights (v0.2.6)
34
+
35
+ - Includes all completed `v0.2.1` through `v0.2.5` work, plus `v0.2.6` updates.
36
+ - `v0.2.6` viewport update:
37
+ - new `editor.zoomToFitElements(options?)` helper for centered fit-to-elements navigation
38
+ - additive `ViewportFitOptions` with `padding`, `minZoom`, and `maxZoom`
39
+ - `v0.2.6` grid auto-layout updates:
40
+ - opt-in grid child width topology editing via `layout.gridChildWidthResizeEnabled`
41
+ - dedicated `gridLayoutChanged` event for resize-driven row split/redistribution
42
+ - proportional partial-row parent sizing on child add, with stable parent width on child move/resize relayout
43
+ - `v0.2.6` routing update:
44
+ - offset external/internal attach anchors now preserve endpoint-host interior avoidance through projected boundary metadata
45
+ - `v0.2.6` interaction update:
46
+ - resize handle drags no longer route through move semantics before resize is applied
47
+ - per-text interaction policy can suppress built-in drag and/or built-in editing with `TextData.interaction`
67
48
 
68
49
  ## API Docs
69
50
 
@@ -107,6 +107,11 @@
107
107
  "moveMode",
108
108
  "anchorCenter",
109
109
  "orientToHostBorder",
110
+ "placementPoint",
111
+ "linkAttachPoint",
112
+ "externalLinkAttachPoint",
113
+ "internalLinkAttachPoint",
114
+ "rotationPivot",
110
115
  "currentAnchorId"
111
116
  ],
112
117
  "defaults": {
@@ -143,6 +148,7 @@
143
148
  "style",
144
149
  "ownerId",
145
150
  "layout",
151
+ "interaction",
146
152
  "displayContent",
147
153
  "displayOffset",
148
154
  "displayClipSize"
@@ -164,6 +170,7 @@
164
170
  "align",
165
171
  "autoResize",
166
172
  "gridTemplate",
173
+ "gridChildWidthResizeEnabled",
167
174
  "childFitMainAxis",
168
175
  "childFitCrossAxis",
169
176
  "childMinWidth",
@@ -179,7 +186,8 @@
179
186
  "additionalContracts": {
180
187
  "portMovementPolicy": {
181
188
  "moveMode": "'free' | 'inside' | 'border' | 'anchors'",
182
- "anchorConstraint": "PortAnchorConstraint"
189
+ "anchorConstraint": "PortAnchorConstraint",
190
+ "positionLimits": "PortPositionLimits"
183
191
  },
184
192
  "portAnchorConstraint": {
185
193
  "preset": "'vertices' | 'cardinal'",
@@ -193,6 +201,14 @@
193
201
  "maxLines": "number",
194
202
  "fixedSize": "Size"
195
203
  },
204
+ "textInteractionPolicy": {
205
+ "movable": "boolean",
206
+ "editable": "boolean",
207
+ "defaults": {
208
+ "movable": true,
209
+ "editable": true
210
+ }
211
+ },
196
212
  "shapeHoverControls": {
197
213
  "targetKinds": [
198
214
  "vertex",
@@ -220,6 +236,25 @@
220
236
  "colors": "string[]",
221
237
  "defaultPoolSize": 20
222
238
  },
239
+ "viewportFitOptions": {
240
+ "padding": "number",
241
+ "minZoom": "number",
242
+ "maxZoom": "number",
243
+ "defaults": {
244
+ "padding": 24,
245
+ "minZoom": 0.2,
246
+ "maxZoom": 3
247
+ }
248
+ },
249
+ "gridLayoutChangedEvent": {
250
+ "parentId": "string",
251
+ "triggerChildId": "string",
252
+ "reason": "'child-resize-split' | 'child-resize-redistribute'",
253
+ "beforeRows": "{ childIds: string[] }[]",
254
+ "afterRows": "{ childIds: string[] }[]",
255
+ "beforeGridTemplate": "number[]",
256
+ "afterGridTemplate": "number[]"
257
+ },
223
258
  "diagramImageExportOptions": {
224
259
  "mimeType": "string",
225
260
  "quality": "number",
@@ -270,6 +305,7 @@
270
305
  "completeLinkToPort",
271
306
  "completeLinkToElement",
272
307
  "cancelLink",
308
+ "zoomToFitElements",
273
309
  "exportImage",
274
310
  "resize",
275
311
  "setElementShapeHoverControls",
@@ -291,6 +327,7 @@
291
327
  "elementDragged": "ElementDropEvent",
292
328
  "elementMoved": "ElementMovedEvent",
293
329
  "elementResized": "ElementResizedEvent",
330
+ "gridLayoutChanged": "GridLayoutChangedEvent",
294
331
  "elementDeleted": "ElementDeletedEvent",
295
332
  "portDeleted": "PortDeletedEvent",
296
333
  "linkDeleted": "LinkDeletedEvent",
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-05-10"
33
+ "updatedAt": "2026-05-14"
34
34
  }