@netless/window-manager 1.0.12 → 1.0.13-bate.1

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,6 +1,6 @@
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, 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';
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, Logger, 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
5
  import { TELE_BOX_STATE, TeleBoxRect, TeleBoxState, TeleBoxColorScheme, NotMinimizedBoxState, TeleBoxManager, TeleBoxCollector, ReadonlyTeleBox, TeleBoxManagerUpdateConfig, TeleBoxConfig } from '@netless/telebox-insider';
6
6
  export { ReadonlyTeleBox, TeleBoxCollector, TeleBoxManager, TeleBoxRect } from '@netless/telebox-insider';
@@ -327,6 +327,11 @@ type EmitterEvent = {
327
327
  changePageState: undefined;
328
328
  writableChange: boolean;
329
329
  containerSizeRatioUpdate: number;
330
+ wrapperRectChange: {
331
+ width: number;
332
+ height: number;
333
+ origin?: string;
334
+ };
330
335
  boxesStatusChange: Map<string, TeleBoxState>;
331
336
  lastNotMinimizedBoxesStatusChange: Map<string, NotMinimizedBoxState>;
332
337
  };
@@ -727,6 +732,7 @@ declare class AppProxy implements PageRemoveService {
727
732
  get isWritable(): boolean;
728
733
  get attributes(): any;
729
734
  get appAttributes(): AppSyncAttributes;
735
+ get Logger(): white_web_sdk.Logger | undefined;
730
736
  getFullScenePath(): string | undefined;
731
737
  private getFullScenePathFromScenes;
732
738
  setFullPath(path: string): void;
@@ -767,10 +773,17 @@ declare class MainViewProxy {
767
773
  private scale?;
768
774
  private started;
769
775
  private mainViewIsAddListener;
776
+ private isForcingMainViewDivElement;
777
+ private wrapperRectWorkaroundFrame;
778
+ private pendingWrapperRectChange?;
770
779
  private mainView;
771
780
  private store;
772
781
  private viewMode;
773
782
  private sideEffectManager;
783
+ private playgroundSizeChangeListenerLocalConsole;
784
+ private sizeUpdatedLocalConsole;
785
+ private cameraUpdatedLocalConsole;
786
+ private cameraReactionLocalConsole;
774
787
  constructor(manager: AppManager);
775
788
  private syncCamera;
776
789
  private startListenWritableChange;
@@ -779,6 +792,9 @@ declare class MainViewProxy {
779
792
  private get mainViewSize();
780
793
  private get didRelease();
781
794
  private moveCameraSizeByAttributes;
795
+ private onWrapperRectChange;
796
+ private runWrapperRectWorkaround;
797
+ private forceSyncMainViewDivElement;
782
798
  start(): void;
783
799
  addCameraReaction: () => void;
784
800
  setCameraAndSize(): void;
@@ -806,7 +822,9 @@ declare class MainViewProxy {
806
822
  private addCameraListener;
807
823
  private removeCameraListener;
808
824
  private _syncMainViewTimer;
809
- private onCameraOrSizeUpdated;
825
+ private handleCameraOrSizeUpdated;
826
+ private onCameraUpdated;
827
+ private onSizeUpdated;
810
828
  private ensureMainViewSize;
811
829
  private syncMainView;
812
830
  moveCameraToContian(size: Size): void;
@@ -903,6 +921,7 @@ declare class AppManager {
903
921
  set polling(b: boolean);
904
922
  get focusApp(): AppProxy | undefined;
905
923
  get uid(): string;
924
+ get Logger(): white_web_sdk.Logger | undefined;
906
925
  getMainViewSceneDir(): string;
907
926
  private onCreated;
908
927
  private onBoxMove;
@@ -936,6 +955,8 @@ declare class AppManager {
936
955
  private onAppDelete;
937
956
  private closeAll;
938
957
  bindMainView(divElement: HTMLDivElement, disableCameraTransform: boolean): void;
958
+ private hasRoot;
959
+ private getRectByDivElement;
939
960
  setMainViewFocusPath(scenePath?: string): boolean | undefined;
940
961
  private resetScenePath;
941
962
  addApp(params: AddAppParams, isDynamicPPT: boolean): Promise<string | undefined>;
@@ -962,6 +983,48 @@ declare class AppManager {
962
983
  destroy(): void;
963
984
  }
964
985
 
986
+ /**
987
+ * 按 `[WindowManager][tagName]` 前缀输出。
988
+ * 若传入 `debounceTime`(毫秒):窗口内多次 `log` 不立即输出,只在连续停止调用满 `debounceTime` 后输出**最后一次**的参数(尾部 debounce)。
989
+ */
990
+ declare class ArgusLog {
991
+ private readonly logger;
992
+ private readonly name;
993
+ private readonly debounceTime?;
994
+ private pendingArgs;
995
+ private flushTimer;
996
+ /** debounce 窗口内按一层 key 合并;同 key 后者覆盖;非普通对象则整段待输出被本次值替换 */
997
+ private pendingShallowMerge;
998
+ private shallowMergeTimer;
999
+ /** debounce 窗口内 safeUpdateAttributes:同 keys 数组则只更新 value,否则追加一段,flush 时拼成一条 */
1000
+ private pendingUpdateSegments;
1001
+ private updateMergeTimer;
1002
+ constructor(logger: Logger, name: string, debounceTime?: number | undefined);
1003
+ private emitInfo;
1004
+ private flush;
1005
+ private flushShallowMerge;
1006
+ log(...args: unknown[]): void;
1007
+ /**
1008
+ * 带 debounce 时:窗口内多次调用会把「一层 key」合并进同一条日志(不同 key 并存,同 key 取最后一次)。
1009
+ * `payload` 为普通对象时做浅合并;否则视为原子值,覆盖当前待合并状态(丢弃此前累积的对象 key)。
1010
+ * 无 debounce 或时间为 0 时立即输出。
1011
+ */
1012
+ logDebouncedShallowMerge(label: string, payload: unknown): void;
1013
+ private flushUpdateAttributesMerge;
1014
+ /**
1015
+ * 带 debounce 时:连续调用若 `keys` 与上一段完全相同则覆盖该段的 `value`;否则追加一段。
1016
+ * flush 时输出一条日志,多段用 ` | ` 连接。
1017
+ */
1018
+ logDebouncedUpdateAttributes(keys: string[], value: unknown): void;
1019
+ /**
1020
+ * 销毁:清除所有 `setTimeout` debounce 定时器,并丢弃尚未输出的暂存日志(不补打日志)。
1021
+ * WindowManager 销毁时应调用,避免泄漏与销毁后仍触发 `logger.info`。
1022
+ */
1023
+ destroy(): void;
1024
+ /** 与 `destroy()` 相同,保留旧名以兼容 */
1025
+ dispose(): void;
1026
+ }
1027
+
965
1028
  declare class AppListeners {
966
1029
  private manager;
967
1030
  private displayer;
@@ -1305,9 +1368,13 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
1305
1368
  private containerResizeObserver?;
1306
1369
  containerSizeRatio: number;
1307
1370
  private extendPluginManager?;
1371
+ private _roomLogger?;
1372
+ attributesDeboundceLog?: ArgusLog;
1373
+ get Logger(): Logger | undefined;
1308
1374
  constructor(context: InvisiblePluginContext);
1309
1375
  static onCreate(manager: WindowManager): void;
1310
1376
  static mount(params: MountParams, extendClass?: ExtendClass$1): Promise<WindowManager>;
1377
+ onMainViewScenePathChangeHandler: (scenePath: string) => void;
1311
1378
  private static initManager;
1312
1379
  private static initContainer;
1313
1380
  static get registered(): Map<string, RegisterParams>;