@next-core/brick-kit 2.145.2 → 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,18 @@
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
+
6
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)
7
19
 
8
20
 
@@ -10614,14 +10614,10 @@
10614
10614
  return "missed";
10615
10615
  }
10616
10616
 
10617
- matchStoryboard(storyboards) {
10618
- if (window.STANDALONE_MICRO_APPS && storyboards.length === 1) {
10619
- return storyboards[0];
10620
- } // Put apps with longer homepage before shorter ones.
10617
+ matchStoryboard(storyboards, location) {
10618
+ // Put apps with longer homepage before shorter ones.
10621
10619
  // E.g., `/legacy/tool` will match first before `/legacy`.
10622
10620
  // This enables two apps with relationship of parent-child of homepage.
10623
-
10624
-
10625
10621
  var sortedStoryboards = _.orderBy(storyboards, storyboard => {
10626
10622
  var _storyboard$app$homep, _storyboard$app, _storyboard$app$homep2;
10627
10623
 
@@ -10634,7 +10630,7 @@
10634
10630
  var homepage = (_storyboard$app2 = storyboard.app) === null || _storyboard$app2 === void 0 ? void 0 : _storyboard$app2.homepage;
10635
10631
 
10636
10632
  if (typeof homepage === "string" && homepage[0] === "/") {
10637
- if (brickUtils.matchPath(this.location.pathname, {
10633
+ if (brickUtils.matchPath((location || this.location).pathname, {
10638
10634
  path: homepage,
10639
10635
  exact: homepage === "/"
10640
10636
  })) {
@@ -12023,6 +12019,20 @@
12023
12019
 
12024
12020
  _this.locationContext.messageDispatcher.reset();
12025
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
+
12026
12036
  if (_this.rendering) {
12027
12037
  _this.nextLocation = location;
12028
12038
  } else {
@@ -12092,16 +12102,6 @@
12092
12102
  if (storyboard) {
12093
12103
  var _storyboard$meta, _storyboard$meta2, _storyboard$meta3;
12094
12104
 
12095
- if (!window.STANDALONE_MICRO_APPS) {
12096
- if (storyboard.app.standaloneMode) {
12097
- // if nextApp was standalone micro-apps, use location.replace to reload window;
12098
- var path = history.createHref({
12099
- pathname: storyboard.app.homepage
12100
- });
12101
- window.location.replace(path);
12102
- }
12103
- }
12104
-
12105
12105
  yield _this3.kernel.fulfilStoryboard(storyboard); // 将动态解析后的模板还原,以便重新动态解析。
12106
12106
 
12107
12107
  brickUtils.restoreDynamicTemplates(storyboard); // 预加载权限信息