@netless/window-manager 1.0.13-test.16 → 1.0.13-test.17

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
@@ -7932,6 +7932,41 @@ class MainViewProxy {
7932
7932
  viewSize: this.mainView.size
7933
7933
  }));
7934
7934
  };
7935
+ this.onResize2 = (entries) => {
7936
+ const entry = entries[0];
7937
+ if (!entry)
7938
+ return;
7939
+ const target = entry.target;
7940
+ const child = target.children[0];
7941
+ const observedSize = {
7942
+ width: entry.contentRect.width,
7943
+ height: entry.contentRect.height
7944
+ };
7945
+ console.log("[window-manager] mainViewResizeObserver2 " + JSON.stringify({
7946
+ sameTarget: target === this.mainView.divElement,
7947
+ contentRect: {
7948
+ width: observedSize.width,
7949
+ height: observedSize.height
7950
+ },
7951
+ client: {
7952
+ width: target.clientWidth,
7953
+ height: target.clientHeight
7954
+ },
7955
+ offset: {
7956
+ width: target.offsetWidth,
7957
+ height: target.offsetHeight
7958
+ },
7959
+ rect: {
7960
+ width: target.getBoundingClientRect().width,
7961
+ height: target.getBoundingClientRect().height
7962
+ },
7963
+ childRect: child ? {
7964
+ width: child.getBoundingClientRect().width,
7965
+ height: child.getBoundingClientRect().height
7966
+ } : null,
7967
+ viewSize: this.mainView.size
7968
+ }));
7969
+ };
7935
7970
  this._syncMainViewTimer = 0;
7936
7971
  this.handleCameraOrSizeUpdated = (source, payload) => {
7937
7972
  console.log("[window-manager] " + source + " payload " + JSON.stringify(payload));
@@ -7997,9 +8032,6 @@ class MainViewProxy {
7997
8032
  this.sideEffectManager.add(() => {
7998
8033
  return internalEmitter.on("containerSizeRatioUpdate", this.onUpdateContainerSizeRatio);
7999
8034
  });
8000
- this.sideEffectManager.add(() => {
8001
- return internalEmitter.on("wrapperRectChange", this.onWrapperRectChange);
8002
- });
8003
8035
  this.sideEffectManager.add(() => {
8004
8036
  return internalEmitter.on("startReconnect", () => {
8005
8037
  if (!this.didRelease) {
@@ -8178,11 +8210,15 @@ class MainViewProxy {
8178
8210
  }));
8179
8211
  this.mainViewResizeObserver = new window.ResizeObserver(this.onResize);
8180
8212
  this.mainViewResizeObserver.observe(this.mainView.divElement);
8213
+ this.mainViewResizeObserver2 = new window.ResizeObserver(this.onResize2);
8214
+ this.mainViewResizeObserver2.observe(this.mainView.divElement);
8181
8215
  }
8182
8216
  disconnectMainViewResizeObserver() {
8183
- var _a;
8217
+ var _a, _b;
8184
8218
  (_a = this.mainViewResizeObserver) == null ? void 0 : _a.disconnect();
8185
8219
  this.mainViewResizeObserver = void 0;
8220
+ (_b = this.mainViewResizeObserver2) == null ? void 0 : _b.disconnect();
8221
+ this.mainViewResizeObserver2 = void 0;
8186
8222
  }
8187
8223
  ensureMainViewSize() {
8188
8224
  if ((!this.mainViewSize || this.mainViewSize.width === 0 || this.mainViewSize.height === 0) && this.mainView.size.width > 0 && this.mainView.size.height > 0) {
@@ -19943,7 +19979,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
19943
19979
  const _WindowManager = class extends InvisiblePlugin {
19944
19980
  constructor(context) {
19945
19981
  super(context);
19946
- this.version = "1.0.13-test.16";
19982
+ this.version = "1.0.13-test.17";
19947
19983
  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" } };
19948
19984
  this.emitter = callbacks$1;
19949
19985
  this.viewMode = ViewMode.Broadcaster;