@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.
package/dist/index.esm.js CHANGED
@@ -7,7 +7,7 @@ function setCurrentRunningApp(appInstance) {
7
7
  currentRunningApp = appInstance;
8
8
  }
9
9
  var windowNativeFuncMap = /* @__PURE__ */ new Map();
10
- var list = [
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
 
@@ -1430,8 +1425,8 @@ var MicroAppModel = class {
1430
1425
  if (container && this.container) {
1431
1426
  if (container instanceof Element) container.setAttribute(CSS_ATTRIBUTE_KEY, this.name);
1432
1427
  const fragment = document.createDocumentFragment();
1433
- const list2 = Array.from(this.container.childNodes);
1434
- for (const node of list2) {
1428
+ const list = Array.from(this.container.childNodes);
1429
+ for (const node of list) {
1435
1430
  node.__BK_WEWEB_APP_KEY__ = this.appCacheKey;
1436
1431
  Object.defineProperties(node, {
1437
1432
  ownerDocument: {
@@ -1861,16 +1856,16 @@ var AppCache = class {
1861
1856
  return this.baseSource.getStyle(urlOrCode);
1862
1857
  }
1863
1858
  getCacheHtml(url) {
1864
- const list2 = Array.from(this.cache.values());
1865
- const app = list2.find((item) => item.url === url);
1859
+ const list = Array.from(this.cache.values());
1860
+ const app = list.find((item) => item.url === url);
1866
1861
  if (app) return app.source?.rawHtml || "";
1867
1862
  return "";
1868
1863
  }
1869
1864
  getCacheScript(url) {
1870
1865
  let script = this.baseSource.getScript(url);
1871
1866
  if (script) return;
1872
- const list2 = Array.from(this.cache.values());
1873
- list2.some((app) => {
1867
+ const list = Array.from(this.cache.values());
1868
+ list.some((app) => {
1874
1869
  script = app.source?.getScript(url);
1875
1870
  return !!script;
1876
1871
  });
@@ -1879,8 +1874,8 @@ var AppCache = class {
1879
1874
  getCacheStyle(url) {
1880
1875
  let style = this.baseSource.getStyle(url);
1881
1876
  if (style) return;
1882
- const list2 = Array.from(this.cache.values());
1883
- list2.some((app) => {
1877
+ const list = Array.from(this.cache.values());
1878
+ list.some((app) => {
1884
1879
  style = app.source?.getStyle(url);
1885
1880
  return !!style;
1886
1881
  });