@commercetools-frontend/application-components 24.11.0 → 24.13.0

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.
@@ -18,6 +18,7 @@ var Text = require('@commercetools-uikit/text');
18
18
  var utils = require('@commercetools-uikit/utils');
19
19
  var react = require('@emotion/react');
20
20
  var designSystem = require('@commercetools-uikit/design-system');
21
+ var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
21
22
  var jsxRuntime = require('@emotion/react/jsx-runtime');
22
23
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
23
24
  var _styled = require('@emotion/styled/base');
@@ -36,6 +37,7 @@ var omitBy = require('lodash/omitBy');
36
37
  var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
37
38
  var _setTimeout = require('@babel/runtime-corejs3/core-js-stable/set-timeout');
38
39
  var FlatButton = require('@commercetools-uikit/flat-button');
40
+ var _taggedTemplateLiteral = require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
39
41
  var IconButton = require('@commercetools-uikit/icon-button');
40
42
  var Constraints = require('@commercetools-uikit/constraints');
41
43
  var PageNotFoundSVG = require('@commercetools-frontend/assets/images/page-not-found.svg');
@@ -61,6 +63,7 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
61
63
  var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
62
64
  var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
63
65
  var Text__default = /*#__PURE__*/_interopDefault(Text);
66
+ var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
64
67
  var _styled__default = /*#__PURE__*/_interopDefault(_styled);
65
68
  var Card__default = /*#__PURE__*/_interopDefault(Card);
66
69
  var SecondaryIconButton__default = /*#__PURE__*/_interopDefault(SecondaryIconButton);
@@ -82,18 +85,20 @@ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstancePro
82
85
  var useResizeObserver__default = /*#__PURE__*/_interopDefault(useResizeObserver);
83
86
 
84
87
  // NOTE: This string will be replaced on build time with the package version.
85
- var version = "24.11.0";
88
+ var version = "24.13.0";
89
+
90
+ var _context, _context2, _context3, _context4, _context5;
86
91
 
87
92
  // We keep these tokens as they are related to page layout components which should have
88
93
  // a slightly different layout (margins/paddings) when used within a Custom View panel.
89
94
  // https://github.com/commercetools/merchant-center-application-kit/pull/3353
90
95
  const themesOverrides = {
91
96
  default: {
92
- marginForCustomViewsSelectorAsTabular: `0 ${designSystem.designTokens.spacing55}`,
93
- marginForPageContent: `${designSystem.designTokens.spacing50} ${designSystem.designTokens.spacing55}`,
94
- paddingForDetailPageHeader: `${designSystem.designTokens.spacing50} ${designSystem.designTokens.spacing55} ${designSystem.designTokens.spacing40}`,
95
- paddingForMainPageHeader: `${designSystem.designTokens.spacing50} ${designSystem.designTokens.spacing55} 0`,
96
- paddingForTabularPageHeader: `${designSystem.designTokens.spacing40} ${designSystem.designTokens.spacing55} 0`,
97
+ marginForCustomViewsSelectorAsTabular: "0 ".concat(designSystem.designTokens.spacing55),
98
+ marginForPageContent: _concatInstanceProperty__default["default"](_context = "".concat(designSystem.designTokens.spacing50, " ")).call(_context, designSystem.designTokens.spacing55),
99
+ paddingForDetailPageHeader: _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "".concat(designSystem.designTokens.spacing50, " ")).call(_context3, designSystem.designTokens.spacing55, " ")).call(_context2, designSystem.designTokens.spacing40),
100
+ paddingForMainPageHeader: _concatInstanceProperty__default["default"](_context4 = "".concat(designSystem.designTokens.spacing50, " ")).call(_context4, designSystem.designTokens.spacing55, " 0"),
101
+ paddingForTabularPageHeader: _concatInstanceProperty__default["default"](_context5 = "".concat(designSystem.designTokens.spacing40, " ")).call(_context5, designSystem.designTokens.spacing55, " 0"),
97
102
  backgroundColorForNavbar: designSystem.designTokens.colorPrimary10,
98
103
  backgroundColorForNavbarHeader: designSystem.designTokens.colorPrimary10,
99
104
  fontColorForTabLabelWhenActive: designSystem.designTokens.colorPrimary
