@netless/window-manager 0.4.71-beta.0 → 0.4.72-beta.0
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 -4
- package/dist/index.d.ts +11 -0
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +213 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/AppManager.ts +12 -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 +79 -21
- package/src/index.ts +46 -16
- package/src/style.css +0 -1
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,14 +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
|
-
private
|
27
|
-
constructor(manager: AppManager, enableCursor: boolean, applianceIcons?: ApplianceIcons);
|
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");
|
28
32
|
private onCursorMove;
|
29
33
|
private initCursorInstance;
|
34
|
+
private enableCustomCursor;
|
30
35
|
private canMoveCursor;
|
31
36
|
setupWrapper(wrapper: HTMLElement): void;
|
32
37
|
setMainViewDivElement(div: HTMLDivElement): void;
|
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,6 +94,7 @@ 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;
|
@@ -210,6 +219,8 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
210
219
|
get focusedView(): View | undefined;
|
211
220
|
get polling(): boolean;
|
212
221
|
set polling(b: boolean);
|
222
|
+
get cursorStyle(): "default" | "custom";
|
223
|
+
set cursorStyle(value: "default" | "custom");
|
213
224
|
get mainViewSceneIndex(): number;
|
214
225
|
get mainViewSceneDir(): string;
|
215
226
|
get topApp(): string | undefined;
|