notificare-react-preview-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +68 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types.d.ts +85 -0
- package/package.json +95 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Defines the structure of a notification object.
|
|
5
|
+
*
|
|
6
|
+
* @property {string} type - The type of the notification (e.g., "re.notifica.notification.Alert", "re.notifica.notification.WebView").
|
|
7
|
+
* @property {string} [title] - The title of the notification (optional).
|
|
8
|
+
* @property {string} [subtitle] - The subtitle of the notification (optional).
|
|
9
|
+
* @property {string} message - The message of the notification.
|
|
10
|
+
* @property {NotificareNotificationContent[]} [content] - An array of content objects associated with the notification (optional). Their structure depends on the notification type.
|
|
11
|
+
* @property {NotificareNotificationAction[]} [actions] - An array of actions associated with the notification (optional).
|
|
12
|
+
* @property {NotificareNotificationAttachment[]} [attachments] - An array of attachments associated with the notification (optional).
|
|
13
|
+
*/
|
|
14
|
+
interface NotificareNotification {
|
|
15
|
+
readonly type: string;
|
|
16
|
+
readonly title?: string;
|
|
17
|
+
readonly subtitle?: string;
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly content?: NotificareNotificationContent[];
|
|
20
|
+
readonly actions?: NotificareNotificationAction[];
|
|
21
|
+
readonly attachments?: NotificareNotificationAttachment[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Defines the content associated with the notification.
|
|
25
|
+
*
|
|
26
|
+
* @property {string} type - The type of content.
|
|
27
|
+
* @property {unknown} data - The content data. Its structure depends on the type.
|
|
28
|
+
*/
|
|
29
|
+
interface NotificareNotificationContent {
|
|
30
|
+
readonly type: string;
|
|
31
|
+
readonly data: unknown;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Defines an action associated with the notification.
|
|
35
|
+
*
|
|
36
|
+
* @property {string} type - The type of action (e.g., "re.notifica.action.Callback", "re.notifica.action.SMS").
|
|
37
|
+
* @property {string} label - The label for the action.
|
|
38
|
+
* @property {string} [target] - The target of the action (optional).
|
|
39
|
+
* @property {boolean} [camera] - Whether the action involves a camera (optional).
|
|
40
|
+
* @property {boolean} [keyboard] - Whether the action involves a keyboard (optional).
|
|
41
|
+
*/
|
|
42
|
+
interface NotificareNotificationAction {
|
|
43
|
+
readonly type: string;
|
|
44
|
+
readonly label: string;
|
|
45
|
+
readonly target?: string;
|
|
46
|
+
readonly camera?: boolean;
|
|
47
|
+
readonly keyboard?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Defines an attachment associated with the notification.
|
|
51
|
+
*
|
|
52
|
+
* @property {string} mimeType - The MIME type of the attachment (e.g., "image/jpeg", "image/png").
|
|
53
|
+
* @property {string} uri - The URI of the attachment.
|
|
54
|
+
*/
|
|
55
|
+
interface NotificareNotificationAttachment {
|
|
56
|
+
readonly mimeType: string;
|
|
57
|
+
readonly uri: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Defines the notification preview variant to be shown.
|
|
62
|
+
*/
|
|
63
|
+
type NotificareNotificationVariant = 'android-lockscreen' | 'android-lockscreen-expanded' | 'android-app-ui' | 'ios-lockscreen' | 'ios-lockscreen-expanded' | 'ios-app-ui' | 'web-desktop-macos' | 'web-iphone-app-ui' | 'web-android-app-ui';
|
|
64
|
+
|
|
65
|
+
declare function NotificareNotificationPreview({ notification, applicationId, showControls, variant, serviceKey, googleMapsAPIKey, }: NotificareNotificationPreviewProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
/**
|
|
67
|
+
* Component that displays a notification preview for different platforms.
|
|
68
|
+
*
|
|
69
|
+
* @param {NotificareNotification} notification - The notification to be displayed in the preview.
|
|
70
|
+
* @param {string} applicationId - The unique identifier of a Notificare application (optional).
|
|
71
|
+
* @param {boolean} [showControls] - Whether the controls should be shown (optional). It's true by default.
|
|
72
|
+
* @param {NotificareNotificationVariant} variant - The variant of the notification preview (optional). It's 'android-lockscreen' by default.
|
|
73
|
+
* @property {string} [serviceKey] - A service key provided by a Notificare admin.
|
|
74
|
+
* @property {string} [googleMapsAPIKey] - A Google Maps API key (optional).
|
|
75
|
+
*/
|
|
76
|
+
interface NotificareNotificationPreviewProps {
|
|
77
|
+
notification: NotificareNotification;
|
|
78
|
+
applicationId?: string;
|
|
79
|
+
showControls?: boolean;
|
|
80
|
+
variant?: NotificareNotificationVariant;
|
|
81
|
+
serviceKey: string;
|
|
82
|
+
googleMapsAPIKey?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { NotificareNotificationPreview };
|
package/package.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "notificare-react-preview-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A set of React components for your admin applications that lets you preview how Notificare notifications, in-app messages, and wallet passes will appear on a user’s device.",
|
|
5
|
+
"author": "Notificare <info@notificare.com> (https://notificare.com)",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://notificare.com/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/notificare/notificare-react-preview-components.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"notificare",
|
|
14
|
+
"react",
|
|
15
|
+
"preview",
|
|
16
|
+
"components",
|
|
17
|
+
"notifications",
|
|
18
|
+
"in-app-messaging",
|
|
19
|
+
"wallet"
|
|
20
|
+
],
|
|
21
|
+
"main": "dist/cjs/index.js",
|
|
22
|
+
"module": "dist/esm/index.js",
|
|
23
|
+
"types": "dist/types.d.ts",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "npm run clean; rollup -c",
|
|
26
|
+
"build-storybook": "storybook build",
|
|
27
|
+
"clean": "rm -rf dist",
|
|
28
|
+
"dev": "rollup -c -w",
|
|
29
|
+
"lint": "eslint .",
|
|
30
|
+
"prepack": "npm run build",
|
|
31
|
+
"storybook": "storybook dev -p 6006",
|
|
32
|
+
"test": "jest"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist"
|
|
36
|
+
],
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@vis.gl/react-google-maps": "^1.5.2",
|
|
39
|
+
"zod": "^3.24.1"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"react": "^19.0.0",
|
|
43
|
+
"react-dom": "^19.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@babel/core": "^7.26.10",
|
|
47
|
+
"@babel/preset-env": "^7.26.9",
|
|
48
|
+
"@babel/preset-react": "^7.26.3",
|
|
49
|
+
"@babel/preset-typescript": "^7.27.0",
|
|
50
|
+
"@chromatic-com/storybook": "^3.2.3",
|
|
51
|
+
"@eslint/js": "^9.18.0",
|
|
52
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
53
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
54
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
55
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
56
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
57
|
+
"@storybook/addon-essentials": "^8.6.12",
|
|
58
|
+
"@storybook/addon-interactions": "^8.6.12",
|
|
59
|
+
"@storybook/addon-onboarding": "^8.6.12",
|
|
60
|
+
"@storybook/blocks": "^8.6.12",
|
|
61
|
+
"@storybook/react": "^8.6.12",
|
|
62
|
+
"@storybook/react-vite": "^8.6.12",
|
|
63
|
+
"@storybook/test": "^8.6.12",
|
|
64
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
65
|
+
"@testing-library/react": "^16.3.0",
|
|
66
|
+
"@types/jest": "^29.5.14",
|
|
67
|
+
"@types/leaflet": "^1.9.16",
|
|
68
|
+
"@types/react": "^19.0.7",
|
|
69
|
+
"babel-jest": "^29.7.0",
|
|
70
|
+
"dotenv": "^16.5.0",
|
|
71
|
+
"eslint": "^9.18.0",
|
|
72
|
+
"eslint-config-prettier": "^10.0.1",
|
|
73
|
+
"eslint-plugin-import": "^2.31.0",
|
|
74
|
+
"eslint-plugin-react": "^7.37.4",
|
|
75
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
76
|
+
"globals": "^16.0.0",
|
|
77
|
+
"identity-obj-proxy": "^3.0.0",
|
|
78
|
+
"jest": "^29.7.0",
|
|
79
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
80
|
+
"prettier": "^3.5.3",
|
|
81
|
+
"react": "^19.1.0",
|
|
82
|
+
"react-dom": "^19.1.0",
|
|
83
|
+
"rollup": "^4.37.0",
|
|
84
|
+
"rollup-plugin-dts": "^6.2.1",
|
|
85
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
86
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
87
|
+
"rollup-plugin-visualizer": "^5.14.0",
|
|
88
|
+
"storybook": "^8.6.12",
|
|
89
|
+
"style-loader": "^4.0.0",
|
|
90
|
+
"ts-node": "^10.9.2",
|
|
91
|
+
"tslib": "^2.8.1",
|
|
92
|
+
"typescript": "^5.7.3",
|
|
93
|
+
"typescript-eslint": "^8.20.0"
|
|
94
|
+
}
|
|
95
|
+
}
|