@pascal-app/core 0.9.1 → 1.0.0-beta.1
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/README.md +17 -10
- package/dist/events/bus.d.ts +49 -2
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/hooks/scene-registry/item-clip-registry.d.ts +18 -0
- package/dist/hooks/scene-registry/item-clip-registry.d.ts.map +1 -0
- package/dist/hooks/scene-registry/item-clip-registry.js +10 -0
- package/dist/hooks/scene-registry/scene-registry.d.ts +8 -1
- package/dist/hooks/scene-registry/scene-registry.d.ts.map +1 -1
- package/dist/hooks/scene-registry/scene-registry.js +27 -1
- package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts +17 -1
- package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/floor-placed-elevation.js +61 -8
- package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts +135 -28
- package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-manager.js +427 -271
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +46 -1
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-sync.js +208 -9
- package/dist/hooks/spatial-grid/support-host-id.d.ts +3 -0
- package/dist/hooks/spatial-grid/support-host-id.d.ts.map +1 -0
- package/dist/hooks/spatial-grid/support-host-id.js +2 -0
- package/dist/hooks/spatial-grid/support-host-patch.d.ts +51 -0
- package/dist/hooks/spatial-grid/support-host-patch.d.ts.map +1 -0
- package/dist/hooks/spatial-grid/support-host-patch.js +164 -0
- package/dist/index.d.ts +33 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -10
- package/dist/lib/level-name.d.ts +4 -0
- package/dist/lib/level-name.d.ts.map +1 -0
- package/dist/lib/level-name.js +10 -0
- package/dist/lib/measurement-geometry.d.ts +23 -0
- package/dist/lib/measurement-geometry.d.ts.map +1 -0
- package/dist/lib/measurement-geometry.js +249 -0
- package/dist/lib/polygon-geometry.d.ts +0 -1
- package/dist/lib/polygon-geometry.d.ts.map +1 -1
- package/dist/lib/polygon-geometry.js +0 -18
- package/dist/lib/selection-proxy.d.ts +4 -0
- package/dist/lib/selection-proxy.d.ts.map +1 -0
- package/dist/lib/selection-proxy.js +12 -0
- package/dist/lib/slab-polygon.d.ts +31 -2
- package/dist/lib/slab-polygon.d.ts.map +1 -1
- package/dist/lib/slab-polygon.js +557 -31
- package/dist/lib/slots.d.ts +14 -0
- package/dist/lib/slots.d.ts.map +1 -0
- package/dist/lib/slots.js +26 -0
- package/dist/lib/space-detection.d.ts +40 -6
- package/dist/lib/space-detection.d.ts.map +1 -1
- package/dist/lib/space-detection.js +574 -192
- package/dist/lib/terrain-brush.d.ts +163 -0
- package/dist/lib/terrain-brush.d.ts.map +1 -0
- package/dist/lib/terrain-brush.js +359 -0
- package/dist/lib/terrain-codec.d.ts +51 -0
- package/dist/lib/terrain-codec.d.ts.map +1 -0
- package/dist/lib/terrain-codec.js +167 -0
- package/dist/lib/terrain-field.d.ts +150 -0
- package/dist/lib/terrain-field.d.ts.map +1 -0
- package/dist/lib/terrain-field.js +248 -0
- package/dist/lib/terrain-raycast.d.ts +44 -0
- package/dist/lib/terrain-raycast.d.ts.map +1 -0
- package/dist/lib/terrain-raycast.js +188 -0
- package/dist/lib/terrain-source.d.ts +60 -0
- package/dist/lib/terrain-source.d.ts.map +1 -0
- package/dist/lib/terrain-source.js +90 -0
- package/dist/lib/terrain-support.d.ts +60 -0
- package/dist/lib/terrain-support.d.ts.map +1 -0
- package/dist/lib/terrain-support.js +150 -0
- package/dist/lib/wall-distance.d.ts +60 -0
- package/dist/lib/wall-distance.d.ts.map +1 -0
- package/dist/lib/wall-distance.js +85 -0
- package/dist/lib/zone-quantities.d.ts +21 -0
- package/dist/lib/zone-quantities.d.ts.map +1 -0
- package/dist/lib/zone-quantities.js +428 -0
- package/dist/material-library.d.ts +28 -1
- package/dist/material-library.d.ts.map +1 -1
- package/dist/material-library.js +2233 -441
- package/dist/registry/handles.d.ts +91 -3
- package/dist/registry/handles.d.ts.map +1 -1
- package/dist/registry/index.d.ts +3 -3
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/registry/registry.d.ts +46 -3
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +82 -1
- package/dist/registry/subtree.d.ts.map +1 -1
- package/dist/registry/subtree.js +8 -1
- package/dist/registry/types.d.ts +781 -39
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/schema/index.d.ts +27 -8
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +23 -6
- package/dist/schema/material.d.ts +3 -2
- package/dist/schema/material.d.ts.map +1 -1
- package/dist/schema/material.js +7 -5
- package/dist/schema/nodes/box-vent.d.ts +2 -2
- package/dist/schema/nodes/cabinet.d.ts +536 -0
- package/dist/schema/nodes/cabinet.d.ts.map +1 -0
- package/dist/schema/nodes/cabinet.js +139 -0
- package/dist/schema/nodes/ceiling.d.ts +4 -3
- package/dist/schema/nodes/ceiling.d.ts.map +1 -1
- package/dist/schema/nodes/ceiling.js +11 -1
- package/dist/schema/nodes/chimney.d.ts +4 -4
- package/dist/schema/nodes/column.d.ts +4 -2
- package/dist/schema/nodes/column.d.ts.map +1 -1
- package/dist/schema/nodes/column.js +5 -0
- package/dist/schema/nodes/construction-dimension.d.ts +195 -0
- package/dist/schema/nodes/construction-dimension.d.ts.map +1 -0
- package/dist/schema/nodes/construction-dimension.js +151 -0
- package/dist/schema/nodes/cupola.d.ts +2 -2
- package/dist/schema/nodes/door.d.ts +42 -5
- package/dist/schema/nodes/door.d.ts.map +1 -1
- package/dist/schema/nodes/door.js +32 -0
- package/dist/schema/nodes/dormer.d.ts +8 -8
- package/dist/schema/nodes/dormer.js +1 -1
- package/dist/schema/nodes/downspout.d.ts +2 -2
- package/dist/schema/nodes/duct-fitting.d.ts +91 -0
- package/dist/schema/nodes/duct-fitting.d.ts.map +1 -0
- package/dist/schema/nodes/duct-fitting.js +92 -0
- package/dist/schema/nodes/duct-segment.d.ts +61 -0
- package/dist/schema/nodes/duct-segment.d.ts.map +1 -0
- package/dist/schema/nodes/duct-segment.js +73 -0
- package/dist/schema/nodes/duct-terminal.d.ts +58 -0
- package/dist/schema/nodes/duct-terminal.d.ts.map +1 -0
- package/dist/schema/nodes/duct-terminal.js +53 -0
- package/dist/schema/nodes/elevator.d.ts +3 -2
- package/dist/schema/nodes/elevator.d.ts.map +1 -1
- package/dist/schema/nodes/elevator.js +3 -0
- package/dist/schema/nodes/eyebrow-vent.d.ts +2 -2
- package/dist/schema/nodes/fence.d.ts +20 -2
- package/dist/schema/nodes/fence.d.ts.map +1 -1
- package/dist/schema/nodes/fence.js +33 -2
- package/dist/schema/nodes/gutter.d.ts +2 -2
- package/dist/schema/nodes/hvac-equipment.d.ts +64 -0
- package/dist/schema/nodes/hvac-equipment.d.ts.map +1 -0
- package/dist/schema/nodes/hvac-equipment.js +57 -0
- package/dist/schema/nodes/item.d.ts +9 -0
- package/dist/schema/nodes/item.d.ts.map +1 -1
- package/dist/schema/nodes/item.js +24 -0
- package/dist/schema/nodes/level.d.ts +2 -1
- package/dist/schema/nodes/level.d.ts.map +1 -1
- package/dist/schema/nodes/level.js +12 -31
- package/dist/schema/nodes/lineset.d.ts +42 -0
- package/dist/schema/nodes/lineset.d.ts.map +1 -0
- package/dist/schema/nodes/lineset.js +38 -0
- package/dist/schema/nodes/liquid-line.d.ts +34 -0
- package/dist/schema/nodes/liquid-line.d.ts.map +1 -0
- package/dist/schema/nodes/liquid-line.js +24 -0
- package/dist/schema/nodes/measurement.d.ts +306 -0
- package/dist/schema/nodes/measurement.d.ts.map +1 -0
- package/dist/schema/nodes/measurement.js +87 -0
- package/dist/schema/nodes/pipe-fitting.d.ts +56 -0
- package/dist/schema/nodes/pipe-fitting.d.ts.map +1 -0
- package/dist/schema/nodes/pipe-fitting.js +45 -0
- package/dist/schema/nodes/pipe-segment.d.ts +48 -0
- package/dist/schema/nodes/pipe-segment.d.ts.map +1 -0
- package/dist/schema/nodes/pipe-segment.js +36 -0
- package/dist/schema/nodes/pipe-trap.d.ts +43 -0
- package/dist/schema/nodes/pipe-trap.d.ts.map +1 -0
- package/dist/schema/nodes/pipe-trap.js +36 -0
- package/dist/schema/nodes/ridge-vent.d.ts +18 -3
- package/dist/schema/nodes/ridge-vent.d.ts.map +1 -1
- package/dist/schema/nodes/ridge-vent.js +221 -3
- package/dist/schema/nodes/roof-segment-shape.d.ts +90 -0
- package/dist/schema/nodes/roof-segment-shape.d.ts.map +1 -0
- package/dist/schema/nodes/roof-segment-shape.js +318 -0
- package/dist/schema/nodes/roof-segment-walls.d.ts +101 -0
- package/dist/schema/nodes/roof-segment-walls.d.ts.map +1 -0
- package/dist/schema/nodes/roof-segment-walls.js +330 -0
- package/dist/schema/nodes/roof-segment.d.ts +84 -8
- package/dist/schema/nodes/roof-segment.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment.js +290 -5
- package/dist/schema/nodes/roof.d.ts +8 -8
- package/dist/schema/nodes/shelf.d.ts +4 -2
- package/dist/schema/nodes/shelf.d.ts.map +1 -1
- package/dist/schema/nodes/shelf.js +8 -0
- package/dist/schema/nodes/site.d.ts +9 -0
- package/dist/schema/nodes/site.d.ts.map +1 -1
- package/dist/schema/nodes/site.js +8 -6
- package/dist/schema/nodes/skylight.d.ts +10 -10
- package/dist/schema/nodes/slab.d.ts +8 -2
- package/dist/schema/nodes/slab.d.ts.map +1 -1
- package/dist/schema/nodes/slab.js +18 -2
- package/dist/schema/nodes/solar-panel.d.ts +4 -4
- package/dist/schema/nodes/spawn.d.ts +1 -0
- package/dist/schema/nodes/spawn.d.ts.map +1 -1
- package/dist/schema/nodes/spawn.js +2 -0
- package/dist/schema/nodes/stair-segment.d.ts +4 -4
- package/dist/schema/nodes/stair.d.ts +16 -13
- package/dist/schema/nodes/stair.d.ts.map +1 -1
- package/dist/schema/nodes/stair.js +11 -1
- package/dist/schema/nodes/structural-grid.d.ts +27 -0
- package/dist/schema/nodes/structural-grid.d.ts.map +1 -0
- package/dist/schema/nodes/structural-grid.js +17 -0
- package/dist/schema/nodes/turbine-vent.d.ts +2 -2
- package/dist/schema/nodes/wall.d.ts +248 -6
- package/dist/schema/nodes/wall.d.ts.map +1 -1
- package/dist/schema/nodes/wall.js +266 -0
- package/dist/schema/nodes/window.d.ts +40 -3
- package/dist/schema/nodes/window.d.ts.map +1 -1
- package/dist/schema/nodes/window.js +30 -0
- package/dist/schema/nodes/zone.d.ts +22 -0
- package/dist/schema/nodes/zone.d.ts.map +1 -1
- package/dist/schema/nodes/zone.js +21 -0
- package/dist/schema/scene-material.d.ts +41 -0
- package/dist/schema/scene-material.d.ts.map +1 -0
- package/dist/schema/scene-material.js +9 -0
- package/dist/schema/terrain.d.ts +28 -0
- package/dist/schema/terrain.d.ts.map +1 -0
- package/dist/schema/terrain.js +30 -0
- package/dist/schema/types.d.ts +1300 -97
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +27 -0
- package/dist/services/__fixtures__/wall-plane-top-boundary-repro.d.ts +80 -0
- package/dist/services/__fixtures__/wall-plane-top-boundary-repro.d.ts.map +1 -0
- package/dist/services/__fixtures__/wall-plane-top-boundary-repro.js +89 -0
- package/dist/services/alignment-anchors.d.ts.map +1 -1
- package/dist/services/alignment-anchors.js +30 -1
- package/dist/services/alignment.d.ts +5 -0
- package/dist/services/alignment.d.ts.map +1 -1
- package/dist/services/alignment.js +2 -0
- package/dist/services/hosting.d.ts +8 -0
- package/dist/services/hosting.d.ts.map +1 -1
- package/dist/services/hosting.js +13 -4
- package/dist/services/index.d.ts +9 -2
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +9 -2
- package/dist/services/level-height.d.ts +27 -0
- package/dist/services/level-height.d.ts.map +1 -0
- package/dist/services/level-height.js +94 -0
- package/dist/services/opening-guides.d.ts +141 -0
- package/dist/services/opening-guides.d.ts.map +1 -0
- package/dist/services/opening-guides.js +267 -0
- package/dist/services/port-connectivity.d.ts +115 -0
- package/dist/services/port-connectivity.d.ts.map +1 -0
- package/dist/services/port-connectivity.js +300 -0
- package/dist/services/riser-diagram.d.ts +40 -0
- package/dist/services/riser-diagram.d.ts.map +1 -0
- package/dist/services/riser-diagram.js +110 -0
- package/dist/services/snap.d.ts +9 -1
- package/dist/services/snap.d.ts.map +1 -1
- package/dist/services/snap.js +21 -1
- package/dist/services/storey.d.ts +103 -0
- package/dist/services/storey.d.ts.map +1 -0
- package/dist/services/storey.js +296 -0
- package/dist/services/system-graph.d.ts +30 -0
- package/dist/services/system-graph.d.ts.map +1 -0
- package/dist/services/system-graph.js +164 -0
- package/dist/services/validate-dwv.d.ts +32 -0
- package/dist/services/validate-dwv.d.ts.map +1 -0
- package/dist/services/validate-dwv.js +118 -0
- package/dist/store/actions/node-actions.d.ts.map +1 -1
- package/dist/store/actions/node-actions.js +141 -4
- package/dist/store/history-control.d.ts +31 -0
- package/dist/store/history-control.d.ts.map +1 -1
- package/dist/store/history-control.js +130 -0
- package/dist/store/use-live-terrain.d.ts +65 -0
- package/dist/store/use-live-terrain.d.ts.map +1 -0
- package/dist/store/use-live-terrain.js +31 -0
- package/dist/store/use-live-transforms.d.ts +8 -0
- package/dist/store/use-live-transforms.d.ts.map +1 -1
- package/dist/store/use-scene.d.ts +47 -3
- package/dist/store/use-scene.d.ts.map +1 -1
- package/dist/store/use-scene.js +992 -55
- package/dist/systems/elevator/elevator-opening-system.d.ts +1 -0
- package/dist/systems/elevator/elevator-opening-system.d.ts.map +1 -1
- package/dist/systems/elevator/elevator-opening-system.js +27 -21
- package/dist/systems/elevator/elevator-service.d.ts +0 -2
- package/dist/systems/elevator/elevator-service.d.ts.map +1 -1
- package/dist/systems/elevator/elevator-service.js +2 -24
- package/dist/systems/fence/fence-centerline.d.ts +12 -0
- package/dist/systems/fence/fence-centerline.d.ts.map +1 -0
- package/dist/systems/fence/fence-centerline.js +37 -0
- package/dist/systems/fence/fence-spline.d.ts +39 -0
- package/dist/systems/fence/fence-spline.d.ts.map +1 -0
- package/dist/systems/fence/fence-spline.js +196 -0
- package/dist/systems/slab/slab-placement.d.ts +11 -0
- package/dist/systems/slab/slab-placement.d.ts.map +1 -0
- package/dist/systems/slab/slab-placement.js +14 -0
- package/dist/systems/slab/slab-support.d.ts +137 -0
- package/dist/systems/slab/slab-support.d.ts.map +1 -0
- package/dist/systems/slab/slab-support.js +557 -0
- package/dist/systems/stair/stair-footprint.d.ts.map +1 -1
- package/dist/systems/stair/stair-footprint.js +21 -11
- package/dist/systems/stair/stair-opening-preview.d.ts +1300 -505
- package/dist/systems/stair/stair-opening-preview.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-sync.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-sync.js +19 -33
- package/dist/systems/stair/stair-opening-system.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-system.js +32 -4
- package/dist/systems/stair/stair-rise.d.ts +22 -0
- package/dist/systems/stair/stair-rise.d.ts.map +1 -0
- package/dist/systems/stair/stair-rise.js +79 -0
- package/dist/systems/wall/wall-curve.d.ts +10 -0
- package/dist/systems/wall/wall-curve.d.ts.map +1 -1
- package/dist/systems/wall/wall-curve.js +1 -1
- package/dist/systems/wall/wall-mitering.d.ts.map +1 -1
- package/dist/systems/wall/wall-mitering.js +44 -8
- package/dist/systems/wall/wall-top.d.ts +40 -0
- package/dist/systems/wall/wall-top.d.ts.map +1 -0
- package/dist/systems/wall/wall-top.js +46 -0
- package/dist/utils/clone-scene-graph.d.ts +1 -0
- package/dist/utils/clone-scene-graph.d.ts.map +1 -1
- package/dist/utils/clone-scene-graph.js +56 -5
- package/dist/utils/heal-scene-graph.d.ts +18 -0
- package/dist/utils/heal-scene-graph.d.ts.map +1 -0
- package/dist/utils/heal-scene-graph.js +106 -0
- package/dist/validation/validate-build-json.d.ts +3 -0
- package/dist/validation/validate-build-json.d.ts.map +1 -1
- package/dist/validation/validate-build-json.js +90 -5
- package/package.json +4 -4
- package/dist/hooks/spatial-grid/floor-placed-elevation.test.d.ts +0 -2
- package/dist/hooks/spatial-grid/floor-placed-elevation.test.d.ts.map +0 -1
- package/dist/hooks/spatial-grid/floor-placed-elevation.test.js +0 -273
- package/dist/lib/space-detection-pause.test.d.ts +0 -2
- package/dist/lib/space-detection-pause.test.d.ts.map +0 -1
- package/dist/lib/space-detection-pause.test.js +0 -42
- package/dist/lib/space-detection.test.d.ts +0 -2
- package/dist/lib/space-detection.test.d.ts.map +0 -1
- package/dist/lib/space-detection.test.js +0 -77
- package/dist/registry/registry.test.d.ts +0 -2
- package/dist/registry/registry.test.d.ts.map +0 -1
- package/dist/registry/registry.test.js +0 -183
- package/dist/registry/relations-resolver.test.d.ts +0 -2
- package/dist/registry/relations-resolver.test.d.ts.map +0 -1
- package/dist/registry/relations-resolver.test.js +0 -183
- package/dist/registry/scene-api.test.d.ts +0 -2
- package/dist/registry/scene-api.test.d.ts.map +0 -1
- package/dist/registry/scene-api.test.js +0 -183
- package/dist/registry/subtree.test.d.ts +0 -2
- package/dist/registry/subtree.test.d.ts.map +0 -1
- package/dist/registry/subtree.test.js +0 -133
- package/dist/schema/asset-url.test.d.ts +0 -2
- package/dist/schema/asset-url.test.d.ts.map +0 -1
- package/dist/schema/asset-url.test.js +0 -134
- package/dist/services/alignment-anchors.test.d.ts +0 -2
- package/dist/services/alignment-anchors.test.d.ts.map +0 -1
- package/dist/services/alignment-anchors.test.js +0 -383
- package/dist/services/alignment.test.d.ts +0 -2
- package/dist/services/alignment.test.d.ts.map +0 -1
- package/dist/services/alignment.test.js +0 -92
- package/dist/services/drag-session.test.d.ts +0 -2
- package/dist/services/drag-session.test.d.ts.map +0 -1
- package/dist/services/drag-session.test.js +0 -219
- package/dist/services/hosting.test.d.ts +0 -2
- package/dist/services/hosting.test.d.ts.map +0 -1
- package/dist/services/hosting.test.js +0 -199
- package/dist/services/movement.test.d.ts +0 -2
- package/dist/services/movement.test.d.ts.map +0 -1
- package/dist/services/movement.test.js +0 -133
- package/dist/services/single-undo-dance.test.d.ts +0 -2
- package/dist/services/single-undo-dance.test.d.ts.map +0 -1
- package/dist/services/single-undo-dance.test.js +0 -210
- package/dist/services/snap.test.d.ts +0 -2
- package/dist/services/snap.test.d.ts.map +0 -1
- package/dist/services/snap.test.js +0 -95
- package/dist/store/actions/node-mutation-sanitize.test.d.ts +0 -2
- package/dist/store/actions/node-mutation-sanitize.test.d.ts.map +0 -1
- package/dist/store/actions/node-mutation-sanitize.test.js +0 -147
- package/dist/store/actions/reparent.test.d.ts +0 -2
- package/dist/store/actions/reparent.test.d.ts.map +0 -1
- package/dist/store/actions/reparent.test.js +0 -212
- package/dist/store/use-scene-elevator-migration.test.d.ts +0 -2
- package/dist/store/use-scene-elevator-migration.test.d.ts.map +0 -1
- package/dist/store/use-scene-elevator-migration.test.js +0 -109
- package/dist/systems/elevator/elevator-opening-sync.test.d.ts +0 -2
- package/dist/systems/elevator/elevator-opening-sync.test.d.ts.map +0 -1
- package/dist/systems/elevator/elevator-opening-sync.test.js +0 -146
- package/dist/systems/elevator/elevator-runtime.test.d.ts +0 -2
- package/dist/systems/elevator/elevator-runtime.test.d.ts.map +0 -1
- package/dist/systems/elevator/elevator-runtime.test.js +0 -64
- package/dist/systems/stair/stair-opening-preview.test.d.ts +0 -2
- package/dist/systems/stair/stair-opening-preview.test.d.ts.map +0 -1
- package/dist/systems/stair/stair-opening-preview.test.js +0 -80
- package/dist/systems/stair/stair-opening-sync.test.d.ts +0 -2
- package/dist/systems/stair/stair-opening-sync.test.d.ts.map +0 -1
- package/dist/systems/stair/stair-opening-sync.test.js +0 -446
- package/dist/utils/clone-scene-graph.test.d.ts +0 -2
- package/dist/utils/clone-scene-graph.test.d.ts.map +0 -1
- package/dist/utils/clone-scene-graph.test.js +0 -59
|
@@ -30,6 +30,17 @@ export type EditorApi = {
|
|
|
30
30
|
* fences). No-ops for kinds without endpoints.
|
|
31
31
|
*/
|
|
32
32
|
engageEndpointMove: (node: AnyNode, endpoint: 'start' | 'end') => void;
|
|
33
|
+
/**
|
|
34
|
+
* Engage drag of a spline control point (`path[index]`). Used by spline
|
|
35
|
+
* fences to reshape their centerline. No-ops for kinds without a path.
|
|
36
|
+
*/
|
|
37
|
+
engageControlPointMove: (node: AnyNode, index: number) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Engage drag of a spline tangent handle (`path[index]`, which end). Used by
|
|
40
|
+
* spline fences to bend the curve through one control point. No-ops for kinds
|
|
41
|
+
* without tangents.
|
|
42
|
+
*/
|
|
43
|
+
engageTangentMove: (node: AnyNode, index: number, side: 'in' | 'out') => void;
|
|
33
44
|
};
|
|
34
45
|
export type HandlePortal = 'self' | 'parent' | 'grandparent';
|
|
35
46
|
export type HandleAxis = 'x' | 'y' | 'z';
|
|
@@ -58,9 +69,11 @@ export type Cursor = 'ew-resize' | 'ns-resize' | 'move' | 'grab' | 'grabbing';
|
|
|
58
69
|
export type HandleDecoration<N> = {
|
|
59
70
|
kind: 'ring';
|
|
60
71
|
/** Node-local radius of the ring (XZ plane). */
|
|
61
|
-
radius: (node: N) => number;
|
|
72
|
+
radius: (node: N, sceneApi: SceneApi) => number;
|
|
62
73
|
/** Node-local Y of the ring. Defaults to 0. */
|
|
63
74
|
y?: (node: N) => number;
|
|
75
|
+
/** Node-local center of the ring. Defaults to the node origin. */
|
|
76
|
+
center?: (node: N, sceneApi: SceneApi) => readonly [number, number, number];
|
|
64
77
|
};
|
|
65
78
|
/**
|
|
66
79
|
* Linear resize along a single local axis. Covers width / depth / height
|
|
@@ -84,6 +97,37 @@ export type LinearResizeHandle<N> = {
|
|
|
84
97
|
anchor: HandleAnchor;
|
|
85
98
|
currentValue: (node: N) => number;
|
|
86
99
|
apply: (node: N, newValue: number, sceneApi: SceneApi) => Partial<N>;
|
|
100
|
+
/**
|
|
101
|
+
* Additional live-only patches for geometry owned by related nodes. The
|
|
102
|
+
* editor publishes these during the drag and clears them on release or
|
|
103
|
+
* cancellation; committed scene writes remain the responsibility of
|
|
104
|
+
* `commit` (or the generic selected-node update).
|
|
105
|
+
*/
|
|
106
|
+
previewOverrides?: (node: N, newValue: number, sceneApi: SceneApi) => ReadonlyArray<readonly [AnyNodeId, Partial<AnyNode>]>;
|
|
107
|
+
/** Optional live-scene visibility gate for context-dependent arrows. */
|
|
108
|
+
visible?: (node: N, sceneApi: SceneApi) => boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Optional committed-write hook. The generic handle renderer previews the
|
|
111
|
+
* selected node with the `apply` patch during drag; on release it normally
|
|
112
|
+
* writes that patch back to the same node. Composite nodes can override the
|
|
113
|
+
* final write here to fan the resize out to siblings / parents while keeping
|
|
114
|
+
* the handle UI generic.
|
|
115
|
+
*/
|
|
116
|
+
commit?: (node: N, patch: Partial<N>, sceneApi: SceneApi) => void;
|
|
117
|
+
/**
|
|
118
|
+
* Optional per-tick hook fired while this handle is being dragged, with the
|
|
119
|
+
* live (in-progress, override-merged) node. A pure side-channel for transient
|
|
120
|
+
* feedback — doors/windows use it to publish proximity / sill guides for the
|
|
121
|
+
* edge being resized. The return value is ignored; the resize itself is driven
|
|
122
|
+
* by `apply`.
|
|
123
|
+
*/
|
|
124
|
+
onDrag?: (node: N, sceneApi: SceneApi) => void;
|
|
125
|
+
/**
|
|
126
|
+
* Cleanup companion to {@link onDrag}. Called for commit, cancellation, and
|
|
127
|
+
* unmount so a descriptor can release transient feedback it owns without the
|
|
128
|
+
* generic renderer knowing which guide store produced it.
|
|
129
|
+
*/
|
|
130
|
+
onDragEnd?: (node: N, sceneApi: SceneApi) => void;
|
|
87
131
|
/**
|
|
88
132
|
* Cross-node redirect. By default the drag's live override + the
|
|
89
133
|
* committed write both land on the SELECTED node. When this returns
|
|
@@ -100,6 +144,8 @@ export type LinearResizeHandle<N> = {
|
|
|
100
144
|
max?: number | ((node: N, sceneApi: SceneApi) => number);
|
|
101
145
|
/** Snap the resized scalar to the editor's active grid step before apply. */
|
|
102
146
|
gridSnap?: boolean;
|
|
147
|
+
/** Kind-owned magnetic snap for the resized scalar, gated by the active snapping mode. */
|
|
148
|
+
magneticSnap?: (node: N, newValue: number, sceneApi: SceneApi) => number;
|
|
103
149
|
placement: HandlePlacement<N>;
|
|
104
150
|
/**
|
|
105
151
|
* Dimension this handle steers (e.g. `'height'`). When set, the editor
|
|
@@ -142,6 +188,25 @@ export type LinearResizeHandle<N> = {
|
|
|
142
188
|
* the roof shell below it. Only consulted when `shape === 'tracker'`.
|
|
143
189
|
*/
|
|
144
190
|
trackerBaseY?: (node: N, sceneApi: SceneApi) => number;
|
|
191
|
+
/**
|
|
192
|
+
* Stand the chevron blade up into the node's facing plane instead of
|
|
193
|
+
* leaving it flat in the local XZ plane. For an `axis: 'x'` handle on a
|
|
194
|
+
* wall-mounted opening (door / window), the local XZ plane is horizontal,
|
|
195
|
+
* so the default blade is seen edge-on from the front — rotating it 90°
|
|
196
|
+
* about its pointing axis lays it in the wall face (local XY) so it reads
|
|
197
|
+
* face-on toward the camera. Chevron shape only; `axis: 'y'` handles are
|
|
198
|
+
* already stood up unconditionally so this is a no-op for them.
|
|
199
|
+
*/
|
|
200
|
+
faceNormal?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Gate this arrow behind a click-to-latch cube. When set, the arrow is
|
|
203
|
+
* hidden until the user clicks the {@link LatchHandle} cube declaring the
|
|
204
|
+
* same `group` name; clicking the cube again hides it. Lets a node keep a
|
|
205
|
+
* dense cluster (e.g. a dormer's window width/height arrows) collapsed
|
|
206
|
+
* behind a single grip until the user opts in. The latch state is local to
|
|
207
|
+
* the selection and resets when the node is deselected.
|
|
208
|
+
*/
|
|
209
|
+
latchGroup?: string;
|
|
145
210
|
};
|
|
146
211
|
/**
|
|
147
212
|
* 1:1 outward growth — dragging the arrow outward by `delta` grows the
|
|
@@ -257,6 +322,11 @@ export type TapActionHandle<N = any> = {
|
|
|
257
322
|
* drag, so the move tool's own preview / ticker feedback shows up.
|
|
258
323
|
*/
|
|
259
324
|
shape?: 'arrow' | 'corner-picker' | 'move-cross';
|
|
325
|
+
/**
|
|
326
|
+
* `shape: 'corner-picker'` only — render the disc and its outer ring as a
|
|
327
|
+
* circle instead of the default hexagon.
|
|
328
|
+
*/
|
|
329
|
+
round?: boolean;
|
|
260
330
|
/**
|
|
261
331
|
* Required when `shape: 'corner-picker'` — controls the dashed leader's
|
|
262
332
|
* vertical extent. Pure callback so the descriptor doesn't need to
|
|
@@ -312,10 +382,28 @@ export type TranslateHandle<N = any> = {
|
|
|
312
382
|
snapExtents?: (node: N, sceneApi: SceneApi) => readonly [number, number] | null;
|
|
313
383
|
portal?: HandlePortal;
|
|
314
384
|
};
|
|
315
|
-
|
|
385
|
+
/**
|
|
386
|
+
* Click-to-latch cube. Renders a small persistent cube at `placement` that
|
|
387
|
+
* toggles the visibility of every handle tagged with the matching
|
|
388
|
+
* {@link LinearResizeHandle.latchGroup} `group`. Clicking the cube once shows
|
|
389
|
+
* the group's arrows; clicking again hides them. The latch state is local to
|
|
390
|
+
* the current selection and resets on deselect.
|
|
391
|
+
*
|
|
392
|
+
* Mirrors the duct-fitting selection cube but driven by descriptor data so any
|
|
393
|
+
* node can collapse a dense arrow cluster behind one grip — e.g. a dormer's
|
|
394
|
+
* window width/height arrows latch behind a cube at the window center.
|
|
395
|
+
*/
|
|
396
|
+
export type LatchHandle<N = any> = {
|
|
397
|
+
kind: 'latch';
|
|
398
|
+
/** The `latchGroup` name whose arrows this cube reveals / hides. */
|
|
399
|
+
group: string;
|
|
400
|
+
placement: HandlePlacement<N>;
|
|
401
|
+
portal?: HandlePortal;
|
|
402
|
+
};
|
|
403
|
+
export type HandleDescriptor<N = any> = LinearResizeHandle<N> | RadialResizeHandle<N> | ArcResizeHandle<N> | EndpointMoveHandle<N> | TapActionHandle<N> | TranslateHandle<N> | LatchHandle<N>;
|
|
316
404
|
/**
|
|
317
405
|
* Static array, or a function for shape-dependent cases (column
|
|
318
406
|
* crossSection / supportStyle, stair-segment segmentType, etc.).
|
|
319
407
|
*/
|
|
320
|
-
export type HandleList<N> = HandleDescriptor<N>[] | ((node: N) => HandleDescriptor<N>[]);
|
|
408
|
+
export type HandleList<N> = HandleDescriptor<N>[] | ((node: N, sceneApi?: SceneApi) => HandleDescriptor<N>[]);
|
|
321
409
|
//# sourceMappingURL=handles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../../src/registry/handles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;;;OAIG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACnC;;;;OAIG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACvC;;;OAGG;IACH,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,KAAK,KAAK,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../../src/registry/handles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;;;OAIG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACnC;;;;OAIG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACvC;;;OAGG;IACH,kBAAkB,EAAE,CAAC,IAAI,EAAE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AC,EAAE,CAAC,CAAA"}
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type { ArcResizeHandle, Cursor, EditorApi, EndpointMoveHandle, HandleAnchor, HandleAxis, HandleDescriptor, HandleList, HandlePlacement, HandlePortal, LinearResizeHandle, RadialResizeHandle, TapActionHandle, TranslateHandle, } from './handles';
|
|
2
|
-
export { discoverPlugins, getHostRefFields, getSelectableKinds, isDrawnViaTool, isDrawnViaToolKind, isPresettable, isPresettableKind, isRegistryMovable, isRegistrySelectable, kindsWithFloorplanScope, loadPlugin, nodeRegistry, type PluginDiscovery, registerNode, setPluginDiscovery, } from './registry';
|
|
1
|
+
export type { ArcResizeHandle, Cursor, EditorApi, EndpointMoveHandle, HandleAnchor, HandleAxis, HandleDescriptor, HandleList, HandlePlacement, HandlePortal, LatchHandle, LinearResizeHandle, RadialResizeHandle, TapActionHandle, TranslateHandle, } from './handles';
|
|
2
|
+
export { bakePolicyOf, discoverPlugins, extendPluginDiscovery, getHostRefFields, getNodePluginId, getSelectableKinds, hasRegistry3DMoveTool, isDrawnViaTool, isDrawnViaToolKind, isNodeKindEnabled, isPresettable, isPresettableKind, isRegistryMovable, isRegistrySelectable, kindsWithBakePolicy, kindsWithFloorplanScope, loadPlugin, nodeRegistry, type PluginDiscovery, registerNode, resolveFacingIndicator, setPluginDiscovery, } from './registry';
|
|
3
3
|
export { type CascadeContext, type ChildQuery, cascadeDirty, collectDescendants, type SpatialQuery, } from './relations-resolver';
|
|
4
4
|
export { createSceneApi, type SceneStoreLike } from './scene-api';
|
|
5
5
|
export { type CloneNodesIntoOptions, type CloneNodesIntoResult, cloneNodesInto, collectSubtree, type Subtree, } from './subtree';
|
|
6
|
-
export type { Affordance, AlignmentFootprint, AlignmentFootprintConfig, AnyNodeDefinition, AssetRef, Capabilities, CapabilityCtx, CuttableConfig, DragAction, EditorCtx, FloorPlacedConfig, FloorPlacedFootprint, FloorPlacedFootprintContext, FloorPlacedFootprintResolver, FloorPlacedFootprintsResolver, FloorplanAffordance, FloorplanAffordanceModifiers, FloorplanAffordancePoint, FloorplanAffordanceSession, FloorplanGeometry, FloorplanMoveTarget, FloorplanMoveTargetSession, FloorplanPalette, FloorplanPoint, FloorplanStyle, GeometryContext, HostableConfig, IconRef, Issue, KeyboardAction, KeyboardActions, LazyComponent, McpOverrides, Modifiers, MovableConfig, NodeCategory, NodeDefinition, NodeRegistry, PaintCapability, PaintEffectiveMaterialArgs, PaintPatchArgs, PaintPreviewArgs, PaintResolveArgs, ParamAction, ParametricDescriptor, ParamField, ParamGroup, Plugin, Presentation, Relations, RendererSource, RoofAccessoryConfig, RotatableConfig, ScalableConfig, SceneApi, SelectableConfig, SnapPointKind, SnappableConfig, SnapServicesLike, SurfacePoint, SurfaceQuery, SurfaceRole, SurfacesConfig, SystemContribution, ToolHint, Vec2, } from './types';
|
|
6
|
+
export type { Affordance, AlignmentFootprint, AlignmentFootprintConfig, AnyNodeDefinition, AssetRef, BakePolicy, BakeReplaceRenderer, Capabilities, CapabilityCtx, CuttableConfig, DimensionTerminator, DimensionTextPosition, DistributionRole, DragAction, DuplicableConfig, DuplicateSubtreeCloneArgs, DuplicateSubtreeCloneResult, EditorCtx, ExportAnimationContext, FloorPlacedConfig, FloorPlacedFootprint, FloorPlacedFootprintContext, FloorPlacedFootprintResolver, FloorPlacedFootprintsResolver, FloorplanAffordance, FloorplanAffordanceModifiers, FloorplanAffordancePoint, FloorplanAffordanceSession, FloorplanGeometry, FloorplanMoveTarget, FloorplanMoveTargetSession, FloorplanPalette, FloorplanPoint, FloorplanStyle, GeometryContext, GroupMoveSnapArgs, HostableConfig, IconRef, Issue, KeyboardAction, KeyboardActions, LazyComponent, LiveTransformLike, McpOverrides, MeasurementContribution, MeasurementFeature, MeasurementFeatureBinding, MeasurementFeatureGeometry, MeasurementSnapKind, Modifiers, MovableConfig, MovableParentFrame, NodeCategory, NodeDefinition, NodePort, NodeQuickAction, NodeQuickActionIcon, NodeQuickActionNodeScope, NodeQuickActionProvider, NodeQuickActionResult, NodeRegistry, PaintCapability, PaintEffectiveMaterialArgs, PaintPatchArgs, PaintPreviewArgs, PaintResolveArgs, ParamAction, ParametricDescriptor, ParamField, ParamGroup, ParentFrameSnapMatch, Plugin, Presentation, QuickMeasurementMetric, QuickMeasurementQuantity, QuickMeasurementReport, Relations, RendererSource, RoofAccessoryConfig, RotatableConfig, ScalableConfig, SceneActionCapability, SceneApi, SelectableConfig, SlotDeclaration, SnapPointKind, SnapProfile, SnappableConfig, SnapServicesLike, SurfacePoint, SurfaceQuery, SurfaceRole, SurfacesConfig, SystemContribution, ToolHint, ToolHintChip, Vec2, } from './types';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,YAAY,EACZ,KAAK,eAAe,EACpB,YAAY,EACZ,kBAAkB,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,YAAY,EACZ,kBAAkB,EAClB,KAAK,YAAY,GAClB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,cAAc,EACd,cAAc,EACd,KAAK,OAAO,GACb,MAAM,WAAW,CAAA;AAClB,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,wBAAwB,EACxB,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,cAAc,EACd,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,mBAAmB,EACnB,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,OAAO,EACP,KAAK,EACL,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,MAAM,EACN,YAAY,EACZ,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,IAAI,GACL,MAAM,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,YAAY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AClB,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,MAAM,EACN,YAAY,EACZ,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,IAAI,GACL,MAAM,SAAS,CAAA"}
|
package/dist/registry/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { discoverPlugins, getHostRefFields, getSelectableKinds, isDrawnViaTool, isDrawnViaToolKind, isPresettable, isPresettableKind, isRegistryMovable, isRegistrySelectable, kindsWithFloorplanScope, loadPlugin, nodeRegistry, registerNode, setPluginDiscovery, } from './registry';
|
|
1
|
+
export { bakePolicyOf, discoverPlugins, extendPluginDiscovery, getHostRefFields, getNodePluginId, getSelectableKinds, hasRegistry3DMoveTool, isDrawnViaTool, isDrawnViaToolKind, isNodeKindEnabled, isPresettable, isPresettableKind, isRegistryMovable, isRegistrySelectable, kindsWithBakePolicy, kindsWithFloorplanScope, loadPlugin, nodeRegistry, registerNode, resolveFacingIndicator, setPluginDiscovery, } from './registry';
|
|
2
2
|
export { cascadeDirty, collectDescendants, } from './relations-resolver';
|
|
3
3
|
export { createSceneApi } from './scene-api';
|
|
4
4
|
export { cloneNodesInto, collectSubtree, } from './subtree';
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import type { AnyNodeDefinition, NodeRegistry, Plugin } from './types';
|
|
1
|
+
import type { AnyNodeDefinition, BakePolicy, NodeRegistry, Plugin } from './types';
|
|
2
2
|
export declare const nodeRegistry: NodeRegistry & {
|
|
3
3
|
_register: (def: AnyNodeDefinition) => void;
|
|
4
4
|
_reset: () => void;
|
|
5
5
|
};
|
|
6
6
|
export declare function registerNode(def: AnyNodeDefinition): void;
|
|
7
|
+
/** The plugin that registered a node kind, when it came through {@link loadPlugin}. */
|
|
8
|
+
export declare function getNodePluginId(kind: string): string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Whether a registered kind should participate in a project. Kinds registered
|
|
11
|
+
* directly by the host and the built-in plugin are always enabled. An omitted
|
|
12
|
+
* install list means a legacy scene whose plugin state predates persistence, so
|
|
13
|
+
* loaded plugins remain visible for backward compatibility.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isNodeKindEnabled(kind: string, installedPlugins?: readonly string[]): boolean;
|
|
7
16
|
/**
|
|
8
17
|
* Returns the set of registered kinds whose definition declares the
|
|
9
18
|
* `selectable` capability. Callers that maintain hardcoded "selectable kinds"
|
|
@@ -28,6 +37,16 @@ export declare function isRegistrySelectable(kind: string): boolean;
|
|
|
28
37
|
* that didn't set the field at all.
|
|
29
38
|
*/
|
|
30
39
|
export declare function kindsWithFloorplanScope(scope: 'level' | 'building'): string[];
|
|
40
|
+
/**
|
|
41
|
+
* A kind's {@link BakePolicy} from the registry, defaulting to `'static'` for
|
|
42
|
+
* kinds that don't declare one (or aren't registered). The bake and the baked
|
|
43
|
+
* `/viewer` consult this instead of hardcoding kind names — see
|
|
44
|
+
* plans/editor-plugin-trees-example.md → Part D.
|
|
45
|
+
*/
|
|
46
|
+
export declare function bakePolicyOf(kind: string): BakePolicy;
|
|
47
|
+
/** Registered kinds whose {@link BakePolicy} matches `policy`. `'static'` is the
|
|
48
|
+
* default, so `kindsWithBakePolicy('static')` includes kinds that didn't set it. */
|
|
49
|
+
export declare function kindsWithBakePolicy(policy: BakePolicy): string[];
|
|
31
50
|
/**
|
|
32
51
|
* Returns true when the kind is movable from a 2D floor-plan handle —
|
|
33
52
|
* either via `capabilities.movable`, an explicit
|
|
@@ -36,6 +55,15 @@ export declare function kindsWithFloorplanScope(scope: 'level' | 'building'): st
|
|
|
36
55
|
* chain in `floating-action-menu.tsx`.
|
|
37
56
|
*/
|
|
38
57
|
export declare function isRegistryMovable(kind: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the kind has a move tool that MOUNTS in the 3D viewport — the
|
|
60
|
+
* generic `capabilities.movable` mover or a bespoke `affordanceTools.move`.
|
|
61
|
+
* Narrower than {@link isRegistryMovable}, which also accepts floorplan-only
|
|
62
|
+
* movers (e.g. zone) that have no 3D tool. Gates 3D direct move: Ctrl/Meta-drag
|
|
63
|
+
* and the move-cross grip. Kept beside `isRegistryMovable` so the 2D and 3D
|
|
64
|
+
* movability predicates can't drift apart.
|
|
65
|
+
*/
|
|
66
|
+
export declare function hasRegistry3DMoveTool(kind: string): boolean;
|
|
39
67
|
/**
|
|
40
68
|
* Whether the kind can be saved as a reusable preset. Default: an
|
|
41
69
|
* explicit `capabilities.presettable` boolean wins; otherwise the kind
|
|
@@ -44,6 +72,15 @@ export declare function isRegistryMovable(kind: string): boolean;
|
|
|
44
72
|
*/
|
|
45
73
|
export declare function isPresettable(def: AnyNodeDefinition): boolean;
|
|
46
74
|
export declare function isPresettableKind(kind: string): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Resolve a kind's facing-triangle config, or `null` when it has none.
|
|
77
|
+
* `{ reversed }` says whether the triangle points along the node's local -Z
|
|
78
|
+
* (its front) instead of +Z. One reader (the editor-side `<FacingPoseIndicator>`
|
|
79
|
+
* publishers) so placement and move stay consistent.
|
|
80
|
+
*/
|
|
81
|
+
export declare function resolveFacingIndicator(kind: string): {
|
|
82
|
+
reversed: boolean;
|
|
83
|
+
} | null;
|
|
47
84
|
/**
|
|
48
85
|
* Names of schema fields on `def` that are host references (`wallId`,
|
|
49
86
|
* `wallT`, etc.). Read by host apps at preset-save time to strip these
|
|
@@ -69,8 +106,8 @@ export declare function loadPlugin(plugin: Plugin): Promise<void>;
|
|
|
69
106
|
* {@link setPluginDiscovery} before the bootstrap module runs.
|
|
70
107
|
*
|
|
71
108
|
* Kept async so a future loader can fetch over the network without
|
|
72
|
-
* changing the contract. See `wiki/
|
|
73
|
-
* plugin author surface this enables.
|
|
109
|
+
* changing the contract. See `wiki/architecture/plugin-authoring.md` for
|
|
110
|
+
* the plugin author surface this enables.
|
|
74
111
|
*/
|
|
75
112
|
export type PluginDiscovery = () => Promise<Plugin[]>;
|
|
76
113
|
/**
|
|
@@ -84,6 +121,12 @@ export type PluginDiscovery = () => Promise<Plugin[]>;
|
|
|
84
121
|
* gate + duplicate-kind protection applies.
|
|
85
122
|
*/
|
|
86
123
|
export declare function setPluginDiscovery(fn: PluginDiscovery): void;
|
|
124
|
+
/**
|
|
125
|
+
* Extend the current plugin discovery instead of replacing it. Useful for app-
|
|
126
|
+
* bundled example or first-party plugins that should load alongside any host-
|
|
127
|
+
* provided discovery source, not clobber it.
|
|
128
|
+
*/
|
|
129
|
+
export declare function extendPluginDiscovery(fn: PluginDiscovery): void;
|
|
87
130
|
/**
|
|
88
131
|
* Run the active plugin discovery and return the discovered plugins.
|
|
89
132
|
* Bootstrap code is expected to call this after `loadPlugin(builtinPlugin)`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,U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gB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAIjF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC,CAE9E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAE9D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGxD;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU9D;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;AAMrD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,eAAe,GAAG,IAAI,CAO5D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,eAAe,GAAG,IAAI,CAM/D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAEnD"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const HOST_API_VERSION = 1;
|
|
2
|
+
const BUILTIN_PLUGIN_ID = 'pascal:core';
|
|
3
|
+
const pluginIdsByKind = new Map();
|
|
2
4
|
// True in dev / test builds, false in production. Tries Vite's
|
|
3
5
|
// `import.meta.env.DEV` first (the editor app's bundler) and falls back
|
|
4
6
|
// to `process.env.NODE_ENV !== 'production'` for Node test runners.
|
|
@@ -63,12 +65,29 @@ class NodeRegistryImpl {
|
|
|
63
65
|
// Test-only — clears the registry. Not exported from the package barrel.
|
|
64
66
|
_reset() {
|
|
65
67
|
this.defs.clear();
|
|
68
|
+
pluginIdsByKind.clear();
|
|
66
69
|
}
|
|
67
70
|
}
|
|
68
71
|
export const nodeRegistry = new NodeRegistryImpl();
|
|
69
72
|
export function registerNode(def) {
|
|
70
73
|
nodeRegistry._register(def);
|
|
71
74
|
}
|
|
75
|
+
/** The plugin that registered a node kind, when it came through {@link loadPlugin}. */
|
|
76
|
+
export function getNodePluginId(kind) {
|
|
77
|
+
return pluginIdsByKind.get(kind);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Whether a registered kind should participate in a project. Kinds registered
|
|
81
|
+
* directly by the host and the built-in plugin are always enabled. An omitted
|
|
82
|
+
* install list means a legacy scene whose plugin state predates persistence, so
|
|
83
|
+
* loaded plugins remain visible for backward compatibility.
|
|
84
|
+
*/
|
|
85
|
+
export function isNodeKindEnabled(kind, installedPlugins) {
|
|
86
|
+
const pluginId = getNodePluginId(kind);
|
|
87
|
+
if (!pluginId || pluginId === BUILTIN_PLUGIN_ID || installedPlugins === undefined)
|
|
88
|
+
return true;
|
|
89
|
+
return installedPlugins.includes(pluginId);
|
|
90
|
+
}
|
|
72
91
|
/**
|
|
73
92
|
* Returns the set of registered kinds whose definition declares the
|
|
74
93
|
* `selectable` capability. Callers that maintain hardcoded "selectable kinds"
|
|
@@ -111,6 +130,25 @@ export function kindsWithFloorplanScope(scope) {
|
|
|
111
130
|
}
|
|
112
131
|
return result;
|
|
113
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* A kind's {@link BakePolicy} from the registry, defaulting to `'static'` for
|
|
135
|
+
* kinds that don't declare one (or aren't registered). The bake and the baked
|
|
136
|
+
* `/viewer` consult this instead of hardcoding kind names — see
|
|
137
|
+
* plans/editor-plugin-trees-example.md → Part D.
|
|
138
|
+
*/
|
|
139
|
+
export function bakePolicyOf(kind) {
|
|
140
|
+
return nodeRegistry.get(kind)?.bake ?? 'static';
|
|
141
|
+
}
|
|
142
|
+
/** Registered kinds whose {@link BakePolicy} matches `policy`. `'static'` is the
|
|
143
|
+
* default, so `kindsWithBakePolicy('static')` includes kinds that didn't set it. */
|
|
144
|
+
export function kindsWithBakePolicy(policy) {
|
|
145
|
+
const result = [];
|
|
146
|
+
for (const [kind, def] of nodeRegistry.entries()) {
|
|
147
|
+
if ((def.bake ?? 'static') === policy)
|
|
148
|
+
result.push(kind);
|
|
149
|
+
}
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
114
152
|
/**
|
|
115
153
|
* Returns true when the kind is movable from a 2D floor-plan handle —
|
|
116
154
|
* either via `capabilities.movable`, an explicit
|
|
@@ -130,6 +168,20 @@ export function isRegistryMovable(kind) {
|
|
|
130
168
|
return true;
|
|
131
169
|
return false;
|
|
132
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Whether the kind has a move tool that MOUNTS in the 3D viewport — the
|
|
173
|
+
* generic `capabilities.movable` mover or a bespoke `affordanceTools.move`.
|
|
174
|
+
* Narrower than {@link isRegistryMovable}, which also accepts floorplan-only
|
|
175
|
+
* movers (e.g. zone) that have no 3D tool. Gates 3D direct move: Ctrl/Meta-drag
|
|
176
|
+
* and the move-cross grip. Kept beside `isRegistryMovable` so the 2D and 3D
|
|
177
|
+
* movability predicates can't drift apart.
|
|
178
|
+
*/
|
|
179
|
+
export function hasRegistry3DMoveTool(kind) {
|
|
180
|
+
const def = nodeRegistry.get(kind);
|
|
181
|
+
if (!def)
|
|
182
|
+
return false;
|
|
183
|
+
return def.capabilities.movable !== undefined || def.affordanceTools?.move !== undefined;
|
|
184
|
+
}
|
|
133
185
|
/**
|
|
134
186
|
* Whether the kind can be saved as a reusable preset. Default: an
|
|
135
187
|
* explicit `capabilities.presettable` boolean wins; otherwise the kind
|
|
@@ -146,6 +198,18 @@ export function isPresettableKind(kind) {
|
|
|
146
198
|
const def = nodeRegistry.get(kind);
|
|
147
199
|
return def ? isPresettable(def) : false;
|
|
148
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Resolve a kind's facing-triangle config, or `null` when it has none.
|
|
203
|
+
* `{ reversed }` says whether the triangle points along the node's local -Z
|
|
204
|
+
* (its front) instead of +Z. One reader (the editor-side `<FacingPoseIndicator>`
|
|
205
|
+
* publishers) so placement and move stay consistent.
|
|
206
|
+
*/
|
|
207
|
+
export function resolveFacingIndicator(kind) {
|
|
208
|
+
const facing = nodeRegistry.get(kind)?.facingIndicator;
|
|
209
|
+
if (!facing)
|
|
210
|
+
return null;
|
|
211
|
+
return { reversed: facing === true ? false : (facing.reversed ?? false) };
|
|
212
|
+
}
|
|
149
213
|
/**
|
|
150
214
|
* Names of schema fields on `def` that are host references (`wallId`,
|
|
151
215
|
* `wallT`, etc.). Read by host apps at preset-save time to strip these
|
|
@@ -175,9 +239,11 @@ export async function loadPlugin(plugin) {
|
|
|
175
239
|
}
|
|
176
240
|
for (const def of plugin.nodes ?? []) {
|
|
177
241
|
registerNode(def);
|
|
242
|
+
pluginIdsByKind.set(def.kind, plugin.id);
|
|
178
243
|
}
|
|
179
244
|
}
|
|
180
|
-
|
|
245
|
+
const defaultPluginDiscovery = async () => [];
|
|
246
|
+
let pluginDiscovery = defaultPluginDiscovery;
|
|
181
247
|
/**
|
|
182
248
|
* Replace the plugin discovery implementation. Call once at app startup
|
|
183
249
|
* before {@link discoverPlugins} is invoked (bootstrap order matters).
|
|
@@ -189,8 +255,23 @@ let pluginDiscovery = async () => [];
|
|
|
189
255
|
* gate + duplicate-kind protection applies.
|
|
190
256
|
*/
|
|
191
257
|
export function setPluginDiscovery(fn) {
|
|
258
|
+
if (isDevMode() && pluginDiscovery !== defaultPluginDiscovery) {
|
|
259
|
+
console.warn('[registry] setPluginDiscovery replaced an existing discovery chain — plugins registered earlier (e.g. via extendPluginDiscovery) are dropped. Use extendPluginDiscovery to compose instead.');
|
|
260
|
+
}
|
|
192
261
|
pluginDiscovery = fn;
|
|
193
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Extend the current plugin discovery instead of replacing it. Useful for app-
|
|
265
|
+
* bundled example or first-party plugins that should load alongside any host-
|
|
266
|
+
* provided discovery source, not clobber it.
|
|
267
|
+
*/
|
|
268
|
+
export function extendPluginDiscovery(fn) {
|
|
269
|
+
const previous = pluginDiscovery;
|
|
270
|
+
pluginDiscovery = async () => {
|
|
271
|
+
const [base, extra] = await Promise.all([previous(), fn()]);
|
|
272
|
+
return [...base, ...extra];
|
|
273
|
+
};
|
|
274
|
+
}
|
|
194
275
|
/**
|
|
195
276
|
* Run the active plugin discovery and return the discovered plugins.
|
|
196
277
|
* Bootstrap code is expected to call this after `loadPlugin(builtinPlugin)`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subtree.d.ts","sourceRoot":"","sources":["../../src/registry/subtree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subtree.d.ts","sourceRoot":"","sources":["../../src/registry/subtree.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAmBzD,kDAAkD;AAClD,MAAM,MAAM,OAAO,GAAG;IACpB,oEAAoE;IACpE,IAAI,EAAE,OAAO,CAAA;IACb,gGAAgG;IAChG,WAAW,EAAE,OAAO,EAAE,CAAA;CACvB,CAAA;AAcD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,EAC3C,MAAM,EAAE,SAAS,GAChB,OAAO,GAAG,IAAI,CAmBhB;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;;OAKG;IACH,MAAM,EAAE,SAAS,CAAA;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CAC7C,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,8DAA8D;IAC9D,MAAM,EAAE,SAAS,CAAA;IACjB,uEAAuE;IACvE,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB,qFAAqF;IACrF,KAAK,EAAE,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;CACjC,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,IAAI,EAAE,qBAAqB,GAC1B,oBAAoB,CAmEtB"}
|
package/dist/registry/subtree.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { remapConstructionDimensionReferences, remapMeasurementReferences, } from '../lib/measurement-geometry';
|
|
1
2
|
import { generateId } from '../schema/base';
|
|
2
3
|
function extractIdPrefix(id) {
|
|
3
4
|
const i = id.indexOf('_');
|
|
@@ -72,7 +73,7 @@ export function cloneNodesInto(nodes, opts) {
|
|
|
72
73
|
const out = [];
|
|
73
74
|
let root = null;
|
|
74
75
|
for (const original of nodes) {
|
|
75
|
-
|
|
76
|
+
let cloned = JSON.parse(JSON.stringify(original));
|
|
76
77
|
const freshId = idMap.get(original.id);
|
|
77
78
|
cloned.id = freshId;
|
|
78
79
|
// parentId: root's parentId becomes opts.parentId (or preserved
|
|
@@ -97,6 +98,12 @@ export function cloneNodesInto(nodes, opts) {
|
|
|
97
98
|
.map((cid) => idMap.get(cid))
|
|
98
99
|
.filter((cid) => cid !== undefined);
|
|
99
100
|
}
|
|
101
|
+
if (cloned.type === 'measurement') {
|
|
102
|
+
cloned.measurement = remapMeasurementReferences(cloned.measurement, idMap);
|
|
103
|
+
}
|
|
104
|
+
if (cloned.type === 'construction-dimension') {
|
|
105
|
+
cloned = remapConstructionDimensionReferences(cloned, idMap);
|
|
106
|
+
}
|
|
100
107
|
if (original.id === opts.rootId) {
|
|
101
108
|
if (opts.position) {
|
|
102
109
|
;
|