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.
- package/CHANGELOG.md +23 -0
- package/README.md +15 -34
- package/ai/api-contract.json +38 -1
- package/ai/manifest.json +1 -1
- package/dist/cjs/examples.js +1252 -113
- package/dist/cjs/index.js +876 -81
- package/dist/cjs/types/api/createDiagramEditor.d.ts +2 -1
- package/dist/cjs/types/api/types.d.ts +26 -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/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 +12 -0
- package/dist/cjs/types/engine/LinkRoutingService.d.ts +1 -0
- package/dist/cjs/types/models/TextModel.d.ts +1 -0
- package/dist/cjs/types/renderer/konva/KonvaInteraction.d.ts +2 -0
- package/dist/esm/examples.js +1252 -113
- package/dist/esm/examples.js.map +1 -1
- package/dist/esm/index.js +876 -81
- 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 +26 -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/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 +12 -0
- package/dist/esm/types/engine/LinkRoutingService.d.ts +1 -0
- package/dist/esm/types/models/TextModel.d.ts +1 -0
- package/dist/esm/types/renderer/konva/KonvaInteraction.d.ts +2 -0
- package/dist/examples.d.ts +27 -1
- package/dist/index.d.ts +29 -2
- package/docs/API_CONTRACT.md +38 -3
- package/docs/CAPABILITIES.md +3 -0
- package/docs/COMMANDS_EVENTS.md +8 -0
- package/docs/DOCUMENTATION_WORKFLOW.md +2 -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 +337 -316
- 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 +74 -73
- package/src/displaybox/demos/index.tsx +80 -64
- 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,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.
|
|
34
|
-
|
|
35
|
-
- Includes all completed `v0.2.1` through `v0.2.
|
|
36
|
-
- `v0.2.
|
|
37
|
-
- new `
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
- `
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
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
|
|
package/ai/api-contract.json
CHANGED
|
@@ -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