@commercetools-frontend/application-components 22.7.0 → 22.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-application-components.cjs.dev.js +61 -176
- package/dist/commercetools-frontend-application-components.cjs.prod.js +31 -134
- package/dist/commercetools-frontend-application-components.esm.js +63 -177
- package/dist/declarations/src/index.d.ts +0 -1
- package/dist/{public-page-layout-610f2030.cjs.dev.js → public-page-layout-0589726b.cjs.dev.js} +2 -5
- package/dist/{public-page-layout-ee5b2b05.cjs.prod.js → public-page-layout-59fc6ad5.cjs.prod.js} +2 -5
- package/dist/{public-page-layout-322be92c.esm.js → public-page-layout-b0c4ba67.esm.js} +2 -5
- package/package.json +30 -31
- package/dist/declarations/src/components/custom-views/custom-view-loader/custom-view-loader.d.ts +0 -7
- package/dist/declarations/src/components/custom-views/custom-view-loader/index.d.ts +0 -1
- package/dist/declarations/src/components/custom-views/custom-view-loader/messages.d.ts +0 -7
- package/dist/declarations/src/types/generated/settings.d.ts +0 -1562
|
@@ -40,9 +40,6 @@ var IconButton = require('@commercetools-uikit/icon-button');
|
|
|
40
40
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
41
41
|
var PageNotFoundSVG = require('@commercetools-frontend/assets/images/page-not-found.svg');
|
|
42
42
|
var FailedAuthorizationSVG = require('@commercetools-frontend/assets/images/doors-closed.svg');
|
|
43
|
-
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
44
|
-
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
45
|
-
var sentry = require('@commercetools-frontend/sentry');
|
|
46
43
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
47
44
|
var useResizeObserver = require('@react-hook/resize-observer');
|
|
48
45
|
var hooks = require('@commercetools-uikit/hooks');
|
|
@@ -78,7 +75,7 @@ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstancePro
|
|
|
78
75
|
var useResizeObserver__default = /*#__PURE__*/_interopDefault(useResizeObserver);
|
|
79
76
|
|
|
80
77
|
// NOTE: This string will be replaced on build time with the package version.
|
|
81
|
-
var version = "22.
|
|
78
|
+
var version = "22.8.0";
|
|
82
79
|
|
|
83
80
|
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9;
|
|
84
81
|
const appKitSpacing55 = '40px';
|
|
@@ -148,8 +145,8 @@ var _ref$7 = {
|
|
|
148
145
|
} ;
|
|
149
146
|
const getLinkStyles = (isActive, isDisabled) => [/*#__PURE__*/react.css("font-size:", designSystem.designTokens.fontSizeDefault, ";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:", designTokens.paddingLeftForTabAsFirst, ";}", getBottomBorderStyles('transparent'), ";" + ("" ), "" ), isActive && /*#__PURE__*/react.css(getBottomBorderStyles(designSystem.designTokens.colorPrimary), " & h4{color:", designSystem.designTokens.colorPrimary, "!important;}" + ("" ), "" ), isDisabled && _ref$7, !isActive && !isDisabled && /*#__PURE__*/react.css(":hover,:focus,:active{& h4{color:", designSystem.designTokens.colorPrimary, "!important;}}" + ("" ), "" )];
|
|
150
147
|
|
|
151
|
-
function ownKeys$6(
|
|
152
|
-
function _objectSpread$6(
|
|
148
|
+
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; }
|
|
149
|
+
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; }
|
|
153
150
|
const pathWithoutSearch = path => typeof path === 'string' ? path.split('?')[0] : path.pathname;
|
|
154
151
|
const warnIfMissingContent = props => {
|
|
155
152
|
Boolean(props.intlMessage) || Boolean(props.label);
|
|
@@ -240,8 +237,8 @@ const getModalContentStyles = props => {
|
|
|
240
237
|
const getOverlayStyles$1 = props => /*#__PURE__*/react.css("display:flex;position:absolute;z-index:", typeof props.zIndex === 'number' ? // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
|
|
241
238
|
"".concat(props.zIndex, " !important") : 'auto', ";top:0;width:100%;height:100%;background-color:rgba(32, 62, 72, 0.5);opacity:1;" + ("" ), "" );
|
|
242
239
|
|
|
243
|
-
function ownKeys$5(
|
|
244
|
-
function _objectSpread$5(
|
|
240
|
+
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; }
|
|
241
|
+
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; }
|
|
245
242
|
const getDefaultParentSelector$1 = () => document.querySelector("#".concat(constants.PORTALS_CONTAINER_ID));
|
|
246
243
|
const getOverlayElement$1 = (props, contentElement) =>
|
|
247
244
|
// Assign the `data-role` to the overlay container, which is used as
|
|
@@ -374,8 +371,8 @@ function filterDataAttributes(obj) {
|
|
|
374
371
|
return omitBy__default["default"](obj, (_value, key) => !_startsWithInstanceProperty__default["default"](key).call(key, 'data-'));
|
|
375
372
|
}
|
|
376
373
|
|
|
377
|
-
function ownKeys$4(
|
|
378
|
-
function _objectSpread$4(
|
|
374
|
+
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; }
|
|
375
|
+
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; }
|
|
379
376
|
const defaultProps$g = {
|
|
380
377
|
isPrimaryButtonDisabled: false,
|
|
381
378
|
dataAttributesPrimaryButton: {},
|
|
@@ -563,7 +560,7 @@ const PageWrapper = /*#__PURE__*/_styled__default["default"]("div", {
|
|
|
563
560
|
styles: "height:100%;display:flex;flex-direction:column"
|
|
564
561
|
} );
|
|
565
562
|
|
|
566
|
-
const messages$
|
|
563
|
+
const messages$2 = reactIntl.defineMessages({
|
|
567
564
|
back: {
|
|
568
565
|
id: 'Components.ModalPage.TopBar.Back',
|
|
569
566
|
defaultMessage: 'Go Back'
|
|
@@ -592,7 +589,7 @@ const LargeIconWrapper = props => jsxRuntime.jsx("span", {
|
|
|
592
589
|
LargeIconWrapper.propTypes = {};
|
|
593
590
|
const defaultProps$c = {
|
|
594
591
|
color: 'surface',
|
|
595
|
-
previousPathLabel: messages$
|
|
592
|
+
previousPathLabel: messages$2.back,
|
|
596
593
|
hidePathLabel: false
|
|
597
594
|
};
|
|
598
595
|
var _ref$4 = {
|
|
@@ -625,7 +622,7 @@ const ModalPageTopBar = props => {
|
|
|
625
622
|
})]
|
|
626
623
|
})]
|
|
627
624
|
}), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
628
|
-
label: intl.formatMessage(messages$
|
|
625
|
+
label: intl.formatMessage(messages$2.close),
|
|
629
626
|
onClick: props.onClose,
|
|
630
627
|
icon: jsxRuntime.jsx(LargeIconWrapper, {
|
|
631
628
|
children: jsxRuntime.jsx(icons.CloseIcon, {})
|
|
@@ -663,8 +660,8 @@ var _ref$3 = {
|
|
|
663
660
|
} ;
|
|
664
661
|
const getBeforeCloseOverlayAnimation = () => _ref$3;
|
|
665
662
|
|
|
666
|
-
function ownKeys$3(
|
|
667
|
-
function _objectSpread$3(
|
|
663
|
+
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; }
|
|
664
|
+
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; }
|
|
668
665
|
const getDefaultParentSelector = () => document.querySelector("#".concat(constants.PORTALS_CONTAINER_ID));
|
|
669
666
|
const getOverlayElement = (props, contentElement) =>
|
|
670
667
|
// Assign the `data-role` to the overlay container, which is used as
|
|
@@ -777,8 +774,8 @@ const InfoModalPage = props => jsxRuntime.jsxs(ModalPage, {
|
|
|
777
774
|
InfoModalPage.propTypes = {};
|
|
778
775
|
InfoModalPage.displayName = 'InfoModalPage';
|
|
779
776
|
|
|
780
|
-
function ownKeys$2(
|
|
781
|
-
function _objectSpread$2(
|
|
777
|
+
function ownKeys$2(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; }
|
|
778
|
+
function _objectSpread$2(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$2(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$2(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
782
779
|
const primaryDefaultProps = {
|
|
783
780
|
label: i18n.sharedMessages.confirm,
|
|
784
781
|
isDisabled: false,
|
|
@@ -980,7 +977,7 @@ TabularModalPage.Intl = i18n.sharedMessages;
|
|
|
980
977
|
|
|
981
978
|
const defaultProps$7 = {
|
|
982
979
|
color: 'surface',
|
|
983
|
-
previousPathLabel: messages$
|
|
980
|
+
previousPathLabel: messages$2.back
|
|
984
981
|
};
|
|
985
982
|
const PageTopBar = props => {
|
|
986
983
|
const intl = reactIntl.useIntl();
|
|
@@ -1148,7 +1145,7 @@ TabularDetailPage.PageHeaderTitle = PageHeaderTitle;
|
|
|
1148
1145
|
// This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
1149
1146
|
TabularDetailPage.Intl = i18n.sharedMessages;
|
|
1150
1147
|
|
|
1151
|
-
const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-
|
|
1148
|
+
const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-59fc6ad5.cjs.prod.js' /* webpackChunkName: "public-page-layout" */); }));
|
|
1152
1149
|
|
|
1153
1150
|
const MainPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
|
|
1154
1151
|
target: "ev8m2jf2"
|
|
@@ -1335,7 +1332,7 @@ const MaintenancePageLayout = props => jsxRuntime.jsx("div", {
|
|
|
1335
1332
|
MaintenancePageLayout.propTypes = {};
|
|
1336
1333
|
MaintenancePageLayout.displayName = 'MaintenancePageLayout';
|
|
1337
1334
|
|
|
1338
|
-
var messages$
|
|
1335
|
+
var messages$1 = reactIntl.defineMessages({
|
|
1339
1336
|
title: {
|
|
1340
1337
|
id: 'PageNotFound.title',
|
|
1341
1338
|
defaultMessage: 'We could not find what you are looking for'
|
|
@@ -1346,8 +1343,8 @@ var messages$2 = reactIntl.defineMessages({
|
|
|
1346
1343
|
}
|
|
1347
1344
|
});
|
|
1348
1345
|
|
|
1349
|
-
function ownKeys$1(
|
|
1350
|
-
function _objectSpread$1(
|
|
1346
|
+
function ownKeys$1(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; }
|
|
1347
|
+
function _objectSpread$1(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$1(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$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1351
1348
|
const getLink = msg => jsxRuntime.jsx("a", {
|
|
1352
1349
|
href: constants.SUPPORT_PORTAL_URL,
|
|
1353
1350
|
target: "_blank",
|
|
@@ -1358,9 +1355,9 @@ const PageNotFound = () => {
|
|
|
1358
1355
|
const intl = reactIntl.useIntl();
|
|
1359
1356
|
return jsxRuntime.jsx(MaintenancePageLayout, {
|
|
1360
1357
|
imageSrc: PageNotFoundSVG__default["default"],
|
|
1361
|
-
title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages$
|
|
1362
|
-
label: intl.formatMessage(messages$
|
|
1363
|
-
paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1(_objectSpread$1({}, messages$
|
|
1358
|
+
title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages$1.title)),
|
|
1359
|
+
label: intl.formatMessage(messages$1.title),
|
|
1360
|
+
paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1(_objectSpread$1({}, messages$1.paragraph1), {}, {
|
|
1364
1361
|
values: {
|
|
1365
1362
|
a: getLink
|
|
1366
1363
|
}
|
|
@@ -1369,7 +1366,7 @@ const PageNotFound = () => {
|
|
|
1369
1366
|
};
|
|
1370
1367
|
PageNotFound.displayName = 'PageNotFound';
|
|
1371
1368
|
|
|
1372
|
-
var messages
|
|
1369
|
+
var messages = reactIntl.defineMessages({
|
|
1373
1370
|
title: {
|
|
1374
1371
|
id: 'PageUnauthorized.title',
|
|
1375
1372
|
defaultMessage: 'We could not find what you are looking for'
|
|
@@ -1384,8 +1381,8 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
1384
1381
|
}
|
|
1385
1382
|
});
|
|
1386
1383
|
|
|
1387
|
-
function ownKeys(
|
|
1388
|
-
function _objectSpread(
|
|
1384
|
+
function ownKeys(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; }
|
|
1385
|
+
function _objectSpread(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(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(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1389
1386
|
const getSupportUrlLink = msg => jsxRuntime.jsx("a", {
|
|
1390
1387
|
href: constants.SUPPORT_PORTAL_URL,
|
|
1391
1388
|
target: "_blank",
|
|
@@ -1396,10 +1393,10 @@ const PageUnauthorized = () => {
|
|
|
1396
1393
|
const intl = reactIntl.useIntl();
|
|
1397
1394
|
return jsxRuntime.jsx(MaintenancePageLayout, {
|
|
1398
1395
|
imageSrc: FailedAuthorizationSVG__default["default"],
|
|
1399
|
-
title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread({}, messages
|
|
1400
|
-
label: intl.formatMessage(messages
|
|
1401
|
-
paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread({}, messages
|
|
1402
|
-
paragraph2: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread(_objectSpread({}, messages
|
|
1396
|
+
title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread({}, messages.title)),
|
|
1397
|
+
label: intl.formatMessage(messages.title),
|
|
1398
|
+
paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread({}, messages.paragraph1)),
|
|
1399
|
+
paragraph2: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread(_objectSpread({}, messages.paragraph2), {}, {
|
|
1403
1400
|
values: {
|
|
1404
1401
|
a: getSupportUrlLink
|
|
1405
1402
|
}
|
|
@@ -1529,105 +1526,6 @@ function CustomPanel(props) {
|
|
|
1529
1526
|
}
|
|
1530
1527
|
CustomPanel.propTypes = {};
|
|
1531
1528
|
|
|
1532
|
-
const messages = reactIntl.defineMessages({
|
|
1533
|
-
loadError: {
|
|
1534
|
-
id: 'Components.CustomViewLoader.error.load',
|
|
1535
|
-
defaultMessage: 'We could not load the Custom View. Please contact your administrator to check its configuration.'
|
|
1536
|
-
}
|
|
1537
|
-
});
|
|
1538
|
-
|
|
1539
|
-
const isIframeReady = iFrameElementRef => {
|
|
1540
|
-
try {
|
|
1541
|
-
var _iFrameElementRef$con;
|
|
1542
|
-
return (iFrameElementRef === null || iFrameElementRef === void 0 ? void 0 : (_iFrameElementRef$con = iFrameElementRef.contentWindow) === null || _iFrameElementRef$con === void 0 ? void 0 : _iFrameElementRef$con.document.readyState) === 'complete';
|
|
1543
|
-
} catch {
|
|
1544
|
-
// Trying to access the contentWindow of a cross-origin iFrame will throw an error.
|
|
1545
|
-
// We are not supposed to even get here because the iFrame must use
|
|
1546
|
-
// a URL from our very same domain (the custom view is proxied through our http-proxy service).
|
|
1547
|
-
return false;
|
|
1548
|
-
}
|
|
1549
|
-
};
|
|
1550
|
-
const CustomPanelIframe = /*#__PURE__*/_styled__default["default"]("iframe", {
|
|
1551
|
-
target: "ewwxuwo0"
|
|
1552
|
-
} )({
|
|
1553
|
-
name: "174lt7a",
|
|
1554
|
-
styles: "height:100%;width:100%;border:none"
|
|
1555
|
-
} );
|
|
1556
|
-
function CustomViewLoader(props) {
|
|
1557
|
-
var _props$customView$typ, _props$customView$typ2, _context2, _context3, _appContext$project2;
|
|
1558
|
-
const iFrameElementRef = react$1.useRef(null);
|
|
1559
|
-
const appContext = applicationShellConnectors.useApplicationContext();
|
|
1560
|
-
const iFrameCommunicationChannel = react$1.useRef(new MessageChannel());
|
|
1561
|
-
const showNotification = actionsGlobal.useShowNotification();
|
|
1562
|
-
const intl = reactIntl.useIntl();
|
|
1563
|
-
const panelSize = ((_props$customView$typ = props.customView.typeSettings) === null || _props$customView$typ === void 0 ? void 0 : (_props$customView$typ2 = _props$customView$typ.size) === null || _props$customView$typ2 === void 0 ? void 0 : _props$customView$typ2.toLocaleLowerCase()) || 'large';
|
|
1564
|
-
const messageFromIFrameHandler = react$1.useCallback(event => {
|
|
1565
|
-
if (event.data.origin === window.location.origin) {
|
|
1566
|
-
console.log('message received from iframe port: ', event);
|
|
1567
|
-
}
|
|
1568
|
-
}, []);
|
|
1569
|
-
|
|
1570
|
-
// onLoad handler is called from the iFrame even where the URL is not valid
|
|
1571
|
-
// (blocked by CORS, 404, etc.) so we need to make sure the iFrame is ready
|
|
1572
|
-
const onLoadSuccessHandler = react$1.useCallback(() => {
|
|
1573
|
-
var _iFrameElementRef$cur, _iFrameElementRef$cur2, _context, _appContext$user, _appContext$project;
|
|
1574
|
-
// Show error and block if the iFrame is not ready
|
|
1575
|
-
// (error loading it)
|
|
1576
|
-
if (!isIframeReady(iFrameElementRef.current)) {
|
|
1577
|
-
showNotification({
|
|
1578
|
-
domain: constants.DOMAINS.PAGE,
|
|
1579
|
-
kind: constants.NOTIFICATION_KINDS_PAGE.error,
|
|
1580
|
-
text: intl.formatMessage(messages.loadError)
|
|
1581
|
-
});
|
|
1582
|
-
return;
|
|
1583
|
-
}
|
|
1584
|
-
|
|
1585
|
-
// Listen for messages from the iFrame
|
|
1586
|
-
iFrameCommunicationChannel.current.port1.onmessage = messageFromIFrameHandler;
|
|
1587
|
-
|
|
1588
|
-
// Transfer port2 to the iFrame so it can send messages back privately
|
|
1589
|
-
(_iFrameElementRef$cur = iFrameElementRef.current) === null || _iFrameElementRef$cur === void 0 ? void 0 : (_iFrameElementRef$cur2 = _iFrameElementRef$cur.contentWindow) === null || _iFrameElementRef$cur2 === void 0 ? void 0 : _iFrameElementRef$cur2.postMessage(constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_BOOTSTRAP, window.location.href, [iFrameCommunicationChannel.current.port2]);
|
|
1590
|
-
|
|
1591
|
-
// Send the initialization message to the iFrame
|
|
1592
|
-
iFrameCommunicationChannel.current.port1.postMessage({
|
|
1593
|
-
source: constants.CUSTOM_VIEWS_EVENTS_META.SOURCE,
|
|
1594
|
-
destination: _concatInstanceProperty__default["default"](_context = "".concat(constants.CUSTOM_VIEWS_EVENTS_META.DESTINATION_PREFIX)).call(_context, props.customView.id),
|
|
1595
|
-
eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION,
|
|
1596
|
-
eventData: {
|
|
1597
|
-
context: {
|
|
1598
|
-
dataLocale: appContext.dataLocale,
|
|
1599
|
-
customViewConfig: props.customView,
|
|
1600
|
-
hostUrl: window.location.href,
|
|
1601
|
-
userLocale: (_appContext$user = appContext.user) === null || _appContext$user === void 0 ? void 0 : _appContext$user.locale,
|
|
1602
|
-
projectKey: (_appContext$project = appContext.project) === null || _appContext$project === void 0 ? void 0 : _appContext$project.key
|
|
1603
|
-
}
|
|
1604
|
-
}
|
|
1605
|
-
});
|
|
1606
|
-
|
|
1607
|
-
// We want the effect to run only once so we don't need the dependencies array.
|
|
1608
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1609
|
-
}, []);
|
|
1610
|
-
|
|
1611
|
-
// Currently we only support custom panels
|
|
1612
|
-
if (props.customView.type !== 'CustomPanel') {
|
|
1613
|
-
sentry.reportErrorToSentry(new Error("CustomViewLoader: Provided Custom View has an unsupported type: ".concat(props.customView.type, ". Supported types: ['CustomPanel'].")));
|
|
1614
|
-
return null;
|
|
1615
|
-
}
|
|
1616
|
-
return jsxRuntime.jsx(CustomPanel, {
|
|
1617
|
-
title: "Custom View: ".concat(props.customView.defaultLabel),
|
|
1618
|
-
onClose: props.onClose,
|
|
1619
|
-
size: panelSize,
|
|
1620
|
-
children: jsxRuntime.jsx(CustomPanelIframe, {
|
|
1621
|
-
id: "custom-view-".concat(props.customView.id),
|
|
1622
|
-
ref: iFrameElementRef,
|
|
1623
|
-
title: "Custom View: ".concat(props.customView.defaultLabel),
|
|
1624
|
-
src: _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "".concat(window.location.origin, "/custom-views/")).call(_context3, props.customView.id, "/projects/")).call(_context2, ((_appContext$project2 = appContext.project) === null || _appContext$project2 === void 0 ? void 0 : _appContext$project2.key) || 'no-project'),
|
|
1625
|
-
onLoad: onLoadSuccessHandler
|
|
1626
|
-
}, "custom-view-".concat(props.customView.id))
|
|
1627
|
-
});
|
|
1628
|
-
}
|
|
1629
|
-
CustomViewLoader.propTypes = {};
|
|
1630
|
-
|
|
1631
1529
|
// The width of each indentation level.
|
|
1632
1530
|
const indentationSize = '48px';
|
|
1633
1531
|
const useObserverElementDimensions = element => {
|
|
@@ -1665,8 +1563,8 @@ const PortalsContainer = /*#__PURE__*/react$1.forwardRef((props, ref) => {
|
|
|
1665
1563
|
const zIndex = (_props$zIndex = props.zIndex) !== null && _props$zIndex !== void 0 ? _props$zIndex : 10000;
|
|
1666
1564
|
const baseModalZIndex = (_props$baseModalZInde = props.baseModalZIndex) !== null && _props$baseModalZInde !== void 0 ? _props$baseModalZInde : 1000;
|
|
1667
1565
|
const portalsContainerRef = react$1.useRef(null);
|
|
1668
|
-
const globalNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0
|
|
1669
|
-
const pageNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0
|
|
1566
|
+
const globalNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0 || (_current = ref.current) === null || _current === void 0 ? void 0 : _current.notificationsGlobalRef);
|
|
1567
|
+
const pageNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0 || (_current2 = ref.current) === null || _current2 === void 0 ? void 0 : _current2.notificationsPageRef);
|
|
1670
1568
|
const _useState3 = react$1.useState([]),
|
|
1671
1569
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1672
1570
|
stackingLayers = _useState4[0],
|
|
@@ -1747,7 +1645,6 @@ exports.CustomFormDetailPage = CustomFormDetailPage;
|
|
|
1747
1645
|
exports.CustomFormMainPage = CustomFormMainPage;
|
|
1748
1646
|
exports.CustomFormModalPage = CustomFormModalPage;
|
|
1749
1647
|
exports.CustomPanel = CustomPanel;
|
|
1750
|
-
exports.CustomViewLoader = CustomViewLoader;
|
|
1751
1648
|
exports.FormDetailPage = FormDetailPage;
|
|
1752
1649
|
exports.FormDialog = FormDialog;
|
|
1753
1650
|
exports.FormMainPage = FormMainPage;
|