@commercetools-frontend/actions-global 20.9.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.
- package/dist/commercetools-frontend-actions-global.cjs.dev.js +9 -9
- package/dist/commercetools-frontend-actions-global.cjs.prod.js +8 -8
- package/dist/commercetools-frontend-actions-global.esm.js +2 -2
- package/dist/declarations/src/actions/handle-action-error.d.ts +15 -15
- package/dist/declarations/src/actions/hide-all-page-notifications.d.ts +6 -6
- package/dist/declarations/src/actions/index.d.ts +5 -5
- package/dist/declarations/src/actions/show-api-error-notification.d.ts +2 -2
- package/dist/declarations/src/actions/show-notification.d.ts +3 -3
- package/dist/declarations/src/actions/show-unexpected-error-notification.d.ts +3 -3
- package/dist/declarations/src/export-types.d.ts +2 -2
- package/dist/declarations/src/hooks/index.d.ts +5 -5
- package/dist/declarations/src/hooks/use-hide-all-page-notifications.d.ts +3 -3
- package/dist/declarations/src/hooks/use-on-action-error.d.ts +2 -2
- package/dist/declarations/src/hooks/use-show-api-error-notification.d.ts +2 -2
- package/dist/declarations/src/hooks/use-show-notification.d.ts +3 -3
- package/dist/declarations/src/hooks/use-show-unexpected-error-notification.d.ts +2 -2
- package/dist/declarations/src/index.d.ts +5 -5
- package/dist/declarations/src/types.d.ts +20 -20
- package/dist/declarations/src/version.d.ts +2 -2
- package/package.json +9 -13
|
@@ -36,23 +36,23 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
|
|
|
36
36
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
37
37
|
var isNumber__default = /*#__PURE__*/_interopDefault(isNumber);
|
|
38
38
|
|
|
39
|
-
// NOTE: This string will be replaced
|
|
40
|
-
var version =
|
|
39
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
40
|
+
var version = "20.10.6";
|
|
41
41
|
|
|
42
|
-
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
42
|
+
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; }
|
|
43
43
|
|
|
44
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default[
|
|
44
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source), true)).call(_context2, 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 _context3; _forEachInstanceProperty__default["default"](_context3 = ownKeys$1(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
45
45
|
function showNotification(notification) {
|
|
46
46
|
var meta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
47
47
|
if (process.env.NODE_ENV !== 'production') if (notification.domain) {
|
|
48
48
|
var _context;
|
|
49
49
|
|
|
50
|
-
if (!_includesInstanceProperty__default[
|
|
50
|
+
if (!_includesInstanceProperty__default["default"](_context = _Object$values__default["default"](constants.NOTIFICATION_DOMAINS)).call(_context, notification.domain)) // eslint-disable-next-line no-console
|
|
51
51
|
console.warn("Unknown notification domain \"".concat(notification.domain, "\""), notification);
|
|
52
52
|
} // eslint-disable-next-line no-console
|
|
53
53
|
else console.warn('Notification is missing domain', notification);
|
|
54
54
|
var dismissAfter = meta.dismissAfter;
|
|
55
|
-
if (!isNumber__default[
|
|
55
|
+
if (!isNumber__default["default"](dismissAfter)) dismissAfter = notification.kind === constants.NOTIFICATION_KINDS_SIDE.success ? 5000 : 0;
|
|
56
56
|
return notifications.addNotification(notification, _objectSpread$1(_objectSpread$1({}, meta), {}, {
|
|
57
57
|
dismissAfter: dismissAfter
|
|
58
58
|
}));
|
|
@@ -67,7 +67,7 @@ function showApiErrorNotification(_ref) {
|
|
|
67
67
|
values: {
|
|
68
68
|
// NOTE: Some sources or errors (e.g. GraphQL) return an array or object.
|
|
69
69
|
// The cast into an array happens here so that consumers can pass both types.
|
|
70
|
-
errors: _Array$isArray__default[
|
|
70
|
+
errors: _Array$isArray__default["default"](errors) ? errors : [errors]
|
|
71
71
|
}
|
|
72
72
|
}, {
|
|
73
73
|
dismissAfter: 0
|
|
@@ -135,9 +135,9 @@ function hideAllPageNotifications() {
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
138
|
+
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; }
|
|
139
139
|
|
|
140
|
-
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[
|
|
140
|
+
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; }
|
|
141
141
|
// a speficic notification.
|
|
142
142
|
// Example:
|
|
143
143
|
// const showSuccessNotification = useShowNotification({
|
|
@@ -34,16 +34,16 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
|
|
|
34
34
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
35
35
|
var isNumber__default = /*#__PURE__*/_interopDefault(isNumber);
|
|
36
36
|
|
|
37
|
-
// NOTE: This string will be replaced
|
|
38
|
-
var version =
|
|
37
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
38
|
+
var version = "20.10.6";
|
|
39
39
|
|
|
40
|
-
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
40
|
+
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; }
|
|
41
41
|
|
|
42
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default[
|
|
42
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source), true)).call(_context2, 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 _context3; _forEachInstanceProperty__default["default"](_context3 = ownKeys$1(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
43
43
|
function showNotification(notification) {
|
|
44
44
|
var meta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
45
45
|
var dismissAfter = meta.dismissAfter;
|
|
46
|
-
if (!isNumber__default[
|
|
46
|
+
if (!isNumber__default["default"](dismissAfter)) dismissAfter = notification.kind === constants.NOTIFICATION_KINDS_SIDE.success ? 5000 : 0;
|
|
47
47
|
return notifications.addNotification(notification, _objectSpread$1(_objectSpread$1({}, meta), {}, {
|
|
48
48
|
dismissAfter: dismissAfter
|
|
49
49
|
}));
|
|
@@ -58,7 +58,7 @@ function showApiErrorNotification(_ref) {
|
|
|
58
58
|
values: {
|
|
59
59
|
// NOTE: Some sources or errors (e.g. GraphQL) return an array or object.
|
|
60
60
|
// The cast into an array happens here so that consumers can pass both types.
|
|
61
|
-
errors: _Array$isArray__default[
|
|
61
|
+
errors: _Array$isArray__default["default"](errors) ? errors : [errors]
|
|
62
62
|
}
|
|
63
63
|
}, {
|
|
64
64
|
dismissAfter: 0
|
|
@@ -126,9 +126,9 @@ function hideAllPageNotifications() {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
129
|
+
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; }
|
|
130
130
|
|
|
131
|
-
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[
|
|
131
|
+
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; }
|
|
132
132
|
// a speficic notification.
|
|
133
133
|
// Example:
|
|
134
134
|
// const showSuccessNotification = useShowNotification({
|
|
@@ -17,8 +17,8 @@ import { addNotification } from '@commercetools-frontend/notifications';
|
|
|
17
17
|
import { useCallback } from 'react';
|
|
18
18
|
import { useDispatch } from 'react-redux';
|
|
19
19
|
|
|
20
|
-
// NOTE: This string will be replaced
|
|
21
|
-
var version =
|
|
20
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
21
|
+
var version = "20.10.6";
|
|
22
22
|
|
|
23
23
|
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
24
24
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ThunkDispatch } from 'redux-thunk';
|
|
2
|
-
import type { TAppNotificationApiError, TStatusCode } from '@commercetools-frontend/constants';
|
|
3
|
-
import showApiErrorNotification from './show-api-error-notification';
|
|
4
|
-
import showUnexpectedErrorNotification from './show-unexpected-error-notification';
|
|
5
|
-
declare type ApiError = {
|
|
6
|
-
statusCode: TStatusCode;
|
|
7
|
-
body: {
|
|
8
|
-
message: string;
|
|
9
|
-
errors?: TAppNotificationApiError | TAppNotificationApiError[];
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare type ActionError = Error | ApiError;
|
|
13
|
-
export declare type DispatchActionError = ThunkDispatch<null, null, ReturnType<typeof showApiErrorNotification> | ReturnType<typeof showUnexpectedErrorNotification>>;
|
|
14
|
-
export default function handleActionError(error: ActionError): (dispatch: DispatchActionError) =>
|
|
15
|
-
export {};
|
|
1
|
+
import type { ThunkDispatch } from 'redux-thunk';
|
|
2
|
+
import type { TAppNotificationApiError, TStatusCode } from '@commercetools-frontend/constants';
|
|
3
|
+
import showApiErrorNotification from './show-api-error-notification';
|
|
4
|
+
import showUnexpectedErrorNotification from './show-unexpected-error-notification';
|
|
5
|
+
declare type ApiError = {
|
|
6
|
+
statusCode: TStatusCode;
|
|
7
|
+
body: {
|
|
8
|
+
message: string;
|
|
9
|
+
errors?: TAppNotificationApiError | TAppNotificationApiError[];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare type ActionError = Error | ApiError;
|
|
13
|
+
export declare type DispatchActionError = ThunkDispatch<null, null, ReturnType<typeof showApiErrorNotification> | ReturnType<typeof showUnexpectedErrorNotification>>;
|
|
14
|
+
export default function handleActionError(error: ActionError): (dispatch: DispatchActionError) => unknown;
|
|
15
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HIDE_ALL_PAGE_NOTIFICATIONS } from '@commercetools-frontend/constants';
|
|
2
|
-
declare type HideAllPageNotificationAction = {
|
|
3
|
-
type: typeof HIDE_ALL_PAGE_NOTIFICATIONS;
|
|
4
|
-
};
|
|
5
|
-
export default function hideAllPageNotifications(): HideAllPageNotificationAction;
|
|
6
|
-
export {};
|
|
1
|
+
import { HIDE_ALL_PAGE_NOTIFICATIONS } from '@commercetools-frontend/constants';
|
|
2
|
+
declare type HideAllPageNotificationAction = {
|
|
3
|
+
type: typeof HIDE_ALL_PAGE_NOTIFICATIONS;
|
|
4
|
+
};
|
|
5
|
+
export default function hideAllPageNotifications(): HideAllPageNotificationAction;
|
|
6
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as handleActionError } from './handle-action-error';
|
|
2
|
-
export { default as hideAllPageNotifications } from './hide-all-page-notifications';
|
|
3
|
-
export { default as showApiErrorNotification } from './show-api-error-notification';
|
|
4
|
-
export { default as showNotification } from './show-notification';
|
|
5
|
-
export { default as showUnexpectedErrorNotification } from './show-unexpected-error-notification';
|
|
1
|
+
export { default as handleActionError } from './handle-action-error';
|
|
2
|
+
export { default as hideAllPageNotifications } from './hide-all-page-notifications';
|
|
3
|
+
export { default as showApiErrorNotification } from './show-api-error-notification';
|
|
4
|
+
export { default as showNotification } from './show-notification';
|
|
5
|
+
export { default as showUnexpectedErrorNotification } from './show-unexpected-error-notification';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { TApiErrorNotification, TApiErrorNotificationOptions } from '../types';
|
|
2
|
-
export default function showApiErrorNotification({ errors, }: TApiErrorNotificationOptions): import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<TApiErrorNotification, "id">>;
|
|
1
|
+
import type { TApiErrorNotification, TApiErrorNotificationOptions } from '../types';
|
|
2
|
+
export default function showApiErrorNotification({ errors, }: TApiErrorNotificationOptions): import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<TApiErrorNotification, "id">>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { TNotificationMetaOptions } from '@commercetools-frontend/notifications';
|
|
2
|
-
import type { TShowNotification } from '../types';
|
|
3
|
-
export default function showNotification<Notification extends TShowNotification>(notification: Notification, meta?: TNotificationMetaOptions): import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<Notification, "id">>;
|
|
1
|
+
import type { TNotificationMetaOptions } from '@commercetools-frontend/notifications';
|
|
2
|
+
import type { TShowNotification } from '../types';
|
|
3
|
+
export default function showNotification<Notification extends TShowNotification>(notification: Notification, meta?: TNotificationMetaOptions): import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<Notification, "id">>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { TAppNotificationValuesUnexpectedError } from '@commercetools-frontend/constants';
|
|
2
|
-
import type { TUnexpectedErrorNotification } from '../types';
|
|
3
|
-
export default function showUnexpectedErrorNotification({ errorId, }?: TAppNotificationValuesUnexpectedError): import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<TUnexpectedErrorNotification, "id">>;
|
|
1
|
+
import type { TAppNotificationValuesUnexpectedError } from '@commercetools-frontend/constants';
|
|
2
|
+
import type { TUnexpectedErrorNotification } from '../types';
|
|
3
|
+
export default function showUnexpectedErrorNotification({ errorId, }?: TAppNotificationValuesUnexpectedError): import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<TUnexpectedErrorNotification, "id">>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DispatchActionError } from './actions/handle-action-error';
|
|
2
|
-
export declare type TDispatchActionError = DispatchActionError;
|
|
1
|
+
import type { DispatchActionError } from './actions/handle-action-error';
|
|
2
|
+
export declare type TDispatchActionError = DispatchActionError;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as useShowNotification } from './use-show-notification';
|
|
2
|
-
export { default as useShowApiErrorNotification } from './use-show-api-error-notification';
|
|
3
|
-
export { default as useShowUnexpectedErrorNotification } from './use-show-unexpected-error-notification';
|
|
4
|
-
export { default as useHideAllPageNotifications } from './use-hide-all-page-notifications';
|
|
5
|
-
export { default as useOnActionError } from './use-on-action-error';
|
|
1
|
+
export { default as useShowNotification } from './use-show-notification';
|
|
2
|
+
export { default as useShowApiErrorNotification } from './use-show-api-error-notification';
|
|
3
|
+
export { default as useShowUnexpectedErrorNotification } from './use-show-unexpected-error-notification';
|
|
4
|
+
export { default as useHideAllPageNotifications } from './use-hide-all-page-notifications';
|
|
5
|
+
export { default as useOnActionError } from './use-on-action-error';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function useHideAllPageNotifications(): () => {
|
|
2
|
-
type: "HIDE_ALL_PAGE_NOTIFICATIONS";
|
|
3
|
-
};
|
|
1
|
+
export default function useHideAllPageNotifications(): () => {
|
|
2
|
+
type: "HIDE_ALL_PAGE_NOTIFICATIONS";
|
|
3
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ActionError } from '../actions/handle-action-error';
|
|
2
|
-
export default function useOnActionError(): (error: ActionError) => (dispatch: import("../actions/handle-action-error").DispatchActionError) =>
|
|
1
|
+
import type { ActionError } from '../actions/handle-action-error';
|
|
2
|
+
export default function useOnActionError(): (error: ActionError) => (dispatch: import("../actions/handle-action-error").DispatchActionError) => unknown;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { TApiErrorNotificationOptions } from '../types';
|
|
2
|
-
export default function useShowApiErrorNotification(): (options: TApiErrorNotificationOptions) => import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<import("../types").TApiErrorNotification, "id">>;
|
|
1
|
+
import type { TApiErrorNotificationOptions } from '../types';
|
|
2
|
+
export default function useShowApiErrorNotification(): (options: TApiErrorNotificationOptions) => import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<import("../types").TApiErrorNotification, "id">>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { TNotificationMetaOptions } from '@commercetools-frontend/notifications';
|
|
2
|
-
import type { TShowNotification } from '../types';
|
|
3
|
-
export default function useShowNotification<Notification extends TShowNotification>(notificationFragment?: Partial<Notification>): (content: Notification, meta?: TNotificationMetaOptions | undefined) => import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<Notification, "id">>;
|
|
1
|
+
import type { TNotificationMetaOptions } from '@commercetools-frontend/notifications';
|
|
2
|
+
import type { TShowNotification } from '../types';
|
|
3
|
+
export default function useShowNotification<Notification extends TShowNotification>(notificationFragment?: Partial<Notification>): (content: Notification, meta?: TNotificationMetaOptions | undefined) => import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<Notification, "id">>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { TAppNotificationValuesUnexpectedError } from '@commercetools-frontend/constants';
|
|
2
|
-
export default function useShowUnexpectedErrorNotification(): (options: TAppNotificationValuesUnexpectedError) => import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<import("..").TUnexpectedErrorNotification, "id">>;
|
|
1
|
+
import type { TAppNotificationValuesUnexpectedError } from '@commercetools-frontend/constants';
|
|
2
|
+
export default function useShowUnexpectedErrorNotification(): (options: TAppNotificationValuesUnexpectedError) => import("@commercetools-frontend/notifications").TAddNotificationAction<Pick<import("..").TUnexpectedErrorNotification, "id">>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as version } from './version';
|
|
2
|
-
export * from './actions';
|
|
3
|
-
export * from './hooks';
|
|
4
|
-
export * from './types';
|
|
5
|
-
export * from './export-types';
|
|
1
|
+
export { default as version } from './version';
|
|
2
|
+
export * from './actions';
|
|
3
|
+
export * from './hooks';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './export-types';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { TNotification } from '@commercetools-frontend/notifications';
|
|
2
|
-
import type { TAppNotification, TAppNotificationDomain, TAppNotificationKind, TAppNotificationApiError, TAppNotificationValuesApiError, TAppNotificationValuesUnexpectedError } from '@commercetools-frontend/constants';
|
|
3
|
-
export declare type TShowNotification = TNotification & {
|
|
4
|
-
domain: TAppNotificationDomain;
|
|
5
|
-
kind: TAppNotificationKind;
|
|
6
|
-
text?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare type TApiErrorNotification = TNotification & TAppNotification<{
|
|
9
|
-
domain: 'page';
|
|
10
|
-
kind: 'api-error';
|
|
11
|
-
values: TAppNotificationValuesApiError;
|
|
12
|
-
}>;
|
|
13
|
-
export declare type TUnexpectedErrorNotification = TNotification & TAppNotification<{
|
|
14
|
-
domain: 'page';
|
|
15
|
-
kind: 'unexpected-error';
|
|
16
|
-
values: TAppNotificationValuesUnexpectedError;
|
|
17
|
-
}>;
|
|
18
|
-
export declare type TApiErrorNotificationOptions = {
|
|
19
|
-
errors: TAppNotificationApiError | TAppNotificationApiError[];
|
|
20
|
-
};
|
|
1
|
+
import type { TNotification } from '@commercetools-frontend/notifications';
|
|
2
|
+
import type { TAppNotification, TAppNotificationDomain, TAppNotificationKind, TAppNotificationApiError, TAppNotificationValuesApiError, TAppNotificationValuesUnexpectedError } from '@commercetools-frontend/constants';
|
|
3
|
+
export declare type TShowNotification = TNotification & {
|
|
4
|
+
domain: TAppNotificationDomain;
|
|
5
|
+
kind: TAppNotificationKind;
|
|
6
|
+
text?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare type TApiErrorNotification = TNotification & TAppNotification<{
|
|
9
|
+
domain: 'page';
|
|
10
|
+
kind: 'api-error';
|
|
11
|
+
values: TAppNotificationValuesApiError;
|
|
12
|
+
}>;
|
|
13
|
+
export declare type TUnexpectedErrorNotification = TNotification & TAppNotification<{
|
|
14
|
+
domain: 'page';
|
|
15
|
+
kind: 'unexpected-error';
|
|
16
|
+
values: TAppNotificationValuesUnexpectedError;
|
|
17
|
+
}>;
|
|
18
|
+
export declare type TApiErrorNotificationOptions = {
|
|
19
|
+
errors: TAppNotificationApiError | TAppNotificationApiError[];
|
|
20
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: "__@APPLICATION_KIT_PACKAGE/VERSION_OF_RELEASE__";
|
|
2
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/actions-global",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.10.6",
|
|
4
4
|
"description": "Global redux actions for a MC application",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -11,32 +11,28 @@
|
|
|
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-actions-global.cjs.js",
|
|
19
18
|
"module": "dist/commercetools-frontend-actions-global.esm.js",
|
|
20
19
|
"files": ["dist", "package.json", "LICENSE", "README.md"],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"prepare": "./../../scripts/version.js replace"
|
|
23
|
-
},
|
|
24
20
|
"dependencies": {
|
|
25
|
-
"@babel/runtime": "7.
|
|
26
|
-
"@babel/runtime-corejs3": "7.
|
|
27
|
-
"@commercetools-frontend/browser-history": "20.
|
|
28
|
-
"@commercetools-frontend/constants": "20.
|
|
29
|
-
"@commercetools-frontend/notifications": "20.
|
|
30
|
-
"@commercetools-frontend/sentry": "20.
|
|
21
|
+
"@babel/runtime": "7.15.4",
|
|
22
|
+
"@babel/runtime-corejs3": "7.15.4",
|
|
23
|
+
"@commercetools-frontend/browser-history": "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
|
"@types/lodash": "^4.14.167",
|
|
32
28
|
"@types/react": "^17.0.16",
|
|
33
29
|
"@types/react-redux": "^7.1.16",
|
|
34
30
|
"lodash": "4.17.21",
|
|
35
|
-
"redux-thunk": "2.
|
|
31
|
+
"redux-thunk": "2.4.0"
|
|
36
32
|
},
|
|
37
33
|
"devDependencies": {
|
|
38
34
|
"react": "17.0.2",
|
|
39
|
-
"react-redux": "7.2.
|
|
35
|
+
"react-redux": "7.2.6",
|
|
40
36
|
"redux": "4.1.1"
|
|
41
37
|
},
|
|
42
38
|
"peerDependencies": {
|