@netless/window-manager 1.0.13-test.18 → 1.0.13-test.19

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": "1.0.13-test.18",
3
+ "version": "1.0.13-test.19",
4
4
  "description": "Multi-window mode for Netless Whiteboard",
5
5
  "author": "l1shen <lishen1635@gmail.com> (https://github.com/l1shen)",
6
6
  "license": "MIT",
package/src/AppManager.ts CHANGED
@@ -923,7 +923,6 @@ export class AppManager {
923
923
  }
924
924
 
925
925
  private dispatchSetMainViewScenePath(scenePath: string): void {
926
- console.log("[window-manager] dispatchSetMainViewScenePath " + scenePath);
927
926
  this.dispatchInternalEvent(Events.SetMainViewScenePath, { nextScenePath: scenePath });
928
927
  callbacks.emit("mainViewScenePathChange", scenePath);
929
928
  // 兼容 15 的 SDK, 需要 room 的当前 ScenePath
@@ -34,7 +34,6 @@ export const setScenePath = (room: Room | undefined, scenePath: string) => {
34
34
  if (room && room.isWritable) {
35
35
  if (room.state.sceneState.scenePath !== scenePath) {
36
36
  const nextScenePath = scenePath === "/" ? "" : scenePath;
37
- console.log("[window-manager] real setScenePath for current room " + nextScenePath);
38
37
  room.setScenePath(nextScenePath);
39
38
  }
40
39
  }
@@ -37,10 +37,24 @@ export const replaceRoomFunction = (room: Room | Player, manager: WindowManager)
37
37
  room.scalePptToFit = (...args) => {
38
38
  _scalePptToFit.call(room, ...args);
39
39
  if (manager.appManager?.mainViewProxy) {
40
- console.log("[window-manager] scalePptToFit " + JSON.stringify(args));
41
40
  manager.appManager.mainViewProxy.setCameraAndSize();
42
41
  }
43
42
  };
43
+ const _putScenes = room.putScenes;
44
+ room.putScenes = (...args) => {
45
+ const [path, scenes] = args;
46
+ const currentScenePath = manager.mainView.focusScenePath;
47
+ if (currentScenePath && path && scenes) {
48
+ console.log("[window-manager] putScenes " + JSON.stringify(args));
49
+ for (const scene of scenes) {
50
+ if (`${path}${scene.name}` === currentScenePath) {
51
+ console.error(`[window-manager] putScenes: scene name can not be the same as the current scene path: ${currentScenePath}`);
52
+ return;
53
+ }
54
+ }
55
+ }
56
+ return _putScenes.call(room, ...args);
57
+ };
44
58
  room.moveCamera = (camera: Camera) => manager.moveCamera(camera);
45
59
  room.moveCameraToContain = (...args) => manager.moveCameraToContain(...args);
46
60
  room.convertToPointInWorld = (...args) => manager.mainView.convertToPointInWorld(...args);
@@ -380,7 +380,7 @@ export class MainViewProxy {
380
380
 
381
381
  private syncMainView = (room: Room) => {
382
382
  if (room.isWritable) {
383
- console.log("[window-manager] syncMainView ");
383
+ console.log("[window-manager] syncMainView ");
384
384
  room.syncMainView(this.mainView);
385
385
  }
386
386
  };