@next-core/brick-kit 2.178.13 → 2.178.15
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.bundle.js +45 -10
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +45 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/dist/types/core/Router.d.ts.map +1 -1
- package/dist/types/handleHttpError.d.ts.map +1 -1
- package/dist/types/setLoginStateCookie.d.ts +3 -0
- package/dist/types/setLoginStateCookie.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -4046,6 +4046,20 @@ function isHttpAbortError(error) {
|
|
|
4046
4046
|
return error instanceof HttpAbortError;
|
|
4047
4047
|
}
|
|
4048
4048
|
|
|
4049
|
+
function setLoginStateCookie(location) {
|
|
4050
|
+
// 独立打包应用 登录时间超时后还是由前端控制跳转,后台无法处理设置登录前的 path 和 query 的 cookie 值
|
|
4051
|
+
// 此这场景下前端做下处理
|
|
4052
|
+
|
|
4053
|
+
var {
|
|
4054
|
+
search,
|
|
4055
|
+
pathname
|
|
4056
|
+
} = location;
|
|
4057
|
+
var pathValue = pathname ? window.btoa(encodeURIComponent(pathname)) : "";
|
|
4058
|
+
var searchValue = search ? window.btoa(encodeURIComponent(search)) : "";
|
|
4059
|
+
document.cookie = "SALOGINPATH=".concat(pathValue, "; path=/");
|
|
4060
|
+
document.cookie = "SALOGINQUERY=".concat(searchValue, "; path=/");
|
|
4061
|
+
}
|
|
4062
|
+
|
|
4049
4063
|
/**
|
|
4050
4064
|
* 将 http 请求错误转换为可读的字符串。
|
|
4051
4065
|
*
|
|
@@ -4101,6 +4115,7 @@ function handleHttpError(error) {
|
|
|
4101
4115
|
onOk: () => {
|
|
4102
4116
|
var ssoEnabled = getRuntime().getFeatureFlags()["sso-enabled"];
|
|
4103
4117
|
var history = getHistory();
|
|
4118
|
+
setLoginStateCookie(history.location);
|
|
4104
4119
|
history.push(ssoEnabled ? "/sso-auth/login" : "/auth/login", {
|
|
4105
4120
|
from: _objectSpread(_objectSpread({}, history.location), {}, {
|
|
4106
4121
|
state: undefined
|
|
@@ -8617,6 +8632,7 @@ function getRuntimeMisc() {
|
|
|
8617
8632
|
}
|
|
8618
8633
|
|
|
8619
8634
|
var _excluded$3 = ["params"];
|
|
8635
|
+
var V3WidgetMates = ["basic.v3-widget-mate"];
|
|
8620
8636
|
class Kernel {
|
|
8621
8637
|
constructor() {
|
|
8622
8638
|
var _this = this;
|
|
@@ -8673,6 +8689,7 @@ class Kernel {
|
|
|
8673
8689
|
yield loadScriptOfDll(eager.dll);
|
|
8674
8690
|
yield loadScriptOfBricksOrTemplates(eager.deps);
|
|
8675
8691
|
if ((_eager$v3Bricks = eager.v3Bricks) !== null && _eager$v3Bricks !== void 0 && _eager$v3Bricks.length) {
|
|
8692
|
+
yield catchLoad(loadBricksImperatively(V3WidgetMates, brickPackages), "brick", V3WidgetMates[0]);
|
|
8676
8693
|
yield loadBricksImperatively(eager.v3Bricks, brickPackages);
|
|
8677
8694
|
}
|
|
8678
8695
|
// 加载构件资源时,不再阻塞后续业务数据的加载,在挂载构件时再等待该任务完成。
|
|
@@ -8706,16 +8723,27 @@ class Kernel {
|
|
|
8706
8723
|
bricks: filteredBricks,
|
|
8707
8724
|
processors
|
|
8708
8725
|
}, _this.bootstrapData.brickPackages);
|
|
8726
|
+
var loadV3Bricks = /*#__PURE__*/function () {
|
|
8727
|
+
var _ref4 = _asyncToGenerator$3(function* () {
|
|
8728
|
+
if (v3Bricks !== null && v3Bricks !== void 0 && v3Bricks.some(brick => brick.includes(".tpl-"))) {
|
|
8729
|
+
yield catchLoad(loadBricksImperatively(V3WidgetMates, brickPackages), "brick", V3WidgetMates[0]);
|
|
8730
|
+
}
|
|
8731
|
+
yield Promise.all([(v3Bricks === null || v3Bricks === void 0 ? void 0 : v3Bricks.length) && loadBricksImperatively(v3Bricks, brickPackages), (v3Processors === null || v3Processors === void 0 ? void 0 : v3Processors.length) && loadProcessorsImperatively(v3Processors, brickPackages)]);
|
|
8732
|
+
});
|
|
8733
|
+
return function loadV3Bricks() {
|
|
8734
|
+
return _ref4.apply(this, arguments);
|
|
8735
|
+
};
|
|
8736
|
+
}();
|
|
8709
8737
|
yield loadScriptOfDll(dll);
|
|
8710
8738
|
yield loadScriptOfBricksOrTemplates(deps);
|
|
8711
|
-
yield Promise.all([loadLazyBricks(filteredBricks), (
|
|
8739
|
+
yield Promise.all([loadLazyBricks(filteredBricks), loadV3Bricks()]);
|
|
8712
8740
|
});
|
|
8713
8741
|
return function (_x2, _x3) {
|
|
8714
8742
|
return _ref3.apply(this, arguments);
|
|
8715
8743
|
};
|
|
8716
8744
|
}());
|
|
8717
8745
|
_defineProperty$1(this, "_loadEditorBricks", /*#__PURE__*/function () {
|
|
8718
|
-
var
|
|
8746
|
+
var _ref5 = _asyncToGenerator$3(function* (editorBricks) {
|
|
8719
8747
|
var {
|
|
8720
8748
|
dll,
|
|
8721
8749
|
deps
|
|
@@ -8728,7 +8756,7 @@ class Kernel {
|
|
|
8728
8756
|
yield loadScriptOfBricksOrTemplates(deps);
|
|
8729
8757
|
});
|
|
8730
8758
|
return function (_x4) {
|
|
8731
|
-
return
|
|
8759
|
+
return _ref5.apply(this, arguments);
|
|
8732
8760
|
};
|
|
8733
8761
|
}());
|
|
8734
8762
|
}
|
|
@@ -8922,8 +8950,8 @@ class Kernel {
|
|
|
8922
8950
|
// Prefix to avoid conflict between brick package's i18n namespace.
|
|
8923
8951
|
var i18nNamespace = getI18nNamespace("app", storyboard.app.id);
|
|
8924
8952
|
// Support any language in `meta.i18n`.
|
|
8925
|
-
Object.entries(storyboard.meta.i18n).forEach(
|
|
8926
|
-
var [lang, resources] =
|
|
8953
|
+
Object.entries(storyboard.meta.i18n).forEach(_ref6 => {
|
|
8954
|
+
var [lang, resources] = _ref6;
|
|
8927
8955
|
i18next.addResourceBundle(lang, i18nNamespace, resources);
|
|
8928
8956
|
});
|
|
8929
8957
|
}
|
|
@@ -9114,12 +9142,12 @@ class Kernel {
|
|
|
9114
9142
|
routes.splice(previewRouteIndex, 1, newPreviewRoute);
|
|
9115
9143
|
}
|
|
9116
9144
|
}
|
|
9117
|
-
_dev_only_getAddedContracts(storyboardPatch,
|
|
9145
|
+
_dev_only_getAddedContracts(storyboardPatch, _ref7) {
|
|
9118
9146
|
var {
|
|
9119
9147
|
appId,
|
|
9120
9148
|
updateStoryboardType,
|
|
9121
9149
|
formId
|
|
9122
|
-
} =
|
|
9150
|
+
} = _ref7;
|
|
9123
9151
|
var storyboard = this.bootstrapData.storyboards.find(item => item.app.id === appId);
|
|
9124
9152
|
var updatedStoryboard;
|
|
9125
9153
|
|
|
@@ -9418,8 +9446,8 @@ class Kernel {
|
|
|
9418
9446
|
});
|
|
9419
9447
|
});
|
|
9420
9448
|
if (!filterMenus.length) {
|
|
9421
|
-
var
|
|
9422
|
-
filterMenus = (
|
|
9449
|
+
var _ref8, _yield$InstanceApi_po;
|
|
9450
|
+
filterMenus = (_ref8 = _this12.getFeatureFlags()["three-level-menu-layout"] ? (yield InstalledMicroAppApi_getMenusInfo(menuId, {
|
|
9423
9451
|
menuObjectId: "STANDALONE_MENU@EASYOPS"
|
|
9424
9452
|
})).menus : (_yield$InstanceApi_po = yield InstanceApi_postSearch("STANDALONE_MENU@EASYOPS", {
|
|
9425
9453
|
page: 1,
|
|
@@ -9450,7 +9478,7 @@ class Kernel {
|
|
|
9450
9478
|
$eq: true
|
|
9451
9479
|
}
|
|
9452
9480
|
}
|
|
9453
|
-
})) === null || _yield$InstanceApi_po === void 0 ? void 0 : _yield$InstanceApi_po.list) !== null &&
|
|
9481
|
+
})) === null || _yield$InstanceApi_po === void 0 ? void 0 : _yield$InstanceApi_po.list) !== null && _ref8 !== void 0 ? _ref8 : [];
|
|
9454
9482
|
}
|
|
9455
9483
|
return filterMenus;
|
|
9456
9484
|
})();
|
|
@@ -9520,6 +9548,12 @@ function generateColorTheme(theme) {
|
|
|
9520
9548
|
}, theme.variables));
|
|
9521
9549
|
}
|
|
9522
9550
|
}
|
|
9551
|
+
function catchLoad(promise, type, name) {
|
|
9552
|
+
return promise.catch(e => {
|
|
9553
|
+
// eslint-disable-next-line no-console
|
|
9554
|
+
console.error("Load ".concat(type, " \"").concat(name, "\" failed:"), e);
|
|
9555
|
+
});
|
|
9556
|
+
}
|
|
9523
9557
|
|
|
9524
9558
|
/** @internal */
|
|
9525
9559
|
|
|
@@ -11707,6 +11741,7 @@ class Router {
|
|
|
11707
11741
|
devtoolsHookEmit("rendering");
|
|
11708
11742
|
unmountTree(mountPoints.bg);
|
|
11709
11743
|
var redirectToLogin = () => {
|
|
11744
|
+
setLoginStateCookie(location);
|
|
11710
11745
|
history.replace(_this3.kernel.getFeatureFlags()["sso-enabled"] ? "/sso-auth/login" : "/auth/login", {
|
|
11711
11746
|
from: location
|
|
11712
11747
|
});
|