@volter/editor-game 0.5.65 → 0.5.66

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.
Files changed (141) hide show
  1. package/contributions/generation.service.ts +2 -2
  2. package/contributions/generations.status.tsx +1 -1
  3. package/contributions/godot.palette.json +99 -0
  4. package/contributions/godot.style.ts +62 -0
  5. package/contributions/godot.view.ts +69 -0
  6. package/contributions/ingest.service.ts +3 -3
  7. package/contributions/play.command.ts +1 -1
  8. package/contributions/react/react-inspector.service.ts +2 -2
  9. package/contributions/scene-document.service.ts +3 -3
  10. package/contributions/three/component-verbs.command.ts +3 -3
  11. package/contributions/unity.palette.json +102 -0
  12. package/contributions/unity.style.ts +62 -0
  13. package/contributions/unity.view.ts +76 -0
  14. package/contributions/unreal.palette.json +105 -0
  15. package/contributions/unreal.style.ts +58 -0
  16. package/contributions/unreal.view.ts +88 -0
  17. package/dist-node/serving.mjs +16 -0
  18. package/package.json +21 -14
  19. package/serving/index.ts +27 -0
  20. package/src/asset-budget/asset-budget-model.ts +3 -3
  21. package/src/asset-budget/optimize-apply.ts +7 -7
  22. package/src/bridge/dispatch.ts +2 -2
  23. package/src/bridge/screenshot.ts +3 -3
  24. package/src/coverage/live-authoring-surface.ts +1 -1
  25. package/src/coverage/live-project-verbs.ts +1 -1
  26. package/src/coverage/native-system-coverage.ts +1 -1
  27. package/src/coverage/session-coverage.ts +2 -2
  28. package/src/design-system-stories/InspectorNarrowBodies.stories.tsx +10 -50
  29. package/src/game-document/GameCaptureFrameButton.tsx +1 -1
  30. package/src/game-document/GamePanel.tsx +4 -4
  31. package/src/generation/GenerationActivity.tsx +3 -5
  32. package/src/generation/generation-documents.tsx +3 -3
  33. package/src/generation/generation-jobs.ts +1 -1
  34. package/src/generation/generation-presentation.ts +1 -1
  35. package/src/host/adapter-reach.ts +1 -1
  36. package/src/host/adapter-runtime-bindings.ts +1 -1
  37. package/src/host/api/configurations.ts +2 -2
  38. package/src/host/authoring/babylon-authoring-adapter.ts +2 -2
  39. package/src/host/authoring/contract-hierarchy-authoring.ts +1 -1
  40. package/src/host/authoring/contract-scenes-stories.ts +1 -1
  41. package/src/host/authoring/creation-site-related.ts +2 -2
  42. package/src/host/authoring/ephemeral-persistence.ts +1 -1
  43. package/src/host/authoring/gesture-persist.ts +1 -1
  44. package/src/host/authoring/ingest-source-persistence.ts +4 -4
  45. package/src/host/authoring/mount-isolated-pixi-screen.ts +1 -1
  46. package/src/host/authoring/pixi-authoring-adapter.ts +2 -2
  47. package/src/host/authoring/pixi-live-write-target.ts +3 -3
  48. package/src/host/authoring/pixi-still-presentation.ts +1 -1
  49. package/src/host/authoring/pixi-structure-history.ts +1 -1
  50. package/src/host/authoring/source-persistence-backend.ts +3 -3
  51. package/src/host/authoring/struct-write-pipe.ts +2 -2
  52. package/src/host/browser-transpile.ts +1 -1
  53. package/src/host/canvas-entry-runtime.ts +1 -1
  54. package/src/host/components/HeaderTelemetry.tsx +5 -12
  55. package/src/host/components/PixiIsolationSceneContent.tsx +8 -7
  56. package/src/host/components/ThreeIsolationSceneContent.tsx +2 -2
  57. package/src/host/components/scene-document.tsx +15 -47
  58. package/src/host/components/world-root-stage-binding.tsx +6 -15
  59. package/src/host/components/world-root-stage.ts +60 -14
  60. package/src/host/coverage/capability-coverage.ts +13 -1
  61. package/src/host/coverage/game-contract-seam-evidence.ts +1 -1
  62. package/src/host/coverage/project-verb-coverage.ts +2 -17
  63. package/src/host/coverage/system-adapter-coverage.ts +1 -1
  64. package/src/host/design-system-stories/fixtures/editor-runtime.tsx +9 -1
  65. package/src/host/document-preview-three.ts +1 -1
  66. package/src/host/game-module-access.ts +1 -1
  67. package/src/host/game-realm-page.ts +15 -7
  68. package/src/host/game-realm-reclaim.ts +1 -1
  69. package/src/host/gated-globals.ts +4 -4
  70. package/src/host/history/json-history-resource.ts +2 -2
  71. package/src/host/instance-extract-actions.ts +1 -1
  72. package/src/host/instance-fork-actions.ts +1 -1
  73. package/src/host/projection/dom.ts +2 -2
  74. package/src/host/projection/pixi.ts +1 -1
  75. package/src/host/r3f-entry-runtime.ts +1 -1
  76. package/src/host/react-mount-runtime.ts +1 -1
  77. package/src/host/realm-services.ts +1 -1
  78. package/src/host/roots/module-root.ts +1 -1
  79. package/src/host/scene-view-drawability.ts +2 -2
  80. package/src/host/server-log-bridge.ts +1 -1
  81. package/src/host/three-ingest-runtime.ts +1 -1
  82. package/src/host/use-active-performance-source.ts +1 -1
  83. package/src/ingest/active-ingest.ts +1 -1
  84. package/src/ingest/authoring/ingest-root-adapter.ts +5 -5
  85. package/src/ingest/capture-wait-report.ts +1 -1
  86. package/src/ingest/deferred-ingest-play.ts +5 -4
  87. package/src/ingest/ingest-boot-viewport.ts +4 -6
  88. package/src/ingest/ingest-canvas-scene-document.tsx +9 -8
  89. package/src/ingest/ingest-canvas-scene.ts +2 -5
  90. package/src/ingest/ingest-play-control.ts +3 -3
  91. package/src/ingest/ingest-render-debug.ts +1 -1
  92. package/src/ingest/ingest-siblings.ts +3 -3
  93. package/src/ingest/module-mode.ts +4 -5
  94. package/src/ingest/mount-canvas-ingest-root.ts +6 -6
  95. package/src/ingest/mount-coverage.ts +2 -2
  96. package/src/ingest/mount-dom-ingest-root.ts +5 -5
  97. package/src/ingest/mount-ingest-root.ts +7 -7
  98. package/src/ingest/mount-three-ingest-root.ts +4 -4
  99. package/src/ingest/unmount-ingest-root.ts +2 -2
  100. package/src/play/play-mode.ts +30 -16
  101. package/src/play/play-recording.ts +1 -1
  102. package/src/profiler/PerformancePanel.tsx +1 -1
  103. package/src/react/design-time-react-mount.ts +17 -23
  104. package/src/react/dom-authoring-adapter.ts +2 -2
  105. package/src/react/react-inspector-section.tsx +8 -8
  106. package/src/react/react-world-authoring-adapter.ts +20 -132
  107. package/src/react/story-documents/story-documents.tsx +9 -13
  108. package/src/react/ui-board-document.tsx +3 -4
  109. package/src/react/ui-component-board.ts +3 -3
  110. package/src/three/authoring/camera-runtime-inspector-section.tsx +1 -1
  111. package/src/three/authoring/constraint-inspector-section.tsx +3 -3
  112. package/src/three/authoring/model-asset-inspector-section.tsx +7 -11
  113. package/src/three/authoring/oid-source-persistence.ts +6 -6
  114. package/src/three/authoring/r3f-design-session.ts +21 -7
  115. package/src/three/authoring/r3f-source-authoring-adapter.ts +17 -17
  116. package/src/three/authoring/reflection-probe-inspector-section.tsx +3 -3
  117. package/src/three/authoring/spatial-joint-handles.ts +1 -1
  118. package/src/three/authoring/spatial-lod-handles.ts +1 -1
  119. package/src/three/authoring/spatial-particle-handles.ts +1 -1
  120. package/src/three/authoring/three-authoring-adapter.ts +4 -4
  121. package/src/three/component-verbs/extract-menu.ts +1 -1
  122. package/src/three/component-verbs/fork-menu.ts +1 -1
  123. package/src/three/component-verbs/internals-menu.ts +1 -1
  124. package/src/three/drei-asset-caches.ts +13 -0
  125. package/src/three/story-documents/three-story-documents.tsx +11 -21
  126. package/src/three/three-board/ThreeBoardDocument.tsx +12 -13
  127. package/src/three/three-board/board-scene.ts +1 -1
  128. package/src/three/three-board/three-component-board.ts +3 -3
  129. package/contributions/react/pasteboard.action.ts +0 -41
  130. package/contributions/xstate-behavior.action.ts +0 -42
  131. package/contributions/xstate-behavior.document.tsx +0 -73
  132. package/contributions/xstate-behavior.inspector.tsx +0 -28
  133. package/contributions/xstate-behavior.menu.ts +0 -23
  134. package/src/react/pasteboard-materialize.ts +0 -154
  135. package/src/xstate/XStateBehaviorSection.tsx +0 -130
  136. package/src/xstate/XStateMachineInspector.tsx +0 -566
  137. package/src/xstate/character-animation-machine.fixture.ts +0 -74
  138. package/src/xstate/live-behaviors.ts +0 -106
  139. package/src/xstate/use-live-actor-state.ts +0 -44
  140. package/src/xstate/xstate-graph.ts +0 -235
  141. package/src/xstate/xstate-layout.ts +0 -76
