@trycourier/courier-react 8.2.4 → 9.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.
@@ -1,3 +1,4 @@
1
+ import { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from '@trycourier/courier-ui-inbox';
1
2
  import { CourierInboxPopupMenuProps } from '@trycourier/courier-react-components';
2
3
  /**
3
4
  * CourierInboxPopupMenu React component.
@@ -1,3 +1,4 @@
1
+ import { CourierInbox as CourierInboxElement } from '@trycourier/courier-ui-inbox';
1
2
  import { CourierInboxProps } from '@trycourier/courier-react-components';
2
3
  /**
3
4
  * CourierInbox React component.
@@ -1,4 +1,3 @@
1
- import { CourierToast as CourierToastElement } from '@trycourier/courier-ui-toast';
2
1
  import { CourierToastProps } from '@trycourier/courier-react-components';
3
2
  /**
4
3
  * CourierToast React component.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@trycourier/courier-js"),r=require("react/jsx-runtime"),t=require("react"),o=require("@trycourier/courier-react-components"),u=require("react-dom"),i=require("react-dom/client"),n=require("@trycourier/courier-ui-inbox"),a=require("@trycourier/courier-ui-toast");function s(e){const r=document.createElement("div"),t=i.createRoot(r);return u.flushSync((()=>{t.render(e)})),r}const c=t.forwardRef(((e,t)=>r.jsx(o.CourierRenderContext.Provider,{value:s,children:r.jsx(o.CourierInboxComponent,{...e,ref:t})})));c.displayName="CourierInbox";const d=t.forwardRef(((e,t)=>r.jsx(o.CourierRenderContext.Provider,{value:s,children:r.jsx(o.CourierInboxPopupMenuComponent,{...e,ref:t})})));d.displayName="CourierInboxPopupMenu";const m=t.forwardRef(((e,t)=>r.jsx(o.CourierRenderContext.Provider,{value:s,children:r.jsx(o.CourierToastComponent,{...e,ref:t})})));m.displayName="CourierToast",e.Courier.shared.courierUserAgentName="courier-react",e.Courier.shared.courierUserAgentVersion="8.2.4",Object.defineProperty(exports,"useCourier",{enumerable:!0,get:()=>o.useCourier}),Object.defineProperty(exports,"archiveMessage",{enumerable:!0,get:()=>n.archiveMessage}),Object.defineProperty(exports,"clickMessage",{enumerable:!0,get:()=>n.clickMessage}),Object.defineProperty(exports,"defaultDarkTheme",{enumerable:!0,get:()=>n.defaultDarkTheme}),Object.defineProperty(exports,"defaultLightTheme",{enumerable:!0,get:()=>n.defaultLightTheme}),Object.defineProperty(exports,"markAsRead",{enumerable:!0,get:()=>n.markAsRead}),Object.defineProperty(exports,"markAsUnread",{enumerable:!0,get:()=>n.markAsUnread}),Object.defineProperty(exports,"mergeTheme",{enumerable:!0,get:()=>n.mergeTheme}),Object.defineProperty(exports,"openMessage",{enumerable:!0,get:()=>n.openMessage}),Object.defineProperty(exports,"defaultToastDarkTheme",{enumerable:!0,get:()=>a.defaultDarkTheme}),Object.defineProperty(exports,"defaultToastLightTheme",{enumerable:!0,get:()=>a.defaultLightTheme}),Object.defineProperty(exports,"mergeToastTheme",{enumerable:!0,get:()=>a.mergeTheme}),exports.CourierInbox=c,exports.CourierInboxPopupMenu=d,exports.CourierToast=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@trycourier/courier-js"),r=require("react/jsx-runtime"),t=require("react"),o=require("@trycourier/courier-react-components"),u=require("react-dom"),i=require("react-dom/client"),n=require("@trycourier/courier-ui-inbox"),a=require("@trycourier/courier-ui-toast");function s(e){const r=document.createElement("div"),t=i.createRoot(r);return u.flushSync((()=>{t.render(e)})),r.style.display="contents",r.setAttribute("data-react-root","true"),r}const c=t.forwardRef(((e,t)=>r.jsx(o.CourierRenderContext.Provider,{value:s,children:r.jsx(o.CourierInboxComponent,{...e,ref:t})})));c.displayName="CourierInbox";const d=t.forwardRef(((e,t)=>r.jsx(o.CourierRenderContext.Provider,{value:s,children:r.jsx(o.CourierInboxPopupMenuComponent,{...e,ref:t})})));d.displayName="CourierInboxPopupMenu";const m=t.forwardRef(((e,t)=>r.jsx(o.CourierRenderContext.Provider,{value:s,children:r.jsx(o.CourierToastComponent,{...e,ref:t})})));m.displayName="CourierToast",e.Courier.shared.courierUserAgentName="courier-react",e.Courier.shared.courierUserAgentVersion="9.0.0",Object.defineProperty(exports,"useCourier",{enumerable:!0,get:()=>o.useCourier}),Object.defineProperty(exports,"archiveMessage",{enumerable:!0,get:()=>n.archiveMessage}),Object.defineProperty(exports,"clickMessage",{enumerable:!0,get:()=>n.clickMessage}),Object.defineProperty(exports,"defaultActions",{enumerable:!0,get:()=>n.defaultActions}),Object.defineProperty(exports,"defaultDarkTheme",{enumerable:!0,get:()=>n.defaultDarkTheme}),Object.defineProperty(exports,"defaultFeeds",{enumerable:!0,get:()=>n.defaultFeeds}),Object.defineProperty(exports,"defaultLightTheme",{enumerable:!0,get:()=>n.defaultLightTheme}),Object.defineProperty(exports,"defaultListItemActions",{enumerable:!0,get:()=>n.defaultListItemActions}),Object.defineProperty(exports,"markAsRead",{enumerable:!0,get:()=>n.markAsRead}),Object.defineProperty(exports,"markAsUnread",{enumerable:!0,get:()=>n.markAsUnread}),Object.defineProperty(exports,"mergeTheme",{enumerable:!0,get:()=>n.mergeTheme}),Object.defineProperty(exports,"openMessage",{enumerable:!0,get:()=>n.openMessage}),Object.defineProperty(exports,"defaultToastDarkTheme",{enumerable:!0,get:()=>a.defaultDarkTheme}),Object.defineProperty(exports,"defaultToastLightTheme",{enumerable:!0,get:()=>a.defaultLightTheme}),Object.defineProperty(exports,"mergeToastTheme",{enumerable:!0,get:()=>a.mergeTheme}),exports.CourierInbox=c,exports.CourierInboxPopupMenu=d,exports.CourierToast=m;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/utils/render.tsx","../src/components/courier-inbox.tsx","../src/components/courier-inbox-popup-menu.tsx","../src/components/courier-toast.tsx","../src/index.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { createRoot } from \"react-dom/client\";\n\n/**\n * Converts a React node to an HTMLElement.\n * This function uses flushSync to ensure the DOM is updated synchronously.\n * @param node - The React node to convert.\n * @returns The converted HTMLElement.\n */\nexport function reactNodeToHTMLElement(node: ReactNode): HTMLElement {\n const container = document.createElement('div');\n\n // Use React 18 root\n const root = createRoot(container);\n flushSync(() => {\n root.render(node);\n });\n\n // Return the container to preserve React's event handling\n // The container maintains the React root and event delegation\n return container;\n}\n","import { forwardRef } from \"react\";\nimport { CourierInbox as CourierInboxElement } from \"@trycourier/courier-ui-inbox\";\nimport { CourierInboxComponent, CourierInboxProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierInbox React component.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierInbox />;\n * ```\n */\nexport const CourierInbox = forwardRef<CourierInboxElement, CourierInboxProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierInboxComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierInbox.displayName = 'CourierInbox';\n","import { forwardRef } from \"react\";\nimport { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from \"@trycourier/courier-ui-inbox\";\nimport { CourierInboxPopupMenuComponent, CourierInboxPopupMenuProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierInboxPopupMenu React component.\n *\n * This component is used to display a popup menu for a message in the inbox.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierInboxPopupMenu />;\n * ```\n */\nexport const CourierInboxPopupMenu = forwardRef<CourierInboxPopupMenuElement, CourierInboxPopupMenuProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierInboxPopupMenuComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierInboxPopupMenu.displayName = 'CourierInboxPopupMenu';\n","import { forwardRef } from \"react\";\nimport { CourierToast as CourierToastElement } from \"@trycourier/courier-ui-toast\";\nimport { CourierToastComponent, CourierToastProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierToast React component.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierToast />;\n * ```\n */\nexport const CourierToast = forwardRef<CourierToastElement, CourierToastProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierToastComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierToast.displayName = 'CourierToast';\n","import { Courier } from '@trycourier/courier-js';\n\nCourier.shared.courierUserAgentName = \"courier-react\";\nCourier.shared.courierUserAgentVersion = __PACKAGE_VERSION__;\n\nexport { CourierInbox } from './components/courier-inbox';\nexport { CourierInboxPopupMenu } from './components/courier-inbox-popup-menu';\nexport { CourierToast } from './components/courier-toast';\n\nexport { useCourier } from '@trycourier/courier-react-components';\n\nexport type {\n CourierInboxProps,\n CourierInboxPopupMenuProps,\n CourierToastProps,\n} from '@trycourier/courier-react-components';\n\n// Re-export types from courier-js\nexport type {\n CourierProps,\n CourierClientOptions,\n CourierBrand,\n CourierApiUrls,\n CourierUserPreferences,\n CourierUserPreferencesStatus,\n CourierUserPreferencesChannel,\n CourierUserPreferencesPaging,\n CourierUserPreferencesTopic,\n CourierUserPreferencesTopicResponse,\n CourierDevice,\n CourierToken,\n CourierGetInboxMessageResponse,\n CourierGetInboxMessagesResponse,\n InboxMessage,\n InboxAction,\n InboxMessageEventEnvelope,\n} from '@trycourier/courier-js';\n\n// Re-export utility functions from courier-ui-inbox\nexport {\n markAsRead,\n markAsUnread,\n clickMessage,\n archiveMessage,\n openMessage\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export factory prop types from courier-ui-inbox\nexport type {\n CourierInboxHeaderFactoryProps,\n CourierInboxStateLoadingFactoryProps,\n CourierInboxStateEmptyFactoryProps,\n CourierInboxStateErrorFactoryProps,\n CourierInboxListItemFactoryProps,\n CourierInboxListItemActionFactoryProps,\n CourierInboxPaginationItemFactoryProps,\n CourierInboxMenuButtonFactoryProps,\n CourierInboxFeedType\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export theme types from courier-ui-inbox\nexport type {\n CourierInboxTheme,\n CourierInboxFontTheme,\n CourierInboxIconTheme,\n CourierInboxFilterItemTheme,\n CourierInboxUnreadCountIndicatorTheme,\n CourierInboxUnreadDotIndicatorTheme,\n CourierInboxIconButtonTheme,\n CourierInboxButtonTheme,\n CourierInboxMenuButtonTheme,\n CourierInboxPopupTheme,\n CourierInboxListItemTheme,\n CourierInboxSkeletonLoadingStateTheme,\n CourierInboxInfoStateTheme,\n CourierMenuItemTheme,\n CourierFilterMenuTheme,\n CourierActionMenuTheme\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export theme utilities from courier-ui-inbox\nexport {\n defaultLightTheme,\n defaultDarkTheme,\n mergeTheme\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export element types from courier-ui-inbox\nexport type { CourierInbox as CourierInboxElement } from '@trycourier/courier-ui-inbox';\nexport type { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from '@trycourier/courier-ui-inbox';\n\n// Re-export element types from courier-ui-toast\nexport type { CourierToast as CourierToastElement } from '@trycourier/courier-ui-toast';\n\n// Re-export toast types from courier-ui-toast\nexport type {\n CourierToastTheme,\n CourierToastFontTheme,\n CourierToastIconTheme,\n CourierToastItemTheme,\n CourierToastItemFactoryProps,\n CourierToastItemClickEvent,\n CourierToastDismissButtonOption\n} from '@trycourier/courier-ui-toast';\n\n// Re-export toast theme utilities from courier-ui-toast\nexport {\n defaultLightTheme as defaultToastLightTheme,\n defaultDarkTheme as defaultToastDarkTheme,\n mergeTheme as mergeToastTheme\n} from '@trycourier/courier-ui-toast';\n\n// Re-export types from courier-ui-core\nexport type {\n CourierComponentThemeMode\n} from '@trycourier/courier-ui-core'\n"],"names":["reactNodeToHTMLElement","node","container","document","createElement","root","createRoot","flushSync","render","CourierInbox","forwardRef","props","ref","jsx","CourierRenderContext","Provider","value","children","CourierInboxComponent","displayName","CourierInboxPopupMenu","CourierInboxPopupMenuComponent","CourierToast","CourierToastComponent","Courier","shared","courierUserAgentName","courierUserAgentVersion"],"mappings":"uWAUO,SAASA,EAAuBC,GACrC,MAAMC,EAAYC,SAASC,cAAc,OAGnCC,EAAOC,EAAAA,WAAWJ,GAOxB,OANAK,EAAAA,WAAU,KACRF,EAAKG,OAAOP,EAAI,IAKXC,CACT,CCIO,MAAMO,EAAeC,EAAAA,YAAmD,CAACC,EAAOC,MAEnFC,IAACC,EAAAA,qBAAqBC,SAArB,CAA8BC,MAAOhB,EACpCiB,WAAAJ,IAACK,EAAAA,sBAAA,IAA0BP,EAAOC,YAKxCH,EAAaU,YAAc,eCNpB,MAAMC,EAAwBV,EAAAA,YAAqE,CAACC,EAAOC,MAE9GC,IAACC,EAAAA,qBAAqBC,SAArB,CAA8BC,MAAOhB,EACpCiB,WAAAJ,IAACQ,EAAAA,+BAAA,IAAmCV,EAAOC,YAKjDQ,EAAsBD,YAAc,wBCV7B,MAAMG,EAAeZ,EAAAA,YAAmD,CAACC,EAAOC,MAEnFC,IAACC,EAAAA,qBAAqBC,SAArB,CAA8BC,MAAOhB,EACpCiB,WAAAJ,IAACU,EAAAA,sBAAA,IAA0BZ,EAAOC,YAKxCU,EAAaH,YAAc,eChC3BK,EAAAA,QAAQC,OAAOC,qBAAuB,gBACtCF,EAAAA,QAAQC,OAAOE,wBAA0B"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/utils/render.tsx","../src/components/courier-inbox.tsx","../src/components/courier-inbox-popup-menu.tsx","../src/components/courier-toast.tsx","../src/index.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { createRoot } from \"react-dom/client\";\n\nexport function reactNodeToHTMLElement(node: ReactNode): HTMLElement {\n const container = document.createElement('div');\n\n // Use React 18 root\n const root = createRoot(container);\n flushSync(() => {\n root.render(node);\n });\n\n /**\n * Always return the container to preserve React's event delegation system.\n * React uses event delegation at the root level, so the React root container\n * must stay in the DOM for event handlers to work.\n * \n * We use `display: contents` to make the container transparent to CSS layout,\n * so it doesn't introduce a visual wrapper while still preserving React's\n * event system.\n */\n container.style.display = 'contents';\n container.setAttribute('data-react-root', 'true');\n return container;\n}\n","import { forwardRef } from \"react\";\nimport { CourierInbox as CourierInboxElement } from \"@trycourier/courier-ui-inbox\";\nimport { CourierInboxComponent, CourierInboxProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierInbox React component.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierInbox />;\n * ```\n */\nexport const CourierInbox = forwardRef<CourierInboxElement, CourierInboxProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierInboxComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierInbox.displayName = 'CourierInbox';\n","import { forwardRef } from \"react\";\nimport { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from \"@trycourier/courier-ui-inbox\";\nimport { CourierInboxPopupMenuComponent, CourierInboxPopupMenuProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierInboxPopupMenu React component.\n *\n * This component is used to display a popup menu for a message in the inbox.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierInboxPopupMenu />;\n * ```\n */\nexport const CourierInboxPopupMenu = forwardRef<CourierInboxPopupMenuElement, CourierInboxPopupMenuProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierInboxPopupMenuComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierInboxPopupMenu.displayName = 'CourierInboxPopupMenu';\n","import { forwardRef } from \"react\";\nimport { CourierToast as CourierToastElement } from \"@trycourier/courier-ui-toast\";\nimport { CourierToastComponent, CourierToastProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierToast React component.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierToast />;\n * ```\n */\nexport const CourierToast = forwardRef<CourierToastElement, CourierToastProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierToastComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierToast.displayName = 'CourierToast';\n","import { Courier } from '@trycourier/courier-js';\n\nCourier.shared.courierUserAgentName = \"courier-react\";\nCourier.shared.courierUserAgentVersion = __PACKAGE_VERSION__;\n\nexport { CourierInbox } from './components/courier-inbox';\nexport { CourierInboxPopupMenu } from './components/courier-inbox-popup-menu';\nexport { CourierToast } from './components/courier-toast';\n\nexport { useCourier } from '@trycourier/courier-react-components';\n\nexport type {\n CourierInboxProps,\n CourierInboxPopupMenuProps,\n CourierToastProps,\n} from '@trycourier/courier-react-components';\n\n// Re-export types from courier-js\nexport type {\n CourierProps,\n CourierClientOptions,\n CourierBrand,\n CourierApiUrls,\n CourierUserPreferences,\n CourierUserPreferencesStatus,\n CourierUserPreferencesChannel,\n CourierUserPreferencesPaging,\n CourierUserPreferencesTopic,\n CourierUserPreferencesTopicResponse,\n CourierDevice,\n CourierToken,\n CourierGetInboxMessageResponse,\n CourierGetInboxMessagesResponse,\n InboxMessage,\n InboxAction,\n InboxMessageEventEnvelope,\n} from '@trycourier/courier-js';\n\n// Re-export utility functions from courier-ui-inbox\nexport {\n markAsRead,\n markAsUnread,\n clickMessage,\n archiveMessage,\n openMessage\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export default configuration functions from courier-ui-inbox\nexport {\n defaultFeeds,\n defaultActions,\n defaultListItemActions\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export factory prop types from courier-ui-inbox\nexport type {\n CourierInboxHeaderFactoryProps,\n CourierInboxStateLoadingFactoryProps,\n CourierInboxStateEmptyFactoryProps,\n CourierInboxStateErrorFactoryProps,\n CourierInboxListItemFactoryProps,\n CourierInboxListItemActionFactoryProps,\n CourierInboxPaginationItemFactoryProps,\n CourierInboxMenuButtonFactoryProps,\n CourierInboxFeed,\n CourierInboxTab,\n CourierInboxDatasetFilter\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export theme types from courier-ui-inbox\nexport type {\n CourierInboxTheme,\n CourierInboxFontTheme,\n CourierInboxIconTheme,\n CourierInboxUnreadCountIndicatorTheme,\n CourierInboxUnreadDotIndicatorTheme,\n CourierInboxIconButtonTheme,\n CourierInboxButtonTheme,\n CourierInboxMenuButtonTheme,\n CourierInboxPopupTheme,\n CourierInboxListItemTheme,\n CourierInboxSkeletonLoadingStateTheme,\n CourierInboxInfoStateTheme,\n CourierMenuItemTheme,\n CourierActionMenuTheme\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export theme utilities from courier-ui-inbox\nexport {\n defaultLightTheme,\n defaultDarkTheme,\n mergeTheme\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export element types from courier-ui-inbox\nexport type { CourierInbox as CourierInboxElement } from '@trycourier/courier-ui-inbox';\nexport type { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from '@trycourier/courier-ui-inbox';\n\n// Re-export element types from courier-ui-toast\nexport type { CourierToast as CourierToastElement } from '@trycourier/courier-ui-toast';\n\n// Re-export toast types from courier-ui-toast\nexport type {\n CourierToastTheme,\n CourierToastFontTheme,\n CourierToastIconTheme,\n CourierToastItemTheme,\n CourierToastItemFactoryProps,\n CourierToastItemClickEvent,\n CourierToastDismissButtonOption\n} from '@trycourier/courier-ui-toast';\n\n// Re-export toast theme utilities from courier-ui-toast\nexport {\n defaultLightTheme as defaultToastLightTheme,\n defaultDarkTheme as defaultToastDarkTheme,\n mergeTheme as mergeToastTheme\n} from '@trycourier/courier-ui-toast';\n\n// Re-export types from courier-ui-core\nexport type {\n CourierComponentThemeMode\n} from '@trycourier/courier-ui-core'\n"],"names":["reactNodeToHTMLElement","node","container","document","createElement","root","createRoot","flushSync","render","style","display","setAttribute","CourierInbox","forwardRef","props","ref","jsx","CourierRenderContext","Provider","value","children","CourierInboxComponent","displayName","CourierInboxPopupMenu","CourierInboxPopupMenuComponent","CourierToast","CourierToastComponent","Courier","shared","courierUserAgentName","courierUserAgentVersion"],"mappings":"uWAIO,SAASA,EAAuBC,GACrC,MAAMC,EAAYC,SAASC,cAAc,OAGnCC,EAAOC,EAAAA,WAAWJ,GAgBxB,OAfAK,EAAAA,WAAU,KACRF,EAAKG,OAAOP,EAAI,IAYlBC,EAAUO,MAAMC,QAAU,WAC1BR,EAAUS,aAAa,kBAAmB,QACnCT,CACT,CCCO,MAAMU,EAAeC,EAAAA,YAAmD,CAACC,EAAOC,MAEnFC,IAACC,EAAAA,qBAAqBC,SAArB,CAA8BC,MAAOnB,EACpCoB,WAAAJ,IAACK,EAAAA,sBAAA,IAA0BP,EAAOC,YAKxCH,EAAaU,YAAc,eCNpB,MAAMC,EAAwBV,EAAAA,YAAqE,CAACC,EAAOC,MAE9GC,IAACC,EAAAA,qBAAqBC,SAArB,CAA8BC,MAAOnB,EACpCoB,WAAAJ,IAACQ,EAAAA,+BAAA,IAAmCV,EAAOC,YAKjDQ,EAAsBD,YAAc,wBCV7B,MAAMG,EAAeZ,EAAAA,YAAmD,CAACC,EAAOC,MAEnFC,IAACC,EAAAA,qBAAqBC,SAArB,CAA8BC,MAAOnB,EACpCoB,WAAAJ,IAACU,EAAAA,sBAAA,IAA0BZ,EAAOC,YAKxCU,EAAaH,YAAc,eChC3BK,EAAAA,QAAQC,OAAOC,qBAAuB,gBACtCF,EAAAA,QAAQC,OAAOE,wBAA0B"}
package/dist/index.d.ts CHANGED
@@ -5,8 +5,9 @@ export { useCourier } from '@trycourier/courier-react-components';
5
5
  export type { CourierInboxProps, CourierInboxPopupMenuProps, CourierToastProps, } from '@trycourier/courier-react-components';
6
6
  export type { CourierProps, CourierClientOptions, CourierBrand, CourierApiUrls, CourierUserPreferences, CourierUserPreferencesStatus, CourierUserPreferencesChannel, CourierUserPreferencesPaging, CourierUserPreferencesTopic, CourierUserPreferencesTopicResponse, CourierDevice, CourierToken, CourierGetInboxMessageResponse, CourierGetInboxMessagesResponse, InboxMessage, InboxAction, InboxMessageEventEnvelope, } from '@trycourier/courier-js';
7
7
  export { markAsRead, markAsUnread, clickMessage, archiveMessage, openMessage } from '@trycourier/courier-ui-inbox';
8
- export type { CourierInboxHeaderFactoryProps, CourierInboxStateLoadingFactoryProps, CourierInboxStateEmptyFactoryProps, CourierInboxStateErrorFactoryProps, CourierInboxListItemFactoryProps, CourierInboxListItemActionFactoryProps, CourierInboxPaginationItemFactoryProps, CourierInboxMenuButtonFactoryProps, CourierInboxFeedType } from '@trycourier/courier-ui-inbox';
9
- export type { CourierInboxTheme, CourierInboxFontTheme, CourierInboxIconTheme, CourierInboxFilterItemTheme, CourierInboxUnreadCountIndicatorTheme, CourierInboxUnreadDotIndicatorTheme, CourierInboxIconButtonTheme, CourierInboxButtonTheme, CourierInboxMenuButtonTheme, CourierInboxPopupTheme, CourierInboxListItemTheme, CourierInboxSkeletonLoadingStateTheme, CourierInboxInfoStateTheme, CourierMenuItemTheme, CourierFilterMenuTheme, CourierActionMenuTheme } from '@trycourier/courier-ui-inbox';
8
+ export { defaultFeeds, defaultActions, defaultListItemActions } from '@trycourier/courier-ui-inbox';
9
+ export type { CourierInboxHeaderFactoryProps, CourierInboxStateLoadingFactoryProps, CourierInboxStateEmptyFactoryProps, CourierInboxStateErrorFactoryProps, CourierInboxListItemFactoryProps, CourierInboxListItemActionFactoryProps, CourierInboxPaginationItemFactoryProps, CourierInboxMenuButtonFactoryProps, CourierInboxFeed, CourierInboxTab, CourierInboxDatasetFilter } from '@trycourier/courier-ui-inbox';
10
+ export type { CourierInboxTheme, CourierInboxFontTheme, CourierInboxIconTheme, CourierInboxUnreadCountIndicatorTheme, CourierInboxUnreadDotIndicatorTheme, CourierInboxIconButtonTheme, CourierInboxButtonTheme, CourierInboxMenuButtonTheme, CourierInboxPopupTheme, CourierInboxListItemTheme, CourierInboxSkeletonLoadingStateTheme, CourierInboxInfoStateTheme, CourierMenuItemTheme, CourierActionMenuTheme } from '@trycourier/courier-ui-inbox';
10
11
  export { defaultLightTheme, defaultDarkTheme, mergeTheme } from '@trycourier/courier-ui-inbox';
11
12
  export type { CourierInbox as CourierInboxElement } from '@trycourier/courier-ui-inbox';
12
13
  export type { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from '@trycourier/courier-ui-inbox';
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import { CourierRenderContext, CourierInboxComponent, CourierInboxPopupMenuCompo
5
5
  import { useCourier } from "@trycourier/courier-react-components";
6
6
  import { flushSync } from "react-dom";
7
7
  import { createRoot } from "react-dom/client";
8
- import { archiveMessage, clickMessage, defaultDarkTheme, defaultLightTheme, markAsRead, markAsUnread, mergeTheme, openMessage } from "@trycourier/courier-ui-inbox";
8
+ import { archiveMessage, clickMessage, defaultActions, defaultDarkTheme, defaultFeeds, defaultLightTheme, defaultListItemActions, markAsRead, markAsUnread, mergeTheme, openMessage } from "@trycourier/courier-ui-inbox";
9
9
  import { defaultDarkTheme as defaultDarkTheme2, defaultLightTheme as defaultLightTheme2, mergeTheme as mergeTheme2 } from "@trycourier/courier-ui-toast";
10
10
  function reactNodeToHTMLElement(node) {
11
11
  const container = document.createElement("div");
@@ -13,6 +13,8 @@ function reactNodeToHTMLElement(node) {
13
13
  flushSync(() => {
14
14
  root.render(node);
15
15
  });
16
+ container.style.display = "contents";
17
+ container.setAttribute("data-react-root", "true");
16
18
  return container;
17
19
  }
18
20
  const CourierInbox = forwardRef((props, ref) => {
@@ -28,15 +30,18 @@ const CourierToast = forwardRef((props, ref) => {
28
30
  });
29
31
  CourierToast.displayName = "CourierToast";
30
32
  Courier.shared.courierUserAgentName = "courier-react";
31
- Courier.shared.courierUserAgentVersion = "8.2.4";
33
+ Courier.shared.courierUserAgentVersion = "9.0.0";
32
34
  export {
33
35
  CourierInbox,
34
36
  CourierInboxPopupMenu,
35
37
  CourierToast,
36
38
  archiveMessage,
37
39
  clickMessage,
40
+ defaultActions,
38
41
  defaultDarkTheme,
42
+ defaultFeeds,
39
43
  defaultLightTheme,
44
+ defaultListItemActions,
40
45
  defaultDarkTheme2 as defaultToastDarkTheme,
41
46
  defaultLightTheme2 as defaultToastLightTheme,
42
47
  markAsRead,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/utils/render.tsx","../src/components/courier-inbox.tsx","../src/components/courier-inbox-popup-menu.tsx","../src/components/courier-toast.tsx","../src/index.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { createRoot } from \"react-dom/client\";\n\n/**\n * Converts a React node to an HTMLElement.\n * This function uses flushSync to ensure the DOM is updated synchronously.\n * @param node - The React node to convert.\n * @returns The converted HTMLElement.\n */\nexport function reactNodeToHTMLElement(node: ReactNode): HTMLElement {\n const container = document.createElement('div');\n\n // Use React 18 root\n const root = createRoot(container);\n flushSync(() => {\n root.render(node);\n });\n\n // Return the container to preserve React's event handling\n // The container maintains the React root and event delegation\n return container;\n}\n","import { forwardRef } from \"react\";\nimport { CourierInbox as CourierInboxElement } from \"@trycourier/courier-ui-inbox\";\nimport { CourierInboxComponent, CourierInboxProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierInbox React component.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierInbox />;\n * ```\n */\nexport const CourierInbox = forwardRef<CourierInboxElement, CourierInboxProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierInboxComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierInbox.displayName = 'CourierInbox';\n","import { forwardRef } from \"react\";\nimport { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from \"@trycourier/courier-ui-inbox\";\nimport { CourierInboxPopupMenuComponent, CourierInboxPopupMenuProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierInboxPopupMenu React component.\n *\n * This component is used to display a popup menu for a message in the inbox.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierInboxPopupMenu />;\n * ```\n */\nexport const CourierInboxPopupMenu = forwardRef<CourierInboxPopupMenuElement, CourierInboxPopupMenuProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierInboxPopupMenuComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierInboxPopupMenu.displayName = 'CourierInboxPopupMenu';\n","import { forwardRef } from \"react\";\nimport { CourierToast as CourierToastElement } from \"@trycourier/courier-ui-toast\";\nimport { CourierToastComponent, CourierToastProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierToast React component.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierToast />;\n * ```\n */\nexport const CourierToast = forwardRef<CourierToastElement, CourierToastProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierToastComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierToast.displayName = 'CourierToast';\n","import { Courier } from '@trycourier/courier-js';\n\nCourier.shared.courierUserAgentName = \"courier-react\";\nCourier.shared.courierUserAgentVersion = __PACKAGE_VERSION__;\n\nexport { CourierInbox } from './components/courier-inbox';\nexport { CourierInboxPopupMenu } from './components/courier-inbox-popup-menu';\nexport { CourierToast } from './components/courier-toast';\n\nexport { useCourier } from '@trycourier/courier-react-components';\n\nexport type {\n CourierInboxProps,\n CourierInboxPopupMenuProps,\n CourierToastProps,\n} from '@trycourier/courier-react-components';\n\n// Re-export types from courier-js\nexport type {\n CourierProps,\n CourierClientOptions,\n CourierBrand,\n CourierApiUrls,\n CourierUserPreferences,\n CourierUserPreferencesStatus,\n CourierUserPreferencesChannel,\n CourierUserPreferencesPaging,\n CourierUserPreferencesTopic,\n CourierUserPreferencesTopicResponse,\n CourierDevice,\n CourierToken,\n CourierGetInboxMessageResponse,\n CourierGetInboxMessagesResponse,\n InboxMessage,\n InboxAction,\n InboxMessageEventEnvelope,\n} from '@trycourier/courier-js';\n\n// Re-export utility functions from courier-ui-inbox\nexport {\n markAsRead,\n markAsUnread,\n clickMessage,\n archiveMessage,\n openMessage\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export factory prop types from courier-ui-inbox\nexport type {\n CourierInboxHeaderFactoryProps,\n CourierInboxStateLoadingFactoryProps,\n CourierInboxStateEmptyFactoryProps,\n CourierInboxStateErrorFactoryProps,\n CourierInboxListItemFactoryProps,\n CourierInboxListItemActionFactoryProps,\n CourierInboxPaginationItemFactoryProps,\n CourierInboxMenuButtonFactoryProps,\n CourierInboxFeedType\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export theme types from courier-ui-inbox\nexport type {\n CourierInboxTheme,\n CourierInboxFontTheme,\n CourierInboxIconTheme,\n CourierInboxFilterItemTheme,\n CourierInboxUnreadCountIndicatorTheme,\n CourierInboxUnreadDotIndicatorTheme,\n CourierInboxIconButtonTheme,\n CourierInboxButtonTheme,\n CourierInboxMenuButtonTheme,\n CourierInboxPopupTheme,\n CourierInboxListItemTheme,\n CourierInboxSkeletonLoadingStateTheme,\n CourierInboxInfoStateTheme,\n CourierMenuItemTheme,\n CourierFilterMenuTheme,\n CourierActionMenuTheme\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export theme utilities from courier-ui-inbox\nexport {\n defaultLightTheme,\n defaultDarkTheme,\n mergeTheme\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export element types from courier-ui-inbox\nexport type { CourierInbox as CourierInboxElement } from '@trycourier/courier-ui-inbox';\nexport type { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from '@trycourier/courier-ui-inbox';\n\n// Re-export element types from courier-ui-toast\nexport type { CourierToast as CourierToastElement } from '@trycourier/courier-ui-toast';\n\n// Re-export toast types from courier-ui-toast\nexport type {\n CourierToastTheme,\n CourierToastFontTheme,\n CourierToastIconTheme,\n CourierToastItemTheme,\n CourierToastItemFactoryProps,\n CourierToastItemClickEvent,\n CourierToastDismissButtonOption\n} from '@trycourier/courier-ui-toast';\n\n// Re-export toast theme utilities from courier-ui-toast\nexport {\n defaultLightTheme as defaultToastLightTheme,\n defaultDarkTheme as defaultToastDarkTheme,\n mergeTheme as mergeToastTheme\n} from '@trycourier/courier-ui-toast';\n\n// Re-export types from courier-ui-core\nexport type {\n CourierComponentThemeMode\n} from '@trycourier/courier-ui-core'\n"],"names":[],"mappings":";;;;;;;;;AAUO,SAAS,uBAAuB,MAA8B;AACnE,QAAM,YAAY,SAAS,cAAc,KAAK;AAG9C,QAAM,OAAO,WAAW,SAAS;AACjC,YAAU,MAAM;AACd,SAAK,OAAO,IAAI;AAAA,EAClB,CAAC;AAID,SAAO;AACT;ACIO,MAAM,eAAe,WAAmD,CAAC,OAAO,QAAQ;AAC7F,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,wBACpC,UAAA,oBAAC,uBAAA,EAAuB,GAAG,OAAO,IAAA,CAAU,EAAA,CAC9C;AAEJ,CAAC;AAED,aAAa,cAAc;ACNpB,MAAM,wBAAwB,WAAqE,CAAC,OAAO,QAAQ;AACxH,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,wBACpC,UAAA,oBAAC,gCAAA,EAAgC,GAAG,OAAO,IAAA,CAAU,EAAA,CACvD;AAEJ,CAAC;AAED,sBAAsB,cAAc;ACV7B,MAAM,eAAe,WAAmD,CAAC,OAAO,QAAQ;AAC7F,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,wBACpC,UAAA,oBAAC,uBAAA,EAAuB,GAAG,OAAO,IAAA,CAAU,EAAA,CAC9C;AAEJ,CAAC;AAED,aAAa,cAAc;AChC3B,QAAQ,OAAO,uBAAuB;AACtC,QAAQ,OAAO,0BAA0B;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/utils/render.tsx","../src/components/courier-inbox.tsx","../src/components/courier-inbox-popup-menu.tsx","../src/components/courier-toast.tsx","../src/index.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { createRoot } from \"react-dom/client\";\n\nexport function reactNodeToHTMLElement(node: ReactNode): HTMLElement {\n const container = document.createElement('div');\n\n // Use React 18 root\n const root = createRoot(container);\n flushSync(() => {\n root.render(node);\n });\n\n /**\n * Always return the container to preserve React's event delegation system.\n * React uses event delegation at the root level, so the React root container\n * must stay in the DOM for event handlers to work.\n * \n * We use `display: contents` to make the container transparent to CSS layout,\n * so it doesn't introduce a visual wrapper while still preserving React's\n * event system.\n */\n container.style.display = 'contents';\n container.setAttribute('data-react-root', 'true');\n return container;\n}\n","import { forwardRef } from \"react\";\nimport { CourierInbox as CourierInboxElement } from \"@trycourier/courier-ui-inbox\";\nimport { CourierInboxComponent, CourierInboxProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierInbox React component.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierInbox />;\n * ```\n */\nexport const CourierInbox = forwardRef<CourierInboxElement, CourierInboxProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierInboxComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierInbox.displayName = 'CourierInbox';\n","import { forwardRef } from \"react\";\nimport { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from \"@trycourier/courier-ui-inbox\";\nimport { CourierInboxPopupMenuComponent, CourierInboxPopupMenuProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierInboxPopupMenu React component.\n *\n * This component is used to display a popup menu for a message in the inbox.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierInboxPopupMenu />;\n * ```\n */\nexport const CourierInboxPopupMenu = forwardRef<CourierInboxPopupMenuElement, CourierInboxPopupMenuProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierInboxPopupMenuComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierInboxPopupMenu.displayName = 'CourierInboxPopupMenu';\n","import { forwardRef } from \"react\";\nimport { CourierToast as CourierToastElement } from \"@trycourier/courier-ui-toast\";\nimport { CourierToastComponent, CourierToastProps, CourierRenderContext } from \"@trycourier/courier-react-components\";\nimport { reactNodeToHTMLElement } from \"../utils/render\";\n\n/**\n * CourierToast React component.\n *\n * @example\n * ```tsx\n * const courier = useCourier();\n *\n * useEffect(() => {\n * // Generate a JWT for your user (do this on your backend server)\n * const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // Replace with actual JWT\n *\n * // Authenticate the user with the inbox\n * courier.shared.signIn({\n * userId: $YOUR_USER_ID,\n * jwt: jwt,\n * });\n * }, []);\n *\n * return <CourierToast />;\n * ```\n */\nexport const CourierToast = forwardRef<CourierToastElement, CourierToastProps>((props, ref) => {\n return (\n <CourierRenderContext.Provider value={reactNodeToHTMLElement}>\n <CourierToastComponent {...props} ref={ref} />\n </CourierRenderContext.Provider>\n );\n});\n\nCourierToast.displayName = 'CourierToast';\n","import { Courier } from '@trycourier/courier-js';\n\nCourier.shared.courierUserAgentName = \"courier-react\";\nCourier.shared.courierUserAgentVersion = __PACKAGE_VERSION__;\n\nexport { CourierInbox } from './components/courier-inbox';\nexport { CourierInboxPopupMenu } from './components/courier-inbox-popup-menu';\nexport { CourierToast } from './components/courier-toast';\n\nexport { useCourier } from '@trycourier/courier-react-components';\n\nexport type {\n CourierInboxProps,\n CourierInboxPopupMenuProps,\n CourierToastProps,\n} from '@trycourier/courier-react-components';\n\n// Re-export types from courier-js\nexport type {\n CourierProps,\n CourierClientOptions,\n CourierBrand,\n CourierApiUrls,\n CourierUserPreferences,\n CourierUserPreferencesStatus,\n CourierUserPreferencesChannel,\n CourierUserPreferencesPaging,\n CourierUserPreferencesTopic,\n CourierUserPreferencesTopicResponse,\n CourierDevice,\n CourierToken,\n CourierGetInboxMessageResponse,\n CourierGetInboxMessagesResponse,\n InboxMessage,\n InboxAction,\n InboxMessageEventEnvelope,\n} from '@trycourier/courier-js';\n\n// Re-export utility functions from courier-ui-inbox\nexport {\n markAsRead,\n markAsUnread,\n clickMessage,\n archiveMessage,\n openMessage\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export default configuration functions from courier-ui-inbox\nexport {\n defaultFeeds,\n defaultActions,\n defaultListItemActions\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export factory prop types from courier-ui-inbox\nexport type {\n CourierInboxHeaderFactoryProps,\n CourierInboxStateLoadingFactoryProps,\n CourierInboxStateEmptyFactoryProps,\n CourierInboxStateErrorFactoryProps,\n CourierInboxListItemFactoryProps,\n CourierInboxListItemActionFactoryProps,\n CourierInboxPaginationItemFactoryProps,\n CourierInboxMenuButtonFactoryProps,\n CourierInboxFeed,\n CourierInboxTab,\n CourierInboxDatasetFilter\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export theme types from courier-ui-inbox\nexport type {\n CourierInboxTheme,\n CourierInboxFontTheme,\n CourierInboxIconTheme,\n CourierInboxUnreadCountIndicatorTheme,\n CourierInboxUnreadDotIndicatorTheme,\n CourierInboxIconButtonTheme,\n CourierInboxButtonTheme,\n CourierInboxMenuButtonTheme,\n CourierInboxPopupTheme,\n CourierInboxListItemTheme,\n CourierInboxSkeletonLoadingStateTheme,\n CourierInboxInfoStateTheme,\n CourierMenuItemTheme,\n CourierActionMenuTheme\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export theme utilities from courier-ui-inbox\nexport {\n defaultLightTheme,\n defaultDarkTheme,\n mergeTheme\n} from '@trycourier/courier-ui-inbox';\n\n// Re-export element types from courier-ui-inbox\nexport type { CourierInbox as CourierInboxElement } from '@trycourier/courier-ui-inbox';\nexport type { CourierInboxPopupMenu as CourierInboxPopupMenuElement } from '@trycourier/courier-ui-inbox';\n\n// Re-export element types from courier-ui-toast\nexport type { CourierToast as CourierToastElement } from '@trycourier/courier-ui-toast';\n\n// Re-export toast types from courier-ui-toast\nexport type {\n CourierToastTheme,\n CourierToastFontTheme,\n CourierToastIconTheme,\n CourierToastItemTheme,\n CourierToastItemFactoryProps,\n CourierToastItemClickEvent,\n CourierToastDismissButtonOption\n} from '@trycourier/courier-ui-toast';\n\n// Re-export toast theme utilities from courier-ui-toast\nexport {\n defaultLightTheme as defaultToastLightTheme,\n defaultDarkTheme as defaultToastDarkTheme,\n mergeTheme as mergeToastTheme\n} from '@trycourier/courier-ui-toast';\n\n// Re-export types from courier-ui-core\nexport type {\n CourierComponentThemeMode\n} from '@trycourier/courier-ui-core'\n"],"names":[],"mappings":";;;;;;;;;AAIO,SAAS,uBAAuB,MAA8B;AACnE,QAAM,YAAY,SAAS,cAAc,KAAK;AAG9C,QAAM,OAAO,WAAW,SAAS;AACjC,YAAU,MAAM;AACd,SAAK,OAAO,IAAI;AAAA,EAClB,CAAC;AAWD,YAAU,MAAM,UAAU;AAC1B,YAAU,aAAa,mBAAmB,MAAM;AAChD,SAAO;AACT;ACCO,MAAM,eAAe,WAAmD,CAAC,OAAO,QAAQ;AAC7F,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,wBACpC,UAAA,oBAAC,uBAAA,EAAuB,GAAG,OAAO,IAAA,CAAU,EAAA,CAC9C;AAEJ,CAAC;AAED,aAAa,cAAc;ACNpB,MAAM,wBAAwB,WAAqE,CAAC,OAAO,QAAQ;AACxH,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,wBACpC,UAAA,oBAAC,gCAAA,EAAgC,GAAG,OAAO,IAAA,CAAU,EAAA,CACvD;AAEJ,CAAC;AAED,sBAAsB,cAAc;ACV7B,MAAM,eAAe,WAAmD,CAAC,OAAO,QAAQ;AAC7F,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,wBACpC,UAAA,oBAAC,uBAAA,EAAuB,GAAG,OAAO,IAAA,CAAU,EAAA,CAC9C;AAEJ,CAAC;AAED,aAAa,cAAc;AChC3B,QAAQ,OAAO,uBAAuB;AACtC,QAAQ,OAAO,0BAA0B;"}
@@ -1,8 +1,2 @@
1
1
  import { ReactNode } from 'react';
2
- /**
3
- * Converts a React node to an HTMLElement.
4
- * This function uses flushSync to ensure the DOM is updated synchronously.
5
- * @param node - The React node to convert.
6
- * @returns The converted HTMLElement.
7
- */
8
2
  export declare function reactNodeToHTMLElement(node: ReactNode): HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/courier-react",
3
- "version": "8.2.4",
3
+ "version": "9.0.0",
4
4
  "description": "The React components for the Courier web UI",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -32,11 +32,11 @@
32
32
  "url": "https://github.com/trycourier/courier-web"
33
33
  },
34
34
  "dependencies": {
35
- "@trycourier/courier-js": "2.1.3",
36
- "@trycourier/courier-react-components": "1.2.4",
37
- "@trycourier/courier-ui-core": "1.0.14",
38
- "@trycourier/courier-ui-inbox": "1.2.3",
39
- "@trycourier/courier-ui-toast": "1.0.4"
35
+ "@trycourier/courier-js": "3.0.0",
36
+ "@trycourier/courier-react-components": "2.0.0",
37
+ "@trycourier/courier-ui-core": "2.0.0",
38
+ "@trycourier/courier-ui-inbox": "2.0.0",
39
+ "@trycourier/courier-ui-toast": "2.0.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=18.0.0",