@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,5 +1,5 @@
|
|
|
1
|
-
import { meterPercent } from '
|
|
2
|
-
import type { PerformanceFrame } from '
|
|
1
|
+
import { meterPercent } from '../../runtime/adapter/audio-meter';
|
|
2
|
+
import type { PerformanceFrame } from '../../runtime/dev/performance-profiler';
|
|
3
3
|
|
|
4
4
|
export const AUDIO_METER_SEGMENTS = 8;
|
|
5
5
|
export const PERFORMANCE_SPARKLINE_SAMPLES = 24;
|
|
@@ -8,43 +8,38 @@
|
|
|
8
8
|
* `useCenterDocuments`): it binds the Game document's tab, reports the
|
|
9
9
|
* live/stopped edge and closes every document on session teardown. What moved
|
|
10
10
|
* here is only what the kit no longer does — synthesize the Scene document
|
|
11
|
-
* the kit still routes every three root's edit document to
|
|
12
|
-
* store's `activeViewportTab` into registry activation for the Scene/Game pair.
|
|
11
|
+
* the kit still routes every three root's edit document to.
|
|
13
12
|
*
|
|
14
|
-
* THE INPUT-GATE CONTRACT (CLAUDE.md T6.3): `
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* back into registry activation (`syncSceneDocument`, run on every store
|
|
20
|
-
* notify).
|
|
21
|
-
*/
|
|
13
|
+
* THE INPUT-GATE CONTRACT (CLAUDE.md T6.3): `play-mode.ts` and the ingest
|
|
14
|
+
* lanes gate game input on `playState === 'playing' && activeViewportTab ===
|
|
15
|
+
* 'play'`. The tab is derived from workspace focus (the Game document is
|
|
16
|
+
* active), so this module never writes it and never mirrors it back into
|
|
17
|
+
* activation. */
|
|
22
18
|
|
|
23
19
|
import {
|
|
24
20
|
activeDocumentSourcePath,
|
|
25
21
|
activeSaveDestination,
|
|
26
22
|
activeSaveState,
|
|
27
|
-
} from '@volter/editor-
|
|
28
|
-
import { Object3DDocumentViewport } from '@volter/editor-
|
|
29
|
-
import type { DocumentPreviewSource } from '@volter/editor-
|
|
30
|
-
import { editorConsole } from '@volter/editor-
|
|
31
|
-
import type { EditorShellStore, ViewportTab } from '@volter/editor-
|
|
32
|
-
import { projectAdapterFacet, subscribeProjectAdapter } from '@volter/editor-
|
|
33
|
-
import { getCurrentProject } from '@volter/editor-
|
|
34
|
-
import { isolationTabsReplaceGenericScene, sceneTabRow } from '@volter/editor-
|
|
23
|
+
} from '@volter/editor-sdk/kit/authoring/shell-document-ops';
|
|
24
|
+
import { Object3DDocumentViewport } from '@volter/editor-threejs/kit/components/Object3DDocumentViewport';
|
|
25
|
+
import type { DocumentPreviewSource } from '@volter/editor-sdk/kit/document-preview-source';
|
|
26
|
+
import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
|
|
27
|
+
import type { EditorShellStore, ViewportTab } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
28
|
+
import { projectAdapterFacet, subscribeProjectAdapter } from '@volter/editor-sdk/kit/project-adapter';
|
|
29
|
+
import { getCurrentProject } from '@volter/editor-sdk/kit/active-project';
|
|
30
|
+
import { isolationTabsReplaceGenericScene, sceneTabRow } from '@volter/editor-sdk/kit/scene-document-plan';
|
|
35
31
|
import {
|
|
36
32
|
registerAvailableWorkspaceDocument,
|
|
37
33
|
unregisterAvailableWorkspaceDocument,
|
|
38
|
-
} from '@volter/editor-
|
|
39
|
-
import {
|
|
34
|
+
} from '@volter/editor-sdk/kit/workspace-available-documents';
|
|
35
|
+
import { SCENE_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
|
|
40
36
|
import {
|
|
41
37
|
activateWorkspaceDocument,
|
|
42
38
|
activeWorkspaceDocumentId,
|
|
43
|
-
openWorkspaceDocuments,
|
|
44
39
|
setWorkspaceDocumentDirty,
|
|
45
40
|
type WorkspaceDocumentContentProps,
|
|
46
41
|
type WorkspaceDocumentDescriptor,
|
|
47
|
-
} from '@volter/editor-
|
|
42
|
+
} from '@volter/editor-sdk/kit/workspace-document-registry';
|
|
48
43
|
import { Button, themeVars } from '@volter/editor-sdk/widgets';
|
|
49
44
|
import { Component, type ErrorInfo, type ReactNode, useEffect, useState } from 'react';
|
|
50
45
|
import { scheduleAfterPaint } from '../after-paint';
|
|
@@ -74,7 +69,6 @@ export interface CenterDocumentsStore {
|
|
|
74
69
|
readonly sourcePath?: string | null;
|
|
75
70
|
/** Whether the active authoring adapter has unsaved edits. */
|
|
76
71
|
readonly isDirty: boolean;
|
|
77
|
-
setActiveViewportTab(tab: ViewportTab): void;
|
|
78
72
|
}
|
|
79
73
|
|
|
80
74
|
/** The root Scene's preview stays available after its tab closes. Its source
|
|
@@ -322,35 +316,24 @@ export function createCenterDocumentDescriptors(store: CenterDocumentsStore): {
|
|
|
322
316
|
store.savePath
|
|
323
317
|
? { kind: 'scene', path: store.savePath }
|
|
324
318
|
: { kind: 'workspace', id: SCENE_DOCUMENT_ID },
|
|
325
|
-
onActivate: () => store.setActiveViewportTab('edit'),
|
|
326
319
|
};
|
|
327
320
|
return { scene };
|
|
328
321
|
}
|
|
329
322
|
|
|
330
323
|
/**
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
* no-ops. The Game document's live/stopped edge is the kit's
|
|
335
|
-
* (`useCenterDocuments`), not repeated here.
|
|
324
|
+
* Keeps the Scene document in step with the session. Idempotent — safe (and
|
|
325
|
+
* designed) to run on EVERY store notify. The Game document's live/stopped edge
|
|
326
|
+
* is the kit's (`useCenterDocuments`), not repeated here.
|
|
336
327
|
*
|
|
337
328
|
* 1. the scene document is available when the manifest has a Three root;
|
|
338
329
|
* 2. its tab's dirty dot tracks `isDirty` live (the title is fixed);
|
|
339
|
-
* 3.
|
|
340
|
-
* play/stop, `set-viewport-tab` control commands, the ingest mount lane's
|
|
341
|
-
* direct writes). A `play` tab value with no Game document open (stopped,
|
|
342
|
-
* or a transient store state) activates the scene if its tab is open.
|
|
330
|
+
* 3. with no document active at all (a first run), the scene document is.
|
|
343
331
|
*/
|
|
344
332
|
export function syncCenterDocuments(
|
|
345
333
|
store: CenterDocumentsStore,
|
|
346
334
|
docs: { scene: WorkspaceDocumentDescriptor },
|
|
347
335
|
hasThreeRoot = true,
|
|
348
336
|
): void {
|
|
349
|
-
const isOpen = (id: string) => openWorkspaceDocuments().some((d) => d.descriptor.id === id);
|
|
350
|
-
// Opening a registry document activates it. Capture the caller's requested
|
|
351
|
-
// viewport before touching the open set, then restore that intent below.
|
|
352
|
-
const requestedViewportTab = store.activeViewportTab;
|
|
353
|
-
|
|
354
337
|
const table = projectAdapterFacet()?.scenes;
|
|
355
338
|
if (hasThreeRoot && !(table && isolationTabsReplaceGenericScene(table))) {
|
|
356
339
|
const row = table
|
|
@@ -377,21 +360,7 @@ export function syncCenterDocuments(
|
|
|
377
360
|
unregisterAvailableWorkspaceDocument(SCENE_DOCUMENT_ID);
|
|
378
361
|
}
|
|
379
362
|
|
|
380
|
-
|
|
381
|
-
// being active is a legitimate state (its own onActivate already asserted
|
|
382
|
-
// the store's tab, so the T6.3 gate is off). The mirror therefore only
|
|
383
|
-
// corrects genuine disagreements about the SCENE/GAME pair:
|
|
384
|
-
// - tab says 'play' (play auto-switch, `set-viewport-tab play`) → the
|
|
385
|
-
// Game document must be active;
|
|
386
|
-
// - tab says 'edit' while the GAME document is active (external
|
|
387
|
-
// `set-viewport-tab edit` during play) → back to the scene document;
|
|
388
|
-
// - no active document at all (first run) → the scene document.
|
|
389
|
-
// An 'edit' tab with an asset/story document active is CONSISTENT and must
|
|
390
|
-
// not be "corrected".
|
|
391
|
-
const activeId = activeWorkspaceDocumentId();
|
|
392
|
-
if (requestedViewportTab === 'play' && isOpen(GAME_DOCUMENT_ID)) {
|
|
393
|
-
if (activeId !== GAME_DOCUMENT_ID) activateWorkspaceDocument(GAME_DOCUMENT_ID);
|
|
394
|
-
} else if (hasThreeRoot && (activeId === GAME_DOCUMENT_ID || activeId === null)) {
|
|
363
|
+
if (hasThreeRoot && activeWorkspaceDocumentId() === null) {
|
|
395
364
|
activateWorkspaceDocument(SCENE_DOCUMENT_ID);
|
|
396
365
|
}
|
|
397
366
|
}
|
|
@@ -409,25 +378,24 @@ export function bindSceneDocument(store: EditorShellStore): () => void {
|
|
|
409
378
|
// tab still represents the same authored TSX document.
|
|
410
379
|
let lastSourcePath: string | null = null;
|
|
411
380
|
const view: CenterDocumentsStore = {
|
|
412
|
-
subscribe: (listener) => store.subscribe(listener),
|
|
381
|
+
subscribe: (listener) => store.shell.subscribe(listener),
|
|
413
382
|
get playState() {
|
|
414
|
-
return store.playState;
|
|
383
|
+
return store.shell.playState;
|
|
415
384
|
},
|
|
416
385
|
get activeViewportTab() {
|
|
417
|
-
return store.activeViewportTab;
|
|
386
|
+
return store.shell.activeViewportTab;
|
|
418
387
|
},
|
|
419
388
|
get savePath() {
|
|
420
|
-
return activeSaveDestination(store);
|
|
389
|
+
return activeSaveDestination(store.shell);
|
|
421
390
|
},
|
|
422
391
|
get sourcePath() {
|
|
423
|
-
const current = activeDocumentSourcePath(store);
|
|
392
|
+
const current = activeDocumentSourcePath(store.shell);
|
|
424
393
|
if (current) lastSourcePath = current;
|
|
425
394
|
return lastSourcePath;
|
|
426
395
|
},
|
|
427
396
|
get isDirty() {
|
|
428
|
-
return activeSaveState(store) === 'unsaved';
|
|
397
|
+
return activeSaveState(store.shell) === 'unsaved';
|
|
429
398
|
},
|
|
430
|
-
setActiveViewportTab: (tab) => store.setActiveViewportTab(tab),
|
|
431
399
|
};
|
|
432
400
|
const docs = createCenterDocumentDescriptors(view);
|
|
433
401
|
// Missing is the legacy-safe default: manifests read by current editor
|
|
@@ -435,7 +403,7 @@ export function bindSceneDocument(store: EditorShellStore): () => void {
|
|
|
435
403
|
const run = () =>
|
|
436
404
|
syncCenterDocuments(view, docs, getCurrentProject()?.config.hasThreeRoot !== false);
|
|
437
405
|
run();
|
|
438
|
-
const unsubscribe = store.subscribe(run);
|
|
406
|
+
const unsubscribe = store.shell.subscribe(run);
|
|
439
407
|
const unsubscribeAdapter = subscribeProjectAdapter(run);
|
|
440
408
|
// Unbinding follows the session's store and leaves the document registered:
|
|
441
409
|
// a store arriving again at boot must not close a restored Scene tab. The
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* button both select a view of a bench that now ships in `@volter/editor-game`.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { showWorkspaceUtility } from '@volter/editor-
|
|
19
|
+
import { showWorkspaceUtility } from '@volter/editor-sdk/kit/workspace-host-commands';
|
|
20
20
|
|
|
21
21
|
export type ProfilerViewId = 'profiler' | 'frame';
|
|
22
22
|
|
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THE GAME'S WORLD-ROOT BINDING for the kit's stage host
|
|
3
|
-
* (`@volter/editor-
|
|
3
|
+
* (`@volter/editor-threejs/kit/components/world-root-binding`): the world's surface,
|
|
4
4
|
* its stage, and the overlays the stage shows only over a world.
|
|
5
5
|
*
|
|
6
6
|
* `Overlays` is the world-root half of vgai's `stage-overlay-set.tsx` — every
|
|
7
7
|
* part it rendered only when `worldRoot` held (the root selection layer, the
|
|
8
|
-
* camera-authoring pin, the
|
|
8
|
+
* camera-authoring pin, the scene's
|
|
9
9
|
* surface-state card). The rest of that overlay set is the kit's
|
|
10
10
|
* `StageOverlays`, which the host renders beside this.
|
|
11
11
|
*/
|
|
12
12
|
import { EDITOR_LAYER } from '@volter/editor-threejs/viewport/editor-layers';
|
|
13
|
-
import { activeAuthoringVersion, subscribeActiveAuthoring } from '@volter/editor-
|
|
13
|
+
import { activeAuthoringVersion, subscribeActiveAuthoring } from '@volter/editor-sdk/kit/authoring/active-adapter';
|
|
14
14
|
import {
|
|
15
15
|
getMountFailureReports,
|
|
16
16
|
subscribeToMountFailures,
|
|
17
|
-
} from '@volter/editor-
|
|
17
|
+
} from '@volter/editor-sdk/kit/mount-failure-report';
|
|
18
18
|
import {
|
|
19
19
|
object3DDocumentSessionsVersion,
|
|
20
20
|
subscribeObject3DDocumentSessions,
|
|
21
|
-
} from '@volter/editor-
|
|
22
|
-
import { RootSelectionOverlay } from '@volter/editor-
|
|
23
|
-
import { SurfaceStateOverlay } from '@volter/editor-
|
|
24
|
-
import { ViewportControlsHint } from '@volter/editor-core/components/ViewportControlsHint';
|
|
21
|
+
} from '@volter/editor-threejs/kit/authoring/object3d-document-session-registry';
|
|
22
|
+
import { RootSelectionOverlay } from '@volter/editor-sdk/kit/components/RootSelectionOverlay';
|
|
23
|
+
import { SurfaceStateOverlay } from '@volter/editor-sdk/kit/components/SurfaceStateOverlay';
|
|
25
24
|
import type {
|
|
26
25
|
WorldRootOverlayProps,
|
|
27
26
|
WorldRootStageBinding,
|
|
28
|
-
} from '@volter/editor-
|
|
29
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
30
|
-
import { readinessFacet, subscribeRootReadiness } from '@volter/editor-
|
|
31
|
-
import { documentStageContext
|
|
32
|
-
import { explainSurface } from '@volter/editor-
|
|
27
|
+
} from '@volter/editor-threejs/kit/components/world-root-binding';
|
|
28
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
29
|
+
import { readinessFacet, subscribeRootReadiness } from '@volter/editor-sdk/kit/readiness';
|
|
30
|
+
import { documentStageContext } from '@volter/editor-sdk/kit/stage-context';
|
|
31
|
+
import { explainSurface } from '@volter/editor-sdk/kit/surface-state';
|
|
33
32
|
import {
|
|
34
33
|
subscribeWorkspaceDocuments,
|
|
35
34
|
workspaceDocumentRegistryVersion,
|
|
36
|
-
} from '@volter/editor-
|
|
35
|
+
} from '@volter/editor-sdk/kit/workspace-document-registry';
|
|
37
36
|
import { useMemo, useSyncExternalStore } from 'react';
|
|
38
37
|
import type * as THREE from 'three';
|
|
39
38
|
import { threeSceneHasRenderableContent } from '../surface-content';
|
|
@@ -55,7 +54,7 @@ function SceneViewportStateOverlay({
|
|
|
55
54
|
rootIds: readonly string[];
|
|
56
55
|
mountStatus: 'mounting' | 'ready';
|
|
57
56
|
}) {
|
|
58
|
-
useSyncExternalStore(store.subscribe, store.getSnapshot);
|
|
57
|
+
useSyncExternalStore(store.shell.subscribe, store.shell.getSnapshot);
|
|
59
58
|
const rootReadiness = useSyncExternalStore(subscribeRootReadiness, readinessFacet);
|
|
60
59
|
const mountFailures = useSyncExternalStore(subscribeToMountFailures, getMountFailureReports);
|
|
61
60
|
const sceneBackground = store.scene?.background as THREE.Color | null | undefined;
|
|
@@ -71,7 +70,7 @@ function SceneViewportStateOverlay({
|
|
|
71
70
|
ignoredLayer: EDITOR_LAYER,
|
|
72
71
|
}),
|
|
73
72
|
),
|
|
74
|
-
[store.scene, store.contentVersion],
|
|
73
|
+
[store.scene, store.shell.contentVersion],
|
|
75
74
|
);
|
|
76
75
|
const sceneHasContent = Boolean(
|
|
77
76
|
store.scene && (sceneBackgroundIsAuthored || sceneHasRenderableObjects),
|
|
@@ -94,14 +93,13 @@ function WorldRootOverlays({
|
|
|
94
93
|
mountStatus,
|
|
95
94
|
rootIds,
|
|
96
95
|
}: WorldRootOverlayProps) {
|
|
97
|
-
useSyncExternalStore(store.subscribe, store.getShellSnapshot ?? store.getSnapshot);
|
|
96
|
+
useSyncExternalStore(store.shell.subscribe, store.shell.getShellSnapshot ?? store.shell.getSnapshot);
|
|
98
97
|
useSyncExternalStore(subscribeActiveAuthoring, activeAuthoringVersion);
|
|
99
98
|
useSyncExternalStore(subscribeObject3DDocumentSessions, object3DDocumentSessionsVersion);
|
|
100
99
|
useSyncExternalStore(subscribeWorkspaceDocuments, workspaceDocumentRegistryVersion);
|
|
101
100
|
// The world root's stage is the Scene document's: the kit's overlay props
|
|
102
101
|
// carry no document id, and the Scene document is the one world-root stage.
|
|
103
|
-
const ctx = documentStageContext(store, documentId, 'document');
|
|
104
|
-
const showsSelectionTools = threeSelectionToolsApply(ctx);
|
|
102
|
+
const ctx = documentStageContext(store.shell, documentId, 'document');
|
|
105
103
|
return (
|
|
106
104
|
<>
|
|
107
105
|
{/* Three-scene selection overlay. React/Pixi documents mount their own
|
|
@@ -114,13 +112,6 @@ function WorldRootOverlays({
|
|
|
114
112
|
(`world-root-stage.ts`), so the pin belongs to the stage that
|
|
115
113
|
installed it. */}
|
|
116
114
|
{ctx.surface === 'three' ? <CameraAuthoringOverlay previewRef={cameraPreviewRef} /> : null}
|
|
117
|
-
{/* The hint also shows WHILE the world is still mounting: a new user
|
|
118
|
-
reads the screen during those boot seconds and looks for the camera
|
|
119
|
-
controls exactly then. The kit's overlay set shows it on a three
|
|
120
|
-
surface; this adds only the mounting case it does not cover. */}
|
|
121
|
-
{!showsSelectionTools && ctx.surface !== 'three' && mountStatus === 'mounting' ? (
|
|
122
|
-
<ViewportControlsHint />
|
|
123
|
-
) : null}
|
|
124
115
|
<SceneViewportStateOverlay store={store} rootIds={rootIds} mountStatus={mountStatus} />
|
|
125
116
|
</>
|
|
126
117
|
);
|