@@ -196,11 +201,10 @@ const getModalContentStyles = props => {
196
201
 
197
202
  // To ensure that the mouse click on the overlay surface goes "through"
198
203
  // and triggers the modal to close, we need to turn off the pointer events.
199
- const baseStyles = /*#__PURE__*/react.css("display:grid;height:100%;width:100%;outline:none;position:relative;pointer-events:none;z-index:", typeof props.zIndex === 'number' ?
200
- // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
204
+ const baseStyles = /*#__PURE__*/react.css("display:grid;height:100%;width:100%;outline:none;position:relative;pointer-events:none;z-index:", typeof props.zIndex === 'number' ? // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
201
205
  // We're assigning value 1 unit higher than the overlay to ensure the content is on top.
202
206
  // It's safe to do that since the modal is topmost in the stacking layer.
203
- `${props.zIndex + 1} !important` : 'auto', ";", gridStyle, ";" + ("" ), "" );
207
+ "".concat(props.zIndex + 1, " !important") : 'auto', ";", gridStyle, ";" + ("" ), "" );
204
208
  return baseStyles;
205
209
  };
206
210
  const ClickableDialogContent = /*#__PURE__*/_styled__default["default"](reactDialog.Content, {
@@ -212,7 +216,7 @@ const DialogOverlay = /*#__PURE__*/_styled__default["default"]("div", {
212
216
  let zIndex = _ref.zIndex;
213
217
  return (
214
218
  // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
215
- typeof zIndex === 'number' ? `${zIndex} !important` : 'auto'
219
+ typeof zIndex === 'number' ? "".concat(zIndex, " !important") : 'auto'
216
220
  );
217
221
  }, ";top:0;width:100%;height:100%;background-color:rgba(32, 62, 72, 0.5);opacity:1;" + ("" ));
218
222
  const DialogContent$1 = /*#__PURE__*/_styled__default["default"]("div", {
@@ -223,7 +227,7 @@ const DialogContent$1 = /*#__PURE__*/_styled__default["default"]("div", {
223
227
  } );
224
228
 
225
229
  const _excluded$j = ["size", "getParentSelector"];
226
- const getDefaultParentSelector$1 = () => document.querySelector(`#${constants.PORTALS_CONTAINER_ID}`);
230
+ const getDefaultParentSelector$1 = () => document.querySelector("#".concat(constants.PORTALS_CONTAINER_ID));
227
231
  const GridArea = /*#__PURE__*/_styled__default["default"]("div", {
228
232
  target: "elx55gk0"
229
233
  } )("grid-area:", props => props.name, ";" + ("" ));
@@ -491,7 +495,7 @@ FormDialog.TextTitle = TextTitle;
491
495
 
492
496
  const CustomViewSelector = /*#__PURE__*/react$1.lazy(() => {
493
497
  if (typeof window !== 'undefined' && typeof window.app !== 'undefined') {
494
- return Promise.resolve().then(function () { return require('./custom-views-selector-7c2c7fe4.cjs.prod.js' /* webpackChunkName: "custom-views-selector" */); });
498
+ return Promise.resolve().then(function () { return require('./custom-views-selector-47a0dbe6.cjs.prod.js' /* webpackChunkName: "custom-views-selector" */); });
495
499
  }
496
500
  return _Promise__default["default"].resolve({
497
501
  default: () => null
@@ -585,7 +589,7 @@ const PageHeader = props => {
585
589
  truncate: true
586
590
  }), props.children]
587
591
  }), jsxRuntime.jsx(CustomViewSelector, {
588
- margin: `${designSystem.designTokens.spacing40} 0 0 0`,
592
+ margin: "".concat(designSystem.designTokens.spacing40, " 0 0 0"),
589
593
  customViewLocatorCode: props.customViewLocatorCode
590
594
  })]
591
595
  });
@@ -679,6 +683,7 @@ const ModalPageTopBar = _ref3 => {
679
683
  };
680
684
  ModalPageTopBar.displayName = 'ModalPageTopBar';
681
685
 
686
+ var _templateObject;
682
687
  const stylesBySize = {
683
688
  '10': {
684
689
  width: '600px',
@@ -697,14 +702,7 @@ const stylesBySize = {
697
702
  transitionTime: 300
698
703
  }
699
704
  };
700
- const overlayShow = react.keyframes`
701
- 0% {
702
- opacity: 0;
703
- }
704
- 100% {
705
- opacity: 1;
706
- }
707
- `;
705
+ const overlayShow = react.keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n"])));
708
706
 
709
707
  // we can't use Overlay from Radix-ui because it doesn't appear in DOM when Dialog.Root is rendered with `modal={false}`
710
708
  const ModalOverlay = /*#__PURE__*/_styled__default["default"]("div", {
@@ -713,7 +711,7 @@ const ModalOverlay = /*#__PURE__*/_styled__default["default"]("div", {
713
711
  let zIndex = _ref.zIndex;
714
712
  return (
715
713
  // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
716
- typeof zIndex === 'number' ? `${zIndex} !important` : 'inherit'
714
+ typeof zIndex === 'number' ? "".concat(zIndex, " !important") : 'inherit'
717
715
  );
718
716
  }, ";opacity:0;", _ref2 => {
719
717
  let size = _ref2.size;
@@ -723,32 +721,32 @@ const ModalOverlay = /*#__PURE__*/_styled__default["default"]("div", {
723
721
  const getContentShowAnimation = size => react.keyframes({
724
722
  '0%': {
725
723
  opacity: 0,
726
- transform: `translate3d(${size !== 'scale' ? stylesBySize[size].width : '30px'}, 0, 0)`
724
+ transform: "translate3d(".concat(size !== 'scale' ? stylesBySize[size].width : '30px', ", 0, 0)")
727
725
  },
728
726
  '100%': {
729
727
  opacity: 1,
730
- transform: `translate3d(0, 0, 0)`
728
+ transform: "translate3d(0, 0, 0)"
731
729
  }
732
730
  });
733
731
  const getContentHideAnimation = size => react.keyframes({
734
732
  '0%': {
735
733
  opacity: 1,
736
- transform: `translate3d(0, 0, 0)`
734
+ transform: "translate3d(0, 0, 0)"
737
735
  },
738
736
  '100%': {
739
737
  opacity: 0,
740
- transform: `translate3d(${size !== 'scale' ? stylesBySize[size].width : '30px'}, 0, 0)`
738
+ transform: "translate3d(".concat(size !== 'scale' ? stylesBySize[size].width : '30px', ", 0, 0)")
741
739
  }
742
740
  });
743
741
  const ModalContent = /*#__PURE__*/_styled__default["default"](reactDialog.Content, {
744
742
  shouldForwardProp: prop => prop !== 'size',
745
743
  target: "e1jbmsa0"
746
744
  } )("position:absolute;top:0;right:0;height:100%;width:", _ref3 => {
745
+ var _context;
747
746
  let size = _ref3.size;
748
- return size !== 'scale' ?
749
- // In case we're using a specific size, we want it to be used until there's no space left.
747
+ return size !== 'scale' ? // In case we're using a specific size, we want it to be used until there's no space left.
750
748
  // In such scenario, we want the modal to be as wide as possible, but using the shared indentation width size.
751
- `min(${stylesBySize[size].width}, calc(100% - ${constants.PORTALS_CONTAINER_INDENTATION_SIZE})) !important` : stylesBySize.scale.width;
749
+ _concatInstanceProperty__default["default"](_context = "min(".concat(stylesBySize[size].width, ", calc(100% - ")).call(_context, constants.PORTALS_CONTAINER_INDENTATION_SIZE, ")) !important") : stylesBySize.scale.width;
752
750
  }, ";display:flex;flex-direction:column;background-color:", designSystem.designTokens.colorSurface, ";box-shadow:0px 0px 40px 0px rgba(0, 0, 0, 0.1);outline:0;z-index:inherit;&[data-state='open']{animation:", _ref4 => {
753
751
  let size = _ref4.size;
754
752
  return getContentShowAnimation(size);
@@ -779,7 +777,7 @@ const HiddenEmptyDialogTitle = () => jsxRuntime.jsx("div", {
779
777
  // instead of a specific element that will be cleaned up, resulting in
780
778
  // console errors (even though the test passes). We only need to to this in
781
779
  // test environment.
782
- const getDefaultParentSelector = () => document.querySelector(`#${constants.PORTALS_CONTAINER_ID}`);
780
+ const getDefaultParentSelector = () => document.querySelector("#".concat(constants.PORTALS_CONTAINER_ID));
783
781
 
784
782
  // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
785
783
  // However, we need to explicitly define this otherwise the prop-types babel plugin
@@ -852,7 +850,7 @@ const ModalPage = _ref => {
852
850
  onInteractOutside: e => {
853
851
  // Prevent only the modal from closing, handle all other events
854
852
  const overlay = document.querySelector('[data-role="modal-overlay-clickable"]');
855
- if (!overlay?.contains(e.target)) {
853
+ if (!(overlay !== null && overlay !== void 0 && overlay.contains(e.target))) {
856
854
  e.preventDefault();
857
855
  }
858
856
  },
@@ -1086,7 +1084,7 @@ const TabularModalPage = _ref => {
1086
1084
  })
1087
1085
  }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1088
1086
  children: jsxRuntime.jsx(CustomViewSelector, {
1089
- margin: `${designSystem.designTokens.spacing30} 0 0 0`,
1087
+ margin: "".concat(designSystem.designTokens.spacing30, " 0 0 0"),
1090
1088
  customViewLocatorCodes: props.customViewLocatorCodes
1091
1089
  })
1092
1090
  }), jsxRuntime.jsx(ModalContentWrapper, {
@@ -1133,13 +1131,17 @@ const DetailPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1133
1131
  const HeaderControlsWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1134
1132
  target: "etkdonc0"
1135
1133
  } )("margin-top:", designSystem.designTokens.spacingS, ";" + ("" ));
1136
- const getCustomViewsSelectorMargin = hasContentBelow => `${designSystem.designTokens.spacing40} 0 ${hasContentBelow ? designSystem.designTokens.spacing40 : '0'} 0`;
1134
+ const getCustomViewsSelectorMargin = hasContentBelow => {
1135
+ var _context;
1136
+ return _concatInstanceProperty__default["default"](_context = "".concat(designSystem.designTokens.spacing40, " 0 ")).call(_context, hasContentBelow ? designSystem.designTokens.spacing40 : '0', " 0");
1137
+ };
1137
1138
 
1138
1139
  // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
1139
1140
  // However, we need to explicitly define this otherwise the prop-types babel plugin
1140
1141
  // does not recognize the object shape.
1141
1142
 
1142
1143
  const CustomFormDetailPage = _ref => {
1144
+ var _props$title;
1143
1145
  let _ref$hideControls = _ref.hideControls,
1144
1146
  hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1145
1147
  props = _objectWithoutProperties(_ref, _excluded$8);
@@ -1150,7 +1152,7 @@ const CustomFormDetailPage = _ref => {
1150
1152
  previousPathLabel: props.previousPathLabel,
1151
1153
  onClick: props.onPreviousPathClick
1152
1154
  }), props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1153
- title: props.title ?? '',
1155
+ title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
1154
1156
  subtitle: props.subtitle,
1155
1157
  titleSize: "big"
1156
1158
  }), jsxRuntime.jsx(CustomViewSelector, {
@@ -1236,6 +1238,7 @@ InfoDetailPage.PageHeaderTitle = PageHeaderTitle;
1236
1238
 
1237
1239
  const _excluded$6 = ["hideControls"];
1238
1240
  const TabularDetailPage = _ref => {
1241
+ var _props$title;
1239
1242
  let _ref$hideControls = _ref.hideControls,
1240
1243
  hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1241
1244
  props = _objectWithoutProperties(_ref, _excluded$6);
@@ -1246,7 +1249,7 @@ const TabularDetailPage = _ref => {
1246
1249
  previousPathLabel: props.previousPathLabel,
1247
1250
  onClick: props.onPreviousPathClick
1248
1251
  }), props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1249
- title: props.title ?? '',
1252
+ title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
1250
1253
  subtitle: props.subtitle,
1251
1254
  titleSize: "big"
1252
1255
  }), jsxRuntime.jsx(ControlsContainter, {
@@ -1260,7 +1263,7 @@ const TabularDetailPage = _ref => {
1260
1263
  })]
1261
1264
  }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1262
1265
  children: jsxRuntime.jsx(CustomViewSelector, {
1263
- margin: `${designSystem.designTokens.spacing30} 0 0 0`,
1266
+ margin: "".concat(designSystem.designTokens.spacing30, " 0 0 0"),
1264
1267
  customViewLocatorCodes: props.customViewLocatorCodes
1265
1268
  })
1266
1269
  }), jsxRuntime.jsx(ContentWrapper$2, {
@@ -1280,7 +1283,7 @@ TabularDetailPage.PageHeaderTitle = PageHeaderTitle;
1280
1283
  // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1281
1284
  TabularDetailPage.Intl = i18n.sharedMessages;
1282
1285
 
1283
- const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-b182d2dd.cjs.prod.js' /* webpackChunkName: "public-page-layout" */); }));
1286
+ const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-a0d532d4.cjs.prod.js' /* webpackChunkName: "public-page-layout" */); }));
1284
1287
 
1285
1288
  const MainPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1286
1289
  target: "ev8m2jf2"
@@ -1295,8 +1298,9 @@ const MainPageContent = /*#__PURE__*/_styled__default["default"]("div", {
1295
1298
  } )("flex:1;flex-basis:0;overflow:auto;margin:", designTokens.marginForPageContent, ";" + ("" ));
1296
1299
 
1297
1300
  const _excluded$5 = ["hideControls", "hideDivider"];
1298
- const headerRowMargin = `${designSystem.designTokens.spacing40} 0 0 0`;
1301
+ const headerRowMargin = "".concat(designSystem.designTokens.spacing40, " 0 0 0");
1299
1302
  const CustomFormMainPage = _ref => {
1303
+ var _props$title;
1300
1304
  let _ref$hideControls = _ref.hideControls,
1301
1305
  hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1302
1306
  _ref$hideDivider = _ref.hideDivider,
@@ -1305,7 +1309,7 @@ const CustomFormMainPage = _ref => {
1305
1309
  return jsxRuntime.jsxs(PageWrapper, {
1306
1310
  children: [jsxRuntime.jsxs(MainPageContainer, {
1307
1311
  children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1308
- title: props.title ?? '',
1312
+ title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
1309
1313
  subtitle: props.subtitle,
1310
1314
  titleSize: "big"
1311
1315
  }), jsxRuntime.jsx(CustomViewSelector, {
@@ -1397,13 +1401,14 @@ InfoMainPage.PageHeaderTitle = PageHeaderTitle;
1397
1401
 
1398
1402
  const _excluded$3 = ["hideControls"];
1399
1403
  const TabularMainPage = _ref => {
1404
+ var _props$title;
1400
1405
  let _ref$hideControls = _ref.hideControls,
1401
1406
  hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1402
1407
  props = _objectWithoutProperties(_ref, _excluded$3);
1403
1408
  return jsxRuntime.jsxs(PageWrapper, {
1404
1409
  children: [jsxRuntime.jsxs(TabularPageContainer, {
1405
1410
  children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1406
- title: props.title ?? '',
1411
+ title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
1407
1412
  subtitle: props.subtitle,
1408
1413
  titleSize: "big"
1409
1414
  }), jsxRuntime.jsx(ControlsContainter, {
@@ -1417,7 +1422,7 @@ const TabularMainPage = _ref => {
1417
1422
  })]
1418
1423
  }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1419
1424
  children: jsxRuntime.jsx(CustomViewSelector, {
1420
- margin: `${designSystem.designTokens.spacing30} 0 0 0`,
1425
+ margin: "".concat(designSystem.designTokens.spacing30, " 0 0 0"),
1421
1426
  customViewLocatorCodes: props.customViewLocatorCodes
1422
1427
  })
1423
1428
  }), jsxRuntime.jsx(ContentWrapper$2, {
@@ -1750,8 +1755,9 @@ const messages$1 = reactIntl.defineMessages({
1750
1755
 
1751
1756
  const isIframeReady = iFrameElementRef => {
1752
1757
  try {
1753
- return iFrameElementRef?.contentWindow?.document.readyState === 'complete';
1754
- } catch {
1758
+ var _iFrameElementRef$con;
1759
+ return (iFrameElementRef === null || iFrameElementRef === void 0 || (_iFrameElementRef$con = iFrameElementRef.contentWindow) === null || _iFrameElementRef$con === void 0 ? void 0 : _iFrameElementRef$con.document.readyState) === 'complete';
1760
+ } catch (_unused) {
1755
1761
  // Trying to access the contentWindow of a cross-origin iFrame will throw an error.
1756
1762
  // We are not supposed to even get here because the iFrame must use
1757
1763
  // a URL from our very same domain (the custom view is proxied through our http-proxy service).
@@ -1771,15 +1777,20 @@ const CustomPanelIframe = /*#__PURE__*/_styled__default["default"]("iframe", {
1771
1777
  styles: "height:100%;width:100%;border:none"
1772
1778
  } );
1773
1779
  function CustomViewLoader(props) {
1780
+ var _props$customView$typ;
1774
1781
  const iFrameElementRef = react$1.useRef(null);
1775
1782
  const dataLocale = applicationShellConnectors.useApplicationContext(context => context.dataLocale);
1776
- const projectKey = applicationShellConnectors.useApplicationContext(context => context.project?.key);
1783
+ const projectKey = applicationShellConnectors.useApplicationContext(context => {
1784
+ var _context$project;
1785
+ return (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key;
1786
+ });
1777
1787
  const featureFlags = reactBroadcast.useAllFeatureToggles();
1778
1788
  const iFrameCommunicationChannel = react$1.useRef(new MessageChannel());
1779
1789
  const showNotification = actionsGlobal.useShowNotification();
1780
1790
  const intl = reactIntl.useIntl();
1781
1791
  const hasSentInitializationMessages = react$1.useRef(false);
1782
1792
  const sendInitializationMessages = react$1.useCallback(() => {
1793
+ var _iFrameElementRef$cur, _context;
1783
1794
  // If we have already sent the initialization messages, do not send them again.
1784
1795
  // The message can be sent either as a response to the CUSTOM_VIEW_READY message
1785
1796
  // or as a result of a setTimeout after 500ms. In any case, this message should be sent only once.
@@ -1788,12 +1799,12 @@ function CustomViewLoader(props) {
1788
1799
  }
1789
1800
 
1790
1801
  // Transfer port2 to the iFrame so it can send messages back privately
1791
- iFrameElementRef.current?.contentWindow?.postMessage(constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_BOOTSTRAP, window.location.href, [iFrameCommunicationChannel.current.port2]);
1802
+ (_iFrameElementRef$cur = iFrameElementRef.current) === null || _iFrameElementRef$cur === void 0 || (_iFrameElementRef$cur = _iFrameElementRef$cur.contentWindow) === null || _iFrameElementRef$cur === void 0 || _iFrameElementRef$cur.postMessage(constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_BOOTSTRAP, window.location.href, [iFrameCommunicationChannel.current.port2]);
1792
1803
 
1793
1804
  // Send the initialization message to the iFrame
1794
1805
  iFrameCommunicationChannel.current.port1.postMessage({
1795
1806
  source: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
1796
- destination: `${constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX}${props.customView.id}`,
1807
+ destination: _concatInstanceProperty__default["default"](_context = "".concat(constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX)).call(_context, props.customView.id),
1797
1808
  eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION,
1798
1809
  eventData: {
1799
1810
  context: {
@@ -1863,31 +1874,31 @@ function CustomViewLoader(props) {
1863
1874
  window.addEventListener('message', messageFromIFrameHandler);
1864
1875
  return () => {
1865
1876
  window.removeEventListener('message', messageFromIFrameHandler);
1866
- communicationChannel?.port1.close();
1877
+ communicationChannel === null || communicationChannel === void 0 || communicationChannel.port1.close();
1867
1878
  };
1868
1879
  }, []);
1869
1880
 
1870
1881
  // Currently we only support custom panels
1871
1882
  if (props.customView.type !== 'CustomPanel') {
1872
- sentry.reportErrorToSentry(new Error(`CustomViewLoader: Provided Custom View has an unsupported type: ${props.customView.type}. Supported types: ['CustomPanel'].`));
1883
+ sentry.reportErrorToSentry(new Error("CustomViewLoader: Provided Custom View has an unsupported type: ".concat(props.customView.type, ". Supported types: ['CustomPanel'].")));
1873
1884
  return null;
1874
1885
  }
1875
- const panelSize = props.customView.typeSettings?.size?.toLocaleLowerCase() || 'large';
1886
+ const panelSize = ((_props$customView$typ = props.customView.typeSettings) === null || _props$customView$typ === void 0 || (_props$customView$typ = _props$customView$typ.size) === null || _props$customView$typ === void 0 ? void 0 : _props$customView$typ.toLocaleLowerCase()) || 'large';
1876
1887
  const iFrameUrl = [window.location.origin, 'custom-views', props.customView.id, 'projects', projectKey].join('/');
1877
1888
  return jsxRuntime.jsx(ModalPage, {
1878
1889
  isOpen: true,
1879
1890
  onClose: props.onClose,
1880
1891
  size: panelSize === 'small' ? 10 : 30,
1881
- title: `Custom View: ${props.customView.defaultLabel}`,
1892
+ title: "Custom View: ".concat(props.customView.defaultLabel),
1882
1893
  hideTopBar: true,
1883
1894
  children: jsxRuntime.jsx(ContentWrapper, {
1884
1895
  children: jsxRuntime.jsx(CustomPanelIframe, {
1885
- id: `custom-view-${props.customView.id}`,
1886
- title: `Custom View: ${props.customView.defaultLabel}`,
1896
+ id: "custom-view-".concat(props.customView.id),
1897
+ title: "Custom View: ".concat(props.customView.defaultLabel),
1887
1898
  ref: iFrameElementRef,
1888
1899
  src: iFrameUrl,
1889
1900
  onLoad: onLoadSuccessHandler
1890
- }, `custom-view-${props.customView.id}`)
1901
+ }, "custom-view-".concat(props.customView.id))
1891
1902
  })
1892
1903
  });
1893
1904
  }
@@ -1988,20 +1999,21 @@ var _ref = {
1988
1999
  styles: "display:flex;height:1px;margin-top:-1px"
1989
2000
  } ;
1990
2001
  const PortalsContainer = /*#__PURE__*/react$1.forwardRef((props, ref) => {
2002
+ var _props$offsetTop, _props$offsetLeft, _props$offsetLeftOnEx, _props$containerSelec, _props$zIndex, _props$baseModalZInde, _current, _current2;
1991
2003
  // Initialize props with default values.
1992
2004
  // NOTE: using `defaultProps` with `forwardRef` results in the type declarations
1993
2005
  // to ignore the `defaultProps`. Therefore, the default props are typed
1994
2006
  // as optional and we initialize the value here with the default values.
1995
- const offsetTop = props.offsetTop ?? '0px';
1996
- const offsetLeft = props.offsetLeft ?? '0px';
1997
- const offsetLeftOnExpandedMenu = props.offsetLeftOnExpandedMenu ?? '0px';
1998
- const containerSelectorToPreventScrollingOnOpen = props.containerSelectorToPreventScrollingOnOpen ?? 'main';
1999
- const zIndex = props.zIndex ?? 10000;
2000
- const baseModalZIndex = props.baseModalZIndex ?? 1000;
2007
+ const offsetTop = (_props$offsetTop = props.offsetTop) !== null && _props$offsetTop !== void 0 ? _props$offsetTop : '0px';
2008
+ const offsetLeft = (_props$offsetLeft = props.offsetLeft) !== null && _props$offsetLeft !== void 0 ? _props$offsetLeft : '0px';
2009
+ const offsetLeftOnExpandedMenu = (_props$offsetLeftOnEx = props.offsetLeftOnExpandedMenu) !== null && _props$offsetLeftOnEx !== void 0 ? _props$offsetLeftOnEx : '0px';
2010
+ const containerSelectorToPreventScrollingOnOpen = (_props$containerSelec = props.containerSelectorToPreventScrollingOnOpen) !== null && _props$containerSelec !== void 0 ? _props$containerSelec : 'main';
2011
+ const zIndex = (_props$zIndex = props.zIndex) !== null && _props$zIndex !== void 0 ? _props$zIndex : 10000;
2012
+ const baseModalZIndex = (_props$baseModalZInde = props.baseModalZIndex) !== null && _props$baseModalZInde !== void 0 ? _props$baseModalZInde : 1000;
2001
2013
  const modalWidthTransition = 'width 150ms cubic-bezier(1, 0, 0.58, 1)';
2002
2014
  const portalsContainerRef = react$1.useRef(null);
2003
- const globalNotificationsElementDimensions = useObserverElementDimensions(ref?.current?.notificationsGlobalRef);
2004
- const pageNotificationsElementDimensions = useObserverElementDimensions(ref?.current?.notificationsPageRef);
2015
+ const globalNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0 || (_current = ref.current) === null || _current === void 0 ? void 0 : _current.notificationsGlobalRef);
2016
+ const pageNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0 || (_current2 = ref.current) === null || _current2 === void 0 ? void 0 : _current2.notificationsPageRef);
2005
2017
  const _useState3 = react$1.useState([]),
2006
2018
  _useState4 = _slicedToArray(_useState3, 2),
2007
2019
  stackingLayers = _useState4[0],