@commercetools-frontend/application-components 22.37.0 → 22.38.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.
Files changed (36) hide show
  1. package/dist/commercetools-frontend-application-components.cjs.dev.js +771 -935
  2. package/dist/commercetools-frontend-application-components.cjs.prod.js +663 -789
  3. package/dist/commercetools-frontend-application-components.esm.js +771 -933
  4. package/dist/custom-views-selector-490b4a72.esm.js +256 -0
  5. package/dist/custom-views-selector-dacff7f7.cjs.dev.js +278 -0
  6. package/dist/custom-views-selector-efdd6e55.cjs.prod.js +247 -0
  7. package/dist/declarations/src/components/custom-views/custom-views-selector/custom-views-selector.d.ts +1 -8
  8. package/dist/declarations/src/components/custom-views/custom-views-selector/index.d.ts +3 -1
  9. package/dist/declarations/src/components/custom-views/custom-views-selector/types.d.ts +12 -0
  10. package/dist/declarations/src/components/detail-pages/custom-form-detail-page/custom-form-detail-page.d.ts +22 -73
  11. package/dist/declarations/src/components/detail-pages/form-detail-page/form-detail-page.d.ts +5 -13
  12. package/dist/declarations/src/components/detail-pages/info-detail-page/info-detail-page.d.ts +3 -10
  13. package/dist/declarations/src/components/detail-pages/tabular-detail-page/tabular-detail-page.d.ts +28 -74
  14. package/dist/declarations/src/components/dialogs/confirmation-dialog/confirmation-dialog.d.ts +3 -4
  15. package/dist/declarations/src/components/dialogs/form-dialog/form-dialog.d.ts +3 -4
  16. package/dist/declarations/src/components/dialogs/internals/dialog-container.d.ts +3 -4
  17. package/dist/declarations/src/components/dialogs/internals/dialog-footer.d.ts +4 -5
  18. package/dist/declarations/src/components/drawer/drawer.d.ts +16 -45
  19. package/dist/declarations/src/components/internals/default-form-buttons.d.ts +6 -9
  20. package/dist/declarations/src/components/internals/page-header-title.d.ts +3 -4
  21. package/dist/declarations/src/components/internals/page-top-bar.d.ts +3 -4
  22. package/dist/declarations/src/components/main-pages/custom-form-main-page/custom-form-main-page.d.ts +22 -71
  23. package/dist/declarations/src/components/main-pages/form-main-page/form-main-page.d.ts +4 -12
  24. package/dist/declarations/src/components/main-pages/info-main-page/info-main-page.d.ts +3 -10
  25. package/dist/declarations/src/components/main-pages/tabular-main-page/tabular-main-page.d.ts +35 -78
  26. package/dist/declarations/src/components/modal-pages/custom-form-modal-page/custom-form-modal-page.d.ts +18 -59
  27. package/dist/declarations/src/components/modal-pages/form-modal-page/form-modal-page.d.ts +2 -3
  28. package/dist/declarations/src/components/modal-pages/internals/modal-page.d.ts +4 -5
  29. package/dist/declarations/src/components/modal-pages/tabular-modal-page/tabular-modal-page.d.ts +22 -64
  30. package/dist/declarations/src/components/modal-pages/utils/modal-page-top-bar.d.ts +3 -4
  31. package/dist/declarations/src/components/page-content-containers/page-content-wide/page-content-wide.d.ts +3 -6
  32. package/dist/declarations/src/components/tab-header/tab-header.d.ts +3 -4
  33. package/dist/{public-page-layout-d365f38f.cjs.prod.js → public-page-layout-2326dd98.cjs.prod.js} +14 -8
  34. package/dist/{public-page-layout-81be35b4.cjs.dev.js → public-page-layout-c5145325.cjs.dev.js} +15 -9
  35. package/dist/{public-page-layout-3fba954d.esm.js → public-page-layout-df1c566c.esm.js} +15 -9
  36. package/package.json +10 -10
@@ -11,6 +11,7 @@ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-
11
11
  var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
12
12
  var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
13
13
  var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
14
+ var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
14
15
  require('prop-types');
15
16
  var reactIntl = require('react-intl');
16
17
  var reactRouterDom = require('react-router-dom');
@@ -32,24 +33,21 @@ var PrimaryButton = require('@commercetools-uikit/primary-button');
32
33
  var SecondaryButton = require('@commercetools-uikit/secondary-button');
33
34
  var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
34
35
  var omitBy = require('lodash/omitBy');
36
+ var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
35
37
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
36
- var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
37
- var sentry = require('@commercetools-frontend/sentry');
38
- var AccessibleButton = require('@commercetools-uikit/accessible-button');
39
- var Constraints = require('@commercetools-uikit/constraints');
40
- var reactBroadcast = require('@flopflip/react-broadcast');
41
- var actionsGlobal = require('@commercetools-frontend/actions-global');
42
- var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
43
38
  var _setTimeout = require('@babel/runtime-corejs3/core-js-stable/set-timeout');
44
39
  var FlatButton = require('@commercetools-uikit/flat-button');
45
40
  var IconButton = require('@commercetools-uikit/icon-button');
46
- var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
47
- var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
41
+ var Constraints = require('@commercetools-uikit/constraints');
48
42
  var PageNotFoundSVG = require('@commercetools-frontend/assets/images/page-not-found.svg');
49
43
  var FailedAuthorizationSVG = require('@commercetools-frontend/assets/images/doors-closed.svg');
50
- var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
44
+ var reactBroadcast = require('@flopflip/react-broadcast');
45
+ var actionsGlobal = require('@commercetools-frontend/actions-global');
46
+ var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
47
+ var sentry = require('@commercetools-frontend/sentry');
51
48
  var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
52
49
  var Stamp = require('@commercetools-uikit/stamp');
50
+ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
53
51
  var useResizeObserver = require('@react-hook/resize-observer');
54
52
  var hooks = require('@commercetools-uikit/hooks');
55
53
 
@@ -73,22 +71,20 @@ var PrimaryButton__default = /*#__PURE__*/_interopDefault(PrimaryButton);
73
71
  var SecondaryButton__default = /*#__PURE__*/_interopDefault(SecondaryButton);
74
72
  var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
75
73
  var omitBy__default = /*#__PURE__*/_interopDefault(omitBy);
76
- var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
77
- var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
78
- var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
74
+ var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
79
75
  var _setTimeout__default = /*#__PURE__*/_interopDefault(_setTimeout);
80
76
  var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
81
77
  var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
82
- var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
83
- var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
78
+ var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
84
79
  var PageNotFoundSVG__default = /*#__PURE__*/_interopDefault(PageNotFoundSVG);
85
80
  var FailedAuthorizationSVG__default = /*#__PURE__*/_interopDefault(FailedAuthorizationSVG);
86
81
  var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
87
82
  var Stamp__default = /*#__PURE__*/_interopDefault(Stamp);
83
+ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
88
84
  var useResizeObserver__default = /*#__PURE__*/_interopDefault(useResizeObserver);
89
85
 
90
86
  // NOTE: This string will be replaced on build time with the package version.
91
- var version = "22.37.0";
87
+ var version = "22.38.1";
92
88
 
93
89
  // We keep these tokens as they are related to page layout components which should have
94
90
  // a slightly different layout (margins/paddings) when used within a Custom View panel.
@@ -116,9 +112,10 @@ var _ref$8 = {
116
112
  } ;
117
113
  const getLinkStyles = (isActive, isDisabled) => [/*#__PURE__*/react.css("font-size:", designSystem.designTokens.fontSize30, ";padding:", designSystem.designTokens.spacingS, " ", designSystem.designTokens.spacingM, ";position:relative;text-align:center;display:inline-block;color:inherit;text-decoration:inherit;&:first-of-type{padding-left:", designSystem.designTokens.spacing30, ";}", getBottomBorderStyles('transparent'), ";" + ("" ), "" ), isActive && /*#__PURE__*/react.css(getBottomBorderStyles(designSystem.designTokens.colorPrimary), " & h3{color:", designTokens.fontColorForTabLabelWhenActive, "!important;}" + ("" ), "" ), isDisabled && _ref$8, !isActive && !isDisabled && /*#__PURE__*/react.css(":hover,:focus,:active{& h3{color:", designTokens.fontColorForTabLabelWhenActive, "!important;}}" + ("" ), "" )];
118
114
 
