@netless/window-manager 1.0.8 → 1.0.9-beta.0
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/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -8
- package/dist/index.mjs.map +1 -1
- package/docs/api.md +3 -2
- package/docs/cn/api.md +1 -0
- package/package.json +1 -1
- package/src/AppListener.ts +2 -2
- package/src/AppManager.ts +11 -9
- package/src/index.ts +3 -0
package/docs/api.md
CHANGED
|
@@ -67,6 +67,7 @@ parameter
|
|
|
67
67
|
| prefersColorScheme | [optional] string | light | auto, light, dark |
|
|
68
68
|
| debug | [optional] boolean | false | print log information |
|
|
69
69
|
| applianceIcons | [optional] {ApplianceNames, string} | | Configure the teaching aid picture used by the cursor |
|
|
70
|
+
| useBoxesStatus | [optional] boolean | false | Whether to use the boxesStatus status management window, after it is enabled, the status of each window can be managed separately |
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
<h3 id="register">WindowManager. register</h3>
|
|
@@ -294,8 +295,8 @@ manager.emitter.on(events, listener)
|
|
|
294
295
|
| ready | undefined | | Triggered when all apps are created |
|
|
295
296
|
| sceneStateChange | SceneState | | Fired when sceneState is modified |
|
|
296
297
|
| pageStateChange | PageState | | |
|
|
297
|
-
| fullscreenChange
|
|
298
|
-
| appsChange
|
|
298
|
+
| fullscreenChange | boolean | | Triggered when the full-screen status changes |
|
|
299
|
+
| appsChange | string[] | | Triggered when the list of opened apps changes |
|
|
299
300
|
|
|
300
301
|
```ts
|
|
301
302
|
type LoadAppEvent = {
|
package/docs/cn/api.md
CHANGED
|
@@ -66,6 +66,7 @@ const manager = await WindowManager.mount(
|
|
|
66
66
|
| prefersColorScheme | [optional] string | light | auto, light, dark |
|
|
67
67
|
| debug | [optional] boolean | false | 打印日志信息
|
|
68
68
|
| applianceIcons | [optional] {ApplianceNames, string} | | 配置光标使用的教具图片 |
|
|
69
|
+
| useBoxesStatus | [optional] boolean | false | 是否使用 boxesStatus 状态管理窗口, 开启后可以单独管理每个窗口的状态 |
|
|
69
70
|
|
|
70
71
|
<h3 id="register">WindowManager.register</h3>
|
|
71
72
|
|
package/package.json
CHANGED
package/src/AppListener.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { callbacks } from "./callback";
|
|
2
2
|
import { internalEmitter } from "./InternalEmitter";
|
|
3
3
|
import { Events, MagixEventName } from "./constants";
|
|
4
|
-
import { isEqual, omit } from "lodash";
|
|
4
|
+
// import { isEqual, omit } from "lodash";
|
|
5
5
|
import { setViewFocusScenePath } from "./Utils/Common";
|
|
6
|
-
import type {
|
|
6
|
+
import type { Event } from "white-web-sdk";
|
|
7
7
|
import type { AppManager } from "./AppManager";
|
|
8
8
|
import type { TeleBoxState } from "@netless/telebox-insider";
|
|
9
9
|
|
package/src/AppManager.ts
CHANGED
|
@@ -348,7 +348,7 @@ export class AppManager {
|
|
|
348
348
|
await new Promise<AppProxy | undefined>(resolve => {
|
|
349
349
|
this._focusAppCreatedResolve = resolve;
|
|
350
350
|
this._resolveTimer = setTimeout(() => {
|
|
351
|
-
resolve(this.appProxies.get(this._focusAppId ||
|
|
351
|
+
resolve(this.appProxies.get(this._focusAppId || ""));
|
|
352
352
|
}, 500);
|
|
353
353
|
}).then(() => {
|
|
354
354
|
this.focusByAttributes(this.attributes.apps);
|
|
@@ -406,14 +406,16 @@ export class AppManager {
|
|
|
406
406
|
this.displayer.callbacks.on("onEnableWriteNowChanged", this.displayerWritableListener);
|
|
407
407
|
this._prevFocused = this.attributes.focus;
|
|
408
408
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
409
|
+
if (!WindowManager.supportAppliancePlugin) {
|
|
410
|
+
this.sideEffectManager.add(() => {
|
|
411
|
+
const redoUndo = new RedoUndo({
|
|
412
|
+
mainView: () => this.mainViewProxy.view,
|
|
413
|
+
focus: () => this.attributes.focus,
|
|
414
|
+
getAppProxy: id => this.appProxies.get(id),
|
|
415
|
+
});
|
|
416
|
+
return () => redoUndo.destroy();
|
|
414
417
|
});
|
|
415
|
-
|
|
416
|
-
});
|
|
418
|
+
}
|
|
417
419
|
}
|
|
418
420
|
|
|
419
421
|
private onBoxMove = (payload: BoxMovePayload) => {
|
|
@@ -601,7 +603,7 @@ export class AppManager {
|
|
|
601
603
|
if (!appAttributes) {
|
|
602
604
|
throw new Error("appAttributes is undefined");
|
|
603
605
|
}
|
|
604
|
-
|
|
606
|
+
|
|
605
607
|
this.appCreateQueue.push<AppProxy>(async () => {
|
|
606
608
|
this.appStatus.set(id, AppStatus.StartCreate);
|
|
607
609
|
const appProxy = await this.baseInsertApp(
|
package/src/index.ts
CHANGED
|
@@ -66,6 +66,7 @@ import type { ExtendPluginInstance } from "./ExtendPluginManager";
|
|
|
66
66
|
import { ExtendPluginManager } from "./ExtendPluginManager";
|
|
67
67
|
import { getExtendClass } from "./Utils/extendClass";
|
|
68
68
|
import type { ExtendClass } from "./Utils/extendClass";
|
|
69
|
+
// import type { AppliancePluginInstance } from "@netless/appliance-plugin/dist/plugin/types";
|
|
69
70
|
|
|
70
71
|
export * from "./utils/extendClass";
|
|
71
72
|
|
|
@@ -230,6 +231,8 @@ export class WindowManager
|
|
|
230
231
|
private _cursorUIDs: string[] = [];
|
|
231
232
|
private _cursorUIDsStyleDOM?: HTMLStyleElement;
|
|
232
233
|
|
|
234
|
+
public _appliancePlugin?: any;
|
|
235
|
+
|
|
233
236
|
private boxManager?: BoxManager;
|
|
234
237
|
private static params?: MountParams;
|
|
235
238
|
static extendClass?: ExtendClass;
|