@novu/react 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.
Files changed (44) hide show
  1. package/dist/cjs/components/Inbox.cjs +65 -61
  2. package/dist/cjs/components/Inbox.cjs.map +1 -1
  3. package/dist/cjs/components/NovuUI.cjs +59 -10
  4. package/dist/cjs/components/NovuUI.cjs.map +1 -1
  5. package/dist/cjs/components/NovuUI.d.cts +6 -2
  6. package/dist/cjs/components/ShadowRootDetector.cjs +63 -0
  7. package/dist/cjs/components/ShadowRootDetector.cjs.map +1 -0
  8. package/dist/cjs/components/ShadowRootDetector.d.cts +5 -0
  9. package/dist/cjs/hooks/NovuProvider.cjs +1 -1
  10. package/dist/cjs/hooks/useNotifications.cjs +8 -7
  11. package/dist/cjs/hooks/useNotifications.cjs.map +1 -1
  12. package/dist/cjs/hooks/useNotifications.d.cts +1 -0
  13. package/dist/cjs/index.cjs.map +1 -1
  14. package/dist/cjs/index.d.cts +1 -1
  15. package/dist/cjs/server/index.cjs +3 -0
  16. package/dist/cjs/server/index.cjs.map +1 -1
  17. package/dist/cjs/server/index.d.cts +3 -3
  18. package/dist/cjs/utils/appearance.cjs +53 -0
  19. package/dist/cjs/utils/appearance.cjs.map +1 -0
  20. package/dist/cjs/utils/appearance.d.cts +10 -0
  21. package/dist/cjs/utils/types.cjs.map +1 -1
  22. package/dist/cjs/utils/types.d.cts +18 -3
  23. package/dist/esm/components/Inbox.js +65 -61
  24. package/dist/esm/components/Inbox.js.map +1 -1
  25. package/dist/esm/components/NovuUI.d.ts +6 -2
  26. package/dist/esm/components/NovuUI.js +61 -12
  27. package/dist/esm/components/NovuUI.js.map +1 -1
  28. package/dist/esm/components/ShadowRootDetector.d.ts +5 -0
  29. package/dist/esm/components/ShadowRootDetector.js +28 -0
  30. package/dist/esm/components/ShadowRootDetector.js.map +1 -0
  31. package/dist/esm/hooks/NovuProvider.js +1 -1
  32. package/dist/esm/hooks/useNotifications.d.ts +1 -0
  33. package/dist/esm/hooks/useNotifications.js +8 -7
  34. package/dist/esm/hooks/useNotifications.js.map +1 -1
  35. package/dist/esm/index.d.ts +1 -1
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist/esm/server/index.d.ts +3 -3
  38. package/dist/esm/server/index.js +3 -0
  39. package/dist/esm/server/index.js.map +1 -1
  40. package/dist/esm/utils/appearance.d.ts +10 -0
  41. package/dist/esm/utils/appearance.js +28 -0
  42. package/dist/esm/utils/appearance.js.map +1 -0
  43. package/dist/esm/utils/types.d.ts +18 -3
  44. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export type {\n FiltersCountResponse,\n ListNotificationsResponse,\n NovuError,\n Preference,\n PreferencesResponse,\n ChannelPreference,\n Notification,\n ChannelType,\n InboxNotification,\n NotificationFilter,\n NotificationStatus,\n NovuOptions,\n PreferenceLevel,\n WebSocketEvent,\n EventHandler,\n Events,\n SocketEventNames,\n} from '@novu/js';\n\nexport type {\n Appearance,\n AppearanceKey,\n Elements,\n ElementStyles,\n Localization,\n LocalizationKey,\n NotificationActionClickHandler,\n NotificationClickHandler,\n NotificationRenderer,\n PreferencesFilter,\n RouterPush,\n Tab,\n Variables,\n} from '@novu/js/ui';\n\nexport { Inbox, Bell, InboxContent, Notifications, NovuProvider, Preferences } from './components';\nexport { useNovu, useCounts, useNotifications, usePreferences } from './hooks';\n\nexport type { InboxProps, BellProps, InboxContentProps, NotificationProps, NovuProviderProps } from './components';\n\nexport type {\n UseCountsProps,\n UseCountsResult,\n UseNotificationsProps,\n UseNotificationsResult,\n UsePreferencesProps,\n UsePreferencesResult,\n} from './hooks';\n\nexport type {\n NotificationsRenderer,\n SubjectRenderer,\n BodyRenderer,\n BellRenderer,\n DefaultInboxProps,\n BaseProps,\n NotificationRendererProps,\n SubjectBodyRendererProps,\n NoRendererProps,\n DefaultProps,\n WithChildrenProps,\n} from './utils/types';\n"],"mappings":";AAoCA,SAAS,OAAO,MAAM,cAAc,eAAe,cAAc,mBAAmB;AACpF,SAAS,SAAS,WAAW,kBAAkB,sBAAsB;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export type {\n FiltersCountResponse,\n ListNotificationsResponse,\n NovuError,\n Preference,\n PreferencesResponse,\n ChannelPreference,\n Notification,\n ChannelType,\n InboxNotification,\n NotificationFilter,\n NotificationStatus,\n NovuOptions,\n PreferenceLevel,\n WebSocketEvent,\n EventHandler,\n Events,\n SocketEventNames,\n} from '@novu/js';\n\nexport type {\n Appearance,\n AppearanceKey,\n Elements,\n ElementStyles,\n Localization,\n LocalizationKey,\n NotificationActionClickHandler,\n NotificationClickHandler,\n NotificationRenderer,\n PreferencesFilter,\n PreferenceGroups,\n RouterPush,\n Tab,\n Variables,\n} from '@novu/js/ui';\n\nexport { Inbox, Bell, InboxContent, Notifications, NovuProvider, Preferences } from './components';\nexport { useNovu, useCounts, useNotifications, usePreferences } from './hooks';\n\nexport type { InboxProps, BellProps, InboxContentProps, NotificationProps, NovuProviderProps } from './components';\n\nexport type {\n UseCountsProps,\n UseCountsResult,\n UseNotificationsProps,\n UseNotificationsResult,\n UsePreferencesProps,\n UsePreferencesResult,\n} from './hooks';\n\nexport type {\n NotificationsRenderer,\n SubjectRenderer,\n BodyRenderer,\n BellRenderer,\n DefaultInboxProps,\n BaseProps,\n NotificationRendererProps,\n SubjectBodyRendererProps,\n NoRendererProps,\n DefaultProps,\n WithChildrenProps,\n} from './utils/types';\n"],"mappings":";AAqCA,SAAS,OAAO,MAAM,cAAc,eAAe,cAAc,mBAAmB;AACpF,SAAS,SAAS,WAAW,kBAAkB,sBAAsB;","names":[]}
