@novu/js 2.2.1 → 2.3.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/index.js CHANGED
@@ -1,58 +1,59 @@
1
1
  'use strict';
2
2
 
3
- var chunkHEC6BX2T_js = require('./chunk-HEC6BX2T.js');
3
+ var chunkAALXN67T_js = require('./chunk-AALXN67T.js');
4
+ require('./chunk-7B52C2XE.js');
4
5
 
5
6
 
6
7
 
7
8
  Object.defineProperty(exports, "ActionTypeEnum", {
8
9
  enumerable: true,
9
- get: function () { return chunkHEC6BX2T_js.ActionTypeEnum; }
10
+ get: function () { return chunkAALXN67T_js.ActionTypeEnum; }
10
11
  });
11
12
  Object.defineProperty(exports, "ChannelType", {
12
13
  enumerable: true,
13
- get: function () { return chunkHEC6BX2T_js.ChannelType; }
14
+ get: function () { return chunkAALXN67T_js.ChannelType; }
14
15
  });
15
16
  Object.defineProperty(exports, "CtaType", {
16
17
  enumerable: true,
17
- get: function () { return chunkHEC6BX2T_js.CtaType; }
18
+ get: function () { return chunkAALXN67T_js.CtaType; }
18
19
  });
19
20
  Object.defineProperty(exports, "NotificationActionStatus", {
20
21
  enumerable: true,
21
- get: function () { return chunkHEC6BX2T_js.NotificationActionStatus; }
22
+ get: function () { return chunkAALXN67T_js.NotificationActionStatus; }
22
23
  });
23
24
  Object.defineProperty(exports, "NotificationButton", {
24
25
  enumerable: true,
25
- get: function () { return chunkHEC6BX2T_js.NotificationButton; }
26
+ get: function () { return chunkAALXN67T_js.NotificationButton; }
26
27
  });
27
28
  Object.defineProperty(exports, "NotificationStatus", {
28
29
  enumerable: true,
29
- get: function () { return chunkHEC6BX2T_js.NotificationStatus; }
30
+ get: function () { return chunkAALXN67T_js.NotificationStatus; }
30
31
  });
31
32
  Object.defineProperty(exports, "Novu", {
32
33
  enumerable: true,
33
- get: function () { return chunkHEC6BX2T_js.Novu; }
34
+ get: function () { return chunkAALXN67T_js.Novu; }
34
35
  });
35
36
  Object.defineProperty(exports, "PreferenceLevel", {
36
37
  enumerable: true,
37
- get: function () { return chunkHEC6BX2T_js.PreferenceLevel; }
38
+ get: function () { return chunkAALXN67T_js.PreferenceLevel; }
38
39
  });
39
40
  Object.defineProperty(exports, "PreferenceOverrideSource", {
40
41
  enumerable: true,
41
- get: function () { return chunkHEC6BX2T_js.PreferenceOverrideSource; }
42
+ get: function () { return chunkAALXN67T_js.PreferenceOverrideSource; }
42
43
  });
43
44
  Object.defineProperty(exports, "PreferenceOverrideSourceEnum", {
44
45
  enumerable: true,
45
- get: function () { return chunkHEC6BX2T_js.PreferenceOverrideSourceEnum; }
46
+ get: function () { return chunkAALXN67T_js.PreferenceOverrideSourceEnum; }
46
47
  });
47
48
  Object.defineProperty(exports, "WebSocketEvent", {
48
49
  enumerable: true,
49
- get: function () { return chunkHEC6BX2T_js.WebSocketEvent; }
50
+ get: function () { return chunkAALXN67T_js.WebSocketEvent; }
50
51
  });
51
52
  Object.defineProperty(exports, "areTagsEqual", {
52
53
  enumerable: true,
53
- get: function () { return chunkHEC6BX2T_js.areTagsEqual; }
54
+ get: function () { return chunkAALXN67T_js.areTagsEqual; }
54
55
  });
55
56
  Object.defineProperty(exports, "isSameFilter", {
56
57
  enumerable: true,
57
- get: function () { return chunkHEC6BX2T_js.isSameFilter; }
58
+ get: function () { return chunkAALXN67T_js.isSameFilter; }
58
59
  });