119
- function ownKeys$8(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
120
- function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$8(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$8(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
121
- const pathWithoutSearch$1 = path => typeof path === 'string' ? path.split('?')[0] : path.pathname;
115
+ const _excluded$k = ["isDisabled", "exactPathMatch"];
116
+ function ownKeys$7(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
117
+ function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
118
+ const pathWithoutSearch = path => typeof path === 'string' ? path.split('?')[0] : path.pathname;
122
119
  const warnIfMissingContent = props => {
123
120
  Boolean(props.intlMessage) || Boolean(props.label);
124
121
  };
@@ -134,22 +131,29 @@ const TabLabel = _ref => {
134
131
  children: children
135
132
  });
136
133
  };
137
- const TabHeader = props => {
134
+ const TabHeader = _ref2 => {
135
+ let _ref2$isDisabled = _ref2.isDisabled,
136
+ isDisabled = _ref2$isDisabled === void 0 ? false : _ref2$isDisabled,
137
+ _ref2$exactPathMatch = _ref2.exactPathMatch,
138
+ exactPathMatch = _ref2$exactPathMatch === void 0 ? false : _ref2$exactPathMatch,
139
+ props = _objectWithoutProperties(_ref2, _excluded$k);
138
140
  const intl = reactIntl.useIntl();
139
141
  const location = reactRouterDom.useLocation();
140
142
  const isActive = Boolean(reactRouterDom.matchPath(location.pathname, {
141
143
  // strip the search, otherwise the path won't match
142
- path: pathWithoutSearch$1(props.to),
143
- exact: props.exactPathMatch,
144
+ path: pathWithoutSearch(props.to),
145
+ exact: exactPathMatch,
144
146
  strict: false
145
147
  }));
146
- const isDisabled = props.isDisabled;
147
148
  let label = props.label;
148
149
  if (props.intlMessage) {
149
150
  label = intl.formatMessage(props.intlMessage);
150
151
  }
151
- warnIfMissingContent(props);
152
- return jsxRuntime.jsx(reactRouterDom.Link, _objectSpread$8(_objectSpread$8({
152
+ warnIfMissingContent(_objectSpread$7({
153
+ exactPathMatch,
154
+ isDisabled
155
+ }, props));
156
+ return jsxRuntime.jsx(reactRouterDom.Link, _objectSpread$7(_objectSpread$7({
153
157
  role: "tab",
154
158
  "aria-selected": isActive,
155
159
  to: props.to,
@@ -162,11 +166,6 @@ const TabHeader = props => {
162
166
  };
163
167
  TabHeader.propTypes = {};
164
168
  TabHeader.displayName = 'TabHeader';
165
- const defaultProps$i = {
166
- isDisabled: false,
167
- exactPathMatch: false
168
- };
169
- TabHeader.defaultProps = defaultProps$i;
170
169
 
171
170
  const getConstraintForGridStyle = size => {
172
171
  switch (size) {
@@ -207,24 +206,17 @@ const getOverlayStyles$1 = props => /*#__PURE__*/react.css("display:flex;positio
207
206
  // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
208
207
  `${props.zIndex} !important` : 'auto', ";top:0;width:100%;height:100%;background-color:rgba(32, 62, 72, 0.5);opacity:1;" + ("" ), "" );
209
208
 
210
- function ownKeys$7(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
211
- function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
209
+ const _excluded$j = ["size", "getParentSelector"];
210
+ function ownKeys$6(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
211
+ function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$6(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
212
212
  const getDefaultParentSelector$1 = () => document.querySelector(`#${constants.PORTALS_CONTAINER_ID}`);
213
213
  const getOverlayElement$1 = (props, contentElement) =>
214
214
  // Assign the `data-role` to the overlay container, which is used as
215
215
  // the CSS selector in the `<PortalsContainer>`.
216
- jsxRuntime.jsx("div", _objectSpread$7(_objectSpread$7({}, props), {}, {
216
+ jsxRuntime.jsx("div", _objectSpread$6(_objectSpread$6({}, props), {}, {
217
217
  "data-role": "dialog-overlay",
218
218
  children: contentElement
219
219
  }));
220
- const defaultProps$h = {
221
- // TODO: t-shirt sizes are deprecated but we need to keep using them for
222
- // backwards compatibility and to help with styling migration
223
- // After the migration is done, we should change this default value to 13.
224
- // t-shirt sizes then can be removed in a next breaking change release
225
- size: 'l',
226
- getParentSelector: getDefaultParentSelector$1
227
- };
228
220
  const GridArea = /*#__PURE__*/_styled__default["default"]("div", {
229
221
  target: "elx55gk0"
230
222
  } )("grid-area:", props => props.name, ";" + ("" ));
@@ -236,21 +228,30 @@ var _ref2$3 = {
236
228
  name: "1187q51",
237
229
  styles: "display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;overflow:hidden"
238
230
  } ;
239
- const DialogContainer = props => {
231
+ const DialogContainer = _ref3 => {
232
+ let _ref3$size = _ref3.size,
233
+ size = _ref3$size === void 0 ? 13 : _ref3$size,
234
+ _ref3$getParentSelect = _ref3.getParentSelector,
235
+ getParentSelector = _ref3$getParentSelect === void 0 ? getDefaultParentSelector$1 : _ref3$getParentSelect,
236
+ props = _objectWithoutProperties(_ref3, _excluded$j);
240
237
  utils.useWarning(typeof props.title === 'string' || typeof props.title !== 'string' && Boolean(props['aria-label']), 'app-kit/DialogHeader: "aria-label" prop is required when the "title" prop is not a string.');
241
238
  return jsxRuntime.jsx(react.ClassNames, {
242
- children: _ref3 => {
243
- let makeClassName = _ref3.css;
239
+ children: _ref4 => {
240
+ let makeClassName = _ref4.css;
244
241
  return jsxRuntime.jsxs(Modal__default["default"], {
245
242
  isOpen: props.isOpen,
246
243
  onRequestClose: props.onClose,
247
244
  shouldCloseOnOverlayClick: Boolean(props.onClose),
248
245
  shouldCloseOnEsc: Boolean(props.onClose),
249
246
  overlayElement: getOverlayElement$1,
250
- overlayClassName: makeClassName(getOverlayStyles$1(props)),
251
- className: makeClassName(getModalContentStyles(props)),
247
+ overlayClassName: makeClassName(getOverlayStyles$1(_objectSpread$6({
248
+ size
249
+ }, props))),
250
+ className: makeClassName(getModalContentStyles(_objectSpread$6({
251
+ size
252
+ }, props))),
252
253
  contentLabel: typeof props.title === 'string' ? props.title : props['aria-label'],
253
- parentSelector: props.getParentSelector,
254
+ parentSelector: getParentSelector,
254
255
  ariaHideApp: false,
255
256
  children: [jsxRuntime.jsx(GridArea, {
256
257
  name: "top"
@@ -280,7 +281,6 @@ const DialogContainer = props => {
280
281
  };
281
282
  DialogContainer.propTypes = {};
282
283
  DialogContainer.displayName = 'DialogContainer';
283
- DialogContainer.defaultProps = defaultProps$h;
284
284
 
285
285
  // The overflow should be "auto", to make the container scrollable
286
286
  const DialogContent = /*#__PURE__*/_styled__default["default"]("div", {
@@ -350,15 +350,18 @@ function filterDataAttributes(obj) {
350
350
  return omitBy__default["default"](obj, (_value, key) => !_startsWithInstanceProperty__default["default"](key).call(key, 'data-'));
351
351
  }
352
352
 
353
- function ownKeys$6(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
354
- function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$6(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
355
- const defaultProps$g = {
356
- isPrimaryButtonDisabled: false,
357
- dataAttributesPrimaryButton: {},
358
- dataAttributesSecondaryButton: {}
359
- };
353
+ const _excluded$i = ["isPrimaryButtonDisabled", "dataAttributesPrimaryButton", "dataAttributesSecondaryButton"];
354
+ function ownKeys$5(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
355
+ function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
360
356
  const getFormattedLabel = (label, intl) => typeof label === 'string' ? label : intl.formatMessage(label);
361
- const DialogFooter = props => {
357
+ const DialogFooter = _ref => {
358
+ let _ref$isPrimaryButtonD = _ref.isPrimaryButtonDisabled,
359
+ isPrimaryButtonDisabled = _ref$isPrimaryButtonD === void 0 ? false : _ref$isPrimaryButtonD,
360
+ _ref$dataAttributesPr = _ref.dataAttributesPrimaryButton,
361
+ dataAttributesPrimaryButton = _ref$dataAttributesPr === void 0 ? {} : _ref$dataAttributesPr,
362
+ _ref$dataAttributesSe = _ref.dataAttributesSecondaryButton,
363
+ dataAttributesSecondaryButton = _ref$dataAttributesSe === void 0 ? {} : _ref$dataAttributesSe,
364
+ props = _objectWithoutProperties(_ref, _excluded$i);
362
365
  const intl = reactIntl.useIntl();
363
366
  return jsxRuntime.jsx("div", {
364
367
  css: /*#__PURE__*/react.css("margin-top:", designSystem.designTokens.spacing50, ";" + ("" ), "" ),
@@ -371,53 +374,55 @@ const DialogFooter = props => {
371
374
  scale: "m",
372
375
  alignItems: "center",
373
376
  justifyContent: "flex-end",
374
- children: [jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$6({
377
+ children: [jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$5({
375
378
  label: getFormattedLabel(props.labelSecondary, intl),
376
379
  onClick: props.onCancel,
377
380
  iconLeft: props.iconLeftSecondaryButton
378
- }, filterDataAttributes(props.dataAttributesSecondaryButton))), jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$6({
381
+ }, filterDataAttributes(dataAttributesSecondaryButton))), jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$5({
379
382
  label: getFormattedLabel(props.labelPrimary, intl),
380
383
  onClick: props.onConfirm,
381
- isDisabled: props.isPrimaryButtonDisabled
382
- }, filterDataAttributes(props.dataAttributesPrimaryButton)))]
384
+ isDisabled: isPrimaryButtonDisabled
385
+ }, filterDataAttributes(dataAttributesPrimaryButton)))]
383
386
  })]
384
387
  })
385
388
  });
386
389
  };
387
390
  DialogFooter.propTypes = {};
388
391
  DialogFooter.displayName = 'DialogFooter';
389
- DialogFooter.defaultProps = defaultProps$g;
390
392
 
391
- const defaultProps$f = {
392
- labelSecondary: i18n.sharedMessages.cancel,
393
- labelPrimary: i18n.sharedMessages.confirm
394
- };
395
- const ConfirmationDialog = props => jsxRuntime.jsxs(DialogContainer, {
396
- isOpen: props.isOpen,
397
- onClose: props.onClose,
398
- size: props.size,
399
- zIndex: props.zIndex,
400
- title: props.title,
401
- "aria-label": props['aria-label'],
402
- getParentSelector: props.getParentSelector,
403
- children: [jsxRuntime.jsx(DialogHeader, {
393
+ const _excluded$h = ["labelSecondary", "labelPrimary"];
394
+ const ConfirmationDialog = _ref => {
395
+ let _ref$labelSecondary = _ref.labelSecondary,
396
+ labelSecondary = _ref$labelSecondary === void 0 ? i18n.sharedMessages.cancel : _ref$labelSecondary,
397
+ _ref$labelPrimary = _ref.labelPrimary,
398
+ labelPrimary = _ref$labelPrimary === void 0 ? i18n.sharedMessages.confirm : _ref$labelPrimary,
399
+ props = _objectWithoutProperties(_ref, _excluded$h);
400
+ return jsxRuntime.jsxs(DialogContainer, {
401
+ isOpen: props.isOpen,
402
+ onClose: props.onClose,
403
+ size: props.size,
404
+ zIndex: props.zIndex,
404
405
  title: props.title,
405
- onClose: props.onClose
406
- }), jsxRuntime.jsx(DialogContent, {
407
- children: props.children
408
- }), jsxRuntime.jsx(DialogFooter, {
409
- labelSecondary: props.labelSecondary,
410
- labelPrimary: props.labelPrimary,
411
- isPrimaryButtonDisabled: props.isPrimaryButtonDisabled,
412
- onCancel: props.onCancel,
413
- onConfirm: props.onConfirm,
414
- dataAttributesSecondaryButton: props.dataAttributesSecondaryButton,
415
- dataAttributesPrimaryButton: props.dataAttributesPrimaryButton
416
- })]
417
- });
406
+ "aria-label": props['aria-label'],
407
+ getParentSelector: props.getParentSelector,
408
+ children: [jsxRuntime.jsx(DialogHeader, {
409
+ title: props.title,
410
+ onClose: props.onClose
411
+ }), jsxRuntime.jsx(DialogContent, {
412
+ children: props.children
413
+ }), jsxRuntime.jsx(DialogFooter, {
414
+ labelSecondary: labelSecondary,
415
+ labelPrimary: labelPrimary,
416
+ isPrimaryButtonDisabled: props.isPrimaryButtonDisabled,
417
+ onCancel: props.onCancel,
418
+ onConfirm: props.onConfirm,
419
+ dataAttributesSecondaryButton: props.dataAttributesSecondaryButton,
420
+ dataAttributesPrimaryButton: props.dataAttributesPrimaryButton
421
+ })]
422
+ });
423
+ };
418
424
  ConfirmationDialog.propTypes = {};
419
425
  ConfirmationDialog.displayName = 'ConfirmationDialog';
420
- ConfirmationDialog.defaultProps = defaultProps$f;
421
426
  // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
422
427
  // The Intl messages can be used for button labels.
423
428
  ConfirmationDialog.Intl = i18n.sharedMessages;
@@ -425,38 +430,41 @@ ConfirmationDialog.Intl = i18n.sharedMessages;
425
430
  // as the default dialog title.
426
431
  ConfirmationDialog.TextTitle = TextTitle;
427
432
 
428
- const defaultProps$e = {
429
- labelSecondary: i18n.sharedMessages.cancel,
430
- labelPrimary: i18n.sharedMessages.save
431
- };
432
- const FormDialog = props => jsxRuntime.jsxs(DialogContainer, {
433
- isOpen: props.isOpen,
434
- onClose: props.onClose,
435
- size: props.size,
436
- zIndex: props.zIndex,
437
- title: props.title,
438
- "aria-label": props['aria-label'],
439
- getParentSelector: props.getParentSelector,
440
- children: [jsxRuntime.jsx(DialogHeader, {
433
+ const _excluded$g = ["labelSecondary", "labelPrimary"];
434
+ const FormDialog = _ref => {
435
+ let _ref$labelSecondary = _ref.labelSecondary,
436
+ labelSecondary = _ref$labelSecondary === void 0 ? i18n.sharedMessages.cancel : _ref$labelSecondary,
437
+ _ref$labelPrimary = _ref.labelPrimary,
438
+ labelPrimary = _ref$labelPrimary === void 0 ? i18n.sharedMessages.save : _ref$labelPrimary,
439
+ props = _objectWithoutProperties(_ref, _excluded$g);
440
+ return jsxRuntime.jsxs(DialogContainer, {
441
+ isOpen: props.isOpen,
442
+ onClose: props.onClose,
443
+ size: props.size,
444
+ zIndex: props.zIndex,
441
445
  title: props.title,
442
- onClose: props.onClose
443
- }), jsxRuntime.jsx(DialogContent, {
444
- children: props.children
445
- }), jsxRuntime.jsx(DialogFooter, {
446
- labelSecondary: props.labelSecondary,
447
- labelPrimary: props.labelPrimary,
448
- isPrimaryButtonDisabled: props.isPrimaryButtonDisabled,
449
- onCancel: props.onSecondaryButtonClick,
450
- onConfirm: props.onPrimaryButtonClick,
451
- dataAttributesSecondaryButton: props.dataAttributesSecondaryButton,
452
- dataAttributesPrimaryButton: props.dataAttributesPrimaryButton,
453
- iconLeftSecondaryButton: props.iconLeftSecondaryButton,
454
- footerContent: props.footerContent
455
- })]
456
- });
446
+ "aria-label": props['aria-label'],
447
+ getParentSelector: props.getParentSelector,
448
+ children: [jsxRuntime.jsx(DialogHeader, {
449
+ title: props.title,
450
+ onClose: props.onClose
451
+ }), jsxRuntime.jsx(DialogContent, {
452
+ children: props.children
453
+ }), jsxRuntime.jsx(DialogFooter, {
454
+ labelSecondary: labelSecondary,
455
+ labelPrimary: labelPrimary,
456
+ isPrimaryButtonDisabled: props.isPrimaryButtonDisabled,
457
+ onCancel: props.onSecondaryButtonClick,
458
+ onConfirm: props.onPrimaryButtonClick,
459
+ dataAttributesSecondaryButton: props.dataAttributesSecondaryButton,
460
+ dataAttributesPrimaryButton: props.dataAttributesPrimaryButton,
461
+ iconLeftSecondaryButton: props.iconLeftSecondaryButton,
462
+ footerContent: props.footerContent
463
+ })]
464
+ });
465
+ };
457
466
  FormDialog.propTypes = {};
458
467
  FormDialog.displayName = 'FormDialog';
459
- FormDialog.defaultProps = defaultProps$e;
460
468
  // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
461
469
  // The Intl messages can be used for button labels.
462
470
  FormDialog.Intl = i18n.sharedMessages;
@@ -464,17 +472,137 @@ FormDialog.Intl = i18n.sharedMessages;
464
472
  // as the default dialog title.
465
473
  FormDialog.TextTitle = TextTitle;
466
474
 
467
- const messages$5 = reactIntl.defineMessages({
475
+ const CustomViewSelector = /*#__PURE__*/react$1.lazy(() => {
476
+ if (typeof window !== 'undefined' && typeof window.app !== 'undefined') {
477
+ return Promise.resolve().then(function () { return require('./custom-views-selector-efdd6e55.cjs.prod.js' /* webpackChunkName: "custom-views-selector" */); });
478
+ }
479
+ return _Promise__default["default"].resolve({
480
+ default: () => null
481
+ });
482
+ });
483
+
484
+ const _excluded$f = ["truncate"],
485
+ _excluded2$1 = ["titleSize", "truncate"];
486
+ const SubtitleWrapper = /*#__PURE__*/_styled__default["default"]("div", {
487
+ target: "epaiodd0"
488
+ } )("margin-top:", designSystem.designTokens.spacing20, ";" + ("" ));
489
+ const Title = props => {
490
+ switch (props.titleSize) {
491
+ case 'big':
492
+ return jsxRuntime.jsx(Text__default["default"].Headline, {
493
+ as: "h1",
494
+ title: props.title,
495
+ truncate: props.truncate,
496
+ children: props.title
497
+ });
498
+ case 'medium':
499
+ return jsxRuntime.jsx(Text__default["default"].Headline, {
500
+ as: "h2",
501
+ title: props.title,
502
+ truncate: props.truncate,
503
+ children: props.title
504
+ });
505
+ default:
506
+ return jsxRuntime.jsx(Text__default["default"].Subheadline, {
507
+ as: "h4",
508
+ title: props.title,
509
+ truncate: props.truncate,
510
+ children: props.title
511
+ });
512
+ }
513
+ };
514
+ const Subtitle = _ref2 => {
515
+ let _ref2$truncate = _ref2.truncate,
516
+ truncate = _ref2$truncate === void 0 ? false : _ref2$truncate,
517
+ props = _objectWithoutProperties(_ref2, _excluded$f);
518
+ if (!props.subtitle) {
519
+ return null;
520
+ }
521
+ if ( /*#__PURE__*/react$1.isValidElement(props.subtitle)) {
522
+ return jsxRuntime.jsx(SubtitleWrapper, {
523
+ children: props.subtitle
524
+ });
525
+ }
526
+ return jsxRuntime.jsx(SubtitleWrapper, {
527
+ children: jsxRuntime.jsx(Text__default["default"].Body, {
528
+ title: typeof props.subtitle === 'string' ? props.subtitle : undefined,
529
+ truncate: truncate,
530
+ tone: "secondary",
531
+ children: props.subtitle
532
+ })
533
+ });
534
+ };
535
+ Subtitle.propTypes = {};
536
+ var _ref$6 = {
537
+ name: "d3v9zr",
538
+ styles: "overflow:hidden"
539
+ } ;
540
+ const PageHeaderTitle = _ref3 => {
541
+ let _ref3$titleSize = _ref3.titleSize,
542
+ titleSize = _ref3$titleSize === void 0 ? 'small' : _ref3$titleSize,
543
+ _ref3$truncate = _ref3.truncate,
544
+ truncate = _ref3$truncate === void 0 ? false : _ref3$truncate,
545
+ props = _objectWithoutProperties(_ref3, _excluded2$1);
546
+ return jsxRuntime.jsxs("div", {
547
+ css: _ref$6,
548
+ children: [jsxRuntime.jsx(Title, {
549
+ title: props.title,
550
+ titleSize: titleSize,
551
+ truncate: truncate
552
+ }), jsxRuntime.jsx(Subtitle, {
553
+ subtitle: props.subtitle,
554
+ truncate: truncate
555
+ })]
556
+ });
557
+ };
558
+ PageHeaderTitle.propTypes = {};
559
+ PageHeaderTitle.displayName = 'PageHeaderTitle';
560
+
561
+ const PageHeader = props => {
562
+ return jsxRuntime.jsxs("div", {
563
+ css: /*#__PURE__*/react.css("margin:0 ", designSystem.designTokens.spacing55, ";padding:", designSystem.designTokens.spacing40, " 0 ", designSystem.designTokens.spacing40, ";border-bottom:1px solid ", designSystem.designTokens.colorNeutral90, ";" + ("" ), "" ),
564
+ children: [jsxRuntime.jsxs("div", {
565
+ css: /*#__PURE__*/react.css("display:flex;align-items:flex-end;justify-content:space-between;&>*+*{margin-left:", designSystem.designTokens.spacing50, ";}" + ("" ), "" ),
566
+ children: [jsxRuntime.jsx(PageHeaderTitle, {
567
+ title: props.title,
568
+ titleSize: "big",
569
+ subtitle: props.subtitle,
570
+ truncate: true
571
+ }), props.children]
572
+ }), jsxRuntime.jsx(CustomViewSelector, {
573
+ margin: `${designSystem.designTokens.spacing40} 0 0 0`,
574
+ customViewLocatorCode: props.customViewLocatorCode
575
+ })]
576
+ });
577
+ };
578
+ PageHeader.propTypes = {};
579
+ PageHeader.displayName = 'PageHeader';
580
+
581
+ const ContentWrapper$2 = /*#__PURE__*/_styled__default["default"]("div", {
582
+ target: "e1b7jwn02"
583
+ } )("flex:1;flex-basis:0;overflow:auto;margin:", designTokens.marginForPageContent, ";" + ("" ));
584
+ const ModalContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
585
+ target: "e1b7jwn01"
586
+ } )("flex:1;flex-basis:0;overflow:auto;margin:", designSystem.designTokens.spacing50, " ", designSystem.designTokens.spacing55, ";" + ("" ));
587
+ const PageWrapper = /*#__PURE__*/_styled__default["default"]("div", {
588
+ target: "e1b7jwn00"
589
+ } )({
590
+ name: "kdbhus",
591
+ styles: "height:100%;display:flex;flex-direction:column"
592
+ } );
593
+
594
+ const messages$4 = reactIntl.defineMessages({
468
595
  back: {
469
- id: 'Components.ModalPage.TopBar.Back',
470
- defaultMessage: 'Go Back'
596
+ id: "Components.ModalPage.TopBar.Back",
597
+ defaultMessage: "Go Back"
471
598
  },
472
599
  close: {
473
- id: 'Components.ModalPage.TopBar.Close',
474
- defaultMessage: 'Close Modal Page'
600
+ id: "Components.ModalPage.TopBar.Close",
601
+ defaultMessage: "Close Modal Page"
475
602
  }
476
603
  });
477
604
 
605
+ const _excluded$e = ["color", "previousPathLabel", "hidePathLabel"];
478
606
  // Component to have a larger clickable surface
479
607
  var _ref2$2 = {
480
608
  name: "1rxhroq",
@@ -491,24 +619,25 @@ const LargeIconWrapper = props => jsxRuntime.jsx("span", {
491
619
  // However, we need to explicitly define this otherwise the prop-types babel plugin
492
620
  // does not recognize the object shape.
493
621
  LargeIconWrapper.propTypes = {};
494
- const defaultProps$d = {
495
- color: 'surface',
496
- previousPathLabel: messages$5.back,
497
- hidePathLabel: false
498
- };
499
- var _ref$6 = {
622
+ var _ref$5 = {
500
623
  name: "uvw8rn",
501
624
  styles: "display:flex;overflow:hidden;button:first-of-type svg{height:12px!important;width:12px!important;}"
502
625
  } ;
503
- const ModalPageTopBar = props => {
626
+ const ModalPageTopBar = _ref3 => {
627
+ _ref3.color;
628
+ let _ref3$previousPathLab = _ref3.previousPathLabel,
629
+ previousPathLabel = _ref3$previousPathLab === void 0 ? messages$4.back : _ref3$previousPathLab,
630
+ _ref3$hidePathLabel = _ref3.hidePathLabel,
631
+ hidePathLabel = _ref3$hidePathLabel === void 0 ? false : _ref3$hidePathLabel,
632
+ props = _objectWithoutProperties(_ref3, _excluded$e);
504
633
  const intl = reactIntl.useIntl();
505
634
  return jsxRuntime.jsxs("div", {
506
635
  css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;padding:", designSystem.designTokens.spacing40, " ", designSystem.designTokens.spacing55, " 0;background-color:", designSystem.designTokens.colorSurface, ";border-bottom:1px solid ", designSystem.designTokens.colorSurface, ";& *+*{margin-left:", designSystem.designTokens.spacingS, ";}p{font-size:12px!important;}" + ("" ), "" ),
507
636
  children: [jsxRuntime.jsxs("div", {
508
- css: _ref$6,
509
- children: [!props.hidePathLabel && jsxRuntime.jsx(FlatButton__default["default"], {
637
+ css: _ref$5,
638
+ children: [!hidePathLabel && jsxRuntime.jsx(FlatButton__default["default"], {
510
639
  tone: "primary",
511
- label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
640
+ label: typeof previousPathLabel === 'string' ? previousPathLabel : intl.formatMessage(previousPathLabel),
512
641
  icon: jsxRuntime.jsx(icons.AngleLeftIcon, {
513
642
  size: "medium",
514
643
  color: "primary"
@@ -526,7 +655,7 @@ const ModalPageTopBar = props => {
526
655
  })]
527
656
  })]
528
657
  }), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
529
- label: intl.formatMessage(messages$5.close),
658
+ label: intl.formatMessage(messages$4.close),
530
659
  onClick: props.onClose,
531
660
  icon: jsxRuntime.jsx(LargeIconWrapper, {
532
661
  children: jsxRuntime.jsx(icons.CloseIcon, {})
@@ -537,7 +666,6 @@ const ModalPageTopBar = props => {
537
666
  };
538
667
  ModalPageTopBar.propTypes = {};
539
668
  ModalPageTopBar.displayName = 'ModalPageTopBar';
540
- ModalPageTopBar.defaultProps = defaultProps$d;
541
669
 
542
670
  const stylesBySize = {
543
671
  '10': {
@@ -575,19 +703,20 @@ var _ref2$1 = {
575
703
  } ;
576
704
  const getAfterOpenOverlayAnimation = () => _ref2$1;
577
705
  const getBeforeCloseContainerAnimation = props => /*#__PURE__*/react.css("transform:translate3d(\n ", props.size !== 'scale' ? stylesBySize[props.size].width : '30px', ",\n ,\n 0,\n 0\n )!important;" + ("" ), "" );
578
- var _ref$5 = {
706
+ var _ref$4 = {
579
707
  name: "728dx5",
580
708
  styles: "opacity:0!important"
581
709
  } ;
582
- const getBeforeCloseOverlayAnimation = () => _ref$5;
710
+ const getBeforeCloseOverlayAnimation = () => _ref$4;
583
711
 
584
- function ownKeys$5(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
585
- function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
712
+ const _excluded$d = ["size", "getParentSelector", "shouldDelayOnClose"];
713
+ function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
714
+ function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
586
715
  const getDefaultParentSelector = () => document.querySelector(`#${constants.PORTALS_CONTAINER_ID}`);
587
716
  const getOverlayElement = (props, contentElement) =>
588
717
  // Assign the `data-role` to the overlay container, which is used as
589
718
  // the CSS selector in the `<PortalsContainer>`.
590
- jsxRuntime.jsx("div", _objectSpread$5(_objectSpread$5({}, props), {}, {
719
+ jsxRuntime.jsx("div", _objectSpread$4(_objectSpread$4({}, props), {}, {
591
720
  "data-role": "modal-overlay",
592
721
  children: contentElement
593
722
  }));
@@ -596,12 +725,14 @@ jsxRuntime.jsx("div", _objectSpread$5(_objectSpread$5({}, props), {}, {
596
725
  // However, we need to explicitly define this otherwise the prop-types babel plugin
597
726
  // does not recognize the object shape.
598
727
 
599
- const defaultProps$c = {
600
- size: 'scale',
601
- getParentSelector: getDefaultParentSelector,
602
- shouldDelayOnClose: true
603
- };
604
- const ModalPage = props => {
728
+ const ModalPage = _ref => {
729
+ let _ref$size = _ref.size,
730
+ size = _ref$size === void 0 ? 'scale' : _ref$size,
731
+ _ref$getParentSelecto = _ref.getParentSelector,
732
+ getParentSelector = _ref$getParentSelecto === void 0 ? getDefaultParentSelector : _ref$getParentSelecto,
733
+ _ref$shouldDelayOnClo = _ref.shouldDelayOnClose,
734
+ shouldDelayOnClose = _ref$shouldDelayOnClo === void 0 ? true : _ref$shouldDelayOnClo,
735
+ props = _objectWithoutProperties(_ref, _excluded$d);
605
736
  const _useState = react$1.useState(false),
606
737
  _useState2 = _slicedToArray(_useState, 2),
607
738
  forceClose = _useState2[0],
@@ -616,9 +747,9 @@ const ModalPage = props => {
616
747
  };
617
748
  }, [props.isOpen]);
618
749
  const onClose = props.onClose;
619
- const TRANSITION_DURATION = stylesBySize[props.size].transitionTime;
750
+ const TRANSITION_DURATION = stylesBySize[size].transitionTime;
620
751
  const handleClose = react$1.useCallback(event => {
621
- if (props.shouldDelayOnClose) {
752
+ if (shouldDelayOnClose) {
622
753
  // In this case we want the closing animation to be shown
623
754
  // and therefore we need wait for it to be completed
624
755
  // before calling `onClose`.
@@ -629,423 +760,57 @@ const ModalPage = props => {
629
760
  return;
630
761
  }
631
762
  onClose && onClose(event);
632
- }, [onClose, props.shouldDelayOnClose, TRANSITION_DURATION]);
763
+ }, [onClose, shouldDelayOnClose, TRANSITION_DURATION]);
633
764
  return jsxRuntime.jsx(react.ClassNames, {
634
- children: _ref => {
635
- let makeClassName = _ref.css;
765
+ children: _ref2 => {
766
+ let makeClassName = _ref2.css;
636
767
  return jsxRuntime.jsxs(Modal__default["default"], {
637
768
  isOpen: forceClose === true ? false : props.isOpen,
638
769
  onRequestClose: handleClose,
639
- shouldCloseOnOverlayClick: Boolean(props.onClose),
640
- shouldCloseOnEsc: Boolean(props.onClose),
641
- overlayElement: getOverlayElement,
642
- overlayClassName: {
643
- base: makeClassName(getOverlayStyles(props)),
644
- afterOpen: makeClassName(getAfterOpenOverlayAnimation()),
645
- beforeClose: makeClassName(getBeforeCloseOverlayAnimation())
646
- },
647
- className: {
648
- base: makeClassName(getContainerStyles(props)),
649
- afterOpen: typeof props.afterOpenStyles === 'string' ? props.afterOpenStyles : makeClassName(props.afterOpenStyles ?? getAfterOpenContainerAnimation()),
650
- beforeClose: makeClassName(getBeforeCloseContainerAnimation(props))
651
- },
652
- contentLabel: props.title,
653
- parentSelector: props.getParentSelector,
654
- ariaHideApp: false
655
- // Adjust this value if the (beforeClose) animation duration is changed
656
- ,
657
- closeTimeoutMS: TRANSITION_DURATION,
658
- style: {
659
- // stylelint-disable-next-line selector-type-no-unknown
660
- overlay: {
661
- zIndex: props.zIndex
662
- }
663
- },
664
- children: [!props.hideTopBar && jsxRuntime.jsx(ModalPageTopBar, {
665
- color: props.topBarColor,
666
- onClose: handleClose,
667
- currentPathLabel: props.currentPathLabel,
668
- previousPathLabel: props.previousPathLabel,
669
- hidePathLabel: props.hidePathLabel
670
- }), props.children]
671
- });
672
- }
673
- });
674
- };
675
- ModalPage.propTypes = {};
676
- ModalPage.displayName = 'ModalPage';
677
- ModalPage.defaultProps = defaultProps$c;
678
-
679
- const messages$4 = reactIntl.defineMessages({
680
- loadError: {
681
- id: 'CustomViewLoader.error.load',
682
- defaultMessage: 'We could not load the Custom View. Please contact your administrator to check its configuration.'
683
- }
684
- });
685
-
686
- const isIframeReady = iFrameElementRef => {
687
- try {
688
- return iFrameElementRef?.contentWindow?.document.readyState === 'complete';
689
- } catch {
690
- // Trying to access the contentWindow of a cross-origin iFrame will throw an error.
691
- // We are not supposed to even get here because the iFrame must use
692
- // a URL from our very same domain (the custom view is proxied through our http-proxy service).
693
- return false;
694
- }
695
- };
696
- const ContentWrapper$2 = /*#__PURE__*/_styled__default["default"]("div", {
697
- target: "ewwxuwo1"
698
- } )({
699
- name: "13udsys",
700
- styles: "height:100%"
701
- } );
702
- const CustomPanelIframe = /*#__PURE__*/_styled__default["default"]("iframe", {
703
- target: "ewwxuwo0"
704
- } )({
705
- name: "174lt7a",
706
- styles: "height:100%;width:100%;border:none"
707
- } );
708
- function CustomViewLoader(props) {
709
- const iFrameElementRef = react$1.useRef(null);
710
- const dataLocale = applicationShellConnectors.useApplicationContext(context => context.dataLocale);
711
- const projectKey = applicationShellConnectors.useApplicationContext(context => context.project?.key);
712
- const featureFlags = reactBroadcast.useAllFeatureToggles();
713
- const iFrameCommunicationChannel = react$1.useRef(new MessageChannel());
714
- const showNotification = actionsGlobal.useShowNotification();
715
- const intl = reactIntl.useIntl();
716
- const messageFromIFrameHandler = react$1.useCallback(event => {
717
- if (event.data.origin === window.location.origin) {
718
- switch (event.data.eventName) {
719
- case constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE:
720
- props.onClose();
721
- break;
722
- }
723
- }
724
- }, [props]);
725
-
726
- // onLoad handler is called from the iFrame even where the URL is not valid
727
- // (blocked by CORS, 404, etc.) so we need to make sure the iFrame is ready
728
- const onLoadSuccessHandler = react$1.useCallback(() => {
729
- // Show error and block if the iFrame is not ready
730
- // (error loading it)
731
- if (!isIframeReady(iFrameElementRef.current)) {
732
- showNotification({
733
- domain: constants.DOMAINS.PAGE,
734
- kind: constants.NOTIFICATION_KINDS_PAGE.error,
735
- text: intl.formatMessage(messages$4.loadError)
736
- });
737
- return;
738
- }
739
-
740
- // Listen for messages from the iFrame
741
- iFrameCommunicationChannel.current.port1.onmessage = messageFromIFrameHandler;
742
-
743
- // Transfer port2 to the iFrame so it can send messages back privately
744
- iFrameElementRef.current?.contentWindow?.postMessage(constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_BOOTSTRAP, window.location.href, [iFrameCommunicationChannel.current.port2]);
745
-
746
- // Send the initialization message to the iFrame
747
- iFrameCommunicationChannel.current.port1.postMessage({
748
- source: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
749
- destination: `${constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX}${props.customView.id}`,
750
- eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION,
751
- eventData: {
752
- context: {
753
- dataLocale,
754
- projectKey,
755
- featureFlags,
756
- customViewConfig: props.customView,
757
- hostUrl: props.hostUrl || window.location.href
758
- }
759
- }
760
- });
761
-
762
- // We want the effect to run only once so we don't need the dependencies array.
763
- // eslint-disable-next-line react-hooks/exhaustive-deps
764
- }, []);
765
- react$1.useEffect(() => {
766
- // Close the channel when the component unmounts
767
- const communicationChannel = iFrameCommunicationChannel.current;
768
- return () => {
769
- communicationChannel?.port1.close();
770
- };
771
- }, []);
772
-
773
- // Currently we only support custom panels
774
- if (props.customView.type !== 'CustomPanel') {
775
- sentry.reportErrorToSentry(new Error(`CustomViewLoader: Provided Custom View has an unsupported type: ${props.customView.type}. Supported types: ['CustomPanel'].`));
776
- return null;
777
- }
778
- const panelSize = props.customView.typeSettings?.size?.toLocaleLowerCase() || 'large';
779
- const iFrameUrl = [window.location.origin, 'custom-views', props.customView.id, 'projects', projectKey].join('/');
780
- return jsxRuntime.jsx(ModalPage, {
781
- isOpen: true,
782
- onClose: props.onClose,
783
- size: panelSize === 'small' ? 10 : 30,
784
- title: `Custom View: ${props.customView.defaultLabel}`,
785
- hideTopBar: true,
786
- children: jsxRuntime.jsx(ContentWrapper$2, {
787
- children: jsxRuntime.jsx(CustomPanelIframe, {
788
- id: `custom-view-${props.customView.id}`,
789
- title: `Custom View: ${props.customView.defaultLabel}`,
790
- ref: iFrameElementRef,
791
- src: iFrameUrl,
792
- onLoad: onLoadSuccessHandler
793
- }, `custom-view-${props.customView.id}`)
794
- })
795
- });
796
- }
797
- CustomViewLoader.propTypes = {};
798
-
799
- var messages$3 = reactIntl.defineMessages({
800
- title: {
801
- id: 'CustomViewsSelector.title',
802
- defaultMessage: 'Custom Views:'
803
- }
804
- });
805
-
806
- var FetchCustomViewsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchCustomViewsByLocator" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "customViewLocatorCode" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allCustomViewsInstallationsByLocator" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "locator" }, value: { kind: "Variable", name: { kind: "Name", value: "customViewLocatorCode" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "customView" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "defaultLabel" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "url" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "typeSettings" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "size" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "locators" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "oAuthScopes" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 405, source: { body: "query FetchCustomViewsByLocator($customViewLocatorCode: String!) {\n allCustomViewsInstallationsByLocator(locator: $customViewLocatorCode) {\n id\n customView {\n id\n defaultLabel\n labelAllLocales {\n locale\n value\n }\n url\n type\n typeSettings {\n size\n }\n locators\n permissions {\n name\n oAuthScopes\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
807
- const useCustomViewsConnector = _ref => {
808
- let customViewLocatorCode = _ref.customViewLocatorCode;
809
- const enableCustomViews = reactBroadcast.useFlagVariation(constants.featureFlags.CUSTOM_VIEWS);
810
- const areCustomViewsEnabled =
811
- // @ts-ignore In case it's coming from the MC API, it's an object { value: boolean }.
812
- (enableCustomViews?.value ?? enableCustomViews) && process.env.DISABLE_CUSTOM_VIEWS_FEATURE !== 'true';
813
- const _useMcQuery = applicationShellConnectors.useMcQuery(FetchCustomViewsQuery, {
814
- variables: {
815
- customViewLocatorCode
816
- },
817
- context: {
818
- target: constants.GRAPHQL_TARGETS.SETTINGS_SERVICE
819
- },
820
- skip: !areCustomViewsEnabled
821
- }),
822
- data = _useMcQuery.data,
823
- error = _useMcQuery.error,
824
- loading = _useMcQuery.loading;
825
- return {
826
- customViews: data?.allCustomViewsInstallationsByLocator?.map(installation => installation.customView) || [],
827
- error,
828
- loading
829
- };
830
- };
831
-
832
- function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
833
- function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
834
- const COMPONENT_HEIGHT = '52px';
835
- const Wrapper = /*#__PURE__*/_styled__default["default"]("div", {
836
- target: "e16cb3zv3"
837
- } )("height:", props => props.shouldRender ? COMPONENT_HEIGHT : '0', ";overflow:hidden;transition:margin 0.3s ease-in-out,height 0.3s ease-in-out;margin:", props => props.shouldRender ? props.margin : '0', ";" + ("" ));
838
- const Container$2 = /*#__PURE__*/_styled__default["default"]("div", {
839
- target: "e16cb3zv2"
840
- } )("background-color:", designSystem.designTokens.colorNeutral98, ";padding:10px ", designSystem.designTokens.spacing30, ";border:1px solid ", designSystem.designTokens.colorNeutral95, ";border-radius:", designSystem.designTokens.borderRadius8, ";" + ("" ));
841
- const hoverAndSelectedStateStyles = /*#__PURE__*/react.css("box-shadow:", designSystem.designTokens.shadow1, ";background-color:", designSystem.designTokens.colorSurface, ";color:", designSystem.designTokens.colorPrimary30, ";" + ("" ), "" );
842
- const CustomViewSelectorItem = props => {
843
- return jsxRuntime.jsx(AccessibleButton__default["default"], {
844
- css: /*#__PURE__*/react.css("display:flex;align-items:center;padding:", designSystem.designTokens.spacing20, " ", designSystem.designTokens.spacing25, ";height:30px;border-radius:", designSystem.designTokens.borderRadius6, ";color:", designSystem.designTokens.colorPrimary, ";", props.selected && hoverAndSelectedStateStyles, " :hover{", hoverAndSelectedStateStyles, ";}" + ("" ), "" ),
845
- onClick: props.onClick,
846
- label: props.label,
847
- children: jsxRuntime.jsx(Text__default["default"].Detail, {
848
- tone: "inherit",
849
- fontWeight: props.selected ? 'bold' : 'regular',
850
- children: props.label
851
- })
852
- });
853
- };
854
- CustomViewSelectorItem.propTypes = {};
855
- const SelectorLabel = /*#__PURE__*/_styled__default["default"]("div", {
856
- target: "e16cb3zv1"
857
- } )({
858
- name: "1i68o0s",
859
- styles: "display:flex;align-items:center;gap:6px;div{font-weight:300;}"
860
- } );
861
- const Separator = /*#__PURE__*/_styled__default["default"]("span", {
862
- target: "e16cb3zv0"
863
- } )({
864
- name: "1lsblg0",
865
- styles: "width:1px;height:18px;background-color:#cccccc"
866
- } );
867
- function CustomViewSelector(props) {
868
- const _useState = react$1.useState(null),
869
- _useState2 = _slicedToArray(_useState, 2),
870
- selectedCustomView = _useState2[0],
871
- setSelectedCustomView = _useState2[1];
872
- const _useCustomViewsConnec = useCustomViewsConnector({
873
- customViewLocatorCode: props.customViewLocatorCode
874
- }),
875
- customViews = _useCustomViewsConnec.customViews,
876
- error = _useCustomViewsConnec.error,
877
- loading = _useCustomViewsConnec.loading;
878
- const onCustomViewsResolved = props.onCustomViewsResolved;
879
- react$1.useEffect(() => {
880
- if (!loading && !error && onCustomViewsResolved) {
881
- onCustomViewsResolved(customViews);
882
- }
883
- }, [customViews, error, loading, onCustomViewsResolved]);
884
- if (error) {
885
- sentry.reportErrorToSentry(error, {
886
- extra: {
887
- customViewLocatorCode: props.customViewLocatorCode
888
- }
889
- });
890
- return null;
891
- }
892
- return jsxRuntime.jsx(Wrapper, {
893
- shouldRender: customViews.length > 0,
894
- margin: props.margin || '0',
895
- children: jsxRuntime.jsx(Container$2, {
896
- children: jsxRuntime.jsxs(Constraints__default["default"].Horizontal, {
897
- max: "scale",
898
- children: [jsxRuntime.jsxs(Spacings__default["default"].Inline, {
899
- scale: "s",
900
- justifyContent: "flex-start",
901
- alignItems: "center",
902
- children: [jsxRuntime.jsxs(SelectorLabel, {
903
- children: [jsxRuntime.jsx(icons.WindowEyeIcon, {
904
- size: "medium",
905
- color: "neutral60"
906
- }), jsxRuntime.jsx(Text__default["default"].Detail, {
907
- tone: "secondary",
908
- intlMessage: messages$3.title
909
- })]
910
- }), _mapInstanceProperty__default["default"](customViews).call(customViews, (customView, index) => {
911
- const isNotLastItem = index !== customViews.length - 1;
912
- return jsxRuntime.jsxs(react$1.Fragment, {
913
- children: [jsxRuntime.jsx(CustomViewSelectorItem, {
914
- selected: selectedCustomView?.id === customView.id,
915
- onClick: () => {
916
- setSelectedCustomView(customView);
917
- },
918
- label: customView.defaultLabel
919
- }), isNotLastItem && jsxRuntime.jsx(Separator, {})]
920
- }, customView.id);
921
- })]
922
- }), selectedCustomView && jsxRuntime.jsx(CustomViewLoader, {
923
- customView: selectedCustomView,
924
- onClose: () => {
925
- setSelectedCustomView(null);
926
- }
927
- })]
928
- })
929
- })
930
- });
931
- }
932
- CustomViewSelector.propTypes = {};
933
- CustomViewSelector.displayName = 'CustomViewSelector';
934
- const CustomViewSelectorOrNothing = props => {
935
- if (!props.customViewLocatorCode) {
936
- return null;
937
- }
938
- return jsxRuntime.jsx(CustomViewSelector, _objectSpread$4(_objectSpread$4({}, props), {}, {
939
- customViewLocatorCode: props.customViewLocatorCode
940
- }));
941
- };
942
- CustomViewSelectorOrNothing.propTypes = {};
943
-
944
- const defaultProps$b = {
945
- titleSize: 'small',
946
- truncate: false
947
- };
948
- const SubtitleWrapper = /*#__PURE__*/_styled__default["default"]("div", {
949
- target: "epaiodd0"
950
- } )("margin-top:", designSystem.designTokens.spacing20, ";" + ("" ));
951
- const Title = props => {
952
- switch (props.titleSize) {
953
- case 'big':
954
- return jsxRuntime.jsx(Text__default["default"].Headline, {
955
- as: "h1",
956
- title: props.title,
957
- truncate: props.truncate,
958
- children: props.title
959
- });
960
- case 'medium':
961
- return jsxRuntime.jsx(Text__default["default"].Headline, {
962
- as: "h2",
963
- title: props.title,
964
- truncate: props.truncate,
965
- children: props.title
966
- });
967
- default:
968
- return jsxRuntime.jsx(Text__default["default"].Subheadline, {
969
- as: "h4",
970
- title: props.title,
971
- truncate: props.truncate,
972
- children: props.title
973
- });
974
- }
975
- };
976
- const Subtitle = props => {
977
- if (!props.subtitle) {
978
- return null;
979
- }
980
- if ( /*#__PURE__*/react$1.isValidElement(props.subtitle)) {
981
- return jsxRuntime.jsx(SubtitleWrapper, {
982
- children: props.subtitle
983
- });
984
- }
985
- return jsxRuntime.jsx(SubtitleWrapper, {
986
- children: jsxRuntime.jsx(Text__default["default"].Body, {
987
- title: typeof props.subtitle === 'string' ? props.subtitle : undefined,
988
- truncate: props.truncate,
989
- tone: "secondary",
990
- children: props.subtitle
991
- })
992
- });
993
- };
994
- Subtitle.propTypes = {};
995
- Subtitle.defaultProps = {
996
- truncate: false
997
- };
998
- var _ref$4 = {
999
- name: "d3v9zr",
1000
- styles: "overflow:hidden"
1001
- } ;
1002
- const PageHeaderTitle = props => jsxRuntime.jsxs("div", {
1003
- css: _ref$4,
1004
- children: [jsxRuntime.jsx(Title, {
1005
- title: props.title,
1006
- titleSize: props.titleSize,
1007
- truncate: props.truncate
1008
- }), jsxRuntime.jsx(Subtitle, {
1009
- subtitle: props.subtitle,
1010
- truncate: props.truncate
1011
- })]
1012
- });
1013
- PageHeaderTitle.propTypes = {};
1014
- PageHeaderTitle.displayName = 'PageHeaderTitle';
1015
- PageHeaderTitle.defaultProps = defaultProps$b;
1016
-
1017
- const PageHeader = props => {
1018
- return jsxRuntime.jsxs("div", {
1019
- css: /*#__PURE__*/react.css("margin:0 ", designSystem.designTokens.spacing55, ";padding:", designSystem.designTokens.spacing40, " 0 ", designSystem.designTokens.spacing40, ";border-bottom:1px solid ", designSystem.designTokens.colorNeutral90, ";" + ("" ), "" ),
1020
- children: [jsxRuntime.jsxs("div", {
1021
- css: /*#__PURE__*/react.css("display:flex;align-items:flex-end;justify-content:space-between;&>*+*{margin-left:", designSystem.designTokens.spacing50, ";}" + ("" ), "" ),
1022
- children: [jsxRuntime.jsx(PageHeaderTitle, {
1023
- title: props.title,
1024
- titleSize: "big",
1025
- subtitle: props.subtitle,
1026
- truncate: true
1027
- }), props.children]
1028
- }), jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1029
- margin: `${designSystem.designTokens.spacing40} 0 0 0`,
1030
- customViewLocatorCode: props.customViewLocatorCode
1031
- })]
770
+ shouldCloseOnOverlayClick: Boolean(props.onClose),
771
+ shouldCloseOnEsc: Boolean(props.onClose),
772
+ overlayElement: getOverlayElement,
773
+ overlayClassName: {
774
+ base: makeClassName(getOverlayStyles(_objectSpread$4({
775
+ size
776
+ }, props))),
777
+ afterOpen: makeClassName(getAfterOpenOverlayAnimation()),
778
+ beforeClose: makeClassName(getBeforeCloseOverlayAnimation())
779
+ },
780
+ className: {
781
+ base: makeClassName(getContainerStyles(_objectSpread$4({
782
+ size
783
+ }, props))),
784
+ afterOpen: typeof props.afterOpenStyles === 'string' ? props.afterOpenStyles : makeClassName(props.afterOpenStyles ?? getAfterOpenContainerAnimation()),
785
+ beforeClose: makeClassName(getBeforeCloseContainerAnimation(_objectSpread$4({
786
+ size
787
+ }, props)))
788
+ },
789
+ contentLabel: props.title,
790
+ parentSelector: getParentSelector,
791
+ ariaHideApp: false
792
+ // Adjust this value if the (beforeClose) animation duration is changed
793
+ ,
794
+ closeTimeoutMS: TRANSITION_DURATION,
795
+ style: {
796
+ // stylelint-disable-next-line selector-type-no-unknown
797
+ overlay: {
798
+ zIndex: props.zIndex
799
+ }
800
+ },
801
+ children: [!props.hideTopBar && jsxRuntime.jsx(ModalPageTopBar, {
802
+ color: props.topBarColor,
803
+ onClose: handleClose,
804
+ currentPathLabel: props.currentPathLabel,
805
+ previousPathLabel: props.previousPathLabel,
806
+ hidePathLabel: props.hidePathLabel
807
+ }), props.children]
808
+ });
809
+ }
1032
810
  });
1033
811
  };
1034
- PageHeader.propTypes = {};
1035
- PageHeader.displayName = 'PageHeader';
1036
-
1037
- const ContentWrapper$1 = /*#__PURE__*/_styled__default["default"]("div", {
1038
- target: "e1b7jwn02"
1039
- } )("flex:1;flex-basis:0;overflow:auto;margin:", designTokens.marginForPageContent, ";" + ("" ));
1040
- const ModalContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1041
- target: "e1b7jwn01"
1042
- } )("flex:1;flex-basis:0;overflow:auto;margin:", designSystem.designTokens.spacing50, " ", designSystem.designTokens.spacing55, ";" + ("" ));
1043
- const PageWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1044
- target: "e1b7jwn00"
1045
- } )({
1046
- name: "kdbhus",
1047
- styles: "height:100%;display:flex;flex-direction:column"
1048
- } );
812
+ ModalPage.propTypes = {};
813
+ ModalPage.displayName = 'ModalPage';
1049
814
 
1050
815
  const InfoModalPage = props => jsxRuntime.jsxs(ModalPage, {
1051
816
  title: props.title,
@@ -1068,63 +833,69 @@ const InfoModalPage = props => jsxRuntime.jsxs(ModalPage, {
1068
833
  InfoModalPage.propTypes = {};
1069
834
  InfoModalPage.displayName = 'InfoModalPage';
1070
835
 
836
+ const _excluded$c = ["label", "isDisabled", "dataAttributes"],
837
+ _excluded2 = ["label", "isDisabled", "dataAttributes"],
838
+ _excluded3 = ["label", "isDisabled", "dataAttributes"];
1071
839
  function ownKeys$3(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1072
840
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1073
- const primaryDefaultProps = {
1074
- label: i18n.sharedMessages.confirm,
1075
- isDisabled: false,
1076
- dataAttributes: {}
1077
- };
1078
841
  const useFormattedLabel = label => {
1079
842
  const intl = reactIntl.useIntl();
1080
843
  return typeof label === 'string' ? label : intl.formatMessage(label);
1081
844
  };
1082
- const FormPrimaryButton = props => {
1083
- const label = useFormattedLabel(props.label);
845
+ const FormPrimaryButton = _ref => {
846
+ let _ref$label = _ref.label,
847
+ label = _ref$label === void 0 ? i18n.sharedMessages.confirm : _ref$label,
848
+ _ref$isDisabled = _ref.isDisabled,
849
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
850
+ _ref$dataAttributes = _ref.dataAttributes,
851
+ dataAttributes = _ref$dataAttributes === void 0 ? {} : _ref$dataAttributes,
852
+ props = _objectWithoutProperties(_ref, _excluded$c);
853
+ const _label = useFormattedLabel(label);
1084
854
  return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$3({
1085
- label: label,
855
+ label: _label,
1086
856
  onClick: props.onClick,
1087
- isDisabled: props.isDisabled,
857
+ isDisabled: isDisabled,
1088
858
  iconLeft: props.iconLeft
1089
- }, filterDataAttributes(props.dataAttributes)));
859
+ }, filterDataAttributes(dataAttributes)));
1090
860
  };
1091
861
  FormPrimaryButton.propTypes = {};
1092
862
  FormPrimaryButton.displayName = 'FormPrimaryButton';
1093
- FormPrimaryButton.defaultProps = primaryDefaultProps;
1094
- const secondaryDefaultProps = {
1095
- label: i18n.sharedMessages.cancel,
1096
- isDisabled: false,
1097
- dataAttributes: {}
1098
- };
1099
- const FormSecondaryButton = props => {
1100
- const label = useFormattedLabel(props.label);
863
+ const FormSecondaryButton = _ref2 => {
864
+ let _ref2$label = _ref2.label,
865
+ label = _ref2$label === void 0 ? i18n.sharedMessages.cancel : _ref2$label,
866
+ _ref2$isDisabled = _ref2.isDisabled,
867
+ isDisabled = _ref2$isDisabled === void 0 ? false : _ref2$isDisabled,
868
+ _ref2$dataAttributes = _ref2.dataAttributes,
869
+ dataAttributes = _ref2$dataAttributes === void 0 ? {} : _ref2$dataAttributes,
870
+ props = _objectWithoutProperties(_ref2, _excluded2);
871
+ const _label = useFormattedLabel(label);
1101
872
  return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$3({
1102
- label: label,
873
+ label: _label,
1103
874
  onClick: props.onClick,
1104
- isDisabled: props.isDisabled,
875
+ isDisabled: isDisabled,
1105
876
  iconLeft: props.iconLeft
1106
- }, filterDataAttributes(props.dataAttributes)));
877
+ }, filterDataAttributes(dataAttributes)));
1107
878
  };
1108
879
  FormSecondaryButton.propTypes = {};
1109
880
  FormSecondaryButton.displayName = 'FormSecondaryButton';
1110
- FormSecondaryButton.defaultProps = secondaryDefaultProps;
1111
- const deleteDefaultProps = {
1112
- label: i18n.sharedMessages.delete,
1113
- isDisabled: false,
1114
- dataAttributes: {}
1115
- };
1116
- const FormDeleteButton = props => {
1117
- const label = useFormattedLabel(props.label);
881
+ const FormDeleteButton = _ref3 => {
882
+ let _ref3$label = _ref3.label,
883
+ label = _ref3$label === void 0 ? i18n.sharedMessages.delete : _ref3$label,
884
+ _ref3$isDisabled = _ref3.isDisabled,
885
+ isDisabled = _ref3$isDisabled === void 0 ? false : _ref3$isDisabled,
886
+ _ref3$dataAttributes = _ref3.dataAttributes,
887
+ dataAttributes = _ref3$dataAttributes === void 0 ? {} : _ref3$dataAttributes,
888
+ props = _objectWithoutProperties(_ref3, _excluded3);
889
+ const _label = useFormattedLabel(label);
1118
890
  return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$3({
1119
891
  icon: jsxRuntime.jsx(icons.BinLinearIcon, {}),
1120
- label: label,
892
+ label: _label,
1121
893
  onClick: props.onClick,
1122
- isDisabled: props.isDisabled
1123
- }, filterDataAttributes(props.dataAttributes)));
894
+ isDisabled: isDisabled
895
+ }, filterDataAttributes(dataAttributes)));
1124
896
  };
1125
897
  FormDeleteButton.propTypes = {};
1126
898
  FormDeleteButton.displayName = 'FormDeleteButton';
1127
- FormDeleteButton.defaultProps = deleteDefaultProps;
1128
899
 
1129
900
  const CustomFormModalPage = props => jsxRuntime.jsxs(ModalPage, {
1130
901
  title: props.title,
@@ -1159,65 +930,47 @@ CustomFormModalPage.FormDeleteButton = FormDeleteButton;
1159
930
  // The Intl messages can be used for button labels.
1160
931
  CustomFormModalPage.Intl = i18n.sharedMessages;
1161
932
 
1162
- const defaultProps$a = {
1163
- hideControls: false
933
+ const _excluded$b = ["hideControls"];
934
+ const FormModalPage = _ref => {
935
+ let _ref$hideControls = _ref.hideControls,
936
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
937
+ props = _objectWithoutProperties(_ref, _excluded$b);
938
+ return jsxRuntime.jsx(CustomFormModalPage, {
939
+ title: props.title,
940
+ subtitle: props.subtitle,
941
+ isOpen: props.isOpen,
942
+ zIndex: props.zIndex,
943
+ onClose: props.onClose,
944
+ topBarCurrentPathLabel: props.topBarCurrentPathLabel,
945
+ topBarPreviousPathLabel: props.topBarPreviousPathLabel,
946
+ getParentSelector: props.getParentSelector,
947
+ shouldDelayOnClose: props.shouldDelayOnClose,
948
+ hideControls: hideControls,
949
+ afterOpenStyles: props.afterOpenStyles,
950
+ formControls: jsxRuntime.jsxs(jsxRuntime.Fragment, {
951
+ children: [jsxRuntime.jsx(CustomFormModalPage.FormSecondaryButton, {
952
+ label: props.labelSecondaryButton,
953
+ onClick: props.onSecondaryButtonClick,
954
+ isDisabled: props.isSecondaryButtonDisabled,
955
+ dataAttributes: props.dataAttributesSecondaryButton,
956
+ iconLeft: props.iconLeftSecondaryButton
957
+ }), jsxRuntime.jsx(CustomFormModalPage.FormPrimaryButton, {
958
+ label: props.labelPrimaryButton,
959
+ onClick: props.onPrimaryButtonClick,
960
+ isDisabled: props.isPrimaryButtonDisabled,
961
+ dataAttributes: props.dataAttributesPrimaryButton
962
+ })]
963
+ }),
964
+ customViewLocatorCode: props.customViewLocatorCode,
965
+ children: props.children
966
+ });
1164
967
  };
1165
- const FormModalPage = props => jsxRuntime.jsx(CustomFormModalPage, {
1166
- title: props.title,
1167
- subtitle: props.subtitle,
1168
- isOpen: props.isOpen,
1169
- zIndex: props.zIndex,
1170
- onClose: props.onClose,
1171
- topBarCurrentPathLabel: props.topBarCurrentPathLabel,
1172
- topBarPreviousPathLabel: props.topBarPreviousPathLabel,
1173
- getParentSelector: props.getParentSelector,
1174
- shouldDelayOnClose: props.shouldDelayOnClose,
1175
- hideControls: props.hideControls,
1176
- afterOpenStyles: props.afterOpenStyles,
1177
- formControls: jsxRuntime.jsxs(jsxRuntime.Fragment, {
1178
- children: [jsxRuntime.jsx(CustomFormModalPage.FormSecondaryButton, {
1179
- label: props.labelSecondaryButton,
1180
- onClick: props.onSecondaryButtonClick,
1181
- isDisabled: props.isSecondaryButtonDisabled,
1182
- dataAttributes: props.dataAttributesSecondaryButton,
1183
- iconLeft: props.iconLeftSecondaryButton
1184
- }), jsxRuntime.jsx(CustomFormModalPage.FormPrimaryButton, {
1185
- label: props.labelPrimaryButton,
1186
- onClick: props.onPrimaryButtonClick,
1187
- isDisabled: props.isPrimaryButtonDisabled,
1188
- dataAttributes: props.dataAttributesPrimaryButton
1189
- })]
1190
- }),
1191
- customViewLocatorCode: props.customViewLocatorCode,
1192
- children: props.children
1193
- });
1194
968
  FormModalPage.propTypes = {};
1195
969
  FormModalPage.displayName = 'FormModalPage';
1196
- FormModalPage.defaultProps = defaultProps$a;
1197
970
  // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1198
971
  // The Intl messages can be used for button labels.
1199
972
  FormModalPage.Intl = i18n.sharedMessages;
1200
973
 
1201
- const pathWithoutSearch = path => typeof path === 'string' ? path.split('?')[0] : path.pathname;
1202
- const useCustomViewLocatorSelector = function () {
1203
- var _context;
1204
- let customViewLocatorCodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1205
- const location = reactRouterDom.useLocation();
1206
- const customViewLocator = _findInstanceProperty__default["default"](_context = _Object$entries__default["default"](customViewLocatorCodes)).call(_context, _ref => {
1207
- let _ref2 = _slicedToArray(_ref, 2),
1208
- locator = _ref2[1];
1209
- return reactRouterDom.matchPath(location.pathname, {
1210
- // strip the search, otherwise the path won't match
1211
- path: pathWithoutSearch(locator),
1212
- exact: true,
1213
- strict: false
1214
- });
1215
- });
1216
- return {
1217
- currentCustomViewLocatorCode: customViewLocator?.[0]
1218
- };
1219
- };
1220
-
1221
974
  const TabControls = /*#__PURE__*/_styled__default["default"]("div", {
1222
975
  target: "elpldre4"
1223
976
  } )("margin-top:", designSystem.designTokens.spacingS, ";" + ("" ));
@@ -1243,12 +996,11 @@ const TabularModalPageContainer = /*#__PURE__*/_styled__default["default"]("div"
1243
996
  target: "elpldre0"
1244
997
  } )(TabularPageContainer, "{padding:", designSystem.designTokens.spacing40, " ", designSystem.designTokens.spacing55, " 0;}" + ("" ));
1245
998
 
1246
- const defaultProps$9 = {
1247
- hideControls: false
1248
- };
1249
- const TabularModalPage = props => {
1250
- const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
1251
- currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
999
+ const _excluded$a = ["hideControls"];
1000
+ const TabularModalPage = _ref => {
1001
+ let _ref$hideControls = _ref.hideControls,
1002
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1003
+ props = _objectWithoutProperties(_ref, _excluded$a);
1252
1004
  return jsxRuntime.jsxs(ModalPage, {
1253
1005
  title: props.title,
1254
1006
  isOpen: props.isOpen,
@@ -1270,7 +1022,7 @@ const TabularModalPage = props => {
1270
1022
  }), jsxRuntime.jsx(ControlsContainter, {
1271
1023
  tabControls: props.tabControls,
1272
1024
  formControls: jsxRuntime.jsx(FormControlsContainer, {
1273
- children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1025
+ children: !hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1274
1026
  alignItems: "flex-end",
1275
1027
  children: props.formControls
1276
1028
  })
@@ -1278,9 +1030,9 @@ const TabularModalPage = props => {
1278
1030
  })]
1279
1031
  })
1280
1032
  }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1281
- children: jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1033
+ children: jsxRuntime.jsx(CustomViewSelector, {
1282
1034
  margin: `${designSystem.designTokens.spacing30} 0 0 0`,
1283
- customViewLocatorCode: currentCustomViewLocatorCode
1035
+ customViewLocatorCodes: props.customViewLocatorCodes
1284
1036
  })
1285
1037
  }), jsxRuntime.jsx(ModalContentWrapper, {
1286
1038
  children: props.children
@@ -1289,7 +1041,6 @@ const TabularModalPage = props => {
1289
1041
  };
1290
1042
  TabularModalPage.propTypes = {};
1291
1043
  TabularModalPage.displayName = 'TabularModalPage';
1292
- TabularModalPage.defaultProps = defaultProps$9;
1293
1044
  // Static export of pre-configured form control buttons to easily re-use
1294
1045
  // them in the custom controls.
1295
1046
  TabularModalPage.FormPrimaryButton = FormPrimaryButton;
@@ -1299,17 +1050,18 @@ TabularModalPage.FormDeleteButton = FormDeleteButton;
1299
1050
  // The Intl messages can be used for button labels.
1300
1051
  TabularModalPage.Intl = i18n.sharedMessages;
1301
1052
 
1302
- const defaultProps$8 = {
1303
- color: 'surface',
1304
- previousPathLabel: messages$5.back
1305
- };
1306
- const PageTopBar = props => {
1053
+ const _excluded$9 = ["color", "previousPathLabel"];
1054
+ const PageTopBar = _ref => {
1055
+ _ref.color;
1056
+ let _ref$previousPathLabe = _ref.previousPathLabel,
1057
+ previousPathLabel = _ref$previousPathLabe === void 0 ? messages$4.back : _ref$previousPathLabe,
1058
+ props = _objectWithoutProperties(_ref, _excluded$9);
1307
1059
  const intl = reactIntl.useIntl();
1308
1060
  return jsxRuntime.jsx("div", {
1309
1061
  css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;margin-bottom:", designSystem.designTokens.spacing40, ";background-color:", designSystem.designTokens.colorSurface, ";" + ("" ), "" ),
1310
1062
  children: jsxRuntime.jsx(FlatButton__default["default"], {
1311
1063
  tone: "primary",
1312
- label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
1064
+ label: typeof previousPathLabel === 'string' ? previousPathLabel : intl.formatMessage(previousPathLabel),
1313
1065
  icon: jsxRuntime.jsx(icons.ListIcon, {
1314
1066
  size: "medium",
1315
1067
  color: "primary"
@@ -1320,8 +1072,8 @@ const PageTopBar = props => {
1320
1072
  };
1321
1073
  PageTopBar.propTypes = {};
1322
1074
  PageTopBar.displayName = 'PageTopBar';
1323
- PageTopBar.defaultProps = defaultProps$8;
1324
1075
 
1076
+ const _excluded$8 = ["hideControls"];
1325
1077
  const DetailPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1326
1078
  target: "etkdonc1"
1327
1079
  } )("background-color:", designSystem.designTokens.colorSurface, ";padding:", designTokens.paddingForDetailPageHeader, ";border-bottom:1px ", designSystem.designTokens.colorNeutral90, " solid;" + ("" ));
@@ -1334,10 +1086,10 @@ const getCustomViewsSelectorMargin = hasContentBelow => `${designSystem.designTo
1334
1086
  // However, we need to explicitly define this otherwise the prop-types babel plugin
1335
1087
  // does not recognize the object shape.
1336
1088
 
1337
- const defaultProps$7 = {
1338
- hideControls: false
1339
- };
1340
- const CustomFormDetailPage = props => {
1089
+ const CustomFormDetailPage = _ref => {
1090
+ let _ref$hideControls = _ref.hideControls,
1091
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1092
+ props = _objectWithoutProperties(_ref, _excluded$8);
1341
1093
  return jsxRuntime.jsxs(PageWrapper, {
1342
1094
  children: [jsxRuntime.jsxs(DetailPageContainer, {
1343
1095
  children: [jsxRuntime.jsx(PageTopBar, {
@@ -1348,23 +1100,22 @@ const CustomFormDetailPage = props => {
1348
1100
  title: props.title ?? '',
1349
1101
  subtitle: props.subtitle,
1350
1102
  titleSize: "big"
1351
- }), jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1352
- margin: getCustomViewsSelectorMargin(!props.hideControls && !!props.formControls),
1103
+ }), jsxRuntime.jsx(CustomViewSelector, {
1104
+ margin: getCustomViewsSelectorMargin(!hideControls && !!props.formControls),
1353
1105
  customViewLocatorCode: props.customViewLocatorCode
1354
- }), !props.hideControls && props.formControls && jsxRuntime.jsx(HeaderControlsWrapper, {
1106
+ }), !hideControls && props.formControls && jsxRuntime.jsx(HeaderControlsWrapper, {
1355
1107
  children: jsxRuntime.jsx(Spacings__default["default"].Inline, {
1356
1108
  justifyContent: "flex-end",
1357
1109
  children: props.formControls
1358
1110
  })
1359
1111
  })]
1360
- }), jsxRuntime.jsx(ContentWrapper$1, {
1112
+ }), jsxRuntime.jsx(ContentWrapper$2, {
1361
1113
  children: props.children
1362
1114
  })]
1363
1115
  });
1364
1116
  };
1365
1117
  CustomFormDetailPage.propTypes = {};
1366
1118
  CustomFormDetailPage.displayName = 'CustomFormDetailPage';
1367
- CustomFormDetailPage.defaultProps = defaultProps$7;
1368
1119
  // Static export of pre-configured page header title component to easily
1369
1120
  // use as part of a custom title row
1370
1121
  CustomFormDetailPage.PageHeaderTitle = PageHeaderTitle;
@@ -1377,36 +1128,38 @@ CustomFormDetailPage.FormDeleteButton = FormDeleteButton;
1377
1128
  // The Intl messages can be used for button labels.
1378
1129
  CustomFormDetailPage.Intl = i18n.sharedMessages;
1379
1130
 
1380
- const defaultProps$6 = {
1381
- hideControls: false
1131
+ const _excluded$7 = ["hideControls"];
1132
+ const FormDetailPage = _ref => {
1133
+ let _ref$hideControls = _ref.hideControls,
1134
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1135
+ props = _objectWithoutProperties(_ref, _excluded$7);
1136
+ return jsxRuntime.jsx(CustomFormDetailPage, {
1137
+ title: props.title,
1138
+ subtitle: props.subtitle,
1139
+ customTitleRow: props.customTitleRow,
1140
+ customViewLocatorCode: props.customViewLocatorCode,
1141
+ previousPathLabel: props.previousPathLabel,
1142
+ onPreviousPathClick: props.onPreviousPathClick,
1143
+ hideControls: hideControls,
1144
+ formControls: jsxRuntime.jsxs(jsxRuntime.Fragment, {
1145
+ children: [jsxRuntime.jsx(CustomFormDetailPage.FormSecondaryButton, {
1146
+ label: props.labelSecondaryButton,
1147
+ onClick: props.onSecondaryButtonClick,
1148
+ isDisabled: props.isSecondaryButtonDisabled,
1149
+ dataAttributes: props.dataAttributesSecondaryButton,
1150
+ iconLeft: props.iconLeftSecondaryButton
1151
+ }), jsxRuntime.jsx(CustomFormDetailPage.FormPrimaryButton, {
1152
+ label: props.labelPrimaryButton,
1153
+ onClick: props.onPrimaryButtonClick,
1154
+ isDisabled: props.isPrimaryButtonDisabled,
1155
+ dataAttributes: props.dataAttributesPrimaryButton
1156
+ })]
1157
+ }),
1158
+ children: props.children
1159
+ });
1382
1160
  };
1383
- const FormDetailPage = props => jsxRuntime.jsx(CustomFormDetailPage, {
1384
- title: props.title,
1385
- subtitle: props.subtitle,
1386
- customTitleRow: props.customTitleRow,
1387
- customViewLocatorCode: props.customViewLocatorCode,
1388
- previousPathLabel: props.previousPathLabel,
1389
- onPreviousPathClick: props.onPreviousPathClick,
1390
- hideControls: props.hideControls,
1391
- formControls: jsxRuntime.jsxs(jsxRuntime.Fragment, {
1392
- children: [jsxRuntime.jsx(CustomFormDetailPage.FormSecondaryButton, {
1393
- label: props.labelSecondaryButton,
1394
- onClick: props.onSecondaryButtonClick,
1395
- isDisabled: props.isSecondaryButtonDisabled,
1396
- dataAttributes: props.dataAttributesSecondaryButton,
1397
- iconLeft: props.iconLeftSecondaryButton
1398
- }), jsxRuntime.jsx(CustomFormDetailPage.FormPrimaryButton, {
1399
- label: props.labelPrimaryButton,
1400
- onClick: props.onPrimaryButtonClick,
1401
- isDisabled: props.isPrimaryButtonDisabled,
1402
- dataAttributes: props.dataAttributesPrimaryButton
1403
- })]
1404
- }),
1405
- children: props.children
1406
- });
1407
1161
  FormDetailPage.propTypes = {};
1408
1162
  FormDetailPage.displayName = 'FormDetailPage';
1409
- FormDetailPage.defaultProps = defaultProps$6;
1410
1163
  // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1411
1164
  // The Intl messages can be used for button labels.
1412
1165
  // Static export of pre-configured page header title component to easily
@@ -1431,12 +1184,11 @@ InfoDetailPage.displayName = 'InfoDetailPage';
1431
1184
  // use as part of a custom title row
1432
1185
  InfoDetailPage.PageHeaderTitle = PageHeaderTitle;
1433
1186
 
1434
- const defaultProps$5 = {
1435
- hideControls: false
1436
- };
1437
- const TabularDetailPage = props => {
1438
- const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
1439
- currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
1187
+ const _excluded$6 = ["hideControls"];
1188
+ const TabularDetailPage = _ref => {
1189
+ let _ref$hideControls = _ref.hideControls,
1190
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1191
+ props = _objectWithoutProperties(_ref, _excluded$6);
1440
1192
  return jsxRuntime.jsxs(PageWrapper, {
1441
1193
  children: [jsxRuntime.jsxs(TabularPageContainer, {
1442
1194
  children: [jsxRuntime.jsx(PageTopBar, {
@@ -1450,25 +1202,24 @@ const TabularDetailPage = props => {
1450
1202
  }), jsxRuntime.jsx(ControlsContainter, {
1451
1203
  tabControls: props.tabControls,
1452
1204
  formControls: jsxRuntime.jsx(FormControlsContainer, {
1453
- children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1205
+ children: !hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1454
1206
  alignItems: "flex-end",
1455
1207
  children: props.formControls
1456
1208
  })
1457
1209
  })
1458
1210
  })]
1459
1211
  }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1460
- children: jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1212
+ children: jsxRuntime.jsx(CustomViewSelector, {
1461
1213
  margin: `${designSystem.designTokens.spacing30} 0 0 0`,
1462
- customViewLocatorCode: currentCustomViewLocatorCode
1214
+ customViewLocatorCodes: props.customViewLocatorCodes
1463
1215
  })
1464
- }), jsxRuntime.jsx(ContentWrapper$1, {
1216
+ }), jsxRuntime.jsx(ContentWrapper$2, {
1465
1217
  children: props.children
1466
1218
  })]
1467
1219
  });
1468
1220
  };
1469
1221
  TabularDetailPage.propTypes = {};
1470
1222
  TabularDetailPage.displayName = 'TabularDetailPage';
1471
- TabularDetailPage.defaultProps = defaultProps$5;
1472
1223
  // Static export of pre-configured form control buttons to easily re-use
1473
1224
  // them in the custom controls.
1474
1225
  TabularDetailPage.FormPrimaryButton = FormPrimaryButton;
@@ -1480,7 +1231,7 @@ TabularDetailPage.PageHeaderTitle = PageHeaderTitle;
1480
1231
  // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1481
1232
  TabularDetailPage.Intl = i18n.sharedMessages;
1482
1233
 
1483
- const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-d365f38f.cjs.prod.js' /* webpackChunkName: "public-page-layout" */); }));
1234
+ const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-2326dd98.cjs.prod.js' /* webpackChunkName: "public-page-layout" */); }));
1484
1235
 
1485
1236
  const MainPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1486
1237
  target: "ev8m2jf2"
@@ -1494,24 +1245,30 @@ const MainPageContent = /*#__PURE__*/_styled__default["default"]("div", {
1494
1245
  target: "ev8m2jf0"
1495
1246
  } )("flex:1;flex-basis:0;overflow:auto;margin:", designTokens.marginForPageContent, ";" + ("" ));
1496
1247
 
1248
+ const _excluded$5 = ["hideControls", "hideDivider"];
1497
1249
  const headerRowMargin = `${designSystem.designTokens.spacing40} 0 0 0`;
1498
- const CustomFormMainPage = props => {
1250
+ const CustomFormMainPage = _ref => {
1251
+ let _ref$hideControls = _ref.hideControls,
1252
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1253
+ _ref$hideDivider = _ref.hideDivider,
1254
+ hideDivider = _ref$hideDivider === void 0 ? false : _ref$hideDivider,
1255
+ props = _objectWithoutProperties(_ref, _excluded$5);
1499
1256
  return jsxRuntime.jsxs(PageWrapper, {
1500
1257
  children: [jsxRuntime.jsxs(MainPageContainer, {
1501
1258
  children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1502
1259
  title: props.title ?? '',
1503
1260
  subtitle: props.subtitle,
1504
1261
  titleSize: "big"
1505
- }), jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1262
+ }), jsxRuntime.jsx(CustomViewSelector, {
1506
1263
  margin: headerRowMargin,
1507
1264
  customViewLocatorCode: props.customViewLocatorCode
1508
- }), !props.hideControls && props.formControls && jsxRuntime.jsx("div", {
1265
+ }), !hideControls && props.formControls && jsxRuntime.jsx("div", {
1509
1266
  css: /*#__PURE__*/react.css("margin:", headerRowMargin, ";" + ("" ), "" ),
1510
1267
  children: jsxRuntime.jsx(Spacings__default["default"].Inline, {
1511
1268
  justifyContent: "flex-end",
1512
1269
  children: props.formControls
1513
1270
  })
1514
- }), !props.hideDivider && jsxRuntime.jsx("div", {
1271
+ }), !hideDivider && jsxRuntime.jsx("div", {
1515
1272
  css: /*#__PURE__*/react.css("&>", Divider, "{margin:", headerRowMargin, ";}" + ("" ), "" ),
1516
1273
  children: jsxRuntime.jsx(Divider, {})
1517
1274
  })]
@@ -1521,12 +1278,7 @@ const CustomFormMainPage = props => {
1521
1278
  });
1522
1279
  };
1523
1280
  CustomFormMainPage.propTypes = {};
1524
- const defaultProps$4 = {
1525
- hideControls: false,
1526
- hideDivider: false
1527
- };
1528
1281
  CustomFormMainPage.displayName = 'CustomFormMainPage';
1529
- CustomFormMainPage.defaultProps = defaultProps$4;
1530
1282
 
1531
1283
  // Static export of pre-configured page header title component to easily
1532
1284
  // use as part of a custom title row
@@ -1542,16 +1294,17 @@ CustomFormMainPage.FormDeleteButton = FormDeleteButton;
1542
1294
  // The Intl messages can be used for button labels.
1543
1295
  CustomFormMainPage.Intl = i18n.sharedMessages;
1544
1296
 
1545
- const defaultProps$3 = {
1546
- hideControls: false
1547
- };
1548
- const FormMainPage = props => {
1297
+ const _excluded$4 = ["hideControls"];
1298
+ const FormMainPage = _ref => {
1299
+ let _ref$hideControls = _ref.hideControls,
1300
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1301
+ props = _objectWithoutProperties(_ref, _excluded$4);
1549
1302
  return jsxRuntime.jsx(CustomFormMainPage, {
1550
1303
  title: props.title,
1551
1304
  subtitle: props.subtitle,
1552
1305
  customTitleRow: props.customTitleRow,
1553
1306
  customViewLocatorCode: props.customViewLocatorCode,
1554
- hideControls: props.hideControls,
1307
+ hideControls: hideControls,
1555
1308
  formControls: jsxRuntime.jsxs(jsxRuntime.Fragment, {
1556
1309
  children: [jsxRuntime.jsx(CustomFormMainPage.FormSecondaryButton, {
1557
1310
  label: props.labelSecondaryButton,
@@ -1571,7 +1324,6 @@ const FormMainPage = props => {
1571
1324
  };
1572
1325
  FormMainPage.propTypes = {};
1573
1326
  FormMainPage.displayName = 'FormMainPage';
1574
- FormMainPage.defaultProps = defaultProps$3;
1575
1327
 
1576
1328
  // Static export of pre-configured page header title component to easily
1577
1329
  // use as part of a custom title row
@@ -1597,12 +1349,11 @@ InfoMainPage.displayName = 'InfoMainPage';
1597
1349
  // use as part of a custom title row
1598
1350
  InfoMainPage.PageHeaderTitle = PageHeaderTitle;
1599
1351
 
1600
- const defaultProps$2 = {
1601
- hideControls: false
1602
- };
1603
- const TabularMainPage = props => {
1604
- const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
1605
- currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
1352
+ const _excluded$3 = ["hideControls"];
1353
+ const TabularMainPage = _ref => {
1354
+ let _ref$hideControls = _ref.hideControls,
1355
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1356
+ props = _objectWithoutProperties(_ref, _excluded$3);
1606
1357
  return jsxRuntime.jsxs(PageWrapper, {
1607
1358
  children: [jsxRuntime.jsxs(TabularPageContainer, {
1608
1359
  children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
@@ -1612,18 +1363,18 @@ const TabularMainPage = props => {
1612
1363
  }), jsxRuntime.jsx(ControlsContainter, {
1613
1364
  tabControls: props.tabControls,
1614
1365
  formControls: jsxRuntime.jsx(FormControlsContainer, {
1615
- children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1366
+ children: !hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1616
1367
  alignItems: "flex-end",
1617
1368
  children: props.formControls
1618
1369
  })
1619
1370
  })
1620
1371
  })]
1621
1372
  }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1622
- children: jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1373
+ children: jsxRuntime.jsx(CustomViewSelector, {
1623
1374
  margin: `${designSystem.designTokens.spacing30} 0 0 0`,
1624
- customViewLocatorCode: currentCustomViewLocatorCode
1375
+ customViewLocatorCodes: props.customViewLocatorCodes
1625
1376
  })
1626
- }), jsxRuntime.jsx(ContentWrapper$1, {
1377
+ }), jsxRuntime.jsx(ContentWrapper$2, {
1627
1378
  css: /*#__PURE__*/react.css("background-color:", designSystem.designTokens.colorSurface, ";" + ("" ), "" ),
1628
1379
  children: props.children
1629
1380
  })]
@@ -1631,7 +1382,6 @@ const TabularMainPage = props => {
1631
1382
  };
1632
1383
  TabularMainPage.propTypes = {};
1633
1384
  TabularMainPage.displayName = 'TabularMainPage';
1634
- TabularMainPage.defaultProps = defaultProps$2;
1635
1385
  // Static export of pre-configured form control buttons to easily re-use
1636
1386
  // them in the custom controls.
1637
1387
  TabularMainPage.FormPrimaryButton = FormPrimaryButton;
@@ -1682,14 +1432,14 @@ const MaintenancePageLayout = props => jsxRuntime.jsx("div", {
1682
1432
  MaintenancePageLayout.propTypes = {};
1683
1433
  MaintenancePageLayout.displayName = 'MaintenancePageLayout';
1684
1434
 
1685
- var messages$2 = reactIntl.defineMessages({
1435
+ var messages$3 = reactIntl.defineMessages({
1686
1436
  title: {
1687
- id: 'PageNotFound.title',
1688
- defaultMessage: 'We could not find what you are looking for'
1437
+ id: "PageNotFound.title",
1438
+ defaultMessage: "We could not find what you are looking for"
1689
1439
  },
1690
1440
  paragraph1: {
1691
- id: 'PageNotFound.paragraph1',
1692
- defaultMessage: 'The item you are looking for may have been deleted, does not exist, or the URL was entered incorrectly. Check the URL and try again.\n\nPlease contact your system administrator or the commercetools <a>Help Desk</a> if you have any further questions.'
1441
+ id: "PageNotFound.paragraph1",
1442
+ defaultMessage: "The item you are looking for may have been deleted, does not exist, or the URL was entered incorrectly. Check the URL and try again. Please contact your system administrator or the commercetools <a>Help Desk</a> if you have any further questions."
1693
1443
  }
1694
1444
  });
1695
1445
 
@@ -1705,9 +1455,9 @@ const PageNotFound = () => {
1705
1455
  const intl = reactIntl.useIntl();
1706
1456
  return jsxRuntime.jsx(MaintenancePageLayout, {
1707
1457
  imageSrc: PageNotFoundSVG__default["default"],
1708
- title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages$2.title)),
1709
- label: intl.formatMessage(messages$2.title),
1710
- paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2(_objectSpread$2({}, messages$2.paragraph1), {}, {
1458
+ title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages$3.title)),
1459
+ label: intl.formatMessage(messages$3.title),
1460
+ paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2(_objectSpread$2({}, messages$3.paragraph1), {}, {
1711
1461
  values: {
1712
1462
  a: getLink
1713
1463
  }
@@ -1716,18 +1466,18 @@ const PageNotFound = () => {
1716
1466
  };
1717
1467
  PageNotFound.displayName = 'PageNotFound';
1718
1468
 
1719
- var messages$1 = reactIntl.defineMessages({
1469
+ var messages$2 = reactIntl.defineMessages({
1720
1470
  title: {
1721
- id: 'PageUnauthorized.title',
1722
- defaultMessage: 'We could not find what you are looking for'
1471
+ id: "PageUnauthorized.title",
1472
+ defaultMessage: "We could not find what you are looking for"
1723
1473
  },
1724
1474
  paragraph1: {
1725
- id: 'PageUnauthorized.paragraph1',
1726
- defaultMessage: 'The Module you are looking for either does not exist for this Project or you are not authorized to view it.'
1475
+ id: "PageUnauthorized.paragraph1",
1476
+ defaultMessage: "The Module you are looking for either does not exist for this Project or you are not authorized to view it."
1727
1477
  },
1728
1478
  paragraph2: {
1729
- id: 'PageUnauthorized.paragraph2',
1730
- defaultMessage: 'Please contact your system administrator or the commercetools <a>Help Desk</a> if you have any further questions.'
1479
+ id: "PageUnauthorized.paragraph2",
1480
+ defaultMessage: "Please contact your system administrator or the commercetools <a>Help Desk</a> if you have any further questions."
1731
1481
  }
1732
1482
  });
1733
1483
 
@@ -1743,10 +1493,10 @@ const PageUnauthorized = () => {
1743
1493
  const intl = reactIntl.useIntl();
1744
1494
  return jsxRuntime.jsx(MaintenancePageLayout, {
1745
1495
  imageSrc: FailedAuthorizationSVG__default["default"],
1746
- title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages$1.title)),
1747
- label: intl.formatMessage(messages$1.title),
1748
- paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages$1.paragraph1)),
1749
- paragraph2: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1(_objectSpread$1({}, messages$1.paragraph2), {}, {
1496
+ title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages$2.title)),
1497
+ label: intl.formatMessage(messages$2.title),
1498
+ paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages$2.paragraph1)),
1499
+ paragraph2: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1(_objectSpread$1({}, messages$2.paragraph2), {}, {
1750
1500
  values: {
1751
1501
  a: getSupportUrlLink
1752
1502
  }
@@ -1776,6 +1526,7 @@ function PageContentNarrow(props) {
1776
1526
  }
1777
1527
  PageContentNarrow.propTypes = {};
1778
1528
 
1529
+ const _excluded$2 = ["columns", "gapSize"];
1779
1530
  const Content = /*#__PURE__*/_styled__default["default"]("section", {
1780
1531
  target: "e1dg479f4"
1781
1532
  } )("grid-area:content;display:grid;grid-template-areas:", props => props.columns === '1' ? 'none' : '"left-column right-column"', ";grid-template-columns:", props => {
@@ -1819,28 +1570,33 @@ const Container = /*#__PURE__*/_styled__default["default"]("div", {
1819
1570
  name: "5phl7w",
1820
1571
  styles: "display:grid;grid-template-areas:'. content .';grid-template-columns:1fr minmax(800px, 1200px) 1fr;width:100%"
1821
1572
  } );
1822
- function PageContentWide(props) {
1573
+ function PageContentWide(_ref) {
1574
+ let _ref$columns = _ref.columns,
1575
+ columns = _ref$columns === void 0 ? '1' : _ref$columns,
1576
+ _ref$gapSize = _ref.gapSize,
1577
+ gapSize = _ref$gapSize === void 0 ? '20' : _ref$gapSize,
1578
+ props = _objectWithoutProperties(_ref, _excluded$2);
1823
1579
  const _Children$toArray = react$1.Children.toArray(props.children),
1824
1580
  _Children$toArray2 = _slicedToArray(_Children$toArray, 2),
1825
1581
  leftChild = _Children$toArray2[0],
1826
1582
  rightChild = _Children$toArray2[1];
1827
1583
  const childrenCount = react$1.Children.count(props.children);
1828
- const isOneColumnAndMoreThanOneChild = props.columns === '1' && childrenCount > 1;
1829
- const isTwoColumnsAndMoreThanTwoChildren = props.columns !== '1' && childrenCount > 2;
1584
+ const isOneColumnAndMoreThanOneChild = columns === '1' && childrenCount > 1;
1585
+ const isTwoColumnsAndMoreThanTwoChildren = columns !== '1' && childrenCount > 2;
1830
1586
  utils.useWarning(!isOneColumnAndMoreThanOneChild, 'PageContentWide: This component only renders its first children when using a single column but you provided more than one.');
1831
1587
  utils.useWarning(!isTwoColumnsAndMoreThanTwoChildren, 'PageContentWide: This component only renders its first two children when using a two columns layout but you provided more than two.');
1832
1588
  return jsxRuntime.jsx(Container, {
1833
1589
  children: jsxRuntime.jsx(Content, {
1834
- columns: props.columns,
1835
- gapSize: props.gapSize,
1836
- children: props.columns === '1' ? jsxRuntime.jsx(jsxRuntime.Fragment, {
1590
+ columns: columns,
1591
+ gapSize: gapSize,
1592
+ children: columns === '1' ? jsxRuntime.jsx(jsxRuntime.Fragment, {
1837
1593
  children: leftChild
1838
1594
  }) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
1839
1595
  children: [jsxRuntime.jsx(LeftContentColumn, {
1840
1596
  children: leftChild
1841
1597
  }), jsxRuntime.jsx(RightContentColumn, {
1842
1598
  children: jsxRuntime.jsx(RightColumnContentWrapper, {
1843
- columns: props.columns,
1599
+ columns: columns,
1844
1600
  children: rightChild
1845
1601
  })
1846
1602
  })]
@@ -1849,11 +1605,6 @@ function PageContentWide(props) {
1849
1605
  });
1850
1606
  }
1851
1607
  PageContentWide.propTypes = {};
1852
- const defaultProps$1 = {
1853
- columns: '1',
1854
- gapSize: '20'
1855
- };
1856
- PageContentWide.defaultProps = defaultProps$1;
1857
1608
 
1858
1609
  var _ref$2 = {
1859
1610
  name: "1d3w5wq",
@@ -1869,26 +1620,30 @@ function PageContentFull(props) {
1869
1620
  }
1870
1621
  PageContentFull.propTypes = {};
1871
1622
 
1872
- const defaultProps = {
1873
- size: 10,
1874
- hideControls: false,
1875
- onPrimaryButtonClick: () => {},
1876
- onSecondaryButtonClick: () => {}
1877
- };
1878
- const ContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1623
+ const _excluded$1 = ["size", "hideControls", "onPrimaryButtonClick", "onSecondaryButtonClick"];
1624
+ const ContentWrapper$1 = /*#__PURE__*/_styled__default["default"]("div", {
1879
1625
  target: "e18jo6y41"
1880
1626
  } )("flex:1;flex-basis:0;margin:", designTokens.marginForPageContent, ";overflow:auto;" + ("" ));
1881
1627
  const HeaderWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1882
1628
  target: "e18jo6y40"
1883
1629
  } )("padding:", designSystem.designTokens.spacing40, " 40px;border-bottom:1px solid ", designSystem.designTokens.colorNeutral90, ";" + ("" ));
1884
- function Drawer(props) {
1630
+ function Drawer(_ref) {
1631
+ let _ref$size = _ref.size,
1632
+ size = _ref$size === void 0 ? 10 : _ref$size,
1633
+ _ref$hideControls = _ref.hideControls,
1634
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
1635
+ _ref$onPrimaryButtonC = _ref.onPrimaryButtonClick,
1636
+ onPrimaryButtonClick = _ref$onPrimaryButtonC === void 0 ? () => {} : _ref$onPrimaryButtonC,
1637
+ _ref$onSecondaryButto = _ref.onSecondaryButtonClick,
1638
+ onSecondaryButtonClick = _ref$onSecondaryButto === void 0 ? () => {} : _ref$onSecondaryButto,
1639
+ props = _objectWithoutProperties(_ref, _excluded$1);
1885
1640
  const intl = reactIntl.useIntl();
1886
1641
  return jsxRuntime.jsxs(ModalPage, {
1887
1642
  isOpen: props.isOpen,
1888
1643
  hidePathLabel: true,
1889
1644
  hideTopBar: true,
1890
1645
  onClose: props.onClose,
1891
- size: props.size,
1646
+ size: size,
1892
1647
  title: props.title,
1893
1648
  afterOpenStyles: props.afterOpenStyles,
1894
1649
  getParentSelector: props.getParentSelector,
@@ -1906,7 +1661,7 @@ function Drawer(props) {
1906
1661
  children: props.subtitle
1907
1662
  })
1908
1663
  }), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
1909
- label: intl.formatMessage(messages$5.close),
1664
+ label: intl.formatMessage(messages$4.close),
1910
1665
  onClick: props.onClose,
1911
1666
  icon: jsxRuntime.jsx(LargeIconWrapper, {
1912
1667
  children: jsxRuntime.jsx(icons.CloseIcon, {})
@@ -1915,30 +1670,29 @@ function Drawer(props) {
1915
1670
  })]
1916
1671
  }), jsxRuntime.jsxs(Spacings__default["default"].Inline, {
1917
1672
  justifyContent: "flex-end",
1918
- children: [!props.hideControls && props.formControls && props.formControls, !props.hideControls && !props.formControls && jsxRuntime.jsxs(jsxRuntime.Fragment, {
1673
+ children: [!hideControls && props.formControls && props.formControls, !hideControls && !props.formControls && jsxRuntime.jsxs(jsxRuntime.Fragment, {
1919
1674
  children: [jsxRuntime.jsx(FormSecondaryButton, {
1920
1675
  label: props.labelSecondaryButton,
1921
- onClick: props.onSecondaryButtonClick,
1676
+ onClick: onSecondaryButtonClick,
1922
1677
  isDisabled: props.isSecondaryButtonDisabled,
1923
1678
  dataAttributes: props.dataAttributesSecondaryButton,
1924
1679
  iconLeft: props.iconLeftSecondaryButton
1925
1680
  }), jsxRuntime.jsx(FormPrimaryButton, {
1926
1681
  label: props.labelPrimaryButton,
1927
- onClick: props.onPrimaryButtonClick,
1682
+ onClick: onPrimaryButtonClick,
1928
1683
  isDisabled: props.isPrimaryButtonDisabled,
1929
1684
  dataAttributes: props.dataAttributesPrimaryButton
1930
1685
  })]
1931
1686
  })]
1932
1687
  })]
1933
1688
  })
1934
- }), jsxRuntime.jsx(ContentWrapper, {
1689
+ }), jsxRuntime.jsx(ContentWrapper$1, {
1935
1690
  children: props.children
1936
1691
  })]
1937
1692
  });
1938
1693
  }
1939
1694
  Drawer.propTypes = {};
1940
1695
  Drawer.displayName = 'Drawer';
1941
- Drawer.defaultProps = defaultProps;
1942
1696
  // Static export of pre-configured form control buttons to easily re-use
1943
1697
  // them in the custom controls.
1944
1698
  Drawer.FormPrimaryButton = FormPrimaryButton;
@@ -1947,22 +1701,142 @@ Drawer.FormSecondaryButton = FormSecondaryButton;
1947
1701
  // The Intl messages can be used for button labels.
1948
1702
  Drawer.Intl = i18n.sharedMessages;
1949
1703
 
1704
+ const messages$1 = reactIntl.defineMessages({
1705
+ loadError: {
1706
+ id: "CustomViewLoader.error.load",
1707
+ defaultMessage: "We could not load the Custom View. Please contact your administrator to check its configuration."
1708
+ }
1709
+ });
1710
+
1711
+ const isIframeReady = iFrameElementRef => {
1712
+ try {
1713
+ return iFrameElementRef?.contentWindow?.document.readyState === 'complete';
1714
+ } catch {
1715
+ // Trying to access the contentWindow of a cross-origin iFrame will throw an error.
1716
+ // We are not supposed to even get here because the iFrame must use
1717
+ // a URL from our very same domain (the custom view is proxied through our http-proxy service).
1718
+ return false;
1719
+ }
1720
+ };
1721
+ const ContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1722
+ target: "ewwxuwo1"
1723
+ } )({
1724
+ name: "13udsys",
1725
+ styles: "height:100%"
1726
+ } );
1727
+ const CustomPanelIframe = /*#__PURE__*/_styled__default["default"]("iframe", {
1728
+ target: "ewwxuwo0"
1729
+ } )({
1730
+ name: "174lt7a",
1731
+ styles: "height:100%;width:100%;border:none"
1732
+ } );
1733
+ function CustomViewLoader(props) {
1734
+ const iFrameElementRef = react$1.useRef(null);
1735
+ const dataLocale = applicationShellConnectors.useApplicationContext(context => context.dataLocale);
1736
+ const projectKey = applicationShellConnectors.useApplicationContext(context => context.project?.key);
1737
+ const featureFlags = reactBroadcast.useAllFeatureToggles();
1738
+ const iFrameCommunicationChannel = react$1.useRef(new MessageChannel());
1739
+ const showNotification = actionsGlobal.useShowNotification();
1740
+ const intl = reactIntl.useIntl();
1741
+ const messageFromIFrameHandler = react$1.useCallback(event => {
1742
+ if (event.data.origin === window.location.origin) {
1743
+ switch (event.data.eventName) {
1744
+ case constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE:
1745
+ props.onClose();
1746
+ break;
1747
+ }
1748
+ }
1749
+ }, [props]);
1750
+
1751
+ // onLoad handler is called from the iFrame even where the URL is not valid
1752
+ // (blocked by CORS, 404, etc.) so we need to make sure the iFrame is ready
1753
+ const onLoadSuccessHandler = react$1.useCallback(() => {
1754
+ // Show error and block if the iFrame is not ready
1755
+ // (error loading it)
1756
+ if (!isIframeReady(iFrameElementRef.current)) {
1757
+ showNotification({
1758
+ domain: constants.DOMAINS.PAGE,
1759
+ kind: constants.NOTIFICATION_KINDS_PAGE.error,
1760
+ text: intl.formatMessage(messages$1.loadError)
1761
+ });
1762
+ return;
1763
+ }
1764
+
1765
+ // Listen for messages from the iFrame
1766
+ iFrameCommunicationChannel.current.port1.onmessage = messageFromIFrameHandler;
1767
+
1768
+ // Transfer port2 to the iFrame so it can send messages back privately
1769
+ iFrameElementRef.current?.contentWindow?.postMessage(constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_BOOTSTRAP, window.location.href, [iFrameCommunicationChannel.current.port2]);
1770
+
1771
+ // Send the initialization message to the iFrame
1772
+ iFrameCommunicationChannel.current.port1.postMessage({
1773
+ source: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
1774
+ destination: `${constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX}${props.customView.id}`,
1775
+ eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION,
1776
+ eventData: {
1777
+ context: {
1778
+ dataLocale,
1779
+ projectKey,
1780
+ featureFlags,
1781
+ customViewConfig: props.customView,
1782
+ hostUrl: props.hostUrl || window.location.href
1783
+ }
1784
+ }
1785
+ });
1786
+
1787
+ // We want the effect to run only once so we don't need the dependencies array.
1788
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1789
+ }, []);
1790
+ react$1.useEffect(() => {
1791
+ // Close the channel when the component unmounts
1792
+ const communicationChannel = iFrameCommunicationChannel.current;
1793
+ return () => {
1794
+ communicationChannel?.port1.close();
1795
+ };
1796
+ }, []);
1797
+
1798
+ // Currently we only support custom panels
1799
+ if (props.customView.type !== 'CustomPanel') {
1800
+ sentry.reportErrorToSentry(new Error(`CustomViewLoader: Provided Custom View has an unsupported type: ${props.customView.type}. Supported types: ['CustomPanel'].`));
1801
+ return null;
1802
+ }
1803
+ const panelSize = props.customView.typeSettings?.size?.toLocaleLowerCase() || 'large';
1804
+ const iFrameUrl = [window.location.origin, 'custom-views', props.customView.id, 'projects', projectKey].join('/');
1805
+ return jsxRuntime.jsx(ModalPage, {
1806
+ isOpen: true,
1807
+ onClose: props.onClose,
1808
+ size: panelSize === 'small' ? 10 : 30,
1809
+ title: `Custom View: ${props.customView.defaultLabel}`,
1810
+ hideTopBar: true,
1811
+ children: jsxRuntime.jsx(ContentWrapper, {
1812
+ children: jsxRuntime.jsx(CustomPanelIframe, {
1813
+ id: `custom-view-${props.customView.id}`,
1814
+ title: `Custom View: ${props.customView.defaultLabel}`,
1815
+ ref: iFrameElementRef,
1816
+ src: iFrameUrl,
1817
+ onLoad: onLoadSuccessHandler
1818
+ }, `custom-view-${props.customView.id}`)
1819
+ })
1820
+ });
1821
+ }
1822
+ CustomViewLoader.propTypes = {};
1823
+
1950
1824
  var messages = reactIntl.defineMessages({
1951
1825
  ProjectProduction: {
1952
- id: 'ProjectStamp.production',
1953
- defaultMessage: 'Production'
1826
+ id: "ProjectStamp.production",
1827
+ defaultMessage: "Production"
1954
1828
  },
1955
1829
  ProjectSuspended: {
1956
- id: 'ProjectStamp.suspended',
1957
- defaultMessage: 'Suspended'
1830
+ id: "ProjectStamp.suspended",
1831
+ defaultMessage: "Suspended"
1958
1832
  },
1959
1833
  ProjectExpired: {
1960
- id: 'ProjectStamp.expired',
1961
- defaultMessage: 'Trial expired'
1834
+ id: "ProjectStamp.expired",
1835
+ defaultMessage: "Trial expired"
1962
1836
  },
1963
1837
  ProjectWillExpire: {
1964
- id: 'ProjectStamp.willExpire',
1965
- defaultMessage: '{daysLeft, select, 0 {Trial ends today} 1 {Trial ends in 1 day} other {Trial ends in {daysLeft} days}}'
1838
+ id: "ProjectStamp.willExpire",
1839
+ defaultMessage: "{daysLeft, select, 0 {Trial ends today} 1 {Trial ends in 1 day} other {Trial ends in {daysLeft} days}}"
1966
1840
  }
1967
1841
  });
1968
1842
 
@@ -2138,7 +2012,7 @@ exports.CustomFormDetailPage = CustomFormDetailPage;
2138
2012
  exports.CustomFormMainPage = CustomFormMainPage;
2139
2013
  exports.CustomFormModalPage = CustomFormModalPage;
2140
2014
  exports.CustomViewLoader = CustomViewLoader;
2141
- exports.CustomViewsSelector = CustomViewSelectorOrNothing;
2015
+ exports.CustomViewsSelector = CustomViewSelector;
2142
2016
  exports.Drawer = Drawer;
2143
2017
  exports.FormDetailPage = FormDetailPage;
2144
2018
  exports.FormDialog = FormDialog;