@netless/window-manager 1.0.0-canary.0 → 1.0.0-canary.1

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.0-canary.0",
3
+ "version": "1.0.0-canary.1",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
package/src/BoxManager.ts CHANGED
@@ -210,6 +210,10 @@ export class BoxManager {
210
210
  return this.teleBoxManager.boxes.length;
211
211
  }
212
212
 
213
+ public get stageRect() {
214
+ return this.teleBoxManager.stageRect;
215
+ }
216
+
213
217
  public createBox(params: CreateBoxParams): void {
214
218
  if (!this.teleBoxManager) return;
215
219
  let { minwidth = MIN_WIDTH, minheight = MIN_HEIGHT } = params.app.config ?? {};
@@ -242,7 +246,7 @@ export class BoxManager {
242
246
  ): TeleBoxManager {
243
247
  const root = WindowManager.playground;
244
248
  const initManagerState: TeleBoxManagerConfig = {
245
- stageRatio: 3 / 4,
249
+ stageRatio: createTeleBoxManagerConfig?.stageRatio,
246
250
  root: root,
247
251
  fence: false,
248
252
  prefersColorScheme: createTeleBoxManagerConfig?.prefersColorScheme,
@@ -390,6 +394,10 @@ export class BoxManager {
390
394
  this.teleBoxManager._root$.setValue(root);
391
395
  }
392
396
 
397
+ public setCollector(collector: HTMLElement) {
398
+ this.teleBoxManager.collector.set$collector(collector);
399
+ }
400
+
393
401
  public destroy() {
394
402
  this.sideEffectManager.flushAll();
395
403
  this.teleBoxManager.destroy();
@@ -42,7 +42,7 @@ export class MainViewProxy {
42
42
  }
43
43
  });
44
44
  });
45
- const rect = this.manager.boxManager?.teleBoxManager.stageRect;
45
+ const rect = this.manager.boxManager?.stageRect;
46
46
  if (rect) {
47
47
  this.synchronizer.setRect(rect);
48
48
  }
@@ -191,7 +191,7 @@ export class MainViewProxy {
191
191
  };
192
192
 
193
193
  private getStageSize(): Size | undefined {
194
- const stage = this.manager.boxManager?.teleBoxManager.stageRect;
194
+ const stage = this.manager.boxManager?.stageRect;
195
195
  if (stage) {
196
196
  return { width: stage.width, height: stage.height };
197
197
  }
package/src/index.ts CHANGED
@@ -340,7 +340,7 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> imple
340
340
 
341
341
  public bindCollectorContainer(container: HTMLElement) {
342
342
  if (WindowManager.isCreated && this.boxManager) {
343
- this.boxManager.teleBoxManager.collector.set$collector(container)
343
+ this.boxManager.setCollector(container);
344
344
  } else {
345
345
  if (WindowManager.params) {
346
346
  WindowManager.params.collectorContainer = container;