@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
|
@@ -42,16 +42,24 @@
|
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* What the host stamps on an adopted surface so
|
|
46
|
-
* overlay is contained to the pane.
|
|
45
|
+
* What the host stamps on an adopted surface so it behaves as the game's own page.
|
|
47
46
|
*
|
|
48
47
|
* `contain: layout` makes the element a containing block for absolutely AND
|
|
49
|
-
* fixed positioned descendants
|
|
50
|
-
* the side effects of the alternatives
|
|
51
|
-
* containing block but force a compositing layer and,
|
|
52
|
-
* itself, are exactly the stamp {@link claimHostSurfaceBox} exists to
|
|
48
|
+
* fixed positioned descendants, so a game's `position:fixed` overlay is contained to the
|
|
49
|
+
* pane — the one CSS primitive that does this without the side effects of the alternatives
|
|
50
|
+
* (`transform`/`filter` also create the containing block but force a compositing layer and,
|
|
51
|
+
* on the ADOPTED element itself, are exactly the stamp {@link claimHostSurfaceBox} exists to
|
|
52
|
+
* clear).
|
|
53
|
+
*
|
|
54
|
+
* The inherited text properties start from a page's defaults, as the game's `<body>` does
|
|
55
|
+
* when it ships: otherwise the editor's own typography (11px, its line height and colour)
|
|
56
|
+
* inherited into the game's DOM, and a game's text rendered smaller in the editor than in
|
|
57
|
+
* its build.
|
|
53
58
|
*/
|
|
54
|
-
export const GAME_SURFACE_CONTAINMENT_CSS =
|
|
59
|
+
export const GAME_SURFACE_CONTAINMENT_CSS =
|
|
60
|
+
'contain: layout; font: initial; color: initial; letter-spacing: normal; word-spacing: normal;' +
|
|
61
|
+
' text-align: start; text-indent: 0; text-transform: none; white-space: normal;' +
|
|
62
|
+
' direction: ltr; cursor: auto; visibility: visible;';
|
|
55
63
|
|
|
56
64
|
/** `EventTarget`'s own listener identity is (type, callback, capture) — read
|
|
57
65
|
* the capture flag out of either options form so the page's registration
|
|
@@ -82,7 +90,7 @@ export const SCOPED_STYLE_MARK = 'vgaiScopedCss';
|
|
|
82
90
|
let gameCssScoper: Promise<(css: string) => string> | null = null;
|
|
83
91
|
export function loadGameCssScoper(): Promise<(css: string) => string> {
|
|
84
92
|
gameCssScoper ??= Promise.all([
|
|
85
|
-
import('
|
|
93
|
+
import('./game-css-scope-transform'),
|
|
86
94
|
import('@volter/editor-sdk/session/game-css-scope'),
|
|
87
95
|
]).then(
|
|
88
96
|
([{ scopeGameCss }, { GAME_CSS_SCOPE_SELECTOR }]) =>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { pcmStats } from '@volter/game-runtime/audio/wav-encode';
|
|
2
1
|
import type { OfflineAudioRenderer } from '@volter/editor-project/adapter';
|
|
3
2
|
import {
|
|
4
3
|
AudioBufferSource,
|
|
@@ -10,8 +9,25 @@ import {
|
|
|
10
9
|
Quality,
|
|
11
10
|
WebMOutputFormat,
|
|
12
11
|
} from 'mediabunny';
|
|
13
|
-
import type { CaptureOptions } from '@volter/editor-
|
|
14
|
-
import { createImageSnapshotCache, drawPlayCompositeFrame } from '@volter/editor-
|
|
12
|
+
import type { CaptureOptions } from '@volter/editor-sdk/kit/composite-screenshot';
|
|
13
|
+
import { createImageSnapshotCache, drawPlayCompositeFrame } from '@volter/editor-sdk/kit/composite-screenshot';
|
|
14
|
+
|
|
15
|
+
/** RMS and peak over all channels and samples: evidence the track is sound, not an all-zero
|
|
16
|
+
* buffer. */
|
|
17
|
+
function pcmStats(channelData: readonly Float32Array[]): { rms: number; peak: number } {
|
|
18
|
+
let sumSquares = 0;
|
|
19
|
+
let peak = 0;
|
|
20
|
+
let count = 0;
|
|
21
|
+
for (const data of channelData) {
|
|
22
|
+
for (let i = 0; i < data.length; i++) {
|
|
23
|
+
const v = data[i] ?? 0;
|
|
24
|
+
sumSquares += v * v;
|
|
25
|
+
peak = Math.max(peak, Math.abs(v));
|
|
26
|
+
count++;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return { rms: count > 0 ? Math.sqrt(sumSquares / count) : 0, peak };
|
|
30
|
+
}
|
|
15
31
|
|
|
16
32
|
/**
|
|
17
33
|
* Opus in the SAME WebM `Output` the video track already uses — the whole
|
|
@@ -25,14 +41,10 @@ import { createImageSnapshotCache, drawPlayCompositeFrame } from '@volter/editor
|
|
|
25
41
|
* second container pipeline beside the first is how one export's timing,
|
|
26
42
|
* metadata and codec support drift away from the other's.
|
|
27
43
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* muxer are in the same JS heap, so encoding to 16-bit WAV and handing the
|
|
33
|
-
* bytes back to an encoder would quantize the samples for no reason at all.
|
|
34
|
-
* `pcmStats` from that module IS used, for the non-silence evidence in the
|
|
35
|
-
* result.
|
|
44
|
+
* The `AudioBuffer` and the muxer are in the same JS heap, so the samples go
|
|
45
|
+
* to the encoder as they are; encoding to 16-bit WAV on the way would quantize
|
|
46
|
+
* them for no reason at all. {@link pcmStats} gives the non-silence evidence in
|
|
47
|
+
* the result.
|
|
36
48
|
*
|
|
37
49
|
* Opus rather than a PCM track (Matroska can carry `A_PCM/INT/LIT`) because
|
|
38
50
|
* WebM's normal audio codec is what every player and every `ffprobe` build
|
|
@@ -105,9 +117,8 @@ export interface GameplayExportResult {
|
|
|
105
117
|
/** How the export gets sound: the world's own audio for the ABSOLUTE sim
|
|
106
118
|
* window the frame walk covers, rendered offline.
|
|
107
119
|
*
|
|
108
|
-
* THE OFFSET TRAP,
|
|
109
|
-
* argument of this whole path
|
|
110
|
-
* first): an offline render of `[10, 10.72)` schedules its first event at
|
|
120
|
+
* THE OFFSET TRAP, stated at the call site because it is the correctness
|
|
121
|
+
* argument of this whole path: an offline render of `[10, 10.72)` schedules its first event at
|
|
111
122
|
* LOCAL time 0, not absolute 10. `startSeconds` is where the paused run
|
|
112
123
|
* stands on its own canonical clock when frame 0 is captured; `render` is
|
|
113
124
|
* asked for `[startSeconds, startSeconds + frames / fps)` and must subtract
|
|
@@ -36,22 +36,22 @@ import type {
|
|
|
36
36
|
CompositeFrame,
|
|
37
37
|
ImageSnapshotCache,
|
|
38
38
|
OverlayFrameCache,
|
|
39
|
-
} from '@volter/editor-
|
|
39
|
+
} from '@volter/editor-sdk/kit/composite-screenshot';
|
|
40
40
|
import {
|
|
41
41
|
createImageSnapshotCache,
|
|
42
42
|
createOverlayFrameCache,
|
|
43
43
|
drawPlayCompositeFrame,
|
|
44
44
|
isRootCanvas,
|
|
45
|
-
} from '@volter/editor-
|
|
45
|
+
} from '@volter/editor-sdk/kit/composite-screenshot';
|
|
46
46
|
import {
|
|
47
47
|
abortGameplayRecordingSink,
|
|
48
48
|
appendGameplayRecordingChunk,
|
|
49
49
|
beginGameplayRecordingSink,
|
|
50
50
|
finishGameplayRecordingSink,
|
|
51
51
|
type GameplayRecordingSink,
|
|
52
|
-
} from '@volter/editor-
|
|
53
|
-
import { type GameplayDomRecording, startGameplayDomRecording } from '@volter/editor-
|
|
54
|
-
import { publishToolContributionRecording } from '@volter/editor-
|
|
52
|
+
} from '@volter/editor-sdk/kit/editor-api';
|
|
53
|
+
import { type GameplayDomRecording, startGameplayDomRecording } from '@volter/editor-sdk/kit/gameplay-dom-recording';
|
|
54
|
+
import { publishToolContributionRecording } from '@volter/editor-sdk/kit/gameplay-sessions';
|
|
55
55
|
import { createRecordingPreviewEncoder } from './recording-preview';
|
|
56
56
|
|
|
57
57
|
export interface GameplayRecordingStartOptions {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
* Defined in a DOM-free module so the Node-side Vite plugin can import the same
|
|
27
27
|
* constant — see `game-globals-prelude.ts`. Re-exported here for the browser
|
|
28
28
|
* callers that already reach for it alongside the proxies. */
|
|
29
|
-
export { GAME_GLOBALS_PRELUDE } from '@volter/editor-
|
|
29
|
+
export { GAME_GLOBALS_PRELUDE } from '@volter/editor-sdk/kit/game-globals-prelude';
|
|
30
30
|
|
|
31
|
-
import { installCreationSiteRecorder } from '@volter/editor-
|
|
32
|
-
import { setConsoleRealmAttribution } from '@volter/editor-
|
|
31
|
+
import { installCreationSiteRecorder } from '@volter/editor-sdk/kit/creation-site-registry';
|
|
32
|
+
import { setConsoleRealmAttribution } from '@volter/editor-sdk/kit/editor-console';
|
|
33
33
|
import { guardedGameLocation, refusedNavigationMessage } from './game-location-guard';
|
|
34
34
|
import { GameRealmPage } from './game-realm-page';
|
|
35
35
|
import {
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
type SameRealmLoopGate,
|
|
45
45
|
type SameRealmLoopGateStats,
|
|
46
46
|
} from './same-realm-loop-gate';
|
|
47
|
-
import { surfaceHoldsKeyboard } from '@volter/editor-
|
|
47
|
+
import { surfaceHoldsKeyboard } from '@volter/editor-sdk/kit/surface-keyboard';
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* The SAME-REALM LOOP GATE (S-5) — the scheduling half of the same idea.
|
|
@@ -93,8 +93,8 @@ const INPUT_EVENT_TYPES = new Set<string>([
|
|
|
93
93
|
* the keyboard and pointer, and it stopped keyup/mouseup/pointerup the same
|
|
94
94
|
* way — so a key pressed while the gate was open and released after it closed
|
|
95
95
|
* (Stop with W still held) left the game's OWN input manager holding KeyW for
|
|
96
|
-
* good: the editor flushes only the session's
|
|
97
|
-
* project-owned
|
|
96
|
+
* good: the editor flushes only the session's own input state, never a
|
|
97
|
+
* project-owned one. With both vertical keys stuck the hero
|
|
98
98
|
* could not move up or down while A/D worked (runhuman pass 129; Opus
|
|
99
99
|
* reproduction 2026-09-03 — forcing KeyW+KeyS into `keysDown` reproduced the
|
|
100
100
|
* report verbatim, a single stuck key does not). Each proxy remembers the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { sha256Hex } from '@volter/editor-
|
|
2
|
-
import { HistoryOperationError, type HistoryService } from '@volter/editor-
|
|
3
|
-
import type { ResourceDescriptor, ResourceDriver, ResourceKind } from '@volter/editor-
|
|
1
|
+
import { sha256Hex } from '@volter/editor-sdk/kit/bytes-codec';
|
|
2
|
+
import { HistoryOperationError, type HistoryService } from '@volter/editor-sdk/kit/history/history-service';
|
|
3
|
+
import type { ResourceDescriptor, ResourceDriver, ResourceKind } from '@volter/editor-sdk/kit/history-types';
|
|
4
4
|
|
|
5
5
|
const encoder = new TextEncoder();
|
|
6
6
|
const decoder = new TextDecoder();
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* action that writes NEW FILES — this one writes two.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import type { InstanceSourceLocator } from '@volter/editor-
|
|
23
|
+
import type { InstanceSourceLocator } from '@volter/editor-sdk/kit/instance-source-actions';
|
|
24
24
|
|
|
25
25
|
export const EXTRACT_COMPONENT_LABEL = 'Extract Component…';
|
|
26
26
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* FILE, which no other hierarchy item does.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import type { InstanceSourceLocator } from '@volter/editor-
|
|
22
|
+
import type { InstanceSourceLocator } from '@volter/editor-sdk/kit/instance-source-actions';
|
|
23
23
|
|
|
24
24
|
export const FORK_COMPONENT_LABEL = 'Fork Component…';
|
|
25
25
|
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
* raycast the projector can own the way {@link ThreeProjector.pick} does.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
import type { ProjectedNode, Projection } from '@volter/editor-
|
|
31
|
+
import type { ProjectedNode, Projection } from '@volter/editor-sdk/kit/projection-types';
|
|
32
32
|
|
|
33
|
-
export type { ProjectedNode, Projection } from '@volter/editor-
|
|
33
|
+
export type { ProjectedNode, Projection } from '@volter/editor-sdk/kit/projection-types';
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* The minimum shape a live DOM walk needs. Deliberately not `Element` so a
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* where an edit lands.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import type { AuthoringAdapter2D, EditorNode2D } from '
|
|
13
|
-
import type { DOMRectLike } from '@volter/editor-project/adapter';
|
|
12
|
+
import type { AuthoringAdapter2D, EditorNode2D } from '../../runtime/pixi/authoring';
|
|
13
|
+
import type { DOMRectLike, FrameCorners } from '@volter/editor-project/adapter';
|
|
14
14
|
import type { Container, PointData } from 'pixi.js';
|
|
15
|
-
import type { ProjectedNode, Projection } from '@volter/editor-
|
|
15
|
+
import type { ProjectedNode, Projection } from '@volter/editor-sdk/kit/projection-types';
|
|
16
16
|
|
|
17
17
|
export type PixiNode = ProjectedNode<Container>;
|
|
18
18
|
|
|
@@ -214,6 +214,28 @@ export class PixiProjector {
|
|
|
214
214
|
return { x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height };
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
+
/** The node's local bounds carried by its global transform — its turned box's corners. */
|
|
218
|
+
frame(id: string): FrameCorners | null {
|
|
219
|
+
const object = this.object(id) as
|
|
220
|
+
| (Container & { getLocalBounds?: () => { x: number; y: number; width: number; height: number } })
|
|
221
|
+
| null;
|
|
222
|
+
if (!object || typeof object.getLocalBounds !== 'function') return null;
|
|
223
|
+
const local = object.getLocalBounds();
|
|
224
|
+
if (!(local.width > 0) || !(local.height > 0)) return null;
|
|
225
|
+
// `toGlobal` brings the transform up to date itself, as `getBounds` does; the cached
|
|
226
|
+
// `worldTransform` is only as fresh as the last render, and an Edit surface renders on demand.
|
|
227
|
+
const at = (x: number, y: number) => {
|
|
228
|
+
const point = object.toGlobal({ x, y });
|
|
229
|
+
return { x: point.x, y: point.y };
|
|
230
|
+
};
|
|
231
|
+
return {
|
|
232
|
+
tl: at(local.x, local.y),
|
|
233
|
+
tr: at(local.x + local.width, local.y),
|
|
234
|
+
br: at(local.x + local.width, local.y + local.height),
|
|
235
|
+
bl: at(local.x, local.y + local.height),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
217
239
|
contextRects(id: string): { parent?: DOMRectLike; siblings: DOMRectLike[] } {
|
|
218
240
|
const node = this.node(id);
|
|
219
241
|
if (!node) return { siblings: [] };
|
|
@@ -1,57 +1,88 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* The React and Fiber a project's three world is mounted with. The packaged
|
|
3
|
+
* editor's UI is prebuilt with its own React/Fiber instances, while project
|
|
4
|
+
* modules are transformed by a separate project-rooted Vite server. Mounting a
|
|
5
|
+
* project component with the UI bundle's copies crosses those graphs and
|
|
6
|
+
* crashes Fiber hooks on a null React dispatcher, so under the packaged
|
|
7
|
+
* runtime the mount takes the project's own through the R3F doorway
|
|
8
|
+
* (`R3F_DOORWAY` in `vite-plugin-module-doorways.ts`); in a checkout one Vite
|
|
9
|
+
* graph already shares them, and this module's own imports are they.
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
advance,
|
|
14
|
+
createRoot,
|
|
15
|
+
events,
|
|
16
|
+
extend,
|
|
17
|
+
flushSync,
|
|
18
|
+
} from '@react-three/fiber';
|
|
10
19
|
import type { RootAdapter, ThreeHostContext } from '@volter/editor-project/adapter';
|
|
20
|
+
import { R3F_RUNTIME_PATH } from '@volter/editor-sdk/host';
|
|
21
|
+
import { isPackagedRuntime } from '@volter/editor-sdk/kit/packaged-runtime';
|
|
22
|
+
import { Component, createElement, Fragment, useEffect } from 'react';
|
|
11
23
|
import type * as THREE from 'three';
|
|
12
|
-
import {
|
|
13
|
-
R3F_ENTRY_RUNTIME_PATH,
|
|
14
|
-
R3F_RUNTIME_PATH,
|
|
15
|
-
} from '@volter/editor-sdk/host';
|
|
16
|
-
import { isPackagedRuntime } from '@volter/editor-core/packaged-runtime';
|
|
24
|
+
import { type R3FRuntime, resolveR3FEntryAdapter } from './roots/r3f-root';
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
const CHECKOUT_RUNTIME: R3FRuntime = {
|
|
27
|
+
createElement,
|
|
28
|
+
Fragment,
|
|
29
|
+
Component,
|
|
30
|
+
useEffect,
|
|
31
|
+
createRoot,
|
|
32
|
+
extend,
|
|
33
|
+
advance,
|
|
34
|
+
flushSync,
|
|
35
|
+
events,
|
|
36
|
+
};
|
|
19
37
|
|
|
20
38
|
interface PackagedR3FRuntime {
|
|
21
|
-
readonly
|
|
39
|
+
readonly runtime: R3FRuntime;
|
|
22
40
|
readonly projectThree: typeof THREE;
|
|
23
41
|
}
|
|
24
42
|
|
|
25
43
|
let cachedPackagedRuntime: Promise<PackagedR3FRuntime> | null = null;
|
|
26
44
|
|
|
45
|
+
const RUNTIME_MEMBERS = [
|
|
46
|
+
'createElement',
|
|
47
|
+
'Fragment',
|
|
48
|
+
'Component',
|
|
49
|
+
'useEffect',
|
|
50
|
+
'createR3FRoot',
|
|
51
|
+
'extendThree',
|
|
52
|
+
'advance',
|
|
53
|
+
'flushSync',
|
|
54
|
+
'events',
|
|
55
|
+
] as const;
|
|
56
|
+
|
|
27
57
|
async function packagedRuntime(): Promise<PackagedR3FRuntime> {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}>,
|
|
32
|
-
import(/* @vite-ignore */ R3F_RUNTIME_PATH) as Promise<{ projectThree?: unknown }>,
|
|
33
|
-
]);
|
|
34
|
-
if (typeof entry.resolveR3FEntryAdapter !== 'function') {
|
|
35
|
-
throw new Error(
|
|
36
|
-
"The packaged runtime's synthetic R3F entry module did not export " +
|
|
37
|
-
'`resolveR3FEntryAdapter` — see R3F_ENTRY_DOORWAY in vite-plugin-module-doorways.ts.',
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
if (typeof mod.projectThree !== 'object' || mod.projectThree === null) {
|
|
58
|
+
const mod = (await import(/* @vite-ignore */ R3F_RUNTIME_PATH)) as Record<string, unknown>;
|
|
59
|
+
const missing = RUNTIME_MEMBERS.filter((name) => mod[name] === undefined);
|
|
60
|
+
if (missing.length > 0 || typeof mod['projectThree'] !== 'object' || mod['projectThree'] === null) {
|
|
41
61
|
throw new Error(
|
|
42
62
|
"The packaged runtime's synthetic R3F module did not export " +
|
|
43
|
-
'
|
|
63
|
+
`${[...missing, ...(mod['projectThree'] ? [] : ['projectThree'])].join(', ')} — see ` +
|
|
64
|
+
'R3F_DOORWAY in vite-plugin-module-doorways.ts.',
|
|
44
65
|
);
|
|
45
66
|
}
|
|
46
67
|
return {
|
|
47
|
-
|
|
48
|
-
|
|
68
|
+
runtime: {
|
|
69
|
+
createElement: mod['createElement'] as R3FRuntime['createElement'],
|
|
70
|
+
Fragment: mod['Fragment'] as R3FRuntime['Fragment'],
|
|
71
|
+
Component: mod['Component'] as R3FRuntime['Component'],
|
|
72
|
+
useEffect: mod['useEffect'] as R3FRuntime['useEffect'],
|
|
73
|
+
createRoot: mod['createR3FRoot'] as R3FRuntime['createRoot'],
|
|
74
|
+
extend: mod['extendThree'] as R3FRuntime['extend'],
|
|
75
|
+
advance: mod['advance'] as R3FRuntime['advance'],
|
|
76
|
+
flushSync: mod['flushSync'] as R3FRuntime['flushSync'],
|
|
77
|
+
events: mod['events'] as R3FRuntime['events'],
|
|
78
|
+
},
|
|
79
|
+
projectThree: mod['projectThree'] as typeof THREE,
|
|
49
80
|
};
|
|
50
81
|
}
|
|
51
82
|
|
|
52
83
|
/**
|
|
53
84
|
* The packaged editor shell and project modules are separate Vite graphs. The
|
|
54
|
-
*
|
|
85
|
+
* world's Fiber comes from the project graph, so its Three host namespace
|
|
55
86
|
* must come from there too: Fiber seeds its intrinsic catalogue from
|
|
56
87
|
* `host.three`, and mixing in the shell's constructors makes applyProps turn a
|
|
57
88
|
* typed `DirectionalLight.color` into the raw JSX string.
|
|
@@ -69,9 +100,9 @@ export function withPackagedProjectThree(
|
|
|
69
100
|
}
|
|
70
101
|
|
|
71
102
|
export async function resolveR3FEntryAdapterForEditor(entryModule: unknown, rootId: string) {
|
|
72
|
-
if (!(await isPackagedRuntime())) return resolveR3FEntryAdapter(entryModule, rootId);
|
|
103
|
+
if (!(await isPackagedRuntime())) return resolveR3FEntryAdapter(entryModule, rootId, CHECKOUT_RUNTIME);
|
|
73
104
|
if (!cachedPackagedRuntime) cachedPackagedRuntime = packagedRuntime();
|
|
74
|
-
const runtime = await cachedPackagedRuntime;
|
|
75
|
-
const adapter =
|
|
76
|
-
return adapter ? withPackagedProjectThree(adapter,
|
|
105
|
+
const { runtime, projectThree } = await cachedPackagedRuntime;
|
|
106
|
+
const adapter = resolveR3FEntryAdapter(entryModule, rootId, runtime);
|
|
107
|
+
return adapter ? withPackagedProjectThree(adapter, projectThree) : null;
|
|
77
108
|
}
|
|
@@ -16,10 +16,7 @@
|
|
|
16
16
|
* (confirmed live; see `packaged.ts`'s header).
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { WorldProvider as EngineWorldProvider } from '@volter/game-runtime/react/world-state';
|
|
20
|
-
import type { Game } from '@volter/game-runtime/runtime/game';
|
|
21
19
|
import {
|
|
22
|
-
type ComponentType,
|
|
23
20
|
createElement,
|
|
24
21
|
useEffect as reactUseEffect,
|
|
25
22
|
useRef as reactUseRef,
|
|
@@ -27,12 +24,11 @@ import {
|
|
|
27
24
|
import { flushSync } from 'react-dom';
|
|
28
25
|
import { createRoot } from 'react-dom/client';
|
|
29
26
|
import { REACT_WORLD_RUNTIME_PATH } from '@volter/editor-sdk/host';
|
|
30
|
-
import { isPackagedRuntime } from '@volter/editor-
|
|
27
|
+
import { isPackagedRuntime } from '@volter/editor-sdk/kit/packaged-runtime';
|
|
31
28
|
|
|
32
29
|
/**
|
|
33
|
-
* The pieces of "react itself" a react-world mount needs:
|
|
34
|
-
*
|
|
35
|
-
* </WorldProvider>` tree) and the engine-published `WorldProvider`.
|
|
30
|
+
* The pieces of "react itself" a react-world mount needs: `createElement`/`createRoot`
|
|
31
|
+
* to build and render `<Entry />`, and the hooks the editor's own wrappers use.
|
|
36
32
|
*/
|
|
37
33
|
export interface ReactRootMountRuntime {
|
|
38
34
|
createElement: typeof createElement;
|
|
@@ -43,7 +39,6 @@ export interface ReactRootMountRuntime {
|
|
|
43
39
|
* layer mount needs it from the SAME react-dom peer as `createRoot` above
|
|
44
40
|
* (both are entry points of the same installed package). */
|
|
45
41
|
flushSync: typeof flushSync;
|
|
46
|
-
engineWorldProvider: ComponentType<{ game: Game; children?: unknown }>;
|
|
47
42
|
}
|
|
48
43
|
|
|
49
44
|
/** The dev default: this module's own static imports. */
|
|
@@ -54,10 +49,6 @@ function staticReactRootMountRuntime(): ReactRootMountRuntime {
|
|
|
54
49
|
useEffect: reactUseEffect,
|
|
55
50
|
useRef: reactUseRef,
|
|
56
51
|
flushSync,
|
|
57
|
-
engineWorldProvider: EngineWorldProvider as unknown as ComponentType<{
|
|
58
|
-
game: Game;
|
|
59
|
-
children?: unknown;
|
|
60
|
-
}>,
|
|
61
52
|
};
|
|
62
53
|
}
|
|
63
54
|
|
|
@@ -77,20 +68,18 @@ async function loadPackagedReactRootMountRuntime(): Promise<ReactRootMountRuntim
|
|
|
77
68
|
useEffect?: unknown;
|
|
78
69
|
useRef?: unknown;
|
|
79
70
|
flushSync?: unknown;
|
|
80
|
-
EngineWorldProvider?: unknown;
|
|
81
71
|
};
|
|
82
72
|
if (
|
|
83
73
|
typeof mod.createElement !== 'function' ||
|
|
84
74
|
typeof mod.createRoot !== 'function' ||
|
|
85
75
|
typeof mod.useEffect !== 'function' ||
|
|
86
76
|
typeof mod.useRef !== 'function' ||
|
|
87
|
-
typeof mod.flushSync !== 'function'
|
|
88
|
-
typeof mod.EngineWorldProvider !== 'function'
|
|
77
|
+
typeof mod.flushSync !== 'function'
|
|
89
78
|
) {
|
|
90
79
|
throw new Error(
|
|
91
80
|
"The packaged runtime's synthetic react-world-runtime module " +
|
|
92
|
-
`("${REACT_WORLD_RUNTIME_PATH}") did not export createElement/createRoot/useEffect/useRef/flushSync
|
|
93
|
-
'
|
|
81
|
+
`("${REACT_WORLD_RUNTIME_PATH}") did not export createElement/createRoot/useEffect/useRef/flushSync ` +
|
|
82
|
+
'as functions — see vite-plugin-module-doorways.ts.',
|
|
94
83
|
);
|
|
95
84
|
}
|
|
96
85
|
return {
|
|
@@ -99,10 +88,6 @@ async function loadPackagedReactRootMountRuntime(): Promise<ReactRootMountRuntim
|
|
|
99
88
|
useEffect: mod.useEffect as typeof reactUseEffect,
|
|
100
89
|
useRef: mod.useRef as typeof reactUseRef,
|
|
101
90
|
flushSync: mod.flushSync as typeof flushSync,
|
|
102
|
-
engineWorldProvider: mod.EngineWorldProvider as ComponentType<{
|
|
103
|
-
game: Game;
|
|
104
|
-
children?: unknown;
|
|
105
|
-
}>,
|
|
106
91
|
};
|
|
107
92
|
}
|
|
108
93
|
|
|
@@ -112,8 +97,8 @@ let cachedPackagedReactRootMountRuntime: Promise<ReactRootMountRuntime> | null =
|
|
|
112
97
|
* Resolve the react-world mount's own react. A react world is an ISOLATED
|
|
113
98
|
* `createRoot` (its own DOM subtree / react tree) that does NOT need to share
|
|
114
99
|
* react with the editor's own UI — it only needs to be internally consistent
|
|
115
|
-
* (the wrapper
|
|
116
|
-
*
|
|
100
|
+
* (the editor's wrapper and the project's entry component sharing ONE react
|
|
101
|
+
* instance), which is exactly what the packaged branch restores.
|
|
117
102
|
*
|
|
118
103
|
* Memoized twice over: `isPackagedRuntime()` is itself session-memoized, and
|
|
119
104
|
* the packaged module load is cached here, so this performs at most one
|
|
@@ -129,32 +114,6 @@ export async function resolveReactRootMountRuntime(): Promise<ReactRootMountRunt
|
|
|
129
114
|
return cachedPackagedReactRootMountRuntime;
|
|
130
115
|
}
|
|
131
116
|
|
|
132
|
-
/**
|
|
133
|
-
* `WorldProvider` is the canonical engine export from
|
|
134
|
-
* `@volter/game-runtime/react/world-state`, reached through the mount runtime above so
|
|
135
|
-
* the project's copy is used under the packaged runtime. Hosts and game
|
|
136
|
-
* entries therefore share ONE module and one React context identity.
|
|
137
|
-
*
|
|
138
|
-
* WHY THIS IS AN ENGINE EXPORT AND NOT A PER-PROJECT FILE — a finding verified
|
|
139
|
-
* empirically, kept because the trap it describes is still live for anyone
|
|
140
|
-
* tempted to reintroduce a project-local provider. Back when each project
|
|
141
|
-
* owned its own bridge module, a hand-built runtime `import('/@fs/' +
|
|
142
|
-
* projectRoot + '/…')` for it did NOT reliably land on the same module
|
|
143
|
-
* instance a react-world entry's own STATIC relative import resolved to:
|
|
144
|
-
* Vite's dev server treated the two differently at the HTTP level (a
|
|
145
|
-
* query-string divergence, confirmed by logging `import.meta.url` inside two
|
|
146
|
-
* otherwise-identical fetches) even though both targeted the identical file on
|
|
147
|
-
* disk, and browser ES module identity is keyed by the exact request URL. That
|
|
148
|
-
* alone produced TWO separate `createContext()` calls. The whole apparatus is
|
|
149
|
-
* gone: one engine module, no per-project path to diverge on.
|
|
150
|
-
*/
|
|
151
|
-
export async function resolveWorldProviderForProject(): Promise<
|
|
152
|
-
ComponentType<{ game: Game; children?: unknown }>
|
|
153
|
-
> {
|
|
154
|
-
const runtime = await resolveReactRootMountRuntime();
|
|
155
|
-
return runtime.engineWorldProvider;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
117
|
/** Test-only: reset the packaged react-world mount runtime cache between
|
|
159
118
|
* tests that toggle `isPackagedRuntime()`'s own (separately memoized) result. */
|
|
160
119
|
export function resetReactRootMountRuntimeCacheForTest(): void {
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
} from '@volter/editor-sdk/session/project-module-url';
|
|
51
51
|
import type { AdapterSurface } from '@volter/editor-project/adapter/adapter-surface';
|
|
52
52
|
import { resolveCanvasEntryAdapterForEditor } from './canvas-entry-runtime';
|
|
53
|
-
import { isPackagedRuntime } from '@volter/editor-
|
|
53
|
+
import { isPackagedRuntime } from '@volter/editor-sdk/kit/packaged-runtime';
|
|
54
54
|
import { type ReactRootMountRuntime, resolveReactRootMountRuntime } from './react-mount-runtime';
|
|
55
55
|
import {
|
|
56
56
|
resolveThreeIngestRuntimeForEditor,
|
|
@@ -92,7 +92,7 @@ export interface RealmServices {
|
|
|
92
92
|
readonly entryReach: 'full';
|
|
93
93
|
/** The canvas doorway: turn a canvas entry namespace into its adapter. */
|
|
94
94
|
readonly pixiRuntime: typeof resolveCanvasEntryAdapterForEditor;
|
|
95
|
-
/** The react-world mount's own react/react-dom
|
|
95
|
+
/** The react-world mount's own react/react-dom. */
|
|
96
96
|
readonly reactDomRuntime: () => Promise<ReactRootMountRuntime>;
|
|
97
97
|
/** The three-ingest doorway: the namespace an ingested three game captures
|
|
98
98
|
* against. */
|