@burdenoff/microfe-notification 2026.1029.1 → 2026.1109.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/AdminNotificationRoot.d.ts +33 -0
  2. package/dist/AdminNotificationRoot.js +9 -6
  3. package/dist/AdminNotificationRoot.js.map +1 -1
  4. package/dist/AdminNotificationRoutes.d.ts +1 -0
  5. package/dist/AdminNotificationRoutes.js +22 -23
  6. package/dist/AdminNotificationRoutes.js.map +1 -1
  7. package/dist/NotificationRoot.d.ts +29 -0
  8. package/dist/NotificationRoot.js +9 -6
  9. package/dist/NotificationRoot.js.map +1 -1
  10. package/dist/NotificationRoutes.d.ts +18 -0
  11. package/dist/NotificationRoutes.js +1 -2
  12. package/dist/NotificationRoutes.js.map +1 -1
  13. package/dist/UserNotificationRoot.d.ts +32 -0
  14. package/dist/UserNotificationRoot.js +9 -6
  15. package/dist/UserNotificationRoot.js.map +1 -1
  16. package/dist/UserNotificationRoutes.d.ts +16 -0
  17. package/dist/UserNotificationRoutes.js +9 -10
  18. package/dist/UserNotificationRoutes.js.map +1 -1
  19. package/dist/components/FeatureDisabledPage.d.ts +6 -0
  20. package/dist/components/FeatureDisabledPage.js +1 -2
  21. package/dist/components/FeatureDisabledPage.js.map +1 -1
  22. package/dist/components/NotificationBell.d.ts +13 -0
  23. package/dist/components/NotificationBell.js +6 -7
  24. package/dist/components/NotificationBell.js.map +1 -1
  25. package/dist/components/NotificationCard.d.ts +18 -0
  26. package/dist/components/NotificationCard.js +10 -11
  27. package/dist/components/NotificationCard.js.map +1 -1
  28. package/dist/components/NotificationPanel.d.ts +10 -0
  29. package/dist/components/NotificationPanel.js +5 -6
  30. package/dist/components/NotificationPanel.js.map +1 -1
  31. package/dist/components/RecipientSelector.d.ts +32 -0
  32. package/dist/components/RecipientSelector.js +2 -3
  33. package/dist/components/RecipientSelector.js.map +1 -1
  34. package/dist/components/TemplatePreview.d.ts +21 -0
  35. package/dist/components/TemplatePreview.js +3 -4
  36. package/dist/components/TemplatePreview.js.map +1 -1
  37. package/dist/components/VariableInserter.d.ts +11 -0
  38. package/dist/components/index.d.ts +3 -0
  39. package/dist/components/index.js +4 -3
  40. package/dist/constants/permissions.d.ts +23 -0
  41. package/dist/constants/permissions.js +1 -2
  42. package/dist/constants/permissions.js.map +1 -1
  43. package/dist/dev/main.d.ts +0 -0
  44. package/dist/generated/global-operations.d.ts +2119 -0
  45. package/dist/generated/global-operations.js +80 -69
  46. package/dist/generated/global-operations.js.map +1 -1
  47. package/dist/generated/global-types.d.ts +23507 -0
  48. package/dist/generated/wspace-operations.d.ts +4 -0
  49. package/dist/generated/wspace-types.d.ts +57831 -0
  50. package/dist/graphql/global-client.d.ts +32 -0
  51. package/dist/graphql/global-client.js +23 -30
  52. package/dist/graphql/global-client.js.map +1 -1
  53. package/dist/hooks/index.d.ts +7 -0
  54. package/dist/hooks/index.js +7 -6
  55. package/dist/hooks/useNotificationAdmin.d.ts +46 -0
  56. package/dist/hooks/useNotificationAdmin.js +18 -17
  57. package/dist/hooks/useNotificationAdmin.js.map +1 -1
  58. package/dist/hooks/useNotificationAnalytics.d.ts +65 -0
  59. package/dist/hooks/useNotificationAnalytics.js +1 -2
  60. package/dist/hooks/useNotificationAnalytics.js.map +1 -1
  61. package/dist/hooks/useNotificationPreferences.d.ts +10 -0
  62. package/dist/hooks/useNotificationPreferences.js +7 -7
  63. package/dist/hooks/useNotificationPreferences.js.map +1 -1
  64. package/dist/hooks/useNotificationTemplates.d.ts +131 -0
  65. package/dist/hooks/useNotificationTemplates.js +1 -2
  66. package/dist/hooks/useNotificationTemplates.js.map +1 -1
  67. package/dist/hooks/useNotificationTopics.d.ts +35 -0
  68. package/dist/hooks/useNotificationTopics.js +22 -22
  69. package/dist/hooks/useNotificationTopics.js.map +1 -1
  70. package/dist/hooks/useNotifications.d.ts +39 -0
  71. package/dist/hooks/useNotifications.js +6 -4
  72. package/dist/hooks/useNotifications.js.map +1 -1
  73. package/dist/hooks/useSendNotification.d.ts +158 -0
  74. package/dist/hooks/useSendNotification.js +12 -10
  75. package/dist/hooks/useSendNotification.js.map +1 -1
  76. package/dist/hooks/useUserSearch.d.ts +26 -0
  77. package/dist/hooks/useUserSearch.js +8 -10
  78. package/dist/hooks/useUserSearch.js.map +1 -1
  79. package/dist/index.d.ts +36 -0
  80. package/dist/index.js +8 -8
  81. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
  82. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
  83. package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
  84. package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
  85. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
  86. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
  87. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +9 -10
  88. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
  89. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
  90. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
  91. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
  92. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
  93. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
  94. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
  95. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
  96. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
  97. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
  98. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
  99. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
  100. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
  101. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
  102. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
  103. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
  104. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
  105. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
  106. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
  107. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
  108. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
  109. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
  110. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
  111. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
  112. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
  113. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
  114. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
  115. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
  116. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
  117. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
  118. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
  119. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
  120. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
  121. package/dist/node_modules/@apollo/client/version.js +2 -3
  122. package/dist/node_modules/@apollo/client/version.js.map +1 -1
  123. package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
  124. package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
  125. package/dist/node_modules/@wry/trie/lib/index.js +2 -3
  126. package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
  127. package/dist/node_modules/graphql-ws/dist/client.js +76 -69
  128. package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
  129. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
  130. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
  131. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
  132. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
  133. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
  134. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
  135. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
  136. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
  137. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
  138. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
  139. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
  140. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
  141. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
  142. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
  143. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
  144. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
  145. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
  146. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
  147. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
  148. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
  149. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
  150. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
  151. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
  152. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
  153. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
  154. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
  155. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
  156. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
  157. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
  158. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
  159. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
  160. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
  161. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
  162. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
  163. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
  164. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
  165. package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
  166. package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
  167. package/dist/pages/CreateNotificationPage.d.ts +5 -0
  168. package/dist/pages/CreateNotificationPage.js +18 -19
  169. package/dist/pages/CreateNotificationPage.js.map +1 -1
  170. package/dist/pages/NotificationCenterPage.d.ts +6 -0
  171. package/dist/pages/NotificationCenterPage.js +13 -14
  172. package/dist/pages/NotificationCenterPage.js.map +1 -1
  173. package/dist/pages/NotificationHistoryAdminPage.d.ts +2 -0
  174. package/dist/pages/NotificationHistoryAdminPage.js +7 -8
  175. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  176. package/dist/pages/NotificationHistoryPage.d.ts +2 -0
  177. package/dist/pages/NotificationHistoryPage.js +13 -14
  178. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  179. package/dist/pages/NotificationLandingPage.d.ts +10 -0
  180. package/dist/pages/NotificationLandingPage.js +5 -6
  181. package/dist/pages/NotificationLandingPage.js.map +1 -1
  182. package/dist/pages/NotificationPreferencesPage.d.ts +1 -0
  183. package/dist/pages/NotificationPreferencesPage.js +14 -15
  184. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  185. package/dist/pages/NotificationTemplatesPage.d.ts +7 -0
  186. package/dist/pages/NotificationTemplatesPage.js +25 -23
  187. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  188. package/dist/pages/NotificationTopicsPage.d.ts +1 -0
  189. package/dist/pages/NotificationTopicsPage.js +6 -7
  190. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  191. package/dist/pages/TemplateEditorPage.d.ts +12 -0
  192. package/dist/pages/TemplateEditorPage.js +294 -285
  193. package/dist/pages/TemplateEditorPage.js.map +1 -1
  194. package/dist/providers/NotificationProvider.d.ts +11 -0
  195. package/dist/providers/NotificationProvider.js +1 -2
  196. package/dist/providers/NotificationProvider.js.map +1 -1
  197. package/dist/shared/hooks/useTr.d.ts +13 -0
  198. package/dist/shared/hooks/useTr.js +1 -2
  199. package/dist/shared/hooks/useTr.js.map +1 -1
  200. package/dist/store/notificationStore.d.ts +30 -0
  201. package/dist/store/notificationStore.js +1 -2
  202. package/dist/store/notificationStore.js.map +1 -1
  203. package/dist/test/happydom.d.ts +1 -0
  204. package/dist/translations/en.d.ts +468 -0
  205. package/dist/types/index.d.ts +249 -0
  206. package/dist/utils/inAppNavigation.d.ts +37 -0
  207. package/dist/utils/inAppNavigation.js +2 -3
  208. package/dist/utils/inAppNavigation.js.map +1 -1
  209. package/dist/utils/index.d.ts +68 -0
  210. package/dist/utils/index.js +16 -10
  211. package/dist/utils/index.js.map +1 -1
  212. package/dist/utils/nativeBridge.d.ts +2 -0
  213. package/dist/utils/nativeBridge.js +1 -2
  214. package/dist/utils/notificationHistoryExport.d.ts +12 -0
  215. package/dist/utils/notificationHistoryExport.js +1 -2
  216. package/dist/utils/notificationHistoryExport.js.map +1 -1
  217. package/package.json +66 -48
  218. package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"UserNotificationRoot.js","names":[],"sources":["../src/UserNotificationRoot.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Bell, Archive, Settings2 } from 'lucide-react';\nimport { NotificationProvider } from './providers/NotificationProvider';\nimport type { NavItem, FooterItem, NotificationRootProps } from './types';\nimport { UserNotificationRoutes } from './UserNotificationRoutes';\n\n/**\n * User Root component for the Notification microfrontend.\n *\n * This is the entry point host product shells should import. It exposes only\n * the user-facing notification surfaces (Notification Center, History) and\n * sets up the required provider stack.\n *\n * For the full admin experience (templates, create/send notification) use\n * `AdminNotificationRoot` instead.\n *\n * @example\n * ```tsx\n * import { UserNotificationRoot, type NotificationRootProps } from '@burdenoff/micro-fe/notification';\n *\n * function App() {\n * const props: NotificationRootProps = {\n * basePath: '/notifications',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * onNotificationClick: (notification) => console.log('Clicked:', notification),\n * };\n *\n * return <UserNotificationRoot {...props} />;\n * }\n * ```\n */\nexport function UserNotificationRoot(props: NotificationRootProps) {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n // Component-level feature gate. `notification.history` is declared as\n // unreleased (defaultValue=false). We use `useFeatureFlagDetails` and\n // explicitly fall back to `false` when the flag is absent from the cache,\n // because the provider's global default-allow would otherwise return `true`\n // for unseeded flags — which would defeat the whole point of the unreleased\n // pattern.\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell (user-facing only)\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'user-notification-center',\n label: tr('notification.nav.center', 'Notification Center'),\n path: joinPath(basePath, 'center'),\n icon: <Bell size={20} />,\n order: 10,\n group: 'notifications',\n },\n ...(historyEnabled\n ? [\n {\n id: 'user-notification-history',\n label: tr('notification.nav.history', 'History'),\n path: joinPath(basePath, 'history'),\n icon: <Archive size={20} />,\n order: 20,\n group: 'notifications',\n },\n ]\n : []),\n {\n id: 'user-notification-preferences',\n label: tr('notification.nav.preferences', 'Preferences'),\n path: joinPath(basePath, 'preferences'),\n icon: <Settings2 size={20} />,\n order: 30,\n group: 'notifications',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerNavItems, basePath, historyEnabled, t]);\n\n // Register footer items (status indicator in left section)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems: FooterItem[] = [\n {\n id: 'user-notification-status',\n label: tr('notification.footer.ready', 'Notifications Ready'),\n type: 'status',\n order: 10,\n section: 'left',\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerFooterItems, t]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'notification.error.moduleLoad',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <NotificationProvider {...props}>\n <UserNotificationRoutes />\n </NotificationProvider>\n </ErrorBoundary>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,SAAgB,EAAqB,GAA8B;CACjE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAa,EAAE,EAAI;AACzB,SAAO,MAAe,IAAM,IAAW;IASnC,IAAiB,EAAsB,uBAAuB,EAC9D,IAAiB,IAAiB,EAAQ,EAAe,QAAS,IAGlE,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AAkEtD,QA7DA,QAAgB;AACT,QAqCL,QAHgB,EAhCY;GAC1B;IACE,IAAI;IACJ,OAAO,EAAG,2BAA2B,sBAAsB;IAC3D,MAAM,EAAS,GAAU,SAAS;IAClC,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;IACxB,OAAO;IACP,OAAO;IACR;GACD,GAAI,IACA,CACE;IACE,IAAI;IACJ,OAAO,EAAG,4BAA4B,UAAU;IAChD,MAAM,EAAS,GAAU,UAAU;IACnC,MAAM,kBAAC,GAAD,EAAS,MAAM,IAAM,CAAA;IAC3B,OAAO;IACP,OAAO;IACR,CACF,GACD,EAAE;GACN;IACE,IAAI;IACJ,OAAO,EAAG,gCAAgC,cAAc;IACxD,MAAM,EAAS,GAAU,cAAc;IACvC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;IAC7B,OAAO;IACP,OAAO;IACR;GACF,CAGyC;IAKzC;EAAC;EAAkB;EAAU;EAAgB;EAAE,CAAC,EAGnD,QAAgB;AACT,QAaL,QADgB,EAVkB,CAChC;GACE,IAAI;GACJ,OAAO,EAAG,6BAA6B,sBAAsB;GAC7D,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAG/C,CAAC,GAAqB,EAAE,CAAC,EAG1B,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aACZ,EACC,iCACA,qEACD;GACG,CAAA;YAGR,kBAAC,GAAD;GAAsB,GAAI;aACxB,kBAAC,GAAD,EAA0B,CAAA;GACL,CAAA;EACT,CAAA"}
