@netless/window-manager 1.0.14 → 1.0.16

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "Multi-window mode for Netless Whiteboard",
5
5
  "author": "l1shen <lishen1635@gmail.com> (https://github.com/l1shen)",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "jspdf": "2.5.1",
26
- "white-web-sdk": "^2.16.54"
26
+ "white-web-sdk": "^2.16.55"
27
27
  },
28
28
  "peerDependenciesMeta": {
29
29
  "jspdf": {
@@ -43,6 +43,7 @@
43
43
  "@hyrious/dts": "^0.2.2",
44
44
  "@netless/app-docs-viewer": "^0.2.19",
45
45
  "@netless/app-media-player": "0.1.4",
46
+ "@netless/app-presentation": "^0.1.9",
46
47
  "@rollup/plugin-commonjs": "^20.0.0",
47
48
  "@rollup/plugin-node-resolve": "^13.0.4",
48
49
  "@rollup/plugin-url": "^6.1.0",
@@ -72,6 +73,6 @@
72
73
  "typescript": "^4.5.5",
73
74
  "vite": "^2.9.9",
74
75
  "vitest": "^0.14.1",
75
- "white-web-sdk": "^2.16.54"
76
+ "white-web-sdk": "^2.16.55"
76
77
  }
77
78
  }
@@ -154,20 +154,25 @@ export class AppProxy implements PageRemoveService {
154
154
  }
155
155
  const appImpl = await appRegister.appClasses.get(params.kind)?.();
156
156
  const appParams = appRegister.registered.get(params.kind);
157
+ const appOptions = this.manager.windowManger.resolveAppOptions(
158
+ params.kind,
159
+ appParams?.appOptions
160
+ );
157
161
  if (appImpl) {
158
162
  await this.setupApp(
159
163
  this.id,
160
164
  skipUpdate,
161
165
  appImpl,
162
166
  params.options,
163
- appParams?.appOptions,
167
+ appOptions,
164
168
  this.manager.useBoxesStatus ? boxStatus : undefined,
165
169
  params.forceTop,
166
170
  params.forceNormal,
167
171
  params.isDragContent
168
172
  );
169
173
  } else {
170
- this.Logger && this.Logger.error(`[WindowManager]: app load failed ${params.kind} ${params.src}`);
174
+ this.Logger &&
175
+ this.Logger.error(`[WindowManager]: app load failed ${params.kind} ${params.src}`);
171
176
  throw new Error(`[WindowManager]: app load failed ${params.kind} ${params.src}`);
172
177
  }
173
178
  internalEmitter.emit("updateManagerRect");
@@ -216,7 +221,10 @@ export class AppProxy implements PageRemoveService {
216
221
  }
