@netless/window-manager 1.0.4 → 1.0.5-beta.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 +1 -0
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/AppManager.ts +18 -2
package/dist/index.mjs
CHANGED
@@ -2541,7 +2541,15 @@ class AppManager {
|
|
2541
2541
|
}
|
2542
2542
|
async onCreated() {
|
2543
2543
|
var _a;
|
2544
|
+
if (Object.keys(this.attributes.apps).length && this.store.focus) {
|
2545
|
+
await new Promise((resolve) => {
|
2546
|
+
this._focusAppCreatedResolve = resolve;
|
2547
|
+
}).then(() => {
|
2548
|
+
this.focusByAttributes(this.attributes.apps);
|
2549
|
+
});
|
2550
|
+
}
|
2544
2551
|
await this.attributesUpdateCallback(this.attributes.apps);
|
2552
|
+
this.focusByAttributes(this.attributes.apps);
|
2545
2553
|
internalEmitter.emit("updateManagerRect");
|
2546
2554
|
boxEmitter.on("move", this.onBoxMove);
|
2547
2555
|
boxEmitter.on("resize", this.onBoxResize);
|
@@ -2627,13 +2635,17 @@ class AppManager {
|
|
2627
2635
|
if (!appAttributes) {
|
2628
2636
|
throw new Error("appAttributes is undefined");
|
2629
2637
|
}
|
2630
|
-
this.appCreateQueue.push(() => {
|
2638
|
+
this.appCreateQueue.push(async () => {
|
2631
2639
|
this.appStatus.set(id2, AppStatus.StartCreate);
|
2632
|
-
|
2640
|
+
const appProxy = await this.baseInsertApp({
|
2633
2641
|
kind: app.kind,
|
2634
2642
|
options: app.options,
|
2635
2643
|
isDynamicPPT: app.isDynamicPPT
|
2636
2644
|
}, id2, false);
|
2645
|
+
if (appProxy && this.store.focus === id2 && this._focusAppCreatedResolve) {
|
2646
|
+
this._focusAppCreatedResolve(appProxy);
|
2647
|
+
}
|
2648
|
+
return appProxy;
|
2637
2649
|
});
|
2638
2650
|
this.focusByAttributes(apps);
|
2639
2651
|
} catch (error) {
|
@@ -2854,6 +2866,7 @@ class AppManager {
|
|
2854
2866
|
this.sideEffectManager.flushAll();
|
2855
2867
|
this._prevFocused = void 0;
|
2856
2868
|
this._prevSceneIndex = void 0;
|
2869
|
+
this._focusAppCreatedResolve = void 0;
|
2857
2870
|
}
|
2858
2871
|
}
|
2859
2872
|
const setupWrapper = (root) => {
|
@@ -5374,12 +5387,15 @@ class MaxTitleBar extends DefaultTitleBar {
|
|
5374
5387
|
}
|
5375
5388
|
setBoxes(boxes) {
|
5376
5389
|
this.boxes = boxes;
|
5390
|
+
if (this.$titleBar) {
|
5391
|
+
this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"), this.state === TELE_BOX_STATE.Maximized && boxes.length > 0);
|
5392
|
+
}
|
5377
5393
|
this.updateTitles();
|
5378
5394
|
}
|
5379
5395
|
setState(state) {
|
5380
5396
|
super.setState(state);
|
5381
5397
|
if (this.$titleBar) {
|
5382
|
-
this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"), state === TELE_BOX_STATE.Maximized);
|
5398
|
+
this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"), state === TELE_BOX_STATE.Maximized && this.boxes.length > 0);
|
5383
5399
|
}
|
5384
5400
|
this.updateTitles();
|
5385
5401
|
}
|
@@ -5404,7 +5420,7 @@ class MaxTitleBar extends DefaultTitleBar {
|
|
5404
5420
|
$titleBar.style.transform = `translate(${x2}px, ${y2}px)`;
|
5405
5421
|
$titleBar.style.width = width + "px";
|
5406
5422
|
$titleBar.classList.add(this.wrapClassName("max-titlebar"));
|
5407
|
-
$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"), this.state === TELE_BOX_STATE.Maximized);
|
5423
|
+
$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"), this.state === TELE_BOX_STATE.Maximized && this.boxes.length > 0);
|
5408
5424
|
$titleBar.classList.toggle(this.wrapClassName("readonly"), this.readonly);
|
5409
5425
|
$titleBar.classList.add(this.wrapClassName(this.darkMode ? "color-scheme-dark" : "color-scheme-light"));
|
5410
5426
|
const $titlesArea = document.createElement("div");
|
@@ -17934,15 +17950,15 @@ const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
|
|
17934
17950
|
const _WindowManager = class extends InvisiblePlugin {
|
17935
17951
|
constructor(context) {
|
17936
17952
|
super(context);
|
17937
|
-
this.version = "1.0.
|
17938
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.
|
17953
|
+
this.version = "1.0.5-beta.1";
|
17954
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.32-beta.1", "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.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@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.22", "@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.52" } };
|
17939
17955
|
this.emitter = callbacks$1;
|
17940
17956
|
this.viewMode = ViewMode.Broadcaster;
|
17941
17957
|
this.isReplay = isPlayer(this.displayer);
|
17942
17958
|
this._cursorUIDs = [];
|
17943
17959
|
this.containerSizeRatio = _WindowManager.containerSizeRatio;
|
17944
17960
|
_WindowManager.displayer = context.displayer;
|
17945
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.
|
17961
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.32-beta.1", "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.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@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.22", "@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.52" } };
|
17946
17962
|
}
|
17947
17963
|
static onCreate(manager) {
|
17948
17964
|
_WindowManager._resolve(manager);
|