@pascal-app/core 1.0.0 → 1.0.3
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/dist/capture/index.d.ts +2 -2
- package/dist/capture/index.js +2 -2
- package/dist/capture/schema.d.ts.map +1 -1
- package/dist/capture/schema.js +2 -0
- package/dist/capture/source.d.ts +1 -1
- package/dist/capture/source.js +1 -1
- package/dist/events/bus.d.ts +6 -3
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts +4 -4
- package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/floor-placed-elevation.js +7 -12
- package/dist/hooks/spatial-grid/floor-placed-footprints.d.ts +4 -0
- package/dist/hooks/spatial-grid/floor-placed-footprints.d.ts.map +1 -0
- package/dist/hooks/spatial-grid/floor-placed-footprints.js +7 -0
- package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts +5 -8
- package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-manager.js +23 -106
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +263 -84
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-sync.js +77 -13
- package/dist/hooks/spatial-grid/support-host-patch.d.ts +1 -1
- package/dist/hooks/spatial-grid/support-host-patch.js +6 -6
- package/dist/hooks/spatial-grid/use-spatial-query.d.ts +1 -1
- package/dist/hooks/spatial-grid/use-spatial-query.js +1 -1
- package/dist/index.d.ts +77 -72
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -69
- package/dist/lib/door-operation.d.ts +1 -1
- package/dist/lib/item-polygon-overlap.d.ts +6 -0
- package/dist/lib/item-polygon-overlap.d.ts.map +1 -0
- package/dist/lib/item-polygon-overlap.js +67 -0
- package/dist/lib/level-name.d.ts +1 -1
- package/dist/lib/measurement-geometry.d.ts +4 -4
- package/dist/lib/node-visibility.d.ts +12 -0
- package/dist/lib/node-visibility.d.ts.map +1 -0
- package/dist/lib/node-visibility.js +12 -0
- package/dist/lib/plan-footprint.d.ts +41 -0
- package/dist/lib/plan-footprint.d.ts.map +1 -0
- package/dist/lib/plan-footprint.js +58 -0
- package/dist/lib/room-topology-index.d.ts +1 -1
- package/dist/lib/room-topology-index.js +1 -1
- package/dist/lib/selection-proxy.d.ts +1 -1
- package/dist/lib/slab-polygon.d.ts +2 -2
- package/dist/lib/slab-polygon.js +2 -2
- package/dist/lib/space-detection.d.ts +1 -1
- package/dist/lib/space-detection.d.ts.map +1 -1
- package/dist/lib/space-detection.js +16 -11
- package/dist/lib/terrain-brush.d.ts +1 -1
- package/dist/lib/terrain-brush.js +1 -1
- package/dist/lib/terrain-codec.d.ts +2 -2
- package/dist/lib/terrain-codec.js +1 -1
- package/dist/lib/terrain-raycast.d.ts +1 -1
- package/dist/lib/terrain-raycast.js +1 -1
- package/dist/lib/terrain-source.d.ts +3 -3
- package/dist/lib/terrain-source.js +3 -3
- package/dist/lib/terrain-support.d.ts +1 -1
- package/dist/lib/terrain-support.js +3 -3
- package/dist/lib/unit-containment.d.ts +19 -0
- package/dist/lib/unit-containment.d.ts.map +1 -0
- package/dist/lib/unit-containment.js +158 -0
- package/dist/lib/unit-report.d.ts +19 -0
- package/dist/lib/unit-report.d.ts.map +1 -0
- package/dist/lib/unit-report.js +36 -0
- package/dist/lib/wall-distance.d.ts +2 -2
- package/dist/lib/wall-distance.js +1 -1
- package/dist/lib/zone-quantities.d.ts +1 -1
- package/dist/lib/zone-quantities.js +7 -7
- package/dist/material-library.d.ts +1 -1
- package/dist/material-library.js +1 -1
- package/dist/procedural-items/fixtures.d.ts +261 -0
- package/dist/procedural-items/fixtures.d.ts.map +1 -0
- package/dist/procedural-items/fixtures.js +349 -0
- package/dist/procedural-items/index.d.ts +10 -0
- package/dist/procedural-items/index.d.ts.map +1 -0
- package/dist/procedural-items/index.js +9 -0
- package/dist/procedural-items/integration.d.ts +92 -0
- package/dist/procedural-items/integration.d.ts.map +1 -0
- package/dist/procedural-items/integration.js +19 -0
- package/dist/procedural-items/library-colors.d.ts +56 -0
- package/dist/procedural-items/library-colors.d.ts.map +1 -0
- package/dist/procedural-items/library-colors.js +84 -0
- package/dist/procedural-items/materials.d.ts +5 -0
- package/dist/procedural-items/materials.d.ts.map +1 -0
- package/dist/procedural-items/materials.js +47 -0
- package/dist/procedural-items/node.d.ts +280 -0
- package/dist/procedural-items/node.d.ts.map +1 -0
- package/dist/procedural-items/node.js +71 -0
- package/dist/procedural-items/placement.d.ts +7 -0
- package/dist/procedural-items/placement.d.ts.map +1 -0
- package/dist/procedural-items/placement.js +48 -0
- package/dist/procedural-items/query.d.ts +51 -0
- package/dist/procedural-items/query.d.ts.map +1 -0
- package/dist/procedural-items/query.js +342 -0
- package/dist/procedural-items/recipe.d.ts +144 -0
- package/dist/procedural-items/recipe.d.ts.map +1 -0
- package/dist/procedural-items/recipe.js +372 -0
- package/dist/procedural-items/spatial.d.ts +19 -0
- package/dist/procedural-items/spatial.d.ts.map +1 -0
- package/dist/procedural-items/spatial.js +39 -0
- package/dist/registry/__bench__/relations-resolver.bench.js +2 -2
- package/dist/registry/handles.d.ts +40 -5
- package/dist/registry/handles.d.ts.map +1 -1
- package/dist/registry/index.d.ts +6 -6
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +4 -4
- package/dist/registry/registry.d.ts +1 -1
- package/dist/registry/relations-resolver.d.ts +2 -2
- package/dist/registry/relations-resolver.js +1 -1
- package/dist/registry/scene-api.d.ts +2 -2
- package/dist/registry/scene-api.js +2 -2
- package/dist/registry/subtree.d.ts +1 -1
- package/dist/registry/subtree.d.ts.map +1 -1
- package/dist/registry/subtree.js +8 -2
- package/dist/registry/types.d.ts +32 -10
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/use-registry-version.js +1 -1
- package/dist/registry/validate-relations.d.ts +4 -0
- package/dist/registry/validate-relations.d.ts.map +1 -0
- package/dist/registry/validate-relations.js +22 -0
- package/dist/schema/__bench__/node-parsers.bench.js +3 -3
- package/dist/schema/__fixtures__/node-fixtures.d.ts +1 -1
- package/dist/schema/__fixtures__/node-fixtures.d.ts.map +1 -1
- package/dist/schema/__fixtures__/node-fixtures.js +4 -2
- package/dist/schema/base.js +1 -1
- package/dist/schema/collections.d.ts +1 -1
- package/dist/schema/collections.js +1 -1
- package/dist/schema/compiled-node-parsers.d.ts +1 -1
- package/dist/schema/compiled-node-parsers.js +1 -1
- package/dist/schema/index.d.ts +74 -70
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +65 -61
- package/dist/schema/material.d.ts +1 -1
- package/dist/schema/material.js +1 -1
- package/dist/schema/nodes/automatic-downspout.d.ts +4 -4
- package/dist/schema/nodes/automatic-downspout.js +5 -5
- package/dist/schema/nodes/block.d.ts +3 -3
- package/dist/schema/nodes/block.d.ts.map +1 -1
- package/dist/schema/nodes/block.js +24 -12
- package/dist/schema/nodes/box-vent.js +2 -2
- package/dist/schema/nodes/building.d.ts +1 -1
- package/dist/schema/nodes/building.d.ts.map +1 -1
- package/dist/schema/nodes/building.js +8 -5
- package/dist/schema/nodes/cabinet.d.ts +4 -4
- package/dist/schema/nodes/cabinet.js +4 -4
- package/dist/schema/nodes/ceiling.d.ts +1 -1
- package/dist/schema/nodes/ceiling.js +5 -5
- package/dist/schema/nodes/chimney.js +2 -2
- package/dist/schema/nodes/column.d.ts +1 -0
- package/dist/schema/nodes/column.d.ts.map +1 -1
- package/dist/schema/nodes/column.js +3 -2
- package/dist/schema/nodes/construction-dimension.d.ts +3 -3
- package/dist/schema/nodes/construction-dimension.js +2 -2
- package/dist/schema/nodes/cupola.d.ts +1 -1
- package/dist/schema/nodes/cupola.js +2 -2
- package/dist/schema/nodes/curtain-wall.d.ts +129 -0
- package/dist/schema/nodes/curtain-wall.d.ts.map +1 -0
- package/dist/schema/nodes/curtain-wall.js +49 -0
- package/dist/schema/nodes/door.d.ts +2 -2
- package/dist/schema/nodes/door.js +2 -2
- package/dist/schema/nodes/dormer.d.ts +3 -3
- package/dist/schema/nodes/dormer.js +4 -4
- package/dist/schema/nodes/downspout.js +2 -2
- package/dist/schema/nodes/duct-fitting.js +1 -1
- package/dist/schema/nodes/duct-segment.js +2 -2
- package/dist/schema/nodes/duct-terminal.js +1 -1
- package/dist/schema/nodes/elevator.js +2 -2
- package/dist/schema/nodes/eyebrow-vent.js +2 -2
- package/dist/schema/nodes/fence.js +2 -2
- package/dist/schema/nodes/guide.js +2 -2
- package/dist/schema/nodes/gutter.d.ts +1 -1
- package/dist/schema/nodes/gutter.js +4 -4
- package/dist/schema/nodes/hvac-equipment.js +1 -1
- package/dist/schema/nodes/imported-mesh.d.ts +40 -0
- package/dist/schema/nodes/imported-mesh.d.ts.map +1 -0
- package/dist/schema/nodes/imported-mesh.js +27 -0
- package/dist/schema/nodes/item.d.ts +3 -3
- package/dist/schema/nodes/item.js +3 -3
- package/dist/schema/nodes/lean-to-extension.js +4 -4
- package/dist/schema/nodes/level.d.ts +1 -1
- package/dist/schema/nodes/level.d.ts.map +1 -1
- package/dist/schema/nodes/level.js +1 -1
- package/dist/schema/nodes/lineset.js +1 -1
- package/dist/schema/nodes/liquid-line.js +1 -1
- package/dist/schema/nodes/measurement.js +2 -2
- package/dist/schema/nodes/pipe-fitting.d.ts +1 -1
- package/dist/schema/nodes/pipe-fitting.js +1 -1
- package/dist/schema/nodes/pipe-segment.d.ts +1 -1
- package/dist/schema/nodes/pipe-segment.js +2 -2
- package/dist/schema/nodes/pipe-trap.d.ts +1 -1
- package/dist/schema/nodes/pipe-trap.js +1 -1
- package/dist/schema/nodes/ridge-vent.d.ts +1 -1
- package/dist/schema/nodes/ridge-vent.js +3 -3
- package/dist/schema/nodes/roof-segment-shape.d.ts +1 -1
- package/dist/schema/nodes/roof-segment-shape.js +1 -1
- package/dist/schema/nodes/roof-segment-walls.d.ts +1 -1
- package/dist/schema/nodes/roof-segment-walls.js +1 -1
- package/dist/schema/nodes/roof-segment.d.ts +2 -2
- package/dist/schema/nodes/roof-segment.js +2 -2
- package/dist/schema/nodes/roof.d.ts +1 -1
- package/dist/schema/nodes/roof.js +3 -3
- package/dist/schema/nodes/scan.js +3 -3
- package/dist/schema/nodes/shelf.d.ts +1 -1
- package/dist/schema/nodes/shelf.d.ts.map +1 -1
- package/dist/schema/nodes/shelf.js +3 -4
- package/dist/schema/nodes/site.js +2 -2
- package/dist/schema/nodes/skylight.d.ts +4 -4
- package/dist/schema/nodes/skylight.js +2 -2
- package/dist/schema/nodes/slab.js +3 -3
- package/dist/schema/nodes/solar-panel.js +3 -3
- package/dist/schema/nodes/spawn.js +1 -1
- package/dist/schema/nodes/stair-segment.js +2 -2
- package/dist/schema/nodes/stair.d.ts +1 -1
- package/dist/schema/nodes/stair.js +3 -3
- package/dist/schema/nodes/structural-grid.js +1 -1
- package/dist/schema/nodes/turbine-vent.d.ts +1 -1
- package/dist/schema/nodes/turbine-vent.js +2 -2
- package/dist/schema/nodes/unit.d.ts +33 -0
- package/dist/schema/nodes/unit.d.ts.map +1 -0
- package/dist/schema/nodes/unit.js +13 -0
- package/dist/schema/nodes/wall.d.ts +75 -2
- package/dist/schema/nodes/wall.d.ts.map +1 -1
- package/dist/schema/nodes/wall.js +10 -6
- package/dist/schema/nodes/window.js +2 -2
- package/dist/schema/nodes/zone.js +1 -1
- package/dist/schema/scene-material.js +2 -2
- package/dist/schema/types.d.ts +417 -22
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +56 -49
- package/dist/services/__fixtures__/hosting.d.ts +3 -0
- package/dist/services/__fixtures__/hosting.d.ts.map +1 -0
- package/dist/services/__fixtures__/hosting.js +9 -0
- package/dist/services/__fixtures__/shelf-surface-rows.d.ts +4 -0
- package/dist/services/__fixtures__/shelf-surface-rows.d.ts.map +1 -0
- package/dist/services/__fixtures__/shelf-surface-rows.js +18 -0
- package/dist/services/alignment-anchors.d.ts +6 -11
- package/dist/services/alignment-anchors.d.ts.map +1 -1
- package/dist/services/alignment-anchors.js +7 -34
- package/dist/services/drag-session.d.ts +4 -4
- package/dist/services/drag-session.js +1 -1
- package/dist/services/hosting.d.ts +5 -8
- package/dist/services/hosting.d.ts.map +1 -1
- package/dist/services/hosting.js +25 -18
- package/dist/services/index.d.ts +16 -13
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +16 -13
- package/dist/services/level-height.d.ts +2 -2
- package/dist/services/level-height.js +3 -3
- package/dist/services/movement.d.ts +3 -3
- package/dist/services/movement.js +2 -2
- package/dist/services/port-connectivity.d.ts +1 -1
- package/dist/services/port-connectivity.js +1 -1
- package/dist/services/riser-diagram.d.ts +1 -1
- package/dist/services/shelf-board.d.ts +5 -0
- package/dist/services/shelf-board.d.ts.map +1 -0
- package/dist/services/shelf-board.js +15 -0
- package/dist/services/snap.d.ts +3 -0
- package/dist/services/snap.d.ts.map +1 -1
- package/dist/services/snap.js +11 -0
- package/dist/services/storey.d.ts +2 -2
- package/dist/services/storey.js +2 -2
- package/dist/services/surface-hosting-procedural-parity.fixtures.d.ts +13 -0
- package/dist/services/surface-hosting-procedural-parity.fixtures.d.ts.map +1 -0
- package/dist/services/surface-hosting-procedural-parity.fixtures.js +4691 -0
- package/dist/services/surface-hosting-shelf-parity.fixtures.d.ts +1060 -0
- package/dist/services/surface-hosting-shelf-parity.fixtures.d.ts.map +1 -0
- package/dist/services/surface-hosting-shelf-parity.fixtures.js +3127 -0
- package/dist/services/surface-hosting.d.ts +92 -0
- package/dist/services/surface-hosting.d.ts.map +1 -0
- package/dist/services/surface-hosting.js +305 -0
- package/dist/services/surface-region.d.ts +8 -0
- package/dist/services/surface-region.d.ts.map +1 -0
- package/dist/services/surface-region.js +44 -0
- package/dist/services/system-graph.d.ts +2 -2
- package/dist/services/system-graph.js +2 -2
- package/dist/services/validate-dwv.d.ts +1 -1
- package/dist/services/validate-dwv.js +1 -1
- package/dist/store/actions/node-actions.d.ts +2 -2
- package/dist/store/actions/node-actions.d.ts.map +1 -1
- package/dist/store/actions/node-actions.js +50 -104
- package/dist/store/history-control.d.ts +3 -3
- package/dist/store/history-invalidation.d.ts +1 -1
- package/dist/store/history-invalidation.js +1 -1
- package/dist/store/use-interactive.d.ts +2 -2
- package/dist/store/use-live-terrain.d.ts +1 -1
- package/dist/store/use-scene.d.ts +4 -4
- package/dist/store/use-scene.d.ts.map +1 -1
- package/dist/store/use-scene.js +50 -32
- package/dist/systems/elevator/elevator-dispatch.d.ts +2 -2
- package/dist/systems/elevator/elevator-dispatch.js +1 -1
- package/dist/systems/elevator/elevator-geometry.d.ts +1 -1
- package/dist/systems/elevator/elevator-opening-sync.d.ts +1 -1
- package/dist/systems/elevator/elevator-opening-sync.js +2 -2
- package/dist/systems/elevator/elevator-opening-system.js +3 -3
- package/dist/systems/elevator/elevator-runtime.d.ts +3 -3
- package/dist/systems/elevator/elevator-runtime.js +3 -3
- package/dist/systems/elevator/elevator-service.d.ts +1 -1
- package/dist/systems/elevator/elevator-service.js +1 -1
- package/dist/systems/fence/fence-centerline.d.ts +2 -2
- package/dist/systems/fence/fence-centerline.js +2 -2
- package/dist/systems/fence/fence-spline.d.ts +2 -2
- package/dist/systems/roof/roof-elevation-system.js +3 -3
- package/dist/systems/roof/roof-elevation.d.ts +2 -2
- package/dist/systems/roof/roof-elevation.js +6 -6
- package/dist/systems/roof/roof-footprint.d.ts +1 -1
- package/dist/systems/roof/roof-footprint.js +3 -3
- package/dist/systems/slab/slab-placement.d.ts +1 -1
- package/dist/systems/slab/slab-support.d.ts +1 -1
- package/dist/systems/slab/slab-support.js +4 -4
- package/dist/systems/stair/stair-flight.d.ts +2 -2
- package/dist/systems/stair/stair-flight.js +2 -2
- package/dist/systems/stair/stair-footprint.d.ts +1 -1
- package/dist/systems/stair/stair-opening-preview.d.ts +248 -87
- package/dist/systems/stair/stair-opening-preview.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-preview.js +2 -2
- package/dist/systems/stair/stair-opening-sync.d.ts +1 -1
- package/dist/systems/stair/stair-opening-sync.js +6 -6
- package/dist/systems/stair/stair-opening-system.js +8 -8
- package/dist/systems/stair/stair-rise.d.ts +1 -1
- package/dist/systems/stair/stair-rise.js +3 -3
- package/dist/systems/wall/wall-curve.d.ts +2 -2
- package/dist/systems/wall/wall-footprint.d.ts +3 -3
- package/dist/systems/wall/wall-footprint.js +3 -3
- package/dist/systems/wall/wall-merge.d.ts +38 -0
- package/dist/systems/wall/wall-merge.d.ts.map +1 -0
- package/dist/systems/wall/wall-merge.js +240 -0
- package/dist/systems/wall/wall-mitering.d.ts +1 -1
- package/dist/systems/wall/wall-mitering.js +1 -1
- package/dist/systems/wall/wall-move.d.ts +1 -1
- package/dist/systems/wall/wall-operations.d.ts +28 -0
- package/dist/systems/wall/wall-operations.d.ts.map +1 -0
- package/dist/systems/wall/wall-operations.js +145 -0
- package/dist/systems/wall/wall-top.d.ts +1 -1
- package/dist/systems/wall/wall-topology.d.ts +9 -2
- package/dist/systems/wall/wall-topology.d.ts.map +1 -1
- package/dist/systems/wall/wall-topology.js +57 -9
- package/dist/utils/clone-scene-graph.d.ts +3 -3
- package/dist/utils/clone-scene-graph.d.ts.map +1 -1
- package/dist/utils/clone-scene-graph.js +9 -3
- package/dist/utils/scene-migrations.d.ts +3 -3
- package/dist/utils/scene-migrations.js +3 -3
- package/dist/utils/vertical-scene-migration.js +5 -5
- package/dist/validation/validate-build-json.d.ts +5 -2
- package/dist/validation/validate-build-json.d.ts.map +1 -1
- package/dist/validation/validate-build-json.js +57 -4
- package/package.json +15 -4
package/dist/schema/types.js
CHANGED
|
@@ -1,51 +1,54 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
2
|
+
import { ProceduralItemNode } from '../procedural-items/node.js';
|
|
3
|
+
import { BlockNode } from './nodes/block.js';
|
|
4
|
+
import { BoxVentNode } from './nodes/box-vent.js';
|
|
5
|
+
import { BuildingNode } from './nodes/building.js';
|
|
6
|
+
import { CabinetModuleNode, CabinetNode } from './nodes/cabinet.js';
|
|
7
|
+
import { CeilingNode } from './nodes/ceiling.js';
|
|
8
|
+
import { ChimneyNode } from './nodes/chimney.js';
|
|
9
|
+
import { ColumnNode } from './nodes/column.js';
|
|
10
|
+
import { ConstructionDimensionNode } from './nodes/construction-dimension.js';
|
|
11
|
+
import { CupolaNode } from './nodes/cupola.js';
|
|
12
|
+
import { DoorNode } from './nodes/door.js';
|
|
13
|
+
import { DormerNode } from './nodes/dormer.js';
|
|
14
|
+
import { DownspoutNode } from './nodes/downspout.js';
|
|
15
|
+
import { DuctFittingNode } from './nodes/duct-fitting.js';
|
|
16
|
+
import { DuctSegmentNode } from './nodes/duct-segment.js';
|
|
17
|
+
import { DuctTerminalNode } from './nodes/duct-terminal.js';
|
|
18
|
+
import { ElevatorNode } from './nodes/elevator.js';
|
|
19
|
+
import { EyebrowVentNode } from './nodes/eyebrow-vent.js';
|
|
20
|
+
import { FenceNode } from './nodes/fence.js';
|
|
21
|
+
import { GuideNode } from './nodes/guide.js';
|
|
22
|
+
import { GutterNode } from './nodes/gutter.js';
|
|
23
|
+
import { HvacEquipmentNode } from './nodes/hvac-equipment.js';
|
|
24
|
+
import { ImportedMeshNode } from './nodes/imported-mesh.js';
|
|
25
|
+
import { ItemNode } from './nodes/item.js';
|
|
26
|
+
import { LeanToExtensionNode } from './nodes/lean-to-extension.js';
|
|
27
|
+
import { LevelNode } from './nodes/level.js';
|
|
28
|
+
import { LinesetNode } from './nodes/lineset.js';
|
|
29
|
+
import { LiquidLineNode } from './nodes/liquid-line.js';
|
|
30
|
+
import { MeasurementNode } from './nodes/measurement.js';
|
|
31
|
+
import { PipeFittingNode } from './nodes/pipe-fitting.js';
|
|
32
|
+
import { PipeSegmentNode } from './nodes/pipe-segment.js';
|
|
33
|
+
import { PipeTrapNode } from './nodes/pipe-trap.js';
|
|
34
|
+
import { RidgeVentNode } from './nodes/ridge-vent.js';
|
|
35
|
+
import { RoofNode } from './nodes/roof.js';
|
|
36
|
+
import { RoofSegmentNode } from './nodes/roof-segment.js';
|
|
37
|
+
import { ScanNode } from './nodes/scan.js';
|
|
38
|
+
import { ShelfNode } from './nodes/shelf.js';
|
|
39
|
+
import { SiteNode } from './nodes/site.js';
|
|
40
|
+
import { SkylightNode } from './nodes/skylight.js';
|
|
41
|
+
import { SlabNode } from './nodes/slab.js';
|
|
42
|
+
import { SolarPanelNode } from './nodes/solar-panel.js';
|
|
43
|
+
import { SpawnNode } from './nodes/spawn.js';
|
|
44
|
+
import { StairNode } from './nodes/stair.js';
|
|
45
|
+
import { StairSegmentNode } from './nodes/stair-segment.js';
|
|
46
|
+
import { StructuralGridNode } from './nodes/structural-grid.js';
|
|
47
|
+
import { TurbineVentNode } from './nodes/turbine-vent.js';
|
|
48
|
+
import { UnitNode } from './nodes/unit.js';
|
|
49
|
+
import { WallNode } from './nodes/wall.js';
|
|
50
|
+
import { WindowNode } from './nodes/window.js';
|
|
51
|
+
import { ZoneNode } from './nodes/zone.js';
|
|
49
52
|
/**
|
|
50
53
|
* Assembles the node union on discriminators that claim exactly one value.
|
|
51
54
|
*
|
|
@@ -58,11 +61,12 @@ import { ZoneNode } from './nodes/zone';
|
|
|
58
61
|
*
|
|
59
62
|
* Each member is therefore projected to a clone whose `type` is the bare
|
|
60
63
|
* literal. Per-kind schemas keep their default; only the union's view of the
|
|
61
|
-
* discriminator narrows.
|
|
64
|
+
* discriminator narrows. `safeExtend` retains member refinements, including
|
|
65
|
+
* procedural recipe/parameter validation. Metadata lives in zod's global registry keyed by
|
|
62
66
|
* instance, so `.describe()` text has to be carried over to the clone by hand.
|
|
63
67
|
*/
|
|
64
68
|
export const nodeUnion = (members) => z.discriminatedUnion('type', members.map((member) => {
|
|
65
|
-
const projected = member.
|
|
69
|
+
const projected = member.safeExtend({ type: member.shape.type.unwrap() });
|
|
66
70
|
const meta = z.globalRegistry.get(member);
|
|
67
71
|
return meta ? projected.meta(meta) : projected;
|
|
68
72
|
}));
|
|
@@ -70,6 +74,7 @@ export const AnyNode = nodeUnion([
|
|
|
70
74
|
SiteNode,
|
|
71
75
|
BuildingNode,
|
|
72
76
|
ElevatorNode,
|
|
77
|
+
UnitNode,
|
|
73
78
|
LevelNode,
|
|
74
79
|
LeanToExtensionNode,
|
|
75
80
|
ColumnNode,
|
|
@@ -81,6 +86,8 @@ export const AnyNode = nodeUnion([
|
|
|
81
86
|
CabinetNode,
|
|
82
87
|
CabinetModuleNode,
|
|
83
88
|
ItemNode,
|
|
89
|
+
ProceduralItemNode,
|
|
90
|
+
ImportedMeshNode,
|
|
84
91
|
ZoneNode,
|
|
85
92
|
SlabNode,
|
|
86
93
|
CeilingNode,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosting.d.ts","sourceRoot":"","sources":["../../../src/services/__fixtures__/hosting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,iBAAiB,QAOpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shelf-surface-rows.d.ts","sourceRoot":"","sources":["../../../src/services/__fixtures__/shelf-surface-rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAGzD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CASrD,CAAA;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,EAAE,CAK3D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Captured from production shelf geometry; checked against it in the nodes suite.
|
|
2
|
+
export const shelfSurfaceRows = {
|
|
3
|
+
'wall-shelf,false,1.8,3,0.04': [0.64, 1.24, 1.8399999999999999],
|
|
4
|
+
'wall-shelf,true,1.8,3,0.04': [0.64, 1.24, 1.8399999999999999],
|
|
5
|
+
'bookshelf,false,1.8,3,0.04': [0.64, 1.24, 1.8399999999999999],
|
|
6
|
+
'bookshelf,true,1.8,3,0.04': [0.04, 0.64, 1.24, 1.8399999999999999],
|
|
7
|
+
'open-rack,false,1.8,3,0.04': [0.64, 1.24, 1.8399999999999999],
|
|
8
|
+
'open-rack,true,1.8,3,0.04': [0.64, 1.24, 1.8399999999999999],
|
|
9
|
+
'cubby,false,1.8,3,0.04': [0.64, 1.24, 1.8399999999999999],
|
|
10
|
+
'cubby,true,1.8,3,0.04': [0.04, 0.64, 1.24, 1.8399999999999999],
|
|
11
|
+
};
|
|
12
|
+
export function shelfRowSurfaceYs(node) {
|
|
13
|
+
const key = [node.style, node.withBottom, node.height, node.rows, node.thickness].join(',');
|
|
14
|
+
const rows = shelfSurfaceRows[key];
|
|
15
|
+
if (!rows)
|
|
16
|
+
throw new Error(`Missing shelf row fixture: ${key}`);
|
|
17
|
+
return rows;
|
|
18
|
+
}
|
|
@@ -11,19 +11,14 @@
|
|
|
11
11
|
* (building-local for nodes inside a building). The 3D move producer works
|
|
12
12
|
* entirely in that frame, so the resulting guides line up with the cursor.
|
|
13
13
|
*/
|
|
14
|
-
import type
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
minZ: number;
|
|
19
|
-
maxX: number;
|
|
20
|
-
maxZ: number;
|
|
21
|
-
};
|
|
14
|
+
import { type PlanAabb } from '../lib/plan-footprint.js';
|
|
15
|
+
import type { AnyNode } from '../schema/types.js';
|
|
16
|
+
import { type AlignmentAnchor } from './alignment.js';
|
|
17
|
+
export type FootprintAABB = PlanAabb;
|
|
22
18
|
/**
|
|
23
19
|
* Axis-aligned XZ bounding box of a rotated rectangle centred at
|
|
24
|
-
* `position`.
|
|
25
|
-
*
|
|
26
|
-
* footprint used for collision / slab elevation.
|
|
20
|
+
* `position`. Delegates to pure `planFootprintAABB` (same math as
|
|
21
|
+
* spatial-grid / MCP layout clearance).
|
|
27
22
|
*/
|
|
28
23
|
export declare function footprintAABBFrom(position: readonly [number, number, number], dimensions: readonly [number, number, number], rotationY: number): FootprintAABB;
|
|
29
24
|
/** XZ footprint AABB of a floor-placed node at its current position, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alignment-anchors.d.ts","sourceRoot":"","sources":["../../src/services/alignment-anchors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"alignment-anchors.d.ts","sourceRoot":"","sources":["../../src/services/alignment-anchors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,uBAAuB,CAAA;AAExE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,aAAa,CAAA;AAErE,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAA;AAEpC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC3C,UAAU,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC7C,SAAS,EAAE,MAAM,GAChB,aAAa,CAEf;AAwDD;iDACiD;AACjD,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAKjE;AAED;;4EAE4E;AAC5E,wBAAgB,eAAe,CAC7B,IAAI,EAAE,OAAO,EACb,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,SAAS,CAAC,EAAE,MAAM,GACjB,aAAa,GAAG,IAAI,CAItB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,EACb,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,SAAS,CAAC,EAAE,MAAM,GACjB,eAAe,EAAE,CAInB;AAoBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,EACpD,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,SAAS,CAAC,EAAE,MAAM,GACjB,eAAe,EAAE,CAuBnB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,GAAG,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,SAAS,CAAC,EAAE,MAAM,GACjB,eAAe,EAAE,CAwBnB;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,GAC7C,eAAe,EAAE,CAEnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,OAAO,EACb,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,eAAe,EAAE,CAqDnB;AAoBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,eAAe,EAAE,CAWnB"}
|
|
@@ -11,44 +11,17 @@
|
|
|
11
11
|
* (building-local for nodes inside a building). The 3D move producer works
|
|
12
12
|
* entirely in that frame, so the resulting guides line up with the cursor.
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { planFootprintAABB } from '../lib/plan-footprint.js';
|
|
15
|
+
import { nodeRegistry } from '../registry/index.js';
|
|
16
|
+
import { DEFAULT_WALL_THICKNESS } from '../systems/wall/wall-footprint.js';
|
|
17
|
+
import { bboxCornerAnchors } from './alignment.js';
|
|
17
18
|
/**
|
|
18
19
|
* Axis-aligned XZ bounding box of a rotated rectangle centred at
|
|
19
|
-
* `position`.
|
|
20
|
-
*
|
|
21
|
-
* footprint used for collision / slab elevation.
|
|
20
|
+
* `position`. Delegates to pure `planFootprintAABB` (same math as
|
|
21
|
+
* spatial-grid / MCP layout clearance).
|
|
22
22
|
*/
|
|
23
23
|
export function footprintAABBFrom(position, dimensions, rotationY) {
|
|
24
|
-
|
|
25
|
-
const [w, , d] = dimensions;
|
|
26
|
-
const halfW = w / 2;
|
|
27
|
-
const halfD = d / 2;
|
|
28
|
-
const cos = Math.cos(rotationY);
|
|
29
|
-
const sin = Math.sin(rotationY);
|
|
30
|
-
let minX = Number.POSITIVE_INFINITY;
|
|
31
|
-
let minZ = Number.POSITIVE_INFINITY;
|
|
32
|
-
let maxX = Number.NEGATIVE_INFINITY;
|
|
33
|
-
let maxZ = Number.NEGATIVE_INFINITY;
|
|
34
|
-
for (const [lx, lz] of [
|
|
35
|
-
[-halfW, -halfD],
|
|
36
|
-
[halfW, -halfD],
|
|
37
|
-
[halfW, halfD],
|
|
38
|
-
[-halfW, halfD],
|
|
39
|
-
]) {
|
|
40
|
-
const wx = x + (lx * cos - lz * sin);
|
|
41
|
-
const wz = z + (lx * sin + lz * cos);
|
|
42
|
-
if (wx < minX)
|
|
43
|
-
minX = wx;
|
|
44
|
-
if (wx > maxX)
|
|
45
|
-
maxX = wx;
|
|
46
|
-
if (wz < minZ)
|
|
47
|
-
minZ = wz;
|
|
48
|
-
if (wz > maxZ)
|
|
49
|
-
maxZ = wz;
|
|
50
|
-
}
|
|
51
|
-
return { minX, minZ, maxX, maxZ };
|
|
24
|
+
return planFootprintAABB(position, dimensions, rotationY);
|
|
52
25
|
}
|
|
53
26
|
/** The relocatable box footprint for a node, or null when it has none
|
|
54
27
|
* (walls / slabs / polygon kinds) or the kind's predicate excludes it
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ChildQuery, type SpatialQuery } from '../registry/relations-resolver';
|
|
2
|
-
import type { DragAction, Modifiers, SceneApi } from '../registry/types';
|
|
3
|
-
import type { AnyNode } from '../schema/types';
|
|
4
|
-
import type { Vec2 } from './snap';
|
|
1
|
+
import { type ChildQuery, type SpatialQuery } from '../registry/relations-resolver.js';
|
|
2
|
+
import type { DragAction, Modifiers, SceneApi } from '../registry/types.js';
|
|
3
|
+
import type { AnyNode } from '../schema/types.js';
|
|
4
|
+
import type { Vec2 } from './snap.js';
|
|
5
5
|
/**
|
|
6
6
|
* Pure orchestrator for a single `DragAction` lifecycle:
|
|
7
7
|
* begin → (preview → snap? → apply → cascade dirty)* → commit | cancel
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cascadeDirty } from '../registry/relations-resolver';
|
|
1
|
+
import { cascadeDirty } from '../registry/relations-resolver.js';
|
|
2
2
|
const EMPTY_MODIFIERS = { shift: false, alt: false, ctrl: false, meta: false };
|
|
3
3
|
export function createDragSession(action, scene, options = {}) {
|
|
4
4
|
let active = false;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { SceneApi, SurfacesConfig } from '../registry/types';
|
|
2
|
-
import type {
|
|
1
|
+
import type { SceneApi, SurfacesConfig } from '../registry/types.js';
|
|
2
|
+
import type { ItemNode } from '../schema/nodes/item.js';
|
|
3
|
+
import type { AnyNode, AnyNodeId } from '../schema/types.js';
|
|
3
4
|
/**
|
|
4
5
|
* Maximum depth a node tree can host. Guards items-on-items-on-items chains
|
|
5
6
|
* from growing pathological — pre-Phase-1 the editor had no cap. Set high
|
|
@@ -22,10 +23,6 @@ export type AttachError = {
|
|
|
22
23
|
} | {
|
|
23
24
|
kind: 'host-missing';
|
|
24
25
|
hostId: AnyNodeId;
|
|
25
|
-
} | {
|
|
26
|
-
kind: 'kind-not-allowed';
|
|
27
|
-
hostKind: string;
|
|
28
|
-
allowed: readonly string[];
|
|
29
26
|
};
|
|
30
27
|
export type AttachResult = {
|
|
31
28
|
ok: true;
|
|
@@ -43,10 +40,9 @@ export type AttachResult = {
|
|
|
43
40
|
* - The hosting chain (child → host → host.parent → ...) must not contain
|
|
44
41
|
* `child` (cycle prevention).
|
|
45
42
|
* - The resulting chain must not exceed {@link MAX_HOST_DEPTH}.
|
|
46
|
-
* - If the child's NodeDefinition declares `capabilities.hostable.parents`,
|
|
47
|
-
* `host.type` must appear in that list.
|
|
48
43
|
*/
|
|
49
44
|
export declare function canAttach(childId: AnyNodeId, hostId: AnyNodeId, scene: SceneApi): AttachResult;
|
|
45
|
+
export declare function wouldCreateHostingCycle(childId: string, host: Pick<AnyNode, 'id' | 'parentId'>, scene: Pick<SceneApi, 'get'>): boolean;
|
|
50
46
|
/**
|
|
51
47
|
* Returns the surfaces declared by a host's NodeDefinition. Surfaces describe
|
|
52
48
|
* where other nodes can stack/mount — the `top` of a slab, the `sides` of a
|
|
@@ -85,4 +81,5 @@ export declare function pickHost(args: {
|
|
|
85
81
|
* is declared. Returns the original Y if the host has no top surface.
|
|
86
82
|
*/
|
|
87
83
|
export declare function clampYToHostTop(host: AnyNode, originalY: number, nodes?: Record<string, AnyNode>): number;
|
|
84
|
+
export declare function clearFaceHostItemFields(host: AnyNode | undefined): Partial<ItemNode>;
|
|
88
85
|
//# sourceMappingURL=hosting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosting.d.ts","sourceRoot":"","sources":["../../src/services/hosting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAEpD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"hosting.d.ts","sourceRoot":"","sources":["../../src/services/hosting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAEpD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,CAAA;AAE/C,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAA;AAE3E;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,GAAG,YAAY,CAsB9F;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,UAAU,CAAC,EACtC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,GAC3B,OAAO,CAUT;AAoBD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAG/D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,EACb,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAuB,GACnD,MAAM,GAAG,IAAI,CAKf;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAGnD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE;IAC7B,KAAK,EAAE,IAAI,CAAA;IACX,UAAU,EAAE,SAAS,OAAO,EAAE,CAAA;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,KAAK,OAAO,CAAA;CAClD,GAAG,OAAO,GAAG,IAAI,CAUjB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAGR;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,CAQpF"}
|
package/dist/services/hosting.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nodeRegistry } from '../registry/registry';
|
|
1
|
+
import { nodeRegistry } from '../registry/registry.js';
|
|
2
2
|
/**
|
|
3
3
|
* Maximum depth a node tree can host. Guards items-on-items-on-items chains
|
|
4
4
|
* from growing pathological — pre-Phase-1 the editor had no cap. Set high
|
|
@@ -16,8 +16,6 @@ export const MAX_HOST_DEPTH = 6;
|
|
|
16
16
|
* - The hosting chain (child → host → host.parent → ...) must not contain
|
|
17
17
|
* `child` (cycle prevention).
|
|
18
18
|
* - The resulting chain must not exceed {@link MAX_HOST_DEPTH}.
|
|
19
|
-
* - If the child's NodeDefinition declares `capabilities.hostable.parents`,
|
|
20
|
-
* `host.type` must appear in that list.
|
|
21
19
|
*/
|
|
22
20
|
export function canAttach(childId, hostId, scene) {
|
|
23
21
|
if (childId === hostId) {
|
|
@@ -33,23 +31,22 @@ export function canAttach(childId, hostId, scene) {
|
|
|
33
31
|
// the caller is responsible for ensuring child exists before commit.
|
|
34
32
|
return checkDepth(hostId, scene);
|
|
35
33
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (allowed && allowed.length > 0 && !allowed.includes(host.type)) {
|
|
39
|
-
return {
|
|
40
|
-
ok: false,
|
|
41
|
-
error: { kind: 'kind-not-allowed', hostKind: host.type, allowed },
|
|
42
|
-
};
|
|
34
|
+
if (wouldCreateHostingCycle(childId, host, scene)) {
|
|
35
|
+
return { ok: false, error: { kind: 'cycle', nodeId: childId, hostId } };
|
|
43
36
|
}
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
return checkDepth(hostId, scene);
|
|
38
|
+
}
|
|
39
|
+
export function wouldCreateHostingCycle(childId, host, scene) {
|
|
40
|
+
const visited = new Set();
|
|
41
|
+
let cursor = host.id;
|
|
46
42
|
while (cursor) {
|
|
47
|
-
if (cursor
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
cursor =
|
|
43
|
+
if (cursor === childId || visited.has(cursor))
|
|
44
|
+
return true;
|
|
45
|
+
visited.add(cursor);
|
|
46
|
+
cursor =
|
|
47
|
+
(scene.get(cursor) ?? (cursor === host.id ? host : undefined))?.parentId ?? null;
|
|
51
48
|
}
|
|
52
|
-
return
|
|
49
|
+
return false;
|
|
53
50
|
}
|
|
54
51
|
function checkDepth(hostId, scene) {
|
|
55
52
|
// Count host's own depth (root = 0); attaching adds 1 to the child's depth.
|
|
@@ -98,7 +95,7 @@ export function getTopSurfaceHeight(host, nodes = { [host.id]: host }) {
|
|
|
98
95
|
*/
|
|
99
96
|
export function canHostOnTop(host) {
|
|
100
97
|
const attachTo = host.asset?.attachTo;
|
|
101
|
-
return attachTo !== 'ceiling';
|
|
98
|
+
return attachTo !== 'ceiling' && !host.recipe?.mounting;
|
|
102
99
|
}
|
|
103
100
|
/**
|
|
104
101
|
* Pure host-discovery helper. Given a list of candidate hosts (already
|
|
@@ -129,3 +126,13 @@ export function clampYToHostTop(host, originalY, nodes) {
|
|
|
129
126
|
const top = getTopSurfaceHeight(host, nodes);
|
|
130
127
|
return top == null ? originalY : top;
|
|
131
128
|
}
|
|
129
|
+
export function clearFaceHostItemFields(host) {
|
|
130
|
+
const patch = {};
|
|
131
|
+
for (const field of (host &&
|
|
132
|
+
nodeRegistry.get(host.type)?.capabilities.faceHost?.clearItemFields) ??
|
|
133
|
+
[]) {
|
|
134
|
+
;
|
|
135
|
+
patch[field] = undefined;
|
|
136
|
+
}
|
|
137
|
+
return patch;
|
|
138
|
+
}
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
export { type AlignmentAnchor, type AlignmentGuide, type AlignmentGuideAxis, type AnchorKind, type BuildingPose, bboxAnchors, bboxCornerAnchors, type ResolveAlignmentInBuildingResult, type ResolveAlignmentInput, type ResolveAlignmentResult, resolveAlignment, resolveAlignmentInBuildingWorld, } from './alignment';
|
|
2
|
-
export { collectAlignmentAnchors, type FootprintAABB, footprintAABB, footprintAABBAt, footprintAABBFrom, movingAlignmentAnchors, movingFootprintAnchors, nodeAlignmentAnchors, polygonAnchors, wallSegmentAnchors, } from './alignment-anchors';
|
|
3
|
-
export { createDragSession, type DragSession, type DragSessionInput, type DragSessionOptions, } from './drag-session';
|
|
4
|
-
export { type AttachError, type AttachResult, canAttach, canHostOnTop, clampYToHostTop, getSurface, getTopSurfaceHeight, MAX_HOST_DEPTH, pickHost, type Vec3, } from './hosting';
|
|
5
|
-
export { DEFAULT_LEVEL_HEIGHT, getCeilingAt, getCeilingHeightAt, resolveCeilingHeight, } from './level-height';
|
|
6
|
-
export { type AxisLock, applyAxisLock, isMovable, movePlanToward, moveToward, resolveMovable, } from './movement';
|
|
7
|
-
export { type AlongWallAlignment, type AlongWallFeature, computeEdgeGaps, computeOpeningGuides, DEFAULT_OPENING_GUIDE_TOLERANCES, detectAlongWallAlignment, detectEqualSpacing, detectVerticalAlignment, type EdgeGap, type EqualSpacingRun, type OpeningGuideInput, type OpeningGuides, type OpeningGuideTolerances, type OpeningSpan, type SillHeadGuide, type VerticalAlignment, type VerticalFeature, type WallExtent, } from './opening-guides';
|
|
8
|
-
export { analyzePortConnectivity, type PortConnection, type PortConnectivity, resolveConnectivityUpdates, } from './port-connectivity';
|
|
9
|
-
export { buildRiserDiagram, projectIso, type RiserDiagram, type RiserLine, type RiserMarker, } from './riser-diagram';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export { type
|
|
1
|
+
export { type AlignmentAnchor, type AlignmentGuide, type AlignmentGuideAxis, type AnchorKind, type BuildingPose, bboxAnchors, bboxCornerAnchors, type ResolveAlignmentInBuildingResult, type ResolveAlignmentInput, type ResolveAlignmentResult, resolveAlignment, resolveAlignmentInBuildingWorld, } from './alignment.js';
|
|
2
|
+
export { collectAlignmentAnchors, type FootprintAABB, footprintAABB, footprintAABBAt, footprintAABBFrom, movingAlignmentAnchors, movingFootprintAnchors, nodeAlignmentAnchors, polygonAnchors, wallSegmentAnchors, } from './alignment-anchors.js';
|
|
3
|
+
export { createDragSession, type DragSession, type DragSessionInput, type DragSessionOptions, } from './drag-session.js';
|
|
4
|
+
export { type AttachError, type AttachResult, canAttach, canHostOnTop, clampYToHostTop, clearFaceHostItemFields, getSurface, getTopSurfaceHeight, MAX_HOST_DEPTH, pickHost, type Vec3, wouldCreateHostingCycle, } from './hosting.js';
|
|
5
|
+
export { DEFAULT_LEVEL_HEIGHT, getCeilingAt, getCeilingHeightAt, resolveCeilingHeight, } from './level-height.js';
|
|
6
|
+
export { type AxisLock, applyAxisLock, isMovable, movePlanToward, moveToward, resolveMovable, } from './movement.js';
|
|
7
|
+
export { type AlongWallAlignment, type AlongWallFeature, computeEdgeGaps, computeOpeningGuides, DEFAULT_OPENING_GUIDE_TOLERANCES, detectAlongWallAlignment, detectEqualSpacing, detectVerticalAlignment, type EdgeGap, type EqualSpacingRun, type OpeningGuideInput, type OpeningGuides, type OpeningGuideTolerances, type OpeningSpan, type SillHeadGuide, type VerticalAlignment, type VerticalFeature, type WallExtent, } from './opening-guides.js';
|
|
8
|
+
export { analyzePortConnectivity, type PortConnection, type PortConnectivity, resolveConnectivityUpdates, } from './port-connectivity.js';
|
|
9
|
+
export { buildRiserDiagram, projectIso, type RiserDiagram, type RiserLine, type RiserMarker, } from './riser-diagram.js';
|
|
10
|
+
export { SHELF_BOARD_INSET, shelfBoardDimensions, shelfRowBoardDimensions } from './shelf-board.js';
|
|
11
|
+
export { DEFAULT_ANGLE_STEP, DEFAULT_GRID_STEP, type SnapServices, snapAngleToList, snapLocalXZInWorld, snapPointAlongAngleRay, snapPointToAngle, snapPointToGrid, snapScalar, snapServices, snapVec3ToGrid, snapWorldXZToBuildingLocal, } from './snap.js';
|
|
12
|
+
export { CEILING_CLAMP_MARGIN, findLevelAboveId, findLevelBelowId, getCeilingClampBound, getCoveringSlabUndersideAt, getLevelAbove, getLevelBelow, getLevelElevations, getLevelFloorToFloorHeight, getStoredLevelHeight, getWallPlaneTop, type LevelElevation, } from './storey.js';
|
|
13
|
+
export { canHostSurfaceChild, type DeclaredHostSurface, getSurfaceProvider, type HostSurface, hitDerivedSurfaceProvider, itemSurfaceProvider, NON_PHYSICAL_HOST_KINDS, proceduralItemSurfaceProvider, rendersHostedChildren, resolveSurfacePlacement, type SurfaceContext, type SurfaceHit, type SurfaceId, type SurfacePlacement, type SurfaceProvider, type SurfaceRegion, type SurfaceRejectReason, shelfSurfaceProvider, } from './surface-hosting.js';
|
|
14
|
+
export { surfaceRegionContainsFootprint, surfaceRegionContainsPoint } from './surface-region.js';
|
|
15
|
+
export { buildPortComponents, collectSystemPorts, distributionPointToWorld, type SystemSummary, summarizeSystemFor, } from './system-graph.js';
|
|
16
|
+
export { type DwvFinding, type DwvSeverity, validateDwv, } from './validate-dwv.js';
|
|
14
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,WAAW,EACX,iBAAiB,EACjB,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,uBAAuB,EACvB,KAAK,aAAa,EAClB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,SAAS,EACT,YAAY,EACZ,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACR,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"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"}
|
package/dist/services/index.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
export { bboxAnchors, bboxCornerAnchors, resolveAlignment, resolveAlignmentInBuildingWorld, } from './alignment';
|
|
2
|
-
export { collectAlignmentAnchors, footprintAABB, footprintAABBAt, footprintAABBFrom, movingAlignmentAnchors, movingFootprintAnchors, nodeAlignmentAnchors, polygonAnchors, wallSegmentAnchors, } from './alignment-anchors';
|
|
3
|
-
export { createDragSession, } from './drag-session';
|
|
4
|
-
export { canAttach, canHostOnTop, clampYToHostTop, getSurface, getTopSurfaceHeight, MAX_HOST_DEPTH, pickHost, } from './hosting';
|
|
5
|
-
export { DEFAULT_LEVEL_HEIGHT, getCeilingAt, getCeilingHeightAt, resolveCeilingHeight, } from './level-height';
|
|
6
|
-
export { applyAxisLock, isMovable, movePlanToward, moveToward, resolveMovable, } from './movement';
|
|
7
|
-
export { computeEdgeGaps, computeOpeningGuides, DEFAULT_OPENING_GUIDE_TOLERANCES, detectAlongWallAlignment, detectEqualSpacing, detectVerticalAlignment, } from './opening-guides';
|
|
8
|
-
export { analyzePortConnectivity, resolveConnectivityUpdates, } from './port-connectivity';
|
|
9
|
-
export { buildRiserDiagram, projectIso, } from './riser-diagram';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
1
|
+
export { bboxAnchors, bboxCornerAnchors, resolveAlignment, resolveAlignmentInBuildingWorld, } from './alignment.js';
|
|
2
|
+
export { collectAlignmentAnchors, footprintAABB, footprintAABBAt, footprintAABBFrom, movingAlignmentAnchors, movingFootprintAnchors, nodeAlignmentAnchors, polygonAnchors, wallSegmentAnchors, } from './alignment-anchors.js';
|
|
3
|
+
export { createDragSession, } from './drag-session.js';
|
|
4
|
+
export { canAttach, canHostOnTop, clampYToHostTop, clearFaceHostItemFields, getSurface, getTopSurfaceHeight, MAX_HOST_DEPTH, pickHost, wouldCreateHostingCycle, } from './hosting.js';
|
|
5
|
+
export { DEFAULT_LEVEL_HEIGHT, getCeilingAt, getCeilingHeightAt, resolveCeilingHeight, } from './level-height.js';
|
|
6
|
+
export { applyAxisLock, isMovable, movePlanToward, moveToward, resolveMovable, } from './movement.js';
|
|
7
|
+
export { computeEdgeGaps, computeOpeningGuides, DEFAULT_OPENING_GUIDE_TOLERANCES, detectAlongWallAlignment, detectEqualSpacing, detectVerticalAlignment, } from './opening-guides.js';
|
|
8
|
+
export { analyzePortConnectivity, resolveConnectivityUpdates, } from './port-connectivity.js';
|
|
9
|
+
export { buildRiserDiagram, projectIso, } from './riser-diagram.js';
|
|
10
|
+
export { SHELF_BOARD_INSET, shelfBoardDimensions, shelfRowBoardDimensions } from './shelf-board.js';
|
|
11
|
+
export { DEFAULT_ANGLE_STEP, DEFAULT_GRID_STEP, snapAngleToList, snapLocalXZInWorld, snapPointAlongAngleRay, snapPointToAngle, snapPointToGrid, snapScalar, snapServices, snapVec3ToGrid, snapWorldXZToBuildingLocal, } from './snap.js';
|
|
12
|
+
export { CEILING_CLAMP_MARGIN, findLevelAboveId, findLevelBelowId, getCeilingClampBound, getCoveringSlabUndersideAt, getLevelAbove, getLevelBelow, getLevelElevations, getLevelFloorToFloorHeight, getStoredLevelHeight, getWallPlaneTop, } from './storey.js';
|
|
13
|
+
export { canHostSurfaceChild, getSurfaceProvider, hitDerivedSurfaceProvider, itemSurfaceProvider, NON_PHYSICAL_HOST_KINDS, proceduralItemSurfaceProvider, rendersHostedChildren, resolveSurfacePlacement, shelfSurfaceProvider, } from './surface-hosting.js';
|
|
14
|
+
export { surfaceRegionContainsFootprint, surfaceRegionContainsPoint } from './surface-region.js';
|
|
15
|
+
export { buildPortComponents, collectSystemPorts, distributionPointToWorld, summarizeSystemFor, } from './system-graph.js';
|
|
16
|
+
export { validateDwv, } from './validate-dwv.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CeilingNode } from '../schema';
|
|
2
|
-
import type { AnyNode, AnyNodeId } from '../schema/types';
|
|
1
|
+
import type { CeilingNode } from '../schema/index.js';
|
|
2
|
+
import type { AnyNode, AnyNodeId } from '../schema/types.js';
|
|
3
3
|
export declare const DEFAULT_LEVEL_HEIGHT = 2.5;
|
|
4
4
|
/**
|
|
5
5
|
* Effective ceiling height in level-local meters. An explicit stored
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computeWallSlabSupport, pointInPolygon } from '../systems/slab/slab-support';
|
|
2
|
-
import { resolveWallTop } from '../systems/wall/wall-top';
|
|
1
|
+
import { computeWallSlabSupport, pointInPolygon } from '../systems/slab/slab-support.js';
|
|
2
|
+
import { resolveWallTop } from '../systems/wall/wall-top.js';
|
|
3
3
|
// Cycle with ./storey (it imports DEFAULT_LEVEL_HEIGHT from here) is safe:
|
|
4
4
|
// both sides only reference the other inside function bodies.
|
|
5
|
-
import { CEILING_CLAMP_MARGIN, getCeilingClampBound } from './storey';
|
|
5
|
+
import { CEILING_CLAMP_MARGIN, getCeilingClampBound } from './storey.js';
|
|
6
6
|
export const DEFAULT_LEVEL_HEIGHT = 2.5;
|
|
7
7
|
/**
|
|
8
8
|
* Effective ceiling height in level-local meters. An explicit stored
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { MovableConfig } from '../registry/types';
|
|
2
|
-
import type { AnyNode } from '../schema/types';
|
|
3
|
-
import { type Vec3 } from './snap';
|
|
1
|
+
import type { MovableConfig } from '../registry/types.js';
|
|
2
|
+
import type { AnyNode } from '../schema/types.js';
|
|
3
|
+
import { type Vec3 } from './snap.js';
|
|
4
4
|
/**
|
|
5
5
|
* Pure movement constraint helpers. Given a node and a target position, apply
|
|
6
6
|
* the constraints declared in `def.capabilities.movable` (axis lock, grid
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { nodeRegistry } from '../registry/registry';
|
|
2
|
-
import { snapVec3ToGrid } from './snap';
|
|
1
|
+
import { nodeRegistry } from '../registry/registry.js';
|
|
2
|
+
import { snapVec3ToGrid } from './snap.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the MovableConfig effective for `node` after running its `override`
|
|
5
5
|
* callback if declared. Returns `null` if the node's def doesn't declare
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nodeRegistry } from '../registry';
|
|
1
|
+
import { nodeRegistry } from '../registry/index.js';
|
|
2
2
|
/** Distance (meters) under which two ports count as the same joint. Joints
|
|
3
3
|
* formed by placement snapping coincide to sub-millimeter; 5 cm leaves
|
|
4
4
|
* generous slack for grid-snapped hand placement without false matches. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyNode, AnyNodeId } from '../schema';
|
|
1
|
+
import type { AnyNode, AnyNodeId } from '../schema/index.js';
|
|
2
2
|
/** A 3D level-local point (meters) projected to 2D iso screen space.
|
|
3
3
|
* Screen Y grows DOWNWARD (SVG convention), so higher elevation → lower
|
|
4
4
|
* screen Y. */
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ShelfNode } from '../schema/nodes/shelf.js';
|
|
2
|
+
export declare const SHELF_BOARD_INSET = 0.001;
|
|
3
|
+
export declare function shelfBoardDimensions(width: number, thickness: number, depth: number, insetWidth?: boolean): [number, number, number];
|
|
4
|
+
export declare function shelfRowBoardDimensions(host: ShelfNode, rowY: number): [number, number, number];
|
|
5
|
+
//# sourceMappingURL=shelf-board.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shelf-board.d.ts","sourceRoot":"","sources":["../../src/services/shelf-board.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAGtD,eAAO,MAAM,iBAAiB,QAAQ,CAAA;AAEtC,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,UAAU,UAAQ,GACjB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAM1B;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,4BAUpE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Recess coplanar board/frame faces by 1 mm to avoid z-fighting.
|
|
2
|
+
export const SHELF_BOARD_INSET = 0.001;
|
|
3
|
+
export function shelfBoardDimensions(width, thickness, depth, insetWidth = false) {
|
|
4
|
+
return [
|
|
5
|
+
insetWidth ? Math.max(width - 2 * SHELF_BOARD_INSET, 0.001) : width,
|
|
6
|
+
thickness,
|
|
7
|
+
Math.max(depth - 2 * SHELF_BOARD_INSET, 0.001),
|
|
8
|
+
];
|
|
9
|
+
}
|
|
10
|
+
export function shelfRowBoardDimensions(host, rowY) {
|
|
11
|
+
const sides = host.style === 'cubby' || (host.style === 'bookshelf' && host.withSides);
|
|
12
|
+
const bottom = host.withBottom && host.style === 'bookshelf' && rowY === host.thickness;
|
|
13
|
+
const insetWidth = host.style === 'open-rack' || (host.style === 'bookshelf' && !sides && !bottom);
|
|
14
|
+
return shelfBoardDimensions(host.width - (sides ? 2 * host.thickness : 0), host.thickness, host.depth, insetWidth);
|
|
15
|
+
}
|