@@ -6,7 +6,7 @@
6
6
  * (projected directly, SourceObject3DAuthoringAdapter-style — no
7
7
  * mirror); the project's `.tsx` source is truth for persistence. Nodes whose
8
8
  * Object3D carries `userData.oid` (stamped by W1's `userData-oid` dialect in
9
- * `vite-plugin-ui-oid.ts`) are SOURCE-ADDRESSABLE: their JSX props (including
9
+ * `@volter/editor-react`'s `serving/ui-oid-plugin.ts`) are SOURCE-ADDRESSABLE: their JSX props (including
10
10
  * W2's number-tuple transforms) read from the real source text
11
11
  * (`analyzeJsxAttributes` over the oid index location) and write back through
12
12
  * the same `/__ui-source/*` seam the DOM adapter (`dom-authoring-adapter.ts`) uses — wrapped
@@ -35,7 +35,7 @@ import {
35
35
  ownOidOf,
36
36
  rendersSameSourceElement,
37
37
  } from '@volter/editor-core/authoring/component-instance-root';
38
- import { beginLiveGesture, endLiveGesture } from '@volter/editor-core/authoring/live-gesture-lock';
38
+ import { beginLiveGesture, endLiveGesture } from '@volter/editor-sdk/kit/live-gesture-lock';
39
39
  import { createStructWritePipe, type StructOpOptions } from '../../host/authoring/struct-write-pipe';
40
40
  import {
41
41
  CollapsedHierarchyView,
@@ -50,10 +50,10 @@ import {
50
50
  runWritePipe,
51
51
  type WriteAck,
52
52
  type WriteResolution,
53
- } from '@volter/editor-core/authoring/write-pipe';
53
+ } from '@volter/editor-sdk/kit/write-pipe';
54
54
  import { componentStatesProvider } from '@volter/editor-core/component-states-registry';
55
55
  import { openProjectToolDocument } from '@volter/editor-core/components/project-tool-documents';
56
- import { editorConsole } from '@volter/editor-core/editor-console';
56
+ import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
57
57
  import type { EditorShellStore } from '@volter/editor-core/editor-shell-store';
58
58
  import {
59
59
  replaceProjectSource,
@@ -81,7 +81,7 @@ import {
81
81
  ThreeProjector,
82
82
  } from '@volter/editor-core/projection/three';
83
83
  import { getStorageBackend } from '@volter/editor-core/storage/index';
84
- import { showTransientHint } from '@volter/editor-core/transient-hint';
84
+ import { showTransientHint } from '@volter/editor-sdk/kit/transient-hint';
85
85
  import {
86
86
  type ComponentPropSpec,
87
87
  lineColToOffset,
@@ -90,13 +90,13 @@ import {
90
90
  type R3fEnvironmentBinding,
91
91
  type R3fEnvironmentNumberBinding,
92
92
  type R3fEnvironmentStringBinding,
93
- } from '@volter/editor-core/ui-source/oid-transform';
94
- import { mergeRowDiagnostics } from '@volter/editor-core/ui-source/r3f-diagnostic-index';
95
- import type { R3fJointLiteral, R3fJointLiteralRange } from '@volter/editor-core/ui-source/r3f-joint-binding';
96
- import type { R3fLodNumberBinding } from '@volter/editor-core/ui-source/r3f-lod-binding';
97
- import { bodyPlacedChannel, physicsRefusal } from '@volter/editor-core/ui-source/r3f-physics-binding';
98
- import { relativeImportSpecifier } from '@volter/editor-core/ui-source/relative-import-specifier';
99
- import type { ReparentChannel, ReparentRebase } from '@volter/editor-core/ui-source/reparent-guard';
93
+ } from '@volter/editor-react/source/oid-transform';
94
+ import { mergeRowDiagnostics } from '@volter/editor-react/source/r3f-diagnostic-index';
95
+ import type { R3fJointLiteral, R3fJointLiteralRange } from '@volter/editor-react/source/r3f-joint-binding';
96
+ import type { R3fLodNumberBinding } from '@volter/editor-react/source/r3f-lod-binding';
97
+ import { bodyPlacedChannel, physicsRefusal } from '@volter/editor-react/source/r3f-physics-binding';
98
+ import { relativeImportSpecifier } from '@volter/editor-react/source/relative-import-specifier';
99
+ import type { ReparentChannel, ReparentRebase } from '@volter/editor-react/source/reparent-guard';
100
100
  import type {
101
101
  SourceWriteBackend,
102
102
  StructReparentContext,
@@ -109,9 +109,9 @@ import {
109
109
  isNumberTupleLiteral,
110
110
  type JsxAttrInfo,
111
111
  offsetSnippetPositions,
112
- } from '@volter/editor-core/ui-source/writer';
113
- import { THREE_COMPONENTS_DOCUMENT_ID } from '@volter/editor-core/workspace-document-ids';
114
- import { activateWorkspaceDocument } from '@volter/editor-core/workspace-document-registry';
112
+ } from '@volter/editor-react/source/writer';
113
+ import { THREE_COMPONENTS_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
114
+ import { activateWorkspaceDocument } from '@volter/editor-sdk/kit/workspace-document-registry';
115
115
  import type {
116
116
  AssetDropContext,
117
117
  AssetDropProvider,
@@ -1026,7 +1026,7 @@ export class R3fSourceAuthoringAdapter implements AuthoringAdapter {
1026
1026
  * WRITTEN, as opposed to {@link sourceLocation}'s callsite (where it is USED).
1027
1027
  *
1028
1028
  * Both live in the same OID index; they are different entries reached through
1029
- * different keys on the SAME object. `vite-plugin-ui-oid`'s transform stamps a
1029
+ * different keys on the SAME object. `@volter/editor-react`'s `serving/ui-oid-plugin.ts`'s transform stamps a
1030
1030
  * host element inside a component definition with BOTH
1031
1031
  * `userData-oid="<this element, in the definition file>"` AND
1032
1032
  * `userData-authoringInstance={__vgaiOid}` (the callsite oid, passed in as a
@@ -1771,7 +1771,7 @@ export class R3fSourceAuthoringAdapter implements AuthoringAdapter {
1771
1771
  id: `definition:project-tool:${reference.name}`,
1772
1772
  title: reference.title,
1773
1773
  open: () => {
1774
- openProjectToolDocument(this.store, reference.name);
1774
+ openProjectToolDocument(reference.name);
1775
1775
  },
1776
1776
  },
1777
1777
  ];
@@ -1,5 +1,5 @@
1
- import { useEditorStore } from '@volter/editor-core/editor-runtime';
2
- import type { InspectorSectionProps } from '@volter/editor-core/inspector-section-registry';
1
+ import { useThreeEditorStore } from '@volter/editor-core/editor-runtime';
2
+ import type { InspectorSectionProps } from '@volter/editor-sdk/kit/inspector-section-registry';
3
3
  import type { AuthoringAdapter, EditorNode } from '@volter/editor-project/adapter';
4
4
  import { type ReflectionProbeSnapshot, reflectionProbeOf } from '@volter/threejs-runtime/adapter/reflection-probe';
5
5
  import { Button, EditorBanner, FieldGroup, FieldRow, Text } from '@volter/editor-sdk/widgets';
@@ -20,7 +20,7 @@ const STATUS_LABEL: Record<ReflectionProbeSnapshot['status'], string> = {
20
20
  const EMPTY_SNAPSHOT: ReflectionProbeSnapshot = { status: 'idle', lastCapturedAt: null };
21
21
 
22
22
  export function ReflectionProbeCaptureSection({ adapter, nodeId }: InspectorSectionProps) {
23
- const store = useEditorStore();
23
+ const store = useThreeEditorStore();
24
24
  const object = nodeId
25
25
  ? (store.objectMap.get(nodeId) ?? adapter.hierarchy.object3D?.(nodeId))
26
26
  : null;
@@ -1,6 +1,6 @@
1
1
  /** Native Rapier impulse-joint anchors projected onto generic viewport guides. */
2
2
 
3
- import type { R3fJointBinding, R3fJointLiteral } from '@volter/editor-core/ui-source/r3f-joint-binding';
3
+ import type { R3fJointBinding, R3fJointLiteral } from '@volter/editor-react/source/r3f-joint-binding';
4
4
  import type { PhysicsJointSnapshot, SpatialHandleLayer, SpatialPoint3 } from '@volter/editor-project/adapter';
5
5
  import * as THREE from 'three';
6
6
 
@@ -1,6 +1,6 @@
1
1
  /** Native THREE.LOD distance thresholds projected onto generic viewport guides. */
2
2
 
3
- import type { R3fLodBinding } from '@volter/editor-core/ui-source/r3f-lod-binding';
3
+ import type { R3fLodBinding } from '@volter/editor-react/source/r3f-lod-binding';
4
4
  import type { SpatialHandleLayer, SpatialPoint3 } from '@volter/editor-project/adapter';
5
5
  import * as THREE from 'three';
6
6
 
@@ -3,7 +3,7 @@
3
3
  import type {
4
4
  QuarksEmitterShape,
5
5
  R3fParticleBinding,
6
- } from '@volter/editor-core/ui-source/r3f-particle-binding';
6
+ } from '@volter/editor-react/source/r3f-particle-binding';
7
7
  import type { SpatialHandleLayer, SpatialPoint3 } from '@volter/editor-project/adapter';
8
8
  import * as THREE from 'three';
9
9
 
@@ -76,7 +76,7 @@ import {
76
76
  runWritePipe,
77
77
  type WriteAck,
78
78
  type WriteResolution,
79
- } from '@volter/editor-core/authoring/write-pipe';
79
+ } from '@volter/editor-sdk/kit/write-pipe';
80
80
  import { componentStatesProvider } from '@volter/editor-core/component-states-registry';
81
81
  import {
82
82
  type ChannelValue,
@@ -87,8 +87,8 @@ import {
87
87
  creationSiteAnchor,
88
88
  instancesAtSite,
89
89
  NO_OBJECT_REASON,
90
- } from '@volter/editor-core/creation-site-registry';
91
- import { editorConsole } from '@volter/editor-core/editor-console';
90
+ } from '@volter/editor-sdk/kit/creation-site-registry';
91
+ import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
92
92
  import type { EditorShellStore } from '@volter/editor-core/editor-shell-store';
93
93
  import { type JournalSubject, JsonHistoryResource } from '../../host/history/json-history-resource';
94
94
  import {
@@ -1337,7 +1337,7 @@ export class ThreeAuthoringAdapter implements AuthoringAdapter {
1337
1337
  // world constructs every object inside `node_modules`, so the creation-site
1338
1338
  // registry below answers "constructed outside project source" for all of
1339
1339
  // them — while the game's own JSX says exactly where each one is written,
1340
- // and `vite-plugin-ui-oid.ts` stamped that callsite onto the object. The
1340
+ // and `@volter/editor-react`'s `serving/ui-oid-plugin.ts` stamped that callsite onto the object. The
1341
1341
  // stamped answer is the SAME KIND of fact as a `new` site (a source
1342
1342
  // file:line an edit can be written at), so it belongs in the same slot
1343
1343
  // rather than beside it.
@@ -20,7 +20,7 @@ import {
20
20
  EXTRACT_COMPONENT_LABEL,
21
21
  type InstanceExtractSource,
22
22
  } from '../../host/instance-extract-actions';
23
- import { showTransientHint } from '@volter/editor-core/transient-hint';
23
+ import { showTransientHint } from '@volter/editor-sdk/kit/transient-hint';
24
24
  import type { AuthoringAdapter } from '@volter/editor-project/adapter';
25
25
 
26
26
  /** The extract surface for `nodeId`, or `null` — the host's own owner walk. */
@@ -26,7 +26,7 @@ import {
26
26
  FORK_COMPONENT_LABEL,
27
27
  type InstanceForkSource,
28
28
  } from '../../host/instance-fork-actions';
29
- import { showTransientHint } from '@volter/editor-core/transient-hint';
29
+ import { showTransientHint } from '@volter/editor-sdk/kit/transient-hint';
30
30
  import type { AuthoringAdapter } from '@volter/editor-project/adapter';
31
31
 
32
32
  /** The fork surface for `nodeId`, or `null` — the host's own owner walk. */
@@ -25,7 +25,7 @@ import {
25
25
  isInternalsRevealed,
26
26
  revealedInternalsIds,
27
27
  toggleInternalsRevealed,
28
- } from '@volter/editor-core/hierarchy-internals';
28
+ } from '@volter/editor-sdk/kit/hierarchy-internals';
29
29
  import { registerHierarchyMenuItems } from '@volter/editor-core/hierarchy-menu-registry';
30
30
  import type { AuthoringAdapter } from '@volter/editor-project/adapter';
31
31
 
@@ -0,0 +1,13 @@
1
+ /**
2
+ * drei's parsed-asset caches (`useGLTF`, `useTexture`) outlive a mount. A lane
3
+ * that reloads after project asset bytes change clears the changed paths
4
+ * first, or the next mount is handed the old bytes.
5
+ */
6
+ export async function evictDreiCaches(paths: readonly string[]): Promise<void> {
7
+ if (paths.length === 0) return;
8
+ const { useGLTF, useTexture } = await import('@react-three/drei');
9
+ for (const path of paths) {
10
+ useGLTF.clear(path);
11
+ useTexture.clear(path);
12
+ }
13
+ }
@@ -30,14 +30,13 @@ import type { SourceDocumentAuthoringFactory } from '@volter/editor-core/compone
30
30
  import { SurfaceStateOverlay } from '@volter/editor-core/components/SurfaceStateOverlay';
31
31
  import { STANDARD_COMPONENT_CAMERA_DIRECTION } from '@volter/editor-core/components/standard-viewport-dressing';
32
32
  import { registerDocumentOpener } from '@volter/editor-core/document-open-registry';
33
- import type { ViewportTab } from '@volter/editor-core/editor-shell-store';
34
- import { createHmrRegistrationGroup } from '@volter/editor-core/hmr-registration-group';
33
+ import { createHmrRegistrationGroup } from '@volter/editor-sdk/kit/hmr-registration-group';
35
34
  import {
36
35
  CONTRIBUTED_SECTION_ORDER,
37
36
  STORY_ARGS_SECTION_ID,
38
37
  STORY_ARGS_SECTION_TITLE,
39
- } from '@volter/editor-core/inspection/model';
40
- import { registerInspectorSections } from '@volter/editor-core/inspector-section-registry';
38
+ } from '@volter/editor-sdk/kit/inspection-model';
39
+ import { registerInspectorSections } from '@volter/editor-sdk/kit/inspector-section-registry';
41
40
  import type { ComposedProjectStory } from '@volter/editor-core/stories/compose-project-stories';
42
41
  import {
43
42
  type MountedStoryViewportSource,
@@ -49,7 +48,7 @@ import { declaredStoryMedium } from '@volter/editor-core/stories/story-declared-
49
48
  import {
50
49
  type StoryDocumentOpenRequest,
51
50
  THREE_STORY_DOCUMENT_OPENER,
52
- } from '@volter/editor-core/stories/story-document-openers';
51
+ } from '@volter/editor-sdk/kit/story-document-openers';
53
52
  import {
54
53
  getProjectStoryModules,
55
54
  subscribeProjectStoryModules,
@@ -60,14 +59,14 @@ import {
60
59
  type StoryPreviewComponent,
61
60
  } from '@volter/editor-core/stories/story-three-preview';
62
61
  import { mountedStoryHasThreeContent } from '@volter/editor-core/stories/three-story-model';
63
- import { explainSurface } from '@volter/editor-core/surface-state';
62
+ import { explainSurface } from '@volter/editor-sdk/kit/surface-state';
64
63
  import { sourceWriteBackendIfPrimed } from '@volter/editor-core/ui-source/tier-source-write-backend';
65
64
  import {
66
65
  activeWorkspaceDocument,
67
66
  closeWorkspaceDocument,
68
67
  openWorkspaceDocument,
69
68
  type WorkspaceDocumentContentProps,
70
- } from '@volter/editor-core/workspace-document-registry';
69
+ } from '@volter/editor-sdk/kit/workspace-document-registry';
71
70
  import { registerWorkspaceDocumentRestorer } from '@volter/editor-core/workspace-document-restore';
72
71
  import { STORY_ARGS_SECTION_ICON } from '../../react/story-documents/story-args-section';
73
72
  import {
@@ -84,10 +83,6 @@ const THREE_STORY_ARG_PATH_PREFIX = 'threeStory.arg.';
84
83
 
85
84
  /** The narrow store surface a three-story document needs — the T6.3 input-gate
86
85
  * hand-off, identical to `story-documents.tsx`'s `StoryDocumentStore`. */
87
- export interface ThreeStoryDocumentStore {
88
- setActiveViewportTab(tab: ViewportTab): void;
89
- }
90
-
91
86
  interface ThreeStoryDocumentState {
92
87
  readonly modulePath: string;
93
88
  readonly storyName: string;
@@ -149,7 +144,6 @@ export function setThreeStoryArgOverride(id: string, key: string, value: unknown
149
144
  * exhibit click-through target.
150
145
  */
151
146
  export function openThreeStoryDocument(
152
- store: ThreeStoryDocumentStore,
153
147
  modulePath: string,
154
148
  storyName: string,
155
149
  title = storyName,
@@ -187,7 +181,6 @@ export function openThreeStoryDocument(
187
181
  // a board-scoped rule (`board-scene.ts`) that one story cannot
188
182
  // re-derive.
189
183
  persist: ({ title: liveTitle }) => ({ modulePath, storyName, title: liveTitle }),
190
- onActivate: () => store.setActiveViewportTab('edit'),
191
184
  onDispose: (documentId) => {
192
185
  if (_states.delete(documentId)) notifyChanged();
193
186
  },
@@ -217,7 +210,6 @@ export function threeStoryDocumentState(
217
210
  * story registry (`refreshProjectStories`) first — this reads it synchronously.
218
211
  */
219
212
  export function restoreThreeStoryDocument(
220
- store: ThreeStoryDocumentStore,
221
213
  modulePath: string,
222
214
  storyName: string,
223
215
  title?: string,
@@ -233,7 +225,7 @@ export function restoreThreeStoryDocument(
233
225
  // which no single story can re-derive — so the tab is restored with the text
234
226
  // it had, falling back to the registry's own label for a record that
235
227
  // predates this or came from another opener.
236
- openThreeStoryDocument(store, modulePath, storyName, title ?? story.label);
228
+ openThreeStoryDocument(modulePath, storyName, title ?? story.label);
237
229
  return true;
238
230
  }
239
231
 
@@ -242,10 +234,8 @@ export function restoreThreeStoryDocument(
242
234
  registerDocumentOpener<StoryDocumentOpenRequest>({
243
235
  id: THREE_STORY_DOCUMENT_OPENER,
244
236
  owner: 'three-story-documents',
245
- open: (store, request) =>
246
- openThreeStoryDocument(
247
- store,
248
- request.modulePath,
237
+ open: (_store, request) =>
238
+ openThreeStoryDocument(request.modulePath,
249
239
  request.storyName,
250
240
  request.title ?? request.storyName,
251
241
  request.activate === undefined ? {} : { activate: request.activate },
@@ -259,7 +249,7 @@ registerWorkspaceDocumentRestorer({
259
249
  kind: 'world',
260
250
  owner: 'three-story-documents',
261
251
  prepare: prepareStoryDocumentRestore,
262
- restore: ({ state, store }) => {
252
+ restore: ({ state }) => {
263
253
  const record = state as
264
254
  | { modulePath?: unknown; storyName?: unknown; title?: unknown }
265
255
  | null
@@ -268,7 +258,7 @@ registerWorkspaceDocumentRestorer({
268
258
  const storyName = typeof record?.storyName === 'string' ? record.storyName : null;
269
259
  if (!modulePath || !storyName) return false;
270
260
  const title = typeof record?.title === 'string' ? record.title : undefined;
271
- return restoreThreeStoryDocument(store, modulePath, storyName, title);
261
+ return restoreThreeStoryDocument(modulePath, storyName, title);
272
262
  },
273
263
  });
274
264
 
@@ -55,39 +55,39 @@ import { registerAvailableWorkspaceDocument } from '@volter/editor-core/workspac
55
55
  import { object3DDocumentSession } from '@volter/editor-core/authoring/object3d-document-session-registry';
56
56
  import { Object3DDocumentViewport } from '@volter/editor-core/components/Object3DDocumentViewport';
57
57
  import { STANDARD_COMPONENT_CAMERA_DIRECTION } from '@volter/editor-core/components/standard-viewport-dressing';
58
- import { threeBoardBuildingCopy } from '@volter/editor-core/components/viewport-surface-status';
58
+ import { threeBoardBuildingCopy } from '@volter/editor-sdk/kit/viewport-surface-status';
59
59
  import { openRegisteredDocument } from '@volter/editor-core/document-open-registry';
60
60
  import { listProjectComponents } from '@volter/editor-core/editor-api';
61
- import { editorConsole } from '@volter/editor-core/editor-console';
62
- import { createHmrRegistrationGroup } from '@volter/editor-core/hmr-registration-group';
63
- import { CONTRIBUTED_SECTION_ORDER } from '@volter/editor-core/inspection/model';
61
+ import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
62
+ import { createHmrRegistrationGroup } from '@volter/editor-sdk/kit/hmr-registration-group';
63
+ import { CONTRIBUTED_SECTION_ORDER } from '@volter/editor-sdk/kit/inspection-model';
64
64
  import {
65
65
  type InspectorSectionProps,
66
66
  registerInspectorSections,
67
- } from '@volter/editor-core/inspector-section-registry';
68
- import { type ClipboardWriter, runInstanceSourceAction } from '@volter/editor-core/instance-source-actions';
67
+ } from '@volter/editor-sdk/kit/inspector-section-registry';
68
+ import { type ClipboardWriter, runInstanceSourceAction } from '@volter/editor-sdk/kit/instance-source-actions';
69
69
  import { getProjectStoryRegions } from '@volter/editor-core/stories/project-story-regions';
70
70
  import { declaredStoryMedium } from '@volter/editor-core/stories/story-declared-medium';
71
- import { THREE_STORY_DOCUMENT_OPENER } from '@volter/editor-core/stories/story-document-openers';
71
+ import { THREE_STORY_DOCUMENT_OPENER } from '@volter/editor-sdk/kit/story-document-openers';
72
72
  import {
73
73
  getProjectStoryModules,
74
74
  type ProjectStoryModule,
75
75
  subscribeProjectStoryModules,
76
76
  whenProjectStoriesReady,
77
77
  } from '@volter/editor-core/stories/story-registry';
78
- import { showTransientHint } from '@volter/editor-core/transient-hint';
78
+ import { showTransientHint } from '@volter/editor-sdk/kit/transient-hint';
79
79
  import {
80
80
  beginViewportBreakdown,
81
81
  cancelViewportBreakdown,
82
82
  markViewportBoardReady,
83
83
  markViewportReactActive,
84
84
  markViewportSegment,
85
- } from '@volter/editor-core/viewport-activation-timings';
86
- import { THREE_COMPONENTS_DOCUMENT_ID } from '@volter/editor-core/workspace-document-ids';
85
+ } from '@volter/editor-sdk/kit/viewport-activation-timings';
86
+ import { THREE_COMPONENTS_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
87
87
  import {
88
88
  activeWorkspaceDocument,
89
89
  type WorkspaceDocumentContentProps,
90
- } from '@volter/editor-core/workspace-document-registry';
90
+ } from '@volter/editor-sdk/kit/workspace-document-registry';
91
91
  import type { WorkspaceStateStore } from '@volter/editor-core/workspace-document-restore';
92
92
  import { faCircleInfo } from '@fortawesome/free-solid-svg-icons';
93
93
  import { themeVars } from '@volter/editor-sdk/widgets';
@@ -814,7 +814,7 @@ const threeBoardPreview = {
814
814
  revision: () => JSON.stringify(getProjectStoryModules().map((module_) => module_.modulePath)),
815
815
  subscribe: subscribeProjectStoryModules,
816
816
  capture: async (
817
- request: import('@volter/editor-core/document-preview-source').DocumentPreviewCaptureRequest,
817
+ request: import('@volter/editor-sdk/kit/document-preview-source').DocumentPreviewCaptureRequest,
818
818
  ) => {
819
819
  await whenProjectStoriesReady();
820
820
  const regions = getProjectStoryRegions();
@@ -881,7 +881,6 @@ export function installThreeBoardDocument(store: ThreeBoardStore): string {
881
881
  readOnly: true,
882
882
  preview: threeBoardPreview,
883
883
  presentation: () => ({ kind: 'workspace', id: THREE_COMPONENTS_DOCUMENT_ID }),
884
- onActivate: () => store.setActiveViewportTab('edit'),
885
884
  },
886
885
  { category: 'canvas' },
887
886
  );
@@ -96,7 +96,7 @@ import {
96
96
  markViewportSegment,
97
97
  noteViewportBreakdownCounts,
98
98
  recordViewportStoryMount,
99
- } from '@volter/editor-core/viewport-activation-timings';
99
+ } from '@volter/editor-sdk/kit/viewport-activation-timings';
100
100
  import { collectContentNodeRecords } from '@volter/editor-threejs/viewport/content-bounds';
101
101
  import { EDITOR_LAYER } from '@volter/editor-threejs/viewport/editor-layers';
102
102
  import { setUserData } from '@volter/threejs-runtime/ecs/user-data';
@@ -9,15 +9,15 @@
9
9
  * when it does not.
10
10
  */
11
11
 
12
- import { commandLine } from '@volter/editor-core/product-command';
12
+ import { commandLine } from '@volter/editor-sdk/kit/product-command';
13
13
  import type { ComponentBoard, ComponentBoardContext } from '@volter/editor-core/component-board-registry';
14
- import { editorConsole } from '@volter/editor-core/editor-console';
14
+ import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
15
15
  import {
16
16
  getStoryMediaPresence,
17
17
  subscribeStoryMediaPresence,
18
18
  } from '../../host/stories/story-media-presence';
19
19
  import { projectStoriesReady, subscribeProjectStoryModules } from '@volter/editor-core/stories/story-registry';
20
- import { THREE_COMPONENTS_DOCUMENT_ID } from '@volter/editor-core/workspace-document-ids';
20
+ import { THREE_COMPONENTS_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
21
21
 
22
22
  /** The tab reads `3D`, the peer of `Scene` and `UI` in the center strip. */
23
23
  const THREE_COMPONENTS_TITLE = '3D';
@@ -1,41 +0,0 @@
1
- /**
2
- * "MATERIALIZE PASTEBOARD FROM UI BOARD" in the command palette
3
- * (`@volter/editor-sdk/chrome`, a `workspace.action` contribution) — the ONE
4
- * action that turns the UI board's derived auto-grid into an authored
5
- * pasteboard `.tsx`.
6
- *
7
- * It was a row in the host's own `action-registry.ts:404-423`, lazily
8
- * importing `pasteboard-materialize.ts` — a host action about THIS package's
9
- * design-time surface, which is the only thing that kept both files in the
10
- * host (WORK.md §The open-source launch item 17). Shape transcribed from
11
- * `@volter/editor-game/contributions/profiler.action.ts`: a static `actions` array, no
12
- * subscribe, because this action's availability never changes — it either
13
- * materializes or it refuses by name.
14
- *
15
- * THE OUTCOME LANDS IN THE EDITOR CONSOLE EITHER WAY, unchanged from the row
16
- * it left: the success sentence names the file (which also opens), a refusal
17
- * names its remedy.
18
- */
19
-
20
- import { editorConsole } from '@volter/editor-core/editor-console';
21
- import type { ActionContribution } from '@volter/editor-sdk/chrome';
22
-
23
- export const point = 'workspace.action';
24
-
25
- export const actions: ActionContribution['actions'] = [
26
- {
27
- id: 'pasteboard.materialize',
28
- label: 'Materialize Pasteboard from UI Board',
29
- execute: async () => {
30
- const { materializePasteboard } = await import('../../src/react/pasteboard-materialize');
31
- try {
32
- editorConsole.log(`[pasteboard] ${await materializePasteboard()}`, 'authoring');
33
- } catch (error) {
34
- editorConsole.error(
35
- `[pasteboard] materialize refused: ${error instanceof Error ? error.message : String(error)}`,
36
- 'authoring',
37
- );
38
- }
39
- },
40
- },
41
- ];
@@ -1,42 +0,0 @@
1
- /**
2
- * The Behavior debugger's palette actions (`@volter/editor-sdk/chrome`, a
3
- * `workspace.action` contribution) — a LIVE set: `Inspect Behavior` (the
4
- * first truthful live actor, the same reveal as Debug ▸ Inspect Behavior)
5
- * plus one `Inspect Behavior: <machine>` per running XState actor. The host
6
- * asks `actions` when the palette opens and re-lists on `subscribe`: an
7
- * actor registering or a hierarchy change (any shell-store notification, so
8
- * the listing walks the object map only while a palette is open).
9
- */
10
-
11
- import type { ActionContribution } from '@volter/editor-sdk/chrome';
12
- import { editorHost } from '@volter/editor-sdk/host';
13
- import { subscribeXStateBehaviorInspections } from '@volter/threejs-runtime/behavior/xstate-inspection';
14
- import {
15
- listLiveBehaviors,
16
- openBehaviorDocument,
17
- openFirstBehaviorDocument,
18
- } from '../src/xstate/live-behaviors';
19
-
20
- export const point = 'workspace.action';
21
-
22
- export const actions: ActionContribution['actions'] = () => [
23
- {
24
- id: 'inspect-behavior',
25
- label: 'Inspect Behavior',
26
- execute: () => void openFirstBehaviorDocument(),
27
- },
28
- ...listLiveBehaviors().map((entry) => ({
29
- id: `xstate-machine:${entry.machineId}:${entry.nodeId}`,
30
- label: `Inspect Behavior: ${entry.machineId}`,
31
- execute: () => void openBehaviorDocument(entry.nodeId),
32
- })),
33
- ];
34
-
35
- export const subscribe: ActionContribution['subscribe'] = (listener) => {
36
- const stopInspections = subscribeXStateBehaviorInspections(listener);
37
- const stopHierarchy = editorHost().hierarchy.subscribe(listener);
38
- return () => {
39
- stopInspections();
40
- stopHierarchy();
41
- };
42
- };
@@ -1,73 +0,0 @@
1
- /**
2
- * THE BEHAVIOR DOCUMENT (`workspace.document`): the REAL live actor of the
3
- * machine you asked to inspect, drawn as its graph — the same asset-document
4
- * pattern the animation and model editors use, inspect-only.
5
- *
6
- * Its subject is `live-behaviors.ts`'s (`openBehaviorDocument(nodeId)` sets it
7
- * and opens this tab, from the section's button, the Debug menu and each
8
- * `Inspect Behavior: <id>` palette action). With no live actor for that node —
9
- * the game stopped, the actor detached — the document says so rather than
10
- * drawing a machine nothing is running.
11
- *
12
- * No `tool`: it drives no registered callable.
13
- */
14
-
15
- import type { ToolContributionProps, ToolDocumentToolbar } from '@volter/editor-sdk/contributions';
16
- import {
17
- subscribeXStateBehaviorInspections,
18
- xstateBehaviorInspectionsVersion,
19
- } from '@volter/threejs-runtime/behavior/xstate-inspection';
20
- import { useSyncExternalStore } from 'react';
21
- import {
22
- behaviorSubject,
23
- behaviorSubjectVersion,
24
- liveBehaviorFor,
25
- subscribeBehaviorSubject,
26
- } from '../src/xstate/live-behaviors';
27
- import { XStateMachineInspector } from '../src/xstate/XStateMachineInspector';
28
-
29
- export const point = 'workspace.document';
30
- export const title = 'Behavior';
31
-
32
- /** Re-render on both live facts this document draws: which node it is on, and
33
- * whether that node still carries an inspection. */
34
- function useSubjectBehavior() {
35
- useSyncExternalStore(subscribeBehaviorSubject, behaviorSubjectVersion, behaviorSubjectVersion);
36
- useSyncExternalStore(
37
- subscribeXStateBehaviorInspections,
38
- xstateBehaviorInspectionsVersion,
39
- xstateBehaviorInspectionsVersion,
40
- );
41
- const nodeId = behaviorSubject();
42
- return nodeId ? liveBehaviorFor(nodeId) : undefined;
43
- }
44
-
45
- /** The document's header, in the host's own strip: which machine, and that it
46
- * is a live actor you may read but not edit. */
47
- export const Toolbar: ToolDocumentToolbar = () => {
48
- const behavior = useSubjectBehavior();
49
- return (
50
- <span data-testid="xstate-behavior-toolbar" style={{ fontSize: 11 }}>
51
- {behavior ? `${behavior.machine.id} · Live actor · inspect-only` : 'Behavior unavailable'}
52
- </span>
53
- );
54
- };
55
-
56
- export default function XStateBehaviorDocument(_props: ToolContributionProps) {
57
- const behavior = useSubjectBehavior();
58
- return (
59
- <div className="vgai-behavior-document" data-testid="xstate-behavior-document">
60
- {behavior ? (
61
- <XStateMachineInspector
62
- machine={behavior.machine}
63
- actor={behavior.actor}
64
- title={behavior.machine.id}
65
- />
66
- ) : (
67
- <div className="vgai-behavior-document__empty">
68
- This live behavior is no longer registered.
69
- </div>
70
- )}
71
- </div>
72
- );
73
- }
@@ -1,28 +0,0 @@
1
- /**
2
- * The Behavior Inspector section (`selection.inspector`, §4.3): the machine a
3
- * selected entity is actually running.
4
- *
5
- * `match` reads the hierarchy door for the node's own live inspection mark, so
6
- * it matches ONLY a real live actor — a template entity (no machine) never
7
- * matches, and the section cannot render for it.
8
- */
9
- import type {
10
- ToolContributionNode,
11
- ToolInspectorContributionProps,
12
- } from '@volter/editor-sdk/contributions';
13
- import { liveBehaviorFor } from '../src/xstate/live-behaviors';
14
- import { XStateMachineSection } from '../src/xstate/XStateBehaviorSection';
15
-
16
- export const point = 'selection.inspector';
17
- export const title = 'Behavior';
18
- /** Where the host registered it before the move: the contributed band's own
19
- * base, ahead of modules that claim no place. */
20
- export const order = 0;
21
-
22
- export function match(node: ToolContributionNode | null): boolean {
23
- return node !== null && liveBehaviorFor(node.id) !== undefined;
24
- }
25
-
26
- export default function XStateBehaviorInspector({ nodeId }: ToolInspectorContributionProps) {
27
- return <XStateMachineSection nodeId={nodeId} />;
28
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * Debug ▸ Inspect Behavior — opens the first truthful live actor as the
3
- * Behavior document. Disabled while no live actor is registered, which is the
4
- * same predicate the open path itself refuses on; `disabled` is asked at
5
- * render, so it follows the session.
6
- */
7
- import type { MenuContribution } from '@volter/editor-sdk/chrome';
8
- import { listLiveBehaviors, openFirstBehaviorDocument } from '../src/xstate/live-behaviors';
9
-
10
- export const point = 'workspace.menu';
11
-
12
- export const menu: MenuContribution = {
13
- menu: 'debug',
14
- items: [
15
- {
16
- id: 'inspect-behavior',
17
- label: 'Inspect Behavior',
18
- testId: 'menu-inspect-behavior',
19
- disabled: () => listLiveBehaviors().length === 0,
20
- execute: () => void openFirstBehaviorDocument(),
21
- },
22
- ],
23
- };