@next-core/brick-kit 2.153.1 → 2.153.3
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 +31 -8
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +32 -9
- 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/core/Runtime.d.ts.map +1 -1
- package/dist/types/core/matchStoryboard.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.bundle.js
CHANGED
|
@@ -3556,6 +3556,10 @@
|
|
|
3556
3556
|
*/
|
|
3557
3557
|
|
|
3558
3558
|
function isOutsideApp(storyboard) {
|
|
3559
|
+
if (process.env.NODE_ENV === "test") {
|
|
3560
|
+
return false;
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3559
3563
|
return !storyboard || !window.STANDALONE_MICRO_APPS && storyboard.app.standaloneMode;
|
|
3560
3564
|
}
|
|
3561
3565
|
|
|
@@ -3933,6 +3937,10 @@
|
|
|
3933
3937
|
/* istanbul ignore next */
|
|
3934
3938
|
|
|
3935
3939
|
function _internalApiMatchStoryboard(pathname) {
|
|
3940
|
+
if (process.env.NODE_ENV === "test") {
|
|
3941
|
+
return;
|
|
3942
|
+
}
|
|
3943
|
+
|
|
3936
3944
|
return matchStoryboard(kernel.bootstrapData.storyboards, pathname);
|
|
3937
3945
|
}
|
|
3938
3946
|
/* istanbul ignore next */
|
|
@@ -8916,7 +8924,7 @@
|
|
|
8916
8924
|
}
|
|
8917
8925
|
}
|
|
8918
8926
|
|
|
8919
|
-
function registerCustomTemplate(tplName, tplConstructor, appId) {
|
|
8927
|
+
function registerCustomTemplate(tplName, tplConstructor, appId, deadCOnditionsRemoved) {
|
|
8920
8928
|
var tagName = tplName; // When a template is registered by an app, its namespace maybe missed.
|
|
8921
8929
|
|
|
8922
8930
|
if (appId && !tplName.includes(".")) {
|
|
@@ -8940,6 +8948,13 @@
|
|
|
8940
8948
|
// eslint-disable-next-line no-console
|
|
8941
8949
|
console.warn("Custom template of \"".concat(tagName, "\" already defined by customElements."));
|
|
8942
8950
|
}
|
|
8951
|
+
}
|
|
8952
|
+
|
|
8953
|
+
if (!deadCOnditionsRemoved && process.env.NODE_ENV !== "test") {
|
|
8954
|
+
brickUtils.removeDeadConditionsInTpl(tplConstructor, {
|
|
8955
|
+
constantFeatureFlags: true,
|
|
8956
|
+
featureFlags: getRuntime().getFeatureFlags()
|
|
8957
|
+
});
|
|
8943
8958
|
} // Now we allow re-register custom template
|
|
8944
8959
|
|
|
8945
8960
|
|
|
@@ -9617,7 +9632,7 @@
|
|
|
9617
9632
|
bricks: tpl.bricks,
|
|
9618
9633
|
proxy: tpl.proxy,
|
|
9619
9634
|
state: tpl.state
|
|
9620
|
-
}, (_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);
|
|
9621
9636
|
}
|
|
9622
9637
|
} // 每个 storyboard 仅注册一次custom-template
|
|
9623
9638
|
|
|
@@ -12196,21 +12211,29 @@
|
|
|
12196
12211
|
if (storyboard) {
|
|
12197
12212
|
var _storyboard$meta, _storyboard$meta2, _storyboard$meta3;
|
|
12198
12213
|
|
|
12199
|
-
yield _this3.kernel.fulfilStoryboard(storyboard);
|
|
12214
|
+
yield _this3.kernel.fulfilStoryboard(storyboard);
|
|
12215
|
+
brickUtils.removeDeadConditions(storyboard, {
|
|
12216
|
+
constantFeatureFlags: true,
|
|
12217
|
+
featureFlags: _this3.featureFlags
|
|
12218
|
+
}); // 将动态解析后的模板还原,以便重新动态解析。
|
|
12200
12219
|
|
|
12201
|
-
brickUtils.restoreDynamicTemplates(storyboard);
|
|
12220
|
+
brickUtils.restoreDynamicTemplates(storyboard);
|
|
12221
|
+
var parallelRequests = []; // 预加载权限信息
|
|
12202
12222
|
|
|
12203
12223
|
if (isLoggedIn() && !getAuth().isAdmin) {
|
|
12204
|
-
|
|
12224
|
+
parallelRequests.push(preCheckPermissions(storyboard));
|
|
12205
12225
|
} // Standalone App 需要额外读取 Installed App 信息
|
|
12206
12226
|
|
|
12207
12227
|
|
|
12208
12228
|
if (window.STANDALONE_MICRO_APPS && !window.NO_AUTH_GUARD) {
|
|
12209
12229
|
// TODO: get standalone apps when NO_AUTH_GUARD, maybe from conf.yaml
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
12230
|
+
parallelRequests.push(preFetchStandaloneInstalledApps(storyboard).then(() => {
|
|
12231
|
+
_this3.kernel.bootstrapData.offSiteStandaloneApps = getStandaloneInstalledApps();
|
|
12232
|
+
}));
|
|
12233
|
+
} // `loadDepsOfStoryboard()` may requires these data.
|
|
12234
|
+
|
|
12213
12235
|
|
|
12236
|
+
yield Promise.all(parallelRequests); // 如果找到匹配的 storyboard,那么根据路由匹配得到的 sub-storyboard 加载它的依赖库。
|
|
12214
12237
|
|
|
12215
12238
|
var subStoryboard = _this3.locationContext.getSubStoryboardByRoute(storyboard);
|
|
12216
12239
|
|