@netless/window-manager 0.3.22 → 0.3.25
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/dist/AppListener.d.ts +1 -0
- package/dist/AppManager.d.ts +2 -0
- package/dist/AppProxy.d.ts +3 -2
- package/dist/AttributesDelegate.d.ts +0 -4
- package/dist/BoxManager.d.ts +1 -1
- package/dist/Cursor/Cursor.d.ts +8 -12
- package/dist/Cursor/index.d.ts +5 -14
- package/dist/MainView.d.ts +3 -2
- package/dist/ViewManager.d.ts +3 -2
- package/dist/constants.d.ts +2 -1
- package/dist/index.d.ts +11 -1
- 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/package.json +5 -5
- package/src/AppContext.ts +1 -1
- package/src/AppListener.ts +9 -1
- package/src/AppManager.ts +11 -4
- package/src/AppProxy.ts +9 -7
- package/src/AttributesDelegate.ts +0 -28
- package/src/BoxManager.ts +21 -24
- package/src/Cursor/Cursor.ts +34 -59
- package/src/Cursor/index.ts +53 -130
- package/src/MainView.ts +11 -12
- package/src/constants.ts +1 -0
- package/src/index.ts +93 -55
- package/src/style.css +1 -1
- package/src/viewManager.ts +4 -5
- package/vite.config.js +4 -2
- package/dist/Base/Context.d.ts +0 -13
- package/dist/Base/index.d.ts +0 -8
- package/src/Base/Context.ts +0 -49
- package/src/Base/index.ts +0 -10
package/.vscode/settings.json
CHANGED
package/dist/AppListener.d.ts
CHANGED
package/dist/AppManager.d.ts
CHANGED
@@ -46,6 +46,8 @@ export declare class AppManager {
|
|
46
46
|
get room(): Room | undefined;
|
47
47
|
get mainView(): import("white-web-sdk").View;
|
48
48
|
get focusApp(): AppProxy | undefined;
|
49
|
+
get uid(): string;
|
50
|
+
findMemberByUid: (uid: string) => import("white-web-sdk").RoomMember | undefined;
|
49
51
|
safeSetAttributes(attributes: any): void;
|
50
52
|
safeUpdateAttributes(keys: string[], value: any): void;
|
51
53
|
setMainViewScenePath(scenePath: string): Promise<void>;
|
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>;
|
@@ -16,6 +16,7 @@ export declare class AppProxy extends Base {
|
|
16
16
|
private appProxies;
|
17
17
|
private viewManager;
|
18
18
|
private cameraStore;
|
19
|
+
private store;
|
19
20
|
private kind;
|
20
21
|
isAddApp: boolean;
|
21
22
|
private status;
|
@@ -54,10 +54,6 @@ export declare class AttributesDelegate {
|
|
54
54
|
id: string;
|
55
55
|
} | undefined): void;
|
56
56
|
setAppFocus(appId: string, focus: boolean): void;
|
57
|
-
updateCursor(uid: string, position: Position): void;
|
58
|
-
updateCursorState(uid: string, cursorState: string | undefined): void;
|
59
|
-
getCursorState(uid: string): any;
|
60
|
-
cleanCursor(uid: string): void;
|
61
57
|
setMainViewFocusPath(): void;
|
62
58
|
}
|
63
59
|
export declare type MainViewSize = {
|
package/dist/BoxManager.d.ts
CHANGED
@@ -67,7 +67,7 @@ export declare class BoxManager {
|
|
67
67
|
setBoxTitle(params: SetBoxTitleParams): void;
|
68
68
|
blurAllBox(): void;
|
69
69
|
updateAll(config: TeleBoxManagerUpdateConfig): void;
|
70
|
-
setMaximized(maximized: boolean): void;
|
70
|
+
setMaximized(maximized: boolean, skipUpdate?: boolean): void;
|
71
71
|
setMinimized(minimized: boolean, skipUpdate?: boolean): void;
|
72
72
|
focusTopBox(): void;
|
73
73
|
setReadonly(readonly: boolean): void;
|
package/dist/Cursor/Cursor.d.ts
CHANGED
@@ -1,23 +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
|
-
private disposer;
|
17
14
|
private timer?;
|
18
15
|
private component?;
|
19
|
-
constructor(manager: AppManager,
|
20
|
-
|
16
|
+
constructor(manager: AppManager, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
17
|
+
move: (position: Position) => void;
|
18
|
+
leave: () => void;
|
21
19
|
private moveCursor;
|
22
20
|
get memberApplianceName(): ApplianceNames | undefined;
|
23
21
|
get memberColor(): string;
|
@@ -28,8 +26,6 @@ export declare class Cursor extends Base {
|
|
28
26
|
private get memberCursorTagBackgroundColor();
|
29
27
|
private get memberAvatar();
|
30
28
|
private get memberOpacity();
|
31
|
-
get cursorState(): CursorState | undefined;
|
32
|
-
get cursorPosition(): Position | undefined;
|
33
29
|
private autoHidden;
|
34
30
|
private createCursor;
|
35
31
|
private initProps;
|
package/dist/Cursor/index.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { Cursor } from './Cursor';
|
1
|
+
import { Cursor } from "./Cursor";
|
3
2
|
import type { PositionType } from "../AttributesDelegate";
|
4
3
|
import type { RoomMember, View } from "white-web-sdk";
|
5
4
|
import type { AppManager } from "../AppManager";
|
@@ -12,36 +11,28 @@ export declare type MoveCursorParams = {
|
|
12
11
|
x: number;
|
13
12
|
y: number;
|
14
13
|
};
|
15
|
-
export declare class CursorManager
|
16
|
-
private
|
14
|
+
export declare class CursorManager {
|
15
|
+
private manager;
|
17
16
|
containerRect?: DOMRect;
|
18
17
|
wrapperRect?: DOMRect;
|
19
18
|
cursorInstances: Map<string, Cursor>;
|
20
19
|
roomMembers?: readonly RoomMember[];
|
21
20
|
private mainViewElement?;
|
22
|
-
|
21
|
+
private store;
|
22
|
+
constructor(manager: AppManager);
|
23
23
|
setMainViewDivElement(div: HTMLDivElement): void;
|
24
|
-
private startReaction;
|
25
|
-
private getUids;
|
26
|
-
private handleRoomMembersChange;
|
27
|
-
get cursors(): any;
|
28
24
|
get boxState(): import("@netless/telebox-insider").TELE_BOX_STATE;
|
29
25
|
get focusView(): View | undefined;
|
30
26
|
private mouseMoveListener;
|
31
|
-
private touchMoveListener;
|
32
27
|
private updateCursor;
|
33
28
|
private getPoint;
|
34
29
|
/**
|
35
30
|
* 因为窗口内框在不同分辨率下的大小不一样,所以这里通过来鼠标事件的 target 来判断是在主白板还是在 APP 中
|
36
31
|
*/
|
37
32
|
private getType;
|
38
|
-
private initCursorAttributes;
|
39
|
-
private setNormalCursorState;
|
40
33
|
private mouseLeaveListener;
|
41
34
|
updateContainerRect(): void;
|
42
|
-
setRoomMembers(members: readonly RoomMember[]): void;
|
43
35
|
deleteCursor(uid: string): void;
|
44
36
|
hideCursor(uid: string): void;
|
45
|
-
cleanMemberAttributes(members: readonly RoomMember[]): void;
|
46
37
|
destroy(): void;
|
47
38
|
}
|
package/dist/MainView.d.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
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 cameraStore;
|
7
|
+
private store;
|
7
8
|
private started;
|
8
9
|
private mainViewIsAddListener;
|
9
10
|
private mainView;
|
package/dist/ViewManager.d.ts
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
import { Base } from "./Base";
|
2
1
|
import type { View, Displayer } from "white-web-sdk";
|
3
2
|
import type { AppManager } from "./AppManager";
|
4
|
-
export declare class ViewManager
|
3
|
+
export declare class ViewManager {
|
4
|
+
private manager;
|
5
5
|
private views;
|
6
6
|
private timer?;
|
7
7
|
private appTimer?;
|
8
8
|
private mainViewProxy;
|
9
9
|
private displayer;
|
10
|
+
private store;
|
10
11
|
constructor(manager: AppManager);
|
11
12
|
get currentScenePath(): string;
|
12
13
|
get mainView(): View;
|
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
|
+
CursorMove = "CursorMove"
|
13
14
|
}
|
14
15
|
export declare const MagixEventName = "__WindowManger";
|
15
16
|
export declare enum AppAttributes {
|
package/dist/index.d.ts
CHANGED
@@ -4,7 +4,7 @@ import { CursorManager } from "./Cursor";
|
|
4
4
|
import "./style.css";
|
5
5
|
import "@netless/telebox-insider/dist/style.css";
|
6
6
|
import type { TELE_BOX_STATE } from "./BoxManager";
|
7
|
-
import type { Apps } from "./AttributesDelegate";
|
7
|
+
import type { Apps, Position } from "./AttributesDelegate";
|
8
8
|
import { InvisiblePlugin, ViewMode } from "white-web-sdk";
|
9
9
|
import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, AnimationMode, CameraBound, Point, Rectangle, ViewVisionMode, CameraState } from "white-web-sdk";
|
10
10
|
import type { AppListeners } from "./AppListener";
|
@@ -63,6 +63,11 @@ export declare type AppInitState = {
|
|
63
63
|
boxState?: TeleBoxState;
|
64
64
|
zIndex?: number;
|
65
65
|
};
|
66
|
+
export declare type CursorMovePayload = {
|
67
|
+
uid: string;
|
68
|
+
state?: "leave";
|
69
|
+
position: Position;
|
70
|
+
};
|
66
71
|
export declare type EmitterEvent = {
|
67
72
|
onCreated: undefined;
|
68
73
|
InitReplay: AppInitState;
|
@@ -90,6 +95,8 @@ export declare type EmitterEvent = {
|
|
90
95
|
observerIdChange: number;
|
91
96
|
boxStateChange: string;
|
92
97
|
playgroundSizeChange: DOMRect;
|
98
|
+
onReconnected: undefined;
|
99
|
+
cursorMove: CursorMovePayload;
|
93
100
|
};
|
94
101
|
export declare const emitter: Emittery<EmitterEvent>;
|
95
102
|
export declare type PublicEvent = {
|
@@ -184,6 +191,9 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
184
191
|
* app destroy 回调
|
185
192
|
*/
|
186
193
|
onAppDestroy(kind: string, listener: (error: Error) => void): void;
|
194
|
+
setBoxState(boxState: TeleBoxState): void;
|
195
|
+
setMaximized(maximized: boolean): void;
|
196
|
+
setMinimized(minimized: boolean): void;
|
187
197
|
/**
|
188
198
|
* 设置 ViewMode
|
189
199
|
*/
|