@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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three.js story thumbnail capture (`@volter/editor-sdk/kit/story-thumbnails`): a prefab
|
|
3
|
+
* story in an offscreen R3F stage. Loads its renderer on first use.
|
|
4
|
+
*/
|
|
5
|
+
import { registerStoryThumbnailCapture, StoryMediumMismatch } from '@volter/editor-sdk/kit/story-thumbnails';
|
|
6
|
+
|
|
7
|
+
/** The three.js leg needs WebGL; jsdom (the component tests) has none. */
|
|
8
|
+
function supportsThreeCapture(): boolean {
|
|
9
|
+
return (
|
|
10
|
+
typeof WebGLRenderingContext !== 'undefined' &&
|
|
11
|
+
typeof navigator !== 'undefined' &&
|
|
12
|
+
!navigator.userAgent.toLowerCase().includes('jsdom')
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function registerThreeStoryCapture(): () => void {
|
|
17
|
+
return supportsThreeCapture()
|
|
18
|
+
? registerStoryThumbnailCapture('three', async (component, options) => {
|
|
19
|
+
const preview = await import('./story-three-preview');
|
|
20
|
+
try {
|
|
21
|
+
return await preview.captureStoryComponentThumbnail(
|
|
22
|
+
component as Parameters<typeof preview.captureStoryComponentThumbnail>[0],
|
|
23
|
+
options,
|
|
24
|
+
);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
// The reconciler's qualification rejection of a DOM story is a
|
|
27
|
+
// classification, not a failure: the caller tries its next leg.
|
|
28
|
+
if (preview.isStoryThreeClassificationRefusal(error)) {
|
|
29
|
+
throw new StoryMediumMismatch('This story is not a three.js story.');
|
|
30
|
+
}
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
: () => {};
|
|
35
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** React/Fiber primitives selected from the graph that owns a project story. */
|
|
2
|
+
|
|
3
|
+
import { createRoot as staticCreateR3FRoot, extend as staticExtendThree } from '@react-three/fiber';
|
|
4
|
+
import { createElement as staticCreateElement } from 'react';
|
|
5
|
+
import * as staticThree from 'three';
|
|
6
|
+
import { R3F_RUNTIME_PATH } from '@volter/editor-sdk/host';
|
|
7
|
+
import { isPackagedRuntime } from '@volter/editor-sdk/kit/packaged-runtime';
|
|
8
|
+
|
|
9
|
+
export interface StoryThreePreviewRuntime {
|
|
10
|
+
readonly packaged: boolean;
|
|
11
|
+
readonly createElement: typeof staticCreateElement;
|
|
12
|
+
readonly createR3FRoot: typeof staticCreateR3FRoot;
|
|
13
|
+
readonly extendThree: typeof staticExtendThree;
|
|
14
|
+
readonly three: typeof staticThree;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const STATIC_RUNTIME: StoryThreePreviewRuntime = {
|
|
18
|
+
packaged: false,
|
|
19
|
+
createElement: staticCreateElement,
|
|
20
|
+
createR3FRoot: staticCreateR3FRoot,
|
|
21
|
+
extendThree: staticExtendThree,
|
|
22
|
+
three: staticThree,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
let cachedPackagedRuntime: Promise<StoryThreePreviewRuntime> | null = null;
|
|
26
|
+
|
|
27
|
+
async function loadPackagedRuntime(): Promise<StoryThreePreviewRuntime> {
|
|
28
|
+
const mod = (await import(/* @vite-ignore */ R3F_RUNTIME_PATH)) as Record<string, unknown>;
|
|
29
|
+
for (const name of ['createElement', 'createR3FRoot', 'extendThree']) {
|
|
30
|
+
if (typeof mod[name] !== 'function') {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`The packaged R3F preview runtime did not export ${name} as a function — see ` +
|
|
33
|
+
'vite-plugin-module-doorways.ts.',
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (typeof mod['projectThree'] !== 'object' || mod['projectThree'] === null) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
'The packaged R3F preview runtime did not export projectThree — see ' +
|
|
40
|
+
'vite-plugin-module-doorways.ts.',
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
packaged: true,
|
|
45
|
+
createElement: mod['createElement'] as typeof staticCreateElement,
|
|
46
|
+
createR3FRoot: mod['createR3FRoot'] as typeof staticCreateR3FRoot,
|
|
47
|
+
extendThree: mod['extendThree'] as typeof staticExtendThree,
|
|
48
|
+
three: mod['projectThree'] as typeof staticThree,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export async function resolveStoryThreePreviewRuntime(): Promise<StoryThreePreviewRuntime> {
|
|
53
|
+
if (!(await isPackagedRuntime())) return STATIC_RUNTIME;
|
|
54
|
+
if (!cachedPackagedRuntime) cachedPackagedRuntime = loadPackagedRuntime();
|
|
55
|
+
return cachedPackagedRuntime;
|
|
56
|
+
}
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
inspectedInstanceId,
|
|
15
15
|
inspectedInstanceVersion,
|
|
16
16
|
subscribeInspectedInstance,
|
|
17
|
-
} from '@volter/editor-
|
|
17
|
+
} from '@volter/editor-sdk/kit/authoring/active-systems';
|
|
18
18
|
import {
|
|
19
19
|
type EditorPerformanceSource,
|
|
20
20
|
performanceSourceForDocument,
|
|
21
21
|
performanceSourceForGameInstance,
|
|
22
22
|
performanceSourcesVersion,
|
|
23
23
|
subscribePerformanceSources,
|
|
24
|
-
} from '@volter/editor-
|
|
24
|
+
} from '@volter/editor-sdk/kit/performance-sources';
|
|
25
25
|
import {
|
|
26
26
|
activeWorkspaceDocumentId,
|
|
27
27
|
subscribeWorkspaceDocuments,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import type * as THREE from 'three';
|
|
18
|
-
import { projectLocalSection, writeProjectLocalSection } from '@volter/editor-
|
|
18
|
+
import { projectLocalSection, writeProjectLocalSection } from '@volter/editor-sdk/kit/project-local-state';
|
|
19
19
|
|
|
20
20
|
/** The section of the project-local document this module owns. */
|
|
21
21
|
const SECTION = 'viewportPose';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { ViewportRoot } from '@volter/editor-sdk/host';
|
|
2
1
|
import { stampMountedAuthoringIds } from './authoring/mounted-authoring';
|
|
3
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
4
|
-
import { stampThreeIdentities } from '@volter/editor-
|
|
2
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
3
|
+
import { stampThreeIdentities } from '@volter/editor-threejs/kit/projection/three';
|
|
4
|
+
import { threeRoot } from '@volter/editor-threejs/adapter/three-contract';
|
|
5
|
+
import type { ViewportRoot } from '@volter/editor-threejs/viewport-api';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* The Three viewport's PRESENTER — what `the world root's stage` binds as
|
|
8
|
-
* `
|
|
9
|
+
* `presentViewportRoots` (`@volter/editor-threejs/viewport-door`). The lane that mounted
|
|
9
10
|
* the roots sees only the returned presentation handle. Native Three scene
|
|
10
11
|
* adoption, identity stamping, and restoration stay here, beside the
|
|
11
12
|
* viewport surface that understands them. A composition with no Three root
|
|
@@ -17,7 +18,7 @@ export function presentThreeRoots(
|
|
|
17
18
|
): { readonly worldId: string; dispose(): void } | null {
|
|
18
19
|
const world = roots.find((candidate) => candidate.mounted.kind === 'three');
|
|
19
20
|
if (!world || world.mounted.kind !== 'three') return null;
|
|
20
|
-
const scene = world.mounted.scene;
|
|
21
|
+
const scene = threeRoot(world.mounted).scene;
|
|
21
22
|
const mountedAuthoring = world.mounted.authoring;
|
|
22
23
|
if (mountedAuthoring) stampMountedAuthoringIds(scene, mountedAuthoring);
|
|
23
24
|
stampThreeIdentities(scene, liveWorldId(world.id));
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* makes that whole graph acyclic.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
15
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
16
16
|
import type { MeasuredLoop } from '../host/same-realm-loop-gate';
|
|
17
17
|
import type { DomAuthoringAdapter } from '../react/dom-authoring-adapter';
|
|
18
18
|
import type { AuthoringAdapter } from '@volter/editor-project/adapter/authoring';
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* only AuthoringAdapter/CompositeAuthoringAdapter currency.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { CompositeAuthoringAdapter } from '@volter/editor-
|
|
7
|
+
import { CompositeAuthoringAdapter } from '@volter/editor-sdk/kit/authoring/composite-authoring-adapter';
|
|
8
8
|
import {
|
|
9
9
|
findCanvasUiElements,
|
|
10
10
|
findPrimaryCanvas,
|
|
11
11
|
type OverlayElement,
|
|
12
12
|
} from '../../host/coverage/capability-coverage';
|
|
13
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
13
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
14
14
|
import { authoringJournal } from '../../host/history/json-history-resource';
|
|
15
|
-
import { sourceWriteBackendIfPrimed } from '@volter/editor-
|
|
15
|
+
import { sourceWriteBackendIfPrimed } from '@volter/editor-sdk/kit/ui-source/tier-source-write-backend';
|
|
16
16
|
import { DomAuthoringAdapter, type DomElementLike } from '../../react/dom-authoring-adapter';
|
|
17
17
|
import {
|
|
18
18
|
type OidElementLike,
|
|
@@ -128,7 +128,7 @@ function domSurfaceAdapter(
|
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
const writeBackend = sourceWriteBackendIfPrimed('An ingested game’s DOM UI surface');
|
|
131
|
-
return new ReactRootAuthoringAdapter(liveUiRoot, store, {
|
|
131
|
+
return new ReactRootAuthoringAdapter(liveUiRoot, store.shell, {
|
|
132
132
|
...(writeBackend ? { writeBackend } : {}),
|
|
133
133
|
});
|
|
134
134
|
}
|
|
@@ -17,27 +17,27 @@
|
|
|
17
17
|
* content uses — no separate editor data model.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { authoringOidOf } from '@volter/editor-
|
|
20
|
+
import { authoringOidOf } from '@volter/editor-threejs/kit/authoring/component-instance-root';
|
|
21
21
|
import { setIngestDataWriter } from '../../host/authoring/ingest-data-writer';
|
|
22
22
|
import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
|
|
23
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
23
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
24
24
|
import { GAME_SURFACE_CONTAINMENT_CSS } from '../../host/game-realm-page';
|
|
25
25
|
import { clearGameSurface, gameLoopGate, setGameSurface } from '../../host/gated-globals';
|
|
26
26
|
import { authoringJournal } from '../../host/history/json-history-resource';
|
|
27
27
|
import { clearPresentationSurface, recordPresentationSurface } from '@volter/editor-sdk/kit/presentation-surface';
|
|
28
|
-
import { getCurrentProject } from '@volter/editor-
|
|
28
|
+
import { getCurrentProject } from '@volter/editor-sdk/kit/active-project';
|
|
29
29
|
import { clearRootReadiness, recordRootReadiness } from '@volter/editor-sdk/kit/readiness';
|
|
30
30
|
import {
|
|
31
31
|
type SameRealmLoopGate,
|
|
32
32
|
type SameRealmLoopVerdict,
|
|
33
33
|
verifySameRealmLoopControl,
|
|
34
34
|
} from '../../host/same-realm-loop-gate';
|
|
35
|
-
import { ensureScopedGameStyles } from '@volter/editor-
|
|
35
|
+
import { ensureScopedGameStyles } from '@volter/editor-sdk/kit/scoped-game-css';
|
|
36
36
|
import { resolveThreeIngestRuntimeForEditor } from '../../host/three-ingest-runtime';
|
|
37
37
|
import type { OidEntry } from '@volter/editor-react/source/oid-transform';
|
|
38
|
-
import { createHttpSourceWriteBackend } from '@volter/editor-
|
|
39
|
-
import { serverRecordsSourceWrites } from '@volter/editor-
|
|
40
|
-
import { clearWorldAdoption, worldAdoptionRecorder } from '@volter/editor-
|
|
38
|
+
import { createHttpSourceWriteBackend } from '@volter/editor-sdk/kit/ui-source/source-write-backend';
|
|
39
|
+
import { serverRecordsSourceWrites } from '@volter/editor-sdk/kit/ui-source/tier-source-write-backend';
|
|
40
|
+
import { clearWorldAdoption, worldAdoptionRecorder } from '@volter/editor-sdk/kit/world-adoption';
|
|
41
41
|
import { markGameCssScope } from '@volter/editor-sdk/session/game-css-scope';
|
|
42
42
|
import type { MountedThreeRoot } from '@volter/editor-project/adapter';
|
|
43
43
|
import {
|
|
@@ -798,7 +798,7 @@ export async function mountIngestGame(
|
|
|
798
798
|
// `collectState` is push-based — the control API would keep serving a
|
|
799
799
|
// snapshot taken before the measurement existed, reporting `loop: null`
|
|
800
800
|
// forever. Broadcast so `vgai status` sees the verdict it just produced.
|
|
801
|
-
onVerdict: () => store.notifyIngestEdit(),
|
|
801
|
+
onVerdict: () => store.shell.notifyIngestEdit(),
|
|
802
802
|
});
|
|
803
803
|
// The game's DECLARED system surface (`window.vgaiGame.systems`), projected
|
|
804
804
|
// onto the host's ordinary `SystemAdapters.debug`. `activateCapturedThreeIngest`
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
|
|
33
33
|
import { activateLiveDocument } from '@volter/editor-sdk/kit/live-document';
|
|
34
34
|
import { commandLine } from '@volter/editor-sdk/kit/product-command';
|
|
35
|
-
import { queueEditModeRebuild } from '@volter/editor-
|
|
36
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
37
|
-
import { fetchGameManifest } from '@volter/editor-
|
|
35
|
+
import { queueEditModeRebuild } from '@volter/editor-sdk/kit/authoring/edit-mode-authoring';
|
|
36
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
37
|
+
import { fetchGameManifest } from '@volter/editor-sdk/kit/manifest-project';
|
|
38
38
|
import {
|
|
39
39
|
type ProjectAdapterFacet,
|
|
40
40
|
projectAdapterFacet,
|
|
41
41
|
subscribeProjectAdapter,
|
|
42
|
-
} from '@volter/editor-
|
|
43
|
-
import { sceneTabRow } from '@volter/editor-
|
|
42
|
+
} from '@volter/editor-sdk/kit/project-adapter';
|
|
43
|
+
import { sceneTabRow } from '@volter/editor-sdk/kit/scene-document-plan';
|
|
44
44
|
import { ingestRoots } from '@volter/editor-project/adapter/manifest-interpreter';
|
|
45
45
|
import { activeIngest } from './active-ingest';
|
|
46
46
|
import {
|
|
@@ -208,7 +208,7 @@ export function exitDeferredIngestPlay(store: EditorShellStore): boolean {
|
|
|
208
208
|
// ownership note) — it unmounts by kind, clears the authoring override and
|
|
209
209
|
// the adopted scene, and resets the play surface.
|
|
210
210
|
exitActiveIngest();
|
|
211
|
-
store.setPlayState('stopped');
|
|
211
|
+
store.shell.setPlayState('stopped');
|
|
212
212
|
// Edit mode is rebuilt through the ONE authoritative reinstall path
|
|
213
213
|
// (`the world root's stage`'s `installAll`), which is what recreates the R3F design
|
|
214
214
|
// session over the world component.
|
|
@@ -34,8 +34,8 @@ import {
|
|
|
34
34
|
PUBLIC_INGEST_BASE,
|
|
35
35
|
publicIngestManifestUrl,
|
|
36
36
|
} from '../host/staged-projects';
|
|
37
|
-
import { extractUpstreamPin } from '
|
|
38
|
-
import type { IngestGame2D } from '
|
|
37
|
+
import { extractUpstreamPin } from '../runtime/adapter/ingest/upstream-pin';
|
|
38
|
+
import type { IngestGame2D } from '../runtime/pixi/ingest';
|
|
39
39
|
import { declaredRoots } from '@volter/editor-project/adapter/manifest-interpreter';
|
|
40
40
|
import { loadGameManifest } from '@volter/editor-project/manifest/load';
|
|
41
41
|
import { composeIngestLoad, ingestDataWriter } from './entry-load';
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
|
|
19
|
-
import { projectAdapterFacet } from '@volter/editor-
|
|
20
|
-
import { sceneDocumentId } from '@volter/editor-
|
|
19
|
+
import { projectAdapterFacet } from '@volter/editor-sdk/kit/project-adapter';
|
|
20
|
+
import { sceneDocumentId } from '@volter/editor-sdk/kit/scene-document-plan';
|
|
21
21
|
import { CANVAS_SCENE_DOCUMENT_ID, SCENE_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
|
|
22
22
|
import {
|
|
23
23
|
activateWorkspaceDocument,
|
|
@@ -18,18 +18,18 @@ import {
|
|
|
18
18
|
getMountFailureReports,
|
|
19
19
|
subscribeToMountFailures,
|
|
20
20
|
} from '@volter/editor-sdk/kit/mount-failure-report';
|
|
21
|
-
import { installCanvasSceneNavigation } from '@volter/editor-
|
|
21
|
+
import { installCanvasSceneNavigation } from '@volter/editor-sdk/kit/authoring/react-canvas-navigation';
|
|
22
22
|
import { createRootViewController } from '@volter/editor-sdk/kit/world-pan-state';
|
|
23
23
|
import {
|
|
24
24
|
CANVAS_SCENE_BACKGROUND,
|
|
25
25
|
CanvasSceneBackdrop,
|
|
26
26
|
CanvasSceneControls,
|
|
27
|
-
} from '@volter/editor-
|
|
28
|
-
import { RootSelectionOverlay } from '@volter/editor-
|
|
29
|
-
import { SurfaceStateOverlay } from '@volter/editor-
|
|
30
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
27
|
+
} from '@volter/editor-sdk/kit/components/CanvasSceneViewport';
|
|
28
|
+
import { RootSelectionOverlay } from '@volter/editor-sdk/kit/components/RootSelectionOverlay';
|
|
29
|
+
import { SurfaceStateOverlay } from '@volter/editor-sdk/kit/components/SurfaceStateOverlay';
|
|
30
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
31
31
|
import { liveDocumentContainer } from '@volter/editor-sdk/kit/live-document';
|
|
32
|
-
import { projectAdapterFacet } from '@volter/editor-
|
|
32
|
+
import { projectAdapterFacet } from '@volter/editor-sdk/kit/project-adapter';
|
|
33
33
|
import { readinessFacet, subscribeRootReadiness } from '@volter/editor-sdk/kit/readiness';
|
|
34
34
|
import { explainSurface } from '@volter/editor-sdk/kit/surface-state';
|
|
35
35
|
import {
|
|
@@ -71,7 +71,7 @@ export function IngestCanvasSceneContent({
|
|
|
71
71
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
72
72
|
const viewRef = useRef(createRootViewController());
|
|
73
73
|
const view = viewRef.current;
|
|
74
|
-
useSyncExternalStore(store.subscribe, store.getSnapshot);
|
|
74
|
+
useSyncExternalStore(store.shell.subscribe, store.shell.getSnapshot);
|
|
75
75
|
const rootReadiness = useSyncExternalStore(subscribeRootReadiness, readinessFacet);
|
|
76
76
|
const mountFailures = useSyncExternalStore(subscribeToMountFailures, getMountFailureReports);
|
|
77
77
|
const live = activeIngest();
|
|
@@ -98,7 +98,7 @@ export function IngestCanvasSceneContent({
|
|
|
98
98
|
useEffect(() => {
|
|
99
99
|
return registerWorkspaceDocumentSelection(documentId, () => ({
|
|
100
100
|
adapter,
|
|
101
|
-
nodeId: [...store.selectedEntityIds].find((id) => adapter.hierarchy.node(id)) ?? null,
|
|
101
|
+
nodeId: [...store.shell.selectedEntityIds].find((id) => adapter.hierarchy.node(id)) ?? null,
|
|
102
102
|
}));
|
|
103
103
|
}, [adapter, documentId, store]);
|
|
104
104
|
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* installer can be unit-tested without pulling Pixi/Three into jsdom.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { projectAdapterFacet } from '@volter/editor-
|
|
8
|
-
import { isolationTabsReplaceGenericScene } from '@volter/editor-
|
|
7
|
+
import { projectAdapterFacet } from '@volter/editor-sdk/kit/project-adapter';
|
|
8
|
+
import { isolationTabsReplaceGenericScene } from '@volter/editor-sdk/kit/scene-document-plan';
|
|
9
9
|
import { CANVAS_SCENE_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
|
|
10
10
|
import {
|
|
11
11
|
activateWorkspaceDocument,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
openWorkspaceDocument,
|
|
14
14
|
type WorkspaceDocumentContentProps,
|
|
15
15
|
} from '@volter/editor-sdk/kit/workspace-document-registry';
|
|
16
|
-
import { registerRootDocumentRoute } from '@volter/editor-
|
|
16
|
+
import { registerRootDocumentRoute } from '@volter/editor-sdk/kit/world-document-routing';
|
|
17
17
|
import type { ReactNode } from 'react';
|
|
18
18
|
import { activeIngest } from './active-ingest';
|
|
19
19
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* appears here because the mounted object actually has it.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { getActiveSystems } from '@volter/editor-
|
|
12
|
+
import { getActiveSystems } from '@volter/editor-sdk/kit/authoring/active-systems';
|
|
13
13
|
import { loadIngestOwnership } from '../host/authoring/ingest-source-persistence';
|
|
14
14
|
import { gameLoopGate } from '../host/gated-globals';
|
|
15
15
|
import type { DomAuthoringAdapter } from '../react/dom-authoring-adapter';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `composite-screenshot.ts` reads a game's canvas with `drawImage`, and that
|
|
8
8
|
* only works on a WebGL canvas whose context was created with
|
|
9
9
|
* `preserveDrawingBuffer: true`. Every canvas the vgai RUNTIME mounts sets it
|
|
10
|
-
* (`@volter/game
|
|
10
|
+
* (`@volter/editor-game/runtime/create-runtime`), which is why the composite leg has always
|
|
11
11
|
* worked for first-party play. An INGESTED game creates its own canvas: the
|
|
12
12
|
* racing-game's `<Canvas>` passes no `gl` prop, so fiber's default
|
|
13
13
|
* (`preserveDrawingBuffer: false`) applies, the browser discards the drawing
|
|
@@ -58,7 +58,7 @@ export function ingestPlaying(): boolean {
|
|
|
58
58
|
* THE one write to the ingest play state.
|
|
59
59
|
*
|
|
60
60
|
* An ingested game's input is gated by the same mechanisms a first-party play
|
|
61
|
-
* session's is (
|
|
61
|
+
* session's is (`gated-globals.ts`'s
|
|
62
62
|
* lexical window/document shadow), driven by the input gate the mount installs.
|
|
63
63
|
*/
|
|
64
64
|
export function setIngestPlaying(playing: boolean): void {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* five WebGL2 draw entry points on whatever real context it is handed and knows
|
|
35
35
|
* nothing about three — so it is reused verbatim over the captured Pixi
|
|
36
36
|
* renderer's own `gl`. The bracket is the renderer's own published seam, its
|
|
37
|
-
* `prerender`/`postrender` runners (`@volter/game
|
|
37
|
+
* `prerender`/`postrender` runners (`@volter/editor-game/runtime/pixi/render-pass-bracket`).
|
|
38
38
|
*
|
|
39
39
|
* What is NOT there is per-draw attribution, and it is absent for a structural
|
|
40
40
|
* reason rather than a missing patch point: three calls `onBeforeRender` on the
|
|
@@ -56,21 +56,21 @@
|
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
58
|
import { adapterObservations } from '@volter/editor-sdk/kit/adapter-observation';
|
|
59
|
-
import { createContractDebugAdapter } from '
|
|
59
|
+
import { createContractDebugAdapter } from '../runtime/adapter/ingest/contract-debug-adapter';
|
|
60
60
|
import {
|
|
61
61
|
type ContractSurface,
|
|
62
62
|
projectContractSystemAdapters,
|
|
63
|
-
} from '
|
|
64
|
-
import { mergeDebugAdapters } from '
|
|
65
|
-
import { createObservationDebugAdapter } from '
|
|
63
|
+
} from '../runtime/adapter/ingest/contract-system-adapters';
|
|
64
|
+
import { mergeDebugAdapters } from '../runtime/adapter/ingest/merge-debug-adapters';
|
|
65
|
+
import { createObservationDebugAdapter } from '../runtime/adapter/ingest/observation-debug-adapter';
|
|
66
66
|
import {
|
|
67
67
|
createRenderDebugAdapter,
|
|
68
68
|
frameCaptureContextFor,
|
|
69
69
|
type RenderDebugWiring,
|
|
70
|
-
} from '
|
|
71
|
-
import { collectRenderMemory } from '
|
|
72
|
-
import { createWebGLFrameCapture } from '
|
|
73
|
-
import { pixiRenderingContext } from '
|
|
70
|
+
} from '../runtime/dev/render-debug-adapter';
|
|
71
|
+
import { collectRenderMemory } from '../runtime/dev/render-memory';
|
|
72
|
+
import { createWebGLFrameCapture } from '../runtime/dev/webgl-frame-capture';
|
|
73
|
+
import { pixiRenderingContext } from '../runtime/pixi/render-pass-bracket';
|
|
74
74
|
import type { ObservationDeclaration } from '@volter/editor-project/adapter/adapter-module';
|
|
75
75
|
import type { VgaiGameSystems } from '@volter/editor-project/adapter/ingest/game-contract';
|
|
76
76
|
import type { SystemAdapters } from '@volter/editor-project/adapter/system-adapter';
|
|
@@ -197,7 +197,7 @@ export interface IngestSystemsWiring {
|
|
|
197
197
|
* Four sources, each with a different provenance:
|
|
198
198
|
* - `debug` — projected from the contract's own `commands`/`state`;
|
|
199
199
|
* - `debug`, AGAIN — projected from the loaded ADAPTER's observation
|
|
200
|
-
* declarations (`@volter/game
|
|
200
|
+
* declarations (`@volter/editor-game/runtime/adapter/ingest/observation-debug-adapter`).
|
|
201
201
|
* These two are peers onto ONE slot, so they are MERGED
|
|
202
202
|
* (`merge-debug-adapters.ts`) rather than layered: a name declared by both
|
|
203
203
|
* is refused by a coded error naming both sources, never shadowed;
|
|
@@ -8,11 +8,8 @@
|
|
|
8
8
|
* degrading loudly per world rather than silently ignoring them (the F24/F9
|
|
9
9
|
* anti-pattern this closes):
|
|
10
10
|
*
|
|
11
|
-
* - a builtin `dom` world — a bare
|
|
12
|
-
*
|
|
13
|
-
* fabricate first-party data (anti-shim) — the sibling's own `useWorldState`/
|
|
14
|
-
* `useGame` calls are simply unavailable, and this says so once per world.
|
|
15
|
-
* Has no loop at all, so its `SiblingMount.setPaused` stays `undefined`
|
|
11
|
+
* - a builtin `dom` world — a bare DOM layer, D-V3, rendered like every `dom`
|
|
12
|
+
* root. Has no loop at all, so its `SiblingMount.setPaused` stays `undefined`
|
|
16
13
|
* (D-B1) — never a fabricated no-op.
|
|
17
14
|
* - `{ module }` (any kind) OR a builtin `three`/`canvas` world
|
|
18
15
|
* (D-B3 — the residual this closes: a second `{ ingest }` world is
|
|
@@ -48,22 +45,22 @@ import {
|
|
|
48
45
|
formatMountFailureMessage,
|
|
49
46
|
} from '@volter/editor-sdk/kit/mount-failure-report';
|
|
50
47
|
import { withStoreSelection } from '../host/authoring/mounted-authoring';
|
|
51
|
-
import { makeNoAuthoringAdapter } from '@volter/editor-
|
|
48
|
+
import { makeNoAuthoringAdapter } from '@volter/editor-sdk/kit/authoring/no-authoring-adapter';
|
|
52
49
|
import { PixiAuthoringAdapter } from '../host/authoring/pixi-authoring-adapter';
|
|
53
50
|
import { createLiveCanvasWriteTarget } from '../host/authoring/pixi-live-write-target';
|
|
54
51
|
import { resolveCanvasPixiForEditor } from '../host/canvas-entry-runtime';
|
|
55
52
|
import { CrashNullBoundary } from '@volter/editor-sdk/kit/crash-null-boundary';
|
|
56
53
|
import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
|
|
57
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
54
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
58
55
|
import { authoringJournal } from '../host/history/json-history-resource';
|
|
59
56
|
import { activeRealmServices } from '../host/realm-services';
|
|
60
57
|
import { resolveReactAdapterRootComponent } from '../host/roots/react-root';
|
|
61
|
-
import { sourceWriteBackendIfPrimed } from '@volter/editor-
|
|
58
|
+
import { sourceWriteBackendIfPrimed } from '@volter/editor-sdk/kit/ui-source/tier-source-write-backend';
|
|
62
59
|
import { DomAuthoringAdapter } from '../react/dom-authoring-adapter';
|
|
63
60
|
import { ReactRootAuthoringAdapter, walkOidTree } from '../react/react-world-authoring-adapter';
|
|
64
61
|
import { beginProjectMountEpoch } from '@volter/editor-sdk/session/project-module-url';
|
|
65
|
-
import { createPhysics2DRegistry } from '
|
|
66
|
-
import { createPhysicsAdapter2D } from '
|
|
62
|
+
import { createPhysics2DRegistry } from '../runtime/pixi/physics-registry';
|
|
63
|
+
import { createPhysicsAdapter2D } from '../runtime/pixi/system-adapters';
|
|
67
64
|
import type { AuthoringAdapter } from '@volter/editor-project/adapter';
|
|
68
65
|
import { declaredRoots } from '@volter/editor-project/adapter/manifest-interpreter';
|
|
69
66
|
import type { ResolvedAdapterRoot, ResolvedGameManifest } from '@volter/editor-project/manifest/load';
|
|
@@ -136,15 +133,13 @@ function styleSiblingLayer(
|
|
|
136
133
|
}
|
|
137
134
|
|
|
138
135
|
/**
|
|
139
|
-
* D-V3: mount a `default-react` sibling as a bare DOM layer
|
|
140
|
-
*
|
|
141
|
-
* Reuses `binding-resolver.ts`'s exact entry-loading step
|
|
136
|
+
* D-V3: mount a `default-react` sibling as a bare DOM layer, the way every
|
|
137
|
+
* `dom` root renders. Reuses `binding-resolver.ts`'s exact entry-loading step
|
|
142
138
|
* (`resolveReactAdapterRootComponent` — the same D4 `scene`-forbidden/
|
|
143
139
|
* `entry`-required checks and default-export validation
|
|
144
140
|
* `resolveDefaultReactAdapter` itself uses) rather than duplicating it.
|
|
145
141
|
*
|
|
146
|
-
* If the entry component throws at mount/first render
|
|
147
|
-
* calls `useGame`/`useWorldState` with no provider in the tree), the error
|
|
142
|
+
* If the entry component throws at mount/first render, the error
|
|
148
143
|
* boundary above catches it, this function removes the layer it just
|
|
149
144
|
* created, and RETHROWS so the caller's uniform per-sibling catch
|
|
150
145
|
* (`mountOneIngestSibling`'s caller, {@link mountIngestSiblings}) can turn it
|
|
@@ -168,13 +163,6 @@ async function mountDefaultReactSibling(
|
|
|
168
163
|
styleSiblingLayer(layer, world, 'none');
|
|
169
164
|
gameContainer.appendChild(layer);
|
|
170
165
|
|
|
171
|
-
// D-V3: one structured note per world naming the degrade — never silent
|
|
172
|
-
// about the missing bridge.
|
|
173
|
-
editorConsole.log(
|
|
174
|
-
`react sibling "${world.id}": no native Game beside an ingest world — useWorldState unavailable`,
|
|
175
|
-
'ingest',
|
|
176
|
-
);
|
|
177
|
-
|
|
178
166
|
const root = createRoot(layer);
|
|
179
167
|
let caught: unknown = null;
|
|
180
168
|
// `flushSync` forces the initial mount (render + commit + error-boundary
|
|
@@ -227,7 +215,7 @@ async function mountDefaultReactSibling(
|
|
|
227
215
|
// built — `ui-source/tier-source-write-backend.ts`, and the packaged-
|
|
228
216
|
// editor bug the old `import.meta.env.DEV` gate carried here.
|
|
229
217
|
const writeBackend = sourceWriteBackendIfPrimed('An ingest sibling’s react layer');
|
|
230
|
-
authoring = new ReactRootAuthoringAdapter(layer, store, {
|
|
218
|
+
authoring = new ReactRootAuthoringAdapter(layer, store.shell, {
|
|
231
219
|
...(writeBackend ? { writeBackend } : {}),
|
|
232
220
|
});
|
|
233
221
|
} else {
|
|
@@ -348,7 +336,7 @@ async function mountScopedRuntimeSibling(
|
|
|
348
336
|
authoring =
|
|
349
337
|
worldInstance.mounted.authoring ??
|
|
350
338
|
makeNoAuthoringAdapter(
|
|
351
|
-
store,
|
|
339
|
+
store.shell,
|
|
352
340
|
`${world.id} (${worldInstance.mounted.kind === 'canvas' ? worldInstance.mounted.substrate.name : 'unknown'} authoring unavailable)`,
|
|
353
341
|
);
|
|
354
342
|
} else {
|
|
@@ -368,7 +356,7 @@ async function mountScopedRuntimeSibling(
|
|
|
368
356
|
});
|
|
369
357
|
}
|
|
370
358
|
} else {
|
|
371
|
-
authoring = makeNoAuthoringAdapter(store, `${world.id} (no authoring surface)`);
|
|
359
|
+
authoring = makeNoAuthoringAdapter(store.shell, `${world.id} (no authoring surface)`);
|
|
372
360
|
}
|
|
373
361
|
}
|
|
374
362
|
return {
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { measureAdapterReach } from '../host/adapter-reach';
|
|
9
|
-
import { setActiveAuthoring } from '@volter/editor-
|
|
10
|
-
import { setActiveSystems } from '@volter/editor-
|
|
9
|
+
import { setActiveAuthoring } from '@volter/editor-sdk/kit/authoring/active-adapter';
|
|
10
|
+
import { setActiveSystems } from '@volter/editor-sdk/kit/authoring/active-systems';
|
|
11
11
|
import {
|
|
12
12
|
addMountFailureReport,
|
|
13
13
|
clearMountFailureReports,
|
|
14
14
|
formatMountFailureMessage,
|
|
15
15
|
} from '@volter/editor-sdk/kit/mount-failure-report';
|
|
16
|
-
import { makeNoAuthoringAdapter } from '@volter/editor-
|
|
16
|
+
import { makeNoAuthoringAdapter } from '@volter/editor-sdk/kit/authoring/no-authoring-adapter';
|
|
17
17
|
import { resolveAllRoots } from '../host/binding-resolver';
|
|
18
18
|
import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
|
|
19
|
-
import type { EditorShellStore } from '@volter/editor-
|
|
20
|
-
import { fetchGameManifest } from '@volter/editor-
|
|
21
|
-
import { getCurrentProject } from '@volter/editor-
|
|
22
|
-
import type { GameSession, RootMountSpec } from '
|
|
19
|
+
import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
|
|
20
|
+
import { fetchGameManifest } from '@volter/editor-sdk/kit/manifest-project';
|
|
21
|
+
import { getCurrentProject } from '@volter/editor-sdk/kit/active-project';
|
|
22
|
+
import type { GameSession, RootMountSpec } from '../runtime/create-runtime';
|
|
23
23
|
import type { AuthoringAdapter } from '@volter/editor-project/adapter';
|
|
24
24
|
import { declaredRoots, ingestRoots } from '@volter/editor-project/adapter/manifest-interpreter';
|
|
25
25
|
import type { ResolvedAdapterRoot, ResolvedGameManifest } from '@volter/editor-project/manifest/load';
|
|
@@ -54,8 +54,8 @@ export function withStoreSelection(
|
|
|
54
54
|
return {
|
|
55
55
|
...authoring,
|
|
56
56
|
selection: {
|
|
57
|
-
get: () => [...store.selectedEntityIds],
|
|
58
|
-
set: (ids) => store.selectMultiple(ids),
|
|
57
|
+
get: () => [...store.shell.selectedEntityIds],
|
|
58
|
+
set: (ids) => store.shell.selectMultiple(ids),
|
|
59
59
|
},
|
|
60
60
|
};
|
|
61
61
|
}
|
|
@@ -68,7 +68,7 @@ export function exitModuleMode(): void {
|
|
|
68
68
|
setActiveAuthoring(null);
|
|
69
69
|
setActiveSystems(null);
|
|
70
70
|
clearMountFailureReports(); // D-W3: no session -> nothing left to report (mirrors ingest/mount-ingest-root.ts's unmountThreeIngestRoot)
|
|
71
|
-
s.store.setPlayState('stopped');
|
|
71
|
+
s.store.shell.setPlayState('stopped');
|
|
72
72
|
try {
|
|
73
73
|
s.stop();
|
|
74
74
|
} catch {
|
|
@@ -93,7 +93,7 @@ export async function mountModuleRootRuntime(
|
|
|
93
93
|
width: number,
|
|
94
94
|
height: number,
|
|
95
95
|
): Promise<{ session: GameSession; specs: RootMountSpec[] }> {
|
|
96
|
-
const { createGameRuntime } = await import('
|
|
96
|
+
const { createGameRuntime } = await import('../runtime/create-runtime');
|
|
97
97
|
const specs = await resolveAllRoots({ ...manifest, roots: [world] }, projectRoot);
|
|
98
98
|
const session = await createGameRuntime({ container, roots: specs, width, height });
|
|
99
99
|
return { session, specs };
|
|
@@ -114,7 +114,7 @@ export async function enterModuleModeFromManifestRoot(
|
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
store.setPlayState('playing');
|
|
117
|
+
store.shell.setPlayState('playing');
|
|
118
118
|
editorConsole.log(
|
|
119
119
|
`Mounting custom adapter module for world "${world.id}" (kind: ${world.surface})`,
|
|
120
120
|
'adapter',
|
|
@@ -142,11 +142,11 @@ export async function enterModuleModeFromManifestRoot(
|
|
|
142
142
|
activeAuthoring = withStoreSelection(mounted.authoring, store);
|
|
143
143
|
} else {
|
|
144
144
|
// Honest answer for a module adapter that declares no authoring surface.
|
|
145
|
-
activeAuthoring = makeNoAuthoringAdapter(store, `${adapterId} (no authoring surface)`);
|
|
145
|
+
activeAuthoring = makeNoAuthoringAdapter(store.shell, `${adapterId} (no authoring surface)`);
|
|
146
146
|
}
|
|
147
147
|
setActiveAuthoring(activeAuthoring);
|
|
148
148
|
setActiveSystems(mounted.systems ?? {});
|
|
149
|
-
store.notifyIngestEdit();
|
|
149
|
+
store.shell.notifyIngestEdit();
|
|
150
150
|
clearMountFailureReports(); // D-W3: mount succeeded
|
|
151
151
|
|
|
152
152
|
// Measured from the mounted adapter rather than declared by the route.
|