@netless/window-manager 0.4.0-canary.17 → 0.4.0-canary.18
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/.vscode/settings.json +1 -0
- package/CHANGELOG.md +30 -2
- package/dist/AppListener.d.ts +1 -0
- package/dist/AppManager.d.ts +8 -6
- package/dist/AppProxy.d.ts +3 -2
- package/dist/AttributesDelegate.d.ts +2 -2
- package/dist/BoxManager.d.ts +4 -3
- package/dist/BuiltinApps.d.ts +0 -1
- package/dist/Cursor/Cursor.d.ts +8 -11
- package/dist/Cursor/index.d.ts +5 -15
- package/dist/Utils/RoomHacker.d.ts +1 -1
- package/dist/View/MainView.d.ts +3 -2
- package/dist/constants.d.ts +3 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.es.js +41 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +41 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/docs/api.md +28 -0
- package/docs/concept.md +5 -0
- package/package.json +5 -5
- package/src/AppListener.ts +14 -6
- package/src/AppManager.ts +61 -34
- package/src/AppProxy.ts +10 -8
- package/src/AttributesDelegate.ts +2 -2
- package/src/BoxManager.ts +29 -20
- package/src/BuiltinApps.ts +0 -1
- package/src/Cursor/Cursor.ts +22 -36
- package/src/Cursor/index.ts +33 -135
- package/src/Utils/RoomHacker.ts +28 -15
- package/src/View/MainView.ts +10 -11
- package/src/constants.ts +3 -2
- package/src/index.ts +46 -3
- package/src/shim.d.ts +2 -1
- package/src/style.css +1 -1
- package/vite.config.js +5 -2
- package/dist/Base/Context.d.ts +0 -12
- package/dist/Base/index.d.ts +0 -7
- package/src/Base/Context.ts +0 -45
- package/src/Base/index.ts +0 -10
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
@@ -1,8 +1,36 @@
|
|
1
|
-
## 0.4.0
|
1
|
+
## 0.4.0(canary)
|
2
2
|
|
3
3
|
1. 废弃 `WindowManager.mount` 的多参数类型
|
4
4
|
2. 添加 `bindContainer` 接口,`mount` 时 `container` 参数不再是必选
|
5
|
-
3. 关闭 `App` 会移除相关的 `
|
5
|
+
3. 关闭 `App` 会移除相关的 `Scenes`
|
6
|
+
4. 添加 `ScenePath` 相同的 `App` 会把这个 `App` 置为最上层
|
7
|
+
5. 代理 `room.putScenes` 和 `room.removeScenes`
|
8
|
+
|
9
|
+
|
10
|
+
## 0.3.25
|
11
|
+
|
12
|
+
1. 修复创建 APP 之后没有设置默认 `zIndex` 的问题
|
13
|
+
|
14
|
+
## 0.3.24
|
15
|
+
|
16
|
+
1. 修复重连之后光标不见的问题(注意: 新的光标同步方式会跟 0.3.24 之前的版本不兼容)
|
17
|
+
2. 修改打包方式, 内部依赖会默认打包
|
18
|
+
3. 确保重复 mount 之后 `WindowManger` 内部状态正确
|
19
|
+
|
20
|
+
## 0.3.23
|
21
|
+
|
22
|
+
1. 修复 ios 上 `boxState` 没有正确回调的问题
|
23
|
+
2. 添加了 `setBoxState` `setMaximized` `setMinimized` 接口
|
24
|
+
|
25
|
+
## 0.3.22
|
26
|
+
|
27
|
+
1. 升级 `@netless/app-docs-viewer` 优化移动端显存占用
|
28
|
+
2. 升级 `@netless/telebox-insider` 优化移动端显存占用
|
29
|
+
|
30
|
+
## 0.3.19-0.3.21
|
31
|
+
|
32
|
+
1. 更新 `@netless/app-docs-viewer`
|
33
|
+
2. 修复 box `zIndex` 同步的问题
|
6
34
|
|
7
35
|
## 0.3.18
|
8
36
|
|
package/dist/AppListener.d.ts
CHANGED
package/dist/AppManager.d.ts
CHANGED
@@ -22,6 +22,13 @@ export declare class AppManager {
|
|
22
22
|
private _prevSceneIndex;
|
23
23
|
private _prevFocused;
|
24
24
|
constructor(windowManger: WindowManager);
|
25
|
+
private get eventName();
|
26
|
+
get attributes(): import("./index").WindowMangerAttributes;
|
27
|
+
get canOperate(): boolean;
|
28
|
+
get room(): Room | undefined;
|
29
|
+
get mainView(): import("white-web-sdk").View;
|
30
|
+
get focusApp(): AppProxy | undefined;
|
31
|
+
get uid(): string;
|
25
32
|
private onCreated;
|
26
33
|
/**
|
27
34
|
* 插件更新 attributes 时的回调
|
@@ -44,12 +51,6 @@ export declare class AppManager {
|
|
44
51
|
private baseInsertApp;
|
45
52
|
private displayerStateListener;
|
46
53
|
displayerWritableListener: (isReadonly: boolean) => void;
|
47
|
-
private get eventName();
|
48
|
-
get attributes(): import("./index").WindowMangerAttributes;
|
49
|
-
get canOperate(): boolean;
|
50
|
-
get room(): Room | undefined;
|
51
|
-
get mainView(): import("white-web-sdk").View;
|
52
|
-
get focusApp(): AppProxy | undefined;
|
53
54
|
safeSetAttributes(attributes: any): void;
|
54
55
|
safeUpdateAttributes(keys: string[], value: any): void;
|
55
56
|
setMainViewScenePath(scenePath: string): Promise<void>;
|
@@ -63,5 +64,6 @@ export declare class AppManager {
|
|
63
64
|
onReconnected(): Promise<void>;
|
64
65
|
notifyContainerRectUpdate(rect: TeleBoxRect): void;
|
65
66
|
dispatchInternalEvent(event: Events, payload: any): void;
|
67
|
+
findMemberByUid: (uid: string) => import("white-web-sdk").RoomMember | undefined;
|
66
68
|
destroy(): void;
|
67
69
|
}
|
package/dist/AppProxy.d.ts
CHANGED
@@ -4,9 +4,9 @@ import type { SceneState, View, SceneDefinition } from "white-web-sdk";
|
|
4
4
|
import type { AppManager } from "./AppManager";
|
5
5
|
import type { NetlessApp } from "./typings";
|
6
6
|
import type { ReadonlyTeleBox } from "@netless/telebox-insider";
|
7
|
-
|
8
|
-
export declare class AppProxy extends Base {
|
7
|
+
export declare class AppProxy {
|
9
8
|
private params;
|
9
|
+
private manager;
|
10
10
|
id: string;
|
11
11
|
scenePath?: string;
|
12
12
|
appEmitter: Emittery<AppEmitterEvent>;
|
@@ -15,6 +15,7 @@ export declare class AppProxy extends Base {
|
|
15
15
|
private boxManager;
|
16
16
|
private appProxies;
|
17
17
|
private viewManager;
|
18
|
+
private store;
|
18
19
|
private kind;
|
19
20
|
isAddApp: boolean;
|
20
21
|
private status;
|
@@ -47,7 +47,7 @@ export declare class AttributesDelegate {
|
|
47
47
|
cleanFocus(): void;
|
48
48
|
getAppSceneIndex(id: string): any;
|
49
49
|
getAppScenePath(id: string): any;
|
50
|
-
getMainViewScenePath():
|
50
|
+
getMainViewScenePath(): string | undefined;
|
51
51
|
getMainViewSceneIndex(): any;
|
52
52
|
getBoxState(): any;
|
53
53
|
setMainViewScenePath(scenePath: string): void;
|
@@ -60,7 +60,7 @@ export declare class AttributesDelegate {
|
|
60
60
|
setMainViewSize(size: (Size & {
|
61
61
|
id: string;
|
62
62
|
}) | undefined): void;
|
63
|
-
setAppFocus(appId: string, focus: boolean)
|
63
|
+
setAppFocus: (appId: string, focus: boolean) => void;
|
64
64
|
updateCursor(uid: string, position: Position): void;
|
65
65
|
updateCursorState(uid: string, cursorState: string | undefined): void;
|
66
66
|
getCursorState(uid: string): any;
|
package/dist/BoxManager.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { AppAttributes } from "./constants";
|
2
|
-
import { TELE_BOX_STATE, TeleBoxManager, TeleBoxConfig } from "@netless/telebox-insider";
|
3
2
|
import { WindowManager } from "./index";
|
3
|
+
import { TELE_BOX_STATE, TeleBoxManager } from "@netless/telebox-insider";
|
4
4
|
import type { AddAppOptions, AppInitState, EmitterType, CallbacksType } from "./index";
|
5
|
-
import type { TeleBoxManagerUpdateConfig, ReadonlyTeleBox, TeleBoxColorScheme, TeleBoxRect } from "@netless/telebox-insider";
|
5
|
+
import type { TeleBoxManagerUpdateConfig, ReadonlyTeleBox, TeleBoxColorScheme, TeleBoxRect, TeleBoxConfig } from "@netless/telebox-insider";
|
6
6
|
import type Emittery from "emittery";
|
7
7
|
import type { NetlessApp } from "./typings";
|
8
8
|
import type { View } from "white-web-sdk";
|
@@ -49,6 +49,7 @@ export declare type BoxManagerContext = {
|
|
49
49
|
canOperate: () => boolean;
|
50
50
|
notifyContainerRectUpdate: (rect: TeleBoxRect) => void;
|
51
51
|
cleanFocus: () => void;
|
52
|
+
setAppFocus: (appId: string) => void;
|
52
53
|
};
|
53
54
|
export declare const createBoxManager: (manager: WindowManager, callbacks: CallbacksType, emitter: EmitterType, options: CreateTeleBoxManagerConfig) => BoxManager;
|
54
55
|
export declare class BoxManager {
|
@@ -83,7 +84,7 @@ export declare class BoxManager {
|
|
83
84
|
setBoxTitle(params: SetBoxTitleParams): void;
|
84
85
|
blurAllBox(): void;
|
85
86
|
updateAll(config: TeleBoxManagerUpdateConfig): void;
|
86
|
-
setMaximized(maximized: boolean): void;
|
87
|
+
setMaximized(maximized: boolean, skipUpdate?: boolean): void;
|
87
88
|
setMinimized(minimized: boolean, skipUpdate?: boolean): void;
|
88
89
|
focusTopBox(): void;
|
89
90
|
updateBox(id: string, payload: TeleBoxConfig, skipUpdate?: boolean): void;
|
package/dist/BuiltinApps.d.ts
CHANGED
package/dist/Cursor/Cursor.d.ts
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
import { ApplianceNames } from
|
2
|
-
import {
|
3
|
-
import type { Position } from '../AttributesDelegate';
|
1
|
+
import { ApplianceNames } from "white-web-sdk";
|
2
|
+
import type { Position } from "../AttributesDelegate";
|
4
3
|
import type { CursorManager } from "./index";
|
5
|
-
import {
|
6
|
-
import type { AppManager } from '../AppManager';
|
4
|
+
import type { AppManager } from "../AppManager";
|
7
5
|
export declare type Payload = {
|
8
6
|
[key: string]: any;
|
9
7
|
};
|
10
|
-
export declare class Cursor
|
11
|
-
private
|
8
|
+
export declare class Cursor {
|
9
|
+
private manager;
|
12
10
|
private memberId;
|
13
11
|
private cursorManager;
|
14
12
|
private wrapper?;
|
15
13
|
private member?;
|
16
14
|
private timer?;
|
17
15
|
private component?;
|
18
|
-
constructor(manager: AppManager,
|
19
|
-
|
16
|
+
constructor(manager: AppManager, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
17
|
+
move: (position: Position) => void;
|
18
|
+
leave: () => void;
|
20
19
|
private moveCursor;
|
21
20
|
get memberApplianceName(): ApplianceNames | undefined;
|
22
21
|
get memberColor(): string;
|
@@ -27,8 +26,6 @@ export declare class Cursor extends Base {
|
|
27
26
|
private get memberCursorTagBackgroundColor();
|
28
27
|
private get memberAvatar();
|
29
28
|
private get memberOpacity();
|
30
|
-
get cursorState(): CursorState | undefined;
|
31
|
-
get cursorPosition(): Position | undefined;
|
32
29
|
private autoHidden;
|
33
30
|
private createCursor;
|
34
31
|
private initProps;
|
package/dist/Cursor/index.d.ts
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
import { Base } from "../Base";
|
2
1
|
import { Cursor } from "./Cursor";
|
3
|
-
import {
|
4
|
-
import type { PositionType, Position } from "../AttributesDelegate";
|
2
|
+
import type { PositionType } from "../AttributesDelegate";
|
5
3
|
import type { RoomMember, View } from "white-web-sdk";
|
6
4
|
import type { AppManager } from "../AppManager";
|
7
5
|
export declare type EventType = {
|
@@ -13,21 +11,19 @@ export declare type MoveCursorParams = {
|
|
13
11
|
x: number;
|
14
12
|
y: number;
|
15
13
|
};
|
16
|
-
export declare class CursorManager
|
17
|
-
private
|
14
|
+
export declare class CursorManager {
|
15
|
+
private manager;
|
18
16
|
containerRect?: DOMRect;
|
19
17
|
wrapperRect?: DOMRect;
|
20
18
|
cursorInstances: Map<string, Cursor>;
|
21
19
|
roomMembers?: readonly RoomMember[];
|
22
20
|
private mainViewElement?;
|
23
21
|
private sideEffectManager;
|
24
|
-
|
22
|
+
private store;
|
23
|
+
constructor(manager: AppManager);
|
25
24
|
setupWrapper(wrapper: HTMLElement): void;
|
26
25
|
setMainViewDivElement(div: HTMLDivElement): void;
|
27
|
-
private startReaction;
|
28
26
|
private getUids;
|
29
|
-
private handleRoomMembersChange;
|
30
|
-
get cursors(): any;
|
31
27
|
get boxState(): any;
|
32
28
|
get focusView(): View | undefined;
|
33
29
|
private mouseMoveListener;
|
@@ -37,15 +33,9 @@ export declare class CursorManager extends Base {
|
|
37
33
|
* 因为窗口内框在不同分辨率下的大小不一样,所以这里通过来鼠标事件的 target 来判断是在主白板还是在 APP 中
|
38
34
|
*/
|
39
35
|
private getType;
|
40
|
-
private initCursorAttributes;
|
41
|
-
private setNormalCursorState;
|
42
36
|
private mouseLeaveListener;
|
43
37
|
updateContainerRect(): void;
|
44
|
-
setRoomMembers(members: readonly RoomMember[]): void;
|
45
38
|
deleteCursor(uid: string): void;
|
46
39
|
hideCursor(uid: string): void;
|
47
|
-
cleanMemberAttributes(members: readonly RoomMember[]): void;
|
48
|
-
onReconnect(): void;
|
49
|
-
addCursorChangeListener: (uid: string, callback: (position: Position, state: CursorState) => void) => void;
|
50
40
|
destroy(): void;
|
51
41
|
}
|
package/dist/View/MainView.d.ts
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
import { Base } from "../Base";
|
2
1
|
import type { Camera, Size, View } from "white-web-sdk";
|
3
2
|
import type { AppManager } from "../AppManager";
|
4
|
-
export declare class MainViewProxy
|
3
|
+
export declare class MainViewProxy {
|
4
|
+
private manager;
|
5
5
|
private scale?;
|
6
6
|
private started;
|
7
7
|
private mainViewIsAddListener;
|
8
8
|
private mainView;
|
9
9
|
private viewId;
|
10
|
+
private store;
|
10
11
|
private sideEffectManager;
|
11
12
|
constructor(manager: AppManager);
|
12
13
|
private get mainViewCamera();
|
package/dist/constants.d.ts
CHANGED
@@ -10,7 +10,8 @@ export declare enum Events {
|
|
10
10
|
SetMainViewScenePath = "SetMainViewScenePath",
|
11
11
|
SetMainViewSceneIndex = "SetMainViewSceneIndex",
|
12
12
|
SwitchViewsToFreedom = "SwitchViewsToFreedom",
|
13
|
-
MoveCameraToContain = "MoveCameraToContain"
|
13
|
+
MoveCameraToContain = "MoveCameraToContain",
|
14
|
+
CursorMove = "CursorMove"
|
14
15
|
}
|
15
16
|
export declare const MagixEventName = "__WindowManger";
|
16
17
|
export declare enum AppAttributes {
|
@@ -31,7 +32,7 @@ export declare enum CursorState {
|
|
31
32
|
Leave = "leave",
|
32
33
|
Normal = "normal"
|
33
34
|
}
|
34
|
-
export declare const REQUIRE_VERSION = "2.16.
|
35
|
+
export declare const REQUIRE_VERSION = "2.16.1";
|
35
36
|
export declare const MIN_WIDTH: number;
|
36
37
|
export declare const MIN_HEIGHT: number;
|
37
38
|
export declare const SET_SCENEPATH_DELAY = 100;
|
package/dist/index.d.ts
CHANGED
@@ -5,7 +5,7 @@ import { ReconnectRefresher } from "./ReconnectRefresher";
|
|
5
5
|
import "./style.css";
|
6
6
|
import "@netless/telebox-insider/dist/style.css";
|
7
7
|
import type { TELE_BOX_STATE } from "./BoxManager";
|
8
|
-
import type { Apps } from "./AttributesDelegate";
|
8
|
+
import type { Apps, Position } from "./AttributesDelegate";
|
9
9
|
import { InvisiblePlugin, ViewMode } from "white-web-sdk";
|
10
10
|
import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, AnimationMode, CameraBound, Point, Rectangle, ViewVisionMode, CameraState } from "white-web-sdk";
|
11
11
|
import type { AppListeners } from "./AppListener";
|
@@ -65,6 +65,11 @@ export declare type AppInitState = {
|
|
65
65
|
boxState?: TeleBoxState;
|
66
66
|
zIndex?: number;
|
67
67
|
};
|
68
|
+
export declare type CursorMovePayload = {
|
69
|
+
uid: string;
|
70
|
+
state?: "leave";
|
71
|
+
position: Position;
|
72
|
+
};
|
68
73
|
export declare type EmitterEvent = {
|
69
74
|
onCreated: undefined;
|
70
75
|
InitReplay: AppInitState;
|
@@ -93,6 +98,8 @@ export declare type EmitterEvent = {
|
|
93
98
|
boxStateChange: string;
|
94
99
|
playgroundSizeChange: DOMRect;
|
95
100
|
onReconnected: void;
|
101
|
+
removeScenes: string;
|
102
|
+
cursorMove: CursorMovePayload;
|
96
103
|
};
|
97
104
|
export declare type EmitterType = Emittery<EmitterEvent>;
|
98
105
|
export declare const emitter: EmitterType;
|
@@ -134,6 +141,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
134
141
|
static containerSizeRatio: number;
|
135
142
|
private static isCreated;
|
136
143
|
version: string;
|
144
|
+
dependencies: Record<string, string>;
|
137
145
|
appListeners?: AppListeners;
|
138
146
|
readonly?: boolean;
|
139
147
|
emitter: Emittery<PublicEvent>;
|
@@ -170,7 +178,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
170
178
|
/**
|
171
179
|
* 返回 mainView 的 ScenePath
|
172
180
|
*/
|
173
|
-
getMainViewScenePath(): string;
|
181
|
+
getMainViewScenePath(): string | undefined;
|
174
182
|
/**
|
175
183
|
* 返回 mainView 的 SceneIndex
|
176
184
|
*/
|
@@ -191,6 +199,9 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
191
199
|
* 设置 ViewMode
|
192
200
|
*/
|
193
201
|
setViewMode(mode: ViewMode): void;
|
202
|
+
setBoxState(boxState: TeleBoxState): void;
|
203
|
+
setMaximized(maximized: boolean): void;
|
204
|
+
setMinimized(minimized: boolean): void;
|
194
205
|
get mainView(): View;
|
195
206
|
get camera(): Camera;
|
196
207
|
get cameraState(): CameraState;
|
@@ -201,6 +212,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
201
212
|
get focused(): string | undefined;
|
202
213
|
get mainViewSceneIndex(): number;
|
203
214
|
get mainViewSceneDir(): string;
|
215
|
+
get topApp(): string | undefined;
|
204
216
|
/**
|
205
217
|
* 查询所有的 App
|
206
218
|
*/
|
@@ -233,6 +245,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
233
245
|
private isDynamicPPT;
|
234
246
|
private static checkVersion;
|
235
247
|
private ensureAttributes;
|
248
|
+
private _removeScenes;
|
236
249
|
}
|
237
250
|
export * from "./typings";
|
238
251
|
export { BuiltinApps } from "./BuiltinApps";
|