@next-core/brick-kit 2.141.2 → 2.142.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/CHANGELOG.md +11 -0
- package/dist/index.bundle.js +67 -33
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +67 -33
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/Kernel.d.ts +1 -1
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.142.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.141.2...@next-core/brick-kit@2.142.0) (2022-09-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* standalone app not need to request i18n ([8f62e8b](https://github.com/easyops-cn/next-core/commit/8f62e8b78e3327817009cbfcf5154636041614f1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.141.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.141.1...@next-core/brick-kit@2.141.2) (2022-09-19)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @next-core/brick-kit
|
package/dist/index.bundle.js
CHANGED
|
@@ -3130,7 +3130,7 @@
|
|
|
3130
3130
|
return menuCache.get(menuId);
|
|
3131
3131
|
}
|
|
3132
3132
|
|
|
3133
|
-
var menuList = window.STANDALONE_MICRO_APPS ? kernel.getStandaloneMenus(menuId, isPreFetch) : (yield InstanceApi_postSearch("EASYOPS_STORYBOARD_MENU", {
|
|
3133
|
+
var menuList = window.STANDALONE_MICRO_APPS ? yield kernel.getStandaloneMenus(menuId, isPreFetch) : (yield InstanceApi_postSearch("EASYOPS_STORYBOARD_MENU", {
|
|
3134
3134
|
page: 1,
|
|
3135
3135
|
page_size: 200,
|
|
3136
3136
|
fields: {
|
|
@@ -3449,17 +3449,10 @@
|
|
|
3449
3449
|
|
|
3450
3450
|
if (overrideAppId !== context.app.id && attemptToVisit(data, ["APP", "I18N"])) {
|
|
3451
3451
|
var storyboard = kernel.bootstrapData.storyboards.find(story => story.app.id === overrideAppId);
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
overrideApp: storyboard.app,
|
|
3457
|
-
appendI18nNamespace: data[symbolMenuI18nNamespace]
|
|
3458
|
-
});
|
|
3459
|
-
} else {
|
|
3460
|
-
// eslint-disable-next-line no-console
|
|
3461
|
-
console.error("The app which injects menu was not found:", overrideAppId);
|
|
3462
|
-
}
|
|
3452
|
+
newContext = _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
3453
|
+
overrideApp: storyboard === null || storyboard === void 0 ? void 0 : storyboard.app,
|
|
3454
|
+
appendI18nNamespace: data[symbolMenuI18nNamespace]
|
|
3455
|
+
});
|
|
3463
3456
|
}
|
|
3464
3457
|
|
|
3465
3458
|
return computeRealValue(data, newContext, true, {
|
|
@@ -9319,8 +9312,7 @@
|
|
|
9319
9312
|
var filteredStoryboards = appIds.map(appId => _this7.bootstrapData.storyboards.find(story => story.app.id === appId)).filter(story => story && !story.$$fulfilled && !story.$$i18nFulfilled);
|
|
9320
9313
|
|
|
9321
9314
|
if (window.STANDALONE_MICRO_APPS) {
|
|
9322
|
-
//
|
|
9323
|
-
yield Promise.all(filteredStoryboards.map(story => _this7.fulfilStoryboard(story)));
|
|
9315
|
+
// standalone micros-apps not need to request i18n
|
|
9324
9316
|
return;
|
|
9325
9317
|
} // Do not fulfil i18n if the app is doing a whole fulfilling.
|
|
9326
9318
|
|
|
@@ -9772,21 +9764,63 @@
|
|
|
9772
9764
|
}
|
|
9773
9765
|
|
|
9774
9766
|
getStandaloneMenus(menuId, isPreFetch) {
|
|
9775
|
-
var
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9767
|
+
var _this11 = this;
|
|
9768
|
+
|
|
9769
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
9770
|
+
var _currentStoryboard$me, _currentStoryboard$me2;
|
|
9771
|
+
|
|
9772
|
+
var app = isPreFetch ? _this11.nextApp : _this11.currentApp;
|
|
9773
|
+
var currentAppId = app.id;
|
|
9774
|
+
|
|
9775
|
+
var currentStoryboard = _this11.bootstrapData.storyboards.find(storyboard => storyboard.app.id === currentAppId);
|
|
9776
|
+
|
|
9777
|
+
var menus = (_currentStoryboard$me = currentStoryboard.meta) !== null && _currentStoryboard$me !== void 0 && _currentStoryboard$me.injectMenus ? _.cloneDeep(currentStoryboard.meta.injectMenus) : (_currentStoryboard$me2 = currentStoryboard.meta) !== null && _currentStoryboard$me2 !== void 0 && _currentStoryboard$me2.menus ? _.cloneDeep(currentStoryboard.meta.menus) : [];
|
|
9778
|
+
var filterMenus = menus.filter(menu => menu.menuId === menuId).map(menu => {
|
|
9779
|
+
var _menu$app;
|
|
9780
|
+
|
|
9781
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, menu), (_menu$app = menu.app) !== null && _menu$app !== void 0 && _menu$app.length && menu.app[0].appId ? {} : {
|
|
9782
|
+
app: [{
|
|
9783
|
+
appId: currentAppId
|
|
9784
|
+
}]
|
|
9785
|
+
});
|
|
9788
9786
|
});
|
|
9789
|
-
|
|
9787
|
+
|
|
9788
|
+
if (!filterMenus.length) {
|
|
9789
|
+
var _ref5, _yield$InstanceApi_po;
|
|
9790
|
+
|
|
9791
|
+
filterMenus = (_ref5 = (_yield$InstanceApi_po = yield InstanceApi_postSearch("STANDALONE_MENU@EASYOPS", {
|
|
9792
|
+
page: 1,
|
|
9793
|
+
page_size: 200,
|
|
9794
|
+
fields: {
|
|
9795
|
+
menuId: true,
|
|
9796
|
+
title: true,
|
|
9797
|
+
icon: true,
|
|
9798
|
+
link: true,
|
|
9799
|
+
titleDataSource: true,
|
|
9800
|
+
defaultCollapsed: true,
|
|
9801
|
+
defaultCollapsedBreakpoint: true,
|
|
9802
|
+
type: true,
|
|
9803
|
+
injectMenuGroupId: true,
|
|
9804
|
+
dynamicItems: true,
|
|
9805
|
+
itemsResolve: true,
|
|
9806
|
+
items: true,
|
|
9807
|
+
i18n: true,
|
|
9808
|
+
"items.children": true,
|
|
9809
|
+
"app.appId": true
|
|
9810
|
+
},
|
|
9811
|
+
query: {
|
|
9812
|
+
menuId: {
|
|
9813
|
+
$eq: menuId
|
|
9814
|
+
},
|
|
9815
|
+
"app.isActiveVersion": {
|
|
9816
|
+
$eq: true
|
|
9817
|
+
}
|
|
9818
|
+
}
|
|
9819
|
+
})) === null || _yield$InstanceApi_po === void 0 ? void 0 : _yield$InstanceApi_po.list) !== null && _ref5 !== void 0 ? _ref5 : [];
|
|
9820
|
+
}
|
|
9821
|
+
|
|
9822
|
+
return filterMenus;
|
|
9823
|
+
})();
|
|
9790
9824
|
}
|
|
9791
9825
|
|
|
9792
9826
|
getOriginFaviconHref() {
|
|
@@ -9794,22 +9828,22 @@
|
|
|
9794
9828
|
}
|
|
9795
9829
|
|
|
9796
9830
|
getProviderBrick(provider) {
|
|
9797
|
-
var
|
|
9831
|
+
var _this12 = this;
|
|
9798
9832
|
|
|
9799
9833
|
return _asyncToGenerator__default["default"](function* () {
|
|
9800
9834
|
if (isCustomApiProvider(provider)) {
|
|
9801
9835
|
provider = CUSTOM_API_PROVIDER;
|
|
9802
9836
|
}
|
|
9803
9837
|
|
|
9804
|
-
if (
|
|
9805
|
-
return
|
|
9838
|
+
if (_this12.providerRepository.has(provider)) {
|
|
9839
|
+
return _this12.providerRepository.get(provider);
|
|
9806
9840
|
}
|
|
9807
9841
|
|
|
9808
9842
|
if (provider === CUSTOM_API_PROVIDER && !customElements.get(provider)) {
|
|
9809
9843
|
registerCustomApi();
|
|
9810
9844
|
}
|
|
9811
9845
|
|
|
9812
|
-
yield
|
|
9846
|
+
yield _this12.loadDynamicBricks([provider]);
|
|
9813
9847
|
|
|
9814
9848
|
if (!customElements.get(provider)) {
|
|
9815
9849
|
throw new Error("Provider not defined: \"".concat(provider, "\"."));
|
|
@@ -9817,7 +9851,7 @@
|
|
|
9817
9851
|
|
|
9818
9852
|
var brick = document.createElement(provider);
|
|
9819
9853
|
|
|
9820
|
-
|
|
9854
|
+
_this12.providerRepository.set(provider, brick);
|
|
9821
9855
|
|
|
9822
9856
|
return brick;
|
|
9823
9857
|
})();
|