@netless/window-manager 1.0.17 → 1.0.19
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 +10 -0
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +178 -12
- package/dist/index.mjs.map +1 -1
- package/docs/cn/box-size-change.md +144 -0
- package/package.json +3 -3
- package/src/App/AppBoxSizeSynchronizer.ts +124 -0
- package/src/App/AppContext.ts +2 -0
- package/src/App/AppProxy.ts +23 -0
- package/src/AppManager.ts +22 -2
- package/src/BoxManager.ts +15 -0
- package/src/Register/storage.ts +6 -3
- package/src/index.ts +11 -1
- package/src/typings.ts +2 -0
package/dist/index.mjs
CHANGED
|
@@ -125,8 +125,8 @@ const internalEmitter = new Emittery();
|
|
|
125
125
|
const DatabaseName = "__WindowManagerAppCache";
|
|
126
126
|
let db;
|
|
127
127
|
let store;
|
|
128
|
-
const initDb = async () => {
|
|
129
|
-
db = await createDb();
|
|
128
|
+
const initDb = async (onBlocked) => {
|
|
129
|
+
db = await createDb(onBlocked);
|
|
130
130
|
};
|
|
131
131
|
const setItem = (key, val) => {
|
|
132
132
|
if (!db)
|
|
@@ -138,12 +138,15 @@ const getItem = async (key) => {
|
|
|
138
138
|
return null;
|
|
139
139
|
return await query(db, key);
|
|
140
140
|
};
|
|
141
|
-
function createDb() {
|
|
141
|
+
function createDb(onBlocked) {
|
|
142
142
|
return new Promise((resolve, reject) => {
|
|
143
143
|
const request = indexedDB.open(DatabaseName, 2);
|
|
144
144
|
request.onerror = (e2) => {
|
|
145
145
|
reject(e2);
|
|
146
146
|
};
|
|
147
|
+
request.onblocked = () => {
|
|
148
|
+
onBlocked == null ? void 0 : onBlocked();
|
|
149
|
+
};
|
|
147
150
|
request.onupgradeneeded = (event) => {
|
|
148
151
|
const db2 = event.target.result;
|
|
149
152
|
if (!db2.objectStoreNames.contains("apps")) {
|
|
@@ -1013,9 +1016,11 @@ class AppContext {
|
|
|
1013
1016
|
const view = this.getView();
|
|
1014
1017
|
if (view) {
|
|
1015
1018
|
view.divElement = dom;
|
|
1019
|
+
this.appProxy.scheduleBoxSizeSync();
|
|
1016
1020
|
setTimeout(() => {
|
|
1017
1021
|
var _a;
|
|
1018
1022
|
(_a = this.getRoom()) == null ? void 0 : _a.refreshViewSize();
|
|
1023
|
+
this.appProxy.scheduleBoxSizeSync();
|
|
1019
1024
|
callbacks.emit("onAppViewMounted", { appId: this.appId, view });
|
|
1020
1025
|
}, 1e3);
|
|
1021
1026
|
}
|
|
@@ -5334,6 +5339,10 @@ const createBoxManager = (manager, callbacks2, emitter, boxEmitter2, options) =>
|
|
|
5334
5339
|
var _a;
|
|
5335
5340
|
return (_a = manager.appManager) == null ? void 0 : _a.notifyContainerRectUpdate(rect);
|
|
5336
5341
|
},
|
|
5342
|
+
scheduleAppBoxSizeSync: (appId) => {
|
|
5343
|
+
var _a;
|
|
5344
|
+
return (_a = manager.appManager) == null ? void 0 : _a.scheduleAppBoxSizeSync(appId);
|
|
5345
|
+
},
|
|
5337
5346
|
cleanFocus: () => {
|
|
5338
5347
|
var _a;
|
|
5339
5348
|
return (_a = manager.appManager) == null ? void 0 : _a.store.cleanFocus();
|
|
@@ -5412,6 +5421,9 @@ class BoxManager {
|
|
|
5412
5421
|
});
|
|
5413
5422
|
}, 200)
|
|
5414
5423
|
);
|
|
5424
|
+
this.teleBoxManager.events.on("visual_resize", (box) => {
|
|
5425
|
+
this.context.scheduleAppBoxSizeSync(box.id);
|
|
5426
|
+
});
|
|
5415
5427
|
this.teleBoxManager.events.on("focused", (box) => {
|
|
5416
5428
|
if (box) {
|
|
5417
5429
|
if (this.canOperate) {
|
|
@@ -5434,6 +5446,7 @@ class BoxManager {
|
|
|
5434
5446
|
this.teleBoxManager.events.on(
|
|
5435
5447
|
"box_status",
|
|
5436
5448
|
(box) => {
|
|
5449
|
+
this.context.scheduleAppBoxSizeSync(box.id);
|
|
5437
5450
|
if (this.canOperate) {
|
|
5438
5451
|
this.context.setBoxStatus(box.id, box.boxStatus);
|
|
5439
5452
|
}
|
|
@@ -5520,6 +5533,7 @@ class BoxManager {
|
|
|
5520
5533
|
setBoxesStatus(status) {
|
|
5521
5534
|
const map = new Map(Object.entries(status != null ? status : {}));
|
|
5522
5535
|
this.teleBoxManager.setBoxesStatus(map, true);
|
|
5536
|
+
this.context.scheduleAppBoxSizeSync();
|
|
5523
5537
|
this.context.callbacks.emit("onBoxesStatusChange", map);
|
|
5524
5538
|
this.context.emitter.emit("boxesStatusChange", map);
|
|
5525
5539
|
}
|
|
@@ -5612,6 +5626,7 @@ class BoxManager {
|
|
|
5612
5626
|
if (state.minimized != null) {
|
|
5613
5627
|
this.teleBoxManager.setMinimized(Boolean(state.minimized), true);
|
|
5614
5628
|
}
|
|
5629
|
+
this.context.scheduleAppBoxSizeSync(box.id);
|
|
5615
5630
|
}, 50);
|
|
5616
5631
|
if (!state.boxStatus) {
|
|
5617
5632
|
this.context.callbacks.emit("boxStateChange", this.teleBoxManager.state);
|
|
@@ -5625,6 +5640,7 @@ class BoxManager {
|
|
|
5625
5640
|
const containerRect = { x: 0, y: 0, width: rect.width, height: rect.height };
|
|
5626
5641
|
this.teleBoxManager.setContainerRect(containerRect);
|
|
5627
5642
|
this.context.notifyContainerRectUpdate(this.teleBoxManager.containerRect);
|
|
5643
|
+
this.context.scheduleAppBoxSizeSync();
|
|
5628
5644
|
}
|
|
5629
5645
|
}
|
|
5630
5646
|
moveBox({ appId, x, y }) {
|
|
@@ -5635,6 +5651,7 @@ class BoxManager {
|
|
|
5635
5651
|
}
|
|
5636
5652
|
resizeBox({ appId, width, height, skipUpdate }) {
|
|
5637
5653
|
this.teleBoxManager.update(appId, { width, height }, skipUpdate);
|
|
5654
|
+
this.context.scheduleAppBoxSizeSync(appId);
|
|
5638
5655
|
}
|
|
5639
5656
|
setBoxMinSize(params) {
|
|
5640
5657
|
this.teleBoxManager.update(
|
|
@@ -5645,6 +5662,7 @@ class BoxManager {
|
|
|
5645
5662
|
},
|
|
5646
5663
|
true
|
|
5647
5664
|
);
|
|
5665
|
+
this.context.scheduleAppBoxSizeSync(params.appId);
|
|
5648
5666
|
}
|
|
5649
5667
|
setBoxTitle(params) {
|
|
5650
5668
|
this.teleBoxManager.update(params.appId, { title: params.title }, true);
|
|
@@ -5658,10 +5676,12 @@ class BoxManager {
|
|
|
5658
5676
|
setMaximized(maximized, skipUpdate = true) {
|
|
5659
5677
|
if (maximized !== this.maximized) {
|
|
5660
5678
|
this.teleBoxManager.setMaximized(maximized, skipUpdate);
|
|
5679
|
+
this.context.scheduleAppBoxSizeSync();
|
|
5661
5680
|
}
|
|
5662
5681
|
}
|
|
5663
5682
|
setMinimized(minimized, skipUpdate = true) {
|
|
5664
5683
|
this.teleBoxManager.setMinimized(minimized, skipUpdate);
|
|
5684
|
+
this.context.scheduleAppBoxSizeSync();
|
|
5665
5685
|
}
|
|
5666
5686
|
focusTopBox() {
|
|
5667
5687
|
const boxes = this.teleBoxManager.query();
|
|
@@ -5674,6 +5694,7 @@ class BoxManager {
|
|
|
5674
5694
|
}
|
|
5675
5695
|
updateBox(id, payload, skipUpdate = true) {
|
|
5676
5696
|
this.teleBoxManager.update(id, payload, skipUpdate);
|
|
5697
|
+
this.context.scheduleAppBoxSizeSync(id);
|
|
5677
5698
|
}
|
|
5678
5699
|
setReadonly(readonly) {
|
|
5679
5700
|
this.teleBoxManager.setReadonly(readonly);
|
|
@@ -7490,6 +7511,97 @@ const calculateNextIndex = (index2, pageState) => {
|
|
|
7490
7511
|
return nextIndex;
|
|
7491
7512
|
};
|
|
7492
7513
|
const boxEmitter = new Emittery();
|
|
7514
|
+
const BOX_SIZE_EPSILON = 0.5;
|
|
7515
|
+
const BOX_SIZE_SETTLE_DELAY = 650;
|
|
7516
|
+
const BOX_SIZE_CONFIRM_DELAY = 100;
|
|
7517
|
+
const sizesEqual = (left, right) => Boolean(
|
|
7518
|
+
left && Math.abs(left.width - right.width) <= BOX_SIZE_EPSILON && Math.abs(left.height - right.height) <= BOX_SIZE_EPSILON
|
|
7519
|
+
);
|
|
7520
|
+
class AppBoxSizeSynchronizer {
|
|
7521
|
+
constructor(appId, getView, getElement, notify, onError) {
|
|
7522
|
+
this.appId = appId;
|
|
7523
|
+
this.getView = getView;
|
|
7524
|
+
this.getElement = getElement;
|
|
7525
|
+
this.notify = notify;
|
|
7526
|
+
this.onError = onError;
|
|
7527
|
+
this.destroyed = false;
|
|
7528
|
+
this.schedule = () => {
|
|
7529
|
+
if (this.destroyed)
|
|
7530
|
+
return;
|
|
7531
|
+
if (this.timer != null)
|
|
7532
|
+
clearTimeout(this.timer);
|
|
7533
|
+
if (this.frame != null) {
|
|
7534
|
+
cancelAnimationFrame(this.frame);
|
|
7535
|
+
this.frame = void 0;
|
|
7536
|
+
}
|
|
7537
|
+
this.pendingSize = void 0;
|
|
7538
|
+
this.timer = setTimeout(() => {
|
|
7539
|
+
this.timer = void 0;
|
|
7540
|
+
this.frame = requestAnimationFrame(this.confirmDOMSize);
|
|
7541
|
+
}, BOX_SIZE_SETTLE_DELAY);
|
|
7542
|
+
};
|
|
7543
|
+
this.confirmDOMSize = () => {
|
|
7544
|
+
var _a, _b, _c, _d;
|
|
7545
|
+
this.frame = void 0;
|
|
7546
|
+
if (this.destroyed)
|
|
7547
|
+
return;
|
|
7548
|
+
const element2 = this.getElement();
|
|
7549
|
+
if (!element2)
|
|
7550
|
+
return;
|
|
7551
|
+
const rect = element2.getBoundingClientRect();
|
|
7552
|
+
const size2 = { width: rect.width, height: rect.height };
|
|
7553
|
+
if (!Number.isFinite(size2.width) || !Number.isFinite(size2.height) || size2.width <= 0 || size2.height <= 0) {
|
|
7554
|
+
this.pendingSize = void 0;
|
|
7555
|
+
return;
|
|
7556
|
+
}
|
|
7557
|
+
if (!sizesEqual(this.pendingSize, size2)) {
|
|
7558
|
+
this.pendingSize = size2;
|
|
7559
|
+
this.timer = setTimeout(() => {
|
|
7560
|
+
this.timer = void 0;
|
|
7561
|
+
this.frame = requestAnimationFrame(this.confirmDOMSize);
|
|
7562
|
+
}, BOX_SIZE_CONFIRM_DELAY);
|
|
7563
|
+
return;
|
|
7564
|
+
}
|
|
7565
|
+
this.pendingSize = void 0;
|
|
7566
|
+
const view = this.getView();
|
|
7567
|
+
if (view && !sizesEqual(view.size, size2)) {
|
|
7568
|
+
try {
|
|
7569
|
+
if (typeof view.refreshSize === "function") {
|
|
7570
|
+
view.refreshSize(size2.width, size2.height);
|
|
7571
|
+
} else if (typeof ((_a = view.screen) == null ? void 0 : _a.refreshSize) === "function") {
|
|
7572
|
+
const resizeObserver = view.screen.resizeObserver;
|
|
7573
|
+
(_b = resizeObserver == null ? void 0 : resizeObserver.disconnect) == null ? void 0 : _b.call(resizeObserver);
|
|
7574
|
+
try {
|
|
7575
|
+
view.screen.refreshSize(size2.width, size2.height);
|
|
7576
|
+
} finally {
|
|
7577
|
+
if (view.divElement)
|
|
7578
|
+
(_c = resizeObserver == null ? void 0 : resizeObserver.observe) == null ? void 0 : _c.call(resizeObserver, view.divElement);
|
|
7579
|
+
}
|
|
7580
|
+
}
|
|
7581
|
+
} catch (error) {
|
|
7582
|
+
(_d = this.onError) == null ? void 0 : _d.call(this, error);
|
|
7583
|
+
}
|
|
7584
|
+
}
|
|
7585
|
+
if (!sizesEqual(this.lastNotifiedSize, size2)) {
|
|
7586
|
+
this.lastNotifiedSize = size2;
|
|
7587
|
+
this.notify({ appId: this.appId, ...size2 });
|
|
7588
|
+
}
|
|
7589
|
+
};
|
|
7590
|
+
}
|
|
7591
|
+
destroy() {
|
|
7592
|
+
this.destroyed = true;
|
|
7593
|
+
if (this.timer != null) {
|
|
7594
|
+
clearTimeout(this.timer);
|
|
7595
|
+
this.timer = void 0;
|
|
7596
|
+
}
|
|
7597
|
+
if (this.frame != null) {
|
|
7598
|
+
cancelAnimationFrame(this.frame);
|
|
7599
|
+
this.frame = void 0;
|
|
7600
|
+
}
|
|
7601
|
+
this.pendingSize = void 0;
|
|
7602
|
+
this.lastNotifiedSize = void 0;
|
|
7603
|
+
}
|
|
7604
|
+
}
|
|
7493
7605
|
const _AppProxy = class {
|
|
7494
7606
|
constructor(params, manager, appId, isAddApp) {
|
|
7495
7607
|
var _a;
|
|
@@ -7500,6 +7612,10 @@ const _AppProxy = class {
|
|
|
7500
7612
|
this.viewManager = this.manager.viewManager;
|
|
7501
7613
|
this.store = this.manager.store;
|
|
7502
7614
|
this.status = "normal";
|
|
7615
|
+
this.scheduleBoxSizeSync = () => {
|
|
7616
|
+
if (this.status !== "destroyed")
|
|
7617
|
+
this.boxSizeSynchronizer.schedule();
|
|
7618
|
+
};
|
|
7503
7619
|
this.getAppInitState = (id) => {
|
|
7504
7620
|
var _a2, _b, _c, _d;
|
|
7505
7621
|
const attrs = this.store.getAppState(id);
|
|
@@ -7594,6 +7710,26 @@ const _AppProxy = class {
|
|
|
7594
7710
|
this.stateKey = `${this.id}_state`;
|
|
7595
7711
|
this.appProxies.set(this.id, this);
|
|
7596
7712
|
this.appEmitter = new Emittery();
|
|
7713
|
+
this.boxSizeSynchronizer = new AppBoxSizeSynchronizer(
|
|
7714
|
+
this.id,
|
|
7715
|
+
() => this.view,
|
|
7716
|
+
() => {
|
|
7717
|
+
var _a2, _b;
|
|
7718
|
+
return ((_a2 = this.view) == null ? void 0 : _a2.divElement) || ((_b = this.box) == null ? void 0 : _b.$content);
|
|
7719
|
+
},
|
|
7720
|
+
(payload) => {
|
|
7721
|
+
this.appEmitter.emit("boxSizeChange", payload).catch((error) => {
|
|
7722
|
+
var _a2;
|
|
7723
|
+
(_a2 = this.Logger) == null ? void 0 : _a2.error(
|
|
7724
|
+
`[WindowManager]: failed to notify app box size change: ${error}`
|
|
7725
|
+
);
|
|
7726
|
+
});
|
|
7727
|
+
},
|
|
7728
|
+
(error) => {
|
|
7729
|
+
var _a2;
|
|
7730
|
+
(_a2 = this.Logger) == null ? void 0 : _a2.error(`[WindowManager]: failed to refresh app view size: ${error}`);
|
|
7731
|
+
}
|
|
7732
|
+
);
|
|
7597
7733
|
this.appListener = this.makeAppEventListener(this.id);
|
|
7598
7734
|
this.isAddApp = isAddApp;
|
|
7599
7735
|
this.initScenes();
|
|
@@ -7724,6 +7860,7 @@ const _AppProxy = class {
|
|
|
7724
7860
|
);
|
|
7725
7861
|
const result = await app.setup(context);
|
|
7726
7862
|
this.appResult = result;
|
|
7863
|
+
this.scheduleBoxSizeSync();
|
|
7727
7864
|
appRegister.notifyApp(this.kind, "created", { appId, result });
|
|
7728
7865
|
this.afterSetupApp(boxInitState);
|
|
7729
7866
|
this.fixMobileSize();
|
|
@@ -7931,6 +8068,7 @@ const _AppProxy = class {
|
|
|
7931
8068
|
if (this.status === "destroyed")
|
|
7932
8069
|
return;
|
|
7933
8070
|
this.status = "destroyed";
|
|
8071
|
+
this.boxSizeSynchronizer.destroy();
|
|
7934
8072
|
try {
|
|
7935
8073
|
await appRegister.notifyApp(this.kind, "destroy", { appId: this.id });
|
|
7936
8074
|
await this.appEmitter.emit("destroy", { error });
|
|
@@ -8634,6 +8772,15 @@ class AppManager {
|
|
|
8634
8772
|
});
|
|
8635
8773
|
callbacks.emit("onBoxResize", payload);
|
|
8636
8774
|
}
|
|
8775
|
+
this.scheduleAppBoxSizeSync(payload.appId);
|
|
8776
|
+
};
|
|
8777
|
+
this.scheduleAppBoxSizeSync = (appId) => {
|
|
8778
|
+
var _a;
|
|
8779
|
+
if (appId) {
|
|
8780
|
+
(_a = this.appProxies.get(appId)) == null ? void 0 : _a.scheduleBoxSizeSync();
|
|
8781
|
+
} else {
|
|
8782
|
+
this.appProxies.forEach((appProxy) => appProxy.scheduleBoxSizeSync());
|
|
8783
|
+
}
|
|
8637
8784
|
};
|
|
8638
8785
|
this.onBoxFocus = (payload) => {
|
|
8639
8786
|
this.windowManger.safeSetAttributes({ focus: payload.appId });
|
|
@@ -9109,11 +9256,19 @@ class AppManager {
|
|
|
9109
9256
|
return rect;
|
|
9110
9257
|
}
|
|
9111
9258
|
setMainViewFocusPath(scenePath) {
|
|
9112
|
-
var _a;
|
|
9259
|
+
var _a, _b;
|
|
9113
9260
|
const focusScenePath = scenePath || this.store.getMainViewScenePath();
|
|
9114
9261
|
if (focusScenePath) {
|
|
9115
|
-
|
|
9116
|
-
|
|
9262
|
+
try {
|
|
9263
|
+
setViewFocusScenePath(this.mainView, focusScenePath);
|
|
9264
|
+
return ((_a = this.mainView) == null ? void 0 : _a.focusScenePath) === focusScenePath;
|
|
9265
|
+
} catch (error) {
|
|
9266
|
+
const cause = error instanceof Error ? error : new Error(String(error));
|
|
9267
|
+
(_b = this.Logger) == null ? void 0 : _b.error(
|
|
9268
|
+
`[WindowManager]: set main view focus scene path failed, focusScenePath: ${focusScenePath}, didRelease: ${Boolean(this.mainView.didRelease)}, error: ${cause.message}, stack: ${cause.stack || ""}`
|
|
9269
|
+
);
|
|
9270
|
+
return false;
|
|
9271
|
+
}
|
|
9117
9272
|
}
|
|
9118
9273
|
}
|
|
9119
9274
|
resetScenePath(scenePath) {
|
|
@@ -10232,8 +10387,8 @@ const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
|
|
|
10232
10387
|
const _WindowManager = class extends InvisiblePlugin {
|
|
10233
10388
|
constructor(context) {
|
|
10234
10389
|
super(context);
|
|
10235
|
-
this.version = "1.0.
|
|
10236
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.
|
|
10390
|
+
this.version = "1.0.19";
|
|
10391
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.57" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@netless/app-presentation": "^0.1.10", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "1.0.0-next.30", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "^2.16.57" } };
|
|
10237
10392
|
this.emitter = callbacks;
|
|
10238
10393
|
this.viewMode = ViewMode.Broadcaster;
|
|
10239
10394
|
this.isReplay = isPlayer(this.displayer);
|
|
@@ -10263,7 +10418,7 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
|
10263
10418
|
);
|
|
10264
10419
|
};
|
|
10265
10420
|
_WindowManager.displayer = context.displayer;
|
|
10266
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.
|
|
10421
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.57" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@netless/app-presentation": "^0.1.10", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "1.0.0-next.30", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "^2.16.57" } };
|
|
10267
10422
|
this.emitter.on("mainViewScenePathChange", this.onMainViewScenePathChangeHandler);
|
|
10268
10423
|
}
|
|
10269
10424
|
get Logger() {
|
|
@@ -10273,7 +10428,7 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
|
10273
10428
|
_WindowManager._resolve(manager);
|
|
10274
10429
|
}
|
|
10275
10430
|
static async mount(params, extendClass) {
|
|
10276
|
-
var _a;
|
|
10431
|
+
var _a, _b, _c, _d, _e;
|
|
10277
10432
|
const room = params.room;
|
|
10278
10433
|
_WindowManager.container = params.container;
|
|
10279
10434
|
_WindowManager.supportAppliancePlugin = params.supportAppliancePlugin;
|
|
@@ -10310,8 +10465,14 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
|
10310
10465
|
}
|
|
10311
10466
|
}
|
|
10312
10467
|
if (_WindowManager.isCreated) {
|
|
10468
|
+
(_a = manager == null ? void 0 : manager._roomLogger) == null ? void 0 : _a.error(
|
|
10469
|
+
"[WindowManager] mount duplicate check failed: isCreated=true"
|
|
10470
|
+
);
|
|
10313
10471
|
throw new Error("[WindowManager]: Already created cannot be created again");
|
|
10314
10472
|
}
|
|
10473
|
+
(_b = manager == null ? void 0 : manager._roomLogger) == null ? void 0 : _b.info(
|
|
10474
|
+
`[WindowManager] mount duplicate check passed: isCreated=${_WindowManager.isCreated}`
|
|
10475
|
+
);
|
|
10315
10476
|
this.debug = Boolean(debug);
|
|
10316
10477
|
if (manager == null ? void 0 : manager._roomLogger) {
|
|
10317
10478
|
manager._roomLogger.info(
|
|
@@ -10377,9 +10538,14 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
|
10377
10538
|
);
|
|
10378
10539
|
}
|
|
10379
10540
|
try {
|
|
10380
|
-
|
|
10541
|
+
(_c = manager._roomLogger) == null ? void 0 : _c.info("[WindowManager] indexedDB open start");
|
|
10542
|
+
await initDb(() => {
|
|
10543
|
+
var _a2;
|
|
10544
|
+
(_a2 = manager == null ? void 0 : manager._roomLogger) == null ? void 0 : _a2.warn("[WindowManager] indexedDB open blocked");
|
|
10545
|
+
});
|
|
10546
|
+
(_d = manager._roomLogger) == null ? void 0 : _d.info("[WindowManager] indexedDB open success");
|
|
10381
10547
|
} catch (error) {
|
|
10382
|
-
(
|
|
10548
|
+
(_e = manager._roomLogger) == null ? void 0 : _e.warn(`[WindowManager] indexedDB open failed: ${error.message}`);
|
|
10383
10549
|
console.warn("[WindowManager]: indexedDB open failed");
|
|
10384
10550
|
console.log(error);
|
|
10385
10551
|
}
|