@netless/window-manager 0.4.66 → 0.4.67-beta.0

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,17 +1,17 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "0.4.66",
4
- "description": "",
3
+ "version": "0.4.67-beta.0",
4
+ "description": "Multi-window mode for Netless Whiteboard",
5
+ "author": "l1shen <lishen1635@gmail.com> (https://github.com/l1shen)",
6
+ "license": "MIT",
7
+ "repository": "netless-io/window-manager",
5
8
  "main": "dist/index.js",
6
9
  "module": "dist/index.mjs",
7
10
  "types": "dist/index.d.ts",
8
- "repository": "netless-io/window-manager",
9
- "author": "l1shen <lishen1635@gmail.com> (https://github.com/l1shen)",
10
- "license": "MIT",
11
11
  "files": [
12
- "src",
13
12
  "dist",
14
- "docs"
13
+ "docs",
14
+ "src"
15
15
  ],
16
16
  "peerDependencies": {
17
17
  "jspdf": "2.5.1",
@@ -66,12 +66,12 @@
66
66
  "white-web-sdk": "2.16.43"
67
67
  },
68
68
  "scripts": {
69
- "prettier": "prettier --write .",
70
69
  "build": "vite build && yarn type-gen",
71
- "type-gen": "tsc --emitDeclarationOnly",
72
- "predev": "yarn type-gen",
73
70
  "build:lib:types": "tsc --emitDeclarationOnly",
74
71
  "lint": "eslint --ext .ts,.tsx,.svelte . && prettier --check .",
75
- "test": "vitest"
72
+ "predev": "yarn type-gen",
73
+ "prettier": "prettier --write .",
74
+ "test": "vitest",
75
+ "type-gen": "tsc --emitDeclarationOnly"
76
76
  }
77
77
  }
@@ -163,10 +163,12 @@ export class AttributesDelegate {
163
163
  }
164
164
 
165
165
  public setMainViewSize(size: ISize) {
166
+ if (size.width === 0 || size.height === 0) return;
166
167
  this.context.safeSetAttributes({ [Fields.MainViewSize]: { ...size } });
167
168
  }
168
169
 
169
170
  public setMainViewCameraAndSize(camera: ICamera, size: ISize) {
171
+ if (size.width === 0 || size.height === 0) return;
170
172
  this.context.safeSetAttributes({
171
173
  [Fields.MainViewCamera]: { ...camera },
172
174
  [Fields.MainViewSize]: { ...size },
@@ -209,7 +209,7 @@ export class MainViewProxy {
209
209
  this.manager.boxManager?.blurAllBox();
210
210
  }
211
211
 
212
- public setMainViewSize = debounce(size => {
212
+ public setMainViewSize = debounce((size: Size) => {
213
213
  this.store.setMainViewSize({ ...size, id: this.manager.uid });
214
214
  }, 50);
215
215
 
@@ -234,6 +234,10 @@ export class MainViewProxy {
234
234
  clearTimeout(this._syncMainViewTimer);
235
235
  this._syncMainViewTimer = setTimeout(this.syncMainView, 100, this.manager.room);
236
236
  }
237
+ if ((!this.mainViewSize || this.mainViewSize.width === 0 || this.mainViewSize.height === 0) &&
238
+ this.mainView.size.width > 0 && this.mainView.size.height > 0) {
239
+ this.setMainViewSize(this.mainView.size);
240
+ }
237
241
  };
238
242
 
239
243
  private syncMainView = (room: Room) => {