217
222
  setTimeout(async () => {
218
223
  // 延迟执行 setup, 防止初始化的属性没有更新成功
219
- this.Logger && this.Logger.info(`[WindowManager]: setup app ${this.kind}, appId: ${appId}`);
224
+ this.Logger &&
225
+ this.Logger.info(
226
+ `[WindowManager]: setup app ${this.kind}, appId: ${appId}`
227
+ );
220
228
  const result = await app.setup(context);
221
229
  this.appResult = result;
222
230
  appRegister.notifyApp(this.kind, "created", { appId, result });
@@ -561,7 +569,8 @@ export class AppProxy implements PageRemoveService {
561
569
  this.manager.refresher.remove(this.stateKey);
562
570
  this.manager.refresher.remove(`${this.id}-fullPath`);
563
571
  this._prevFullPath = undefined;
564
- this.Logger && this.Logger.info(`[WindowManager]: destroy app ${this.kind} appId: ${this.id}`);
572
+ this.Logger &&
573
+ this.Logger.info(`[WindowManager]: destroy app ${this.kind} appId: ${this.id}`);
565
574
  }
566
575
 
567
576
  public close(): Promise<void> {
package/src/AppManager.ts CHANGED
@@ -158,7 +158,9 @@ export class AppManager {
158
158
  sceneName = this.callbacksNode?.scenes[nextIndex];
159
159
  }
160
160
  if (sceneName) {
161
- console.log(`[window-manager] onRemoveScenes setMainViewScenePath ${ROOT_DIR}${sceneName}`);
161
+ console.log(
162
+ `[window-manager] onRemoveScenes setMainViewScenePath ${ROOT_DIR}${sceneName}`
163
+ );
162
164
  this.setMainViewScenePath(`${ROOT_DIR}${sceneName}`);
163
165
  }
164
166
  await this.setMainViewSceneIndex(nextIndex);
@@ -604,9 +606,10 @@ export class AppManager {
604
606
  try {
605
607
  const appAttributes = this.attributes[id];
606
608
  if (!appAttributes) {
607
- this.Logger && this.Logger.error(
608
- `[WindowManager]: appAttributes is undefined, appId: ${id}`
609
- );
609
+ this.Logger &&
610
+ this.Logger.error(
611
+ `[WindowManager]: appAttributes is undefined, appId: ${id}`
612
+ );
610
613
  throw new Error("appAttributes is undefined");
611
614
  }
612
615
 
@@ -712,7 +715,9 @@ export class AppManager {
712
715
  callbacks.emit("onMainViewMounted", mainView);
713
716
  const hasRoot = this.hasRoot(mainView.divElement);
714
717
  const rect = this.getRectByDivElement(mainView.divElement);
715
- let log = `[window-manager] bindMainView hasRoot:${hasRoot}, rect:${JSON.stringify(rect)}, outerHeight:${window.outerHeight}, outerWidth:${window.outerWidth}`;
718
+ let log = `[window-manager] bindMainView hasRoot:${hasRoot}, rect:${JSON.stringify(
719
+ rect
720
+ )}, outerHeight:${window.outerHeight}, outerWidth:${window.outerWidth}`;
716
721
  const visualViewport = window.visualViewport;
717
722
  if (visualViewport) {
718
723
  log += `, visualViewportWidth:${visualViewport.width}, visualViewportHeight:${visualViewport.height}, visualViewportOffsetLeft:${visualViewport.offsetLeft}, visualViewportOffsetTop:${visualViewport.offsetTop}`;
@@ -720,7 +725,7 @@ export class AppManager {
720
725
  console.log(log);
721
726
  }
722
727
 
723
- private hasRoot(divElement: HTMLDivElement){
728
+ private hasRoot(divElement: HTMLDivElement) {
724
729
  let current = divElement;
725
730
  while (current) {
726
731
  if (current.parentElement === document.body) {
@@ -731,7 +736,7 @@ export class AppManager {
731
736
  return false;
732
737
  }
733
738
 
734
- private getRectByDivElement(divElement: HTMLDivElement){
739
+ private getRectByDivElement(divElement: HTMLDivElement) {
735
740
  // 获取当前divElement的矩形区域
736
741
  const rect = divElement.getBoundingClientRect();
737
742
  return rect;
@@ -818,7 +823,8 @@ export class AppManager {
818
823
  return appProxy;
819
824
  } else {
820
825
  this.appStatus.delete(appId);
821
- this.Logger && this.Logger.error(`[WindowManager]: initialize AppProxy failed, appId: ${appId}`);
826
+ this.Logger &&
827
+ this.Logger.error(`[WindowManager]: initialize AppProxy failed, appId: ${appId}`);
822
828
  throw new Error("[WindowManger]: initialize AppProxy failed");
823
829
  }
824
830
  }
@@ -858,7 +864,8 @@ export class AppManager {
858
864
  const scenePathType = this.displayer.scenePathType(scenePath);
859
865
  const sceneDir = parseSceneDir(scenePath);
860
866
  if (sceneDir !== ROOT_DIR) {
861
- this.Logger && this.Logger.error(`[WindowManager]: main view scenePath must in root dir "/"`);
867
+ this.Logger &&
868
+ this.Logger.error(`[WindowManager]: main view scenePath must in root dir "/"`);
862
869
  throw new Error(`[WindowManager]: main view scenePath must in root dir "/"`);
863
870
  }
864
871
  if (scenePathType === ScenePathType.None) {
@@ -866,7 +873,6 @@ export class AppManager {
866
873
  throw new Error(`[WindowManager]: ${scenePath} not valid scene`);
867
874
  } else if (scenePathType === ScenePathType.Page) {
868
875
  await this._setMainViewScenePath(scenePath);
869
-
870
876
  } else if (scenePathType === ScenePathType.Dir) {
871
877
  const validScenePath = makeValidScenePath(this.displayer, scenePath);
872
878
  if (validScenePath) {
@@ -1000,4 +1006,3 @@ export class AppManager {
1000
1006
  this._resolveTimer = undefined;
1001
1007
  }
1002
1008
  }
1003
-
@@ -1,5 +1,9 @@
1
- import AppDocsViewer from "@netless/app-docs-viewer";
2
1
  import { WindowManager } from "./index";
2
+ import type { PresentationAppOptions } from "@netless/app-presentation";
3
+
4
+ export interface BuiltinAppOptions {
5
+ Presentation?: PresentationAppOptions;
6
+ }
3
7
 
4
8
  const loadAppMediaPlayer = async () => {
5
9
  const mod = await import("@netless/app-media-player");
@@ -9,18 +13,37 @@ const loadAppMediaPlayer = async () => {
9
13
  return (mod.default || mod) as any;
10
14
  };
11
15
 
16
+ const loadAppDocsViewer = async () => {
17
+ const mod = await import("@netless/app-docs-viewer");
18
+ return (mod.default || mod) as any;
19
+ };
20
+
21
+ const loadAppPresentation = async () => {
22
+ const mod = await import("@netless/app-presentation");
23
+ return (mod.default || mod) as any;
24
+ };
25
+
12
26
  export const setupBuiltin = () => {
13
27
  WindowManager.register({
14
- kind: AppDocsViewer.kind,
15
- src: AppDocsViewer,
28
+ kind: BuiltinApps.DocsViewer,
29
+ src: loadAppDocsViewer,
16
30
  });
17
31
  WindowManager.register({
18
- kind: "MediaPlayer",
32
+ kind: BuiltinApps.MediaPlayer,
19
33
  src: loadAppMediaPlayer,
20
34
  });
35
+ WindowManager.register({
36
+ kind: BuiltinApps.Presentation,
37
+ src: loadAppPresentation,
38
+ appOptions: {
39
+ debounceSync: true,
40
+ useScrollbar: true,
41
+ },
42
+ });
21
43
  };
22
44
 
23
45
  export const BuiltinApps = {
24
- DocsViewer: AppDocsViewer.kind as string,
25
- MediaPlayer: "MediaPlayer" as string,
46
+ DocsViewer: "DocsViewer",
47
+ MediaPlayer: "MediaPlayer",
48
+ Presentation: "Presentation",
26
49
  };
@@ -9,7 +9,7 @@ const ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill;
9
9
  export class ContainerResizeObserver {
10
10
  private containerResizeObserver?: ResizeObserver;
11
11
  private disposer?: UnsubscribeFn;
12
-
12
+
13
13
  private updateSizerLocalConsole = new LocalConsole("updateSizer", 100);
14
14
 
15
15
  constructor(private emitter: EmitterType) {}
@@ -30,19 +30,24 @@ export class ContainerResizeObserver {
30
30
  sizer: HTMLElement,
31
31
  wrapper: HTMLDivElement
32
32
  ) {
33
- this.updateSizer(container.getBoundingClientRect(), sizer, wrapper, 'observePlaygroundSize');
33
+ this.updateSizer(
34
+ container.getBoundingClientRect(),
35
+ sizer,
36
+ wrapper,
37
+ "observePlaygroundSize"
38
+ );
34
39
 
35
40
  this.containerResizeObserver = new ResizeObserver(entries => {
36
41
  const containerRect = entries[0]?.contentRect;
37
42
  if (containerRect) {
38
- this.updateSizer(containerRect, sizer, wrapper, 'containerResizeObserver');
43
+ this.updateSizer(containerRect, sizer, wrapper, "containerResizeObserver");
39
44
  this.emitter.emit("playgroundSizeChange", containerRect);
40
45
  }
41
46
  });
42
47
 
43
48
  this.disposer = this.emitter.on("containerSizeRatioUpdate", () => {
44
49
  const containerRect = container.getBoundingClientRect();
45
- this.updateSizer(containerRect, sizer, wrapper, 'containerSizeRatioUpdate');
50
+ this.updateSizer(containerRect, sizer, wrapper, "containerSizeRatioUpdate");
46
51
  this.emitter.emit("playgroundSizeChange", containerRect);
47
52
  });
48
53
 
@@ -66,7 +71,11 @@ export class ContainerResizeObserver {
66
71
  wrapper.style.width = `${width}px`;
67
72
  wrapper.style.height = `${height}px`;
68
73
  const wrapperRect = wrapper.getBoundingClientRect();
69
- this.updateSizerLocalConsole.log(`from ${origin}, traget size: ${JSON.stringify({ width, height })}, wrapperRect: ${wrapperRect.width} ${wrapperRect.height}`);
74
+ this.updateSizerLocalConsole.log(
75
+ `from ${origin}, traget size: ${JSON.stringify({ width, height })}, wrapperRect: ${
76
+ wrapperRect.width
77
+ } ${wrapperRect.height}`
78
+ );
70
79
  this.emitter.emit("wrapperRectChange", {
71
80
  width: wrapperRect.width,
72
81
  height: wrapperRect.height,
@@ -48,7 +48,9 @@ export const replaceRoomFunction = (room: Room | Player, manager: WindowManager)
48
48
  console.log("[window-manager] putScenes " + JSON.stringify(args));
49
49
  for (const scene of scenes) {
50
50
  if (`${path}${scene.name}` === currentScenePath) {
51
- console.error(`[window-manager] putScenes: scene name can not be the same as the current scene path: ${currentScenePath}`);
51
+ console.error(
52
+ `[window-manager] putScenes: scene name can not be the same as the current scene path: ${currentScenePath}`
53
+ );
52
54
  return;
53
55
  }
54
56
  }
@@ -3,11 +3,16 @@ function formatAttributesLogObjectKey(key: string): string {
3
3
  return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) ? key : JSON.stringify(key);
4
4
  }
5
5
 
6
+ type AttributesLogRecord = Record<string, unknown>;
7
+
6
8
  /**
7
9
  * attributes 调试日志:对象/数组会写成近似 JS 字面量(保留 `undefined`、数组空洞),避免 `[object Object]`;
8
10
  * 并处理 BigInt、循环引用等。
9
11
  */
10
- export function stringifyForAttributesLog(value: unknown, seen?: WeakSet<object>): string {
12
+ export function stringifyForAttributesLog(
13
+ value: unknown,
14
+ seen?: WeakSet<AttributesLogRecord>
15
+ ): string {
11
16
  if (value === undefined) {
12
17
  return "undefined";
13
18
  }
@@ -29,17 +34,17 @@ export function stringifyForAttributesLog(value: unknown, seen?: WeakSet<object>
29
34
  return t === "string" ? JSON.stringify(value as string) : String(value);
30
35
  }
31
36
 
32
- const obj = value as object;
37
+ const obj = value as AttributesLogRecord;
33
38
  if (seen?.has(obj)) {
34
39
  return "[Circular]";
35
40
  }
36
41
 
37
- const nextSeen = seen ?? new WeakSet<object>();
42
+ const nextSeen = seen ?? new WeakSet<AttributesLogRecord>();
38
43
  nextSeen.add(obj);
39
44
  try {
40
45
  if (Array.isArray(value)) {
41
- return `[${Array.from(value as unknown[], (item) =>
42
- stringifyForAttributesLog(item, nextSeen),
46
+ return `[${Array.from(value as unknown[], item =>
47
+ stringifyForAttributesLog(item, nextSeen)
43
48
  ).join(",")}]`;
44
49
  }
45
50
  if (value instanceof Date) {
@@ -48,11 +53,11 @@ export function stringifyForAttributesLog(value: unknown, seen?: WeakSet<object>
48
53
  if (value instanceof RegExp) {
49
54
  return String(value);
50
55
  }
51
- const keys = Object.keys(value as object);
52
- const pairs = keys.map((k) => {
56
+ const keys = Object.keys(obj);
57
+ const pairs = keys.map(k => {
53
58
  let v: unknown;
54
59
  try {
55
- v = (value as Record<string, unknown>)[k];
60
+ v = obj[k];
56
61
  } catch {
57
62
  return `${formatAttributesLogObjectKey(k)}:[Threw]`;
58
63
  }
package/src/Utils/log.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import type { Logger } from "white-web-sdk";
2
- import { isShallowMergeAttributesRecord, stringifyForAttributesLog } from "./attributesLogStringify";
2
+ import {
3
+ isShallowMergeAttributesRecord,
4
+ stringifyForAttributesLog,
5
+ } from "./attributesLogStringify";
3
6
  import { WindowManager } from "../index";
4
7
 
5
8
  /** ArgusLog 经 `logger.info` 上报的单条字符串上限(含前缀) */
@@ -39,10 +42,7 @@ export class LocalConsole {
39
42
  private pendingArgs: unknown[] | null = null;
40
43
  private flushTimer: ReturnType<typeof setTimeout> | null = null;
41
44
 
42
- constructor(
43
- private readonly name: string,
44
- private readonly debounceTime?: number,
45
- ) {}
45
+ constructor(private readonly name: string, private readonly debounceTime?: number) {}
46
46
 
47
47
  private flush(): void {
48
48
  this.flushTimer = null;
@@ -102,7 +102,7 @@ export class ArgusLog {
102
102
  constructor(
103
103
  private readonly logger: Logger,
104
104
  private readonly name: string,
105
- private readonly debounceTime?: number,
105
+ private readonly debounceTime?: number
106
106
  ) {}
107
107
 
108
108
  private emitInfo(message: string): void {
@@ -127,7 +127,9 @@ export class ArgusLog {
127
127
  return;
128
128
  }
129
129
  const body =
130
- p.kind === "record" ? stringifyForAttributesLog(p.data) : stringifyForAttributesLog(p.value);
130
+ p.kind === "record"
131
+ ? stringifyForAttributesLog(p.data)
132
+ : stringifyForAttributesLog(p.value);
131
133
  this.emitInfo(`[WindowManager][${this.name}]: ${p.label} ${body}`);
132
134
  // 输出后释放合并对象引用,避免长时间持有 attributes 快照
133
135
  if (p.kind === "record") {
@@ -198,7 +200,7 @@ export class ArgusLog {
198
200
  return;
199
201
  }
200
202
  const parts = segments.map(
201
- (s) => `${s.keys.join(", ")} ${stringifyForAttributesLog(s.value)}`,
203
+ s => `${s.keys.join(", ")} ${stringifyForAttributesLog(s.value)}`
202
204
  );
203
205
  this.emitInfo(`[WindowManager][${this.name}]: safeUpdateAttributes ${parts.join(" | ")}`);
204
206
  for (const s of segments) {
@@ -219,7 +221,9 @@ export class ArgusLog {
219
221
 
220
222
  if (!debounced) {
221
223
  this.emitInfo(
222
- `[WindowManager][${this.name}]: safeUpdateAttributes ${keysCopy.join(", ")} ${stringifyForAttributesLog(value)}`,
224
+ `[WindowManager][${this.name}]: safeUpdateAttributes ${keysCopy.join(
225
+ ", "
226
+ )} ${stringifyForAttributesLog(value)}`
223
227
  );
224
228
  return;
225
229
  }
@@ -0,0 +1,12 @@
1
+ export function resolveAppOptions(
2
+ registeredOptions: any | (() => any),
3
+ override: any
4
+ ): any | (() => any) {
5
+ if (override === undefined) {
6
+ return registeredOptions;
7
+ }
8
+ return () => ({
9
+ ...(typeof registeredOptions === "function" ? registeredOptions() : registeredOptions),
10
+ ...override,
11
+ });
12
+ }
@@ -3,11 +3,12 @@ import { callbacks } from "../callback";
3
3
  import { createView } from "./ViewManager";
4
4
  import { debounce, get, isEmpty, isEqual } from "lodash";
5
5
  import { internalEmitter } from "../InternalEmitter";
6
- import { Fields, type MainViewCamera } from "../AttributesDelegate";
6
+ import { Fields } from "../AttributesDelegate";
7
7
  import { setViewFocusScenePath } from "../Utils/Common";
8
8
  import { SideEffectManager } from "side-effect-manager";
9
9
  import type { Camera, Room, Size, View } from "white-web-sdk";
10
10
  import type { AppManager } from "../AppManager";
11
+ import type { MainViewCamera } from "../AttributesDelegate";
11
12
  import { Events } from "../constants";
12
13
  import { LocalConsole } from "../Utils/log";
13
14
 
@@ -35,7 +36,10 @@ export class MainViewProxy {
35
36
 
36
37
  private sideEffectManager = new SideEffectManager();
37
38
 
38
- private playgroundSizeChangeListenerLocalConsole = new LocalConsole("playgroundSizeChangeListener", 100);
39
+ private playgroundSizeChangeListenerLocalConsole = new LocalConsole(
40
+ "playgroundSizeChangeListener",
41
+ 100
42
+ );
39
43
  private sizeUpdatedLocalConsole = new LocalConsole("sizeUpdated", 100);
40
44
  private cameraUpdatedLocalConsole = new LocalConsole("cameraUpdated", 100);
41
45
  private cameraReactionLocalConsole = new LocalConsole("cameraReaction", 100);
@@ -52,12 +56,15 @@ export class MainViewProxy {
52
56
  const playgroundSizeChangeListener = () => {
53
57
  this.playgroundSizeChangeListenerLocalConsole.log(
54
58
  JSON.stringify(this.mainView.camera),
55
- JSON.stringify(this.mainView.size),
56
- JSON.stringify(this.mainViewSize),
59
+ JSON.stringify(this.mainView.size),
60
+ JSON.stringify(this.mainViewSize),
57
61
  JSON.stringify(this.mainViewCamera),
58
- window.outerHeight, window.outerWidth,
59
- window.visualViewport?.width ?? "null", window.visualViewport?.height ?? "null",
60
- window.visualViewport?.offsetLeft ?? "null", window.visualViewport?.offsetTop ?? "null",
62
+ window.outerHeight,
63
+ window.outerWidth,
64
+ window.visualViewport?.width ?? "null",
65
+ window.visualViewport?.height ?? "null",
66
+ window.visualViewport?.offsetLeft ?? "null",
67
+ window.visualViewport?.offsetTop ?? "null"
61
68
  );
62
69
  this.sizeChangeHandler(this.mainViewSize);
63
70
  };
@@ -164,7 +171,7 @@ export class MainViewProxy {
164
171
  element: HTMLDivElement
165
172
  ) {
166
173
  const { width: viewWidth, height: viewHeight } = this.mainView.size;
167
- let targetElement = element;
174
+ const targetElement = element;
168
175
  if (
169
176
  Math.abs(viewWidth - observedSize.width) <= 0.5 &&
170
177
  Math.abs(viewHeight - observedSize.height) <= 0.5
@@ -172,11 +179,14 @@ export class MainViewProxy {
172
179
  return;
173
180
  }
174
181
  if (this.isForcingMainViewDivElement) {
175
- console.log("[window-manager] skipForceSyncMainViewDivElement " + JSON.stringify({
176
- reason,
177
- observedSize,
178
- viewSize: this.mainView.size,
179
- }));
182
+ console.log(
183
+ "[window-manager] skipForceSyncMainViewDivElement " +
184
+ JSON.stringify({
185
+ reason,
186
+ observedSize,
187
+ viewSize: this.mainView.size,
188
+ })
189
+ );
180
190
  return;
181
191
  }
182
192
  this.isForcingMainViewDivElement = true;
@@ -202,11 +212,14 @@ export class MainViewProxy {
202
212
  } finally {
203
213
  queueMicrotask(() => {
204
214
  const rect = targetElement.getBoundingClientRect();
205
- console.log("[window-manager] forceSyncMainViewDivElementResult " + JSON.stringify({
206
- reason,
207
- viewSize: this.mainView.size,
208
- rect: { width: rect.width, height: rect.height },
209
- }));
215
+ console.log(
216
+ "[window-manager] forceSyncMainViewDivElementResult " +
217
+ JSON.stringify({
218
+ reason,
219
+ viewSize: this.mainView.size,
220
+ rect: { width: rect.width, height: rect.height },
221
+ })
222
+ );
210
223
  this.isForcingMainViewDivElement = false;
211
224
  });
212
225
  }
@@ -220,10 +233,14 @@ export class MainViewProxy {
220
233
  this.addCameraReaction();
221
234
  if (this.manager.room) this.syncMainView(this.manager.room);
222
235
  this.started = true;
223
- if(this.mainView.focusScenePath) {
224
- this.manager.windowManger.onMainViewScenePathChangeHandler(this.mainView.focusScenePath);
236
+ if (this.mainView.focusScenePath) {
237
+ this.manager.windowManger.onMainViewScenePathChangeHandler(
238
+ this.mainView.focusScenePath
239
+ );
225
240
  }
226
- console.log("[window-manager] start end mainView size:" + JSON.stringify(this.mainView.size));
241
+ console.log(
242
+ "[window-manager] start end mainView size:" + JSON.stringify(this.mainView.size)
243
+ );
227
244
  }
228
245
 
229
246
  public addCameraReaction = () => {
@@ -243,7 +260,11 @@ export class MainViewProxy {
243
260
  if (camera && camera.id !== this.manager.uid) {
244
261
  this.moveCameraToContian(this.mainViewSize);
245
262
  this.moveCamera(camera);
246
- this.cameraReactionLocalConsole.log(`camera: ${JSON.stringify(camera)}, current size: ${JSON.stringify(this.mainViewSize)}`);
263
+ this.cameraReactionLocalConsole.log(
264
+ `camera: ${JSON.stringify(camera)}, current size: ${JSON.stringify(
265
+ this.mainViewSize
266
+ )}`
267
+ );
247
268
  }
248
269
  },
249
270
  { fireImmediately: true }
@@ -254,8 +275,13 @@ export class MainViewProxy {
254
275
  if (size) {
255
276
  this.moveCameraToContian(size);
256
277
  this.moveCamera(this.mainViewCamera);
257
- console.log("[window-manager] sizeChangeHandler current size and camera" + JSON.stringify(size) + JSON.stringify(this.mainViewCamera) +
258
- JSON.stringify(this.mainView.camera) + JSON.stringify(this.mainView.size));
278
+ console.log(
279
+ "[window-manager] sizeChangeHandler current size and camera" +
280
+ JSON.stringify(size) +
281
+ JSON.stringify(this.mainViewCamera) +
282
+ JSON.stringify(this.mainView.camera) +
283
+ JSON.stringify(this.mainView.size)
284
+ );
259
285
  }
260
286
  this.ensureMainViewSize();
261
287
  }, 30);
package/src/css.d.ts ADDED
@@ -0,0 +1 @@
1
+ declare module "*.css";