@next-core/brick-kit 2.117.10 → 2.117.13

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
@@ -2754,7 +2754,6 @@ function constructMenuByMenusList(_x4, _x5, _x6) {
2754
2754
 
2755
2755
  function _constructMenuByMenusList() {
2756
2756
  _constructMenuByMenusList = _asyncToGenerator$4(function* (menus, context, kernel) {
2757
- processMenuCache.clear();
2758
2757
  var data = yield Promise.all(menus.map(menuId => processMenu(menuId, context, kernel)));
2759
2758
  data.forEach((item, index) => processMenuCache.set(menus[index], item));
2760
2759
  });
@@ -8081,7 +8080,7 @@ class Kernel {
8081
8080
  path: previewPath,
8082
8081
  bricks: [_objectSpread({
8083
8082
  brick: templateId
8084
- }, pick(settings, "properties", "events", "lifeCycle"))],
8083
+ }, pick(settings, "properties", "events", "lifeCycle", "context"))],
8085
8084
  menu: false,
8086
8085
  exact: true
8087
8086
  };
@@ -8666,6 +8665,9 @@ function getRuntimeMisc() {
8666
8665
  if (!misc) {
8667
8666
  misc = {
8668
8667
  isInIframe: false,
8668
+ isInIframeOfSameSite: false,
8669
+ isInIframeOfNext: false,
8670
+ isInIframeOfVisualBuilder: false,
8669
8671
  isInIframeOfLegacyConsole: false
8670
8672
  };
8671
8673
 
@@ -8673,8 +8675,19 @@ function getRuntimeMisc() {
8673
8675
  misc.isInIframe = true;
8674
8676
 
8675
8677
  try {
8676
- // Handle when previewing in visual builder by iframe.
8677
- misc.isInIframeOfLegacyConsole = window.origin === window.parent.origin && getBasePath() === "/next/" && !window.parent.location.pathname.startsWith("/next/");
8678
+ // Handle:
8679
+ // - Previewing in visual builder by iframe.
8680
+ // - Nesting next in next.
8681
+ // - Nesting console in next.
8682
+ if (window.origin === window.parent.origin) {
8683
+ misc.isInIframeOfSameSite = true;
8684
+ var selfIsNext = getBasePath() === "/next/";
8685
+ var parentPathname = window.parent.location.pathname;
8686
+ var parentIsNext = parentPathname.startsWith("/next/");
8687
+ misc.isInIframeOfNext = (Number(selfIsNext) ^ Number(parentIsNext)) === 0;
8688
+ misc.isInIframeOfVisualBuilder = parentPathname.startsWith("".concat(parentIsNext ? "/next" : "", "/visual-builder/"));
8689
+ misc.isInIframeOfLegacyConsole = selfIsNext && !parentIsNext;
8690
+ }
8678
8691
  } catch (e) {// do nothing
8679
8692
  }
8680
8693
  }
@@ -10307,7 +10320,9 @@ class Router {
10307
10320
  }));
10308
10321
  }
10309
10322
 
10310
- if (barsHidden || getRuntimeMisc().isInIframeOfLegacyConsole) {
10323
+ var misc;
10324
+
10325
+ if (barsHidden || (misc = getRuntimeMisc(), misc.isInIframeOfSameSite && !misc.isInIframeOfVisualBuilder)) {
10311
10326
  _this3.kernel.toggleBars(false);
10312
10327
  } else {
10313
10328
  yield constructMenu(menuBar, _this3.locationContext.getCurrentContext(), _this3.kernel);