@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/dist/index.esm.js
CHANGED
|
@@ -3131,7 +3131,7 @@ function _fetchMenuById() {
|
|
|
3131
3131
|
return menuCache.get(menuId);
|
|
3132
3132
|
}
|
|
3133
3133
|
|
|
3134
|
-
var menuList = window.STANDALONE_MICRO_APPS ? kernel.getStandaloneMenus(menuId, isPreFetch) : (yield InstanceApi_postSearch("EASYOPS_STORYBOARD_MENU", {
|
|
3134
|
+
var menuList = window.STANDALONE_MICRO_APPS ? yield kernel.getStandaloneMenus(menuId, isPreFetch) : (yield InstanceApi_postSearch("EASYOPS_STORYBOARD_MENU", {
|
|
3135
3135
|
page: 1,
|
|
3136
3136
|
page_size: 200,
|
|
3137
3137
|
fields: {
|
|
@@ -3450,17 +3450,10 @@ function computeRealValueWithOverrideApp(data, overrideAppId, context, kernel) {
|
|
|
3450
3450
|
|
|
3451
3451
|
if (overrideAppId !== context.app.id && attemptToVisit(data, ["APP", "I18N"])) {
|
|
3452
3452
|
var storyboard = kernel.bootstrapData.storyboards.find(story => story.app.id === overrideAppId);
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
overrideApp: storyboard.app,
|
|
3458
|
-
appendI18nNamespace: data[symbolMenuI18nNamespace]
|
|
3459
|
-
});
|
|
3460
|
-
} else {
|
|
3461
|
-
// eslint-disable-next-line no-console
|
|
3462
|
-
console.error("The app which injects menu was not found:", overrideAppId);
|
|
3463
|
-
}
|
|
3453
|
+
newContext = _objectSpread(_objectSpread({}, context), {}, {
|
|
3454
|
+
overrideApp: storyboard === null || storyboard === void 0 ? void 0 : storyboard.app,
|
|
3455
|
+
appendI18nNamespace: data[symbolMenuI18nNamespace]
|
|
3456
|
+
});
|
|
3464
3457
|
}
|
|
3465
3458
|
|
|
3466
3459
|
return computeRealValue(data, newContext, true, {
|
|
@@ -6724,7 +6717,9 @@ function customListenerFactory(handler, ifContainer, context, runtimeBrick) {
|
|
|
6724
6717
|
var computedTarget = rawTarget; // Allow `target` to be set as evaluable string.
|
|
6725
6718
|
|
|
6726
6719
|
if (typeof rawTarget === "string" ? isEvaluable(rawTarget) : isPreEvaluated(rawTarget)) {
|
|
6727
|
-
computedTarget = computeRealValue(rawTarget, context)
|
|
6720
|
+
computedTarget = computeRealValue(rawTarget, _objectSpread(_objectSpread({}, context), {}, {
|
|
6721
|
+
event
|
|
6722
|
+
}));
|
|
6728
6723
|
}
|
|
6729
6724
|
|
|
6730
6725
|
if (typeof computedTarget === "string") {
|
|
@@ -6750,7 +6745,9 @@ function customListenerFactory(handler, ifContainer, context, runtimeBrick) {
|
|
|
6750
6745
|
var computedTargetRef = rawTargetRef; // Allow `targetRef` to be set as evaluable string.
|
|
6751
6746
|
|
|
6752
6747
|
if (typeof rawTargetRef === "string" ? isEvaluable(rawTargetRef) : isPreEvaluated(rawTargetRef)) {
|
|
6753
|
-
computedTargetRef = computeRealValue(rawTargetRef, context,
|
|
6748
|
+
computedTargetRef = computeRealValue(rawTargetRef, _objectSpread(_objectSpread({}, context), {}, {
|
|
6749
|
+
event
|
|
6750
|
+
}), true);
|
|
6754
6751
|
}
|
|
6755
6752
|
|
|
6756
6753
|
var tpl = getTplContext(context.tplContextId).getBrick().element;
|
|
@@ -9202,7 +9199,7 @@ class Kernel {
|
|
|
9202
9199
|
|
|
9203
9200
|
return _asyncToGenerator$3(function* () {
|
|
9204
9201
|
var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : BootstrapV2Api_bootstrapV2(_objectSpread({
|
|
9205
|
-
appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status,icons",
|
|
9202
|
+
appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status,icons,standaloneMode",
|
|
9206
9203
|
ignoreTemplateFields: "templates",
|
|
9207
9204
|
ignoreBrickFields: "bricks,processors,providers,editors"
|
|
9208
9205
|
}, params), {
|
|
@@ -9320,8 +9317,7 @@ class Kernel {
|
|
|
9320
9317
|
var filteredStoryboards = appIds.map(appId => _this7.bootstrapData.storyboards.find(story => story.app.id === appId)).filter(story => story && !story.$$fulfilled && !story.$$i18nFulfilled);
|
|
9321
9318
|
|
|
9322
9319
|
if (window.STANDALONE_MICRO_APPS) {
|
|
9323
|
-
//
|
|
9324
|
-
yield Promise.all(filteredStoryboards.map(story => _this7.fulfilStoryboard(story)));
|
|
9320
|
+
// standalone micros-apps not need to request i18n
|
|
9325
9321
|
return;
|
|
9326
9322
|
} // Do not fulfil i18n if the app is doing a whole fulfilling.
|
|
9327
9323
|
|
|
@@ -9773,21 +9769,63 @@ class Kernel {
|
|
|
9773
9769
|
}
|
|
9774
9770
|
|
|
9775
9771
|
getStandaloneMenus(menuId, isPreFetch) {
|
|
9776
|
-
var
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9772
|
+
var _this11 = this;
|
|
9773
|
+
|
|
9774
|
+
return _asyncToGenerator$3(function* () {
|
|
9775
|
+
var _currentStoryboard$me, _currentStoryboard$me2;
|
|
9776
|
+
|
|
9777
|
+
var app = isPreFetch ? _this11.nextApp : _this11.currentApp;
|
|
9778
|
+
var currentAppId = app.id;
|
|
9779
|
+
|
|
9780
|
+
var currentStoryboard = _this11.bootstrapData.storyboards.find(storyboard => storyboard.app.id === currentAppId);
|
|
9781
|
+
|
|
9782
|
+
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) : [];
|
|
9783
|
+
var filterMenus = menus.filter(menu => menu.menuId === menuId).map(menu => {
|
|
9784
|
+
var _menu$app;
|
|
9785
|
+
|
|
9786
|
+
return _objectSpread(_objectSpread({}, menu), (_menu$app = menu.app) !== null && _menu$app !== void 0 && _menu$app.length && menu.app[0].appId ? {} : {
|
|
9787
|
+
app: [{
|
|
9788
|
+
appId: currentAppId
|
|
9789
|
+
}]
|
|
9790
|
+
});
|
|
9789
9791
|
});
|
|
9790
|
-
|
|
9792
|
+
|
|
9793
|
+
if (!filterMenus.length) {
|
|
9794
|
+
var _ref5, _yield$InstanceApi_po;
|
|
9795
|
+
|
|
9796
|
+
filterMenus = (_ref5 = (_yield$InstanceApi_po = yield InstanceApi_postSearch("STANDALONE_MENU@EASYOPS", {
|
|
9797
|
+
page: 1,
|
|
9798
|
+
page_size: 200,
|
|
9799
|
+
fields: {
|
|
9800
|
+
menuId: true,
|
|
9801
|
+
title: true,
|
|
9802
|
+
icon: true,
|
|
9803
|
+
link: true,
|
|
9804
|
+
titleDataSource: true,
|
|
9805
|
+
defaultCollapsed: true,
|
|
9806
|
+
defaultCollapsedBreakpoint: true,
|
|
9807
|
+
type: true,
|
|
9808
|
+
injectMenuGroupId: true,
|
|
9809
|
+
dynamicItems: true,
|
|
9810
|
+
itemsResolve: true,
|
|
9811
|
+
items: true,
|
|
9812
|
+
i18n: true,
|
|
9813
|
+
"items.children": true,
|
|
9814
|
+
"app.appId": true
|
|
9815
|
+
},
|
|
9816
|
+
query: {
|
|
9817
|
+
menuId: {
|
|
9818
|
+
$eq: menuId
|
|
9819
|
+
},
|
|
9820
|
+
"app.isActiveVersion": {
|
|
9821
|
+
$eq: true
|
|
9822
|
+
}
|
|
9823
|
+
}
|
|
9824
|
+
})) === null || _yield$InstanceApi_po === void 0 ? void 0 : _yield$InstanceApi_po.list) !== null && _ref5 !== void 0 ? _ref5 : [];
|
|
9825
|
+
}
|
|
9826
|
+
|
|
9827
|
+
return filterMenus;
|
|
9828
|
+
})();
|
|
9791
9829
|
}
|
|
9792
9830
|
|
|
9793
9831
|
getOriginFaviconHref() {
|
|
@@ -9795,22 +9833,22 @@ class Kernel {
|
|
|
9795
9833
|
}
|
|
9796
9834
|
|
|
9797
9835
|
getProviderBrick(provider) {
|
|
9798
|
-
var
|
|
9836
|
+
var _this12 = this;
|
|
9799
9837
|
|
|
9800
9838
|
return _asyncToGenerator$3(function* () {
|
|
9801
9839
|
if (isCustomApiProvider(provider)) {
|
|
9802
9840
|
provider = CUSTOM_API_PROVIDER;
|
|
9803
9841
|
}
|
|
9804
9842
|
|
|
9805
|
-
if (
|
|
9806
|
-
return
|
|
9843
|
+
if (_this12.providerRepository.has(provider)) {
|
|
9844
|
+
return _this12.providerRepository.get(provider);
|
|
9807
9845
|
}
|
|
9808
9846
|
|
|
9809
9847
|
if (provider === CUSTOM_API_PROVIDER && !customElements.get(provider)) {
|
|
9810
9848
|
registerCustomApi();
|
|
9811
9849
|
}
|
|
9812
9850
|
|
|
9813
|
-
yield
|
|
9851
|
+
yield _this12.loadDynamicBricks([provider]);
|
|
9814
9852
|
|
|
9815
9853
|
if (!customElements.get(provider)) {
|
|
9816
9854
|
throw new Error("Provider not defined: \"".concat(provider, "\"."));
|
|
@@ -9818,7 +9856,7 @@ class Kernel {
|
|
|
9818
9856
|
|
|
9819
9857
|
var brick = document.createElement(provider);
|
|
9820
9858
|
|
|
9821
|
-
|
|
9859
|
+
_this12.providerRepository.set(provider, brick);
|
|
9822
9860
|
|
|
9823
9861
|
return brick;
|
|
9824
9862
|
})();
|