orcasvn-react-diagrams 0.2.4 → 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.
- package/CHANGELOG.md +42 -4
- package/README.md +15 -32
- package/ai/api-contract.json +88 -3
- package/ai/manifest.json +1 -1
- package/dist/cjs/examples.js +6519 -4423
- package/dist/cjs/index.js +1513 -120
- package/dist/cjs/types/api/createDiagramEditor.d.ts +4 -1
- package/dist/cjs/types/api/types.d.ts +43 -1
- package/dist/cjs/types/displaybox/demos/LinkColorPoolDemoTab.d.ts +3 -0
- package/dist/cjs/types/displaybox/demos/OffsetAnchorAvoidanceDemoTab.d.ts +3 -0
- package/dist/cjs/types/displaybox/demos/SimpleDemo.d.ts +4 -1
- package/dist/cjs/types/displaybox/demos/ZoomToFitElementsDemoTab.d.ts +3 -0
- package/dist/cjs/types/displaybox/demos/linkColorPoolDemo.d.ts +2 -0
- package/dist/cjs/types/displaybox/demos/offsetAnchorAvoidanceDemo.d.ts +4 -0
- package/dist/cjs/types/displaybox/demos/textDemo.d.ts +3 -0
- package/dist/cjs/types/displaybox/demos/zoomToFitElementsDemo.d.ts +4 -0
- package/dist/cjs/types/displaybox/types.d.ts +3 -1
- package/dist/cjs/types/displaybox/useDemoEditor.d.ts +4 -2
- package/dist/cjs/types/engine/AutoLayoutService.d.ts +59 -2
- package/dist/cjs/types/engine/DiagramEngine.d.ts +20 -1
- package/dist/cjs/types/engine/LinkRoutingService.d.ts +9 -0
- package/dist/cjs/types/models/TextModel.d.ts +1 -0
- package/dist/cjs/types/renderer/konva/KonvaInteraction.d.ts +6 -0
- package/dist/cjs/types/strategies/ObstacleRouter.d.ts +2 -0
- package/dist/cjs/types/strategies/RouterStrategy.d.ts +10 -0
- package/dist/esm/examples.js +6519 -4423
- package/dist/esm/examples.js.map +1 -1
- package/dist/esm/index.js +1513 -120
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api/createDiagramEditor.d.ts +4 -1
- package/dist/esm/types/api/types.d.ts +43 -1
- package/dist/esm/types/displaybox/demos/LinkColorPoolDemoTab.d.ts +3 -0
- package/dist/esm/types/displaybox/demos/OffsetAnchorAvoidanceDemoTab.d.ts +3 -0
- package/dist/esm/types/displaybox/demos/SimpleDemo.d.ts +4 -1
- package/dist/esm/types/displaybox/demos/ZoomToFitElementsDemoTab.d.ts +3 -0
- package/dist/esm/types/displaybox/demos/linkColorPoolDemo.d.ts +2 -0
- package/dist/esm/types/displaybox/demos/offsetAnchorAvoidanceDemo.d.ts +4 -0
- package/dist/esm/types/displaybox/demos/textDemo.d.ts +3 -0
- package/dist/esm/types/displaybox/demos/zoomToFitElementsDemo.d.ts +4 -0
- package/dist/esm/types/displaybox/types.d.ts +3 -1
- package/dist/esm/types/displaybox/useDemoEditor.d.ts +4 -2
- package/dist/esm/types/engine/AutoLayoutService.d.ts +59 -2
- package/dist/esm/types/engine/DiagramEngine.d.ts +20 -1
- package/dist/esm/types/engine/LinkRoutingService.d.ts +9 -0
- package/dist/esm/types/models/TextModel.d.ts +1 -0
- package/dist/esm/types/renderer/konva/KonvaInteraction.d.ts +6 -0
- package/dist/esm/types/strategies/ObstacleRouter.d.ts +2 -0
- package/dist/esm/types/strategies/RouterStrategy.d.ts +10 -0
- package/dist/examples.d.ts +56 -1
- package/dist/index.d.ts +60 -2
- package/docs/API_CONTRACT.md +73 -3
- package/docs/CAPABILITIES.md +8 -0
- package/docs/COMMANDS_EVENTS.md +8 -0
- package/docs/DOCUMENTATION_WORKFLOW.md +4 -1
- package/docs/INTEGRATION_PLAYBOOK.md +3 -0
- package/docs/STATE_INVARIANTS.md +4 -0
- package/package.json +1 -1
- package/src/displaybox/demos/AutoLayoutDemoTab.tsx +515 -381
- package/src/displaybox/demos/EngineEventsDemoTab.tsx +12 -11
- package/src/displaybox/demos/LinkColorPoolDemoTab.tsx +49 -0
- package/src/displaybox/demos/ObstacleRoutingDemoTab.tsx +52 -31
- package/src/displaybox/demos/OffsetAnchorAvoidanceDemoTab.tsx +30 -0
- package/src/displaybox/demos/SimpleDemo.tsx +18 -13
- package/src/displaybox/demos/TextLayoutDemoTab.tsx +18 -1
- package/src/displaybox/demos/ZoomToFitElementsDemoTab.tsx +29 -0
- package/src/displaybox/demos/autoLayoutDemo.ts +62 -26
- package/src/displaybox/demos/index.tsx +81 -57
- package/src/displaybox/demos/linkColorPoolDemo.ts +122 -0
- package/src/displaybox/demos/obstacleRoutingDemo.ts +77 -1
- package/src/displaybox/demos/offsetAnchorAvoidanceDemo.ts +211 -0
- package/src/displaybox/demos/routingDemo.ts +5 -5
- package/src/displaybox/demos/shared.ts +17 -12
- package/src/displaybox/demos/textDemo.ts +6 -2
- package/src/displaybox/demos/zoomToFitElementsDemo.ts +83 -0
- package/src/displaybox/types.ts +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,52 @@
|
|
|
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
|
+
|
|
28
|
+
## [0.2.5] - 2026-05-10
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- Auto-layout `grid` mode with template rows/columns (`gridTemplate`) and weighted track sizing support.
|
|
32
|
+
- Auto-layout parent resize policy (`autoResize`) with `grow` and `grow-shrink` modes.
|
|
33
|
+
- Explicit auto-layout child size aliases (`childMinWidth`, `childMaxWidth`, `childMinHeight`, `childMaxHeight`).
|
|
34
|
+
- Grid auto-layout child resize behavior that locks horizontal child resizing while preserving vertical child resizing and parent resize responsiveness.
|
|
35
|
+
- Direct resize handling for non-manual layout parents that preserves explicit resized parent bounds for the resize cycle before child reflow.
|
|
36
|
+
- Optional redraw-time link route refresh policy (`linkRouteRefreshPolicy`) for two-endpoint-change checks.
|
|
37
|
+
- Cross-parent first common-ancestor corridor preference for auto-routed links across parent branches.
|
|
38
|
+
- Optional random link color assignment policy (`linkColorPoolPolicy`) with built-in default 20-color pool.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
- Stabilized `element-hover` nested hover-control ownership near child boundaries to prevent child/parent control flicker.
|
|
42
|
+
|
|
43
|
+
### Docs
|
|
44
|
+
- Updated `README.md` release highlights for `v0.2.5`.
|
|
45
|
+
- Updated public API and machine-readable contract docs for new `v0.2.5` config and layout options.
|
|
46
|
+
|
|
5
47
|
## [0.2.4] - 2026-05-06
|
|
6
48
|
|
|
7
49
|
### Added
|
|
8
50
|
- Directional parent-child attach mode support for hierarchy-aware linking flows.
|
|
9
|
-
- Port position-limit normalization coverage in DisplayBox demos for add/load/move entry points.
|
|
10
51
|
|
|
11
52
|
### Changed
|
|
12
53
|
- Unified child-port movement restrictions across all engine entry points (move, add, load, link-session creation, resize reprojection).
|
|
@@ -30,7 +71,6 @@ All notable changes to this project are documented in this file.
|
|
|
30
71
|
|
|
31
72
|
### Changed
|
|
32
73
|
- Asymmetric SVG-path multi-anchor transform/orientation behavior for deterministic border-side placement.
|
|
33
|
-
- DisplayBox demo coverage consolidated for auto-layout and vertex-control scenarios.
|
|
34
74
|
- Vertex-control session logs in demo flows improved for collapse/scroll stability.
|
|
35
75
|
|
|
36
76
|
### Fixed
|
|
@@ -50,7 +90,6 @@ All notable changes to this project are documented in this file.
|
|
|
50
90
|
- Discrete port anchor constraints with anchor-based movement support.
|
|
51
91
|
- Shape hover controls for edge and vertex targets with configurable trigger modes.
|
|
52
92
|
- Ellipse midpoint control enumeration support.
|
|
53
|
-
- DisplayBox demos for discrete anchors, hover controls, and ellipse midpoints.
|
|
54
93
|
|
|
55
94
|
### Changed
|
|
56
95
|
- Refactored built-in shape behavior to class-based implementations.
|
|
@@ -66,4 +105,3 @@ All notable changes to this project are documented in this file.
|
|
|
66
105
|
- Improved shape-aware endpoint edge detection for link routing.
|
|
67
106
|
|
|
68
107
|
### Docs
|
|
69
|
-
- Refreshed DisplayBox verification coverage for shape class and rotation behavior.
|
package/README.md
CHANGED
|
@@ -30,38 +30,21 @@ editor.addElement({
|
|
|
30
30
|
});
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
## Release Highlights (v0.2.
|
|
34
|
-
|
|
35
|
-
- Includes all completed `v0.2.1
|
|
36
|
-
- `v0.2.
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
- Shape system upgrade:
|
|
49
|
-
- class-based built-in shape behaviors
|
|
50
|
-
- runtime removal of `boundaryKind` branching
|
|
51
|
-
- additive rotation (`baseRotation` + instance rotation style)
|
|
52
|
-
- Port movement enhancements:
|
|
53
|
-
- shape-aware border projection
|
|
54
|
-
- optional anchor-constrained movement (`portMovement.moveMode = 'anchors'`)
|
|
55
|
-
- orientation support with host-border normals and resize reprojection
|
|
56
|
-
- Shape hover controls:
|
|
57
|
-
- generic control definitions with `targetKind` (`edge`, `vertex`, `midpoint`, `ellipse-midpoint`)
|
|
58
|
-
- trigger modes (`element-hover`, `target-hover`)
|
|
59
|
-
- interaction callbacks for click and drag lifecycle
|
|
60
|
-
- Text layout improvements:
|
|
61
|
-
- owner/fixed bounds modes, wrap and overflow controls, and layout padding
|
|
62
|
-
- `textUpdated` lifecycle event with rendered display content
|
|
63
|
-
- Additional lifecycle events:
|
|
64
|
-
- `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`
|
|
65
48
|
|
|
66
49
|
## API Docs
|
|
67
50
|
|
package/ai/api-contract.json
CHANGED
|
@@ -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",
|
|
@@ -103,6 +107,11 @@
|
|
|
103
107
|
"moveMode",
|
|
104
108
|
"anchorCenter",
|
|
105
109
|
"orientToHostBorder",
|
|
110
|
+
"placementPoint",
|
|
111
|
+
"linkAttachPoint",
|
|
112
|
+
"externalLinkAttachPoint",
|
|
113
|
+
"internalLinkAttachPoint",
|
|
114
|
+
"rotationPivot",
|
|
106
115
|
"currentAnchorId"
|
|
107
116
|
],
|
|
108
117
|
"defaults": {
|
|
@@ -139,6 +148,7 @@
|
|
|
139
148
|
"style",
|
|
140
149
|
"ownerId",
|
|
141
150
|
"layout",
|
|
151
|
+
"interaction",
|
|
142
152
|
"displayContent",
|
|
143
153
|
"displayOffset",
|
|
144
154
|
"displayClipSize"
|
|
@@ -151,12 +161,33 @@
|
|
|
151
161
|
"padding": 12,
|
|
152
162
|
"gap": 12,
|
|
153
163
|
"align": "center"
|
|
164
|
+
},
|
|
165
|
+
"elementLayout": {
|
|
166
|
+
"mode": "'manual' | 'horizontal' | 'vertical' | 'grid'",
|
|
167
|
+
"optional": [
|
|
168
|
+
"padding",
|
|
169
|
+
"gap",
|
|
170
|
+
"align",
|
|
171
|
+
"autoResize",
|
|
172
|
+
"gridTemplate",
|
|
173
|
+
"gridChildWidthResizeEnabled",
|
|
174
|
+
"childFitMainAxis",
|
|
175
|
+
"childFitCrossAxis",
|
|
176
|
+
"childMinWidth",
|
|
177
|
+
"childMaxWidth",
|
|
178
|
+
"childMinHeight",
|
|
179
|
+
"childMaxHeight",
|
|
180
|
+
"childFitMinSize",
|
|
181
|
+
"childFitMaxSize",
|
|
182
|
+
"labelReservedSpace"
|
|
183
|
+
]
|
|
154
184
|
}
|
|
155
185
|
},
|
|
156
186
|
"additionalContracts": {
|
|
157
187
|
"portMovementPolicy": {
|
|
158
188
|
"moveMode": "'free' | 'inside' | 'border' | 'anchors'",
|
|
159
|
-
"anchorConstraint": "PortAnchorConstraint"
|
|
189
|
+
"anchorConstraint": "PortAnchorConstraint",
|
|
190
|
+
"positionLimits": "PortPositionLimits"
|
|
160
191
|
},
|
|
161
192
|
"portAnchorConstraint": {
|
|
162
193
|
"preset": "'vertices' | 'cardinal'",
|
|
@@ -170,6 +201,14 @@
|
|
|
170
201
|
"maxLines": "number",
|
|
171
202
|
"fixedSize": "Size"
|
|
172
203
|
},
|
|
204
|
+
"textInteractionPolicy": {
|
|
205
|
+
"movable": "boolean",
|
|
206
|
+
"editable": "boolean",
|
|
207
|
+
"defaults": {
|
|
208
|
+
"movable": true,
|
|
209
|
+
"editable": true
|
|
210
|
+
}
|
|
211
|
+
},
|
|
173
212
|
"shapeHoverControls": {
|
|
174
213
|
"targetKinds": [
|
|
175
214
|
"vertex",
|
|
@@ -187,6 +226,44 @@
|
|
|
187
226
|
"drag-move",
|
|
188
227
|
"drag-end"
|
|
189
228
|
]
|
|
229
|
+
},
|
|
230
|
+
"linkRouteRefreshPolicy": {
|
|
231
|
+
"mode": "'mutation-only' | 'redraw-two-endpoint-change'",
|
|
232
|
+
"includeManual": "boolean"
|
|
233
|
+
},
|
|
234
|
+
"linkColorPoolPolicy": {
|
|
235
|
+
"enabled": "boolean",
|
|
236
|
+
"colors": "string[]",
|
|
237
|
+
"defaultPoolSize": 20
|
|
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
|
+
},
|
|
258
|
+
"diagramImageExportOptions": {
|
|
259
|
+
"mimeType": "string",
|
|
260
|
+
"quality": "number",
|
|
261
|
+
"pixelRatio": "number",
|
|
262
|
+
"x": "number",
|
|
263
|
+
"y": "number",
|
|
264
|
+
"width": "number",
|
|
265
|
+
"height": "number",
|
|
266
|
+
"fitToContent": "boolean | { padding?: number }"
|
|
190
267
|
}
|
|
191
268
|
},
|
|
192
269
|
"handleMethods": {
|
|
@@ -223,6 +300,13 @@
|
|
|
223
300
|
"render"
|
|
224
301
|
],
|
|
225
302
|
"editorOnly": [
|
|
303
|
+
"startLinkFromPort",
|
|
304
|
+
"updateLinkPreview",
|
|
305
|
+
"completeLinkToPort",
|
|
306
|
+
"completeLinkToElement",
|
|
307
|
+
"cancelLink",
|
|
308
|
+
"zoomToFitElements",
|
|
309
|
+
"exportImage",
|
|
226
310
|
"resize",
|
|
227
311
|
"setElementShapeHoverControls",
|
|
228
312
|
"destroy"
|
|
@@ -243,6 +327,7 @@
|
|
|
243
327
|
"elementDragged": "ElementDropEvent",
|
|
244
328
|
"elementMoved": "ElementMovedEvent",
|
|
245
329
|
"elementResized": "ElementResizedEvent",
|
|
330
|
+
"gridLayoutChanged": "GridLayoutChangedEvent",
|
|
246
331
|
"elementDeleted": "ElementDeletedEvent",
|
|
247
332
|
"portDeleted": "PortDeletedEvent",
|
|
248
333
|
"linkDeleted": "LinkDeletedEvent",
|
package/ai/manifest.json
CHANGED