@netless/window-manager 1.0.7-beta.1 → 1.0.7-beta.3
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/index.d.ts +220 -159
- package/dist/index.js +14 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8319 -6807
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/App/AppContext.ts +17 -1
- package/src/App/AppProxy.ts +25 -6
- package/src/App/Storage/index.ts +1 -0
- package/src/AppManager.ts +52 -5
- package/src/AttributesDelegate.ts +72 -11
- package/src/BoxEmitter.ts +2 -0
- package/src/BoxManager.ts +61 -1
- package/src/Utils/extendClass.ts +49 -0
- package/src/callback.ts +2 -0
- package/src/index.ts +66 -10
- package/src/shim.d.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as lodash from 'lodash';
|
|
2
2
|
import * as white_web_sdk from 'white-web-sdk';
|
|
3
|
-
import {
|
|
3
|
+
import { SceneDefinition, SceneState, DisplayerState, View, ApplianceNames, ViewVisionMode, CameraState, Event as Event$1, Scope, EventPhase, MagixEventListenerOptions as MagixEventListenerOptions$1, toJS, listenUpdated, unlistenUpdated, listenDisposed, unlistenDisposed, Room, RoomMember, Camera, Size, ViewMode, Displayer, MemberState, AnimationMode, InvisiblePlugin, InvisiblePluginContext, Player, Rectangle, Point, CameraBound, ImageInformation } from 'white-web-sdk';
|
|
4
4
|
export { AnimationMode, Displayer, Player, Room, SceneDefinition, SceneState, View } from 'white-web-sdk';
|
|
5
|
-
import
|
|
6
|
-
import { TELE_BOX_STATE, TeleBoxRect, TeleBoxColorScheme, TeleBoxManager, ReadonlyTeleBox, TeleBoxManagerUpdateConfig, TeleBoxConfig, TeleBoxState } from '@netless/telebox-insider';
|
|
5
|
+
import { TELE_BOX_STATE, TeleBoxRect, TeleBoxColorScheme, TeleBoxManager, TeleBoxState, NotMinimizedBoxState, ReadonlyTeleBox, TeleBoxManagerUpdateConfig, TeleBoxConfig } from '@netless/telebox-insider';
|
|
7
6
|
export { ReadonlyTeleBox, TeleBoxRect } from '@netless/telebox-insider';
|
|
7
|
+
import Emittery from 'emittery';
|
|
8
8
|
|
|
9
9
|
declare enum Events {
|
|
10
10
|
AppMove = "AppMove",
|
|
@@ -36,153 +36,6 @@ declare enum AppStatus {
|
|
|
36
36
|
StartCreate = "StartCreate"
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
declare class CursorManager {
|
|
40
|
-
private manager;
|
|
41
|
-
private enableCursor;
|
|
42
|
-
containerRect?: DOMRect;
|
|
43
|
-
wrapperRect?: DOMRect;
|
|
44
|
-
cursorInstances: Map<string, Cursor>;
|
|
45
|
-
roomMembers?: readonly RoomMember[];
|
|
46
|
-
userApplianceIcons: ApplianceIcons;
|
|
47
|
-
private mainViewElement?;
|
|
48
|
-
private sideEffectManager;
|
|
49
|
-
private store;
|
|
50
|
-
private leaveFlag;
|
|
51
|
-
private _style;
|
|
52
|
-
constructor(manager: AppManager, enableCursor: boolean, cursorOptions?: CursorOptions, applianceIcons?: ApplianceIcons);
|
|
53
|
-
get applianceIcons(): ApplianceIcons;
|
|
54
|
-
get style(): "default" | "custom";
|
|
55
|
-
set style(value: "default" | "custom");
|
|
56
|
-
private onCursorMove;
|
|
57
|
-
private initCursorInstance;
|
|
58
|
-
private enableCustomCursor;
|
|
59
|
-
private canMoveCursor;
|
|
60
|
-
setupWrapper(wrapper: HTMLElement): void;
|
|
61
|
-
setMainViewDivElement(div: HTMLDivElement): void;
|
|
62
|
-
get boxState(): any;
|
|
63
|
-
get focusView(): View | undefined;
|
|
64
|
-
private mouseMoveListener_;
|
|
65
|
-
private mouseMoveTimer;
|
|
66
|
-
private mouseMoveListener;
|
|
67
|
-
private mouseLeaveListener;
|
|
68
|
-
private showPencilEraserIfNeeded;
|
|
69
|
-
private updateCursor;
|
|
70
|
-
private getPoint;
|
|
71
|
-
/**
|
|
72
|
-
* 因为窗口内框在不同分辨率下的大小不一样,所以这里通过来鼠标事件的 target 来判断是在主白板还是在 APP 中
|
|
73
|
-
*/
|
|
74
|
-
private getType;
|
|
75
|
-
updateContainerRect(): void;
|
|
76
|
-
deleteCursor(uid: string): void;
|
|
77
|
-
hideCursor(uid: string): void;
|
|
78
|
-
destroy(): void;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
declare class Cursor {
|
|
82
|
-
private manager;
|
|
83
|
-
private memberId;
|
|
84
|
-
private cursorManager;
|
|
85
|
-
private wrapper?;
|
|
86
|
-
private member?;
|
|
87
|
-
private timer?;
|
|
88
|
-
private component?;
|
|
89
|
-
private style;
|
|
90
|
-
constructor(manager: AppManager, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
|
91
|
-
move: (position: Position) => void;
|
|
92
|
-
setStyle: (style: typeof this.style) => void;
|
|
93
|
-
leave: () => void;
|
|
94
|
-
private moveCursor;
|
|
95
|
-
get memberApplianceName(): ApplianceNames | undefined;
|
|
96
|
-
get memberColor(): string;
|
|
97
|
-
get memberColorHex(): string;
|
|
98
|
-
private get payload();
|
|
99
|
-
get memberCursorName(): any;
|
|
100
|
-
private get memberTheme();
|
|
101
|
-
private get memberCursorTextColor();
|
|
102
|
-
private get memberCursorTagBackgroundColor();
|
|
103
|
-
private get memberAvatar();
|
|
104
|
-
private get memberOpacity();
|
|
105
|
-
private get memberTagName();
|
|
106
|
-
private autoHidden;
|
|
107
|
-
private createCursor;
|
|
108
|
-
private initProps;
|
|
109
|
-
private getIcon;
|
|
110
|
-
private isCustomIcon;
|
|
111
|
-
updateMember(): RoomMember | undefined;
|
|
112
|
-
private updateComponent;
|
|
113
|
-
destroy(): void;
|
|
114
|
-
hide(): void;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
type Apps = {
|
|
118
|
-
[key: string]: AppSyncAttributes;
|
|
119
|
-
};
|
|
120
|
-
type Position = {
|
|
121
|
-
x: number;
|
|
122
|
-
y: number;
|
|
123
|
-
type: PositionType;
|
|
124
|
-
id?: string;
|
|
125
|
-
};
|
|
126
|
-
type PositionType = "main" | "app";
|
|
127
|
-
type StoreContext = {
|
|
128
|
-
getAttributes: () => any;
|
|
129
|
-
safeUpdateAttributes: (keys: string[], value: any) => void;
|
|
130
|
-
safeSetAttributes: (attributes: any) => void;
|
|
131
|
-
};
|
|
132
|
-
type ICamera = Camera & {
|
|
133
|
-
id: string;
|
|
134
|
-
};
|
|
135
|
-
type ISize = Size & {
|
|
136
|
-
id: string;
|
|
137
|
-
};
|
|
138
|
-
declare class AttributesDelegate {
|
|
139
|
-
private context;
|
|
140
|
-
constructor(context: StoreContext);
|
|
141
|
-
setContext(context: StoreContext): void;
|
|
142
|
-
get attributes(): any;
|
|
143
|
-
apps(): Apps;
|
|
144
|
-
get focus(): string | undefined;
|
|
145
|
-
getAppAttributes(id: string): AppSyncAttributes;
|
|
146
|
-
getAppState(id: string): any;
|
|
147
|
-
getMaximized(): any;
|
|
148
|
-
getMinimized(): any;
|
|
149
|
-
setupAppAttributes(params: AddAppParams, id: string, isDynamicPPT: boolean): void;
|
|
150
|
-
updateAppState(appId: string, stateName: AppAttributes, state: any): void;
|
|
151
|
-
cleanAppAttributes(id: string): void;
|
|
152
|
-
cleanFocus(): void;
|
|
153
|
-
getAppSceneIndex(id: string): any;
|
|
154
|
-
getAppScenePath(id: string): any;
|
|
155
|
-
getMainViewScenePath(): string | undefined;
|
|
156
|
-
getMainViewSceneIndex(): any;
|
|
157
|
-
getBoxState(): any;
|
|
158
|
-
setMainViewScenePath(scenePath: string): void;
|
|
159
|
-
setMainViewSceneIndex(index: number): void;
|
|
160
|
-
getMainViewCamera(): MainViewCamera;
|
|
161
|
-
getMainViewSize(): MainViewSize;
|
|
162
|
-
setMainViewCamera(camera: ICamera): void;
|
|
163
|
-
setMainViewSize(size: ISize): void;
|
|
164
|
-
setMainViewCameraAndSize(camera: ICamera, size: ISize): void;
|
|
165
|
-
setAppFocus: (appId: string, focus: boolean) => void;
|
|
166
|
-
updateCursor(uid: string, position: Position): void;
|
|
167
|
-
updateCursorState(uid: string, cursorState: string | undefined): void;
|
|
168
|
-
getCursorState(uid: string): any;
|
|
169
|
-
cleanCursor(uid: string): void;
|
|
170
|
-
setMainViewFocusPath(mainView: View): void;
|
|
171
|
-
getIframeBridge(): any;
|
|
172
|
-
setIframeBridge(data: any): void;
|
|
173
|
-
}
|
|
174
|
-
type MainViewSize = {
|
|
175
|
-
id: string;
|
|
176
|
-
width: number;
|
|
177
|
-
height: number;
|
|
178
|
-
};
|
|
179
|
-
type MainViewCamera = {
|
|
180
|
-
id: string;
|
|
181
|
-
centerX: number;
|
|
182
|
-
centerY: number;
|
|
183
|
-
scale: number;
|
|
184
|
-
};
|
|
185
|
-
|
|
186
39
|
type StorageEventListener<T> = (event: T) => void;
|
|
187
40
|
declare class StorageEvent<TMessage> {
|
|
188
41
|
listeners: Set<StorageEventListener<TMessage>>;
|
|
@@ -205,6 +58,7 @@ type StorageStateChangedListenerDisposer = () => void;
|
|
|
205
58
|
|
|
206
59
|
declare class Storage<TState extends Record<string, any> = any> implements Storage<TState> {
|
|
207
60
|
readonly id: string | null;
|
|
61
|
+
readonly maxIllusionQueueSize = 500;
|
|
208
62
|
private readonly _context;
|
|
209
63
|
private readonly _sideEffect;
|
|
210
64
|
private _state;
|
|
@@ -246,6 +100,9 @@ type BoxMovePayload = {
|
|
|
246
100
|
type BoxFocusPayload = {
|
|
247
101
|
appId: string;
|
|
248
102
|
};
|
|
103
|
+
type BoxBlurredPayload = {
|
|
104
|
+
appId: string;
|
|
105
|
+
};
|
|
249
106
|
type BoxResizePayload = {
|
|
250
107
|
appId: string;
|
|
251
108
|
width: number;
|
|
@@ -267,6 +124,7 @@ type BoxEvent = {
|
|
|
267
124
|
resize: BoxResizePayload;
|
|
268
125
|
close: BoxClosePayload;
|
|
269
126
|
boxStateChange: BoxStateChangePayload;
|
|
127
|
+
blurred: BoxBlurredPayload;
|
|
270
128
|
};
|
|
271
129
|
type BoxEmitterType = Emittery<BoxEvent>;
|
|
272
130
|
|
|
@@ -423,6 +281,7 @@ type PublicEvent = {
|
|
|
423
281
|
onBoxMove: BoxMovePayload;
|
|
424
282
|
onBoxResize: BoxResizePayload;
|
|
425
283
|
onBoxFocus: BoxFocusPayload;
|
|
284
|
+
onBoxBlurred: BoxBlurredPayload;
|
|
426
285
|
onBoxClose: BoxClosePayload;
|
|
427
286
|
onBoxStateChange: BoxStateChangePayload;
|
|
428
287
|
onMainViewMounted: View;
|
|
@@ -473,6 +332,7 @@ type CreateBoxParams = {
|
|
|
473
332
|
options?: AddAppOptions;
|
|
474
333
|
canOperate?: boolean;
|
|
475
334
|
smartPosition?: boolean;
|
|
335
|
+
boxStatus?: TeleBoxState;
|
|
476
336
|
};
|
|
477
337
|
type AppId = {
|
|
478
338
|
appId: string;
|
|
@@ -497,11 +357,14 @@ type CreateTeleBoxManagerConfig = {
|
|
|
497
357
|
collectorContainer?: HTMLElement;
|
|
498
358
|
collectorStyles?: Partial<CSSStyleDeclaration>;
|
|
499
359
|
prefersColorScheme?: TeleBoxColorScheme;
|
|
360
|
+
useBoxesStatus?: boolean;
|
|
500
361
|
};
|
|
501
362
|
type BoxManagerContext = {
|
|
502
363
|
safeSetAttributes: (attributes: any) => void;
|
|
503
364
|
getMainView: () => View;
|
|
504
365
|
updateAppState: (appId: string, field: AppAttributes, value: any) => void;
|
|
366
|
+
setBoxStatus: (appId: string, status?: TeleBoxState) => void;
|
|
367
|
+
setLastNotMinimizedBoxStatus: (appId: string, status?: NotMinimizedBoxState) => void;
|
|
505
368
|
emitter: EmitterType;
|
|
506
369
|
boxEmitter: BoxEmitterType;
|
|
507
370
|
callbacks: CallbacksType;
|
|
@@ -517,7 +380,7 @@ declare class BoxManager {
|
|
|
517
380
|
constructor(context: BoxManagerContext, createTeleBoxManagerConfig?: CreateTeleBoxManagerConfig | undefined);
|
|
518
381
|
private get mainView();
|
|
519
382
|
private get canOperate();
|
|
520
|
-
get boxState(): "
|
|
383
|
+
get boxState(): "normal" | "minimized" | "maximized";
|
|
521
384
|
get maximized(): boolean;
|
|
522
385
|
get minimized(): boolean;
|
|
523
386
|
get darkMode(): boolean;
|
|
@@ -525,6 +388,10 @@ declare class BoxManager {
|
|
|
525
388
|
get boxSize(): number;
|
|
526
389
|
createBox(params: CreateBoxParams): void;
|
|
527
390
|
setBoxInitState(appId: string): void;
|
|
391
|
+
setBoxesStatus(status?: Record<string, TeleBoxState>): void;
|
|
392
|
+
setBoxStatus(appId: string, status?: TeleBoxState): void;
|
|
393
|
+
setLastNotMinimizedBoxesStatus(status?: Record<string, NotMinimizedBoxState>): void;
|
|
394
|
+
setLastNotMinimizedBoxStatus(appId: string, status?: NotMinimizedBoxState): void;
|
|
528
395
|
setupBoxManager(createTeleBoxManagerConfig?: CreateTeleBoxManagerConfig): TeleBoxManager;
|
|
529
396
|
setCollectorContainer(container: HTMLElement): void;
|
|
530
397
|
getBox(appId: string): ReadonlyTeleBox | undefined;
|
|
@@ -587,8 +454,8 @@ declare class AppContext<TAttributes extends {} = any, TMagixEventPayloads = any
|
|
|
587
454
|
private appOptions?;
|
|
588
455
|
readonly emitter: Emittery<AppEmitterEvent<TAttributes>>;
|
|
589
456
|
readonly mobxUtils: {
|
|
590
|
-
autorun:
|
|
591
|
-
reaction:
|
|
457
|
+
autorun: any;
|
|
458
|
+
reaction: any;
|
|
592
459
|
toJS: typeof toJS;
|
|
593
460
|
};
|
|
594
461
|
readonly objectUtils: {
|
|
@@ -600,8 +467,12 @@ declare class AppContext<TAttributes extends {} = any, TMagixEventPayloads = any
|
|
|
600
467
|
private store;
|
|
601
468
|
readonly isAddApp: boolean;
|
|
602
469
|
readonly isReplay: boolean;
|
|
603
|
-
constructor(manager: AppManager, boxManager: BoxManager, appId: string, appProxy: AppProxy, appOptions?: TAppOptions | (() => TAppOptions) | undefined);
|
|
470
|
+
constructor(manager: AppManager, boxManager: BoxManager, appId: string, appProxy: AppProxy, appOptions?: (TAppOptions | (() => TAppOptions)) | undefined);
|
|
471
|
+
getManager: () => AppManager;
|
|
472
|
+
getBoxManager: () => BoxManager;
|
|
473
|
+
getWindowManager: () => WindowManager;
|
|
604
474
|
getDisplayer: () => white_web_sdk.Displayer<white_web_sdk.DisplayerCallbacks>;
|
|
475
|
+
getAppProxy: () => AppProxy;
|
|
605
476
|
/** @deprecated Use context.storage.state instead. */
|
|
606
477
|
getAttributes: () => TAttributes | undefined;
|
|
607
478
|
getScenes: () => SceneDefinition[] | undefined;
|
|
@@ -708,6 +579,168 @@ declare class AppProxy implements PageRemoveService {
|
|
|
708
579
|
close(): Promise<void>;
|
|
709
580
|
}
|
|
710
581
|
|
|
582
|
+
declare class CursorManager {
|
|
583
|
+
private manager;
|
|
584
|
+
private enableCursor;
|
|
585
|
+
containerRect?: DOMRect;
|
|
586
|
+
wrapperRect?: DOMRect;
|
|
587
|
+
cursorInstances: Map<string, Cursor>;
|
|
588
|
+
roomMembers?: readonly RoomMember[];
|
|
589
|
+
userApplianceIcons: ApplianceIcons;
|
|
590
|
+
private mainViewElement?;
|
|
591
|
+
private sideEffectManager;
|
|
592
|
+
private store;
|
|
593
|
+
private leaveFlag;
|
|
594
|
+
private _style;
|
|
595
|
+
constructor(manager: AppManager, enableCursor: boolean, cursorOptions?: CursorOptions, applianceIcons?: ApplianceIcons);
|
|
596
|
+
get applianceIcons(): ApplianceIcons;
|
|
597
|
+
get style(): "default" | "custom";
|
|
598
|
+
set style(value: "default" | "custom");
|
|
599
|
+
private onCursorMove;
|
|
600
|
+
private initCursorInstance;
|
|
601
|
+
private enableCustomCursor;
|
|
602
|
+
private canMoveCursor;
|
|
603
|
+
setupWrapper(wrapper: HTMLElement): void;
|
|
604
|
+
setMainViewDivElement(div: HTMLDivElement): void;
|
|
605
|
+
get boxState(): any;
|
|
606
|
+
get focusView(): View | undefined;
|
|
607
|
+
private mouseMoveListener_;
|
|
608
|
+
private mouseMoveTimer;
|
|
609
|
+
private mouseMoveListener;
|
|
610
|
+
private mouseLeaveListener;
|
|
611
|
+
private showPencilEraserIfNeeded;
|
|
612
|
+
private updateCursor;
|
|
613
|
+
private getPoint;
|
|
614
|
+
/**
|
|
615
|
+
* 因为窗口内框在不同分辨率下的大小不一样,所以这里通过来鼠标事件的 target 来判断是在主白板还是在 APP 中
|
|
616
|
+
*/
|
|
617
|
+
private getType;
|
|
618
|
+
updateContainerRect(): void;
|
|
619
|
+
deleteCursor(uid: string): void;
|
|
620
|
+
hideCursor(uid: string): void;
|
|
621
|
+
destroy(): void;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
declare class Cursor {
|
|
625
|
+
private manager;
|
|
626
|
+
private memberId;
|
|
627
|
+
private cursorManager;
|
|
628
|
+
private wrapper?;
|
|
629
|
+
private member?;
|
|
630
|
+
private timer?;
|
|
631
|
+
private component?;
|
|
632
|
+
private style;
|
|
633
|
+
constructor(manager: AppManager, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
|
634
|
+
move: (position: Position) => void;
|
|
635
|
+
setStyle: (style: typeof this.style) => void;
|
|
636
|
+
leave: () => void;
|
|
637
|
+
private moveCursor;
|
|
638
|
+
get memberApplianceName(): ApplianceNames | undefined;
|
|
639
|
+
get memberColor(): string;
|
|
640
|
+
get memberColorHex(): string;
|
|
641
|
+
private get payload();
|
|
642
|
+
get memberCursorName(): any;
|
|
643
|
+
private get memberTheme();
|
|
644
|
+
private get memberCursorTextColor();
|
|
645
|
+
private get memberCursorTagBackgroundColor();
|
|
646
|
+
private get memberAvatar();
|
|
647
|
+
private get memberOpacity();
|
|
648
|
+
private get memberTagName();
|
|
649
|
+
private autoHidden;
|
|
650
|
+
private createCursor;
|
|
651
|
+
private initProps;
|
|
652
|
+
private getIcon;
|
|
653
|
+
private isCustomIcon;
|
|
654
|
+
updateMember(): RoomMember | undefined;
|
|
655
|
+
private updateComponent;
|
|
656
|
+
destroy(): void;
|
|
657
|
+
hide(): void;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
type ExtendClass$1 = {
|
|
661
|
+
AppManager?: typeof AppManager;
|
|
662
|
+
BoxManager?: typeof BoxManager;
|
|
663
|
+
AttributesDelegate?: typeof AttributesDelegate;
|
|
664
|
+
CursorManager?: typeof CursorManager;
|
|
665
|
+
AppProxy?: typeof AppProxy;
|
|
666
|
+
AppContext?: typeof AppContext;
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
type Apps = {
|
|
670
|
+
[key: string]: AppSyncAttributes;
|
|
671
|
+
};
|
|
672
|
+
type Position = {
|
|
673
|
+
x: number;
|
|
674
|
+
y: number;
|
|
675
|
+
type: PositionType;
|
|
676
|
+
id?: string;
|
|
677
|
+
};
|
|
678
|
+
type PositionType = "main" | "app";
|
|
679
|
+
type StoreContext = {
|
|
680
|
+
getAttributes: () => any;
|
|
681
|
+
safeUpdateAttributes: (keys: string[], value: any) => void;
|
|
682
|
+
safeSetAttributes: (attributes: any) => void;
|
|
683
|
+
};
|
|
684
|
+
type ICamera = Camera & {
|
|
685
|
+
id: string;
|
|
686
|
+
};
|
|
687
|
+
type ISize = Size & {
|
|
688
|
+
id: string;
|
|
689
|
+
};
|
|
690
|
+
declare class AttributesDelegate {
|
|
691
|
+
private context;
|
|
692
|
+
constructor(context: StoreContext);
|
|
693
|
+
setContext(context: StoreContext): void;
|
|
694
|
+
get attributes(): any;
|
|
695
|
+
apps(): Apps;
|
|
696
|
+
get focus(): string | undefined;
|
|
697
|
+
getAppAttributes(id: string): AppSyncAttributes;
|
|
698
|
+
getAppState(id: string): any;
|
|
699
|
+
getMaximized(): any;
|
|
700
|
+
getMinimized(): any;
|
|
701
|
+
getBoxesStatus(): Record<string, TELE_BOX_STATE> | undefined;
|
|
702
|
+
getBoxStatus(id: string): TELE_BOX_STATE | undefined;
|
|
703
|
+
setBoxStatus(id: string, status?: TeleBoxState): void;
|
|
704
|
+
getLastNotMinimizedBoxesStatus(): Record<string, NotMinimizedBoxState> | undefined;
|
|
705
|
+
getLastNotMinimizedBoxStatus(id: string): NotMinimizedBoxState | undefined;
|
|
706
|
+
setLastNotMinimizedBoxStatus(id: string, status?: NotMinimizedBoxState): void;
|
|
707
|
+
setupAppAttributes(params: AddAppParams, id: string, isDynamicPPT: boolean): void;
|
|
708
|
+
updateAppState(appId: string, stateName: AppAttributes, state: any): void;
|
|
709
|
+
cleanAppAttributes(id: string): void;
|
|
710
|
+
cleanFocus(): void;
|
|
711
|
+
getAppSceneIndex(id: string): any;
|
|
712
|
+
getAppScenePath(id: string): any;
|
|
713
|
+
getMainViewScenePath(): string | undefined;
|
|
714
|
+
getMainViewSceneIndex(): any;
|
|
715
|
+
getBoxState(): any;
|
|
716
|
+
setMainViewScenePath(scenePath: string): void;
|
|
717
|
+
setMainViewSceneIndex(index: number): void;
|
|
718
|
+
getMainViewCamera(): MainViewCamera;
|
|
719
|
+
getMainViewSize(): MainViewSize;
|
|
720
|
+
setMainViewCamera(camera: ICamera): void;
|
|
721
|
+
setMainViewSize(size: ISize): void;
|
|
722
|
+
setMainViewCameraAndSize(camera: ICamera, size: ISize): void;
|
|
723
|
+
setAppFocus: (appId: string, focus: boolean) => void;
|
|
724
|
+
updateCursor(uid: string, position: Position): void;
|
|
725
|
+
updateCursorState(uid: string, cursorState: string | undefined): void;
|
|
726
|
+
getCursorState(uid: string): any;
|
|
727
|
+
cleanCursor(uid: string): void;
|
|
728
|
+
setMainViewFocusPath(mainView: View): void;
|
|
729
|
+
getIframeBridge(): any;
|
|
730
|
+
setIframeBridge(data: any): void;
|
|
731
|
+
}
|
|
732
|
+
type MainViewSize = {
|
|
733
|
+
id: string;
|
|
734
|
+
width: number;
|
|
735
|
+
height: number;
|
|
736
|
+
};
|
|
737
|
+
type MainViewCamera = {
|
|
738
|
+
id: string;
|
|
739
|
+
centerX: number;
|
|
740
|
+
centerY: number;
|
|
741
|
+
scale: number;
|
|
742
|
+
};
|
|
743
|
+
|
|
711
744
|
declare class MainViewProxy {
|
|
712
745
|
private manager;
|
|
713
746
|
/** Refresh the view's camera in an interval of 1.5s. */
|
|
@@ -819,6 +852,9 @@ declare class AppManager {
|
|
|
819
852
|
private sideEffectManager;
|
|
820
853
|
sceneState: SceneState | null;
|
|
821
854
|
rootDirRemoving: boolean;
|
|
855
|
+
private _useBoxesStatus;
|
|
856
|
+
get useBoxesStatus(): boolean;
|
|
857
|
+
set useBoxesStatus(value: boolean);
|
|
822
858
|
constructor(windowManger: WindowManager);
|
|
823
859
|
getMemberState(): MemberState;
|
|
824
860
|
private onRemoveScenes;
|
|
@@ -850,8 +886,10 @@ declare class AppManager {
|
|
|
850
886
|
private onBoxMove;
|
|
851
887
|
private onBoxResize;
|
|
852
888
|
private onBoxFocus;
|
|
889
|
+
private onBoxBlurred;
|
|
853
890
|
private onBoxClose;
|
|
854
891
|
private onBoxStateChange;
|
|
892
|
+
addBoxesStatusChangeListener: () => void;
|
|
855
893
|
addAppsChangeListener: () => void;
|
|
856
894
|
addAppCloseListener: () => void;
|
|
857
895
|
private onMainViewIndexChange;
|
|
@@ -992,9 +1030,6 @@ type InsertOptions = {
|
|
|
992
1030
|
readonly useClicker?: boolean;
|
|
993
1031
|
readonly useSelector?: boolean;
|
|
994
1032
|
} & BaseOption;
|
|
995
|
-
type OnCreateInsertOption = {
|
|
996
|
-
readonly displayer: Displayer;
|
|
997
|
-
} & BaseOption;
|
|
998
1033
|
/**
|
|
999
1034
|
* {@link https://github.com/netless-io/netless-iframe-bridge @netless/iframe-bridge}
|
|
1000
1035
|
*/
|
|
@@ -1092,6 +1127,17 @@ declare class ExtendPluginManager {
|
|
|
1092
1127
|
destroy(): void;
|
|
1093
1128
|
}
|
|
1094
1129
|
|
|
1130
|
+
type ExtendClassAble = typeof AppManager | typeof AppProxy | typeof AppContext | typeof BoxManager | typeof AttributesDelegate | typeof CursorManager;
|
|
1131
|
+
type ExtendClass = {
|
|
1132
|
+
AppManager?: typeof AppManager;
|
|
1133
|
+
BoxManager?: typeof BoxManager;
|
|
1134
|
+
AttributesDelegate?: typeof AttributesDelegate;
|
|
1135
|
+
CursorManager?: typeof CursorManager;
|
|
1136
|
+
AppProxy?: typeof AppProxy;
|
|
1137
|
+
AppContext?: typeof AppContext;
|
|
1138
|
+
};
|
|
1139
|
+
declare function getExtendClass<T extends ExtendClassAble>(baseClass: T, extendClass?: ExtendClass): T;
|
|
1140
|
+
|
|
1095
1141
|
declare const BuiltinApps: {
|
|
1096
1142
|
DocsViewer: string;
|
|
1097
1143
|
MediaPlayer: string;
|
|
@@ -1147,8 +1193,13 @@ type AppInitState = {
|
|
|
1147
1193
|
maximized?: boolean;
|
|
1148
1194
|
minimized?: boolean;
|
|
1149
1195
|
sceneIndex?: number;
|
|
1196
|
+
/** 所有box的基本状态 */
|
|
1150
1197
|
boxState?: TeleBoxState;
|
|
1151
1198
|
zIndex?: number;
|
|
1199
|
+
/** 扩展版本,单个box的状态 */
|
|
1200
|
+
boxStatus?: TeleBoxState;
|
|
1201
|
+
/** 上次非最小化窗口状态 */
|
|
1202
|
+
lastNotMinimizedBoxStatus?: NotMinimizedBoxState;
|
|
1152
1203
|
};
|
|
1153
1204
|
type CursorMovePayload = {
|
|
1154
1205
|
uid: string;
|
|
@@ -1182,6 +1233,8 @@ type MountParams = {
|
|
|
1182
1233
|
fullscreen?: boolean;
|
|
1183
1234
|
polling?: boolean;
|
|
1184
1235
|
supportAppliancePlugin?: boolean;
|
|
1236
|
+
/** 是否使用 boxesStatus 状态管理窗口 */
|
|
1237
|
+
useBoxesStatus?: boolean;
|
|
1185
1238
|
};
|
|
1186
1239
|
declare const reconnectRefresher: ReconnectRefresher;
|
|
1187
1240
|
declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any> implements PageController {
|
|
@@ -1211,12 +1264,13 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
|
1211
1264
|
private _cursorUIDsStyleDOM?;
|
|
1212
1265
|
private boxManager?;
|
|
1213
1266
|
private static params?;
|
|
1267
|
+
static extendClass?: ExtendClass$1;
|
|
1214
1268
|
private containerResizeObserver?;
|
|
1215
1269
|
containerSizeRatio: number;
|
|
1216
1270
|
private extendPluginManager?;
|
|
1217
1271
|
constructor(context: InvisiblePluginContext);
|
|
1218
1272
|
static onCreate(manager: WindowManager): void;
|
|
1219
|
-
static mount(params: MountParams): Promise<WindowManager>;
|
|
1273
|
+
static mount(params: MountParams, extendClass?: ExtendClass$1): Promise<WindowManager>;
|
|
1220
1274
|
private static initManager;
|
|
1221
1275
|
private static initContainer;
|
|
1222
1276
|
static get registered(): Map<string, RegisterParams>;
|
|
@@ -1292,6 +1346,10 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
|
1292
1346
|
setBoxState(boxState: TeleBoxState): void;
|
|
1293
1347
|
setMaximized(maximized: boolean): void;
|
|
1294
1348
|
setMinimized(minimized: boolean): void;
|
|
1349
|
+
/** 设置指定 box 的状态, 如果为 undefined, 则移除状态*/
|
|
1350
|
+
setBoxStatus(boxId: string, boxStatus?: TELE_BOX_STATE): void;
|
|
1351
|
+
/** 设置指定 box 的非最小化状态, 如果为 undefined, 则移除状态 */
|
|
1352
|
+
setLastNotMinimizedBoxStatus(boxId: string, lastNotMinimizedBoxStatus?: NotMinimizedBoxState): void;
|
|
1295
1353
|
setFullscreen(fullscreen: boolean): void;
|
|
1296
1354
|
get cursorUIDs(): string[];
|
|
1297
1355
|
setCursorUIDs(cursorUIDs?: string[] | null): void;
|
|
@@ -1300,6 +1358,8 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
|
1300
1358
|
get cameraState(): CameraState;
|
|
1301
1359
|
get apps(): Apps | undefined;
|
|
1302
1360
|
get boxState(): TeleBoxState | undefined;
|
|
1361
|
+
get boxStatus(): Record<string, TELE_BOX_STATE> | undefined;
|
|
1362
|
+
get lastNotMinimizedBoxStatus(): Record<string, NotMinimizedBoxState> | undefined;
|
|
1303
1363
|
get darkMode(): boolean;
|
|
1304
1364
|
get prefersColorScheme(): TeleBoxColorScheme | undefined;
|
|
1305
1365
|
get focused(): string | undefined;
|
|
@@ -1371,4 +1431,5 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
|
1371
1431
|
useExtendPlugin(extend: ExtendPluginInstance<any>): void;
|
|
1372
1432
|
}
|
|
1373
1433
|
|
|
1374
|
-
export {
|
|
1434
|
+
export { AppContext, AppCreateError, AppManager, AppManagerNotInitError, AppNotRegisterError, AppProxy, AttributesDelegate, BindContainerRoomPhaseInvalidError, BoxManager, BoxManagerNotFoundError, BoxNotCreatedError, BuiltinApps, CursorManager, ExtendPlugin, ExtendPluginManager, InvalidScenePath, ParamsInvalidError, Storage, WhiteWebSDKInvalidError, WindowManager, calculateNextIndex, getExtendClass, reconnectRefresher };
|
|
1435
|
+
export type { AddAppOptions, AddAppParams, AddPageParams, AppEmitterEvent, AppInitState, AppListenerKeys, AppPayload, AppSyncAttributes, ApplianceIcons, BaseInsertParams, CursorMovePayload, CursorOptions, ExtendClass, ExtendClassAble, ExtendContext, ExtendManagerOptions, ExtendPluginInstance, MountParams, NetlessApp, PageController, PageRemoveService, PageState, PublicEvent, RegisterEventData, RegisterEvents, RegisterParams, StorageStateChangedEvent, StorageStateChangedListener, WindowMangerAttributes, apps, setAppOptions };
|