@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/dist/BoxManager.d.ts +2 -0
- package/dist/index.cjs.js +10 -10
- package/dist/index.es.js +11 -5
- package/dist/index.umd.js +9 -9
- package/package.json +1 -1
- package/src/BoxManager.ts +9 -1
- package/src/View/MainView.ts +2 -2
- package/src/index.ts +1 -1
package/package.json
CHANGED
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:
|
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();
|
package/src/View/MainView.ts
CHANGED
@@ -42,7 +42,7 @@ export class MainViewProxy {
|
|
42
42
|
}
|
43
43
|
});
|
44
44
|
});
|
45
|
-
const rect = this.manager.boxManager?.
|
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?.
|
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.
|
343
|
+
this.boxManager.setCollector(container);
|
344
344
|
} else {
|
345
345
|
if (WindowManager.params) {
|
346
346
|
WindowManager.params.collectorContainer = container;
|