notificare-react-preview-components 1.1.0 → 1.2.1

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/types.d.ts CHANGED
@@ -66,6 +66,16 @@ declare const IN_APP_MESSAGING_TRANSLATIONS: {
66
66
  */
67
67
  type NotificareInAppMessagingTranslationKey = keyof typeof IN_APP_MESSAGING_TRANSLATIONS;
68
68
 
69
+ declare const PUSH_ONBOARDING_TRANSLATIONS: {
70
+ 'preview.error.invalidPushOnboardingApplicationInfo': string;
71
+ 'preview.error.notGeneratedPreview': string;
72
+ 'preview.error.checkConsole': string;
73
+ };
74
+ /**
75
+ * The set of translation keys for push onboarding previews.
76
+ */
77
+ type NotificarePushOnboardingTranslationKey = keyof typeof PUSH_ONBOARDING_TRANSLATIONS;
78
+
69
79
  /**
70
80
  * Defines the structure of a notification object.
71
81
  *
@@ -157,6 +167,90 @@ interface NotificareInAppMessageAction {
157
167
  readonly destructive?: boolean;
158
168
  }
159
169
 
170
+ /**
171
+ * Defines partial information of a Notificare app.
172
+ *
173
+ * @property {string} [name] - The name of the application (optional).
174
+ * @property {string} websitePushConfig - The Website Push configuration of the app.
175
+ */
176
+ interface NotificarePushOnboardingApplicationInfo {
177
+ readonly name?: string;
178
+ readonly websitePushConfig: NotificarePushOnboardingWebsitePushConfig;
179
+ }
180
+ /**
181
+ * Defines the Website Push configuration of an app.
182
+ *
183
+ * @property {string} [icon] - The icon to be displayed in a native browser notification (optional).
184
+ * @property {NotificarePushOnboardingLaunchConfig} launchConfig - Set of launch options.
185
+ */
186
+ interface NotificarePushOnboardingWebsitePushConfig {
187
+ readonly icon?: string;
188
+ readonly launchConfig: NotificarePushOnboardingLaunchConfig;
189
+ }
190
+ /**
191
+ * Defines the launch configuration of an app.
192
+ *
193
+ * @property {string} [applicationName] - A custom application name to replace the original one at the top of a dialog (optional).
194
+ * @property {NotificarePushOnboardingFloatingButtonOptions} [floatingButtonOptions] - Set of floating button customization options (optional).
195
+ * @property {NotificarePushOnboardingAutoOnboardingOptions} [autoOnboardingOptions] - Set of dialog customization options (optional).
196
+ */
197
+ interface NotificarePushOnboardingLaunchConfig {
198
+ readonly applicationName?: string;
199
+ readonly floatingButtonOptions?: NotificarePushOnboardingFloatingButtonOptions;
200
+ readonly autoOnboardingOptions?: NotificarePushOnboardingAutoOnboardingOptions;
201
+ }
202
+ /**
203
+ * Defines the floating button customization options.
204
+ *
205
+ * @property {NotificarePushOnboardingFloatingButtonAlignment} alignment - Defines the horizontal and vertical alignment of the floating button.
206
+ * @property {NotificarePushOnboardingFloatingButtonPermissionTexts} permissionTexts - Custom texts for the tooltip on the floating button based on the remote notification permission status.
207
+ */
208
+ interface NotificarePushOnboardingFloatingButtonOptions {
209
+ readonly alignment: NotificarePushOnboardingFloatingButtonAlignment;
210
+ readonly permissionTexts: NotificarePushOnboardingFloatingButtonPermissionTexts;
211
+ }
212
+ /**
213
+ * Defines the horizontal and vertical alignment of the floating button.
214
+ *
215
+ * @property {NotificarePushOnboardingFloatingButtonHorizontalAlignment} horizontal - The horizontal alignment.
216
+ * @property {NotificarePushOnboardingFloatingButtonVerticalAlignment} vertical - The vertical alignment.
217
+ */
218
+ interface NotificarePushOnboardingFloatingButtonAlignment {
219
+ readonly horizontal: NotificarePushOnboardingFloatingButtonHorizontalAlignment;
220
+ readonly vertical: NotificarePushOnboardingFloatingButtonVerticalAlignment;
221
+ }
222
+ type NotificarePushOnboardingFloatingButtonHorizontalAlignment = 'start' | 'end';
223
+ type NotificarePushOnboardingFloatingButtonVerticalAlignment = 'top' | 'bottom';
224
+ /**
225
+ * Specifies custom texts for the tooltip on the floating button based on the remote notification permission status.
226
+ *
227
+ * @property {string} default - The text to be displayed when remote notifications were neither allowed nor denied by the user.
228
+ * @property {string} granted - The text to be displayed when the user allows remote notifications.
229
+ * @property {string} denied - The text to be displayed when the user denies remote notifications.
230
+ */
231
+ interface NotificarePushOnboardingFloatingButtonPermissionTexts {
232
+ readonly default: string;
233
+ readonly granted: string;
234
+ readonly denied: string;
235
+ }
236
+ /**
237
+ * Defines the dialog customization options.
238
+ *
239
+ * @property {string} message - The main message of the dialog.
240
+ * @property {string} cancelButton - The text on the cancel button.
241
+ * @property {string} acceptButton - The text on the accept button.
242
+ */
243
+ interface NotificarePushOnboardingAutoOnboardingOptions {
244
+ readonly message: string;
245
+ readonly cancelButton: string;
246
+ readonly acceptButton: string;
247
+ }
248
+
249
+ /**
250
+ * The remote notification permission status.
251
+ */
252
+ type NotificarePushOnboardingPermissionStatus = 'default' | 'granted' | 'denied';
253
+
160
254
  /**
161
255
  * The language/region code for the UI.
162
256
  */
@@ -200,5 +294,25 @@ interface NotificareInAppMessagePreviewProps {
200
294
  translations?: Partial<Record<NotificareInAppMessagingTranslationKey, string>>;
201
295
  }
202
296
 
203
- export { NotificareInAppMessagePreview, NotificareNotificationPreview };
204
- export type { NotificareInAppMessage, NotificareInAppMessageAction, NotificareInAppMessagingTranslationKey, NotificareNotification, NotificareNotificationAction, NotificareNotificationAttachment, NotificareNotificationContent, NotificareNotificationPreviewLocale, NotificareNotificationPreviewVariant, NotificarePushTranslationKey };
297
+ /**
298
+ * Component that displays a push onboarding preview depending on the launch configurations of an app.
299
+ *
300
+ * @param {string} [applicationId] - The unique identifier of a Notificare application (optional).
301
+ * @param {string} [permissionStatus] - The remote notification permission status (optional). It's 'default' by default.
302
+ * @param {string} applicationInfo - Partial information from a Notificare application.
303
+ * @param {string} [serviceKey] - A service key provided by a Notificare admin (optional).
304
+ * @param {string} [locale] - The language/region code for the UI (optional). It's 'en-US' by default.
305
+ * @param {string} [translations] - A set of custom translations to override the default ones (optional).
306
+ */
307
+ declare function NotificarePushOnboardingPreview({ applicationId, permissionStatus, applicationInfo, serviceKey, locale, translations, }: NotificarePushOnboardingPreviewProps): react_jsx_runtime.JSX.Element;
308
+ interface NotificarePushOnboardingPreviewProps {
309
+ applicationId?: string;
310
+ permissionStatus?: NotificarePushOnboardingPermissionStatus;
311
+ applicationInfo: NotificarePushOnboardingApplicationInfo;
312
+ serviceKey?: string;
313
+ locale?: string;
314
+ translations?: Partial<Record<NotificarePushOnboardingTranslationKey, string>>;
315
+ }
316
+
317
+ export { NotificareInAppMessagePreview, NotificareNotificationPreview, NotificarePushOnboardingPreview };
318
+ export type { NotificareInAppMessage, NotificareInAppMessageAction, NotificareInAppMessagingTranslationKey, NotificareNotification, NotificareNotificationAction, NotificareNotificationAttachment, NotificareNotificationContent, NotificareNotificationPreviewLocale, NotificareNotificationPreviewVariant, NotificarePushOnboardingApplicationInfo, NotificarePushOnboardingAutoOnboardingOptions, NotificarePushOnboardingFloatingButtonAlignment, NotificarePushOnboardingFloatingButtonHorizontalAlignment, NotificarePushOnboardingFloatingButtonOptions, NotificarePushOnboardingFloatingButtonPermissionTexts, NotificarePushOnboardingFloatingButtonVerticalAlignment, NotificarePushOnboardingLaunchConfig, NotificarePushOnboardingPermissionStatus, NotificarePushOnboardingTranslationKey, NotificarePushOnboardingWebsitePushConfig, NotificarePushTranslationKey };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notificare-react-preview-components",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
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
5
  "author": "Notificare <info@notificare.com> (https://notificare.com)",
6
6
  "license": "MIT",
@@ -37,8 +37,8 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@vis.gl/react-google-maps": "^1.5.2",
40
- "zod": "^3.24.1",
41
- "react-intl": "^7.1.11"
40
+ "react-intl": "^7.1.11",
41
+ "zod": "^3.24.1"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": "^19.0.0",
@@ -66,8 +66,11 @@
66
66
  "dotenv": "^16.5.0",
67
67
  "eslint": "^9.18.0",
68
68
  "eslint-config-prettier": "^10.0.1",
69
+ "eslint-import-resolver-typescript": "^4.4.4",
69
70
  "eslint-plugin-import": "^2.31.0",
71
+ "eslint-plugin-prettier": "^5.5.4",
70
72
  "eslint-plugin-react": "^7.37.4",
73
+ "eslint-plugin-react-hooks": "^5.2.0",
71
74
  "eslint-plugin-storybook": "^9.0.4",
72
75
  "globals": "^16.0.0",
73
76
  "identity-obj-proxy": "^3.0.0",