@commercetools-frontend/react-notifications 0.0.0-FEC-157-preview-releases-20241126230331

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -0
  3. package/dist/commercetools-frontend-react-notifications.cjs.d.ts +2 -0
  4. package/dist/commercetools-frontend-react-notifications.cjs.d.ts.map +1 -0
  5. package/dist/commercetools-frontend-react-notifications.cjs.dev.js +845 -0
  6. package/dist/commercetools-frontend-react-notifications.cjs.js +7 -0
  7. package/dist/commercetools-frontend-react-notifications.cjs.prod.js +816 -0
  8. package/dist/commercetools-frontend-react-notifications.esm.js +811 -0
  9. package/dist/declarations/src/components/map-notification-to-component/index.d.ts +4 -0
  10. package/dist/declarations/src/components/map-notification-to-component/map-notification-to-component.d.ts +12 -0
  11. package/dist/declarations/src/components/notification/index.d.ts +1 -0
  12. package/dist/declarations/src/components/notification/messages.d.ts +8 -0
  13. package/dist/declarations/src/components/notification/notification.d.ts +15 -0
  14. package/dist/declarations/src/components/notification/notification.styles.d.ts +12 -0
  15. package/dist/declarations/src/components/notification-kinds/api-error/api-error.d.ts +16 -0
  16. package/dist/declarations/src/components/notification-kinds/api-error/index.d.ts +1 -0
  17. package/dist/declarations/src/components/notification-kinds/api-error-message/api-error-message.d.ts +34 -0
  18. package/dist/declarations/src/components/notification-kinds/api-error-message/index.d.ts +1 -0
  19. package/dist/declarations/src/components/notification-kinds/api-error-message/messages.d.ts +153 -0
  20. package/dist/declarations/src/components/notification-kinds/generic/generic.d.ts +15 -0
  21. package/dist/declarations/src/components/notification-kinds/generic/index.d.ts +1 -0
  22. package/dist/declarations/src/components/notification-kinds/unexpected-error/index.d.ts +1 -0
  23. package/dist/declarations/src/components/notification-kinds/unexpected-error/unexpected-error.d.ts +16 -0
  24. package/dist/declarations/src/components/notifications-list/index.d.ts +1 -0
  25. package/dist/declarations/src/components/notifications-list/notifications-list.d.ts +9 -0
  26. package/dist/declarations/src/components/notifications-list/notifications-list.styles.d.ts +6 -0
  27. package/dist/declarations/src/components/notifications-list/selectors.d.ts +18 -0
  28. package/dist/declarations/src/components/notifications-list/types.d.ts +4 -0
  29. package/dist/declarations/src/components/notifier/index.d.ts +1 -0
  30. package/dist/declarations/src/components/notifier/notifier.d.ts +16 -0
  31. package/dist/declarations/src/export-types.d.ts +2 -0
  32. package/dist/declarations/src/index.d.ts +8 -0
  33. package/dist/declarations/src/utils/filter-data-attributes.d.ts +1 -0
  34. package/dist/declarations/src/version.d.ts +2 -0
  35. package/package.json +79 -0
