@netless/window-manager 1.0.0-canary.76 → 1.0.0-canary.77
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/App/AppContext.d.ts +1 -1
- package/dist/App/AppPageStateImpl.d.ts +1 -1
- package/dist/App/AppProxy.d.ts +1 -1
- package/dist/App/MagixEvent/index.d.ts +7 -7
- package/dist/App/WhiteboardView.d.ts +2 -2
- package/dist/App/type.d.ts +1 -1
- package/dist/AttributesDelegate.d.ts +7 -7
- package/dist/BoxEmitter.d.ts +7 -7
- package/dist/BoxManager.d.ts +8 -8
- package/dist/Cursor/Cursor.d.ts +1 -1
- package/dist/Cursor/Cursor.svelte.d.ts +1 -0
- package/dist/Cursor/index.d.ts +2 -2
- package/dist/Helper.d.ts +1 -1
- package/dist/InternalEmitter.d.ts +3 -3
- package/dist/Page/PageController.d.ts +2 -2
- package/dist/ReconnectRefresher.d.ts +1 -1
- package/dist/RedoUndo.d.ts +1 -1
- package/dist/Register/index.d.ts +3 -3
- package/dist/Register/storage.d.ts +1 -1
- package/dist/Utils/AppCreateQueue.d.ts +1 -1
- package/dist/View/CameraSynchronizer.d.ts +1 -1
- package/dist/View/ScrollMode.d.ts +1 -1
- package/dist/View/ViewSync.d.ts +1 -1
- package/dist/callback.d.ts +2 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +663 -291
- package/dist/index.mjs +659 -291
- package/dist/index.umd.js +661 -293
- package/dist/storage.d.ts +2 -2
- package/dist/typings.d.ts +9 -9
- package/package.json +26 -26
- package/src/Helper.ts +10 -2
- package/dist/image.d.ts +0 -19
- package/dist/shim.d.ts +0 -5
package/dist/App/AppContext.d.ts
CHANGED
@@ -8,7 +8,7 @@ import type { AppManager } from "../AppManager";
|
|
8
8
|
import type { AppProxy } from "./AppProxy";
|
9
9
|
import type { MagixEventAddListener, MagixEventDispatcher, MagixEventRemoveListener } from "./MagixEvent";
|
10
10
|
import { WhiteBoardView } from "./WhiteboardView";
|
11
|
-
export
|
11
|
+
export type CreateWhiteBoardViewParams = {
|
12
12
|
size?: number;
|
13
13
|
syncCamera?: boolean;
|
14
14
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Displayer, ScenesCallbacksNode, View } from "white-web-sdk";
|
2
2
|
import type { PageState } from "../Page";
|
3
|
-
export
|
3
|
+
export type AppPageStateParams = {
|
4
4
|
displayer: Displayer;
|
5
5
|
scenePath: string | undefined;
|
6
6
|
view: View | undefined;
|
package/dist/App/AppProxy.d.ts
CHANGED
@@ -11,7 +11,7 @@ import type { NetlessApp } from "../typings";
|
|
11
11
|
import type { ReadonlyTeleBox } from "@netless/telebox-insider";
|
12
12
|
import type { PageRemoveService, PageState } from "../Page";
|
13
13
|
import type { AppState } from "./type";
|
14
|
-
export
|
14
|
+
export type AppEmitter = Emittery<AppEmitterEvent>;
|
15
15
|
export declare class AppProxy implements PageRemoveService {
|
16
16
|
private params;
|
17
17
|
private manager;
|
@@ -20,10 +20,10 @@ export interface MagixEventMessage<TPayloads = any, TEvent extends MagixEventTyp
|
|
20
20
|
scope: `${WhiteScope}`;
|
21
21
|
phase: `${WhiteEventPhase}`;
|
22
22
|
}
|
23
|
-
export
|
24
|
-
export
|
25
|
-
export
|
26
|
-
export
|
27
|
-
export
|
28
|
-
export
|
29
|
-
export
|
23
|
+
export type MagixEventTypes<TPayloads = any> = Extract<keyof TPayloads, string>;
|
24
|
+
export type MagixEventPayload<TPayloads = any, TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>> = TPayloads[TEvent];
|
25
|
+
export type MagixEventDispatcher<TPayloads = any> = <TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>>(event: TEvent, payload: TPayloads[TEvent]) => void;
|
26
|
+
export type MagixEventHandler<TPayloads = any, TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>> = (message: MagixEventMessage<TPayloads, TEvent>) => void;
|
27
|
+
export type MagixEventListenerDisposer = () => void;
|
28
|
+
export type MagixEventAddListener<TPayloads = any> = <TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>>(event: TEvent, handler: MagixEventHandler<TPayloads, TEvent>, options?: MagixEventListenerOptions | undefined) => MagixEventListenerDisposer;
|
29
|
+
export type MagixEventRemoveListener<TPayloads = any> = <TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>>(event: TEvent, handler?: MagixEventHandler<TPayloads, TEvent>) => void;
|
@@ -5,8 +5,8 @@ import type { AppContext } from "./AppContext";
|
|
5
5
|
import type { View } from "white-web-sdk";
|
6
6
|
import type { TeleBoxRect } from "@netless/telebox-insider";
|
7
7
|
import type { ICamera, ISize } from "../AttributesDelegate";
|
8
|
-
export
|
9
|
-
export
|
8
|
+
export type WhiteBoardViewCamera = Omit<ICamera, "id">;
|
9
|
+
export type WhiteBoardViewRect = Omit<ISize, "id">;
|
10
10
|
export declare class WhiteBoardView implements PageController {
|
11
11
|
view: View;
|
12
12
|
protected appContext: AppContext;
|
package/dist/App/type.d.ts
CHANGED
@@ -18,28 +18,28 @@ export declare enum Fields {
|
|
18
18
|
Camera = "camera",
|
19
19
|
Size = "size"
|
20
20
|
}
|
21
|
-
export
|
21
|
+
export type Apps = {
|
22
22
|
[key: string]: AppSyncAttributes;
|
23
23
|
};
|
24
|
-
export
|
24
|
+
export type Position = {
|
25
25
|
x: number;
|
26
26
|
y: number;
|
27
27
|
type: PositionType;
|
28
28
|
id?: string;
|
29
29
|
};
|
30
|
-
export
|
31
|
-
export
|
30
|
+
export type PositionType = "main" | "app";
|
31
|
+
export type StoreContext = {
|
32
32
|
getAttributes: () => any;
|
33
33
|
safeUpdateAttributes: (keys: string[], value: any) => void;
|
34
34
|
safeSetAttributes: (attributes: any) => void;
|
35
35
|
};
|
36
|
-
export
|
36
|
+
export type ICamera = {
|
37
37
|
id: string;
|
38
38
|
centerX: number | null;
|
39
39
|
centerY: number | null;
|
40
40
|
scale: number;
|
41
41
|
};
|
42
|
-
export
|
42
|
+
export type ISize = Size & {
|
43
43
|
id: string;
|
44
44
|
};
|
45
45
|
export declare class AttributesDelegate {
|
@@ -77,7 +77,7 @@ export declare class AttributesDelegate {
|
|
77
77
|
cleanCursor(uid: string): void;
|
78
78
|
setMainViewFocusPath(mainView: View): void;
|
79
79
|
}
|
80
|
-
export
|
80
|
+
export type Cursors = {
|
81
81
|
[key: string]: Cursor;
|
82
82
|
};
|
83
83
|
export declare const store: AttributesDelegate;
|
package/dist/BoxEmitter.d.ts
CHANGED
@@ -1,34 +1,34 @@
|
|
1
1
|
import type { TELE_BOX_STATE } from "@netless/telebox-insider";
|
2
2
|
import Emittery from "emittery";
|
3
|
-
export
|
3
|
+
export type BoxMovePayload = {
|
4
4
|
appId: string;
|
5
5
|
x: number;
|
6
6
|
y: number;
|
7
7
|
};
|
8
|
-
export
|
8
|
+
export type BoxFocusPayload = {
|
9
9
|
appId: string;
|
10
10
|
};
|
11
|
-
export
|
11
|
+
export type BoxResizePayload = {
|
12
12
|
appId: string;
|
13
13
|
width: number;
|
14
14
|
height: number;
|
15
15
|
x?: number;
|
16
16
|
y?: number;
|
17
17
|
};
|
18
|
-
export
|
18
|
+
export type BoxClosePayload = {
|
19
19
|
appId: string;
|
20
20
|
error?: Error;
|
21
21
|
};
|
22
|
-
export
|
22
|
+
export type BoxStateChangePayload = {
|
23
23
|
appId: string;
|
24
24
|
state: TELE_BOX_STATE;
|
25
25
|
};
|
26
|
-
export
|
26
|
+
export type BoxEvent = {
|
27
27
|
move: BoxMovePayload;
|
28
28
|
focus: BoxFocusPayload;
|
29
29
|
resize: BoxResizePayload;
|
30
30
|
close: BoxClosePayload;
|
31
31
|
boxStateChange: BoxStateChangePayload;
|
32
32
|
};
|
33
|
-
export
|
33
|
+
export type BoxEmitterType = Emittery<BoxEvent>;
|
34
34
|
export declare const boxEmitter: BoxEmitterType;
|
package/dist/BoxManager.d.ts
CHANGED
@@ -13,7 +13,7 @@ import type { EmitterType } from "./InternalEmitter";
|
|
13
13
|
import type { AppState } from "./App/type";
|
14
14
|
import { ReadonlyVal } from "value-enhancer";
|
15
15
|
export { TELE_BOX_STATE };
|
16
|
-
export
|
16
|
+
export type CreateBoxParams = {
|
17
17
|
appId: string;
|
18
18
|
app: NetlessApp;
|
19
19
|
view?: View;
|
@@ -22,26 +22,26 @@ export declare type CreateBoxParams = {
|
|
22
22
|
canOperate?: boolean;
|
23
23
|
smartPosition?: boolean;
|
24
24
|
};
|
25
|
-
|
25
|
+
type AppId = {
|
26
26
|
appId: string;
|
27
27
|
};
|
28
|
-
|
28
|
+
type MoveBoxParams = AppId & {
|
29
29
|
x: number;
|
30
30
|
y: number;
|
31
31
|
};
|
32
|
-
|
32
|
+
type ResizeBoxParams = AppId & {
|
33
33
|
width: number;
|
34
34
|
height: number;
|
35
35
|
skipUpdate: boolean;
|
36
36
|
};
|
37
|
-
|
37
|
+
type SetBoxMinSizeParams = AppId & {
|
38
38
|
minWidth: number;
|
39
39
|
minHeight: number;
|
40
40
|
};
|
41
|
-
|
41
|
+
type SetBoxTitleParams = AppId & {
|
42
42
|
title: string;
|
43
43
|
};
|
44
|
-
export
|
44
|
+
export type CreateTeleBoxManagerConfig = {
|
45
45
|
collectorContainer?: HTMLElement;
|
46
46
|
collectorStyles?: Partial<CSSStyleDeclaration>;
|
47
47
|
prefersColorScheme?: TeleBoxColorScheme;
|
@@ -53,7 +53,7 @@ export declare type CreateTeleBoxManagerConfig = {
|
|
53
53
|
defaultBoxStageStyle?: string | null;
|
54
54
|
theme?: TeleBoxManagerThemeConfig;
|
55
55
|
};
|
56
|
-
export
|
56
|
+
export type BoxManagerContext = {
|
57
57
|
safeSetAttributes: (attributes: any) => void;
|
58
58
|
updateAppState: (appId: string, field: AppAttributes, value: any) => void;
|
59
59
|
emitter: EmitterType;
|
package/dist/Cursor/Cursor.d.ts
CHANGED
@@ -3,7 +3,7 @@ import type { Position } from "../AttributesDelegate";
|
|
3
3
|
import type { RoomMember } from "white-web-sdk";
|
4
4
|
import type { CursorManager } from "./index";
|
5
5
|
import type { AppManager } from "../AppManager";
|
6
|
-
export
|
6
|
+
export type Payload = {
|
7
7
|
[key: string]: any;
|
8
8
|
};
|
9
9
|
export declare class Cursor {
|
@@ -0,0 +1 @@
|
|
1
|
+
export { SvelteComponentTyped as default } from 'svelte/internal';
|
package/dist/Cursor/index.d.ts
CHANGED
@@ -4,11 +4,11 @@ import type { PositionType } from "../AttributesDelegate";
|
|
4
4
|
import type { RoomMember, View } from "white-web-sdk";
|
5
5
|
import type { AppManager } from "../AppManager";
|
6
6
|
import { Val } from "value-enhancer";
|
7
|
-
export
|
7
|
+
export type EventType = {
|
8
8
|
type: PositionType;
|
9
9
|
id?: string;
|
10
10
|
};
|
11
|
-
export
|
11
|
+
export type MoveCursorParams = {
|
12
12
|
uid: string;
|
13
13
|
x: number;
|
14
14
|
y: number;
|
package/dist/Helper.d.ts
CHANGED
@@ -6,7 +6,7 @@ export declare const setupWrapper: (root: HTMLElement, target: HTMLElement) => {
|
|
6
6
|
};
|
7
7
|
export declare const checkVersion: () => void;
|
8
8
|
export declare const findMemberByUid: (room: Room | undefined, uid: string) => RoomMember | undefined;
|
9
|
-
export
|
9
|
+
export type Member = RoomMember & {
|
10
10
|
uid: string;
|
11
11
|
};
|
12
12
|
export declare const serializeRoomMembers: (members: readonly RoomMember[]) => any[];
|
@@ -2,11 +2,11 @@ import Emittery from "emittery";
|
|
2
2
|
import type { TeleBoxRect } from "@netless/telebox-insider";
|
3
3
|
import type { CursorMovePayload } from "./index";
|
4
4
|
import type { MemberState } from "white-web-sdk";
|
5
|
-
export
|
5
|
+
export type RemoveSceneParams = {
|
6
6
|
scenePath: string;
|
7
7
|
index?: number;
|
8
8
|
};
|
9
|
-
export
|
9
|
+
export type EmitterEvent = {
|
10
10
|
onCreated: undefined;
|
11
11
|
error: Error;
|
12
12
|
seekStart: undefined;
|
@@ -32,5 +32,5 @@ export declare type EmitterEvent = {
|
|
32
32
|
containerSizeRatioUpdate: number;
|
33
33
|
memberStateChange: MemberState;
|
34
34
|
};
|
35
|
-
export
|
35
|
+
export type EmitterType = Emittery<EmitterEvent>;
|
36
36
|
export declare const emitter: EmitterType;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { SceneDefinition } from "white-web-sdk";
|
2
|
-
export
|
2
|
+
export type AddPageParams = {
|
3
3
|
after?: boolean;
|
4
4
|
scene?: SceneDefinition | SceneDefinition[];
|
5
5
|
};
|
6
|
-
export
|
6
|
+
export type PageState = {
|
7
7
|
index: number;
|
8
8
|
length: number;
|
9
9
|
pages: string[];
|
package/dist/RedoUndo.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { View } from "white-web-sdk";
|
2
2
|
import type { AppProxy } from "./App";
|
3
|
-
export
|
3
|
+
export type RedoUndoContext = {
|
4
4
|
mainView: () => View;
|
5
5
|
focus: () => string | undefined;
|
6
6
|
getAppProxy: (id: string) => AppProxy | undefined;
|
package/dist/Register/index.d.ts
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
import Emittery from "emittery";
|
2
2
|
import type { NetlessApp, RegisterEvents, RegisterParams } from "../typings";
|
3
|
-
export
|
3
|
+
export type LoadAppEvent = {
|
4
4
|
kind: string;
|
5
5
|
status: "start" | "success" | "failed";
|
6
6
|
reason?: string;
|
7
7
|
};
|
8
|
-
export
|
8
|
+
export type SyncRegisterAppPayload = {
|
9
9
|
kind: string;
|
10
10
|
src: string;
|
11
11
|
name: string | undefined;
|
12
12
|
};
|
13
|
-
export
|
13
|
+
export type SyncRegisterApp = (payload: SyncRegisterAppPayload) => void;
|
14
14
|
export declare class AppRegister {
|
15
15
|
kindEmitters: Map<string, Emittery<RegisterEvents>>;
|
16
16
|
registered: Map<string, RegisterParams>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { TeleBoxRect } from "@netless/telebox-insider";
|
2
2
|
import type { View } from "white-web-sdk";
|
3
3
|
import type { ICamera, ISize } from "../AttributesDelegate";
|
4
|
-
export
|
4
|
+
export type SaveCamera = (camera: ICamera) => void;
|
5
5
|
export declare class CameraSynchronizer {
|
6
6
|
protected saveCamera: SaveCamera;
|
7
7
|
remoteCamera?: ICamera;
|
@@ -3,7 +3,7 @@ import type { ReadonlyVal } from "value-enhancer";
|
|
3
3
|
import type { AppManager } from "../AppManager";
|
4
4
|
import type { ScrollStorage } from "../storage";
|
5
5
|
import type { View } from "white-web-sdk";
|
6
|
-
export
|
6
|
+
export type ScrollState = {
|
7
7
|
scrollTop: number;
|
8
8
|
page: number;
|
9
9
|
maxScrollPage: number;
|
package/dist/View/ViewSync.d.ts
CHANGED
@@ -4,7 +4,7 @@ import type { ReadonlyVal } from "value-enhancer";
|
|
4
4
|
import type { ICamera, ISize } from "../AttributesDelegate";
|
5
5
|
import type { TeleBoxRect } from "@netless/telebox-insider";
|
6
6
|
import type { ManagerViewMode } from "../typings";
|
7
|
-
export
|
7
|
+
export type ViewSyncContext = {
|
8
8
|
uid: string;
|
9
9
|
camera$: Val<ICamera | undefined, boolean>;
|
10
10
|
size$: Val<ISize | undefined>;
|
package/dist/callback.d.ts
CHANGED
@@ -5,7 +5,7 @@ import type { LoadAppEvent } from "./Register";
|
|
5
5
|
import type { PageState } from "./Page";
|
6
6
|
import type { ISize } from "./AttributesDelegate";
|
7
7
|
import type { ScrollState } from "./View/ScrollMode";
|
8
|
-
export
|
8
|
+
export type PublicEvent = {
|
9
9
|
mainViewModeChange: ViewVisionMode;
|
10
10
|
boxStateChange: `${TELE_BOX_STATE}`;
|
11
11
|
darkModeChange: boolean;
|
@@ -31,5 +31,5 @@ export declare type PublicEvent = {
|
|
31
31
|
userScroll: undefined;
|
32
32
|
scrollStateChange: ScrollState;
|
33
33
|
};
|
34
|
-
export
|
34
|
+
export type CallbacksType = Emittery<PublicEvent>;
|
35
35
|
export declare const callbacks: CallbacksType;
|
package/dist/index.d.ts
CHANGED
@@ -14,7 +14,7 @@ import type { PublicEvent } from "./callback";
|
|
14
14
|
import type Emittery from "emittery";
|
15
15
|
import type { PageController, AddPageParams, PageState } from "./Page";
|
16
16
|
import type { ScrollState } from "./View/ScrollMode";
|
17
|
-
export
|
17
|
+
export type WindowMangerAttributes = {
|
18
18
|
modelValue?: string;
|
19
19
|
boxState: TELE_BOX_STATE;
|
20
20
|
maximized?: boolean;
|
@@ -22,31 +22,31 @@ export declare type WindowMangerAttributes = {
|
|
22
22
|
scrollTop?: number;
|
23
23
|
[key: string]: any;
|
24
24
|
};
|
25
|
-
export
|
25
|
+
export type apps = {
|
26
26
|
[key: string]: NetlessApp;
|
27
27
|
};
|
28
|
-
export
|
28
|
+
export type AddAppOptions = {
|
29
29
|
scenePath?: string;
|
30
30
|
title?: string;
|
31
31
|
scenes?: SceneDefinition[];
|
32
32
|
};
|
33
|
-
export
|
33
|
+
export type setAppOptions = AddAppOptions & {
|
34
34
|
appOptions?: any;
|
35
35
|
};
|
36
|
-
export
|
36
|
+
export type AddAppParams<TAttributes = any> = {
|
37
37
|
kind: string;
|
38
38
|
src?: string;
|
39
39
|
options?: AddAppOptions;
|
40
40
|
attributes?: TAttributes;
|
41
41
|
};
|
42
|
-
export
|
42
|
+
export type BaseInsertParams = {
|
43
43
|
kind: string;
|
44
44
|
src?: string;
|
45
45
|
options?: AddAppOptions;
|
46
46
|
attributes?: any;
|
47
47
|
isDynamicPPT?: boolean;
|
48
48
|
};
|
49
|
-
export
|
49
|
+
export type AppSyncAttributes = {
|
50
50
|
kind: string;
|
51
51
|
src?: string;
|
52
52
|
options: any;
|
@@ -58,7 +58,7 @@ export declare type AppSyncAttributes = {
|
|
58
58
|
size?: ISize;
|
59
59
|
setup: boolean;
|
60
60
|
};
|
61
|
-
export
|
61
|
+
export type AppInitState = {
|
62
62
|
id: string;
|
63
63
|
x?: number;
|
64
64
|
y?: number;
|
@@ -76,12 +76,12 @@ export declare type AppInitState = {
|
|
76
76
|
draggable?: boolean;
|
77
77
|
ratio?: number;
|
78
78
|
};
|
79
|
-
export
|
79
|
+
export type CursorMovePayload = {
|
80
80
|
uid: string;
|
81
81
|
state?: "leave";
|
82
82
|
position: Position;
|
83
83
|
};
|
84
|
-
export
|
84
|
+
export type MountParams = {
|
85
85
|
room: Room | Player;
|
86
86
|
container?: HTMLElement;
|
87
87
|
/** 白板高宽比例, 默认为 9 / 16 */
|
@@ -139,7 +139,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
139
139
|
static mount(params: MountParams): Promise<WindowManager>;
|
140
140
|
private static initManager;
|
141
141
|
private static initContainer;
|
142
|
-
static get registered(): Map<string, RegisterParams
|
142
|
+
static get registered(): Map<string, RegisterParams>;
|
143
143
|
bindContainer(container: HTMLElement): void;
|
144
144
|
bindCollectorContainer(container: HTMLElement): void;
|
145
145
|
/**
|