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