1
+ {"version":3,"file":"UserNotificationRoot.js","names":["UserNotificationRoot","props","useI18n","tr","translated","t","key","fallback","historyDetails","useFeatureFlagDetails","historyEnabled","joinPath","base","path","useEffect","registerNavItems","navItems","basePath","Bell","Archive","Settings2","registerFooterItems","footerItems","ErrorBoundary","NotificationProvider","UserNotificationRoutes"],"sources":["../src/UserNotificationRoot.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Bell, Archive, Settings2 } from 'lucide-react';\nimport { NotificationProvider } from './providers/NotificationProvider';\nimport type { NavItem, FooterItem, NotificationRootProps } from './types';\nimport { UserNotificationRoutes } from './UserNotificationRoutes';\n\n/**\n * User Root component for the Notification microfrontend.\n *\n * This is the entry point host product shells should import. It exposes only\n * the user-facing notification surfaces (Notification Center, History) and\n * sets up the required provider stack.\n *\n * For the full admin experience (templates, create/send notification) use\n * `AdminNotificationRoot` instead.\n *\n * @example\n * ```tsx\n * import { UserNotificationRoot, type NotificationRootProps } from '@burdenoff/micro-fe/notification';\n *\n * function App() {\n * const props: NotificationRootProps = {\n * basePath: '/notifications',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * onNotificationClick: (notification) => console.log('Clicked:', notification),\n * };\n *\n * return <UserNotificationRoot {...props} />;\n * }\n * ```\n */\nexport function UserNotificationRoot(props: NotificationRootProps) {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n // Component-level feature gate. `notification.history` is declared as\n // unreleased (defaultValue=false). We use `useFeatureFlagDetails` and\n // explicitly fall back to `false` when the flag is absent from the cache,\n // because the provider's global default-allow would otherwise return `true`\n // for unseeded flags — which would defeat the whole point of the unreleased\n // pattern.\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell (user-facing only)\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'user-notification-center',\n label: tr('notification.nav.center', 'Notification Center'),\n path: joinPath(basePath, 'center'),\n icon: <Bell size={20} />,\n order: 10,\n group: 'notifications',\n },\n ...(historyEnabled\n ? [\n {\n id: 'user-notification-history',\n label: tr('notification.nav.history', 'History'),\n path: joinPath(basePath, 'history'),\n icon: <Archive size={20} />,\n order: 20,\n group: 'notifications',\n },\n ]\n : []),\n {\n id: 'user-notification-preferences',\n label: tr('notification.nav.preferences', 'Preferences'),\n path: joinPath(basePath, 'preferences'),\n icon: <Settings2 size={20} />,\n order: 30,\n group: 'notifications',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerNavItems, basePath, historyEnabled, t]);\n\n // Register footer items (status indicator in left section)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems: FooterItem[] = [\n {\n id: 'user-notification-status',\n label: tr('notification.footer.ready', 'Notifications Ready'),\n type: 'status',\n order: 10,\n section: 'left',\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerFooterItems, t]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'notification.error.moduleLoad',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <NotificationProvider {...props}>\n <UserNotificationRoutes />\n </NotificationProvider>\n </ErrorBoundary>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,SAAgBA,EAAqB,GAA8B;CACjE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQC,GAC5D,EAAE,SAAMC,EAAQ,GAChBC,KAAM,GAAa,MAA6B;EACpD,IAAMC,IAAaC,EAAEC,CAAG;EACxB,OAAOF,MAAeE,IAAMC,IAAWH;CACzC,GAQMI,IAAiBC,EAAsB,sBAAsB,GAC7DC,IAAiBF,IAAiB,EAAQA,EAAe,QAAS,IAGlEG,KAAY,GAAc,OACZC,EAAK,SAAS,GAAG,IAAIA,EAAK,MAAM,GAAG,EAAE,IAAIA,MACzCC,EAAK,WAAW,GAAG,IAAIA,IAAO,IAAIA;CAkEtD,OA7DAC,QAAgB;EACd,IAAI,CAACC,GAAkB;EAEvB,IAAMC,IAAsB;GAC1B;IACE,IAAI;IACJ,OAAOb,EAAG,2BAA2B,qBAAqB;IAC1D,MAAMQ,EAASM,GAAU,QAAQ;IACjC,MAAM,kBAACC,GAAD,EAAM,MAAM,GAAK,CAAA;IACvB,OAAO;IACP,OAAO;GACT;GACA,GAAIR,IACA,CACE;IACE,IAAI;IACJ,OAAOP,EAAG,4BAA4B,SAAS;IAC/C,MAAMQ,EAASM,GAAU,SAAS;IAClC,MAAM,kBAACE,GAAD,EAAS,MAAM,GAAK,CAAA;IAC1B,OAAO;IACP,OAAO;GACT,CACF,IACA,CAAC;GACL;IACE,IAAI;IACJ,OAAOhB,EAAG,gCAAgC,aAAa;IACvD,MAAMQ,EAASM,GAAU,aAAa;IACtC,MAAM,kBAACG,GAAD,EAAW,MAAM,GAAK,CAAA;IAC5B,OAAO;IACP,OAAO;GACT;EACF;EAMA,OAHgBL,EAAiBC,CAG1B;CAET,GAAG;EAACD;EAAkBE;EAAUP;EAAgBL;CAAC,CAAC,GAGlDS,QAAgB;EACd,IAAI,CAACO,GAAqB;EAE1B,IAAMC,IAA4B,CAChC;GACE,IAAI;GACJ,OAAOnB,EAAG,6BAA6B,qBAAqB;GAC5D,MAAM;GACN,OAAO;GACP,SAAS;EACX,CACF;EAGA,OADgBkB,EAAoBC,CAC7B;CAET,GAAG,CAACD,GAAqBhB,CAAC,CAAC,GAGzB,kBAACkB,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;GACZ,UAAApB,EACC,iCACA,oEACF;EACG,CAAA;EAGP,UAAA,kBAACqB,GAAD;GAAsB,GAAIvB;GACxB,UAAA,kBAACwB,GAAD,CAAyB,CAAA;EACL,CAAA;CACT,CAAA;AAEnB"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Internal router for the User-facing Notification microfrontend.
3
+ * This component handles routing within the microfrontend using React Router v7.
4
+ *
5
+ * Only exposes user-facing routes intended for product shells. RBAC permissions
6
+ * still gate in-page actions via usePermissions checks.
7
+ *
8
+ * Routes:
9
+ * - / → Redirect to notification center
10
+ * - /list → Notification center (canonical list alias used by shell nav homePath)
11
+ * - /center → Notification center (in-app notifications)
12
+ * - /history → Notification history and archive
13
+ * - /preferences → Topic subscriptions and preferences
14
+ * - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)
15
+ */
16
+ export declare function UserNotificationRoutes(): import('react').JSX.Element;
@@ -1,12 +1,12 @@
1
- import { useNotification as e } from "./providers/NotificationProvider.js";
2
- import { useTr as t } from "./shared/hooks/useTr.js";
3
- import { NotificationCenterPage as n } from "./pages/NotificationCenterPage.js";
4
- import { FeatureDisabledPage as r } from "./components/FeatureDisabledPage.js";
1
+ import { FeatureDisabledPage as e } from "./components/FeatureDisabledPage.js";
2
+ import { useNotification as t } from "./providers/NotificationProvider.js";
3
+ import { useTr as n } from "./shared/hooks/useTr.js";
4
+ import { NotificationCenterPage as r } from "./pages/NotificationCenterPage.js";
5
5
  import { Suspense as i, lazy as a } from "react";
6
6
  import { useFeatureFlagDetails as o } from "@burdenoff/fe-libs/shared/feature-flags";
7
7
  import { Navigate as s, Route as c, Routes as l } from "react-router";
8
8
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- //#region src/UserNotificationRoutes.tsx
9
+ // src/UserNotificationRoutes.tsx
10
10
  var f = a(() => import("./pages/NotificationHistoryPage.js").then((e) => ({ default: e.NotificationHistoryPage }))), p = a(() => import("./pages/NotificationPreferencesPage.js").then((e) => ({ default: e.NotificationPreferencesPage })));
11
11
  function m() {
12
12
  return /* @__PURE__ */ u("div", {
@@ -15,7 +15,7 @@ function m() {
15
15
  });
16
16
  }
17
17
  function h() {
18
- let { basePath: a = "/" } = e(), h = t(), g = `${a.endsWith("/") ? a.slice(0, -1) : a}/center`, _ = o("notification.history"), v = _ ? !!_.value : !1;
18
+ let { basePath: a = "/" } = t(), h = n(), g = `${a.endsWith("/") ? a.slice(0, -1) : a}/center`, _ = o("notification.history"), v = _ ? !!_.value : !1;
19
19
  return /* @__PURE__ */ u(i, {
20
20
  fallback: /* @__PURE__ */ u(m, {}),
21
21
  children: /* @__PURE__ */ d(l, { children: [
@@ -28,15 +28,15 @@ function h() {
28
28
  }),
29
29
  /* @__PURE__ */ u(c, {
30
30
  path: "list",
31
- element: /* @__PURE__ */ u(n, {})
31
+ element: /* @__PURE__ */ u(r, {})
32
32
  }),
33
33
  /* @__PURE__ */ u(c, {
34
34
  path: "center",
35
- element: /* @__PURE__ */ u(n, {})
35
+ element: /* @__PURE__ */ u(r, {})
36
36
  }),
37
37
  /* @__PURE__ */ u(c, {
38
38
  path: "history",
39
- element: v ? /* @__PURE__ */ u(f, {}) : /* @__PURE__ */ u(r, {
39
+ element: v ? /* @__PURE__ */ u(f, {}) : /* @__PURE__ */ u(e, {
40
40
  title: h("notification.featureDisabled.historyTitle", "Notification history is not enabled"),
41
41
  description: h("notification.featureDisabled.historyUserDescription", "This page is controlled by the notification.history feature flag. Ask an administrator to enable it for this tenant if history should be available.")
42
42
  })
@@ -55,7 +55,6 @@ function h() {
55
55
  ] })
56
56
  });
57
57
  }
58
- //#endregion
59
58
  export { h as UserNotificationRoutes };
60
59
 
61
60
  //# sourceMappingURL=UserNotificationRoutes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserNotificationRoutes.js","names":[],"sources":["../src/UserNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { FeatureDisabledPage } from './components/FeatureDisabledPage';\nimport { useNotification } from './providers/NotificationProvider';\nimport { useTr } from './shared/hooks/useTr';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the User-facing Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Only exposes user-facing routes intended for product shells. RBAC permissions\n * still gate in-page actions via usePermissions checks.\n *\n * Routes:\n * - / → Redirect to notification center\n * - /list → Notification center (canonical list alias used by shell nav homePath)\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /preferences → Topic subscriptions and preferences\n * - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)\n */\nexport function UserNotificationRoutes() {\n const { basePath = '/' } = useNotification();\n const tr = useTr();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n // Component-level feature gate. `notification.history` is declared as\n // unreleased (defaultValue=false). We use `useFeatureFlagDetails` and\n // explicitly fall back to `false` when the flag is absent from the cache,\n // because the provider's global default-allow would otherwise return `true`\n // for unseeded flags — which would defeat the whole point of the unreleased\n // pattern.\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Default redirect to notification center */}\n <Route index element={<Navigate to={centerPath} replace />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route\n path=\"history\"\n element={\n historyEnabled ? (\n <NotificationHistoryPage />\n ) : (\n <FeatureDisabledPage\n title={tr(\n 'notification.featureDisabled.historyTitle',\n 'Notification history is not enabled'\n )}\n description={tr(\n 'notification.featureDisabled.historyUserDescription',\n 'This page is controlled by the notification.history feature flag. Ask an administrator to enable it for this tenant if history should be available.'\n )}\n />\n )\n }\n />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,IAAM,IAA0B,QAC9B,OAAO,sCAAmC,MAAM,OAAO,EACrD,SAAS,EAAE,yBACZ,EAAE,CACJ,EACK,IAA8B,QAClC,OAAO,0CAAuC,MAAM,OAAO,EACzD,SAAS,EAAE,6BACZ,EAAE,CACJ;AAGD,SAAS,IAAa;AACpB,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,WAAU,kFAAmF,CAAA;EAC9F,CAAA;;AAmBV,SAAgB,IAAyB;CACvC,IAAM,EAAE,cAAW,QAAQ,GAAiB,EACtC,IAAK,GAAO,EACZ,IAAa,GAAG,EAAS,SAAS,IAAI,GAAG,EAAS,MAAM,GAAG,GAAG,GAAG,EAAS,UAQ1E,IAAiB,EAAsB,uBAAuB,EAC9D,IAAiB,IAAiB,EAAQ,EAAe,QAAS;AAExE,QACE,kBAAC,GAAD;EAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;YAChC,kBAAC,GAAD,EAAA,UAAA;GAEE,kBAAC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAAC,GAAD;KAAU,IAAI;KAAY,SAAA;KAAU,CAAA;IAAI,CAAA;GAG9D,kBAAC,GAAD;IAAO,MAAK;IAAO,SAAS,kBAAC,GAAD,EAA0B,CAAA;IAAI,CAAA;GAG1D,kBAAC,GAAD;IAAO,MAAK;IAAS,SAAS,kBAAC,GAAD,EAA0B,CAAA;IAAI,CAAA;GAC5D,kBAAC,GAAD;IACE,MAAK;IACL,SACE,IACE,kBAAC,GAAD,EAA2B,CAAA,GAE3B,kBAAC,GAAD;KACE,OAAO,EACL,6CACA,sCACD;KACD,aAAa,EACX,uDACA,sJACD;KACD,CAAA;IAGN,CAAA;GACF,kBAAC,GAAD;IAAO,MAAK;IAAc,SAAS,kBAAC,GAAD,EAA+B,CAAA;IAAI,CAAA;GAItE,kBAAC,GAAD;IAAO,MAAK;IAAI,SAAS,kBAAC,GAAD;KAAU,IAAI;KAAY,SAAA;KAAU,CAAA;IAAI,CAAA;GAC1D,EAAA,CAAA;EACA,CAAA"}
1
+ {"version":3,"file":"UserNotificationRoutes.js","names":["NotificationHistoryPage","lazy","m","NotificationPreferencesPage","PageLoader","UserNotificationRoutes","useNotification","tr","useTr","centerPath","basePath","historyDetails","useFeatureFlagDetails","historyEnabled","Suspense","Routes","Route","Navigate","NotificationCenterPage","FeatureDisabledPage"],"sources":["../src/UserNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { FeatureDisabledPage } from './components/FeatureDisabledPage';\nimport { useNotification } from './providers/NotificationProvider';\nimport { useTr } from './shared/hooks/useTr';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the User-facing Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Only exposes user-facing routes intended for product shells. RBAC permissions\n * still gate in-page actions via usePermissions checks.\n *\n * Routes:\n * - / → Redirect to notification center\n * - /list → Notification center (canonical list alias used by shell nav homePath)\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /preferences → Topic subscriptions and preferences\n * - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)\n */\nexport function UserNotificationRoutes() {\n const { basePath = '/' } = useNotification();\n const tr = useTr();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n // Component-level feature gate. `notification.history` is declared as\n // unreleased (defaultValue=false). We use `useFeatureFlagDetails` and\n // explicitly fall back to `false` when the flag is absent from the cache,\n // because the provider's global default-allow would otherwise return `true`\n // for unseeded flags — which would defeat the whole point of the unreleased\n // pattern.\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Default redirect to notification center */}\n <Route index element={<Navigate to={centerPath} replace />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route\n path=\"history\"\n element={\n historyEnabled ? (\n <NotificationHistoryPage />\n ) : (\n <FeatureDisabledPage\n title={tr(\n 'notification.featureDisabled.historyTitle',\n 'Notification history is not enabled'\n )}\n description={tr(\n 'notification.featureDisabled.historyUserDescription',\n 'This page is controlled by the notification.history feature flag. Ask an administrator to enable it for this tenant if history should be available.'\n )}\n />\n )\n }\n />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,IAAMA,IAA0BC,QAC9B,OAAO,qCAAkC,CAAC,MAAM,OAAO,EACrD,SAASC,EAAE,wBACb,EAAE,CACJ,GACMC,IAA8BF,QAClC,OAAO,yCAAsC,CAAC,MAAM,OAAO,EACzD,SAASC,EAAE,4BACb,EAAE,CACJ;AAGA,SAASE,IAAa;CACpB,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA;AAET;AAiBA,SAAgBC,IAAyB;CACvC,IAAM,EAAE,cAAW,QAAQC,EAAgB,GACrCC,IAAKC,EAAM,GACXC,IAAa,GAAGC,EAAS,SAAS,GAAG,IAAIA,EAAS,MAAM,GAAG,EAAE,IAAIA,EAAS,UAQ1EC,IAAiBC,EAAsB,sBAAsB,GAC7DC,IAAiBF,IAAiB,EAAQA,EAAe,QAAS;CAExE,OACE,kBAACG,GAAD;EAAU,UAAU,kBAACV,GAAD,CAAa,CAAA;EAC/B,UAAA,kBAACW,GAAD,EAAA,UAAA;GAEE,kBAACC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAACC,GAAD;KAAU,IAAIR;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;GAG7D,kBAACO,GAAD;IAAO,MAAK;IAAO,SAAS,kBAACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GAGzD,kBAACF,GAAD;IAAO,MAAK;IAAS,SAAS,kBAACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GAC3D,kBAACF,GAAD;IACE,MAAK;IACL,SACEH,IACE,kBAACb,GAAD,CAA0B,CAAA,IAE1B,kBAACmB,GAAD;KACE,OAAOZ,EACL,6CACA,qCACF;KACA,aAAaA,EACX,uDACA,qJACF;IACD,CAAA;GAGN,CAAA;GACD,kBAACS,GAAD;IAAO,MAAK;IAAc,SAAS,kBAACb,GAAD,CAA8B,CAAA;GAAI,CAAA;GAIrE,kBAACa,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACC,GAAD;KAAU,IAAIR;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;EAC1D,EAAA,CAAA;CACA,CAAA;AAEd"}
@@ -0,0 +1,6 @@
1
+ interface FeatureDisabledPageProps {
2
+ title: string;
3
+ description: string;
4
+ }
5
+ export declare function FeatureDisabledPage({ title, description }: FeatureDisabledPageProps): import('react').JSX.Element;
6
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { Lock as e } from "lucide-react";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- //#region src/components/FeatureDisabledPage.tsx
3
+ // src/components/FeatureDisabledPage.tsx
4
4
  function r({ title: r, description: i }) {
5
5
  return /* @__PURE__ */ t("div", {
6
6
  className: "flex min-h-64 items-center justify-center p-6",
@@ -26,7 +26,6 @@ function r({ title: r, description: i }) {
26
26
  })
27
27
  });
28
28
  }
29
- //#endregion
30
29
  export { r as FeatureDisabledPage };
31
30
 
32
31
  //# sourceMappingURL=FeatureDisabledPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureDisabledPage.js","names":[],"sources":["../../src/components/FeatureDisabledPage.tsx"],"sourcesContent":["import { Lock } from 'lucide-react';\n\ninterface FeatureDisabledPageProps {\n title: string;\n description: string;\n}\n\nexport function FeatureDisabledPage({ title, description }: FeatureDisabledPageProps) {\n return (\n <div className=\"flex min-h-64 items-center justify-center p-6\">\n <div className=\"max-w-md rounded-xl border border-border-seam bg-gloss-card p-6 text-center shadow-[var(--shadow-pop)]\">\n <div className=\"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-secondary\">\n <Lock size={22} aria-hidden=\"true\" />\n </div>\n <h1 className=\"text-lg font-semibold text-primary\">{title}</h1>\n <p className=\"mt-2 text-sm leading-6 text-secondary\">{description}</p>\n </div>\n </div>\n );\n}\n"],"mappings":";;;AAOA,SAAgB,EAAoB,EAAE,UAAO,kBAAyC;AACpF,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MAAM,MAAM;MAAI,eAAY;MAAS,CAAA;KACjC,CAAA;IACN,kBAAC,MAAD;KAAI,WAAU;eAAsC;KAAW,CAAA;IAC/D,kBAAC,KAAD;KAAG,WAAU;eAAyC;KAAgB,CAAA;IAClE;;EACF,CAAA"}
1
+ {"version":3,"file":"FeatureDisabledPage.js","names":["FeatureDisabledPage","Lock","title","description"],"sources":["../../src/components/FeatureDisabledPage.tsx"],"sourcesContent":["import { Lock } from 'lucide-react';\n\ninterface FeatureDisabledPageProps {\n title: string;\n description: string;\n}\n\nexport function FeatureDisabledPage({ title, description }: FeatureDisabledPageProps) {\n return (\n <div className=\"flex min-h-64 items-center justify-center p-6\">\n <div className=\"max-w-md rounded-xl border border-border-seam bg-gloss-card p-6 text-center shadow-[var(--shadow-pop)]\">\n <div className=\"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-secondary\">\n <Lock size={22} aria-hidden=\"true\" />\n </div>\n <h1 className=\"text-lg font-semibold text-primary\">{title}</h1>\n <p className=\"mt-2 text-sm leading-6 text-secondary\">{description}</p>\n </div>\n </div>\n );\n}\n"],"mappings":";;;AAOA,SAAgBA,EAAoB,EAAE,UAAO,kBAAyC;CACpF,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACC,GAAD;MAAM,MAAM;MAAI,eAAY;KAAQ,CAAA;IACjC,CAAA;IACL,kBAAC,MAAD;KAAI,WAAU;KAAsC,UAAAC;IAAU,CAAA;IAC9D,kBAAC,KAAD;KAAG,WAAU;KAAyC,UAAAC;IAAe,CAAA;GAClE;;CACF,CAAA;AAET"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Notification bell icon with unread count badge
3
+ *
4
+ * This component should be placed in the global header/navbar
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <NotificationBell onClick={() => navigate('/notifications/center')} />
9
+ * ```
10
+ */
11
+ export declare function NotificationBell({ onClick }: {
12
+ onClick?: () => void;
13
+ }): import('react').JSX.Element;
@@ -1,18 +1,18 @@
1
1
  import { useNotification as e } from "../providers/NotificationProvider.js";
2
2
  import { USER_NOTIFICATION_CONTEXT as t, getGlobalNotificationClient as n } from "../graphql/global-client.js";
3
- import { useNotificationStore as r } from "../store/notificationStore.js";
4
- import { GetMyUnreadNotificationCountDocument as i, UnreadCountUpdatedDocument as a } from "../generated/global-operations.js";
3
+ import { GetMyUnreadNotificationCountDocument as r, UnreadCountUpdatedDocument as i } from "../generated/global-operations.js";
4
+ import { useNotificationStore as a } from "../store/notificationStore.js";
5
5
  import { useTr as o } from "../shared/hooks/useTr.js";
6
6
  import { useCallback as s, useEffect as c } from "react";
7
7
  import { Bell as l } from "lucide-react";
8
8
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- //#region src/components/NotificationBell.tsx
9
+ // src/components/NotificationBell.tsx
10
10
  function f({ onClick: f }) {
11
- let p = o(), { authToken: m, apiGatewayUrl: h, currentUser: g } = e(), { unreadCount: _, togglePanel: v, setUnreadCount: y } = r(), b = s(async () => {
11
+ let p = o(), { authToken: m, apiGatewayUrl: h, currentUser: g } = e(), { unreadCount: _, togglePanel: v, setUnreadCount: y } = a(), b = s(async () => {
12
12
  try {
13
13
  let e = await n(h ?? void 0, m ?? void 0).query({
14
14
  context: t,
15
- query: i,
15
+ query: r,
16
16
  variables: { filter: { channel: "IN_APP" } },
17
17
  fetchPolicy: "network-only"
18
18
  });
@@ -28,7 +28,7 @@ function f({ onClick: f }) {
28
28
  }, [b]), c(() => {
29
29
  if (!g?.id) return;
30
30
  let e = n(h ?? void 0, m ?? void 0).subscribe({
31
- query: a,
31
+ query: i,
32
32
  variables: { userId: g.id }
33
33
  }).subscribe({
34
34
  next: (e) => {
@@ -64,7 +64,6 @@ function f({ onClick: f }) {
64
64
  })]
65
65
  });
66
66
  }
67
- //#endregion
68
67
  export { f as NotificationBell };
69
68
 
70
69
  //# sourceMappingURL=NotificationBell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationBell.js","names":[],"sources":["../../src/components/NotificationBell.tsx"],"sourcesContent":["import { useCallback, useEffect } from 'react';\nimport { Bell } from 'lucide-react';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { getGlobalNotificationClient, USER_NOTIFICATION_CONTEXT } from '../graphql/global-client';\nimport {\n GetMyUnreadNotificationCountDocument,\n UnreadCountUpdatedDocument,\n} from '../generated/global-operations';\nimport type {\n GetMyUnreadNotificationCountQuery,\n UnreadCountUpdatedSubscription,\n} from '../generated/global-operations';\nimport { useNotificationStore } from '../store/notificationStore';\nimport { useTr } from '../shared/hooks/useTr';\n\n/**\n * Notification bell icon with unread count badge\n *\n * This component should be placed in the global header/navbar\n *\n * @example\n * ```tsx\n * <NotificationBell onClick={() => navigate('/notifications/center')} />\n * ```\n */\nexport function NotificationBell({ onClick }: { onClick?: () => void }) {\n const tr = useTr();\n const { authToken, apiGatewayUrl, currentUser } = useNotification();\n const { unreadCount, togglePanel, setUnreadCount } = useNotificationStore();\n\n const refreshUnreadCount = useCallback(async () => {\n try {\n const client = getGlobalNotificationClient(\n apiGatewayUrl ?? undefined,\n authToken ?? undefined\n );\n const result = await client.query<GetMyUnreadNotificationCountQuery>({\n context: USER_NOTIFICATION_CONTEXT,\n query: GetMyUnreadNotificationCountDocument,\n variables: { filter: { channel: 'IN_APP' } },\n fetchPolicy: 'network-only',\n });\n\n if (typeof result.data?.myUnreadNotificationCount === 'number') {\n setUnreadCount(result.data.myUnreadNotificationCount);\n }\n } catch {\n // Keep bell resilient; do not surface errors here.\n }\n }, [apiGatewayUrl, authToken, setUnreadCount]);\n\n useEffect(() => {\n refreshUnreadCount();\n }, [refreshUnreadCount]);\n\n useEffect(() => {\n if (!currentUser?.id) return undefined;\n\n const client = getGlobalNotificationClient(apiGatewayUrl ?? undefined, authToken ?? undefined);\n const subscription = client\n .subscribe<UnreadCountUpdatedSubscription>({\n query: UnreadCountUpdatedDocument,\n variables: { userId: currentUser.id },\n })\n .subscribe({\n next: (result) => {\n const nextCount = result.data?.unreadCountUpdated;\n if (typeof nextCount === 'number') {\n setUnreadCount(nextCount);\n }\n },\n error: () => {\n // Keep the header resilient; visibility refresh below handles recovery.\n },\n });\n\n return () => subscription.unsubscribe();\n }, [apiGatewayUrl, authToken, currentUser?.id, setUnreadCount]);\n\n useEffect(() => {\n const handleVisibilityChange = () => {\n if (document.visibilityState === 'visible') {\n refreshUnreadCount();\n }\n };\n\n document.addEventListener('visibilitychange', handleVisibilityChange);\n return () => document.removeEventListener('visibilitychange', handleVisibilityChange);\n }, [refreshUnreadCount]);\n\n const handleClick = () => {\n if (onClick) {\n onClick();\n } else {\n togglePanel();\n }\n };\n\n return (\n <button\n data-tour=\"notification-bell\"\n onClick={handleClick}\n className=\"relative inline-flex items-center justify-center p-2 rounded-md hover:bg-bg-sunken transition-all duration-150\"\n aria-label={`${tr('notifCommon.notifications', 'Notifications')}${unreadCount > 0 ? ` (${unreadCount} ${tr('notifCommon.unread', 'unread')})` : ''}`}\n >\n <Bell size={20} className=\"text-primary\" />\n {unreadCount > 0 && (\n <span className=\"absolute top-1 right-1 flex items-center justify-center min-w-[18px] h-[18px] px-1 text-xs font-semibold tabular-nums text-white bg-error rounded-full motion-safe:animate-vc-glow-pulse\">\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n )}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAgB,EAAiB,EAAE,cAAqC;CACtE,IAAM,IAAK,GAAO,EACZ,EAAE,cAAW,kBAAe,mBAAgB,GAAiB,EAC7D,EAAE,gBAAa,gBAAa,sBAAmB,GAAsB,EAErE,IAAqB,EAAY,YAAY;AACjD,MAAI;GAKF,IAAM,IAAS,MAJA,EACb,KAAiB,KAAA,GACjB,KAAa,KAAA,EACd,CAC2B,MAAyC;IACnE,SAAS;IACT,OAAO;IACP,WAAW,EAAE,QAAQ,EAAE,SAAS,UAAU,EAAE;IAC5C,aAAa;IACd,CAAC;AAEF,GAAI,OAAO,EAAO,MAAM,6BAA8B,YACpD,EAAe,EAAO,KAAK,0BAA0B;UAEjD;IAGP;EAAC;EAAe;EAAW;EAAe,CAAC;AAiD9C,QA/CA,QAAgB;AACd,KAAoB;IACnB,CAAC,EAAmB,CAAC,EAExB,QAAgB;AACd,MAAI,CAAC,GAAa,GAAI;EAGtB,IAAM,IADS,EAA4B,KAAiB,KAAA,GAAW,KAAa,KAAA,EAAU,CAE3F,UAA0C;GACzC,OAAO;GACP,WAAW,EAAE,QAAQ,EAAY,IAAI;GACtC,CAAC,CACD,UAAU;GACT,OAAO,MAAW;IAChB,IAAM,IAAY,EAAO,MAAM;AAC/B,IAAI,OAAO,KAAc,YACvB,EAAe,EAAU;;GAG7B,aAAa;GAGd,CAAC;AAEJ,eAAa,EAAa,aAAa;IACtC;EAAC;EAAe;EAAW,GAAa;EAAI;EAAe,CAAC,EAE/D,QAAgB;EACd,IAAM,UAA+B;AACnC,GAAI,SAAS,oBAAoB,aAC/B,GAAoB;;AAKxB,SADA,SAAS,iBAAiB,oBAAoB,EAAuB,QACxD,SAAS,oBAAoB,oBAAoB,EAAuB;IACpF,CAAC,EAAmB,CAAC,EAWtB,kBAAC,UAAD;EACE,aAAU;EACV,eAXsB;AACxB,GAAI,IACF,GAAS,GAET,GAAa;;EAQb,WAAU;EACV,cAAY,GAAG,EAAG,6BAA6B,gBAAgB,GAAG,IAAc,IAAI,KAAK,EAAY,GAAG,EAAG,sBAAsB,SAAS,CAAC,KAAK;YAJlJ,CAME,kBAAC,GAAD;GAAM,MAAM;GAAI,WAAU;GAAiB,CAAA,EAC1C,IAAc,KACb,kBAAC,QAAD;GAAM,WAAU;aACb,IAAc,KAAK,QAAQ;GACvB,CAAA,CAEF"}
1
+ {"version":3,"file":"NotificationBell.js","names":["NotificationBell","tr","useTr","useNotification","useNotificationStore","refreshUnreadCount","useCallback","result","getGlobalNotificationClient","apiGatewayUrl","authToken","USER_NOTIFICATION_CONTEXT","GetMyUnreadNotificationCountDocument","setUnreadCount","useEffect","currentUser","subscription","UnreadCountUpdatedDocument","nextCount","handleVisibilityChange","onClick","togglePanel","unreadCount","Bell"],"sources":["../../src/components/NotificationBell.tsx"],"sourcesContent":["import { useCallback, useEffect } from 'react';\nimport { Bell } from 'lucide-react';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { getGlobalNotificationClient, USER_NOTIFICATION_CONTEXT } from '../graphql/global-client';\nimport {\n GetMyUnreadNotificationCountDocument,\n UnreadCountUpdatedDocument,\n} from '../generated/global-operations';\nimport type {\n GetMyUnreadNotificationCountQuery,\n UnreadCountUpdatedSubscription,\n} from '../generated/global-operations';\nimport { useNotificationStore } from '../store/notificationStore';\nimport { useTr } from '../shared/hooks/useTr';\n\n/**\n * Notification bell icon with unread count badge\n *\n * This component should be placed in the global header/navbar\n *\n * @example\n * ```tsx\n * <NotificationBell onClick={() => navigate('/notifications/center')} />\n * ```\n */\nexport function NotificationBell({ onClick }: { onClick?: () => void }) {\n const tr = useTr();\n const { authToken, apiGatewayUrl, currentUser } = useNotification();\n const { unreadCount, togglePanel, setUnreadCount } = useNotificationStore();\n\n const refreshUnreadCount = useCallback(async () => {\n try {\n const client = getGlobalNotificationClient(\n apiGatewayUrl ?? undefined,\n authToken ?? undefined\n );\n const result = await client.query<GetMyUnreadNotificationCountQuery>({\n context: USER_NOTIFICATION_CONTEXT,\n query: GetMyUnreadNotificationCountDocument,\n variables: { filter: { channel: 'IN_APP' } },\n fetchPolicy: 'network-only',\n });\n\n if (typeof result.data?.myUnreadNotificationCount === 'number') {\n setUnreadCount(result.data.myUnreadNotificationCount);\n }\n } catch {\n // Keep bell resilient; do not surface errors here.\n }\n }, [apiGatewayUrl, authToken, setUnreadCount]);\n\n useEffect(() => {\n refreshUnreadCount();\n }, [refreshUnreadCount]);\n\n useEffect(() => {\n if (!currentUser?.id) return undefined;\n\n const client = getGlobalNotificationClient(apiGatewayUrl ?? undefined, authToken ?? undefined);\n const subscription = client\n .subscribe<UnreadCountUpdatedSubscription>({\n query: UnreadCountUpdatedDocument,\n variables: { userId: currentUser.id },\n })\n .subscribe({\n next: (result) => {\n const nextCount = result.data?.unreadCountUpdated;\n if (typeof nextCount === 'number') {\n setUnreadCount(nextCount);\n }\n },\n error: () => {\n // Keep the header resilient; visibility refresh below handles recovery.\n },\n });\n\n return () => subscription.unsubscribe();\n }, [apiGatewayUrl, authToken, currentUser?.id, setUnreadCount]);\n\n useEffect(() => {\n const handleVisibilityChange = () => {\n if (document.visibilityState === 'visible') {\n refreshUnreadCount();\n }\n };\n\n document.addEventListener('visibilitychange', handleVisibilityChange);\n return () => document.removeEventListener('visibilitychange', handleVisibilityChange);\n }, [refreshUnreadCount]);\n\n const handleClick = () => {\n if (onClick) {\n onClick();\n } else {\n togglePanel();\n }\n };\n\n return (\n <button\n data-tour=\"notification-bell\"\n onClick={handleClick}\n className=\"relative inline-flex items-center justify-center p-2 rounded-md hover:bg-bg-sunken transition-all duration-150\"\n aria-label={`${tr('notifCommon.notifications', 'Notifications')}${unreadCount > 0 ? ` (${unreadCount} ${tr('notifCommon.unread', 'unread')})` : ''}`}\n >\n <Bell size={20} className=\"text-primary\" />\n {unreadCount > 0 && (\n <span className=\"absolute top-1 right-1 flex items-center justify-center min-w-[18px] h-[18px] px-1 text-xs font-semibold tabular-nums text-white bg-error rounded-full motion-safe:animate-vc-glow-pulse\">\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n )}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAgBA,EAAiB,EAAE,cAAqC;CACtE,IAAMC,IAAKC,EAAM,GACX,EAAE,cAAW,kBAAe,mBAAgBC,EAAgB,GAC5D,EAAE,gBAAa,gBAAa,sBAAmBC,EAAqB,GAEpEC,IAAqBC,EAAY,YAAY;EACjD,IAAI;GAKF,IAAMC,IAAS,MAJAC,EACbC,KAAiB,KAAA,GACjBC,KAAa,KAAA,CAEM,CAAA,CAAO,MAAyC;IACnE,SAASC;IACT,OAAOC;IACP,WAAW,EAAE,QAAQ,EAAE,SAAS,SAAS,EAAE;IAC3C,aAAa;GACf,CAAC;GAED,AAAI,OAAOL,EAAO,MAAM,6BAA8B,YACpDM,EAAeN,EAAO,KAAK,yBAAyB;EAExD,QAAQ,CAER;CACF,GAAG;EAACE;EAAeC;EAAWG;CAAc,CAAC;CAiD7C,OA/CAC,QAAgB;EACd,EAAmB;CACrB,GAAG,CAACT,CAAkB,CAAC,GAEvBS,QAAgB;EACd,IAAI,CAACC,GAAa,IAAI;EAGtB,IAAMC,IADSR,EAA4BC,KAAiB,KAAA,GAAWC,KAAa,KAAA,CAC/D,CAAA,CAClB,UAA0C;GACzC,OAAOO;GACP,WAAW,EAAE,QAAQF,EAAY,GAAG;EACtC,CAAC,CAAC,CACD,UAAU;GACT,OAAO,MAAW;IAChB,IAAMG,IAAYX,EAAO,MAAM;IAC/B,AAAI,OAAOW,KAAc,YACvBL,EAAeK,CAAS;GAE5B;GACA,aAAa,CAEb;EACF,CAAC;EAEH,aAAaF,EAAa,YAAY;CACxC,GAAG;EAACP;EAAeC;EAAWK,GAAa;EAAIF;CAAc,CAAC,GAE9DC,QAAgB;EACd,IAAMK,UAA+B;GACnC,AAAI,SAAS,oBAAoB,aAC/Bd,EAAmB;EAEvB;EAGA,OADA,SAAS,iBAAiB,oBAAoBc,CAAsB,SACvD,SAAS,oBAAoB,oBAAoBA,CAAsB;CACtF,GAAG,CAACd,CAAkB,CAAC,GAWrB,kBAAC,UAAD;EACE,aAAU;EACV,eAXsB;GACxB,AAAIe,IACFA,EAAQ,IAERC,EAAY;EAEhB;EAMI,WAAU;EACV,cAAY,GAAGpB,EAAG,6BAA6B,eAAe,IAAIqB,IAAc,IAAI,KAAKA,EAAY,GAAGrB,EAAG,sBAAsB,QAAQ,EAAE,KAAK;EAJlJ,UAAA,CAME,kBAACsB,GAAD;GAAM,MAAM;GAAI,WAAU;EAAgB,CAAA,GACzCD,IAAc,KACb,kBAAC,QAAD;GAAM,WAAU;GACb,UAAAA,IAAc,KAAK,QAAQA;EACxB,CAAA,CAEF;;AAEZ"}
@@ -0,0 +1,18 @@
1
+ import { Notification } from '../types';
2
+ interface NotificationCardProps {
3
+ notification: Notification;
4
+ onMarkAsRead?: (id: string) => void;
5
+ onArchive?: (id: string) => void;
6
+ onAction?: (notificationId: string, actionId?: string) => void;
7
+ onClick?: (notification: Notification) => void;
8
+ showArchivedState?: boolean;
9
+ compact?: boolean;
10
+ analyticsSource?: 'center' | 'panel' | 'history' | 'admin_history';
11
+ }
12
+ /**
13
+ * Notification card component
14
+ *
15
+ * Displays notification information with action buttons
16
+ */
17
+ export declare function NotificationCard({ notification, onMarkAsRead, onArchive, onAction, onClick, showArchivedState, compact, analyticsSource, }: NotificationCardProps): import('react').JSX.Element;
18
+ export {};
@@ -1,13 +1,13 @@
1
1
  import { useNotificationAnalytics as e } from "../hooks/useNotificationAnalytics.js";
2
- import { formatRelativeTime as t, getNotificationTypeIcon as n, getPriorityColor as r, getPriorityIcon as i, truncateText as a } from "../utils/index.js";
3
- import { useTr as o } from "../shared/hooks/useTr.js";
2
+ import { useTr as t } from "../shared/hooks/useTr.js";
3
+ import { formatRelativeTime as n, getNotificationTypeIcon as r, getPriorityColor as i, getPriorityIcon as a, truncateText as o } from "../utils/index.js";
4
4
  import { nativeImpact as s, nativeOpenUrl as c } from "../utils/nativeBridge.js";
5
5
  import { navigateInApp as l } from "../utils/inAppNavigation.js";
6
6
  import { ExternalLink as u, X as d } from "lucide-react";
7
7
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
8
- //#region src/components/NotificationCard.tsx
8
+ // src/components/NotificationCard.tsx
9
9
  function h({ notification: h, onMarkAsRead: g, onArchive: _, onAction: v, onClick: y, showArchivedState: b = !1, compact: x = !1, analyticsSource: S = "center" }) {
10
- let C = o(), { trackNotificationOpened: w } = e(), T = !h.readAt, E = !!h.archivedAt, D = () => {
10
+ let C = t(), { trackNotificationOpened: w } = e(), T = !h.readAt, E = !!h.archivedAt, D = () => {
11
11
  w(h, S, "card"), y && y(h), T && g && g(h.id);
12
12
  }, O = (e) => {
13
13
  e.stopPropagation(), _ && _(h.id);
@@ -39,16 +39,16 @@ function h({ notification: h, onMarkAsRead: g, onArchive: _, onAction: v, onClic
39
39
  /* @__PURE__ */ p("span", {
40
40
  className: "text-base",
41
41
  "aria-hidden": "true",
42
- children: n(h.type)
42
+ children: r(h.type)
43
43
  }),
44
44
  /* @__PURE__ */ p("h3", {
45
45
  className: `text-sm truncate ${T ? "font-bold text-primary" : "font-medium text-secondary"}`,
46
- children: x ? a(h.title, 60) : h.title
46
+ children: x ? o(h.title, 60) : h.title
47
47
  }),
48
48
  /* @__PURE__ */ p("span", {
49
49
  className: "text-xs",
50
50
  "aria-label": `Priority: ${h.priority}`,
51
- children: i(h.priority)
51
+ children: a(h.priority)
52
52
  })
53
53
  ]
54
54
  }), _ && /* @__PURE__ */ p("button", {
@@ -72,7 +72,7 @@ function h({ notification: h, onMarkAsRead: g, onArchive: _, onAction: v, onClic
72
72
  }),
73
73
  /* @__PURE__ */ p("p", {
74
74
  className: `text-sm text-secondary ${x ? "line-clamp-2" : ""}`,
75
- children: x ? a(h.body, 120) : h.body
75
+ children: x ? o(h.body, 120) : h.body
76
76
  }),
77
77
  h.topic && /* @__PURE__ */ p("div", {
78
78
  className: "mt-2 inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-secondary",
@@ -94,14 +94,14 @@ function h({ notification: h, onMarkAsRead: g, onArchive: _, onAction: v, onClic
94
94
  className: "flex items-center gap-2 text-xs text-tertiary",
95
95
  children: [
96
96
  /* @__PURE__ */ p("span", {
97
- className: r(h.priority),
97
+ className: i(h.priority),
98
98
  children: h.priority
99
99
  }),
100
100
  b && E && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", { children: "•" }), /* @__PURE__ */ p("span", { children: C("notifCommon.archived", "Archived") })] }),
101
101
  /* @__PURE__ */ p("span", { children: "•" }),
102
102
  /* @__PURE__ */ p("time", {
103
103
  dateTime: h.createdAt,
104
- children: t(h.createdAt, C)
104
+ children: n(h.createdAt, C)
105
105
  })
106
106
  ]
107
107
  }), h.actionUrl && /* @__PURE__ */ m("button", {
@@ -114,7 +114,6 @@ function h({ notification: h, onMarkAsRead: g, onArchive: _, onAction: v, onClic
114
114
  ]
115
115
  });
116
116
  }
117
- //#endregion
118
117
  export { h as NotificationCard };
119
118
 
120
119
  //# sourceMappingURL=NotificationCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationCard.js","names":[],"sources":["../../src/components/NotificationCard.tsx"],"sourcesContent":["import { X, ExternalLink } from 'lucide-react';\nimport type { Notification } from '../types';\nimport { useNotificationAnalytics } from '../hooks/useNotificationAnalytics';\nimport { useTr } from '../shared/hooks/useTr';\nimport {\n formatRelativeTime,\n getPriorityColor,\n getPriorityIcon,\n getNotificationTypeIcon,\n truncateText,\n} from '../utils';\nimport { nativeImpact, nativeOpenUrl } from '../utils/nativeBridge';\nimport { navigateInApp } from '../utils/inAppNavigation';\n\ninterface NotificationCardProps {\n notification: Notification;\n onMarkAsRead?: (id: string) => void;\n onArchive?: (id: string) => void;\n onAction?: (notificationId: string, actionId?: string) => void;\n onClick?: (notification: Notification) => void;\n showArchivedState?: boolean;\n compact?: boolean;\n analyticsSource?: 'center' | 'panel' | 'history' | 'admin_history';\n}\n\n/**\n * Notification card component\n *\n * Displays notification information with action buttons\n */\nexport function NotificationCard({\n notification,\n onMarkAsRead,\n onArchive,\n onAction,\n onClick,\n showArchivedState = false,\n compact = false,\n analyticsSource = 'center',\n}: NotificationCardProps) {\n const tr = useTr();\n const { trackNotificationOpened } = useNotificationAnalytics();\n const isUnread = !notification.readAt;\n const isArchived = Boolean(notification.archivedAt);\n\n const handleClick = () => {\n trackNotificationOpened(notification, analyticsSource, 'card');\n if (onClick) {\n onClick(notification);\n }\n if (isUnread && onMarkAsRead) {\n onMarkAsRead(notification.id);\n }\n };\n\n const handleArchive = (e: React.MouseEvent) => {\n e.stopPropagation();\n if (onArchive) {\n onArchive(notification.id);\n }\n };\n\n // A link into this app (an agent, a run, a vibe) opens in place, like the\n // shell's notification bell; only a link that leaves the app opens a new tab\n // (or the system browser on native).\n const openNotificationLink = (url: string) => {\n if (navigateInApp(url)) return;\n if (url.startsWith('https://')) {\n void nativeOpenUrl(url);\n } else {\n window.open(url, '_blank', 'noopener,noreferrer');\n }\n };\n\n const handleActionUrl = (e: React.MouseEvent) => {\n e.stopPropagation();\n nativeImpact('light');\n if (notification.actionUrl) {\n trackNotificationOpened(notification, analyticsSource, 'primary_action');\n onAction?.(notification.id);\n openNotificationLink(notification.actionUrl);\n }\n };\n\n const handleActionClick = (e: React.MouseEvent, actionId: string, actionUrl: string) => {\n e.stopPropagation();\n nativeImpact('light');\n trackNotificationOpened(notification, analyticsSource, 'custom_action');\n onAction?.(notification.id, actionId);\n openNotificationLink(actionUrl);\n };\n\n return (\n <div\n data-tour=\"notification-card\"\n className={`\n relative flex flex-col gap-2 p-4 rounded-lg border cursor-pointer\n transition-[box-shadow,border-color,opacity] duration-200 ease-in-out\n bg-gloss-card\n ${isUnread ? 'border-accent-primary/30 shadow-sm ring-1 ring-accent-primary/10' : 'border-border-seam opacity-75'}\n ${showArchivedState && isArchived ? 'border-dashed opacity-60' : ''}\n hover:shadow-[var(--shadow-pop)] hover:border-accent-primary/30 hover:opacity-100\n `}\n onClick={handleClick}\n >\n {/* Unread indicator */}\n {isUnread && (\n <div className=\"absolute top-4 left-1.5 w-2.5 h-2.5 bg-accent-primary rounded-full shadow-sm shadow-accent-primary/50 motion-safe:animate-vc-glow-pulse\" />\n )}\n\n {/* Header */}\n <div className=\"flex items-start justify-between gap-2 ml-3\">\n <div className=\"flex items-center gap-2 flex-1 min-w-0\">\n <span className=\"text-base\" aria-hidden=\"true\">\n {getNotificationTypeIcon(notification.type)}\n </span>\n <h3\n className={`text-sm truncate ${isUnread ? 'font-bold text-primary' : 'font-medium text-secondary'}`}\n >\n {compact ? truncateText(notification.title, 60) : notification.title}\n </h3>\n <span className=\"text-xs\" aria-label={`Priority: ${notification.priority}`}>\n {getPriorityIcon(notification.priority)}\n </span>\n </div>\n\n {onArchive && (\n <button\n data-tour=\"notification-archive-action\"\n onClick={handleArchive}\n className=\"flex-shrink-0 p-1 hover:bg-bg-sunken rounded transition-colors duration-150\"\n aria-label={tr('notifCommon.archiveNotification', 'Archive notification')}\n >\n <X size={16} className=\"text-tertiary hover:text-secondary\" />\n </button>\n )}\n </div>\n\n {/* Body */}\n <div className=\"ml-3\">\n {notification.media[0]?.url && (\n <img\n src={notification.media[0].thumbnailUrl || notification.media[0].url}\n alt={notification.media[0].label || notification.title}\n className=\"mb-3 h-40 w-full rounded-md object-cover border border-default\"\n />\n )}\n <p className={`text-sm text-secondary ${compact ? 'line-clamp-2' : ''}`}>\n {compact ? truncateText(notification.body, 120) : notification.body}\n </p>\n {notification.topic && (\n <div className=\"mt-2 inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-secondary\">\n {notification.topic.name}\n </div>\n )}\n </div>\n\n {notification.actions.length > 0 && !compact && (\n <div className=\"ml-3 flex flex-wrap gap-2\">\n {notification.actions.map((action) => (\n <button\n key={action.id}\n onClick={(e) => handleActionClick(e, action.id, action.url)}\n className={`rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${\n action.style === 'secondary'\n ? 'bg-bg-sunken text-secondary hover:bg-bg-sunken/80'\n : action.style === 'danger'\n ? 'bg-status-error-bg-subtle text-status-error-text hover:opacity-80'\n : 'bg-accent-primary text-white hover:opacity-90'\n }`}\n >\n {action.label}\n </button>\n ))}\n </div>\n )}\n\n {/* Footer */}\n <div className=\"flex items-center justify-between gap-2 ml-3\">\n <div className=\"flex items-center gap-2 text-xs text-tertiary\">\n <span className={getPriorityColor(notification.priority)}>{notification.priority}</span>\n {showArchivedState && isArchived && (\n <>\n <span>•</span>\n <span>{tr('notifCommon.archived', 'Archived')}</span>\n </>\n )}\n <span>•</span>\n <time dateTime={notification.createdAt}>\n {formatRelativeTime(notification.createdAt, tr)}\n </time>\n </div>\n\n {notification.actionUrl && (\n <button\n onClick={handleActionUrl}\n className=\"flex items-center gap-1 text-xs text-accent-primary hover:text-accent-primary/80 transition-colors duration-150\"\n aria-label={tr('notifCommon.openLink', 'Open link')}\n >\n <span>{tr('notifCommon.view', 'View')}</span>\n <ExternalLink size={12} />\n </button>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA8BA,SAAgB,EAAiB,EAC/B,iBACA,iBACA,cACA,aACA,YACA,uBAAoB,IACpB,aAAU,IACV,qBAAkB,YACM;CACxB,IAAM,IAAK,GAAO,EACZ,EAAE,+BAA4B,GAA0B,EACxD,IAAW,CAAC,EAAa,QACzB,IAAa,EAAQ,EAAa,YAElC,UAAoB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,EAAG;OAC1C,CAAA;MACH;QAEL,EAAa,aACZ,kBAAC,UAAD;KACE,SAAS;KACT,WAAU;KACV,cAAY,EAAG,wBAAwB,YAAY;eAHrD,CAKE,kBAAC,QAAD,EAAA,UAAO,EAAG,oBAAoB,OAAO,EAAQ,CAAA,EAC7C,kBAAC,GAAD,EAAc,MAAM,IAAM,CAAA,CACnB;OAEP;;GACF"}
1
+ {"version":3,"file":"NotificationCard.js","names":["_Fragment","NotificationCard","tr","useTr","useNotificationAnalytics","isUnread","notification","isArchived","handleClick","trackNotificationOpened","analyticsSource","onClick","onMarkAsRead","handleArchive","onArchive","openNotificationLink","navigateInApp","url","nativeOpenUrl","handleActionUrl","nativeImpact","onAction","handleActionClick","actionId","actionUrl","showArchivedState","getNotificationTypeIcon","compact","truncateText","getPriorityIcon","X","e","action","getPriorityColor","Fragment","formatRelativeTime","ExternalLink"],"sources":["../../src/components/NotificationCard.tsx"],"sourcesContent":["import { X, ExternalLink } from 'lucide-react';\nimport type { Notification } from '../types';\nimport { useNotificationAnalytics } from '../hooks/useNotificationAnalytics';\nimport { useTr } from '../shared/hooks/useTr';\nimport {\n formatRelativeTime,\n getPriorityColor,\n getPriorityIcon,\n getNotificationTypeIcon,\n truncateText,\n} from '../utils';\nimport { nativeImpact, nativeOpenUrl } from '../utils/nativeBridge';\nimport { navigateInApp } from '../utils/inAppNavigation';\n\ninterface NotificationCardProps {\n notification: Notification;\n onMarkAsRead?: (id: string) => void;\n onArchive?: (id: string) => void;\n onAction?: (notificationId: string, actionId?: string) => void;\n onClick?: (notification: Notification) => void;\n showArchivedState?: boolean;\n compact?: boolean;\n analyticsSource?: 'center' | 'panel' | 'history' | 'admin_history';\n}\n\n/**\n * Notification card component\n *\n * Displays notification information with action buttons\n */\nexport function NotificationCard({\n notification,\n onMarkAsRead,\n onArchive,\n onAction,\n onClick,\n showArchivedState = false,\n compact = false,\n analyticsSource = 'center',\n}: NotificationCardProps) {\n const tr = useTr();\n const { trackNotificationOpened } = useNotificationAnalytics();\n const isUnread = !notification.readAt;\n const isArchived = Boolean(notification.archivedAt);\n\n const handleClick = () => {\n trackNotificationOpened(notification, analyticsSource, 'card');\n if (onClick) {\n onClick(notification);\n }\n if (isUnread && onMarkAsRead) {\n onMarkAsRead(notification.id);\n }\n };\n\n const handleArchive = (e: React.MouseEvent) => {\n e.stopPropagation();\n if (onArchive) {\n onArchive(notification.id);\n }\n };\n\n // A link into this app (an agent, a run, a vibe) opens in place, like the\n // shell's notification bell; only a link that leaves the app opens a new tab\n // (or the system browser on native).\n const openNotificationLink = (url: string) => {\n if (navigateInApp(url)) return;\n if (url.startsWith('https://')) {\n void nativeOpenUrl(url);\n } else {\n window.open(url, '_blank', 'noopener,noreferrer');\n }\n };\n\n const handleActionUrl = (e: React.MouseEvent) => {\n e.stopPropagation();\n nativeImpact('light');\n if (notification.actionUrl) {\n trackNotificationOpened(notification, analyticsSource, 'primary_action');\n onAction?.(notification.id);\n openNotificationLink(notification.actionUrl);\n }\n };\n\n const handleActionClick = (e: React.MouseEvent, actionId: string, actionUrl: string) => {\n e.stopPropagation();\n nativeImpact('light');\n trackNotificationOpened(notification, analyticsSource, 'custom_action');\n onAction?.(notification.id, actionId);\n openNotificationLink(actionUrl);\n };\n\n return (\n <div\n data-tour=\"notification-card\"\n className={`\n relative flex flex-col gap-2 p-4 rounded-lg border cursor-pointer\n transition-[box-shadow,border-color,opacity] duration-200 ease-in-out\n bg-gloss-card\n ${isUnread ? 'border-accent-primary/30 shadow-sm ring-1 ring-accent-primary/10' : 'border-border-seam opacity-75'}\n ${showArchivedState && isArchived ? 'border-dashed opacity-60' : ''}\n hover:shadow-[var(--shadow-pop)] hover:border-accent-primary/30 hover:opacity-100\n `}\n onClick={handleClick}\n >\n {/* Unread indicator */}\n {isUnread && (\n <div className=\"absolute top-4 left-1.5 w-2.5 h-2.5 bg-accent-primary rounded-full shadow-sm shadow-accent-primary/50 motion-safe:animate-vc-glow-pulse\" />\n )}\n\n {/* Header */}\n <div className=\"flex items-start justify-between gap-2 ml-3\">\n <div className=\"flex items-center gap-2 flex-1 min-w-0\">\n <span className=\"text-base\" aria-hidden=\"true\">\n {getNotificationTypeIcon(notification.type)}\n </span>\n <h3\n className={`text-sm truncate ${isUnread ? 'font-bold text-primary' : 'font-medium text-secondary'}`}\n >\n {compact ? truncateText(notification.title, 60) : notification.title}\n </h3>\n <span className=\"text-xs\" aria-label={`Priority: ${notification.priority}`}>\n {getPriorityIcon(notification.priority)}\n </span>\n </div>\n\n {onArchive && (\n <button\n data-tour=\"notification-archive-action\"\n onClick={handleArchive}\n className=\"flex-shrink-0 p-1 hover:bg-bg-sunken rounded transition-colors duration-150\"\n aria-label={tr('notifCommon.archiveNotification', 'Archive notification')}\n >\n <X size={16} className=\"text-tertiary hover:text-secondary\" />\n </button>\n )}\n </div>\n\n {/* Body */}\n <div className=\"ml-3\">\n {notification.media[0]?.url && (\n <img\n src={notification.media[0].thumbnailUrl || notification.media[0].url}\n alt={notification.media[0].label || notification.title}\n className=\"mb-3 h-40 w-full rounded-md object-cover border border-default\"\n />\n )}\n <p className={`text-sm text-secondary ${compact ? 'line-clamp-2' : ''}`}>\n {compact ? truncateText(notification.body, 120) : notification.body}\n </p>\n {notification.topic && (\n <div className=\"mt-2 inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-secondary\">\n {notification.topic.name}\n </div>\n )}\n </div>\n\n {notification.actions.length > 0 && !compact && (\n <div className=\"ml-3 flex flex-wrap gap-2\">\n {notification.actions.map((action) => (\n <button\n key={action.id}\n onClick={(e) => handleActionClick(e, action.id, action.url)}\n className={`rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${\n action.style === 'secondary'\n ? 'bg-bg-sunken text-secondary hover:bg-bg-sunken/80'\n : action.style === 'danger'\n ? 'bg-status-error-bg-subtle text-status-error-text hover:opacity-80'\n : 'bg-accent-primary text-white hover:opacity-90'\n }`}\n >\n {action.label}\n </button>\n ))}\n </div>\n )}\n\n {/* Footer */}\n <div className=\"flex items-center justify-between gap-2 ml-3\">\n <div className=\"flex items-center gap-2 text-xs text-tertiary\">\n <span className={getPriorityColor(notification.priority)}>{notification.priority}</span>\n {showArchivedState && isArchived && (\n <>\n <span>•</span>\n <span>{tr('notifCommon.archived', 'Archived')}</span>\n </>\n )}\n <span>•</span>\n <time dateTime={notification.createdAt}>\n {formatRelativeTime(notification.createdAt, tr)}\n </time>\n </div>\n\n {notification.actionUrl && (\n <button\n onClick={handleActionUrl}\n className=\"flex items-center gap-1 text-xs text-accent-primary hover:text-accent-primary/80 transition-colors duration-150\"\n aria-label={tr('notifCommon.openLink', 'Open link')}\n >\n <span>{tr('notifCommon.view', 'View')}</span>\n <ExternalLink size={12} />\n </button>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA8BA,SAAgBC,EAAiB,EAC/B,iBACA,iBACA,cACA,aACA,YACA,uBAAoB,IACpB,aAAU,IACV,qBAAkB,YACM;CACxB,IAAMC,IAAKC,EAAM,GACX,EAAE,+BAA4BC,EAAyB,GACvDC,IAAW,CAACC,EAAa,QACzBC,IAAa,EAAQD,EAAa,YAElCE,UAAoB;EAKxB,AAJAC,EAAwBH,GAAcI,GAAiB,MAAM,GACzDC,KACFA,EAAQL,CAAY,GAElBD,KAAYO,KACdA,EAAaN,EAAa,EAAE;CAEhC,GAEMO,KAAiB,MAAwB;EAE7C,AADA,EAAE,gBAAgB,GACdC,KACFA,EAAUR,EAAa,EAAE;CAE7B,GAKMS,KAAwB,MAAgB;EAC5C,AAAIC,EAAcC,CAAG,MACjBA,EAAI,WAAW,UAAU,IAC3BC,EAAmBD,CAAG,IAEtB,OAAO,KAAKA,GAAK,UAAU,qBAAqB;CAEpD,GAEME,KAAmB,MAAwB;EAG/C,AAFA,EAAE,gBAAgB,GAClBC,EAAa,OAAO,GAChBd,EAAa,cACfG,EAAwBH,GAAcI,GAAiB,gBAAgB,GACvEW,IAAWf,EAAa,EAAE,GAC1BS,EAAqBT,EAAa,SAAS;CAE/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AAK,CAAA,CACnB;IAEP,CAAA,CAAA;;EACF;;AAET"}
@@ -0,0 +1,10 @@
1
+ interface NotificationPanelProps {
2
+ onViewAll?: () => void;
3
+ }
4
+ /**
5
+ * Notification dropdown panel
6
+ *
7
+ * Quick view of recent notifications that appears when clicking the bell icon
8
+ */
9
+ export declare function NotificationPanel({ onViewAll }: NotificationPanelProps): import('react').JSX.Element | null;
10
+ export {};
@@ -1,13 +1,13 @@
1
1
  import { useNotificationStore as e } from "../store/notificationStore.js";
2
2
  import { useNotifications as t } from "../hooks/useNotifications.js";
3
3
  import "../hooks/index.js";
4
- import { useTr as n } from "../shared/hooks/useTr.js";
5
- import { NotificationCard as r } from "./NotificationCard.js";
4
+ import { NotificationCard as n } from "./NotificationCard.js";
5
+ import { useTr as r } from "../shared/hooks/useTr.js";
6
6
  import { Bell as i, X as a } from "lucide-react";
7
7
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
- //#region src/components/NotificationPanel.tsx
8
+ // src/components/NotificationPanel.tsx
9
9
  function l({ onViewAll: l }) {
10
- let u = n(), { isPanelOpen: d, togglePanel: f } = e(), { notifications: p, unreadCount: m, markAsRead: h, markAllAsRead: g, archiveNotification: _, recordAction: v } = t();
10
+ let u = r(), { isPanelOpen: d, togglePanel: f } = e(), { notifications: p, unreadCount: m, markAsRead: h, markAllAsRead: g, archiveNotification: _, recordAction: v } = t();
11
11
  if (!d) return null;
12
12
  let y = p.slice(0, 5);
13
13
  return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
@@ -58,7 +58,7 @@ function l({ onViewAll: l }) {
58
58
  className: "flex-1 overflow-y-auto",
59
59
  children: y.length > 0 ? /* @__PURE__ */ s("div", {
60
60
  className: "flex flex-col gap-2 p-2",
61
- children: y.map((e) => /* @__PURE__ */ s(r, {
61
+ children: y.map((e) => /* @__PURE__ */ s(n, {
62
62
  notification: e,
63
63
  onMarkAsRead: h,
64
64
  onArchive: _,
@@ -98,7 +98,6 @@ function l({ onViewAll: l }) {
98
98
  ]
99
99
  })] });
100
100
  }
101
- //#endregion
102
101
  export { l as NotificationPanel };
103
102
 
104
103
  //# sourceMappingURL=NotificationPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationPanel.js","names":[],"sources":["../../src/components/NotificationPanel.tsx"],"sourcesContent":["import { X, Bell } from 'lucide-react';\nimport { useNotificationStore } from '../store/notificationStore';\nimport { useNotifications } from '../hooks';\nimport { NotificationCard } from './NotificationCard';\nimport { useTr } from '../shared/hooks/useTr';\n\ninterface NotificationPanelProps {\n onViewAll?: () => void;\n}\n\n/**\n * Notification dropdown panel\n *\n * Quick view of recent notifications that appears when clicking the bell icon\n */\nexport function NotificationPanel({ onViewAll }: NotificationPanelProps) {\n const tr = useTr();\n const { isPanelOpen, togglePanel } = useNotificationStore();\n const {\n notifications,\n unreadCount,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n } = useNotifications();\n\n if (!isPanelOpen) return null;\n\n // Show only the 5 most recent notifications\n const recentNotifications = notifications.slice(0, 5);\n\n return (\n <>\n {/* Backdrop */}\n <div className=\"fixed inset-0 z-40\" onClick={togglePanel} aria-hidden=\"true\" />\n\n {/* Panel */}\n <div\n data-tour=\"notification-panel\"\n className=\"absolute right-0 top-full mt-2 w-96 max-h-[600px] bg-gloss-card border border-border-seam rounded-lg shadow-[var(--shadow-pop)] z-50 overflow-hidden flex flex-col animate-in fade-in slide-in-from-top-2 duration-200\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between p-4 border-b border-border-seam bg-accent-wash\">\n <div className=\"flex items-center gap-2\">\n <Bell size={20} className=\"text-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifCommon.notifications', 'Notifications')}\n </h2>\n {unreadCount > 0 && (\n <span className=\"px-2 py-0.5 text-xs font-semibold tabular-nums text-white bg-primary-500 rounded-full\">\n {unreadCount}\n </span>\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n {unreadCount > 0 && (\n <button\n data-tour=\"notification-panel-mark-all-read\"\n onClick={markAllAsRead}\n className=\"text-xs text-accent-primary hover:text-accent-primary/80 transition-colors duration-150\"\n >\n {tr('notifCommon.markAllRead', 'Mark all read')}\n </button>\n )}\n <button\n onClick={togglePanel}\n className=\"p-1 hover:bg-bg-sunken rounded transition-colors duration-150\"\n aria-label={tr('notifCommon.closePanel', 'Close panel')}\n >\n <X size={16} className=\"text-tertiary\" />\n </button>\n </div>\n </div>\n\n {/* Notifications list */}\n <div className=\"flex-1 overflow-y-auto\">\n {recentNotifications.length > 0 ? (\n <div className=\"flex flex-col gap-2 p-2\">\n {recentNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n compact\n analyticsSource=\"panel\"\n />\n ))}\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center p-8 text-center animate-in fade-in duration-200\">\n <Bell size={48} className=\"text-tertiary mb-4\" />\n <p className=\"text-sm text-secondary\">\n {tr('notifCommon.noNotifications', 'No notifications')}\n </p>\n <p className=\"text-xs text-tertiary mt-1\">\n {tr('notifCommon.allCaughtUp', \"You're all caught up!\")}\n </p>\n </div>\n )}\n </div>\n\n {/* Footer */}\n {recentNotifications.length > 0 && (\n <div className=\"p-3 border-t border-default\">\n <button\n data-tour=\"notification-panel-view-all\"\n onClick={() => {\n togglePanel();\n if (onViewAll) onViewAll();\n }}\n className=\"w-full py-2 text-sm text-accent-primary hover:text-accent-primary/80 font-medium transition-colors duration-150\"\n >\n {tr('notifCommon.viewAllNotifications', 'View All Notifications')}\n </button>\n </div>\n )}\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,EAAkB,EAAE,gBAAqC;CACvE,IAAM,IAAK,GAAO,EACZ,EAAE,gBAAa,mBAAgB,GAAsB,EACrD,EACJ,kBACA,gBACA,eACA,kBACA,wBACA,oBACE,GAAkB;AAEtB,KAAI,CAAC,EAAa,Q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;;IAEJ,CAAA;GAGL,EAAoB,SAAS,KAC5B,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,UAAD;KACE,aAAU;KACV,eAAe;AAEb,MADA,GAAa,EACT,KAAW,GAAW;;KAE5B,WAAU;eAET,EAAG,oCAAoC,yBAAyB;KAC1D,CAAA;IACL,CAAA;GAEJ;IACL,EAAA,CAAA"}
1
+ {"version":3,"file":"NotificationPanel.js","names":["_Fragment","NotificationPanel","tr","useTr","useNotificationStore","useNotifications","isPanelOpen","recentNotifications","notifications","Fragment","togglePanel","Bell","unreadCount","markAllAsRead","X","NotificationCard","markAsRead","archiveNotification","recordAction","notification","onViewAll"],"sources":["../../src/components/NotificationPanel.tsx"],"sourcesContent":["import { X, Bell } from 'lucide-react';\nimport { useNotificationStore } from '../store/notificationStore';\nimport { useNotifications } from '../hooks';\nimport { NotificationCard } from './NotificationCard';\nimport { useTr } from '../shared/hooks/useTr';\n\ninterface NotificationPanelProps {\n onViewAll?: () => void;\n}\n\n/**\n * Notification dropdown panel\n *\n * Quick view of recent notifications that appears when clicking the bell icon\n */\nexport function NotificationPanel({ onViewAll }: NotificationPanelProps) {\n const tr = useTr();\n const { isPanelOpen, togglePanel } = useNotificationStore();\n const {\n notifications,\n unreadCount,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n } = useNotifications();\n\n if (!isPanelOpen) return null;\n\n // Show only the 5 most recent notifications\n const recentNotifications = notifications.slice(0, 5);\n\n return (\n <>\n {/* Backdrop */}\n <div className=\"fixed inset-0 z-40\" onClick={togglePanel} aria-hidden=\"true\" />\n\n {/* Panel */}\n <div\n data-tour=\"notification-panel\"\n className=\"absolute right-0 top-full mt-2 w-96 max-h-[600px] bg-gloss-card border border-border-seam rounded-lg shadow-[var(--shadow-pop)] z-50 overflow-hidden flex flex-col animate-in fade-in slide-in-from-top-2 duration-200\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between p-4 border-b border-border-seam bg-accent-wash\">\n <div className=\"flex items-center gap-2\">\n <Bell size={20} className=\"text-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifCommon.notifications', 'Notifications')}\n </h2>\n {unreadCount > 0 && (\n <span className=\"px-2 py-0.5 text-xs font-semibold tabular-nums text-white bg-primary-500 rounded-full\">\n {unreadCount}\n </span>\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n {unreadCount > 0 && (\n <button\n data-tour=\"notification-panel-mark-all-read\"\n onClick={markAllAsRead}\n className=\"text-xs text-accent-primary hover:text-accent-primary/80 transition-colors duration-150\"\n >\n {tr('notifCommon.markAllRead', 'Mark all read')}\n </button>\n )}\n <button\n onClick={togglePanel}\n className=\"p-1 hover:bg-bg-sunken rounded transition-colors duration-150\"\n aria-label={tr('notifCommon.closePanel', 'Close panel')}\n >\n <X size={16} className=\"text-tertiary\" />\n </button>\n </div>\n </div>\n\n {/* Notifications list */}\n <div className=\"flex-1 overflow-y-auto\">\n {recentNotifications.length > 0 ? (\n <div className=\"flex flex-col gap-2 p-2\">\n {recentNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n compact\n analyticsSource=\"panel\"\n />\n ))}\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center p-8 text-center animate-in fade-in duration-200\">\n <Bell size={48} className=\"text-tertiary mb-4\" />\n <p className=\"text-sm text-secondary\">\n {tr('notifCommon.noNotifications', 'No notifications')}\n </p>\n <p className=\"text-xs text-tertiary mt-1\">\n {tr('notifCommon.allCaughtUp', \"You're all caught up!\")}\n </p>\n </div>\n )}\n </div>\n\n {/* Footer */}\n {recentNotifications.length > 0 && (\n <div className=\"p-3 border-t border-default\">\n <button\n data-tour=\"notification-panel-view-all\"\n onClick={() => {\n togglePanel();\n if (onViewAll) onViewAll();\n }}\n className=\"w-full py-2 text-sm text-accent-primary hover:text-accent-primary/80 font-medium transition-colors duration-150\"\n >\n {tr('notifCommon.viewAllNotif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;MACd,cAAcC;MACd,WAAWC;MACX,UAAUC;MACV,SAAA;MACA,iBAAgB;KACjB,GAPMC,EAAa,EAOnB,CACF;IACE,CAAA,IAEL,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAACR,GAAD;OAAM,MAAM;OAAI,WAAU;MAAsB,CAAA;MAChD,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAT,EAAG,+BAA+B,kBAAkB;MACpD,CAAA;MACH,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAA,EAAG,2BAA2B,uBAAuB;MACrD,CAAA;KACA;;GAEJ,CAAA;GAGJK,EAAoB,SAAS,KAC5B,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAAC,UAAD;KACE,aAAU;KACV,eAAe;MAEb,AADAG,EAAY,GACRU,KAAWA,EAAU;KAC3B;KACA,WAAU;KAET,UAAAlB,EAAG,oCAAoC,wBAAwB;IAC1D,CAAA;GACL,CAAA;EAEJ;CACL,CAAA,CAAA,EAAA,CAAA;AAEN"}
@@ -0,0 +1,32 @@
1
+ import { RecipientInput, NotificationChannelType } from '../hooks/useSendNotification';
2
+ /**
3
+ * Recipient with display info
4
+ */
5
+ export interface Recipient extends RecipientInput {
6
+ id: string;
7
+ displayName: string;
8
+ type: 'email' | 'phone' | 'user' | 'manual';
9
+ }
10
+ interface RecipientSelectorProps {
11
+ recipients: Recipient[];
12
+ onChange: (recipients: Recipient[]) => void;
13
+ channel: NotificationChannelType;
14
+ placeholder?: string;
15
+ disabled?: boolean;
16
+ maxRecipients?: number;
17
+ error?: string;
18
+ }
19
+ /**
20
+ * RecipientSelector component
21
+ *
22
+ * Allows selecting multiple recipients for notifications.
23
+ * Supports email, phone, and manual input based on channel type.
24
+ */
25
+ export declare function RecipientSelector({ recipients, onChange, channel, placeholder, disabled, maxRecipients, error, }: RecipientSelectorProps): import('react').JSX.Element;
26
+ /**
27
+ * Compact recipient display for read-only views
28
+ */
29
+ export declare function RecipientList({ recipients }: {
30
+ recipients: Recipient[];
31
+ }): import('react').JSX.Element;
32
+ export {};
@@ -2,7 +2,7 @@ import { useTr as e } from "../shared/hooks/useTr.js";
2
2
  import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
3
3
  import { AlertCircle as a, Mail as o, Phone as s, Plus as c, User as l, X as u } from "lucide-react";
4
4
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
- //#region src/components/RecipientSelector.tsx
5
+ // src/components/RecipientSelector.tsx
6
6
  function p(e) {
7
7
  switch (e) {
8
8
  case "email": return /* @__PURE__ */ d(o, {
@@ -27,7 +27,7 @@ function m(e) {
27
27
  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
28
28
  }
29
29
  function h(e) {
30
- return /^\+?[1-9]\d{6,14}$/.test(e.replace(/[\s\-\(\)]/g, ""));
30
+ return /^\+?[1-9]\d{6,14}$/.test(e.replace(/[\s\-()]/g, ""));
31
31
  }
32
32
  function g() {
33
33
  return `recipient-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
@@ -206,7 +206,6 @@ function _({ recipients: o, onChange: s, channel: l, placeholder: _, disabled: v
206
206
  ]
207
207
  });
208
208
  }
209
- //#endregion
210
209
  export { _ as RecipientSelector };
211
210
 
212
211
  //# sourceMappingURL=RecipientSelector.js.map