@blueking/bk-weweb 0.0.35-beta.4 → 0.0.35-beta.6

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
@@ -84,7 +84,11 @@ var GLOBAL_CONTEXT_VARIABLES = [
84
84
  "URIError",
85
85
  "valueOf",
86
86
  "WeakMap",
87
- "WeakSet"
87
+ "WeakSet",
88
+ "requestAnimationFrame",
89
+ "cancelAnimationFrame",
90
+ "requestIdleCallback",
91
+ "cancelIdleCallback"
88
92
  ];
89
93
  var getGlobalContextCode = () => `const { ${GLOBAL_CONTEXT_VARIABLES.join(",")} } = this;`;
90
94
  var isNativeFunction = (func) => {
@@ -1481,10 +1485,8 @@ var MicroInstanceModel = class {
1481
1485
  setupContainer() {
1482
1486
  if (this.container) {
1483
1487
  this.container.innerHTML = "";
1484
- if (this.showSourceCode) {
1485
- const instanceWrapper = this.createInstanceWrapper();
1486
- this.container.appendChild(instanceWrapper);
1487
- }
1488
+ const instanceWrapper = this.createInstanceWrapper();
1489
+ this.container.appendChild(instanceWrapper);
1488
1490
  }
1489
1491
  }
1490
1492
  /** 执行样式 */
@@ -1503,7 +1505,7 @@ var MicroInstanceModel = class {
1503
1505
  renderInstance() {
1504
1506
  const scriptInfo = this.getScriptInfo();
1505
1507
  if (scriptInfo?.exportInstance?.render && this.container) {
1506
- const targetContainer = this.showSourceCode ? this.container.querySelector(`#${this.name}${WRAPPER_SUFFIX}`) : this.container;
1508
+ const targetContainer = this.container.querySelector(`#${this.name}${WRAPPER_SUFFIX}`);
1507
1509
  if (targetContainer) {
1508
1510
  scriptInfo.exportInstance.render(targetContainer, this.data);
1509
1511
  }
@@ -1516,7 +1518,7 @@ var MicroInstanceModel = class {
1516
1518
  }
1517
1519
  /** 检查是否需要重新加载 */
1518
1520
  needsReload() {
1519
- return this.status === AppState.ERROR;
1521
+ return this.status === AppState.ERROR || this.status === AppState.UNSET;
1520
1522
  }
1521
1523
  };
1522
1524
 
@@ -2193,7 +2195,8 @@ var EntrySource = class {
2193
2195
  * 检查是否应该忽略脚本
2194
2196
  */
2195
2197
  shouldIgnoreScript = (script) => {
2196
- return script.hasAttribute("ignore") || script.type !== "module" && isJsonpUrl(script.getAttribute("src")) || script.hasAttribute("type") && !SCRIPT_TYPE_NAMES.includes(script.type);
2198
+ return script.hasAttribute("ignore") || // (script.type !== 'module' && isJsonpUrl(script.getAttribute('src'))) ||
2199
+ script.hasAttribute("type") && !SCRIPT_TYPE_NAMES.includes(script.type);
2197
2200
  };
2198
2201
  /**
2199
2202
  * 处理被排除的脚本