@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/dist/App/AppContext.d.ts +1 -1
- package/dist/BoxManager.d.ts +3 -0
- package/dist/Cursor/index.d.ts +3 -2
- package/dist/Helper.d.ts +2 -0
- package/dist/index.cjs.js +12 -12
- package/dist/index.es.js +56 -21
- package/dist/index.umd.js +12 -12
- package/dist/style.css +1 -1
- package/docs/app-context.md +68 -26
- package/package.json +2 -2
- package/pnpm-lock.yaml +2 -9
- package/src/App/AppContext.ts +13 -5
- package/src/BoxManager.ts +12 -0
- package/src/Cursor/Cursor.ts +6 -2
- package/src/Cursor/index.ts +5 -5
- package/src/Helper.ts +20 -3
- package/src/index.ts +8 -12
- package/src/style.css +1 -6
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 =
|
282
|
-
|
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 =
|
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
|
-
|
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
|
}
|