@next-core/brick-kit 2.126.1 → 2.127.1
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 +30 -0
- package/dist/index.bundle.js +35 -48
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +35 -48
- 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 +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
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.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.127.0...@next-core/brick-kit@2.127.1) (2022-08-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @next-core/brick-kit
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [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)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **brick-kit:** 增加两个cmdb模板 ([e53dca1](https://github.com/easyops-cn/next-core/commit/e53dca14ac2b00ec4cf4a13011c2e7b555bb18b2))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [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)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* fix merge preview routes ([ed39097](https://github.com/easyops-cn/next-core/commit/ed390976eb4cb8536465aa30abce5ae51c18e72a))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## [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)
|
|
7
37
|
|
|
8
38
|
|
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
|
|
@@ -11990,50 +12021,6 @@
|
|
|
11990
12021
|
subMenu: mountResult.menuBar.subMenu
|
|
11991
12022
|
};
|
|
11992
12023
|
}
|
|
11993
|
-
|
|
11994
|
-
MergePreviewRouter(router) {
|
|
11995
|
-
var mergedRoutes = router;
|
|
11996
|
-
var specificTemplatePreviewIndex = _.findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/template-preview/"));
|
|
11997
|
-
|
|
11998
|
-
if (specificTemplatePreviewIndex > -1) {
|
|
11999
|
-
mergedRoutes = [...mergedRoutes.slice(0, specificTemplatePreviewIndex + 1), {
|
|
12000
|
-
path: "${APP.homepage}/_dev_only_/template-preview/:templateId",
|
|
12001
|
-
bricks: [{
|
|
12002
|
-
brick: "span"
|
|
12003
|
-
}],
|
|
12004
|
-
menu: false,
|
|
12005
|
-
exact: true
|
|
12006
|
-
}, ...mergedRoutes.slice(specificTemplatePreviewIndex + 1)];
|
|
12007
|
-
}
|
|
12008
|
-
|
|
12009
|
-
var specificSnippetPreviewIndex = _.findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/"));
|
|
12010
|
-
|
|
12011
|
-
if (specificSnippetPreviewIndex > -1) {
|
|
12012
|
-
mergedRoutes = [...mergedRoutes.slice(0, specificSnippetPreviewIndex + 1), {
|
|
12013
|
-
path: "${APP.homepage}/_dev_only_/snippet-preview/:snippetId",
|
|
12014
|
-
bricks: [{
|
|
12015
|
-
brick: "span"
|
|
12016
|
-
}],
|
|
12017
|
-
menu: false,
|
|
12018
|
-
exact: true
|
|
12019
|
-
}, ...mergedRoutes.slice(specificSnippetPreviewIndex + 1)];
|
|
12020
|
-
}
|
|
12021
|
-
|
|
12022
|
-
var specificFormPreviewIndex = _.findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/form-preview/"));
|
|
12023
|
-
|
|
12024
|
-
if (specificFormPreviewIndex > -1) {
|
|
12025
|
-
mergedRoutes = [...mergedRoutes.slice(0, specificFormPreviewIndex + 1), {
|
|
12026
|
-
path: "${APP.homepage}/_dev_only_/form-preview/:FormId",
|
|
12027
|
-
bricks: [{
|
|
12028
|
-
brick: "span"
|
|
12029
|
-
}],
|
|
12030
|
-
menu: false,
|
|
12031
|
-
exact: true
|
|
12032
|
-
}, ...mergedRoutes.slice(specificFormPreviewIndex + 1)];
|
|
12033
|
-
}
|
|
12034
|
-
|
|
12035
|
-
return mergedRoutes;
|
|
12036
|
-
}
|
|
12037
12024
|
/* istanbul ignore next */
|
|
12038
12025
|
|
|
12039
12026
|
|