@netless/window-manager 0.4.30-canary.0 → 0.4.31
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/CHANGELOG.md +11 -2
- package/dist/AppManager.d.ts +5 -1
- package/dist/BoxEmitter.d.ts +34 -0
- package/dist/BoxManager.d.ts +3 -1
- package/dist/InternalEmitter.d.ts +0 -18
- package/dist/Utils/AppCreateQueue.d.ts +2 -3
- package/dist/constants.d.ts +1 -0
- package/dist/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +70 -58
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -2
- package/pnpm-lock.yaml +66 -36
- package/src/App/AppProxy.ts +7 -1
- package/src/AppManager.ts +67 -59
- package/src/BoxEmitter.ts +19 -0
- package/src/BoxManager.ts +10 -6
- package/src/InternalEmitter.ts +0 -4
- package/src/ReconnectRefresher.ts +18 -4
- package/src/Utils/AppCreateQueue.ts +2 -3
- package/src/constants.ts +1 -0
- package/src/index.ts +3 -2
- package/dist/ScenePath/index.d.ts +0 -12
- package/src/ScenePath/index.ts +0 -47
package/CHANGELOG.md
CHANGED
@@ -1,7 +1,16 @@
|
|
1
|
+
## 0.4.31 (2022-06-09)
|
2
|
+
|
3
|
+
- 修复: `bindContainer` 在回放模式下直接抛出错误的问题
|
4
|
+
|
5
|
+
## 0.4.30 (2022-06-08)
|
6
|
+
|
7
|
+
- 重构: removePage 在 resolve 之后可以立即查询到正确的状态
|
8
|
+
- 修复: 重连后 app 创建错误
|
9
|
+
|
1
10
|
## 0.4.28-0.4.29 (2022-06-08)
|
2
11
|
|
3
|
-
-
|
4
|
-
- `removePage` `index` 参数变为可选,默认删除当前页
|
12
|
+
- 修复: `removePage` 可以删除最后一页的问题
|
13
|
+
- 重构: `removePage` `index` 参数变为可选,默认删除当前页
|
5
14
|
|
6
15
|
## 0.4.27 (2022-06-07)
|
7
16
|
|
package/dist/AppManager.d.ts
CHANGED
@@ -52,6 +52,11 @@ export declare class AppManager {
|
|
52
52
|
get uid(): string;
|
53
53
|
getMainViewSceneDir(): string;
|
54
54
|
private onCreated;
|
55
|
+
private onBoxMove;
|
56
|
+
private onBoxResize;
|
57
|
+
private onBoxFocus;
|
58
|
+
private onBoxClose;
|
59
|
+
private onBoxStateChange;
|
55
60
|
addAppsChangeListener: () => void;
|
56
61
|
addAppCloseListener: () => void;
|
57
62
|
private onMainViewIndexChange;
|
@@ -91,7 +96,6 @@ export declare class AppManager {
|
|
91
96
|
private dispatchSetMainViewScenePath;
|
92
97
|
getAppInitPath(appId: string): string | undefined;
|
93
98
|
safeDispatchMagixEvent(event: string, payload: any): void;
|
94
|
-
private boxEventListener;
|
95
99
|
focusByAttributes(apps: any): void;
|
96
100
|
onReconnected(): Promise<void>;
|
97
101
|
notifyContainerRectUpdate(rect: TeleBoxRect): void;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import type { TELE_BOX_STATE } from "@netless/telebox-insider";
|
2
|
+
import Emittery from "emittery";
|
3
|
+
export declare type BoxMovePayload = {
|
4
|
+
appId: string;
|
5
|
+
x: number;
|
6
|
+
y: number;
|
7
|
+
};
|
8
|
+
export declare type BoxFocusPayload = {
|
9
|
+
appId: string;
|
10
|
+
};
|
11
|
+
export declare type BoxResizePayload = {
|
12
|
+
appId: string;
|
13
|
+
width: number;
|
14
|
+
height: number;
|
15
|
+
x?: number;
|
16
|
+
y?: number;
|
17
|
+
};
|
18
|
+
export declare type BoxClosePayload = {
|
19
|
+
appId: string;
|
20
|
+
error?: Error;
|
21
|
+
};
|
22
|
+
export declare type BoxStateChangePayload = {
|
23
|
+
appId: string;
|
24
|
+
state: TELE_BOX_STATE;
|
25
|
+
};
|
26
|
+
export declare type BoxEvent = {
|
27
|
+
move: BoxMovePayload;
|
28
|
+
focus: BoxFocusPayload;
|
29
|
+
resize: BoxResizePayload;
|
30
|
+
close: BoxClosePayload;
|
31
|
+
boxStateChange: BoxStateChangePayload;
|
32
|
+
};
|
33
|
+
export declare type BoxEmitterType = Emittery<BoxEvent>;
|
34
|
+
export declare const boxEmitter: BoxEmitterType;
|
package/dist/BoxManager.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { AppAttributes } from "./constants";
|
2
2
|
import { TELE_BOX_STATE, TeleBoxManager } from "@netless/telebox-insider";
|
3
3
|
import { WindowManager } from "./index";
|
4
|
+
import type { BoxEmitterType } from "./BoxEmitter";
|
4
5
|
import type { AddAppOptions, AppInitState } from "./index";
|
5
6
|
import type { TeleBoxManagerUpdateConfig, ReadonlyTeleBox, TeleBoxColorScheme, TeleBoxRect, TeleBoxConfig } from "@netless/telebox-insider";
|
6
7
|
import type Emittery from "emittery";
|
@@ -47,13 +48,14 @@ export declare type BoxManagerContext = {
|
|
47
48
|
getMainView: () => View;
|
48
49
|
updateAppState: (appId: string, field: AppAttributes, value: any) => void;
|
49
50
|
emitter: EmitterType;
|
51
|
+
boxEmitter: BoxEmitterType;
|
50
52
|
callbacks: CallbacksType;
|
51
53
|
canOperate: () => boolean;
|
52
54
|
notifyContainerRectUpdate: (rect: TeleBoxRect) => void;
|
53
55
|
cleanFocus: () => void;
|
54
56
|
setAppFocus: (appId: string) => void;
|
55
57
|
};
|
56
|
-
export declare const createBoxManager: (manager: WindowManager, callbacks: CallbacksType, emitter: EmitterType, options: CreateTeleBoxManagerConfig) => BoxManager;
|
58
|
+
export declare const createBoxManager: (manager: WindowManager, callbacks: CallbacksType, emitter: EmitterType, boxEmitter: BoxEmitterType, options: CreateTeleBoxManagerConfig) => BoxManager;
|
57
59
|
export declare class BoxManager {
|
58
60
|
private context;
|
59
61
|
private createTeleBoxManagerConfig?;
|
@@ -7,24 +7,6 @@ export declare type RemoveSceneParams = {
|
|
7
7
|
export declare type EmitterEvent = {
|
8
8
|
onCreated: undefined;
|
9
9
|
InitReplay: AppInitState;
|
10
|
-
move: {
|
11
|
-
appId: string;
|
12
|
-
x: number;
|
13
|
-
y: number;
|
14
|
-
};
|
15
|
-
focus: {
|
16
|
-
appId: string;
|
17
|
-
};
|
18
|
-
close: {
|
19
|
-
appId: string;
|
20
|
-
};
|
21
|
-
resize: {
|
22
|
-
appId: string;
|
23
|
-
width: number;
|
24
|
-
height: number;
|
25
|
-
x?: number;
|
26
|
-
y?: number;
|
27
|
-
};
|
28
10
|
error: Error;
|
29
11
|
seekStart: undefined;
|
30
12
|
seek: number;
|
@@ -1,12 +1,11 @@
|
|
1
|
-
|
2
|
-
export declare type Invoker = () => Promise<AppProxy | undefined>;
|
1
|
+
export declare type Invoker<T = any> = () => Promise<T | undefined>;
|
3
2
|
export declare class AppCreateQueue {
|
4
3
|
private list;
|
5
4
|
private currentInvoker;
|
6
5
|
private timer;
|
7
6
|
isEmit: boolean;
|
8
7
|
private initInterval;
|
9
|
-
push(item: Invoker): void;
|
8
|
+
push<T>(item: Invoker<T>): void;
|
10
9
|
invoke(): void;
|
11
10
|
private invoked;
|
12
11
|
private clear;
|
package/dist/constants.d.ts
CHANGED
@@ -19,6 +19,7 @@ export declare enum Events {
|
|
19
19
|
InitMainViewCamera = "InitMainViewCamera"
|
20
20
|
}
|
21
21
|
export declare const MagixEventName = "__WindowManger";
|
22
|
+
export declare const EnsureReconnectEvent = "__WindowMangerEnsureReconnected__";
|
22
23
|
export declare enum AppAttributes {
|
23
24
|
Size = "size",
|
24
25
|
Position = "position",
|