@@ -0,0 +1,7 @@
1
+ import { g as Theme } from '../types-yDke_w6U.js';
2
+ import '../novu-psplDV5F.js';
3
+ import '@novu/client';
4
+
5
+ declare const dark: Theme;
6
+
7
+ export { dark };
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ require('../chunk-7B52C2XE.js');
4
+
5
+ // src/ui/themes/dark.ts
6
+ var dark = {
7
+ variables: {
8
+ colorNeutral: "white",
9
+ colorBackground: "#161618",
10
+ colorForeground: "#EDEDEF",
11
+ colorSecondary: "#7E7D86",
12
+ colorSecondaryForeground: "#EDEDEF",
13
+ colorShadow: "black"
14
+ }
15
+ };
16
+
17
+ exports.dark = dark;
@@ -0,0 +1,98 @@
1
+ import { t as Notification, N as NotificationFilter, s as NovuOptions, b as Novu } from './novu-psplDV5F.js';
2
+
3
+ declare const defaultLocalization: {
4
+ readonly locale: "en-US";
5
+ readonly 'inbox.filters.dropdownOptions.unread': "Unread only";
6
+ readonly 'inbox.filters.dropdownOptions.default': "Unread & read";
7
+ readonly 'inbox.filters.dropdownOptions.archived': "Archived";
8
+ readonly 'inbox.filters.labels.unread': "Unread";
9
+ readonly 'inbox.filters.labels.default': "Inbox";
10
+ readonly 'inbox.filters.labels.archived': "Archived";
11
+ readonly 'notifications.emptyNotice': "No notifications";
12
+ readonly 'notifications.actions.readAll': "Mark all as read";
13
+ readonly 'notifications.actions.archiveAll': "Archive all";
14
+ readonly 'notifications.actions.archiveRead': "Archive read";
15
+ readonly 'notifications.newNotifications': ({ notificationCount }: {
16
+ notificationCount: number;
17
+ }) => string;
18
+ readonly 'notification.actions.read.tooltip': "Mark as read";
19
+ readonly 'notification.actions.unread.tooltip': "Mark as unread";
20
+ readonly 'notification.actions.archive.tooltip': "Archive";
21
+ readonly 'notification.actions.unarchive.tooltip': "Unarchive";
22
+ readonly 'preferences.title': "Notification Preferences";
23
+ readonly 'preferences.global': "Global Preferences";
24
+ readonly 'preferences.workflow.disabled.notice': "Contact admin to enable subscription management for this critical notification.";
25
+ readonly 'preferences.workflow.disabled.tooltip': "Contact admin to edit";
26
+ };
27
+
28
+ declare const appearanceKeys: readonly ["button", "popoverContent", "popoverTrigger", "dropdownContent", "dropdownTrigger", "dropdownItem", "dropdownItemLabel", "dropdownItemLabelContainer", "dropdownItemLeftIcon", "dropdownItemRightIcon", "tooltipContent", "tooltipTrigger", "back__button", "skeletonText", "skeletonAvatar", "tabsRoot", "tabsList", "tabsContent", "tabsTrigger", "dots", "root", "bellIcon", "bellContainer", "bellDot", "preferences__button", "preferencesContainer", "inboxHeader", "loading", "inboxContent", "inbox__popoverTrigger", "inbox__popoverContent", "notificationListContainer", "notificationList", "notificationListEmptyNoticeContainer", "notificationListEmptyNotice", "notificationListEmptyNoticeIcon", "notificationListNewNotificationsNotice__button", "notification", "notificationDot", "notificationSubject", "notificationSubject__strong", "notificationBody", "notificationBody__strong", "notificationBodyContainer", "notificationImage", "notificationDate", "notificationDefaultActions", "notificationCustomActions", "notificationPrimaryAction__button", "notificationSecondaryAction__button", "notificationRead__button", "notificationUnread__button", "notificationArchive__button", "notificationUnarchive__button", "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", "moreActionsContainer", "moreActions__dropdownTrigger", "moreActions__dropdownContent", "moreActions__dropdownItem", "moreActions__dropdownItemLabel", "moreActions__dropdownItemLeft__icon", "moreActions__dots", "moreTabs__button", "moreTabs__dots", "moreTabs__dropdownTrigger", "moreTabs__dropdownContent", "moreTabs__dropdownItem", "moreTabs__dropdownItemLabel", "moreTabs__dropdownItemRight__icon", "workflowContainer", "workflowLabel", "workflowLabelContainer", "workflowContainerDisabledNotice", "workflowLabelDisabled__icon", "workflowContainerRight__icon", "workflowArrow__icon", "channelContainer", "channelsContainerCollapsible", "channelsContainer", "channelLabel", "channelLabelContainer", "channelDescription", "channelName", "channelSwitchContainer", "channelSwitch", "channelSwitchThumb", "preferencesHeader", "preferencesHeader__back__button", "preferencesHeader__title", "preferencesLoadingContainer", "strong"];
29
+
30
+ type LocalizationKey = keyof typeof defaultLocalization;
31
+ type Localization = {
32
+ [K in LocalizationKey]?: (typeof defaultLocalization)[K] extends (...args: infer P) => any ? ((...args: P) => ReturnType<(typeof defaultLocalization)[K]>) | string : string;
33
+ } & {
34
+ dynamic?: Record<string, string>;
35
+ };
36
+
37
+ type NotificationClickHandler = (notification: Notification) => void;
38
+ type NotificationActionClickHandler = (notification: Notification) => void;
39
+ type NotificationRenderer = (el: HTMLDivElement, notification: Notification) => () => void;
40
+ type BellRenderer = (el: HTMLDivElement, unreadCount: number) => () => void;
41
+ type RouterPush = (path: string) => void;
42
+ type Tab = {
43
+ label: string;
44
+ /**
45
+ * @deprecated Use `filter` instead
46
+ */
47
+ value?: Array<string>;
48
+ filter?: Pick<NotificationFilter, 'tags'>;
49
+ };
50
+ type CSSProperties = {
51
+ [key: string]: string | number;
52
+ };
53
+ type ElementStyles = string | CSSProperties;
54
+ type Variables = {
55
+ colorBackground?: string;
56
+ colorForeground?: string;
57
+ colorPrimary?: string;
58
+ colorPrimaryForeground?: string;
59
+ colorSecondary?: string;
60
+ colorSecondaryForeground?: string;
61
+ colorCounter?: string;
62
+ colorCounterForeground?: string;
63
+ colorNeutral?: string;
64
+ colorShadow?: string;
65
+ fontSize?: string;
66
+ borderRadius?: string;
67
+ };
68
+ type AppearanceKey = (typeof appearanceKeys)[number];
69
+ type Elements = Partial<Record<AppearanceKey, ElementStyles>>;
70
+ type Theme = {
71
+ variables?: Variables;
72
+ elements?: Elements;
73
+ animations?: boolean;
74
+ };
75
+ type Appearance = Theme & {
76
+ baseTheme?: Theme | Theme[];
77
+ };
78
+ type BaseNovuProviderProps = {
79
+ appearance?: Appearance;
80
+ localization?: Localization;
81
+ options: NovuOptions;
82
+ tabs?: Array<Tab>;
83
+ preferencesFilter?: PreferencesFilter;
84
+ routerPush?: RouterPush;
85
+ novu?: Novu;
86
+ };
87
+ type NovuProviderProps = BaseNovuProviderProps & {
88
+ renderNotification?: NotificationRenderer;
89
+ renderBell?: BellRenderer;
90
+ };
91
+ declare enum NotificationStatus {
92
+ UNREAD_READ = "unreadRead",
93
+ UNREAD = "unread",
94
+ ARCHIVED = "archived"
95
+ }
96
+ type PreferencesFilter = Pick<NotificationFilter, 'tags'>;
97
+
98
+ export { type Appearance as A, type BellRenderer as B, type CSSProperties as C, type ElementStyles as E, type Localization as L, type NotificationRenderer as N, type PreferencesFilter as P, type RouterPush as R, type Tab as T, type Variables as V, type NotificationClickHandler as a, type NotificationActionClickHandler as b, type NovuProviderProps as c, type BaseNovuProviderProps as d, type AppearanceKey as e, type Elements as f, type Theme as g, NotificationStatus as h, type LocalizationKey as i };
@@ -1,104 +1,12 @@
1
- import { t as Notification, N as NotificationFilter, s as NovuOptions, b as Novu } from '../novu-psplDV5F.js';
1
+ import { s as NovuOptions } from '../novu-psplDV5F.js';
2
+ export { t as Notification } from '../novu-psplDV5F.js';
3
+ import { N as NotificationRenderer, B as BellRenderer, a as NotificationClickHandler, b as NotificationActionClickHandler, c as NovuProviderProps, d as BaseNovuProviderProps, A as Appearance, L as Localization, T as Tab, P as PreferencesFilter, R as RouterPush } from '../types-yDke_w6U.js';
4
+ export { e as AppearanceKey, C as CSSProperties, E as ElementStyles, f as Elements, i as LocalizationKey, h as NotificationStatus, g as Theme, V as Variables } from '../types-yDke_w6U.js';
2
5
  import * as solid_js from 'solid-js';
