@next-core/brick-kit 2.126.1 → 2.126.2

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 CHANGED
@@ -3,6 +3,17 @@
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.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)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * fix merge preview routes ([ed39097](https://github.com/easyops-cn/next-core/commit/ed390976eb4cb8536465aa30abce5ae51c18e72a))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [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
18
 
8
19
 
@@ -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);
@@ -11778,8 +11810,7 @@
11778
11810
  };
11779
11811
 
11780
11812
  try {
11781
- var mergedRoutes = _this3.MergePreviewRouter(storyboard.routes);
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