@next-core/brick-kit 2.145.3 → 2.146.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/dist/index.esm.js CHANGED
@@ -2181,26 +2181,6 @@ function _resolveNormalStoryboardContext() {
2181
2181
  // Or if the resolve is ignored or lazy, use its `value` as a fallback.
2182
2182
  value = computeRealValue(contextConf.value, mergedContext, true);
2183
2183
  }
2184
-
2185
- if (contextConf.track) {
2186
- // Track its dependencies and auto update when each of them changed.
2187
- var deps = (isTemplateState ? trackUsedState : trackUsedContext)(load ? contextConf.resolve : contextConf.value);
2188
-
2189
- for (var dep of deps) {
2190
- var _eventTarget;
2191
-
2192
- var ctx = storyboardContextWrapper.get().get(dep);
2193
- ctx === null || ctx === void 0 ? void 0 : (_eventTarget = ctx.eventTarget) === null || _eventTarget === void 0 ? void 0 : _eventTarget.addEventListener(isTemplateState ? "state.change" : "context.change", () => {
2194
- if (load) {
2195
- storyboardContextWrapper.updateValue(contextConf.name, {
2196
- cache: "default"
2197
- }, "refresh");
2198
- } else {
2199
- storyboardContextWrapper.updateValue(contextConf.name, computeRealValue(contextConf.value, mergedContext, true), "replace");
2200
- }
2201
- });
2202
- }
2203
- }
2204
2184
  }
2205
2185
 
2206
2186
  resolveFreeVariableValue(value, contextConf, mergedContext, storyboardContextWrapper, brick, load, !isLazyResolve);
@@ -2250,6 +2230,27 @@ function resolveFreeVariableValue(value, contextConf, mergedContext, storyboardC
2250
2230
  }
2251
2231
  }
2252
2232
 
2233
+ if (contextConf.track) {
2234
+ var isTemplateState = !!storyboardContextWrapper.tplContextId; // Track its dependencies and auto update when each of them changed.
2235
+
2236
+ var deps = (isTemplateState ? trackUsedState : trackUsedContext)(load ? contextConf.resolve : contextConf.value);
2237
+
2238
+ for (var dep of deps) {
2239
+ var _eventTarget;
2240
+
2241
+ var ctx = storyboardContextWrapper.get().get(dep);
2242
+ ctx === null || ctx === void 0 ? void 0 : (_eventTarget = ctx.eventTarget) === null || _eventTarget === void 0 ? void 0 : _eventTarget.addEventListener(isTemplateState ? "state.change" : "context.change", () => {
2243
+ if (load) {
2244
+ storyboardContextWrapper.updateValue(contextConf.name, {
2245
+ cache: "default"
2246
+ }, "refresh");
2247
+ } else {
2248
+ storyboardContextWrapper.updateValue(contextConf.name, computeRealValue(contextConf.value, mergedContext, true), "replace");
2249
+ }
2250
+ });
2251
+ }
2252
+ }
2253
+
2253
2254
  storyboardContextWrapper.set(contextConf.name, newContext);
2254
2255
  }
2255
2256
 
@@ -12020,16 +12021,16 @@ class Router {
12020
12021
 
12021
12022
  _this.locationContext.messageDispatcher.reset();
12022
12023
 
12023
- var storyboard = _this.locationContext.matchStoryboard(_this.kernel.bootstrapData.storyboards, location);
12024
+ var storyboard = _this.locationContext.matchStoryboard(_this.kernel.bootstrapData.storyboards, location); // Whether non-standalone app to standalone app, or standlone app to non-standalone app
12025
+ // window should reload to refresh the resource
12026
+
12024
12027
 
12025
12028
  if (!window.STANDALONE_MICRO_APPS) {
12026
12029
  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);
12030
+ window.location.reload();
12029
12031
  }
12030
12032
  } else {
12031
12033
  if (!storyboard) {
12032
- // from standalone app goback to non-standalone app, should reload
12033
12034
  window.location.reload();
12034
12035
  }
12035
12036
  }