@volter/editor-game 0.5.65 → 0.5.67
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/contributions/audio-unlock.service.ts +2 -2
- package/contributions/autoplay.service.ts +1 -1
- package/contributions/bridge.command.ts +3 -3
- package/contributions/canvas/component-board.service.ts +16 -0
- package/contributions/canvas/design-time-mount.service.ts +45 -0
- package/contributions/canvas-story-capture.service.ts +12 -0
- package/contributions/edit-mode-audio.service.ts +2 -2
- package/contributions/edit-mode-networking.service.ts +1 -1
- package/contributions/gameplay.command.ts +4 -4
- package/contributions/generation.service.ts +3 -3
- package/contributions/generations.status.tsx +1 -1
- package/contributions/godot.palette.json +99 -0
- package/contributions/godot.style.ts +82 -0
- package/contributions/godot.view.ts +75 -0
- package/contributions/ingest.service.ts +4 -4
- package/contributions/instances.command.ts +1 -1
- package/contributions/navmesh.menu.ts +1 -1
- package/contributions/network-observer.service.ts +14 -0
- package/contributions/play.command.ts +11 -5
- package/contributions/react/component-board.service.ts +1 -1
- package/contributions/react/design-time-mount.service.ts +1 -1
- package/contributions/react/react-inspector.service.ts +2 -2
- package/contributions/scene-document.service.ts +5 -5
- package/contributions/state-watch.menu.ts +1 -1
- package/contributions/state-watch.utility.tsx +1 -1
- package/contributions/team-playtest.service.ts +4 -4
- package/contributions/three/component-board.service.ts +1 -1
- package/contributions/three/component-verbs.command.ts +8 -8
- package/contributions/three/three-authoring.service.ts +8 -5
- package/contributions/three-story-capture.service.ts +12 -0
- package/contributions/unity.palette.json +102 -0
- package/contributions/unity.style.ts +72 -0
- package/contributions/unity.view.ts +82 -0
- package/contributions/unreal.palette.json +105 -0
- package/contributions/unreal.style.ts +66 -0
- package/contributions/unreal.view.ts +93 -0
- package/dist-node/serving.mjs +16 -0
- package/package.json +33 -16
- package/serving/index.ts +27 -0
- package/src/asset-budget/AssetBudgetPanel.tsx +1 -1
- package/src/asset-budget/asset-budget-model.ts +4 -4
- package/src/asset-budget/optimize-apply.ts +7 -7
- package/src/audio/AudioDebuggerPanel.tsx +1 -1
- package/src/bridge/dispatch.ts +16 -16
- package/src/bridge/live-frames.ts +1 -1
- package/src/bridge/screenshot.ts +6 -6
- package/src/build/BuildProfilesPanel.tsx +3 -3
- package/src/canvas/canvas-board/CanvasBoardDocument.tsx +676 -0
- package/src/canvas/canvas-board/canvas-board-model.ts +407 -0
- package/src/canvas/canvas-board/canvas-component-board.ts +56 -0
- package/src/canvas/canvas-design-mount.ts +524 -0
- package/src/canvas/design-time-canvas-mount.ts +79 -0
- package/src/coverage/live-authoring-surface.ts +6 -6
- package/src/coverage/live-project-verbs.ts +2 -2
- package/src/coverage/native-system-coverage.ts +6 -6
- package/src/coverage/root-coverage.ts +1 -1
- package/src/coverage/session-coverage.ts +5 -5
- package/src/design-system-stories/ApplicationChrome.stories.tsx +5 -5
- package/src/design-system-stories/InspectorNarrowBodies.stories.tsx +13 -53
- package/src/edit-mode/edit-mode-audio.ts +4 -4
- package/src/edit-mode/edit-mode-networking.ts +2 -2
- package/src/game-document/GameCaptureFrameButton.tsx +2 -2
- package/src/game-document/GameDocument.tsx +2 -2
- package/src/game-document/GamePanel.tsx +8 -8
- package/src/game-document/InstanceInspectorPicker.tsx +2 -2
- package/src/game-document/crowd-debug.ts +1 -1
- package/src/game-document/device-preview.ts +10 -11
- package/src/game-document/physics-debug.ts +1 -1
- package/src/generation/GenerationActivity.tsx +6 -8
- package/src/generation/generation-documents.tsx +8 -8
- package/src/generation/generation-jobs.ts +2 -2
- package/src/generation/generation-presentation.ts +1 -1
- package/src/host/adapter-reach.ts +1 -1
- package/src/host/adapter-runtime-bindings.ts +97 -6
- package/src/host/api/configurations.ts +2 -2
- package/src/host/authoring/babylon-authoring-adapter.ts +8 -8
- package/src/host/authoring/contract-hierarchy-authoring.ts +1 -1
- package/src/host/authoring/contract-scenes-stories.ts +1 -1
- package/src/host/authoring/creation-site-related.ts +2 -2
- package/src/host/authoring/ephemeral-persistence.ts +1 -1
- package/src/host/authoring/gesture-persist.ts +2 -2
- package/src/host/authoring/ingest-data-writer.ts +1 -1
- package/src/host/authoring/ingest-source-persistence.ts +8 -8
- package/src/host/authoring/mount-isolated-pixi-screen.ts +1 -1
- package/src/host/authoring/mounted-authoring.ts +4 -4
- package/src/host/authoring/phaser-live-authoring-adapter.ts +4 -4
- package/src/host/authoring/pixi-authoring-adapter.ts +42 -17
- package/src/host/authoring/pixi-creation-site-write-target.ts +2 -2
- package/src/host/authoring/pixi-live-write-target.ts +7 -7
- package/src/host/authoring/pixi-source-identity.ts +3 -3
- package/src/host/authoring/pixi-source-write-target.ts +1614 -0
- package/src/host/authoring/pixi-still-presentation.ts +2 -2
- package/src/host/authoring/pixi-structure-history.ts +3 -3
- package/src/host/authoring/pixi-transform-channels.ts +16 -14
- package/src/host/authoring/source-persistence-backend.ts +6 -6
- package/src/host/authoring/struct-write-pipe.ts +3 -3
- package/src/host/binding-resolver.ts +8 -9
- package/src/host/browser-transpile.ts +2 -2
- package/src/host/canvas-entry-runtime.ts +59 -48
- package/src/host/canvas-preview-frames.ts +482 -0
- package/src/host/components/CameraAuthoringOverlay.tsx +1 -1
- package/src/host/components/HeaderTelemetry.tsx +9 -16
- package/src/host/components/PixiIsolationSceneContent.tsx +17 -16
- package/src/host/components/ThreeIsolationSceneContent.tsx +5 -5
- package/src/host/components/frame-debugger-model.ts +2 -2
- package/src/host/components/header-telemetry-model.ts +2 -2
- package/src/host/components/scene-document.tsx +29 -61
- package/src/host/components/utility-view-state.ts +1 -1
- package/src/host/components/world-root-stage-binding.tsx +17 -26
- package/src/host/components/world-root-stage.ts +130 -63
- package/src/host/coverage/capability-coverage.ts +13 -1
- package/src/host/coverage/game-contract-seam-evidence.ts +1 -1
- package/src/host/coverage/project-verb-coverage.ts +2 -17
- package/src/host/coverage/system-adapter-coverage.ts +4 -5
- package/src/host/design-system-stories/fixtures/editor-runtime.tsx +14 -8
- package/src/host/document-preview-three.ts +2 -2
- package/src/host/entry-adjudication.ts +6 -6
- package/src/host/game-css-scope-transform.ts +4 -0
- package/src/host/game-module-access.ts +1 -1
- package/src/host/game-realm-page.ts +16 -8
- package/src/host/game-realm-reclaim.ts +1 -1
- package/src/host/gameplay-export.ts +25 -14
- package/src/host/gameplay-recording.ts +5 -5
- package/src/host/gated-globals.ts +6 -6
- package/src/host/history/json-history-resource.ts +3 -3
- package/src/host/instance-extract-actions.ts +1 -1
- package/src/host/instance-fork-actions.ts +1 -1
- package/src/host/projection/dom.ts +2 -2
- package/src/host/projection/pixi.ts +25 -3
- package/src/host/r3f-entry-runtime.ts +65 -34
- package/src/host/react-mount-runtime.ts +8 -49
- package/src/host/realm-services.ts +2 -2
- package/src/host/roots/canvas-root.tsx +361 -0
- package/src/host/roots/module-root.ts +1 -1
- package/src/host/roots/r3f-root.tsx +473 -0
- package/src/host/roots/react-root.ts +9 -43
- package/src/host/scene-view-drawability.ts +2 -2
- package/src/host/served-bundle-runtime-modules.ts +1 -19
- package/src/host/server-log-bridge.ts +3 -3
- package/src/host/stories/mounted-story-viewport-source.ts +1 -1
- package/src/host/stories/pixi-story-model.ts +30 -0
- package/src/host/stories/story-media-captures.ts +46 -0
- package/src/host/stories/story-media-presence.ts +3 -3
- package/src/host/stories/story-pixi-preview.ts +408 -0
- package/src/host/stories/story-three-preview.ts +806 -0
- package/src/host/stories/three-story-captures.ts +35 -0
- package/src/host/story-three-preview-runtime.ts +56 -0
- package/src/host/three-ingest-runtime.ts +1 -1
- package/src/host/use-active-performance-source.ts +3 -3
- package/src/host/viewport-pose-memory.ts +1 -1
- package/src/host/viewport-root-presentation.ts +6 -5
- package/src/ingest/active-ingest.ts +2 -2
- package/src/ingest/authoring/ingest-dom-surface-authoring.ts +4 -4
- package/src/ingest/authoring/ingest-root-adapter.ts +13 -13
- package/src/ingest/capture-wait-report.ts +1 -1
- package/src/ingest/deferred-ingest-play.ts +11 -10
- package/src/ingest/discovery-public-ingest.ts +2 -2
- package/src/ingest/ingest-boot-viewport.ts +6 -8
- package/src/ingest/ingest-canvas-scene-document.tsx +17 -16
- package/src/ingest/ingest-canvas-scene.ts +5 -8
- package/src/ingest/ingest-evidence-hook.ts +1 -1
- package/src/ingest/ingest-frame-snapshot.ts +1 -1
- package/src/ingest/ingest-play-control.ts +4 -4
- package/src/ingest/ingest-render-debug.ts +11 -11
- package/src/ingest/ingest-siblings.ts +16 -28
- package/src/ingest/module-mode.ts +18 -19
- package/src/ingest/mount-canvas-ingest-root.ts +27 -27
- package/src/ingest/mount-coverage.ts +4 -4
- package/src/ingest/mount-dom-ingest-root.ts +16 -16
- package/src/ingest/mount-ingest-root.ts +14 -14
- package/src/ingest/mount-three-ingest-root.ts +12 -12
- package/src/ingest/resolve-canvas.ts +1 -1
- package/src/ingest/served-html-boot.ts +1 -1
- package/src/ingest/surface-canvas.ts +1 -1
- package/src/ingest/unmount-ingest-root.ts +7 -7
- package/src/navmesh/navmesh-handler.ts +24 -16
- package/src/network/NetworkInspectorPanel.tsx +449 -14
- package/src/network/network-inspector-model.ts +14 -2
- package/src/play/play-log-events.ts +1 -1
- package/src/play/play-mode.ts +99 -142
- package/src/play/play-recording.ts +2 -2
- package/src/play/react-play-live-authoring.ts +3 -3
- package/src/play/run-selection.ts +93 -0
- package/src/play-bar/PlayBar.tsx +20 -39
- package/src/profiler/FrameDebuggerPanel.tsx +1 -1
- package/src/profiler/PerformancePanel.tsx +4 -4
- package/src/react/design-time-react-mount.ts +37 -85
- package/src/react/dom-authoring-adapter.ts +11 -11
- package/src/react/react-inspector-section.tsx +13 -13
- package/src/react/react-world-authoring-adapter.ts +31 -143
- package/src/react/story-documents/story-documents.tsx +18 -22
- package/src/react/ui-board-document.tsx +10 -11
- package/src/react/ui-component-board.ts +5 -5
- package/src/runtime/adapter/audio-meter.ts +21 -0
- package/src/runtime/adapter/first-party-audio-system.ts +230 -0
- package/src/runtime/adapter/ingest/contract-debug-adapter.ts +114 -0
- package/src/runtime/adapter/ingest/contract-system-adapters.ts +256 -0
- package/src/runtime/adapter/ingest/merge-debug-adapters.ts +197 -0
- package/src/runtime/adapter/ingest/observation-debug-adapter.ts +162 -0
- package/src/runtime/adapter/ingest/upstream-pin.ts +51 -0
- package/src/runtime/adapter/native-debug-module.ts +498 -0
- package/src/runtime/audio/bus-mixer.ts +161 -0
- package/src/runtime/audio/pose-guard.ts +80 -0
- package/src/runtime/core/frame-pacing.ts +126 -0
- package/src/runtime/core/game-loop.ts +225 -0
- package/src/runtime/core/game-scoped-slot.ts +28 -0
- package/src/runtime/core/seeded-random.ts +162 -0
- package/src/runtime/core/sim-clock.ts +391 -0
- package/src/runtime/core/system-runner.ts +269 -0
- package/src/runtime/core/types.ts +104 -0
- package/src/runtime/create-runtime.ts +1128 -0
- package/src/runtime/debug-bridge.ts +570 -0
- package/src/runtime/debug-registry.ts +899 -0
- package/src/runtime/dev/chrome-trace.ts +153 -0
- package/src/runtime/dev/instruments.ts +403 -0
- package/src/runtime/dev/logger.ts +119 -0
- package/src/runtime/dev/performance-profiler.ts +367 -0
- package/src/runtime/dev/register-render-vitals.ts +276 -0
- package/src/runtime/dev/render-census.ts +354 -0
- package/src/runtime/dev/render-debug-adapter.ts +218 -0
- package/src/runtime/dev/render-memory.ts +226 -0
- package/src/runtime/dev/render-vitals.ts +338 -0
- package/src/runtime/dev/static-batch-advisor.ts +188 -0
- package/src/runtime/dev/webgl-frame-capture.ts +366 -0
- package/src/runtime/dev/webgl-gpu-timer.ts +53 -0
- package/src/runtime/dev-build.ts +47 -0
- package/src/runtime/game.ts +1636 -0
- package/src/runtime/gameplay-rng-trap.ts +135 -0
- package/src/runtime/host-context.ts +64 -0
- package/src/runtime/input-router.ts +169 -0
- package/src/runtime/mount-manifest.ts +480 -0
- package/src/runtime/pixi/authoring.ts +706 -0
- package/src/runtime/pixi/ingest.ts +116 -0
- package/src/runtime/pixi/physics-registry.ts +49 -0
- package/src/runtime/pixi/render-pass-bracket.ts +117 -0
- package/src/runtime/pixi/scene-capture.ts +179 -0
- package/src/runtime/pixi/system-adapters.ts +69 -0
- package/src/runtime/playtest.ts +22 -0
- package/src/runtime/presentation.ts +141 -0
- package/src/runtime/render-control.ts +642 -0
- package/src/runtime/render-seed.ts +77 -0
- package/src/runtime/run-ticks-settled.ts +73 -0
- package/src/runtime/setup/setup-audio.ts +72 -0
- package/src/services/audio-pose-guard.ts +2 -2
- package/src/services/game-audio.ts +152 -0
- package/src/services/game-network.ts +657 -0
- package/src/services/game-physics.ts +334 -0
- package/src/state-watch/StateWatchPanel.tsx +1 -1
- package/src/three/authoring/camera-runtime-inspector-section.tsx +4 -3
- package/src/three/authoring/constraint-inspector-section.tsx +8 -7
- package/src/three/authoring/model-asset-inspector-section.tsx +14 -17
- package/src/three/authoring/oid-source-persistence.ts +13 -13
- package/src/three/authoring/r3f-design-session.ts +79 -61
- package/src/three/authoring/r3f-source-authoring-adapter.ts +112 -108
- package/src/three/authoring/reflection-probe-inspector-section.tsx +5 -4
- package/src/three/authoring/spatial-joint-handles.ts +1 -1
- package/src/three/authoring/spatial-lod-handles.ts +1 -1
- package/src/three/authoring/spatial-particle-handles.ts +1 -1
- package/src/three/authoring/three-authoring-adapter.ts +33 -33
- package/src/three/component-verbs/extract-menu.ts +8 -7
- package/src/three/component-verbs/fork-menu.ts +8 -7
- package/src/three/component-verbs/internals-menu.ts +3 -3
- package/src/three/drei-asset-caches.ts +13 -0
- package/src/three/story-documents/three-story-documents.tsx +24 -34
- package/src/three/three-board/ThreeBoardDocument.tsx +25 -25
- package/src/three/three-board/board-scene.ts +7 -7
- package/src/three/three-board/three-component-board.ts +5 -5
- package/contributions/react/pasteboard.action.ts +0 -41
- package/contributions/xstate-behavior.action.ts +0 -42
- package/contributions/xstate-behavior.document.tsx +0 -73
- package/contributions/xstate-behavior.inspector.tsx +0 -28
- package/contributions/xstate-behavior.menu.ts +0 -23
- package/src/react/pasteboard-materialize.ts +0 -154
- package/src/services/game-audio-unlock.ts +0 -48
- package/src/xstate/XStateBehaviorSection.tsx +0 -130
- package/src/xstate/XStateMachineInspector.tsx +0 -566
- package/src/xstate/character-animation-machine.fixture.ts +0 -74
- package/src/xstate/live-behaviors.ts +0 -106
- package/src/xstate/use-live-actor-state.ts +0 -44
- package/src/xstate/xstate-graph.ts +0 -235
- package/src/xstate/xstate-layout.ts +0 -76
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { InspectorSectionProps } from '@volter/editor-
|
|
1
|
+
import { threeObject } from '@volter/editor-threejs/adapter/three-contract';
|
|
2
|
+
import type { InspectorSectionProps } from '@volter/editor-sdk/kit/inspector-section-registry';
|
|
3
3
|
import type { AuthoringAdapter, EditorNode } from '@volter/editor-project/adapter';
|
|
4
4
|
import { type ReflectionProbeSnapshot, reflectionProbeOf } from '@volter/threejs-runtime/adapter/reflection-probe';
|
|
5
5
|
import { Button, EditorBanner, FieldGroup, FieldRow, Text } from '@volter/editor-sdk/widgets';
|
|
6
6
|
import { useSyncExternalStore } from 'react';
|
|
7
|
+
import { useThreeEditorStore } from '@volter/editor-threejs/kit/three-state';
|
|
7
8
|
|
|
8
9
|
export function matches(node: EditorNode | null, adapter: AuthoringAdapter): boolean {
|
|
9
10
|
void adapter;
|
|
@@ -20,9 +21,9 @@ const STATUS_LABEL: Record<ReflectionProbeSnapshot['status'], string> = {
|
|
|
20
21
|
const EMPTY_SNAPSHOT: ReflectionProbeSnapshot = { status: 'idle', lastCapturedAt: null };
|
|
21
22
|
|
|
22
23
|
export function ReflectionProbeCaptureSection({ adapter, nodeId }: InspectorSectionProps) {
|
|
23
|
-
const store =
|
|
24
|
+
const store = useThreeEditorStore();
|
|
24
25
|
const object = nodeId
|
|
25
|
-
? (store.objectMap.get(nodeId) ?? adapter.hierarchy
|
|
26
|
+
? (store.objectMap.get(nodeId) ?? threeObject(adapter.hierarchy, nodeId))
|
|
26
27
|
: null;
|
|
27
28
|
const probe = reflectionProbeOf(object);
|
|
28
29
|
const snapshot = useSyncExternalStore(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Native Rapier impulse-joint anchors projected onto generic viewport guides. */
|
|
2
2
|
|
|
3
|
-
import type { R3fJointBinding, R3fJointLiteral } from '@volter/editor-
|
|
3
|
+
import type { R3fJointBinding, R3fJointLiteral } from '@volter/editor-react/source/r3f-joint-binding';
|
|
4
4
|
import type { PhysicsJointSnapshot, SpatialHandleLayer, SpatialPoint3 } from '@volter/editor-project/adapter';
|
|
5
5
|
import * as THREE from 'three';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Native THREE.LOD distance thresholds projected onto generic viewport guides. */
|
|
2
2
|
|
|
3
|
-
import type { R3fLodBinding } from '@volter/editor-
|
|
3
|
+
import type { R3fLodBinding } from '@volter/editor-react/source/r3f-lod-binding';
|
|
4
4
|
import type { SpatialHandleLayer, SpatialPoint3 } from '@volter/editor-project/adapter';
|
|
5
5
|
import * as THREE from 'three';
|
|
6
6
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type {
|
|
4
4
|
QuarksEmitterShape,
|
|
5
5
|
R3fParticleBinding,
|
|
6
|
-
} from '@volter/editor-
|
|
6
|
+
} from '@volter/editor-react/source/r3f-particle-binding';
|
|
7
7
|
import type { SpatialHandleLayer, SpatialPoint3 } from '@volter/editor-project/adapter';
|
|
8
8
|
import * as THREE from 'three';
|
|
9
9
|
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
* create/delete/reparent is not meaningfully re-expressible against it.
|
|
52
52
|
*/
|
|
53
53
|
|
|
54
|
-
import { getActiveNetworking, getActivePhysics } from '@volter/editor-
|
|
54
|
+
import { getActiveNetworking, getActivePhysics } from '@volter/editor-sdk/kit/authoring/active-systems';
|
|
55
55
|
import {
|
|
56
56
|
authoringOidOf,
|
|
57
57
|
isComponentInstanceRoot,
|
|
58
58
|
ownOidOf,
|
|
59
|
-
} from '@volter/editor-
|
|
59
|
+
} from '@volter/editor-threejs/kit/authoring/component-instance-root';
|
|
60
60
|
import { creationSiteRelated } from '../../host/authoring/creation-site-related';
|
|
61
61
|
import { createEphemeralPersistence } from '../../host/authoring/ephemeral-persistence';
|
|
62
62
|
import { multiChannelRefusal, persistChannelWrite } from '../../host/authoring/gesture-persist';
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
type SourcePersistenceBackend,
|
|
68
68
|
type SourceWriteSubject,
|
|
69
69
|
} from '../../host/authoring/source-persistence-backend';
|
|
70
|
-
import { readLocalTransform } from '@volter/editor-
|
|
70
|
+
import { readLocalTransform } from '@volter/editor-threejs/kit/authoring/three-projection-core';
|
|
71
71
|
import {
|
|
72
72
|
LIVE_ONLY_ACK,
|
|
73
73
|
LIVE_ONLY_DESTINATION,
|
|
@@ -76,20 +76,20 @@ import {
|
|
|
76
76
|
runWritePipe,
|
|
77
77
|
type WriteAck,
|
|
78
78
|
type WriteResolution,
|
|
79
|
-
} from '@volter/editor-
|
|
80
|
-
import { componentStatesProvider } from '@volter/editor-
|
|
79
|
+
} from '@volter/editor-sdk/kit/write-pipe';
|
|
80
|
+
import { componentStatesProvider } from '@volter/editor-sdk/kit/component-states-registry';
|
|
81
81
|
import {
|
|
82
82
|
type ChannelValue,
|
|
83
83
|
type CreationSiteLiteralReport,
|
|
84
84
|
channelFor,
|
|
85
|
-
} from '@volter/editor-
|
|
85
|
+
} from '@volter/editor-sdk/kit/creation-site-edit';
|
|
86
86
|
import {
|
|
87
87
|
creationSiteAnchor,
|
|
88
88
|
instancesAtSite,
|
|
89
89
|
NO_OBJECT_REASON,
|
|
90
|
-
} from '@volter/editor-
|
|
91
|
-
import { editorConsole } from '@volter/editor-
|
|
92
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
90
|
+
} from '@volter/editor-sdk/kit/creation-site-registry';
|
|
91
|
+
import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
|
|
92
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
93
93
|
import { type JournalSubject, JsonHistoryResource } from '../../host/history/json-history-resource';
|
|
94
94
|
import {
|
|
95
95
|
nativeKindOf,
|
|
@@ -100,8 +100,8 @@ import {
|
|
|
100
100
|
type ThreeProjectionDelta,
|
|
101
101
|
ThreeProjector,
|
|
102
102
|
type ThreeWalkStats,
|
|
103
|
-
} from '@volter/editor-
|
|
104
|
-
import type { SourceWriteBackend } from '@volter/editor-
|
|
103
|
+
} from '@volter/editor-threejs/kit/projection/three';
|
|
104
|
+
import type { SourceWriteBackend } from '@volter/editor-sdk/kit/ui-source/source-write-backend';
|
|
105
105
|
import type {
|
|
106
106
|
AuthoringAdapter,
|
|
107
107
|
AuthoringCapabilities,
|
|
@@ -498,7 +498,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
498
498
|
const object = this.objectOf(id);
|
|
499
499
|
const values = this.captureChannelBaseline(id) ?? {};
|
|
500
500
|
const ack = await options.sourceCommit!.commit(authoringOidOf(object), values);
|
|
501
|
-
if (ack.persisted) this.store.notifyIngestEdit();
|
|
501
|
+
if (ack.persisted) this.store.shell.notifyIngestEdit();
|
|
502
502
|
return ack;
|
|
503
503
|
},
|
|
504
504
|
};
|
|
@@ -509,7 +509,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
509
509
|
// scene object honestly returns none. `typeLabel` is the component name
|
|
510
510
|
// the OID stamp put there (`toEditorNode`), which is exactly what
|
|
511
511
|
// `meta.component` names.
|
|
512
|
-
this.stories = componentStatesProvider('three', store, (nodeId) => {
|
|
512
|
+
this.stories = componentStatesProvider('three', store.shell, (nodeId) => {
|
|
513
513
|
const node = this.hierarchy.node(nodeId);
|
|
514
514
|
if (node?.role !== 'component') return null;
|
|
515
515
|
return { name: node.typeLabel ?? node.label };
|
|
@@ -522,7 +522,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
522
522
|
// entries; one with a backend needs them, because
|
|
523
523
|
// a running world does not re-derive its scene from source and undoing only
|
|
524
524
|
// a file would leave the world showing the edit it just undid.
|
|
525
|
-
const history = store.projectHistory;
|
|
525
|
+
const history = store.shell.projectHistory;
|
|
526
526
|
this.historyResource =
|
|
527
527
|
this.persist && history
|
|
528
528
|
? new JsonHistoryResource({
|
|
@@ -714,9 +714,9 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
714
714
|
if (object !== null) map.set(id, object);
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
const retainedSelection = [...this.store.selectedEntityIds].filter((id) => map.has(id));
|
|
718
|
-
if (retainedSelection.length !== this.store.selectedEntityIds.size) {
|
|
719
|
-
this.store.selectMultiple(retainedSelection);
|
|
717
|
+
const retainedSelection = [...this.store.shell.selectedEntityIds].filter((id) => map.has(id));
|
|
718
|
+
if (retainedSelection.length !== this.store.shell.selectedEntityIds.size) {
|
|
719
|
+
this.store.shell.selectMultiple(retainedSelection);
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
|
|
@@ -801,12 +801,12 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
801
801
|
return node ? this.toEditorNode(node) : null;
|
|
802
802
|
},
|
|
803
803
|
object3D: (id) => this.objectOf(id),
|
|
804
|
-
idForObject3D: (object) => this.projector.idOf(object),
|
|
804
|
+
idForObject3D: (object: THREE.Object3D) => this.projector.idOf(object),
|
|
805
805
|
};
|
|
806
806
|
|
|
807
807
|
readonly selection: SelectionProvider = {
|
|
808
|
-
get: () => [...this.store.selectedEntityIds],
|
|
809
|
-
set: (ids) => this.store.selectMultiple(ids),
|
|
808
|
+
get: () => [...this.store.shell.selectedEntityIds],
|
|
809
|
+
set: (ids) => this.store.shell.selectMultiple(ids),
|
|
810
810
|
// Component boundaries are closed by default: a normal pick resolves to the
|
|
811
811
|
// outermost component owner, a scoped pick to the next nested one, and a
|
|
812
812
|
// deep pick advances one further. Deliberately the same contract the source
|
|
@@ -916,7 +916,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
916
916
|
...this.removableFlag(id, channel),
|
|
917
917
|
};
|
|
918
918
|
}
|
|
919
|
-
if (this.frameControl === 'host' && this.store.playState === 'playing') {
|
|
919
|
+
if (this.frameControl === 'host' && this.store.shell.playState === 'playing') {
|
|
920
920
|
return { writable: true, reason: LIVE_FRAME_REASON, ...this.removableFlag(id, channel) };
|
|
921
921
|
}
|
|
922
922
|
if (!this.persist) return { writable: true };
|
|
@@ -964,7 +964,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
964
964
|
// adapter cannot pause, which is the whole play-mode case.
|
|
965
965
|
this.physicsFor(id)?.commit(id, transform);
|
|
966
966
|
this.markedBodies.commit(id, transform);
|
|
967
|
-
this.store.notifyIngestEdit();
|
|
967
|
+
this.store.shell.notifyIngestEdit();
|
|
968
968
|
},
|
|
969
969
|
endEdit: (id) => {
|
|
970
970
|
this.loop?.resume();
|
|
@@ -977,7 +977,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
977
977
|
if (object) {
|
|
978
978
|
this.physicsFor(id)?.unfreeze(id);
|
|
979
979
|
this.markedBodies.unfreeze(id);
|
|
980
|
-
this.store.notifyIngestEdit();
|
|
980
|
+
this.store.shell.notifyIngestEdit();
|
|
981
981
|
}
|
|
982
982
|
// The gesture's own ack — awaited by whoever closed it, so a caller that
|
|
983
983
|
// has the ack has the byte. `undefined` when this surface has no backend
|
|
@@ -1223,7 +1223,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
1223
1223
|
};
|
|
1224
1224
|
|
|
1225
1225
|
subscribe(listener: () => void): () => void {
|
|
1226
|
-
return this.store.subscribe(listener);
|
|
1226
|
+
return this.store.shell.subscribe(listener);
|
|
1227
1227
|
}
|
|
1228
1228
|
|
|
1229
1229
|
dispose(): void {
|
|
@@ -1268,7 +1268,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
1268
1268
|
this.writeProp(id, property, value);
|
|
1269
1269
|
return;
|
|
1270
1270
|
}
|
|
1271
|
-
this.store.notifyIngestEdit();
|
|
1271
|
+
this.store.shell.notifyIngestEdit();
|
|
1272
1272
|
}
|
|
1273
1273
|
|
|
1274
1274
|
/** Write a transform to the live object + record it in the session edit map
|
|
@@ -1314,7 +1314,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
1314
1314
|
}
|
|
1315
1315
|
} else if (path === 'shadow.cast') object.castShadow = Boolean(value);
|
|
1316
1316
|
else if (path === 'shadow.receive') object.receiveShadow = Boolean(value);
|
|
1317
|
-
this.store.notifyIngestEdit();
|
|
1317
|
+
this.store.shell.notifyIngestEdit();
|
|
1318
1318
|
}
|
|
1319
1319
|
|
|
1320
1320
|
// ───────────────────────────────────────────── creation-site anchoring
|
|
@@ -1337,7 +1337,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
1337
1337
|
// world constructs every object inside `node_modules`, so the creation-site
|
|
1338
1338
|
// registry below answers "constructed outside project source" for all of
|
|
1339
1339
|
// them — while the game's own JSX says exactly where each one is written,
|
|
1340
|
-
// and `
|
|
1340
|
+
// and `@volter/editor-react`'s `serving/ui-oid-plugin.ts` stamped that callsite onto the object. The
|
|
1341
1341
|
// stamped answer is the SAME KIND of fact as a `new` site (a source
|
|
1342
1342
|
// file:line an edit can be written at), so it belongs in the same slot
|
|
1343
1343
|
// rather than beside it.
|
|
@@ -1570,7 +1570,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
1570
1570
|
properties,
|
|
1571
1571
|
}).then((answer) => {
|
|
1572
1572
|
this.instanceLiterals.set(key, answer);
|
|
1573
|
-
this.store.notifyIngestEdit();
|
|
1573
|
+
this.store.shell.notifyIngestEdit();
|
|
1574
1574
|
return answer;
|
|
1575
1575
|
});
|
|
1576
1576
|
this.instanceLiteralRequests.set(key, request);
|
|
@@ -1666,7 +1666,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
1666
1666
|
}
|
|
1667
1667
|
this.instanceLiterals.delete(key);
|
|
1668
1668
|
this.instanceLiteralRequests.delete(key);
|
|
1669
|
-
this.store.notifyIngestEdit();
|
|
1669
|
+
this.store.shell.notifyIngestEdit();
|
|
1670
1670
|
const destination = subject.anchor.anchored ? subject.anchor.display : 'this source site';
|
|
1671
1671
|
return {
|
|
1672
1672
|
changed: true,
|
|
@@ -1810,7 +1810,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
|
|
|
1810
1810
|
object.receiveShadow = value.receiveShadow;
|
|
1811
1811
|
}
|
|
1812
1812
|
this.edits = structuredClone(state.edits);
|
|
1813
|
-
this.store.notifyIngestEdit();
|
|
1813
|
+
this.store.shell.notifyIngestEdit();
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
1816
|
|
|
@@ -1855,7 +1855,7 @@ export function structuralThree(
|
|
|
1855
1855
|
identity: structuralIdentity({ camera: options.camera }),
|
|
1856
1856
|
journal: options.journal,
|
|
1857
1857
|
persistence: createCreationSitePersistence({
|
|
1858
|
-
history: store.projectHistory,
|
|
1858
|
+
history: store.shell.projectHistory,
|
|
1859
1859
|
writer: options.sourceWriter,
|
|
1860
1860
|
}),
|
|
1861
1861
|
loop: options.loop,
|
|
@@ -1896,7 +1896,7 @@ export function oidSourceThree(
|
|
|
1896
1896
|
identity: oidIdentity(options.worldId, { camera: options.camera }),
|
|
1897
1897
|
journal: options.journal,
|
|
1898
1898
|
persistence: createOidSourcePersistence({
|
|
1899
|
-
history: store.projectHistory,
|
|
1899
|
+
history: store.shell.projectHistory,
|
|
1900
1900
|
backend: options.backend,
|
|
1901
1901
|
}),
|
|
1902
1902
|
loop: options.loop,
|
|
@@ -1944,7 +1944,7 @@ export function oidThree(
|
|
|
1944
1944
|
...(options.explicitSourceCommit
|
|
1945
1945
|
? {
|
|
1946
1946
|
sourceCommit: createOidTransformSourceCommitter({
|
|
1947
|
-
history: store.projectHistory,
|
|
1947
|
+
history: store.shell.projectHistory,
|
|
1948
1948
|
...(options.backend ? { backend: options.backend } : {}),
|
|
1949
1949
|
}),
|
|
1950
1950
|
}
|
|
@@ -11,17 +11,18 @@
|
|
|
11
11
|
* and lives server-side in the host's `ui-source/plan-extract-component.ts`.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { getActiveAuthoring } from '@volter/editor-
|
|
15
|
-
import { instanceSourceLocatorFor } from '@volter/editor-
|
|
16
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
17
|
-
import { registerHierarchyMenuItems } from '@volter/editor-
|
|
14
|
+
import { getActiveAuthoring } from '@volter/editor-sdk/kit/authoring/active-adapter';
|
|
15
|
+
import { instanceSourceLocatorFor } from '@volter/editor-sdk/kit/authoring/instance-source-menu';
|
|
16
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
17
|
+
import { registerHierarchyMenuItems } from '@volter/editor-sdk/kit/hierarchy-menu-registry';
|
|
18
18
|
import {
|
|
19
19
|
canExtractNode,
|
|
20
20
|
EXTRACT_COMPONENT_LABEL,
|
|
21
21
|
type InstanceExtractSource,
|
|
22
22
|
} from '../../host/instance-extract-actions';
|
|
23
|
-
import { showTransientHint } from '@volter/editor-
|
|
23
|
+
import { showTransientHint } from '@volter/editor-sdk/kit/transient-hint';
|
|
24
24
|
import type { AuthoringAdapter } from '@volter/editor-project/adapter';
|
|
25
|
+
import { threeStateOf } from '@volter/editor-threejs/kit/three-state';
|
|
25
26
|
|
|
26
27
|
/** The extract surface for `nodeId`, or `null` — the host's own owner walk. */
|
|
27
28
|
export function instanceExtractSourceFor(
|
|
@@ -32,7 +33,7 @@ export function instanceExtractSourceFor(
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
function extractable(store: EditorShellStore, nodeId: string): boolean {
|
|
35
|
-
const adapter = getActiveAuthoring(store);
|
|
36
|
+
const adapter = getActiveAuthoring(store.shell);
|
|
36
37
|
return canExtractNode(
|
|
37
38
|
adapter.hierarchy.node(nodeId),
|
|
38
39
|
instanceExtractSourceFor(adapter, nodeId),
|
|
@@ -46,7 +47,7 @@ let unregister: (() => void) | null = null;
|
|
|
46
47
|
export function ensureInstanceExtractMenuRegistered(): void {
|
|
47
48
|
if (unregister) return;
|
|
48
49
|
unregister = registerHierarchyMenuItems(
|
|
49
|
-
({ nodeId, store }) => extractable(store, nodeId),
|
|
50
|
+
({ nodeId, store }) => extractable(threeStateOf(store), nodeId),
|
|
50
51
|
({ nodeId, store }) => {
|
|
51
52
|
const source = instanceExtractSourceFor(getActiveAuthoring(store), nodeId);
|
|
52
53
|
return [
|
|
@@ -17,17 +17,18 @@
|
|
|
17
17
|
* asking the composite directly would ask the wrong object.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { getActiveAuthoring } from '@volter/editor-
|
|
21
|
-
import { instanceSourceLocatorFor } from '@volter/editor-
|
|
22
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
23
|
-
import { registerHierarchyMenuItems } from '@volter/editor-
|
|
20
|
+
import { getActiveAuthoring } from '@volter/editor-sdk/kit/authoring/active-adapter';
|
|
21
|
+
import { instanceSourceLocatorFor } from '@volter/editor-sdk/kit/authoring/instance-source-menu';
|
|
22
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
23
|
+
import { registerHierarchyMenuItems } from '@volter/editor-sdk/kit/hierarchy-menu-registry';
|
|
24
24
|
import {
|
|
25
25
|
canForkInstance,
|
|
26
26
|
FORK_COMPONENT_LABEL,
|
|
27
27
|
type InstanceForkSource,
|
|
28
28
|
} from '../../host/instance-fork-actions';
|
|
29
|
-
import { showTransientHint } from '@volter/editor-
|
|
29
|
+
import { showTransientHint } from '@volter/editor-sdk/kit/transient-hint';
|
|
30
30
|
import type { AuthoringAdapter } from '@volter/editor-project/adapter';
|
|
31
|
+
import { threeStateOf } from '@volter/editor-threejs/kit/three-state';
|
|
31
32
|
|
|
32
33
|
/** The fork surface for `nodeId`, or `null` — the host's own owner walk. */
|
|
33
34
|
export function instanceForkSourceFor(
|
|
@@ -38,7 +39,7 @@ export function instanceForkSourceFor(
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
function forkable(store: EditorShellStore, nodeId: string): boolean {
|
|
41
|
-
const adapter = getActiveAuthoring(store);
|
|
42
|
+
const adapter = getActiveAuthoring(store.shell);
|
|
42
43
|
return canForkInstance(
|
|
43
44
|
adapter.hierarchy.node(nodeId),
|
|
44
45
|
instanceForkSourceFor(adapter, nodeId),
|
|
@@ -52,7 +53,7 @@ let unregister: (() => void) | null = null;
|
|
|
52
53
|
export function ensureInstanceForkMenuRegistered(): void {
|
|
53
54
|
if (unregister) return;
|
|
54
55
|
unregister = registerHierarchyMenuItems(
|
|
55
|
-
({ nodeId, store }) => forkable(store, nodeId),
|
|
56
|
+
({ nodeId, store }) => forkable(threeStateOf(store), nodeId),
|
|
56
57
|
({ nodeId, store }) => {
|
|
57
58
|
const source = instanceForkSourceFor(getActiveAuthoring(store), nodeId);
|
|
58
59
|
return [
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
* probing the active adapter is already asking the right one.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import { getActiveAuthoring } from '@volter/editor-
|
|
21
|
+
import { getActiveAuthoring } from '@volter/editor-sdk/kit/authoring/active-adapter';
|
|
22
22
|
import {
|
|
23
23
|
type InternalsSource,
|
|
24
24
|
internalsProjection,
|
|
25
25
|
isInternalsRevealed,
|
|
26
26
|
revealedInternalsIds,
|
|
27
27
|
toggleInternalsRevealed,
|
|
28
|
-
} from '@volter/editor-
|
|
29
|
-
import { registerHierarchyMenuItems } from '@volter/editor-
|
|
28
|
+
} from '@volter/editor-sdk/kit/hierarchy-internals';
|
|
29
|
+
import { registerHierarchyMenuItems } from '@volter/editor-sdk/kit/hierarchy-menu-registry';
|
|
30
30
|
import type { AuthoringAdapter } from '@volter/editor-project/adapter';
|
|
31
31
|
|
|
32
32
|
/** Menu capitalization follows the panel's Title Case idiom (`Rename`,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* drei's parsed-asset caches (`useGLTF`, `useTexture`) outlive a mount. A lane
|
|
3
|
+
* that reloads after project asset bytes change clears the changed paths
|
|
4
|
+
* first, or the next mount is handed the old bytes.
|
|
5
|
+
*/
|
|
6
|
+
export async function evictDreiCaches(paths: readonly string[]): Promise<void> {
|
|
7
|
+
if (paths.length === 0) return;
|
|
8
|
+
const { useGLTF, useTexture } = await import('@react-three/drei');
|
|
9
|
+
for (const path of paths) {
|
|
10
|
+
useGLTF.clear(path);
|
|
11
|
+
useTexture.clear(path);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -25,50 +25,49 @@
|
|
|
25
25
|
* it.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
import { Object3DDocumentViewport } from '@volter/editor-
|
|
29
|
-
import type { SourceDocumentAuthoringFactory } from '@volter/editor-
|
|
30
|
-
import { SurfaceStateOverlay } from '@volter/editor-
|
|
31
|
-
import { STANDARD_COMPONENT_CAMERA_DIRECTION } from '@volter/editor-
|
|
32
|
-
import { registerDocumentOpener } from '@volter/editor-
|
|
33
|
-
import
|
|
34
|
-
import { createHmrRegistrationGroup } from '@volter/editor-core/hmr-registration-group';
|
|
28
|
+
import { Object3DDocumentViewport } from '@volter/editor-threejs/kit/components/Object3DDocumentViewport';
|
|
29
|
+
import type { SourceDocumentAuthoringFactory } from '@volter/editor-threejs/kit/components/StageHost';
|
|
30
|
+
import { SurfaceStateOverlay } from '@volter/editor-sdk/kit/components/SurfaceStateOverlay';
|
|
31
|
+
import { STANDARD_COMPONENT_CAMERA_DIRECTION } from '@volter/editor-threejs/kit/components/standard-viewport-dressing';
|
|
32
|
+
import { registerDocumentOpener } from '@volter/editor-sdk/kit/document-open-registry';
|
|
33
|
+
import { createHmrRegistrationGroup } from '@volter/editor-sdk/kit/hmr-registration-group';
|
|
35
34
|
import {
|
|
36
35
|
CONTRIBUTED_SECTION_ORDER,
|
|
37
36
|
STORY_ARGS_SECTION_ID,
|
|
38
37
|
STORY_ARGS_SECTION_TITLE,
|
|
39
|
-
} from '@volter/editor-
|
|
40
|
-
import { registerInspectorSections } from '@volter/editor-
|
|
41
|
-
import type { ComposedProjectStory } from '@volter/editor-
|
|
38
|
+
} from '@volter/editor-sdk/kit/inspection-model';
|
|
39
|
+
import { registerInspectorSections } from '@volter/editor-sdk/kit/inspector-section-registry';
|
|
40
|
+
import type { ComposedProjectStory } from '@volter/editor-sdk/kit/stories/compose-project-stories';
|
|
42
41
|
import {
|
|
43
42
|
type MountedStoryViewportSource,
|
|
44
43
|
mountedStoryViewportSource,
|
|
45
44
|
} from '../../host/stories/mounted-story-viewport-source';
|
|
46
|
-
import { getProjectStoryRegions } from '@volter/editor-
|
|
45
|
+
import { getProjectStoryRegions } from '@volter/editor-sdk/kit/stories/project-story-regions';
|
|
47
46
|
import { storyArgPropertyDescriptors } from '../../host/stories/story-arg-descriptors';
|
|
48
|
-
import { declaredStoryMedium } from '@volter/editor-
|
|
47
|
+
import { declaredStoryMedium } from '@volter/editor-sdk/kit/stories/story-declared-medium';
|
|
49
48
|
import {
|
|
50
49
|
type StoryDocumentOpenRequest,
|
|
51
50
|
THREE_STORY_DOCUMENT_OPENER,
|
|
52
|
-
} from '@volter/editor-
|
|
51
|
+
} from '@volter/editor-sdk/kit/story-document-openers';
|
|
53
52
|
import {
|
|
54
53
|
getProjectStoryModules,
|
|
55
54
|
subscribeProjectStoryModules,
|
|
56
|
-
} from '@volter/editor-
|
|
55
|
+
} from '@volter/editor-sdk/kit/stories/story-registry';
|
|
57
56
|
import {
|
|
58
57
|
disposeStoryObject3D,
|
|
59
58
|
mountStoryObject3D,
|
|
60
59
|
type StoryPreviewComponent,
|
|
61
|
-
} from '
|
|
62
|
-
import { mountedStoryHasThreeContent } from '@volter/editor-
|
|
63
|
-
import { explainSurface } from '@volter/editor-
|
|
64
|
-
import { sourceWriteBackendIfPrimed } from '@volter/editor-
|
|
60
|
+
} from '../../host/stories/story-three-preview';
|
|
61
|
+
import { mountedStoryHasThreeContent } from '@volter/editor-threejs/kit/stories/three-story-model';
|
|
62
|
+
import { explainSurface } from '@volter/editor-sdk/kit/surface-state';
|
|
63
|
+
import { sourceWriteBackendIfPrimed } from '@volter/editor-sdk/kit/ui-source/tier-source-write-backend';
|
|
65
64
|
import {
|
|
66
65
|
activeWorkspaceDocument,
|
|
67
66
|
closeWorkspaceDocument,
|
|
68
67
|
openWorkspaceDocument,
|
|
69
68
|
type WorkspaceDocumentContentProps,
|
|
70
|
-
} from '@volter/editor-
|
|
71
|
-
import { registerWorkspaceDocumentRestorer } from '@volter/editor-
|
|
69
|
+
} from '@volter/editor-sdk/kit/workspace-document-registry';
|
|
70
|
+
import { registerWorkspaceDocumentRestorer } from '@volter/editor-sdk/kit/workspace-document-restore';
|
|
72
71
|
import { STORY_ARGS_SECTION_ICON } from '../../react/story-documents/story-args-section';
|
|
73
72
|
import {
|
|
74
73
|
prepareStoryDocumentRestore,
|
|
@@ -84,10 +83,6 @@ const THREE_STORY_ARG_PATH_PREFIX = 'threeStory.arg.';
|
|
|
84
83
|
|
|
85
84
|
/** The narrow store surface a three-story document needs — the T6.3 input-gate
|
|
86
85
|
* hand-off, identical to `story-documents.tsx`'s `StoryDocumentStore`. */
|
|
87
|
-
export interface ThreeStoryDocumentStore {
|
|
88
|
-
setActiveViewportTab(tab: ViewportTab): void;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
86
|
interface ThreeStoryDocumentState {
|
|
92
87
|
readonly modulePath: string;
|
|
93
88
|
readonly storyName: string;
|
|
@@ -149,7 +144,6 @@ export function setThreeStoryArgOverride(id: string, key: string, value: unknown
|
|
|
149
144
|
* exhibit click-through target.
|
|
150
145
|
*/
|
|
151
146
|
export function openThreeStoryDocument(
|
|
152
|
-
store: ThreeStoryDocumentStore,
|
|
153
147
|
modulePath: string,
|
|
154
148
|
storyName: string,
|
|
155
149
|
title = storyName,
|
|
@@ -187,7 +181,6 @@ export function openThreeStoryDocument(
|
|
|
187
181
|
// a board-scoped rule (`board-scene.ts`) that one story cannot
|
|
188
182
|
// re-derive.
|
|
189
183
|
persist: ({ title: liveTitle }) => ({ modulePath, storyName, title: liveTitle }),
|
|
190
|
-
onActivate: () => store.setActiveViewportTab('edit'),
|
|
191
184
|
onDispose: (documentId) => {
|
|
192
185
|
if (_states.delete(documentId)) notifyChanged();
|
|
193
186
|
},
|
|
@@ -217,7 +210,6 @@ export function threeStoryDocumentState(
|
|
|
217
210
|
* story registry (`refreshProjectStories`) first — this reads it synchronously.
|
|
218
211
|
*/
|
|
219
212
|
export function restoreThreeStoryDocument(
|
|
220
|
-
store: ThreeStoryDocumentStore,
|
|
221
213
|
modulePath: string,
|
|
222
214
|
storyName: string,
|
|
223
215
|
title?: string,
|
|
@@ -233,7 +225,7 @@ export function restoreThreeStoryDocument(
|
|
|
233
225
|
// which no single story can re-derive — so the tab is restored with the text
|
|
234
226
|
// it had, falling back to the registry's own label for a record that
|
|
235
227
|
// predates this or came from another opener.
|
|
236
|
-
openThreeStoryDocument(
|
|
228
|
+
openThreeStoryDocument(modulePath, storyName, title ?? story.label);
|
|
237
229
|
return true;
|
|
238
230
|
}
|
|
239
231
|
|
|
@@ -242,10 +234,8 @@ export function restoreThreeStoryDocument(
|
|
|
242
234
|
registerDocumentOpener<StoryDocumentOpenRequest>({
|
|
243
235
|
id: THREE_STORY_DOCUMENT_OPENER,
|
|
244
236
|
owner: 'three-story-documents',
|
|
245
|
-
open: (
|
|
246
|
-
openThreeStoryDocument(
|
|
247
|
-
store,
|
|
248
|
-
request.modulePath,
|
|
237
|
+
open: (_store, request) =>
|
|
238
|
+
openThreeStoryDocument(request.modulePath,
|
|
249
239
|
request.storyName,
|
|
250
240
|
request.title ?? request.storyName,
|
|
251
241
|
request.activate === undefined ? {} : { activate: request.activate },
|
|
@@ -259,7 +249,7 @@ registerWorkspaceDocumentRestorer({
|
|
|
259
249
|
kind: 'world',
|
|
260
250
|
owner: 'three-story-documents',
|
|
261
251
|
prepare: prepareStoryDocumentRestore,
|
|
262
|
-
restore: ({ state
|
|
252
|
+
restore: ({ state }) => {
|
|
263
253
|
const record = state as
|
|
264
254
|
| { modulePath?: unknown; storyName?: unknown; title?: unknown }
|
|
265
255
|
| null
|
|
@@ -268,7 +258,7 @@ registerWorkspaceDocumentRestorer({
|
|
|
268
258
|
const storyName = typeof record?.storyName === 'string' ? record.storyName : null;
|
|
269
259
|
if (!modulePath || !storyName) return false;
|
|
270
260
|
const title = typeof record?.title === 'string' ? record.title : undefined;
|
|
271
|
-
return restoreThreeStoryDocument(
|
|
261
|
+
return restoreThreeStoryDocument(modulePath, storyName, title);
|
|
272
262
|
},
|
|
273
263
|
});
|
|
274
264
|
|