@netless/window-manager 0.4.30 → 0.4.33
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 +8 -0
- package/dist/AppManager.d.ts +5 -1
- package/dist/BoxEmitter.d.ts +34 -0
- package/dist/BoxManager.d.ts +3 -1
- package/dist/Cursor/index.d.ts +3 -1
- package/dist/Helper.d.ts +2 -0
- package/dist/InternalEmitter.d.ts +0 -18
- package/dist/Utils/AppCreateQueue.d.ts +2 -3
- package/dist/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +99 -79
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/dist/typings.d.ts +2 -1
- package/docs/api.md +1 -1
- package/docs/app-context.md +127 -36
- package/docs/develop-app.md +1 -1
- package/package.json +3 -2
- package/pnpm-lock.yaml +66 -36
- package/src/App/AppProxy.ts +2 -1
- package/src/AppManager.ts +67 -59
- package/src/BoxEmitter.ts +19 -0
- package/src/BoxManager.ts +10 -6
- package/src/Cursor/Cursor.ts +3 -3
- package/src/Cursor/index.ts +8 -2
- package/src/Helper.ts +17 -1
- package/src/InternalEmitter.ts +0 -4
- package/src/ReconnectRefresher.ts +9 -3
- package/src/Utils/AppCreateQueue.ts +2 -3
- package/src/index.ts +27 -37
- package/src/typings.ts +3 -0
- package/dist/ScenePath/index.d.ts +0 -12
- package/src/ScenePath/index.ts +0 -47
package/CHANGELOG.md
CHANGED
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?;
|
package/dist/Cursor/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Cursor } from "./Cursor";
|
2
|
+
import type { ApplianceIcons } from "../index";
|
2
3
|
import type { PositionType } from "../AttributesDelegate";
|
3
4
|
import type { RoomMember, View } from "white-web-sdk";
|
4
5
|
import type { AppManager } from "../AppManager";
|
@@ -21,7 +22,8 @@ export declare class CursorManager {
|
|
21
22
|
private mainViewElement?;
|
22
23
|
private sideEffectManager;
|
23
24
|
private store;
|
24
|
-
|
25
|
+
applianceIcons: ApplianceIcons;
|
26
|
+
constructor(manager: AppManager, enableCursor: boolean, applianceIcons?: ApplianceIcons);
|
25
27
|
private onCursorMove;
|
26
28
|
private initCursorInstance;
|
27
29
|
private canMoveCursor;
|
package/dist/Helper.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { WindowManager } from "./index";
|
1
2
|
import type { Room } from "white-web-sdk";
|
2
3
|
export declare const setupWrapper: (root: HTMLElement) => {
|
3
4
|
playground: HTMLDivElement;
|
@@ -7,3 +8,4 @@ export declare const setupWrapper: (root: HTMLElement) => {
|
|
7
8
|
};
|
8
9
|
export declare const checkVersion: () => void;
|
9
10
|
export declare const findMemberByUid: (room: Room | undefined, uid: string) => import("white-web-sdk").RoomMember | undefined;
|
11
|
+
export declare const createInvisiblePlugin: (room: Room) => Promise<WindowManager | undefined>;
|
@@ -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;
|