@novu/react 3.19.2-rc.dc9caee828 → 3.20.0-rc.569d407fd0

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 (250) hide show
  1. package/dist/cjs/components/Bell.cjs +6 -21
  2. package/dist/cjs/components/Bell.cjs.map +1 -1
  3. package/dist/cjs/components/Bell.d.cts +2 -3
  4. package/dist/cjs/components/Inbox.cjs +100 -138
  5. package/dist/cjs/components/Inbox.cjs.map +1 -1
  6. package/dist/cjs/components/InboxContent.cjs +9 -65
  7. package/dist/cjs/components/InboxContent.cjs.map +1 -1
  8. package/dist/cjs/components/InboxContent.d.cts +2 -3
  9. package/dist/cjs/components/Mounter.cjs +20 -13
  10. package/dist/cjs/components/Mounter.cjs.map +1 -1
  11. package/dist/cjs/components/Mounter.d.cts +12 -4
  12. package/dist/cjs/components/Notifications.cjs +9 -59
  13. package/dist/cjs/components/Notifications.cjs.map +1 -1
  14. package/dist/cjs/components/Notifications.d.cts +2 -3
  15. package/dist/cjs/components/NovuUI.cjs +17 -6
  16. package/dist/cjs/components/NovuUI.cjs.map +1 -1
  17. package/dist/cjs/components/NovuUI.d.cts +4 -0
  18. package/dist/cjs/{context/RendererContext.cjs → components/OutletHost.cjs} +15 -15
  19. package/dist/cjs/components/OutletHost.cjs.map +1 -0
  20. package/dist/cjs/components/OutletHost.d.cts +14 -0
  21. package/dist/cjs/components/Preferences.cjs +1 -20
  22. package/dist/cjs/components/Preferences.cjs.map +1 -1
  23. package/dist/cjs/components/connect-chat/ConnectChat.cjs +2 -3
  24. package/dist/cjs/components/connect-chat/ConnectChat.cjs.map +1 -1
  25. package/dist/cjs/components/connect-chat/DefaultConnectChat.cjs +14 -23
  26. package/dist/cjs/components/connect-chat/DefaultConnectChat.cjs.map +1 -1
  27. package/dist/cjs/components/index.cjs +2 -0
  28. package/dist/cjs/components/index.cjs.map +1 -1
  29. package/dist/cjs/components/index.d.cts +6 -0
  30. package/dist/cjs/components/msteams-connect-button/DefaultMsTeamsConnectButton.cjs +17 -26
  31. package/dist/cjs/components/msteams-connect-button/DefaultMsTeamsConnectButton.cjs.map +1 -1
  32. package/dist/cjs/components/msteams-connect-button/MsTeamsConnectButton.cjs +2 -3
  33. package/dist/cjs/components/msteams-connect-button/MsTeamsConnectButton.cjs.map +1 -1
  34. package/dist/cjs/components/msteams-link-user/DefaultMsTeamsLinkUser.cjs +13 -22
  35. package/dist/cjs/components/msteams-link-user/DefaultMsTeamsLinkUser.cjs.map +1 -1
  36. package/dist/cjs/components/msteams-link-user/MsTeamsLinkUser.cjs +2 -3
  37. package/dist/cjs/components/msteams-link-user/MsTeamsLinkUser.cjs.map +1 -1
  38. package/dist/cjs/components/notification-item/ClockIcon.cjs +43 -0
  39. package/dist/cjs/components/notification-item/ClockIcon.cjs.map +1 -0
  40. package/dist/cjs/components/notification-item/ClockIcon.d.cts +7 -0
  41. package/dist/cjs/components/notification-item/Markdown.cjs +53 -0
  42. package/dist/cjs/components/notification-item/Markdown.cjs.map +1 -0
  43. package/dist/cjs/components/notification-item/Markdown.d.cts +12 -0
  44. package/dist/cjs/components/notification-item/NotificationItem.cjs +146 -0
  45. package/dist/cjs/components/notification-item/NotificationItem.cjs.map +1 -0
  46. package/dist/cjs/components/notification-item/NotificationItem.d.cts +40 -0
  47. package/dist/cjs/components/notification-item/context.cjs +49 -0
  48. package/dist/cjs/components/notification-item/context.cjs.map +1 -0
  49. package/dist/cjs/components/notification-item/context.d.cts +23 -0
  50. package/dist/cjs/components/notification-item/parts/Actions.cjs +56 -0
  51. package/dist/cjs/components/notification-item/parts/Actions.cjs.map +1 -0
  52. package/dist/cjs/components/notification-item/parts/Actions.d.cts +11 -0
  53. package/dist/cjs/components/notification-item/parts/Avatar.cjs +65 -0
  54. package/dist/cjs/components/notification-item/parts/Avatar.cjs.map +1 -0
  55. package/dist/cjs/components/notification-item/parts/Avatar.d.cts +8 -0
  56. package/dist/cjs/components/notification-item/parts/Content.cjs +66 -0
  57. package/dist/cjs/components/notification-item/parts/Content.cjs.map +1 -0
  58. package/dist/cjs/components/notification-item/parts/Content.d.cts +17 -0
  59. package/dist/cjs/components/notification-item/parts/Date.cjs +114 -0
  60. package/dist/cjs/components/notification-item/parts/Date.cjs.map +1 -0
  61. package/dist/cjs/components/notification-item/parts/Date.d.cts +11 -0
  62. package/dist/cjs/components/notification-item/parts/Dot.cjs +48 -0
  63. package/dist/cjs/components/notification-item/parts/Dot.cjs.map +1 -0
  64. package/dist/cjs/components/notification-item/parts/Dot.d.cts +9 -0
  65. package/dist/cjs/components/notification-item/parts/Subject.cjs +92 -0
  66. package/dist/cjs/components/notification-item/parts/Subject.cjs.map +1 -0
  67. package/dist/cjs/components/notification-item/parts/Subject.d.cts +15 -0
  68. package/dist/cjs/components/slack-connect-button/DefaultSlackConnectButton.cjs +18 -27
  69. package/dist/cjs/components/slack-connect-button/DefaultSlackConnectButton.cjs.map +1 -1
  70. package/dist/cjs/components/slack-connect-button/SlackConnectButton.cjs +2 -3
  71. package/dist/cjs/components/slack-connect-button/SlackConnectButton.cjs.map +1 -1
  72. package/dist/cjs/components/slack-link-user/DefaultSlackLinkUser.cjs +13 -22
  73. package/dist/cjs/components/slack-link-user/DefaultSlackLinkUser.cjs.map +1 -1
  74. package/dist/cjs/components/slack-link-user/SlackLinkUser.cjs +2 -3
  75. package/dist/cjs/components/slack-link-user/SlackLinkUser.cjs.map +1 -1
  76. package/dist/cjs/components/subscription/DefaultSubscription.cjs +14 -22
  77. package/dist/cjs/components/subscription/DefaultSubscription.cjs.map +1 -1
  78. package/dist/cjs/components/subscription/Subscription.cjs +2 -3
  79. package/dist/cjs/components/subscription/Subscription.cjs.map +1 -1
  80. package/dist/cjs/components/subscription/SubscriptionButton.cjs +9 -26
  81. package/dist/cjs/components/subscription/SubscriptionButton.cjs.map +1 -1
  82. package/dist/cjs/components/subscription/SubscriptionButton.d.cts +1 -1
  83. package/dist/cjs/components/subscription/SubscriptionPreferences.cjs +9 -26
  84. package/dist/cjs/components/subscription/SubscriptionPreferences.cjs.map +1 -1
  85. package/dist/cjs/components/subscription/SubscriptionPreferences.d.cts +1 -1
  86. package/dist/cjs/components/telegram-connect-button/DefaultTelegramConnectButton.cjs +14 -23
  87. package/dist/cjs/components/telegram-connect-button/DefaultTelegramConnectButton.cjs.map +1 -1
  88. package/dist/cjs/components/telegram-connect-button/TelegramConnectButton.cjs +2 -3
  89. package/dist/cjs/components/telegram-connect-button/TelegramConnectButton.cjs.map +1 -1
  90. package/dist/cjs/context/NovuUIContext.cjs +3 -0
  91. package/dist/cjs/context/NovuUIContext.cjs.map +1 -1
  92. package/dist/cjs/context/NovuUIContext.d.cts +8 -1
  93. package/dist/cjs/context/OutletStore.cjs +97 -0
  94. package/dist/cjs/context/OutletStore.cjs.map +1 -0
  95. package/dist/cjs/context/OutletStore.d.cts +31 -0
  96. package/dist/cjs/hooks/internal/useEngineAccessor.cjs +36 -0
  97. package/dist/cjs/hooks/internal/useEngineAccessor.cjs.map +1 -0
  98. package/dist/cjs/hooks/internal/useEngineAccessor.d.cts +4 -0
  99. package/dist/cjs/hooks/internal/useEngineStores.cjs +54 -0
  100. package/dist/cjs/hooks/internal/useEngineStores.cjs.map +1 -0
  101. package/dist/cjs/hooks/internal/useEngineStores.d.cts +13 -0
  102. package/dist/cjs/hooks/internal/useIsomorphicLayoutEffect.cjs +32 -0
  103. package/dist/cjs/hooks/internal/useIsomorphicLayoutEffect.cjs.map +1 -0
  104. package/dist/cjs/hooks/internal/useIsomorphicLayoutEffect.d.cts +5 -0
  105. package/dist/cjs/hooks/internal/useNotificationOutlets.cjs +57 -0
  106. package/dist/cjs/hooks/internal/useNotificationOutlets.cjs.map +1 -0
  107. package/dist/cjs/hooks/internal/useNotificationOutlets.d.cts +33 -0
  108. package/dist/cjs/hooks/internal/useOutletRenderer.cjs +53 -0
  109. package/dist/cjs/hooks/internal/useOutletRenderer.cjs.map +1 -0
  110. package/dist/cjs/hooks/internal/useOutletRenderer.d.cts +14 -0
  111. package/dist/cjs/index.cjs +2 -0
  112. package/dist/cjs/index.cjs.map +1 -1
  113. package/dist/cjs/index.d.cts +6 -0
  114. package/dist/cjs/server/index.cjs +14 -0
  115. package/dist/cjs/server/index.cjs.map +1 -1
  116. package/dist/cjs/server/index.d.cts +15 -1
  117. package/dist/cjs/utils/appearance.cjs +2 -2
  118. package/dist/cjs/utils/appearance.cjs.map +1 -1
  119. package/dist/cjs/utils/appearance.d.cts +2 -3
  120. package/dist/esm/components/Bell.d.ts +2 -3
  121. package/dist/esm/components/Bell.js +7 -22
  122. package/dist/esm/components/Bell.js.map +1 -1
  123. package/dist/esm/components/Inbox.js +100 -138
  124. package/dist/esm/components/Inbox.js.map +1 -1
  125. package/dist/esm/components/InboxContent.d.ts +2 -3
  126. package/dist/esm/components/InboxContent.js +10 -66
  127. package/dist/esm/components/InboxContent.js.map +1 -1
  128. package/dist/esm/components/Mounter.d.ts +12 -4
  129. package/dist/esm/components/Mounter.js +19 -14
  130. package/dist/esm/components/Mounter.js.map +1 -1
  131. package/dist/esm/components/Notifications.d.ts +2 -3
  132. package/dist/esm/components/Notifications.js +10 -60
  133. package/dist/esm/components/Notifications.js.map +1 -1
  134. package/dist/esm/components/NovuUI.d.ts +4 -0
  135. package/dist/esm/components/NovuUI.js +16 -6
  136. package/dist/esm/components/NovuUI.js.map +1 -1
  137. package/dist/esm/components/OutletHost.d.ts +14 -0
  138. package/dist/esm/components/OutletHost.js +15 -0
  139. package/dist/esm/components/OutletHost.js.map +1 -0
  140. package/dist/esm/components/Preferences.js +1 -10
  141. package/dist/esm/components/Preferences.js.map +1 -1
  142. package/dist/esm/components/connect-chat/ConnectChat.js +2 -3
  143. package/dist/esm/components/connect-chat/ConnectChat.js.map +1 -1
  144. package/dist/esm/components/connect-chat/DefaultConnectChat.js +15 -24
  145. package/dist/esm/components/connect-chat/DefaultConnectChat.js.map +1 -1
  146. package/dist/esm/components/index.d.ts +6 -0
  147. package/dist/esm/components/index.js +1 -0
  148. package/dist/esm/components/index.js.map +1 -1
  149. package/dist/esm/components/msteams-connect-button/DefaultMsTeamsConnectButton.js +18 -27
  150. package/dist/esm/components/msteams-connect-button/DefaultMsTeamsConnectButton.js.map +1 -1
  151. package/dist/esm/components/msteams-connect-button/MsTeamsConnectButton.js +2 -3
  152. package/dist/esm/components/msteams-connect-button/MsTeamsConnectButton.js.map +1 -1
  153. package/dist/esm/components/msteams-link-user/DefaultMsTeamsLinkUser.js +14 -23
  154. package/dist/esm/components/msteams-link-user/DefaultMsTeamsLinkUser.js.map +1 -1
  155. package/dist/esm/components/msteams-link-user/MsTeamsLinkUser.js +2 -3
  156. package/dist/esm/components/msteams-link-user/MsTeamsLinkUser.js.map +1 -1
  157. package/dist/esm/components/notification-item/ClockIcon.d.ts +7 -0
  158. package/dist/esm/components/notification-item/ClockIcon.js +18 -0
  159. package/dist/esm/components/notification-item/ClockIcon.js.map +1 -0
  160. package/dist/esm/components/notification-item/Markdown.d.ts +12 -0
  161. package/dist/esm/components/notification-item/Markdown.js +28 -0
  162. package/dist/esm/components/notification-item/Markdown.js.map +1 -0
  163. package/dist/esm/components/notification-item/NotificationItem.d.ts +40 -0
  164. package/dist/esm/components/notification-item/NotificationItem.js +131 -0
  165. package/dist/esm/components/notification-item/NotificationItem.js.map +1 -0
  166. package/dist/esm/components/notification-item/context.d.ts +23 -0
  167. package/dist/esm/components/notification-item/context.js +21 -0
  168. package/dist/esm/components/notification-item/context.js.map +1 -0
  169. package/dist/esm/components/notification-item/parts/Actions.d.ts +11 -0
  170. package/dist/esm/components/notification-item/parts/Actions.js +30 -0
  171. package/dist/esm/components/notification-item/parts/Actions.js.map +1 -0
  172. package/dist/esm/components/notification-item/parts/Avatar.d.ts +8 -0
  173. package/dist/esm/components/notification-item/parts/Avatar.js +40 -0
  174. package/dist/esm/components/notification-item/parts/Avatar.js.map +1 -0
  175. package/dist/esm/components/notification-item/parts/Content.d.ts +17 -0
  176. package/dist/esm/components/notification-item/parts/Content.js +40 -0
  177. package/dist/esm/components/notification-item/parts/Content.js.map +1 -0
  178. package/dist/esm/components/notification-item/parts/Date.d.ts +11 -0
  179. package/dist/esm/components/notification-item/parts/Date.js +89 -0
  180. package/dist/esm/components/notification-item/parts/Date.js.map +1 -0
  181. package/dist/esm/components/notification-item/parts/Dot.d.ts +9 -0
  182. package/dist/esm/components/notification-item/parts/Dot.js +23 -0
  183. package/dist/esm/components/notification-item/parts/Dot.js.map +1 -0
  184. package/dist/esm/components/notification-item/parts/Subject.d.ts +15 -0
  185. package/dist/esm/components/notification-item/parts/Subject.js +66 -0
  186. package/dist/esm/components/notification-item/parts/Subject.js.map +1 -0
  187. package/dist/esm/components/slack-connect-button/DefaultSlackConnectButton.js +19 -28
  188. package/dist/esm/components/slack-connect-button/DefaultSlackConnectButton.js.map +1 -1
  189. package/dist/esm/components/slack-connect-button/SlackConnectButton.js +2 -3
  190. package/dist/esm/components/slack-connect-button/SlackConnectButton.js.map +1 -1
  191. package/dist/esm/components/slack-link-user/DefaultSlackLinkUser.js +14 -23
  192. package/dist/esm/components/slack-link-user/DefaultSlackLinkUser.js.map +1 -1
  193. package/dist/esm/components/slack-link-user/SlackLinkUser.js +2 -3
  194. package/dist/esm/components/slack-link-user/SlackLinkUser.js.map +1 -1
  195. package/dist/esm/components/subscription/DefaultSubscription.js +15 -23
  196. package/dist/esm/components/subscription/DefaultSubscription.js.map +1 -1
  197. package/dist/esm/components/subscription/Subscription.js +2 -3
  198. package/dist/esm/components/subscription/Subscription.js.map +1 -1
  199. package/dist/esm/components/subscription/SubscriptionButton.d.ts +1 -1
  200. package/dist/esm/components/subscription/SubscriptionButton.js +10 -27
  201. package/dist/esm/components/subscription/SubscriptionButton.js.map +1 -1
  202. package/dist/esm/components/subscription/SubscriptionPreferences.d.ts +1 -1
  203. package/dist/esm/components/subscription/SubscriptionPreferences.js +10 -27
  204. package/dist/esm/components/subscription/SubscriptionPreferences.js.map +1 -1
  205. package/dist/esm/components/telegram-connect-button/DefaultTelegramConnectButton.js +15 -24
  206. package/dist/esm/components/telegram-connect-button/DefaultTelegramConnectButton.js.map +1 -1
  207. package/dist/esm/components/telegram-connect-button/TelegramConnectButton.js +2 -3
  208. package/dist/esm/components/telegram-connect-button/TelegramConnectButton.js.map +1 -1
  209. package/dist/esm/context/NovuUIContext.d.ts +8 -1
  210. package/dist/esm/context/NovuUIContext.js +2 -0
  211. package/dist/esm/context/NovuUIContext.js.map +1 -1
  212. package/dist/esm/context/OutletStore.d.ts +31 -0
  213. package/dist/esm/context/OutletStore.js +61 -0
  214. package/dist/esm/context/OutletStore.js.map +1 -0
  215. package/dist/esm/hooks/internal/useEngineAccessor.d.ts +4 -0
  216. package/dist/esm/hooks/internal/useEngineAccessor.js +11 -0
  217. package/dist/esm/hooks/internal/useEngineAccessor.js.map +1 -0
  218. package/dist/esm/hooks/internal/useEngineStores.d.ts +13 -0
  219. package/dist/esm/hooks/internal/useEngineStores.js +27 -0
  220. package/dist/esm/hooks/internal/useEngineStores.js.map +1 -0
  221. package/dist/esm/hooks/internal/useIsomorphicLayoutEffect.d.ts +5 -0
  222. package/dist/esm/hooks/internal/useIsomorphicLayoutEffect.js +7 -0
  223. package/dist/esm/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -0
  224. package/dist/esm/hooks/internal/useNotificationOutlets.d.ts +33 -0
  225. package/dist/esm/hooks/internal/useNotificationOutlets.js +32 -0
  226. package/dist/esm/hooks/internal/useNotificationOutlets.js.map +1 -0
  227. package/dist/esm/hooks/internal/useOutletRenderer.d.ts +14 -0
  228. package/dist/esm/hooks/internal/useOutletRenderer.js +25 -0
  229. package/dist/esm/hooks/internal/useOutletRenderer.js.map +1 -0
  230. package/dist/esm/index.d.ts +6 -0
  231. package/dist/esm/index.js +5 -3
  232. package/dist/esm/index.js.map +1 -1
  233. package/dist/esm/server/index.d.ts +15 -1
  234. package/dist/esm/server/index.js +14 -1
  235. package/dist/esm/server/index.js.map +1 -1
  236. package/dist/esm/utils/appearance.d.ts +2 -3
  237. package/dist/esm/utils/appearance.js +2 -2
  238. package/dist/esm/utils/appearance.js.map +1 -1
  239. package/package.json +11 -5
  240. package/dist/cjs/components/Renderer.cjs +0 -70
  241. package/dist/cjs/components/Renderer.cjs.map +0 -1
  242. package/dist/cjs/components/Renderer.d.cts +0 -8
  243. package/dist/cjs/context/RendererContext.cjs.map +0 -1
  244. package/dist/cjs/context/RendererContext.d.cts +0 -15
  245. package/dist/esm/components/Renderer.d.ts +0 -8
  246. package/dist/esm/components/Renderer.js +0 -44
  247. package/dist/esm/components/Renderer.js.map +0 -1
  248. package/dist/esm/context/RendererContext.d.ts +0 -15
  249. package/dist/esm/context/RendererContext.js +0 -13
  250. package/dist/esm/context/RendererContext.js.map +0 -1
