@netless/window-manager 1.0.7-beta.3 → 1.0.7-beta.4

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 CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as lodash from 'lodash';
2
2
  import * as white_web_sdk from 'white-web-sdk';
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';
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, TeleBoxColorScheme, TeleBoxManager, TeleBoxState, NotMinimizedBoxState, ReadonlyTeleBox, TeleBoxManagerUpdateConfig, TeleBoxConfig } from '@netless/telebox-insider';
6
- export { ReadonlyTeleBox, TeleBoxRect } from '@netless/telebox-insider';
5
+ import { TELE_BOX_STATE, TeleBoxRect, TeleBoxColorScheme, TeleBoxState, NotMinimizedBoxState, TeleBoxManager, TeleBoxCollector, ReadonlyTeleBox, TeleBoxManagerUpdateConfig, TeleBoxConfig } from '@netless/telebox-insider';
6
+ export { ReadonlyTeleBox, TeleBoxCollector, TeleBoxManager, TeleBoxRect } from '@netless/telebox-insider';
7
7
  import Emittery from 'emittery';
8
8
 
9
9
  declare enum Events {
@@ -324,6 +324,170 @@ type EmitterEvent = {
324
324
  };
325
325
  type EmitterType = Emittery<EmitterEvent>;
326
326
 
327
+ declare class CursorManager {
328
+ private manager;
329
+ private enableCursor;
330
+ containerRect?: DOMRect;
331
+ wrapperRect?: DOMRect;
332
+ cursorInstances: Map<string, Cursor>;
333
+ roomMembers?: readonly RoomMember[];
334
+ userApplianceIcons: ApplianceIcons;
335
+ private mainViewElement?;
336
+ private sideEffectManager;
337
+ private store;
338
+ private leaveFlag;
339
+ private _style;
340
+ constructor(manager: AppManager, enableCursor: boolean, cursorOptions?: CursorOptions, applianceIcons?: ApplianceIcons);
341
+ get applianceIcons(): ApplianceIcons;
342
+ get style(): "default" | "custom";
343
+ set style(value: "default" | "custom");
344
+ private onCursorMove;
345
+ private initCursorInstance;
346
+ private enableCustomCursor;
347
+ private canMoveCursor;
348
+ setupWrapper(wrapper: HTMLElement): void;
349
+ setMainViewDivElement(div: HTMLDivElement): void;
350
+ get boxState(): any;
351
+ get focusView(): View | undefined;
352
+ private mouseMoveListener_;
353
+ private mouseMoveTimer;
354
+ private mouseMoveListener;
355
+ private mouseLeaveListener;
356
+ private showPencilEraserIfNeeded;
357
+ private updateCursor;
358
+ private getPoint;
359
+ /**
360
+ * 因为窗口内框在不同分辨率下的大小不一样,所以这里通过来鼠标事件的 target 来判断是在主白板还是在 APP 中
361
+ */
362
+ private getType;
363
+ updateContainerRect(): void;
364
+ deleteCursor(uid: string): void;
365
+ hideCursor(uid: string): void;
366
+ destroy(): void;
367
+ }
368
+
369
+ declare class Cursor {
370
+ private manager;
371
+ private memberId;
372
+ private cursorManager;
373
+ private wrapper?;
374
+ private member?;
375
+ private timer?;
376
+ private component?;
377
+ private style;
378
+ constructor(manager: AppManager, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
379
+ move: (position: Position) => void;
380
+ setStyle: (style: typeof this.style) => void;
381
+ leave: () => void;
382
+ private moveCursor;
383
+ get memberApplianceName(): ApplianceNames | undefined;
384
+ get memberColor(): string;
385
+ get memberColorHex(): string;
386
+ private get payload();
387
+ get memberCursorName(): any;
388
+ private get memberTheme();
389
+ private get memberCursorTextColor();
390
+ private get memberCursorTagBackgroundColor();
391
+ private get memberAvatar();
392
+ private get memberOpacity();
393
+ private get memberTagName();
394
+ private autoHidden;
395
+ private createCursor;
396
+ private initProps;
397
+ private getIcon;
398
+ private isCustomIcon;
399
+ updateMember(): RoomMember | undefined;
400
+ private updateComponent;
401
+ destroy(): void;
402
+ hide(): void;
403
+ }
404
+
405
+ type Apps = {
406
+ [key: string]: AppSyncAttributes;
407
+ };
408
+ type Position = {
409
+ x: number;
410
+ y: number;
411
+ type: PositionType;
412
+ id?: string;
413
+ };
414
+ type PositionType = "main" | "app";
415
+ type StoreContext = {
416
+ getAttributes: () => any;
417
+ safeUpdateAttributes: (keys: string[], value: any) => void;
418
+ safeSetAttributes: (attributes: any) => void;
419
+ };
420
+ type ICamera = Camera & {
421
+ id: string;
422
+ };
423
+ type ISize = Size & {
424
+ id: string;
425
+ };
426
+ declare class AttributesDelegate {
427
+ private context;
428
+ constructor(context: StoreContext);
429
+ setContext(context: StoreContext): void;
430
+ get attributes(): any;
431
+ apps(): Apps;
432
+ get focus(): string | undefined;
433
+ getAppAttributes(id: string): AppSyncAttributes;
434
+ getAppState(id: string): any;
435
+ getMaximized(): any;
436
+ getMinimized(): any;
437
+ getBoxesStatus(): Record<string, TELE_BOX_STATE> | undefined;
438
+ getBoxStatus(id: string): TELE_BOX_STATE | undefined;
439
+ setBoxStatus(id: string, status?: TeleBoxState): void;
440
+ getLastNotMinimizedBoxesStatus(): Record<string, NotMinimizedBoxState> | undefined;
441
+ getLastNotMinimizedBoxStatus(id: string): NotMinimizedBoxState | undefined;
442
+ setLastNotMinimizedBoxStatus(id: string, status?: NotMinimizedBoxState): void;
443
+ setupAppAttributes(params: AddAppParams, id: string, isDynamicPPT: boolean): void;
444
+ updateAppState(appId: string, stateName: AppAttributes, state: any): void;
445
+ cleanAppAttributes(id: string): void;
446
+ cleanFocus(): void;
447
+ getAppSceneIndex(id: string): any;
448
+ getAppScenePath(id: string): any;
449
+ getMainViewScenePath(): string | undefined;
450
+ getMainViewSceneIndex(): any;
451
+ getBoxState(): any;
452
+ setMainViewScenePath(scenePath: string): void;
453
+ setMainViewSceneIndex(index: number): void;
454
+ getMainViewCamera(): MainViewCamera;
455
+ getMainViewSize(): MainViewSize;
456
+ setMainViewCamera(camera: ICamera): void;
457
+ setMainViewSize(size: ISize): void;
458
+ setMainViewCameraAndSize(camera: ICamera, size: ISize): void;
459
+ setAppFocus: (appId: string, focus: boolean) => void;
460
+ updateCursor(uid: string, position: Position): void;
461
+ updateCursorState(uid: string, cursorState: string | undefined): void;
462
+ getCursorState(uid: string): any;
463
+ cleanCursor(uid: string): void;
464
+ setMainViewFocusPath(mainView: View): void;
465
+ getIframeBridge(): any;
466
+ setIframeBridge(data: any): void;
467
+ }
468
+ type MainViewSize = {
469
+ id: string;
470
+ width: number;
471
+ height: number;
472
+ };
473
+ type MainViewCamera = {
474
+ id: string;
475
+ centerX: number;
476
+ centerY: number;
477
+ scale: number;
478
+ };
479
+
480
+ type ExtendClass$1 = {
481
+ AppManager?: typeof AppManager;
482
+ BoxManager?: typeof BoxManager;
483
+ AttributesDelegate?: typeof AttributesDelegate;
484
+ CursorManager?: typeof CursorManager;
485
+ AppProxy?: typeof AppProxy;
486
+ AppContext?: typeof AppContext;
487
+ TeleBoxManager?: typeof TeleBoxManager;
488
+ TeleBoxCollector?: typeof TeleBoxCollector;
489
+ };
490
+
327
491
  type CreateBoxParams = {
328
492
  appId: string;
329
493
  app: NetlessApp;
@@ -579,168 +743,6 @@ declare class AppProxy implements PageRemoveService {
579
743
  close(): Promise<void>;
580
744
  }
581
745
 
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
-
744
746
  declare class MainViewProxy {
745
747
  private manager;
746
748
  /** Refresh the view's camera in an interval of 1.5s. */
@@ -1127,7 +1129,7 @@ declare class ExtendPluginManager {
1127
1129
  destroy(): void;
1128
1130
  }
1129
1131
 
1130
- type ExtendClassAble = typeof AppManager | typeof AppProxy | typeof AppContext | typeof BoxManager | typeof AttributesDelegate | typeof CursorManager;
1132
+ type ExtendClassAble = typeof AppManager | typeof AppProxy | typeof AppContext | typeof BoxManager | typeof AttributesDelegate | typeof CursorManager | typeof TeleBoxManager | typeof TeleBoxCollector;
1131
1133
  type ExtendClass = {
1132
1134
  AppManager?: typeof AppManager;
1133
1135
  BoxManager?: typeof BoxManager;
@@ -1135,6 +1137,8 @@ type ExtendClass = {
1135
1137
  CursorManager?: typeof CursorManager;
1136
1138
  AppProxy?: typeof AppProxy;
1137
1139
  AppContext?: typeof AppContext;
1140
+ TeleBoxManager?: typeof TeleBoxManager;
1141
+ TeleBoxCollector?: typeof TeleBoxCollector;
1138
1142
  };
1139
1143
  declare function getExtendClass<T extends ExtendClassAble>(baseClass: T, extendClass?: ExtendClass): T;
1140
1144