@blueking/bk-weweb 0.0.36-beta.16 → 0.0.36-beta.18

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.mts CHANGED
@@ -552,6 +552,8 @@ interface IBaseModelProps {
552
552
  id?: string | null;
553
553
  /** 是否预加载 */
554
554
  isPreLoad?: boolean;
555
+ /** 获取资源的函数 */
556
+ fetchSource?: typeof fetchSource;
555
557
  }
556
558
  /** 微应用模式属性配置 */
557
559
  interface IAppModelProps extends IBaseModelProps {
@@ -715,6 +717,7 @@ interface IInjectWindowAttrs {
715
717
  __BK_WEWEB_DATA__: Record<string, unknown>;
716
718
  /** 标识页面是否由BK WEWEB驱动 */
717
719
  __POWERED_BY_BK_WEWEB__: boolean;
720
+ __BK_WEWEB_HAS_REWRITE__?: boolean;
718
721
  /** 原始 document 对象的引用 */
719
722
  rawDocument: Document;
720
723
  /** 原始 window 对象的引用 */
package/dist/index.esm.js CHANGED
@@ -1164,7 +1164,7 @@ var elementAppendHandler = (parent, newChild, rawMethod) => {
1164
1164
  if (!newChild.__BK_WEWEB_APP_KEY__) {
1165
1165
  return rawMethod.call(parent, newChild);
1166
1166
  }
1167
- const app = appCache.getApp(newChild.__BK_WEWEB_APP_KEY__);
1167
+ const app = appCache.getApp(newChild.__BK_WEWEB_APP_KEY__) || getCurrentRunningApp();
1168
1168
  if (!app?.container) {
1169
1169
  return rawMethod.call(parent, newChild);
1170
1170
  }
@@ -1179,7 +1179,7 @@ var elementInsertHandler = (parent, newChild, passiveChild, rawMethod) => {
1179
1179
  if (!newChild.__BK_WEWEB_APP_KEY__) {
1180
1180
  return rawMethod.call(parent, newChild, passiveChild);
1181
1181
  }
1182
- const app = appCache.getApp(newChild.__BK_WEWEB_APP_KEY__);
1182
+ const app = appCache.getApp(newChild.__BK_WEWEB_APP_KEY__) || getCurrentRunningApp();
1183
1183
  if (!app?.container) {
1184
1184
  return rawMethod.call(parent, newChild, passiveChild);
1185
1185
  }
@@ -2710,7 +2710,7 @@ function getElementApp(element) {
2710
2710
  if (!element.__BK_WEWEB_APP_KEY__) {
2711
2711
  return null;
2712
2712
  }
2713
- return appCache.getApp(element.__BK_WEWEB_APP_KEY__);
2713
+ return appCache.getApp(element.__BK_WEWEB_APP_KEY__) || getCurrentRunningApp();
2714
2714
  }
2715
2715
  function createOverriddenSetAttribute() {
2716
2716
  return function(key, value) {
@@ -2774,7 +2774,7 @@ function createOverriddenRemoveChild() {
2774
2774
  }
2775
2775
  var insertAdjacentElement = createOverriddenInsertAdjacentElement();
2776
2776
  function createOverriddenInsertAdjacentElement() {
2777
- return function(where, element) {
2777
+ return function(_where, element) {
2778
2778
  const node = elementAppendHandler(this, element, headAppendChild);
2779
2779
  if (node?.tagName === "STYLE") {
2780
2780
  node.insertAdjacentElement = insertAdjacentElement;