@netless/window-manager 1.0.0-canary.41 → 1.0.0-canary.44

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.
@@ -84,18 +84,18 @@ export declare type MountParams = {
84
84
  container?: HTMLElement;
85
85
  /** 白板高宽比例, 默认为 9 / 16 */
86
86
  containerSizeRatio?: number;
87
- /** @deprecated */
88
- chessboard?: boolean;
89
87
  collectorContainer?: HTMLElement;
90
88
  collectorStyles?: Partial<CSSStyleDeclaration>;
91
89
  overwriteStyles?: string;
92
- containerStyle?: string;
93
- stageStyle?: string;
94
90
  cursor?: boolean;
95
91
  debug?: boolean;
96
92
  disableCameraTransform?: boolean;
97
93
  prefersColorScheme?: TeleBoxColorScheme;
94
+ /** @deprecated */
95
+ chessboard?: boolean;
98
96
  applianceIcons?: ApplianceIcons;
97
+ containerStyle?: string;
98
+ stageStyle?: string;
99
99
  fullscreen?: TeleBoxFullscreen;
100
100
  /** Custom `style` attribute value for content area of all boxes. Can be overwritten by box. */
101
101
  defaultBoxBodyStyle?: string | null;
@@ -232,9 +232,9 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
232
232
  * 关闭 APP
233
233
  */
234
234
  closeApp(appId: string): Promise<void>;
235
- moveCamera: import("lodash").DebouncedFuncLeading<(camera: Partial<Camera> & {
235
+ moveCamera: (camera: Partial<Camera> & {
236
236
  animationMode?: AnimationMode;
237
- }) => void>;
237
+ }) => void;
238
238
  convertToPointInWorld(point: Point): Point;
239
239
  setCameraBound(cameraBound: CameraBound): void;
240
240
  onDestroy(): void;
@@ -18,18 +18,31 @@
18
18
 
19
19
  ```html
20
20
  <div class="netless-window-manager-playground">
21
- <div class="netless-window-manager-main-view"></div>
21
+ <div class="telebox-manager-container">
22
+ <div class="telebox-manager-stage">
23
+ <div class="netless-window-manager-main-view"></div>
24
+ </div>
25
+ </div>
22
26
  </div>
23
27
  ```
24
28
 
25
29
 
26
30
  ### `WindowManager.mount()` 迁移
27
31
 
28
- 废弃 `chessboard` 属性
32
+ 废弃: `chessboard` 属性
29
33
 
30
- 添加: `containerStyle` 配置
31
- 添加: `stageStyle` 配置
32
- 添加: `fullscreen` 配置
34
+ - 添加: `containerStyle` 配置
35
+ - 配置 `telebox-manager-container` 的样式
36
+ - 添加: `stageStyle` 配置**
37
+ - 配置 `telebox-manager-stage` 的样式
38
+ - 添加: `defaultBoxBodyStyle` 配置
39
+ - 配置应用窗口默认 `body` 的样式
40
+ - 添加: `defaultBoxStageStyle` 配置
41
+ - 配置应用窗口默认 `stage` 也就是内容区域的样式
42
+ - 添加: `fullscreen` 配置
43
+ - 控制应用是否以全屏模式进入
44
+ - 添加: `theme` 配置
45
+ - 配置默认的颜色变量
33
46
 
34
47
  ### `manager.setContainerSizeRatio()` 行为修改
35
48
 
@@ -37,3 +50,19 @@
37
50
 
38
51
  1.0 之后重复修改 `containerSizeRatio` 不会导致内容一致缩小
39
52
 
53
+ ### baseSize
54
+
55
+ `baseSize` 主白板会去匹配内容到此大小
56
+
57
+ 添加: `manager.baseSize` 属性\
58
+ 添加: `manager.setBaseSize()` 方法\
59
+ 添加: `baseSizeChange` 回调
60
+
61
+ ### baseCamera
62
+
63
+ 主白板的 `camera` 会根据 `baseSize` 的值和 `baseCamera` 的值计算一个最终值
64
+
65
+ 添加: `manager.baseSize` 属性\
66
+ 添加: `baseCamera` 回调
67
+
68
+ 修改 `baseCamera` 依旧通过 `manager.moveCamera` 来实现
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "1.0.0-canary.41",
3
+ "version": "1.0.0-canary.44",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@juggle/resize-observer": "^3.3.1",
28
- "@netless/telebox-insider": "1.0.0-alpha.34",
28
+ "@netless/telebox-insider": "1.0.0-alpha.35",
29
29
  "emittery": "^0.11.0",
30
30
  "lodash": "^4.17.21",
31
31
  "p-retry": "^4.6.2",
package/pnpm-lock.yaml CHANGED
@@ -4,7 +4,7 @@ specifiers:
4
4
  '@juggle/resize-observer': ^3.3.1
5
5
  '@netless/app-docs-viewer': ^0.3.0
6
6
  '@netless/app-plyr': 0.2.0
7
- '@netless/telebox-insider': 1.0.0-alpha.34
7
+ '@netless/telebox-insider': 1.0.0-alpha.35
8
8
  '@playwright/test': ^1.23.2
9
9
  '@rollup/plugin-commonjs': ^20.0.0
10
10
  '@rollup/plugin-node-resolve': ^13.0.4
@@ -45,7 +45,7 @@ specifiers:
45
45
 
46
46
  dependencies:
47
47
  '@juggle/resize-observer': 3.3.1
48
- '@netless/telebox-insider': 1.0.0-alpha.34
48
+ '@netless/telebox-insider': 1.0.0-alpha.35
49
49
  emittery: 0.11.0
50
50
  lodash: 4.17.21
51
51
  p-retry: 4.6.2
@@ -247,8 +247,8 @@ packages:
247
247
  resolution: {integrity: sha512-7NzsJrba0R/mq/l10SkIZQwbrNVJyPxZYrjK6xL3Ts732iWAVuS2UB0u3s6iGeUVcqV39A679yva8APWRl4M0A==}
248
248
  dev: true
249
249
 
250
- /@netless/telebox-insider/1.0.0-alpha.34:
251
- resolution: {integrity: sha512-jU/+CR1WTwrzk0Wx73LfXZkXXUuxIEsltLDUtr9LiGEeb57EoXxO2hbimR/3EebRBv760VVthsI8hDfabiqZYA==}
250
+ /@netless/telebox-insider/1.0.0-alpha.35:
251
+ resolution: {integrity: sha512-uX/PUEoG/+CoaigeoWH+U07io93n+T89VjJDl5FRnd3gc/QfYf3ASSDQ9+7GjbOBUDUFwYHqVIxEhU67mGXCbw==}
252
252
  dependencies:
253
253
  '@juggle/resize-observer': 3.3.1
254
254
  '@types/shallowequal': 1.1.1
package/src/index.ts CHANGED
@@ -10,7 +10,7 @@ import { emitter } from "./InternalEmitter";
10
10
  import { Fields } from "./AttributesDelegate";
11
11
  import { initDb } from "./Register/storage";
12
12
  import { AnimationMode, InvisiblePlugin, isPlayer, isRoom, RoomPhase, ViewMode } from "white-web-sdk";
13
- import { isEqual, isNull, isObject, isNumber, debounce } from "lodash";
13
+ import { isEqual, isNull, isObject, isNumber } from "lodash";
14
14
  import { log } from "./Utils/log";
15
15
  import { PageStateImpl } from "./PageState";
16
16
  import { ReconnectRefresher } from "./ReconnectRefresher";
@@ -135,18 +135,18 @@ export type MountParams = {
135
135
  container?: HTMLElement;
136
136
  /** 白板高宽比例, 默认为 9 / 16 */
137
137
  containerSizeRatio?: number;
138
- /** @deprecated */
139
- chessboard?: boolean;
140
138
  collectorContainer?: HTMLElement;
141
139
  collectorStyles?: Partial<CSSStyleDeclaration>;
142
140
  overwriteStyles?: string;
143
- containerStyle?: string;
144
- stageStyle?: string;
145
141
  cursor?: boolean;
146
142
  debug?: boolean;
147
143
  disableCameraTransform?: boolean;
148
144
  prefersColorScheme?: TeleBoxColorScheme;
145
+ /** @deprecated */
146
+ chessboard?: boolean;
149
147
  applianceIcons?: ApplianceIcons;
148
+ containerStyle?: string;
149
+ stageStyle?: string;
150
150
  fullscreen?: TeleBoxFullscreen;
151
151
  /** Custom `style` attribute value for content area of all boxes. Can be overwritten by box. */
152
152
  defaultBoxBodyStyle?: string | null;
@@ -261,6 +261,7 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> imple
261
261
  containerStyle: params.containerStyle,
262
262
  stageStyle: params.stageStyle,
263
263
  fullscreen: params.fullscreen,
264
+ theme: params.theme,
264
265
  });
265
266
  manager.appManager?.setBoxManager(manager.boxManager);
266
267
  if (params.container) {
@@ -807,8 +808,7 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> imple
807
808
  return this.appManager?.closeApp(appId);
808
809
  }
809
810
 
810
- public moveCamera = debounce((camera: Partial<Camera> & { animationMode?: AnimationMode } ): void => {
811
- console.log("moveCamera", performance.now());
811
+ public moveCamera = (camera: Partial<Camera> & { animationMode?: AnimationMode } ): void => {
812
812
  const mainViewCamera = { ...this.mainView.camera };
813
813
  const nextCamera = { ...mainViewCamera, ...camera };
814
814
  if (isEqual(nextCamera, mainViewCamera)) return;
@@ -853,7 +853,7 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> imple
853
853
  this.mainView.callbacks.on("onCameraUpdated", onCameraUpdated);
854
854
 
855
855
  }
856
- }, 400, { leading: true });
856
+ };
857
857
 
858
858
  public convertToPointInWorld(point: Point): Point {
859
859
  return this.mainView.convertToPointInWorld(point);