orcasvn-react-diagrams 0.2.7 → 0.2.9

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 (37) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +7 -12
  3. package/ai/api-contract.json +16 -0
  4. package/ai/invariants.json +8 -0
  5. package/ai/manifest.json +1 -1
  6. package/dist/cjs/examples.js +604 -39
  7. package/dist/cjs/index.js +227 -28
  8. package/dist/cjs/types/api/types.d.ts +2 -0
  9. package/dist/cjs/types/displaybox/demos/elementVisibilitySelectionDemo.d.ts +4 -0
  10. package/dist/cjs/types/engine/DiagramEngine.d.ts +8 -0
  11. package/dist/cjs/types/models/DiagramModel.d.ts +5 -0
  12. package/dist/cjs/types/models/ElementModel.d.ts +2 -0
  13. package/dist/esm/examples.js +604 -39
  14. package/dist/esm/examples.js.map +1 -1
  15. package/dist/esm/index.js +227 -28
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/esm/types/api/types.d.ts +2 -0
  18. package/dist/esm/types/displaybox/demos/elementVisibilitySelectionDemo.d.ts +4 -0
  19. package/dist/esm/types/engine/DiagramEngine.d.ts +8 -0
  20. package/dist/esm/types/models/DiagramModel.d.ts +5 -0
  21. package/dist/esm/types/models/ElementModel.d.ts +2 -0
  22. package/dist/examples.d.ts +2 -0
  23. package/dist/index.d.ts +9 -0
  24. package/docs/API_CONTRACT.md +16 -1
  25. package/docs/CAPABILITIES.md +1 -0
  26. package/docs/COMMANDS_EVENTS.md +3 -1
  27. package/docs/DOCUMENTATION_WORKFLOW.md +3 -1
  28. package/docs/INTEGRATION_PLAYBOOK.md +1 -0
  29. package/docs/PORTING_CHECKLIST.md +1 -0
  30. package/docs/STATE_INVARIANTS.md +9 -1
  31. package/package.json +1 -1
  32. package/src/displaybox/demos/AutoLayoutDemoTab.tsx +11 -5
  33. package/src/displaybox/demos/autoLayoutDemo.ts +233 -0
  34. package/src/displaybox/demos/basicDemo.ts +6 -6
  35. package/src/displaybox/demos/elementVisibilitySelectionDemo.ts +128 -0
  36. package/src/displaybox/demos/index.tsx +14 -7
  37. package/src/displaybox/demos/selectionDemo.ts +12 -12
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.9] - 2026-05-27
6
+
7
+ ### Added
8
+ - Element-level visibility and selectability policy through `ElementData.visible` and `ElementData.selectable`.
9
+
10
+ ### Changed
11
+ - Built-in element-body hit testing, click selection, marquee selection, and persisted selection normalization now honor element visibility/selectability state.
12
+ - Hidden-scene propagation now suppresses owned ports, owned texts, and links whose endpoint ports belong to hidden elements.
13
+ - `zoomToFitElements` and `exportImage({ fitToContent: ... })` now ignore hidden scene members when deriving bounds.
14
+
15
+ ### Docs
16
+ - Updated release highlights, API/invariant docs, integration guidance, and machine-readable contract artifacts for `v0.2.9`.
17
+
18
+ ## [0.2.8] - 2026-05-24
19
+
20
+ ### Fixed
21
+ - Grid auto-layout now preserves the owner-assigned slot size of a direct child that is itself an empty non-manual layout parent during the active layout cycle.
22
+ - Enabled `layout.gridChildWidthResizeEnabled` resize redistribution now keeps that nested layout parent at its resolved slot size instead of collapsing it back to empty padding bounds.
23
+
24
+ ### Docs
25
+ - Updated `README.md` release highlights for `v0.2.8`.
26
+ - Refreshed release workflow metadata for `v0.2.8`.
27
+
5
28
  ## [0.2.7] - 2026-05-18
6
29
 
7
30
  ### Added
@@ -30,6 +53,7 @@ All notable changes to this project are documented in this file.
30
53
 
31
54
  ### Changed
32
55
  - Grid auto-layout now keeps overflow rows on the established fallback model while deriving row occupancy from flat slot templates.
56
+ - Grid auto-layout `gridTemplate` now uses a flat one-level slot array shape such as `[12,4,8]` instead of nested row arrays, with rows derived greedily during layout.
33
57
  - 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
