@next-core/brick-kit 2.156.7 → 2.156.9

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
@@ -3938,9 +3938,9 @@ class Runtime {
3938
3938
  }
3939
3939
 
3940
3940
  getMiscSettings() {
3941
- var _kernel$bootstrapData5;
3941
+ var _kernel$bootstrapData5, _kernel$nextApp, _kernel$nextApp$confi, _kernel$nextApp$confi2;
3942
3942
 
3943
- return Object.assign({}, (_kernel$bootstrapData5 = kernel.bootstrapData.settings) === null || _kernel$bootstrapData5 === void 0 ? void 0 : _kernel$bootstrapData5.misc);
3943
+ return Object.assign({}, (_kernel$bootstrapData5 = kernel.bootstrapData.settings) === null || _kernel$bootstrapData5 === void 0 ? void 0 : _kernel$bootstrapData5.misc, (_kernel$nextApp = kernel.nextApp) === null || _kernel$nextApp === void 0 ? void 0 : (_kernel$nextApp$confi = _kernel$nextApp.config) === null || _kernel$nextApp$confi === void 0 ? void 0 : (_kernel$nextApp$confi2 = _kernel$nextApp$confi.settings) === null || _kernel$nextApp$confi2 === void 0 ? void 0 : _kernel$nextApp$confi2.misc);
3944
3944
  }
3945
3945
 
3946
3946
  /* istanbul ignore next */
@@ -9927,9 +9927,9 @@ class Kernel {
9927
9927
  }
9928
9928
 
9929
9929
  getFeatureFlags() {
9930
- var _this$bootstrapData, _this$bootstrapData$s;
9930
+ var _this$bootstrapData, _this$bootstrapData$s, _this$nextApp, _this$nextApp$config, _this$nextApp$config$;
9931
9931
 
9932
- return Object.assign({}, (_this$bootstrapData = this.bootstrapData) === null || _this$bootstrapData === void 0 ? void 0 : (_this$bootstrapData$s = _this$bootstrapData.settings) === null || _this$bootstrapData$s === void 0 ? void 0 : _this$bootstrapData$s.featureFlags);
9932
+ return Object.assign({}, (_this$bootstrapData = this.bootstrapData) === null || _this$bootstrapData === void 0 ? void 0 : (_this$bootstrapData$s = _this$bootstrapData.settings) === null || _this$bootstrapData$s === void 0 ? void 0 : _this$bootstrapData$s.featureFlags, (_this$nextApp = this.nextApp) === null || _this$nextApp === void 0 ? void 0 : (_this$nextApp$config = _this$nextApp.config) === null || _this$nextApp$config === void 0 ? void 0 : (_this$nextApp$config$ = _this$nextApp$config.settings) === null || _this$nextApp$config$ === void 0 ? void 0 : _this$nextApp$config$.featureFlags);
9933
9933
  }
9934
9934
 
