@commercetools-frontend/react-notifications 0.0.0-CRAFT-1791-20251006162610
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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/commercetools-frontend-react-notifications.cjs.d.ts +2 -0
- package/dist/commercetools-frontend-react-notifications.cjs.dev.js +812 -0
- package/dist/commercetools-frontend-react-notifications.cjs.js +7 -0
- package/dist/commercetools-frontend-react-notifications.cjs.prod.js +806 -0
- package/dist/commercetools-frontend-react-notifications.esm.js +779 -0
- package/dist/declarations/src/components/map-notification-to-component/index.d.ts +4 -0
- package/dist/declarations/src/components/map-notification-to-component/map-notification-to-component.d.ts +12 -0
- package/dist/declarations/src/components/notification/index.d.ts +1 -0
- package/dist/declarations/src/components/notification/notification.d.ts +14 -0
- package/dist/declarations/src/components/notification-kinds/api-error-message/api-error-message.d.ts +34 -0
- package/dist/declarations/src/components/notification-kinds/api-error-message/index.d.ts +1 -0
- package/dist/declarations/src/components/notifications-list/index.d.ts +1 -0
- package/dist/declarations/src/components/notifications-list/notifications-list.d.ts +9 -0
- package/dist/declarations/src/components/notifications-list/selectors.d.ts +18 -0
- package/dist/declarations/src/components/notifications-list/types.d.ts +4 -0
- package/dist/declarations/src/components/notifier/index.d.ts +1 -0
- package/dist/declarations/src/components/notifier/notifier.d.ts +15 -0
- package/dist/declarations/src/export-types.d.ts +2 -0
- package/dist/declarations/src/index.d.ts +8 -0
- package/dist/declarations/src/version.d.ts +2 -0
- package/package.json +79 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
import type { TAppNotificationGlobal, TAppNotificationPage, TAppNotificationSide } from '@commercetools-frontend/constants';
|
|
3
|
+
export type Props = {
|
|
4
|
+
mapNotificationToComponent: (notification: TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide) => ElementType | null;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare function NotificationProviderForCustomComponent(props: Props): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare namespace NotificationProviderForCustomComponent {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const useCustomNotificationComponent: () => (notification: TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide) => ElementType | null;
|
|
12
|
+
export default NotificationProviderForCustomComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./notification.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import type { TAppNotificationKind, TAppNotificationDomain } from '@commercetools-frontend/constants';
|
|
3
|
+
export type Props = {
|
|
4
|
+
domain: TAppNotificationDomain;
|
|
5
|
+
type: TAppNotificationKind;
|
|
6
|
+
fixed?: boolean;
|
|
7
|
+
onCloseClick?: (event: SyntheticEvent) => void;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare const Notification: {
|
|
11
|
+
({ fixed, ...props }: Props): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export default Notification;
|
package/dist/declarations/src/components/notification-kinds/api-error-message/api-error-message.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TAppNotificationApiError } from '@commercetools-frontend/constants';
|
|
2
|
+
type ExtraErrorExtensionsFields = {
|
|
3
|
+
field?: string;
|
|
4
|
+
duplicateValue?: string;
|
|
5
|
+
referencedBy?: string;
|
|
6
|
+
invalidValue?: string | {
|
|
7
|
+
overlappingPrices: string;
|
|
8
|
+
} | {
|
|
9
|
+
validFrom: string;
|
|
10
|
+
validUntil: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type ExtraErrorFields = ExtraErrorExtensionsFields & {
|
|
14
|
+
errorByExtension?: {
|
|
15
|
+
id: string;
|
|
16
|
+
key?: string;
|
|
17
|
+
};
|
|
18
|
+
localizedMessage?: {
|
|
19
|
+
[locale: string]: string;
|
|
20
|
+
};
|
|
21
|
+
detailedErrorMessage?: string;
|
|
22
|
+
attribute?: {
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
extensions?: ExtraErrorExtensionsFields;
|
|
26
|
+
};
|
|
27
|
+
type Props = {
|
|
28
|
+
error: TAppNotificationApiError<ExtraErrorFields>;
|
|
29
|
+
};
|
|
30
|
+
declare const ApiErrorMessage: {
|
|
31
|
+
(props: Props): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
export default ApiErrorMessage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./api-error-message.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./notifications-list.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TAppNotificationDomain } from '@commercetools-frontend/constants';
|
|
2
|
+
type Props = {
|
|
3
|
+
domain: TAppNotificationDomain;
|
|
4
|
+
};
|
|
5
|
+
declare const NotificationsList: {
|
|
6
|
+
(props: Props): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export default NotificationsList;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TAppNotificationGlobal, TAppNotificationPage, TAppNotificationSide } from '@commercetools-frontend/constants';
|
|
2
|
+
import type { TAppState } from "./types.js";
|
|
3
|
+
export declare const selectNotifications: (state: TAppState) => (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[];
|
|
4
|
+
export declare const selectGlobalNotifications: ((state: TAppState) => TAppNotificationGlobal[]) & import("reselect").OutputSelectorFields<(args_0: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[]) => TAppNotificationGlobal[], {
|
|
5
|
+
clearCache: () => void;
|
|
6
|
+
}> & {
|
|
7
|
+
clearCache: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const selectPageNotifications: ((state: TAppState) => TAppNotificationPage[]) & import("reselect").OutputSelectorFields<(args_0: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[]) => TAppNotificationPage[], {
|
|
10
|
+
clearCache: () => void;
|
|
11
|
+
}> & {
|
|
12
|
+
clearCache: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const selectSideNotifications: ((state: TAppState) => TAppNotificationSide[]) & import("reselect").OutputSelectorFields<(args_0: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[]) => TAppNotificationSide[], {
|
|
15
|
+
clearCache: () => void;
|
|
16
|
+
}> & {
|
|
17
|
+
clearCache: () => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./notifier.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TAppNotificationDomain, TAppNotificationKind } from '@commercetools-frontend/constants';
|
|
2
|
+
type Props = {
|
|
3
|
+
domain: TAppNotificationDomain;
|
|
4
|
+
kind: TAppNotificationKind;
|
|
5
|
+
text?: string;
|
|
6
|
+
meta?: {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
dismissAfter?: number;
|
|
10
|
+
};
|
|
11
|
+
declare const Notifier: {
|
|
12
|
+
({ domain, kind, ...props }: Props): null;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export default Notifier;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as version } from "./version.js";
|
|
2
|
+
export * from "./export-types.js";
|
|
3
|
+
export { default as NotificationProviderForCustomComponent } from "./components/map-notification-to-component/index.js";
|
|
4
|
+
export { default as Notification } from "./components/notification/index.js";
|
|
5
|
+
export { default as NotificationsList } from "./components/notifications-list/index.js";
|
|
6
|
+
export { selectSideNotifications, selectGlobalNotifications, selectPageNotifications, } from "./components/notifications-list/selectors.js";
|
|
7
|
+
export { default as Notifier } from "./components/notifier/index.js";
|
|
8
|
+
export { default as ApiErrorMessage } from "./components/notification-kinds/api-error-message/index.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@commercetools-frontend/react-notifications",
|
|
3
|
+
"version": "0.0.0-CRAFT-1791-20251006162610",
|
|
4
|
+
"description": "React bindings for @commercetools-frontend/notifications",
|
|
5
|
+
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/commercetools/merchant-center-application-kit.git",
|
|
9
|
+
"directory": "packages/react-notifications"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://docs.commercetools.com/merchant-center-customizations",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"javascript",
|
|
14
|
+
"frontend",
|
|
15
|
+
"react",
|
|
16
|
+
"toolkit"
|
|
17
|
+
],
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"main": "dist/commercetools-frontend-react-notifications.cjs.js",
|
|
23
|
+
"module": "dist/commercetools-frontend-react-notifications.esm.js",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"README.md"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@babel/runtime": "^7.22.15",
|
|
32
|
+
"@babel/runtime-corejs3": "^7.22.15",
|
|
33
|
+
"@commercetools-frontend/actions-global": "0.0.0-CRAFT-1791-20251006162610",
|
|
34
|
+
"@commercetools-frontend/application-components": "0.0.0-CRAFT-1791-20251006162610",
|
|
35
|
+
"@commercetools-frontend/constants": "0.0.0-CRAFT-1791-20251006162610",
|
|
36
|
+
"@commercetools-frontend/notifications": "0.0.0-CRAFT-1791-20251006162610",
|
|
37
|
+
"@commercetools-frontend/sentry": "0.0.0-CRAFT-1791-20251006162610",
|
|
38
|
+
"@commercetools-uikit/design-system": "^20.2.3",
|
|
39
|
+
"@commercetools-uikit/hooks": "^20.2.3",
|
|
40
|
+
"@commercetools-uikit/icon-button": "^20.2.3",
|
|
41
|
+
"@commercetools-uikit/icons": "^20.2.3",
|
|
42
|
+
"@commercetools-uikit/secondary-icon-button": "^20.2.3",
|
|
43
|
+
"@commercetools-uikit/spacings": "^20.2.3",
|
|
44
|
+
"@commercetools-uikit/utils": "^20.2.3",
|
|
45
|
+
"@emotion/react": "^11.14.0",
|
|
46
|
+
"@emotion/styled": "^11.14.0",
|
|
47
|
+
"@types/history": "^4.7.11",
|
|
48
|
+
"@types/lodash": "^4.14.198",
|
|
49
|
+
"@types/prop-types": "^15.7.5",
|
|
50
|
+
"@types/react": "^19.0.3",
|
|
51
|
+
"@types/react-dom": "^19.0.2",
|
|
52
|
+
"@types/react-redux": "^7.1.26",
|
|
53
|
+
"@types/react-router": "^5.1.20",
|
|
54
|
+
"@types/react-router-dom": "^5.3.3",
|
|
55
|
+
"lodash": "4.17.21",
|
|
56
|
+
"moment": "^2.29.4",
|
|
57
|
+
"moment-timezone": "^0.6.0",
|
|
58
|
+
"prop-types": "15.8.1",
|
|
59
|
+
"reselect": "4.1.8"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/jest": "^29.5.14",
|
|
63
|
+
"@types/testing-library__jest-dom": "^5.14.9",
|
|
64
|
+
"jest": "29.7.0",
|
|
65
|
+
"jest-mock": "29.7.0",
|
|
66
|
+
"react": "19.0.0",
|
|
67
|
+
"react-dom": "19.0.0",
|
|
68
|
+
"react-intl": "^7.1.4",
|
|
69
|
+
"react-redux": "9.2.0",
|
|
70
|
+
"react-router-dom": "5.3.4"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"react": "19.x",
|
|
74
|
+
"react-dom": "19.x",
|
|
75
|
+
"react-intl": "7.x",
|
|
76
|
+
"react-redux": "7.x || 9.x",
|
|
77
|
+
"react-router-dom": "5.x"
|
|
78
|
+
}
|
|
79
|
+
}
|