@netless/window-manager 1.0.7-beta.1 → 1.0.7-beta.10
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 +258 -162
- package/dist/index.js +14 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8490 -6806
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/App/AppContext.ts +27 -2
- package/src/App/AppProxy.ts +49 -6
- package/src/App/Storage/index.ts +1 -0
- package/src/AppListener.ts +17 -17
- package/src/AppManager.ts +88 -8
- package/src/AttributesDelegate.ts +82 -12
- package/src/BoxEmitter.ts +2 -0
- package/src/BoxManager.ts +82 -4
- package/src/Cursor/index.ts +1 -0
- package/src/InternalEmitter.ts +3 -0
- package/src/Utils/extendClass.ts +62 -0
- package/src/callback.ts +10 -1
- package/src/index.ts +92 -11
- package/src/shim.d.ts +4 -0
- package/src/typings.ts +2 -1
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, RoomMember, Camera, Size, Event as Event$1, Scope, EventPhase, MagixEventListenerOptions as MagixEventListenerOptions$1, toJS, listenUpdated, unlistenUpdated, listenDisposed, unlistenDisposed, Room, 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 { TELE_BOX_STATE, TeleBoxRect, TeleBoxState, TeleBoxColorScheme, NotMinimizedBoxState, TeleBoxManager, TeleBoxCollector, ReadonlyTeleBox, TeleBoxManagerUpdateConfig, TeleBoxConfig } from '@netless/telebox-insider';
|
|
6
|
+
export { ReadonlyTeleBox, TeleBoxCollector, TeleBoxManager, TeleBoxRect } from '@netless/telebox-insider';
|
|
5
7
|
import Emittery from 'emittery';
|
|
6
|
-
import { TELE_BOX_STATE, TeleBoxRect, TeleBoxColorScheme, TeleBoxManager, ReadonlyTeleBox, TeleBoxManagerUpdateConfig, TeleBoxConfig, TeleBoxState } from '@netless/telebox-insider';
|
|
7
|
-
export { ReadonlyTeleBox, TeleBoxRect } from '@netless/telebox-insider';
|
|
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
|
|
|
@@ -367,6 +225,10 @@ type AppEmitterEvent<T = any> = {
|
|
|
367
225
|
reconnected: void;
|
|
368
226
|
seek: number;
|
|
369
227
|
pageStateChange: PageState;
|
|
228
|
+
boxStatusChange: {
|
|
229
|
+
appId: string;
|
|
230
|
+
status: TeleBoxState;
|
|
231
|
+
};
|
|
370
232
|
};
|
|
371
233
|
type RegisterEventData = {
|
|
372
234
|
appId: string;
|
|
@@ -423,6 +285,7 @@ type PublicEvent = {
|
|
|
423
285
|
onBoxMove: BoxMovePayload;
|
|
424
286
|
onBoxResize: BoxResizePayload;
|
|
425
287
|
onBoxFocus: BoxFocusPayload;
|
|
288
|
+
onBoxBlurred: BoxBlurredPayload;
|
|
426
289
|
onBoxClose: BoxClosePayload;
|
|
427
290
|
onBoxStateChange: BoxStateChangePayload;
|
|
428
291
|
onMainViewMounted: View;
|
|
@@ -430,6 +293,8 @@ type PublicEvent = {
|
|
|
430
293
|
onAppViewMounted: AppPayload;
|
|
431
294
|
onAppSetup: string;
|
|
432
295
|
onAppScenePathChange: AppPayload;
|
|
296
|
+
onBoxesStatusChange: Map<string, TeleBoxState>;
|
|
297
|
+
onLastNotMinimizedBoxesStatusChange: Map<string, NotMinimizedBoxState>;
|
|
433
298
|
};
|
|
434
299
|
type CallbacksType = Emittery<PublicEvent>;
|
|
435
300
|
|
|
@@ -462,9 +327,177 @@ type EmitterEvent = {
|
|
|
462
327
|
changePageState: undefined;
|
|
463
328
|
writableChange: boolean;
|
|
464
329
|
containerSizeRatioUpdate: number;
|
|
330
|
+
boxesStatusChange: Map<string, TeleBoxState>;
|
|
331
|
+
lastNotMinimizedBoxesStatusChange: Map<string, NotMinimizedBoxState>;
|
|
465
332
|
};
|
|
466
333
|
type EmitterType = Emittery<EmitterEvent>;
|
|
467
334
|
|
|
335
|
+
declare class CursorManager {
|
|
336
|
+
private manager;
|
|
337
|
+
private enableCursor;
|
|
338
|
+
static readonly kind = "CursorManager";
|
|
339
|
+
containerRect?: DOMRect;
|
|
340
|
+
wrapperRect?: DOMRect;
|
|
341
|
+
cursorInstances: Map<string, Cursor>;
|
|
342
|
+
roomMembers?: readonly RoomMember[];
|
|
343
|
+
userApplianceIcons: ApplianceIcons;
|
|
344
|
+
private mainViewElement?;
|
|
345
|
+
private sideEffectManager;
|
|
346
|
+
private store;
|
|
347
|
+
private leaveFlag;
|
|
348
|
+
private _style;
|
|
349
|
+
constructor(manager: AppManager, enableCursor: boolean, cursorOptions?: CursorOptions, applianceIcons?: ApplianceIcons);
|
|
350
|
+
get applianceIcons(): ApplianceIcons;
|
|
351
|
+
get style(): "default" | "custom";
|
|
352
|
+
set style(value: "default" | "custom");
|
|
353
|
+
private onCursorMove;
|
|
354
|
+
private initCursorInstance;
|
|
355
|
+
private enableCustomCursor;
|
|
356
|
+
private canMoveCursor;
|
|
357
|
+
setupWrapper(wrapper: HTMLElement): void;
|
|
358
|
+
setMainViewDivElement(div: HTMLDivElement): void;
|
|
359
|
+
get boxState(): any;
|
|
360
|
+
get focusView(): View | undefined;
|
|
361
|
+
private mouseMoveListener_;
|
|
362
|
+
private mouseMoveTimer;
|
|
363
|
+
private mouseMoveListener;
|
|
364
|
+
private mouseLeaveListener;
|
|
365
|
+
private showPencilEraserIfNeeded;
|
|
366
|
+
private updateCursor;
|
|
367
|
+
private getPoint;
|
|
368
|
+
/**
|
|
369
|
+
* 因为窗口内框在不同分辨率下的大小不一样,所以这里通过来鼠标事件的 target 来判断是在主白板还是在 APP 中
|
|
370
|
+
*/
|
|
371
|
+
private getType;
|
|
372
|
+
updateContainerRect(): void;
|
|
373
|
+
deleteCursor(uid: string): void;
|
|
374
|
+
hideCursor(uid: string): void;
|
|
375
|
+
destroy(): void;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
declare class Cursor {
|
|
379
|
+
private manager;
|
|
380
|
+
private memberId;
|
|
381
|
+
private cursorManager;
|
|
382
|
+
private wrapper?;
|
|
383
|
+
private member?;
|
|
384
|
+
private timer?;
|
|
385
|
+
private component?;
|
|
386
|
+
private style;
|
|
387
|
+
constructor(manager: AppManager, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
|
388
|
+
move: (position: Position) => void;
|
|
389
|
+
setStyle: (style: typeof this.style) => void;
|
|
390
|
+
leave: () => void;
|
|
391
|
+
private moveCursor;
|
|
392
|
+
get memberApplianceName(): ApplianceNames | undefined;
|
|
393
|
+
get memberColor(): string;
|
|
394
|
+
get memberColorHex(): string;
|
|
395
|
+
private get payload();
|
|
396
|
+
get memberCursorName(): any;
|
|
397
|
+
private get memberTheme();
|
|
398
|
+
private get memberCursorTextColor();
|
|
399
|
+
private get memberCursorTagBackgroundColor();
|
|
400
|
+
private get memberAvatar();
|
|
401
|
+
private get memberOpacity();
|
|
402
|
+
private get memberTagName();
|
|
403
|
+
private autoHidden;
|
|
404
|
+
private createCursor;
|
|
405
|
+
private initProps;
|
|
406
|
+
private getIcon;
|
|
407
|
+
private isCustomIcon;
|
|
408
|
+
updateMember(): RoomMember | undefined;
|
|
409
|
+
private updateComponent;
|
|
410
|
+
destroy(): void;
|
|
411
|
+
hide(): void;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
type Apps = {
|
|
415
|
+
[key: string]: AppSyncAttributes;
|
|
416
|
+
};
|
|
417
|
+
type Position = {
|
|
418
|
+
x: number;
|
|
419
|
+
y: number;
|
|
420
|
+
type: PositionType;
|
|
421
|
+
id?: string;
|
|
422
|
+
};
|
|
423
|
+
type PositionType = "main" | "app";
|
|
424
|
+
type StoreContext = {
|
|
425
|
+
getAttributes: () => any;
|
|
426
|
+
safeUpdateAttributes: (keys: string[], value: any) => void;
|
|
427
|
+
safeSetAttributes: (attributes: any) => void;
|
|
428
|
+
};
|
|
429
|
+
type ICamera = Camera & {
|
|
430
|
+
id: string;
|
|
431
|
+
};
|
|
432
|
+
type ISize = Size & {
|
|
433
|
+
id: string;
|
|
434
|
+
};
|
|
435
|
+
declare class AttributesDelegate {
|
|
436
|
+
private context;
|
|
437
|
+
static readonly kind = "AttributesDelegate";
|
|
438
|
+
constructor(context: StoreContext);
|
|
439
|
+
setContext(context: StoreContext): void;
|
|
440
|
+
get attributes(): any;
|
|
441
|
+
apps(): Apps;
|
|
442
|
+
get focus(): string | undefined;
|
|
443
|
+
getAppAttributes(id: string): AppSyncAttributes;
|
|
444
|
+
getAppState(id: string): any;
|
|
445
|
+
getMaximized(): any;
|
|
446
|
+
getMinimized(): any;
|
|
447
|
+
getBoxesStatus(): Record<string, TeleBoxState> | undefined;
|
|
448
|
+
getBoxStatus(id: string): TeleBoxState | undefined;
|
|
449
|
+
setBoxStatus(id: string, status?: TeleBoxState): void;
|
|
450
|
+
getLastNotMinimizedBoxesStatus(): Record<string, NotMinimizedBoxState> | undefined;
|
|
451
|
+
getLastNotMinimizedBoxStatus(id: string): NotMinimizedBoxState | undefined;
|
|
452
|
+
setLastNotMinimizedBoxStatus(id: string, status?: NotMinimizedBoxState): void;
|
|
453
|
+
setupAppAttributes(params: AddAppParams, id: string, isDynamicPPT: boolean): void;
|
|
454
|
+
updateAppState(appId: string, stateName: AppAttributes, state: any): void;
|
|
455
|
+
cleanAppAttributes(id: string): void;
|
|
456
|
+
cleanFocus(): void;
|
|
457
|
+
getAppSceneIndex(id: string): any;
|
|
458
|
+
getAppScenePath(id: string): any;
|
|
459
|
+
getMainViewScenePath(): string | undefined;
|
|
460
|
+
getMainViewSceneIndex(): any;
|
|
461
|
+
getBoxState(): any;
|
|
462
|
+
setMainViewScenePath(scenePath: string): void;
|
|
463
|
+
setMainViewSceneIndex(index: number): void;
|
|
464
|
+
getMainViewCamera(): MainViewCamera;
|
|
465
|
+
getMainViewSize(): MainViewSize;
|
|
466
|
+
setMainViewCamera(camera: ICamera): void;
|
|
467
|
+
setMainViewSize(size: ISize): void;
|
|
468
|
+
setMainViewCameraAndSize(camera: ICamera, size: ISize): void;
|
|
469
|
+
setAppFocus: (appId: string, focus: boolean) => void;
|
|
470
|
+
updateCursor(uid: string, position: Position): void;
|
|
471
|
+
updateCursorState(uid: string, cursorState: string | undefined): void;
|
|
472
|
+
getCursorState(uid: string): any;
|
|
473
|
+
cleanCursor(uid: string): void;
|
|
474
|
+
setMainViewFocusPath(mainView: View): void;
|
|
475
|
+
getIframeBridge(): any;
|
|
476
|
+
setIframeBridge(data: any): void;
|
|
477
|
+
}
|
|
478
|
+
type MainViewSize = {
|
|
479
|
+
id: string;
|
|
480
|
+
width: number;
|
|
481
|
+
height: number;
|
|
482
|
+
};
|
|
483
|
+
type MainViewCamera = {
|
|
484
|
+
id: string;
|
|
485
|
+
centerX: number;
|
|
486
|
+
centerY: number;
|
|
487
|
+
scale: number;
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
type ExtendClass$1 = {
|
|
491
|
+
AppManager?: typeof AppManager;
|
|
492
|
+
BoxManager?: typeof BoxManager;
|
|
493
|
+
AttributesDelegate?: typeof AttributesDelegate;
|
|
494
|
+
CursorManager?: typeof CursorManager;
|
|
495
|
+
AppProxy?: typeof AppProxy;
|
|
496
|
+
AppContext?: typeof AppContext;
|
|
497
|
+
TeleBoxManager?: typeof TeleBoxManager;
|
|
498
|
+
TeleBoxCollector?: typeof TeleBoxCollector;
|
|
499
|
+
};
|
|
500
|
+
|
|
468
501
|
type CreateBoxParams = {
|
|
469
502
|
appId: string;
|
|
470
503
|
app: NetlessApp;
|
|
@@ -473,6 +506,10 @@ type CreateBoxParams = {
|
|
|
473
506
|
options?: AddAppOptions;
|
|
474
507
|
canOperate?: boolean;
|
|
475
508
|
smartPosition?: boolean;
|
|
509
|
+
boxStatus?: TeleBoxState;
|
|
510
|
+
forceTop?: boolean;
|
|
511
|
+
forceNormal?: boolean;
|
|
512
|
+
isDragContent?: boolean;
|
|
476
513
|
};
|
|
477
514
|
type AppId = {
|
|
478
515
|
appId: string;
|
|
@@ -497,11 +534,14 @@ type CreateTeleBoxManagerConfig = {
|
|
|
497
534
|
collectorContainer?: HTMLElement;
|
|
498
535
|
collectorStyles?: Partial<CSSStyleDeclaration>;
|
|
499
536
|
prefersColorScheme?: TeleBoxColorScheme;
|
|
537
|
+
useBoxesStatus?: boolean;
|
|
500
538
|
};
|
|
501
539
|
type BoxManagerContext = {
|
|
502
540
|
safeSetAttributes: (attributes: any) => void;
|
|
503
541
|
getMainView: () => View;
|
|
504
542
|
updateAppState: (appId: string, field: AppAttributes, value: any) => void;
|
|
543
|
+
setBoxStatus: (appId: string, status?: TeleBoxState) => void;
|
|
544
|
+
setLastNotMinimizedBoxStatus: (appId: string, status?: NotMinimizedBoxState) => void;
|
|
505
545
|
emitter: EmitterType;
|
|
506
546
|
boxEmitter: BoxEmitterType;
|
|
507
547
|
callbacks: CallbacksType;
|
|
@@ -513,11 +553,12 @@ type BoxManagerContext = {
|
|
|
513
553
|
declare class BoxManager {
|
|
514
554
|
private context;
|
|
515
555
|
private createTeleBoxManagerConfig?;
|
|
556
|
+
static readonly kind = "BoxManager";
|
|
516
557
|
teleBoxManager: TeleBoxManager;
|
|
517
558
|
constructor(context: BoxManagerContext, createTeleBoxManagerConfig?: CreateTeleBoxManagerConfig | undefined);
|
|
518
559
|
private get mainView();
|
|
519
560
|
private get canOperate();
|
|
520
|
-
get boxState(): "
|
|
561
|
+
get boxState(): "normal" | "minimized" | "maximized";
|
|
521
562
|
get maximized(): boolean;
|
|
522
563
|
get minimized(): boolean;
|
|
523
564
|
get darkMode(): boolean;
|
|
@@ -525,6 +566,8 @@ declare class BoxManager {
|
|
|
525
566
|
get boxSize(): number;
|
|
526
567
|
createBox(params: CreateBoxParams): void;
|
|
527
568
|
setBoxInitState(appId: string): void;
|
|
569
|
+
setBoxesStatus(status?: Record<string, TeleBoxState>): void;
|
|
570
|
+
setLastNotMinimizedBoxesStatus(status?: Record<string, NotMinimizedBoxState>): void;
|
|
528
571
|
setupBoxManager(createTeleBoxManagerConfig?: CreateTeleBoxManagerConfig): TeleBoxManager;
|
|
529
572
|
setCollectorContainer(container: HTMLElement): void;
|
|
530
573
|
getBox(appId: string): ReadonlyTeleBox | undefined;
|
|
@@ -585,10 +628,11 @@ declare class AppContext<TAttributes extends {} = any, TMagixEventPayloads = any
|
|
|
585
628
|
appId: string;
|
|
586
629
|
private appProxy;
|
|
587
630
|
private appOptions?;
|
|
631
|
+
static readonly kind = "AppContext";
|
|
588
632
|
readonly emitter: Emittery<AppEmitterEvent<TAttributes>>;
|
|
589
633
|
readonly mobxUtils: {
|
|
590
|
-
autorun:
|
|
591
|
-
reaction:
|
|
634
|
+
autorun: any;
|
|
635
|
+
reaction: any;
|
|
592
636
|
toJS: typeof toJS;
|
|
593
637
|
};
|
|
594
638
|
readonly objectUtils: {
|
|
@@ -600,8 +644,14 @@ declare class AppContext<TAttributes extends {} = any, TMagixEventPayloads = any
|
|
|
600
644
|
private store;
|
|
601
645
|
readonly isAddApp: boolean;
|
|
602
646
|
readonly isReplay: boolean;
|
|
603
|
-
constructor(manager: AppManager, boxManager: BoxManager, appId: string, appProxy: AppProxy, appOptions?: TAppOptions | (() => TAppOptions) | undefined);
|
|
647
|
+
constructor(manager: AppManager, boxManager: BoxManager, appId: string, appProxy: AppProxy, appOptions?: (TAppOptions | (() => TAppOptions)) | undefined);
|
|
648
|
+
getManager: () => AppManager;
|
|
649
|
+
getBoxManager: () => BoxManager;
|
|
650
|
+
getWindowManager: () => WindowManager;
|
|
651
|
+
getBoxStatus: () => TeleBoxState | undefined;
|
|
652
|
+
getLastNotMinimizedBoxStatus: () => NotMinimizedBoxState | undefined;
|
|
604
653
|
getDisplayer: () => white_web_sdk.Displayer<white_web_sdk.DisplayerCallbacks>;
|
|
654
|
+
getAppProxy: () => AppProxy;
|
|
605
655
|
/** @deprecated Use context.storage.state instead. */
|
|
606
656
|
getAttributes: () => TAttributes | undefined;
|
|
607
657
|
getScenes: () => SceneDefinition[] | undefined;
|
|
@@ -652,6 +702,7 @@ type AppEmitter = Emittery<AppEmitterEvent>;
|
|
|
652
702
|
declare class AppProxy implements PageRemoveService {
|
|
653
703
|
private params;
|
|
654
704
|
private manager;
|
|
705
|
+
static readonly kind = "AppProxy";
|
|
655
706
|
kind: string;
|
|
656
707
|
id: string;
|
|
657
708
|
scenePath?: string;
|
|
@@ -700,6 +751,7 @@ declare class AppProxy implements PageRemoveService {
|
|
|
700
751
|
setViewFocusScenePath(): string | undefined;
|
|
701
752
|
private createView;
|
|
702
753
|
notifyPageStateChange: lodash.DebouncedFunc<() => void>;
|
|
754
|
+
notifyBoxStatusChange: (status: TeleBoxState) => void;
|
|
703
755
|
get pageState(): PageState;
|
|
704
756
|
removeSceneByIndex(index: number): Promise<boolean>;
|
|
705
757
|
setSceneIndexWithoutSync(index: number): void;
|
|
@@ -800,6 +852,7 @@ declare class ReconnectRefresher {
|
|
|
800
852
|
|
|
801
853
|
declare class AppManager {
|
|
802
854
|
windowManger: WindowManager;
|
|
855
|
+
static readonly kind = "AppManager";
|
|
803
856
|
displayer: Displayer;
|
|
804
857
|
viewManager: ViewManager;
|
|
805
858
|
appProxies: Map<string, AppProxy>;
|
|
@@ -816,9 +869,14 @@ declare class AppManager {
|
|
|
816
869
|
private callbacksNode;
|
|
817
870
|
private appCreateQueue;
|
|
818
871
|
private _focusAppCreatedResolve?;
|
|
872
|
+
private _focusAppId;
|
|
873
|
+
private _resolveTimer;
|
|
819
874
|
private sideEffectManager;
|
|
820
875
|
sceneState: SceneState | null;
|
|
821
876
|
rootDirRemoving: boolean;
|
|
877
|
+
private _useBoxesStatus;
|
|
878
|
+
get useBoxesStatus(): boolean;
|
|
879
|
+
set useBoxesStatus(value: boolean);
|
|
822
880
|
constructor(windowManger: WindowManager);
|
|
823
881
|
getMemberState(): MemberState;
|
|
824
882
|
private onRemoveScenes;
|
|
@@ -850,8 +908,11 @@ declare class AppManager {
|
|
|
850
908
|
private onBoxMove;
|
|
851
909
|
private onBoxResize;
|
|
852
910
|
private onBoxFocus;
|
|
911
|
+
private onBoxBlurred;
|
|
853
912
|
private onBoxClose;
|
|
854
913
|
private onBoxStateChange;
|
|
914
|
+
private notifyBoxesStatusChange;
|
|
915
|
+
addBoxesStatusChangeListener: () => void;
|
|
855
916
|
addAppsChangeListener: () => void;
|
|
856
917
|
addAppCloseListener: () => void;
|
|
857
918
|
private onMainViewIndexChange;
|
|
@@ -913,8 +974,6 @@ declare class AppListeners {
|
|
|
913
974
|
private appResizeHandler;
|
|
914
975
|
private boxStateChangeHandler;
|
|
915
976
|
private setMainViewScenePathHandler;
|
|
916
|
-
private moveCameraHandler;
|
|
917
|
-
private moveCameraToContainHandler;
|
|
918
977
|
private cursorMoveHandler;
|
|
919
978
|
private rootDirRemovedHandler;
|
|
920
979
|
private refreshHandler;
|
|
@@ -992,9 +1051,6 @@ type InsertOptions = {
|
|
|
992
1051
|
readonly useClicker?: boolean;
|
|
993
1052
|
readonly useSelector?: boolean;
|
|
994
1053
|
} & BaseOption;
|
|
995
|
-
type OnCreateInsertOption = {
|
|
996
|
-
readonly displayer: Displayer;
|
|
997
|
-
} & BaseOption;
|
|
998
1054
|
/**
|
|
999
1055
|
* {@link https://github.com/netless-io/netless-iframe-bridge @netless/iframe-bridge}
|
|
1000
1056
|
*/
|
|
@@ -1092,6 +1148,19 @@ declare class ExtendPluginManager {
|
|
|
1092
1148
|
destroy(): void;
|
|
1093
1149
|
}
|
|
1094
1150
|
|
|
1151
|
+
type ExtendClassAble = typeof AppManager | typeof AppProxy | typeof AppContext | typeof BoxManager | typeof AttributesDelegate | typeof CursorManager | typeof TeleBoxManager | typeof TeleBoxCollector;
|
|
1152
|
+
type ExtendClass = {
|
|
1153
|
+
AppManager?: typeof AppManager;
|
|
1154
|
+
BoxManager?: typeof BoxManager;
|
|
1155
|
+
AttributesDelegate?: typeof AttributesDelegate;
|
|
1156
|
+
CursorManager?: typeof CursorManager;
|
|
1157
|
+
AppProxy?: typeof AppProxy;
|
|
1158
|
+
AppContext?: typeof AppContext;
|
|
1159
|
+
TeleBoxManager?: typeof TeleBoxManager;
|
|
1160
|
+
TeleBoxCollector?: typeof TeleBoxCollector;
|
|
1161
|
+
};
|
|
1162
|
+
declare function getExtendClass<T extends ExtendClassAble>(baseClass: T, extendClass?: ExtendClass): T;
|
|
1163
|
+
|
|
1095
1164
|
declare const BuiltinApps: {
|
|
1096
1165
|
DocsViewer: string;
|
|
1097
1166
|
MediaPlayer: string;
|
|
@@ -1120,6 +1189,9 @@ type AddAppParams<TAttributes = any> = {
|
|
|
1120
1189
|
src?: string;
|
|
1121
1190
|
options?: AddAppOptions;
|
|
1122
1191
|
attributes?: TAttributes;
|
|
1192
|
+
forceTop?: boolean;
|
|
1193
|
+
forceNormal?: boolean;
|
|
1194
|
+
isDragContent?: boolean;
|
|
1123
1195
|
};
|
|
1124
1196
|
type BaseInsertParams = {
|
|
1125
1197
|
kind: string;
|
|
@@ -1127,6 +1199,9 @@ type BaseInsertParams = {
|
|
|
1127
1199
|
options?: AddAppOptions;
|
|
1128
1200
|
attributes?: any;
|
|
1129
1201
|
isDynamicPPT?: boolean;
|
|
1202
|
+
forceTop?: boolean;
|
|
1203
|
+
forceNormal?: boolean;
|
|
1204
|
+
isDragContent?: boolean;
|
|
1130
1205
|
};
|
|
1131
1206
|
type AppSyncAttributes = {
|
|
1132
1207
|
kind: string;
|
|
@@ -1136,6 +1211,9 @@ type AppSyncAttributes = {
|
|
|
1136
1211
|
isDynamicPPT?: boolean;
|
|
1137
1212
|
fullPath?: string;
|
|
1138
1213
|
createdAt?: number;
|
|
1214
|
+
forceTop?: boolean;
|
|
1215
|
+
forceNormal?: boolean;
|
|
1216
|
+
isDragContent?: boolean;
|
|
1139
1217
|
};
|
|
1140
1218
|
type AppInitState = {
|
|
1141
1219
|
id: string;
|
|
@@ -1147,8 +1225,16 @@ type AppInitState = {
|
|
|
1147
1225
|
maximized?: boolean;
|
|
1148
1226
|
minimized?: boolean;
|
|
1149
1227
|
sceneIndex?: number;
|
|
1228
|
+
/** 所有box的基本状态 */
|
|
1150
1229
|
boxState?: TeleBoxState;
|
|
1151
1230
|
zIndex?: number;
|
|
1231
|
+
/** 扩展版本,单个box的状态 */
|
|
1232
|
+
boxStatus?: TeleBoxState;
|
|
1233
|
+
/** 上次非最小化窗口状态 */
|
|
1234
|
+
lastNotMinimizedBoxStatus?: NotMinimizedBoxState;
|
|
1235
|
+
forceTop?: boolean;
|
|
1236
|
+
forceNormal?: boolean;
|
|
1237
|
+
isDragContent?: boolean;
|
|
1152
1238
|
};
|
|
1153
1239
|
type CursorMovePayload = {
|
|
1154
1240
|
uid: string;
|
|
@@ -1182,10 +1268,12 @@ type MountParams = {
|
|
|
1182
1268
|
fullscreen?: boolean;
|
|
1183
1269
|
polling?: boolean;
|
|
1184
1270
|
supportAppliancePlugin?: boolean;
|
|
1271
|
+
/** 是否使用 boxesStatus 状态管理窗口 */
|
|
1272
|
+
useBoxesStatus?: boolean;
|
|
1185
1273
|
};
|
|
1186
1274
|
declare const reconnectRefresher: ReconnectRefresher;
|
|
1187
1275
|
declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any> implements PageController {
|
|
1188
|
-
static kind
|
|
1276
|
+
static readonly kind = "WindowManager";
|
|
1189
1277
|
static displayer: Displayer;
|
|
1190
1278
|
static wrapper?: HTMLElement;
|
|
1191
1279
|
static sizer?: HTMLElement;
|
|
@@ -1211,12 +1299,13 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
|
1211
1299
|
private _cursorUIDsStyleDOM?;
|
|
1212
1300
|
private boxManager?;
|
|
1213
1301
|
private static params?;
|
|
1302
|
+
static extendClass?: ExtendClass$1;
|
|
1214
1303
|
private containerResizeObserver?;
|
|
1215
1304
|
containerSizeRatio: number;
|
|
1216
1305
|
private extendPluginManager?;
|
|
1217
1306
|
constructor(context: InvisiblePluginContext);
|
|
1218
1307
|
static onCreate(manager: WindowManager): void;
|
|
1219
|
-
static mount(params: MountParams): Promise<WindowManager>;
|
|
1308
|
+
static mount(params: MountParams, extendClass?: ExtendClass$1): Promise<WindowManager>;
|
|
1220
1309
|
private static initManager;
|
|
1221
1310
|
private static initContainer;
|
|
1222
1311
|
static get registered(): Map<string, RegisterParams>;
|
|
@@ -1292,6 +1381,10 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
|
1292
1381
|
setBoxState(boxState: TeleBoxState): void;
|
|
1293
1382
|
setMaximized(maximized: boolean): void;
|
|
1294
1383
|
setMinimized(minimized: boolean): void;
|
|
1384
|
+
/** 设置指定 box 的状态, 如果为 undefined, 则移除状态*/
|
|
1385
|
+
setBoxStatus(boxId: string, boxStatus?: TELE_BOX_STATE): void;
|
|
1386
|
+
/** 设置指定 box 的非最小化状态, 如果为 undefined, 则移除状态 */
|
|
1387
|
+
setLastNotMinimizedBoxStatus(boxId: string, lastNotMinimizedBoxStatus?: NotMinimizedBoxState): void;
|
|
1295
1388
|
setFullscreen(fullscreen: boolean): void;
|
|
1296
1389
|
get cursorUIDs(): string[];
|
|
1297
1390
|
setCursorUIDs(cursorUIDs?: string[] | null): void;
|
|
@@ -1300,6 +1393,8 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
|
1300
1393
|
get cameraState(): CameraState;
|
|
1301
1394
|
get apps(): Apps | undefined;
|
|
1302
1395
|
get boxState(): TeleBoxState | undefined;
|
|
1396
|
+
get boxStatus(): Record<string, TeleBoxState> | undefined;
|
|
1397
|
+
get lastNotMinimizedBoxStatus(): Record<string, NotMinimizedBoxState> | undefined;
|
|
1303
1398
|
get darkMode(): boolean;
|
|
1304
1399
|
get prefersColorScheme(): TeleBoxColorScheme | undefined;
|
|
1305
1400
|
get focused(): string | undefined;
|
|
@@ -1371,4 +1466,5 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
|
1371
1466
|
useExtendPlugin(extend: ExtendPluginInstance<any>): void;
|
|
1372
1467
|
}
|
|
1373
1468
|
|
|
1374
|
-
export {
|
|
1469
|
+
export { AppContext, AppCreateError, AppManager, AppManagerNotInitError, AppNotRegisterError, AppProxy, AttributesDelegate, BindContainerRoomPhaseInvalidError, BoxManager, BoxManagerNotFoundError, BoxNotCreatedError, BuiltinApps, CursorManager, ExtendPlugin, ExtendPluginManager, InvalidScenePath, ParamsInvalidError, Storage, WhiteWebSDKInvalidError, WindowManager, calculateNextIndex, getExtendClass, reconnectRefresher };
|
|
1470
|
+
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 };
|