@netless/window-manager 1.0.13-beta.1 → 1.0.13-test.2

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/dist/index.mjs CHANGED
@@ -352,6 +352,7 @@ const setScenePath = (room, scenePath) => {
352
352
  if (room && room.isWritable) {
353
353
  if (room.state.sceneState.scenePath !== scenePath) {
354
354
  const nextScenePath = scenePath === "/" ? "" : scenePath;
355
+ console.log("[window-manager] real setScenePath for current room====>", nextScenePath);
355
356
  room.setScenePath(nextScenePath);
356
357
  }
357
358
  }
@@ -463,6 +464,7 @@ class AppListeners {
463
464
  break;
464
465
  }
465
466
  case Events.SetMainViewScenePath: {
467
+ console.log("[window-manager] mainMagixEventListener====>", JSON.stringify(data.payload));
466
468
  this.setMainViewScenePathHandler(data.payload);
467
469
  break;
468
470
  }
@@ -7127,9 +7129,11 @@ class AttributesDelegate {
7127
7129
  return this.attributes["boxState"];
7128
7130
  }
7129
7131
  setMainViewScenePath(scenePath) {
7132
+ console.log("[window-manager] setMainViewScenePath====>", scenePath);
7130
7133
  this.context.safeSetAttributes({ _mainScenePath: scenePath });
7131
7134
  }
7132
7135
  setMainViewSceneIndex(index2) {
7136
+ console.log("[window-manager] setMainViewSceneIndex====>", index2);
7133
7137
  this.context.safeSetAttributes({ _mainSceneIndex: index2 });
7134
7138
  }
7135
7139
  getMainViewCamera() {
@@ -7139,16 +7143,19 @@ class AttributesDelegate {
7139
7143
  return get(this.attributes, ["mainViewSize"]);
7140
7144
  }
7141
7145
  setMainViewCamera(camera) {
7146
+ console.log("[window-manager] setMainViewCamera====>", JSON.stringify(camera));
7142
7147
  this.context.safeSetAttributes({ ["mainViewCamera"]: { ...camera } });
7143
7148
  }
7144
7149
  setMainViewSize(size2) {
7145
7150
  if (size2.width === 0 || size2.height === 0)
7146
7151
  return;
7152
+ console.log("[window-manager] setMainViewSize====>", JSON.stringify(size2));
7147
7153
  this.context.safeSetAttributes({ ["mainViewSize"]: { ...size2 } });
7148
7154
  }
7149
7155
  setMainViewCameraAndSize(camera, size2) {
7150
7156
  if (size2.width === 0 || size2.height === 0)
7151
7157
  return;
7158
+ console.log("[window-manager] setMainViewCameraAndSize====>", JSON.stringify(camera), JSON.stringify(size2));
7152
7159
  this.context.safeSetAttributes({
7153
7160
  ["mainViewCamera"]: { ...camera },
7154
7161
  ["mainViewSize"]: { ...size2 }
@@ -7782,6 +7789,7 @@ class MainViewProxy {
7782
7789
  () => this.mainViewCamera,
7783
7790
  (camera) => {
7784
7791
  if (camera && camera.id !== this.manager.uid) {
7792
+ console.log("[window-manager] cameraReaction====>", JSON.stringify(camera), JSON.stringify(this.mainViewSize));
7785
7793
  this.moveCameraToContian(this.mainViewSize);
7786
7794
  this.moveCamera(camera);
7787
7795
  }
@@ -7793,11 +7801,13 @@ class MainViewProxy {
7793
7801
  if (size2) {
7794
7802
  this.moveCameraToContian(size2);
7795
7803
  this.moveCamera(this.mainViewCamera);
7804
+ console.log("[window-manager] sizeChangeHandler====> current size and camera", JSON.stringify(size2), JSON.stringify(this.mainViewCamera));
7796
7805
  }
7797
7806
  this.ensureMainViewSize();
7798
7807
  }, 30);
7799
7808
  this.onUpdateContainerSizeRatio = () => {
7800
7809
  const size2 = this.store.getMainViewSize();
7810
+ console.log("[window-manager] onUpdateContainerSizeRatio====>", JSON.stringify(size2));
7801
7811
  this.sizeChangeHandler(size2);
7802
7812
  };
7803
7813
  this.onCameraUpdatedByDevice = (camera) => {
@@ -7821,10 +7831,12 @@ class MainViewProxy {
7821
7831
  clearTimeout(this._syncMainViewTimer);
7822
7832
  this._syncMainViewTimer = setTimeout(this.syncMainView, 100, this.manager.room);
7823
7833
  }
7834
+ console.log("[window-manager] onCameraOrSizeUpdated====>", JSON.stringify(this.cameraState));
7824
7835
  this.ensureMainViewSize();
7825
7836
  };
7826
7837
  this.syncMainView = (room) => {
7827
7838
  if (room.isWritable) {
7839
+ console.log("[window-manager] syncMainView====>");
7828
7840
  room.syncMainView(this.mainView);
7829
7841
  }
7830
7842
  };
@@ -7840,6 +7852,7 @@ class MainViewProxy {
7840
7852
  this.startListenWritableChange();
7841
7853
  });
7842
7854
  const playgroundSizeChangeListener = () => {
7855
+ console.log("[window-manager] playgroundSizeChangeListener====>", JSON.stringify(this.mainViewSize));
7843
7856
  this.sizeChangeHandler(this.mainViewSize);
7844
7857
  };
7845
7858
  this.sideEffectManager.add(() => {
@@ -7879,6 +7892,7 @@ class MainViewProxy {
7879
7892
  this.moveCamera(this.mainViewCamera);
7880
7893
  }
7881
7894
  start() {
7895
+ console.log("[window-manager] start====>", JSON.stringify(this.mainViewSize));
7882
7896
  this.sizeChangeHandler(this.mainViewSize);
7883
7897
  if (this.started)
7884
7898
  return;
@@ -8404,6 +8418,7 @@ class AppManager {
8404
8418
  const pageName = scenePath.replace(sceneDir, "").replace("/", "");
8405
8419
  const index2 = scenes.findIndex((scene) => scene.name === pageName);
8406
8420
  if (isInteger(index2) && index2 >= 0) {
8421
+ console.log("[window-manager] updateSceneIndex====>", index2);
8407
8422
  this.safeSetAttributes({ _mainSceneIndex: index2 });
8408
8423
  }
8409
8424
  }
@@ -8790,6 +8805,7 @@ class AppManager {
8790
8805
  async _setMainViewScenePath(scenePath) {
8791
8806
  const success = this.setMainViewFocusPath(scenePath);
8792
8807
  if (success) {
8808
+ console.log("[window-manager] _setMainViewScenePath====>", scenePath);
8793
8809
  this.safeSetAttributes({ _mainScenePath: scenePath });
8794
8810
  this.store.setMainViewFocusPath(this.mainView);
8795
8811
  this.updateSceneIndex();
@@ -8817,6 +8833,7 @@ class AppManager {
8817
8833
  }
8818
8834
  }
8819
8835
  dispatchSetMainViewScenePath(scenePath) {
8836
+ console.log("[window-manager] dispatchSetMainViewScenePath====>", JSON.stringify(scenePath));
8820
8837
  this.dispatchInternalEvent(Events.SetMainViewScenePath, { nextScenePath: scenePath });
8821
8838
  callbacks$1.emit("mainViewScenePathChange", scenePath);
8822
8839
  setScenePath(this.room, scenePath);
@@ -9082,6 +9099,11 @@ const replaceRoomFunction = (room, manager) => {
9082
9099
  return manager.canRedoSteps;
9083
9100
  }
9084
9101
  });
9102
+ const _scalePptToFit = room.scalePptToFit;
9103
+ room.scalePptToFit = (...args) => {
9104
+ console.log("[window-manager] scalePptToFit====>", JSON.stringify(args));
9105
+ _scalePptToFit.call(room, ...args);
9106
+ };
9085
9107
  room.moveCamera = (camera) => manager.moveCamera(camera);
9086
9108
  room.moveCameraToContain = (...args) => manager.moveCameraToContain(...args);
9087
9109
  room.convertToPointInWorld = (...args) => manager.mainView.convertToPointInWorld(...args);
@@ -19672,7 +19694,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
19672
19694
  const _WindowManager = class extends InvisiblePlugin {
19673
19695
  constructor(context) {
19674
19696
  super(context);
19675
- this.version = "1.0.13-beta.1";
19697
+ this.version = "1.0.13-test.2";
19676
19698
  this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.53" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "1.0.0-next.30", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "^2.16.53" } };
19677
19699
  this.emitter = callbacks$1;
19678
19700
  this.viewMode = ViewMode.Broadcaster;