9935
9935
  getStandaloneMenus(menuId, isPreFetch) {
@@ -12150,14 +12150,11 @@ class Router {
12150
12150
 
12151
12151
  _defineProperty$1(this, "renderId", void 0);
12152
12152
 
12153
- _defineProperty$1(this, "featureFlags", void 0);
12154
-
12155
12153
  _defineProperty$1(this, "navConfig", void 0);
12156
12154
 
12157
12155
  _defineProperty$1(this, "mediaEventTargetHandler", void 0);
12158
12156
 
12159
12157
  this.kernel = kernel;
12160
- this.featureFlags = this.kernel.getFeatureFlags();
12161
12158
  var history = getHistory();
12162
12159
  window.addEventListener("beforeunload", event => {
12163
12160
  var message = this.getBlockMessageBeforePageLave({}); // See examples in https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload
@@ -12196,7 +12193,7 @@ class Router {
12196
12193
  }
12197
12194
 
12198
12195
  locationChangeNotify(from, to) {
12199
- if (this.featureFlags["log-location-change"]) {
12196
+ if (this.kernel.getFeatureFlags()["log-location-change"]) {
12200
12197
  var _window$CORE_ROOT;
12201
12198
 
12202
12199
  var username = getAuth().username;
@@ -12339,9 +12336,10 @@ class Router {
12339
12336
  var _storyboard$meta, _storyboard$meta2, _storyboard$meta3;
12340
12337
 
12341
12338
  yield _this3.kernel.fulfilStoryboard(storyboard);
12339
+ _this3.kernel.nextApp = storyboard.app;
12342
12340
  removeDeadConditions(storyboard, {
12343
12341
  constantFeatureFlags: true,
12344
- featureFlags: _this3.featureFlags
12342
+ featureFlags: _this3.kernel.getFeatureFlags()
12345
12343
  }); // 将动态解析后的模板还原,以便重新动态解析。
12346
12344
 
12347
12345
  restoreDynamicTemplates(storyboard);
@@ -12382,7 +12380,6 @@ class Router {
12382
12380
 
12383
12381
  var appChanged = previousApp && currentApp ? previousApp.id !== currentApp.id : previousApp !== currentApp;
12384
12382
  var legacy = currentApp ? currentApp.legacy : undefined;
12385
- _this3.kernel.nextApp = currentApp;
12386
12383
  var layoutType = (currentApp === null || currentApp === void 0 ? void 0 : currentApp.layoutType) || "console";
12387
12384
  var faviconElement = document.querySelector("link[rel='shortcut icon']");
12388
12385
  var customFaviconHref = currentApp === null || currentApp === void 0 ? void 0 : (_currentApp$config = currentApp.config) === null || _currentApp$config === void 0 ? void 0 : (_currentApp$config$_e = _currentApp$config._easyops_app_favicon) === null || _currentApp$config$_e === void 0 ? void 0 : _currentApp$config$_e.default;
@@ -12401,7 +12398,7 @@ class Router {
12401
12398
  unmountTree(mountPoints.bg);
12402
12399
 
12403
12400
  var redirectToLogin = () => {
12404
- history.replace(_this3.featureFlags["sso-enabled"] ? "/sso-auth/login" : "/auth/login", {
12401
+ history.replace(_this3.kernel.getFeatureFlags()["sso-enabled"] ? "/sso-auth/login" : "/auth/login", {
12405
12402
  from: location
12406
12403
  });
12407
12404
  };
@@ -12422,7 +12419,7 @@ class Router {
12422
12419
  }
12423
12420
  }
12424
12421
 
12425
- layoutType = bricks.some(brick => ["base-layout.tpl-base-page-module", "base-layout.tpl-homepage-base-module", "base-layout.tpl-homepage-base-module-cmdb", "base-layout.tpl-base-page-module-cmdb"].includes(brick)) && layoutType === "business" && !_this3.featureFlags["support-ui-8.0-base-layout"] ? "console" : layoutType;
12422
+ layoutType = bricks.some(brick => ["base-layout.tpl-base-page-module", "base-layout.tpl-homepage-base-module", "base-layout.tpl-homepage-base-module-cmdb", "base-layout.tpl-base-page-module-cmdb"].includes(brick)) && layoutType === "business" && !_this3.kernel.getFeatureFlags()["support-ui-8.0-base-layout"] ? "console" : layoutType;
12426
12423
  var mountRoutesResult = {
12427
12424
  main: [],
12428
12425
  menuInBg: [],
@@ -12664,7 +12661,7 @@ class Router {
12664
12661
  _this3.state = "mounted";
12665
12662
  devtoolsHookEmit("rendered");
12666
12663
 
12667
- if (!_this3.featureFlags["disable-prefetch-scripts"]) {
12664
+ if (_this3.kernel.getFeatureFlags()["prefetch-scripts"]) {
12668
12665
  // Try to prefetch during a browser's idle periods.
12669
12666
  // https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
12670
12667
  if (typeof window.requestIdleCallback === "function") {