@@ -1,15 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { UseNotificationsProps, UseNotificationsResult } from '../hooks/useNotifications.js';
2
3
  import { UsePreferencesProps, UsePreferencesResult } from '../hooks/usePreferences.js';
3
4
  import { UseCountsProps, UseCountsResult } from '../hooks/useCounts.js';
4
5
  import { NovuProviderProps } from '../hooks/NovuProvider.js';
5
6
  import { InboxProps } from '../components/Inbox.js';
6
7
  export { ChannelPreference, ChannelType, FiltersCountResponse, InboxNotification, ListNotificationsResponse, Notification, NotificationFilter, NotificationStatus, NovuError, NovuOptions, Preference, PreferenceLevel } from '@novu/js';
7
- export { Appearance, AppearanceKey, ElementStyles, Elements, Localization, LocalizationKey, NotificationActionClickHandler, NotificationClickHandler, NotificationRenderer, PreferencesFilter, RouterPush, Tab, Variables } from '@novu/js/ui';
8
+ export { Appearance, AppearanceKey, ElementStyles, Elements, Localization, LocalizationKey, NotificationActionClickHandler, NotificationClickHandler, NotificationRenderer, PreferenceGroups, PreferencesFilter, RouterPush, Tab, Variables } from '@novu/js/ui';
8
9
  export { BellProps } from '../components/Bell.js';
