@netless/window-manager 1.0.0-canary.24 → 1.0.0-canary.25

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/src/index.ts CHANGED
@@ -2,7 +2,7 @@ import pRetry from "p-retry";
2
2
  import { AppManager } from "./AppManager";
3
3
  import { appRegister } from "./Register";
4
4
  import { callbacks } from "./callback";
5
- import { checkVersion, setupWrapper } from "./Helper";
5
+ import { checkVersion, createInvisiblePlugin, setupWrapper } from "./Helper";
6
6
  import { createBoxManager } from "./BoxManager";
7
7
  import { CursorManager } from "./Cursor";
8
8
  import { DEFAULT_CONTAINER_RATIO, Events, INIT_DIR, ROOT_DIR } from "./constants";
@@ -268,8 +268,8 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> imple
268
268
  return manager;
269
269
  }
270
270
 
271
- private static async initManager(room: Room): Promise<WindowManager> {
272
- let manager = room.getInvisiblePlugin(WindowManager.kind) as WindowManager;
271
+ private static async initManager(room: Room): Promise<WindowManager | undefined> {
272
+ let manager = room.getInvisiblePlugin(WindowManager.kind) as WindowManager | undefined;
273
273
  if (!manager) {
274
274
  if (isRoom(room)) {
275
275
  if (room.isWritable === false) {
@@ -278,18 +278,12 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> imple
278
278
  } catch (error) {
279
279
  throw new Error("[WindowManger]: room must be switched to be writable");
280
280
  }
281
- manager = (await room.createInvisiblePlugin(
282
- WindowManager,
283
- {}
284
- )) as WindowManager;
285
- manager.ensureAttributes();
281
+ manager = await createInvisiblePlugin(room);
282
+ manager?.ensureAttributes();
286
283
  await wait(500);
287
284
  await room.setWritable(false);
288
285
  } else {
289
- manager = (await room.createInvisiblePlugin(
290
- WindowManager,
291
- {}
292
- )) as WindowManager;
286
+ manager = await createInvisiblePlugin(room);
293
287
  }
294
288
  }
295
289
  }
@@ -334,11 +328,13 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> imple
334
328
  );
335
329
  if (this.boxManager && WindowManager.playground) {
336
330
  this.boxManager.setRoot(WindowManager.playground);
331
+ this.boxManager.mainViewElement$.setValue(mainViewElement);
337
332
  }
338
333
  this.bindMainView(mainViewElement, params.disableCameraTransform);
339
334
  if (WindowManager.playground) {
340
335
  this.cursorManager?.setupWrapper(WindowManager.playground);
341
336
  }
337
+
342
338
  }
343
339
  }
344
340
  emitter.emit("updateManagerRect");
package/src/style.css CHANGED
@@ -49,8 +49,7 @@
49
49
  }
50
50
 
51
51
  .netless-window-manager-main-view {
52
- width: 100%;
53
- height: 100%;
52
+ position: absolute;
54
53
  }
55
54
 
56
55
 
@@ -180,10 +179,6 @@
180
179
  }
181
180
 
182
181
  .window-manager-view-wrapper {
183
- width: 100%;
184
- height: 100%;
185
182
  position: absolute;
186
- left: 0;
187
- top: 0;
188
183
  z-index: 1;
189
184
  }