@volter/editor-game 0.5.66 → 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 +1 -1
- package/contributions/godot.style.ts +26 -6
- package/contributions/godot.view.ts +6 -0
- package/contributions/ingest.service.ts +2 -2
- 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 +10 -4
- package/contributions/react/component-board.service.ts +1 -1
- package/contributions/react/design-time-mount.service.ts +1 -1
- package/contributions/scene-document.service.ts +3 -3
- 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 +6 -6
- package/contributions/three/three-authoring.service.ts +8 -5
- package/contributions/three-story-capture.service.ts +12 -0
- package/contributions/unity.style.ts +17 -7
- package/contributions/unity.view.ts +6 -0
- package/contributions/unreal.style.ts +10 -2
- package/contributions/unreal.view.ts +5 -0
- package/package.json +20 -10
- package/src/asset-budget/AssetBudgetPanel.tsx +1 -1
- package/src/asset-budget/asset-budget-model.ts +1 -1
- package/src/audio/AudioDebuggerPanel.tsx +1 -1
- package/src/bridge/dispatch.ts +14 -14
- package/src/bridge/live-frames.ts +1 -1
- package/src/bridge/screenshot.ts +3 -3
- 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 +5 -5
- package/src/coverage/live-project-verbs.ts +1 -1
- package/src/coverage/native-system-coverage.ts +5 -5
- package/src/coverage/root-coverage.ts +1 -1
- package/src/coverage/session-coverage.ts +3 -3
- package/src/design-system-stories/ApplicationChrome.stories.tsx +5 -5
- package/src/design-system-stories/InspectorNarrowBodies.stories.tsx +7 -7
- 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 +1 -1
- package/src/game-document/GameDocument.tsx +2 -2
- package/src/game-document/GamePanel.tsx +4 -4
- 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 +3 -3
- package/src/generation/generation-documents.tsx +5 -5
- package/src/generation/generation-jobs.ts +1 -1
- package/src/host/adapter-runtime-bindings.ts +96 -5
- package/src/host/authoring/babylon-authoring-adapter.ts +6 -6
- package/src/host/authoring/gesture-persist.ts +1 -1
- package/src/host/authoring/ingest-data-writer.ts +1 -1
- package/src/host/authoring/ingest-source-persistence.ts +4 -4
- 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 +40 -15
- package/src/host/authoring/pixi-creation-site-write-target.ts +2 -2
- package/src/host/authoring/pixi-live-write-target.ts +4 -4
- 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 +1 -1
- package/src/host/authoring/pixi-structure-history.ts +2 -2
- package/src/host/authoring/pixi-transform-channels.ts +16 -14
- package/src/host/authoring/source-persistence-backend.ts +3 -3
- package/src/host/authoring/struct-write-pipe.ts +1 -1
- package/src/host/binding-resolver.ts +8 -9
- package/src/host/browser-transpile.ts +1 -1
- package/src/host/canvas-entry-runtime.ts +58 -47
- package/src/host/canvas-preview-frames.ts +482 -0
- package/src/host/components/CameraAuthoringOverlay.tsx +1 -1
- package/src/host/components/HeaderTelemetry.tsx +4 -4
- package/src/host/components/PixiIsolationSceneContent.tsx +10 -10
- package/src/host/components/ThreeIsolationSceneContent.tsx +3 -3
- 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 +14 -14
- package/src/host/components/utility-view-state.ts +1 -1
- package/src/host/components/world-root-stage-binding.tsx +12 -12
- package/src/host/components/world-root-stage.ts +70 -49
- package/src/host/coverage/system-adapter-coverage.ts +3 -4
- package/src/host/design-system-stories/fixtures/editor-runtime.tsx +9 -11
- package/src/host/document-preview-three.ts +1 -1
- package/src/host/entry-adjudication.ts +6 -6
- package/src/host/game-css-scope-transform.ts +4 -0
- package/src/host/game-realm-page.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 +2 -2
- package/src/host/history/json-history-resource.ts +1 -1
- package/src/host/projection/pixi.ts +24 -2
- package/src/host/r3f-entry-runtime.ts +65 -34
- package/src/host/react-mount-runtime.ts +7 -48
- package/src/host/realm-services.ts +1 -1
- package/src/host/roots/canvas-root.tsx +361 -0
- package/src/host/roots/r3f-root.tsx +473 -0
- package/src/host/roots/react-root.ts +9 -43
- package/src/host/served-bundle-runtime-modules.ts +1 -19
- package/src/host/server-log-bridge.ts +2 -2
- 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/use-active-performance-source.ts +2 -2
- package/src/host/viewport-pose-memory.ts +1 -1
- package/src/host/viewport-root-presentation.ts +6 -5
- package/src/ingest/active-ingest.ts +1 -1
- package/src/ingest/authoring/ingest-dom-surface-authoring.ts +4 -4
- package/src/ingest/authoring/ingest-root-adapter.ts +8 -8
- package/src/ingest/deferred-ingest-play.ts +6 -6
- package/src/ingest/discovery-public-ingest.ts +2 -2
- package/src/ingest/ingest-boot-viewport.ts +2 -2
- package/src/ingest/ingest-canvas-scene-document.tsx +8 -8
- package/src/ingest/ingest-canvas-scene.ts +3 -3
- 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 +1 -1
- package/src/ingest/ingest-render-debug.ts +10 -10
- package/src/ingest/ingest-siblings.ts +13 -25
- package/src/ingest/module-mode.ts +14 -14
- package/src/ingest/mount-canvas-ingest-root.ts +21 -21
- package/src/ingest/mount-coverage.ts +2 -2
- package/src/ingest/mount-dom-ingest-root.ts +11 -11
- package/src/ingest/mount-ingest-root.ts +8 -8
- package/src/ingest/mount-three-ingest-root.ts +8 -8
- 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 +5 -5
- 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 +76 -133
- package/src/play/play-recording.ts +1 -1
- 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 +3 -3
- package/src/react/design-time-react-mount.ts +23 -65
- package/src/react/dom-authoring-adapter.ts +9 -9
- package/src/react/react-inspector-section.tsx +5 -5
- package/src/react/react-world-authoring-adapter.ts +11 -11
- package/src/react/story-documents/story-documents.tsx +9 -9
- package/src/react/ui-board-document.tsx +7 -7
- package/src/react/ui-component-board.ts +2 -2
- 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 +3 -2
- package/src/three/authoring/constraint-inspector-section.tsx +6 -5
- package/src/three/authoring/model-asset-inspector-section.tsx +7 -6
- package/src/three/authoring/oid-source-persistence.ts +7 -7
- package/src/three/authoring/r3f-design-session.ts +58 -54
- package/src/three/authoring/r3f-source-authoring-adapter.ts +95 -91
- package/src/three/authoring/reflection-probe-inspector-section.tsx +3 -2
- package/src/three/authoring/three-authoring-adapter.ts +29 -29
- package/src/three/component-verbs/extract-menu.ts +7 -6
- package/src/three/component-verbs/fork-menu.ts +7 -6
- package/src/three/component-verbs/internals-menu.ts +2 -2
- package/src/three/story-documents/three-story-documents.tsx +13 -13
- package/src/three/three-board/ThreeBoardDocument.tsx +13 -12
- package/src/three/three-board/board-scene.ts +6 -6
- package/src/three/three-board/three-component-board.ts +2 -2
- package/src/services/game-audio-unlock.ts +0 -48
|
@@ -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,
|
|
@@ -77,19 +77,19 @@ import {
|
|
|
77
77
|
type WriteAck,
|
|
78
78
|
type WriteResolution,
|
|
79
79
|
} from '@volter/editor-sdk/kit/write-pipe';
|
|
80
|
-
import { componentStatesProvider } from '@volter/editor-
|
|
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
90
|
} from '@volter/editor-sdk/kit/creation-site-registry';
|
|
91
91
|
import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
|
|
92
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
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
|
|
@@ -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,10 +11,10 @@
|
|
|
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,
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
} from '../../host/instance-extract-actions';
|
|
23
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,10 +17,10 @@
|
|
|
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,
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
} from '../../host/instance-fork-actions';
|
|
29
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,7 +18,7 @@
|
|
|
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,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
revealedInternalsIds,
|
|
27
27
|
toggleInternalsRevealed,
|
|
28
28
|
} from '@volter/editor-sdk/kit/hierarchy-internals';
|
|
29
|
-
import { registerHierarchyMenuItems } from '@volter/editor-
|
|
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`,
|
|
@@ -25,11 +25,11 @@
|
|
|
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-
|
|
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
33
|
import { createHmrRegistrationGroup } from '@volter/editor-sdk/kit/hmr-registration-group';
|
|
34
34
|
import {
|
|
35
35
|
CONTRIBUTED_SECTION_ORDER,
|
|
@@ -37,14 +37,14 @@ import {
|
|
|
37
37
|
STORY_ARGS_SECTION_TITLE,
|
|
38
38
|
} from '@volter/editor-sdk/kit/inspection-model';
|
|
39
39
|
import { registerInspectorSections } from '@volter/editor-sdk/kit/inspector-section-registry';
|
|
40
|
-
import type { ComposedProjectStory } from '@volter/editor-
|
|
40
|
+
import type { ComposedProjectStory } from '@volter/editor-sdk/kit/stories/compose-project-stories';
|
|
41
41
|
import {
|
|
42
42
|
type MountedStoryViewportSource,
|
|
43
43
|
mountedStoryViewportSource,
|
|
44
44
|
} from '../../host/stories/mounted-story-viewport-source';
|
|
45
|
-
import { getProjectStoryRegions } from '@volter/editor-
|
|
45
|
+
import { getProjectStoryRegions } from '@volter/editor-sdk/kit/stories/project-story-regions';
|
|
46
46
|
import { storyArgPropertyDescriptors } from '../../host/stories/story-arg-descriptors';
|
|
47
|
-
import { declaredStoryMedium } from '@volter/editor-
|
|
47
|
+
import { declaredStoryMedium } from '@volter/editor-sdk/kit/stories/story-declared-medium';
|
|
48
48
|
import {
|
|
49
49
|
type StoryDocumentOpenRequest,
|
|
50
50
|
THREE_STORY_DOCUMENT_OPENER,
|
|
@@ -52,22 +52,22 @@ import {
|
|
|
52
52
|
import {
|
|
53
53
|
getProjectStoryModules,
|
|
54
54
|
subscribeProjectStoryModules,
|
|
55
|
-
} from '@volter/editor-
|
|
55
|
+
} from '@volter/editor-sdk/kit/stories/story-registry';
|
|
56
56
|
import {
|
|
57
57
|
disposeStoryObject3D,
|
|
58
58
|
mountStoryObject3D,
|
|
59
59
|
type StoryPreviewComponent,
|
|
60
|
-
} from '
|
|
61
|
-
import { mountedStoryHasThreeContent } from '@volter/editor-
|
|
60
|
+
} from '../../host/stories/story-three-preview';
|
|
61
|
+
import { mountedStoryHasThreeContent } from '@volter/editor-threejs/kit/stories/three-story-model';
|
|
62
62
|
import { explainSurface } from '@volter/editor-sdk/kit/surface-state';
|
|
63
|
-
import { sourceWriteBackendIfPrimed } from '@volter/editor-
|
|
63
|
+
import { sourceWriteBackendIfPrimed } from '@volter/editor-sdk/kit/ui-source/tier-source-write-backend';
|
|
64
64
|
import {
|
|
65
65
|
activeWorkspaceDocument,
|
|
66
66
|
closeWorkspaceDocument,
|
|
67
67
|
openWorkspaceDocument,
|
|
68
68
|
type WorkspaceDocumentContentProps,
|
|
69
69
|
} from '@volter/editor-sdk/kit/workspace-document-registry';
|
|
70
|
-
import { registerWorkspaceDocumentRestorer } from '@volter/editor-
|
|
70
|
+
import { registerWorkspaceDocumentRestorer } from '@volter/editor-sdk/kit/workspace-document-restore';
|
|
71
71
|
import { STORY_ARGS_SECTION_ICON } from '../../react/story-documents/story-args-section';
|
|
72
72
|
import {
|
|
73
73
|
prepareStoryDocumentRestore,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { threeObject } from '@volter/editor-threejs/adapter/three-contract';
|
|
2
|
+
import { registerAvailableWorkspaceDocument } from '@volter/editor-sdk/kit/workspace-available-documents';
|
|
2
3
|
/**
|
|
3
4
|
* The 3D COMPONENTS board — a generated, never-persisted 3D scene laying out
|
|
4
5
|
* every qualifying `three` story's mounted `Object3D` at TRUE SCALE, so a
|
|
@@ -52,12 +53,12 @@ import { registerAvailableWorkspaceDocument } from '@volter/editor-core/workspac
|
|
|
52
53
|
* degradation). Same sentences, same clipboard path, never a silent no-op.
|
|
53
54
|
*/
|
|
54
55
|
|
|
55
|
-
import { object3DDocumentSession } from '@volter/editor-
|
|
56
|
-
import { Object3DDocumentViewport } from '@volter/editor-
|
|
57
|
-
import { STANDARD_COMPONENT_CAMERA_DIRECTION } from '@volter/editor-
|
|
56
|
+
import { object3DDocumentSession } from '@volter/editor-threejs/kit/authoring/object3d-document-session-registry';
|
|
57
|
+
import { Object3DDocumentViewport } from '@volter/editor-threejs/kit/components/Object3DDocumentViewport';
|
|
58
|
+
import { STANDARD_COMPONENT_CAMERA_DIRECTION } from '@volter/editor-threejs/kit/components/standard-viewport-dressing';
|
|
58
59
|
import { threeBoardBuildingCopy } from '@volter/editor-sdk/kit/viewport-surface-status';
|
|
59
|
-
import { openRegisteredDocument } from '@volter/editor-
|
|
60
|
-
import { listProjectComponents } from '@volter/editor-
|
|
60
|
+
import { openRegisteredDocument } from '@volter/editor-sdk/kit/document-open-registry';
|
|
61
|
+
import { listProjectComponents } from '@volter/editor-sdk/kit/editor-api';
|
|
61
62
|
import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
|
|
62
63
|
import { createHmrRegistrationGroup } from '@volter/editor-sdk/kit/hmr-registration-group';
|
|
63
64
|
import { CONTRIBUTED_SECTION_ORDER } from '@volter/editor-sdk/kit/inspection-model';
|
|
@@ -66,15 +67,15 @@ import {
|
|
|
66
67
|
registerInspectorSections,
|
|
67
68
|
} from '@volter/editor-sdk/kit/inspector-section-registry';
|
|
68
69
|
import { type ClipboardWriter, runInstanceSourceAction } from '@volter/editor-sdk/kit/instance-source-actions';
|
|
69
|
-
import { getProjectStoryRegions } from '@volter/editor-
|
|
70
|
-
import { declaredStoryMedium } from '@volter/editor-
|
|
70
|
+
import { getProjectStoryRegions } from '@volter/editor-sdk/kit/stories/project-story-regions';
|
|
71
|
+
import { declaredStoryMedium } from '@volter/editor-sdk/kit/stories/story-declared-medium';
|
|
71
72
|
import { THREE_STORY_DOCUMENT_OPENER } from '@volter/editor-sdk/kit/story-document-openers';
|
|
72
73
|
import {
|
|
73
74
|
getProjectStoryModules,
|
|
74
75
|
type ProjectStoryModule,
|
|
75
76
|
subscribeProjectStoryModules,
|
|
76
77
|
whenProjectStoriesReady,
|
|
77
|
-
} from '@volter/editor-
|
|
78
|
+
} from '@volter/editor-sdk/kit/stories/story-registry';
|
|
78
79
|
import { showTransientHint } from '@volter/editor-sdk/kit/transient-hint';
|
|
79
80
|
import {
|
|
80
81
|
beginViewportBreakdown,
|
|
@@ -88,7 +89,7 @@ import {
|
|
|
88
89
|
activeWorkspaceDocument,
|
|
89
90
|
type WorkspaceDocumentContentProps,
|
|
90
91
|
} from '@volter/editor-sdk/kit/workspace-document-registry';
|
|
91
|
-
import type { WorkspaceStateStore } from '@volter/editor-
|
|
92
|
+
import type { WorkspaceStateStore } from '@volter/editor-sdk/kit/workspace-document-restore';
|
|
92
93
|
import { faCircleInfo } from '@fortawesome/free-solid-svg-icons';
|
|
93
94
|
import { themeVars } from '@volter/editor-sdk/widgets';
|
|
94
95
|
import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
@@ -737,7 +738,7 @@ export function BoardExhibitSection({ adapter, nodeId }: InspectorSectionProps)
|
|
|
737
738
|
useSyncExternalStore(subscribeThreeBoard, threeBoardVersion);
|
|
738
739
|
const candidateIds = [...(nodeId ? [nodeId] : []), ...(adapter.selection?.get() ?? [])];
|
|
739
740
|
const exhibit = candidateIds.reduce<BoardExhibit | null>(
|
|
740
|
-
(found, id) => found ?? findExhibitIn(_scene, adapter.hierarchy
|
|
741
|
+
(found, id) => found ?? findExhibitIn(_scene, threeObject(adapter.hierarchy, id)),
|
|
741
742
|
null,
|
|
742
743
|
);
|
|
743
744
|
return (
|
|
@@ -829,7 +830,7 @@ const threeBoardPreview = {
|
|
|
829
830
|
const { captureAuthoredThreeScenePreview } = await import('../../host/document-preview-three');
|
|
830
831
|
const { createStandardEnvironment } = await import('@volter/editor-threejs/viewport/environment');
|
|
831
832
|
const { applyStandardViewportDressing } = await import(
|
|
832
|
-
'@volter/editor-
|
|
833
|
+
'@volter/editor-threejs/kit/components/standard-viewport-dressing'
|
|
833
834
|
);
|
|
834
835
|
const { isEditorOwnedObject } = await import('@volter/editor-threejs/viewport/editor-layers');
|
|
835
836
|
board.root.traverse((object) => {
|
|
@@ -73,25 +73,25 @@
|
|
|
73
73
|
* only way it comes back.
|
|
74
74
|
*/
|
|
75
75
|
|
|
76
|
-
import { getProjectStoryRegions } from '@volter/editor-
|
|
76
|
+
import { getProjectStoryRegions } from '@volter/editor-sdk/kit/stories/project-story-regions';
|
|
77
77
|
import {
|
|
78
78
|
declaredStoryMedium,
|
|
79
79
|
reportUndeclaredStoryMedium,
|
|
80
|
-
} from '@volter/editor-
|
|
80
|
+
} from '@volter/editor-sdk/kit/stories/story-declared-medium';
|
|
81
81
|
import {
|
|
82
82
|
deriveStoryGroupPath,
|
|
83
83
|
formatStoryGroupPath,
|
|
84
84
|
storyGroupKey,
|
|
85
|
-
} from '@volter/editor-
|
|
86
|
-
import { type ProjectStoryModule, pickComponentPreviewStory } from '@volter/editor-
|
|
85
|
+
} from '@volter/editor-sdk/kit/stories/story-grouping';
|
|
86
|
+
import { type ProjectStoryModule, pickComponentPreviewStory } from '@volter/editor-sdk/kit/stories/story-registry';
|
|
87
87
|
import {
|
|
88
88
|
lastStoryMountPhaseTiming,
|
|
89
89
|
type MountedStoryObject3D,
|
|
90
90
|
type StoryMountInTurn,
|
|
91
91
|
type StoryPreviewComponent,
|
|
92
92
|
withStoryMountTurn,
|
|
93
|
-
} from '
|
|
94
|
-
import { mountedStoryHasThreeContent } from '@volter/editor-
|
|
93
|
+
} from '../../host/stories/story-three-preview';
|
|
94
|
+
import { mountedStoryHasThreeContent } from '@volter/editor-threejs/kit/stories/three-story-model';
|
|
95
95
|
import {
|
|
96
96
|
markViewportSegment,
|
|
97
97
|
noteViewportBreakdownCounts,
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { commandLine } from '@volter/editor-sdk/kit/product-command';
|
|
13
|
-
import type { ComponentBoard, ComponentBoardContext } from '@volter/editor-
|
|
13
|
+
import type { ComponentBoard, ComponentBoardContext } from '@volter/editor-sdk/kit/component-board-registry';
|
|
14
14
|
import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
|
|
15
15
|
import {
|
|
16
16
|
getStoryMediaPresence,
|
|
17
17
|
subscribeStoryMediaPresence,
|
|
18
18
|
} from '../../host/stories/story-media-presence';
|
|
19
|
-
import { projectStoriesReady, subscribeProjectStoryModules } from '@volter/editor-
|
|
19
|
+
import { projectStoriesReady, subscribeProjectStoryModules } from '@volter/editor-sdk/kit/stories/story-registry';
|
|
20
20
|
import { THREE_COMPONENTS_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
|
|
21
21
|
|
|
22
22
|
/** The tab reads `3D`, the peer of `Scene` and `UI` in the center strip. */
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HOST-LEVEL audio unlock for game-created AudioContexts.
|
|
3
|
-
*
|
|
4
|
-
* A game running in the editor's page can create its AudioContext before the
|
|
5
|
-
* visitor's first gesture (survivor's auto-attack lands kills while they are
|
|
6
|
-
* still reading), and browsers with a strict autoplay policy then hold it
|
|
7
|
-
* suspended until `resume()` runs INSIDE a trusted input handler. The game's
|
|
8
|
-
* own unlock listeners go through the realm's gated re-dispatch, which is no
|
|
9
|
-
* longer that trusted stack — two human passes heard both flagship canvas
|
|
10
|
-
* games silent on first load and cured them only by restarting under a
|
|
11
|
-
* gesture (runhuman 23/33).
|
|
12
|
-
*
|
|
13
|
-
* The EDITOR owns the page, so it does what a game cannot: wrap the page's
|
|
14
|
-
* AudioContext constructor once at boot to track instances, and resume any
|
|
15
|
-
* suspended one from capture-phase pointerdown/keydown handlers — the real,
|
|
16
|
-
* trusted stack. Contexts already running are untouched; the listeners stay
|
|
17
|
-
* (cheap) so a context created later unlocks on the next gesture.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
const tracked = new Set<WeakRef<AudioContext>>();
|
|
21
|
-
|
|
22
|
-
function resumeSuspended(): void {
|
|
23
|
-
for (const ref of tracked) {
|
|
24
|
-
const ctx = ref.deref();
|
|
25
|
-
if (!ctx || ctx.state === 'closed') {
|
|
26
|
-
tracked.delete(ref);
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
if (ctx.state === 'suspended') void ctx.resume();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Install once at editor boot (main.tsx). Idempotent. */
|
|
34
|
-
export function installGameAudioUnlock(): void {
|
|
35
|
-
const host = window as unknown as { __vgaiAudioUnlock?: boolean } & typeof window;
|
|
36
|
-
if (host.__vgaiAudioUnlock) return;
|
|
37
|
-
host.__vgaiAudioUnlock = true;
|
|
38
|
-
const Orig = window.AudioContext;
|
|
39
|
-
if (typeof Orig !== 'function') return;
|
|
40
|
-
window.AudioContext = class extends Orig {
|
|
41
|
-
constructor(...args: ConstructorParameters<typeof AudioContext>) {
|
|
42
|
-
super(...args);
|
|
43
|
-
tracked.add(new WeakRef(this));
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
window.addEventListener('pointerdown', resumeSuspended, { capture: true });
|
|
47
|
-
window.addEventListener('keydown', resumeSuspended, { capture: true });
|
|
48
|
-
}
|