orcasvn-react-diagrams 0.2.5 → 0.2.7
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 +41 -0
- package/README.md +12 -34
- package/ai/api-contract.json +45 -1
- package/ai/manifest.json +1 -1
- package/dist/cjs/examples.js +1724 -321
- package/dist/cjs/index.js +929 -108
- package/dist/cjs/types/api/createDiagramEditor.d.ts +2 -1
- package/dist/cjs/types/api/types.d.ts +30 -1
- package/dist/cjs/types/displaybox/demos/OffsetAnchorAvoidanceDemoTab.d.ts +3 -0
- package/dist/cjs/types/displaybox/demos/ZoomToFitElementsDemoTab.d.ts +3 -0
- package/dist/cjs/types/displaybox/demos/autoLayoutDemo.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/engine/AutoLayoutService.d.ts +44 -1
- package/dist/cjs/types/engine/DiagramEngine.d.ts +14 -0
- package/dist/cjs/types/engine/LinkRoutingService.d.ts +1 -0
- package/dist/cjs/types/models/ElementModel.d.ts +1 -0
- package/dist/cjs/types/models/TextModel.d.ts +1 -0
- package/dist/cjs/types/renderer/konva/KonvaInteraction.d.ts +3 -2
- package/dist/esm/examples.js +1724 -321
- package/dist/esm/examples.js.map +1 -1
- package/dist/esm/index.js +929 -108
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api/createDiagramEditor.d.ts +2 -1
- package/dist/esm/types/api/types.d.ts +30 -1
- package/dist/esm/types/displaybox/demos/OffsetAnchorAvoidanceDemoTab.d.ts +3 -0
- package/dist/esm/types/displaybox/demos/ZoomToFitElementsDemoTab.d.ts +3 -0
- package/dist/esm/types/displaybox/demos/autoLayoutDemo.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/engine/AutoLayoutService.d.ts +44 -1
- package/dist/esm/types/engine/DiagramEngine.d.ts +14 -0
- package/dist/esm/types/engine/LinkRoutingService.d.ts +1 -0
- package/dist/esm/types/models/ElementModel.d.ts +1 -0
- package/dist/esm/types/models/TextModel.d.ts +1 -0
- package/dist/esm/types/renderer/konva/KonvaInteraction.d.ts +3 -2
- package/dist/examples.d.ts +31 -1
- package/dist/index.d.ts +34 -2
- package/docs/API_CONTRACT.md +51 -5
- package/docs/CAPABILITIES.md +4 -0
- package/docs/COMMANDS_EVENTS.md +9 -0
- package/docs/DOCUMENTATION_WORKFLOW.md +3 -1
- package/docs/INTEGRATION_PLAYBOOK.md +4 -0
- package/docs/STATE_INVARIANTS.md +4 -0
- package/package.json +1 -1
- package/src/displaybox/demos/AutoLayoutDemoTab.tsx +426 -327
- package/src/displaybox/demos/EngineEventsDemoTab.tsx +12 -11
- package/src/displaybox/demos/OffsetAnchorAvoidanceDemoTab.tsx +30 -0
- package/src/displaybox/demos/TextLayoutDemoTab.tsx +18 -1
- package/src/displaybox/demos/ZoomToFitElementsDemoTab.tsx +29 -0
- package/src/displaybox/demos/autoLayoutDemo.ts +203 -83
- package/src/displaybox/demos/index.tsx +80 -64
- package/src/displaybox/demos/nestedDemo.ts +122 -69
- package/src/displaybox/demos/offsetAnchorAvoidanceDemo.ts +211 -0
- package/src/displaybox/demos/textDemo.ts +6 -2
- package/src/displaybox/demos/zoomToFitElementsDemo.ts +83 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.2.7] - 2026-05-18
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Parent-owned child drag lock via `ElementData.childElementInteraction.movable`, allowing direct child elements to remain selectable while suppressing built-in pointer drag.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Built-in empty-paper panning now starts from plain primary-button drag without requiring `Ctrl`, and the applied pan direction now follows pointer movement.
|
|
12
|
+
- Marquee selection now uses `Shift + primary drag` on empty paper so paper-drag panning and box selection do not conflict.
|
|
13
|
+
- Enabled grid child width topology editing (`layout.gridChildWidthResizeEnabled`) now applies consistently to all direct grid children, including nested layout-container children.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Preserved disabled grid-child resize compatibility so nested layout-parent children stay directly horizontally resizable unless the grid width-topology capability is explicitly enabled.
|
|
17
|
+
- Prevented built-in child drag suppression from blocking programmatic `moveElementTo(...)`, layout reflow, or ancestor-driven repositioning.
|
|
18
|
+
|
|
19
|
+
### Docs
|
|
20
|
+
- Updated `README.md` release highlights for `v0.2.7`.
|
|
21
|
+
- Updated public API and machine-readable contract docs for `ElementChildInteractionPolicy`, `childElementInteraction`, and `v0.2.7` interaction behavior.
|
|
22
|
+
|
|
23
|
+
## [0.2.6] - 2026-05-14
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- Editor viewport helper `zoomToFitElements(options?)` with `padding`, `minZoom`, and `maxZoom` fit controls.
|
|
27
|
+
- Grid auto-layout opt-in child width topology editing through `layout.gridChildWidthResizeEnabled`.
|
|
28
|
+
- Dedicated `gridLayoutChanged` host event for resize-driven grid row split/redistribution changes.
|
|
29
|
+
- Per-text interaction policy via `TextData.interaction` with `movable` and `editable` controls for built-in text behavior.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- Grid auto-layout now keeps overflow rows on the established fallback model while deriving row occupancy from flat slot templates.
|
|
33
|
+
- 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.
|
|
34
|
+
- Resize-handle interaction now applies bounds changes directly without routing through move semantics.
|
|
35
|
+
- Auto routing now preserves endpoint-host interior avoidance for offset attach anchors by treating projected border-equivalent endpoints like boundary endpoints.
|
|
36
|
+
- Built-in text drag and built-in double-click/tap editing now respect per-text interaction policy while leaving programmatic `moveTextTo(...)` and `updateText(...)` unchanged.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
- Prevented dramatic grid parent width growth when adding children into partially occupied derived rows.
|
|
40
|
+
- Prevented resize gestures that update top-left position from emitting move-specific behavior/events.
|
|
41
|
+
|
|
42
|
+
### Docs
|
|
43
|
+
- Updated `README.md` release highlights for `v0.2.6`.
|
|
44
|
+
- Updated public API and machine-readable contract docs for `zoomToFitElements`, `ViewportFitOptions`, grid child width resize policy, `gridLayoutChanged`, and per-text interaction policy.
|
|
45
|
+
|
|
5
46
|
## [0.2.5] - 2026-05-10
|
|
6
47
|
|
|
7
48
|
### Added
|
package/README.md
CHANGED
|
@@ -30,40 +30,18 @@ editor.addElement({
|
|
|
30
30
|
});
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
## Release Highlights (v0.2.
|
|
34
|
-
|
|
35
|
-
- Includes all completed `v0.2.1` through `v0.2.
|
|
36
|
-
- `v0.2.
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
- `
|
|
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.7)
|
|
34
|
+
|
|
35
|
+
- Includes all completed `v0.2.1` through `v0.2.6` work, plus `v0.2.7` updates.
|
|
36
|
+
- `v0.2.7` child interaction update:
|
|
37
|
+
- parent elements can suppress built-in drag for direct child elements with `childElementInteraction.movable = false`
|
|
38
|
+
- locked child elements remain selectable, while programmatic movement and layout-driven repositioning still work
|
|
39
|
+
- `v0.2.7` viewport gesture update:
|
|
40
|
+
- empty-paper primary drag now pans without requiring `Ctrl`
|
|
41
|
+
- pan direction now follows pointer movement
|
|
42
|
+
- marquee selection now uses `Shift + drag` on empty paper
|
|
43
|
+
- `v0.2.7` grid auto-layout update:
|
|
44
|
+
- enabled `layout.gridChildWidthResizeEnabled` now applies the same 12-unit width-topology behavior to all direct grid children, including nested layout parents
|
|
67
45
|
|
|
68
46
|
## API Docs
|
|
69
47
|
|
package/ai/api-contract.json
CHANGED
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
"moveMode",
|
|
86
86
|
"anchorCenter",
|
|
87
87
|
"layout",
|
|
88
|
+
"childElementInteraction",
|
|
88
89
|
"portMovement"
|
|
89
90
|
],
|
|
90
91
|
"defaults": {
|
|
@@ -107,6 +108,11 @@
|
|
|
107
108
|
"moveMode",
|
|
108
109
|
"anchorCenter",
|
|
109
110
|
"orientToHostBorder",
|
|
111
|
+
"placementPoint",
|
|
112
|
+
"linkAttachPoint",
|
|
113
|
+
"externalLinkAttachPoint",
|
|
114
|
+
"internalLinkAttachPoint",
|
|
115
|
+
"rotationPivot",
|
|
110
116
|
"currentAnchorId"
|
|
111
117
|
],
|
|
112
118
|
"defaults": {
|
|
@@ -143,6 +149,7 @@
|
|
|
143
149
|
"style",
|
|
144
150
|
"ownerId",
|
|
145
151
|
"layout",
|
|
152
|
+
"interaction",
|
|
146
153
|
"displayContent",
|
|
147
154
|
"displayOffset",
|
|
148
155
|
"displayClipSize"
|
|
@@ -164,6 +171,7 @@
|
|
|
164
171
|
"align",
|
|
165
172
|
"autoResize",
|
|
166
173
|
"gridTemplate",
|
|
174
|
+
"gridChildWidthResizeEnabled",
|
|
167
175
|
"childFitMainAxis",
|
|
168
176
|
"childFitCrossAxis",
|
|
169
177
|
"childMinWidth",
|
|
@@ -179,7 +187,8 @@
|
|
|
179
187
|
"additionalContracts": {
|
|
180
188
|
"portMovementPolicy": {
|
|
181
189
|
"moveMode": "'free' | 'inside' | 'border' | 'anchors'",
|
|
182
|
-
"anchorConstraint": "PortAnchorConstraint"
|
|
190
|
+
"anchorConstraint": "PortAnchorConstraint",
|
|
191
|
+
"positionLimits": "PortPositionLimits"
|
|
183
192
|
},
|
|
184
193
|
"portAnchorConstraint": {
|
|
185
194
|
"preset": "'vertices' | 'cardinal'",
|
|
@@ -193,6 +202,20 @@
|
|
|
193
202
|
"maxLines": "number",
|
|
194
203
|
"fixedSize": "Size"
|
|
195
204
|
},
|
|
205
|
+
"textInteractionPolicy": {
|
|
206
|
+
"movable": "boolean",
|
|
207
|
+
"editable": "boolean",
|
|
208
|
+
"defaults": {
|
|
209
|
+
"movable": true,
|
|
210
|
+
"editable": true
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"elementChildInteractionPolicy": {
|
|
214
|
+
"movable": "boolean",
|
|
215
|
+
"defaults": {
|
|
216
|
+
"movable": true
|
|
217
|
+
}
|
|
218
|
+
},
|
|
196
219
|
"shapeHoverControls": {
|
|
197
220
|
"targetKinds": [
|
|
198
221
|
"vertex",
|
|
@@ -220,6 +243,25 @@
|
|
|
220
243
|
"colors": "string[]",
|
|
221
244
|
"defaultPoolSize": 20
|
|
222
245
|
},
|
|
246
|
+
"viewportFitOptions": {
|
|
247
|
+
"padding": "number",
|
|
248
|
+
"minZoom": "number",
|
|
249
|
+
"maxZoom": "number",
|
|
250
|
+
"defaults": {
|
|
251
|
+
"padding": 24,
|
|
252
|
+
"minZoom": 0.2,
|
|
253
|
+
"maxZoom": 3
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
"gridLayoutChangedEvent": {
|
|
257
|
+
"parentId": "string",
|
|
258
|
+
"triggerChildId": "string",
|
|
259
|
+
"reason": "'child-resize-split' | 'child-resize-redistribute'",
|
|
260
|
+
"beforeRows": "{ childIds: string[] }[]",
|
|
261
|
+
"afterRows": "{ childIds: string[] }[]",
|
|
262
|
+
"beforeGridTemplate": "number[]",
|
|
263
|
+
"afterGridTemplate": "number[]"
|
|
264
|
+
},
|
|
223
265
|
"diagramImageExportOptions": {
|
|
224
266
|
"mimeType": "string",
|
|
225
267
|
"quality": "number",
|
|
@@ -270,6 +312,7 @@
|
|
|
270
312
|
"completeLinkToPort",
|
|
271
313
|
"completeLinkToElement",
|
|
272
314
|
"cancelLink",
|
|
315
|
+
"zoomToFitElements",
|
|
273
316
|
"exportImage",
|
|
274
317
|
"resize",
|
|
275
318
|
"setElementShapeHoverControls",
|
|
@@ -291,6 +334,7 @@
|
|
|
291
334
|
"elementDragged": "ElementDropEvent",
|
|
292
335
|
"elementMoved": "ElementMovedEvent",
|
|
293
336
|
"elementResized": "ElementResizedEvent",
|
|
337
|
+
"gridLayoutChanged": "GridLayoutChangedEvent",
|
|
294
338
|
"elementDeleted": "ElementDeletedEvent",
|
|
295
339
|
"portDeleted": "PortDeletedEvent",
|
|
296
340
|
"linkDeleted": "LinkDeletedEvent",
|
package/ai/manifest.json
CHANGED