9
10
  export { NotificationProps } from '../components/Notifications.js';
10
11
  export { InboxContentProps } from '../components/InboxContent.js';
11
12
  export { BaseProps, BellRenderer, BodyRenderer, DefaultInboxProps, DefaultProps, NoRendererProps, NotificationRendererProps, NotificationsRenderer, SubjectBodyRendererProps, SubjectRenderer, WithChildrenProps } from '../utils/types.js';
12
- import 'react/jsx-runtime';
13
13
  import 'react';
14
14
 
15
15
  /**
@@ -18,7 +18,7 @@ import 'react';
18
18
  * This will be replaced with actual components
19
19
  * when we implement the SSR components in @novu/js/ui
20
20
  */
21
- declare function Inbox(props: InboxProps): void;
21
+ declare function Inbox(props: InboxProps): react_jsx_runtime.JSX.Element;
22
22
  declare function InboxContent(): void;
23
23
  declare function Notifications(): void;
24
24
  declare function Preferences(): void;
@@ -1,5 +1,8 @@
1
1
  // src/server/index.tsx
2
+ import { ShadowRootDetector } from "../components/ShadowRootDetector.js";
3
+ import { jsx } from "react/jsx-runtime";
2
4
  function Inbox(props) {
5
+ return /* @__PURE__ */ jsx(ShadowRootDetector, {});
3
6
  }
