@netless/window-manager 0.4.9-canary.0 → 0.4.9

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/docs/api.md CHANGED
@@ -252,6 +252,7 @@ manager.callbacks.on(events, listener)
252
252
  | canUndoStepsChange | number | | 当前 focus 的 view 可撤销步数改变 |
253
253
  | loadApp | LoadAppEvent | | 加载远程APP 事件 |
254
254
  | ready | undefined | | 当所有 APP 创建完毕时触发 |
255
+ | sceneStateChange | SceneState | | 当 sceneState 修改时触发 |
255
256
 
256
257
  ```ts
257
258
  type LoadAppEvent = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "0.4.9-canary.0",
3
+ "version": "0.4.9",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",
package/src/AppManager.ts CHANGED
@@ -168,6 +168,7 @@ export class AppManager {
168
168
  }),
169
169
  sceneName: sceneName,
170
170
  };
171
+ callbacks.emit("sceneStateChange", this.sceneState);
171
172
  };
172
173
 
173
174
  private get eventName() {
package/src/AppProxy.ts CHANGED
@@ -92,7 +92,7 @@ export class AppProxy {
92
92
 
93
93
  public getFullScenePath(): string | undefined {
94
94
  if (this.scenePath) {
95
- return get(this.appAttributes, [Fields.FullPath], this.getFullScenePathFromScenes());
95
+ return get(this.appAttributes, [Fields.FullPath]) || this.getFullScenePathFromScenes();
96
96
  }
97
97
  }
98
98
 
@@ -347,6 +347,7 @@ export class AppProxy {
347
347
  if (fullPath && this.view) {
348
348
  setViewFocusScenePath(this.view, fullPath);
349
349
  }
350
+ return fullPath;
350
351
  }
351
352
 
352
353
  private async createView(): Promise<View> {
package/src/callback.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import Emittery from "emittery";
2
2
  import type { TeleBoxColorScheme, TELE_BOX_STATE } from "@netless/telebox-insider";
3
- import type { CameraState, ViewVisionMode } from "white-web-sdk";
3
+ import type { CameraState, SceneState, ViewVisionMode } from "white-web-sdk";
4
4
  import type { LoadAppEvent } from "./Register";
5
5
 
6
6
  export type PublicEvent = {
@@ -17,6 +17,7 @@ export type PublicEvent = {
17
17
  canUndoStepsChange: number;
18
18
  loadApp: LoadAppEvent;
19
19
  ready: undefined; // 所有 APP 创建完毕时触发
20
+ sceneStateChange: SceneState;
20
21
  };
21
22
 
22
23
  export type CallbacksType = Emittery<PublicEvent>;
package/src/index.ts CHANGED
@@ -849,12 +849,11 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
849
849
  if (!this.attributes[Fields.Cursors]) {
850
850
  this.safeSetAttributes({ [Fields.Cursors]: {} });
851
851
  }
852
- const sceneState = this.displayer.state.sceneState;
853
852
  if (!this.attributes["_mainScenePath"]) {
854
- this.safeSetAttributes({ _mainScenePath: sceneState.scenePath });
853
+ this.safeSetAttributes({ _mainScenePath: ROOT_DIR });
855
854
  }
856
855
  if (!this.attributes["_mainSceneIndex"]) {
857
- this.safeSetAttributes({ _mainSceneIndex: sceneState.index });
856
+ this.safeSetAttributes({ _mainSceneIndex: 0 });
858
857
  }
859
858
  }
860
859
  }