@netless/window-manager 0.3.8-canary.0 → 0.3.8-canary.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "0.3.8-canary.0",
3
+ "version": "0.3.8-canary.1",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",
@@ -56,6 +56,6 @@
56
56
  "typescript": "^4.3.5",
57
57
  "video.js": "^7.14.3",
58
58
  "vite": "^2.5.3",
59
- "white-web-sdk": "2.15.6"
59
+ "white-web-sdk": "^2.15.8"
60
60
  }
61
61
  }
@@ -3,6 +3,7 @@ import { Events, MagixEventName } from './constants';
3
3
  import type { Event } from "white-web-sdk";
4
4
  import type { AppManager } from "./AppManager";
5
5
  import type { TeleBoxState } from "@netless/telebox-insider";
6
+ import { setViewFocusScenePath } from './Utils/Common';
6
7
 
7
8
  export class AppListeners {
8
9
  private displayer = this.manager.displayer;
@@ -38,6 +39,10 @@ export class AppListeners {
38
39
  this.boxStateChangeHandler(data.payload);
39
40
  break;
40
41
  }
42
+ case Events.SetMainViewScenePath: {
43
+ this.setMainViewScenePathHandler(data.payload);
44
+ break;
45
+ }
41
46
  default:
42
47
  break;
43
48
  }
@@ -60,4 +65,8 @@ export class AppListeners {
60
65
  private boxStateChangeHandler = (state: TeleBoxState) => {
61
66
  callbacks.emit("boxStateChange", state);
62
67
  }
68
+
69
+ private setMainViewScenePathHandler = ({ nextScenePath }: { nextScenePath: string }) => {
70
+ setViewFocusScenePath(this.manager.mainView, nextScenePath);
71
+ }
63
72
  }
package/src/AppManager.ts CHANGED
@@ -314,6 +314,7 @@ export class AppManager {
314
314
  await this.viewManager.switchMainViewToWriter();
315
315
  setScenePath(this.room, scenePath);
316
316
  this.store.setMainViewFocusPath();
317
+ this.dispatchInternalEvent(Events.SetMainViewScenePath, { nextScenePath: scenePath });
317
318
  }
318
319
 
319
320
  public async setMainViewSceneIndex(index: number) {
@@ -321,8 +322,10 @@ export class AppManager {
321
322
  this.safeSetAttributes({ _mainSceneIndex: index });
322
323
  await this.viewManager.switchMainViewToWriter();
323
324
  this.room.setSceneIndex(index);
324
- this.store.setMainViewScenePath(this.room.state.sceneState.scenePath);
325
+ const nextScenePath = this.room.state.sceneState.scenePath;
326
+ this.store.setMainViewScenePath(nextScenePath);
325
327
  this.store.setMainViewFocusPath();
328
+ this.dispatchInternalEvent(Events.SetMainViewScenePath, { nextScenePath });
326
329
  }
327
330
  }
328
331
 
@@ -2,11 +2,7 @@ import { Base } from "./Base";
2
2
  import { callbacks, WindowManager } from "./index";
3
3
  import { reaction, ViewVisionMode } from "white-web-sdk";
4
4
  import { SET_SCENEPATH_DELAY } from "./constants";
5
- import {
6
- notifyMainViewModeChange,
7
- setScenePath,
8
- setViewMode,
9
- } from "./Utils/Common";
5
+ import { notifyMainViewModeChange, setScenePath, setViewMode } from "./Utils/Common";
10
6
  import type { View } from "white-web-sdk";
11
7
  import type { AppManager } from "./AppManager";
12
8
 
package/src/index.ts CHANGED
@@ -169,7 +169,7 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
169
169
  public static containerSizeRatio = DEFAULT_CONTAINER_RATIO;
170
170
  private static isCreated = false;
171
171
 
172
- public version = "0.3.8-canary.0";
172
+ public version = "0.3.8-canary.1";
173
173
 
174
174
  public appListeners?: AppListeners;
175
175