4
7
  function InboxContent() {
5
8
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/index.tsx"],"sourcesContent":["import type {\n UseNotificationsProps,\n UseNotificationsResult,\n UsePreferencesProps,\n UsePreferencesResult,\n} from '../hooks';\nimport type { UseCountsProps, UseCountsResult } from '../hooks/useCounts';\nimport type { InboxProps } from '../components/Inbox';\nimport type { NovuProviderProps } from '../hooks/NovuProvider';\n\n/**\n * Exporting all components from the components folder\n * as empty functions to fix build errors in SSR\n * This will be replaced with actual components\n * when we implement the SSR components in @novu/js/ui\n */\nexport function Inbox(props: InboxProps) {}\n\nexport function InboxContent() {}\n\nexport function Notifications() {}\n\nexport function Preferences() {}\n\nexport function Bell() {}\n\nexport function NovuProvider(props: NovuProviderProps) {}\n\nexport function useNovu() {\n return null;\n}\n\nexport function useCounts(_: UseCountsProps): UseCountsResult {\n return {\n isLoading: false,\n isFetching: false,\n refetch: () => Promise.resolve(),\n };\n}\n\nexport function useNotifications(_: UseNotificationsProps): UseNotificationsResult {\n return {\n isLoading: false,\n isFetching: false,\n hasMore: false,\n readAll: () => Promise.resolve({ data: undefined, error: undefined }),\n archiveAll: () => Promise.resolve({ data: undefined, error: undefined }),\n archiveAllRead: () => Promise.resolve({ data: undefined, error: undefined }),\n refetch: () => Promise.resolve(),\n fetchMore: () => Promise.resolve(),\n };\n}\n\nexport function usePreferences(_: UsePreferencesProps): UsePreferencesResult {\n return {\n isLoading: false,\n isFetching: false,\n refetch: () => Promise.resolve(),\n };\n}\n\nexport type {\n FiltersCountResponse,\n ListNotificationsResponse,\n NovuError,\n Preference,\n ChannelPreference,\n Notification,\n ChannelType,\n InboxNotification,\n NotificationFilter,\n NotificationStatus,\n NovuOptions,\n PreferenceLevel,\n} from '@novu/js';\n\nexport type {\n Appearance,\n AppearanceKey,\n Elements,\n ElementStyles,\n Localization,\n LocalizationKey,\n NotificationActionClickHandler,\n NotificationClickHandler,\n NotificationRenderer,\n PreferencesFilter,\n RouterPush,\n Tab,\n Variables,\n} from '@novu/js/ui';\n\nexport type { InboxProps, BellProps, InboxContentProps, NotificationProps, NovuProviderProps } from '../components';\n\nexport type {\n UseCountsProps,\n UseCountsResult,\n UseNotificationsProps,\n UseNotificationsResult,\n UsePreferencesProps,\n UsePreferencesResult,\n} from '../hooks';\n\nexport type {\n NotificationsRenderer,\n SubjectRenderer,\n BodyRenderer,\n BellRenderer,\n DefaultInboxProps,\n BaseProps,\n NotificationRendererProps,\n SubjectBodyRendererProps,\n NoRendererProps,\n DefaultProps,\n WithChildrenProps,\n} from '../utils/types';\n"],"mappings":";AAgBO,SAAS,MAAM,OAAmB;AAAC;AAEnC,SAAS,eAAe;AAAC;AAEzB,SAAS,gBAAgB;AAAC;AAE1B,SAAS,cAAc;AAAC;AAExB,SAAS,OAAO;AAAC;AAEjB,SAAS,aAAa,OAA0B;AAAC;AAEjD,SAAS,UAAU;AACxB,SAAO;AACT;AAEO,SAAS,UAAU,GAAoC;AAC5D,SAAO;AAAA,IACL,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS,MAAM,QAAQ,QAAQ;AAAA,EACjC;AACF;AAEO,SAAS,iBAAiB,GAAkD;AACjF,SAAO;AAAA,IACL,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,SAAS,MAAM,QAAQ,QAAQ,EAAE,MAAM,QAAW,OAAO,OAAU,CAAC;AAAA,IACpE,YAAY,MAAM,QAAQ,QAAQ,EAAE,MAAM,QAAW,OAAO,OAAU,CAAC;AAAA,IACvE,gBAAgB,MAAM,QAAQ,QAAQ,EAAE,MAAM,QAAW,OAAO,OAAU,CAAC;AAAA,IAC3E,SAAS,MAAM,QAAQ,QAAQ;AAAA,IAC/B,WAAW,MAAM,QAAQ,QAAQ;AAAA,EACnC;AACF;AAEO,SAAS,eAAe,GAA8C;AAC3E,SAAO;AAAA,IACL,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS,MAAM,QAAQ,QAAQ;AAAA,EACjC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/server/index.tsx"],"sourcesContent":["import type {\n UseNotificationsProps,\n UseNotificationsResult,\n UsePreferencesProps,\n UsePreferencesResult,\n} from '../hooks';\nimport type { UseCountsProps, UseCountsResult } from '../hooks/useCounts';\nimport type { InboxProps } from '../components/Inbox';\nimport type { NovuProviderProps } from '../hooks/NovuProvider';\nimport { ShadowRootDetector } from '../components/ShadowRootDetector';\n\n/**\n * Exporting all components from the components folder\n * as empty functions to fix build errors in SSR\n * This will be replaced with actual components\n * when we implement the SSR components in @novu/js/ui\n */\nexport function Inbox(props: InboxProps) {\n return <ShadowRootDetector />;\n}\n\nexport function InboxContent() {}\n\nexport function Notifications() {}\n\nexport function Preferences() {}\n\nexport function Bell() {}\n\nexport function NovuProvider(props: NovuProviderProps) {}\n\nexport function useNovu() {\n return null;\n}\n\nexport function useCounts(_: UseCountsProps): UseCountsResult {\n return {\n isLoading: false,\n isFetching: false,\n refetch: () => Promise.resolve(),\n };\n}\n\nexport function useNotifications(_: UseNotificationsProps): UseNotificationsResult {\n return {\n isLoading: false,\n isFetching: false,\n hasMore: false,\n readAll: () => Promise.resolve({ data: undefined, error: undefined }),\n archiveAll: () => Promise.resolve({ data: undefined, error: undefined }),\n archiveAllRead: () => Promise.resolve({ data: undefined, error: undefined }),\n refetch: () => Promise.resolve(),\n fetchMore: () => Promise.resolve(),\n };\n}\n\nexport function usePreferences(_: UsePreferencesProps): UsePreferencesResult {\n return {\n isLoading: false,\n isFetching: false,\n refetch: () => Promise.resolve(),\n };\n}\n\nexport type {\n FiltersCountResponse,\n ListNotificationsResponse,\n NovuError,\n Preference,\n ChannelPreference,\n Notification,\n ChannelType,\n InboxNotification,\n NotificationFilter,\n NotificationStatus,\n NovuOptions,\n PreferenceLevel,\n} from '@novu/js';\n\nexport type {\n Appearance,\n AppearanceKey,\n Elements,\n ElementStyles,\n Localization,\n LocalizationKey,\n NotificationActionClickHandler,\n NotificationClickHandler,\n NotificationRenderer,\n PreferencesFilter,\n PreferenceGroups,\n RouterPush,\n Tab,\n Variables,\n} from '@novu/js/ui';\n\nexport type { InboxProps, BellProps, InboxContentProps, NotificationProps, NovuProviderProps } from '../components';\n\nexport type {\n UseCountsProps,\n UseCountsResult,\n UseNotificationsProps,\n UseNotificationsResult,\n UsePreferencesProps,\n UsePreferencesResult,\n} from '../hooks';\n\nexport type {\n NotificationsRenderer,\n SubjectRenderer,\n BodyRenderer,\n BellRenderer,\n DefaultInboxProps,\n BaseProps,\n NotificationRendererProps,\n SubjectBodyRendererProps,\n NoRendererProps,\n DefaultProps,\n WithChildrenProps,\n} from '../utils/types';\n"],"mappings":";AASA,SAAS,0BAA0B;AAS1B;AADF,SAAS,MAAM,OAAmB;AACvC,SAAO,oBAAC,sBAAmB;AAC7B;AAEO,SAAS,eAAe;AAAC;AAEzB,SAAS,gBAAgB;AAAC;AAE1B,SAAS,cAAc;AAAC;AAExB,SAAS,OAAO;AAAC;AAEjB,SAAS,aAAa,OAA0B;AAAC;AAEjD,SAAS,UAAU;AACxB,SAAO;AACT;AAEO,SAAS,UAAU,GAAoC;AAC5D,SAAO;AAAA,IACL,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS,MAAM,QAAQ,QAAQ;AAAA,EACjC;AACF;AAEO,SAAS,iBAAiB,GAAkD;AACjF,SAAO;AAAA,IACL,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,SAAS,MAAM,QAAQ,QAAQ,EAAE,MAAM,QAAW,OAAO,OAAU,CAAC;AAAA,IACpE,YAAY,MAAM,QAAQ,QAAQ,EAAE,MAAM,QAAW,OAAO,OAAU,CAAC;AAAA,IACvE,gBAAgB,MAAM,QAAQ,QAAQ,EAAE,MAAM,QAAW,OAAO,OAAU,CAAC;AAAA,IAC3E,SAAS,MAAM,QAAQ,QAAQ;AAAA,IAC/B,WAAW,MAAM,QAAQ,QAAQ;AAAA,EACnC;AACF;AAEO,SAAS,eAAe,GAA8C;AAC3E,SAAO;AAAA,IACL,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS,MAAM,QAAQ,QAAQ;AAAA,EACjC;AACF;","names":[]}
@@ -0,0 +1,10 @@
1
+ import { Appearance } from '@novu/js/ui';
2
+ import { ReactAppearance } from './types.js';
3
+ import { MountedElement } from '../context/RendererContext.js';
4
+ import '@novu/js';
5
+ import 'react';
6
+ import 'react/jsx-runtime';
7
+
8
+ declare function adaptAppearanceForJs(appearance: ReactAppearance, mountElement: (el: HTMLElement, mountedElement: MountedElement) => () => void): Appearance | undefined;
9
+
10
+ export { adaptAppearanceForJs };
@@ -0,0 +1,28 @@
1
+ // src/utils/appearance.ts
2
+ function adaptAppearanceForJs(appearance, mountElement) {
3
+ if (!appearance) {
4
+ return void 0;
5
+ }
6
+ const jsAppearance = JSON.parse(JSON.stringify(appearance));
7
+ if (appearance.icons) {
8
+ const jsIcons = {};
9
+ const reactIcons = appearance.icons;
10
+ const iconKeys = Object.keys(reactIcons);
11
+ for (const iconKey of iconKeys) {
12
+ const reactRenderer = reactIcons[iconKey];
13
+ if (reactRenderer) {
14
+ jsIcons[iconKey] = (el, props) => {
15
+ return mountElement(el, reactRenderer(props));
16
+ };
17
+ }
18
+ }
19
+ jsAppearance.icons = jsIcons;
20
+ } else {
21
+ delete jsAppearance.icons;
22
+ }
23
+ return jsAppearance;
24
+ }
25
+ export {
26
+ adaptAppearanceForJs
27
+ };
28
+ //# sourceMappingURL=appearance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/appearance.ts"],"sourcesContent":["import type { Appearance as JsAppearance, IconRenderer, IconOverrides as JsIconOverrides, IconKey } from '@novu/js/ui';\n\nimport type { ReactAppearance, ReactIconRenderer } from './types';\nimport { MountedElement } from '../context/RendererContext';\n\nexport function adaptAppearanceForJs(\n appearance: ReactAppearance,\n mountElement: (el: HTMLElement, mountedElement: MountedElement) => () => void\n): JsAppearance | undefined {\n if (!appearance) {\n return undefined;\n }\n\n const jsAppearance: JsAppearance = JSON.parse(JSON.stringify(appearance));\n\n if (appearance.icons) {\n const jsIcons: JsIconOverrides = {};\n const reactIcons = appearance.icons;\n const iconKeys = Object.keys(reactIcons) as IconKey[];\n\n for (const iconKey of iconKeys) {\n const reactRenderer = reactIcons[iconKey];\n\n if (reactRenderer) {\n jsIcons[iconKey] = (el: HTMLDivElement, props: { class?: string }) => {\n return mountElement(el, reactRenderer(props));\n };\n }\n }\n\n // JsAppearance also has .icons directly (from JsTheme part of JsAppearance)\n jsAppearance.icons = jsIcons;\n } else {\n // If original didn't have icons, ensure the clone doesn't either\n delete jsAppearance.icons;\n }\n\n return jsAppearance;\n}\n"],"mappings":";AAKO,SAAS,qBACd,YACA,cAC0B;AAC1B,MAAI,CAAC,YAAY;AACf,WAAO;AAAA,EACT;AAEA,QAAM,eAA6B,KAAK,MAAM,KAAK,UAAU,UAAU,CAAC;AAExE,MAAI,WAAW,OAAO;AACpB,UAAM,UAA2B,CAAC;AAClC,UAAM,aAAa,WAAW;AAC9B,UAAM,WAAW,OAAO,KAAK,UAAU;AAEvC,eAAW,WAAW,UAAU;AAC9B,YAAM,gBAAgB,WAAW,OAAO;AAExC,UAAI,eAAe;AACjB,gBAAQ,OAAO,IAAI,CAAC,IAAoB,UAA8B;AACpE,iBAAO,aAAa,IAAI,cAAc,KAAK,CAAC;AAAA,QAC9C;AAAA,MACF;AAAA,IACF;AAGA,iBAAa,QAAQ;AAAA,EACvB,OAAO;AAEL,WAAO,aAAa;AAAA,EACtB;AAEA,SAAO;AACT;","names":[]}
@@ -1,10 +1,24 @@
1
- import { Notification, NotificationClickHandler, NotificationActionClickHandler, InboxProps, Appearance, Localization, Tab, PreferencesFilter, RouterPush } from '@novu/js/ui';
1
+ import { Notification, IconKey, Theme, NotificationClickHandler, NotificationActionClickHandler, InboxProps, Localization, Tab, PreferencesFilter, PreferenceGroups, RouterPush } from '@novu/js/ui';
2
2
  import { Subscriber } from '@novu/js';
3
+ import { ReactNode } from 'react';
3
4
 
4
5
  type NotificationsRenderer = (notification: Notification) => React.ReactNode;
5
6
  type SubjectRenderer = (notification: Notification) => React.ReactNode;
6
7
  type BodyRenderer = (notification: Notification) => React.ReactNode;
7
8
  type BellRenderer = (unreadCount: number) => React.ReactNode;
9
+ type ReactIconRendererProps = {
10
+ class?: string;
11
+ };
12
+ type ReactIconRenderer = (props: ReactIconRendererProps) => ReactNode;
13
+ type ReactIconOverrides = {
14
+ [key in IconKey]?: ReactIconRenderer;
15
+ };
16
+ type ReactTheme = Omit<Theme, 'icons'> & {
17
+ icons?: ReactIconOverrides;
18
+ };
19
+ type ReactAppearance = ReactTheme & {
20
+ baseTheme?: Theme | Theme[];
21
+ };
8
22
  type DefaultInboxProps = {
9
23
  open?: boolean;
10
24
  renderNotification?: NotificationsRenderer;
@@ -22,10 +36,11 @@ type BaseProps = {
22
36
  subscriberHash?: string;
23
37
  backendUrl?: string;
24
38
  socketUrl?: string;
25
- appearance?: Appearance;
39
+ appearance?: ReactAppearance;
26
40
  localization?: Localization;
27
41
  tabs?: Array<Tab>;
28
42
  preferencesFilter?: PreferencesFilter;
43
+ preferenceGroups?: PreferenceGroups;
29
44
  routerPush?: RouterPush;
30
45
  } & ({
31
46
  /** @deprecated Use subscriber prop instead */
@@ -57,4 +72,4 @@ type WithChildrenProps = BaseProps & {
57
72
  children: React.ReactNode;
58
73
  };
59
74
 
60
- export type { BaseProps, BellRenderer, BodyRenderer, DefaultInboxProps, DefaultProps, NoRendererProps, NotificationRendererProps, NotificationsRenderer, SubjectBodyRendererProps, SubjectRenderer, WithChildrenProps };
75
+ export type { BaseProps, BellRenderer, BodyRenderer, DefaultInboxProps, DefaultProps, NoRendererProps, NotificationRendererProps, NotificationsRenderer, ReactAppearance, ReactIconOverrides, ReactIconRenderer, ReactIconRendererProps, ReactTheme, SubjectBodyRendererProps, SubjectRenderer, WithChildrenProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novu/react",
3
- "version": "3.3.1",
3
+ "version": "3.5.0-rc.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/novuhq/novu",
@@ -79,6 +79,12 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
+ "scripts": {
83
+ "build:watch": "tsup --watch",
84
+ "build": "tsup && pnpm run check-exports",
85
+ "lint": "eslint src",
86
+ "check-exports": "attw --pack ."
87
+ },
82
88
  "browserslist": {
83
89
  "production": [
84
90
  ">0.2%",
@@ -110,17 +116,11 @@
110
116
  }
111
117
  },
112
118
  "dependencies": {
113
- "@novu/js": "3.3.1"
119
+ "@novu/js": "^3.5.0-rc.1"
114
120
  },
115
121
  "nx": {
116
122
  "tags": [
117
123
  "type:package"
118
124
  ]
119
- },
120
- "scripts": {
121
- "build:watch": "tsup --watch",
122
- "build": "tsup && pnpm run check-exports",
123
- "lint": "eslint src",
124
- "check-exports": "attw --pack ."
125
125
  }
126
- }
126
+ }