@novu/react 3.19.2 → 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 +10 -4
  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
@@ -0,0 +1,65 @@
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/Avatar.tsx
21
+ var Avatar_exports = {};
22
+ __export(Avatar_exports, {
23
+ Avatar: () => Avatar
24
+ });
25
+ module.exports = __toCommonJS(Avatar_exports);
26
+ var import_ui_core = require("@novu/js/ui-core");
27
+ var import_useEngineStores = require("../../../hooks/internal/useEngineStores.cjs");
28
+ var import_context = require("../context.cjs");
29
+ var import_jsx_runtime = require("react/jsx-runtime");
30
+ var Avatar = ({ className }) => {
31
+ const { notification, renderers } = (0, import_context.useNotificationItem)("Avatar");
32
+ const style = (0, import_useEngineStores.useStyle)();
33
+ if (renderers.renderAvatar) {
34
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: renderers.renderAvatar(notification) });
35
+ }
36
+ if (!notification.avatar) {
37
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
38
+ "div",
39
+ {
40
+ className: style({
41
+ key: import_ui_core.notificationItemStyles.avatarFallback.key,
42
+ className: [import_ui_core.notificationItemStyles.avatarFallback.className, className].filter(Boolean).join(" "),
43
+ context: { notification }
44
+ })
45
+ }
46
+ );
47
+ }
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
+ "img",
50
+ {
51
+ alt: "",
52
+ className: style({
53
+ key: import_ui_core.notificationItemStyles.avatar.key,
54
+ className: [import_ui_core.notificationItemStyles.avatar.className, className].filter(Boolean).join(" "),
55
+ context: { notification }
56
+ }),
57
+ src: notification.avatar
58
+ }
59
+ );
60
+ };
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ Avatar
64
+ });
65
+ //# sourceMappingURL=Avatar.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/notification-item/parts/Avatar.tsx"],"sourcesContent":["import { notificationItemStyles } from '@novu/js/ui-core';\nimport React from 'react';\nimport { useStyle } from '../../../hooks/internal/useEngineStores';\nimport { useNotificationItem } from '../context';\n\nexport type NotificationItemAvatarProps = { className?: string };\n\nexport const Avatar = ({ className }: NotificationItemAvatarProps) => {\n const { notification, renderers } = useNotificationItem('Avatar');\n const style = useStyle();\n\n if (renderers.renderAvatar) {\n return <>{renderers.renderAvatar(notification)}</>;\n }\n\n if (!notification.avatar) {\n return (\n <div\n className={style({\n key: notificationItemStyles.avatarFallback.key,\n className: [notificationItemStyles.avatarFallback.className, className].filter(Boolean).join(' '),\n context: { notification },\n })}\n />\n );\n }\n\n return (\n <img\n alt=\"\"\n className={style({\n key: notificationItemStyles.avatar.key,\n className: [notificationItemStyles.avatar.className, className].filter(Boolean).join(' '),\n context: { notification },\n })}\n src={notification.avatar}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuC;AAEvC,6BAAyB;AACzB,qBAAoC;AASzB;AALJ,IAAM,SAAS,CAAC,EAAE,UAAU,MAAmC;AACpE,QAAM,EAAE,cAAc,UAAU,QAAI,oCAAoB,QAAQ;AAChE,QAAM,YAAQ,iCAAS;AAEvB,MAAI,UAAU,cAAc;AAC1B,WAAO,2EAAG,oBAAU,aAAa,YAAY,GAAE;AAAA,EACjD;AAEA,MAAI,CAAC,aAAa,QAAQ;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,MAAM;AAAA,UACf,KAAK,sCAAuB,eAAe;AAAA,UAC3C,WAAW,CAAC,sCAAuB,eAAe,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,UAChG,SAAS,EAAE,aAAa;AAAA,QAC1B,CAAC;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAI;AAAA,MACJ,WAAW,MAAM;AAAA,QACf,KAAK,sCAAuB,OAAO;AAAA,QACnC,WAAW,CAAC,sCAAuB,OAAO,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,QACxF,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA,MACD,KAAK,aAAa;AAAA;AAAA,EACpB;AAEJ;","names":[]}
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ type NotificationItemAvatarProps = {
4
+ className?: string;
5
+ };
6
+ declare const Avatar: ({ className }: NotificationItemAvatarProps) => react_jsx_runtime.JSX.Element;
7
+
8
+ export { Avatar, type NotificationItemAvatarProps };
@@ -0,0 +1,66 @@
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/Content.tsx
21
+ var Content_exports = {};
22
+ __export(Content_exports, {
23
+ Content: () => Content,
24
+ Text: () => Text
25
+ });
26
+ module.exports = __toCommonJS(Content_exports);
27
+ var import_ui_core = require("@novu/js/ui-core");
28
+ var import_useEngineStores = require("../../../hooks/internal/useEngineStores.cjs");
29
+ var import_context = require("../context.cjs");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ var Content = ({ className, children }) => {
32
+ const { notification } = (0, import_context.useNotificationItem)("Content");
33
+ const style = (0, import_useEngineStores.useStyle)();
34
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
35
+ "div",
36
+ {
37
+ className: style({
38
+ key: import_ui_core.notificationItemStyles.content.key,
39
+ className: [import_ui_core.notificationItemStyles.content.className, className].filter(Boolean).join(" "),
40
+ context: { notification }
41
+ }),
42
+ children
43
+ }
44
+ );
45
+ };
46
+ var Text = ({ className, children }) => {
47
+ const { notification } = (0, import_context.useNotificationItem)("Text");
48
+ const style = (0, import_useEngineStores.useStyle)();
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
50
+ "div",
51
+ {
52
+ className: style({
53
+ key: import_ui_core.notificationItemStyles.textContainer.key,
54
+ className: [import_ui_core.notificationItemStyles.textContainer.className, className].filter(Boolean).join(" "),
55
+ context: { notification }
56
+ }),
57
+ children
58
+ }
59
+ );
60
+ };
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ Content,
64
+ Text
65
+ });
66
+ //# sourceMappingURL=Content.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/notification-item/parts/Content.tsx"],"sourcesContent":["import { notificationItemStyles } from '@novu/js/ui-core';\nimport React, { type ReactNode } from 'react';\nimport { useStyle } from '../../../hooks/internal/useEngineStores';\nimport { useNotificationItem } from '../context';\n\nexport type NotificationItemContentProps = { className?: string; children?: ReactNode };\n\n/** The column next to the avatar that holds the text, the actions and the date. */\nexport const Content = ({ className, children }: NotificationItemContentProps) => {\n const { notification } = useNotificationItem('Content');\n const style = useStyle();\n\n return (\n <div\n className={style({\n key: notificationItemStyles.content.key,\n className: [notificationItemStyles.content.className, className].filter(Boolean).join(' '),\n context: { notification },\n })}\n >\n {children}\n </div>\n );\n};\n\nexport type NotificationItemTextProps = { className?: string; children?: ReactNode };\n\n/** Groups the subject and the body. */\nexport const Text = ({ className, children }: NotificationItemTextProps) => {\n const { notification } = useNotificationItem('Text');\n const style = useStyle();\n\n return (\n <div\n className={style({\n key: notificationItemStyles.textContainer.key,\n className: [notificationItemStyles.textContainer.className, className].filter(Boolean).join(' '),\n context: { notification },\n })}\n >\n {children}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuC;AAEvC,6BAAyB;AACzB,qBAAoC;AAUhC;AALG,IAAM,UAAU,CAAC,EAAE,WAAW,SAAS,MAAoC;AAChF,QAAM,EAAE,aAAa,QAAI,oCAAoB,SAAS;AACtD,QAAM,YAAQ,iCAAS;AAEvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM;AAAA,QACf,KAAK,sCAAuB,QAAQ;AAAA,QACpC,WAAW,CAAC,sCAAuB,QAAQ,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,QACzF,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA,MAEA;AAAA;AAAA,EACH;AAEJ;AAKO,IAAM,OAAO,CAAC,EAAE,WAAW,SAAS,MAAiC;AAC1E,QAAM,EAAE,aAAa,QAAI,oCAAoB,MAAM;AACnD,QAAM,YAAQ,iCAAS;AAEvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM;AAAA,QACf,KAAK,sCAAuB,cAAc;AAAA,QAC1C,WAAW,CAAC,sCAAuB,cAAc,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,QAC/F,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA,MAEA;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -0,0 +1,17 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ type NotificationItemContentProps = {
5
+ className?: string;
6
+ children?: ReactNode;
7
+ };
8
+ /** The column next to the avatar that holds the text, the actions and the date. */
9
+ declare const Content: ({ className, children }: NotificationItemContentProps) => react_jsx_runtime.JSX.Element;
10
+ type NotificationItemTextProps = {
11
+ className?: string;
12
+ children?: ReactNode;
13
+ };
14
+ /** Groups the subject and the body. */
15
+ declare const Text: ({ className, children }: NotificationItemTextProps) => react_jsx_runtime.JSX.Element;
16
+
17
+ export { Content, type NotificationItemContentProps, type NotificationItemTextProps, Text };
@@ -0,0 +1,114 @@
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/Date.tsx
21
+ var Date_exports = {};
22
+ __export(Date_exports, {
23
+ Date: () => Date
24
+ });
25
+ module.exports = __toCommonJS(Date_exports);
26
+ var import_ui_core = require("@novu/js/ui-core");
27
+ var import_react = require("react");
28
+ var import_NovuUIContext = require("../../../context/NovuUIContext.cjs");
29
+ var import_useEngineStores = require("../../../hooks/internal/useEngineStores.cjs");
30
+ var import_ClockIcon = require("../ClockIcon.cjs");
31
+ var import_context = require("../context.cjs");
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ var MINUTE = 60 * 1e3;
34
+ var useMinuteTick = () => {
35
+ const [, setMinutesPassed] = (0, import_react.useState)(0);
36
+ (0, import_react.useEffect)(() => {
37
+ const interval = setInterval(() => setMinutesPassed((prev) => prev + 1), MINUTE);
38
+ return () => clearInterval(interval);
39
+ }, []);
40
+ };
41
+ var Clock = ({ styleKey }) => {
42
+ const { notification } = (0, import_context.useNotificationItem)("Date");
43
+ const { icons } = (0, import_NovuUIContext.useNovuUI)();
44
+ const style = (0, import_useEngineStores.useStyle)();
45
+ const className = style({
46
+ key: import_ui_core.notificationItemStyles[styleKey].key,
47
+ className: import_ui_core.notificationItemStyles[styleKey].className,
48
+ iconKey: "clock",
49
+ context: { notification }
50
+ });
51
+ if (icons.clock) {
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: icons.clock({ class: className }) });
53
+ }
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ClockIcon.ClockIcon, { className });
55
+ };
56
+ var Date = ({ className, children }) => {
57
+ const { notification } = (0, import_context.useNotificationItem)("Date");
58
+ const style = (0, import_useEngineStores.useStyle)();
59
+ const { t, locale } = (0, import_useEngineStores.useLocalization)();
60
+ useMinuteTick();
61
+ const createdAt = (0, import_ui_core.formatToRelativeTime)({ fromDate: new globalThis.Date(notification.createdAt), locale });
62
+ const snoozedUntil = notification.snoozedUntil ? (0, import_ui_core.formatSnoozedUntil)({ untilDate: new globalThis.Date(notification.snoozedUntil), locale }) : null;
63
+ const deliveredAt = Array.isArray(notification.deliveredAt) ? notification.deliveredAt.map((date) => (0, import_ui_core.formatToRelativeTime)({ fromDate: new globalThis.Date(date), locale })) : null;
64
+ let content = createdAt;
65
+ if (children !== void 0) {
66
+ content = children;
67
+ } else if (snoozedUntil) {
68
+ content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Clock, { styleKey: "snoozedUntilIcon" }),
70
+ t("notification.snoozedUntil"),
71
+ " \xB7 ",
72
+ snoozedUntil
73
+ ] });
74
+ } else if (deliveredAt && deliveredAt.length >= 2) {
75
+ const [previous, latest] = deliveredAt.slice(-2);
76
+ content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
77
+ " ",
78
+ previous,
79
+ " \xB7",
80
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
81
+ "span",
82
+ {
83
+ "data-variant": "secondary",
84
+ "data-size": "default",
85
+ className: style({
86
+ key: import_ui_core.notificationItemStyles.deliveredAtBadge.key,
87
+ className: [import_ui_core.badgeStyles.base, import_ui_core.badgeStyles.variants.secondary, import_ui_core.badgeStyles.sizes.default].join(" "),
88
+ context: { notification }
89
+ }),
90
+ children: [
91
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Clock, { styleKey: "deliveredAtIcon" }),
92
+ latest
93
+ ]
94
+ }
95
+ )
96
+ ] });
97
+ }
98
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
99
+ "div",
100
+ {
101
+ className: style({
102
+ key: import_ui_core.notificationItemStyles.date.key,
103
+ className: [import_ui_core.notificationItemStyles.date.className, className].filter(Boolean).join(" "),
104
+ context: { notification }
105
+ }),
106
+ children: content
107
+ }
108
+ );
109
+ };
110
+ // Annotate the CommonJS export names for ESM import in node:
111
+ 0 && (module.exports = {
112
+ Date
113
+ });
114
+ //# sourceMappingURL=Date.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/notification-item/parts/Date.tsx"],"sourcesContent":["import { badgeStyles, formatSnoozedUntil, formatToRelativeTime, notificationItemStyles } from '@novu/js/ui-core';\nimport React, { type ReactNode, useEffect, useMemo, useState } from 'react';\nimport { useNovuUI } from '../../../context/NovuUIContext';\nimport { useLocalization, useStyle } from '../../../hooks/internal/useEngineStores';\nimport { ClockIcon } from '../ClockIcon';\nimport { useNotificationItem } from '../context';\n\nexport type NotificationItemDateProps = { className?: string; children?: ReactNode };\n\nconst MINUTE = 60 * 1000;\n\nconst useMinuteTick = () => {\n const [, setMinutesPassed] = useState(0);\n\n useEffect(() => {\n const interval = setInterval(() => setMinutesPassed((prev) => prev + 1), MINUTE);\n\n return () => clearInterval(interval);\n }, []);\n};\n\nconst Clock = ({ styleKey }: { styleKey: 'deliveredAtIcon' | 'snoozedUntilIcon' }) => {\n const { notification } = useNotificationItem('Date');\n const { icons } = useNovuUI();\n const style = useStyle();\n const className = style({\n key: notificationItemStyles[styleKey].key,\n className: notificationItemStyles[styleKey].className,\n iconKey: 'clock',\n context: { notification },\n });\n\n if (icons.clock) {\n return <>{icons.clock({ class: className })}</>;\n }\n\n return <ClockIcon className={className} />;\n};\n\n/** When the notification arrived, when it was delivered again, or until when it is snoozed. */\nexport const Date = ({ className, children }: NotificationItemDateProps) => {\n const { notification } = useNotificationItem('Date');\n const style = useStyle();\n const { t, locale } = useLocalization();\n useMinuteTick();\n\n const createdAt = formatToRelativeTime({ fromDate: new globalThis.Date(notification.createdAt), locale });\n const snoozedUntil = notification.snoozedUntil\n ? formatSnoozedUntil({ untilDate: new globalThis.Date(notification.snoozedUntil), locale })\n : null;\n const deliveredAt = Array.isArray(notification.deliveredAt)\n ? notification.deliveredAt.map((date) => formatToRelativeTime({ fromDate: new globalThis.Date(date), locale }))\n : null;\n\n let content: ReactNode = createdAt;\n if (children !== undefined) {\n content = children;\n } else if (snoozedUntil) {\n content = (\n <>\n <Clock styleKey=\"snoozedUntilIcon\" />\n {t('notification.snoozedUntil')} · {snoozedUntil}\n </>\n );\n } else if (deliveredAt && deliveredAt.length >= 2) {\n const [previous, latest] = deliveredAt.slice(-2);\n content = (\n <>\n {' '}\n {previous} ·\n <span\n data-variant=\"secondary\"\n data-size=\"default\"\n className={style({\n key: notificationItemStyles.deliveredAtBadge.key,\n className: [badgeStyles.base, badgeStyles.variants.secondary, badgeStyles.sizes.default].join(' '),\n context: { notification },\n })}\n >\n <Clock styleKey=\"deliveredAtIcon\" />\n {latest}\n </span>\n </>\n );\n }\n\n return (\n <div\n className={style({\n key: notificationItemStyles.date.key,\n className: [notificationItemStyles.date.className, className].filter(Boolean).join(' '),\n context: { notification },\n })}\n >\n {content}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA8F;AAC9F,mBAAoE;AACpE,2BAA0B;AAC1B,6BAA0C;AAC1C,uBAA0B;AAC1B,qBAAoC;AA4BzB;AAxBX,IAAM,SAAS,KAAK;AAEpB,IAAM,gBAAgB,MAAM;AAC1B,QAAM,CAAC,EAAE,gBAAgB,QAAI,uBAAS,CAAC;AAEvC,8BAAU,MAAM;AACd,UAAM,WAAW,YAAY,MAAM,iBAAiB,CAAC,SAAS,OAAO,CAAC,GAAG,MAAM;AAE/E,WAAO,MAAM,cAAc,QAAQ;AAAA,EACrC,GAAG,CAAC,CAAC;AACP;AAEA,IAAM,QAAQ,CAAC,EAAE,SAAS,MAA4D;AACpF,QAAM,EAAE,aAAa,QAAI,oCAAoB,MAAM;AACnD,QAAM,EAAE,MAAM,QAAI,gCAAU;AAC5B,QAAM,YAAQ,iCAAS;AACvB,QAAM,YAAY,MAAM;AAAA,IACtB,KAAK,sCAAuB,QAAQ,EAAE;AAAA,IACtC,WAAW,sCAAuB,QAAQ,EAAE;AAAA,IAC5C,SAAS;AAAA,IACT,SAAS,EAAE,aAAa;AAAA,EAC1B,CAAC;AAED,MAAI,MAAM,OAAO;AACf,WAAO,2EAAG,gBAAM,MAAM,EAAE,OAAO,UAAU,CAAC,GAAE;AAAA,EAC9C;AAEA,SAAO,4CAAC,8BAAU,WAAsB;AAC1C;AAGO,IAAM,OAAO,CAAC,EAAE,WAAW,SAAS,MAAiC;AAC1E,QAAM,EAAE,aAAa,QAAI,oCAAoB,MAAM;AACnD,QAAM,YAAQ,iCAAS;AACvB,QAAM,EAAE,GAAG,OAAO,QAAI,wCAAgB;AACtC,gBAAc;AAEd,QAAM,gBAAY,qCAAqB,EAAE,UAAU,IAAI,WAAW,KAAK,aAAa,SAAS,GAAG,OAAO,CAAC;AACxG,QAAM,eAAe,aAAa,mBAC9B,mCAAmB,EAAE,WAAW,IAAI,WAAW,KAAK,aAAa,YAAY,GAAG,OAAO,CAAC,IACxF;AACJ,QAAM,cAAc,MAAM,QAAQ,aAAa,WAAW,IACtD,aAAa,YAAY,IAAI,CAAC,aAAS,qCAAqB,EAAE,UAAU,IAAI,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,CAAC,IAC5G;AAEJ,MAAI,UAAqB;AACzB,MAAI,aAAa,QAAW;AAC1B,cAAU;AAAA,EACZ,WAAW,cAAc;AACvB,cACE,4EACE;AAAA,kDAAC,SAAM,UAAS,oBAAmB;AAAA,MAClC,EAAE,2BAA2B;AAAA,MAAE;AAAA,MAAI;AAAA,OACtC;AAAA,EAEJ,WAAW,eAAe,YAAY,UAAU,GAAG;AACjD,UAAM,CAAC,UAAU,MAAM,IAAI,YAAY,MAAM,EAAE;AAC/C,cACE,4EACG;AAAA;AAAA,MACA;AAAA,MAAS;AAAA,MACV;AAAA,QAAC;AAAA;AAAA,UACC,gBAAa;AAAA,UACb,aAAU;AAAA,UACV,WAAW,MAAM;AAAA,YACf,KAAK,sCAAuB,iBAAiB;AAAA,YAC7C,WAAW,CAAC,2BAAY,MAAM,2BAAY,SAAS,WAAW,2BAAY,MAAM,OAAO,EAAE,KAAK,GAAG;AAAA,YACjG,SAAS,EAAE,aAAa;AAAA,UAC1B,CAAC;AAAA,UAED;AAAA,wDAAC,SAAM,UAAS,mBAAkB;AAAA,YACjC;AAAA;AAAA;AAAA,MACH;AAAA,OACF;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM;AAAA,QACf,KAAK,sCAAuB,KAAK;AAAA,QACjC,WAAW,CAAC,sCAAuB,KAAK,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,QACtF,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA,MAEA;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -0,0 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ type NotificationItemDateProps = {
5
+ className?: string;
6
+ children?: ReactNode;
7
+ };
8
+ /** When the notification arrived, when it was delivered again, or until when it is snoozed. */
9
+ declare const Date: ({ className, children }: NotificationItemDateProps) => react_jsx_runtime.JSX.Element;
10
+
11
+ export { Date, type NotificationItemDateProps };
@@ -0,0 +1,48 @@
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/Dot.tsx
21
+ var Dot_exports = {};
22
+ __export(Dot_exports, {
23
+ Dot: () => Dot
24
+ });
25
+ module.exports = __toCommonJS(Dot_exports);
26
+ var import_ui_core = require("@novu/js/ui-core");
27
+ var import_useEngineStores = require("../../../hooks/internal/useEngineStores.cjs");
28
+ var import_context = require("../context.cjs");
29
+ var import_jsx_runtime = require("react/jsx-runtime");
30
+ var Dot = ({ className }) => {
31
+ const { notification } = (0, import_context.useNotificationItem)("Dot");
32
+ const style = (0, import_useEngineStores.useStyle)();
33
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_ui_core.notificationItemStyles.dotContainer.className, children: !notification.isRead && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
34
+ "span",
35
+ {
36
+ className: style({
37
+ key: import_ui_core.notificationItemStyles.dot.key,
38
+ className: [import_ui_core.notificationItemStyles.dot.className, className].filter(Boolean).join(" "),
39
+ context: { notification }
40
+ })
41
+ }
42
+ ) });
43
+ };
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ Dot
47
+ });
48
+ //# sourceMappingURL=Dot.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/notification-item/parts/Dot.tsx"],"sourcesContent":["import { notificationItemStyles } from '@novu/js/ui-core';\nimport React from 'react';\nimport { useStyle } from '../../../hooks/internal/useEngineStores';\nimport { useNotificationItem } from '../context';\n\nexport type NotificationItemDotProps = { className?: string };\n\n/** The unread marker on the right edge of the item. */\nexport const Dot = ({ className }: NotificationItemDotProps) => {\n const { notification } = useNotificationItem('Dot');\n const style = useStyle();\n\n return (\n <div className={notificationItemStyles.dotContainer.className}>\n {!notification.isRead && (\n <span\n className={style({\n key: notificationItemStyles.dot.key,\n className: [notificationItemStyles.dot.className, className].filter(Boolean).join(' '),\n context: { notification },\n })}\n />\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuC;AAEvC,6BAAyB;AACzB,qBAAoC;AAY5B;AAPD,IAAM,MAAM,CAAC,EAAE,UAAU,MAAgC;AAC9D,QAAM,EAAE,aAAa,QAAI,oCAAoB,KAAK;AAClD,QAAM,YAAQ,iCAAS;AAEvB,SACE,4CAAC,SAAI,WAAW,sCAAuB,aAAa,WACjD,WAAC,aAAa,UACb;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM;AAAA,QACf,KAAK,sCAAuB,IAAI;AAAA,QAChC,WAAW,CAAC,sCAAuB,IAAI,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,QACrF,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA;AAAA,EACH,GAEJ;AAEJ;","names":[]}
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ type NotificationItemDotProps = {
4
+ className?: string;
5
+ };
6
+ /** The unread marker on the right edge of the item. */
7
+ declare const Dot: ({ className }: NotificationItemDotProps) => react_jsx_runtime.JSX.Element;
8
+
9
+ export { Dot, type NotificationItemDotProps };
@@ -0,0 +1,92 @@
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/Subject.tsx
21
+ var Subject_exports = {};
22
+ __export(Subject_exports, {
23
+ Body: () => Body,
24
+ Subject: () => Subject
25
+ });
26
+ module.exports = __toCommonJS(Subject_exports);
27
+ var import_ui_core = require("@novu/js/ui-core");
28
+ var import_useEngineStores = require("../../../hooks/internal/useEngineStores.cjs");
29
+ var import_context = require("../context.cjs");
30
+ var import_Markdown = require("../Markdown.cjs");
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ var Subject = ({ className, children }) => {
33
+ const { notification, renderers } = (0, import_context.useNotificationItem)("Subject");
34
+ const style = (0, import_useEngineStores.useStyle)();
35
+ if (renderers.renderSubject) {
36
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: renderers.renderSubject(notification) });
37
+ }
38
+ if (children === void 0 && !notification.subject) {
39
+ return null;
40
+ }
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
42
+ "p",
43
+ {
44
+ className: style({
45
+ key: import_ui_core.notificationItemStyles.subject.key,
46
+ className: [import_ui_core.notificationItemStyles.subject.className, className].filter(Boolean).join(" "),
47
+ context: { notification }
48
+ }),
49
+ children: children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
50
+ import_Markdown.Markdown,
51
+ {
52
+ strongKey: import_ui_core.notificationItemStyles.subject.strongKey,
53
+ emKey: import_ui_core.notificationItemStyles.subject.emKey,
54
+ context: { notification },
55
+ children: notification.subject ?? ""
56
+ }
57
+ )
58
+ }
59
+ );
60
+ };
61
+ var Body = ({ className, children }) => {
62
+ const { notification, renderers } = (0, import_context.useNotificationItem)("Body");
63
+ const style = (0, import_useEngineStores.useStyle)();
64
+ if (renderers.renderBody) {
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: renderers.renderBody(notification) });
66
+ }
67
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
68
+ "p",
69
+ {
70
+ className: style({
71
+ key: import_ui_core.notificationItemStyles.body.key,
72
+ className: [import_ui_core.notificationItemStyles.body.className, className].filter(Boolean).join(" "),
73
+ context: { notification }
74
+ }),
75
+ children: children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ import_Markdown.Markdown,
77
+ {
78
+ strongKey: import_ui_core.notificationItemStyles.body.strongKey,
79
+ emKey: import_ui_core.notificationItemStyles.body.emKey,
80
+ context: { notification },
81
+ children: notification.body
82
+ }
83
+ )
84
+ }
85
+ );
86
+ };
87
+ // Annotate the CommonJS export names for ESM import in node:
88
+ 0 && (module.exports = {
89
+ Body,
90
+ Subject
91
+ });
92
+ //# sourceMappingURL=Subject.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/notification-item/parts/Subject.tsx"],"sourcesContent":["import { notificationItemStyles } from '@novu/js/ui-core';\nimport React, { type ReactNode } from 'react';\nimport { useStyle } from '../../../hooks/internal/useEngineStores';\nimport { useNotificationItem } from '../context';\nimport { Markdown } from '../Markdown';\n\nexport type NotificationItemSubjectProps = { className?: string; children?: ReactNode };\n\nexport const Subject = ({ className, children }: NotificationItemSubjectProps) => {\n const { notification, renderers } = useNotificationItem('Subject');\n const style = useStyle();\n\n if (renderers.renderSubject) {\n return <>{renderers.renderSubject(notification)}</>;\n }\n\n if (children === undefined && !notification.subject) {\n return null;\n }\n\n return (\n <p\n className={style({\n key: notificationItemStyles.subject.key,\n className: [notificationItemStyles.subject.className, className].filter(Boolean).join(' '),\n context: { notification },\n })}\n >\n {children ?? (\n <Markdown\n strongKey={notificationItemStyles.subject.strongKey}\n emKey={notificationItemStyles.subject.emKey}\n context={{ notification }}\n >\n {notification.subject ?? ''}\n </Markdown>\n )}\n </p>\n );\n};\n\nexport type NotificationItemBodyProps = { className?: string; children?: ReactNode };\n\nexport const Body = ({ className, children }: NotificationItemBodyProps) => {\n const { notification, renderers } = useNotificationItem('Body');\n const style = useStyle();\n\n if (renderers.renderBody) {\n return <>{renderers.renderBody(notification)}</>;\n }\n\n return (\n <p\n className={style({\n key: notificationItemStyles.body.key,\n className: [notificationItemStyles.body.className, className].filter(Boolean).join(' '),\n context: { notification },\n })}\n >\n {children ?? (\n <Markdown\n strongKey={notificationItemStyles.body.strongKey}\n emKey={notificationItemStyles.body.emKey}\n context={{ notification }}\n >\n {notification.body}\n </Markdown>\n )}\n </p>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuC;AAEvC,6BAAyB;AACzB,qBAAoC;AACpC,sBAAyB;AASd;AALJ,IAAM,UAAU,CAAC,EAAE,WAAW,SAAS,MAAoC;AAChF,QAAM,EAAE,cAAc,UAAU,QAAI,oCAAoB,SAAS;AACjE,QAAM,YAAQ,iCAAS;AAEvB,MAAI,UAAU,eAAe;AAC3B,WAAO,2EAAG,oBAAU,cAAc,YAAY,GAAE;AAAA,EAClD;AAEA,MAAI,aAAa,UAAa,CAAC,aAAa,SAAS;AACnD,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM;AAAA,QACf,KAAK,sCAAuB,QAAQ;AAAA,QACpC,WAAW,CAAC,sCAAuB,QAAQ,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,QACzF,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA,MAEA,sBACC;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,sCAAuB,QAAQ;AAAA,UAC1C,OAAO,sCAAuB,QAAQ;AAAA,UACtC,SAAS,EAAE,aAAa;AAAA,UAEvB,uBAAa,WAAW;AAAA;AAAA,MAC3B;AAAA;AAAA,EAEJ;AAEJ;AAIO,IAAM,OAAO,CAAC,EAAE,WAAW,SAAS,MAAiC;AAC1E,QAAM,EAAE,cAAc,UAAU,QAAI,oCAAoB,MAAM;AAC9D,QAAM,YAAQ,iCAAS;AAEvB,MAAI,UAAU,YAAY;AACxB,WAAO,2EAAG,oBAAU,WAAW,YAAY,GAAE;AAAA,EAC/C;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM;AAAA,QACf,KAAK,sCAAuB,KAAK;AAAA,QACjC,WAAW,CAAC,sCAAuB,KAAK,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,QACtF,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA,MAEA,sBACC;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,sCAAuB,KAAK;AAAA,UACvC,OAAO,sCAAuB,KAAK;AAAA,UACnC,SAAS,EAAE,aAAa;AAAA,UAEvB,uBAAa;AAAA;AAAA,MAChB;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ type NotificationItemSubjectProps = {
5
+ className?: string;
6
+ children?: ReactNode;
7
+ };
8
+ declare const Subject: ({ className, children }: NotificationItemSubjectProps) => react_jsx_runtime.JSX.Element | null;
9
+ type NotificationItemBodyProps = {
10
+ className?: string;
11
+ children?: ReactNode;
12
+ };
13
+ declare const Body: ({ className, children }: NotificationItemBodyProps) => react_jsx_runtime.JSX.Element;
14
+
15
+ export { Body, type NotificationItemBodyProps, type NotificationItemSubjectProps, Subject };
@@ -24,7 +24,6 @@ __export(DefaultSlackConnectButton_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(DefaultSlackConnectButton_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 DefaultSlackConnectButton = (props) => {
@@ -44,32 +43,24 @@ var DefaultSlackConnectButton = (props) => {
44
43
  connectLabel,
45
44
  connectedLabel
46
45
  } = props;
47
- const { novuUI } = (0, import_NovuUIContext.useNovuUI)();
48
- const mount = (0, import_react.useCallback)(
49
- (element) => {
50
- return novuUI.mountComponent({
51
- name: "SlackConnectButton",
52
- props: {
53
- integrationIdentifier,
54
- connectionIdentifier,
55
- subscriberId,
56
- context,
57
- contextHash,
58
- scope,
59
- connectionMode,
60
- autoLinkUser,
61
- onConnectSuccess,
62
- onConnectError,
63
- onDisconnectSuccess,
64
- onDisconnectError,
65
- connectLabel,
66
- connectedLabel
67
- },
68
- element
69
- });
70
- },
46
+ const mountProps = (0, import_react.useMemo)(
47
+ () => ({
48
+ integrationIdentifier,
49
+ connectionIdentifier,
50
+ subscriberId,
51
+ context,
52
+ contextHash,
53
+ scope,
54
+ connectionMode,
55
+ autoLinkUser,
56
+ onConnectSuccess,
57
+ onConnectError,
58
+ onDisconnectSuccess,
59
+ onDisconnectError,
60
+ connectLabel,
61
+ connectedLabel
62
+ }),
71
63
  [
72
- novuUI,
73
64
  integrationIdentifier,
74
65
  connectionIdentifier,
75
66
  subscriberId,
@@ -86,7 +77,7 @@ var DefaultSlackConnectButton = (props) => {
86
77
  connectedLabel
87
78
  ]
88
79
  );
89
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Mounter.Mounter, { mount });
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Mounter.Mounter, { name: "SlackConnectButton", props: mountProps });
90
81
  };
91
82
  // Annotate the CommonJS export names for ESM import in node:
92
83
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/slack-connect-button/DefaultSlackConnectButton.tsx"],"sourcesContent":["import { SlackConnectButtonProps } from '@novu/js/ui';\nimport { useCallback } from 'react';\nimport { useNovuUI } from '../../context/NovuUIContext';\nimport { Mounter } from '../Mounter';\n\nexport type DefaultSlackConnectButtonProps = Pick<\n SlackConnectButtonProps,\n | 'integrationIdentifier'\n | 'connectionIdentifier'\n | 'subscriberId'\n | 'context'\n | 'contextHash'\n | 'scope'\n | 'connectionMode'\n | 'autoLinkUser'\n | 'onConnectSuccess'\n | 'onConnectError'\n | 'onDisconnectSuccess'\n | 'onDisconnectError'\n | 'connectLabel'\n | 'connectedLabel'\n>;\n\nexport const DefaultSlackConnectButton = (props: DefaultSlackConnectButtonProps) => {\n const {\n integrationIdentifier,\n connectionIdentifier,\n subscriberId,\n context,\n contextHash,\n scope,\n connectionMode,\n autoLinkUser,\n onConnectSuccess,\n onConnectError,\n onDisconnectSuccess,\n onDisconnectError,\n connectLabel,\n connectedLabel,\n } = props;\n const { novuUI } = useNovuUI();\n\n const mount = useCallback(\n (element: HTMLElement) => {\n return novuUI.mountComponent({\n name: 'SlackConnectButton',\n props: {\n integrationIdentifier,\n connectionIdentifier,\n subscriberId,\n context,\n contextHash,\n scope,\n connectionMode,\n autoLinkUser,\n onConnectSuccess,\n onConnectError,\n onDisconnectSuccess,\n onDisconnectError,\n connectLabel,\n connectedLabel,\n },\n element,\n });\n },\n [\n novuUI,\n integrationIdentifier,\n connectionIdentifier,\n subscriberId,\n context,\n contextHash,\n scope,\n connectionMode,\n autoLinkUser,\n onConnectSuccess,\n onConnectError,\n onDisconnectSuccess,\n onDisconnectError,\n connectLabel,\n connectedLabel,\n ]\n );\n\n return <Mounter mount={mount} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA4B;AAC5B,2BAA0B;AAC1B,qBAAwB;AAiFf;AA7DF,IAAM,4BAA4B,CAAC,UAA0C;AAClF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;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,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,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,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/slack-connect-button/DefaultSlackConnectButton.tsx"],"sourcesContent":["import { SlackConnectButtonProps } from '@novu/js/ui';\nimport { useMemo } from 'react';\nimport { Mounter } from '../Mounter';\n\nexport type DefaultSlackConnectButtonProps = Pick<\n SlackConnectButtonProps,\n | 'integrationIdentifier'\n | 'connectionIdentifier'\n | 'subscriberId'\n | 'context'\n | 'contextHash'\n | 'scope'\n | 'connectionMode'\n | 'autoLinkUser'\n | 'onConnectSuccess'\n | 'onConnectError'\n | 'onDisconnectSuccess'\n | 'onDisconnectError'\n | 'connectLabel'\n | 'connectedLabel'\n>;\n\nexport const DefaultSlackConnectButton = (props: DefaultSlackConnectButtonProps) => {\n const {\n integrationIdentifier,\n connectionIdentifier,\n subscriberId,\n context,\n contextHash,\n scope,\n connectionMode,\n autoLinkUser,\n onConnectSuccess,\n onConnectError,\n onDisconnectSuccess,\n onDisconnectError,\n connectLabel,\n connectedLabel,\n } = props;\n\n const mountProps = useMemo(\n () => ({\n integrationIdentifier,\n connectionIdentifier,\n subscriberId,\n context,\n contextHash,\n scope,\n connectionMode,\n autoLinkUser,\n onConnectSuccess,\n onConnectError,\n onDisconnectSuccess,\n onDisconnectError,\n connectLabel,\n connectedLabel,\n }),\n [\n integrationIdentifier,\n connectionIdentifier,\n subscriberId,\n context,\n contextHash,\n scope,\n connectionMode,\n autoLinkUser,\n onConnectSuccess,\n onConnectError,\n onDisconnectSuccess,\n onDisconnectError,\n connectLabel,\n connectedLabel,\n ]\n );\n\n return <Mounter name=\"SlackConnectButton\" props={mountProps} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAwB;AACxB,qBAAwB;AAyEf;AArDF,IAAM,4BAA4B,CAAC,UAA0C;AAClF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;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,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,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO,4CAAC,0BAAQ,MAAK,sBAAqB,OAAO,YAAY;AAC/D;","names":[]}
@@ -36,10 +36,9 @@ module.exports = __toCommonJS(SlackConnectButton_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_DefaultSlackConnectButton = require("./DefaultSlackConnectButton.cjs");
41
40
  var import_jsx_runtime = require("react/jsx-runtime");
42
- var SlackConnectButtonInternal = (0, import_Renderer.withRenderer)((props) => {
41
+ var SlackConnectButtonInternal = (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 SlackConnectButtonInternal = (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_DefaultSlackConnectButton.DefaultSlackConnectButton, { ...defaultProps }) });
53
- });
52
+ };
54
53
  SlackConnectButtonInternal.displayName = "SlackConnectButtonInternal";
55
54
  var SlackConnectButton = import_react.default.memo((props) => {
56
55
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlackConnectButtonInternal, { ...props });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/slack-connect-button/SlackConnectButton.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { useNovu } from '../../hooks/NovuProvider';\nimport { NovuUI, NovuUIOptions } from '../NovuUI';\nimport { withRenderer } from '../Renderer';\nimport { DefaultSlackConnectButton, DefaultSlackConnectButtonProps } from './DefaultSlackConnectButton';\n\nexport type SlackConnectButtonProps = DefaultSlackConnectButtonProps & Pick<NovuUIOptions, 'container' | 'appearance'>;\n\nconst SlackConnectButtonInternal = withRenderer<SlackConnectButtonProps>((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 <DefaultSlackConnectButton {...defaultProps} />\n </NovuUI>\n );\n});\n\nSlackConnectButtonInternal.displayName = 'SlackConnectButtonInternal';\n\nexport const SlackConnectButton = React.memo((props: SlackConnectButtonProps) => {\n return <SlackConnectButtonInternal {...props} />;\n});\n\nSlackConnectButton.displayName = 'SlackConnectButton';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,0BAAwB;AACxB,oBAAsC;AACtC,sBAA6B;AAC7B,uCAA0E;AAkBpE;AAdN,IAAM,iCAA6B,8BAAsC,CAAC,UAAU;AAClF,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,8DAA2B,GAAG,cAAc,GAC/C;AAEJ,CAAC;AAED,2BAA2B,cAAc;AAElC,IAAM,qBAAqB,aAAAA,QAAM,KAAK,CAAC,UAAmC;AAC/E,SAAO,4CAAC,8BAA4B,GAAG,OAAO;AAChD,CAAC;AAED,mBAAmB,cAAc;","names":["React"]}
1
+ {"version":3,"sources":["../../../../src/components/slack-connect-button/SlackConnectButton.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { useNovu } from '../../hooks/NovuProvider';\nimport { NovuUI, NovuUIOptions } from '../NovuUI';\nimport { DefaultSlackConnectButton, DefaultSlackConnectButtonProps } from './DefaultSlackConnectButton';\n\nexport type SlackConnectButtonProps = DefaultSlackConnectButtonProps & Pick<NovuUIOptions, 'container' | 'appearance'>;\n\nconst SlackConnectButtonInternal = (props: SlackConnectButtonProps) => {\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 <DefaultSlackConnectButton {...defaultProps} />\n </NovuUI>\n );\n};\n\nSlackConnectButtonInternal.displayName = 'SlackConnectButtonInternal';\n\nexport const SlackConnectButton = React.memo((props: SlackConnectButtonProps) => {\n return <SlackConnectButtonInternal {...props} />;\n});\n\nSlackConnectButton.displayName = 'SlackConnectButton';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,0BAAwB;AACxB,oBAAsC;AACtC,uCAA0E;AAkBpE;AAdN,IAAM,6BAA6B,CAAC,UAAmC;AACrE,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,8DAA2B,GAAG,cAAc,GAC/C;AAEJ;AAEA,2BAA2B,cAAc;AAElC,IAAM,qBAAqB,aAAAA,QAAM,KAAK,CAAC,UAAmC;AAC/E,SAAO,4CAAC,8BAA4B,GAAG,OAAO;AAChD,CAAC;AAED,mBAAmB,cAAc;","names":["React"]}