@netless/window-manager 1.0.13-test.9 → 1.0.14
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 +61 -4
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7513 -7167
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/App/AppProxy.ts +6 -6
- package/src/AppListener.ts +0 -1
- package/src/AppManager.ts +13 -16
- package/src/AttributesDelegate.ts +0 -7
- package/src/BoxManager.ts +0 -1
- package/src/BuiltinApps.ts +9 -6
- package/src/ContainerResizeObserver.ts +18 -14
- package/src/InternalEmitter.ts +1 -0
- package/src/Utils/Common.ts +0 -1
- package/src/Utils/Reactive.ts +2 -2
- package/src/Utils/RoomHacker.ts +15 -1
- package/src/Utils/attributesLogStringify.ts +78 -0
- package/src/Utils/log.ts +228 -0
- package/src/View/MainView.ts +138 -13
- package/src/index.ts +19 -14
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,
|
|
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
|
};
|
|
@@ -435,7 +440,6 @@ type ISize = Size & {
|
|
|
435
440
|
declare class AttributesDelegate {
|
|
436
441
|
private context;
|
|
437
442
|
static readonly kind = "AttributesDelegate";
|
|
438
|
-
private setMainViewCameraConsole;
|
|
439
443
|
constructor(context: StoreContext);
|
|
440
444
|
setContext(context: StoreContext): void;
|
|
441
445
|
get attributes(): any;
|
|
@@ -769,11 +773,17 @@ declare class MainViewProxy {
|
|
|
769
773
|
private scale?;
|
|
770
774
|
private started;
|
|
771
775
|
private mainViewIsAddListener;
|
|
776
|
+
private isForcingMainViewDivElement;
|
|
777
|
+
private wrapperRectWorkaroundFrame;
|
|
778
|
+
private pendingWrapperRectChange?;
|
|
772
779
|
private mainView;
|
|
773
780
|
private store;
|
|
774
781
|
private viewMode;
|
|
775
782
|
private sideEffectManager;
|
|
776
783
|
private playgroundSizeChangeListenerLocalConsole;
|
|
784
|
+
private sizeUpdatedLocalConsole;
|
|
785
|
+
private cameraUpdatedLocalConsole;
|
|
786
|
+
private cameraReactionLocalConsole;
|
|
777
787
|
constructor(manager: AppManager);
|
|
778
788
|
private syncCamera;
|
|
779
789
|
private startListenWritableChange;
|
|
@@ -782,6 +792,9 @@ declare class MainViewProxy {
|
|
|
782
792
|
private get mainViewSize();
|
|
783
793
|
private get didRelease();
|
|
784
794
|
private moveCameraSizeByAttributes;
|
|
795
|
+
private onWrapperRectChange;
|
|
796
|
+
private runWrapperRectWorkaround;
|
|
797
|
+
private forceSyncMainViewDivElement;
|
|
785
798
|
start(): void;
|
|
786
799
|
addCameraReaction: () => void;
|
|
787
800
|
setCameraAndSize(): void;
|
|
@@ -809,7 +822,9 @@ declare class MainViewProxy {
|
|
|
809
822
|
private addCameraListener;
|
|
810
823
|
private removeCameraListener;
|
|
811
824
|
private _syncMainViewTimer;
|
|
812
|
-
private
|
|
825
|
+
private handleCameraOrSizeUpdated;
|
|
826
|
+
private onCameraUpdated;
|
|
827
|
+
private onSizeUpdated;
|
|
813
828
|
private ensureMainViewSize;
|
|
814
829
|
private syncMainView;
|
|
815
830
|
moveCameraToContian(size: Size): void;
|
|
@@ -968,6 +983,48 @@ declare class AppManager {
|
|
|
968
983
|
destroy(): void;
|
|
969
984
|
}
|
|
970
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
|
+
|
|
971
1028
|
declare class AppListeners {
|
|
972
1029
|
private manager;
|
|
973
1030
|
private displayer;
|
|
@@ -1312,9 +1369,9 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
|
1312
1369
|
containerSizeRatio: number;
|
|
1313
1370
|
private extendPluginManager?;
|
|
1314
1371
|
private _roomLogger?;
|
|
1372
|
+
attributesDeboundceLog?: ArgusLog;
|
|
1315
1373
|
get Logger(): Logger | undefined;
|
|
1316
1374
|
constructor(context: InvisiblePluginContext);
|
|
1317
|
-
private visibleStateListener;
|
|
1318
1375
|
static onCreate(manager: WindowManager): void;
|
|
1319
1376
|
static mount(params: MountParams, extendClass?: ExtendClass$1): Promise<WindowManager>;
|
|
1320
1377
|
onMainViewScenePathChangeHandler: (scenePath: string) => void;
|