@next-core/brick-kit 2.145.1 → 2.145.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/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
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.145.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.145.2...@next-core/brick-kit@2.145.3) (2022-09-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * app to standalone app, path to homepage ([af5a01d](https://github.com/easyops-cn/next-core/commit/af5a01d0e1f1875430084f9e253d326f0994386a))
12
+ * standalone back and show pageNotFound ([80d1c18](https://github.com/easyops-cn/next-core/commit/80d1c185a4f3bf5039192b7861e710456c416080))
13
+
14
+
15
+
16
+
17
+
18
+ ## [2.145.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.145.1...@next-core/brick-kit@2.145.2) (2022-09-27)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * should merge userConfig and defaultConfig ([623c30b](https://github.com/easyops-cn/next-core/commit/623c30b32df487bbf8850245f0b44d397d17fc7b))
24
+
25
+
26
+
27
+
28
+
6
29
  ## [2.145.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.145.0...@next-core/brick-kit@2.145.1) (2022-09-26)
7
30
 
8
31
  **Note:** Version bump only for package @next-core/brick-kit
@@ -9207,7 +9207,7 @@
9207
9207
 
9208
9208
  var bootstrapResponse = _objectSpread__default["default"]({
9209
9209
  templatePackages: []
9210
- }, data); // Merge `app.defaultConfig` and `app.userConfig` to `app.config`.
9210
+ }, data); // Merge `app.defaultConfig` and `app.userConfig` to `app.config`. Should merge config again in standalone mode when doFulfilStoryboard because static bootstrap.json do not have userConfig.
9211
9211
 
9212
9212
 
9213
9213
  processBootstrapResponse(bootstrapResponse);
@@ -9262,8 +9262,9 @@
9262
9262
  }
9263
9263
 
9264
9264
  if (appRuntimeData) {
9265
- // merge user config
9266
- storyboard.app.userConfig = _objectSpread__default["default"](_objectSpread__default["default"]({}, storyboard.app.userConfig), appRuntimeData.userConfig); // get inject menus (Actually, appRuntimeData contains both main and inject menus)
9265
+ // Merge `app.defaultConfig` and `app.userConfig` to `app.config`.
9266
+ storyboard.app.userConfig = _objectSpread__default["default"](_objectSpread__default["default"]({}, storyboard.app.userConfig), appRuntimeData.userConfig);
9267
+ storyboard.app.config = brickUtils.deepFreeze(_.merge({}, storyboard.app.defaultConfig, storyboard.app.userConfig)); // get inject menus (Actually, appRuntimeData contains both main and inject menus)
9267
9268
 
9268
9269
  storyboard.meta = _objectSpread__default["default"](_objectSpread__default["default"]({}, storyboard.meta), {}, {
9269
9270
  injectMenus: appRuntimeData.injectMenus
@@ -10613,14 +10614,10 @@
10613
10614
  return "missed";
10614
10615
  }
10615
10616
 
10616
- matchStoryboard(storyboards) {
10617
- if (window.STANDALONE_MICRO_APPS && storyboards.length === 1) {
10618
- return storyboards[0];
10619
- } // Put apps with longer homepage before shorter ones.
10617
+ matchStoryboard(storyboards, location) {
10618
+ // Put apps with longer homepage before shorter ones.
10620
10619
  // E.g., `/legacy/tool` will match first before `/legacy`.
10621
10620
  // This enables two apps with relationship of parent-child of homepage.
10622
-
10623
-
10624
10621
  var sortedStoryboards = _.orderBy(storyboards, storyboard => {
10625
10622
  var _storyboard$app$homep, _storyboard$app, _storyboard$app$homep2;
10626
10623
 
@@ -10633,7 +10630,7 @@
10633
10630
  var homepage = (_storyboard$app2 = storyboard.app) === null || _storyboard$app2 === void 0 ? void 0 : _storyboard$app2.homepage;
10634
10631
 
10635
10632
  if (typeof homepage === "string" && homepage[0] === "/") {
10636
- if (brickUtils.matchPath(this.location.pathname, {
10633
+ if (brickUtils.matchPath((location || this.location).pathname, {
10637
10634
  path: homepage,
10638
10635
  exact: homepage === "/"
10639
10636
  })) {
@@ -12022,6 +12019,20 @@
12022
12019
 
12023
12020
  _this.locationContext.messageDispatcher.reset();
12024
12021
 
12022
+ var storyboard = _this.locationContext.matchStoryboard(_this.kernel.bootstrapData.storyboards, location);
12023
+
12024
+ if (!window.STANDALONE_MICRO_APPS) {
12025
+ if (storyboard && storyboard.app.standaloneMode) {
12026
+ // from non-standalone app to standalone app, should jump out off site
12027
+ window.location.assign(window.location.href);
12028
+ }
12029
+ } else {
12030
+ if (!storyboard) {
12031
+ // from standalone app goback to non-standalone app, should reload
12032
+ window.location.reload();
12033
+ }
12034
+ }
12035
+
12025
12036
  if (_this.rendering) {
12026
12037
  _this.nextLocation = location;
12027
12038
  } else {
@@ -12091,16 +12102,6 @@
12091
12102
  if (storyboard) {
12092
12103
  var _storyboard$meta, _storyboard$meta2, _storyboard$meta3;
12093
12104
 
12094
- if (!window.STANDALONE_MICRO_APPS) {
12095
- if (storyboard.app.standaloneMode) {
12096
- // if nextApp was standalone micro-apps, use location.replace to reload window;
12097
- var path = history.createHref({
12098
- pathname: storyboard.app.homepage
12099
- });
12100
- window.location.replace(path);
12101
- }
12102
- }
12103
-
12104
12105
  yield _this3.kernel.fulfilStoryboard(storyboard); // 将动态解析后的模板还原,以便重新动态解析。
12105
12106
 
12106
12107
  brickUtils.restoreDynamicTemplates(storyboard); // 预加载权限信息