@next-core/brick-kit 2.189.0 → 2.191.0

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.
@@ -5848,9 +5848,10 @@
5848
5848
  if (!shouldStop) {
5849
5849
  var _computeRealValue2;
5850
5850
  var _result = yield task();
5851
+ var expectPollStopImmediatelyResult = (_computeRealValue2 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue2 === void 0 ? void 0 : _computeRealValue2();
5851
5852
  // Stop polling immediately when the expectation is match or a different router
5852
5853
  // is rendering after the task processed.
5853
- shouldStop = ((_computeRealValue2 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue2 === void 0 ? void 0 : _computeRealValue2()) || currentRenderId !== _internalApiGetRouterRenderId();
5854
+ shouldStop = expectPollStopImmediatelyResult || currentRenderId !== _internalApiGetRouterRenderId();
5854
5855
  if (!shouldStop) {
5855
5856
  var _computeRealValue3;
5856
5857
  progress === null || progress === void 0 ? void 0 : progress(_result);
@@ -5864,13 +5865,18 @@
5864
5865
  } else {
5865
5866
  delayedPoll(interval !== null && interval !== void 0 ? interval : 3000);
5866
5867
  }
5868
+ } else if (expectPollStopImmediatelyResult) {
5869
+ finallyCallback === null || finallyCallback === void 0 ? void 0 : finallyCallback();
5867
5870
  }
5871
+ } else {
5872
+ finallyCallback === null || finallyCallback === void 0 ? void 0 : finallyCallback();
5868
5873
  }
5869
5874
  } catch (e) {
5870
5875
  var _computeRealValue4;
5876
+ var _expectPollStopImmediatelyResult = (_computeRealValue4 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue4 === void 0 ? void 0 : _computeRealValue4();
5871
5877
  // Stop polling immediately when the expectation is match or a different router
5872
5878
  // is rendering after the task processed.
5873
- shouldStop = ((_computeRealValue4 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue4 === void 0 ? void 0 : _computeRealValue4()) || currentRenderId !== _internalApiGetRouterRenderId();
5879
+ shouldStop = _expectPollStopImmediatelyResult || currentRenderId !== _internalApiGetRouterRenderId();
5874
5880
  if (!shouldStop) {
5875
5881
  error === null || error === void 0 ? void 0 : error(e);
5876
5882
  if (continueOnError) {
@@ -5878,6 +5884,8 @@
5878
5884
  } else {
5879
5885
  finallyCallback === null || finallyCallback === void 0 ? void 0 : finallyCallback();
5880
5886
  }
5887
+ } else if (_expectPollStopImmediatelyResult) {
5888
+ finallyCallback === null || finallyCallback === void 0 ? void 0 : finallyCallback();
5881
5889
  }
5882
5890
  } finally {
5883
5891
  // Manually dispatch an event of `request.end` when the polling is stopped immediately.
@@ -7046,25 +7054,6 @@
7046
7054
  var app = storyboard.app;
7047
7055
  if (app) {
7048
7056
  app.config = brickUtils.deepFreeze(_.merge({}, app.defaultConfig, app.userConfig));
7049
- if (app.locales) {
7050
- (function () {
7051
- // Prefix to avoid conflict between brick package's i18n namespace.
7052
- var ns = "$tmp-".concat(app.id);
7053
- // Support any languages in `app.locales`.
7054
- Object.entries(app.locales).forEach(_ref => {
7055
- var [lang, resources] = _ref;
7056
- i18next__default["default"].addResourceBundle(lang, ns, resources);
7057
- });
7058
- // Use `app.name` as the fallback `app.localeName`.
7059
- app.localeName = i18next__default["default"].getFixedT(null, ns)("name", app.name);
7060
- // Remove the temporary i18n resource bundles.
7061
- Object.keys(app.locales).forEach(lang => {
7062
- i18next__default["default"].removeResourceBundle(lang, ns);
7063
- });
7064
- })();
7065
- } else {
7066
- app.localeName = app.name;
7067
- }
7068
7057
  }
7069
7058
  }
7070
7059
  if (bootstrapResponse.settings) {
@@ -11816,6 +11805,28 @@
11816
11805
  }
11817
11806
  }
11818
11807
 
11808
+ function setAppLocales(app) {
11809
+ var _locales, _app$config, _app$config$settings;
11810
+ var locales = (_locales = (_app$config = app.config) === null || _app$config === void 0 ? void 0 : (_app$config$settings = _app$config.settings) === null || _app$config$settings === void 0 ? void 0 : _app$config$settings.locales) !== null && _locales !== void 0 ? _locales : app.locales;
11811
+ if (locales) {
11812
+ // Prefix to avoid conflict between brick package's i18n namespace.
11813
+ var ns = "$tmp-".concat(app.id);
11814
+ // Support any languages in `app.locales`.
11815
+ Object.entries(locales).forEach(_ref => {
11816
+ var [lang, resources] = _ref;
11817
+ i18next__default["default"].addResourceBundle(lang, ns, resources);
11818
+ });
11819
+ // Use `app.name` as the fallback `app.localeName`.
11820
+ app.localeName = i18next__default["default"].getFixedT(null, ns)("name", app.name);
11821
+ // Remove the temporary i18n resource bundles.
11822
+ Object.keys(locales).forEach(lang => {
11823
+ i18next__default["default"].removeResourceBundle(lang, ns);
11824
+ });
11825
+ } else {
11826
+ app.localeName = app.name;
11827
+ }
11828
+ }
11829
+
11819
11830
  class Router {
11820
11831
  constructor(kernel) {
11821
11832
  _defineProperty__default["default"](this, "defaultCollapsed", false);
@@ -11995,6 +12006,7 @@
11995
12006
  if (storyboard) {
11996
12007
  var _storyboard$meta, _storyboard$meta2, _storyboard$meta3;
11997
12008
  yield _this3.kernel.fulfilStoryboard(storyboard);
12009
+ setAppLocales(storyboard.app);
11998
12010
  _this3.kernel.nextApp = storyboard.app;
11999
12011
  setWatermark();
12000
12012
  brickUtils.removeDeadConditions(storyboard, {