@netless/window-manager 1.0.7-beta.7 → 1.0.7-beta.9
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 +9 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/App/AppContext.ts +1 -0
- package/src/App/AppProxy.ts +1 -0
- package/src/AppManager.ts +22 -4
- package/src/AttributesDelegate.ts +1 -0
- package/src/BoxManager.ts +1 -0
- package/src/Cursor/index.ts +1 -0
- package/src/Utils/extendClass.ts +22 -19
- package/src/index.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1174,6 +1174,7 @@ class AppContext {
|
|
|
1174
1174
|
});
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
|
+
AppContext.kind = "AppContext";
|
|
1177
1178
|
class AppPageStateImpl {
|
|
1178
1179
|
constructor(params) {
|
|
1179
1180
|
this.params = params;
|
|
@@ -3816,6 +3817,7 @@ class TeleBoxCollector {
|
|
|
3816
3817
|
return `${this.namespace}-${className}`;
|
|
3817
3818
|
}
|
|
3818
3819
|
}
|
|
3820
|
+
TeleBoxCollector.kind = "TeleBoxCollector";
|
|
3819
3821
|
var TELE_BOX_MANAGER_EVENT = /* @__PURE__ */ ((TELE_BOX_MANAGER_EVENT2) => {
|
|
3820
3822
|
TELE_BOX_MANAGER_EVENT2["Focused"] = "focused";
|
|
3821
3823
|
TELE_BOX_MANAGER_EVENT2["Blurred"] = "blurred";
|
|
@@ -5322,6 +5324,7 @@ class TeleBoxManager {
|
|
|
5322
5324
|
return;
|
|
5323
5325
|
}
|
|
5324
5326
|
}
|
|
5327
|
+
TeleBoxManager.kind = "TeleBoxManager";
|
|
5325
5328
|
const createBoxManager = (manager, callbacks2, emitter, boxEmitter2, options) => {
|
|
5326
5329
|
const BoxManagerClass = getExtendClass$1(BoxManager, WindowManager.extendClass);
|
|
5327
5330
|
return new BoxManagerClass(
|
|
@@ -5700,6 +5703,7 @@ class BoxManager {
|
|
|
5700
5703
|
this.teleBoxManager.destroy();
|
|
5701
5704
|
}
|
|
5702
5705
|
}
|
|
5706
|
+
BoxManager.kind = "BoxManager";
|
|
5703
5707
|
const log = (...args) => {
|
|
5704
5708
|
if (WindowManager.debug) {
|
|
5705
5709
|
console.log(`[WindowManager]:`, ...args);
|
|
@@ -6965,27 +6969,31 @@ class CursorManager {
|
|
|
6965
6969
|
}
|
|
6966
6970
|
}
|
|
6967
6971
|
}
|
|
6972
|
+
CursorManager.kind = "CursorManager";
|
|
6968
6973
|
function getExtendClass$1(baseClass, extendClass) {
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6974
|
+
if (baseClass.kind && extendClass && Object.keys(extendClass).includes(baseClass.kind)) {
|
|
6975
|
+
switch (baseClass.kind) {
|
|
6976
|
+
case "AppManager":
|
|
6977
|
+
return (extendClass == null ? void 0 : extendClass.AppManager) || AppManager;
|
|
6978
|
+
case "BoxManager":
|
|
6979
|
+
return (extendClass == null ? void 0 : extendClass.BoxManager) || BoxManager;
|
|
6980
|
+
case "AttributesDelegate":
|
|
6981
|
+
return (extendClass == null ? void 0 : extendClass.AttributesDelegate) || AttributesDelegate;
|
|
6982
|
+
case "CursorManager":
|
|
6983
|
+
return (extendClass == null ? void 0 : extendClass.CursorManager) || CursorManager;
|
|
6984
|
+
case "AppProxy":
|
|
6985
|
+
return (extendClass == null ? void 0 : extendClass.AppProxy) || AppProxy;
|
|
6986
|
+
case "AppContext":
|
|
6987
|
+
return (extendClass == null ? void 0 : extendClass.AppContext) || AppContext;
|
|
6988
|
+
case "TeleBoxManager":
|
|
6989
|
+
return (extendClass == null ? void 0 : extendClass.TeleBoxManager) || TeleBoxManager;
|
|
6990
|
+
case "TeleBoxCollector":
|
|
6991
|
+
return (extendClass == null ? void 0 : extendClass.TeleBoxCollector) || TeleBoxCollector;
|
|
6992
|
+
default:
|
|
6993
|
+
return baseClass;
|
|
6994
|
+
}
|
|
6988
6995
|
}
|
|
6996
|
+
return baseClass;
|
|
6989
6997
|
}
|
|
6990
6998
|
var Fields = /* @__PURE__ */ ((Fields2) => {
|
|
6991
6999
|
Fields2["Apps"] = "apps";
|
|
@@ -7202,6 +7210,7 @@ class AttributesDelegate {
|
|
|
7202
7210
|
}
|
|
7203
7211
|
}
|
|
7204
7212
|
}
|
|
7213
|
+
AttributesDelegate.kind = "AttributesDelegate";
|
|
7205
7214
|
const createAttributesDelegate = (extendClass, context = {
|
|
7206
7215
|
getAttributes: () => {
|
|
7207
7216
|
throw new Error("getAttributes not implemented");
|
|
@@ -7231,7 +7240,7 @@ const calculateNextIndex = (index2, pageState) => {
|
|
|
7231
7240
|
return nextIndex;
|
|
7232
7241
|
};
|
|
7233
7242
|
const boxEmitter = new Emittery();
|
|
7234
|
-
class
|
|
7243
|
+
const _AppProxy = class {
|
|
7235
7244
|
constructor(params, manager, appId, isAddApp) {
|
|
7236
7245
|
var _a;
|
|
7237
7246
|
this.params = params;
|
|
@@ -7529,7 +7538,7 @@ class AppProxy {
|
|
|
7529
7538
|
const currentAppState = this.getAppInitState(this.id);
|
|
7530
7539
|
await this.destroy(true, false, true);
|
|
7531
7540
|
const params = this.params;
|
|
7532
|
-
const AppProxyClass = getExtendClass$1(
|
|
7541
|
+
const AppProxyClass = getExtendClass$1(_AppProxy, WindowManager.extendClass);
|
|
7533
7542
|
const appProxy = new AppProxyClass(params, this.manager, this.id, this.isAddApp);
|
|
7534
7543
|
await appProxy.baseInsertApp(true);
|
|
7535
7544
|
(_a = this.boxManager) == null ? void 0 : _a.updateBoxState(currentAppState);
|
|
@@ -7690,7 +7699,9 @@ class AppProxy {
|
|
|
7690
7699
|
close() {
|
|
7691
7700
|
return this.destroy(true, true, false);
|
|
7692
7701
|
}
|
|
7693
|
-
}
|
|
7702
|
+
};
|
|
7703
|
+
let AppProxy = _AppProxy;
|
|
7704
|
+
AppProxy.kind = "AppProxy";
|
|
7694
7705
|
class ViewManager {
|
|
7695
7706
|
constructor(displayer) {
|
|
7696
7707
|
this.displayer = displayer;
|
|
@@ -8505,9 +8516,16 @@ class AppManager {
|
|
|
8505
8516
|
async onCreated() {
|
|
8506
8517
|
var _a;
|
|
8507
8518
|
if (Object.keys(this.attributes.apps).length && this.store.focus) {
|
|
8519
|
+
this._focusAppId = this.store.focus;
|
|
8520
|
+
console.log("onCreated===>", this._focusAppId);
|
|
8508
8521
|
await new Promise((resolve) => {
|
|
8509
8522
|
this._focusAppCreatedResolve = resolve;
|
|
8523
|
+
this._resolveTimer = setTimeout(() => {
|
|
8524
|
+
console.log("onCreated===>3333", this._focusAppId);
|
|
8525
|
+
resolve(this.appProxies.get(this._focusAppId || ""));
|
|
8526
|
+
}, 500);
|
|
8510
8527
|
}).then(() => {
|
|
8528
|
+
console.log("onCreated===>2222", this._focusAppId);
|
|
8511
8529
|
this.focusByAttributes(this.attributes.apps);
|
|
8512
8530
|
});
|
|
8513
8531
|
}
|
|
@@ -8618,7 +8636,11 @@ class AppManager {
|
|
|
8618
8636
|
id2,
|
|
8619
8637
|
false
|
|
8620
8638
|
);
|
|
8621
|
-
if (appProxy && this.
|
|
8639
|
+
if (appProxy && this._focusAppId === id2 && this._focusAppCreatedResolve) {
|
|
8640
|
+
console.log("onCreated===>4444", this._focusAppId);
|
|
8641
|
+
if (this._resolveTimer) {
|
|
8642
|
+
clearTimeout(this._resolveTimer);
|
|
8643
|
+
}
|
|
8622
8644
|
this._focusAppCreatedResolve(appProxy);
|
|
8623
8645
|
}
|
|
8624
8646
|
return appProxy;
|
|
@@ -8843,9 +8865,14 @@ class AppManager {
|
|
|
8843
8865
|
this.sideEffectManager.flushAll();
|
|
8844
8866
|
this._prevFocused = void 0;
|
|
8845
8867
|
this._prevSceneIndex = void 0;
|
|
8868
|
+
if (this._resolveTimer) {
|
|
8869
|
+
clearTimeout(this._resolveTimer);
|
|
8870
|
+
}
|
|
8846
8871
|
this._focusAppCreatedResolve = void 0;
|
|
8872
|
+
this._resolveTimer = void 0;
|
|
8847
8873
|
}
|
|
8848
8874
|
}
|
|
8875
|
+
AppManager.kind = "AppManager";
|
|
8849
8876
|
const ResizeObserver$2 = window.ResizeObserver || ResizeObserver$3;
|
|
8850
8877
|
class ContainerResizeObserver {
|
|
8851
8878
|
constructor(emitter) {
|
|
@@ -19602,40 +19629,43 @@ class ExtendPluginManager {
|
|
|
19602
19629
|
}
|
|
19603
19630
|
}
|
|
19604
19631
|
function getExtendClass(baseClass, extendClass) {
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19617
|
-
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19632
|
+
if (baseClass.kind && extendClass && Object.keys(extendClass).includes(baseClass.kind)) {
|
|
19633
|
+
switch (baseClass.kind) {
|
|
19634
|
+
case "AppManager":
|
|
19635
|
+
return (extendClass == null ? void 0 : extendClass.AppManager) || AppManager;
|
|
19636
|
+
case "BoxManager":
|
|
19637
|
+
return (extendClass == null ? void 0 : extendClass.BoxManager) || BoxManager;
|
|
19638
|
+
case "AttributesDelegate":
|
|
19639
|
+
return (extendClass == null ? void 0 : extendClass.AttributesDelegate) || AttributesDelegate;
|
|
19640
|
+
case "CursorManager":
|
|
19641
|
+
return (extendClass == null ? void 0 : extendClass.CursorManager) || CursorManager;
|
|
19642
|
+
case "AppProxy":
|
|
19643
|
+
return (extendClass == null ? void 0 : extendClass.AppProxy) || AppProxy;
|
|
19644
|
+
case "AppContext":
|
|
19645
|
+
return (extendClass == null ? void 0 : extendClass.AppContext) || AppContext;
|
|
19646
|
+
case "TeleBoxManager":
|
|
19647
|
+
return (extendClass == null ? void 0 : extendClass.TeleBoxManager) || TeleBoxManager;
|
|
19648
|
+
case "TeleBoxCollector":
|
|
19649
|
+
return (extendClass == null ? void 0 : extendClass.TeleBoxCollector) || TeleBoxCollector;
|
|
19650
|
+
default:
|
|
19651
|
+
return baseClass;
|
|
19652
|
+
}
|
|
19624
19653
|
}
|
|
19654
|
+
return baseClass;
|
|
19625
19655
|
}
|
|
19626
19656
|
const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
|
|
19627
19657
|
const _WindowManager = class extends InvisiblePlugin {
|
|
19628
19658
|
constructor(context) {
|
|
19629
19659
|
super(context);
|
|
19630
|
-
this.version = "1.0.7-beta.
|
|
19631
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0-beta.
|
|
19660
|
+
this.version = "1.0.7-beta.9";
|
|
19661
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0-beta.14", "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.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.52" } };
|
|
19632
19662
|
this.emitter = callbacks$1;
|
|
19633
19663
|
this.viewMode = ViewMode.Broadcaster;
|
|
19634
19664
|
this.isReplay = isPlayer(this.displayer);
|
|
19635
19665
|
this._cursorUIDs = [];
|
|
19636
19666
|
this.containerSizeRatio = _WindowManager.containerSizeRatio;
|
|
19637
19667
|
_WindowManager.displayer = context.displayer;
|
|
19638
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0-beta.
|
|
19668
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0-beta.14", "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.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.52" } };
|
|
19639
19669
|
}
|
|
19640
19670
|
static onCreate(manager) {
|
|
19641
19671
|
_WindowManager._resolve(manager);
|