@novu/js 3.3.1 → 3.5.0-rc.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/cjs/{chunk-DCLHIVKS.js → chunk-ME3JBJPI.js} +205 -62
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +8 -8
- package/dist/{esm/novu-DJTVB7VN.d.mts → cjs/novu-q3jzGeyW.d.ts} +46 -25
- package/dist/cjs/themes/index.d.ts +2 -2
- package/dist/cjs/{types-BPv1rvbm.d.ts → types-DdImrpw7.d.ts} +25 -4
- package/dist/cjs/ui/index.d.ts +7 -5
- package/dist/cjs/ui/index.js +1383 -590
- package/dist/esm/{chunk-JKFCSXQM.mjs → chunk-P4YVABAC.mjs} +205 -62
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/{cjs/novu-DJTVB7VN.d.ts → esm/novu-q3jzGeyW.d.mts} +46 -25
- package/dist/esm/themes/index.d.mts +2 -2
- package/dist/esm/{types-CYgpCW2I.d.mts → types-CTQLJWIf.d.mts} +25 -4
- package/dist/esm/ui/index.d.mts +7 -5
- package/dist/esm/ui/index.mjs +1382 -589
- package/dist/index.css +1 -1
- package/dist/novu.min.js +11 -11
- package/dist/novu.min.js.gz +0 -0
- package/package.json +16 -16
|
@@ -6,18 +6,15 @@ declare class NovuError extends Error {
|
|
|
6
6
|
type ListPreferencesArgs = {
|
|
7
7
|
tags?: string[];
|
|
8
8
|
};
|
|
9
|
-
type
|
|
10
|
-
workflowId
|
|
9
|
+
type BasePreferenceArgs = {
|
|
10
|
+
workflowId: string;
|
|
11
|
+
channels: ChannelPreference;
|
|
12
|
+
};
|
|
13
|
+
type InstancePreferenceArgs = {
|
|
14
|
+
preference: Preference;
|
|
11
15
|
channels: ChannelPreference;
|
|
12
|
-
/** @deprecated Use channels instead */
|
|
13
|
-
channelPreferences?: ChannelPreference;
|
|
14
|
-
preference?: {
|
|
15
|
-
level: PreferenceLevel;
|
|
16
|
-
enabled: boolean;
|
|
17
|
-
channels: ChannelPreference;
|
|
18
|
-
workflow?: Workflow;
|
|
19
|
-
};
|
|
20
16
|
};
|
|
17
|
+
type UpdatePreferenceArgs = BasePreferenceArgs | InstancePreferenceArgs;
|
|
21
18
|
|
|
22
19
|
declare class PreferencesCache {
|
|
23
20
|
#private;
|
|
@@ -45,9 +42,10 @@ declare class Preference {
|
|
|
45
42
|
cache: PreferencesCache;
|
|
46
43
|
useCache: boolean;
|
|
47
44
|
});
|
|
48
|
-
update({ channels,
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
update({ channels, channelPreferences, }: Prettify<Pick<UpdatePreferenceArgs, 'channels'> & {
|
|
46
|
+
/** @deprecated Use channels instead */
|
|
47
|
+
channelPreferences?: ChannelPreference;
|
|
48
|
+
}>): Result<Preference>;
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
declare global {
|
|
@@ -150,6 +148,7 @@ type NotificationFilter = {
|
|
|
150
148
|
read?: boolean;
|
|
151
149
|
archived?: boolean;
|
|
152
150
|
snoozed?: boolean;
|
|
151
|
+
data?: Record<string, unknown>;
|
|
153
152
|
};
|
|
154
153
|
type ChannelPreference = {
|
|
155
154
|
email?: boolean;
|
|
@@ -216,7 +215,7 @@ declare class InboxService {
|
|
|
216
215
|
subscriberHash?: string;
|
|
217
216
|
subscriber: Subscriber;
|
|
218
217
|
}): Promise<Session>;
|
|
219
|
-
fetchNotifications({ after, archived, limit, offset, read, tags, snoozed, }: {
|
|
218
|
+
fetchNotifications({ after, archived, limit, offset, read, tags, snoozed, data, }: {
|
|
220
219
|
tags?: string[];
|
|
221
220
|
read?: boolean;
|
|
222
221
|
archived?: boolean;
|
|
@@ -224,16 +223,18 @@ declare class InboxService {
|
|
|
224
223
|
limit?: number;
|
|
225
224
|
after?: string;
|
|
226
225
|
offset?: number;
|
|
226
|
+
data?: Record<string, unknown>;
|
|
227
227
|
}): Promise<{
|
|
228
228
|
data: InboxNotification[];
|
|
229
229
|
hasMore: boolean;
|
|
230
230
|
filter: NotificationFilter;
|
|
231
231
|
}>;
|
|
232
|
-
count({ filters }: {
|
|
232
|
+
count({ filters, }: {
|
|
233
233
|
filters: Array<{
|
|
234
234
|
tags?: string[];
|
|
235
235
|
read?: boolean;
|
|
236
236
|
archived?: boolean;
|
|
237
|
+
data?: Record<string, unknown>;
|
|
237
238
|
}>;
|
|
238
239
|
}): Promise<{
|
|
239
240
|
data: Array<{
|
|
@@ -247,14 +248,17 @@ declare class InboxService {
|
|
|
247
248
|
unarchive(notificationId: string): Promise<InboxNotification>;
|
|
248
249
|
snooze(notificationId: string, snoozeUntil: string): Promise<InboxNotification>;
|
|
249
250
|
unsnooze(notificationId: string): Promise<InboxNotification>;
|
|
250
|
-
readAll({ tags }: {
|
|
251
|
+
readAll({ tags, data }: {
|
|
251
252
|
tags?: string[];
|
|
253
|
+
data?: Record<string, unknown>;
|
|
252
254
|
}): Promise<void>;
|
|
253
|
-
archiveAll({ tags }: {
|
|
255
|
+
archiveAll({ tags, data }: {
|
|
254
256
|
tags?: string[];
|
|
257
|
+
data?: Record<string, unknown>;
|
|
255
258
|
}): Promise<void>;
|
|
256
|
-
archiveAllRead({ tags }: {
|
|
259
|
+
archiveAllRead({ tags, data }: {
|
|
257
260
|
tags?: string[];
|
|
261
|
+
data?: Record<string, unknown>;
|
|
258
262
|
}): Promise<void>;
|
|
259
263
|
completeAction({ actionType, notificationId, }: {
|
|
260
264
|
notificationId: string;
|
|
@@ -265,6 +269,9 @@ declare class InboxService {
|
|
|
265
269
|
actionType: ActionTypeEnum;
|
|
266
270
|
}): Promise<InboxNotification>;
|
|
267
271
|
fetchPreferences(tags?: string[]): Promise<PreferencesResponse[]>;
|
|
272
|
+
bulkUpdatePreferences(preferences: Array<{
|
|
273
|
+
workflowId: string;
|
|
274
|
+
} & ChannelPreference>): Promise<PreferencesResponse[]>;
|
|
268
275
|
updateGlobalPreferences(channels: ChannelPreference): Promise<PreferencesResponse>;
|
|
269
276
|
updateWorkflowPreferences({ workflowId, channels, }: {
|
|
270
277
|
workflowId: string;
|
|
@@ -329,6 +336,7 @@ declare class Notification implements Pick<NovuEventEmitter, 'on'>, InboxNotific
|
|
|
329
336
|
type ListNotificationsArgs = {
|
|
330
337
|
tags?: string[];
|
|
331
338
|
read?: boolean;
|
|
339
|
+
data?: Record<string, unknown>;
|
|
332
340
|
archived?: boolean;
|
|
333
341
|
snoozed?: boolean;
|
|
334
342
|
limit?: number;
|
|
@@ -343,6 +351,7 @@ type ListNotificationsResponse = {
|
|
|
343
351
|
};
|
|
344
352
|
type FilterCountArgs = {
|
|
345
353
|
tags?: string[];
|
|
354
|
+
data?: Record<string, unknown>;
|
|
346
355
|
read?: boolean;
|
|
347
356
|
archived?: boolean;
|
|
348
357
|
snoozed?: boolean;
|
|
@@ -353,6 +362,7 @@ type FiltersCountArgs = {
|
|
|
353
362
|
read?: boolean;
|
|
354
363
|
archived?: boolean;
|
|
355
364
|
snoozed?: boolean;
|
|
365
|
+
data?: Record<string, unknown>;
|
|
356
366
|
}>;
|
|
357
367
|
};
|
|
358
368
|
type CountArgs = undefined | FilterCountArgs | FiltersCountArgs;
|
|
@@ -399,9 +409,9 @@ declare class NotificationsCache {
|
|
|
399
409
|
getAll(args: ListNotificationsArgs): ListNotificationsResponse | undefined;
|
|
400
410
|
/**
|
|
401
411
|
* Get unique notifications based on specified filter fields.
|
|
402
|
-
* The same tags can be applied to multiple filters which means that the same notification can be duplicated.
|
|
412
|
+
* The same tags and data can be applied to multiple filters which means that the same notification can be duplicated.
|
|
403
413
|
*/
|
|
404
|
-
getUniqueNotifications({ tags, read }: Pick<ListNotificationsArgs, 'tags' | 'read'>): Array<Notification>;
|
|
414
|
+
getUniqueNotifications({ tags, read, data, }: Pick<ListNotificationsArgs, 'tags' | 'read' | 'data'>): Array<Notification>;
|
|
405
415
|
clear(filter: NotificationFilter): void;
|
|
406
416
|
clearAll(): void;
|
|
407
417
|
}
|
|
@@ -436,14 +446,17 @@ declare class Notifications extends BaseModule {
|
|
|
436
446
|
revertPrimary(args: InstanceArgs): Result<Notification>;
|
|
437
447
|
revertSecondary(args: BaseArgs): Result<Notification>;
|
|
438
448
|
revertSecondary(args: InstanceArgs): Result<Notification>;
|
|
439
|
-
readAll({ tags }?: {
|
|
449
|
+
readAll({ tags, data, }?: {
|
|
440
450
|
tags?: NotificationFilter['tags'];
|
|
451
|
+
data?: Record<string, unknown>;
|
|
441
452
|
}): Result<void>;
|
|
442
|
-
archiveAll({ tags }?: {
|
|
453
|
+
archiveAll({ tags, data, }?: {
|
|
443
454
|
tags?: NotificationFilter['tags'];
|
|
455
|
+
data?: Record<string, unknown>;
|
|
444
456
|
}): Result<void>;
|
|
445
|
-
archiveAllRead({ tags }?: {
|
|
457
|
+
archiveAllRead({ tags, data, }?: {
|
|
446
458
|
tags?: NotificationFilter['tags'];
|
|
459
|
+
data?: Record<string, unknown>;
|
|
447
460
|
}): Result<void>;
|
|
448
461
|
clearCache({ filter }?: {
|
|
449
462
|
filter?: NotificationFilter;
|
|
@@ -482,15 +495,19 @@ type NotificationCompleteActionEvents = BaseEvents<'notification.complete_action
|
|
|
482
495
|
type NotificationRevertActionEvents = BaseEvents<'notification.revert_action', RevertArgs, Notification>;
|
|
483
496
|
type NotificationsReadAllEvents = BaseEvents<'notifications.read_all', {
|
|
484
497
|
tags?: string[];
|
|
498
|
+
data?: Record<string, unknown>;
|
|
485
499
|
}, Notification[]>;
|
|
486
500
|
type NotificationsArchivedAllEvents = BaseEvents<'notifications.archive_all', {
|
|
487
501
|
tags?: string[];
|
|
502
|
+
data?: Record<string, unknown>;
|
|
488
503
|
}, Notification[]>;
|
|
489
504
|
type NotificationsReadArchivedAllEvents = BaseEvents<'notifications.archive_all_read', {
|
|
490
505
|
tags?: string[];
|
|
506
|
+
data?: Record<string, unknown>;
|
|
491
507
|
}, Notification[]>;
|
|
492
508
|
type PreferencesFetchEvents = BaseEvents<'preferences.list', ListPreferencesArgs, Preference[]>;
|
|
493
|
-
type PreferenceUpdateEvents = BaseEvents<'preference.update',
|
|
509
|
+
type PreferenceUpdateEvents = BaseEvents<'preference.update', UpdatePreferenceArgs, Preference>;
|
|
510
|
+
type PreferencesBulkUpdateEvents = BaseEvents<'preferences.bulk_update', Array<UpdatePreferenceArgs>, Preference[]>;
|
|
494
511
|
type SocketConnectEvents = BaseEvents<'socket.connect', {
|
|
495
512
|
socketUrl: string;
|
|
496
513
|
}, undefined>;
|
|
@@ -530,7 +547,7 @@ type Events = SessionInitializeEvents & NotificationsFetchEvents & {
|
|
|
530
547
|
'preferences.list.updated': {
|
|
531
548
|
data: Preference[];
|
|
532
549
|
};
|
|
533
|
-
} & PreferenceUpdateEvents & SocketConnectEvents & SocketEvents & NotificationReadEvents & NotificationUnreadEvents & NotificationArchiveEvents & NotificationUnarchiveEvents & NotificationSnoozeEvents & NotificationUnsnoozeEvents & NotificationCompleteActionEvents & NotificationRevertActionEvents & NotificationsReadAllEvents & NotificationsArchivedAllEvents & NotificationsReadArchivedAllEvents;
|
|
550
|
+
} & PreferenceUpdateEvents & PreferencesBulkUpdateEvents & SocketConnectEvents & SocketEvents & NotificationReadEvents & NotificationUnreadEvents & NotificationArchiveEvents & NotificationUnarchiveEvents & NotificationSnoozeEvents & NotificationUnsnoozeEvents & NotificationCompleteActionEvents & NotificationRevertActionEvents & NotificationsReadAllEvents & NotificationsArchivedAllEvents & NotificationsReadArchivedAllEvents;
|
|
534
551
|
type EventNames = keyof Events;
|
|
535
552
|
type SocketEventNames = keyof SocketEvents;
|
|
536
553
|
type EventHandler<T = unknown> = (event: T) => void;
|
|
@@ -552,6 +569,10 @@ declare class Preferences extends BaseModule {
|
|
|
552
569
|
eventEmitterInstance: NovuEventEmitter;
|
|
553
570
|
});
|
|
554
571
|
list(args?: ListPreferencesArgs): Result<Preference[]>;
|
|
572
|
+
update(args: BasePreferenceArgs): Result<Preference>;
|
|
573
|
+
update(args: InstancePreferenceArgs): Result<Preference>;
|
|
574
|
+
bulkUpdate(args: Array<BasePreferenceArgs>): Result<Preference[]>;
|
|
575
|
+
bulkUpdate(args: Array<InstancePreferenceArgs>): Result<Preference[]>;
|
|
555
576
|
}
|
|
556
577
|
|
|
557
578
|
declare class Socket extends BaseModule {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as Notification, N as NotificationFilter, g as NovuOptions, b as Novu } from './novu-
|
|
1
|
+
import { d as Notification, N as NotificationFilter, g as NovuOptions, b as Novu, P as Preference } from './novu-q3jzGeyW.mjs';
|
|
2
2
|
|
|
3
|
-
declare const appearanceKeys: readonly ["button", "input", "icon", "badge", "popoverContent", "popoverTrigger", "popoverClose", "dropdownContent", "dropdownTrigger", "dropdownItem", "dropdownItemLabel", "dropdownItemLabelContainer", "dropdownItemLeft__icon", "dropdownItemRight__icon", "dropdownItem__icon", "collapsible", "tooltipContent", "tooltipTrigger", "datePicker", "datePickerGrid", "datePickerGridRow", "datePickerGridCell", "datePickerGridCellTrigger", "datePickerTrigger", "datePickerGridHeader", "datePickerControl", "datePickerControlPrevTrigger", "datePickerControlNextTrigger", "datePickerControlPrevTrigger__icon", "datePickerControlNextTrigger__icon", "datePickerCalendar", "datePickerHeaderMonth", "datePickerCalendarDay__button", "timePicker", "timePicker__hourSelect", "timePicker__minuteSelect", "timePicker__periodSelect", "timePicker__separator", "timePickerHour__input", "timePickerMinute__input", "snoozeDatePicker", "snoozeDatePicker__actions", "snoozeDatePickerCancel__button", "snoozeDatePickerApply__button", "snoozeDatePicker__timePickerContainer", "snoozeDatePicker__timePickerLabel", "back__button", "skeletonText", "skeletonAvatar", "skeletonSwitch", "skeletonSwitchThumb", "tabsRoot", "tabsList", "tabsContent", "tabsTrigger", "dots", "root", "bellIcon", "bellContainer", "bellDot", "preferences__button", "preferencesContainer", "inboxHeader", "loading", "inboxContent", "inbox__popoverTrigger", "inbox__popoverContent", "notificationListContainer", "notificationList", "notificationListEmptyNoticeContainer", "notificationListEmptyNoticeOverlay", "notificationListEmptyNoticeIcon", "notificationListEmptyNotice", "notificationList__skeleton", "notificationList__skeletonContent", "notificationList__skeletonItem", "notificationList__skeletonAvatar", "notificationList__skeletonText", "notificationListNewNotificationsNotice__button", "notification", "notificationContent", "notificationTextContainer", "notificationDot", "notificationSubject", "notificationSubject__strong", "notificationBody", "notificationBody__strong", "notificationBodyContainer", "notificationImage", "notificationImageLoadingFallback", "notificationDate", "notificationDateActionsContainer", "notificationDefaultActions", "notificationCustomActions", "notificationPrimaryAction__button", "notificationSecondaryAction__button", "notificationRead__button", "notificationUnread__button", "notificationArchive__button", "notificationUnarchive__button", "notificationSnooze__button", "notificationUnsnooze__button", "notificationRead__icon", "notificationUnread__icon", "notificationArchive__icon", "notificationUnarchive__icon", "notificationSnooze__icon", "notificationUnsnooze__icon", "notificationsTabs__tabsRoot", "notificationsTabs__tabsList", "notificationsTabs__tabsContent", "notificationsTabs__tabsTrigger", "notificationsTabsTriggerLabel", "notificationsTabsTriggerCount", "inboxStatus__title", "inboxStatus__dropdownTrigger", "inboxStatus__dropdownContent", "inboxStatus__dropdownItem", "inboxStatus__dropdownItemLabel", "inboxStatus__dropdownItemLabelContainer", "inboxStatus__dropdownItemLeft__icon", "inboxStatus__dropdownItemRight__icon", "inboxStatus__dropdownItem__icon", "inboxStatus__dropdownItemCheck__icon", "moreActionsContainer", "moreActions__dropdownTrigger", "moreActions__dropdownContent", "moreActions__dropdownItem", "moreActions__dropdownItemLabel", "moreActions__dropdownItemLeft__icon", "moreActions__dots", "moreTabs__button", "moreTabs__icon", "moreTabs__dropdownTrigger", "moreTabs__dropdownContent", "moreTabs__dropdownItem", "moreTabs__dropdownItemLabel", "moreTabs__dropdownItemRight__icon", "workflowContainer", "workflowLabel", "workflowLabelHeader", "workflowLabelContainer", "workflowContainerDisabledNotice", "workflowLabelDisabled__icon", "workflowContainerRight__icon", "workflowArrow__icon", "workflowDescription", "channelContainer", "channelIconContainer", "channel__icon", "channelsContainerCollapsible", "channelsContainer", "channelLabel", "channelLabelContainer", "channelName", "channelSwitchContainer", "channelSwitch", "channelSwitchThumb", "preferencesHeader", "preferencesHeader__back__button", "preferencesHeader__back__button__icon", "preferencesHeader__title", "preferencesHeader__icon", "preferencesListEmptyNoticeContainer", "preferencesListEmptyNotice", "preferencesList__skeleton", "preferencesList__skeletonContent", "preferencesList__skeletonItem", "preferencesList__skeletonIcon", "preferencesList__skeletonSwitch", "preferencesList__skeletonSwitchThumb", "preferencesList__skeletonText", "notificationSnooze__dropdownContent", "notificationSnooze__dropdownItem", "notificationSnooze__dropdownItem__icon", "notificationSnoozeCustomTime_popoverContent", "notificationDeliveredAt__badge", "notificationDeliveredAt__icon", "notificationSnoozedUntil__icon", "strong"];
|
|
3
|
+
declare const appearanceKeys: readonly ["button", "input", "icon", "badge", "popoverContent", "popoverTrigger", "popoverClose", "dropdownContent", "dropdownTrigger", "dropdownItem", "dropdownItemLabel", "dropdownItemLabelContainer", "dropdownItemLeft__icon", "dropdownItemRight__icon", "dropdownItem__icon", "collapsible", "tooltipContent", "tooltipTrigger", "datePicker", "datePickerGrid", "datePickerGridRow", "datePickerGridCell", "datePickerGridCellTrigger", "datePickerTrigger", "datePickerGridHeader", "datePickerControl", "datePickerControlPrevTrigger", "datePickerControlNextTrigger", "datePickerControlPrevTrigger__icon", "datePickerControlNextTrigger__icon", "datePickerCalendar", "datePickerHeaderMonth", "datePickerCalendarDay__button", "timePicker", "timePicker__hourSelect", "timePicker__minuteSelect", "timePicker__periodSelect", "timePicker__separator", "timePickerHour__input", "timePickerMinute__input", "snoozeDatePicker", "snoozeDatePicker__actions", "snoozeDatePickerCancel__button", "snoozeDatePickerApply__button", "snoozeDatePicker__timePickerContainer", "snoozeDatePicker__timePickerLabel", "back__button", "skeletonText", "skeletonAvatar", "skeletonSwitch", "skeletonSwitchThumb", "tabsRoot", "tabsList", "tabsContent", "tabsTrigger", "dots", "root", "bellIcon", "bellContainer", "bellDot", "preferences__button", "preferencesContainer", "inboxHeader", "loading", "inboxContent", "inbox__popoverTrigger", "inbox__popoverContent", "notificationListContainer", "notificationList", "notificationListEmptyNoticeContainer", "notificationListEmptyNoticeOverlay", "notificationListEmptyNoticeIcon", "notificationListEmptyNotice", "notificationList__skeleton", "notificationList__skeletonContent", "notificationList__skeletonItem", "notificationList__skeletonAvatar", "notificationList__skeletonText", "notificationListNewNotificationsNotice__button", "notification", "notificationContent", "notificationTextContainer", "notificationDot", "notificationSubject", "notificationSubject__strong", "notificationBody", "notificationBody__strong", "notificationBodyContainer", "notificationImage", "notificationImageLoadingFallback", "notificationDate", "notificationDateActionsContainer", "notificationDefaultActions", "notificationCustomActions", "notificationPrimaryAction__button", "notificationSecondaryAction__button", "notificationRead__button", "notificationUnread__button", "notificationArchive__button", "notificationUnarchive__button", "notificationSnooze__button", "notificationUnsnooze__button", "notificationRead__icon", "notificationUnread__icon", "notificationArchive__icon", "notificationUnarchive__icon", "notificationSnooze__icon", "notificationUnsnooze__icon", "notificationsTabs__tabsRoot", "notificationsTabs__tabsList", "notificationsTabs__tabsContent", "notificationsTabs__tabsTrigger", "notificationsTabsTriggerLabel", "notificationsTabsTriggerCount", "inboxStatus__title", "inboxStatus__dropdownTrigger", "inboxStatus__dropdownContent", "inboxStatus__dropdownItem", "inboxStatus__dropdownItemLabel", "inboxStatus__dropdownItemLabelContainer", "inboxStatus__dropdownItemLeft__icon", "inboxStatus__dropdownItemRight__icon", "inboxStatus__dropdownItem__icon", "inboxStatus__dropdownItemCheck__icon", "moreActionsContainer", "moreActions__dropdownTrigger", "moreActions__dropdownContent", "moreActions__dropdownItem", "moreActions__dropdownItemLabel", "moreActions__dropdownItemLeft__icon", "moreActions__dots", "moreTabs__button", "moreTabs__icon", "moreTabs__dropdownTrigger", "moreTabs__dropdownContent", "moreTabs__dropdownItem", "moreTabs__dropdownItemLabel", "moreTabs__dropdownItemRight__icon", "workflowContainer", "workflowLabel", "workflowLabelHeader", "workflowLabelHeaderContainer", "workflowLabelIcon", "workflowLabelContainer", "workflowContainerDisabledNotice", "workflowLabelDisabled__icon", "workflowContainerRight__icon", "workflowArrow__icon", "workflowDescription", "preferencesGroupContainer", "preferencesGroupHeader", "preferencesGroupLabelContainer", "preferencesGroupLabelIcon", "preferencesGroupLabel", "preferencesGroupActionsContainer", "preferencesGroupActionsContainerRight__icon", "preferencesGroupBody", "preferencesGroupChannels", "preferencesGroupInfo", "preferencesGroupInfoIcon", "preferencesGroupWorkflows", "channelContainer", "channelIconContainer", "channel__icon", "channelsContainerCollapsible", "channelsContainer", "channelLabel", "channelLabelContainer", "channelName", "channelSwitchContainer", "channelSwitch", "channelSwitchThumb", "preferencesHeader", "preferencesHeader__back__button", "preferencesHeader__back__button__icon", "preferencesHeader__title", "preferencesHeader__icon", "preferencesListEmptyNoticeContainer", "preferencesListEmptyNotice", "preferencesList__skeleton", "preferencesList__skeletonContent", "preferencesList__skeletonItem", "preferencesList__skeletonIcon", "preferencesList__skeletonSwitch", "preferencesList__skeletonSwitchThumb", "preferencesList__skeletonText", "notificationSnooze__dropdownContent", "notificationSnooze__dropdownItem", "notificationSnooze__dropdownItem__icon", "notificationSnoozeCustomTime_popoverContent", "notificationDeliveredAt__badge", "notificationDeliveredAt__icon", "notificationSnoozedUntil__icon", "strong"];
|
|
4
4
|
|
|
5
5
|
declare const defaultLocalization: {
|
|
6
6
|
readonly locale: "en-US";
|
|
@@ -31,6 +31,7 @@ declare const defaultLocalization: {
|
|
|
31
31
|
readonly 'preferences.global': "Global Preferences";
|
|
32
32
|
readonly 'preferences.workflow.disabled.notice': "Contact admin to enable subscription management for this critical notification.";
|
|
33
33
|
readonly 'preferences.workflow.disabled.tooltip': "Contact admin to edit";
|
|
34
|
+
readonly 'preferences.group.info': "Applies to all notifications under this group.";
|
|
34
35
|
readonly 'snooze.datePicker.timePickerLabel': "Time";
|
|
35
36
|
readonly 'snooze.datePicker.apply': "Apply";
|
|
36
37
|
readonly 'snooze.datePicker.cancel': "Cancel";
|
|
@@ -65,7 +66,7 @@ type Tab = {
|
|
|
65
66
|
* @deprecated Use `filter` instead
|
|
66
67
|
*/
|
|
67
68
|
value?: Array<string>;
|
|
68
|
-
filter?: Pick<NotificationFilter, 'tags'>;
|
|
69
|
+
filter?: Pick<NotificationFilter, 'tags' | 'data'>;
|
|
69
70
|
};
|
|
70
71
|
type CSSProperties = {
|
|
71
72
|
[key: string]: string | number;
|
|
@@ -89,20 +90,30 @@ type Variables = {
|
|
|
89
90
|
};
|
|
90
91
|
type AppearanceKey = (typeof appearanceKeys)[number];
|
|
91
92
|
type Elements = Partial<Record<AppearanceKey, ElementStyles>>;
|
|
93
|
+
type IconKey = 'bell' | 'clock' | 'arrowDropDown' | 'dots' | 'markAsRead' | 'cogs' | 'trash' | 'markAsArchived' | 'markAsArchivedRead' | 'markAsUnread' | 'markAsUnarchived' | 'unsnooze' | 'arrowRight' | 'arrowLeft' | 'unread' | 'sms' | 'inApp' | 'email' | 'push' | 'chat' | 'check' | 'arrowDown' | 'routeFill' | 'info' | 'nodeTree';
|
|
94
|
+
type IconRenderer = (el: HTMLDivElement, props: {
|
|
95
|
+
class?: string;
|
|
96
|
+
}) => () => void;
|
|
97
|
+
type IconOverrides = {
|
|
98
|
+
[key in IconKey]?: IconRenderer;
|
|
99
|
+
};
|
|
92
100
|
type Theme = {
|
|
93
101
|
variables?: Variables;
|
|
94
102
|
elements?: Elements;
|
|
95
103
|
animations?: boolean;
|
|
104
|
+
icons?: IconOverrides;
|
|
96
105
|
};
|
|
97
106
|
type Appearance = Theme & {
|
|
98
107
|
baseTheme?: Theme | Theme[];
|
|
99
108
|
};
|
|
100
109
|
type BaseNovuProviderProps = {
|
|
110
|
+
container?: Node | string | null;
|
|
101
111
|
appearance?: Appearance;
|
|
102
112
|
localization?: Localization;
|
|
103
113
|
options: NovuOptions;
|
|
104
114
|
tabs?: Array<Tab>;
|
|
105
115
|
preferencesFilter?: PreferencesFilter;
|
|
116
|
+
preferenceGroups?: PreferenceGroups;
|
|
106
117
|
routerPush?: RouterPush;
|
|
107
118
|
novu?: Novu;
|
|
108
119
|
};
|
|
@@ -117,5 +128,15 @@ declare enum NotificationStatus {
|
|
|
117
128
|
SNOOZED = "snoozed"
|
|
118
129
|
}
|
|
119
130
|
type PreferencesFilter = Pick<NotificationFilter, 'tags'>;
|
|
131
|
+
type PreferenceFilterFunction = (args: {
|
|
132
|
+
preferences: Preference[];
|
|
133
|
+
}) => Preference[];
|
|
134
|
+
type PreferenceGroupFilter = (PreferencesFilter & {
|
|
135
|
+
workflowIds?: string[];
|
|
136
|
+
}) | PreferenceFilterFunction;
|
|
137
|
+
type PreferenceGroups = Array<{
|
|
138
|
+
name: string;
|
|
139
|
+
filter: PreferenceGroupFilter;
|
|
140
|
+
}>;
|
|
120
141
|
|
|
121
|
-
export { type Appearance as A, type BellRenderer as B, type Elements as E, type Localization as L, type NotificationClickHandler as N, type PreferencesFilter as P, type RouterPush as R, type SubjectRenderer as S, type Tab as T, type Variables as V, type NotificationActionClickHandler as a, type NotificationRenderer as b, type BodyRenderer as c, type NovuProviderProps as d, type BaseNovuProviderProps as e, type
|
|
142
|
+
export { type Appearance as A, type BellRenderer as B, type Elements as E, type IconKey as I, type Localization as L, type NotificationClickHandler as N, type PreferencesFilter as P, type RouterPush as R, type SubjectRenderer as S, type Tab as T, type Variables as V, type NotificationActionClickHandler as a, type NotificationRenderer as b, type BodyRenderer as c, type NovuProviderProps as d, type BaseNovuProviderProps as e, type PreferenceGroups as f, type AppearanceKey as g, type ElementStyles as h, type IconOverrides as i, type IconRenderer as j, type LocalizationKey as k, NotificationStatus as l, type Theme as m };
|
package/dist/esm/ui/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as NovuOptions } from '../novu-
|
|
2
|
-
export { d as Notification } from '../novu-
|
|
3
|
-
import { B as BellRenderer, N as NotificationClickHandler, a as NotificationActionClickHandler, b as NotificationRenderer, S as SubjectRenderer, c as BodyRenderer, d as NovuProviderProps, e as BaseNovuProviderProps, A as Appearance, L as Localization, T as Tab, P as PreferencesFilter, R as RouterPush } from '../types-
|
|
4
|
-
export {
|
|
1
|
+
import { g as NovuOptions } from '../novu-q3jzGeyW.mjs';
|
|
2
|
+
export { d as Notification } from '../novu-q3jzGeyW.mjs';
|
|
3
|
+
import { B as BellRenderer, N as NotificationClickHandler, a as NotificationActionClickHandler, b as NotificationRenderer, S as SubjectRenderer, c as BodyRenderer, d as NovuProviderProps, e as BaseNovuProviderProps, A as Appearance, L as Localization, T as Tab, P as PreferencesFilter, f as PreferenceGroups, R as RouterPush } from '../types-CTQLJWIf.mjs';
|
|
4
|
+
export { g as AppearanceKey, h as ElementStyles, E as Elements, I as IconKey, i as IconOverrides, j as IconRenderer, k as LocalizationKey, l as NotificationStatus, m as Theme, V as Variables } from '../types-CTQLJWIf.mjs';
|
|
5
5
|
import { Placement, OffsetOptions } from '@floating-ui/dom';
|
|
6
6
|
import * as solid_js from 'solid-js';
|
|
7
7
|
import { ComponentProps } from 'solid-js';
|
|
@@ -71,8 +71,10 @@ declare class NovuUI {
|
|
|
71
71
|
updateOptions(options: NovuOptions): void;
|
|
72
72
|
updateTabs(tabs?: Array<Tab>): void;
|
|
73
73
|
updatePreferencesFilter(preferencesFilter?: PreferencesFilter): void;
|
|
74
|
+
updatePreferenceGroups(preferenceGroups?: PreferenceGroups): void;
|
|
74
75
|
updateRouterPush(routerPush?: RouterPush): void;
|
|
76
|
+
updateContainer(container?: Node | string | null): void;
|
|
75
77
|
unmount(): void;
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
export { Appearance, type BaseNovuUIOptions, BellRenderer, BodyRenderer, InboxPage, type InboxProps, Localization, NotificationActionClickHandler, NotificationClickHandler, NotificationRenderer, NovuProviderProps, NovuUI, type NovuUIOptions, PreferencesFilter, RouterPush, SubjectRenderer, Tab };
|
|
80
|
+
export { Appearance, type BaseNovuUIOptions, BellRenderer, BodyRenderer, InboxPage, type InboxProps, Localization, NotificationActionClickHandler, NotificationClickHandler, NotificationRenderer, NovuProviderProps, NovuUI, type NovuUIOptions, PreferenceGroups, PreferencesFilter, RouterPush, SubjectRenderer, Tab };
|