@next-core/brick-kit 2.126.0 → 2.127.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 +33 -0
- package/dist/index.bundle.js +40 -52
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +40 -52
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/LocationContext.d.ts.map +1 -1
- package/dist/types/core/Router.d.ts +1 -2
- package/dist/types/core/Router.d.ts.map +1 -1
- package/dist/types/internal/mergePreviewRoutes.d.ts +3 -0
- package/dist/types/internal/mergePreviewRoutes.d.ts.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
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.127.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.126.2...@next-core/brick-kit@2.127.0) (2022-08-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **brick-kit:** 增加两个cmdb模板 ([e53dca1](https://github.com/easyops-cn/next-core/commit/e53dca14ac2b00ec4cf4a13011c2e7b555bb18b2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.126.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.126.1...@next-core/brick-kit@2.126.2) (2022-08-09)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* fix merge preview routes ([ed39097](https://github.com/easyops-cn/next-core/commit/ed390976eb4cb8536465aa30abce5ae51c18e72a))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [2.126.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.126.0...@next-core/brick-kit@2.126.1) (2022-08-09)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* do not report 404 when page is empty ([869038e](https://github.com/easyops-cn/next-core/commit/869038e2d5447001aa7e22a1218ce91774ce0905))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
# [2.126.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.125.0...@next-core/brick-kit@2.126.0) (2022-08-08)
|
|
7
40
|
|
|
8
41
|
|
package/dist/index.bundle.js
CHANGED
|
@@ -10640,7 +10640,7 @@
|
|
|
10640
10640
|
|
|
10641
10641
|
yield _this6.resolver.resolve(brickConf, brick, context);
|
|
10642
10642
|
var expandedBrickConf = brickConf;
|
|
10643
|
-
var isBaseLayout = ["base-layout.tpl-homepage-base-module", "base-layout.tpl-base-page-module"].includes(tplTagName);
|
|
10643
|
+
var isBaseLayout = ["base-layout.tpl-homepage-base-module", "base-layout.tpl-base-page-module", "base-layout.tpl-homepage-base-module-cmdb", "base-layout.tpl-base-page-module-cmdb"].includes(tplTagName);
|
|
10644
10644
|
|
|
10645
10645
|
if (tplTagName && (!isBaseLayout || _this6.kernel.getFeatureFlags()["support-ui-8.0-base-layout"] && isBaseLayout)) {
|
|
10646
10646
|
var _customTemplateRegist;
|
|
@@ -11503,6 +11503,38 @@
|
|
|
11503
11503
|
return standaloneApps;
|
|
11504
11504
|
}
|
|
11505
11505
|
|
|
11506
|
+
function mergePreviewRoutes(routes) {
|
|
11507
|
+
var mergedRoutes = routes;
|
|
11508
|
+
var specificTemplatePreviewIndex = _.findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/template-preview/"));
|
|
11509
|
+
mergedRoutes = [...mergedRoutes.slice(0, specificTemplatePreviewIndex + 1), {
|
|
11510
|
+
path: "${APP.homepage}/_dev_only_/template-preview/:templateId",
|
|
11511
|
+
bricks: [{
|
|
11512
|
+
brick: "span"
|
|
11513
|
+
}],
|
|
11514
|
+
menu: false,
|
|
11515
|
+
exact: true
|
|
11516
|
+
}, ...mergedRoutes.slice(specificTemplatePreviewIndex + 1)];
|
|
11517
|
+
var specificSnippetPreviewIndex = _.findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/"));
|
|
11518
|
+
mergedRoutes = [...mergedRoutes.slice(0, specificSnippetPreviewIndex + 1), {
|
|
11519
|
+
path: "${APP.homepage}/_dev_only_/snippet-preview/:snippetId",
|
|
11520
|
+
bricks: [{
|
|
11521
|
+
brick: "span"
|
|
11522
|
+
}],
|
|
11523
|
+
menu: false,
|
|
11524
|
+
exact: true
|
|
11525
|
+
}, ...mergedRoutes.slice(specificSnippetPreviewIndex + 1)];
|
|
11526
|
+
var specificFormPreviewIndex = _.findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/form-preview/"));
|
|
11527
|
+
mergedRoutes = [...mergedRoutes.slice(0, specificFormPreviewIndex + 1), {
|
|
11528
|
+
path: "${APP.homepage}/_dev_only_/form-preview/:FormId",
|
|
11529
|
+
bricks: [{
|
|
11530
|
+
brick: "span"
|
|
11531
|
+
}],
|
|
11532
|
+
menu: false,
|
|
11533
|
+
exact: true
|
|
11534
|
+
}, ...mergedRoutes.slice(specificFormPreviewIndex + 1)];
|
|
11535
|
+
return mergedRoutes;
|
|
11536
|
+
}
|
|
11537
|
+
|
|
11506
11538
|
class Router {
|
|
11507
11539
|
constructor(kernel) {
|
|
11508
11540
|
_defineProperty__default["default"](this, "defaultCollapsed", false);
|
|
@@ -11759,7 +11791,7 @@
|
|
|
11759
11791
|
}
|
|
11760
11792
|
}
|
|
11761
11793
|
|
|
11762
|
-
layoutType = bricks.some(brick => ["base-layout.tpl-base-page-module", "base-layout.tpl-homepage-base-module"].includes(brick)) && layoutType === "business" && !_this3.featureFlags["support-ui-8.0-base-layout"] ? "console" : layoutType;
|
|
11794
|
+
layoutType = bricks.some(brick => ["base-layout.tpl-base-page-module", "base-layout.tpl-homepage-base-module", "base-layout.tpl-homepage-base-module-cmdb", "base-layout.tpl-base-page-module-cmdb"].includes(brick)) && layoutType === "business" && !_this3.featureFlags["support-ui-8.0-base-layout"] ? "console" : layoutType;
|
|
11763
11795
|
var mountRoutesResult = {
|
|
11764
11796
|
main: [],
|
|
11765
11797
|
menuInBg: [],
|
|
@@ -11778,8 +11810,7 @@
|
|
|
11778
11810
|
};
|
|
11779
11811
|
|
|
11780
11812
|
try {
|
|
11781
|
-
var mergedRoutes =
|
|
11782
|
-
|
|
11813
|
+
var mergedRoutes = mergePreviewRoutes(storyboard.routes);
|
|
11783
11814
|
yield locationContext.mountRoutes(mergedRoutes, undefined, mountRoutesResult);
|
|
11784
11815
|
} catch (error) {
|
|
11785
11816
|
// eslint-disable-next-line no-console
|
|
@@ -11907,9 +11938,10 @@
|
|
|
11907
11938
|
|
|
11908
11939
|
menuInBg.forEach(brick => {
|
|
11909
11940
|
appendBrick(brick, mountPoints.portal);
|
|
11910
|
-
});
|
|
11941
|
+
}); // When we have a matched route other than an abstract route,
|
|
11942
|
+
// we say *page found*, otherwise, *page not found*.
|
|
11911
11943
|
|
|
11912
|
-
if (
|
|
11944
|
+
if (route && route.type !== "routes" || failed) {
|
|
11913
11945
|
main.length > 0 && mountTree(main, mountPoints.main);
|
|
11914
11946
|
portal.length > 0 && mountTree(portal, mountPoints.portal);
|
|
11915
11947
|
afterMountTree(mountPoints.main);
|
|
@@ -11949,9 +11981,9 @@
|
|
|
11949
11981
|
_this3.kernel.prefetchDepsOfStoryboard(storyboard);
|
|
11950
11982
|
});
|
|
11951
11983
|
} else {
|
|
11952
|
-
|
|
11984
|
+
setTimeout(() => {
|
|
11953
11985
|
_this3.kernel.prefetchDepsOfStoryboard(storyboard);
|
|
11954
|
-
});
|
|
11986
|
+
}, 0);
|
|
11955
11987
|
}
|
|
11956
11988
|
|
|
11957
11989
|
return;
|
|
@@ -11989,50 +12021,6 @@
|
|
|
11989
12021
|
subMenu: mountResult.menuBar.subMenu
|
|
11990
12022
|
};
|
|
11991
12023
|
}
|
|
11992
|
-
|
|
11993
|
-
MergePreviewRouter(router) {
|
|
11994
|
-
var mergedRoutes = router;
|
|
11995
|
-
var specificTemplatePreviewIndex = _.findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/template-preview/"));
|
|
11996
|
-
|
|
11997
|
-
if (specificTemplatePreviewIndex > -1) {
|
|
11998
|
-
mergedRoutes = [...mergedRoutes.slice(0, specificTemplatePreviewIndex + 1), {
|
|
11999
|
-
path: "${APP.homepage}/_dev_only_/template-preview/:templateId",
|
|
12000
|
-
bricks: [{
|
|
12001
|
-
brick: "span"
|
|
12002
|
-
}],
|
|
12003
|
-
menu: false,
|
|
12004
|
-
exact: true
|
|
12005
|
-
}, ...mergedRoutes.slice(specificTemplatePreviewIndex + 1)];
|
|
12006
|
-
}
|
|
12007
|
-
|
|
12008
|
-
var specificSnippetPreviewIndex = _.findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/"));
|
|
12009
|
-
|
|
12010
|
-
if (specificSnippetPreviewIndex > -1) {
|
|
12011
|
-
mergedRoutes = [...mergedRoutes.slice(0, specificSnippetPreviewIndex + 1), {
|
|
12012
|
-
path: "${APP.homepage}/_dev_only_/snippet-preview/:snippetId",
|
|
12013
|
-
bricks: [{
|
|
12014
|
-
brick: "span"
|
|
12015
|
-
}],
|
|
12016
|
-
menu: false,
|
|
12017
|
-
exact: true
|
|
12018
|
-
}, ...mergedRoutes.slice(specificSnippetPreviewIndex + 1)];
|
|
12019
|
-
}
|
|
12020
|
-
|
|
12021
|
-
var specificFormPreviewIndex = _.findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/form-preview/"));
|
|
12022
|
-
|
|
12023
|
-
if (specificFormPreviewIndex > -1) {
|
|
12024
|
-
mergedRoutes = [...mergedRoutes.slice(0, specificFormPreviewIndex + 1), {
|
|
12025
|
-
path: "${APP.homepage}/_dev_only_/form-preview/:FormId",
|
|
12026
|
-
bricks: [{
|
|
12027
|
-
brick: "span"
|
|
12028
|
-
}],
|
|
12029
|
-
menu: false,
|
|
12030
|
-
exact: true
|
|
12031
|
-
}, ...mergedRoutes.slice(specificFormPreviewIndex + 1)];
|
|
12032
|
-
}
|
|
12033
|
-
|
|
12034
|
-
return mergedRoutes;
|
|
12035
|
-
}
|
|
12036
12024
|
/* istanbul ignore next */
|
|
12037
12025
|
|
|
12038
12026
|
|