@netless/window-manager 0.4.66 → 0.4.67-beta.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/dist/index.mjs CHANGED
@@ -1240,9 +1240,13 @@ class AttributesDelegate {
1240
1240
  this.context.safeSetAttributes({ ["mainViewCamera"]: __spreadValues({}, camera) });
1241
1241
  }
1242
1242
  setMainViewSize(size2) {
1243
+ if (size2.width === 0 || size2.height === 0)
1244
+ return;
1243
1245
  this.context.safeSetAttributes({ ["mainViewSize"]: __spreadValues({}, size2) });
1244
1246
  }
1245
1247
  setMainViewCameraAndSize(camera, size2) {
1248
+ if (size2.width === 0 || size2.height === 0)
1249
+ return;
1246
1250
  this.context.safeSetAttributes({
1247
1251
  ["mainViewCamera"]: __spreadValues({}, camera),
1248
1252
  ["mainViewSize"]: __spreadValues({}, size2)
@@ -1819,6 +1823,7 @@ class MainViewProxy {
1819
1823
  this.moveCameraToContian(size2);
1820
1824
  this.moveCamera(this.mainViewCamera);
1821
1825
  }
1826
+ this.ensureMainViewSize();
1822
1827
  }, 30);
1823
1828
  this.onUpdateContainerSizeRatio = () => {
1824
1829
  const size2 = this.store.getMainViewSize();
@@ -1845,6 +1850,7 @@ class MainViewProxy {
1845
1850
  clearTimeout(this._syncMainViewTimer);
1846
1851
  this._syncMainViewTimer = setTimeout(this.syncMainView, 100, this.manager.room);
1847
1852
  }
1853
+ this.ensureMainViewSize();
1848
1854
  };
1849
1855
  this.syncMainView = (room) => {
1850
1856
  if (room.isWritable) {
@@ -1989,6 +1995,11 @@ class MainViewProxy {
1989
1995
  this.view.callbacks.off("onCameraUpdated", this.onCameraOrSizeUpdated);
1990
1996
  this.view.callbacks.off("onSizeUpdated", this.onCameraOrSizeUpdated);
1991
1997
  }
1998
+ ensureMainViewSize() {
1999
+ if ((!this.mainViewSize || this.mainViewSize.width === 0 || this.mainViewSize.height === 0) && this.mainView.size.width > 0 && this.mainView.size.height > 0) {
2000
+ this.setMainViewSize(this.mainView.size);
2001
+ }
2002
+ }
1992
2003
  moveCameraToContian(size2) {
1993
2004
  if (!isEmpty(size2)) {
1994
2005
  this.view.moveCameraToContain({
@@ -17505,7 +17516,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
17505
17516
  const _WindowManager = class extends InvisiblePlugin {
17506
17517
  constructor(context) {
17507
17518
  super(context);
17508
- this.version = "0.4.66-beta.0";
17519
+ this.version = "0.4.67-beta.1";
17509
17520
  this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.27", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "^0.1.5", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.17", "@netless/app-media-player": "0.1.0-beta.5", "@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.22", "@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", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.5.3", "vitest": "^0.14.1", "white-web-sdk": "2.16.43" } };
17510
17521
  this.emitter = callbacks$1;
17511
17522
  this.viewMode = ViewMode.Broadcaster;