@next-core/brick-kit 2.184.1 → 2.185.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.
@@ -176,6 +176,7 @@
176
176
  K["NO_PERMISSION"] = "NO_PERMISSION";
177
177
  K["OTHER_ERROR"] = "OTHER_ERROR";
178
178
  K["GO_BACK_PREVIOUS_PAGE"] = "GO_BACK_PREVIOUS_PAGE";
179
+ K["GO_BACK_HOME_PAGE"] = "GO_BACK_HOME_PAGE";
179
180
  })(K || (K = {}));
180
181
 
181
182
  /**
@@ -1209,7 +1210,8 @@
1209
1210
  [K.LICENSE_EXPIRED]: "The license authorization has expired, please contact the platform administrator",
1210
1211
  [K.NO_PERMISSION]: "Unauthorized access, unable to retrieve the required resources for this page",
1211
1212
  [K.OTHER_ERROR]: "Oops! Something went wrong",
1212
- [K.GO_BACK_PREVIOUS_PAGE]: "Go back to previous page"
1213
+ [K.GO_BACK_PREVIOUS_PAGE]: "Go back to previous page",
1214
+ [K.GO_BACK_HOME_PAGE]: "Back to home page"
1213
1215
  };
1214
1216
  var en = locale$7;
1215
1217
 
@@ -1225,7 +1227,8 @@
1225
1227
  [K.LICENSE_EXPIRED]: "License 授权失效,请联系平台管理员",
1226
1228
  [K.NO_PERMISSION]: "没有权限,无法获取页面所需要的资源",
1227
1229
  [K.OTHER_ERROR]: "糟糕!页面出现了一些问题",
1228
- [K.GO_BACK_PREVIOUS_PAGE]: "回到上一页"
1230
+ [K.GO_BACK_PREVIOUS_PAGE]: "回到上一页",
1231
+ [K.GO_BACK_HOME_PAGE]: "回到首页"
1229
1232
  };
1230
1233
  var zh = locale$6;
1231
1234
 
@@ -5800,21 +5803,23 @@
5800
5803
  }
5801
5804
 
5802
5805
  var timeoutIdList = new Set();
5803
- function startPoll(task, _ref, _ref2) {
5806
+ function startPoll(task, _ref, pollOptions, context) {
5804
5807
  var {
5805
5808
  progress,
5806
5809
  success,
5807
5810
  error,
5808
5811
  finally: finallyCallback
5809
5812
  } = _ref;
5813
+ var {
5814
+ expectPollStopImmediately,
5815
+ expectPollEnd
5816
+ } = pollOptions;
5810
5817
  var {
5811
5818
  interval,
5812
5819
  leadingRequestDelay,
5813
5820
  continueOnError,
5814
- delegateLoadingBar,
5815
- expectPollEnd,
5816
- expectPollStopImmediately
5817
- } = _ref2;
5821
+ delegateLoadingBar
5822
+ } = computeRealValue(_.pick(pollOptions, ["interval", "leadingRequestDelay", "continueOnError", "delegateLoadingBar"]), context);
5818
5823
  var currentRenderId = _internalApiGetRouterRenderId();
5819
5824
  var currentTimeoutId;
5820
5825
  function poll() {
@@ -5825,16 +5830,20 @@
5825
5830
  timeoutIdList.delete(currentTimeoutId);
5826
5831
  var shouldStop;
5827
5832
  try {
5828
- shouldStop = expectPollStopImmediately === null || expectPollStopImmediately === void 0 ? void 0 : expectPollStopImmediately();
5833
+ var _computeRealValue;
5834
+ shouldStop = (_computeRealValue = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue === void 0 ? void 0 : _computeRealValue();
5829
5835
  // Stop polling immediately when the expectation is match before task.
5830
5836
  if (!shouldStop) {
5837
+ var _computeRealValue2;
5831
5838
  var _result = yield task();
5832
5839
  // Stop polling immediately when the expectation is match or a different router
5833
5840
  // is rendering after the task processed.
5834
- shouldStop = (expectPollStopImmediately === null || expectPollStopImmediately === void 0 ? void 0 : expectPollStopImmediately()) || currentRenderId !== _internalApiGetRouterRenderId();
5841
+ shouldStop = ((_computeRealValue2 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue2 === void 0 ? void 0 : _computeRealValue2()) || currentRenderId !== _internalApiGetRouterRenderId();
5835
5842
  if (!shouldStop) {
5843
+ var _computeRealValue3;
5836
5844
  progress === null || progress === void 0 ? void 0 : progress(_result);
5837
- if (expectPollEnd !== null && expectPollEnd !== void 0 && expectPollEnd(_result)) {
5845
+ var value = (_computeRealValue3 = computeRealValue(expectPollEnd, context)) === null || _computeRealValue3 === void 0 ? void 0 : _computeRealValue3(_result);
5846
+ if (value) {
5838
5847
  if (delegateLoadingBar) {
5839
5848
  window.dispatchEvent(new CustomEvent("request.end"));
5840
5849
  }
@@ -5846,9 +5855,10 @@
5846
5855
  }
5847
5856
  }
5848
5857
  } catch (e) {
5858
+ var _computeRealValue4;
5849
5859
  // Stop polling immediately when the expectation is match or a different router
5850
5860
  // is rendering after the task processed.
5851
- shouldStop = (expectPollStopImmediately === null || expectPollStopImmediately === void 0 ? void 0 : expectPollStopImmediately()) || currentRenderId !== _internalApiGetRouterRenderId();
5861
+ shouldStop = ((_computeRealValue4 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue4 === void 0 ? void 0 : _computeRealValue4()) || currentRenderId !== _internalApiGetRouterRenderId();
5852
5862
  if (!shouldStop) {
5853
5863
  error === null || error === void 0 ? void 0 : error(e);
5854
5864
  if (continueOnError) {
@@ -6703,7 +6713,6 @@
6703
6713
  }
6704
6714
  function _brickCallback() {
6705
6715
  _brickCallback = _asyncToGenerator__default["default"](function* (target, handler, method, context, runtimeBrick, event, options) {
6706
- var _poll;
6707
6716
  if (typeof target[method] !== "function") {
6708
6717
  // eslint-disable-next-line no-console
6709
6718
  console.error("target has no method:", {
@@ -6735,25 +6744,26 @@
6735
6744
  error: callbackFactory("error"),
6736
6745
  finally: callbackFactory("finally")
6737
6746
  };
6738
- var poll;
6739
6747
  if (isUseProviderHandler(handler)) {
6740
- poll = computeRealValue(handler.poll, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
6748
+ var _handler$poll;
6749
+ var runtimeContext = _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
6741
6750
  event
6742
- }), true);
6743
- }
6744
- if ((_poll = poll) !== null && _poll !== void 0 && _poll.enabled) {
6745
- startPoll(task, pollableCallback, poll);
6746
- } else {
6747
- try {
6748
- // Try to catch synchronized tasks too.
6749
- var result = yield task();
6750
- pollableCallback.success(result);
6751
- } catch (err) {
6752
- pollableCallback.error(err);
6753
- } finally {
6754
- pollableCallback["finally"]();
6751
+ });
6752
+ var pollEnabled = computeRealValue((_handler$poll = handler.poll) === null || _handler$poll === void 0 ? void 0 : _handler$poll.enabled, runtimeContext, true);
6753
+ if (pollEnabled) {
6754
+ startPoll(task, pollableCallback, handler.poll, runtimeContext);
6755
+ return;
6755
6756
  }
6756
6757
  }
6758
+ try {
6759
+ // Try to catch synchronized tasks too.
6760
+ var result = yield task();
6761
+ pollableCallback.success(result);
6762
+ } catch (err) {
6763
+ pollableCallback.error(err);
6764
+ } finally {
6765
+ pollableCallback["finally"]();
6766
+ }
6757
6767
  });
6758
6768
  return _brickCallback.apply(this, arguments);
6759
6769
  }
@@ -11821,7 +11831,7 @@
11821
11831
  render(location) {
11822
11832
  var _this3 = this;
11823
11833
  return _asyncToGenerator__default["default"](function* () {
11824
- var _apiAnalyzer$getInsta, _storyboard$app, _this3$kernel$previou, _currentApp$config, _currentApp$config$_e, _this3$kernel$bootstr, _this3$kernel$bootstr2, _getLocalAppsTheme;
11834
+ var _apiAnalyzer$getInsta, _storyboard$app, _this3$kernel$previou, _currentApp$config, _currentApp$config$_e, _this3$kernel$bootstr, _this3$kernel$bootstr2, _getLocalAppsTheme, _storyboard$app$homep, _storyboard$app2;
11825
11835
  _this3.state = "initial";
11826
11836
  var renderId = _this3.renderId = _.uniqueId("render-id-");
11827
11837
  resetAllInjected();
@@ -12256,6 +12266,23 @@
12256
12266
  useNewIllustration: true,
12257
12267
  style: illustrationStyle
12258
12268
  }, storyboard ? notFoundPageConfig : notFoundAppConfig),
12269
+ children: [{
12270
+ type: "a",
12271
+ properties: {
12272
+ textContent: i18next__default["default"].t("".concat(NS_BRICK_KIT, ":").concat(K.GO_BACK_HOME_PAGE)),
12273
+ style: {
12274
+ display: "block",
12275
+ textAlign: "center"
12276
+ }
12277
+ },
12278
+ slotId: "content",
12279
+ events: {
12280
+ click: [{
12281
+ action: "history.push",
12282
+ args: [(_storyboard$app$homep = storyboard === null || storyboard === void 0 ? void 0 : (_storyboard$app2 = storyboard.app) === null || _storyboard$app2 === void 0 ? void 0 : _storyboard$app2.homepage) !== null && _storyboard$app$homep !== void 0 ? _storyboard$app$homep : "/"]
12283
+ }]
12284
+ }
12285
+ }],
12259
12286
  events: {}
12260
12287
  }], mountPoints.main);
12261
12288
  unmountTree(mountPoints.portal);