@@ -24,7 +24,6 @@ __export(DefaultMsTeamsLinkUser_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(DefaultMsTeamsLinkUser_exports);
26
26
  var import_react = require("react");
27
- var import_NovuUIContext = require("../../context/NovuUIContext.cjs");
28
27
  var import_Mounter = require("../Mounter.cjs");
29
28
  var import_jsx_runtime = require("react/jsx-runtime");
30
29
  var DefaultMsTeamsLinkUser = (props) => {
@@ -39,27 +38,19 @@ var DefaultMsTeamsLinkUser = (props) => {
39
38
  linkLabel,
40
39
  unlinkLabel
41
40
  } = props;
42
- const { novuUI } = (0, import_NovuUIContext.useNovuUI)();
43
- const mount = (0, import_react.useCallback)(
44
- (element) => {
45
- return novuUI.mountComponent({
46
- name: "MsTeamsLinkUser",
47
- props: {
48
- integrationIdentifier,
49
- connectionIdentifier,
50
- context,
51
- onLinkSuccess,
52
- onLinkError,
53
- onUnlinkSuccess,
54
- onUnlinkError,
55
- linkLabel,
56
- unlinkLabel
57
- },
58
- element
59
- });
60
- },
41
+ const mountProps = (0, import_react.useMemo)(
42
+ () => ({
43
+ integrationIdentifier,
44
+ connectionIdentifier,
45
+ context,
46
+ onLinkSuccess,
47
+ onLinkError,
48
+ onUnlinkSuccess,
49
+ onUnlinkError,
50
+ linkLabel,
51
+ unlinkLabel
52
+ }),
61
53
  [
62
- novuUI,
63
54
  integrationIdentifier,
64
55
  connectionIdentifier,
65
56
  context,
@@ -71,7 +62,7 @@ var DefaultMsTeamsLinkUser = (props) => {
71
62
  unlinkLabel
72
63
  ]
73
64
  );
74
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Mounter.Mounter, { mount });
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Mounter.Mounter, { name: "MsTeamsLinkUser", props: mountProps });
75
66
  };
76
67
  // Annotate the CommonJS export names for ESM import in node:
77
68
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/msteams-link-user/DefaultMsTeamsLinkUser.tsx"],"sourcesContent":["import { MsTeamsLinkUserProps } from '@novu/js/ui';\nimport { useCallback } from 'react';\nimport { useNovuUI } from '../../context/NovuUIContext';\nimport { Mounter } from '../Mounter';\n\nexport type DefaultMsTeamsLinkUserProps = Pick<\n MsTeamsLinkUserProps,\n | 'integrationIdentifier'\n | 'connectionIdentifier'\n | 'context'\n | 'onLinkSuccess'\n | 'onLinkError'\n | 'onUnlinkSuccess'\n | 'onUnlinkError'\n | 'linkLabel'\n | 'unlinkLabel'\n>;\n\nexport const DefaultMsTeamsLinkUser = (props: DefaultMsTeamsLinkUserProps) => {\n const {\n integrationIdentifier,\n connectionIdentifier,\n context,\n onLinkSuccess,\n onLinkError,\n onUnlinkSuccess,\n onUnlinkError,\n linkLabel,\n unlinkLabel,\n } = props;\n const { novuUI } = useNovuUI();\n\n const mount = useCallback(\n (element: HTMLElement) => {\n return novuUI.mountComponent({\n name: 'MsTeamsLinkUser',\n props: {\n integrationIdentifier,\n connectionIdentifier,\n context,\n onLinkSuccess,\n onLinkError,\n onUnlinkSuccess,\n onUnlinkError,\n linkLabel,\n unlinkLabel,\n },\n element,\n });\n },\n [\n novuUI,\n integrationIdentifier,\n connectionIdentifier,\n context,\n onLinkSuccess,\n onLinkError,\n onUnlinkSuccess,\n onUnlinkError,\n linkLabel,\n unlinkLabel,\n ]\n );\n\n return <Mounter mount={mount} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA4B;AAC5B,2BAA0B;AAC1B,qBAAwB;AA6Df;AA9CF,IAAM,yBAAyB,CAAC,UAAuC;AAC5E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,OAAO,QAAI,gCAAU;AAE7B,QAAM,YAAQ;AAAA,IACZ,CAAC,YAAyB;AACxB,aAAO,OAAO,eAAe;AAAA,QAC3B,MAAM;AAAA,QACN,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO,4CAAC,0BAAQ,OAAc;AAChC;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/msteams-link-user/DefaultMsTeamsLinkUser.tsx"],"sourcesContent":["import { MsTeamsLinkUserProps } from '@novu/js/ui';\nimport { useMemo } from 'react';\nimport { Mounter } from '../Mounter';\n\nexport type DefaultMsTeamsLinkUserProps = Pick<\n MsTeamsLinkUserProps,\n | 'integrationIdentifier'\n | 'connectionIdentifier'\n | 'context'\n | 'onLinkSuccess'\n | 'onLinkError'\n | 'onUnlinkSuccess'\n | 'onUnlinkError'\n | 'linkLabel'\n | 'unlinkLabel'\n>;\n\nexport const DefaultMsTeamsLinkUser = (props: DefaultMsTeamsLinkUserProps) => {\n const {\n integrationIdentifier,\n connectionIdentifier,\n context,\n onLinkSuccess,\n onLinkError,\n onUnlinkSuccess,\n onUnlinkError,\n linkLabel,\n unlinkLabel,\n } = props;\n\n const mountProps = useMemo(\n () => ({\n integrationIdentifier,\n connectionIdentifier,\n context,\n onLinkSuccess,\n onLinkError,\n onUnlinkSuccess,\n onUnlinkError,\n linkLabel,\n unlinkLabel,\n }),\n [\n integrationIdentifier,\n connectionIdentifier,\n context,\n onLinkSuccess,\n onLinkError,\n onUnlinkSuccess,\n onUnlinkError,\n linkLabel,\n unlinkLabel,\n ]\n );\n\n return <Mounter name=\"MsTeamsLinkUser\" props={mountProps} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAwB;AACxB,qBAAwB;AAqDf;AAtCF,IAAM,yBAAyB,CAAC,UAAuC;AAC5E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,iBAAa;AAAA,IACjB,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO,4CAAC,0BAAQ,MAAK,mBAAkB,OAAO,YAAY;AAC5D;","names":[]}
@@ -36,10 +36,9 @@ module.exports = __toCommonJS(MsTeamsLinkUser_exports);
36
36
  var import_react = __toESM(require("react"), 1);
37
37
  var import_NovuProvider = require("../../hooks/NovuProvider.cjs");
38
38
  var import_NovuUI = require("../NovuUI.cjs");
39
- var import_Renderer = require("../Renderer.cjs");
40
39
  var import_DefaultMsTeamsLinkUser = require("./DefaultMsTeamsLinkUser.cjs");
41
40
  var import_jsx_runtime = require("react/jsx-runtime");
42
- var MsTeamsLinkUserInternal = (0, import_Renderer.withRenderer)((props) => {
41
+ var MsTeamsLinkUserInternal = (props) => {
43
42
  const { container, appearance, ...defaultProps } = props;
44
43
  const novu = (0, import_NovuProvider.useNovu)();
45
44
  const options = (0, import_react.useMemo)(() => {
@@ -50,7 +49,7 @@ var MsTeamsLinkUserInternal = (0, import_Renderer.withRenderer)((props) => {
50
49
  };
51
50
  }, [container, appearance, novu.options]);
52
51
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_NovuUI.NovuUI, { options, novu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DefaultMsTeamsLinkUser.DefaultMsTeamsLinkUser, { ...defaultProps }) });
53
- });
52
+ };
54
53
  MsTeamsLinkUserInternal.displayName = "MsTeamsLinkUserInternal";
55
54
  var MsTeamsLinkUser = import_react.default.memo((props) => {
56
55
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MsTeamsLinkUserInternal, { ...props });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/msteams-link-user/MsTeamsLinkUser.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { useNovu } from '../../hooks/NovuProvider';\nimport { NovuUI, NovuUIOptions } from '../NovuUI';\nimport { withRenderer } from '../Renderer';\nimport { DefaultMsTeamsLinkUser, DefaultMsTeamsLinkUserProps } from './DefaultMsTeamsLinkUser';\n\nexport type MsTeamsLinkUserProps = DefaultMsTeamsLinkUserProps & Pick<NovuUIOptions, 'container' | 'appearance'>;\n\nconst MsTeamsLinkUserInternal = withRenderer<MsTeamsLinkUserProps>((props) => {\n const { container, appearance, ...defaultProps } = props;\n const novu = useNovu();\n\n const options: NovuUIOptions = useMemo(() => {\n return {\n container,\n appearance,\n options: novu.options,\n };\n }, [container, appearance, novu.options]);\n\n return (\n <NovuUI options={options} novu={novu}>\n <DefaultMsTeamsLinkUser {...defaultProps} />\n </NovuUI>\n );\n});\n\nMsTeamsLinkUserInternal.displayName = 'MsTeamsLinkUserInternal';\n\nexport const MsTeamsLinkUser = React.memo((props: MsTeamsLinkUserProps) => {\n return <MsTeamsLinkUserInternal {...props} />;\n});\n\nMsTeamsLinkUser.displayName = 'MsTeamsLinkUser';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,0BAAwB;AACxB,oBAAsC;AACtC,sBAA6B;AAC7B,oCAAoE;AAkB9D;AAdN,IAAM,8BAA0B,8BAAmC,CAAC,UAAU;AAC5E,QAAM,EAAE,WAAW,YAAY,GAAG,aAAa,IAAI;AACnD,QAAM,WAAO,6BAAQ;AAErB,QAAM,cAAyB,sBAAQ,MAAM;AAC3C,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,SAAS,KAAK;AAAA,IAChB;AAAA,EACF,GAAG,CAAC,WAAW,YAAY,KAAK,OAAO,CAAC;AAExC,SACE,4CAAC,wBAAO,SAAkB,MACxB,sDAAC,wDAAwB,GAAG,cAAc,GAC5C;AAEJ,CAAC;AAED,wBAAwB,cAAc;AAE/B,IAAM,kBAAkB,aAAAA,QAAM,KAAK,CAAC,UAAgC;AACzE,SAAO,4CAAC,2BAAyB,GAAG,OAAO;AAC7C,CAAC;AAED,gBAAgB,cAAc;","names":["React"]}
1
+ {"version":3,"sources":["../../../../src/components/msteams-link-user/MsTeamsLinkUser.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { useNovu } from '../../hooks/NovuProvider';\nimport { NovuUI, NovuUIOptions } from '../NovuUI';\nimport { DefaultMsTeamsLinkUser, DefaultMsTeamsLinkUserProps } from './DefaultMsTeamsLinkUser';\n\nexport type MsTeamsLinkUserProps = DefaultMsTeamsLinkUserProps & Pick<NovuUIOptions, 'container' | 'appearance'>;\n\nconst MsTeamsLinkUserInternal = (props: MsTeamsLinkUserProps) => {\n const { container, appearance, ...defaultProps } = props;\n const novu = useNovu();\n\n const options: NovuUIOptions = useMemo(() => {\n return {\n container,\n appearance,\n options: novu.options,\n };\n }, [container, appearance, novu.options]);\n\n return (\n <NovuUI options={options} novu={novu}>\n <DefaultMsTeamsLinkUser {...defaultProps} />\n </NovuUI>\n );\n};\n\nMsTeamsLinkUserInternal.displayName = 'MsTeamsLinkUserInternal';\n\nexport const MsTeamsLinkUser = React.memo((props: MsTeamsLinkUserProps) => {\n return <MsTeamsLinkUserInternal {...props} />;\n});\n\nMsTeamsLinkUser.displayName = 'MsTeamsLinkUser';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,0BAAwB;AACxB,oBAAsC;AACtC,oCAAoE;AAkB9D;AAdN,IAAM,0BAA0B,CAAC,UAAgC;AAC/D,QAAM,EAAE,WAAW,YAAY,GAAG,aAAa,IAAI;AACnD,QAAM,WAAO,6BAAQ;AAErB,QAAM,cAAyB,sBAAQ,MAAM;AAC3C,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,SAAS,KAAK;AAAA,IAChB;AAAA,EACF,GAAG,CAAC,WAAW,YAAY,KAAK,OAAO,CAAC;AAExC,SACE,4CAAC,wBAAO,SAAkB,MACxB,sDAAC,wDAAwB,GAAG,cAAc,GAC5C;AAEJ;AAEA,wBAAwB,cAAc;AAE/B,IAAM,kBAAkB,aAAAA,QAAM,KAAK,CAAC,UAAgC;AACzE,SAAO,4CAAC,2BAAyB,GAAG,OAAO;AAC7C,CAAC;AAED,gBAAgB,cAAc;","names":["React"]}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/notification-item/ClockIcon.tsx
21
+ var ClockIcon_exports = {};
22
+ __export(ClockIcon_exports, {
23
+ ClockIcon: () => ClockIcon
24
+ });
25
+ module.exports = __toCommonJS(ClockIcon_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ var ClockIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
28
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", { children: "clock" }),
29
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { clipPath: "url(#clip0_3188_15050)", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
30
+ "path",
31
+ {
32
+ d: "M6 3V6L8 7M11 6C11 8.76142 8.76142 11 6 11C3.23858 11 1 8.76142 1 6C1 3.23858 3.23858 1 6 1C8.76142 1 11 3.23858 11 6Z",
33
+ stroke: "currentColor",
34
+ strokeLinecap: "round",
35
+ strokeLinejoin: "round"
36
+ }
37
+ ) })
38
+ ] });
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ ClockIcon
42
+ });
43
+ //# sourceMappingURL=ClockIcon.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/notification-item/ClockIcon.tsx"],"sourcesContent":["import React from 'react';\n\n/** The engine's clock icon, used when the host has no `appearance.icons.clock` override. */\nexport const ClockIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <title>clock</title>\n <g clipPath=\"url(#clip0_3188_15050)\">\n <path\n d=\"M6 3V6L8 7M11 6C11 8.76142 8.76142 11 6 11C3.23858 11 1 8.76142 1 6C1 3.23858 3.23858 1 6 1C8.76142 1 11 3.23858 11 6Z\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIE;AADK,IAAM,YAAY,CAAC,UACxB,6CAAC,SAAI,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAA8B,GAAG,OAC1E;AAAA,8CAAC,WAAM,mBAAK;AAAA,EACZ,4CAAC,OAAE,UAAS,0BACV;AAAA,IAAC;AAAA;AAAA,MACC,GAAE;AAAA,MACF,QAAO;AAAA,MACP,eAAc;AAAA,MACd,gBAAe;AAAA;AAAA,EACjB,GACF;AAAA,GACF;","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ /** The engine's clock icon, used when the host has no `appearance.icons.clock` override. */
5
+ declare const ClockIcon: (props: React__default.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
6
+
7
+ export { ClockIcon };
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/notification-item/Markdown.tsx
21
+ var Markdown_exports = {};
22
+ __export(Markdown_exports, {
23
+ Markdown: () => Markdown
24
+ });
25
+ module.exports = __toCommonJS(Markdown_exports);
26
+ var import_ui_core = require("@novu/js/ui-core");
27
+ var import_react = require("react");
28
+ var import_useEngineStores = require("../../hooks/internal/useEngineStores.cjs");
29
+ var import_jsx_runtime = require("react/jsx-runtime");
30
+ var Markdown = ({ children, strongKey, emKey, context }) => {
31
+ const style = (0, import_useEngineStores.useStyle)();
32
+ const tokens = (0, import_react.useMemo)(() => (0, import_ui_core.parseMarkdownIntoTokens)(children), [children]);
33
+ const strongClassName = style({ key: strongKey, className: import_ui_core.markdownStyles.strong.className, context });
34
+ const emClassName = style({ key: emKey, className: import_ui_core.markdownStyles.em.className, context });
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: tokens.map((token, index) => {
36
+ const key = `${index}-${token.type}`;
37
+ if (token.type === "boldItalic") {
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { className: strongClassName, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("em", { className: emClassName, children: token.content }) }, key);
39
+ }
40
+ if (token.type === "bold") {
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { className: strongClassName, children: token.content }, key);
42
+ }
43
+ if (token.type === "italic") {
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("em", { className: emClassName, children: token.content }, key);
45
+ }
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: token.content }, key);
47
+ }) });
48
+ };
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ Markdown
52
+ });
53
+ //# sourceMappingURL=Markdown.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/notification-item/Markdown.tsx"],"sourcesContent":["import { markdownStyles, parseMarkdownIntoTokens } from '@novu/js/ui-core';\nimport React, { Fragment, useMemo } from 'react';\nimport { useStyle } from '../../hooks/internal/useEngineStores';\n\ntype MarkdownProps = {\n children: string;\n strongKey: string;\n emKey: string;\n context: Record<string, unknown>;\n};\n\n/** Renders the same inline markdown as the engine: `**strong**`, `*em*`, and both nested. */\nexport const Markdown = ({ children, strongKey, emKey, context }: MarkdownProps) => {\n const style = useStyle();\n const tokens = useMemo(() => parseMarkdownIntoTokens(children), [children]);\n const strongClassName = style({ key: strongKey as never, className: markdownStyles.strong.className, context });\n const emClassName = style({ key: emKey as never, className: markdownStyles.em.className, context });\n\n return (\n <>\n {tokens.map((token, index) => {\n const key = `${index}-${token.type}`;\n if (token.type === 'boldItalic') {\n return (\n <strong key={key} className={strongClassName}>\n <em className={emClassName}>{token.content}</em>\n </strong>\n );\n }\n if (token.type === 'bold') {\n return (\n <strong key={key} className={strongClassName}>\n {token.content}\n </strong>\n );\n }\n if (token.type === 'italic') {\n return (\n <em key={key} className={emClassName}>\n {token.content}\n </em>\n );\n }\n\n return <Fragment key={key}>{token.content}</Fragment>;\n })}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwD;AACxD,mBAAyC;AACzC,6BAAyB;AAiBrB;AAPG,IAAM,WAAW,CAAC,EAAE,UAAU,WAAW,OAAO,QAAQ,MAAqB;AAClF,QAAM,YAAQ,iCAAS;AACvB,QAAM,aAAS,sBAAQ,UAAM,wCAAwB,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAC1E,QAAM,kBAAkB,MAAM,EAAE,KAAK,WAAoB,WAAW,8BAAe,OAAO,WAAW,QAAQ,CAAC;AAC9G,QAAM,cAAc,MAAM,EAAE,KAAK,OAAgB,WAAW,8BAAe,GAAG,WAAW,QAAQ,CAAC;AAElG,SACE,2EACG,iBAAO,IAAI,CAAC,OAAO,UAAU;AAC5B,UAAM,MAAM,GAAG,KAAK,IAAI,MAAM,IAAI;AAClC,QAAI,MAAM,SAAS,cAAc;AAC/B,aACE,4CAAC,YAAiB,WAAW,iBAC3B,sDAAC,QAAG,WAAW,aAAc,gBAAM,SAAQ,KADhC,GAEb;AAAA,IAEJ;AACA,QAAI,MAAM,SAAS,QAAQ;AACzB,aACE,4CAAC,YAAiB,WAAW,iBAC1B,gBAAM,WADI,GAEb;AAAA,IAEJ;AACA,QAAI,MAAM,SAAS,UAAU;AAC3B,aACE,4CAAC,QAAa,WAAW,aACtB,gBAAM,WADA,GAET;AAAA,IAEJ;AAEA,WAAO,4CAAC,yBAAoB,gBAAM,WAAZ,GAAoB;AAAA,EAC5C,CAAC,GACH;AAEJ;","names":[]}
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ type MarkdownProps = {
4
+ children: string;
5
+ strongKey: string;
6
+ emKey: string;
7
+ context: Record<string, unknown>;
8
+ };
9
+ /** Renders the same inline markdown as the engine: `**strong**`, `*em*`, and both nested. */
10
+ declare const Markdown: ({ children, strongKey, emKey, context }: MarkdownProps) => react_jsx_runtime.JSX.Element;
11
+
12
+ export { Markdown };
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/notification-item/NotificationItem.tsx
21
+ var NotificationItem_exports = {};
22
+ __export(NotificationItem_exports, {
23
+ NotificationItem: () => NotificationItem
24
+ });
25
+ module.exports = __toCommonJS(NotificationItem_exports);
26
+ var import_js = require("@novu/js");
27
+ var import_ui_core = require("@novu/js/ui-core");
28
+ var import_react = require("react");
29
+ var import_useEngineStores = require("../../hooks/internal/useEngineStores.cjs");
30
+ var import_context = require("./context.cjs");
31
+ var import_Actions = require("./parts/Actions.cjs");
32
+ var import_Avatar = require("./parts/Avatar.cjs");
33
+ var import_Content = require("./parts/Content.cjs");
34
+ var import_Date = require("./parts/Date.cjs");
35
+ var import_Dot = require("./parts/Dot.cjs");
36
+ var import_Subject = require("./parts/Subject.cjs");
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ var DefaultArrangement = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
39
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Avatar.Avatar, {}),
40
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Content.Content, { children: [
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Content.Text, { children: [
42
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Subject.Subject, {}),
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Subject.Body, {})
44
+ ] }),
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Actions.DefaultActions, {}),
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Actions.CustomActions, {}),
47
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Date.Date, {})
48
+ ] }),
49
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Dot.Dot, {})
50
+ ] });
51
+ var NotificationItemRoot = (props) => {
52
+ const {
53
+ notification,
54
+ children,
55
+ className,
56
+ onNotificationClick,
57
+ onPrimaryActionClick,
58
+ onSecondaryActionClick,
59
+ renderAvatar,
60
+ renderSubject,
61
+ renderBody,
62
+ renderDefaultActions,
63
+ renderCustomActions
64
+ } = props;
65
+ const style = (0, import_useEngineStores.useStyle)();
66
+ const { inbox } = (0, import_useEngineStores.useEngineStores)();
67
+ const inherited = (0, import_context.useInheritedNotificationHandlers)();
68
+ const handlers = (0, import_react.useMemo)(
69
+ () => ({
70
+ onNotificationClick: onNotificationClick ?? inherited.onNotificationClick,
71
+ onPrimaryActionClick: onPrimaryActionClick ?? inherited.onPrimaryActionClick,
72
+ onSecondaryActionClick: onSecondaryActionClick ?? inherited.onSecondaryActionClick
73
+ }),
74
+ [onNotificationClick, onPrimaryActionClick, onSecondaryActionClick, inherited]
75
+ );
76
+ const latest = (0, import_react.useRef)({ notification, handlers });
77
+ latest.current = { notification, handlers };
78
+ const controller = (0, import_react.useMemo)(
79
+ () => (0, import_ui_core.createNotificationItemController)({
80
+ notification: () => latest.current.notification,
81
+ handlers: () => latest.current.handlers,
82
+ navigate: inbox.navigate
83
+ }),
84
+ [inbox]
85
+ );
86
+ const contextValue = (0, import_react.useMemo)(
87
+ () => ({
88
+ notification,
89
+ handlers,
90
+ renderers: { renderAvatar, renderSubject, renderBody, renderDefaultActions, renderCustomActions }
91
+ }),
92
+ [notification, handlers, renderAvatar, renderSubject, renderBody, renderDefaultActions, renderCustomActions]
93
+ );
94
+ const severity = notification.severity ?? import_js.SeverityLevelEnum.NONE;
95
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.NotificationItemProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
96
+ "a",
97
+ {
98
+ className: style({
99
+ key: import_ui_core.SEVERITY_TO_NOTIFICATION_KEYS[severity],
100
+ className: (0, import_ui_core.cn)(
101
+ import_ui_core.notificationItemStyles.root.className,
102
+ import_ui_core.notificationItemStyles.root.severity[severity],
103
+ { [import_ui_core.notificationItemStyles.root.clickable]: controller.isClickable() },
104
+ className
105
+ ),
106
+ context: { notification }
107
+ }),
108
+ onClick: (event) => {
109
+ if (!(0, import_ui_core.isInsideIsland)(event.target)) {
110
+ event.stopPropagation();
111
+ }
112
+ void controller.handleClick(event.nativeEvent);
113
+ },
114
+ children: [
115
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
116
+ "div",
117
+ {
118
+ className: style({
119
+ key: import_ui_core.SEVERITY_TO_BAR_KEYS[severity],
120
+ className: (0, import_ui_core.cn)(import_ui_core.notificationItemStyles.bar.className, import_ui_core.notificationItemStyles.bar.severity[severity]),
121
+ context: { notification }
122
+ })
123
+ }
124
+ ),
125
+ children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultArrangement, {})
126
+ ]
127
+ }
128
+ ) });
129
+ };
130
+ NotificationItemRoot.displayName = "NotificationItem";
131
+ var NotificationItem = Object.assign(NotificationItemRoot, {
132
+ Avatar: import_Avatar.Avatar,
133
+ Content: import_Content.Content,
134
+ Text: import_Content.Text,
135
+ Subject: import_Subject.Subject,
136
+ Body: import_Subject.Body,
137
+ DefaultActions: import_Actions.DefaultActions,
138
+ CustomActions: import_Actions.CustomActions,
139
+ Date: import_Date.Date,
140
+ Dot: import_Dot.Dot
141
+ });
142
+ // Annotate the CommonJS export names for ESM import in node:
143
+ 0 && (module.exports = {
144
+ NotificationItem
145
+ });
146
+ //# sourceMappingURL=NotificationItem.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/notification-item/NotificationItem.tsx"],"sourcesContent":["import type { Notification } from '@novu/js';\nimport { SeverityLevelEnum } from '@novu/js';\nimport type { NotificationActionClickHandler, NotificationClickHandler } from '@novu/js/ui';\nimport {\n cn,\n createNotificationItemController,\n isInsideIsland,\n notificationItemStyles,\n SEVERITY_TO_BAR_KEYS,\n SEVERITY_TO_NOTIFICATION_KEYS,\n} from '@novu/js/ui-core';\nimport React, { type ReactNode, useMemo, useRef } from 'react';\nimport { useEngineStores, useStyle } from '../../hooks/internal/useEngineStores';\nimport {\n type NotificationItemContextValue,\n NotificationItemProvider,\n useInheritedNotificationHandlers,\n} from './context';\nimport { CustomActions, DefaultActions } from './parts/Actions';\nimport { Avatar } from './parts/Avatar';\nimport { Content, Text } from './parts/Content';\nimport { Date } from './parts/Date';\nimport { Dot } from './parts/Dot';\nimport { Body, Subject } from './parts/Subject';\n\nexport type NotificationItemProps = {\n notification: Notification;\n /** Your own arrangement of the parts. Without it, the built-in arrangement is rendered. */\n children?: ReactNode;\n className?: string;\n onNotificationClick?: NotificationClickHandler;\n onPrimaryActionClick?: NotificationActionClickHandler;\n onSecondaryActionClick?: NotificationActionClickHandler;\n renderAvatar?: (notification: Notification) => ReactNode;\n renderSubject?: (notification: Notification) => ReactNode;\n renderBody?: (notification: Notification) => ReactNode;\n renderDefaultActions?: (notification: Notification) => ReactNode;\n renderCustomActions?: (notification: Notification) => ReactNode;\n};\n\nconst DefaultArrangement = () => (\n <>\n <Avatar />\n <Content>\n <Text>\n <Subject />\n <Body />\n </Text>\n <DefaultActions />\n <CustomActions />\n <Date />\n </Content>\n <Dot />\n </>\n);\n\n/**\n * The built-in notification item, rendered natively in React.\n *\n * `<NotificationItem notification={n} />` is the default look. Pass children to arrange the parts yourself:\n * `NotificationItem.Avatar`, `Content`, `Text`, `Subject`, `Body`, `DefaultActions`, `CustomActions`, `Date`\n * and `Dot`. The root carries the item's behaviour in both modes: severity styling, the hover group, and the\n * click that marks the notification read and follows its redirect. Handlers fall back to the ones given to\n * `Inbox`, `Notifications` or `InboxContent`.\n */\nconst NotificationItemRoot = (props: NotificationItemProps) => {\n const {\n notification,\n children,\n className,\n onNotificationClick,\n onPrimaryActionClick,\n onSecondaryActionClick,\n renderAvatar,\n renderSubject,\n renderBody,\n renderDefaultActions,\n renderCustomActions,\n } = props;\n const style = useStyle();\n const { inbox } = useEngineStores();\n const inherited = useInheritedNotificationHandlers();\n\n const handlers = useMemo(\n () => ({\n onNotificationClick: onNotificationClick ?? inherited.onNotificationClick,\n onPrimaryActionClick: onPrimaryActionClick ?? inherited.onPrimaryActionClick,\n onSecondaryActionClick: onSecondaryActionClick ?? inherited.onSecondaryActionClick,\n }),\n [onNotificationClick, onPrimaryActionClick, onSecondaryActionClick, inherited]\n );\n\n const latest = useRef({ notification, handlers });\n latest.current = { notification, handlers };\n const controller = useMemo(\n () =>\n createNotificationItemController({\n notification: () => latest.current.notification,\n handlers: () => latest.current.handlers,\n navigate: inbox.navigate,\n }),\n [inbox]\n );\n\n const contextValue = useMemo<NotificationItemContextValue>(\n () => ({\n notification,\n handlers,\n renderers: { renderAvatar, renderSubject, renderBody, renderDefaultActions, renderCustomActions },\n }),\n [notification, handlers, renderAvatar, renderSubject, renderBody, renderDefaultActions, renderCustomActions]\n );\n\n const severity = notification.severity ?? SeverityLevelEnum.NONE;\n\n return (\n <NotificationItemProvider value={contextValue}>\n <a\n className={style({\n key: SEVERITY_TO_NOTIFICATION_KEYS[severity],\n className: cn(\n notificationItemStyles.root.className,\n notificationItemStyles.root.severity[severity],\n { [notificationItemStyles.root.clickable]: controller.isClickable() },\n className\n ),\n context: { notification },\n })}\n onClick={(event) => {\n if (!isInsideIsland(event.target)) {\n event.stopPropagation();\n }\n void controller.handleClick(event.nativeEvent);\n }}\n >\n <div\n className={style({\n key: SEVERITY_TO_BAR_KEYS[severity],\n className: cn(notificationItemStyles.bar.className, notificationItemStyles.bar.severity[severity]),\n context: { notification },\n })}\n />\n {children ?? <DefaultArrangement />}\n </a>\n </NotificationItemProvider>\n );\n};\n\nNotificationItemRoot.displayName = 'NotificationItem';\n\nexport const NotificationItem = Object.assign(NotificationItemRoot, {\n Avatar,\n Content,\n Text,\n Subject,\n Body,\n DefaultActions,\n CustomActions,\n Date,\n Dot,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,gBAAkC;AAElC,qBAOO;AACP,mBAAuD;AACvD,6BAA0C;AAC1C,qBAIO;AACP,qBAA8C;AAC9C,oBAAuB;AACvB,qBAA8B;AAC9B,kBAAqB;AACrB,iBAAoB;AACpB,qBAA8B;AAkB5B;AADF,IAAM,qBAAqB,MACzB,4EACE;AAAA,8CAAC,wBAAO;AAAA,EACR,6CAAC,0BACC;AAAA,iDAAC,uBACC;AAAA,kDAAC,0BAAQ;AAAA,MACT,4CAAC,uBAAK;AAAA,OACR;AAAA,IACA,4CAAC,iCAAe;AAAA,IAChB,4CAAC,gCAAc;AAAA,IACf,4CAAC,oBAAK;AAAA,KACR;AAAA,EACA,4CAAC,kBAAI;AAAA,GACP;AAYF,IAAM,uBAAuB,CAAC,UAAiC;AAC7D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,YAAQ,iCAAS;AACvB,QAAM,EAAE,MAAM,QAAI,wCAAgB;AAClC,QAAM,gBAAY,iDAAiC;AAEnD,QAAM,eAAW;AAAA,IACf,OAAO;AAAA,MACL,qBAAqB,uBAAuB,UAAU;AAAA,MACtD,sBAAsB,wBAAwB,UAAU;AAAA,MACxD,wBAAwB,0BAA0B,UAAU;AAAA,IAC9D;AAAA,IACA,CAAC,qBAAqB,sBAAsB,wBAAwB,SAAS;AAAA,EAC/E;AAEA,QAAM,aAAS,qBAAO,EAAE,cAAc,SAAS,CAAC;AAChD,SAAO,UAAU,EAAE,cAAc,SAAS;AAC1C,QAAM,iBAAa;AAAA,IACjB,UACE,iDAAiC;AAAA,MAC/B,cAAc,MAAM,OAAO,QAAQ;AAAA,MACnC,UAAU,MAAM,OAAO,QAAQ;AAAA,MAC/B,UAAU,MAAM;AAAA,IAClB,CAAC;AAAA,IACH,CAAC,KAAK;AAAA,EACR;AAEA,QAAM,mBAAe;AAAA,IACnB,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,WAAW,EAAE,cAAc,eAAe,YAAY,sBAAsB,oBAAoB;AAAA,IAClG;AAAA,IACA,CAAC,cAAc,UAAU,cAAc,eAAe,YAAY,sBAAsB,mBAAmB;AAAA,EAC7G;AAEA,QAAM,WAAW,aAAa,YAAY,4BAAkB;AAE5D,SACE,4CAAC,2CAAyB,OAAO,cAC/B;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM;AAAA,QACf,KAAK,6CAA8B,QAAQ;AAAA,QAC3C,eAAW;AAAA,UACT,sCAAuB,KAAK;AAAA,UAC5B,sCAAuB,KAAK,SAAS,QAAQ;AAAA,UAC7C,EAAE,CAAC,sCAAuB,KAAK,SAAS,GAAG,WAAW,YAAY,EAAE;AAAA,UACpE;AAAA,QACF;AAAA,QACA,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA,MACD,SAAS,CAAC,UAAU;AAClB,YAAI,KAAC,+BAAe,MAAM,MAAM,GAAG;AACjC,gBAAM,gBAAgB;AAAA,QACxB;AACA,aAAK,WAAW,YAAY,MAAM,WAAW;AAAA,MAC/C;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,MAAM;AAAA,cACf,KAAK,oCAAqB,QAAQ;AAAA,cAClC,eAAW,mBAAG,sCAAuB,IAAI,WAAW,sCAAuB,IAAI,SAAS,QAAQ,CAAC;AAAA,cACjG,SAAS,EAAE,aAAa;AAAA,YAC1B,CAAC;AAAA;AAAA,QACH;AAAA,QACC,YAAY,4CAAC,sBAAmB;AAAA;AAAA;AAAA,EACnC,GACF;AAEJ;AAEA,qBAAqB,cAAc;AAE5B,IAAM,mBAAmB,OAAO,OAAO,sBAAsB;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":[]}
@@ -0,0 +1,40 @@
1
+ import { NotificationItemDotProps } from './parts/Dot.cjs';
2
+ import { NotificationItemDateProps } from './parts/Date.cjs';
3
+ import { NotificationItemSubjectProps, NotificationItemBodyProps } from './parts/Subject.cjs';
4
+ import { NotificationItemContentProps, NotificationItemTextProps } from './parts/Content.cjs';
5
+ import { NotificationItemAvatarProps } from './parts/Avatar.cjs';
6
+ import * as react_jsx_runtime from 'react/jsx-runtime';
7
+ import { Notification } from '@novu/js';
8
+ import { NotificationClickHandler, NotificationActionClickHandler } from '@novu/js/ui';
9
+ import { ReactNode } from 'react';
10
+
11
+ type NotificationItemProps = {
12
+ notification: Notification;
13
+ /** Your own arrangement of the parts. Without it, the built-in arrangement is rendered. */
14
+ children?: ReactNode;
15
+ className?: string;
16
+ onNotificationClick?: NotificationClickHandler;
17
+ onPrimaryActionClick?: NotificationActionClickHandler;
18
+ onSecondaryActionClick?: NotificationActionClickHandler;
19
+ renderAvatar?: (notification: Notification) => ReactNode;
20
+ renderSubject?: (notification: Notification) => ReactNode;
21
+ renderBody?: (notification: Notification) => ReactNode;
22
+ renderDefaultActions?: (notification: Notification) => ReactNode;
23
+ renderCustomActions?: (notification: Notification) => ReactNode;
24
+ };
25
+ declare const NotificationItem: {
26
+ (props: NotificationItemProps): react_jsx_runtime.JSX.Element;
27
+ displayName: string;
28
+ } & {
29
+ Avatar: ({ className }: NotificationItemAvatarProps) => react_jsx_runtime.JSX.Element;
30
+ Content: ({ className, children }: NotificationItemContentProps) => react_jsx_runtime.JSX.Element;
31
+ Text: ({ className, children }: NotificationItemTextProps) => react_jsx_runtime.JSX.Element;
32
+ Subject: ({ className, children }: NotificationItemSubjectProps) => react_jsx_runtime.JSX.Element | null;
33
+ Body: ({ className, children }: NotificationItemBodyProps) => react_jsx_runtime.JSX.Element;
34
+ DefaultActions: () => react_jsx_runtime.JSX.Element;
35
+ CustomActions: () => react_jsx_runtime.JSX.Element;
36
+ Date: ({ className, children }: NotificationItemDateProps) => react_jsx_runtime.JSX.Element;
37
+ Dot: ({ className }: NotificationItemDotProps) => react_jsx_runtime.JSX.Element;
38
+ };
39
+
40
+ export { NotificationItem, type NotificationItemProps };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/notification-item/context.tsx
21
+ var context_exports = {};
22
+ __export(context_exports, {
23
+ NotificationHandlersProvider: () => NotificationHandlersProvider,
24
+ NotificationItemProvider: () => NotificationItemProvider,
25
+ useInheritedNotificationHandlers: () => useInheritedNotificationHandlers,
26
+ useNotificationItem: () => useNotificationItem
27
+ });
28
+ module.exports = __toCommonJS(context_exports);
29
+ var import_react = require("react");
30
+ var NotificationItemContext = (0, import_react.createContext)(void 0);
31
+ var NotificationItemProvider = NotificationItemContext.Provider;
32
+ var useNotificationItem = (part) => {
33
+ const context = (0, import_react.useContext)(NotificationItemContext);
34
+ if (!context) {
35
+ throw new Error(`<NotificationItem.${part} /> must be rendered inside <NotificationItem />`);
36
+ }
37
+ return context;
38
+ };
39
+ var NotificationHandlersContext = (0, import_react.createContext)({});
40
+ var NotificationHandlersProvider = NotificationHandlersContext.Provider;
41
+ var useInheritedNotificationHandlers = () => (0, import_react.useContext)(NotificationHandlersContext);
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ NotificationHandlersProvider,
45
+ NotificationItemProvider,
46
+ useInheritedNotificationHandlers,
47
+ useNotificationItem
48
+ });
49
+ //# sourceMappingURL=context.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/notification-item/context.tsx"],"sourcesContent":["import type { Notification } from '@novu/js';\nimport type { NotificationItemHandlers } from '@novu/js/ui-core';\nimport { createContext, type ReactNode, useContext } from 'react';\n\nexport type NotificationItemRenderers = {\n renderAvatar?: (notification: Notification) => ReactNode;\n renderSubject?: (notification: Notification) => ReactNode;\n renderBody?: (notification: Notification) => ReactNode;\n renderDefaultActions?: (notification: Notification) => ReactNode;\n renderCustomActions?: (notification: Notification) => ReactNode;\n};\n\nexport type NotificationItemContextValue = {\n notification: Notification;\n handlers: NotificationItemHandlers;\n renderers: NotificationItemRenderers;\n};\n\nconst NotificationItemContext = createContext<NotificationItemContextValue | undefined>(undefined);\n\nexport const NotificationItemProvider = NotificationItemContext.Provider;\n\nexport const useNotificationItem = (part: string): NotificationItemContextValue => {\n const context = useContext(NotificationItemContext);\n if (!context) {\n throw new Error(`<NotificationItem.${part} /> must be rendered inside <NotificationItem />`);\n }\n\n return context;\n};\n\n/**\n * The handlers given to `Inbox`, `Notifications` or `InboxContent`. Items rendered from their `renderNotification`\n * fall back to these when they get no handlers of their own.\n */\nconst NotificationHandlersContext = createContext<NotificationItemHandlers>({});\n\nexport const NotificationHandlersProvider = NotificationHandlersContext.Provider;\n\nexport const useInheritedNotificationHandlers = () => useContext(NotificationHandlersContext);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA0D;AAgB1D,IAAM,8BAA0B,4BAAwD,MAAS;AAE1F,IAAM,2BAA2B,wBAAwB;AAEzD,IAAM,sBAAsB,CAAC,SAA+C;AACjF,QAAM,cAAU,yBAAW,uBAAuB;AAClD,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qBAAqB,IAAI,kDAAkD;AAAA,EAC7F;AAEA,SAAO;AACT;AAMA,IAAM,kCAA8B,4BAAwC,CAAC,CAAC;AAEvE,IAAM,+BAA+B,4BAA4B;AAEjE,IAAM,mCAAmC,UAAM,yBAAW,2BAA2B;","names":[]}
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { Notification } from '@novu/js';
4
+ import { NotificationItemHandlers } from '@novu/js/ui-core';
5
+
6
+ type NotificationItemRenderers = {
7
+ renderAvatar?: (notification: Notification) => ReactNode;
8
+ renderSubject?: (notification: Notification) => ReactNode;
9
+ renderBody?: (notification: Notification) => ReactNode;
10
+ renderDefaultActions?: (notification: Notification) => ReactNode;
11
+ renderCustomActions?: (notification: Notification) => ReactNode;
12
+ };
13
+ type NotificationItemContextValue = {
14
+ notification: Notification;
15
+ handlers: NotificationItemHandlers;
16
+ renderers: NotificationItemRenderers;
17
+ };
18
+ declare const NotificationItemProvider: React.Provider<NotificationItemContextValue | undefined>;
19
+ declare const useNotificationItem: (part: string) => NotificationItemContextValue;
20
+ declare const NotificationHandlersProvider: React.Provider<NotificationItemHandlers>;
21
+ declare const useInheritedNotificationHandlers: () => NotificationItemHandlers;
22
+
23
+ export { NotificationHandlersProvider, type NotificationItemContextValue, NotificationItemProvider, type NotificationItemRenderers, useInheritedNotificationHandlers, useNotificationItem };
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/notification-item/parts/Actions.tsx
21
+ var Actions_exports = {};
22
+ __export(Actions_exports, {
23
+ CustomActions: () => CustomActions,
24
+ DefaultActions: () => DefaultActions
25
+ });
26
+ module.exports = __toCommonJS(Actions_exports);
27
+ var import_react = require("react");
28
+ var import_Mounter = require("../../Mounter.cjs");
29
+ var import_context = require("../context.cjs");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ var DefaultActions = () => {
32
+ const { notification, renderers } = (0, import_context.useNotificationItem)("DefaultActions");
33
+ const mountProps = (0, import_react.useMemo)(() => ({ notification }), [notification]);
34
+ if (renderers.renderDefaultActions) {
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: renderers.renderDefaultActions(notification) });
36
+ }
37
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Mounter.Mounter, { name: "NotificationDefaultActions", props: mountProps, bare: true });
38
+ };
39
+ var CustomActions = () => {
40
+ const { notification, handlers, renderers } = (0, import_context.useNotificationItem)("CustomActions");
41
+ const { onPrimaryActionClick, onSecondaryActionClick } = handlers;
42
+ const mountProps = (0, import_react.useMemo)(
43
+ () => ({ notification, onPrimaryActionClick, onSecondaryActionClick }),
44
+ [notification, onPrimaryActionClick, onSecondaryActionClick]
45
+ );
46
+ if (renderers.renderCustomActions) {
47
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: renderers.renderCustomActions(notification) });
48
+ }
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Mounter.Mounter, { name: "NotificationCustomActions", props: mountProps, bare: true });
50
+ };
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ CustomActions,
54
+ DefaultActions
55
+ });
56
+ //# sourceMappingURL=Actions.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/notification-item/parts/Actions.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Mounter } from '../../Mounter';\nimport { useNotificationItem } from '../context';\n\n/**\n * The read, archive and snooze controls. An island: the engine renders it into this block, so the dropdowns,\n * tooltips and pickers exist once. Clicks inside it never reach the item's own click handler.\n */\nexport const DefaultActions = () => {\n const { notification, renderers } = useNotificationItem('DefaultActions');\n const mountProps = useMemo(() => ({ notification }), [notification]);\n\n if (renderers.renderDefaultActions) {\n return <>{renderers.renderDefaultActions(notification)}</>;\n }\n\n return <Mounter name=\"NotificationDefaultActions\" props={mountProps} bare />;\n};\n\n/** The primary and secondary action buttons. An island, like the default actions. */\nexport const CustomActions = () => {\n const { notification, handlers, renderers } = useNotificationItem('CustomActions');\n const { onPrimaryActionClick, onSecondaryActionClick } = handlers;\n const mountProps = useMemo(\n () => ({ notification, onPrimaryActionClick, onSecondaryActionClick }),\n [notification, onPrimaryActionClick, onSecondaryActionClick]\n );\n\n if (renderers.renderCustomActions) {\n return <>{renderers.renderCustomActions(notification)}</>;\n }\n\n return <Mounter name=\"NotificationCustomActions\" props={mountProps} bare />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,qBAAwB;AACxB,qBAAoC;AAWzB;AALJ,IAAM,iBAAiB,MAAM;AAClC,QAAM,EAAE,cAAc,UAAU,QAAI,oCAAoB,gBAAgB;AACxE,QAAM,iBAAa,sBAAQ,OAAO,EAAE,aAAa,IAAI,CAAC,YAAY,CAAC;AAEnE,MAAI,UAAU,sBAAsB;AAClC,WAAO,2EAAG,oBAAU,qBAAqB,YAAY,GAAE;AAAA,EACzD;AAEA,SAAO,4CAAC,0BAAQ,MAAK,8BAA6B,OAAO,YAAY,MAAI,MAAC;AAC5E;AAGO,IAAM,gBAAgB,MAAM;AACjC,QAAM,EAAE,cAAc,UAAU,UAAU,QAAI,oCAAoB,eAAe;AACjF,QAAM,EAAE,sBAAsB,uBAAuB,IAAI;AACzD,QAAM,iBAAa;AAAA,IACjB,OAAO,EAAE,cAAc,sBAAsB,uBAAuB;AAAA,IACpE,CAAC,cAAc,sBAAsB,sBAAsB;AAAA,EAC7D;AAEA,MAAI,UAAU,qBAAqB;AACjC,WAAO,2EAAG,oBAAU,oBAAoB,YAAY,GAAE;AAAA,EACxD;AAEA,SAAO,4CAAC,0BAAQ,MAAK,6BAA4B,OAAO,YAAY,MAAI,MAAC;AAC3E;","names":[]}
@@ -0,0 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ /**
4
+ * The read, archive and snooze controls. An island: the engine renders it into this block, so the dropdowns,
5
+ * tooltips and pickers exist once. Clicks inside it never reach the item's own click handler.
6
+ */
7
+ declare const DefaultActions: () => react_jsx_runtime.JSX.Element;
8
+ /** The primary and secondary action buttons. An island, like the default actions. */
9
+ declare const CustomActions: () => react_jsx_runtime.JSX.Element;
10
+
11
+ export { CustomActions, DefaultActions };