@next-core/brick-kit 2.165.4 → 2.165.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
@@ -3237,15 +3237,19 @@ function matchStoryboard(storyboards, pathname) {
3237
3237
  /**
3238
3238
  * We say it's an outside app when at least one of the below conditions are true:
3239
3239
  * - target app is not found.
3240
+ * - target app is not the current app.
3240
3241
  * - current app is non-standalone mode and target app is standalone mode.
3241
3242
  *
3242
3243
  * Note: when current app is standalone mode, other apps will not be found.
3243
3244
  */
3244
3245
  function isOutsideApp(storyboard) {
3246
+ var _getRuntime$getCurren;
3245
3247
  if (process.env.NODE_ENV === "test") {
3246
3248
  return false;
3247
3249
  }
3248
- return !storyboard || !window.STANDALONE_MICRO_APPS && storyboard.app.standaloneMode;
3250
+ return !storyboard ||
3251
+ // Sometimes `storyboard.app.standaloneMode` is incorrect.
3252
+ ((_getRuntime$getCurren = getRuntime().getCurrentApp()) === null || _getRuntime$getCurren === void 0 ? void 0 : _getRuntime$getCurren.id) !== storyboard.app.id && !window.STANDALONE_MICRO_APPS && storyboard.app.standaloneMode;
3249
3253
  }
3250
3254
 
3251
3255
  var kernel;
@@ -8788,6 +8792,14 @@ class Kernel {
8788
8792
  yield _this9.loadDynamicBricks(bricks, processors);
8789
8793
  })();
8790
8794
  }
8795
+ loadResourceOfTemplate(tplTagName) {
8796
+ var _this10 = this;
8797
+ return _asyncToGenerator$3(function* () {
8798
+ var template = customTemplateRegistry.get(tplTagName);
8799
+ var processors = scanProcessorsInAny([template.state, template.bricks]);
8800
+ yield _this10.loadDynamicBricks([], processors);
8801
+ })();
8802
+ }
8791
8803
  loadDynamicBricks(bricks, processors) {
8792
8804
  return this.gracefullyLoadDeps(this._loadDynamicBricks, bricks, processors);
8793
8805
  }
@@ -8872,9 +8884,9 @@ class Kernel {
8872
8884
  this.allMicroAppApiOrchestrationPromise = this.loadMicroAppApiOrchestration(usedCustomApis);
8873
8885
  }
8874
8886
  getMicroAppApiOrchestrationMapAsync() {
8875
- var _this10 = this;
8887
+ var _this11 = this;
8876
8888
  return _asyncToGenerator$3(function* () {
8877
- return yield _this10.allMicroAppApiOrchestrationPromise;
8889
+ return yield _this11.allMicroAppApiOrchestrationPromise;
8878
8890
  })();
8879
8891
  }
8880
8892
  loadMicroAppApiOrchestration(usedCustomApis) {
@@ -8947,12 +8959,12 @@ class Kernel {
8947
8959
  return Object.assign({}, (_this$bootstrapData = this.bootstrapData) === null || _this$bootstrapData === void 0 ? void 0 : (_this$bootstrapData$s = _this$bootstrapData.settings) === null || _this$bootstrapData$s === void 0 ? void 0 : _this$bootstrapData$s.featureFlags, (_this$nextApp = this.nextApp) === null || _this$nextApp === void 0 ? void 0 : (_this$nextApp$config = _this$nextApp.config) === null || _this$nextApp$config === void 0 ? void 0 : (_this$nextApp$config$ = _this$nextApp$config.settings) === null || _this$nextApp$config$ === void 0 ? void 0 : _this$nextApp$config$.featureFlags);
8948
8960
  }
8949
8961
  getStandaloneMenus(menuId, isPreFetch) {
8950
- var _this11 = this;
8962
+ var _this12 = this;
8951
8963
  return _asyncToGenerator$3(function* () {
8952
8964
  var _currentStoryboard$me, _currentStoryboard$me2;
8953
- var app = isPreFetch ? _this11.nextApp : _this11.currentApp;
8965
+ var app = isPreFetch ? _this12.nextApp : _this12.currentApp;
8954
8966
  var currentAppId = app.id;
8955
- var currentStoryboard = _this11.bootstrapData.storyboards.find(storyboard => storyboard.app.id === currentAppId);
8967
+ var currentStoryboard = _this12.bootstrapData.storyboards.find(storyboard => storyboard.app.id === currentAppId);
8956
8968
  var menus = (_currentStoryboard$me = currentStoryboard.meta) !== null && _currentStoryboard$me !== void 0 && _currentStoryboard$me.injectMenus ? cloneDeep(currentStoryboard.meta.injectMenus) : (_currentStoryboard$me2 = currentStoryboard.meta) !== null && _currentStoryboard$me2 !== void 0 && _currentStoryboard$me2.menus ? cloneDeep(currentStoryboard.meta.menus) : [];
8957
8969
  var filterMenus = menus.filter(menu => menu.menuId === menuId).map(menu => {
8958
8970
  var _menu$app;
@@ -9005,23 +9017,23 @@ class Kernel {
9005
9017
  return this.originFaviconHref;
9006
9018
  }
9007
9019
  getProviderBrick(provider) {
9008
- var _this12 = this;
9020
+ var _this13 = this;
9009
9021
  return _asyncToGenerator$3(function* () {
9010
9022
  if (isCustomApiProvider(provider)) {
9011
9023
  provider = CUSTOM_API_PROVIDER;
9012
9024
  }
9013
- if (_this12.providerRepository.has(provider)) {
9014
- return _this12.providerRepository.get(provider);
9025
+ if (_this13.providerRepository.has(provider)) {
9026
+ return _this13.providerRepository.get(provider);
9015
9027
  }
9016
9028
  if (provider === CUSTOM_API_PROVIDER && !customElements.get(provider)) {
9017
9029
  registerCustomApi();
9018
9030
  }
9019
- yield _this12.loadDynamicBricks([provider]);
9031
+ yield _this13.loadDynamicBricks([provider]);
9020
9032
  if (!customElements.get(provider)) {
9021
9033
  throw new Error("Provider not defined: \"".concat(provider, "\"."));
9022
9034
  }
9023
9035
  var brick = document.createElement(provider);
9024
- _this12.providerRepository.set(provider, brick);
9036
+ _this13.providerRepository.set(provider, brick);
9025
9037
  return brick;
9026
9038
  })();
9027
9039
  }
@@ -10143,6 +10155,7 @@ class LocationContext {
10143
10155
  if (tplTagName && (!isBaseLayout || _this10.kernel.getFeatureFlags()["support-ui-8.0-base-layout"] && isBaseLayout)) {
10144
10156
  var _customTemplateRegist;
10145
10157
  yield _this10.preFetchMenu((_customTemplateRegist = customTemplateRegistry.get(tplTagName)) === null || _customTemplateRegist === void 0 ? void 0 : _customTemplateRegist.bricks);
10158
+ yield _this10.kernel.loadResourceOfTemplate(tplTagName);
10146
10159
  expandedBrickConf = yield asyncExpandCustomTemplate(_objectSpread(_objectSpread({}, brickConf), {}, {
10147
10160
  brick: tplTagName,
10148
10161
  // Properties are computed for custom templates.