3
6
  import { ComponentProps } from 'solid-js';
4
7
  import { MountableElement } from 'solid-js/web';
5
8
  import '@novu/client';
6
9
 
7
- declare const defaultLocalization: {
8
- readonly locale: "en-US";
9
- readonly 'inbox.filters.dropdownOptions.unread': "Unread only";
10
- readonly 'inbox.filters.dropdownOptions.default': "Unread & read";
11
- readonly 'inbox.filters.dropdownOptions.archived': "Archived";
12
- readonly 'inbox.filters.labels.unread': "Unread";
13
- readonly 'inbox.filters.labels.default': "Inbox";
14
- readonly 'inbox.filters.labels.archived': "Archived";
15
- readonly 'notifications.emptyNotice': "No notifications";
16
- readonly 'notifications.actions.readAll': "Mark all as read";
17
- readonly 'notifications.actions.archiveAll': "Archive all";
18
- readonly 'notifications.actions.archiveRead': "Archive read";
19
- readonly 'notifications.newNotifications': ({ notificationCount }: {
20
- notificationCount: number;
21
- }) => string;
22
- readonly 'notification.actions.read.tooltip': "Mark as read";
23
- readonly 'notification.actions.unread.tooltip': "Mark as unread";
24
- readonly 'notification.actions.archive.tooltip': "Archive";
25
- readonly 'notification.actions.unarchive.tooltip': "Unarchive";
26
- readonly 'preferences.title': "Notification Preferences";
27
- readonly 'preferences.global': "Global Preferences";
28
- readonly 'preferences.workflow.disabled.notice': "Contact admin to enable subscription management for this critical notification.";
29
- readonly 'preferences.workflow.disabled.tooltip': "Contact admin to edit";
30
- };
31
-
32
- declare const appearanceKeys: readonly ["button", "popoverContent", "popoverTrigger", "dropdownContent", "dropdownTrigger", "dropdownItem", "dropdownItemLabel", "dropdownItemLabelContainer", "dropdownItemLeftIcon", "dropdownItemRightIcon", "tooltipContent", "tooltipTrigger", "back__button", "skeletonText", "skeletonAvatar", "tabsRoot", "tabsList", "tabsContent", "tabsTrigger", "dots", "root", "bellIcon", "bellContainer", "bellDot", "preferences__button", "preferencesContainer", "inboxHeader", "loading", "inboxContent", "inbox__popoverTrigger", "inbox__popoverContent", "notificationListContainer", "notificationList", "notificationListEmptyNoticeContainer", "notificationListEmptyNotice", "notificationListEmptyNoticeIcon", "notificationListNewNotificationsNotice__button", "notification", "notificationDot", "notificationSubject", "notificationSubject__strong", "notificationBody", "notificationBody__strong", "notificationBodyContainer", "notificationImage", "notificationDate", "notificationDefaultActions", "notificationCustomActions", "notificationPrimaryAction__button", "notificationSecondaryAction__button", "notificationRead__button", "notificationUnread__button", "notificationArchive__button", "notificationUnarchive__button", "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", "moreActionsContainer", "moreActions__dropdownTrigger", "moreActions__dropdownContent", "moreActions__dropdownItem", "moreActions__dropdownItemLabel", "moreActions__dropdownItemLeft__icon", "moreActions__dots", "moreTabs__button", "moreTabs__dots", "moreTabs__dropdownTrigger", "moreTabs__dropdownContent", "moreTabs__dropdownItem", "moreTabs__dropdownItemLabel", "moreTabs__dropdownItemRight__icon", "workflowContainer", "workflowLabel", "workflowLabelContainer", "workflowContainerDisabledNotice", "workflowLabelDisabled__icon", "workflowContainerRight__icon", "workflowArrow__icon", "channelContainer", "channelsContainerCollapsible", "channelsContainer", "channelLabel", "channelLabelContainer", "channelDescription", "channelName", "channelSwitchContainer", "channelSwitch", "channelSwitchThumb", "preferencesHeader", "preferencesHeader__back__button", "preferencesHeader__title", "preferencesLoadingContainer", "strong"];
33
-
34
- type LocalizationKey = keyof typeof defaultLocalization;
35
- type Localization = {
36
- [K in LocalizationKey]?: (typeof defaultLocalization)[K] extends (...args: infer P) => any ? ((...args: P) => ReturnType<(typeof defaultLocalization)[K]>) | string : string;
37
- } & {
38
- dynamic?: Record<string, string>;
39
- };
40
-
41
- type NotificationClickHandler = (notification: Notification) => void;
42
- type NotificationActionClickHandler = (notification: Notification) => void;
43
- type NotificationRenderer = (el: HTMLDivElement, notification: Notification) => () => void;
44
- type BellRenderer = (el: HTMLDivElement, unreadCount: number) => () => void;
45
- type RouterPush = (path: string) => void;
46
- type Tab = {
47
- label: string;
48
- /**
49
- * @deprecated Use `filter` instead
50
- */
51
- value?: Array<string>;
52
- filter?: Pick<NotificationFilter, 'tags'>;
53
- };
54
- type CSSProperties = {
55
- [key: string]: string | number;
56
- };
57
- type ElementStyles = string | CSSProperties;
58
- type Variables = {
59
- colorBackground?: string;
60
- colorForeground?: string;
61
- colorPrimary?: string;
62
- colorPrimaryForeground?: string;
63
- colorSecondary?: string;
64
- colorSecondaryForeground?: string;
65
- colorCounter?: string;
66
- colorCounterForeground?: string;
67
- colorNeutral?: string;
68
- colorShadow?: string;
69
- fontSize?: string;
70
- borderRadius?: string;
71
- };
72
- type AppearanceKey = (typeof appearanceKeys)[number];
73
- type Elements = Partial<Record<AppearanceKey, ElementStyles>>;
74
- type Theme = {
75
- variables?: Variables;
76
- elements?: Elements;
77
- animations?: boolean;
78
- };
79
- type Appearance = Theme & {
80
- baseTheme?: Theme | Theme[];
81
- };
82
- type BaseNovuProviderProps = {
83
- appearance?: Appearance;
84
- localization?: Localization;
85
- options: NovuOptions;
86
- tabs?: Array<Tab>;
87
- preferencesFilter?: PreferencesFilter;
88
- routerPush?: RouterPush;
89
- novu?: Novu;
90
- };
91
- type NovuProviderProps = BaseNovuProviderProps & {
92
- renderNotification?: NotificationRenderer;
93
- renderBell?: BellRenderer;
94
- };
95
- declare enum NotificationStatus {
96
- UNREAD_READ = "unreadRead",
97
- UNREAD = "unread",
98
- ARCHIVED = "archived"
99
- }
100
- type PreferencesFilter = Pick<NotificationFilter, 'tags'>;
101
-
102
10
  type InboxProps = {
103
11
  open?: boolean;
104
12
  renderNotification?: NotificationRenderer;
@@ -122,6 +30,7 @@ type InboxContentProps = {
122
30
 
123
31
  declare const novuComponents: {
124
32
  Inbox: (props: InboxProps) => solid_js.JSX.Element;
33
+ InboxContent: (props: InboxContentProps) => solid_js.JSX.Element;
125
34
  Bell: solid_js.Component<{
126
35
  renderBell?: BellRenderer;
127
36
  }>;
@@ -151,4 +60,4 @@ declare class NovuUI {
151
60
  unmount(): void;
152
61
  }
153
62
 
154
- export { type Appearance, type AppearanceKey, type BaseNovuProviderProps, type BaseNovuUIOptions, type BellRenderer, type CSSProperties, type ElementStyles, type Elements, InboxPage, type InboxProps, type Localization, type LocalizationKey, Notification, type NotificationActionClickHandler, type NotificationClickHandler, type NotificationRenderer, NotificationStatus, type NovuProviderProps, NovuUI, type NovuUIOptions, type PreferencesFilter, type RouterPush, type Tab, type Theme, type Variables };
63
+ export { Appearance, BaseNovuProviderProps, type BaseNovuUIOptions, BellRenderer, InboxPage, type InboxProps, Localization, NotificationActionClickHandler, NotificationClickHandler, NotificationRenderer, NovuProviderProps, NovuUI, type NovuUIOptions, PreferencesFilter, RouterPush, Tab };