@holoscript/core 6.0.3 → 7.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/README.md +40 -40
- package/dist/codebase/index.d.ts +25 -0
- package/dist/compiler/index.d.ts +82 -0
- package/dist/constants.d.ts +4 -0
- package/dist/coordinators/index.d.ts +189 -0
- package/dist/entries/interop.d.ts +9 -0
- package/dist/entries/scripting.d.ts +7 -0
- package/dist/index.d.ts +520 -19
- package/dist/paper-0c-spike/index.d.ts +29 -0
- package/dist/reconstruction/index.d.ts +78 -0
- package/dist/self-improvement/index.d.ts +0 -48
- package/dist/storage/index.d.ts +24 -0
- package/dist/tools/index.d.ts +33 -0
- package/dist/traitDocs/traitDocs.d.ts +69 -0
- package/dist/traits/index.d.ts +61 -0
- package/package.json +102 -19
- package/dist/GLTFPipeline-3KLWWUQO.cjs +0 -34
- package/dist/GLTFPipeline-LYII2ZVQ.js +0 -13
- package/dist/HoloScriptPlusParser-BZR5DELQ.js +0 -692
- package/dist/HoloScriptPlusParser-SBMYDNXO.cjs +0 -697
- package/dist/USDZExporter-MHEHXZB4.cjs +0 -709
- package/dist/USDZExporter-YA55ZS35.js +0 -707
- package/dist/chunk-26TLYBFD.js +0 -309
- package/dist/chunk-27LWW5FU.cjs +0 -410
- package/dist/chunk-2UX5LRAP.cjs +0 -833
- package/dist/chunk-32TWR3HE.js +0 -70
- package/dist/chunk-3FXV5S25.cjs +0 -633
- package/dist/chunk-3FYZOR7S.cjs +0 -69
- package/dist/chunk-3KEU5QYY.cjs +0 -175
- package/dist/chunk-4FCZDTD5.js +0 -610
- package/dist/chunk-4KJ2R7VP.cjs +0 -507
- package/dist/chunk-4SMUJFHL.js +0 -1213
- package/dist/chunk-54FHG2MX.js +0 -655
- package/dist/chunk-56IF4NTA.js +0 -56
- package/dist/chunk-5GLCTO44.js +0 -161
- package/dist/chunk-5TOFIR6L.js +0 -407
- package/dist/chunk-65RFOWZI.js +0 -765
- package/dist/chunk-6OQBLABR.js +0 -5240
- package/dist/chunk-6WNCRE6F.js +0 -126
- package/dist/chunk-74YCHHTE.js +0 -1872
- package/dist/chunk-7H5UNJZD.cjs +0 -1973
- package/dist/chunk-7KPI4EKH.cjs +0 -701
- package/dist/chunk-7LCYLPW2.cjs +0 -663
- package/dist/chunk-7N3JIJMT.js +0 -1395
- package/dist/chunk-7X2IEJIE.cjs +0 -2526
- package/dist/chunk-A6GO3DPZ.cjs +0 -1002
- package/dist/chunk-AC4BSHFV.js +0 -765
- package/dist/chunk-AIUXRS74.cjs +0 -3681
- package/dist/chunk-ARNKA274.cjs +0 -130
- package/dist/chunk-AW7WAELW.js +0 -975
- package/dist/chunk-BKIGPPVM.js +0 -629
- package/dist/chunk-BO2OKHIY.js +0 -6055
- package/dist/chunk-BU5ZAFMC.js +0 -115
- package/dist/chunk-BY3B7ZYV.cjs +0 -457
- package/dist/chunk-C2QHVHZF.js +0 -4066
- package/dist/chunk-C7BNX4XJ.js +0 -1043
- package/dist/chunk-CLYEIWA5.cjs +0 -408
- package/dist/chunk-CMYAWUX3.js +0 -4455
- package/dist/chunk-CN4NOESF.cjs +0 -416
- package/dist/chunk-CNVM7J3M.js +0 -883
- package/dist/chunk-CO2VM2DK.js +0 -1965
- package/dist/chunk-CQDOF3G7.cjs +0 -1404
- package/dist/chunk-DH5G2JUA.cjs +0 -614
- package/dist/chunk-DIEDKX5B.cjs +0 -660
- package/dist/chunk-DN7UFU63.cjs +0 -172
- package/dist/chunk-DXVCEFZB.js +0 -2027
- package/dist/chunk-EGIZHYJP.cjs +0 -85
- package/dist/chunk-EJA7G2C4.cjs +0 -428
- package/dist/chunk-ELLQPFAF.js +0 -830
- package/dist/chunk-EMO7HAKJ.cjs +0 -1875
- package/dist/chunk-ENV7K6XA.js +0 -282
- package/dist/chunk-EPWRXL6S.js +0 -2522
- package/dist/chunk-EUFLX2PI.js +0 -56956
- package/dist/chunk-F5LVGHNT.js +0 -449
- package/dist/chunk-FEFHPUEM.cjs +0 -6122
- package/dist/chunk-FF3Q7ADR.js +0 -380
- package/dist/chunk-GC3YU46J.js +0 -762
- package/dist/chunk-H6WMMLQK.cjs +0 -4492
- package/dist/chunk-H7XMORZI.js +0 -2731
- package/dist/chunk-HAN4V3PF.cjs +0 -2037
- package/dist/chunk-HBZYCASG.js +0 -4208
- package/dist/chunk-HF4OFY25.cjs +0 -4097
- package/dist/chunk-HHS6FMOU.cjs +0 -3813
- package/dist/chunk-HJJLD366.js +0 -1169
- package/dist/chunk-HKCVM6OK.cjs +0 -2237
- package/dist/chunk-HUFNKFA6.js +0 -698
- package/dist/chunk-I3XGTIHM.cjs +0 -1505
- package/dist/chunk-I6XZ5DZF.cjs +0 -488
- package/dist/chunk-IHOUYQIA.js +0 -406
- package/dist/chunk-ILRBGFVD.cjs +0 -72
- package/dist/chunk-KDB6BUMB.js +0 -3666
- package/dist/chunk-KUJRR4FJ.js +0 -657
- package/dist/chunk-KYM4XRFG.js +0 -421
- package/dist/chunk-L3Z2HIWJ.cjs +0 -793
- package/dist/chunk-LBPEZQAF.js +0 -2232
- package/dist/chunk-LER4WXW5.cjs +0 -286
- package/dist/chunk-LK5IAVH6.cjs +0 -1173
- package/dist/chunk-M6FU6S22.js +0 -2911
- package/dist/chunk-MWEFR6YQ.js +0 -1857
- package/dist/chunk-N5FTS757.cjs +0 -415
- package/dist/chunk-NCUHGRTZ.js +0 -752
- package/dist/chunk-NKRKT6V2.js +0 -69
- package/dist/chunk-NLPSZT4C.js +0 -630
- package/dist/chunk-NRUB55IT.cjs +0 -771
- package/dist/chunk-NTMZSDXM.cjs +0 -633
- package/dist/chunk-ODGMVILH.js +0 -9662
- package/dist/chunk-PBA6NXCT.cjs +0 -1216
- package/dist/chunk-PHENW4MQ.js +0 -65
- package/dist/chunk-PJMOXFPR.cjs +0 -1861
- package/dist/chunk-PLMYCCA4.js +0 -504
- package/dist/chunk-PPULB4GG.cjs +0 -9728
- package/dist/chunk-PQLGZKMC.cjs +0 -755
- package/dist/chunk-Q56TT7IL.js +0 -483
- package/dist/chunk-QHVVVN47.cjs +0 -2033
- package/dist/chunk-QWKUKVRE.js +0 -2026
- package/dist/chunk-RE3OKSYF.cjs +0 -424
- package/dist/chunk-RT7LJRSF.cjs +0 -57378
- package/dist/chunk-SPDELRRV.cjs +0 -319
- package/dist/chunk-SUCBB66F.js +0 -229
- package/dist/chunk-TSWTWZ42.cjs +0 -4214
- package/dist/chunk-UITWA6DV.cjs +0 -2829
- package/dist/chunk-UQW6SLM5.js +0 -172
- package/dist/chunk-V2ILLPHK.cjs +0 -237
- package/dist/chunk-V42NTCFH.js +0 -3645
- package/dist/chunk-VJ3L7CHT.cjs +0 -169
- package/dist/chunk-VJVCD5T5.cjs +0 -769
- package/dist/chunk-VK5AXKO3.js +0 -746
- package/dist/chunk-VSXOIUCF.cjs +0 -473
- package/dist/chunk-VZNKJZTT.cjs +0 -749
- package/dist/chunk-W76ETJTI.js +0 -678
- package/dist/chunk-WFJIDI2N.cjs +0 -424
- package/dist/chunk-WN3YF33G.cjs +0 -118
- package/dist/chunk-WUXIRGZP.cjs +0 -2915
- package/dist/chunk-WYH4GVZ5.js +0 -1488
- package/dist/chunk-X4YVN7H3.cjs +0 -888
- package/dist/chunk-X67XRI2T.js +0 -410
- package/dist/chunk-XDXZM3ZP.cjs +0 -1046
- package/dist/chunk-XH7SE4HH.cjs +0 -72
- package/dist/chunk-XNMEH2BI.js +0 -126
- package/dist/chunk-XSF76QRU.js +0 -468
- package/dist/chunk-XSUZMPVQ.cjs +0 -682
- package/dist/chunk-XUILI4KB.cjs +0 -430
- package/dist/chunk-Y5MUAYTO.js +0 -167
- package/dist/chunk-Y7VK5TH3.cjs +0 -129
- package/dist/chunk-YCMQQQ5U.cjs +0 -5244
- package/dist/chunk-YYXH45E2.js +0 -426
- package/dist/chunk-ZGTGVSTZ.js +0 -422
- package/dist/chunk-ZL6VJ6SN.js +0 -421
- package/dist/cli/holoscript-runner.cjs +0 -2258
- package/dist/cli/holoscript-runner.js +0 -2233
- package/dist/codebase/index.cjs +0 -336
- package/dist/codebase/index.js +0 -331
- package/dist/compiler/agent-inference.cjs +0 -29
- package/dist/compiler/agent-inference.js +0 -6
- package/dist/compiler/android-xr.cjs +0 -20
- package/dist/compiler/android-xr.js +0 -10
- package/dist/compiler/android.cjs +0 -21
- package/dist/compiler/android.js +0 -11
- package/dist/compiler/ar.cjs +0 -21
- package/dist/compiler/ar.js +0 -9
- package/dist/compiler/babylon.cjs +0 -18
- package/dist/compiler/babylon.js +0 -12
- package/dist/compiler/coco.cjs +0 -27
- package/dist/compiler/coco.js +0 -4
- package/dist/compiler/domain-block-utils.cjs +0 -595
- package/dist/compiler/domain-block-utils.js +0 -9
- package/dist/compiler/dtdl.cjs +0 -25
- package/dist/compiler/dtdl.js +0 -9
- package/dist/compiler/gltf-pipeline.cjs +0 -39
- package/dist/compiler/gltf-pipeline.js +0 -4
- package/dist/compiler/godot.cjs +0 -16
- package/dist/compiler/godot.js +0 -10
- package/dist/compiler/incremental.cjs +0 -30
- package/dist/compiler/incremental.js +0 -5
- package/dist/compiler/index.cjs +0 -1522
- package/dist/compiler/index.js +0 -1321
- package/dist/compiler/ios.cjs +0 -21
- package/dist/compiler/ios.js +0 -11
- package/dist/compiler/multi-layer.cjs +0 -27
- package/dist/compiler/multi-layer.js +0 -12
- package/dist/compiler/nodetoy.cjs +0 -23
- package/dist/compiler/nodetoy.js +0 -4
- package/dist/compiler/openxr.cjs +0 -16
- package/dist/compiler/openxr.js +0 -10
- package/dist/compiler/playcanvas.cjs +0 -17
- package/dist/compiler/playcanvas.js +0 -11
- package/dist/compiler/r3f.cjs +0 -35
- package/dist/compiler/r3f.js +0 -13
- package/dist/compiler/remotion.cjs +0 -23
- package/dist/compiler/remotion.js +0 -4
- package/dist/compiler/reproducibility.cjs +0 -39
- package/dist/compiler/reproducibility.js +0 -4
- package/dist/compiler/sdf.cjs +0 -22
- package/dist/compiler/sdf.js +0 -10
- package/dist/compiler/semantic-scene.cjs +0 -31
- package/dist/compiler/semantic-scene.js +0 -4
- package/dist/compiler/state.cjs +0 -18
- package/dist/compiler/state.js +0 -8
- package/dist/compiler/trait-composition.cjs +0 -27
- package/dist/compiler/trait-composition.js +0 -6
- package/dist/compiler/unity.cjs +0 -16
- package/dist/compiler/unity.js +0 -10
- package/dist/compiler/unreal.cjs +0 -20
- package/dist/compiler/unreal.js +0 -10
- package/dist/compiler/urdf.cjs +0 -46
- package/dist/compiler/urdf.js +0 -10
- package/dist/compiler/usd-physics.cjs +0 -24
- package/dist/compiler/usd-physics.js +0 -7
- package/dist/compiler/visionos.cjs +0 -16
- package/dist/compiler/visionos.js +0 -10
- package/dist/compiler/vrchat.cjs +0 -20
- package/dist/compiler/vrchat.js +0 -10
- package/dist/compiler/vrr.cjs +0 -22
- package/dist/compiler/vrr.js +0 -10
- package/dist/compiler/wasm.cjs +0 -34
- package/dist/compiler/wasm.js +0 -10
- package/dist/compiler/webgpu.cjs +0 -16
- package/dist/compiler/webgpu.js +0 -10
- package/dist/debugger.cjs +0 -21
- package/dist/debugger.js +0 -8
- package/dist/entries/interop.cjs +0 -62
- package/dist/entries/interop.js +0 -5
- package/dist/entries/scripting.cjs +0 -67
- package/dist/entries/scripting.js +0 -10
- package/dist/index.cjs +0 -61703
- package/dist/index.js +0 -58652
- package/dist/math/vec3.cjs +0 -57
- package/dist/math/vec3.js +0 -4
- package/dist/parser.cjs +0 -26
- package/dist/parser.js +0 -9
- package/dist/playwright-7DTEQCBD.cjs +0 -98673
- package/dist/playwright-BIZXMLD2.js +0 -98660
- package/dist/post-quantum-JTTAAGO3.cjs +0 -6
- package/dist/post-quantum-RVPVDEPI.js +0 -4
- package/dist/runtime.cjs +0 -16
- package/dist/runtime.js +0 -7
- package/dist/storage/index.cjs +0 -37
- package/dist/storage/index.js +0 -4
- package/dist/traits/index.cjs +0 -14331
- package/dist/traits/index.js +0 -12126
- package/dist/type-checker.cjs +0 -18
- package/dist/type-checker.js +0 -5
- package/dist/wot/index.cjs +0 -29
- package/dist/wot/index.js +0 -4
package/dist/chunk-ZGTGVSTZ.js
DELETED
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
// src/compiler/SemanticSceneGraph.ts
|
|
2
|
-
var DEFAULT_CONTEXT = {
|
|
3
|
-
"@vocab": "https://holoscript.dev/schema/",
|
|
4
|
-
schema: "https://schema.org/",
|
|
5
|
-
hs: "https://holoscript.dev/schema/",
|
|
6
|
-
xsd: "http://www.w3.org/2001/XMLSchema#",
|
|
7
|
-
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
8
|
-
};
|
|
9
|
-
function generateSemanticSceneGraph(composition, options = {}) {
|
|
10
|
-
const generator = new SceneGraphGenerator(options);
|
|
11
|
-
const graph = generator.convert(composition);
|
|
12
|
-
return JSON.stringify(graph, null, options.pretty !== false ? 2 : void 0);
|
|
13
|
-
}
|
|
14
|
-
function generateSemanticSceneGraphObject(composition, options = {}) {
|
|
15
|
-
const generator = new SceneGraphGenerator(options);
|
|
16
|
-
return generator.convert(composition);
|
|
17
|
-
}
|
|
18
|
-
var SceneGraphGenerator = class {
|
|
19
|
-
constructor(options = {}) {
|
|
20
|
-
this.idCounter = 0;
|
|
21
|
-
this.baseURI = options.baseURI ?? "urn:holoscript:";
|
|
22
|
-
this.includeSourceLocations = options.includeSourceLocations ?? false;
|
|
23
|
-
this.includeMetadata = options.includeMetadata ?? true;
|
|
24
|
-
this.maxDepth = options.maxDepth ?? 10;
|
|
25
|
-
this.contextExtensions = options.contextExtensions ?? {};
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Convert a HoloComposition into a JSON-LD scene graph.
|
|
29
|
-
*/
|
|
30
|
-
convert(composition) {
|
|
31
|
-
this.idCounter = 0;
|
|
32
|
-
const context = {
|
|
33
|
-
...DEFAULT_CONTEXT,
|
|
34
|
-
...this.contextExtensions
|
|
35
|
-
};
|
|
36
|
-
const graph = {
|
|
37
|
-
"@context": context,
|
|
38
|
-
"@type": "hs:Composition",
|
|
39
|
-
"@id": this.makeId(composition.name),
|
|
40
|
-
"schema:name": composition.name
|
|
41
|
-
};
|
|
42
|
-
if (composition.objects?.length > 0) {
|
|
43
|
-
graph["hs:objects"] = composition.objects.map((obj) => this.convertObject(obj));
|
|
44
|
-
}
|
|
45
|
-
if (composition.spatialGroups?.length > 0) {
|
|
46
|
-
graph["hs:spatialGroups"] = composition.spatialGroups.map(
|
|
47
|
-
(g) => this.convertSpatialGroup(g, 0)
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
if (composition.lights?.length > 0) {
|
|
51
|
-
graph["hs:lights"] = composition.lights.map((l) => this.convertLight(l));
|
|
52
|
-
}
|
|
53
|
-
if (composition.camera) {
|
|
54
|
-
graph["hs:camera"] = this.convertCamera(composition.camera);
|
|
55
|
-
}
|
|
56
|
-
if (composition.timelines?.length > 0) {
|
|
57
|
-
graph["hs:timelines"] = composition.timelines.map((t) => this.convertTimeline(t));
|
|
58
|
-
}
|
|
59
|
-
if (composition.audio?.length > 0) {
|
|
60
|
-
graph["hs:audio"] = composition.audio.map((a) => this.convertAudio(a));
|
|
61
|
-
}
|
|
62
|
-
if (composition.zones?.length > 0) {
|
|
63
|
-
graph["hs:zones"] = composition.zones.map((z) => this.convertZone(z));
|
|
64
|
-
}
|
|
65
|
-
if (composition.npcs?.length > 0) {
|
|
66
|
-
graph["hs:npcs"] = composition.npcs.map((n) => this.convertNPC(n));
|
|
67
|
-
}
|
|
68
|
-
if ((composition.domainBlocks?.length ?? 0) > 0) {
|
|
69
|
-
graph["hs:domainBlocks"] = composition.domainBlocks.map((d) => this.convertDomainBlock(d));
|
|
70
|
-
}
|
|
71
|
-
if (composition.shapes?.length > 0) {
|
|
72
|
-
graph["hs:shapes"] = composition.shapes.map((s) => this.convertShape(s));
|
|
73
|
-
}
|
|
74
|
-
if (this.includeMetadata && composition.environment) {
|
|
75
|
-
const envProps = {};
|
|
76
|
-
for (const prop of composition.environment.properties) {
|
|
77
|
-
envProps[prop.key] = this.serializeValue(prop.value);
|
|
78
|
-
}
|
|
79
|
-
graph["hs:environment"] = {
|
|
80
|
-
"@type": "hs:Environment",
|
|
81
|
-
...envProps
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
if (this.includeMetadata && composition.state) {
|
|
85
|
-
const stateProps = {};
|
|
86
|
-
for (const prop of composition.state.properties) {
|
|
87
|
-
stateProps[prop.key] = this.serializeValue(prop.value);
|
|
88
|
-
}
|
|
89
|
-
graph["hs:state"] = {
|
|
90
|
-
"@type": "hs:State",
|
|
91
|
-
...stateProps
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
return graph;
|
|
95
|
-
}
|
|
96
|
-
// ---------------------------------------------------------------------------
|
|
97
|
-
// Object conversion
|
|
98
|
-
// ---------------------------------------------------------------------------
|
|
99
|
-
convertObject(obj) {
|
|
100
|
-
const node = {
|
|
101
|
-
"@type": "hs:Object",
|
|
102
|
-
"@id": this.makeId(obj.name),
|
|
103
|
-
"schema:name": obj.name
|
|
104
|
-
};
|
|
105
|
-
if (obj.template) {
|
|
106
|
-
node["hs:template"] = obj.template;
|
|
107
|
-
}
|
|
108
|
-
if (obj.properties?.length > 0) {
|
|
109
|
-
const props = {};
|
|
110
|
-
for (const prop of obj.properties) {
|
|
111
|
-
props[prop.key] = this.serializeValue(prop.value);
|
|
112
|
-
}
|
|
113
|
-
node["hs:properties"] = props;
|
|
114
|
-
}
|
|
115
|
-
if (obj.traits?.length > 0) {
|
|
116
|
-
node["hs:traits"] = obj.traits.map((t) => this.convertTrait(t));
|
|
117
|
-
}
|
|
118
|
-
if (obj.children?.length) {
|
|
119
|
-
node["hs:children"] = obj.children.map((c) => this.convertObject(c));
|
|
120
|
-
}
|
|
121
|
-
if (obj.platformConstraint) {
|
|
122
|
-
node["hs:platformConstraint"] = {
|
|
123
|
-
include: obj.platformConstraint.include,
|
|
124
|
-
exclude: obj.platformConstraint.exclude
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
if (this.includeSourceLocations && obj.loc) {
|
|
128
|
-
node["hs:sourceLocation"] = {
|
|
129
|
-
startLine: obj.loc.start.line,
|
|
130
|
-
startColumn: obj.loc.start.column,
|
|
131
|
-
endLine: obj.loc.end.line,
|
|
132
|
-
endColumn: obj.loc.end.column
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
return node;
|
|
136
|
-
}
|
|
137
|
-
// ---------------------------------------------------------------------------
|
|
138
|
-
// Trait conversion
|
|
139
|
-
// ---------------------------------------------------------------------------
|
|
140
|
-
convertTrait(trait) {
|
|
141
|
-
const node = {
|
|
142
|
-
"@type": "hs:Trait",
|
|
143
|
-
"schema:name": trait.name
|
|
144
|
-
};
|
|
145
|
-
if (trait.config && Object.keys(trait.config).length > 0) {
|
|
146
|
-
const config = {};
|
|
147
|
-
for (const [key, val] of Object.entries(trait.config)) {
|
|
148
|
-
config[key] = this.serializeValue(val);
|
|
149
|
-
}
|
|
150
|
-
node["hs:config"] = config;
|
|
151
|
-
}
|
|
152
|
-
return node;
|
|
153
|
-
}
|
|
154
|
-
// ---------------------------------------------------------------------------
|
|
155
|
-
// Spatial group conversion
|
|
156
|
-
// ---------------------------------------------------------------------------
|
|
157
|
-
convertSpatialGroup(group, depth) {
|
|
158
|
-
const node = {
|
|
159
|
-
"@type": "hs:SpatialGroup",
|
|
160
|
-
"@id": this.makeId(group.name),
|
|
161
|
-
"schema:name": group.name
|
|
162
|
-
};
|
|
163
|
-
if (group.properties?.length > 0) {
|
|
164
|
-
const props = {};
|
|
165
|
-
for (const prop of group.properties) {
|
|
166
|
-
props[prop.key] = this.serializeValue(prop.value);
|
|
167
|
-
}
|
|
168
|
-
node["hs:properties"] = props;
|
|
169
|
-
}
|
|
170
|
-
if (group.objects?.length > 0) {
|
|
171
|
-
node["hs:objects"] = group.objects.map((o) => this.convertObject(o));
|
|
172
|
-
}
|
|
173
|
-
if (group.groups?.length && depth < this.maxDepth) {
|
|
174
|
-
node["hs:children"] = group.groups.map((g) => this.convertSpatialGroup(g, depth + 1));
|
|
175
|
-
}
|
|
176
|
-
if (group.platformConstraint) {
|
|
177
|
-
node["hs:platformConstraint"] = {
|
|
178
|
-
include: group.platformConstraint.include,
|
|
179
|
-
exclude: group.platformConstraint.exclude
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
return node;
|
|
183
|
-
}
|
|
184
|
-
// ---------------------------------------------------------------------------
|
|
185
|
-
// Light conversion
|
|
186
|
-
// ---------------------------------------------------------------------------
|
|
187
|
-
convertLight(light) {
|
|
188
|
-
const node = {
|
|
189
|
-
"@type": "hs:Light",
|
|
190
|
-
"@id": this.makeId(light.name),
|
|
191
|
-
"schema:name": light.name,
|
|
192
|
-
"hs:lightType": light.lightType
|
|
193
|
-
};
|
|
194
|
-
if (light.properties?.length > 0) {
|
|
195
|
-
const props = {};
|
|
196
|
-
for (const prop of light.properties) {
|
|
197
|
-
props[prop.key] = this.serializeValue(prop.value);
|
|
198
|
-
}
|
|
199
|
-
node["hs:properties"] = props;
|
|
200
|
-
}
|
|
201
|
-
return node;
|
|
202
|
-
}
|
|
203
|
-
// ---------------------------------------------------------------------------
|
|
204
|
-
// Camera conversion
|
|
205
|
-
// ---------------------------------------------------------------------------
|
|
206
|
-
convertCamera(camera) {
|
|
207
|
-
const node = {
|
|
208
|
-
"@type": "hs:Camera",
|
|
209
|
-
"hs:cameraType": camera.cameraType
|
|
210
|
-
};
|
|
211
|
-
if (camera.properties?.length > 0) {
|
|
212
|
-
const props = {};
|
|
213
|
-
for (const prop of camera.properties) {
|
|
214
|
-
props[prop.key] = this.serializeValue(prop.value);
|
|
215
|
-
}
|
|
216
|
-
node["hs:properties"] = props;
|
|
217
|
-
}
|
|
218
|
-
return node;
|
|
219
|
-
}
|
|
220
|
-
// ---------------------------------------------------------------------------
|
|
221
|
-
// Timeline conversion
|
|
222
|
-
// ---------------------------------------------------------------------------
|
|
223
|
-
convertTimeline(timeline) {
|
|
224
|
-
const node = {
|
|
225
|
-
"@type": "hs:Timeline",
|
|
226
|
-
"@id": this.makeId(timeline.name),
|
|
227
|
-
"schema:name": timeline.name
|
|
228
|
-
};
|
|
229
|
-
if (timeline.autoplay !== void 0) {
|
|
230
|
-
node["hs:autoplay"] = timeline.autoplay;
|
|
231
|
-
}
|
|
232
|
-
if (timeline.loop !== void 0) {
|
|
233
|
-
node["hs:loop"] = timeline.loop;
|
|
234
|
-
}
|
|
235
|
-
if (timeline.entries?.length > 0) {
|
|
236
|
-
node["hs:entries"] = timeline.entries.map((e) => this.convertTimelineEntry(e));
|
|
237
|
-
}
|
|
238
|
-
return node;
|
|
239
|
-
}
|
|
240
|
-
convertTimelineEntry(entry) {
|
|
241
|
-
const node = {
|
|
242
|
-
"@type": "hs:TimelineEntry",
|
|
243
|
-
"hs:time": entry.time,
|
|
244
|
-
"hs:actionKind": entry.action.kind
|
|
245
|
-
};
|
|
246
|
-
if (entry.action.kind === "animate") {
|
|
247
|
-
node["hs:target"] = entry.action.target;
|
|
248
|
-
node["hs:animateProperties"] = entry.action.properties;
|
|
249
|
-
} else if (entry.action.kind === "emit") {
|
|
250
|
-
node["hs:event"] = entry.action.event;
|
|
251
|
-
if (entry.action.data !== void 0) {
|
|
252
|
-
node["hs:data"] = entry.action.data;
|
|
253
|
-
}
|
|
254
|
-
} else if (entry.action.kind === "call") {
|
|
255
|
-
node["hs:method"] = entry.action.method;
|
|
256
|
-
if (entry.action.args) {
|
|
257
|
-
node["hs:args"] = entry.action.args;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
return node;
|
|
261
|
-
}
|
|
262
|
-
// ---------------------------------------------------------------------------
|
|
263
|
-
// Audio conversion
|
|
264
|
-
// ---------------------------------------------------------------------------
|
|
265
|
-
convertAudio(audio) {
|
|
266
|
-
const node = {
|
|
267
|
-
"@type": "hs:Audio",
|
|
268
|
-
"@id": this.makeId(audio.name),
|
|
269
|
-
"schema:name": audio.name
|
|
270
|
-
};
|
|
271
|
-
if (audio.properties?.length > 0) {
|
|
272
|
-
const props = {};
|
|
273
|
-
for (const prop of audio.properties) {
|
|
274
|
-
props[prop.key] = this.serializeValue(prop.value);
|
|
275
|
-
}
|
|
276
|
-
node["hs:properties"] = props;
|
|
277
|
-
}
|
|
278
|
-
return node;
|
|
279
|
-
}
|
|
280
|
-
// ---------------------------------------------------------------------------
|
|
281
|
-
// Zone conversion
|
|
282
|
-
// ---------------------------------------------------------------------------
|
|
283
|
-
convertZone(zone) {
|
|
284
|
-
const node = {
|
|
285
|
-
"@type": "hs:Zone",
|
|
286
|
-
"@id": this.makeId(zone.name),
|
|
287
|
-
"schema:name": zone.name
|
|
288
|
-
};
|
|
289
|
-
if (zone.properties?.length > 0) {
|
|
290
|
-
const props = {};
|
|
291
|
-
for (const prop of zone.properties) {
|
|
292
|
-
props[prop.key] = this.serializeValue(prop.value);
|
|
293
|
-
}
|
|
294
|
-
node["hs:properties"] = props;
|
|
295
|
-
}
|
|
296
|
-
if (zone.handlers?.length > 0) {
|
|
297
|
-
node["hs:handlers"] = zone.handlers.map((h) => ({
|
|
298
|
-
"@type": "hs:EventHandler",
|
|
299
|
-
"hs:event": h.event
|
|
300
|
-
}));
|
|
301
|
-
}
|
|
302
|
-
return node;
|
|
303
|
-
}
|
|
304
|
-
// ---------------------------------------------------------------------------
|
|
305
|
-
// NPC conversion
|
|
306
|
-
// ---------------------------------------------------------------------------
|
|
307
|
-
convertNPC(npc) {
|
|
308
|
-
const node = {
|
|
309
|
-
"@type": "hs:NPC",
|
|
310
|
-
"@id": this.makeId(npc.name),
|
|
311
|
-
"schema:name": npc.name
|
|
312
|
-
};
|
|
313
|
-
if (npc.npcType) node["hs:npcType"] = npc.npcType;
|
|
314
|
-
if (npc.model) node["hs:model"] = npc.model;
|
|
315
|
-
if (npc.dialogueTree) node["hs:dialogueTree"] = npc.dialogueTree;
|
|
316
|
-
if (npc.properties?.length > 0) {
|
|
317
|
-
const props = {};
|
|
318
|
-
for (const prop of npc.properties) {
|
|
319
|
-
props[prop.key] = this.serializeValue(prop.value);
|
|
320
|
-
}
|
|
321
|
-
node["hs:properties"] = props;
|
|
322
|
-
}
|
|
323
|
-
if (npc.behaviors?.length > 0) {
|
|
324
|
-
node["hs:behaviors"] = npc.behaviors.map((b) => ({
|
|
325
|
-
"@type": "hs:Behavior",
|
|
326
|
-
"schema:name": b.name,
|
|
327
|
-
"hs:trigger": b.trigger,
|
|
328
|
-
"hs:priority": b.priority
|
|
329
|
-
}));
|
|
330
|
-
}
|
|
331
|
-
return node;
|
|
332
|
-
}
|
|
333
|
-
// ---------------------------------------------------------------------------
|
|
334
|
-
// Domain block conversion
|
|
335
|
-
// ---------------------------------------------------------------------------
|
|
336
|
-
convertDomainBlock(block) {
|
|
337
|
-
const node = {
|
|
338
|
-
"@type": `hs:DomainBlock`,
|
|
339
|
-
"@id": this.makeId(block.name),
|
|
340
|
-
"schema:name": block.name,
|
|
341
|
-
"hs:domain": block.domain,
|
|
342
|
-
"hs:keyword": block.keyword
|
|
343
|
-
};
|
|
344
|
-
if (block.traits?.length > 0) {
|
|
345
|
-
node["hs:traits"] = block.traits;
|
|
346
|
-
}
|
|
347
|
-
if (block.properties && Object.keys(block.properties).length > 0) {
|
|
348
|
-
const props = {};
|
|
349
|
-
for (const [key, val] of Object.entries(block.properties)) {
|
|
350
|
-
props[key] = this.serializeValue(val);
|
|
351
|
-
}
|
|
352
|
-
node["hs:properties"] = props;
|
|
353
|
-
}
|
|
354
|
-
if (block.children?.length) {
|
|
355
|
-
node["hs:children"] = block.children.map((c) => this.convertObject(c));
|
|
356
|
-
}
|
|
357
|
-
return node;
|
|
358
|
-
}
|
|
359
|
-
// ---------------------------------------------------------------------------
|
|
360
|
-
// Shape conversion
|
|
361
|
-
// ---------------------------------------------------------------------------
|
|
362
|
-
convertShape(shape) {
|
|
363
|
-
const node = {
|
|
364
|
-
"@type": "hs:Shape",
|
|
365
|
-
"@id": this.makeId(shape.name),
|
|
366
|
-
"schema:name": shape.name,
|
|
367
|
-
"hs:shapeType": shape.shapeType
|
|
368
|
-
};
|
|
369
|
-
if (shape.properties?.length > 0) {
|
|
370
|
-
const props = {};
|
|
371
|
-
for (const prop of shape.properties) {
|
|
372
|
-
props[prop.key] = this.serializeValue(prop.value);
|
|
373
|
-
}
|
|
374
|
-
node["hs:properties"] = props;
|
|
375
|
-
}
|
|
376
|
-
return node;
|
|
377
|
-
}
|
|
378
|
-
// ---------------------------------------------------------------------------
|
|
379
|
-
// Utility helpers
|
|
380
|
-
// ---------------------------------------------------------------------------
|
|
381
|
-
makeId(name) {
|
|
382
|
-
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
383
|
-
return `${this.baseURI}${slug}-${this.idCounter++}`;
|
|
384
|
-
}
|
|
385
|
-
serializeValue(value) {
|
|
386
|
-
if (value === null || value === void 0) return null;
|
|
387
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
388
|
-
return value;
|
|
389
|
-
}
|
|
390
|
-
if (Array.isArray(value)) {
|
|
391
|
-
return value.map((v) => this.serializeValue(v));
|
|
392
|
-
}
|
|
393
|
-
if (typeof value === "object" && "__bind" in value) {
|
|
394
|
-
return {
|
|
395
|
-
"@type": "hs:Binding",
|
|
396
|
-
"hs:source": value.source,
|
|
397
|
-
"hs:transform": value.transform
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
if (typeof value === "object") {
|
|
401
|
-
const result = {};
|
|
402
|
-
for (const [k, v] of Object.entries(value)) {
|
|
403
|
-
result[k] = this.serializeValue(v);
|
|
404
|
-
}
|
|
405
|
-
return result;
|
|
406
|
-
}
|
|
407
|
-
return value;
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
var SemanticSceneGraph = class {
|
|
411
|
-
static generate(composition, options) {
|
|
412
|
-
return generateSemanticSceneGraph(composition, options);
|
|
413
|
-
}
|
|
414
|
-
static generateObject(composition, options) {
|
|
415
|
-
return generateSemanticSceneGraphObject(composition, options);
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
var SemanticSceneGraph_default = SemanticSceneGraph;
|
|
419
|
-
|
|
420
|
-
export { SceneGraphGenerator, SemanticSceneGraph, SemanticSceneGraph_default, generateSemanticSceneGraph, generateSemanticSceneGraphObject };
|
|
421
|
-
//# sourceMappingURL=chunk-ZGTGVSTZ.js.map
|
|
422
|
-
//# sourceMappingURL=chunk-ZGTGVSTZ.js.map
|