@blueking/bk-weweb 0.0.29-beta.2 → 0.0.29-beta.3
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.
|
@@ -7,7 +7,7 @@ function setCurrentRunningApp(appInstance) {
|
|
|
7
7
|
currentRunningApp = appInstance;
|
|
8
8
|
}
|
|
9
9
|
var windowNativeFuncMap = /* @__PURE__ */ new Map();
|
|
10
|
-
var
|
|
10
|
+
var globalContextCode = `const { ${[
|
|
11
11
|
"Array",
|
|
12
12
|
"ArrayBuffer",
|
|
13
13
|
"Boolean",
|
|
@@ -65,8 +65,7 @@ var list = [
|
|
|
65
65
|
"valueOf",
|
|
66
66
|
"WeakMap",
|
|
67
67
|
"WeakSet"
|
|
68
|
-
]
|
|
69
|
-
var globalContextCode = list.join(",");
|
|
68
|
+
].join(",")} }= window.rawWindow;`;
|
|
70
69
|
var getGlobalContextCode = () => {
|
|
71
70
|
return globalContextCode;
|
|
72
71
|
};
|
|
@@ -75,12 +74,8 @@ var collectNativeWindowFunc = () => {
|
|
|
75
74
|
for (const key of keyList) {
|
|
76
75
|
if (!windowNativeFuncMap.has(key) && key.match(/^[A-Z]/) && typeof window[key] === "function" && window[key].toString().includes("[native code]")) {
|
|
77
76
|
windowNativeFuncMap.set(key, true);
|
|
78
|
-
if (!list.includes(key)) {
|
|
79
|
-
globalContextCode += `,${key}`;
|
|
80
|
-
}
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
|
-
globalContextCode = `const { ${globalContextCode} }= window.rawWindow;`;
|
|
84
79
|
};
|
|
85
80
|
collectNativeWindowFunc();
|
|
86
81
|
|
|
@@ -1740,8 +1735,8 @@ var MicroAppModel = class {
|
|
|
1740
1735
|
if (container && this.container) {
|
|
1741
1736
|
if (container instanceof Element) container.setAttribute(CSS_ATTRIBUTE_KEY, this.name);
|
|
1742
1737
|
const fragment = document.createDocumentFragment();
|
|
1743
|
-
const
|
|
1744
|
-
for (const node of
|
|
1738
|
+
const list = Array.from(this.container.childNodes);
|
|
1739
|
+
for (const node of list) {
|
|
1745
1740
|
node.__BK_WEWEB_APP_KEY__ = this.appCacheKey;
|
|
1746
1741
|
Object.defineProperties(node, {
|
|
1747
1742
|
ownerDocument: {
|
|
@@ -2104,16 +2099,16 @@ var AppCache = class {
|
|
|
2104
2099
|
return this.baseSource.getStyle(urlOrCode);
|
|
2105
2100
|
}
|
|
2106
2101
|
getCacheHtml(url) {
|
|
2107
|
-
const
|
|
2108
|
-
const app =
|
|
2102
|
+
const list = Array.from(this.cache.values());
|
|
2103
|
+
const app = list.find((item) => item.url === url);
|
|
2109
2104
|
if (app) return app.source?.rawHtml || "";
|
|
2110
2105
|
return "";
|
|
2111
2106
|
}
|
|
2112
2107
|
getCacheScript(url) {
|
|
2113
2108
|
let script = this.baseSource.getScript(url);
|
|
2114
2109
|
if (script) return;
|
|
2115
|
-
const
|
|
2116
|
-
|
|
2110
|
+
const list = Array.from(this.cache.values());
|
|
2111
|
+
list.some((app) => {
|
|
2117
2112
|
script = app.source?.getScript(url);
|
|
2118
2113
|
return !!script;
|
|
2119
2114
|
});
|
|
@@ -2122,8 +2117,8 @@ var AppCache = class {
|
|
|
2122
2117
|
getCacheStyle(url) {
|
|
2123
2118
|
let style = this.baseSource.getStyle(url);
|
|
2124
2119
|
if (style) return;
|
|
2125
|
-
const
|
|
2126
|
-
|
|
2120
|
+
const list = Array.from(this.cache.values());
|
|
2121
|
+
list.some((app) => {
|
|
2127
2122
|
style = app.source?.getStyle(url);
|
|
2128
2123
|
return !!style;
|
|
2129
2124
|
});
|