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