@netless/window-manager 0.4.0-canary.0 → 0.4.0-canary.4
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 +6 -0
- package/dist/AppListener.d.ts +1 -0
- package/dist/AppManager.d.ts +2 -2
- package/dist/AppProxy.d.ts +1 -1
- package/dist/Cursor/Cursor.d.ts +2 -3
- package/dist/Cursor/index.d.ts +7 -4
- package/dist/MainView.d.ts +1 -0
- package/dist/ReconnectRefresher.d.ts +8 -3
- package/dist/constants.d.ts +2 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -2
- package/src/AppListener.ts +8 -0
- package/src/AppManager.ts +13 -10
- package/src/AppProxy.ts +2 -2
- package/src/BoxManager.ts +0 -1
- package/src/Cursor/Cursor.ts +23 -34
- package/src/Cursor/index.ts +70 -41
- package/src/MainView.ts +11 -3
- package/src/ReconnectRefresher.ts +16 -4
- package/src/constants.ts +1 -0
- package/src/index.ts +55 -49
package/CHANGELOG.md
CHANGED
package/dist/AppListener.d.ts
CHANGED
package/dist/AppManager.d.ts
CHANGED
@@ -3,8 +3,8 @@ import { AppProxy } from "./AppProxy";
|
|
3
3
|
import { WindowManager } from "./index";
|
4
4
|
import { CameraStore } from "./Utils/CameraStore";
|
5
5
|
import { MainViewProxy } from "./MainView";
|
6
|
-
import { ReconnectRefresher } from "./ReconnectRefresher";
|
7
6
|
import { ViewManager } from "./ViewManager";
|
7
|
+
import type { ReconnectRefresher } from "./ReconnectRefresher";
|
8
8
|
import type { BoxManager } from "./BoxManager";
|
9
9
|
import type { Displayer, Room } from "white-web-sdk";
|
10
10
|
import type { AddAppParams, TeleBoxRect } from "./index";
|
@@ -58,7 +58,7 @@ export declare class AppManager {
|
|
58
58
|
safeDispatchMagixEvent(event: string, payload: any): void;
|
59
59
|
private boxEventListener;
|
60
60
|
focusByAttributes(apps: any): void;
|
61
|
-
|
61
|
+
onReconnected(): Promise<void>;
|
62
62
|
notifyContainerRectUpdate(rect: TeleBoxRect): void;
|
63
63
|
dispatchInternalEvent(event: Events, payload: any): void;
|
64
64
|
destroy(): void;
|
package/dist/AppProxy.d.ts
CHANGED
@@ -20,7 +20,7 @@ export declare class AppProxy extends Base {
|
|
20
20
|
isAddApp: boolean;
|
21
21
|
private status;
|
22
22
|
private stateKey;
|
23
|
-
private
|
23
|
+
private appResult?;
|
24
24
|
private appContext?;
|
25
25
|
constructor(params: BaseInsertParams, manager: AppManager, appId: string, isAddApp: boolean);
|
26
26
|
private initScenes;
|
package/dist/Cursor/Cursor.d.ts
CHANGED
@@ -13,11 +13,10 @@ export declare class Cursor extends Base {
|
|
13
13
|
private cursorManager;
|
14
14
|
private wrapper?;
|
15
15
|
private member?;
|
16
|
-
private disposer;
|
17
16
|
private timer?;
|
18
17
|
private component?;
|
19
|
-
constructor(manager: AppManager, cursors: any, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
20
|
-
private
|
18
|
+
constructor(manager: AppManager, addCursorChangeListener: (uid: string, callback: (position: Position, state: CursorState) => void) => void, cursors: any, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
19
|
+
private onCursorChange;
|
21
20
|
private moveCursor;
|
22
21
|
get memberApplianceName(): ApplianceNames | undefined;
|
23
22
|
get memberColor(): string;
|
package/dist/Cursor/index.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
import { Base } from
|
2
|
-
import { Cursor } from
|
3
|
-
import
|
1
|
+
import { Base } from "../Base";
|
2
|
+
import { Cursor } from "./Cursor";
|
3
|
+
import { CursorState } from "../constants";
|
4
|
+
import type { PositionType, Position } from "../AttributesDelegate";
|
4
5
|
import type { RoomMember, View } from "white-web-sdk";
|
5
6
|
import type { AppManager } from "../AppManager";
|
6
7
|
export declare type EventType = {
|
@@ -19,6 +20,7 @@ export declare class CursorManager extends Base {
|
|
19
20
|
cursorInstances: Map<string, Cursor>;
|
20
21
|
roomMembers?: readonly RoomMember[];
|
21
22
|
private mainViewElement?;
|
23
|
+
private sideEffectManager;
|
22
24
|
constructor(appManager: AppManager);
|
23
25
|
setupWrapper(wrapper: HTMLElement): void;
|
24
26
|
setMainViewDivElement(div: HTMLDivElement): void;
|
@@ -29,7 +31,6 @@ export declare class CursorManager extends Base {
|
|
29
31
|
get boxState(): any;
|
30
32
|
get focusView(): View | undefined;
|
31
33
|
private mouseMoveListener;
|
32
|
-
private touchMoveListener;
|
33
34
|
private updateCursor;
|
34
35
|
private getPoint;
|
35
36
|
/**
|
@@ -44,5 +45,7 @@ export declare class CursorManager extends Base {
|
|
44
45
|
deleteCursor(uid: string): void;
|
45
46
|
hideCursor(uid: string): void;
|
46
47
|
cleanMemberAttributes(members: readonly RoomMember[]): void;
|
48
|
+
onReconnect(): void;
|
49
|
+
addCursorChangeListener: (uid: string, callback: (position: Position, state: CursorState) => void) => void;
|
47
50
|
destroy(): void;
|
48
51
|
}
|
package/dist/MainView.d.ts
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
import type { Room } from "white-web-sdk";
|
2
|
-
import type {
|
2
|
+
import type { EmitterType } from "./index";
|
3
|
+
export declare type ReconnectRefresherContext = {
|
4
|
+
emitter: EmitterType;
|
5
|
+
};
|
3
6
|
export declare class ReconnectRefresher {
|
4
|
-
private
|
7
|
+
private ctx;
|
5
8
|
private phase?;
|
6
9
|
private room;
|
7
10
|
private reactors;
|
8
11
|
private disposers;
|
9
|
-
constructor(
|
12
|
+
constructor(ctx: ReconnectRefresherContext);
|
13
|
+
setRoom(room: Room | undefined): void;
|
14
|
+
setContext(ctx: ReconnectRefresherContext): void;
|
10
15
|
private onPhaseChanged;
|
11
16
|
private onReconnected;
|
12
17
|
private releaseDisposers;
|
package/dist/constants.d.ts
CHANGED
@@ -9,7 +9,8 @@ export declare enum Events {
|
|
9
9
|
WindowCreated = "WindowCreated",
|
10
10
|
SetMainViewScenePath = "SetMainViewScenePath",
|
11
11
|
SetMainViewSceneIndex = "SetMainViewSceneIndex",
|
12
|
-
SwitchViewsToFreedom = "SwitchViewsToFreedom"
|
12
|
+
SwitchViewsToFreedom = "SwitchViewsToFreedom",
|
13
|
+
MoveCameraToContain = "MoveCameraToContain"
|
13
14
|
}
|
14
15
|
export declare const MagixEventName = "__WindowManger";
|
15
16
|
export declare enum AppAttributes {
|
package/dist/index.d.ts
CHANGED
@@ -11,6 +11,7 @@ import type { AppListeners } from "./AppListener";
|
|
11
11
|
import type { NetlessApp, RegisterParams } from "./typings";
|
12
12
|
import type { TeleBoxColorScheme, TeleBoxState } from "@netless/telebox-insider";
|
13
13
|
import type { AppProxy } from "./AppProxy";
|
14
|
+
import { ReconnectRefresher } from "./ReconnectRefresher";
|
14
15
|
export declare type WindowMangerAttributes = {
|
15
16
|
modelValue?: string;
|
16
17
|
boxState: TELE_BOX_STATE;
|
@@ -29,11 +30,11 @@ export declare type AddAppOptions = {
|
|
29
30
|
export declare type setAppOptions = AddAppOptions & {
|
30
31
|
appOptions?: any;
|
31
32
|
};
|
32
|
-
export declare type AddAppParams = {
|
33
|
+
export declare type AddAppParams<TAttributes = any> = {
|
33
34
|
kind: string;
|
34
35
|
src?: string;
|
35
36
|
options?: AddAppOptions;
|
36
|
-
attributes?:
|
37
|
+
attributes?: TAttributes;
|
37
38
|
};
|
38
39
|
export declare type BaseInsertParams = {
|
39
40
|
kind: string;
|
@@ -91,6 +92,7 @@ export declare type EmitterEvent = {
|
|
91
92
|
observerIdChange: number;
|
92
93
|
boxStateChange: string;
|
93
94
|
playgroundSizeChange: DOMRect;
|
95
|
+
onReconnected: void;
|
94
96
|
};
|
95
97
|
export declare type EmitterType = Emittery<EmitterEvent>;
|
96
98
|
export declare const emitter: EmitterType;
|
@@ -118,6 +120,7 @@ export declare type MountParams = {
|
|
118
120
|
};
|
119
121
|
export declare type CallbacksType = Emittery<PublicEvent>;
|
120
122
|
export declare const callbacks: CallbacksType;
|
123
|
+
export declare const reconnectRefresher: ReconnectRefresher;
|
121
124
|
export declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
|
122
125
|
static kind: string;
|
123
126
|
static displayer: Displayer;
|
@@ -141,17 +144,16 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
141
144
|
static mount(params: MountParams): Promise<WindowManager>;
|
142
145
|
private static initManager;
|
143
146
|
private static initContainer;
|
144
|
-
bindContainer(container: HTMLElement
|
147
|
+
bindContainer(container: HTMLElement): void;
|
148
|
+
bindCollectorContainer(container: HTMLElement): void;
|
145
149
|
/**
|
146
150
|
* 注册插件
|
147
151
|
*/
|
148
152
|
static register<AppOptions = any, SetupResult = any, Attributes = any>(params: RegisterParams<AppOptions, SetupResult, Attributes>): Promise<void>;
|
149
|
-
static setContainer(container: HTMLElement): void;
|
150
|
-
static setCollectorContainer(container: HTMLElement): void;
|
151
153
|
/**
|
152
154
|
* 创建一个 app 至白板
|
153
155
|
*/
|
154
|
-
addApp(params: AddAppParams): Promise<string | undefined>;
|
156
|
+
addApp<T = any>(params: AddAppParams<T>): Promise<string | undefined>;
|
155
157
|
private setupScenePath;
|
156
158
|
/**
|
157
159
|
* 设置 mainView 的 ScenePath, 并且切换白板为可写状态
|