@next-core/brick-kit 2.157.3 → 2.158.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
@@ -171,6 +171,8 @@ var K;
171
171
  K["SOMETHING_WENT_WRONG"] = "SOMETHING_WENT_WRONG";
172
172
  K["LOGIN_TIMEOUT_MESSAGE"] = "LOGIN_TIMEOUT_MESSAGE";
173
173
  K["NETWORK_ERROR"] = "NETWORK_ERROR";
174
+ K["PAGE_NOT_FOUND"] = "PAGE_NOT_FOUND";
175
+ K["APP_NOT_FOUND"] = "APP_NOT_FOUND";
174
176
  })(K || (K = {}));
175
177
 
176
178
  /**
@@ -1106,7 +1108,9 @@ var locale$7 = {
1106
1108
  [K.MODAL_CANCEL]: "Cancel",
1107
1109
  [K.SOMETHING_WENT_WRONG]: "Something went wrong!",
1108
1110
  [K.LOGIN_TIMEOUT_MESSAGE]: "You haven't logged in or your login session has expired. Login right now?",
1109
- [K.NETWORK_ERROR]: "Network error, please check your network."
1111
+ [K.NETWORK_ERROR]: "Network error, please check your network.",
1112
+ [K.PAGE_NOT_FOUND]: "Page not found, please check the URL",
1113
+ [K.APP_NOT_FOUND]: "App not found, maybe the URL is wrong or you don't have permission to access"
1110
1114
  };
1111
1115
  var en = locale$7;
1112
1116
 
@@ -1116,7 +1120,9 @@ var locale$6 = {
1116
1120
  [K.MODAL_CANCEL]: "取消",
1117
1121
  [K.SOMETHING_WENT_WRONG]: "出现了一些问题!",
1118
1122
  [K.LOGIN_TIMEOUT_MESSAGE]: "您还未登录或登录信息已过期,现在重新登录?",
1119
- [K.NETWORK_ERROR]: "网络错误,请检查您的网络连接。"
1123
+ [K.NETWORK_ERROR]: "网络错误,请检查您的网络连接。",
1124
+ [K.PAGE_NOT_FOUND]: "请求的页面未找到,请确认 URL 是否正确",
1125
+ [K.APP_NOT_FOUND]: "请求的微应用无法找到, 可能是 URL 错误或者无权限访问"
1120
1126
  };
1121
1127
  var zh = locale$6;
1122
1128
 
@@ -6603,7 +6609,7 @@ function _standaloneBootstrap() {
6603
6609
  })];
6604
6610
  if (!window.NO_AUTH_GUARD) {
6605
6611
  var matches;
6606
- var appId = window.APP_ID || (window.APP_ROOT && (matches = window.APP_ROOT.match(/^(?:\/next)?\/sa-static\/([^/]+)\/versions\//)) ? matches[1] : null);
6612
+ var appId = window.APP_ID || (window.APP_ROOT && (matches = window.APP_ROOT.match(/^(?:(?:\/next)?\/)?sa-static\/([^/]+)\/versions\//)) ? matches[1] : null);
6607
6613
  if (appId) {
6608
6614
  // No need to wait.
6609
6615
  safeGetRuntimeMicroAppStandalone(appId);
@@ -6685,6 +6691,7 @@ function _safeGetRuntimeMicroAppStandalone() {
6685
6691
  console.warn("request standalone runtime api from micro-app-standalone failed: ", error, ", something might went wrong running standalone micro app");
6686
6692
  });
6687
6693
  appRuntimeDataMap.set(appId, promise);
6694
+ return promise;
6688
6695
  });
6689
6696
  return _safeGetRuntimeMicroAppStandalone.apply(this, arguments);
6690
6697
  }
@@ -8195,10 +8202,10 @@ class Kernel {
8195
8202
  _this3.currentLayout = layout;
8196
8203
  _this3.presetBricks = layout === "business" ? {
8197
8204
  loadingBar: "business-website.loading-bar",
8198
- pageNotFound: "business-website.page-not-found",
8205
+ pageNotFound: "presentational-bricks.brick-result",
8199
8206
  pageError: "business-website.page-error"
8200
8207
  } : _objectSpread(_objectSpread({}, _this3.bootstrapData.navbar), {}, {
8201
- pageNotFound: "basic-bricks.page-not-found",
8208
+ pageNotFound: "presentational-bricks.brick-result",
8202
8209
  pageError: "basic-bricks.page-error"
8203
8210
  });
8204
8211
  for (var item of supportedLayouts) {
@@ -11140,15 +11147,37 @@ class Router {
11140
11147
  redirectToLogin();
11141
11148
  return;
11142
11149
  }
11143
- yield _this3.kernel.layoutBootstrap(layoutType);
11150
+ yield _this3.kernel.layoutBootstrap(storyboard ? layoutType : "business");
11144
11151
  var brickPageNotFound = _this3.kernel.presetBricks.pageNotFound;
11145
11152
  yield _this3.kernel.loadDynamicBricks([brickPageNotFound]);
11153
+ var notFoundAppConfig = {
11154
+ illustrationsConfig: {
11155
+ name: "no-permission",
11156
+ category: "easyops2"
11157
+ },
11158
+ customTitle: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.APP_NOT_FOUND))
11159
+ };
11160
+ var notFoundPageConfig = {
11161
+ illustrationsConfig: {
11162
+ name: "http-404",
11163
+ category: "exception"
11164
+ },
11165
+ customTitle: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.PAGE_NOT_FOUND))
11166
+ };
11146
11167
  _this3.state = "ready-to-mount";
11147
11168
  mountTree([{
11148
11169
  type: brickPageNotFound,
11149
- properties: {
11150
- url: history.createHref(location)
11151
- },
11170
+ properties: _objectSpread({
11171
+ status: "illustrations",
11172
+ useNewIllustration: true,
11173
+ style: {
11174
+ display: "flex",
11175
+ alignItems: "center",
11176
+ justifyContent: "center",
11177
+ transform: "translateY(-100px)",
11178
+ height: "calc(100vh - var(--app-bar-height))"
11179
+ }
11180
+ }, storyboard ? notFoundPageConfig : notFoundAppConfig),
11152
11181
  events: {}
11153
11182
  }], mountPoints.main);
11154
11183
  unmountTree(mountPoints.portal);