@commercetools-frontend/react-notifications 20.10.4 → 20.10.6
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.
|
@@ -59,8 +59,8 @@ var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
|
59
59
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
60
60
|
var isNumber__default = /*#__PURE__*/_interopDefault(isNumber);
|
|
61
61
|
|
|
62
|
-
// NOTE: This string will be replaced
|
|
63
|
-
var version =
|
|
62
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
63
|
+
var version = "20.10.6";
|
|
64
64
|
|
|
65
65
|
var Context = /*#__PURE__*/react.createContext(function () {
|
|
66
66
|
return null;
|
|
@@ -74,8 +74,8 @@ function NotificationProviderForCustomComponent(props) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
NotificationProviderForCustomComponent.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
77
|
-
mapNotificationToComponent: _pt__default[
|
|
78
|
-
children: _pt__default[
|
|
77
|
+
mapNotificationToComponent: _pt__default["default"].func.isRequired,
|
|
78
|
+
children: _pt__default["default"].node.isRequired
|
|
79
79
|
} : {};
|
|
80
80
|
NotificationProviderForCustomComponent.displayName = 'NotificationProviderForCustomComponent';
|
|
81
81
|
var useCustomNotificationComponent = function useCustomNotificationComponent() {
|
|
@@ -83,8 +83,8 @@ var useCustomNotificationComponent = function useCustomNotificationComponent() {
|
|
|
83
83
|
}; // Exports
|
|
84
84
|
|
|
85
85
|
function filterDataAttributes(obj) {
|
|
86
|
-
return omitBy__default[
|
|
87
|
-
return !_startsWithInstanceProperty__default[
|
|
86
|
+
return omitBy__default["default"](obj, function (_value, key) {
|
|
87
|
+
return !_startsWithInstanceProperty__default["default"](key).call(key, 'data-');
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -152,9 +152,9 @@ var getStylesForNotification = function getStylesForNotification(props) {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
-
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
155
|
+
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
156
156
|
|
|
157
|
-
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default[
|
|
157
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
158
158
|
|
|
159
159
|
var NotificationIcon = function NotificationIcon(props) {
|
|
160
160
|
if (props.type === constants.NOTIFICATION_KINDS_SIDE.error) return jsxRuntime.jsx(icons.ErrorIcon, {
|
|
@@ -172,8 +172,8 @@ var NotificationIcon = function NotificationIcon(props) {
|
|
|
172
172
|
};
|
|
173
173
|
|
|
174
174
|
NotificationIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
175
|
-
type: _pt__default[
|
|
176
|
-
color: _pt__default[
|
|
175
|
+
type: _pt__default["default"].any.isRequired,
|
|
176
|
+
color: _pt__default["default"].oneOf(['error', 'warning', 'info', 'solid', 'neutral60', 'surface', 'primary', 'primary40']).isRequired
|
|
177
177
|
} : {};
|
|
178
178
|
NotificationIcon.displayName = 'NotificationIcon';
|
|
179
179
|
var defaultProps$1 = {
|
|
@@ -189,7 +189,7 @@ var Notification = function Notification(props) {
|
|
|
189
189
|
css: getStylesForContent(props),
|
|
190
190
|
children: props.children
|
|
191
191
|
}), props.onCloseClick ? jsxRuntime.jsx("div", {
|
|
192
|
-
children: jsxRuntime.jsx(IconButton__default[
|
|
192
|
+
children: jsxRuntime.jsx(IconButton__default["default"], {
|
|
193
193
|
label: intl.formatMessage(messages.hideNotification),
|
|
194
194
|
onClick: props.onCloseClick,
|
|
195
195
|
icon: jsxRuntime.jsx(icons.CloseBoldIcon, {}),
|
|
@@ -206,11 +206,11 @@ var Notification = function Notification(props) {
|
|
|
206
206
|
};
|
|
207
207
|
|
|
208
208
|
Notification.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
209
|
-
domain: _pt__default[
|
|
210
|
-
type: _pt__default[
|
|
211
|
-
fixed: _pt__default[
|
|
212
|
-
onCloseClick: _pt__default[
|
|
213
|
-
children: _pt__default[
|
|
209
|
+
domain: _pt__default["default"].any.isRequired,
|
|
210
|
+
type: _pt__default["default"].any.isRequired,
|
|
211
|
+
fixed: _pt__default["default"].bool.isRequired,
|
|
212
|
+
onCloseClick: _pt__default["default"].func,
|
|
213
|
+
children: _pt__default["default"].node.isRequired
|
|
214
214
|
} : {};
|
|
215
215
|
Notification.displayName = 'Notification';
|
|
216
216
|
Notification.defaultProps = defaultProps$1;
|
|
@@ -225,8 +225,8 @@ var GenericNotification = function GenericNotification(props) {
|
|
|
225
225
|
};
|
|
226
226
|
|
|
227
227
|
GenericNotification.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
228
|
-
notification: _pt__default[
|
|
229
|
-
dismiss: _pt__default[
|
|
228
|
+
notification: _pt__default["default"].any.isRequired,
|
|
229
|
+
dismiss: _pt__default["default"].func.isRequired
|
|
230
230
|
} : {};
|
|
231
231
|
GenericNotification.displayName = 'GenericNotification';
|
|
232
232
|
|
|
@@ -371,9 +371,9 @@ var apiErrorMessages = reactIntl.defineMessages({
|
|
|
371
371
|
}
|
|
372
372
|
});
|
|
373
373
|
|
|
374
|
-
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
374
|
+
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
375
375
|
|
|
376
|
-
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context6; _forEachInstanceProperty__default[
|
|
376
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context6; _forEachInstanceProperty__default["default"](_context6 = ownKeys$3(Object(source), true)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context7; _forEachInstanceProperty__default["default"](_context7 = ownKeys$3(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
377
377
|
var regexInvalidOperationRequiredAttribute = /Required attribute '(.*)' cannot be removed/;
|
|
378
378
|
|
|
379
379
|
// The values passed to the Intl message must be a map of scalar values.
|
|
@@ -408,7 +408,7 @@ var FormattedErrorMessage = function FormattedErrorMessage(props) {
|
|
|
408
408
|
// This error is not mapped / translated yet,
|
|
409
409
|
// we log, report it to sentry and show the original error, unless `error.code` is `invalid_scope`
|
|
410
410
|
// which an error code emitted for expired project(s)
|
|
411
|
-
if (props.error.code !== 'invalid_scope' && !_includesInstanceProperty__default[
|
|
411
|
+
if (props.error.code !== 'invalid_scope' && !_includesInstanceProperty__default["default"](_context = props.error.message).call(_context, 'has expired')) {
|
|
412
412
|
sentry.reportErrorToSentry(new Error('Unmapped error'), {
|
|
413
413
|
extra: props.error
|
|
414
414
|
});
|
|
@@ -424,12 +424,12 @@ var FormattedErrorMessage = function FormattedErrorMessage(props) {
|
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
427
|
-
children: _filterInstanceProperty__default[
|
|
427
|
+
children: _filterInstanceProperty__default["default"](_context2 = [props.error.message, props.error.detailedErrorMessage && "(".concat(props.error.detailedErrorMessage, ")")]).call(_context2, Boolean).join(' ')
|
|
428
428
|
});
|
|
429
429
|
};
|
|
430
430
|
|
|
431
431
|
FormattedErrorMessage.propTypes = {
|
|
432
|
-
error: _pt__default[
|
|
432
|
+
error: _pt__default["default"].any.isRequired
|
|
433
433
|
};
|
|
434
434
|
FormattedErrorMessage.displayName = 'FormattedErrorMessage';
|
|
435
435
|
|
|
@@ -448,7 +448,7 @@ var ApiErrorMessage = function ApiErrorMessage(props) {
|
|
|
448
448
|
};
|
|
449
449
|
|
|
450
450
|
ApiErrorMessage.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
451
|
-
error: _pt__default[
|
|
451
|
+
error: _pt__default["default"].any.isRequired
|
|
452
452
|
} : {};
|
|
453
453
|
ApiErrorMessage.displayName = 'ApiErrorMessage';
|
|
454
454
|
|
|
@@ -472,15 +472,15 @@ function getSpecialFormattedMessageByErrorCode(error, intl) {
|
|
|
472
472
|
slugValue: error.duplicateValue
|
|
473
473
|
}); // Try to match the error with a custom error message
|
|
474
474
|
|
|
475
|
-
if (has__default[
|
|
475
|
+
if (has__default["default"](error, 'invalidValue') && has__default["default"](error.invalidValue, 'overlappingPrices')) return intl.formatMessage(apiErrorMessages.OverlappingPrices);
|
|
476
476
|
|
|
477
|
-
if (error.code === 'InvalidOperation' && _includesInstanceProperty__default[
|
|
477
|
+
if (error.code === 'InvalidOperation' && _includesInstanceProperty__default["default"](_context3 = error.message).call(_context3, 'validFrom') && _includesInstanceProperty__default["default"](_context4 = error.message).call(_context4, 'validUntil')) {
|
|
478
478
|
return intl.formatMessage(apiErrorMessages.InvalidDateRange, {
|
|
479
479
|
field: 'validFrom'
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
-
if (error.code === 'InvalidOperation' && _includesInstanceProperty__default[
|
|
483
|
+
if (error.code === 'InvalidOperation' && _includesInstanceProperty__default["default"](_context5 = error.message).call(_context5, 'Duplicate tax rate for')) {
|
|
484
484
|
return intl.formatMessage(apiErrorMessages.TaxCategoryDuplicateCountry);
|
|
485
485
|
}
|
|
486
486
|
|
|
@@ -494,7 +494,7 @@ function getSpecialFormattedMessageByErrorCode(error, intl) {
|
|
|
494
494
|
// errors. We should investigate this further.
|
|
495
495
|
|
|
496
496
|
|
|
497
|
-
if (error.code === 'InvalidField' && error.field === 'price' && has__default[
|
|
497
|
+
if (error.code === 'InvalidField' && error.field === 'price' && has__default["default"](error, 'invalidValue') && has__default["default"](error.invalidValue, 'validFrom') && has__default["default"](error.invalidValue, 'validUntil')) return intl.formatMessage(apiErrorMessages.InvalidDateRange, {
|
|
498
498
|
field: error.field
|
|
499
499
|
});
|
|
500
500
|
|
|
@@ -519,7 +519,7 @@ var ApiErrorNotification = function ApiErrorNotification(props) {
|
|
|
519
519
|
domain: props.notification.domain,
|
|
520
520
|
onCloseClick: props.dismiss,
|
|
521
521
|
children: jsxRuntime.jsx("ul", {
|
|
522
|
-
children: _valuesInstanceProperty__default[
|
|
522
|
+
children: _valuesInstanceProperty__default["default"](props.notification) && _mapInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](props.notification).errors).call(_context, function (error, idx) {
|
|
523
523
|
var shouldLogErrorToConsole = !error.code && process.env.NODE_ENV === 'development';
|
|
524
524
|
|
|
525
525
|
if (shouldLogErrorToConsole) {
|
|
@@ -544,33 +544,33 @@ var ApiErrorNotification = function ApiErrorNotification(props) {
|
|
|
544
544
|
};
|
|
545
545
|
|
|
546
546
|
ApiErrorNotification.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
547
|
-
notification: _pt__default[
|
|
548
|
-
dismiss: _pt__default[
|
|
547
|
+
notification: _pt__default["default"].any.isRequired,
|
|
548
|
+
dismiss: _pt__default["default"].func.isRequired
|
|
549
549
|
} : {};
|
|
550
550
|
ApiErrorNotification.displayName = 'ApiErrorNotification';
|
|
551
551
|
|
|
552
|
-
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
552
|
+
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
553
553
|
|
|
554
|
-
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default[
|
|
554
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
555
555
|
|
|
556
556
|
var UnexpectedErrorNotification = function UnexpectedErrorNotification(props) {
|
|
557
557
|
return jsxRuntime.jsx(Notification, {
|
|
558
558
|
type: "error",
|
|
559
559
|
domain: props.notification.domain,
|
|
560
560
|
onCloseClick: props.dismiss,
|
|
561
|
-
children: jsxRuntime.jsxs(Spacings__default[
|
|
561
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
562
562
|
children: [jsxRuntime.jsx("div", {
|
|
563
563
|
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, apiErrorMessages.General))
|
|
564
|
-
}), _valuesInstanceProperty__default[
|
|
565
|
-
children: "ID (".concat(_valuesInstanceProperty__default[
|
|
564
|
+
}), _valuesInstanceProperty__default["default"](props.notification) && _valuesInstanceProperty__default["default"](props.notification).errorId && jsxRuntime.jsx("div", {
|
|
565
|
+
children: "ID (".concat(_valuesInstanceProperty__default["default"](props.notification).errorId, ")")
|
|
566
566
|
})]
|
|
567
567
|
})
|
|
568
568
|
});
|
|
569
569
|
};
|
|
570
570
|
|
|
571
571
|
UnexpectedErrorNotification.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
572
|
-
notification: _pt__default[
|
|
573
|
-
dismiss: _pt__default[
|
|
572
|
+
notification: _pt__default["default"].any.isRequired,
|
|
573
|
+
dismiss: _pt__default["default"].func.isRequired
|
|
574
574
|
} : {};
|
|
575
575
|
UnexpectedErrorNotification.displayName = 'UnexpectedErrorNotification';
|
|
576
576
|
|
|
@@ -582,18 +582,18 @@ var selectNotifications = function selectNotifications(state) {
|
|
|
582
582
|
var selectGlobalNotifications = reselect.createSelector(selectNotifications, function (notifications) {
|
|
583
583
|
var _context;
|
|
584
584
|
|
|
585
|
-
return _sliceInstanceProperty__default[
|
|
585
|
+
return _sliceInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](notifications).call(notifications, function (notification) {
|
|
586
586
|
return notification.domain === constants.NOTIFICATION_DOMAINS.GLOBAL;
|
|
587
587
|
}) // Return only 1 at a time
|
|
588
588
|
).call(_context, 0, 1);
|
|
589
589
|
});
|
|
590
590
|
var selectPageNotifications = reselect.createSelector(selectNotifications, function (notifications) {
|
|
591
|
-
return _filterInstanceProperty__default[
|
|
591
|
+
return _filterInstanceProperty__default["default"](notifications).call(notifications, function (notification) {
|
|
592
592
|
return notification.domain === constants.NOTIFICATION_DOMAINS.PAGE;
|
|
593
593
|
});
|
|
594
594
|
});
|
|
595
595
|
var selectSideNotifications = reselect.createSelector(selectNotifications, function (notifications) {
|
|
596
|
-
return _filterInstanceProperty__default[
|
|
596
|
+
return _filterInstanceProperty__default["default"](notifications).call(notifications, function (notification) {
|
|
597
597
|
return notification.domain === constants.NOTIFICATION_DOMAINS.SIDE;
|
|
598
598
|
});
|
|
599
599
|
});
|
|
@@ -622,9 +622,9 @@ var _excluded = ["values"],
|
|
|
622
622
|
_excluded4 = ["text"],
|
|
623
623
|
_excluded5 = ["text"];
|
|
624
624
|
|
|
625
|
-
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
625
|
+
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
626
626
|
|
|
627
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default[
|
|
627
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
628
628
|
|
|
629
629
|
var NotificationsListGlobal = function NotificationsListGlobal(props) {
|
|
630
630
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -632,7 +632,7 @@ var NotificationsListGlobal = function NotificationsListGlobal(props) {
|
|
|
632
632
|
var notifications$1 = reactRedux.useSelector(selectGlobalNotifications);
|
|
633
633
|
return jsxRuntime.jsx("div", {
|
|
634
634
|
css: getStyles(props),
|
|
635
|
-
children: _mapInstanceProperty__default[
|
|
635
|
+
children: _mapInstanceProperty__default["default"](notifications$1).call(notifications$1, function (notification) {
|
|
636
636
|
// 1. Check if there is a custom notification component first
|
|
637
637
|
var CustomNotificationComponent = mapCustomNotificationToComponent(notification);
|
|
638
638
|
|
|
@@ -651,7 +651,7 @@ var NotificationsListGlobal = function NotificationsListGlobal(props) {
|
|
|
651
651
|
case constants.NOTIFICATION_KINDS_GLOBAL.info:
|
|
652
652
|
case constants.NOTIFICATION_KINDS_GLOBAL.success:
|
|
653
653
|
{
|
|
654
|
-
_valuesInstanceProperty__default[
|
|
654
|
+
_valuesInstanceProperty__default["default"](notification);
|
|
655
655
|
var genericNotification = _objectWithoutProperties(notification, _excluded);
|
|
656
656
|
|
|
657
657
|
return jsxRuntime.jsx(GenericNotification, {
|
|
@@ -697,7 +697,7 @@ var NotificationsListPage = function NotificationsListPage(props) {
|
|
|
697
697
|
var notifications$1 = reactRedux.useSelector(selectPageNotifications);
|
|
698
698
|
return jsxRuntime.jsx("div", {
|
|
699
699
|
css: getStyles(props),
|
|
700
|
-
children: _mapInstanceProperty__default[
|
|
700
|
+
children: _mapInstanceProperty__default["default"](notifications$1).call(notifications$1, function (notification) {
|
|
701
701
|
// 1. Check if there is a custom notification component first
|
|
702
702
|
var CustomNotificationComponent = mapCustomNotificationToComponent(notification);
|
|
703
703
|
|
|
@@ -716,7 +716,7 @@ var NotificationsListPage = function NotificationsListPage(props) {
|
|
|
716
716
|
case constants.NOTIFICATION_KINDS_PAGE.info:
|
|
717
717
|
case constants.NOTIFICATION_KINDS_PAGE.success:
|
|
718
718
|
{
|
|
719
|
-
_valuesInstanceProperty__default[
|
|
719
|
+
_valuesInstanceProperty__default["default"](notification);
|
|
720
720
|
var genericNotification = _objectWithoutProperties(notification, _excluded3);
|
|
721
721
|
|
|
722
722
|
return jsxRuntime.jsx(GenericNotification, {
|
|
@@ -749,7 +749,7 @@ var NotificationsListPage = function NotificationsListPage(props) {
|
|
|
749
749
|
|
|
750
750
|
return jsxRuntime.jsx(UnexpectedErrorNotification, {
|
|
751
751
|
notification: _objectSpread$1(_objectSpread$1({}, _errorNotification), {}, {
|
|
752
|
-
values: _valuesInstanceProperty__default[
|
|
752
|
+
values: _valuesInstanceProperty__default["default"](notification)
|
|
753
753
|
}),
|
|
754
754
|
dismiss: function dismiss() {
|
|
755
755
|
dispatch(notifications.removeNotification(notification.id));
|
|
@@ -770,7 +770,7 @@ var NotificationsListSide = function NotificationsListSide(props) {
|
|
|
770
770
|
var notifications$1 = reactRedux.useSelector(selectSideNotifications);
|
|
771
771
|
return jsxRuntime.jsx("div", {
|
|
772
772
|
css: getStyles(props),
|
|
773
|
-
children: _mapInstanceProperty__default[
|
|
773
|
+
children: _mapInstanceProperty__default["default"](notifications$1).call(notifications$1, function (notification) {
|
|
774
774
|
// 1. Check if there is a custom notification component first
|
|
775
775
|
var CustomNotificationComponent = mapCustomNotificationToComponent(notification);
|
|
776
776
|
|
|
@@ -820,9 +820,9 @@ var NotificationsList = function NotificationsList(props) {
|
|
|
820
820
|
|
|
821
821
|
NotificationsList.displayName = 'NotificationsList';
|
|
822
822
|
|
|
823
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
823
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
824
824
|
|
|
825
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default[
|
|
825
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
826
826
|
var defaultProps = {
|
|
827
827
|
domain: constants.NOTIFICATION_DOMAINS.SIDE,
|
|
828
828
|
kind: constants.NOTIFICATION_KINDS_SIDE.success
|
|
@@ -836,7 +836,7 @@ var Notifier = function Notifier(props) {
|
|
|
836
836
|
domain: props.domain,
|
|
837
837
|
kind: props.kind,
|
|
838
838
|
text: props.text
|
|
839
|
-
}, isNumber__default[
|
|
839
|
+
}, isNumber__default["default"](props.dismissAfter) ? _objectSpread(_objectSpread({}, props.meta), {}, {
|
|
840
840
|
dismissAfter: props.dismissAfter
|
|
841
841
|
}) : props.meta);
|
|
842
842
|
return function () {
|
|
@@ -849,11 +849,11 @@ var Notifier = function Notifier(props) {
|
|
|
849
849
|
};
|
|
850
850
|
|
|
851
851
|
Notifier.propTypes = {
|
|
852
|
-
domain: _pt__default[
|
|
853
|
-
kind: _pt__default[
|
|
854
|
-
text: _pt__default[
|
|
855
|
-
meta: _pt__default[
|
|
856
|
-
dismissAfter: _pt__default[
|
|
852
|
+
domain: _pt__default["default"].any.isRequired,
|
|
853
|
+
kind: _pt__default["default"].any.isRequired,
|
|
854
|
+
text: _pt__default["default"].string,
|
|
855
|
+
meta: _pt__default["default"].objectOf(_pt__default["default"].any),
|
|
856
|
+
dismissAfter: _pt__default["default"].number
|
|
857
857
|
};
|
|
858
858
|
Notifier.displayName = 'Notifier';
|
|
859
859
|
Notifier.defaultProps = defaultProps;
|
|
@@ -59,8 +59,8 @@ var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
|
59
59
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
60
60
|
var isNumber__default = /*#__PURE__*/_interopDefault(isNumber);
|
|
61
61
|
|
|
62
|
-
// NOTE: This string will be replaced
|
|
63
|
-
var version =
|
|
62
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
63
|
+
var version = "20.10.6";
|
|
64
64
|
|
|
65
65
|
var Context = /*#__PURE__*/react.createContext(function () {
|
|
66
66
|
return null;
|
|
@@ -80,8 +80,8 @@ var useCustomNotificationComponent = function useCustomNotificationComponent() {
|
|
|
80
80
|
}; // Exports
|
|
81
81
|
|
|
82
82
|
function filterDataAttributes(obj) {
|
|
83
|
-
return omitBy__default[
|
|
84
|
-
return !_startsWithInstanceProperty__default[
|
|
83
|
+
return omitBy__default["default"](obj, function (_value, key) {
|
|
84
|
+
return !_startsWithInstanceProperty__default["default"](key).call(key, 'data-');
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -149,9 +149,9 @@ var getStylesForNotification = function getStylesForNotification(props) {
|
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
-
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
152
|
+
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
153
153
|
|
|
154
|
-
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default[
|
|
154
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
155
155
|
|
|
156
156
|
var NotificationIcon = function NotificationIcon(props) {
|
|
157
157
|
if (props.type === constants.NOTIFICATION_KINDS_SIDE.error) return jsxRuntime.jsx(icons.ErrorIcon, {
|
|
@@ -183,7 +183,7 @@ var Notification = function Notification(props) {
|
|
|
183
183
|
css: getStylesForContent(props),
|
|
184
184
|
children: props.children
|
|
185
185
|
}), props.onCloseClick ? jsxRuntime.jsx("div", {
|
|
186
|
-
children: jsxRuntime.jsx(IconButton__default[
|
|
186
|
+
children: jsxRuntime.jsx(IconButton__default["default"], {
|
|
187
187
|
label: intl.formatMessage(messages.hideNotification),
|
|
188
188
|
onClick: props.onCloseClick,
|
|
189
189
|
icon: jsxRuntime.jsx(icons.CloseBoldIcon, {}),
|
|
@@ -356,9 +356,9 @@ var apiErrorMessages = reactIntl.defineMessages({
|
|
|
356
356
|
}
|
|
357
357
|
});
|
|
358
358
|
|
|
359
|
-
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
359
|
+
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
360
360
|
|
|
361
|
-
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context6; _forEachInstanceProperty__default[
|
|
361
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context6; _forEachInstanceProperty__default["default"](_context6 = ownKeys$3(Object(source), true)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context7; _forEachInstanceProperty__default["default"](_context7 = ownKeys$3(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
362
362
|
var regexInvalidOperationRequiredAttribute = /Required attribute '(.*)' cannot be removed/;
|
|
363
363
|
|
|
364
364
|
// The values passed to the Intl message must be a map of scalar values.
|
|
@@ -393,7 +393,7 @@ var FormattedErrorMessage = function FormattedErrorMessage(props) {
|
|
|
393
393
|
// This error is not mapped / translated yet,
|
|
394
394
|
// we log, report it to sentry and show the original error, unless `error.code` is `invalid_scope`
|
|
395
395
|
// which an error code emitted for expired project(s)
|
|
396
|
-
if (props.error.code !== 'invalid_scope' && !_includesInstanceProperty__default[
|
|
396
|
+
if (props.error.code !== 'invalid_scope' && !_includesInstanceProperty__default["default"](_context = props.error.message).call(_context, 'has expired')) {
|
|
397
397
|
sentry.reportErrorToSentry(new Error('Unmapped error'), {
|
|
398
398
|
extra: props.error
|
|
399
399
|
});
|
|
@@ -409,12 +409,12 @@ var FormattedErrorMessage = function FormattedErrorMessage(props) {
|
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
412
|
-
children: _filterInstanceProperty__default[
|
|
412
|
+
children: _filterInstanceProperty__default["default"](_context2 = [props.error.message, props.error.detailedErrorMessage && "(".concat(props.error.detailedErrorMessage, ")")]).call(_context2, Boolean).join(' ')
|
|
413
413
|
});
|
|
414
414
|
};
|
|
415
415
|
|
|
416
416
|
FormattedErrorMessage.propTypes = {
|
|
417
|
-
error: _pt__default[
|
|
417
|
+
error: _pt__default["default"].any.isRequired
|
|
418
418
|
};
|
|
419
419
|
FormattedErrorMessage.displayName = 'FormattedErrorMessage';
|
|
420
420
|
|
|
@@ -455,15 +455,15 @@ function getSpecialFormattedMessageByErrorCode(error, intl) {
|
|
|
455
455
|
slugValue: error.duplicateValue
|
|
456
456
|
}); // Try to match the error with a custom error message
|
|
457
457
|
|
|
458
|
-
if (has__default[
|
|
458
|
+
if (has__default["default"](error, 'invalidValue') && has__default["default"](error.invalidValue, 'overlappingPrices')) return intl.formatMessage(apiErrorMessages.OverlappingPrices);
|
|
459
459
|
|
|
460
|
-
if (error.code === 'InvalidOperation' && _includesInstanceProperty__default[
|
|
460
|
+
if (error.code === 'InvalidOperation' && _includesInstanceProperty__default["default"](_context3 = error.message).call(_context3, 'validFrom') && _includesInstanceProperty__default["default"](_context4 = error.message).call(_context4, 'validUntil')) {
|
|
461
461
|
return intl.formatMessage(apiErrorMessages.InvalidDateRange, {
|
|
462
462
|
field: 'validFrom'
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
if (error.code === 'InvalidOperation' && _includesInstanceProperty__default[
|
|
466
|
+
if (error.code === 'InvalidOperation' && _includesInstanceProperty__default["default"](_context5 = error.message).call(_context5, 'Duplicate tax rate for')) {
|
|
467
467
|
return intl.formatMessage(apiErrorMessages.TaxCategoryDuplicateCountry);
|
|
468
468
|
}
|
|
469
469
|
|
|
@@ -477,7 +477,7 @@ function getSpecialFormattedMessageByErrorCode(error, intl) {
|
|
|
477
477
|
// errors. We should investigate this further.
|
|
478
478
|
|
|
479
479
|
|
|
480
|
-
if (error.code === 'InvalidField' && error.field === 'price' && has__default[
|
|
480
|
+
if (error.code === 'InvalidField' && error.field === 'price' && has__default["default"](error, 'invalidValue') && has__default["default"](error.invalidValue, 'validFrom') && has__default["default"](error.invalidValue, 'validUntil')) return intl.formatMessage(apiErrorMessages.InvalidDateRange, {
|
|
481
481
|
field: error.field
|
|
482
482
|
});
|
|
483
483
|
|
|
@@ -502,7 +502,7 @@ var ApiErrorNotification = function ApiErrorNotification(props) {
|
|
|
502
502
|
domain: props.notification.domain,
|
|
503
503
|
onCloseClick: props.dismiss,
|
|
504
504
|
children: jsxRuntime.jsx("ul", {
|
|
505
|
-
children: _valuesInstanceProperty__default[
|
|
505
|
+
children: _valuesInstanceProperty__default["default"](props.notification) && _mapInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](props.notification).errors).call(_context, function (error, idx) {
|
|
506
506
|
var shouldLogErrorToConsole = !error.code && "production" === 'development';
|
|
507
507
|
|
|
508
508
|
if (shouldLogErrorToConsole) {
|
|
@@ -529,20 +529,20 @@ var ApiErrorNotification = function ApiErrorNotification(props) {
|
|
|
529
529
|
ApiErrorNotification.propTypes = {};
|
|
530
530
|
ApiErrorNotification.displayName = 'ApiErrorNotification';
|
|
531
531
|
|
|
532
|
-
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
532
|
+
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
533
533
|
|
|
534
|
-
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default[
|
|
534
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
535
535
|
|
|
536
536
|
var UnexpectedErrorNotification = function UnexpectedErrorNotification(props) {
|
|
537
537
|
return jsxRuntime.jsx(Notification, {
|
|
538
538
|
type: "error",
|
|
539
539
|
domain: props.notification.domain,
|
|
540
540
|
onCloseClick: props.dismiss,
|
|
541
|
-
children: jsxRuntime.jsxs(Spacings__default[
|
|
541
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
542
542
|
children: [jsxRuntime.jsx("div", {
|
|
543
543
|
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, apiErrorMessages.General))
|
|
544
|
-
}), _valuesInstanceProperty__default[
|
|
545
|
-
children: "ID (".concat(_valuesInstanceProperty__default[
|
|
544
|
+
}), _valuesInstanceProperty__default["default"](props.notification) && _valuesInstanceProperty__default["default"](props.notification).errorId && jsxRuntime.jsx("div", {
|
|
545
|
+
children: "ID (".concat(_valuesInstanceProperty__default["default"](props.notification).errorId, ")")
|
|
546
546
|
})]
|
|
547
547
|
})
|
|
548
548
|
});
|
|
@@ -559,18 +559,18 @@ var selectNotifications = function selectNotifications(state) {
|
|
|
559
559
|
var selectGlobalNotifications = reselect.createSelector(selectNotifications, function (notifications) {
|
|
560
560
|
var _context;
|
|
561
561
|
|
|
562
|
-
return _sliceInstanceProperty__default[
|
|
562
|
+
return _sliceInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](notifications).call(notifications, function (notification) {
|
|
563
563
|
return notification.domain === constants.NOTIFICATION_DOMAINS.GLOBAL;
|
|
564
564
|
}) // Return only 1 at a time
|
|
565
565
|
).call(_context, 0, 1);
|
|
566
566
|
});
|
|
567
567
|
var selectPageNotifications = reselect.createSelector(selectNotifications, function (notifications) {
|
|
568
|
-
return _filterInstanceProperty__default[
|
|
568
|
+
return _filterInstanceProperty__default["default"](notifications).call(notifications, function (notification) {
|
|
569
569
|
return notification.domain === constants.NOTIFICATION_DOMAINS.PAGE;
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var selectSideNotifications = reselect.createSelector(selectNotifications, function (notifications) {
|
|
573
|
-
return _filterInstanceProperty__default[
|
|
573
|
+
return _filterInstanceProperty__default["default"](notifications).call(notifications, function (notification) {
|
|
574
574
|
return notification.domain === constants.NOTIFICATION_DOMAINS.SIDE;
|
|
575
575
|
});
|
|
576
576
|
});
|
|
@@ -599,9 +599,9 @@ var _excluded = ["values"],
|
|
|
599
599
|
_excluded4 = ["text"],
|
|
600
600
|
_excluded5 = ["text"];
|
|
601
601
|
|
|
602
|
-
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
602
|
+
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
603
603
|
|
|
604
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default[
|
|
604
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
605
605
|
|
|
606
606
|
var NotificationsListGlobal = function NotificationsListGlobal(props) {
|
|
607
607
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -609,7 +609,7 @@ var NotificationsListGlobal = function NotificationsListGlobal(props) {
|
|
|
609
609
|
var notifications$1 = reactRedux.useSelector(selectGlobalNotifications);
|
|
610
610
|
return jsxRuntime.jsx("div", {
|
|
611
611
|
css: getStyles(props),
|
|
612
|
-
children: _mapInstanceProperty__default[
|
|
612
|
+
children: _mapInstanceProperty__default["default"](notifications$1).call(notifications$1, function (notification) {
|
|
613
613
|
// 1. Check if there is a custom notification component first
|
|
614
614
|
var CustomNotificationComponent = mapCustomNotificationToComponent(notification);
|
|
615
615
|
|
|
@@ -628,7 +628,7 @@ var NotificationsListGlobal = function NotificationsListGlobal(props) {
|
|
|
628
628
|
case constants.NOTIFICATION_KINDS_GLOBAL.info:
|
|
629
629
|
case constants.NOTIFICATION_KINDS_GLOBAL.success:
|
|
630
630
|
{
|
|
631
|
-
_valuesInstanceProperty__default[
|
|
631
|
+
_valuesInstanceProperty__default["default"](notification);
|
|
632
632
|
var genericNotification = _objectWithoutProperties(notification, _excluded);
|
|
633
633
|
|
|
634
634
|
return jsxRuntime.jsx(GenericNotification, {
|
|
@@ -668,7 +668,7 @@ var NotificationsListPage = function NotificationsListPage(props) {
|
|
|
668
668
|
var notifications$1 = reactRedux.useSelector(selectPageNotifications);
|
|
669
669
|
return jsxRuntime.jsx("div", {
|
|
670
670
|
css: getStyles(props),
|
|
671
|
-
children: _mapInstanceProperty__default[
|
|
671
|
+
children: _mapInstanceProperty__default["default"](notifications$1).call(notifications$1, function (notification) {
|
|
672
672
|
// 1. Check if there is a custom notification component first
|
|
673
673
|
var CustomNotificationComponent = mapCustomNotificationToComponent(notification);
|
|
674
674
|
|
|
@@ -687,7 +687,7 @@ var NotificationsListPage = function NotificationsListPage(props) {
|
|
|
687
687
|
case constants.NOTIFICATION_KINDS_PAGE.info:
|
|
688
688
|
case constants.NOTIFICATION_KINDS_PAGE.success:
|
|
689
689
|
{
|
|
690
|
-
_valuesInstanceProperty__default[
|
|
690
|
+
_valuesInstanceProperty__default["default"](notification);
|
|
691
691
|
var genericNotification = _objectWithoutProperties(notification, _excluded3);
|
|
692
692
|
|
|
693
693
|
return jsxRuntime.jsx(GenericNotification, {
|
|
@@ -720,7 +720,7 @@ var NotificationsListPage = function NotificationsListPage(props) {
|
|
|
720
720
|
|
|
721
721
|
return jsxRuntime.jsx(UnexpectedErrorNotification, {
|
|
722
722
|
notification: _objectSpread$1(_objectSpread$1({}, _errorNotification), {}, {
|
|
723
|
-
values: _valuesInstanceProperty__default[
|
|
723
|
+
values: _valuesInstanceProperty__default["default"](notification)
|
|
724
724
|
}),
|
|
725
725
|
dismiss: function dismiss() {
|
|
726
726
|
dispatch(notifications.removeNotification(notification.id));
|
|
@@ -741,7 +741,7 @@ var NotificationsListSide = function NotificationsListSide(props) {
|
|
|
741
741
|
var notifications$1 = reactRedux.useSelector(selectSideNotifications);
|
|
742
742
|
return jsxRuntime.jsx("div", {
|
|
743
743
|
css: getStyles(props),
|
|
744
|
-
children: _mapInstanceProperty__default[
|
|
744
|
+
children: _mapInstanceProperty__default["default"](notifications$1).call(notifications$1, function (notification) {
|
|
745
745
|
// 1. Check if there is a custom notification component first
|
|
746
746
|
var CustomNotificationComponent = mapCustomNotificationToComponent(notification);
|
|
747
747
|
|
|
@@ -791,9 +791,9 @@ var NotificationsList = function NotificationsList(props) {
|
|
|
791
791
|
|
|
792
792
|
NotificationsList.displayName = 'NotificationsList';
|
|
793
793
|
|
|
794
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
794
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
795
795
|
|
|
796
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default[
|
|
796
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
797
797
|
var defaultProps = {
|
|
798
798
|
domain: constants.NOTIFICATION_DOMAINS.SIDE,
|
|
799
799
|
kind: constants.NOTIFICATION_KINDS_SIDE.success
|
|
@@ -807,7 +807,7 @@ var Notifier = function Notifier(props) {
|
|
|
807
807
|
domain: props.domain,
|
|
808
808
|
kind: props.kind,
|
|
809
809
|
text: props.text
|
|
810
|
-
}, isNumber__default[
|
|
810
|
+
}, isNumber__default["default"](props.dismissAfter) ? _objectSpread(_objectSpread({}, props.meta), {}, {
|
|
811
811
|
dismissAfter: props.dismissAfter
|
|
812
812
|
}) : props.meta);
|
|
813
813
|
return function () {
|
|
@@ -820,11 +820,11 @@ var Notifier = function Notifier(props) {
|
|
|
820
820
|
};
|
|
821
821
|
|
|
822
822
|
Notifier.propTypes = {
|
|
823
|
-
domain: _pt__default[
|
|
824
|
-
kind: _pt__default[
|
|
825
|
-
text: _pt__default[
|
|
826
|
-
meta: _pt__default[
|
|
827
|
-
dismissAfter: _pt__default[
|
|
823
|
+
domain: _pt__default["default"].any.isRequired,
|
|
824
|
+
kind: _pt__default["default"].any.isRequired,
|
|
825
|
+
text: _pt__default["default"].string,
|
|
826
|
+
meta: _pt__default["default"].objectOf(_pt__default["default"].any),
|
|
827
|
+
dismissAfter: _pt__default["default"].number
|
|
828
828
|
};
|
|
829
829
|
Notifier.displayName = 'Notifier';
|
|
830
830
|
Notifier.defaultProps = defaultProps;
|
|
@@ -33,8 +33,8 @@ import { createSelector } from 'reselect';
|
|
|
33
33
|
import isNumber from 'lodash/isNumber';
|
|
34
34
|
import { useShowNotification } from '@commercetools-frontend/actions-global';
|
|
35
35
|
|
|
36
|
-
// NOTE: This string will be replaced
|
|
37
|
-
var version =
|
|
36
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
37
|
+
var version = "20.10.6";
|
|
38
38
|
|
|
39
39
|
var Context = /*#__PURE__*/createContext(function () {
|
|
40
40
|
return null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "
|
|
1
|
+
declare const _default: "__@APPLICATION_KIT_PACKAGE/VERSION_OF_RELEASE__";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/react-notifications",
|
|
3
|
-
"version": "20.10.
|
|
3
|
+
"version": "20.10.6",
|
|
4
4
|
"description": "React bindings for @commercetools-frontend/notifications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -11,23 +11,19 @@
|
|
|
11
11
|
"homepage": "https://docs.commercetools.com/custom-applications",
|
|
12
12
|
"keywords": ["javascript", "frontend", "react", "toolkit"],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
18
17
|
"main": "dist/commercetools-frontend-react-notifications.cjs.js",
|
|
19
18
|
"module": "dist/commercetools-frontend-react-notifications.esm.js",
|
|
20
19
|
"files": ["dist", "package.json", "LICENSE", "README.md"],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"prepare": "./../../scripts/version.js replace"
|
|
23
|
-
},
|
|
24
20
|
"dependencies": {
|
|
25
21
|
"@babel/runtime": "7.15.4",
|
|
26
22
|
"@babel/runtime-corejs3": "7.15.4",
|
|
27
|
-
"@commercetools-frontend/actions-global": "20.10.
|
|
28
|
-
"@commercetools-frontend/constants": "20.10.
|
|
29
|
-
"@commercetools-frontend/notifications": "20.10.
|
|
30
|
-
"@commercetools-frontend/sentry": "20.10.
|
|
23
|
+
"@commercetools-frontend/actions-global": "20.10.6",
|
|
24
|
+
"@commercetools-frontend/constants": "20.10.6",
|
|
25
|
+
"@commercetools-frontend/notifications": "20.10.6",
|
|
26
|
+
"@commercetools-frontend/sentry": "20.10.6",
|
|
31
27
|
"@commercetools-uikit/design-system": "^12.2.2",
|
|
32
28
|
"@commercetools-uikit/icon-button": "^12.2.2",
|
|
33
29
|
"@commercetools-uikit/icons": "^12.2.2",
|