@pascal-app/core 1.0.0-beta.5 → 1.0.0
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/LICENSE +21 -0
- package/README.md +23 -0
- package/dist/capture/index.d.ts +3 -0
- package/dist/capture/index.d.ts.map +1 -0
- package/dist/capture/index.js +2 -0
- package/dist/capture/schema.d.ts +417 -0
- package/dist/capture/schema.d.ts.map +1 -0
- package/dist/capture/schema.js +348 -0
- package/dist/capture/source.d.ts +60 -0
- package/dist/capture/source.d.ts.map +1 -0
- package/dist/capture/source.js +254 -0
- package/dist/events/bus.d.ts +55 -7
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/hidden-wall-pointer-hold.d.ts +28 -0
- package/dist/events/hidden-wall-pointer-hold.d.ts.map +1 -0
- package/dist/events/hidden-wall-pointer-hold.js +37 -0
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +2785 -1
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-sync.js +132 -19
- package/dist/hooks/spatial-grid/support-host-patch.d.ts +45 -1
- package/dist/hooks/spatial-grid/support-host-patch.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/support-host-patch.js +171 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -5
- package/dist/lib/asset-storage.d.ts.map +1 -1
- package/dist/lib/asset-storage.js +4 -1
- package/dist/lib/polygon-union.d.ts +4 -0
- package/dist/lib/polygon-union.d.ts.map +1 -0
- package/dist/lib/polygon-union.js +306 -0
- package/dist/lib/roof-overlap.d.ts +32 -0
- package/dist/lib/roof-overlap.d.ts.map +1 -0
- package/dist/lib/roof-overlap.js +72 -0
- package/dist/lib/slab-polygon.d.ts +35 -2
- package/dist/lib/slab-polygon.d.ts.map +1 -1
- package/dist/lib/slab-polygon.js +133 -27
- package/dist/lib/space-detection.d.ts +11 -0
- package/dist/lib/space-detection.d.ts.map +1 -1
- package/dist/lib/space-detection.js +42 -14
- package/dist/registry/handles.d.ts +24 -3
- package/dist/registry/handles.d.ts.map +1 -1
- package/dist/registry/index.d.ts +3 -4
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -2
- package/dist/registry/registry.d.ts +13 -6
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +37 -4
- package/dist/registry/scene-api.d.ts +16 -0
- package/dist/registry/scene-api.d.ts.map +1 -1
- package/dist/registry/scene-api.js +49 -1
- package/dist/registry/types.d.ts +226 -13
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/schema/__bench__/node-parsers.bench.d.ts +24 -0
- package/dist/schema/__bench__/node-parsers.bench.d.ts.map +1 -0
- package/dist/schema/__bench__/node-parsers.bench.js +314 -0
- package/dist/schema/__fixtures__/node-fixtures.d.ts +28 -0
- package/dist/schema/__fixtures__/node-fixtures.d.ts.map +1 -0
- package/dist/schema/__fixtures__/node-fixtures.js +125 -0
- package/dist/schema/base.d.ts +1 -1
- package/dist/schema/base.d.ts.map +1 -1
- package/dist/schema/base.js +8 -1
- package/dist/schema/compiled-node-parsers.d.ts +40 -0
- package/dist/schema/compiled-node-parsers.d.ts.map +1 -0
- package/dist/schema/compiled-node-parsers.js +95 -0
- package/dist/schema/index.d.ts +19 -15
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +17 -12
- package/dist/schema/material.d.ts +2 -1
- package/dist/schema/material.d.ts.map +1 -1
- package/dist/schema/material.js +1 -0
- package/dist/schema/nodes/automatic-downspout.d.ts +17 -0
- package/dist/schema/nodes/automatic-downspout.d.ts.map +1 -0
- package/dist/schema/nodes/automatic-downspout.js +237 -0
- package/dist/schema/nodes/block.d.ts +107 -0
- package/dist/schema/nodes/block.d.ts.map +1 -0
- package/dist/schema/nodes/block.js +207 -0
- package/dist/schema/nodes/box-vent.d.ts +8 -2
- package/dist/schema/nodes/box-vent.d.ts.map +1 -1
- package/dist/schema/nodes/box-vent.js +2 -0
- package/dist/schema/nodes/building.d.ts +1 -1
- package/dist/schema/nodes/cabinet.d.ts +25 -3
- package/dist/schema/nodes/cabinet.d.ts.map +1 -1
- package/dist/schema/nodes/cabinet.js +26 -5
- package/dist/schema/nodes/ceiling.d.ts +1 -1
- package/dist/schema/nodes/chimney.d.ts +2 -2
- package/dist/schema/nodes/column.d.ts +6 -6
- package/dist/schema/nodes/construction-dimension.d.ts +4 -4
- package/dist/schema/nodes/cupola.d.ts +9 -1
- package/dist/schema/nodes/cupola.d.ts.map +1 -1
- package/dist/schema/nodes/cupola.js +2 -0
- package/dist/schema/nodes/door.d.ts +1 -1
- package/dist/schema/nodes/dormer.d.ts +44 -1
- package/dist/schema/nodes/dormer.d.ts.map +1 -1
- package/dist/schema/nodes/dormer.js +131 -7
- package/dist/schema/nodes/downspout.d.ts +11 -1
- package/dist/schema/nodes/downspout.d.ts.map +1 -1
- package/dist/schema/nodes/downspout.js +24 -0
- package/dist/schema/nodes/duct-fitting.d.ts +18 -1
- package/dist/schema/nodes/duct-fitting.d.ts.map +1 -1
- package/dist/schema/nodes/duct-fitting.js +25 -4
- package/dist/schema/nodes/duct-segment.d.ts +23 -1
- package/dist/schema/nodes/duct-segment.d.ts.map +1 -1
- package/dist/schema/nodes/duct-segment.js +20 -0
- package/dist/schema/nodes/duct-terminal.d.ts +1 -1
- package/dist/schema/nodes/elevator.d.ts +1 -1
- package/dist/schema/nodes/eyebrow-vent.d.ts +8 -2
- package/dist/schema/nodes/eyebrow-vent.d.ts.map +1 -1
- package/dist/schema/nodes/eyebrow-vent.js +2 -0
- package/dist/schema/nodes/fence.d.ts +1 -1
- package/dist/schema/nodes/guide.d.ts +1 -1
- package/dist/schema/nodes/gutter.d.ts +36 -2
- package/dist/schema/nodes/gutter.d.ts.map +1 -1
- package/dist/schema/nodes/gutter.js +308 -1
- package/dist/schema/nodes/hanger-overrides.d.ts +7 -0
- package/dist/schema/nodes/hanger-overrides.d.ts.map +1 -0
- package/dist/schema/nodes/hanger-overrides.js +6 -0
- package/dist/schema/nodes/hvac-equipment.d.ts +1 -1
- package/dist/schema/nodes/item.d.ts +4 -3
- package/dist/schema/nodes/item.d.ts.map +1 -1
- package/dist/schema/nodes/item.js +5 -0
- package/dist/schema/nodes/lean-to-extension.d.ts +212 -0
- package/dist/schema/nodes/lean-to-extension.d.ts.map +1 -0
- package/dist/schema/nodes/lean-to-extension.js +114 -0
- package/dist/schema/nodes/level.d.ts +2 -2
- package/dist/schema/nodes/level.d.ts.map +1 -1
- package/dist/schema/nodes/lineset.d.ts +1 -1
- package/dist/schema/nodes/liquid-line.d.ts +1 -1
- package/dist/schema/nodes/measurement.d.ts +1 -1
- package/dist/schema/nodes/pipe-fitting.d.ts +9 -1
- package/dist/schema/nodes/pipe-fitting.d.ts.map +1 -1
- package/dist/schema/nodes/pipe-fitting.js +6 -2
- package/dist/schema/nodes/pipe-segment.d.ts +23 -1
- package/dist/schema/nodes/pipe-segment.d.ts.map +1 -1
- package/dist/schema/nodes/pipe-segment.js +20 -0
- package/dist/schema/nodes/pipe-trap.d.ts +1 -1
- package/dist/schema/nodes/ridge-vent.d.ts +1 -1
- package/dist/schema/nodes/ridge-vent.d.ts.map +1 -1
- package/dist/schema/nodes/ridge-vent.js +4 -1
- package/dist/schema/nodes/roof-segment-shape.d.ts +4 -0
- package/dist/schema/nodes/roof-segment-shape.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment-shape.js +64 -1
- package/dist/schema/nodes/roof-segment-walls.d.ts +3 -1
- package/dist/schema/nodes/roof-segment-walls.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment-walls.js +1 -1
- package/dist/schema/nodes/roof-segment.d.ts +41 -1
- package/dist/schema/nodes/roof-segment.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment.js +79 -2
- package/dist/schema/nodes/roof.d.ts +22 -1
- package/dist/schema/nodes/roof.d.ts.map +1 -1
- package/dist/schema/nodes/roof.js +14 -0
- package/dist/schema/nodes/scan.d.ts +19 -2
- package/dist/schema/nodes/scan.d.ts.map +1 -1
- package/dist/schema/nodes/scan.js +11 -1
- package/dist/schema/nodes/shelf.d.ts +2 -2
- package/dist/schema/nodes/site.d.ts +1 -1
- package/dist/schema/nodes/skylight.d.ts +1 -1
- package/dist/schema/nodes/slab.d.ts +1 -1
- package/dist/schema/nodes/solar-panel.d.ts +1 -1
- package/dist/schema/nodes/spawn.d.ts +1 -1
- package/dist/schema/nodes/stair-segment.d.ts +1 -1
- package/dist/schema/nodes/stair.d.ts +1 -1
- package/dist/schema/nodes/structural-grid.d.ts +1 -1
- package/dist/schema/nodes/turbine-vent.d.ts +7 -1
- package/dist/schema/nodes/turbine-vent.d.ts.map +1 -1
- package/dist/schema/nodes/turbine-vent.js +2 -0
- package/dist/schema/nodes/wall.d.ts +4 -4
- package/dist/schema/nodes/wall.d.ts.map +1 -1
- package/dist/schema/nodes/wall.js +7 -1
- package/dist/schema/nodes/window.d.ts +10 -3
- package/dist/schema/nodes/window.d.ts.map +1 -1
- package/dist/schema/nodes/window.js +4 -0
- package/dist/schema/nodes/zone.d.ts +2 -2
- package/dist/schema/nodes/zone.js +1 -1
- package/dist/schema/types.d.ts +484 -109
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +27 -1
- package/dist/services/hosting.d.ts +2 -2
- package/dist/services/hosting.d.ts.map +1 -1
- package/dist/services/hosting.js +4 -4
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/system-graph.d.ts +11 -0
- package/dist/services/system-graph.d.ts.map +1 -1
- package/dist/services/system-graph.js +35 -5
- package/dist/store/actions/node-actions.d.ts +7 -0
- package/dist/store/actions/node-actions.d.ts.map +1 -1
- package/dist/store/actions/node-actions.js +429 -17
- package/dist/store/history-invalidation.d.ts +3 -0
- package/dist/store/history-invalidation.d.ts.map +1 -0
- package/dist/store/history-invalidation.js +72 -0
- package/dist/store/scene-hydration.d.ts +5 -0
- package/dist/store/scene-hydration.d.ts.map +1 -0
- package/dist/store/scene-hydration.js +57 -0
- package/dist/store/use-scene.d.ts +3 -0
- package/dist/store/use-scene.d.ts.map +1 -1
- package/dist/store/use-scene.js +332 -64
- package/dist/systems/roof/roof-elevation-system.d.ts +3 -0
- package/dist/systems/roof/roof-elevation-system.d.ts.map +1 -0
- package/dist/systems/roof/roof-elevation-system.js +94 -0
- package/dist/systems/roof/roof-elevation.d.ts +4 -0
- package/dist/systems/roof/roof-elevation.d.ts.map +1 -0
- package/dist/systems/roof/roof-elevation.js +95 -0
- package/dist/systems/roof/roof-footprint.d.ts +17 -0
- package/dist/systems/roof/roof-footprint.d.ts.map +1 -0
- package/dist/systems/roof/roof-footprint.js +83 -0
- package/dist/systems/stair/stair-flight.d.ts +17 -0
- package/dist/systems/stair/stair-flight.d.ts.map +1 -0
- package/dist/systems/stair/stair-flight.js +27 -0
- package/dist/systems/stair/stair-opening-preview.d.ts +1555 -1328
- package/dist/systems/stair/stair-opening-preview.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-system.d.ts +1 -0
- package/dist/systems/stair/stair-opening-system.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-system.js +93 -96
- package/dist/systems/stair/stair-rise.d.ts.map +1 -1
- package/dist/systems/stair/stair-rise.js +20 -21
- package/dist/systems/wall/wall-curve.d.ts +1 -0
- package/dist/systems/wall/wall-curve.d.ts.map +1 -1
- package/dist/systems/wall/wall-curve.js +73 -0
- package/dist/systems/wall/wall-footprint.d.ts +1 -0
- package/dist/systems/wall/wall-footprint.d.ts.map +1 -1
- package/dist/systems/wall/wall-footprint.js +1 -0
- package/dist/utils/clone-scene-graph.d.ts.map +1 -1
- package/dist/utils/clone-scene-graph.js +26 -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 +49 -2
- package/package.json +10 -3
- package/dist/systems/elevator/elevator-runtime-system.d.ts +0 -2
- package/dist/systems/elevator/elevator-runtime-system.d.ts.map +0 -1
- package/dist/systems/elevator/elevator-runtime-system.js +0 -8
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import * as schema from '../index';
|
|
3
|
+
import { AnyNode, nodeKindOf } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Minimal valid instances of every node kind, built from the kinds' own
|
|
6
|
+
* schemas. Shared by the `AnyNode` contract test, the compiled-parser parity
|
|
7
|
+
* test, and the schema bench so all three cover the same 48 kinds without
|
|
8
|
+
* three copies of the table drifting apart.
|
|
9
|
+
*/
|
|
10
|
+
/** Fields a kind requires beyond the defaults its own schema fills in. */
|
|
11
|
+
export const NODE_REQUIRED_FIELDS = {
|
|
12
|
+
ceiling: {
|
|
13
|
+
polygon: [
|
|
14
|
+
[0, 0],
|
|
15
|
+
[4, 0],
|
|
16
|
+
[4, 4],
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
'duct-segment': {
|
|
20
|
+
path: [
|
|
21
|
+
[0, 0, 0],
|
|
22
|
+
[1, 0, 0],
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
fence: { start: [0, 0], end: [4, 0] },
|
|
26
|
+
guide: { url: 'asset://guide.png' },
|
|
27
|
+
item: {
|
|
28
|
+
asset: {
|
|
29
|
+
id: 'asset-1',
|
|
30
|
+
category: 'furniture',
|
|
31
|
+
name: 'Chair',
|
|
32
|
+
thumbnail: 'asset://chair.png',
|
|
33
|
+
src: 'asset://chair.glb',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
lineset: {
|
|
37
|
+
path: [
|
|
38
|
+
[0, 0, 0],
|
|
39
|
+
[1, 0, 0],
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
'liquid-line': {
|
|
43
|
+
path: [
|
|
44
|
+
[0, 0, 0],
|
|
45
|
+
[1, 0, 0],
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
measurement: {
|
|
49
|
+
measurement: {
|
|
50
|
+
kind: 'distance',
|
|
51
|
+
points: [
|
|
52
|
+
[0, 0, 0],
|
|
53
|
+
[1, 0, 0],
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
'pipe-segment': {
|
|
58
|
+
path: [
|
|
59
|
+
[0, 0, 0],
|
|
60
|
+
[1, 0, 0],
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
slab: {
|
|
64
|
+
polygon: [
|
|
65
|
+
[0, 0],
|
|
66
|
+
[4, 0],
|
|
67
|
+
[4, 4],
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
wall: { start: [0, 0], end: [4, 0] },
|
|
71
|
+
zone: {
|
|
72
|
+
name: 'Kitchen',
|
|
73
|
+
polygon: [
|
|
74
|
+
[0, 0],
|
|
75
|
+
[4, 0],
|
|
76
|
+
[4, 4],
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
/** Every kind `AnyNode` discriminates on. */
|
|
81
|
+
export const NODE_KINDS = AnyNode.options.map(nodeKindOf);
|
|
82
|
+
export function isAuthoredNodeSchema(value) {
|
|
83
|
+
if (!(value instanceof z.ZodObject))
|
|
84
|
+
return false;
|
|
85
|
+
const discriminator = value.shape.type;
|
|
86
|
+
return discriminator instanceof z.ZodDefault && discriminator.unwrap() instanceof z.ZodLiteral;
|
|
87
|
+
}
|
|
88
|
+
let authored;
|
|
89
|
+
/** kind → the per-kind schema the package exports, keyed off its own default. */
|
|
90
|
+
export function authoredNodeSchemas() {
|
|
91
|
+
if (authored)
|
|
92
|
+
return authored;
|
|
93
|
+
authored = new Map();
|
|
94
|
+
for (const exported of Object.values(schema)) {
|
|
95
|
+
if (!isAuthoredNodeSchema(exported))
|
|
96
|
+
continue;
|
|
97
|
+
authored.set(exported.shape.type.unwrap().value, exported);
|
|
98
|
+
}
|
|
99
|
+
return authored;
|
|
100
|
+
}
|
|
101
|
+
let fixtures;
|
|
102
|
+
/**
|
|
103
|
+
* kind → a minimal valid node with every schema default materialized.
|
|
104
|
+
*
|
|
105
|
+
* Always parsed through the raw authored schema, which `z.compile` leaves
|
|
106
|
+
* untouched (it returns a clone), so the fixtures are an interpreted baseline
|
|
107
|
+
* regardless of whether compiled parsers are enabled.
|
|
108
|
+
*/
|
|
109
|
+
export function nodeFixtures() {
|
|
110
|
+
if (fixtures)
|
|
111
|
+
return fixtures;
|
|
112
|
+
const schemas = authoredNodeSchemas();
|
|
113
|
+
fixtures = new Map();
|
|
114
|
+
for (const kind of NODE_KINDS) {
|
|
115
|
+
const perKind = schemas.get(kind);
|
|
116
|
+
if (!perKind)
|
|
117
|
+
throw new Error(`no per-kind schema exported for "${kind}"`);
|
|
118
|
+
const parsed = perKind.safeParse({ ...NODE_REQUIRED_FIELDS[kind] });
|
|
119
|
+
if (!parsed.success) {
|
|
120
|
+
throw new Error(`fixture for "${kind}" does not satisfy its own schema: ${parsed.error.message}`);
|
|
121
|
+
}
|
|
122
|
+
fixtures.set(kind, parsed.data);
|
|
123
|
+
}
|
|
124
|
+
return fixtures;
|
|
125
|
+
}
|
package/dist/schema/base.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const BaseNode: z.ZodObject<{
|
|
|
24
24
|
fov: z.ZodOptional<z.ZodNumber>;
|
|
25
25
|
zoom: z.ZodOptional<z.ZodNumber>;
|
|
26
26
|
}, z.core.$strip>>;
|
|
27
|
-
metadata: z.ZodDefault<z.ZodOptional<z.
|
|
27
|
+
metadata: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
export type BaseNode = z.infer<typeof BaseNode>;
|
|
30
30
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/schema/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB;;;GAGG;AACH,eAAO,MAAM,QAAQ,4BAAwB,CAAA;AAC7C,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,CAAC,KAAG,GAAG,CAAC,IAAI,MAAM,EACxB,CAAA;AAC/C,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,CAAC,qhBAInD,CAAA;AACD,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,kCAAkC,CAAA;AAEpF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/schema/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB;;;GAGG;AACH,eAAO,MAAM,QAAQ,4BAAwB,CAAA;AAC7C,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,CAAC,KAAG,GAAG,CAAC,IAAI,MAAM,EACxB,CAAA;AAC/C,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,CAAC,qhBAInD,CAAA;AACD,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,kCAAkC,CAAA;AAEpF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;iBAgBnB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
package/dist/schema/base.js
CHANGED
|
@@ -21,5 +21,12 @@ export const BaseNode = z.object({
|
|
|
21
21
|
parentId: z.string().nullable().default(null),
|
|
22
22
|
visible: z.boolean().optional().default(true),
|
|
23
23
|
camera: CameraSchema.optional(),
|
|
24
|
-
|
|
24
|
+
// Deliberately a record, not `z.json()`. The recursive JSON schema is the
|
|
25
|
+
// most expensive member of every node that embeds it (`WallNode.parse` runs
|
|
26
|
+
// ~1.5x faster without it) and, being self-referential, it also denies the
|
|
27
|
+
// whole node tree zod 4.5's compiled parser: measured on `WallNode`,
|
|
28
|
+
// `z.compile()` bought 1.0x with `z.json()` and 2.2x with this record.
|
|
29
|
+
// Metadata is a flat bag of per-node extras, so an open object with
|
|
30
|
+
// unchecked values is the whole contract we need.
|
|
31
|
+
metadata: z.record(z.string(), z.unknown()).optional().default({}),
|
|
25
32
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { AnyNode, type AnyNodeOption } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Opt this process into compiled per-kind node parsers. Call at host startup.
|
|
5
|
+
*
|
|
6
|
+
* Compiled and interpreted parsers agree on both successful output and error
|
|
7
|
+
* issues (`compiled-node-parsers.test.ts` asserts that for every node kind), so
|
|
8
|
+
* this only ever changes throughput.
|
|
9
|
+
*/
|
|
10
|
+
export declare function enableCompiledNodeParsers(value?: boolean): void;
|
|
11
|
+
/** Whether {@link enableCompiledNodeParsers} is currently on. */
|
|
12
|
+
export declare function compiledNodeParsersEnabled(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The compiled clone of a single node kind's schema, or `schema` itself when
|
|
15
|
+
* compilation is off or unavailable.
|
|
16
|
+
*
|
|
17
|
+
* Memoized per schema instance, so the codegen for a kind runs once per
|
|
18
|
+
* process. Never pass `AnyNode` — see the module note on megamorphism.
|
|
19
|
+
*/
|
|
20
|
+
export declare function compiledNodeSchema<T extends z.ZodType>(schema: T): T;
|
|
21
|
+
/**
|
|
22
|
+
* The `AnyNode` member that accepts `kind`, compiled when enabled.
|
|
23
|
+
*
|
|
24
|
+
* Returns `null` for anything the union does not discriminate on — an unknown
|
|
25
|
+
* kind, a plugin-registered kind, a missing or non-string `type`. Callers fall
|
|
26
|
+
* back to parsing the union so the failure path (and its `invalid_union` issue
|
|
27
|
+
* at `['type']`) stays byte-identical.
|
|
28
|
+
*/
|
|
29
|
+
export declare function nodeSchemaForKind(kind: unknown): AnyNodeOption | null;
|
|
30
|
+
/**
|
|
31
|
+
* Parse a node against the member for its own `type`, or against the whole
|
|
32
|
+
* union when the kind is one `AnyNode` does not discriminate on.
|
|
33
|
+
*
|
|
34
|
+
* Drop-in for `AnyNode.safeParse(node)`: a discriminated union delegates to the
|
|
35
|
+
* member anyway, so success values and failure issues are the same either way —
|
|
36
|
+
* and the union fallback keeps the `invalid_union` issue at `['type']` for a
|
|
37
|
+
* missing, unknown, or plugin-registered kind.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseNode(node: unknown): z.ZodSafeParseResult<AnyNode>;
|
|
40
|
+
//# sourceMappingURL=compiled-node-parsers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiled-node-parsers.d.ts","sourceRoot":"","sources":["../../src/schema/compiled-node-parsers.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AACnB,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,SAAS,CAAA;AAyBjE;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,UAAO,GAAG,IAAI,CAE5D;AAED,iEAAiE;AACjE,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAcD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAWpE;AAID;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAOrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAItE"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { AnyNode, nodeKindOf } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* AOT-compiled per-kind node parsers.
|
|
5
|
+
*
|
|
6
|
+
* `z.compile()` trades a one-off codegen pass for a faster warm parse. Two
|
|
7
|
+
* properties of that trade decide the shape of this module:
|
|
8
|
+
*
|
|
9
|
+
* - **Per kind, never the union.** One compiled function covering all 48
|
|
10
|
+
* `AnyNode` members is megamorphic at the call site and can run slower than
|
|
11
|
+
* the interpreter. Each kind gets its own compiled clone instead, and
|
|
12
|
+
* dispatch stays a `Map` lookup on the discriminator.
|
|
13
|
+
* - **Lazily.** Compiling every kind up front pays codegen for kinds a session
|
|
14
|
+
* never touches and retains their generated code for the process lifetime. A
|
|
15
|
+
* kind is compiled on its first parse and only then.
|
|
16
|
+
*
|
|
17
|
+
* Off by default; a host opts in via {@link enableCompiledNodeParsers}. While
|
|
18
|
+
* off — and in any environment without a usable `Function` constructor (a
|
|
19
|
+
* CSP-restricted embedder) or with `z.config({ jitless: true })` set — every
|
|
20
|
+
* entry point returns the interpreted schema it was handed, so parses behave
|
|
21
|
+
* exactly as they do without this module.
|
|
22
|
+
*/
|
|
23
|
+
let enabled = false;
|
|
24
|
+
/**
|
|
25
|
+
* Opt this process into compiled per-kind node parsers. Call at host startup.
|
|
26
|
+
*
|
|
27
|
+
* Compiled and interpreted parsers agree on both successful output and error
|
|
28
|
+
* issues (`compiled-node-parsers.test.ts` asserts that for every node kind), so
|
|
29
|
+
* this only ever changes throughput.
|
|
30
|
+
*/
|
|
31
|
+
export function enableCompiledNodeParsers(value = true) {
|
|
32
|
+
enabled = value;
|
|
33
|
+
}
|
|
34
|
+
/** Whether {@link enableCompiledNodeParsers} is currently on. */
|
|
35
|
+
export function compiledNodeParsersEnabled() {
|
|
36
|
+
return enabled;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* `z.core.util.allowsEval` is zod's own cached `new Function` probe. Reusing it
|
|
40
|
+
* rather than probing ourselves means a CSP-restricted page reports at most one
|
|
41
|
+
* `securitypolicyviolation` for the whole process, and `jitless` short-circuits
|
|
42
|
+
* before any probe runs at all.
|
|
43
|
+
*/
|
|
44
|
+
function canCompile() {
|
|
45
|
+
return z.core.util.allowsEval.value;
|
|
46
|
+
}
|
|
47
|
+
const compiledBySchema = new WeakMap();
|
|
48
|
+
/**
|
|
49
|
+
* The compiled clone of a single node kind's schema, or `schema` itself when
|
|
50
|
+
* compilation is off or unavailable.
|
|
51
|
+
*
|
|
52
|
+
* Memoized per schema instance, so the codegen for a kind runs once per
|
|
53
|
+
* process. Never pass `AnyNode` — see the module note on megamorphism.
|
|
54
|
+
*/
|
|
55
|
+
export function compiledNodeSchema(schema) {
|
|
56
|
+
if (!(enabled && canCompile()))
|
|
57
|
+
return schema;
|
|
58
|
+
const memo = compiledBySchema.get(schema);
|
|
59
|
+
if (memo)
|
|
60
|
+
return memo;
|
|
61
|
+
// `z.compile` never throws by default: a schema its codegen cannot model
|
|
62
|
+
// comes back as the original, which memoizes as "do not try again".
|
|
63
|
+
const compiled = z.compile(schema);
|
|
64
|
+
compiledBySchema.set(schema, compiled);
|
|
65
|
+
return compiled;
|
|
66
|
+
}
|
|
67
|
+
let optionsByKind;
|
|
68
|
+
/**
|
|
69
|
+
* The `AnyNode` member that accepts `kind`, compiled when enabled.
|
|
70
|
+
*
|
|
71
|
+
* Returns `null` for anything the union does not discriminate on — an unknown
|
|
72
|
+
* kind, a plugin-registered kind, a missing or non-string `type`. Callers fall
|
|
73
|
+
* back to parsing the union so the failure path (and its `invalid_union` issue
|
|
74
|
+
* at `['type']`) stays byte-identical.
|
|
75
|
+
*/
|
|
76
|
+
export function nodeSchemaForKind(kind) {
|
|
77
|
+
if (typeof kind !== 'string')
|
|
78
|
+
return null;
|
|
79
|
+
optionsByKind ??= new Map(AnyNode.options.map((option) => [nodeKindOf(option), option]));
|
|
80
|
+
const option = optionsByKind.get(kind);
|
|
81
|
+
return option ? compiledNodeSchema(option) : null;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Parse a node against the member for its own `type`, or against the whole
|
|
85
|
+
* union when the kind is one `AnyNode` does not discriminate on.
|
|
86
|
+
*
|
|
87
|
+
* Drop-in for `AnyNode.safeParse(node)`: a discriminated union delegates to the
|
|
88
|
+
* member anyway, so success values and failure issues are the same either way —
|
|
89
|
+
* and the union fallback keeps the `invalid_union` issue at `['type']` for a
|
|
90
|
+
* missing, unknown, or plugin-registered kind.
|
|
91
|
+
*/
|
|
92
|
+
export function parseNode(node) {
|
|
93
|
+
const schema = nodeSchemaForKind(node?.type);
|
|
94
|
+
return (schema ?? AnyNode).safeParse(node);
|
|
95
|
+
}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -3,30 +3,34 @@ export { ALLOWED_ORIGINS_ENV, ALLOWED_SCHEMES, AssetUrl } from './asset-url';
|
|
|
3
3
|
export { BaseNode, generateId, Material, nodeType, objectId } from './base';
|
|
4
4
|
export { CameraSchema } from './camera';
|
|
5
5
|
export { type Collection, type CollectionId, generateCollectionId } from './collections';
|
|
6
|
+
export { compiledNodeParsersEnabled, enableCompiledNodeParsers, parseNode, } from './compiled-node-parsers';
|
|
6
7
|
export type { MaterialMapProperties, MaterialMaps, MaterialPresetPayload, MaterialTarget as MaterialTargetValue, TextureWrapMode as TextureWrapModeValue, } from './material';
|
|
7
8
|
export { DEFAULT_MATERIALS, MaterialMapPropertiesSchema, MaterialMapsSchema, MaterialPreset, MaterialPresetPayloadSchema, MaterialProperties, MaterialSchema, MaterialTarget, resolveMaterial, TextureWrapMode, } from './material';
|
|
8
|
-
export {
|
|
9
|
+
export { type AutoDownspoutPlacement, type AutomaticDownspoutInput, planAutomaticDownspouts, resolveAutomaticDownspoutLength, } from './nodes/automatic-downspout';
|
|
10
|
+
export { BlockEdge, BlockFace, type BlockFaceFrame, BlockNode, BlockTopology, type BlockTopologyIssue, BlockVertex, blockUndirectedEdgeKey, createBoxBlockTopology, getBlockFaceCentroid, getBlockFaceFrame, getBlockFaceNormal, inspectBlockTopology, } from './nodes/block';
|
|
11
|
+
export { BoxVentMaterialRole, BoxVentNode } from './nodes/box-vent';
|
|
9
12
|
export { BuildingNode } from './nodes/building';
|
|
10
|
-
export { CabinetModuleNode, CabinetNode } from './nodes/cabinet';
|
|
13
|
+
export { CABINET_METRIC_DEFAULTS, CabinetFrontStyleSchema, CabinetModuleNode, CabinetNode, CabinetTopFinishSchema, } from './nodes/cabinet';
|
|
11
14
|
export { CeilingNode } from './nodes/ceiling';
|
|
12
15
|
export { ChimneyMaterialRole, ChimneyNode } from './nodes/chimney';
|
|
13
16
|
export { COLUMN_PRESETS, ColumnBaseStyle, ColumnCapitalStyle, ColumnCarvingPlacement, ColumnCrossSection, ColumnNode, ColumnPanelShape, type ColumnPresetId, ColumnRingPlacement, ColumnShaftDetail, ColumnShaftProfile, ColumnStyle, ColumnSupportStyle, } from './nodes/column';
|
|
14
17
|
export { CONSTRUCTION_DRAWING_TYPES, ConstructionDimensionBaseline, ConstructionDimensionChainMode, ConstructionDimensionDatumPolicy, ConstructionDimensionDrawingOverride, ConstructionDimensionDrawingPresentation, ConstructionDimensionImperialPrecision, ConstructionDimensionMetricNotation, ConstructionDimensionMode, ConstructionDimensionNode, ConstructionDimensionTerminator, ConstructionDimensionTextPosition, ConstructionDrawingType, constructionDimensionRequiredAnchorCount, resolveConstructionDimensionDrawingOverride, resolveConstructionDimensionDrawingPresentation, setConstructionDimensionDrawingPresentation, setConstructionDimensionDrawingSuppressedSegments, } from './nodes/construction-dimension';
|
|
15
|
-
export { CupolaNode } from './nodes/cupola';
|
|
18
|
+
export { CupolaMaterialRole, CupolaNode } from './nodes/cupola';
|
|
16
19
|
export { DoorNode, DoorSegment, OpeningConstructionType, OpeningDimensionReference, } from './nodes/door';
|
|
17
|
-
export { DormerNode, type DormerSurfaceMaterialRole, type DormerSurfaceMaterialSpec, getEffectiveDormerSurfaceMaterial, } from './nodes/dormer';
|
|
18
|
-
export { DownspoutNode } from './nodes/downspout';
|
|
20
|
+
export { createDormerDefaultWindow, DormerNode, type DormerSurfaceMaterialRole, type DormerSurfaceMaterialSpec, DormerWallFace, dormerPointToWallFace, dormerWallFacePointToDormer, getDormerDefaultWindowFace, getDormerExposedFaces, getDormerWallFaceFrame, getDormerWallHorizontalBoundsAtHeight, getDormerWallOpeningVerticalBounds, getDormerWallVerticalBounds, getEffectiveDormerSurfaceMaterial, } from './nodes/dormer';
|
|
21
|
+
export { DownspoutNode, defaultDownspoutMetadata, isDefaultDownspoutNode, usesAutomaticDownspoutLength, } from './nodes/downspout';
|
|
19
22
|
export { DuctFittingNode } from './nodes/duct-fitting';
|
|
20
23
|
export { DuctSegmentNode } from './nodes/duct-segment';
|
|
21
24
|
export { DuctTerminalNode } from './nodes/duct-terminal';
|
|
22
25
|
export { ElevatorDoorPanelStyle, ElevatorDoorStyle, ElevatorNode, ElevatorShaftStyle, } from './nodes/elevator';
|
|
23
|
-
export { EyebrowVentNode } from './nodes/eyebrow-vent';
|
|
26
|
+
export { EyebrowVentMaterialRole, EyebrowVentNode } from './nodes/eyebrow-vent';
|
|
24
27
|
export { FenceBaseStyle, FenceNode, FenceStyle } from './nodes/fence';
|
|
25
28
|
export { GuideNode, GuideScaleReference } from './nodes/guide';
|
|
26
|
-
export { GutterNode, GutterOutlet } from './nodes/gutter';
|
|
29
|
+
export { computeGutterEaveY, createDefaultGuttersForSegment, GUTTER_EAVE_TUCK_INWARD, GUTTER_EAVE_TUCK_UP, type GutterEaveSide, type GutterEdgeExclusion, GutterNode, GutterOutlet, type GutterRun, getDefaultGutterSide, getGutterRunsForSegment, hasAutoGutterMetadata, isAutoGutterEnabled, isDefaultGutterNode, } from './nodes/gutter';
|
|
27
30
|
export { HvacEquipmentNode } from './nodes/hvac-equipment';
|
|
28
31
|
export type { AnimationEffect, Asset, AssetInput, Control, Effect, Interactive, LightEffect, SliderControl, TemperatureControl, ToggleControl, } from './nodes/item';
|
|
29
32
|
export { getScaledDimensions, ItemNode, isLowProfileItemSurface, LOW_PROFILE_ITEM_SURFACE_MAX_HEIGHT, } from './nodes/item';
|
|
33
|
+
export { LeanToCanopyForm, LeanToConnectionMode, LeanToEndCondition, LeanToExtensionNode, LeanToResizeLock, LeanToRoofEdge, } from './nodes/lean-to-extension';
|
|
30
34
|
export { LevelNode } from './nodes/level';
|
|
31
35
|
export { LinesetNode } from './nodes/lineset';
|
|
32
36
|
export { LiquidLineNode } from './nodes/liquid-line';
|
|
@@ -35,15 +39,15 @@ export { PipeFittingNode } from './nodes/pipe-fitting';
|
|
|
35
39
|
export { PipeSegmentNode } from './nodes/pipe-segment';
|
|
36
40
|
export { PipeTrapNode } from './nodes/pipe-trap';
|
|
37
41
|
export { createDefaultRidgeVentsForSegment, getRidgeVentLinesForSegment, hasAutoRidgeVentMetadata, isAutoRidgeVentEnabled, isDefaultRidgeVentNode, type RidgeVentLine, RidgeVentNode, } from './nodes/ridge-vent';
|
|
38
|
-
export type { RoofSurfaceMaterialRole, RoofSurfaceMaterialSpec } from './nodes/roof';
|
|
42
|
+
export type { RoofSupport, RoofSurfaceMaterialRole, RoofSurfaceMaterialSpec } from './nodes/roof';
|
|
39
43
|
export { getEffectiveRoofSurfaceMaterial, RoofNode } from './nodes/roof';
|
|
40
44
|
export type { DutchRoofMetrics, RoofSegmentSurfaceMaterialRole, RoofSegmentSurfaceMaterialSpec, RoofSegmentVisibleTopBounds, SegmentSlopeFrame, } from './nodes/roof-segment';
|
|
41
|
-
export { getActiveRoofHeight, getDutchRoofMetrics, getEffectiveSegmentSurfaceMaterial, getPitchFromActiveRoofHeight, getRoofSegmentSurfaceY, getRoofSegmentVisibleTopBounds, getSegmentSlopeFrame, hasSegmentMaterialOverride, MIN_ROOF_SEGMENT_TRIM_SPAN, normalizeRoofSegmentTrim, ROOF_SHAPE_DEFAULTS, RoofSegmentNode, RoofSegmentTrim, RoofType, } from './nodes/roof-segment';
|
|
42
|
-
export type { DutchRoofShapeMetrics, RoofShapeFaceVertex, RoofShapeInsets, RoofShapeRatios, } from './nodes/roof-segment-shape';
|
|
43
|
-
export { getDutchEndSlopeFaces, getDutchRoofShapeMetrics, getRoofModuleFaces, getRoofShapeInsets, getRoofShapeRatios, } from './nodes/roof-segment-shape';
|
|
45
|
+
export { getActiveRoofHeight, getConicalRoofCoverage, getDutchRoofMetrics, getEffectiveSegmentSurfaceMaterial, getPitchFromActiveRoofHeight, getRoofSegmentSurfaceY, getRoofSegmentVisibleTopBounds, getSegmentSlopeFrame, hasSegmentMaterialOverride, isBandedShedSegment, MIN_ROOF_SEGMENT_TRIM_SPAN, normalizeRoofSegmentTrim, ROOF_SHAPE_DEFAULTS, RoofSegmentNode, RoofSegmentTrim, RoofType, } from './nodes/roof-segment';
|
|
46
|
+
export type { DutchRoofShapeMetrics, RoofShapeEaveSide, RoofShapeFaceVertex, RoofShapeInsets, RoofShapeRatios, } from './nodes/roof-segment-shape';
|
|
47
|
+
export { getDutchEndSlopeFaces, getDutchRoofShapeMetrics, getRoofModuleFaces, getRoofShapeEaveSides, getRoofShapeInsets, getRoofShapeRatios, } from './nodes/roof-segment-shape';
|
|
44
48
|
export type { RoofSegmentWallFace, RoofWallFaceId } from './nodes/roof-segment-walls';
|
|
45
49
|
export { clampRectToRoofWallFace, getMaxRoofRectHeightFromAnchor, getMaxRoofRectWidthFromAnchor, getRoofSegmentWallFace, getRoofSegmentWallFaces, getRoofWallFaceFrame, roofFacePointToSegment, segmentPointToRoofWallFace, } from './nodes/roof-segment-walls';
|
|
46
|
-
export { ScanNode } from './nodes/scan';
|
|
50
|
+
export { CaptureSessionReference, type CaptureSessionReferenceInput, ScanNode, } from './nodes/scan';
|
|
47
51
|
export { ShelfNode } from './nodes/shelf';
|
|
48
52
|
export { SiteNode } from './nodes/site';
|
|
49
53
|
export { SKYLIGHT_TYPE_ORDER, SKYLIGHT_TYPE_PRESETS, SkylightMaterialRole, SkylightNode, SkylightOpeningSide, SkylightSlideDirection, SkylightType, type SkylightTypePreset, } from './nodes/skylight';
|
|
@@ -55,13 +59,13 @@ export { getEffectiveStairSurfaceMaterial, StairNode, StairRailingMode, StairSla
|
|
|
55
59
|
export { AttachmentSide, StairSegmentNode, StairSegmentType } from './nodes/stair-segment';
|
|
56
60
|
export { StructuralGridNode } from './nodes/structural-grid';
|
|
57
61
|
export { SurfaceHoleMetadata } from './nodes/surface-hole-metadata';
|
|
58
|
-
export { TurbineVentNode } from './nodes/turbine-vent';
|
|
62
|
+
export { TurbineVentMaterialRole, TurbineVentNode } from './nodes/turbine-vent';
|
|
59
63
|
export type { WallBandSurfaceSlotId, WallFaceBand, WallFaceBandConfig, WallSurfaceMaterialSpec, WallSurfaceSide, WallSurfaceSlotId, WallTrimConfig, } from './nodes/wall';
|
|
60
64
|
export { buildEnabledWallFaceBandPatch, buildWallFaceBandCountPatch, getEffectiveWallSurfaceMaterial, getWallBandSlotId, getWallFaceBandConfig, getWallFaceBandForHeight, getWallSurfaceMaterialSignature, getWallSurfaceSideFromBandSlot, WALL_CHAIR_RAIL_DEFAULT, WALL_CHAIR_RAIL_SLOT_DEFAULT, WALL_CROWN_DEFAULT, WALL_CROWN_SLOT_DEFAULT, WALL_FACE_BAND_DEFAULT, WALL_SKIRTING_DEFAULT, WALL_SKIRTING_SLOT_DEFAULT, WALL_SLOT_DEFAULT, WALL_SURFACE_SLOT_DEFAULTS, WALL_TRIM_DEFAULTS, WallNode, WallTreatmentSide, WallTrimProfile, } from './nodes/wall';
|
|
61
65
|
export { WindowConstructionType, WindowDimensionReference, WindowNode, WindowType, } from './nodes/window';
|
|
62
66
|
export { ZoneNode } from './nodes/zone';
|
|
63
67
|
export { generateSceneMaterialId, SceneMaterial, type SceneMaterialId } from './scene-material';
|
|
64
68
|
export { MAX_TERRAIN_SIDE, TerrainData } from './terrain';
|
|
65
|
-
export type { AnyNodeId, AnyNodeType } from './types';
|
|
66
|
-
export { AnyNode } from './types';
|
|
69
|
+
export type { AnyNodeId, AnyNodeOption, AnyNodeType } from './types';
|
|
70
|
+
export { AnyNode, nodeKindOf } from './types';
|
|
67
71
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,mBAAmB,GACpB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,mBAAmB,GACpB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAExF,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,SAAS,GACV,MAAM,yBAAyB,CAAA;AAChC,YAAY,EACV,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,cAAc,IAAI,mBAAmB,EACrC,eAAe,IAAI,oBAAoB,GACxC,MAAM,YAAY,CAAA;AAEnB,OAA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K,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC/F,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACzD,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEpE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/schema/index.js
CHANGED
|
@@ -7,29 +7,34 @@ export { BaseNode, generateId, Material, nodeType, objectId } from './base';
|
|
|
7
7
|
export { CameraSchema } from './camera';
|
|
8
8
|
// Collections
|
|
9
9
|
export { generateCollectionId } from './collections';
|
|
10
|
+
// Compiled per-kind parsers (opt-in)
|
|
11
|
+
export { compiledNodeParsersEnabled, enableCompiledNodeParsers, parseNode, } from './compiled-node-parsers';
|
|
10
12
|
// Material
|
|
11
13
|
export { DEFAULT_MATERIALS, MaterialMapPropertiesSchema, MaterialMapsSchema, MaterialPreset, MaterialPresetPayloadSchema, MaterialProperties, MaterialSchema, MaterialTarget, resolveMaterial, TextureWrapMode, } from './material';
|
|
12
|
-
export {
|
|
14
|
+
export { planAutomaticDownspouts, resolveAutomaticDownspoutLength, } from './nodes/automatic-downspout';
|
|
15
|
+
export { BlockEdge, BlockFace, BlockNode, BlockTopology, BlockVertex, blockUndirectedEdgeKey, createBoxBlockTopology, getBlockFaceCentroid, getBlockFaceFrame, getBlockFaceNormal, inspectBlockTopology, } from './nodes/block';
|
|
16
|
+
export { BoxVentMaterialRole, BoxVentNode } from './nodes/box-vent';
|
|
13
17
|
export { BuildingNode } from './nodes/building';
|
|
14
|
-
export { CabinetModuleNode, CabinetNode } from './nodes/cabinet';
|
|
18
|
+
export { CABINET_METRIC_DEFAULTS, CabinetFrontStyleSchema, CabinetModuleNode, CabinetNode, CabinetTopFinishSchema, } from './nodes/cabinet';
|
|
15
19
|
export { CeilingNode } from './nodes/ceiling';
|
|
16
20
|
export { ChimneyMaterialRole, ChimneyNode } from './nodes/chimney';
|
|
17
21
|
export { COLUMN_PRESETS, ColumnBaseStyle, ColumnCapitalStyle, ColumnCarvingPlacement, ColumnCrossSection, ColumnNode, ColumnPanelShape, ColumnRingPlacement, ColumnShaftDetail, ColumnShaftProfile, ColumnStyle, ColumnSupportStyle, } from './nodes/column';
|
|
18
22
|
export { CONSTRUCTION_DRAWING_TYPES, ConstructionDimensionBaseline, ConstructionDimensionChainMode, ConstructionDimensionDatumPolicy, ConstructionDimensionDrawingOverride, ConstructionDimensionDrawingPresentation, ConstructionDimensionImperialPrecision, ConstructionDimensionMetricNotation, ConstructionDimensionMode, ConstructionDimensionNode, ConstructionDimensionTerminator, ConstructionDimensionTextPosition, ConstructionDrawingType, constructionDimensionRequiredAnchorCount, resolveConstructionDimensionDrawingOverride, resolveConstructionDimensionDrawingPresentation, setConstructionDimensionDrawingPresentation, setConstructionDimensionDrawingSuppressedSegments, } from './nodes/construction-dimension';
|
|
19
|
-
export { CupolaNode } from './nodes/cupola';
|
|
23
|
+
export { CupolaMaterialRole, CupolaNode } from './nodes/cupola';
|
|
20
24
|
export { DoorNode, DoorSegment, OpeningConstructionType, OpeningDimensionReference, } from './nodes/door';
|
|
21
|
-
export { DormerNode, getEffectiveDormerSurfaceMaterial, } from './nodes/dormer';
|
|
22
|
-
export { DownspoutNode } from './nodes/downspout';
|
|
25
|
+
export { createDormerDefaultWindow, DormerNode, DormerWallFace, dormerPointToWallFace, dormerWallFacePointToDormer, getDormerDefaultWindowFace, getDormerExposedFaces, getDormerWallFaceFrame, getDormerWallHorizontalBoundsAtHeight, getDormerWallOpeningVerticalBounds, getDormerWallVerticalBounds, getEffectiveDormerSurfaceMaterial, } from './nodes/dormer';
|
|
26
|
+
export { DownspoutNode, defaultDownspoutMetadata, isDefaultDownspoutNode, usesAutomaticDownspoutLength, } from './nodes/downspout';
|
|
23
27
|
export { DuctFittingNode } from './nodes/duct-fitting';
|
|
24
28
|
export { DuctSegmentNode } from './nodes/duct-segment';
|
|
25
29
|
export { DuctTerminalNode } from './nodes/duct-terminal';
|
|
26
30
|
export { ElevatorDoorPanelStyle, ElevatorDoorStyle, ElevatorNode, ElevatorShaftStyle, } from './nodes/elevator';
|
|
27
|
-
export { EyebrowVentNode } from './nodes/eyebrow-vent';
|
|
31
|
+
export { EyebrowVentMaterialRole, EyebrowVentNode } from './nodes/eyebrow-vent';
|
|
28
32
|
export { FenceBaseStyle, FenceNode, FenceStyle } from './nodes/fence';
|
|
29
33
|
export { GuideNode, GuideScaleReference } from './nodes/guide';
|
|
30
|
-
export { GutterNode, GutterOutlet } from './nodes/gutter';
|
|
34
|
+
export { computeGutterEaveY, createDefaultGuttersForSegment, GUTTER_EAVE_TUCK_INWARD, GUTTER_EAVE_TUCK_UP, GutterNode, GutterOutlet, getDefaultGutterSide, getGutterRunsForSegment, hasAutoGutterMetadata, isAutoGutterEnabled, isDefaultGutterNode, } from './nodes/gutter';
|
|
31
35
|
export { HvacEquipmentNode } from './nodes/hvac-equipment';
|
|
32
36
|
export { getScaledDimensions, ItemNode, isLowProfileItemSurface, LOW_PROFILE_ITEM_SURFACE_MAX_HEIGHT, } from './nodes/item';
|
|
37
|
+
export { LeanToCanopyForm, LeanToConnectionMode, LeanToEndCondition, LeanToExtensionNode, LeanToResizeLock, LeanToRoofEdge, } from './nodes/lean-to-extension';
|
|
33
38
|
export { LevelNode } from './nodes/level';
|
|
34
39
|
export { LinesetNode } from './nodes/lineset';
|
|
35
40
|
export { LiquidLineNode } from './nodes/liquid-line';
|
|
@@ -40,10 +45,10 @@ export { PipeTrapNode } from './nodes/pipe-trap';
|
|
|
40
45
|
// Nodes
|
|
41
46
|
export { createDefaultRidgeVentsForSegment, getRidgeVentLinesForSegment, hasAutoRidgeVentMetadata, isAutoRidgeVentEnabled, isDefaultRidgeVentNode, RidgeVentNode, } from './nodes/ridge-vent';
|
|
42
47
|
export { getEffectiveRoofSurfaceMaterial, RoofNode } from './nodes/roof';
|
|
43
|
-
export { getActiveRoofHeight, getDutchRoofMetrics, getEffectiveSegmentSurfaceMaterial, getPitchFromActiveRoofHeight, getRoofSegmentSurfaceY, getRoofSegmentVisibleTopBounds, getSegmentSlopeFrame, hasSegmentMaterialOverride, MIN_ROOF_SEGMENT_TRIM_SPAN, normalizeRoofSegmentTrim, ROOF_SHAPE_DEFAULTS, RoofSegmentNode, RoofSegmentTrim, RoofType, } from './nodes/roof-segment';
|
|
44
|
-
export { getDutchEndSlopeFaces, getDutchRoofShapeMetrics, getRoofModuleFaces, getRoofShapeInsets, getRoofShapeRatios, } from './nodes/roof-segment-shape';
|
|
48
|
+
export { getActiveRoofHeight, getConicalRoofCoverage, getDutchRoofMetrics, getEffectiveSegmentSurfaceMaterial, getPitchFromActiveRoofHeight, getRoofSegmentSurfaceY, getRoofSegmentVisibleTopBounds, getSegmentSlopeFrame, hasSegmentMaterialOverride, isBandedShedSegment, MIN_ROOF_SEGMENT_TRIM_SPAN, normalizeRoofSegmentTrim, ROOF_SHAPE_DEFAULTS, RoofSegmentNode, RoofSegmentTrim, RoofType, } from './nodes/roof-segment';
|
|
49
|
+
export { getDutchEndSlopeFaces, getDutchRoofShapeMetrics, getRoofModuleFaces, getRoofShapeEaveSides, getRoofShapeInsets, getRoofShapeRatios, } from './nodes/roof-segment-shape';
|
|
45
50
|
export { clampRectToRoofWallFace, getMaxRoofRectHeightFromAnchor, getMaxRoofRectWidthFromAnchor, getRoofSegmentWallFace, getRoofSegmentWallFaces, getRoofWallFaceFrame, roofFacePointToSegment, segmentPointToRoofWallFace, } from './nodes/roof-segment-walls';
|
|
46
|
-
export { ScanNode } from './nodes/scan';
|
|
51
|
+
export { CaptureSessionReference, ScanNode, } from './nodes/scan';
|
|
47
52
|
export { ShelfNode } from './nodes/shelf';
|
|
48
53
|
export { SiteNode } from './nodes/site';
|
|
49
54
|
export { SKYLIGHT_TYPE_ORDER, SKYLIGHT_TYPE_PRESETS, SkylightMaterialRole, SkylightNode, SkylightOpeningSide, SkylightSlideDirection, SkylightType, } from './nodes/skylight';
|
|
@@ -54,11 +59,11 @@ export { getEffectiveStairSurfaceMaterial, StairNode, StairRailingMode, StairSla
|
|
|
54
59
|
export { AttachmentSide, StairSegmentNode, StairSegmentType } from './nodes/stair-segment';
|
|
55
60
|
export { StructuralGridNode } from './nodes/structural-grid';
|
|
56
61
|
export { SurfaceHoleMetadata } from './nodes/surface-hole-metadata';
|
|
57
|
-
export { TurbineVentNode } from './nodes/turbine-vent';
|
|
62
|
+
export { TurbineVentMaterialRole, TurbineVentNode } from './nodes/turbine-vent';
|
|
58
63
|
export { buildEnabledWallFaceBandPatch, buildWallFaceBandCountPatch, getEffectiveWallSurfaceMaterial, getWallBandSlotId, getWallFaceBandConfig, getWallFaceBandForHeight, getWallSurfaceMaterialSignature, getWallSurfaceSideFromBandSlot, WALL_CHAIR_RAIL_DEFAULT, WALL_CHAIR_RAIL_SLOT_DEFAULT, WALL_CROWN_DEFAULT, WALL_CROWN_SLOT_DEFAULT, WALL_FACE_BAND_DEFAULT, WALL_SKIRTING_DEFAULT, WALL_SKIRTING_SLOT_DEFAULT, WALL_SLOT_DEFAULT, WALL_SURFACE_SLOT_DEFAULTS, WALL_TRIM_DEFAULTS, WallNode, WallTreatmentSide, WallTrimProfile, } from './nodes/wall';
|
|
59
64
|
export { WindowConstructionType, WindowDimensionReference, WindowNode, WindowType, } from './nodes/window';
|
|
60
65
|
export { ZoneNode } from './nodes/zone';
|
|
61
66
|
export { generateSceneMaterialId, SceneMaterial } from './scene-material';
|
|
62
67
|
export { MAX_TERRAIN_SIDE, TerrainData } from './terrain';
|
|
63
68
|
// Union types
|
|
64
|
-
export { AnyNode } from './types';
|
|
69
|
+
export { AnyNode, nodeKindOf } from './types';
|
|
@@ -60,6 +60,7 @@ export declare const MaterialSchema: z.ZodObject<{
|
|
|
60
60
|
export type MaterialSchema = z.infer<typeof MaterialSchema>;
|
|
61
61
|
export declare const MaterialTarget: z.ZodEnum<{
|
|
62
62
|
wall: "wall";
|
|
63
|
+
ceiling: "ceiling";
|
|
63
64
|
roof: "roof";
|
|
64
65
|
"roof-segment": "roof-segment";
|
|
65
66
|
stair: "stair";
|
|
@@ -67,7 +68,6 @@ export declare const MaterialTarget: z.ZodEnum<{
|
|
|
67
68
|
fence: "fence";
|
|
68
69
|
column: "column";
|
|
69
70
|
slab: "slab";
|
|
70
|
-
ceiling: "ceiling";
|
|
71
71
|
door: "door";
|
|
72
72
|
window: "window";
|
|
73
73
|
shelf: "shelf";
|
|
@@ -81,6 +81,7 @@ export declare const MaterialTarget: z.ZodEnum<{
|
|
|
81
81
|
cupola: "cupola";
|
|
82
82
|
"eyebrow-vent": "eyebrow-vent";
|
|
83
83
|
gutter: "gutter";
|
|
84
|
+
downspout: "downspout";
|
|
84
85
|
}>;
|
|
85
86
|
export type MaterialTarget = z.infer<typeof MaterialTarget>;
|
|
86
87
|
export declare const TextureWrapMode: z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../src/schema/material.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,cAAc;;;;;;;;;;;EAWzB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,kBAAkB;;;;;;;;;;;iBAO7B,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYzB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../src/schema/material.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,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E,CAAA;AAED,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,cAAc,GAAG,kBAAkB,CAiB7E"}
|
package/dist/schema/material.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AnyNode, AnyNodeId } from '../types';
|
|
2
|
+
import type { DownspoutNode } from './downspout';
|
|
3
|
+
import { type GutterNode } from './gutter';
|
|
4
|
+
import type { RoofSegmentNode } from './roof-segment';
|
|
5
|
+
export type AutoDownspoutPlacement = {
|
|
6
|
+
gutterId: GutterNode['id'];
|
|
7
|
+
offset: number;
|
|
8
|
+
};
|
|
9
|
+
export type AutomaticDownspoutInput = {
|
|
10
|
+
segments: readonly RoofSegmentNode[];
|
|
11
|
+
gutters: readonly GutterNode[];
|
|
12
|
+
downspouts: readonly DownspoutNode[];
|
|
13
|
+
maxRunPerDownspout?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function resolveAutomaticDownspoutLength(nodes: Record<AnyNodeId, AnyNode>, segment: RoofSegmentNode, gutter: GutterNode, outletOffset: number): number;
|
|
16
|
+
export declare function planAutomaticDownspouts({ segments, gutters, downspouts, maxRunPerDownspout, }: AutomaticDownspoutInput): AutoDownspoutPlacement[];
|
|
17
|
+
//# sourceMappingURL=automatic-downspout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automatic-downspout.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/automatic-downspout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAI9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAiBrD,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAA;IACpC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAA;IAC9B,UAAU,EAAE,SAAS,aAAa,EAAE,CAAA;IACpC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAuED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EACjC,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,MAAM,GACnB,MAAM,CA+CR;AAmCD,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,OAAO,EACP,UAAU,EACV,kBAAoD,GACrD,EAAE,uBAAuB,GAAG,sBAAsB,EAAE,CAmHpD"}
|