@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/dist/index.esm.js CHANGED
@@ -10615,14 +10615,10 @@ class LocationContext {
10615
10615
  return "missed";
10616
10616
  }
10617
10617
 
10618
- matchStoryboard(storyboards) {
10619
- if (window.STANDALONE_MICRO_APPS && storyboards.length === 1) {
10620
- return storyboards[0];
10621
- } // Put apps with longer homepage before shorter ones.
10618
+ matchStoryboard(storyboards, location) {
10619
+ // Put apps with longer homepage before shorter ones.
10622
10620
  // E.g., `/legacy/tool` will match first before `/legacy`.
10623
10621
  // This enables two apps with relationship of parent-child of homepage.
10624
-
10625
-
10626
10622
  var sortedStoryboards = orderBy(storyboards, storyboard => {
10627
10623
  var _storyboard$app$homep, _storyboard$app, _storyboard$app$homep2;
10628
10624
 
@@ -10635,7 +10631,7 @@ class LocationContext {
10635
10631
  var homepage = (_storyboard$app2 = storyboard.app) === null || _storyboard$app2 === void 0 ? void 0 : _storyboard$app2.homepage;
10636
10632
 
10637
10633
  if (typeof homepage === "string" && homepage[0] === "/") {
10638
- if (matchPath(this.location.pathname, {
10634
+ if (matchPath((location || this.location).pathname, {
10639
10635
  path: homepage,
10640
10636
  exact: homepage === "/"
10641
10637
  })) {
@@ -12024,6 +12020,20 @@ class Router {
12024
12020
 
12025
12021
  _this.locationContext.messageDispatcher.reset();
12026
12022
 
12023
+ var storyboard = _this.locationContext.matchStoryboard(_this.kernel.bootstrapData.storyboards, location);
12024
+
12025
+ if (!window.STANDALONE_MICRO_APPS) {
12026
+ if (storyboard && storyboard.app.standaloneMode) {
12027
+ // from non-standalone app to standalone app, should jump out off site
12028
+ window.location.assign(window.location.href);
12029
+ }
12030
+ } else {
12031
+ if (!storyboard) {
12032
+ // from standalone app goback to non-standalone app, should reload
12033
+ window.location.reload();
12034
+ }
12035
+ }
12036
+
12027
12037
  if (_this.rendering) {
12028
12038
  _this.nextLocation = location;
12029
12039
  } else {
@@ -12093,16 +12103,6 @@ class Router {
12093
12103
  if (storyboard) {
12094
12104
  var _storyboard$meta, _storyboard$meta2, _storyboard$meta3;
12095
12105
 
12096
- if (!window.STANDALONE_MICRO_APPS) {
12097
- if (storyboard.app.standaloneMode) {
12098
- // if nextApp was standalone micro-apps, use location.replace to reload window;
12099
- var path = history.createHref({
12100
- pathname: storyboard.app.homepage
12101
- });
12102
- window.location.replace(path);
12103
- }
12104
- }
12105
-
12106
12106
  yield _this3.kernel.fulfilStoryboard(storyboard); // 将动态解析后的模板还原,以便重新动态解析。
12107
12107
 
12108
12108
  restoreDynamicTemplates(storyboard); // 预加载权限信息