@netless/window-manager 1.0.13-test.10 → 1.0.13-test.11

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
@@ -7860,6 +7860,14 @@ class MainViewProxy {
7860
7860
  this._syncMainViewTimer = 0;
7861
7861
  this.onCameraOrSizeUpdated = () => {
7862
7862
  console.log("[window-manager] onCameraOrSizeUpdated " + JSON.stringify(this.cameraState));
7863
+ if (this.mainView.divElement) {
7864
+ const children2 = this.mainView.divElement.children;
7865
+ console.log("[window-manager] onCameraOrSizeUpdated " + this.mainView.divElement.getBoundingClientRect());
7866
+ const child = children2[0];
7867
+ if (child) {
7868
+ console.log("[window-manager] child" + JSON.stringify(child.getBoundingClientRect()));
7869
+ }
7870
+ }
7863
7871
  callbacks$1.emit("cameraStateChange", this.cameraState);
7864
7872
  if (this.manager.room && this.manager.room.syncMainView) {
7865
7873
  clearTimeout(this._syncMainViewTimer);
@@ -7886,6 +7894,7 @@ class MainViewProxy {
7886
7894
  });
7887
7895
  const playgroundSizeChangeListener = () => {
7888
7896
  var _a, _b, _c, _d, _e, _f, _g, _h;
7897
+ this.refreshScreenSizeIfStale();
7889
7898
  this.playgroundSizeChangeListenerLocalConsole.log(
7890
7899
  JSON.stringify(this.mainView.camera),
7891
7900
  JSON.stringify(this.mainView.size),
@@ -7936,6 +7945,24 @@ class MainViewProxy {
7936
7945
  this.moveCameraToContian(this.mainViewSize);
7937
7946
  this.moveCamera(this.mainViewCamera);
7938
7947
  }
7948
+ refreshScreenSizeIfStale() {
7949
+ var _a;
7950
+ const element2 = this.mainView.divElement;
7951
+ if (!element2)
7952
+ return;
7953
+ const { width, height } = element2.getBoundingClientRect();
7954
+ if (width <= 0 || height <= 0)
7955
+ return;
7956
+ const { width: viewWidth, height: viewHeight } = this.mainView.size;
7957
+ if (Math.abs(viewWidth - width) > 0.5 || Math.abs(viewHeight - height) > 0.5) {
7958
+ const resizableView = this.mainView;
7959
+ console.log("[window-manager] forceResizeScreen stale size" + JSON.stringify({
7960
+ viewSize: this.mainView.size,
7961
+ domSize: { width, height }
7962
+ }));
7963
+ (_a = resizableView.resizeScreen) == null ? void 0 : _a.call(resizableView);
7964
+ }
7965
+ }
7939
7966
  start() {
7940
7967
  console.log("[window-manager] start " + JSON.stringify(this.mainViewSize));
7941
7968
  this.sizeChangeHandler(this.mainViewSize);
@@ -19774,7 +19801,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
19774
19801
  const _WindowManager = class extends InvisiblePlugin {
19775
19802
  constructor(context) {
19776
19803
  super(context);
19777
- this.version = "1.0.13-test.10";
19804
+ this.version = "1.0.13-test.11";
19778
19805
  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" } };
19779
19806
  this.emitter = callbacks$1;
19780
19807
  this.viewMode = ViewMode.Broadcaster;