@next-core/brick-kit 2.153.2 → 2.153.4
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 +35 -12
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +38 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/types/checkIf.d.ts +1 -1
- package/dist/types/core/CustomTemplates/registerCustomTemplate.d.ts +1 -1
- package/dist/types/core/CustomTemplates/registerCustomTemplate.d.ts.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/hooks/useProvider/fetch.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.bundle.js
CHANGED
|
@@ -8924,7 +8924,7 @@
|
|
|
8924
8924
|
}
|
|
8925
8925
|
}
|
|
8926
8926
|
|
|
8927
|
-
function registerCustomTemplate(tplName, tplConstructor, appId) {
|
|
8927
|
+
function registerCustomTemplate(tplName, tplConstructor, appId, deadCOnditionsRemoved) {
|
|
8928
8928
|
var tagName = tplName; // When a template is registered by an app, its namespace maybe missed.
|
|
8929
8929
|
|
|
8930
8930
|
if (appId && !tplName.includes(".")) {
|
|
@@ -8948,6 +8948,13 @@
|
|
|
8948
8948
|
// eslint-disable-next-line no-console
|
|
8949
8949
|
console.warn("Custom template of \"".concat(tagName, "\" already defined by customElements."));
|
|
8950
8950
|
}
|
|
8951
|
+
}
|
|
8952
|
+
|
|
8953
|
+
if (!deadCOnditionsRemoved && process.env.NODE_ENV !== "test") {
|
|
8954
|
+
brickUtils.removeDeadConditionsInTpl(tplConstructor, {
|
|
8955
|
+
constantFeatureFlags: true,
|
|
8956
|
+
featureFlags: getRuntime().getFeatureFlags()
|
|
8957
|
+
});
|
|
8951
8958
|
} // Now we allow re-register custom template
|
|
8952
8959
|
|
|
8953
8960
|
|
|
@@ -9625,7 +9632,7 @@
|
|
|
9625
9632
|
bricks: tpl.bricks,
|
|
9626
9633
|
proxy: tpl.proxy,
|
|
9627
9634
|
state: tpl.state
|
|
9628
|
-
}, (_storyboard$app = storyboard.app) === null || _storyboard$app === void 0 ? void 0 : _storyboard$app.id);
|
|
9635
|
+
}, (_storyboard$app = storyboard.app) === null || _storyboard$app === void 0 ? void 0 : _storyboard$app.id, true);
|
|
9629
9636
|
}
|
|
9630
9637
|
} // 每个 storyboard 仅注册一次custom-template
|
|
9631
9638
|
|
|
@@ -12204,21 +12211,29 @@
|
|
|
12204
12211
|
if (storyboard) {
|
|
12205
12212
|
var _storyboard$meta, _storyboard$meta2, _storyboard$meta3;
|
|
12206
12213
|
|
|
12207
|
-
yield _this3.kernel.fulfilStoryboard(storyboard);
|
|
12214
|
+
yield _this3.kernel.fulfilStoryboard(storyboard);
|
|
12215
|
+
brickUtils.removeDeadConditions(storyboard, {
|
|
12216
|
+
constantFeatureFlags: true,
|
|
12217
|
+
featureFlags: _this3.featureFlags
|
|
12218
|
+
}); // 将动态解析后的模板还原,以便重新动态解析。
|
|
12208
12219
|
|
|
12209
|
-
brickUtils.restoreDynamicTemplates(storyboard);
|
|
12220
|
+
brickUtils.restoreDynamicTemplates(storyboard);
|
|
12221
|
+
var parallelRequests = []; // 预加载权限信息
|
|
12210
12222
|
|
|
12211
12223
|
if (isLoggedIn() && !getAuth().isAdmin) {
|
|
12212
|
-
|
|
12224
|
+
parallelRequests.push(preCheckPermissions(storyboard));
|
|
12213
12225
|
} // Standalone App 需要额外读取 Installed App 信息
|
|
12214
12226
|
|
|
12215
12227
|
|
|
12216
12228
|
if (window.STANDALONE_MICRO_APPS && !window.NO_AUTH_GUARD) {
|
|
12217
12229
|
// TODO: get standalone apps when NO_AUTH_GUARD, maybe from conf.yaml
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12230
|
+
parallelRequests.push(preFetchStandaloneInstalledApps(storyboard).then(() => {
|
|
12231
|
+
_this3.kernel.bootstrapData.offSiteStandaloneApps = getStandaloneInstalledApps();
|
|
12232
|
+
}));
|
|
12233
|
+
} // `loadDepsOfStoryboard()` may requires these data.
|
|
12234
|
+
|
|
12221
12235
|
|
|
12236
|
+
yield Promise.all(parallelRequests); // 如果找到匹配的 storyboard,那么根据路由匹配得到的 sub-storyboard 加载它的依赖库。
|
|
12222
12237
|
|
|
12223
12238
|
var subStoryboard = _this3.locationContext.getSubStoryboardByRoute(storyboard);
|
|
12224
12239
|
|
|
@@ -14949,13 +14964,21 @@
|
|
|
14949
14964
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
14950
14965
|
}
|
|
14951
14966
|
|
|
14952
|
-
function
|
|
14967
|
+
function isString(v) {
|
|
14968
|
+
return typeof v === "string";
|
|
14969
|
+
}
|
|
14970
|
+
|
|
14971
|
+
function buildSortedCacheKey(provider) {
|
|
14953
14972
|
var sortObj = obj => Object.keys(obj).sort().map(k => ({
|
|
14954
14973
|
[k]: obj[k]
|
|
14955
14974
|
}));
|
|
14956
14975
|
|
|
14976
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
14977
|
+
args[_key - 1] = arguments[_key];
|
|
14978
|
+
}
|
|
14979
|
+
|
|
14957
14980
|
try {
|
|
14958
|
-
var sortedArgs = isObj(args) ? sortObj(args) : args.map(arg => sortObj(arg));
|
|
14981
|
+
var sortedArgs = isObj(args) ? sortObj(args) : args.map(arg => isString(arg) ? arg : sortObj(arg));
|
|
14959
14982
|
return JSON.stringify({
|
|
14960
14983
|
provider,
|
|
14961
14984
|
args: sortedArgs
|
|
@@ -14974,8 +14997,8 @@
|
|
|
14974
14997
|
|
|
14975
14998
|
function _fetch() {
|
|
14976
14999
|
_fetch = _asyncToGenerator__default["default"](function* (provider, cache) {
|
|
14977
|
-
for (var
|
|
14978
|
-
args[
|
|
15000
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
15001
|
+
args[_key2 - 2] = arguments[_key2];
|
|
14979
15002
|
}
|
|
14980
15003
|
|
|
14981
15004
|
var promise; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|