@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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural validation for the canonical SceneDocument.
|
|
3
|
+
*
|
|
4
|
+
* Validation returns diagnostics rather than mutating or migrating input.
|
|
5
|
+
* Canonical codec loading migrates supported older versions first; validation
|
|
6
|
+
* itself accepts only the current schema and never partially interprets an
|
|
7
|
+
* older shape.
|
|
8
|
+
*/
|
|
9
|
+
import type { Diagnostic } from '../util/diagnostics';
|
|
10
|
+
import { type ObjectSemantic, type PhysicsJointOverride, type PhysicsMaterialOverride, type Quat, type SceneAssetNode, type SceneDocument, type SceneNode, type SceneVisualNode, type SemanticSource, type Vec3, type VisualAssetRevision } from './schema';
|
|
11
|
+
import { type StudioDocumentDomainExtension } from './domain-extensions';
|
|
12
|
+
export interface ValidationResult {
|
|
13
|
+
readonly ok: boolean;
|
|
14
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
15
|
+
}
|
|
16
|
+
export interface ValidateSceneDocOptions {
|
|
17
|
+
readonly domainExtensions?: readonly StudioDocumentDomainExtension[];
|
|
18
|
+
}
|
|
19
|
+
export declare const SCENE_DIAGNOSTIC: {
|
|
20
|
+
readonly unsupportedSchemaVersion: "SIM_SCENE_UNSUPPORTED_SCHEMA_VERSION";
|
|
21
|
+
readonly invalidRoot: "SIM_SCENE_INVALID_ROOT";
|
|
22
|
+
readonly unknownField: "SIM_SCENE_UNKNOWN_FIELD";
|
|
23
|
+
readonly invalidSceneId: "SIM_SCENE_INVALID_SCENE_ID";
|
|
24
|
+
readonly invalidMeta: "SIM_SCENE_INVALID_META";
|
|
25
|
+
readonly invalidCoordinateSystem: "SIM_SCENE_INVALID_COORDINATE_SYSTEM";
|
|
26
|
+
readonly invalidEnvironment: "SIM_SCENE_INVALID_ENVIRONMENT";
|
|
27
|
+
readonly invalidAssets: "SIM_SCENE_INVALID_ASSETS";
|
|
28
|
+
readonly invalidVisualAssets: "SIM_SCENE_INVALID_VISUAL_ASSETS";
|
|
29
|
+
readonly duplicateAssetRevisionId: "SIM_SCENE_DUPLICATE_ASSET_REVISION_ID";
|
|
30
|
+
readonly duplicateAssetResourceId: "SIM_SCENE_DUPLICATE_ASSET_RESOURCE_ID";
|
|
31
|
+
readonly duplicateAssetResourcePath: "SIM_SCENE_DUPLICATE_ASSET_RESOURCE_PATH";
|
|
32
|
+
readonly invalidAssetRevision: "SIM_SCENE_INVALID_ASSET_REVISION";
|
|
33
|
+
readonly invalidVisualAssetRevision: "SIM_SCENE_INVALID_VISUAL_ASSET_REVISION";
|
|
34
|
+
readonly invalidAssetResource: "SIM_SCENE_INVALID_ASSET_RESOURCE";
|
|
35
|
+
readonly invalidAssetHash: "SIM_SCENE_INVALID_ASSET_HASH";
|
|
36
|
+
readonly invalidAssetPath: "SIM_SCENE_INVALID_ASSET_PATH";
|
|
37
|
+
readonly invalidVariantSet: "SIM_SCENE_INVALID_VARIANT_SET";
|
|
38
|
+
readonly invalidSceneTree: "SIM_SCENE_INVALID_SCENE_TREE";
|
|
39
|
+
readonly duplicateNodeId: "SIM_SCENE_DUPLICATE_NODE_ID";
|
|
40
|
+
readonly invalidNodeId: "SIM_SCENE_INVALID_NODE_ID";
|
|
41
|
+
readonly invalidNodeLabel: "SIM_SCENE_INVALID_NODE_LABEL";
|
|
42
|
+
readonly invalidNodeType: "SIM_SCENE_INVALID_NODE_TYPE";
|
|
43
|
+
readonly unknownAssetRevision: "SIM_SCENE_UNKNOWN_ASSET_REVISION";
|
|
44
|
+
readonly unknownVisualAssetRevision: "SIM_SCENE_UNKNOWN_VISUAL_ASSET_REVISION";
|
|
45
|
+
readonly invalidRole: "SIM_SCENE_INVALID_ROLE";
|
|
46
|
+
readonly invalidVariantSelection: "SIM_SCENE_INVALID_VARIANT_SELECTION";
|
|
47
|
+
readonly invalidTransform: "SIM_SCENE_INVALID_TRANSFORM";
|
|
48
|
+
readonly invalidOrigin: "SIM_SCENE_INVALID_ORIGIN";
|
|
49
|
+
readonly nonUnitQuaternion: "SIM_SCENE_NON_UNIT_QUATERNION";
|
|
50
|
+
readonly nonPositiveScale: "SIM_SCENE_NON_POSITIVE_SCALE";
|
|
51
|
+
readonly nonUniformGaussianScale: "SIM_SCENE_NON_UNIFORM_GAUSSIAN_SCALE";
|
|
52
|
+
readonly invalidPhysics: "SIM_SCENE_INVALID_PHYSICS";
|
|
53
|
+
readonly invalidPose: "SIM_SCENE_INVALID_POSE";
|
|
54
|
+
readonly invalidAppearance: "SIM_SCENE_INVALID_APPEARANCE";
|
|
55
|
+
readonly invalidExternalRef: "SIM_SCENE_INVALID_EXTERNAL_REF";
|
|
56
|
+
readonly invalidSemantic: "SIM_SCENE_INVALID_SEMANTIC";
|
|
57
|
+
readonly invalidDomains: "SIM_SCENE_INVALID_DOMAINS";
|
|
58
|
+
readonly invalidDomainNode: "SIM_SCENE_INVALID_DOMAIN_NODE";
|
|
59
|
+
readonly invalidExtensions: "SIM_SCENE_INVALID_EXTENSIONS";
|
|
60
|
+
readonly invalidBounds: "SIM_SCENE_INVALID_BOUNDS";
|
|
61
|
+
};
|
|
62
|
+
export declare function validateSceneDoc(value: unknown, options?: ValidateSceneDocOptions): ValidationResult;
|
|
63
|
+
export declare function assertValidSceneDoc(value: unknown): asserts value is SceneDocument;
|
|
64
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
65
|
+
export declare function isNonEmptyString(value: unknown): value is string;
|
|
66
|
+
export declare function isVec3(value: unknown): value is Vec3;
|
|
67
|
+
export declare function isQuat(value: unknown): value is Quat;
|
|
68
|
+
export type { ObjectSemantic, PhysicsJointOverride, PhysicsMaterialOverride, SceneAssetNode, SceneNode, SceneVisualNode, SemanticSource, VisualAssetRevision, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Converts platform-neutral asset resolutions into Viewer scene entries. */
|
|
2
|
+
import type { UsdVariantSelection } from '@nebula-spatial/viewer';
|
|
3
|
+
import type { StudioAssetSource } from '../ports/asset-source';
|
|
4
|
+
import type { StudioSceneSource } from '../view/scene-session';
|
|
5
|
+
import type { SceneVisualNode, VisualAssetRevision } from '../doc/schema';
|
|
6
|
+
import { StudioRemoteAssetResolver } from '../asset/remote-asset-resolver';
|
|
7
|
+
export interface StudioSceneSourceResolutionOptions {
|
|
8
|
+
readonly signal?: AbortSignal;
|
|
9
|
+
/** Reuse one remote cache across every node that references the revision. */
|
|
10
|
+
readonly remoteResolver?: StudioRemoteAssetResolver;
|
|
11
|
+
/** Canonical remote locators declared by the source revision. */
|
|
12
|
+
readonly resourcePaths?: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function sceneSourceFromResolution(source: StudioAssetSource, selections: readonly UsdVariantSelection[], options?: StudioSceneSourceResolutionOptions): Promise<StudioSceneSource>;
|
|
15
|
+
export declare function visualSceneSourceFromResolution(source: StudioAssetSource, revision: VisualAssetRevision, node: SceneVisualNode, options?: StudioSceneSourceResolutionOptions): Promise<StudioSceneSource>;
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/** UI-independent scene authoring controller. All UI clients share this bridge. */
|
|
2
|
+
import type { StudioCommandResult, StudioHost, StudioSelection } from '../core/host';
|
|
3
|
+
import type { CommandRecord } from '../doc/command';
|
|
4
|
+
import { createAssetNodeFromRevision } from '../doc/builders';
|
|
5
|
+
import type { LocalTransform, NodePivot, PhysicsOverride, SceneDocument, StudioEditorialState, Vec3 } from '../doc/schema';
|
|
6
|
+
import type { StudioAssetPlacementIntent } from '../core/asset-task';
|
|
7
|
+
import type { StudioPlacementPolicy, StudioPlacementSurface } from '../doc/placement-policy';
|
|
8
|
+
import type { StudioPlacementPlan, StudioAssetPlacementPlan } from './types';
|
|
9
|
+
import type { StudioSceneTreeSnapshot } from '../core/scene-tree';
|
|
10
|
+
import type { StudioNodeFeatures } from '../view/node-features';
|
|
11
|
+
import { createStudioSceneSession } from '../view/scene-session';
|
|
12
|
+
import type { StudioAssetLoadStatus, StudioSceneSession, StudioSceneSessionOptions } from '../view/scene-session';
|
|
13
|
+
import type { GizmoMode } from '../view/gizmo';
|
|
14
|
+
import type { StudioSceneRegionOverlay } from '../doc/scene-regions';
|
|
15
|
+
import type { EditorialStateV1 } from '../project/contracts';
|
|
16
|
+
import type { StudioEditorActionDefinition, StudioEditorEvent, StudioEditorSnapshot, StudioExecuteActionRequest, StudioPreviewOptions, StudioPreviewSelection, StudioToolbarAction, StudioToolbarState } from './types';
|
|
17
|
+
export interface StudioEditorOptions {
|
|
18
|
+
readonly host: StudioHost;
|
|
19
|
+
readonly viewport: HTMLElement;
|
|
20
|
+
readonly canvas: HTMLCanvasElement;
|
|
21
|
+
readonly resolveSource?: StudioSceneSessionOptions['resolveSource'];
|
|
22
|
+
readonly resolveVisualSource?: StudioSceneSessionOptions['resolveVisualSource'];
|
|
23
|
+
readonly resolveRegionOverlays?: (document: SceneDocument) => readonly StudioSceneRegionOverlay[];
|
|
24
|
+
/** Observer callbacks run after the controller has applied its default behavior. */
|
|
25
|
+
readonly sessionOptions?: Omit<StudioSceneSessionOptions, 'viewport' | 'canvas' | 'resolveSource' | 'resolveVisualSource'>;
|
|
26
|
+
readonly onError?: (error: unknown) => void;
|
|
27
|
+
/** Dispose the supplied host as well. Defaults to false. */
|
|
28
|
+
readonly ownsHost?: boolean;
|
|
29
|
+
/** Enable the built-in keyboard shortcut bridge (UI hosts may disable it). */
|
|
30
|
+
readonly shortcuts?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Placement of an already registered asset revision, in parent-local metres. */
|
|
33
|
+
export type StudioAddAssetOptions = Omit<StudioAssetPlacementIntent, 'itemId' | 'sourceKey'>;
|
|
34
|
+
/** @internal Allows controller tests to avoid creating WebGL. */
|
|
35
|
+
export interface StudioEditorDependencies {
|
|
36
|
+
readonly createSession?: typeof createStudioSceneSession;
|
|
37
|
+
}
|
|
38
|
+
type Listener = (event: StudioEditorEvent) => void;
|
|
39
|
+
export declare class StudioEditor {
|
|
40
|
+
private readonly options;
|
|
41
|
+
readonly host: StudioHost;
|
|
42
|
+
readonly session: StudioSceneSession;
|
|
43
|
+
readonly ready: Promise<void>;
|
|
44
|
+
private readonly listeners;
|
|
45
|
+
private readonly unsubscribeHost;
|
|
46
|
+
private readonly writePolicy;
|
|
47
|
+
private readonly releaseWritePolicy;
|
|
48
|
+
private readonly actionReader;
|
|
49
|
+
private readonly actionDefinitions;
|
|
50
|
+
private readonly actionControllers;
|
|
51
|
+
private readonly remoteResolvers;
|
|
52
|
+
private readonly coreActionBusy;
|
|
53
|
+
private sceneSessionId;
|
|
54
|
+
private selectionVersion;
|
|
55
|
+
private contextVersion;
|
|
56
|
+
private overlaySequence;
|
|
57
|
+
private mode;
|
|
58
|
+
private snap;
|
|
59
|
+
private readonly transactionBounds;
|
|
60
|
+
private placementPolicy;
|
|
61
|
+
private transformSpace;
|
|
62
|
+
private readonly actionVisibility;
|
|
63
|
+
private readonly transformOrigins;
|
|
64
|
+
private groundVisible;
|
|
65
|
+
private collisionVisible;
|
|
66
|
+
private editingEnabled;
|
|
67
|
+
private previewMode;
|
|
68
|
+
private previewSelection;
|
|
69
|
+
private boxSelectionEnabled;
|
|
70
|
+
private previewDocument;
|
|
71
|
+
private placementPreviewActive;
|
|
72
|
+
private sceneStatus;
|
|
73
|
+
private overlay;
|
|
74
|
+
private disposed;
|
|
75
|
+
private disposal;
|
|
76
|
+
private syncEpoch;
|
|
77
|
+
private readonly releaseShortcuts;
|
|
78
|
+
constructor(options: StudioEditorOptions, dependencies?: StudioEditorDependencies);
|
|
79
|
+
getSnapshot(): StudioEditorSnapshot;
|
|
80
|
+
/**
|
|
81
|
+
* Returns the immutable scene-tree projection used by tree and inspector
|
|
82
|
+
* clients. The projection includes effective editorial state and the
|
|
83
|
+
* current selection, so consumers should refresh it after `host.change` or
|
|
84
|
+
* a selection event instead of retaining individual node objects.
|
|
85
|
+
*/
|
|
86
|
+
getSceneTreeSnapshot(): StudioSceneTreeSnapshot;
|
|
87
|
+
/**
|
|
88
|
+
* Reads the semantic and physical feature availability for a mounted node.
|
|
89
|
+
* This deliberately combines authored facts with the current runtime
|
|
90
|
+
* inspection result; callers can distinguish unavailable data from a
|
|
91
|
+
* feature that is present but whose visualization is not mounted.
|
|
92
|
+
*/
|
|
93
|
+
getNodeFeatures(nodeId: string): StudioNodeFeatures | null;
|
|
94
|
+
getAssetLoadStatus(nodeId: string): StudioAssetLoadStatus | null;
|
|
95
|
+
private remoteResolverFor;
|
|
96
|
+
private remoteResourcePathsFor;
|
|
97
|
+
captureEditorialState(): EditorialStateV1;
|
|
98
|
+
applyEditorialState(state: EditorialStateV1): void;
|
|
99
|
+
subscribe(listener: Listener, options?: {
|
|
100
|
+
readonly emitCurrent?: boolean;
|
|
101
|
+
}): () => void;
|
|
102
|
+
registerAction(definition: StudioEditorActionDefinition): () => void;
|
|
103
|
+
unregisterAction(actionId: string): void;
|
|
104
|
+
cancelAction(actionId: string): void;
|
|
105
|
+
sync(): Promise<void>;
|
|
106
|
+
setPreviewDocument(document: SceneDocument | null): Promise<void>;
|
|
107
|
+
beginPlacementPreview(revisionId: string, transform: LocalTransform): Promise<boolean>;
|
|
108
|
+
updatePlacementPreview(transform: LocalTransform): Promise<boolean>;
|
|
109
|
+
confirmPlacementPreview(request: {
|
|
110
|
+
readonly revisionId: string;
|
|
111
|
+
readonly label: string;
|
|
112
|
+
readonly role: Parameters<typeof createAssetNodeFromRevision>[1]['role'];
|
|
113
|
+
readonly parentNodeId?: string;
|
|
114
|
+
readonly nodeId?: string;
|
|
115
|
+
readonly variantSelections?: Readonly<Record<string, string>>;
|
|
116
|
+
readonly physics?: Parameters<typeof createAssetNodeFromRevision>[1]['physics'];
|
|
117
|
+
}): Promise<StudioCommandResult | null>;
|
|
118
|
+
cancelPlacementPreview(): Promise<void>;
|
|
119
|
+
select(ids: readonly string[], primaryId?: string | null): StudioSelection;
|
|
120
|
+
dispatch(records: CommandRecord | readonly CommandRecord[]): StudioCommandResult;
|
|
121
|
+
private applyCommands;
|
|
122
|
+
captureViewport(options?: import('../view/scene-session').StudioCaptureOptions): Promise<import('../view/scene-session').StudioCaptureResult>;
|
|
123
|
+
getPlacementPolicy(): StudioPlacementPolicy;
|
|
124
|
+
setPlacementPolicy(policy: Partial<StudioPlacementPolicy>): void;
|
|
125
|
+
prepareAssetPlacement(input: {
|
|
126
|
+
readonly revisionId: string;
|
|
127
|
+
readonly point?: Vec3;
|
|
128
|
+
readonly worldTransform?: LocalTransform;
|
|
129
|
+
readonly surface?: StudioPlacementSurface | null;
|
|
130
|
+
readonly parentNodeId?: string;
|
|
131
|
+
readonly allowOverlap?: boolean;
|
|
132
|
+
readonly signal?: AbortSignal;
|
|
133
|
+
}): Promise<StudioAssetPlacementPlan>;
|
|
134
|
+
commitAssetPlacement(plan: StudioAssetPlacementPlan, input: {
|
|
135
|
+
readonly label: string;
|
|
136
|
+
readonly role: import('../doc/schema').InstanceRole;
|
|
137
|
+
readonly nodeId?: string;
|
|
138
|
+
}): StudioCommandResult;
|
|
139
|
+
prepareNodePlacement(input: {
|
|
140
|
+
readonly nodeId: string;
|
|
141
|
+
readonly worldTransform: LocalTransform;
|
|
142
|
+
readonly surface?: StudioPlacementSurface | null;
|
|
143
|
+
readonly allowOverlap?: boolean;
|
|
144
|
+
}): StudioPlacementPlan;
|
|
145
|
+
commitPlacement(plan: StudioPlacementPlan): StudioCommandResult;
|
|
146
|
+
getPhysicsFacts(nodeId: string): import("..").StudioPhysicsFacts | null;
|
|
147
|
+
getNodeFrame(nodeId: string): import("..").StudioNodeFrame | null;
|
|
148
|
+
getNodeOriginAnchors(nodeId: string): import("..").StudioNodeGeometryAnchors | null;
|
|
149
|
+
getSelectionFrame(): import("..").StudioSelectionFrame | null;
|
|
150
|
+
getNodeOrigin(nodeId: string): {
|
|
151
|
+
readonly pivot: NodePivot;
|
|
152
|
+
readonly local: Vec3;
|
|
153
|
+
readonly world: Vec3;
|
|
154
|
+
readonly provenance: "default" | "authored";
|
|
155
|
+
} | null;
|
|
156
|
+
/** Runtime-only transform pivot, kept separate from authored scene data. */
|
|
157
|
+
getTransformOrigin(nodeId: string): Vec3 | null;
|
|
158
|
+
setTransformOrigin(nodeId: string, offset: Vec3 | null): boolean;
|
|
159
|
+
getNodeOrientation(nodeId: string): {
|
|
160
|
+
readonly localUpAxis: Vec3;
|
|
161
|
+
readonly parentUpDirection: Vec3;
|
|
162
|
+
readonly worldUpDirection: Vec3 | null;
|
|
163
|
+
readonly preset: "+X" | "+Y" | "+Z" | null;
|
|
164
|
+
} | null;
|
|
165
|
+
setNodeOrigin(nodeId: string, origin: NodePivot | null): StudioCommandResult;
|
|
166
|
+
setNodeUpDirection(nodeId: string, direction: Vec3): StudioCommandResult;
|
|
167
|
+
getAssetDimensions(nodeId: string): import("..").StudioAssetDimensions | null;
|
|
168
|
+
focusSelection(options?: {
|
|
169
|
+
readonly padding?: number;
|
|
170
|
+
}): boolean;
|
|
171
|
+
setTransformSpace(space: 'local' | 'world'): void;
|
|
172
|
+
setNodeDimensions(nodeId: string, dimensions: Vec3, options?: {
|
|
173
|
+
readonly anchor?: 'node-origin' | 'bounds-center';
|
|
174
|
+
}): StudioCommandResult;
|
|
175
|
+
setNodesVisible(nodeIds: readonly string[], visible: boolean): StudioCommandResult;
|
|
176
|
+
updateEditorialState(nodeIds: readonly string[], patch: Partial<StudioEditorialState>): void;
|
|
177
|
+
hideNodes(nodeIds: readonly string[]): void;
|
|
178
|
+
hideSelection(): void;
|
|
179
|
+
selectFromTree(nodeIds: readonly string[]): StudioSelection;
|
|
180
|
+
/** Explicit selection API for clients that own a viewport picker. */
|
|
181
|
+
selectFromViewport(nodeIds: readonly string[], primaryId?: string | null): StudioSelection;
|
|
182
|
+
/** Set temporary editor visibility without changing authored scene data. */
|
|
183
|
+
setNodesHidden(nodeIds: readonly string[], hidden: boolean): void;
|
|
184
|
+
showNodes(nodeIds: readonly string[]): void;
|
|
185
|
+
/** Set temporary editor lock state without adding a document command. */
|
|
186
|
+
setNodesLocked(nodeIds: readonly string[], locked: boolean): void;
|
|
187
|
+
setNodePhysics(nodeId: string, physics: PhysicsOverride): StudioCommandResult;
|
|
188
|
+
setNodeInitialPose(nodeId: string, joints: Readonly<Record<string, number>> | null): StudioCommandResult;
|
|
189
|
+
setActionVisibility(actionId: string, visible: boolean | null): void;
|
|
190
|
+
private projectActionVisibility;
|
|
191
|
+
changeTransform(id: string, next: LocalTransform, options?: {
|
|
192
|
+
readonly space?: 'local' | 'world';
|
|
193
|
+
readonly scope?: 'node' | 'selection';
|
|
194
|
+
}): StudioCommandResult;
|
|
195
|
+
private commitTransform;
|
|
196
|
+
duplicateSelection(ids?: readonly string[]): StudioCommandResult;
|
|
197
|
+
deleteSelection(ids?: readonly string[]): StudioCommandResult;
|
|
198
|
+
groupSelection(ids?: readonly string[]): StudioCommandResult;
|
|
199
|
+
ungroupSelection(ids?: readonly string[]): StudioCommandResult;
|
|
200
|
+
setSelectionLocked(locked: boolean, ids?: readonly string[]): void;
|
|
201
|
+
setMode(mode: GizmoMode): void;
|
|
202
|
+
setSnap(enabled: boolean): void;
|
|
203
|
+
setGroundVisible(enabled: boolean): void;
|
|
204
|
+
setCollisionVisible(enabled: boolean): void;
|
|
205
|
+
setEditingEnabled(enabled: boolean): void;
|
|
206
|
+
setPreviewMode(enabled: boolean, options?: StudioPreviewOptions): void;
|
|
207
|
+
setPreviewSelection(selection: StudioPreviewSelection): void;
|
|
208
|
+
setBoxSelectionEnabled(enabled: boolean): void;
|
|
209
|
+
fit(): boolean;
|
|
210
|
+
zoomIn(factor?: number): boolean;
|
|
211
|
+
zoomOut(factor?: number): boolean;
|
|
212
|
+
setAxisView(axis: 'x' | 'y' | 'z', sign: 1 | -1): boolean;
|
|
213
|
+
setTheme(theme: 'dark' | 'light'): void;
|
|
214
|
+
cancelActiveGesture(): void;
|
|
215
|
+
playScene(): boolean;
|
|
216
|
+
pauseScene(): boolean;
|
|
217
|
+
stepScene(timestep?: number): boolean;
|
|
218
|
+
resetScene(): boolean;
|
|
219
|
+
stopScene(): boolean;
|
|
220
|
+
getNodeActions(ids: readonly string[]): readonly StudioToolbarAction[];
|
|
221
|
+
getToolbarState(): StudioToolbarState;
|
|
222
|
+
executeAction(request: StudioExecuteActionRequest): Promise<unknown>;
|
|
223
|
+
dispose(): Promise<void>;
|
|
224
|
+
private handleShortcut;
|
|
225
|
+
private runShortcutAction;
|
|
226
|
+
private editableTargets;
|
|
227
|
+
private assertProjectionRepresentable;
|
|
228
|
+
private selectionClosure;
|
|
229
|
+
private removableGroupIds;
|
|
230
|
+
private sceneInstances;
|
|
231
|
+
private selectionTypeCounts;
|
|
232
|
+
private assertActive;
|
|
233
|
+
private installBuiltInActions;
|
|
234
|
+
private registeredToolbarActions;
|
|
235
|
+
private coreToolbarActions;
|
|
236
|
+
private gestureActive;
|
|
237
|
+
private syncInteractionMode;
|
|
238
|
+
private assertEditable;
|
|
239
|
+
private changed;
|
|
240
|
+
private emit;
|
|
241
|
+
private emitEvent;
|
|
242
|
+
private notify;
|
|
243
|
+
private report;
|
|
244
|
+
}
|
|
245
|
+
export declare function createStudioEditor(options: StudioEditorOptions, dependencies?: StudioEditorDependencies): StudioEditor;
|
|
246
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { StudioEditor, createStudioEditor } from './editor';
|
|
2
|
+
export type { StudioEditorOptions, StudioAddAssetOptions } from './editor';
|
|
3
|
+
export type { StudioNodeDisplayOptions, StudioNodeDisplayState, } from '../view/scene-session';
|
|
4
|
+
export type { StudioNodeFeatureSource, StudioNodeFeatureCapability, StudioNodeCoordinateCapability, StudioNodeFeatures, StudioNodePhysicsVisualization, StudioNodePhysicsVisualizationKey, StudioNodePhysicsVisualizationResult, StudioNodePhysicsVisualizationState, } from '../view/node-features';
|
|
5
|
+
export type { StudioEffectiveNodeState, StudioNodeCapabilities, StudioSceneTreeNode, StudioSceneTreeSnapshot, } from '../core/scene-tree';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export * from './ui-plugins';
|
|
8
|
+
export { sceneSourceFromResolution, visualSceneSourceFromResolution } from './asset-source';
|
|
9
|
+
export type { StudioSceneSourceResolutionOptions } from './asset-source';
|
|
10
|
+
export type { StudioAssetLoadError, StudioAssetLoadOutcome, StudioAssetLoadPhase, StudioAssetLoadProgress, StudioAssetLoadReporter, StudioAssetLoadStage, StudioAssetLoadStatus, StudioAssetLoadWarning, StudioSceneSession, StudioSceneStatus, StudioPlacementRuntimeFeedback, StudioPlacementTarget, StudioSelectionOverlay, StudioTransformCommitOptions, } from '../view/scene-session';
|
|
11
|
+
export type { GizmoMode } from '../view/gizmo';
|
|
12
|
+
export type { RegionShape, StudioSceneRegionOverlay, } from '../doc/scene-regions';
|
|
13
|
+
export type { StudioProjectionCapability, StudioProjectionStatus, StudioRuntimeProjectionCapabilities, } from '../view/runtime-capabilities';
|
|
14
|
+
export type { EditorialCameraV1, EditorialNodeStateV1, EditorialStateV1, } from '../project/contracts';
|
|
15
|
+
export type { StudioPlacementPlan } from './types';
|
|
16
|
+
export type { StudioNodeFrame, StudioSelectionFrame, StudioAssetDimensions } from '../doc/node-facts';
|
|
17
|
+
export type { StudioNodeGeometryAnchors } from '../view/geometry-anchors';
|
|
18
|
+
export type { StudioPlacementPolicy, StudioPlacementSurface, StudioPlacementEvaluation } from '../doc/placement-policy';
|
|
19
|
+
export type { StudioCaptureOptions, StudioCaptureResult } from '../view/scene-session';
|
|
20
|
+
export type { StudioPhysicsFacts, StudioPhysicsBodyFact, StudioPhysicsJointFact } from '../doc/physics-facts';
|
|
21
|
+
export type { StudioAssetPlacementPlan } from './types';
|
|
22
|
+
export type { StudioEditorActionReader } from './types';
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { StudioHostEvent, StudioHostSnapshot } from '../core/host';
|
|
2
|
+
import type { StudioSceneStatus } from '../view/scene-session';
|
|
3
|
+
import type { GizmoMode } from '../view/gizmo';
|
|
4
|
+
import type { StudioRuntimeProjectionCapabilities } from '../view/runtime-capabilities';
|
|
5
|
+
import type { StudioEditor } from './editor';
|
|
6
|
+
export type StudioPreviewSelection = 'none' | 'inspect';
|
|
7
|
+
export interface StudioPreviewOptions {
|
|
8
|
+
readonly selection?: StudioPreviewSelection;
|
|
9
|
+
}
|
|
10
|
+
export interface StudioToolbarAction {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly scope: 'scene' | 'selection';
|
|
13
|
+
readonly visible: boolean;
|
|
14
|
+
readonly enabled: boolean;
|
|
15
|
+
readonly active?: boolean;
|
|
16
|
+
readonly valueState?: 'on' | 'off' | 'mixed';
|
|
17
|
+
readonly busy: boolean;
|
|
18
|
+
readonly reason?: {
|
|
19
|
+
readonly code: string;
|
|
20
|
+
readonly nodeIds?: readonly string[];
|
|
21
|
+
};
|
|
22
|
+
readonly targetIds: readonly string[];
|
|
23
|
+
readonly execution: 'atomic' | 'eligible-subset';
|
|
24
|
+
readonly excludedTargets?: readonly {
|
|
25
|
+
readonly nodeId: string;
|
|
26
|
+
readonly reasonCode: string;
|
|
27
|
+
}[];
|
|
28
|
+
}
|
|
29
|
+
export interface StudioToolbarOverlay {
|
|
30
|
+
readonly sceneSessionId: string;
|
|
31
|
+
readonly selectionVersion: number;
|
|
32
|
+
readonly sequence: number;
|
|
33
|
+
/** CSS pixels relative to the viewport element, never device pixels. */
|
|
34
|
+
readonly anchor: {
|
|
35
|
+
readonly x: number;
|
|
36
|
+
readonly y: number;
|
|
37
|
+
} | null;
|
|
38
|
+
readonly visible: boolean;
|
|
39
|
+
readonly hiddenReason: 'no-selection' | 'selecting' | 'transforming' | 'camera-moving' | 'anchor-unavailable' | 'editing-disabled' | null;
|
|
40
|
+
}
|
|
41
|
+
export interface StudioToolbarState {
|
|
42
|
+
readonly sceneSessionId: string;
|
|
43
|
+
readonly contextVersion: number;
|
|
44
|
+
readonly selection: {
|
|
45
|
+
readonly version: number;
|
|
46
|
+
readonly nodeIds: readonly string[];
|
|
47
|
+
readonly primaryId: string | null;
|
|
48
|
+
readonly kind: 'none' | 'single' | 'multiple';
|
|
49
|
+
readonly typeCounts: Readonly<Record<string, number>>;
|
|
50
|
+
};
|
|
51
|
+
readonly scene: {
|
|
52
|
+
readonly visible: boolean;
|
|
53
|
+
readonly actions: readonly StudioToolbarAction[];
|
|
54
|
+
};
|
|
55
|
+
readonly object: {
|
|
56
|
+
readonly actions: readonly StudioToolbarAction[];
|
|
57
|
+
readonly overlay: StudioToolbarOverlay;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface StudioExecuteActionRequest {
|
|
61
|
+
readonly actionId: string;
|
|
62
|
+
readonly targetIds: readonly string[];
|
|
63
|
+
readonly expectedSceneSessionId: string;
|
|
64
|
+
readonly expectedSelectionVersion?: number;
|
|
65
|
+
}
|
|
66
|
+
/** Action callbacks query editor facts and write through their bound commit capability. */
|
|
67
|
+
export type StudioEditorActionReader = Pick<StudioEditor, 'getSnapshot' | 'getNodeFrame' | 'getNodeOriginAnchors' | 'getNodeOrigin' | 'getNodeOrientation' | 'getSelectionFrame' | 'getAssetDimensions' | 'getPhysicsFacts'>;
|
|
68
|
+
export interface StudioEditorActionContext {
|
|
69
|
+
readonly editor: StudioEditorActionReader;
|
|
70
|
+
readonly snapshot: StudioEditorSnapshot;
|
|
71
|
+
readonly signal: AbortSignal;
|
|
72
|
+
/** One atomic document transaction bound to this action's captured context. */
|
|
73
|
+
readonly commit: (commands: readonly import('../doc/command').CommandRecord[]) => import('../core/host').StudioCommandResult;
|
|
74
|
+
}
|
|
75
|
+
export interface StudioEditorActionStateContext {
|
|
76
|
+
readonly editor: StudioEditorActionReader;
|
|
77
|
+
readonly selectionIds: readonly string[];
|
|
78
|
+
readonly editingEnabled: boolean;
|
|
79
|
+
readonly previewMode: boolean;
|
|
80
|
+
readonly previewSelection: StudioPreviewSelection;
|
|
81
|
+
readonly previewing: boolean;
|
|
82
|
+
readonly gestureActive: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface StudioEditorActionDefinition {
|
|
85
|
+
readonly id: string;
|
|
86
|
+
readonly scope: 'scene' | 'selection';
|
|
87
|
+
readonly getState?: (context: StudioEditorActionStateContext) => StudioToolbarAction;
|
|
88
|
+
readonly execute: (context: StudioEditorActionContext, request: StudioExecuteActionRequest) => unknown | Promise<unknown>;
|
|
89
|
+
readonly cancel?: () => void;
|
|
90
|
+
}
|
|
91
|
+
export interface StudioEditorSnapshot {
|
|
92
|
+
readonly host: StudioHostSnapshot;
|
|
93
|
+
readonly toolbar: StudioToolbarState;
|
|
94
|
+
readonly sceneStatus: StudioSceneStatus | null;
|
|
95
|
+
readonly mode: GizmoMode;
|
|
96
|
+
readonly snap: boolean;
|
|
97
|
+
readonly snapStepM: number;
|
|
98
|
+
readonly transformSpace: 'local' | 'world';
|
|
99
|
+
readonly groundVisible: boolean;
|
|
100
|
+
readonly collisionVisible: boolean;
|
|
101
|
+
readonly editingEnabled: boolean;
|
|
102
|
+
readonly previewMode: boolean;
|
|
103
|
+
readonly previewSelection: StudioPreviewSelection;
|
|
104
|
+
readonly previewing: boolean;
|
|
105
|
+
readonly placementPreviewActive: boolean;
|
|
106
|
+
readonly placementPolicy: import('../doc/placement-policy').StudioPlacementPolicy;
|
|
107
|
+
readonly runtimeProjection: StudioRuntimeProjectionCapabilities;
|
|
108
|
+
readonly boxSelectionEnabled: boolean;
|
|
109
|
+
}
|
|
110
|
+
export type StudioEditorEvent = {
|
|
111
|
+
readonly type: 'snapshot' | 'toolbar.change' | 'overlay.change' | 'status.change' | 'disposed';
|
|
112
|
+
readonly snapshot: StudioEditorSnapshot;
|
|
113
|
+
} | {
|
|
114
|
+
readonly type: 'host.change';
|
|
115
|
+
readonly snapshot: StudioEditorSnapshot;
|
|
116
|
+
readonly event: StudioHostEvent;
|
|
117
|
+
} | {
|
|
118
|
+
readonly type: 'error';
|
|
119
|
+
readonly snapshot: StudioEditorSnapshot;
|
|
120
|
+
readonly error: unknown;
|
|
121
|
+
};
|
|
122
|
+
export declare class StudioEditorError extends Error {
|
|
123
|
+
readonly code: string;
|
|
124
|
+
constructor(code: string, message: string);
|
|
125
|
+
}
|
|
126
|
+
export interface StudioPlacementPlan {
|
|
127
|
+
readonly nodeId: string;
|
|
128
|
+
readonly sceneEpoch: number;
|
|
129
|
+
readonly documentVersion: number;
|
|
130
|
+
readonly policy: import('../doc/placement-policy').StudioPlacementPolicy;
|
|
131
|
+
readonly evaluation: import('../doc/placement-policy').StudioPlacementEvaluation;
|
|
132
|
+
readonly localTransform: import('../doc/schema').LocalTransform;
|
|
133
|
+
}
|
|
134
|
+
export interface StudioAssetPlacementPlan {
|
|
135
|
+
readonly revisionId: string;
|
|
136
|
+
readonly parentNodeId: string;
|
|
137
|
+
readonly sceneEpoch: number;
|
|
138
|
+
readonly documentVersion: number;
|
|
139
|
+
readonly policy: import('../doc/placement-policy').StudioPlacementPolicy;
|
|
140
|
+
readonly sourceBounds: import('../doc/schema').Vec3Bounds;
|
|
141
|
+
readonly evaluation: import('../doc/placement-policy').StudioPlacementEvaluation;
|
|
142
|
+
readonly localTransform: import('../doc/schema').LocalTransform;
|
|
143
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { StudioEditor } from './editor';
|
|
2
|
+
/** Version of the DOM contribution contract, independent of scene-data plugins. */
|
|
3
|
+
export declare const STUDIO_UI_PLUGIN_API_VERSION: 1;
|
|
4
|
+
export type StudioUiSlot = 'inspector' | 'scene-toolbar' | 'selection-toolbar';
|
|
5
|
+
export type StudioUiSnapshot = ReturnType<StudioEditor['getSnapshot']>;
|
|
6
|
+
export type StudioUiEditorEvent = Parameters<StudioEditor['subscribe']>[0] extends (event: infer Event) => unknown ? Event : never;
|
|
7
|
+
export type StudioUiDisposer = () => void;
|
|
8
|
+
export interface StudioUiViewContext {
|
|
9
|
+
readonly editor: StudioEditor;
|
|
10
|
+
readonly snapshot: StudioUiSnapshot;
|
|
11
|
+
}
|
|
12
|
+
export interface StudioUiMountedView {
|
|
13
|
+
/** Receives the complete current SDK snapshot; views do not assemble partial events. */
|
|
14
|
+
update?(context: StudioUiViewContext): void;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface StudioUiViewContribution {
|
|
18
|
+
/** Unique within the contributing plugin. */
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly slot: StudioUiSlot;
|
|
21
|
+
readonly order?: number;
|
|
22
|
+
mount(container: HTMLElement, context: StudioUiViewContext): void | StudioUiDisposer | StudioUiMountedView;
|
|
23
|
+
}
|
|
24
|
+
export interface StudioUiPluginContext {
|
|
25
|
+
readonly editor: StudioEditor;
|
|
26
|
+
readonly contributions: {
|
|
27
|
+
addView(view: StudioUiViewContribution): StudioUiDisposer;
|
|
28
|
+
};
|
|
29
|
+
/** Subscriptions registered here are automatically removed with the plugin. */
|
|
30
|
+
readonly events: {
|
|
31
|
+
subscribe(listener: (event: StudioUiEditorEvent) => void): StudioUiDisposer;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface StudioUiPlugin {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly apiVersion: typeof STUDIO_UI_PLUGIN_API_VERSION;
|
|
37
|
+
activate(context: StudioUiPluginContext): void | StudioUiDisposer;
|
|
38
|
+
}
|
|
39
|
+
export interface StudioUiPluginError {
|
|
40
|
+
readonly pluginId: string;
|
|
41
|
+
readonly viewId?: string;
|
|
42
|
+
readonly phase: 'activate' | 'mount' | 'update' | 'event' | 'dispose';
|
|
43
|
+
readonly error: unknown;
|
|
44
|
+
}
|
|
45
|
+
export interface StudioUiPluginHostOptions {
|
|
46
|
+
readonly editor: StudioEditor;
|
|
47
|
+
/** The frontend owns slot placement, styling, and the surrounding page. */
|
|
48
|
+
readonly slots: Partial<Record<StudioUiSlot, HTMLElement>>;
|
|
49
|
+
readonly onError?: (error: StudioUiPluginError) => void;
|
|
50
|
+
}
|
|
51
|
+
export interface StudioUiPluginHost {
|
|
52
|
+
/** Registration can happen before start or dynamically while running. */
|
|
53
|
+
register(plugin: StudioUiPlugin): StudioUiDisposer;
|
|
54
|
+
/** Activate registered plugins and begin forwarding SDK state changes. Idempotent. */
|
|
55
|
+
start(): void;
|
|
56
|
+
/** Unmount all owned views and subscriptions. Does not dispose the editor or slots. */
|
|
57
|
+
dispose(): void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A framework-independent surface host. It contains no default panels, business
|
|
61
|
+
* actions, or toolbar layout. Applications register those as UI plugins and use
|
|
62
|
+
* the same public editor APIs as their other frontend components.
|
|
63
|
+
*/
|
|
64
|
+
export declare function createStudioUiPluginHost(options: StudioUiPluginHostOptions): StudioUiPluginHost;
|