@volter/sdk 0.0.0-stage → 0.5.204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +20 -0
- package/README.md +38 -3
- package/package.json +510 -4
- package/src/account.ts +210 -0
- package/src/chrome.ts +88 -0
- package/src/client.ts +1646 -0
- package/src/commands.ts +66 -0
- package/src/contributions.ts +619 -0
- package/src/css-numeric-style.ts +97 -0
- package/src/document-probe.ts +282 -0
- package/src/editor-view.ts +225 -0
- package/src/extension.ts +40 -0
- package/src/generations.ts +178 -0
- package/src/host.ts +1157 -0
- package/src/http-transport.browser.ts +14 -0
- package/src/http-transport.node.ts +19 -0
- package/src/index.ts +131 -0
- package/src/kit/CapabilityCoverageSection.tsx +185 -0
- package/src/kit/account-client.ts +333 -0
- package/src/kit/action-registry.ts +317 -0
- package/src/kit/active-product.ts +76 -0
- package/src/kit/active-project.ts +155 -0
- package/src/kit/adapter-editor-config.ts +25 -0
- package/src/kit/adapter-module.ts +7 -0
- package/src/kit/adapter-observation.ts +49 -0
- package/src/kit/animation/animation-clock.ts +479 -0
- package/src/kit/animation/stage-transport.ts +385 -0
- package/src/kit/api/assets.ts +365 -0
- package/src/kit/api/project-open.ts +355 -0
- package/src/kit/api/project-source.ts +180 -0
- package/src/kit/api/project-state.ts +110 -0
- package/src/kit/api/relay.ts +270 -0
- package/src/kit/api/themes.ts +45 -0
- package/src/kit/api-asset-library-wire.ts +45 -0
- package/src/kit/api-base.ts +10 -0
- package/src/kit/api-build.ts +99 -0
- package/src/kit/api-git-wire.ts +56 -0
- package/src/kit/api-logs.ts +92 -0
- package/src/kit/api-project-identity.ts +74 -0
- package/src/kit/api-settings.ts +36 -0
- package/src/kit/api-worktrees.ts +205 -0
- package/src/kit/asset-capabilities.ts +344 -0
- package/src/kit/asset-compare-core.ts +171 -0
- package/src/kit/asset-editor-context.tsx +101 -0
- package/src/kit/asset-events.ts +96 -0
- package/src/kit/asset-inspector-actions.ts +87 -0
- package/src/kit/asset-selection-viewer-registry.ts +113 -0
- package/src/kit/asset-selection.ts +146 -0
- package/src/kit/asset-thumbnails.ts +25 -0
- package/src/kit/asset-viewers.ts +115 -0
- package/src/kit/asset-workflow/asset-import-jobs.ts +106 -0
- package/src/kit/asset-workflow/asset-ledger-backend.ts +126 -0
- package/src/kit/asset-workflow/asset-ledger.ts +156 -0
- package/src/kit/asset-workflow/asset-materialization-report.ts +140 -0
- package/src/kit/asset-workflow/asset-pack-manifest.ts +320 -0
- package/src/kit/asset-workflow/asset-types.ts +142 -0
- package/src/kit/asset-workflow/audio-preview-player.ts +193 -0
- package/src/kit/asset-workflow/audio-waveform.ts +22 -0
- package/src/kit/asset-workflow/cloud-asset-client.ts +263 -0
- package/src/kit/asset-workflow/hosted-asset-materialization.ts +236 -0
- package/src/kit/asset-workflow/image-view-scale.ts +31 -0
- package/src/kit/asset-workflow/import-contract.ts +124 -0
- package/src/kit/asset-workflow/ledger-write-lock.ts +244 -0
- package/src/kit/asset-workflow/pixi-spritesheet.ts +197 -0
- package/src/kit/asset-workflow/preview-resource-lifetime.ts +44 -0
- package/src/kit/asset-workflow/project-asset-commands.ts +20 -0
- package/src/kit/asset-workflow/project-content.ts +288 -0
- package/src/kit/asset-workflow/project-source-index.ts +545 -0
- package/src/kit/asset-workflow/thumbnail-system.ts +256 -0
- package/src/kit/authoring/active-adapter.ts +200 -0
- package/src/kit/authoring/active-systems.ts +422 -0
- package/src/kit/authoring/adapter-key.ts +18 -0
- package/src/kit/authoring/authoring-asset-url.ts +27 -0
- package/src/kit/authoring/bootstrap-state.ts +49 -0
- package/src/kit/authoring/boundary-authoring-adapter.ts +189 -0
- package/src/kit/authoring/canvas-scene-guides.ts +84 -0
- package/src/kit/authoring/composite-authoring-adapter.ts +2109 -0
- package/src/kit/authoring/consumer-actions.ts +531 -0
- package/src/kit/authoring/design-time-layers.ts +852 -0
- package/src/kit/authoring/design-time-mount-registry.ts +244 -0
- package/src/kit/authoring/edit-mode-authoring.ts +637 -0
- package/src/kit/authoring/empty-project-authoring.ts +22 -0
- package/src/kit/authoring/instance-source-menu.ts +135 -0
- package/src/kit/authoring/layered-pick.ts +185 -0
- package/src/kit/authoring/mounted-root-subjects.ts +146 -0
- package/src/kit/authoring/no-authoring-adapter.ts +59 -0
- package/src/kit/authoring/object3d-document-persistence.ts +122 -0
- package/src/kit/authoring/panel-authoring.ts +121 -0
- package/src/kit/authoring/project-authoring-session.ts +105 -0
- package/src/kit/authoring/provenance.ts +99 -0
- package/src/kit/authoring/react-canvas-navigation.ts +259 -0
- package/src/kit/authoring/react-design-canvas-style.ts +20 -0
- package/src/kit/authoring/react-story-board.ts +917 -0
- package/src/kit/authoring/selection-scope.ts +195 -0
- package/src/kit/authoring/shell-document-ops.ts +169 -0
- package/src/kit/authoring/story-board-chrome-fit.ts +107 -0
- package/src/kit/authoring/story-board-presentation.ts +111 -0
- package/src/kit/authoring/three-root.ts +67 -0
- package/src/kit/authoring/viewport-tool-context.ts +73 -0
- package/src/kit/authoring/viewport-tool-owner.ts +38 -0
- package/src/kit/authoring/world-session-state.ts +101 -0
- package/src/kit/authoring-seam-evidence.ts +300 -0
- package/src/kit/availability-tick.ts +66 -0
- package/src/kit/bitmap-label.ts +120 -0
- package/src/kit/boot-routing.ts +392 -0
- package/src/kit/breakpoint-state.ts +43 -0
- package/src/kit/build-identity.ts +16 -0
- package/src/kit/bytes-codec.ts +62 -0
- package/src/kit/cancellation-reason.ts +58 -0
- package/src/kit/canvas-frames.ts +88 -0
- package/src/kit/capture-camera-pose.ts +77 -0
- package/src/kit/capture-size.ts +88 -0
- package/src/kit/chrome-registry.ts +159 -0
- package/src/kit/chrome-slot-registry.ts +91 -0
- package/src/kit/collaboration-client.ts +264 -0
- package/src/kit/collaboration-presence.ts +41 -0
- package/src/kit/command-dispatch.ts +19 -0
- package/src/kit/command-listener.ts +2182 -0
- package/src/kit/command-registry.ts +71 -0
- package/src/kit/component-board-registry.ts +205 -0
- package/src/kit/component-states-registry.ts +199 -0
- package/src/kit/components/AlignToolbar.tsx +204 -0
- package/src/kit/components/ApplicationMenus.tsx +372 -0
- package/src/kit/components/AssetEditorShell.tsx +216 -0
- package/src/kit/components/AssetInspectorToolSection.tsx +124 -0
- package/src/kit/components/BoardRulers.tsx +354 -0
- package/src/kit/components/CanvasAddNodeDialogs.tsx +529 -0
- package/src/kit/components/CanvasSceneViewport.tsx +1195 -0
- package/src/kit/components/ChromeSlot.tsx +20 -0
- package/src/kit/components/CodeView.tsx +470 -0
- package/src/kit/components/CompactInspectorShell.tsx +39 -0
- package/src/kit/components/ConsolePanel.tsx +273 -0
- package/src/kit/components/GameplaySessionTimeline.tsx +295 -0
- package/src/kit/components/InspectionProjection.tsx +932 -0
- package/src/kit/components/Inspector.tsx +270 -0
- package/src/kit/components/InspectorCanvasPreview.tsx +35 -0
- package/src/kit/components/InspectorFieldsSection.tsx +290 -0
- package/src/kit/components/InspectorStoriesSection.tsx +92 -0
- package/src/kit/components/InspectorToolSection.tsx +96 -0
- package/src/kit/components/InspectorTransformSection.tsx +245 -0
- package/src/kit/components/LightExplorerPanel.tsx +433 -0
- package/src/kit/components/MediaProperties.tsx +145 -0
- package/src/kit/components/ProjectHeader.tsx +328 -0
- package/src/kit/components/ReactCanvasControls.tsx +358 -0
- package/src/kit/components/RootSelectionOverlay.tsx +3688 -0
- package/src/kit/components/RootTextEditor.tsx +79 -0
- package/src/kit/components/SaveStatus.tsx +70 -0
- package/src/kit/components/SurfaceCrashBoundary.tsx +105 -0
- package/src/kit/components/SurfaceStateOverlay.tsx +24 -0
- package/src/kit/components/ToolContributionSurfaces.tsx +49 -0
- package/src/kit/components/ToolHost.tsx +380 -0
- package/src/kit/components/Toolbar.tsx +811 -0
- package/src/kit/components/TransientHint.tsx +44 -0
- package/src/kit/components/VersionControlSection.tsx +470 -0
- package/src/kit/components/ViewportOverlaysMenu.tsx +177 -0
- package/src/kit/components/VolterLogo.tsx +18 -0
- package/src/kit/components/WorktreeSwitcher.tsx +712 -0
- package/src/kit/components/account-documents.tsx +1162 -0
- package/src/kit/components/asset-documents.tsx +794 -0
- package/src/kit/components/asset-editor-persistence.ts +216 -0
- package/src/kit/components/asset-selection-section.tsx +545 -0
- package/src/kit/components/asset-thumbnails.tsx +307 -0
- package/src/kit/components/asset-viewers/AudioViewer.tsx +201 -0
- package/src/kit/components/asset-viewers/GenericJsonViewer.tsx +102 -0
- package/src/kit/components/asset-viewers/ImageViewer.tsx +300 -0
- package/src/kit/components/asset-viewers/JsonAssetDocument.tsx +98 -0
- package/src/kit/components/asset-viewers/OnlineAssetDetail.tsx +426 -0
- package/src/kit/components/asset-viewers/SourceAssetViewer.tsx +356 -0
- package/src/kit/components/asset-viewers/SpritesheetSpriteView.tsx +102 -0
- package/src/kit/components/asset-viewers/VideoViewer.tsx +101 -0
- package/src/kit/components/asset-viewers/shader-source.ts +144 -0
- package/src/kit/components/board-guides.ts +150 -0
- package/src/kit/components/canvas-scene-hotkeys.ts +37 -0
- package/src/kit/components/canvas-temporary-pivot.ts +34 -0
- package/src/kit/components/core-utilities.tsx +94 -0
- package/src/kit/components/inspector-preview-section.tsx +223 -0
- package/src/kit/components/inspector-revert-label.ts +20 -0
- package/src/kit/components/inspector-selection.ts +42 -0
- package/src/kit/components/inspector-stories-gating.ts +171 -0
- package/src/kit/components/inspector-transform-subject.ts +11 -0
- package/src/kit/components/inspector-transform.ts +88 -0
- package/src/kit/components/kind-documents.tsx +544 -0
- package/src/kit/components/primitives/DraftColorInput.tsx +74 -0
- package/src/kit/components/project-tool-documents.tsx +402 -0
- package/src/kit/components/scene-documents.tsx +221 -0
- package/src/kit/components/status-contributions.tsx +407 -0
- package/src/kit/components/tool-documents.tsx +302 -0
- package/src/kit/components/tool-schema-form.tsx +262 -0
- package/src/kit/components/use-after-paint.ts +41 -0
- package/src/kit/components/use-project-image-assets.ts +86 -0
- package/src/kit/components/workspace-history.ts +32 -0
- package/src/kit/components/world-documents.tsx +570 -0
- package/src/kit/components/world-overlay-gestures.ts +1939 -0
- package/src/kit/composite-screenshot.ts +2238 -0
- package/src/kit/content-entry-source-registry.ts +184 -0
- package/src/kit/contribution-surfaces.ts +48 -0
- package/src/kit/coverage/canvas-reveal.ts +192 -0
- package/src/kit/coverage/design-time-surfaces.ts +101 -0
- package/src/kit/coverage/ontology-invariants.ts +466 -0
- package/src/kit/coverage/session-vitals.ts +503 -0
- package/src/kit/crash-null-boundary.ts +36 -0
- package/src/kit/creation-site-edit.ts +1491 -0
- package/src/kit/creation-site-registry.ts +160 -0
- package/src/kit/delegate-harness-registry.ts +134 -0
- package/src/kit/document-areas.ts +70 -0
- package/src/kit/document-context-registry.ts +193 -0
- package/src/kit/document-open-registry.ts +200 -0
- package/src/kit/document-play-extension.ts +221 -0
- package/src/kit/document-preview-source.ts +20 -0
- package/src/kit/document-renderer-session.ts +138 -0
- package/src/kit/document-stage-sessions.ts +26 -0
- package/src/kit/document-viewports.ts +120 -0
- package/src/kit/editor-api.ts +46 -0
- package/src/kit/editor-chrome-capture.ts +136 -0
- package/src/kit/editor-commands.ts +176 -0
- package/src/kit/editor-console.ts +580 -0
- package/src/kit/editor-current-view.ts +56 -0
- package/src/kit/editor-document-probe.ts +1168 -0
- package/src/kit/editor-git-client.ts +115 -0
- package/src/kit/editor-hotkeys.ts +728 -0
- package/src/kit/editor-lease-view.ts +39 -0
- package/src/kit/editor-lease.ts +415 -0
- package/src/kit/editor-mode.ts +19 -0
- package/src/kit/editor-notifications.ts +140 -0
- package/src/kit/editor-presence.ts +563 -0
- package/src/kit/editor-presentation-activity.ts +58 -0
- package/src/kit/editor-presentation-notice.ts +42 -0
- package/src/kit/editor-runtime.tsx +147 -0
- package/src/kit/editor-server-response.ts +86 -0
- package/src/kit/editor-session-attribution.ts +85 -0
- package/src/kit/editor-session-mode.ts +54 -0
- package/src/kit/editor-state-facets.ts +74 -0
- package/src/kit/editor-view-presentation.ts +777 -0
- package/src/kit/environment-images.ts +58 -0
- package/src/kit/eyedropper-session.ts +60 -0
- package/src/kit/files/file-provider.ts +62 -0
- package/src/kit/files/project-files.ts +270 -0
- package/src/kit/finders/index.ts +137 -0
- package/src/kit/finders/scenes-from-entrypoint-selection.ts +387 -0
- package/src/kit/frame/frame-parts.ts +30 -0
- package/src/kit/framed-document-capture.ts +34 -0
- package/src/kit/game-globals-prelude.ts +143 -0
- package/src/kit/game-surface-defaults.ts +33 -0
- package/src/kit/gameplay-dom-recording.ts +318 -0
- package/src/kit/gameplay-export-state.ts +14 -0
- package/src/kit/gameplay-replay.ts +417 -0
- package/src/kit/gameplay-session-time.ts +9 -0
- package/src/kit/gameplay-sessions.ts +204 -0
- package/src/kit/hierarchy-component-marks.ts +298 -0
- package/src/kit/hierarchy-internals.ts +197 -0
- package/src/kit/hierarchy-kind-icon.ts +217 -0
- package/src/kit/hierarchy-menu-registry.ts +67 -0
- package/src/kit/hierarchy-node-rows.ts +307 -0
- package/src/kit/hierarchy-panel-view.ts +280 -0
- package/src/kit/hierarchy-projection.ts +76 -0
- package/src/kit/hierarchy-row-media.ts +45 -0
- package/src/kit/hierarchy-row-model.ts +308 -0
- package/src/kit/hierarchy-rows.ts +11 -0
- package/src/kit/hierarchy-walk.ts +86 -0
- package/src/kit/history/editor-session.ts +25 -0
- package/src/kit/history/history-commands.ts +147 -0
- package/src/kit/history/history-delegate.ts +187 -0
- package/src/kit/history/history-limit-notices.ts +43 -0
- package/src/kit/history/history-service.ts +1189 -0
- package/src/kit/history/persistence-coordinator.ts +35 -0
- package/src/kit/history/project-file-history.ts +386 -0
- package/src/kit/history/project-root-history-backends.ts +139 -0
- package/src/kit/history/resource-registry.ts +209 -0
- package/src/kit/history/snapshot-store.ts +103 -0
- package/src/kit/history/source-history-backend.ts +546 -0
- package/src/kit/history-types.ts +124 -0
- package/src/kit/hmr-registration-group.ts +67 -0
- package/src/kit/hmr-stable-react-context.ts +23 -0
- package/src/kit/hotkeys.ts +190 -0
- package/src/kit/inference-diagnostics.ts +69 -0
- package/src/kit/initial-project.ts +80 -0
- package/src/kit/inspection/active-subject.ts +571 -0
- package/src/kit/inspection/active-surface.ts +142 -0
- package/src/kit/inspection/compose-subject.ts +1055 -0
- package/src/kit/inspection/compose.ts +7 -0
- package/src/kit/inspection/display.ts +171 -0
- package/src/kit/inspection/document-subject.ts +109 -0
- package/src/kit/inspection/game-subject.ts +85 -0
- package/src/kit/inspection/null-subject.ts +119 -0
- package/src/kit/inspection/serialize.ts +357 -0
- package/src/kit/inspection/use-active-inspection.ts +180 -0
- package/src/kit/inspection-model.ts +542 -0
- package/src/kit/inspection-node-media.ts +58 -0
- package/src/kit/inspector-presentation.ts +203 -0
- package/src/kit/inspector-property-grouping.ts +64 -0
- package/src/kit/inspector-section-registry.ts +221 -0
- package/src/kit/instance-source-actions.ts +163 -0
- package/src/kit/js-heap.ts +71 -0
- package/src/kit/key-actions.ts +91 -0
- package/src/kit/keymap-presets.ts +428 -0
- package/src/kit/layout-policy.ts +31 -0
- package/src/kit/light-explorer-model.ts +134 -0
- package/src/kit/live-canvas-frame.ts +55 -0
- package/src/kit/live-document.ts +296 -0
- package/src/kit/live-gesture-lock.ts +50 -0
- package/src/kit/live-seam-evidence.ts +11 -0
- package/src/kit/live-session-registry.ts +220 -0
- package/src/kit/live-transition.ts +391 -0
- package/src/kit/manifest-project.ts +107 -0
- package/src/kit/module-fetch-diagnosis.ts +192 -0
- package/src/kit/mount-failure-report.ts +154 -0
- package/src/kit/native-selection-style.ts +497 -0
- package/src/kit/object3d-document-write-policy.ts +137 -0
- package/src/kit/packaged-runtime.ts +108 -0
- package/src/kit/palettes/maya.palette.json +57 -0
- package/src/kit/palettes/substance.palette.json +57 -0
- package/src/kit/performance-profiler.ts +367 -0
- package/src/kit/performance-sources.ts +69 -0
- package/src/kit/photograph-notice.ts +141 -0
- package/src/kit/play-boot-phase.ts +166 -0
- package/src/kit/play-camera-flight.ts +35 -0
- package/src/kit/png-encode.worker.ts +26 -0
- package/src/kit/presentation-surface.ts +248 -0
- package/src/kit/product-command.ts +90 -0
- package/src/kit/project-adapter.ts +1140 -0
- package/src/kit/project-asset-refresh.ts +23 -0
- package/src/kit/project-asset-roots.ts +68 -0
- package/src/kit/project-local-state.ts +151 -0
- package/src/kit/project-manager.ts +243 -0
- package/src/kit/project-module-changes.ts +201 -0
- package/src/kit/project-module-split.ts +270 -0
- package/src/kit/project-play-layers.ts +25 -0
- package/src/kit/project-provenance.ts +115 -0
- package/src/kit/project-ready.ts +42 -0
- package/src/kit/project-shape.ts +68 -0
- package/src/kit/project-tools.ts +107 -0
- package/src/kit/projection-types.ts +44 -0
- package/src/kit/readiness.ts +113 -0
- package/src/kit/renderer-resource-counts.ts +27 -0
- package/src/kit/reported-play-state.ts +90 -0
- package/src/kit/resolve-contributed-command.ts +14 -0
- package/src/kit/resolve-relative-specifier.ts +33 -0
- package/src/kit/retained-document-states.ts +91 -0
- package/src/kit/scene-document-plan.ts +320 -0
- package/src/kit/scene-live-open.ts +210 -0
- package/src/kit/scoped-game-css.ts +152 -0
- package/src/kit/served-url.ts +5 -0
- package/src/kit/session-close.ts +17 -0
- package/src/kit/session-tombstone.ts +127 -0
- package/src/kit/settings/settings-provider.ts +82 -0
- package/src/kit/settings-store.ts +348 -0
- package/src/kit/shell-document-state.ts +27 -0
- package/src/kit/shell-store-door.ts +45 -0
- package/src/kit/shell-store.ts +722 -0
- package/src/kit/source-conflict.ts +122 -0
- package/src/kit/stage-context.ts +377 -0
- package/src/kit/stage-invalidation.ts +25 -0
- package/src/kit/stage-store-registry.ts +69 -0
- package/src/kit/startup-failure.ts +80 -0
- package/src/kit/state-report-deferral.ts +73 -0
- package/src/kit/storage/host-files-storage.ts +97 -0
- package/src/kit/storage/http-storage.ts +174 -0
- package/src/kit/storage/index.ts +75 -0
- package/src/kit/storage/mem-storage.ts +158 -0
- package/src/kit/storage/path-lock.ts +44 -0
- package/src/kit/storage/paths.ts +26 -0
- package/src/kit/storage-types.ts +127 -0
- package/src/kit/stories/StoryPreviewMount.tsx +306 -0
- package/src/kit/stories/compose-project-stories.ts +255 -0
- package/src/kit/stories/prefabs-finder.ts +54 -0
- package/src/kit/stories/prefabs-from-stories.ts +182 -0
- package/src/kit/stories/project-story-regions.ts +24 -0
- package/src/kit/stories/story-capture.ts +579 -0
- package/src/kit/stories/story-declared-medium.ts +126 -0
- package/src/kit/stories/story-discovery.ts +176 -0
- package/src/kit/stories/story-dom-runtime.ts +78 -0
- package/src/kit/stories/story-grouping.ts +111 -0
- package/src/kit/stories/story-mount-turn.ts +27 -0
- package/src/kit/stories/story-presentation.ts +215 -0
- package/src/kit/stories/story-preview-component.ts +7 -0
- package/src/kit/stories/story-registry.ts +530 -0
- package/src/kit/stories-scope.ts +35 -0
- package/src/kit/story-document-openers.ts +36 -0
- package/src/kit/story-thumbnails.ts +47 -0
- package/src/kit/surface-keyboard.ts +101 -0
- package/src/kit/surface-state.ts +135 -0
- package/src/kit/system-seam-evidence.ts +72 -0
- package/src/kit/tab-census.ts +202 -0
- package/src/kit/tab-lifecycle-client.ts +227 -0
- package/src/kit/theme-library.ts +897 -0
- package/src/kit/theme-preference.ts +429 -0
- package/src/kit/three-viewport-presentation.ts +23 -0
- package/src/kit/tool-contribution-play.ts +74 -0
- package/src/kit/tool-loader.ts +1918 -0
- package/src/kit/transform-mode-request.ts +66 -0
- package/src/kit/transient-hint.ts +78 -0
- package/src/kit/transport-strip.tsx +174 -0
- package/src/kit/ui-source/adapter-region-includes.ts +238 -0
- package/src/kit/ui-source/file-region-resolver.ts +302 -0
- package/src/kit/ui-source/inspect.ts +775 -0
- package/src/kit/ui-source/source-write-backend.ts +605 -0
- package/src/kit/ui-source/tier-source-write-backend.ts +279 -0
- package/src/kit/user-local-state.ts +105 -0
- package/src/kit/viewport-activation-timings.ts +840 -0
- package/src/kit/viewport-editor-controls.ts +22 -0
- package/src/kit/viewport-presentation.ts +668 -0
- package/src/kit/viewport-surface-status.tsx +55 -0
- package/src/kit/wait-until.ts +37 -0
- package/src/kit/worker-call-metrics.ts +166 -0
- package/src/kit/workspace-areas.ts +191 -0
- package/src/kit/workspace-aux-commands.ts +11 -0
- package/src/kit/workspace-available-documents.ts +142 -0
- package/src/kit/workspace-core-utilities.ts +31 -0
- package/src/kit/workspace-document-ids.ts +59 -0
- package/src/kit/workspace-document-registry.ts +624 -0
- package/src/kit/workspace-document-restore.ts +146 -0
- package/src/kit/workspace-host-commands.ts +141 -0
- package/src/kit/workspace-persistence-gate.ts +40 -0
- package/src/kit/workspace-play-utilities.ts +44 -0
- package/src/kit/workspace-presets.ts +446 -0
- package/src/kit/workspace-regions.ts +276 -0
- package/src/kit/workspace-static-panels.ts +73 -0
- package/src/kit/workspace-status-registry.ts +121 -0
- package/src/kit/workspace-storage.ts +35 -0
- package/src/kit/workspace-style.ts +226 -0
- package/src/kit/workspace-utility-commands.ts +74 -0
- package/src/kit/workspace-utility-registry.ts +263 -0
- package/src/kit/world-adoption-event.ts +23 -0
- package/src/kit/world-adoption.ts +115 -0
- package/src/kit/world-canvas-viewport-state.ts +35 -0
- package/src/kit/world-document-routing.ts +104 -0
- package/src/kit/world-pan-state.ts +198 -0
- package/src/kit/write-pipe.ts +173 -0
- package/src/layout-arrangements.ts +5 -0
- package/src/layouts.tsx +108 -0
- package/src/looks.ts +16 -0
- package/src/project/output-roots.ts +73 -0
- package/src/project/tab-census.ts +155 -0
- package/src/project-tool-catalog.ts +104 -0
- package/src/selection.tsx +107 -0
- package/src/services.ts +18 -0
- package/src/session/build-report.ts +22 -0
- package/src/session/collaboration-types.ts +262 -0
- package/src/session/command-table.ts +327 -0
- package/src/session/discovery.ts +100 -0
- package/src/session/editor-brand.ts +48 -0
- package/src/session/editor-compatibility.ts +329 -0
- package/src/session/editor-control-lifecycle.ts +68 -0
- package/src/session/editor-control-protocol.ts +5 -0
- package/src/session/entrypoint-selection-readers.ts +66 -0
- package/src/session/entrypoint-selection-source.ts +120 -0
- package/src/session/game-css-scope.ts +30 -0
- package/src/session/hosted-attachment.ts +225 -0
- package/src/session/limited-view.ts +82 -0
- package/src/session/product-create.ts +24 -0
- package/src/session/product-locator.ts +478 -0
- package/src/session/project-module-url.ts +242 -0
- package/src/session/project-serving.ts +164 -0
- package/src/session/project-upgrade.ts +669 -0
- package/src/session/registry-format.ts +210 -0
- package/src/session/relative-path-guard.ts +56 -0
- package/src/session/scoped-game-css.ts +461 -0
- package/src/session/source-glob.ts +15 -0
- package/src/session/tool-contribution-convention.ts +123 -0
- package/src/session/workbench-locator.ts +712 -0
- package/src/session.ts +41 -0
- package/src/share.ts +160 -0
- package/src/source-analysis.ts +28 -0
- package/src/source-authoring.ts +439 -0
- package/src/tools/errors.ts +91 -0
- package/src/tools/provider-execution.ts +70 -0
- package/src/tools/registry.ts +341 -0
- package/src/tools/types.ts +159 -0
- package/src/transport.ts +100 -0
- package/src/types.ts +1693 -0
- package/src/views.ts +164 -0
- package/src/widgets/design-system.ts +93 -0
- package/src/widgets/editor-appearance.ts +151 -0
- package/src/widgets/editor-material.ts +83 -0
- package/src/widgets/icon-set-registry.ts +105 -0
- package/src/widgets/index.ts +71 -0
- package/src/widgets/inspector-widgets/AlignmentGrid.tsx +182 -0
- package/src/widgets/inspector-widgets/AssetSlotPicker.tsx +123 -0
- package/src/widgets/inspector-widgets/BorderEditor.tsx +309 -0
- package/src/widgets/inspector-widgets/ColorPicker.tsx +549 -0
- package/src/widgets/inspector-widgets/CurveEditor.tsx +359 -0
- package/src/widgets/inspector-widgets/FilterEditor.tsx +108 -0
- package/src/widgets/inspector-widgets/FontPicker.tsx +191 -0
- package/src/widgets/inspector-widgets/GradientEditor.tsx +623 -0
- package/src/widgets/inspector-widgets/ScrubbableInput.tsx +180 -0
- package/src/widgets/inspector-widgets/ShadowEditor.tsx +319 -0
- package/src/widgets/inspector-widgets/color-utils.ts +201 -0
- package/src/widgets/inspector-widgets/curve-utils.ts +212 -0
- package/src/widgets/inspector-widgets/index.ts +25 -0
- package/src/widgets/inspector-widgets/shared.tsx +140 -0
- package/src/widgets/interactive-edit-scope.ts +33 -0
- package/src/widgets/patterns/Dialog.tsx +140 -0
- package/src/widgets/patterns/Fields.tsx +44 -0
- package/src/widgets/patterns/List.tsx +25 -0
- package/src/widgets/patterns/StateSurface.tsx +40 -0
- package/src/widgets/patterns/Surfaces.tsx +122 -0
- package/src/widgets/patterns/Tabs.tsx +80 -0
- package/src/widgets/patterns/Toolbar.tsx +72 -0
- package/src/widgets/patterns/Tree.tsx +72 -0
- package/src/widgets/primitives/AnchoredMenu.tsx +260 -0
- package/src/widgets/primitives/Button.tsx +62 -0
- package/src/widgets/primitives/ColorInput.tsx +78 -0
- package/src/widgets/primitives/DraftTextInput.tsx +63 -0
- package/src/widgets/primitives/EditorIcon.tsx +157 -0
- package/src/widgets/primitives/FormControls.tsx +88 -0
- package/src/widgets/primitives/HoverPreview.tsx +96 -0
- package/src/widgets/primitives/JsonInput.tsx +113 -0
- package/src/widgets/primitives/Layout.tsx +100 -0
- package/src/widgets/primitives/Menu.tsx +161 -0
- package/src/widgets/primitives/NumberInput.tsx +169 -0
- package/src/widgets/primitives/Panel.tsx +80 -0
- package/src/widgets/primitives/SectionHeader.tsx +77 -0
- package/src/widgets/primitives/Text.tsx +54 -0
- package/src/widgets/primitives/ThemeRootPortal.tsx +52 -0
- package/src/widgets/primitives/Tooltip.tsx +204 -0
- package/src/widgets/primitives/Vec3Input.tsx +70 -0
- package/src/widgets/primitives/banner-tones.ts +32 -0
- package/src/widgets/primitives/clamp-to-viewport.ts +44 -0
- package/src/widgets/primitives/editor-icons.ts +254 -0
- package/src/widgets/primitives/panel-header-styles.ts +42 -0
- package/src/widgets/theme.ts +2841 -0
- package/src/widgets/z-index.ts +25 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { PROJECT_ASSET_COMMANDS } from './asset-workflow/project-asset-commands';
|
|
2
|
+
import { getActiveAuthoring } from '@volter/sdk/kit/authoring/active-adapter';
|
|
3
|
+
import { NO_AUTHORING_ID } from '@volter/sdk/kit/authoring/no-authoring-adapter';
|
|
4
|
+
import {
|
|
5
|
+
activeHierarchyRows,
|
|
6
|
+
selectAllAuthoringNodes,
|
|
7
|
+
selectAuthoringNodes,
|
|
8
|
+
} from '@volter/sdk/kit/authoring/shell-document-ops';
|
|
9
|
+
import { openAccountDocument } from './components/account-documents';
|
|
10
|
+
import {
|
|
11
|
+
copySelection,
|
|
12
|
+
cutSelection,
|
|
13
|
+
deleteSelection,
|
|
14
|
+
duplicateSelection,
|
|
15
|
+
pasteSelection,
|
|
16
|
+
} from './editor-hotkeys';
|
|
17
|
+
import { invokeKeyAction } from '@volter/sdk/kit/key-actions';
|
|
18
|
+
import type { ShellStore } from '@volter/sdk/kit/shell-store';
|
|
19
|
+
import type { HistoryCommandSnapshot, HistoryCommands } from '@volter/sdk/kit/history/history-commands';
|
|
20
|
+
import { editorKeymaps, setEditorKeymapPreference, shortcutFor } from '@volter/sdk/kit/keymap-presets';
|
|
21
|
+
import { openUndoHistory } from './workspace-aux-commands';
|
|
22
|
+
import { CORE_WORKSPACE_UTILITIES } from '@volter/sdk/kit/workspace-core-utilities';
|
|
23
|
+
import {
|
|
24
|
+
showWorkspaceStaticPanel,
|
|
25
|
+
showWorkspaceUtility,
|
|
26
|
+
toggleWorkspaceFocus,
|
|
27
|
+
} from '@volter/sdk/kit/workspace-host-commands';
|
|
28
|
+
import {
|
|
29
|
+
cycleEditorWorkspace,
|
|
30
|
+
editorWorkspaces,
|
|
31
|
+
setEditorWorkspace,
|
|
32
|
+
workspaceApplies,
|
|
33
|
+
} from './workspace-presets';
|
|
34
|
+
import { applyWorkspaceStyle, workspaceStyles } from './workspace-style';
|
|
35
|
+
import { toggleConsoleUtility } from '@volter/sdk/kit/workspace-utility-commands';
|
|
36
|
+
|
|
37
|
+
export interface EditorAction {
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
category: 'action' | 'entity' | 'asset';
|
|
41
|
+
/**
|
|
42
|
+
* The printed hint, resolved from the ACTIVE keymap (`keymap-presets.ts`)
|
|
43
|
+
* rather than spelled here — so the palette tells the truth under `blender`
|
|
44
|
+
* as well as `volter`. Explicitly `| undefined` because a keymap may leave an
|
|
45
|
+
* action deliberately unbound, and printing a stale key would be worse than
|
|
46
|
+
* printing none.
|
|
47
|
+
*/
|
|
48
|
+
shortcut?: string | undefined;
|
|
49
|
+
execute: () => void | Promise<void>;
|
|
50
|
+
/** The application menu this action is an item of (a package's `workspace.menu`), and its
|
|
51
|
+
* label THERE — the palette's label names the menu, the menu's does not. */
|
|
52
|
+
menu?: { readonly id: string; readonly label: string } | undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Build the static list of editor command actions. */
|
|
56
|
+
export function buildStaticActions(
|
|
57
|
+
store: ShellStore,
|
|
58
|
+
history: HistoryCommands,
|
|
59
|
+
historySnapshot?: HistoryCommandSnapshot,
|
|
60
|
+
): EditorAction[] {
|
|
61
|
+
const isMac = navigator.platform.includes('Mac');
|
|
62
|
+
const mod = isMac ? '\u2318' : 'Ctrl+';
|
|
63
|
+
const authoring = getActiveAuthoring(store);
|
|
64
|
+
const clipboardIds = [...store.selectedEntityIds];
|
|
65
|
+
const selectedId = clipboardIds[0];
|
|
66
|
+
const pasteParentId = selectedId
|
|
67
|
+
? (authoring.hierarchy.node(selectedId)?.parentId ?? null)
|
|
68
|
+
: null;
|
|
69
|
+
const canCopy =
|
|
70
|
+
clipboardIds.length > 0 &&
|
|
71
|
+
!!authoring.structure?.copy &&
|
|
72
|
+
(authoring.structure.canCopy?.(clipboardIds) ?? true);
|
|
73
|
+
const canCut = canCopy && !!authoring.structure?.cut;
|
|
74
|
+
const canPaste =
|
|
75
|
+
!!authoring.structure?.paste && (authoring.structure.canPaste?.(pasteParentId) ?? true);
|
|
76
|
+
const clipboardActions: EditorAction[] = [
|
|
77
|
+
...(canCut
|
|
78
|
+
? [
|
|
79
|
+
{
|
|
80
|
+
id: 'editor.cut',
|
|
81
|
+
label: 'Cut',
|
|
82
|
+
category: 'action' as const,
|
|
83
|
+
shortcut: shortcutFor('edit.cut'),
|
|
84
|
+
execute: () => cutSelection(store),
|
|
85
|
+
},
|
|
86
|
+
]
|
|
87
|
+
: []),
|
|
88
|
+
...(canCopy
|
|
89
|
+
? [
|
|
90
|
+
{
|
|
91
|
+
id: 'editor.copy',
|
|
92
|
+
label: 'Copy',
|
|
93
|
+
category: 'action' as const,
|
|
94
|
+
shortcut: shortcutFor('edit.copy'),
|
|
95
|
+
execute: () => copySelection(store),
|
|
96
|
+
},
|
|
97
|
+
]
|
|
98
|
+
: []),
|
|
99
|
+
...(canPaste
|
|
100
|
+
? [
|
|
101
|
+
{
|
|
102
|
+
id: 'editor.paste',
|
|
103
|
+
label: 'Paste',
|
|
104
|
+
category: 'action' as const,
|
|
105
|
+
shortcut: shortcutFor('edit.paste'),
|
|
106
|
+
execute: () => pasteSelection(store),
|
|
107
|
+
},
|
|
108
|
+
]
|
|
109
|
+
: []),
|
|
110
|
+
];
|
|
111
|
+
return [
|
|
112
|
+
{
|
|
113
|
+
id: 'account.open',
|
|
114
|
+
label: 'Account and Provider Connections',
|
|
115
|
+
category: 'action',
|
|
116
|
+
execute: () => {
|
|
117
|
+
openAccountDocument();
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'editor.undo',
|
|
122
|
+
label: historySnapshot?.undoLabel ? `Undo ${historySnapshot.undoLabel}` : 'Undo',
|
|
123
|
+
category: 'action',
|
|
124
|
+
shortcut: shortcutFor('edit.undo'),
|
|
125
|
+
// H2: shell actions use the project-scoped command service. Its temporary
|
|
126
|
+
// compatibility bridge preserves chronology with producers not yet migrated.
|
|
127
|
+
execute: async () => {
|
|
128
|
+
await history.undo();
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 'editor.redo',
|
|
133
|
+
label: historySnapshot?.redoLabel ? `Redo ${historySnapshot.redoLabel}` : 'Redo',
|
|
134
|
+
category: 'action',
|
|
135
|
+
shortcut: shortcutFor('edit.redo'),
|
|
136
|
+
execute: async () => {
|
|
137
|
+
await history.redo();
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
...clipboardActions,
|
|
141
|
+
{
|
|
142
|
+
id: 'editor.duplicate',
|
|
143
|
+
label: 'Duplicate',
|
|
144
|
+
category: 'action',
|
|
145
|
+
shortcut: shortcutFor('edit.duplicate'),
|
|
146
|
+
execute: () => duplicateSelection(store),
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'editor.delete',
|
|
150
|
+
label: 'Delete Selected',
|
|
151
|
+
category: 'action',
|
|
152
|
+
shortcut: shortcutFor('edit.delete'),
|
|
153
|
+
execute: () => deleteSelection(store),
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 'editor.select-all',
|
|
157
|
+
label: 'Select All',
|
|
158
|
+
category: 'action',
|
|
159
|
+
shortcut: shortcutFor('edit.selectAll'),
|
|
160
|
+
execute: () => selectAllAuthoringNodes(store),
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: 'editor.deselect',
|
|
164
|
+
label: 'Deselect All',
|
|
165
|
+
category: 'action',
|
|
166
|
+
shortcut: shortcutFor('edit.deselectAll') ?? shortcutFor('edit.exitScopeOrDeselect'),
|
|
167
|
+
execute: () => selectAuthoringNodes(store, []),
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
id: 'toggle.console',
|
|
171
|
+
label: 'Toggle Console',
|
|
172
|
+
category: 'action',
|
|
173
|
+
shortcut: shortcutFor('view.toggleConsole'),
|
|
174
|
+
execute: () => {
|
|
175
|
+
toggleConsoleUtility();
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 'view.focusMode',
|
|
180
|
+
label: 'Toggle Focus Mode',
|
|
181
|
+
category: 'action',
|
|
182
|
+
shortcut: shortcutFor('view.focusMode'),
|
|
183
|
+
execute: () => {
|
|
184
|
+
toggleWorkspaceFocus();
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
// NAMED WORKSPACES (ARCHITECTURE-CORE §Editor chrome): one action per
|
|
188
|
+
// registered workspace, plus the cycle pair. The ruling calls for these to
|
|
189
|
+
// be palette-ready, which is exactly what this registry is — a seventh
|
|
190
|
+
// workspace would appear here on its own.
|
|
191
|
+
...editorWorkspaces().map(
|
|
192
|
+
(choice): EditorAction => ({
|
|
193
|
+
id: `workspace.${choice.id}`,
|
|
194
|
+
label: `Workspace: ${choice.title}`,
|
|
195
|
+
category: 'action',
|
|
196
|
+
execute: () => {
|
|
197
|
+
// A workspace the project's declared shape does not meet is not a
|
|
198
|
+
// destination (ARCHITECTURE-CORE §Roots).
|
|
199
|
+
if (workspaceApplies(choice.id)) setEditorWorkspace(choice.id);
|
|
200
|
+
},
|
|
201
|
+
}),
|
|
202
|
+
),
|
|
203
|
+
{
|
|
204
|
+
id: 'workspace.cycleNext',
|
|
205
|
+
label: 'Next Workspace',
|
|
206
|
+
category: 'action',
|
|
207
|
+
// Blender's own workspace cycle keys, and free in this registry.
|
|
208
|
+
shortcut: shortcutFor('workspace.cycleNext'),
|
|
209
|
+
execute: () => {
|
|
210
|
+
cycleEditorWorkspace(1);
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: 'workspace.cyclePrevious',
|
|
215
|
+
label: 'Previous Workspace',
|
|
216
|
+
category: 'action',
|
|
217
|
+
shortcut: shortcutFor('workspace.cyclePrevious'),
|
|
218
|
+
execute: () => {
|
|
219
|
+
cycleEditorWorkspace(-1);
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
// KEYMAPS (ARCHITECTURE-CORE §Editor chrome: "Keymaps are orthogonal to
|
|
223
|
+
// workspaces"). One action per registered keymap, exactly as the workspace
|
|
224
|
+
// axis above — orthogonal to it, and the switch is live.
|
|
225
|
+
...editorKeymaps().map(
|
|
226
|
+
(choice): EditorAction => ({
|
|
227
|
+
id: `keymap.${choice.id}`,
|
|
228
|
+
label: `Keymap: ${choice.title}`,
|
|
229
|
+
category: 'action',
|
|
230
|
+
execute: () => {
|
|
231
|
+
setEditorKeymapPreference(choice.id);
|
|
232
|
+
},
|
|
233
|
+
}),
|
|
234
|
+
),
|
|
235
|
+
// Workspace style bundles (Glass-UI spike, Unit 3): one action per named
|
|
236
|
+
// palette+material+icons+regions bundle — a third bundle appears here
|
|
237
|
+
// automatically.
|
|
238
|
+
...workspaceStyles().map(
|
|
239
|
+
(choice): EditorAction => ({
|
|
240
|
+
id: `view.workspaceStyle.${choice.id}`,
|
|
241
|
+
label: `Workspace Style: ${choice.title}`,
|
|
242
|
+
category: 'action',
|
|
243
|
+
execute: () => {
|
|
244
|
+
applyWorkspaceStyle(choice.id);
|
|
245
|
+
},
|
|
246
|
+
}),
|
|
247
|
+
),
|
|
248
|
+
{
|
|
249
|
+
id: 'view.undoHistory',
|
|
250
|
+
label: 'Undo History',
|
|
251
|
+
category: 'action',
|
|
252
|
+
execute: () => {
|
|
253
|
+
// Undo History is an on-demand panel, not a permanent tab. The host
|
|
254
|
+
// defaults it beside Inspector but preserves a user's later move.
|
|
255
|
+
// §8 naming: 'Undo History', not 'History'.
|
|
256
|
+
openUndoHistory();
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: 'view.lightExplorer',
|
|
261
|
+
label: 'Open Light Explorer',
|
|
262
|
+
category: 'action',
|
|
263
|
+
execute: () => showWorkspaceUtility(CORE_WORKSPACE_UTILITIES.lightExplorer.id),
|
|
264
|
+
},
|
|
265
|
+
...Object.values(PROJECT_ASSET_COMMANDS)
|
|
266
|
+
.filter((command) => command.id !== PROJECT_ASSET_COMMANDS.open.id)
|
|
267
|
+
.map((command) => ({
|
|
268
|
+
id: command.id,
|
|
269
|
+
label: `${command.id
|
|
270
|
+
.replace('project-asset.', '')
|
|
271
|
+
.split('-')
|
|
272
|
+
.map((part) => part[0]?.toUpperCase() + part.slice(1))
|
|
273
|
+
.join(' ')} Project Asset`,
|
|
274
|
+
category: 'asset' as const,
|
|
275
|
+
...(command.shortcut ? { shortcut: command.shortcut.replace('Mod', mod) } : {}),
|
|
276
|
+
execute: () => {
|
|
277
|
+
window.dispatchEvent(
|
|
278
|
+
new CustomEvent('editor:project-asset-command', { detail: { id: command.id } }),
|
|
279
|
+
);
|
|
280
|
+
},
|
|
281
|
+
})),
|
|
282
|
+
{
|
|
283
|
+
// Content and Library are permanent peer navigators; individual
|
|
284
|
+
// results open as center asset documents.
|
|
285
|
+
id: 'view.asset-library',
|
|
286
|
+
label: 'Asset Library',
|
|
287
|
+
category: 'action' as const,
|
|
288
|
+
execute: () => {
|
|
289
|
+
showWorkspaceStaticPanel('asset-library');
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** Build dynamic node actions from the active authoring adapter's hierarchy.
|
|
296
|
+
*
|
|
297
|
+
* THE NO-AUTHORING FLOOR IS A MESSAGE, NOT AN ENTITY. `makeNoAuthoringAdapter`
|
|
298
|
+
* publishes one `role: 'boundary'` row so the panels can say "no authoring
|
|
299
|
+
* surface" honestly; mapping it like a node put a command literally called
|
|
300
|
+
* **Volter Entity: No authoring adapter** in the palette, whose whole effect is
|
|
301
|
+
* to select and focus nothing (measured under the frame on a Model document,
|
|
302
|
+
* U8 walk 3, 2026-09-20). */
|
|
303
|
+
export function buildEntityActions(store: ShellStore): EditorAction[] {
|
|
304
|
+
return activeHierarchyRows(store)
|
|
305
|
+
.filter((row) => row.id !== NO_AUTHORING_ID)
|
|
306
|
+
.map((row) => ({
|
|
307
|
+
id: `entity:${row.id}`,
|
|
308
|
+
label: row.name,
|
|
309
|
+
category: 'entity' as const,
|
|
310
|
+
// Going to an entity is selecting it and framing the selection on the
|
|
311
|
+
// focused stage, which answers `viewport.frameSelection` if it has a camera.
|
|
312
|
+
execute: () => {
|
|
313
|
+
selectAuthoringNodes(store, [row.id]);
|
|
314
|
+
invokeKeyAction('viewport.frameSelection');
|
|
315
|
+
},
|
|
316
|
+
}));
|
|
317
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHICH PRODUCT THIS PAGE IS — set once, by the product's own entry module,
|
|
3
|
+
* before anything mounts.
|
|
4
|
+
*
|
|
5
|
+
* A product is the last mile: thin code that stitches packages onto the kit and
|
|
6
|
+
* holds only purpose-specific choices (ARCHITECTURE-CORE §The target shape).
|
|
7
|
+
* `@volter/game-editor` and `@volter/cyclotron` each have ONE source entry which
|
|
8
|
+
* IS that product's frame entry, and the first thing it does is call
|
|
9
|
+
* `product({ … })` (`frame/product.ts`), which lands here.
|
|
10
|
+
*
|
|
11
|
+
* THE KIT KNOWS NO PRODUCT BY NAME (rule 1). This module holds a record it was
|
|
12
|
+
* HANDED and never a table of products; the two readers below ask it for a
|
|
13
|
+
* default and fall back to their own when there is none, so the host still
|
|
14
|
+
* stands up with no product at all (a Storybook page, a measurement of one
|
|
15
|
+
* surface). What it is NOT is a switch on which product is open (rule 4): a
|
|
16
|
+
* product is the running program, and this is that program telling the kit what
|
|
17
|
+
* it composed, not the kit choosing between compositions.
|
|
18
|
+
*
|
|
19
|
+
* Its two readers, both defaults and both outranked by anything the person or
|
|
20
|
+
* the project said:
|
|
21
|
+
* - `workspace-style.ts` resolves {@link ActiveProduct.look} to a style
|
|
22
|
+
* bundle and makes its palette/material/icons the editor's DEFAULT
|
|
23
|
+
* appearance, beneath `~/.volter/settings.json`, the project's own
|
|
24
|
+
* `.volter/settings.json` and the adapter's declaration;
|
|
25
|
+
* - `workspace-presets.ts` uses {@link ActiveProduct.workspace} as the
|
|
26
|
+
* workspace a project opens in when this checkout has none recorded and the
|
|
27
|
+
* adapter declares none.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** What a product's entry composed, as the kit reads it. */
|
|
31
|
+
export interface ActiveProduct {
|
|
32
|
+
/** The product's id — `game-editor`, `cyclotron`. Reported by the session
|
|
33
|
+
* beside the workbench (the editor's `status` command), never read as a branch. */
|
|
34
|
+
readonly id: string;
|
|
35
|
+
/** The packages it mounts, by name, in composition order. The contributions
|
|
36
|
+
* themselves are already in the bundle (`tool-loader.ts`); this is the list
|
|
37
|
+
* for anything that needs to SAY what is installed. */
|
|
38
|
+
readonly packages: readonly string[];
|
|
39
|
+
/** The style bundle id this product wears by default (`workspace-style.ts`). */
|
|
40
|
+
readonly look: string;
|
|
41
|
+
/** The workspace it opens in by default (`workspace-presets.ts`). */
|
|
42
|
+
readonly workspace: string;
|
|
43
|
+
/** Use the workbench application menu instead of a second product menu. */
|
|
44
|
+
readonly nativeMenus?: boolean | undefined;
|
|
45
|
+
/** The product's own logo URL; the kit shows its own when absent. */
|
|
46
|
+
readonly logo?: string | undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let _product: ActiveProduct | null = null;
|
|
50
|
+
const listeners = new Set<() => void>();
|
|
51
|
+
|
|
52
|
+
/** The composed product, or `null` on a surface no product stood up. */
|
|
53
|
+
export function activeProduct(): ActiveProduct | null {
|
|
54
|
+
return _product;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Record the composition. Called once, by the product's entry, at module scope
|
|
59
|
+
* — so every default below is in force before the first module that reads one.
|
|
60
|
+
* A second call with a different id is a page with two products in it, which is
|
|
61
|
+
* the one thing this record cannot be honest about.
|
|
62
|
+
*/
|
|
63
|
+
export function setActiveProduct(next: ActiveProduct): void {
|
|
64
|
+
if (_product !== null && _product.id !== next.id)
|
|
65
|
+
throw new Error(
|
|
66
|
+
`Two products in one page: "${_product.id}" is already composed and "${next.id}" asked to be. ` +
|
|
67
|
+
'A product is the running program; one page runs one.',
|
|
68
|
+
);
|
|
69
|
+
_product = next;
|
|
70
|
+
for (const listener of listeners) listener();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function subscribeActiveProduct(listener: () => void): () => void {
|
|
74
|
+
listeners.add(listener);
|
|
75
|
+
return () => listeners.delete(listener);
|
|
76
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE ACTIVE PROJECT — the one store every surface reads the open project
|
|
3
|
+
* from, and nothing else. Split out of `project-manager.ts` so a host that
|
|
4
|
+
* only needs to know WHICH project is open (a bounded host, the
|
|
5
|
+
* contribution loader) does not carry the server boot path — the launcher,
|
|
6
|
+
* the server-project probe, the recent-projects list — and the server-SDK
|
|
7
|
+
* barrel those import. `project-manager.ts` re-exports everything here, so
|
|
8
|
+
* its importers are unchanged; a surface below the shell imports THIS file.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { LearnMetadata } from '@volter/project/manifest/schema';
|
|
12
|
+
import type { HierarchyProjection } from '@volter/sdk/kit/hierarchy-projection';
|
|
13
|
+
|
|
14
|
+
/** One `run[]` declaration as the manifest carries it: the envelope plus the
|
|
15
|
+
* kind's own fields (spelled here, not imported, so a bounded host's closure
|
|
16
|
+
* stays free of the engine's kind registry). */
|
|
17
|
+
export interface ConfigurationDeclaration {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly kind: string;
|
|
20
|
+
readonly [param: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ProjectConfig {
|
|
24
|
+
/** Project-file schema version. Kept distinct from game and engine versions. */
|
|
25
|
+
manifestVersion: 2;
|
|
26
|
+
name: string;
|
|
27
|
+
/** The authored game's own release version. */
|
|
28
|
+
version: string;
|
|
29
|
+
/** Exact engine identity the project is pinned to. */
|
|
30
|
+
engine: { version: string };
|
|
31
|
+
/** Editor-only organization. It never changes which runtime roots mount. */
|
|
32
|
+
authoring?: { hierarchy?: HierarchyProjection | undefined } | undefined;
|
|
33
|
+
resolution?: { width: number; height: number } | undefined;
|
|
34
|
+
appId?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Multiplayer server config from the manifest (`server.room` — the Colyseus
|
|
37
|
+
* room this game registers), if declared. Carried here so edit-mode
|
|
38
|
+
* networking can answer "does this project declare a server" from the
|
|
39
|
+
* already-parsed manifest, NOT by re-reading `volter.project.json` through the
|
|
40
|
+
* asset-scoped `StorageBackend.read` (which resolves under `public/` and so
|
|
41
|
+
* returns the SPA fallback for a root manifest — the bug that left the
|
|
42
|
+
* player-count picker hidden on the local dev server).
|
|
43
|
+
*/
|
|
44
|
+
/** The manifest's run configurations (ARCHITECTURE-CORE §The project model). */
|
|
45
|
+
configurations?: readonly ConfigurationDeclaration[] | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Derived from the manifest roots. `false` means the editor must not
|
|
48
|
+
* fabricate its native Three scene document for this project. Optional
|
|
49
|
+
* only for legacy callers/tests; current project readers always provide it.
|
|
50
|
+
*/
|
|
51
|
+
hasThreeRoot?: boolean | undefined;
|
|
52
|
+
/** How many roots the manifest declares — what MOUNTS. Zero is a real
|
|
53
|
+
* shape (ARCHITECTURE-CORE §Roots): the chrome that only means something
|
|
54
|
+
* for a running world (transport, instances, play state, analytics) is
|
|
55
|
+
* derived from this, never from a project kind. */
|
|
56
|
+
rootCount?: number | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* The project's default scene path, or `null` when the manifest's first
|
|
59
|
+
* world declares no scene (e.g. an `entry`-only world — §7.1-12). Always
|
|
60
|
+
* present when derived from the manifest (`readProjectView`, server-side).
|
|
61
|
+
* Consumers must NOT default a missing/null value to a guessed path: a
|
|
62
|
+
* guess resolves to a file nobody declared, and writing to it silently
|
|
63
|
+
* creates a placeholder the project never asked for.
|
|
64
|
+
*/
|
|
65
|
+
defaultScene?: string | null | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* FT-5 learner-facing metadata from the manifest's `learn` block. Carried
|
|
68
|
+
* for BUNDLED EXAMPLES opened read-only in the hosted editor so the shell
|
|
69
|
+
* can offer the example's Learn-site lesson ("This example has a lesson →",
|
|
70
|
+
* G6); absent everywhere else.
|
|
71
|
+
*/
|
|
72
|
+
learn?: LearnMetadata | undefined;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ActiveProject {
|
|
76
|
+
/** Absolute path to the project root (as passed via URL param / env). */
|
|
77
|
+
rootPath: string;
|
|
78
|
+
/** Parsed volter.project.json project configuration plus derived editor fields. */
|
|
79
|
+
config: ProjectConfig;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let _activeProject: ActiveProject | null = null;
|
|
83
|
+
const _listeners = new Set<() => void>();
|
|
84
|
+
|
|
85
|
+
function _notify(): void {
|
|
86
|
+
for (const fn of _listeners) fn();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Set or clear the active project directly (project screen and bounded hosts).
|
|
91
|
+
*
|
|
92
|
+
* This is also where a project SESSION ends: switching to a different project
|
|
93
|
+
* without a page reload is a real path (the project screen's five open sites),
|
|
94
|
+
* and the editor's module-level session singletons do not reset themselves on
|
|
95
|
+
* it. Anything that must not outlive the previous project registers with
|
|
96
|
+
* {@link onProjectSessionEnd} — see `project-session-reset.ts`, the one
|
|
97
|
+
* subscriber, for the list.
|
|
98
|
+
*/
|
|
99
|
+
export function setActiveProject(project: ActiveProject | null): void {
|
|
100
|
+
const previous = _activeProject;
|
|
101
|
+
_activeProject = project;
|
|
102
|
+
// Only a genuine CHANGE of project ends a session: re-setting the same
|
|
103
|
+
// project (a config refresh after a manifest save) is not a switch, and
|
|
104
|
+
// resetting session state under it would drop a live mount for nothing.
|
|
105
|
+
if (previous && previous.rootPath !== project?.rootPath) {
|
|
106
|
+
for (const fn of _sessionEndListeners) fn();
|
|
107
|
+
}
|
|
108
|
+
_notify();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The boot/open path's own assignment: install the project just resolved
|
|
113
|
+
* WITHOUT the session-end notice — a session ends on a SWITCH
|
|
114
|
+
* ({@link setActiveProject}); resolving a project at boot or re-reading its
|
|
115
|
+
* manifest is not one. Same notify as the setter.
|
|
116
|
+
*/
|
|
117
|
+
export function assignActiveProject(project: ActiveProject): ActiveProject {
|
|
118
|
+
_activeProject = project;
|
|
119
|
+
_notify();
|
|
120
|
+
return project;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Get the currently open project, or null if none. */
|
|
124
|
+
export function getCurrentProject(): ActiveProject | null {
|
|
125
|
+
return _activeProject;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Subscribe to project changes. Returns unsubscribe function. */
|
|
129
|
+
export function onProjectChange(fn: () => void): () => void {
|
|
130
|
+
_listeners.add(fn);
|
|
131
|
+
return () => _listeners.delete(fn);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const _sessionEndListeners = new Set<() => void>();
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Subscribe to the END of a project session — fired by {@link setActiveProject}
|
|
138
|
+
* when a DIFFERENT project (or none) takes over.
|
|
139
|
+
*
|
|
140
|
+
* The sibling of {@link onProjectChange}, and deliberately not the same hook:
|
|
141
|
+
* `onProjectChange` means "re-derive against whatever project is open now" and
|
|
142
|
+
* fires for every notify, while this one means "the previous project's live
|
|
143
|
+
* state is over, drop it". Nothing but `project-session-reset.ts` subscribes;
|
|
144
|
+
* add a reset there rather than a second subscriber here.
|
|
145
|
+
*/
|
|
146
|
+
export function onProjectSessionEnd(fn: () => void): () => void {
|
|
147
|
+
_sessionEndListeners.add(fn);
|
|
148
|
+
return () => _sessionEndListeners.delete(fn);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** The identity every per-project cache keys on: the open project's folder,
|
|
152
|
+
* and a fixed unscoped key when no project is active. */
|
|
153
|
+
export function activeProjectKey(): string {
|
|
154
|
+
return getCurrentProject()?.rootPath ?? '__unscoped__';
|
|
155
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AdapterEditorConfiguration } from '@volter/project/adapter/adapter-module';
|
|
2
|
+
import { activeProjectKey } from '@volter/sdk/kit/active-project';
|
|
3
|
+
|
|
4
|
+
// Published by the adapter loader; consumers need no dependency on its module graph.
|
|
5
|
+
let configuration: AdapterEditorConfiguration = {};
|
|
6
|
+
let owner: string | null = null;
|
|
7
|
+
const EMPTY: AdapterEditorConfiguration = Object.freeze({});
|
|
8
|
+
const listeners = new Set<() => void>();
|
|
9
|
+
|
|
10
|
+
export function adapterEditorConfiguration(): AdapterEditorConfiguration {
|
|
11
|
+
return owner !== null && owner === activeProjectKey() ? configuration : EMPTY;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function setAdapterEditorConfiguration(value: AdapterEditorConfiguration = {}): void {
|
|
15
|
+
owner = activeProjectKey();
|
|
16
|
+
configuration = value;
|
|
17
|
+
for (const listener of listeners) listener();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function subscribeAdapterEditorConfiguration(listener: () => void): () => void {
|
|
21
|
+
listeners.add(listener);
|
|
22
|
+
return () => {
|
|
23
|
+
listeners.delete(listener);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The game's adapter module lives beside `volter.project.json`, by contract.
|
|
2
|
+
*
|
|
3
|
+
* IN A MODULE OF ITS OWN, with no imports, because the CLI reads it: the launcher's adapter check
|
|
4
|
+
* (`editor-core/server/project-adapter-required.ts`) imported it from `ui-source/adapter-region-includes`,
|
|
5
|
+
* which imports `typescript`, and the CLI bundle then carried TypeScript and died on start
|
|
6
|
+
* ("Dynamic require of "fs" is not supported"). */
|
|
7
|
+
export const ADAPTER_MODULE_FILENAME = 'editor/volter.adapter.ts';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE LOADED ADAPTER'S OBSERVATION DECLARATIONS, held host-side with their
|
|
3
|
+
* closures intact.
|
|
4
|
+
*
|
|
5
|
+
* Pushed rather than pulled, for exactly the reason `presentation-surface.ts`
|
|
6
|
+
* is: the reader is an ingest MOUNT, and having the mount import
|
|
7
|
+
* `project-adapter.ts` would drag the whole loader graph (the finder namespace,
|
|
8
|
+
* the manifest fetchers, the story registry) into the mount's module closure.
|
|
9
|
+
* `project-adapter.ts` stays the one place the table is decided; this is the
|
|
10
|
+
* one place the part that cannot travel over the wire is kept.
|
|
11
|
+
*
|
|
12
|
+
* "Cannot travel" is the whole reason this module exists separately from the
|
|
13
|
+
* `/__editor/state` facet. A declaration's `answer` is a CLOSURE evaluated
|
|
14
|
+
* against the mounted game, so the facet publishes only the statically readable
|
|
15
|
+
* half — id, kind, and whether an answer is bound — while the closures stay
|
|
16
|
+
* here, in the host realm, reachable by the mount that has a game to evaluate
|
|
17
|
+
* them against.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import type {
|
|
21
|
+
AdapterInputBinding,
|
|
22
|
+
ObservationDeclaration,
|
|
23
|
+
} from '@volter/project/adapter/adapter-module';
|
|
24
|
+
|
|
25
|
+
let _declarations: readonly ObservationDeclaration[] = [];
|
|
26
|
+
let _input: AdapterInputBinding | null = null;
|
|
27
|
+
|
|
28
|
+
/** Written by `project-adapter.ts` on every load — including with `[]`, so a
|
|
29
|
+
* project switch cannot leave the previous game's closures reachable. */
|
|
30
|
+
export function setAdapterObservations(declarations: readonly ObservationDeclaration[]): void {
|
|
31
|
+
_declarations = declarations;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** What the loaded adapter declares. Empty before the first load, and for a
|
|
35
|
+
* project whose adapter declares none — both are "nothing to project", which
|
|
36
|
+
* is the only distinction a mount needs. */
|
|
37
|
+
export function adapterObservations(): readonly ObservationDeclaration[] {
|
|
38
|
+
return _declarations;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The loaded adapter's app-owned input binding, or `null` when it declares none. */
|
|
42
|
+
export function adapterInputBinding(): AdapterInputBinding | null {
|
|
43
|
+
return _input;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Written beside {@link setAdapterObservations} on every project load. */
|
|
47
|
+
export function setAdapterInputBinding(binding: AdapterInputBinding | null): void {
|
|
48
|
+
_input = binding;
|
|
49
|
+
}
|