@netless/window-manager 0.4.70 → 0.4.71
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/dist/AppManager.d.ts +2 -1
- package/dist/Cursor/Cursor.d.ts +7 -3
- package/dist/Cursor/icons2.d.ts +4 -0
- package/dist/Cursor/index.d.ts +9 -3
- package/dist/callback.d.ts +12 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +247 -50
- package/dist/index.mjs.map +1 -1
- package/dist/typings.d.ts +4 -0
- package/package.json +1 -1
- package/src/App/AppContext.ts +5 -0
- package/src/App/AppProxy.ts +8 -0
- package/src/AppManager.ts +31 -1
- package/src/Cursor/Cursor.svelte +9 -4
- package/src/Cursor/Cursor.svelte.d.ts +21 -0
- package/src/Cursor/Cursor.ts +75 -19
- package/src/Cursor/icons2.ts +66 -0
- package/src/Cursor/index.ts +84 -14
- package/src/callback.ts +12 -1
- package/src/index.ts +48 -15
- package/src/style.css +0 -1
- package/src/typings.ts +5 -0
package/dist/AppManager.d.ts
CHANGED
@@ -5,7 +5,7 @@ import { WindowManager } from "./index";
|
|
5
5
|
import { ViewManager } from "./View/ViewManager";
|
6
6
|
import type { ReconnectRefresher } from "./ReconnectRefresher";
|
7
7
|
import type { BoxManager } from "./BoxManager";
|
8
|
-
import type { Displayer, Room, SceneState } from "white-web-sdk";
|
8
|
+
import type { Displayer, Room, SceneState, MemberState } from "white-web-sdk";
|
9
9
|
import type { AddAppParams, TeleBoxRect } from "./index";
|
10
10
|
export declare class AppManager {
|
11
11
|
windowManger: WindowManager;
|
@@ -28,6 +28,7 @@ export declare class AppManager {
|
|
28
28
|
sceneState: SceneState | null;
|
29
29
|
rootDirRemoving: boolean;
|
30
30
|
constructor(windowManger: WindowManager);
|
31
|
+
getMemberState(): MemberState;
|
31
32
|
private onRemoveScenes;
|
32
33
|
/**
|
33
34
|
* 根目录被删除时所有的 scene 都会被删除.
|
package/dist/Cursor/Cursor.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { ApplianceNames } from "white-web-sdk";
|
2
|
-
import type { Position } from "../AttributesDelegate";
|
3
1
|
import type { RoomMember } from "white-web-sdk";
|
4
|
-
import type { CursorManager } from "./index";
|
5
2
|
import type { AppManager } from "../AppManager";
|
3
|
+
import type { Position } from "../AttributesDelegate";
|
4
|
+
import type { CursorManager } from "./index";
|
5
|
+
import { ApplianceNames } from "white-web-sdk";
|
6
6
|
export declare type Payload = {
|
7
7
|
[key: string]: any;
|
8
8
|
};
|
@@ -14,12 +14,15 @@ export declare class Cursor {
|
|
14
14
|
private member?;
|
15
15
|
private timer?;
|
16
16
|
private component?;
|
17
|
+
private style;
|
17
18
|
constructor(manager: AppManager, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
18
19
|
move: (position: Position) => void;
|
20
|
+
setStyle: (style: "default" | "custom") => void;
|
19
21
|
leave: () => void;
|
20
22
|
private moveCursor;
|
21
23
|
get memberApplianceName(): ApplianceNames | undefined;
|
22
24
|
get memberColor(): string;
|
25
|
+
get memberColorHex(): string;
|
23
26
|
private get payload();
|
24
27
|
get memberCursorName(): any;
|
25
28
|
private get memberTheme();
|
@@ -32,6 +35,7 @@ export declare class Cursor {
|
|
32
35
|
private createCursor;
|
33
36
|
private initProps;
|
34
37
|
private getIcon;
|
38
|
+
private isCustomIcon;
|
35
39
|
updateMember(): RoomMember | undefined;
|
36
40
|
private updateComponent;
|
37
41
|
destroy(): void;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import type { MemberState } from "white-web-sdk";
|
2
|
+
import { ApplianceNames } from "white-web-sdk";
|
3
|
+
export declare function enableLocal(memberState: MemberState): () => void;
|
4
|
+
export declare function remoteIcon(applianceName: ApplianceNames, hex: string): string | undefined;
|
package/dist/Cursor/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Cursor } from "./Cursor";
|
2
|
-
import type { ApplianceIcons } from "../index";
|
2
|
+
import type { ApplianceIcons, CursorOptions } from "../index";
|
3
3
|
import type { PositionType } from "../AttributesDelegate";
|
4
4
|
import type { RoomMember, View } from "white-web-sdk";
|
5
5
|
import type { AppManager } from "../AppManager";
|
@@ -19,13 +19,19 @@ export declare class CursorManager {
|
|
19
19
|
wrapperRect?: DOMRect;
|
20
20
|
cursorInstances: Map<string, Cursor>;
|
21
21
|
roomMembers?: readonly RoomMember[];
|
22
|
+
userApplianceIcons: ApplianceIcons;
|
22
23
|
private mainViewElement?;
|
23
24
|
private sideEffectManager;
|
24
25
|
private store;
|
25
|
-
|
26
|
-
|
26
|
+
private leaveFlag;
|
27
|
+
private _style;
|
28
|
+
constructor(manager: AppManager, enableCursor: boolean, cursorOptions?: CursorOptions, applianceIcons?: ApplianceIcons);
|
29
|
+
get applianceIcons(): ApplianceIcons;
|
30
|
+
get style(): "default" | "custom";
|
31
|
+
set style(value: "default" | "custom");
|
27
32
|
private onCursorMove;
|
28
33
|
private initCursorInstance;
|
34
|
+
private enableCustomCursor;
|
29
35
|
private canMoveCursor;
|
30
36
|
setupWrapper(wrapper: HTMLElement): void;
|
31
37
|
setMainViewDivElement(div: HTMLDivElement): void;
|
package/dist/callback.d.ts
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
import Emittery from "emittery";
|
2
2
|
import type { TeleBoxColorScheme, TELE_BOX_STATE } from "@netless/telebox-insider";
|
3
|
-
import type { CameraState, SceneState, ViewVisionMode } from "white-web-sdk";
|
3
|
+
import type { CameraState, SceneState, View, ViewVisionMode } from "white-web-sdk";
|
4
4
|
import type { LoadAppEvent } from "./Register";
|
5
5
|
import type { PageState } from "./Page";
|
6
|
+
import type { BoxClosePayload, BoxFocusPayload, BoxMovePayload, BoxResizePayload, BoxStateChangePayload } from "./BoxEmitter";
|
7
|
+
import type { AppPayload } from "./typings";
|
6
8
|
export declare type PublicEvent = {
|
7
9
|
mainViewModeChange: ViewVisionMode;
|
8
10
|
boxStateChange: `${TELE_BOX_STATE}`;
|
@@ -21,6 +23,15 @@ export declare type PublicEvent = {
|
|
21
23
|
pageStateChange: PageState;
|
22
24
|
fullscreenChange: boolean;
|
23
25
|
appsChange: string[];
|
26
|
+
onBoxMove: BoxMovePayload;
|
27
|
+
onBoxResize: BoxResizePayload;
|
28
|
+
onBoxFocus: BoxFocusPayload;
|
29
|
+
onBoxClose: BoxClosePayload;
|
30
|
+
onBoxStateChange: BoxStateChangePayload;
|
31
|
+
onMainViewMounted: View;
|
32
|
+
onAppViewMounted: AppPayload;
|
33
|
+
onAppSetup: string;
|
34
|
+
onAppScenePathChange: AppPayload;
|
24
35
|
};
|
25
36
|
export declare type CallbacksType = Emittery<PublicEvent>;
|
26
37
|
export declare const callbacks: CallbacksType;
|
package/dist/index.d.ts
CHANGED
@@ -75,6 +75,14 @@ export declare type CursorMovePayload = {
|
|
75
75
|
state?: "leave";
|
76
76
|
position: Position;
|
77
77
|
};
|
78
|
+
export declare type CursorOptions = {
|
79
|
+
/**
|
80
|
+
* If `"custom"`, it will render the pencil / eraser cursor as a circle and shapes cursor as a cross.
|
81
|
+
*
|
82
|
+
* @default "default"
|
83
|
+
*/
|
84
|
+
style?: "default" | "custom";
|
85
|
+
};
|
78
86
|
export declare type MountParams = {
|
79
87
|
room: Room | Player;
|
80
88
|
container?: HTMLElement;
|
@@ -86,12 +94,14 @@ export declare type MountParams = {
|
|
86
94
|
collectorStyles?: Partial<CSSStyleDeclaration>;
|
87
95
|
overwriteStyles?: string;
|
88
96
|
cursor?: boolean;
|
97
|
+
cursorOptions?: CursorOptions;
|
89
98
|
debug?: boolean;
|
90
99
|
disableCameraTransform?: boolean;
|
91
100
|
prefersColorScheme?: TeleBoxColorScheme;
|
92
101
|
applianceIcons?: ApplianceIcons;
|
93
102
|
fullscreen?: boolean;
|
94
103
|
polling?: boolean;
|
104
|
+
supportTeachingAidsPlugin?: boolean;
|
95
105
|
};
|
96
106
|
export declare const reconnectRefresher: ReconnectRefresher;
|
97
107
|
export declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any> implements PageController {
|
@@ -103,6 +113,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
103
113
|
static container?: HTMLElement;
|
104
114
|
static debug: boolean;
|
105
115
|
static containerSizeRatio: number;
|
116
|
+
static supportTeachingAidsPlugin?: boolean;
|
106
117
|
private static isCreated;
|
107
118
|
version: string;
|
108
119
|
dependencies: Record<string, string>;
|
@@ -208,6 +219,8 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
208
219
|
get focusedView(): View | undefined;
|
209
220
|
get polling(): boolean;
|
210
221
|
set polling(b: boolean);
|
222
|
+
get cursorStyle(): "default" | "custom";
|
223
|
+
set cursorStyle(value: "default" | "custom");
|
211
224
|
get mainViewSceneIndex(): number;
|
212
225
|
get mainViewSceneDir(): string;
|
213
226
|
get topApp(): string | undefined;
|