@@ -0,0 +1,4 @@
1
+ import type { Props } from './map-notification-to-component';
2
+ export type TProps = Props;
3
+ export { default } from './map-notification-to-component';
4
+ export { useCustomNotificationComponent } from './map-notification-to-component';
@@ -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/types/jsx-namespace").EmotionJSX.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';
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ hideNotification: {
3
+ id: string;
4
+ description: string;
5
+ defaultMessage: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,15 @@
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
+ (props: Props): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
12
+ displayName: string;
13
+ defaultProps: Pick<Props, "fixed">;
14
+ };
15
+ export default Notification;
@@ -0,0 +1,12 @@
1
+ import { type SerializedStyles } from '@emotion/react';
2
+ import type { TAppNotificationKind, TAppNotificationDomain } from '@commercetools-frontend/constants';
3
+ type StyleProps = {
4
+ type: TAppNotificationKind;
5
+ domain: TAppNotificationDomain;
6
+ fixed: boolean;
7
+ };
8
+ declare const getStylesForNotificationIcon: (props: StyleProps) => SerializedStyles;
9
+ declare const getStylesForCloseIcon: (props: StyleProps) => SerializedStyles;
10
+ declare const getStylesForContent: (props: StyleProps) => SerializedStyles;
11
+ declare const getStylesForNotification: (props: StyleProps) => SerializedStyles;
12
+ export { getStylesForNotificationIcon, getStylesForCloseIcon, getStylesForContent, getStylesForNotification, };
@@ -0,0 +1,16 @@
1
+ import { SyntheticEvent } from 'react';
2
+ import type { TAppNotification, TAppNotificationValuesApiError } from '@commercetools-frontend/constants';
3
+ import { NOTIFICATION_DOMAINS, NOTIFICATION_KINDS_PAGE } from '@commercetools-frontend/constants';
4
+ type Props = {
5
+ notification: TAppNotification<{
6
+ domain: typeof NOTIFICATION_DOMAINS.PAGE;
7
+ kind: (typeof NOTIFICATION_KINDS_PAGE)['api-error'];
8
+ values: TAppNotificationValuesApiError;
9
+ }>;
10
+ dismiss: (event: SyntheticEvent) => void;
11
+ };
12
+ declare const ApiErrorNotification: {
13
+ (props: Props): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
14
+ displayName: string;
15
+ };
16
+ export default ApiErrorNotification;
@@ -0,0 +1 @@
1
+ export { default } from './api-error';
@@ -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/types/jsx-namespace").EmotionJSX.Element;
32
+ displayName: string;
33
+ };
34
+ export default ApiErrorMessage;
@@ -0,0 +1 @@
1
+ export { default } from './api-error-message';
@@ -0,0 +1,153 @@
1
+ declare const _default: {
2
+ General: {
3
+ id: string;
4
+ description: string;
5
+ defaultMessage: string;
6
+ };
7
+ OverlappingPrices: {
8
+ id: string;
9
+ description: string;
10
+ defaultMessage: string;
11
+ };
12
+ ConcurrentModificationBulkEdit: {
13
+ id: string;
14
+ description: string;
15
+ defaultMessage: string;
16
+ };
17
+ ConcurrentModification: {
18
+ id: string;
19
+ description: string;
20
+ defaultMessage: string;
21
+ };
22
+ DuplicateAttributeValue: {
23
+ id: string;
24
+ description: string;
25
+ defaultMessage: string;
26
+ };
27
+ DuplicateAttributeValues: {
28
+ id: string;
29
+ description: string;
30
+ defaultMessage: string;
31
+ };
32
+ DuplicateField: {
33
+ id: string;
34
+ description: string;
35
+ defaultMessage: string;
36
+ };
37
+ DuplicateSlug: {
38
+ id: string;
39
+ description: string;
40
+ defaultMessage: string;
41
+ };
42
+ DuplicatePriceScope: {
43
+ id: string;
44
+ description: string;
45
+ defaultMessage: string;
46
+ };
47
+ DuplicateStandalonePriceScope: {
48
+ id: string;
49
+ description: string;
50
+ defaultMessage: string;
51
+ };
52
+ DuplicateVariantValues: {
53
+ id: string;
54
+ description: string;
55
+ defaultMessage: string;
56
+ };
57
+ InvalidDateRange: {
58
+ id: string;
59
+ description: string;
60
+ defaultMessage: string;
61
+ };
62
+ InvalidField: {
63
+ id: string;
64
+ description: string;
65
+ defaultMessage: string;
66
+ };
67
+ InvalidSlug: {
68
+ id: string;
69
+ description: string;
70
+ defaultMessage: string;
71
+ };
72
+ OverlappingPriceValidity: {
73
+ id: string;
74
+ description: string;
75
+ defaultMessage: string;
76
+ };
77
+ OverlappingStandalonePriceValidity: {
78
+ id: string;
79
+ description: string;
80
+ defaultMessage: string;
81
+ };
82
+ PendingOperation: {
83
+ id: string;
84
+ description: string;
85
+ defaultMessage: string;
86
+ };
87
+ ResourceNotFound: {
88
+ id: string;
89
+ description: string;
90
+ defaultMessage: string;
91
+ };
92
+ ReferenceExists: {
93
+ id: string;
94
+ description: string;
95
+ defaultMessage: string;
96
+ };
97
+ RequiredField: {
98
+ id: string;
99
+ description: string;
100
+ defaultMessage: string;
101
+ };
102
+ RequiredFields: {
103
+ id: string;
104
+ description: string;
105
+ defaultMessage: string;
106
+ };
107
+ SemanticError: {
108
+ id: string;
109
+ description: string;
110
+ defaultMessage: string;
111
+ };
112
+ SyntaxError: {
113
+ id: string;
114
+ description: string;
115
+ defaultMessage: string;
116
+ };
117
+ Unauthorized: {
118
+ id: string;
119
+ description: string;
120
+ defaultMessage: string;
121
+ };
122
+ Forbidden: {
123
+ id: string;
124
+ description: string;
125
+ defaultMessage: string;
126
+ };
127
+ ExtensionNoResponse: {
128
+ id: string;
129
+ description: string;
130
+ defaultMessage: string;
131
+ };
132
+ ExtensionBadResponse: {
133
+ id: string;
134
+ description: string;
135
+ defaultMessage: string;
136
+ };
137
+ ExtensionUpdateActionsFailed: {
138
+ id: string;
139
+ description: string;
140
+ defaultMessage: string;
141
+ };
142
+ TaxCategoryDuplicateCountry: {
143
+ id: string;
144
+ description: string;
145
+ defaultMessage: string;
146
+ };
147
+ MaxResourceLimitExceeded: {
148
+ id: string;
149
+ description: string;
150
+ defaultMessage: string;
151
+ };
152
+ };
153
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { SyntheticEvent } from 'react';
2
+ import type { TAppNotification, TAppNotificationDomain, TAppNotificationKindSide } from '@commercetools-frontend/constants';
3
+ type Props = {
4
+ notification: TAppNotification<{
5
+ domain: TAppNotificationDomain;
6
+ kind: TAppNotificationKindSide;
7
+ text: string;
8
+ }>;
9
+ dismiss: (event: SyntheticEvent) => void;
10
+ };
11
+ declare const GenericNotification: {
12
+ (props: Props): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
13
+ displayName: string;
14
+ };
15
+ export default GenericNotification;
@@ -0,0 +1 @@
1
+ export { default } from './generic';
@@ -0,0 +1 @@
1
+ export { default } from './unexpected-error';
@@ -0,0 +1,16 @@
1
+ import { SyntheticEvent } from 'react';
2
+ import type { TAppNotification, TAppNotificationValuesUnexpectedError } from '@commercetools-frontend/constants';
3
+ import { NOTIFICATION_DOMAINS, NOTIFICATION_KINDS_PAGE } from '@commercetools-frontend/constants';
4
+ type Props = {
5
+ notification: TAppNotification<{
6
+ domain: typeof NOTIFICATION_DOMAINS.PAGE;
7
+ kind: (typeof NOTIFICATION_KINDS_PAGE)['unexpected-error'];
8
+ values: TAppNotificationValuesUnexpectedError;
9
+ }>;
10
+ dismiss: (event: SyntheticEvent) => void;
11
+ };
12
+ declare const UnexpectedErrorNotification: {
13
+ (props: Props): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
14
+ displayName: string;
15
+ };
16
+ export default UnexpectedErrorNotification;
@@ -0,0 +1 @@
1
+ export { default } from './notifications-list';
@@ -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/types/jsx-namespace").EmotionJSX.Element | null;
7
+ displayName: string;
8
+ };
9
+ export default NotificationsList;
@@ -0,0 +1,6 @@
1
+ import type { TAppNotificationDomain } from '@commercetools-frontend/constants';
2
+ type StyleProps = {
3
+ domain: TAppNotificationDomain;
4
+ };
5
+ declare const getStyles: (props: StyleProps) => import("@emotion/react").SerializedStyles;
6
+ export { getStyles };
@@ -0,0 +1,18 @@
1
+ import type { TAppNotificationGlobal, TAppNotificationPage, TAppNotificationSide } from '@commercetools-frontend/constants';
2
+ import type { TAppState } from './types';
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,4 @@
1
+ import type { TAppNotificationGlobal, TAppNotificationPage, TAppNotificationSide } from '@commercetools-frontend/constants';
2
+ export type TAppState = {
3
+ notifications: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[];
4
+ };
@@ -0,0 +1 @@
1
+ export { default } from './notifier';
@@ -0,0 +1,16 @@
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
+ (props: Props): null;
13
+ displayName: string;
14
+ defaultProps: Pick<Props, "domain" | "kind">;
15
+ };
16
+ export default Notifier;
@@ -0,0 +1,2 @@
1
+ import type { TProps as MapNotificationToComponentProps } from './components/map-notification-to-component';
2
+ export type TMapNotificationToComponentProps = MapNotificationToComponentProps;
@@ -0,0 +1,8 @@
1
+ export { default as version } from './version';
2
+ export * from './export-types';
3
+ export { default as NotificationProviderForCustomComponent } from './components/map-notification-to-component';
4
+ export { default as Notification } from './components/notification';
5
+ export { default as NotificationsList } from './components/notifications-list';
6
+ export { selectSideNotifications, selectGlobalNotifications, selectPageNotifications, } from './components/notifications-list/selectors';
7
+ export { default as Notifier } from './components/notifier';
8
+ export { default as ApiErrorMessage } from './components/notification-kinds/api-error-message';
@@ -0,0 +1 @@
1
+ export default function filterDataAttributes<T extends object>(obj: T): Partial<T>;
@@ -0,0 +1,2 @@
1
+ declare const _default: "__@APPLICATION_KIT_PACKAGE/VERSION_OF_RELEASE__";
2
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@commercetools-frontend/react-notifications",
3
+ "version": "0.0.0-FEC-157-preview-releases-20241126230331",
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-FEC-157-preview-releases-20241126230331",
34
+ "@commercetools-frontend/application-components": "0.0.0-FEC-157-preview-releases-20241126230331",
35
+ "@commercetools-frontend/constants": "0.0.0-FEC-157-preview-releases-20241126230331",
36
+ "@commercetools-frontend/notifications": "0.0.0-FEC-157-preview-releases-20241126230331",
37
+ "@commercetools-frontend/sentry": "0.0.0-FEC-157-preview-releases-20241126230331",
38
+ "@commercetools-uikit/design-system": "^19.9.0",
39
+ "@commercetools-uikit/hooks": "^19.9.0",
40
+ "@commercetools-uikit/icon-button": "^19.9.0",
41
+ "@commercetools-uikit/icons": "^19.9.0",
42
+ "@commercetools-uikit/secondary-icon-button": "^19.9.0",
43
+ "@commercetools-uikit/spacings": "^19.9.0",
44
+ "@commercetools-uikit/utils": "^19.9.0",
45
+ "@emotion/react": "^11.11.4",
46
+ "@emotion/styled": "^11.11.0",
47
+ "@types/history": "^4.7.11",
48
+ "@types/lodash": "^4.14.198",
49
+ "@types/prop-types": "^15.7.5",
50
+ "@types/react": "^17.0.80",
51
+ "@types/react-dom": "^17.0.19",
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.5.40",
58
+ "prop-types": "15.8.1",
59
+ "reselect": "4.1.8"
60
+ },
61
+ "devDependencies": {
62
+ "@types/jest": "^29.5.4",
63
+ "@types/testing-library__jest-dom": "^5.14.9",
64
+ "jest": "29.7.0",
65
+ "jest-mock": "29.7.0",
66
+ "react": "17.0.2",
67
+ "react-dom": "17.0.2",
68
+ "react-intl": "^6.4.7",
69
+ "react-redux": "7.2.9",
70
+ "react-router-dom": "5.3.4"
71
+ },
72
+ "peerDependencies": {
73
+ "react": "17.x",
74
+ "react-dom": "17.x",
75
+ "react-intl": "6.x",
76
+ "react-redux": "7.x",
77
+ "react-router-dom": "5.x"
78
+ }
79
+ }