58
  - Resize-handle interaction now applies bounds changes directly without routing through move semantics.
35
59
  - Auto routing now preserves endpoint-host interior avoidance for offset attach anchors by treating projected border-equivalent endpoints like boundary endpoints.
package/README.md CHANGED
@@ -30,18 +30,13 @@ editor.addElement({
30
30
  });
31
31
  ```
32
32
 
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
33
+ ## Release Highlights (v0.2.9)
34
+
35
+ - Includes all completed `v0.2.1` through `v0.2.8` work, plus `v0.2.9` updates.
36
+ - `v0.2.9` element visibility/selectability policy:
37
+ - `ElementData.visible = false` keeps the element in state while removing it from built-in render, hit testing, selection, and fit/export bounds
38
+ - `ElementData.selectable = false` keeps the element visible while preventing built-in element-body click/marquee/programmatic selection from retaining that element id
39
+ - owned ports/texts and endpoint-dependent links now follow the same hidden-scene visibility rules
45
40
 
46
41
  ## API Docs
47
42
 
@@ -81,6 +81,8 @@
81
81
  "style",
82
82
  "portIds",
83
83
  "textIds",
84
+ "visible",
85
+ "selectable",
84
86
  "parentId",
85
87
  "moveMode",
86
88
  "anchorCenter",
@@ -216,6 +218,20 @@
216
218
  "movable": true
217
219
  }
218
220
  },
221
+ "elementVisibilitySelectionPolicy": {
222
+ "visible": "boolean",
223
+ "selectable": "boolean",
224
+ "defaults": {
225
+ "visible": true,
226
+ "selectable": true
227
+ },
228
+ "semantics": [
229
+ "visible=false hides the element body from built-in render, hit testing, marquee selection, persisted selection, zoomToFitElements, and exportImage fit-to-content bounds",
230
+ "hidden-scene propagation also hides owned ports, owned texts, and links whose endpoint ports belong to hidden elements",
231
+ "selectable=false blocks built-in element-body click selection, marquee selection, and programmatic setSelection/toggleSelection from retaining that element id",
232
+ "selectable=false does not hide the element"
233
+ ]
234
+ },
219
235
  "shapeHoverControls": {
220
236
  "targetKinds": [
221
237
  "vertex",
@@ -6,6 +6,8 @@
6
6
  "texts[]"
7
7
  ],
8
8
  "defaults": {
9
+ "element.visible": true,
10
+ "element.selectable": true,
9
11
  "port.anchorCenter": true,
10
12
  "port.orientToHostBorder": true,
11
13
  "link.routing": "auto"
@@ -13,25 +15,31 @@
13
15
  "entityRules": {
14
16
  "element": [
15
17
  "child element positions are parent-relative when parentId is set",
18
+ "element visible-state is enabled by default and hidden ancestors suppress descendant element visibility",
19
+ "element selectable-state is enabled by default and selectable=false prevents the element id from persisting in selection state",
16
20
  "deleting an element removes its ports, links via ports, and owned texts"
17
21
  ],
18
22
  "port": [
19
23
  "port positions are relative to element",
24
+ "port visible-state follows owning element visibility",
20
25
  "moving a port can be constrained by moveMode/moveAxis/moveBounds",
21
26
  "element portMovement policy can enforce anchor-constrained movement with discrete shape anchors"
22
27
  ],
23
28
  "link": [
29
+ "link visible-state requires both endpoint ports to remain visible",
24
30
  "manual routing preserves interior bend points on endpoint updates",
25
31
  "auto routing normalizes first/last points to source/target port world positions"
26
32
  ],
27
33
  "text": [
28
34
  "owner-bound text stores owner-relative position",
35
+ "owned text visible-state follows its resolved owner visibility",
29
36
  "orphan owner references are tolerated as standalone world text",
30
37
  "displayContent/displayOffset/displayClipSize may be derived from text layout rules"
31
38
  ]
32
39
  },
33
40
  "eventRules": [
34
41
  "mutations emit change with patches and full state snapshot",
42
+ "setSelection/toggleSelection normalize away hidden scene members and selectable=false element ids before emitting selection",
35
43
  "setSelection emits selection plus derived selected entity events",
36
44
  "setViewport emits viewport patch without immediate render"
37
45
  ],
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-18"
33
+ "updatedAt": "2026-05-27"
34
34
  }