@next-core/brick-kit 2.117.12 → 2.117.15

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
@@ -583,7 +583,7 @@ var InstanceApi_postSearchV3 = /*#__PURE__*/function () {
583
583
  };
584
584
  }();
585
585
 
586
- function supply(attemptToVisitGlobals, providedGlobalVariables) {
586
+ function supply(attemptToVisitGlobals, providedGlobalVariables, mock) {
587
587
  var globalVariables = _objectSpread({}, providedGlobalVariables); // Allow limited browser builtin values.
588
588
 
589
589
 
@@ -591,7 +591,7 @@ function supply(attemptToVisitGlobals, providedGlobalVariables) {
591
591
 
592
592
  for (var variableName of attemptToVisitGlobals) {
593
593
  if (!Object.prototype.hasOwnProperty.call(globalVariables, variableName)) {
594
- var variable = supplyIndividual(variableName);
594
+ var variable = supplyIndividual(variableName, mock);
595
595
 
596
596
  if (variable !== undefined) {
597
597
  globalVariables[variableName] = variable;
@@ -619,14 +619,14 @@ var shouldOmitInLodash = new Set([// Omit all mutable methods from lodash.
619
619
  var shouldOmitInMoment = new Set(["lang", "langData", "locale", "localeData", "defineLocale", "updateLocale", "updateOffset"]);
620
620
  var allowedGlobalObjects = new Set(["Array", "Boolean", "Date", "Infinity", "JSON", "Math", "NaN", "Number", "String", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "isFinite", "isNaN", "parseFloat", "parseInt", "Map", "Set", "URLSearchParams", "WeakMap", "WeakSet", "atob", "btoa"]);
621
621
 
622
- function supplyIndividual(variableName) {
622
+ function supplyIndividual(variableName, mock) {
623
623
  switch (variableName) {
624
624
  case "Object":
625
625
  // Do not allow mutable methods like `Object.assign`.
626
626
  return delegateMethods(Object, ["entries", "fromEntries", "keys", "values"]);
627
627
 
628
628
  case "_":
629
- return Object.fromEntries(Object.entries(lodash).filter(entry => !shouldOmitInLodash.has(entry[0])));
629
+ return Object.fromEntries(Object.entries(lodash).filter(entry => !shouldOmitInLodash.has(entry[0])).concat(mock ? [["uniqueId", prefix => "".concat(prefix !== null && prefix !== void 0 ? prefix : "", "42")]] : []));
630
630
 
631
631
  case "moment":
632
632
  return Object.assign(function () {
@@ -1688,7 +1688,7 @@ function StoryboardFunctionRegistryFactory() {
1688
1688
  app: currentApp,
1689
1689
  storyboardFunctions,
1690
1690
  isStoryboardFunction: true
1691
- })),
1691
+ }), !!collectCoverage),
1692
1692
  hooks: collector && {
1693
1693
  beforeEvaluate: collector.beforeEvaluate,
1694
1694
  beforeCall: collector.beforeCall,
@@ -8665,6 +8665,9 @@ function getRuntimeMisc() {
8665
8665
  if (!misc) {
8666
8666
  misc = {
8667
8667
  isInIframe: false,
8668
+ isInIframeOfSameSite: false,
8669
+ isInIframeOfNext: false,
8670
+ isInIframeOfVisualBuilder: false,
8668
8671
  isInIframeOfLegacyConsole: false
8669
8672
  };
8670
8673
 
@@ -8672,8 +8675,19 @@ function getRuntimeMisc() {
8672
8675
  misc.isInIframe = true;
8673
8676
 
8674
8677
  try {
8675
- // Handle when previewing in visual builder by iframe.
8676
- 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
+ }
8677
8691
  } catch (e) {// do nothing
8678
8692
  }
8679
8693
  }
@@ -10306,7 +10320,9 @@ class Router {
10306
10320
  }));
10307
10321
  }
10308
10322
 
10309
- if (barsHidden || getRuntimeMisc().isInIframeOfLegacyConsole) {
10323
+ var misc;
10324
+
10325
+ if (barsHidden || (misc = getRuntimeMisc(), misc.isInIframeOfSameSite && !misc.isInIframeOfVisualBuilder)) {
10310
10326
  _this3.kernel.toggleBars(false);
10311
10327
  } else {
10312
10328
  yield constructMenu(menuBar, _this3.locationContext.getCurrentContext(), _this3.kernel);