@next-core/brick-kit 2.141.2 → 2.143.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 +27 -0
- package/dist/index.bundle.js +74 -36
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +74 -36
- 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/dist/types/internal/bindListeners.d.ts.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
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.143.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.142.0...@next-core/brick-kit@2.143.0) (2022-09-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* target/ targetRef 能够获取事件信息 ([c7cbd24](https://github.com/easyops-cn/next-core/commit/c7cbd24aa335a68d582ec183b3c600b6e41ca127))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* bootstrap add standaloneMode field ([676cd23](https://github.com/easyops-cn/next-core/commit/676cd238e49713afe885feec5f73d5ff3ffaa8d1))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [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)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* standalone app not need to request i18n ([8f62e8b](https://github.com/easyops-cn/next-core/commit/8f62e8b78e3327817009cbfcf5154636041614f1))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [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
34
|
|
|
8
35
|
**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, {
|
|
@@ -6723,7 +6716,9 @@
|
|
|
6723
6716
|
var computedTarget = rawTarget; // Allow `target` to be set as evaluable string.
|
|
6724
6717
|
|
|
6725
6718
|
if (typeof rawTarget === "string" ? brickUtils.isEvaluable(rawTarget) : isPreEvaluated(rawTarget)) {
|
|
6726
|
-
computedTarget = computeRealValue(rawTarget, context)
|
|
6719
|
+
computedTarget = computeRealValue(rawTarget, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
6720
|
+
event
|
|
6721
|
+
}));
|
|
6727
6722
|
}
|
|
6728
6723
|
|
|
6729
6724
|
if (typeof computedTarget === "string") {
|
|
@@ -6749,7 +6744,9 @@
|
|
|
6749
6744
|
var computedTargetRef = rawTargetRef; // Allow `targetRef` to be set as evaluable string.
|
|
6750
6745
|
|
|
6751
6746
|
if (typeof rawTargetRef === "string" ? brickUtils.isEvaluable(rawTargetRef) : isPreEvaluated(rawTargetRef)) {
|
|
6752
|
-
computedTargetRef = computeRealValue(rawTargetRef, context,
|
|
6747
|
+
computedTargetRef = computeRealValue(rawTargetRef, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
6748
|
+
event
|
|
6749
|
+
}), true);
|
|
6753
6750
|
}
|
|
6754
6751
|
|
|
6755
6752
|
var tpl = getTplContext(context.tplContextId).getBrick().element;
|
|
@@ -9201,7 +9198,7 @@
|
|
|
9201
9198
|
|
|
9202
9199
|
return _asyncToGenerator__default["default"](function* () {
|
|
9203
9200
|
var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : BootstrapV2Api_bootstrapV2(_objectSpread__default["default"]({
|
|
9204
|
-
appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status,icons",
|
|
9201
|
+
appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status,icons,standaloneMode",
|
|
9205
9202
|
ignoreTemplateFields: "templates",
|
|
9206
9203
|
ignoreBrickFields: "bricks,processors,providers,editors"
|
|
9207
9204
|
}, params), {
|
|
@@ -9319,8 +9316,7 @@
|
|
|
9319
9316
|
var filteredStoryboards = appIds.map(appId => _this7.bootstrapData.storyboards.find(story => story.app.id === appId)).filter(story => story && !story.$$fulfilled && !story.$$i18nFulfilled);
|
|
9320
9317
|
|
|
9321
9318
|
if (window.STANDALONE_MICRO_APPS) {
|
|
9322
|
-
//
|
|
9323
|
-
yield Promise.all(filteredStoryboards.map(story => _this7.fulfilStoryboard(story)));
|
|
9319
|
+
// standalone micros-apps not need to request i18n
|
|
9324
9320
|
return;
|
|
9325
9321
|
} // Do not fulfil i18n if the app is doing a whole fulfilling.
|
|
9326
9322
|
|
|
@@ -9772,21 +9768,63 @@
|
|
|
9772
9768
|
}
|
|
9773
9769
|
|
|
9774
9770
|
getStandaloneMenus(menuId, isPreFetch) {
|
|
9775
|
-
var
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9771
|
+
var _this11 = this;
|
|
9772
|
+
|
|
9773
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
9774
|
+
var _currentStoryboard$me, _currentStoryboard$me2;
|
|
9775
|
+
|
|
9776
|
+
var app = isPreFetch ? _this11.nextApp : _this11.currentApp;
|
|
9777
|
+
var currentAppId = app.id;
|
|
9778
|
+
|
|
9779
|
+
var currentStoryboard = _this11.bootstrapData.storyboards.find(storyboard => storyboard.app.id === currentAppId);
|
|
9780
|
+
|
|
9781
|
+
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) : [];
|
|
9782
|
+
var filterMenus = menus.filter(menu => menu.menuId === menuId).map(menu => {
|
|
9783
|
+
var _menu$app;
|
|
9784
|
+
|
|
9785
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, menu), (_menu$app = menu.app) !== null && _menu$app !== void 0 && _menu$app.length && menu.app[0].appId ? {} : {
|
|
9786
|
+
app: [{
|
|
9787
|
+
appId: currentAppId
|
|
9788
|
+
}]
|
|
9789
|
+
});
|
|
9788
9790
|
});
|
|
9789
|
-
|
|
9791
|
+
|
|
9792
|
+
if (!filterMenus.length) {
|
|
9793
|
+
var _ref5, _yield$InstanceApi_po;
|
|
9794
|
+
|
|
9795
|
+
filterMenus = (_ref5 = (_yield$InstanceApi_po = yield InstanceApi_postSearch("STANDALONE_MENU@EASYOPS", {
|
|
9796
|
+
page: 1,
|
|
9797
|
+
page_size: 200,
|
|
9798
|
+
fields: {
|
|
9799
|
+
menuId: true,
|
|
9800
|
+
title: true,
|
|
9801
|
+
icon: true,
|
|
9802
|
+
link: true,
|
|
9803
|
+
titleDataSource: true,
|
|
9804
|
+
defaultCollapsed: true,
|
|
9805
|
+
defaultCollapsedBreakpoint: true,
|
|
9806
|
+
type: true,
|
|
9807
|
+
injectMenuGroupId: true,
|
|
9808
|
+
dynamicItems: true,
|
|
9809
|
+
itemsResolve: true,
|
|
9810
|
+
items: true,
|
|
9811
|
+
i18n: true,
|
|
9812
|
+
"items.children": true,
|
|
9813
|
+
"app.appId": true
|
|
9814
|
+
},
|
|
9815
|
+
query: {
|
|
9816
|
+
menuId: {
|
|
9817
|
+
$eq: menuId
|
|
9818
|
+
},
|
|
9819
|
+
"app.isActiveVersion": {
|
|
9820
|
+
$eq: true
|
|
9821
|
+
}
|
|
9822
|
+
}
|
|
9823
|
+
})) === null || _yield$InstanceApi_po === void 0 ? void 0 : _yield$InstanceApi_po.list) !== null && _ref5 !== void 0 ? _ref5 : [];
|
|
9824
|
+
}
|
|
9825
|
+
|
|
9826
|
+
return filterMenus;
|
|
9827
|
+
})();
|
|
9790
9828
|
}
|
|
9791
9829
|
|
|
9792
9830
|
getOriginFaviconHref() {
|
|
@@ -9794,22 +9832,22 @@
|
|
|
9794
9832
|
}
|
|
9795
9833
|
|
|
9796
9834
|
getProviderBrick(provider) {
|
|
9797
|
-
var
|
|
9835
|
+
var _this12 = this;
|
|
9798
9836
|
|
|
9799
9837
|
return _asyncToGenerator__default["default"](function* () {
|
|
9800
9838
|
if (isCustomApiProvider(provider)) {
|
|
9801
9839
|
provider = CUSTOM_API_PROVIDER;
|
|
9802
9840
|
}
|
|
9803
9841
|
|
|
9804
|
-
if (
|
|
9805
|
-
return
|
|
9842
|
+
if (_this12.providerRepository.has(provider)) {
|
|
9843
|
+
return _this12.providerRepository.get(provider);
|
|
9806
9844
|
}
|
|
9807
9845
|
|
|
9808
9846
|
if (provider === CUSTOM_API_PROVIDER && !customElements.get(provider)) {
|
|
9809
9847
|
registerCustomApi();
|
|
9810
9848
|
}
|
|
9811
9849
|
|
|
9812
|
-
yield
|
|
9850
|
+
yield _this12.loadDynamicBricks([provider]);
|
|
9813
9851
|
|
|
9814
9852
|
if (!customElements.get(provider)) {
|
|
9815
9853
|
throw new Error("Provider not defined: \"".concat(provider, "\"."));
|
|
@@ -9817,7 +9855,7 @@
|
|
|
9817
9855
|
|
|
9818
9856
|
var brick = document.createElement(provider);
|
|
9819
9857
|
|
|
9820
|
-
|
|
9858
|
+
_this12.providerRepository.set(provider, brick);
|
|
9821
9859
|
|
|
9822
9860
|
return brick;
|
|
9823
9861
|
})();
|