@nebula-spatial/studio 0.0.0-stage → 0.1.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 +206 -3
- package/dist/ai/contract.d.ts +73 -0
- package/dist/ai/host.d.ts +28 -0
- package/dist/asset/dependency-scan.d.ts +78 -0
- package/dist/asset/intake.d.ts +84 -0
- package/dist/asset/layout-detect.d.ts +40 -0
- package/dist/asset/media-type.d.ts +10 -0
- package/dist/asset/model-inspection.d.ts +127 -0
- package/dist/asset/record.d.ts +35 -0
- package/dist/asset/remote-asset-resolver.d.ts +36 -0
- package/dist/asset/repairs.d.ts +53 -0
- package/dist/asset/resource-locator.d.ts +15 -0
- package/dist/asset/revision-diff.d.ts +33 -0
- package/dist/asset/source-contracts.d.ts +21 -0
- package/dist/asset/source-paths.d.ts +15 -0
- package/dist/asset/usd-inspection.d.ts +39 -0
- package/dist/asset/usd-source-metadata.d.ts +142 -0
- package/dist/asset/visual-intake.d.ts +27 -0
- package/dist/asset/visual-record.d.ts +22 -0
- package/dist/asset/web-intake.d.ts +46 -0
- package/dist/asset-source-BExlEcRt.js +444 -0
- package/dist/assets/usd-export-worker-BsGubtAE.js +1 -0
- package/dist/builders-BAXRR5o5.js +1854 -0
- package/dist/core/asset-task.d.ts +105 -0
- package/dist/core/context.d.ts +23 -0
- package/dist/core/host.d.ts +432 -0
- package/dist/core/persistence-controller.d.ts +58 -0
- package/dist/core/plugins.d.ts +139 -0
- package/dist/core/scene-tree.d.ts +62 -0
- package/dist/core/versions.d.ts +2 -0
- package/dist/core/when.d.ts +13 -0
- package/dist/core/write-policy.d.ts +29 -0
- package/dist/delivery/build-plan.d.ts +2 -0
- package/dist/delivery/contracts.d.ts +362 -0
- package/dist/delivery/digest.d.ts +3 -0
- package/dist/delivery/evidence.d.ts +10 -0
- package/dist/delivery/export-evidence.d.ts +3 -0
- package/dist/delivery/index.d.ts +9 -0
- package/dist/delivery/prim-name.d.ts +17 -0
- package/dist/delivery/profile.d.ts +4 -0
- package/dist/doc/builders.d.ts +99 -0
- package/dist/doc/command.d.ts +195 -0
- package/dist/doc/domain-extensions.d.ts +34 -0
- package/dist/doc/node-facts.d.ts +87 -0
- package/dist/doc/physics-facts.d.ts +74 -0
- package/dist/doc/placement-policy.d.ts +71 -0
- package/dist/doc/random-placement.d.ts +30 -0
- package/dist/doc/scene-graph.d.ts +80 -0
- package/dist/doc/scene-regions.d.ts +29 -0
- package/dist/doc/schema.d.ts +452 -0
- package/dist/doc/task.d.ts +71 -0
- package/dist/doc/validate.d.ts +68 -0
- package/dist/editor/asset-source.d.ts +15 -0
- package/dist/editor/editor.d.ts +246 -0
- package/dist/editor/index.d.ts +22 -0
- package/dist/editor/shortcuts.d.ts +2 -0
- package/dist/editor/types.d.ts +143 -0
- package/dist/editor/ui-plugins.d.ts +64 -0
- package/dist/editor.js +1755 -0
- package/dist/editorial-BkAFWfbg.js +83 -0
- package/dist/export-evidence-B_0zRmb8.js +5027 -0
- package/dist/generalization/domain.d.ts +10 -0
- package/dist/generalization/generalization.d.ts +371 -0
- package/dist/generalization/index.d.ts +11 -0
- package/dist/generalization.js +1659 -0
- package/dist/history/undo-stack.d.ts +74 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +2839 -0
- package/dist/persist/content-addressed.d.ts +11 -0
- package/dist/persist/create-scene-package-from-host.d.ts +7 -0
- package/dist/persist/indexeddb-store.d.ts +69 -0
- package/dist/persist/scene-file.d.ts +52 -0
- package/dist/persist/scene-package.d.ts +8 -0
- package/dist/persist/snapshot.d.ts +5 -0
- package/dist/physics-facts-tfQYyNTD.js +337 -0
- package/dist/placement-policy-DY_FNRDu.js +405 -0
- package/dist/ports/asset-ingestor.d.ts +41 -0
- package/dist/ports/asset-source.d.ts +57 -0
- package/dist/ports/delivery.d.ts +13 -0
- package/dist/ports/persistence.d.ts +29 -0
- package/dist/project/asset-catalog.d.ts +21 -0
- package/dist/project/contracts.d.ts +272 -0
- package/dist/project/editorial.d.ts +16 -0
- package/dist/project/identity.d.ts +20 -0
- package/dist/project/index.d.ts +9 -0
- package/dist/project/scene-document.d.ts +5 -0
- package/dist/project/source-dependencies.d.ts +7 -0
- package/dist/remote-asset-resolver-Cb8cfNmw.js +136 -0
- package/dist/scene/index.d.ts +12 -0
- package/dist/scene-graph-DBLKAhxa.js +681 -0
- package/dist/scene-session-BV1HnxNh.js +3506 -0
- package/dist/scene.js +244 -0
- package/dist/studio/delivery-catalog.d.ts +28 -0
- package/dist/studio/in-memory-asset-source.d.ts +15 -0
- package/dist/studio/index.d.ts +31 -0
- package/dist/studio/indexeddb-asset-source.d.ts +32 -0
- package/dist/studio/indexeddb-persistence.d.ts +13 -0
- package/dist/studio/remote-asset-importer.d.ts +56 -0
- package/dist/studio/source-package.d.ts +9 -0
- package/dist/studio/usd-export-client.d.ts +13 -0
- package/dist/studio/usd-export-protocol.d.ts +98 -0
- package/dist/studio/usd-export-worker.d.ts +1 -0
- package/dist/studio/usd-zip-reader.d.ts +14 -0
- package/dist/studio/web-asset-ingestor.d.ts +10 -0
- package/dist/studio/web-host.d.ts +8 -0
- package/dist/studio.js +5544 -0
- package/dist/util/asset-facts.d.ts +3 -0
- package/dist/util/data.d.ts +17 -0
- package/dist/util/diagnostics.d.ts +38 -0
- package/dist/util/geometry.d.ts +11 -0
- package/dist/util/hash.d.ts +9 -0
- package/dist/util/ids.d.ts +20 -0
- package/dist/util/math.d.ts +47 -0
- package/dist/util/ply-metadata.d.ts +19 -0
- package/dist/util/studio-source.d.ts +23 -0
- package/dist/version.d.ts +5 -0
- package/dist/view/appearance.d.ts +13 -0
- package/dist/view/authoring-appearance.d.ts +25 -0
- package/dist/view/bounds-preview.d.ts +34 -0
- package/dist/view/bounds.d.ts +11 -0
- package/dist/view/camera-zoom.d.ts +3 -0
- package/dist/view/geometry-anchors.d.ts +20 -0
- package/dist/view/gizmo-appearance.d.ts +5 -0
- package/dist/view/gizmo.d.ts +81 -0
- package/dist/view/group-selection.d.ts +13 -0
- package/dist/view/node-features.d.ts +39 -0
- package/dist/view/picking.d.ts +49 -0
- package/dist/view/placement.d.ts +48 -0
- package/dist/view/region-editing.d.ts +25 -0
- package/dist/view/rotation-guide.d.ts +36 -0
- package/dist/view/runtime-capabilities.d.ts +22 -0
- package/dist/view/scene-session.d.ts +258 -0
- package/dist/view/screen-bounds.d.ts +17 -0
- package/dist/view/selection-transform.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/CHANGELOG.md +48 -0
- package/node_modules/@nebula-spatial/cad-loader/README.md +108 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/cad-types.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/errors.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.js +2354 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-group-reader.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-parser.d.ts +78 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/dxbs-sidecar.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/geometry-segments.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/text-roundtrip.d.ts +4 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/types.d.ts +81 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/runtime-text-decoder.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/types.d.ts +153 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/insert-bbox.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/viewport-rect.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.d.ts +36 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.js +5829 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/geo-loader.d.ts +59 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/automatic-external-resources.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/external-variant-sidecar-fetch.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/flow-control.d.ts +29 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/frame-budget-scheduler.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-compact-executor.d.ts +19 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-local-adapter.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-pipeline.d.ts +92 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-worker-adapter.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-builder.d.ts +34 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-load-sink.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node.d.ts +304 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts +94 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.worker.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts +15 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-canonical.d.ts +37 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-quality.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/prepare-credit-gate.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/transport.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/cad-render-node.d.ts +80 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-geometry.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-material.d.ts +18 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts +23 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/viewport-instance-presenter.d.ts +66 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-insert-selection.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-text-selection.d.ts +31 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/annotation-idle-gate.d.ts +14 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-document-session.d.ts +187 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-font-runtime.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-insert-id.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-text-warmup.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/create-cad-document-session.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/load-session.d.ts +90 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/viewport-coverage.d.ts +32 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/abort.d.ts +3 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-display-color.d.ts +55 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-load-source.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/color-buffer.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/constants.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/display-color-buffer.d.ts +27 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/errors.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-builder.d.ts +25 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-font.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/types.d.ts +57 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/insert-bbox.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/timing.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/viewport-rect.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/viewer-theme.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/workers/geo-prepare.worker.js +2264 -0
- package/node_modules/@nebula-spatial/cad-loader/package.json +62 -0
- package/node_modules/@nebula-spatial/viewer/CHANGELOG.md +426 -0
- package/node_modules/@nebula-spatial/viewer/FBX-MATERIAL-CONVERSION.md +97 -0
- package/node_modules/@nebula-spatial/viewer/README.md +1056 -0
- package/node_modules/@nebula-spatial/viewer/USD-VISUAL-MATERIAL-SUPPORT.md +89 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.js +19 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/dist/asset-ir-DEOK9SqE.js +382 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/ground-grid.d.ts +6 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/source-types.d.ts +19 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/types.d.ts +393 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/usd-worker-Bom5cjz3.js +1392 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/text.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/types.d.ts +368 -0
- package/node_modules/@nebula-spatial/viewer/dist/index-ByBlfVc0.js +12132 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.d.ts +32 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.js +26 -0
- package/node_modules/@nebula-spatial/viewer/dist/inspection/types.d.ts +112 -0
- package/node_modules/@nebula-spatial/viewer/dist/mjcf-visual-DVRa0w90.js +72 -0
- package/node_modules/@nebula-spatial/viewer/dist/mujoco-runtime-Dhx6Ua2u.js +463 -0
- package/node_modules/@nebula-spatial/viewer/dist/plugins.d.ts +179 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/instances.d.ts +36 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/types.d.ts +258 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B-j6KdA-.js +389 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B4AICTeJ.js +963 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-BAG5cDYe.js +9153 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-runtime.d.ts +118 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-wasm-module.d.ts +11 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/openusd-wasm-module.d.ts +10 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/physics-runtime-state.d.ts +75 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/types.d.ts +129 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-inspection.d.ts +66 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-query.d.ts +50 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-resource-policy.d.ts +28 -0
- package/node_modules/@nebula-spatial/viewer/dist/types.d.ts +278 -0
- package/node_modules/@nebula-spatial/viewer/dist/ui/types.d.ts +48 -0
- package/node_modules/@nebula-spatial/viewer/dist/urdf-session-kemAnBn8.js +3231 -0
- package/node_modules/@nebula-spatial/viewer/dist/usd-session-QtwGKI7v.js +6771 -0
- package/node_modules/@nebula-spatial/viewer/dist/version.d.ts +5 -0
- package/node_modules/@nebula-spatial/viewer/dist/viewer.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/xacro-CYTPS7mh.js +1537 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd-runtime-manifest.json +15 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.js +14 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/package.json +66 -0
- package/package.json +87 -6
package/dist/scene.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { c as ze } from "./scene-session-BV1HnxNh.js";
|
|
2
|
+
import { WebGLRenderer as J, SRGBColorSpace as Q, Scene as K, PerspectiveCamera as ee, Group as V, Box3 as G, Vector3 as v, Quaternion as te, BoxGeometry as ne, MeshBasicMaterial as oe, Color as O, Mesh as re, LineSegments as se, EdgesGeometry as ae, LineBasicMaterial as ie, GridHelper as ce } from "three";
|
|
3
|
+
import { OrbitControls as le } from "three/examples/jsm/controls/OrbitControls.js";
|
|
4
|
+
import { X as de } from "./scene-graph-DBLKAhxa.js";
|
|
5
|
+
const ue = Object.freeze({
|
|
6
|
+
X: "#08ddd6",
|
|
7
|
+
Y: "#08ddd6",
|
|
8
|
+
Z: "#08ddd6"
|
|
9
|
+
}), pe = [
|
|
10
|
+
"position:absolute",
|
|
11
|
+
"inset:0",
|
|
12
|
+
"overflow:hidden",
|
|
13
|
+
"contain:layout paint",
|
|
14
|
+
"background:#090d0e"
|
|
15
|
+
].join(";"), he = [
|
|
16
|
+
"display:block",
|
|
17
|
+
"width:100%",
|
|
18
|
+
"height:100%",
|
|
19
|
+
"touch-action:none",
|
|
20
|
+
"cursor:grab"
|
|
21
|
+
].join(";"), me = [
|
|
22
|
+
"position:absolute",
|
|
23
|
+
"inset:0",
|
|
24
|
+
"pointer-events:none",
|
|
25
|
+
'font-family:"JetBrains Mono","SFMono-Regular",Consolas,monospace'
|
|
26
|
+
].join(";");
|
|
27
|
+
function Ae(e) {
|
|
28
|
+
const n = e.container.ownerDocument, t = n.createElement("div");
|
|
29
|
+
t.dataset.studioBoundsPreview = "true", t.style.cssText = pe;
|
|
30
|
+
const o = n.createElement("canvas");
|
|
31
|
+
o.className = "studio-bounds-preview-canvas", o.setAttribute("aria-label", "Three-dimensional bounding box preview"), o.tabIndex = 0, o.style.cssText = he;
|
|
32
|
+
const s = n.createElement("div");
|
|
33
|
+
s.style.cssText = me;
|
|
34
|
+
const r = n.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
35
|
+
r.setAttribute("width", "100%"), r.setAttribute("height", "100%"), r.style.cssText = "position:absolute;inset:0;overflow:visible", s.append(r);
|
|
36
|
+
const d = n.createElement("div");
|
|
37
|
+
d.style.cssText = [
|
|
38
|
+
"position:absolute",
|
|
39
|
+
"top:24px",
|
|
40
|
+
"right:28px",
|
|
41
|
+
"display:flex",
|
|
42
|
+
"align-items:baseline",
|
|
43
|
+
"gap:6px",
|
|
44
|
+
"color:#aeb4b4",
|
|
45
|
+
'font:12px/1.2 "JetBrains Mono",monospace',
|
|
46
|
+
"letter-spacing:.02em",
|
|
47
|
+
"text-shadow:0 1px 2px #000"
|
|
48
|
+
].join(";");
|
|
49
|
+
const u = n.createElement("span"), z = n.createElement("span");
|
|
50
|
+
z.textContent = "↑", d.append(u, z), s.append(d), t.append(o, s), e.container.append(t);
|
|
51
|
+
const i = new J({
|
|
52
|
+
canvas: o,
|
|
53
|
+
alpha: !0,
|
|
54
|
+
antialias: !0,
|
|
55
|
+
preserveDrawingBuffer: !0
|
|
56
|
+
});
|
|
57
|
+
i.outputColorSpace = Q, i.setClearColor(0, 0);
|
|
58
|
+
const f = new K(), m = new ee(34, 1, 0.01, 1e3);
|
|
59
|
+
m.up.set(0, 0, 1);
|
|
60
|
+
const c = new le(m, o);
|
|
61
|
+
c.enableDamping = !1, c.enablePan = !1, c.minDistance = 0.5, c.maxDistance = 500;
|
|
62
|
+
const y = new V();
|
|
63
|
+
y.name = "studio-bounds-preview:content", f.add(y);
|
|
64
|
+
let p = k(e.dimensions), x = e.localUpDirection ?? [0, 0, 1], B = e.showGrid ?? !0, C = e.showMeasurements ?? !0, $ = e.showAxes ?? !0, g = !1, D = new G(new v(-0.5, -0.5, 0), new v(0.5, 0.5, 1)), S = null, P = [], M = null;
|
|
65
|
+
const F = () => {
|
|
66
|
+
g || (i.render(f, m), q());
|
|
67
|
+
}, L = () => {
|
|
68
|
+
g || requestAnimationFrame(F);
|
|
69
|
+
}, R = () => {
|
|
70
|
+
if (g) return !1;
|
|
71
|
+
const l = e.container.clientWidth, h = e.container.clientHeight;
|
|
72
|
+
if (l <= 0 || h <= 0) return !1;
|
|
73
|
+
const a = Math.min(globalThis.devicePixelRatio || 1, 2);
|
|
74
|
+
return i.setPixelRatio(a), i.setSize(l, h, !1), m.aspect = l / h, m.updateProjectionMatrix(), F(), !0;
|
|
75
|
+
}, T = () => {
|
|
76
|
+
if (g) return !1;
|
|
77
|
+
const l = D.getSize(new v()), h = D.getCenter(new v()), a = Math.max(l.x, l.y, l.z, 0.25), b = a * 3.15, A = new v(1.15, -1.65, 1.05).normalize();
|
|
78
|
+
return m.position.copy(h).addScaledVector(A, b), m.near = Math.max(b / 200, 5e-3), m.far = Math.max(b * 20, 50), m.updateProjectionMatrix(), c.target.copy(h), c.minDistance = Math.max(a * 1.2, 0.2), c.maxDistance = Math.max(a * 8, 10), c.update(), F(), !0;
|
|
79
|
+
}, W = (l) => {
|
|
80
|
+
if (g) return;
|
|
81
|
+
p = k(l.dimensions), x = fe(l.localUpDirection ?? [0, 0, 1]);
|
|
82
|
+
const h = xe(x);
|
|
83
|
+
u.textContent = h, d.dataset.studioBoundsUp = h, X(S), N(M), M = null, S = we(p, x), D = S.bounds, y.add(S.root), B && (M = be(D), f.add(M));
|
|
84
|
+
for (const a of P) a.label.remove();
|
|
85
|
+
P = ye(p, S, C, r, n), I(), R(), T();
|
|
86
|
+
}, I = () => {
|
|
87
|
+
r.style.display = C ? "block" : "none", d.style.display = $ ? "block" : "none", M && (M.visible = B);
|
|
88
|
+
for (const l of P) l.label.hidden = !C;
|
|
89
|
+
}, q = () => {
|
|
90
|
+
if (g) return;
|
|
91
|
+
const l = e.container.clientWidth, h = e.container.clientHeight;
|
|
92
|
+
if (!(l <= 0 || h <= 0))
|
|
93
|
+
for (const a of P) {
|
|
94
|
+
const b = U(a.start, m, l, h), A = U(a.end, m, l, h);
|
|
95
|
+
if (!b.visible || !A.visible) {
|
|
96
|
+
a.line.style.display = "none", a.label.hidden = !0;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
a.line.style.display = "", a.line.setAttribute("x1", b.x.toFixed(2)), a.line.setAttribute("y1", b.y.toFixed(2)), a.line.setAttribute("x2", A.x.toFixed(2)), a.line.setAttribute("y2", A.y.toFixed(2)), a.label.hidden = !C;
|
|
100
|
+
const _ = a.axis === "Z" ? 34 : a.axis === "Y" ? -24 : 0, H = a.axis === "Z" ? 0 : 16;
|
|
101
|
+
a.label.style.left = `${(b.x + A.x) / 2 + _}px`, a.label.style.top = `${(b.y + A.y) / 2 + H}px`;
|
|
102
|
+
}
|
|
103
|
+
}, E = typeof ResizeObserver == "function" ? new ResizeObserver(() => {
|
|
104
|
+
R() && T();
|
|
105
|
+
}) : null;
|
|
106
|
+
E == null || E.observe(e.container), c.addEventListener("change", L);
|
|
107
|
+
const w = e.signal;
|
|
108
|
+
let j = null;
|
|
109
|
+
W({ dimensions: p, localUpDirection: x }), L();
|
|
110
|
+
const Y = {
|
|
111
|
+
update: W,
|
|
112
|
+
fit: T,
|
|
113
|
+
resize: R,
|
|
114
|
+
render: F,
|
|
115
|
+
dispose() {
|
|
116
|
+
if (!g) {
|
|
117
|
+
g = !0, j && (w == null || w.removeEventListener("abort", j)), E == null || E.disconnect(), c.removeEventListener("change", L), c.dispose(), X(S), N(M);
|
|
118
|
+
for (const l of P) l.label.remove();
|
|
119
|
+
i.dispose(), t.remove();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return j = () => Y.dispose(), w != null && w.aborted ? j() : w == null || w.addEventListener("abort", j, { once: !0 }), Y;
|
|
124
|
+
}
|
|
125
|
+
function k(e) {
|
|
126
|
+
if ([e.length, e.width, e.height].some((t) => !Number.isFinite(t) || t <= 0))
|
|
127
|
+
throw new Error("Bounds preview dimensions must be positive finite values.");
|
|
128
|
+
return { length: e.length, width: e.width, height: e.height };
|
|
129
|
+
}
|
|
130
|
+
function fe(e) {
|
|
131
|
+
const n = new v().fromArray(e);
|
|
132
|
+
if (!e.every(Number.isFinite) || n.lengthSq() <= 1e-16)
|
|
133
|
+
throw new Error("Bounds preview local up direction must be a finite non-zero vector.");
|
|
134
|
+
return n.normalize(), [n.x, n.y, n.z];
|
|
135
|
+
}
|
|
136
|
+
function xe(e) {
|
|
137
|
+
const n = ["X", "Y", "Z"];
|
|
138
|
+
let t = 0;
|
|
139
|
+
for (let s = 1; s < e.length; s += 1)
|
|
140
|
+
Math.abs(e[s]) > Math.abs(e[t]) && (t = s);
|
|
141
|
+
const o = e[t];
|
|
142
|
+
return Math.abs(o) < 1 - 1e-9 ? "UP" : `${o < 0 ? "-" : "+"}${n[t]}`;
|
|
143
|
+
}
|
|
144
|
+
function we(e, n) {
|
|
145
|
+
const t = new V();
|
|
146
|
+
t.rotation.setFromQuaternion(new te().fromArray(de(n)));
|
|
147
|
+
const o = new ne(e.length, e.width, e.height), s = new oe({
|
|
148
|
+
color: new O("#102c2d"),
|
|
149
|
+
transparent: !0,
|
|
150
|
+
opacity: 0.045,
|
|
151
|
+
depthWrite: !1
|
|
152
|
+
}), r = new re(o, s);
|
|
153
|
+
r.name = "studio-bounds-preview:mesh";
|
|
154
|
+
const d = new se(
|
|
155
|
+
new ae(o),
|
|
156
|
+
new ie({
|
|
157
|
+
color: new O("#08ddd6"),
|
|
158
|
+
transparent: !0,
|
|
159
|
+
opacity: 0.95,
|
|
160
|
+
depthWrite: !1
|
|
161
|
+
})
|
|
162
|
+
);
|
|
163
|
+
d.name = "studio-bounds-preview:edges", t.add(r, d), t.updateMatrixWorld(!0);
|
|
164
|
+
const u = new G().setFromObject(t);
|
|
165
|
+
t.position.z = -u.min.z, t.updateMatrixWorld(!0);
|
|
166
|
+
const z = new G().setFromObject(t);
|
|
167
|
+
return {
|
|
168
|
+
root: t,
|
|
169
|
+
bounds: z,
|
|
170
|
+
rotation: t.quaternion.clone(),
|
|
171
|
+
translation: t.position.clone()
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function be(e) {
|
|
175
|
+
const n = e.getSize(new v()), t = Math.max(n.x, n.y, n.z, 1), o = Math.max(4, Math.ceil(t * 4)), s = Math.min(60, Math.max(12, Math.round(o * 5))), r = new ce(o, s, 6713457, 3423036);
|
|
176
|
+
r.name = "studio-bounds-preview:grid", r.rotation.x = Math.PI / 2, r.position.z = -1e-3;
|
|
177
|
+
const d = Array.isArray(r.material) ? r.material : [r.material];
|
|
178
|
+
for (const u of d)
|
|
179
|
+
u.transparent = !0, u.opacity = 0.48, u.depthWrite = !1;
|
|
180
|
+
return r;
|
|
181
|
+
}
|
|
182
|
+
function ye(e, n, t, o, s) {
|
|
183
|
+
o.replaceChildren();
|
|
184
|
+
const r = e.length / 2, d = e.width / 2, u = e.height / 2, i = Math.max(e.length, e.width, e.height) * 0.12, f = (c, y, p) => new v(c, y, p).applyQuaternion(n.rotation).add(n.translation);
|
|
185
|
+
return [
|
|
186
|
+
{
|
|
187
|
+
axis: "X",
|
|
188
|
+
value: e.length,
|
|
189
|
+
start: f(-r, -d - i, -u - i),
|
|
190
|
+
end: f(r, -d - i, -u - i)
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
axis: "Y",
|
|
194
|
+
value: e.width,
|
|
195
|
+
start: f(-r - i, -d, -u - i),
|
|
196
|
+
end: f(-r - i, d, -u - i)
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
axis: "Z",
|
|
200
|
+
value: e.height,
|
|
201
|
+
start: f(r + i, -d - i, -u),
|
|
202
|
+
end: f(r + i, -d - i, u)
|
|
203
|
+
}
|
|
204
|
+
].map((c) => {
|
|
205
|
+
var B;
|
|
206
|
+
const y = ue[c.axis], p = s.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
207
|
+
p.setAttribute("stroke", "#6d7778"), p.setAttribute("stroke-width", "0.8"), p.setAttribute("stroke-dasharray", "4 5"), p.setAttribute("opacity", t ? "0.9" : "0"), o.append(p);
|
|
208
|
+
const x = s.createElement("span");
|
|
209
|
+
return x.textContent = `${c.axis} ${c.value.toFixed(3)} m`, x.hidden = !t, x.style.cssText = [
|
|
210
|
+
"position:absolute",
|
|
211
|
+
"transform:translate(-50%,-50%)",
|
|
212
|
+
"color:" + y,
|
|
213
|
+
'font:12px/1.2 "JetBrains Mono",monospace',
|
|
214
|
+
"white-space:nowrap",
|
|
215
|
+
"text-shadow:0 1px 3px #000,0 0 6px rgba(0,0,0,.9)"
|
|
216
|
+
].join(";"), (B = o.parentElement) == null || B.append(x), { ...c, color: y, line: p, label: x };
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function U(e, n, t, o) {
|
|
220
|
+
const s = e.clone().project(n);
|
|
221
|
+
return {
|
|
222
|
+
x: (s.x * 0.5 + 0.5) * t,
|
|
223
|
+
y: (-s.y * 0.5 + 0.5) * o,
|
|
224
|
+
visible: s.z >= -1 && s.z <= 1
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function X(e) {
|
|
228
|
+
e && (e.root.removeFromParent(), Z(e.root));
|
|
229
|
+
}
|
|
230
|
+
function N(e) {
|
|
231
|
+
e && (e.removeFromParent(), Z(e));
|
|
232
|
+
}
|
|
233
|
+
function Z(e) {
|
|
234
|
+
e.traverse((n) => {
|
|
235
|
+
if ("geometry" in n && n.geometry instanceof Object && n.geometry.dispose(), "material" in n) {
|
|
236
|
+
const t = n.material, o = Array.isArray(t) ? t : t ? [t] : [];
|
|
237
|
+
for (const s of o) s.dispose();
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
export {
|
|
242
|
+
Ae as createStudioBoundsPreview,
|
|
243
|
+
ze as createStudioSceneSession
|
|
244
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SceneDocument } from '../doc/schema';
|
|
2
|
+
import type { DeliveryProfileV1 } from '../delivery/contracts';
|
|
3
|
+
import type { AssetCatalogV3, DeliveryDiagnosticV1 } from '../project/contracts';
|
|
4
|
+
import type { StudioAssetSourceProvider } from '../ports/asset-source';
|
|
5
|
+
import type { StudioDeliveryProvider } from '../ports/delivery';
|
|
6
|
+
export interface ResolveUsdDeliveryCatalogInput {
|
|
7
|
+
readonly document: SceneDocument;
|
|
8
|
+
readonly catalog: AssetCatalogV3;
|
|
9
|
+
readonly profile: DeliveryProfileV1;
|
|
10
|
+
readonly sourceProvider?: StudioAssetSourceProvider;
|
|
11
|
+
readonly deliveryProvider?: StudioDeliveryProvider;
|
|
12
|
+
readonly signal?: AbortSignal;
|
|
13
|
+
}
|
|
14
|
+
export type StudioDeliveryCatalogResolution = {
|
|
15
|
+
readonly status: 'resolved';
|
|
16
|
+
readonly catalog: AssetCatalogV3;
|
|
17
|
+
readonly diagnostics: readonly [];
|
|
18
|
+
} | {
|
|
19
|
+
readonly status: 'blocked';
|
|
20
|
+
readonly catalog: AssetCatalogV3;
|
|
21
|
+
readonly diagnostics: readonly DeliveryDiagnosticV1[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Resolves only visual entries referenced by the document. The decision order
|
|
25
|
+
* is intentional and exclusive: exact lock, unique profile artifact, provider,
|
|
26
|
+
* blocked. A lock never falls back to another artifact or the provider.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveUsdDeliveryCatalog(input: ResolveUsdDeliveryCatalogInput): Promise<StudioDeliveryCatalogResolution>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StudioAssetRegistrationInput, StudioAssetSource, StudioAssetSourceProvider, StudioAssetSourceRegisterOptions, StudioAssetSourceRegistration, StudioAssetSourceResolveOptions, StudioResolvableRevision } from '../ports/asset-source';
|
|
2
|
+
import type { StudioSourceBundle } from '../util/studio-source';
|
|
3
|
+
/** Ephemeral browser composition provider used by reference and test hosts. */
|
|
4
|
+
export declare class InMemoryStudioAssetSourceProvider implements StudioAssetSourceProvider {
|
|
5
|
+
private readonly sources;
|
|
6
|
+
private readonly fingerprints;
|
|
7
|
+
private readonly registrationTails;
|
|
8
|
+
resolve(revision: StudioResolvableRevision, _options?: StudioAssetSourceResolveOptions): StudioAssetSource | null;
|
|
9
|
+
register(input: StudioAssetRegistrationInput, options?: StudioAssetSourceRegisterOptions): Promise<StudioAssetSourceRegistration>;
|
|
10
|
+
materialize(revision: StudioResolvableRevision, source: StudioAssetSource, options?: StudioAssetSourceResolveOptions): StudioSourceBundle | null;
|
|
11
|
+
release(revisionId: string): void;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
snapshot(): readonly StudioAssetSource[];
|
|
14
|
+
private enqueueRegistration;
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { StudioHost, StudioTransactionError } from '../core/host';
|
|
2
|
+
export type { StudioEffectiveNodeState, StudioNodeCapabilities, StudioSceneTreeNode, StudioSceneTreeSnapshot, } from '../core/scene-tree';
|
|
3
|
+
export { StudioPersistenceController } from '../core/persistence-controller';
|
|
4
|
+
export type { StudioPersistenceCapture, StudioPersistenceControllerOptions, StudioPersistenceSaveResult, } from '../core/persistence-controller';
|
|
5
|
+
export type { LoadedStudioAsset, StudioAssetLoadResult, StudioBoundingBoxDimensions, StudioBoundingBoxInput, StudioActionRunOptions, StudioCommandResult, StudioHostEvent, StudioHostOptions, StudioHostSnapshot, StudioOpenResult, StudioReadOnlyHost, StudioStateSnapshot, StudioSelection, StudioReplaceModelExpected, StudioReplaceModelInput, StudioReplaceModelReplacement, StudioTransactionKind, StudioTransactionPreview, StudioTransactionRequest, StudioTransactionTargetPolicy, StudioWriteDecision, StudioWritePolicy, StudioWriteRequest, } from '../core/host';
|
|
6
|
+
export type { StudioAssetCommitOptions, StudioAssetCommitReceipt, StudioAssetCommitResult, StudioAssetCommitScope, StudioAssetPlacementIntent, StudioAssetPrepareOptions, StudioAssetTaskSnapshot, StudioAssetTaskStatus, StudioPreparedAssetBatch, StudioPreparedAssetItem, StudioPreparedAssetStatus, } from '../core/asset-task';
|
|
7
|
+
export { createStudioContext } from '../core/context';
|
|
8
|
+
export type { StudioContext, StudioContextCapabilities, } from '../core/context';
|
|
9
|
+
export { IndexedDbStudioPersistence } from './indexeddb-persistence';
|
|
10
|
+
export { IndexedDbStudioAssetSourceProvider } from './indexeddb-asset-source';
|
|
11
|
+
export { InMemoryStudioAssetSourceProvider } from './in-memory-asset-source';
|
|
12
|
+
export { resolveUsdDeliveryCatalog, } from './delivery-catalog';
|
|
13
|
+
export type { ResolveUsdDeliveryCatalogInput, StudioDeliveryCatalogResolution, } from './delivery-catalog';
|
|
14
|
+
export { exportUsd, UsdExportError } from './usd-export-client';
|
|
15
|
+
export type { UsdExportClientOptions } from './usd-export-client';
|
|
16
|
+
export { normalizeStudioSourceBundleForExport } from './source-package';
|
|
17
|
+
export type { UsdExporterBeginOptions, UsdExporterBeginResult, UsdExporterOutputInfo, UsdExporterRuntimeOptions, UsdExporterSerializedError, UsdExporterValidationResult, UsdExporterWorkerRequest, UsdExporterWorkerResponse, } from './usd-export-protocol';
|
|
18
|
+
export { WebAssetIngestor, studioAssetFileFromWebFile } from './web-asset-ingestor';
|
|
19
|
+
export { StudioRemoteAssetImporter } from './remote-asset-importer';
|
|
20
|
+
export type { PrepareRemoteAssetInput, RemoteUsdProbeRequest, RemoteUsdProbeResult, RemoteUsdVariantSet, StudioRemoteAssetImporterOptions, } from './remote-asset-importer';
|
|
21
|
+
export { createWebStudioHost } from './web-host';
|
|
22
|
+
export type { WebStudioHostOptions } from './web-host';
|
|
23
|
+
export { createContentAddressedResources, sourceBundlesFromContentStore, verifyContentAddressedResources, } from '../persist/content-addressed';
|
|
24
|
+
export type { ContentAddressedResource } from '../persist/content-addressed';
|
|
25
|
+
export { IndexedDbStudioStore } from '../persist/indexeddb-store';
|
|
26
|
+
export type { IndexedDbStudioStoreOptions, } from '../persist/indexeddb-store';
|
|
27
|
+
export { STUDIO_PLUGIN_API_VERSION, StudioPluginHost } from '../core/plugins';
|
|
28
|
+
export type { StudioActivationEvent, StudioActionContribution, StudioActionContext, StudioActionHost, StudioCheckerContribution, StudioContributionContext, StudioDisposer, StudioExporterContribution, StudioInspectorContribution, StudioInspectorInvocationContext, StudioPlugin, StudioPluginContributions, StudioPluginContext, StudioPluginDependency, StudioPluginManifest, } from '../core/plugins';
|
|
29
|
+
export { isPluginApiVersionCompatible, satisfiesVersion } from '../core/versions';
|
|
30
|
+
export { evaluateWhen } from '../core/when';
|
|
31
|
+
export type { StudioContextFacts, StudioWhen } from '../core/when';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StudioAssetRegistrationInput, StudioAssetRequest, StudioAssetSource, StudioAssetSourceProvider, StudioAssetSourceRegistration, StudioAssetSourceResolveOptions, StudioResolvableRevision } from '../ports/asset-source';
|
|
2
|
+
import { IndexedDbStudioStore } from '../persist/indexeddb-store';
|
|
3
|
+
import type { StudioSourceBundle } from '../util/studio-source';
|
|
4
|
+
export interface IndexedDbStudioAssetSourceProviderOptions {
|
|
5
|
+
readonly store?: IndexedDbStudioStore;
|
|
6
|
+
/** Reattached after page reload; request functions are never persisted. */
|
|
7
|
+
readonly request?: StudioAssetRequest;
|
|
8
|
+
readonly materializeRemote?: (revision: StudioResolvableRevision, source: StudioAssetSource, options: StudioAssetSourceResolveOptions) => Promise<StudioSourceBundle | null>;
|
|
9
|
+
}
|
|
10
|
+
/** Browser-local implementation of the Studio asset source boundary. */
|
|
11
|
+
export declare class IndexedDbStudioAssetSourceProvider implements StudioAssetSourceProvider {
|
|
12
|
+
private readonly options;
|
|
13
|
+
private readonly store;
|
|
14
|
+
private readonly sources;
|
|
15
|
+
private readonly fingerprints;
|
|
16
|
+
private readonly registrationTails;
|
|
17
|
+
private readonly pending;
|
|
18
|
+
private readonly failures;
|
|
19
|
+
constructor(options?: IndexedDbStudioAssetSourceProviderOptions);
|
|
20
|
+
resolve(revision: StudioResolvableRevision, _options?: StudioAssetSourceResolveOptions): StudioAssetSource | null | Promise<StudioAssetSource | null>;
|
|
21
|
+
register(input: StudioAssetRegistrationInput, options?: {
|
|
22
|
+
readonly signal?: AbortSignal;
|
|
23
|
+
readonly operationId?: string;
|
|
24
|
+
}): Promise<StudioAssetSourceRegistration>;
|
|
25
|
+
materialize(revision: StudioResolvableRevision, source: StudioAssetSource, options?: StudioAssetSourceResolveOptions): Promise<StudioSourceBundle | null>;
|
|
26
|
+
flush(): Promise<void>;
|
|
27
|
+
acknowledge(revisionId: string, operationId?: string): void;
|
|
28
|
+
release(revisionId: string): Promise<void>;
|
|
29
|
+
clearErrors(): void;
|
|
30
|
+
private loadSource;
|
|
31
|
+
private enqueueRegistration;
|
|
32
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IndexedDbStudioStore } from '../persist/indexeddb-store';
|
|
2
|
+
import type { StudioPersistenceAdapter } from '../ports/persistence';
|
|
3
|
+
import type { StudioStateSnapshot } from '../persist/snapshot';
|
|
4
|
+
import { IndexedDbStudioAssetSourceProvider } from './indexeddb-asset-source';
|
|
5
|
+
/** Browser-local state adapter paired with a browser-local source provider. */
|
|
6
|
+
export declare class IndexedDbStudioPersistence implements StudioPersistenceAdapter {
|
|
7
|
+
private readonly store;
|
|
8
|
+
readonly assetSourceProvider: IndexedDbStudioAssetSourceProvider;
|
|
9
|
+
constructor(store?: IndexedDbStudioStore);
|
|
10
|
+
load(): Promise<StudioStateSnapshot | null>;
|
|
11
|
+
save(snapshot: StudioStateSnapshot): Promise<void>;
|
|
12
|
+
close(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { StudioExternalAssetRef } from '../doc/schema';
|
|
2
|
+
import type { AssetAnnotations } from '../asset/intake';
|
|
3
|
+
import type { StudioPreparedAsset, StudioRemoteAssetSourceInput } from '../ports/asset-source';
|
|
4
|
+
export interface RemoteUsdVariantSet {
|
|
5
|
+
readonly primPath: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly options: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
export interface RemoteUsdProbeRequest {
|
|
10
|
+
readonly entry: Blob;
|
|
11
|
+
readonly entryPath: string;
|
|
12
|
+
readonly entryUrl: string;
|
|
13
|
+
readonly signal?: AbortSignal;
|
|
14
|
+
readonly variantSelections?: readonly {
|
|
15
|
+
readonly primPath: string;
|
|
16
|
+
readonly setName: string;
|
|
17
|
+
readonly selection: string;
|
|
18
|
+
}[];
|
|
19
|
+
readonly resolveResource: (identifier: string, url: string) => Promise<Blob>;
|
|
20
|
+
readonly onProgress?: (completed: number, identifier: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface RemoteUsdProbeResult {
|
|
23
|
+
readonly variantSets: readonly RemoteUsdVariantSet[];
|
|
24
|
+
readonly capability: {
|
|
25
|
+
readonly hasPhysics: boolean;
|
|
26
|
+
readonly hasArticulation: boolean;
|
|
27
|
+
readonly hasColliderGeometry: boolean;
|
|
28
|
+
readonly hasRigidBody: boolean;
|
|
29
|
+
readonly source: 'usd-authored' | 'none' | 'unknown';
|
|
30
|
+
};
|
|
31
|
+
readonly measured: {
|
|
32
|
+
readonly bounds?: {
|
|
33
|
+
readonly min: readonly [number, number, number];
|
|
34
|
+
readonly max: readonly [number, number, number];
|
|
35
|
+
};
|
|
36
|
+
readonly jointCount?: number;
|
|
37
|
+
readonly meshCount?: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface StudioRemoteAssetImporterOptions {
|
|
41
|
+
readonly probe: (request: RemoteUsdProbeRequest) => Promise<RemoteUsdProbeResult>;
|
|
42
|
+
readonly now?: () => string;
|
|
43
|
+
}
|
|
44
|
+
export interface PrepareRemoteAssetInput {
|
|
45
|
+
readonly source: StudioRemoteAssetSourceInput;
|
|
46
|
+
readonly assetId: string;
|
|
47
|
+
readonly externalRef?: StudioExternalAssetRef;
|
|
48
|
+
readonly annotations?: Omit<AssetAnnotations, 'externalRef' | 'slug'>;
|
|
49
|
+
readonly signal?: AbortSignal;
|
|
50
|
+
readonly onProgress?: (completed: number, identifier: string) => void;
|
|
51
|
+
}
|
|
52
|
+
export declare class StudioRemoteAssetImporter {
|
|
53
|
+
private readonly options;
|
|
54
|
+
constructor(options: StudioRemoteAssetImporterOptions);
|
|
55
|
+
prepareRemoteAsset(input: PrepareRemoteAssetInput): Promise<StudioPreparedAsset>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StudioSourceBundle } from '../util/studio-source';
|
|
2
|
+
/**
|
|
3
|
+
* Delivery plans reference their source entry directly. Expand an entry USDZ
|
|
4
|
+
* into the package-relative layer and texture set so relative shader assets
|
|
5
|
+
* remain resolvable after the delivery is packed into another USDZ.
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalizeStudioSourceBundleForExport(bundle: StudioSourceBundle, options?: {
|
|
8
|
+
readonly signal?: AbortSignal;
|
|
9
|
+
}): Promise<StudioSourceBundle>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UsdExportRequest, UsdExportResult } from '../delivery/contracts';
|
|
2
|
+
import { type UsdExporterRuntimeOptions } from './usd-export-protocol';
|
|
3
|
+
export interface UsdExportClientOptions {
|
|
4
|
+
readonly runtime: UsdExporterRuntimeOptions;
|
|
5
|
+
readonly createWorker?: () => Worker;
|
|
6
|
+
}
|
|
7
|
+
export declare class UsdExportError extends Error {
|
|
8
|
+
readonly code: string;
|
|
9
|
+
readonly stage: string;
|
|
10
|
+
readonly detail?: Readonly<Record<string, unknown>> | undefined;
|
|
11
|
+
constructor(message: string, code: string, stage: string, detail?: Readonly<Record<string, unknown>> | undefined);
|
|
12
|
+
}
|
|
13
|
+
export declare function exportUsd(request: UsdExportRequest, clientOptions: UsdExportClientOptions): Promise<UsdExportResult>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { UsdDeliveryPlanV4, UsdExportEvidenceV3, UsdExportLimits, UsdExportResourceFactV1, UsdLayerEncoding } from '../delivery/contracts';
|
|
2
|
+
export interface UsdExporterRuntimeOptions {
|
|
3
|
+
readonly moduleUrl: string;
|
|
4
|
+
readonly wasmUrl: string;
|
|
5
|
+
readonly runtimeId: string;
|
|
6
|
+
readonly apiVersion: number;
|
|
7
|
+
}
|
|
8
|
+
export interface UsdExporterBeginOptions {
|
|
9
|
+
readonly layerEncoding: UsdLayerEncoding;
|
|
10
|
+
readonly packageKind: 'layer-bundle' | 'usdz';
|
|
11
|
+
readonly rootLayerPath: string;
|
|
12
|
+
readonly packageOutputPath: string;
|
|
13
|
+
readonly limits?: UsdExportLimits;
|
|
14
|
+
}
|
|
15
|
+
export type UsdExporterWorkerRequest = {
|
|
16
|
+
readonly type: 'init';
|
|
17
|
+
readonly runtime: UsdExporterRuntimeOptions;
|
|
18
|
+
} | {
|
|
19
|
+
readonly type: 'begin';
|
|
20
|
+
readonly id: number;
|
|
21
|
+
readonly plan: UsdDeliveryPlanV4;
|
|
22
|
+
readonly options: UsdExporterBeginOptions;
|
|
23
|
+
} | {
|
|
24
|
+
readonly type: 'write-resource';
|
|
25
|
+
readonly id: number;
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly bytes: ArrayBuffer;
|
|
28
|
+
} | {
|
|
29
|
+
readonly type: 'build-stage';
|
|
30
|
+
readonly id: number;
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: 'write-output';
|
|
33
|
+
readonly id: number;
|
|
34
|
+
readonly encoding: UsdLayerEncoding;
|
|
35
|
+
readonly path: string;
|
|
36
|
+
} | {
|
|
37
|
+
readonly type: 'package-usdz';
|
|
38
|
+
readonly id: number;
|
|
39
|
+
readonly entryPath: string;
|
|
40
|
+
readonly outputPath: string;
|
|
41
|
+
} | {
|
|
42
|
+
readonly type: 'validate';
|
|
43
|
+
readonly id: number;
|
|
44
|
+
readonly expectation: Readonly<Record<string, unknown>>;
|
|
45
|
+
} | {
|
|
46
|
+
readonly type: 'read-output';
|
|
47
|
+
readonly id: number;
|
|
48
|
+
readonly path: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly type: 'release';
|
|
51
|
+
readonly id: number;
|
|
52
|
+
};
|
|
53
|
+
export interface UsdExporterSerializedError {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly message: string;
|
|
56
|
+
readonly code?: string;
|
|
57
|
+
readonly stage?: string;
|
|
58
|
+
readonly detail?: Readonly<Record<string, unknown>>;
|
|
59
|
+
}
|
|
60
|
+
export type UsdExporterWorkerResponse = {
|
|
61
|
+
readonly type: 'ready';
|
|
62
|
+
readonly apiVersion: number;
|
|
63
|
+
readonly runtimeId: string;
|
|
64
|
+
} | {
|
|
65
|
+
readonly type: 'result';
|
|
66
|
+
readonly id: number;
|
|
67
|
+
readonly value: unknown;
|
|
68
|
+
} | {
|
|
69
|
+
readonly type: 'output';
|
|
70
|
+
readonly id: number;
|
|
71
|
+
readonly path: string;
|
|
72
|
+
readonly bytes: ArrayBuffer;
|
|
73
|
+
} | {
|
|
74
|
+
readonly type: 'error';
|
|
75
|
+
readonly id?: number;
|
|
76
|
+
readonly error: UsdExporterSerializedError;
|
|
77
|
+
};
|
|
78
|
+
export interface UsdExporterBeginResult {
|
|
79
|
+
readonly handle: number;
|
|
80
|
+
readonly planDigest: string;
|
|
81
|
+
}
|
|
82
|
+
export interface UsdExporterOutputInfo {
|
|
83
|
+
readonly path: string;
|
|
84
|
+
readonly byteSize: number;
|
|
85
|
+
}
|
|
86
|
+
export interface UsdExporterResourceFactV1 extends Omit<UsdExportResourceFactV1, 'outputSha256'> {
|
|
87
|
+
}
|
|
88
|
+
type UsdExporterEvidenceV3 = Omit<UsdExportEvidenceV3, 'format' | 'schemaVersion' | 'packageDigest' | 'evidenceDigest' | 'resourceClosure'> & {
|
|
89
|
+
readonly resourceClosure: Omit<UsdExportEvidenceV3['resourceClosure'], 'resourceManifest'> & {
|
|
90
|
+
readonly resourceManifest: readonly UsdExporterResourceFactV1[];
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export interface UsdExporterValidationResult {
|
|
94
|
+
readonly evidence: UsdExporterEvidenceV3;
|
|
95
|
+
}
|
|
96
|
+
export declare function serializeUsdExportError(error: unknown): UsdExporterSerializedError;
|
|
97
|
+
export declare function deserializeUsdExportError(error: UsdExporterSerializedError): Error;
|
|
98
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ParsedStoredZipEntry {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly byteSize: number;
|
|
4
|
+
readonly dataOffset: number;
|
|
5
|
+
readonly localHeaderOffset: number;
|
|
6
|
+
readonly flags: number;
|
|
7
|
+
readonly utf8Flag: boolean;
|
|
8
|
+
readonly crc32: number;
|
|
9
|
+
readonly data: Uint8Array;
|
|
10
|
+
}
|
|
11
|
+
export interface ParsedStoredZip {
|
|
12
|
+
readonly entries: readonly ParsedStoredZipEntry[];
|
|
13
|
+
}
|
|
14
|
+
export declare function parseStoredZip(input: ArrayBuffer | Uint8Array): ParsedStoredZip;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StudioAssetFile, StudioAssetIngestor, StudioAssetInput, StudioAssetIntakeResult, StudioAssetIngestOptions } from '../ports/asset-ingestor';
|
|
2
|
+
/** Web adapter for package and file intake. */
|
|
3
|
+
export declare class WebAssetIngestor implements StudioAssetIngestor {
|
|
4
|
+
private readonly options;
|
|
5
|
+
constructor(options?: {
|
|
6
|
+
readonly now?: () => string;
|
|
7
|
+
});
|
|
8
|
+
ingest(input: StudioAssetInput, options?: StudioAssetIngestOptions): Promise<StudioAssetIntakeResult>;
|
|
9
|
+
}
|
|
10
|
+
export declare function studioAssetFileFromWebFile(file: File): StudioAssetFile;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StudioHostOptions } from '../core/host';
|
|
2
|
+
import { StudioHost } from '../core/host';
|
|
3
|
+
import type { StudioAssetIngestor } from '../ports/asset-ingestor';
|
|
4
|
+
export interface WebStudioHostOptions extends Omit<StudioHostOptions, 'assetIngestor'> {
|
|
5
|
+
readonly assetIngestor?: StudioAssetIngestor;
|
|
6
|
+
}
|
|
7
|
+
/** Default web composition for the runtime-independent StudioHost. */
|
|
8
|
+
export declare function createWebStudioHost(options?: WebStudioHostOptions): StudioHost;
|