@volter/editor-blender 0.1.146 → 0.1.147

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.
@@ -1026,14 +1026,25 @@ function BlenderViewportArea({
1026
1026
  waitForDraw();
1027
1027
  const stopStages = onViewportStages(waitForDraw);
1028
1028
  const onEscape = (event: KeyboardEvent): void => {
1029
- if (event.key === 'Escape' && surfaceAcceptsKey(event)) {
1029
+ if (event.key !== 'Escape' || !surfaceAcceptsKey(event)) return;
1030
+ // Decided once the event has finished dispatching: a play script that claims Escape (a
1031
+ // game's pause, registered after this listener) prevents its default, and the Escape that
1032
+ // frees a game's mouse look is the person taking their mouse back. Both used to stop Play
1033
+ // (three playtests of a Cyclotron game lost a mission each to it).
1034
+ if (globalThis.document.pointerLockElement || performance.now() - lastPointerUnlockAt < 500) return;
1035
+ setTimeout(() => {
1036
+ if (event.defaultPrevented) return;
1030
1037
  const extension = documentPlayExtension('model');
1031
1038
  if (extension?.escape) extension.escape(modelId);
1032
1039
  else extension?.setPlaying(modelId, false);
1033
- }
1040
+ }, 0);
1034
1041
  };
1042
+ let lastPointerUnlockAt = -Infinity;
1043
+ const onLockChange = (): void => { if (!globalThis.document.pointerLockElement) lastPointerUnlockAt = performance.now(); };
1044
+ globalThis.document.addEventListener('pointerlockchange', onLockChange);
1035
1045
  window.addEventListener('keydown', onEscape, true);
1036
1046
  return () => {
1047
+ globalThis.document.removeEventListener('pointerlockchange', onLockChange);
1037
1048
  stopped = true;
1038
1049
  stopStages();
1039
1050
  stopPrepareFrames?.();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@volter/editor-blender",
3
3
  "author": "Volter AI, Inc.",
4
4
  "license": "AGPL-3.0-only AND GPL-3.0-or-later",
5
- "version": "0.1.146",
5
+ "version": "0.1.147",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -72,15 +72,15 @@
72
72
  },
73
73
  "dependencies": {
74
74
  "@modelcontextprotocol/sdk": "1.32.1",
75
- "@volter/blender-engine": "0.1.144",
76
- "@volter/editor-threejs": "0.5.207",
75
+ "@volter/blender-engine": "0.1.145",
76
+ "@volter/editor-threejs": "0.5.208",
77
77
  "zod": "^4.3.6",
78
78
  "@fortawesome/free-solid-svg-icons": "^7.2.0"
79
79
  },
80
80
  "peerDependencies": {
81
- "@volter/live": "0.5.207",
82
- "@volter/project": "0.5.207",
83
- "@volter/sdk": "0.5.207",
81
+ "@volter/live": "0.5.208",
82
+ "@volter/project": "0.5.208",
83
+ "@volter/sdk": "0.5.208",
84
84
  "react": "^19.0.0",
85
85
  "react-dom": "^19.0.0",
86
86
  "three": "^0.180.0",