@netless/window-manager 0.4.39 → 0.4.40
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/CHANGELOG.md +5 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +13 -7
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/pnpm-lock.yaml +2927 -4336
- package/src/App/AppProxy.ts +1 -0
- package/src/Register/index.ts +9 -4
- package/src/index.ts +2 -2
package/src/App/AppProxy.ts
CHANGED
@@ -188,6 +188,7 @@ export class AppProxy implements PageRemoveService {
|
|
188
188
|
this.setViewFocusScenePath();
|
189
189
|
setTimeout(async () => {
|
190
190
|
// 延迟执行 setup, 防止初始化的属性没有更新成功
|
191
|
+
console.log("setup app", app);
|
191
192
|
const result = await app.setup(context);
|
192
193
|
this.appResult = result;
|
193
194
|
appRegister.notifyApp(this.kind, "created", { appId, result });
|
package/src/Register/index.ts
CHANGED
@@ -32,18 +32,23 @@ class AppRegister {
|
|
32
32
|
this.registered.set(params.kind, params);
|
33
33
|
|
34
34
|
const paramSrc = params.src;
|
35
|
-
let srcOrAppOrFunction: () => Promise<NetlessApp>;
|
36
35
|
let downloadApp: () => Promise<NetlessApp>;
|
37
36
|
|
38
37
|
if (typeof paramSrc === "string") {
|
39
|
-
|
38
|
+
downloadApp = async () => {
|
39
|
+
const result = await loadApp(paramSrc, params.kind, params.name) as any;
|
40
|
+
if (result.__esModule) {
|
41
|
+
return result.default;
|
42
|
+
}
|
43
|
+
return result;
|
44
|
+
};
|
40
45
|
if (this.syncRegisterApp) {
|
41
46
|
this.syncRegisterApp({ kind: params.kind, src: paramSrc, name: params.name });
|
42
47
|
}
|
43
48
|
}
|
44
49
|
if (typeof paramSrc === "function") {
|
45
50
|
downloadApp = async () => {
|
46
|
-
let appClass = await
|
51
|
+
let appClass = await paramSrc() as any;
|
47
52
|
if (appClass) {
|
48
53
|
if (appClass.__esModule) {
|
49
54
|
appClass = appClass.default;
|
@@ -51,7 +56,7 @@ class AppRegister {
|
|
51
56
|
return appClass;
|
52
57
|
} else {
|
53
58
|
throw new Error(
|
54
|
-
`[WindowManager]: load remote script failed, ${
|
59
|
+
`[WindowManager]: load remote script failed, ${paramSrc}`
|
55
60
|
);
|
56
61
|
}
|
57
62
|
};
|
package/src/index.ts
CHANGED
@@ -142,7 +142,7 @@ export type MountParams = {
|
|
142
142
|
|
143
143
|
export const reconnectRefresher = new ReconnectRefresher({ emitter });
|
144
144
|
|
145
|
-
export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> implements PageController {
|
145
|
+
export class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any> implements PageController {
|
146
146
|
public static kind = "WindowManager";
|
147
147
|
public static displayer: Displayer;
|
148
148
|
public static wrapper?: HTMLElement;
|
@@ -218,7 +218,7 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> imple
|
|
218
218
|
throw new Error();
|
219
219
|
}
|
220
220
|
},
|
221
|
-
{ retries: 10 }
|
221
|
+
{ retries: 10 } as any,
|
222
222
|
);
|
223
223
|
}
|
224
224
|
|