@burdenoff/microfe-notification 2026.521.1 → 2026.522.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationBell.d.ts","sourceRoot":"","sources":["../../src/components/NotificationBell.tsx"],"names":[],"mappings":"AAeA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,2CAsFrE"}
1
+ {"version":3,"file":"NotificationBell.d.ts","sourceRoot":"","sources":["../../src/components/NotificationBell.tsx"],"names":[],"mappings":"AAeA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,2CAuFrE"}
@@ -48,6 +48,7 @@ function d({ onClick: d }) {
48
48
  };
49
49
  return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
50
50
  }, [y]), /* @__PURE__ */ u("button", {
51
+ "data-tour": "notification-bell",
51
52
  onClick: () => {
52
53
  d ? d() : _();
53
54
  },
@@ -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 } 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 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 onClick={handleClick}\n className=\"relative inline-flex items-center justify-center p-2 rounded-md hover:bg-muted transition-all duration-150 hover:scale-105\"\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 text-white bg-error rounded-full animate-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,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,eAVsB;AACxB,GAAI,IACF,GAAS,GAET,GAAa;;EAOb,WAAU;EACV,cAAY,GAAG,EAAG,6BAA6B,gBAAgB,GAAG,IAAc,IAAI,KAAK,EAAY,GAAG,EAAG,sBAAsB,SAAS,CAAC,KAAK;YAHlJ,CAKE,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":[],"sources":["../../src/components/NotificationBell.tsx"],"sourcesContent":["import { useCallback, useEffect } from 'react';\nimport { Bell } from 'lucide-react';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { getGlobalNotificationClient } 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 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-muted transition-all duration-150 hover:scale-105\"\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 text-white bg-error rounded-full animate-pulse\">\n {unreadCount > 99 ? '99+' : unread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,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 +1 @@
1
- {"version":3,"file":"NotificationCard.d.ts","sourceRoot":"","sources":["../../src/components/NotificationCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAY7C,UAAU,qBAAqB;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,eAAe,CAAC;CACpE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,iBAAyB,EACzB,OAAe,EACf,eAA0B,GAC3B,EAAE,qBAAqB,2CAiKvB"}
1
+ {"version":3,"file":"NotificationCard.d.ts","sourceRoot":"","sources":["../../src/components/NotificationCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAY7C,UAAU,qBAAqB;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,eAAe,CAAC;CACpE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,iBAAyB,EACzB,OAAe,EACf,eAA0B,GAC3B,EAAE,qBAAqB,2CAmKvB"}
@@ -20,6 +20,7 @@ function m({ notification: m, onMarkAsRead: h, onArchive: g, onAction: _, onClic
20
20
  e.stopPropagation(), s("light"), C(m, x, "custom_action"), _?.(m.id, t), n.startsWith("https://") ? c(n) : window.open(n, "_blank");
21
21
  };
22
22
  return /* @__PURE__ */ p("div", {
23
+ "data-tour": "notification-card",
23
24
  className: `
24
25
  relative flex flex-col gap-2 p-4 rounded-lg border cursor-pointer
25
26
  transition-all duration-200 ease-in-out
@@ -51,6 +52,7 @@ function m({ notification: m, onMarkAsRead: h, onArchive: g, onAction: _, onClic
51
52
  })
52
53
  ]
53
54
  }), g && /* @__PURE__ */ f("button", {
55
+ "data-tour": "notification-archive-action",
54
56
  onClick: D,
55
57
  className: "flex-shrink-0 p-1 hover:bg-muted rounded transition-colors duration-150",
56
58
  "aria-label": S("notifCommon.archiveNotification", "Archive notification"),
@@ -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';\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 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 const url = notification.actionUrl;\n if (url.startsWith('https://')) {\n void nativeOpenUrl(url);\n } else {\n window.open(url, '_blank');\n }\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 if (actionUrl.startsWith('https://')) {\n void nativeOpenUrl(actionUrl);\n } else {\n window.open(actionUrl, '_blank');\n }\n };\n\n return (\n <div\n className={`\n relative flex flex-col gap-2 p-4 rounded-lg border cursor-pointer\n transition-all duration-200 ease-in-out\n ${isUnread ? 'bg-accent-subtle/5 border-accent-primary/20 shadow-sm ring-1 ring-accent-primary/10' : 'bg-surface border-default opacity-75'}\n ${showArchivedState && isArchived ? 'border-dashed opacity-60' : ''}\n hover:bg-muted hover:shadow-md hover:-translate-y-0.5 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 animate-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 onClick={handleArchive}\n className=\"flex-shrink-0 p-1 hover:bg-muted 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-muted 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-muted text-secondary hover:bg-muted/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)}\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":";;;;;;;AA6BA,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;AAKxB,EAJA,EAAwB,GAAc,GAAiB,OAAO,EAC1D,KACF,EAAQ,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AS;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":[],"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';\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 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 const url = notification.actionUrl;\n if (url.startsWith('https://')) {\n void nativeOpenUrl(url);\n } else {\n window.open(url, '_blank');\n }\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 if (actionUrl.startsWith('https://')) {\n void nativeOpenUrl(actionUrl);\n } else {\n window.open(actionUrl, '_blank');\n }\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-all duration-200 ease-in-out\n ${isUnread ? 'bg-accent-subtle/5 border-accent-primary/20 shadow-sm ring-1 ring-accent-primary/10' : 'bg-surface border-default opacity-75'}\n ${showArchivedState && isArchived ? 'border-dashed opacity-60' : ''}\n hover:bg-muted hover:shadow-md hover:-translate-y-0.5 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 animate-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-muted 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-muted 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-muted text-secondary hover:bg-muted/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)}\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":";;;;;;;AA6BA,SAAgB,EAA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EAAA,UAAM,KAAQ,CAAA,EACd,kBAAC,QAAD,EAAA,UAAO,EAAG,wBAAwB,WAAW,EAAQ,CAAA,CACpD,EAAA,CAAA;MAEL,kBAAC,QAAD,EAAA,UAAM,KAAQ,CAAA;MACd,kBAAC,QAAD;OAAM,UAAU,EAAa;iBAC1B,EAAmB,EAAa,UAAU;OACtC,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 +1 @@
1
- {"version":3,"file":"NotificationPanel.d.ts","sourceRoot":"","sources":["../../src/components/NotificationPanel.tsx"],"names":[],"mappings":"AAMA,UAAU,sBAAsB;IAC9B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE,sBAAsB,kDAuGtE"}
1
+ {"version":3,"file":"NotificationPanel.d.ts","sourceRoot":"","sources":["../../src/components/NotificationPanel.tsx"],"names":[],"mappings":"AAMA,UAAU,sBAAsB;IAC9B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE,sBAAsB,kDA4GtE"}
@@ -15,6 +15,7 @@ function l({ onViewAll: l }) {
15
15
  onClick: f,
16
16
  "aria-hidden": "true"
17
17
  }), /* @__PURE__ */ c("div", {
18
+ "data-tour": "notification-panel",
18
19
  className: "absolute right-0 top-full mt-2 w-96 max-h-[600px] bg-surface border border-default rounded-lg shadow-lg z-50 overflow-hidden flex flex-col animate-in fade-in slide-in-from-top-2 duration-200",
19
20
  children: [
20
21
  /* @__PURE__ */ c("div", {
@@ -38,6 +39,7 @@ function l({ onViewAll: l }) {
38
39
  }), /* @__PURE__ */ c("div", {
39
40
  className: "flex items-center gap-2",
40
41
  children: [m > 0 && /* @__PURE__ */ s("button", {
42
+ "data-tour": "notification-panel-mark-all-read",
41
43
  onClick: g,
42
44
  className: "text-xs text-accent-primary hover:text-accent-primary/80 transition-colors duration-150",
43
45
  children: u("notifCommon.markAllRead", "Mark all read")
@@ -85,6 +87,7 @@ function l({ onViewAll: l }) {
85
87
  y.length > 0 && /* @__PURE__ */ s("div", {
86
88
  className: "p-3 border-t border-default",
87
89
  children: /* @__PURE__ */ s("button", {
90
+ "data-tour": "notification-panel-view-all",
88
91
  onClick: () => {
89
92
  f(), l && l();
90
93
  },
@@ -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 className=\"absolute right-0 top-full mt-2 w-96 max-h-[600px] bg-surface border border-default rounded-lg shadow-lg z-50 overflow-hidden flex flex-col animate-in fade-in slide-in-from-top-2 duration-200\">\n {/* Header */}\n <div className=\"flex items-center justify-between p-4 border-b border-default\">\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 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 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-muted 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-300\">\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 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 </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M,MAAM;OAAI,WAAU;OAAuB,CAAA;MACjD,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAG,+BAA+B,mBAAmB;OACpD,CAAA;MACJ,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAG,2BAA2B,wBAAwB;OACrD,CAAA;MACA;;IAEJ,CAAA;GAGL,EAAoB,SAAS,KAC5B,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,UAAD;KACE,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":[],"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-surface border border-default rounded-lg shadow-lg 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-default\">\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 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-muted 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-300\">\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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OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,GAAD;OAAM,MAAM;OAAI,WAAU;OAAuB,CAAA;MACjD,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAG,+BAA+B,mBAAmB;OACpD,CAAA;MACJ,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAG,2BAA2B,wBAAwB;OACrD,CAAA;MACA;;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 +1 @@
1
- {"version":3,"file":"NotificationCenterPage.d.ts","sourceRoot":"","sources":["../../src/pages/NotificationCenterPage.tsx"],"names":[],"mappings":"AA0BA;;;;GAIG;AACH,wBAAgB,sBAAsB,4CA2MrC"}
1
+ {"version":3,"file":"NotificationCenterPage.d.ts","sourceRoot":"","sources":["../../src/pages/NotificationCenterPage.tsx"],"names":[],"mappings":"AA0BA;;;;GAIG;AACH,wBAAgB,sBAAsB,4CAmNrC"}
@@ -72,6 +72,7 @@ function v() {
72
72
  className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-300",
73
73
  children: [
74
74
  /* @__PURE__ */ p("div", {
75
+ "data-tour": "notification-center-header",
75
76
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
76
77
  children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
77
78
  className: "text-xl sm:text-2xl font-bold text-primary",
@@ -80,12 +81,14 @@ function v() {
80
81
  className: "text-sm text-secondary mt-1",
81
82
  children: C > 0 ? `${v("notifications.youHave", "You have")} ${C} ${v("notifications.unreadNotifications", "unread notification")}${C > 1 ? "s" : ""}` : v("notifications.allCaughtUp", "All caught up!")
82
83
  })] }), C > 0 && /* @__PURE__ */ f("button", {
84
+ "data-tour": "notification-center-mark-all-read",
83
85
  onClick: E,
84
86
  className: "px-4 py-2 text-sm font-medium text-accent-primary hover:text-accent-primary/80 border border-accent-primary hover:border-accent-primary/80 rounded-lg transition-all duration-150 hover:shadow-sm",
85
87
  children: v("notifications.markAllAsRead", "Mark All as Read")
86
88
  })]
87
89
  }),
88
90
  /* @__PURE__ */ p("div", {
91
+ "data-tour": "notification-center-filters",
89
92
  className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",
90
93
  children: [
91
94
  /* @__PURE__ */ p("div", {
@@ -94,6 +97,7 @@ function v() {
94
97
  size: 16,
95
98
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
96
99
  }), /* @__PURE__ */ f("input", {
100
+ "data-tour": "notification-center-search",
97
101
  type: "text",
98
102
  placeholder: v("notifications.searchPlaceholder", "Search notifications..."),
99
103
  value: w.search,
@@ -164,6 +168,7 @@ function v() {
164
168
  ]
165
169
  }),
166
170
  /* @__PURE__ */ f("div", {
171
+ "data-tour": "notification-center-list",
167
172
  className: "space-y-6",
168
173
  children: M.length > 0 ? Object.entries(N).map(([e, t]) => /* @__PURE__ */ p("div", {
169
174
  className: "animate-in fade-in slide-in-from-bottom-2 duration-300",
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationCenterPage.js","names":[],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, Bell } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications\n */\nexport function NotificationCenterPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications),\n [filteredNotifications]\n );\n\n if (permissionsLoading) {\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 if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-300\">\n {/* Header */}\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.centerTitle', 'Notification Center')}\n </h1>\n <p className=\"text-sm text-secondary mt-1\">\n {unreadCount > 0\n ? `${tr('notifications.youHave', 'You have')} ${unreadCount} ${tr('notifications.unreadNotifications', 'unread notification')}${unreadCount > 1 ? 's' : ''}`\n : tr('notifications.allCaughtUp', 'All caught up!')}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <button\n onClick={markAllAsRead}\n className=\"px-4 py-2 text-sm font-medium text-accent-primary hover:text-accent-primary/80 border border-accent-primary hover:border-accent-primary/80 rounded-lg transition-all duration-150 hover:shadow-sm\"\n >\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </button>\n )}\n </div>\n\n {/* Filters */}\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4\">\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n {/* Type filter */}\n <select\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n {/* Priority filter */}\n <select\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n {/* Read/Unread filter */}\n <select\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </select>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </div>\n\n {/* Notifications list */}\n <div className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-300\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"flex flex-col items-center justify-center py-12 text-center animate-in fade-in duration-300\">\n <Bell size={48} className=\"text-tertiary mb-4\" />\n <h3 className=\"text-lg font-semibold text-primary mb-2\">\n {tr('notifications.noNotificationsFound', 'No notifications found')}\n </h3>\n <p className=\"text-sm text-secondary max-w-md\">\n {notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )}\n </p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAM,IAAgB;CAAE,UAAU;CAAO,SAAS;CAAmB,EAC/D,IAAuB,EAAE,SAAS,UAAU,EAC5C,IAAoF;CACxF;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;EAAU;CAC1E;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;EAAS;CACvE;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;EAAiB;CAC/F;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;EAAa;CACpF,EACK,IAA4F;CAChG;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;EAAU;CAC9E;EAAE,OAAO;EAAQ,UAAU;EAA8B,OAAO;EAAQ;CACxE;EAAE,OAAO;EAAU,UAAU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MACA;;IAEJ,CAAA;GACF"}
1
+ {"version":3,"file":"NotificationCenterPage.js","names":[],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, Bell } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications\n */\nexport function NotificationCenterPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications),\n [filteredNotifications]\n );\n\n if (permissionsLoading) {\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 if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-300\">\n {/* Header */}\n <div\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.centerTitle', 'Notification Center')}\n </h1>\n <p className=\"text-sm text-secondary mt-1\">\n {unreadCount > 0\n ? `${tr('notifications.youHave', 'You have')} ${unreadCount} ${tr('notifications.unreadNotifications', 'unread notification')}${unreadCount > 1 ? 's' : ''}`\n : tr('notifications.allCaughtUp', 'All caught up!')}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <button\n data-tour=\"notification-center-mark-all-read\"\n onClick={markAllAsRead}\n className=\"px-4 py-2 text-sm font-medium text-accent-primary hover:text-accent-primary/80 border border-accent-primary hover:border-accent-primary/80 rounded-lg transition-all duration-150 hover:shadow-sm\"\n >\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </button>\n )}\n </div>\n\n {/* Filters */}\n <div\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4\"\n >\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n data-tour=\"notification-center-search\"\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n {/* Type filter */}\n <select\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n {/* Priority filter */}\n <select\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n {/* Read/Unread filter */}\n <select\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </select>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </div>\n\n {/* Notifications list */}\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-300\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"flex flex-col items-center justify-center py-12 text-center animate-in fade-in duration-300\">\n <Bell size={48} className=\"text-tertiary mb-4\" />\n <h3 className=\"text-lg font-semibold text-primary mb-2\">\n {tr('notifications.noNotificationsFound', 'No notifications found')}\n </h3>\n <p className=\"text-sm text-secondary max-w-md\">\n {notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )}\n </p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAM,IAAgB;CAAE,UAAU;CAAO,SAAS;CAAmB,EAC/D,IAAuB,EAAE,SAAS,UAAU,EAC5C,IAAoF;CACxF;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;EAAU;CAC1E;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;EAAS;CACvE;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;EAAiB;CAC/F;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;EAAa;CACpF,EACK,IAA4F;CAChG;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;EAAU;CAC9E;EAAE,OAAO;EAAQ,UAAU;EAA8B,OAAO;EAAQ;CACxE;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;EAAU;CAC9E;EAAE,OAAO;EAAO,UAAU;EAA6B,OAAO;EAAO;CACtE;AAOD,SAAgB,IAAyB;CACvC,IAAM,IAAK,GAAO,EACZ,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,EAAE,mBAAgB,GAAiB,EACnC,EACJ,kBACA,gBACA,uBACA,eACA,kBACA,wBACA,iBACA,iBACA,mBACE,EAAiB;EAAE,YAAY;EAAe,cAAc;EAAsB,CAAC,EACjF,EAAE,cAAW,EAAsB,EAAE,UAAU,IAAM,CAAC,EAGtD,IAAwB,QACtB,EAAoB,GAAe,EAAmB,EAC5D,CAAC,GAAe,EAAmB,CACpC,EACK,IAAuB,QACrB,EAAyB,EAAsB,EACrD,CAAC,EAAsB,CACxB;AAkBD,QAhBI,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,WAAU,kFAAmF,CAAA;EAC9F,CAAA,GAIN,CAAC,EAAc,EAAyB,kBAAkB,IAAI,CAAC,GAAa,KAE5E,kBAAC,O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AAK,aAAU;IAA2B,WAAU;cACjD,EAAsB,SAAS,IAC9B,OAAO,QAAQ,EAAqB,CAAC,KAAK,CAAC,GAAO,OAChD,kBAAC,OAAD;KAAiB,WAAU;eAA3B,CACE,kBAAC,MAAD;MAAI,WAAU;gBAA4C;MAAW,CAAA,EACrE,kBAAC,OAAD;MAAK,WAAU;gBACZ,EAAmB,KAAK,MACvB,kBAAC,GAAD;OAEgB;OACd,cAAc;OACd,WAAW;OACX,UAAU;OACV,iBAAgB;OAChB,EANK,EAAa,GAMlB,CACF;MACE,CAAA,CACF;OAdI,EAcJ,CACN,GAEF,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,GAAD;OAAM,MAAM;OAAI,WAAU;OAAuB,CAAA;MACjD,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAG,sCAAsC,yBAAyB;OAChE,CAAA;MACL,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAc,WAAW,IACtB,EACE,oCACA,2FACD,GACD,EACE,+BACA,wDACD;OACH,CAAA;MACA;;IAEJ,CAAA;GACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationHistoryPage.d.ts","sourceRoot":"","sources":["../../src/pages/NotificationHistoryPage.tsx"],"names":[],"mappings":"AAWA,2FAA2F;AAC3F,wBAAgB,uBAAuB,4CA+JtC"}
1
+ {"version":3,"file":"NotificationHistoryPage.d.ts","sourceRoot":"","sources":["../../src/pages/NotificationHistoryPage.tsx"],"names":[],"mappings":"AAWA,2FAA2F;AAC3F,wBAAgB,uBAAuB,4CAmKtC"}
@@ -26,6 +26,7 @@ function m() {
26
26
  className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-300",
27
27
  children: [
28
28
  /* @__PURE__ */ f("div", {
29
+ "data-tour": "notification-history-header",
29
30
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
30
31
  children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h1", {
31
32
  className: "text-xl sm:text-2xl font-bold text-primary",
@@ -34,6 +35,7 @@ function m() {
34
35
  className: "text-sm text-secondary mt-1",
35
36
  children: m("notifications.historySubtitle", "View and search all your notifications")
36
37
  })] }), /* @__PURE__ */ f("button", {
38
+ "data-tour": "notification-history-export",
37
39
  onClick: () => o(m, y),
38
40
  disabled: y.length === 0,
39
41
  className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-accent-primary hover:text-accent-primary/80 border border-accent-primary hover:border-accent-primary/80 rounded-lg transition-all duration-150 hover:shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationHistoryPage.js","names":[],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Archive, Download, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/** User Notification History — personal history, filter, CSV export, archive/unarchive. */\nexport function NotificationHistoryPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics } = useNotificationTopics({ isActive: true });\n const {\n notifications,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n\n if (permissionsLoading) {\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 if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-300\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.historyTitle', 'Notification History')}\n </h1>\n <p className=\"text-sm text-secondary mt-1\">\n {tr('notifications.historySubtitle', 'View and search all your notifications')}\n </p>\n </div>\n\n <button\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"flex items-center gap-2 px-4 py-2 text-sm font-medium text-accent-primary hover:text-accent-primary/80 border border-accent-primary hover:border-accent-primary/80 rounded-lg transition-all duration-150 hover:shadow-sm disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </button>\n </div>\n\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-5\">\n <div className=\"relative sm:col-span-2 xl:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(event) => updateFilter({ topicId: event.target.value || undefined })}\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n <input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={\n notificationFilter.dateRange.start\n ? notificationFilter.dateRange.start.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n start: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n\n <input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={\n notificationFilter.dateRange.end\n ? notificationFilter.dateRange.end.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n end: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n </div>\n\n <div className=\"space-y-2\">\n {notifications.length > 0 ? (\n notifications.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <button\n onClick={() => unarchiveNotification(notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-muted\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"flex flex-col items-center justify-center py-12 text-center animate-in fade-in duration-300\">\n <Archive size={48} className=\"text-tertiary mb-4\" />\n <h3 className=\"text-lg font-semibold text-primary mb-2\">\n {tr('notifications.noNotificationsFound', 'No notifications found')}\n </h3>\n <p className=\"text-sm text-secondary\">\n {tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')}\n </p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AASA,IAAM,IAAiB;CAAE,UAAU;CAAM,SAAS;CAAgB;AAGlE,SAAgB,IAA0B;CACxC,IAAM,IAAK,GAAO,EACZ,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,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AC,GAAD;OAAS,MAAM;OAAI,WAAU;OAAuB,CAAA;MACpD,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAG,sCAAsC,yBAAyB;OAChE,CAAA;MACL,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAG,yCAAyC,6BAA6B;OACxE,CAAA;MACA;;IAEJ,CAAA;GACF"}
1
+ {"version":3,"file":"NotificationHistoryPage.js","names":[],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Archive, Download, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/** User Notification History — personal history, filter, CSV export, archive/unarchive. */\nexport function NotificationHistoryPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics } = useNotificationTopics({ isActive: true });\n const {\n notifications,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n\n if (permissionsLoading) {\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 if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-300\">\n <div\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.historyTitle', 'Notification History')}\n </h1>\n <p className=\"text-sm text-secondary mt-1\">\n {tr('notifications.historySubtitle', 'View and search all your notifications')}\n </p>\n </div>\n\n <button\n data-tour=\"notification-history-export\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"flex items-center gap-2 px-4 py-2 text-sm font-medium text-accent-primary hover:text-accent-primary/80 border border-accent-primary hover:border-accent-primary/80 rounded-lg transition-all duration-150 hover:shadow-sm disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </button>\n </div>\n\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-5\">\n <div className=\"relative sm:col-span-2 xl:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(event) => updateFilter({ topicId: event.target.value || undefined })}\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n <input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={\n notificationFilter.dateRange.start\n ? notificationFilter.dateRange.start.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n start: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n\n <input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={\n notificationFilter.dateRange.end\n ? notificationFilter.dateRange.end.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n end: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n </div>\n\n <div className=\"space-y-2\">\n {notifications.length > 0 ? (\n notifications.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <button\n onClick={() => unarchiveNotification(notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-muted\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"flex flex-col items-center justify-center py-12 text-center animate-in fade-in duration-300\">\n <Archive size={48} className=\"text-tertiary mb-4\" />\n <h3 className=\"text-lg font-semibold text-primary mb-2\">\n {tr('notifications.noNotificationsFound', 'No notifications found')}\n </h3>\n <p className=\"text-sm text-secondary\">\n {tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')}\n </p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AASA,IAAM,IAAiB;CAAE,UAAU;CAAM,SAAS;CAAgB;AAGlE,SAAgB,IAA0B;CACxC,IAAM,IAAK,GAAO,EACZ,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,EAAE,mBAAgB,GAAiB,EACnC,EAAE,cAAW,EAAsB,EAAE,UAAU,IAAM,CAAC,EACtD,EACJ,kBACA,uBACA,iBACA,w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ACX,EAAG,sCAAsC,yBAAyB;OAChE,CAAA;MACL,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAG,yCAAyC,6BAA6B;OACxE,CAAA;MACA;;IAEJ,CAAA;GACF"}
@@ -203,6 +203,7 @@ function S() {
203
203
  className: "p-8 text-center text-text-secondary",
204
204
  children: S("notifications.noPermissionPreferences", "You don't have permission to manage notification preferences.")
205
205
  }) : /* @__PURE__ */ v("div", {
206
+ "data-tour": "notification-preferences-page",
206
207
  className: "space-y-6 p-4 sm:p-6",
207
208
  children: [
208
209
  /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h1", {
@@ -213,6 +214,7 @@ function S() {
213
214
  children: S("notifications.preferencesSubtitle", "Control global, channel, type, and topic-level notification delivery.")
214
215
  })] }),
215
216
  /* @__PURE__ */ v("section", {
217
+ "data-tour": "notification-preferences-global",
216
218
  className: "space-y-3",
217
219
  children: [/* @__PURE__ */ _("h2", {
218
220
  className: "text-sm font-semibold uppercase tracking-wide text-tertiary",
@@ -225,6 +227,7 @@ function S() {
225
227
  })]
226
228
  }),
227
229
  /* @__PURE__ */ v("section", {
230
+ "data-tour": "notification-preferences-channels",
228
231
  className: "space-y-3",
229
232
  children: [/* @__PURE__ */ _("h2", {
230
233
  className: "text-sm font-semibold uppercase tracking-wide text-tertiary",
@@ -241,6 +244,7 @@ function S() {
241
244
  })]
242
245
  }),
243
246
  /* @__PURE__ */ v("section", {
247
+ "data-tour": "notification-preferences-types",
244
248
  className: "space-y-3",
245
249
  children: [/* @__PURE__ */ _("h2", {
246
250
  className: "text-sm font-semibold uppercase tracking-wide text-tertiary",
@@ -271,6 +275,7 @@ function S() {
271
275
  })]
272
276
  }),
273
277
  /* @__PURE__ */ v("section", {
278
+ "data-tour": "notification-preferences-topics",
274
279
  className: "space-y-3",
275
280
  children: [/* @__PURE__ */ _("h2", {
276
281
  className: "text-sm font-semibold uppercase tracking-wide text-tertiary",
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationPreferencesPage.js","names":[],"sources":["../../src/pages/NotificationPreferencesPage.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\nimport { BellRing, Search, ToggleLeft, ToggleRight } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useNotificationPreferences, useNotificationTopics } from '../hooks';\nimport { useNotificationAnalytics } from '../hooks/useNotificationAnalytics';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationChannel, NotificationPreferenceScope, NotificationType } from '../types';\nimport { nativeImpact, nativeNotify } from '../utils/nativeBridge';\n\nconst CHANNEL_OPTIONS: Array<{ value: NotificationChannel; labelKey: string; label: string }> = [\n { value: 'IN_APP', labelKey: 'notifications.channelInApp', label: 'In-app' },\n { value: 'EMAIL', labelKey: 'notifications.channelEmail', label: 'Email' },\n { value: 'PUSH', labelKey: 'notifications.channelPush', label: 'Push' },\n { value: 'SMS', labelKey: 'notifications.channelSms', label: 'SMS' },\n { value: 'WHATSAPP', labelKey: 'notifications.channelWhatsapp', label: 'WhatsApp' },\n { value: 'SLACK', labelKey: 'notifications.channelSlack', label: 'Slack' },\n];\n\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alerts' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\n\nfunction preferenceKey(input: {\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n}) {\n if (input.scope === 'CHANNEL') return `CHANNEL:${input.channel || ''}`;\n if (input.scope === 'TYPE') return `TYPE:${input.type || ''}`;\n if (input.scope === 'TOPIC') return `TOPIC:${input.topicId || ''}`;\n return 'GLOBAL';\n}\n\nexport function NotificationPreferencesPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics, isLoading: topicsLoading } = useNotificationTopics({\n type: 'MARKETING',\n isActive: true,\n });\n const {\n preferencesByKey,\n isLoading: preferencesLoading,\n setPreference,\n deletePreference,\n } = useNotificationPreferences();\n const { trackPreferenceUpdated } = useNotificationAnalytics();\n const [search, setSearch] = useState('');\n const [savingKey, setSavingKey] = useState<string | null>(null);\n const [saveFeedback, setSaveFeedback] = useState<{\n key: string;\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const feedbackTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const isLoading = topicsLoading || preferencesLoading;\n\n useEffect(() => {\n return () => {\n if (feedbackTimerRef.current) {\n clearTimeout(feedbackTimerRef.current);\n }\n };\n }, []);\n\n const showSaveFeedback = (feedback: {\n key: string;\n type: 'success' | 'error';\n message: string;\n }) => {\n if (feedbackTimerRef.current) {\n clearTimeout(feedbackTimerRef.current);\n }\n\n setSaveFeedback(feedback);\n feedbackTimerRef.current = setTimeout(() => {\n setSaveFeedback((current) => (current?.key === feedback.key ? null : current));\n feedbackTimerRef.current = null;\n }, 2500);\n };\n\n const filteredTopics = useMemo(() => {\n if (!search.trim()) {\n return topics;\n }\n\n const query = search.toLowerCase();\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\n\n const togglePreference = async (input: {\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n }) => {\n const key = preferenceKey(input);\n const existing = preferencesByKey.get(key);\n const nextEnabled = !(existing?.enabled ?? true);\n setSavingKey(key);\n nativeImpact('medium');\n try {\n await setPreference({\n ...input,\n enabled: nextEnabled,\n frequency: existing?.frequency || 'IMMEDIATE',\n });\n trackPreferenceUpdated({\n action: 'set',\n scope: input.scope,\n channel: input.channel,\n type: input.type,\n enabled: nextEnabled,\n });\n showSaveFeedback({\n key,\n type: 'success',\n message: tr('notifications.preferenceSaved', 'Preference saved.'),\n });\n void nativeNotify('success');\n } catch {\n showSaveFeedback({\n key,\n type: 'error',\n message: tr('notifications.preferenceSaveFailed', 'Could not save preference.'),\n });\n void nativeNotify('error');\n } finally {\n setSavingKey(null);\n }\n };\n\n const resetPreference = async (key: string) => {\n const existing = preferencesByKey.get(key);\n if (!existing) return;\n setSavingKey(key);\n try {\n await deletePreference(existing.id);\n trackPreferenceUpdated({\n action: 'reset',\n scope: existing.scope,\n channel: existing.channel,\n type: existing.type,\n });\n showSaveFeedback({\n key,\n type: 'success',\n message: tr('notifications.preferenceReset', 'Preference reset.'),\n });\n } catch {\n showSaveFeedback({\n key,\n type: 'error',\n message: tr('notifications.preferenceResetFailed', 'Could not reset preference.'),\n });\n } finally {\n setSavingKey(null);\n }\n };\n\n const renderPreferenceRow = (input: {\n key: string;\n title: string;\n description: string;\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n }) => {\n const existing = preferencesByKey.get(input.key);\n const isEnabled = existing?.enabled ?? true;\n const isSaving = savingKey === input.key;\n const feedback = saveFeedback?.key === input.key ? saveFeedback : null;\n\n return (\n <div key={input.key} className=\"rounded-lg border border-default bg-surface p-4 shadow-sm\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2\">\n <BellRing size={16} className=\"text-accent-primary\" />\n <h2 className=\"text-sm font-semibold text-primary\">{input.title}</h2>\n {existing && (\n <span className=\"rounded-full bg-muted px-2 py-0.5 text-xs text-secondary\">\n {existing.frequency.replace('_', ' ').toLowerCase()}\n </span>\n )}\n </div>\n <p className=\"text-sm text-secondary\">{input.description}</p>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {existing && (\n <button\n type=\"button\"\n disabled={isSaving}\n onClick={() => resetPreference(input.key)}\n className=\"rounded-md border border-default px-3 py-2 text-sm text-secondary hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {tr('notifications.reset', 'Reset')}\n </button>\n )}\n <button\n type=\"button\"\n aria-pressed={isEnabled}\n disabled={isSaving}\n onClick={() =>\n togglePreference({\n scope: input.scope,\n channel: input.channel,\n type: input.type,\n topicId: input.topicId,\n })\n }\n className={`inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors ${\n isEnabled\n ? 'border-accent-primary bg-action-primary-bg text-text-inverse hover:opacity-90'\n : 'border-default bg-muted text-secondary hover:bg-muted/80'\n } disabled:cursor-not-allowed disabled:opacity-50`}\n >\n {isEnabled ? <ToggleRight size={18} /> : <ToggleLeft size={18} />}\n {isSaving\n ? tr('notifications.saving', 'Saving...')\n : isEnabled\n ? tr('notifications.enabled', 'Enabled')\n : tr('notifications.disabled', 'Disabled')}\n </button>\n </div>\n </div>\n <div className=\"mt-3 min-h-5\" aria-live=\"polite\">\n {feedback && (\n <p className={`text-xs ${feedback.type === 'success' ? 'text-success' : 'text-error'}`}>\n {feedback.message}\n </p>\n )}\n </div>\n </div>\n );\n };\n\n if (permissionsLoading) {\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 if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionPreferences',\n \"You don't have permission to manage notification preferences.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <h1 className=\"text-2xl font-bold text-primary\">\n {tr('notifications.preferencesTitle', 'Notification Preferences')}\n </h1>\n <p className=\"mt-1 text-sm text-secondary\">\n {tr(\n 'notifications.preferencesSubtitle',\n 'Control global, channel, type, and topic-level notification delivery.'\n )}\n </p>\n </div>\n\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.globalPreferences', 'Global')}\n </h2>\n {renderPreferenceRow({\n key: 'GLOBAL',\n scope: 'GLOBAL',\n title: tr('notifications.allNotifications', 'All notifications'),\n description: tr(\n 'notifications.allNotificationsDescription',\n 'Master preference for notification delivery across all channels and types.'\n ),\n })}\n </section>\n\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.channelPreferences', 'Channels')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {CHANNEL_OPTIONS.map((channel) =>\n renderPreferenceRow({\n key: `CHANNEL:${channel.value}`,\n scope: 'CHANNEL',\n channel: channel.value,\n title: tr(channel.labelKey, channel.label),\n description: tr(\n 'notifications.channelPreferenceDescription',\n 'Control delivery for this channel.'\n ),\n })\n )}\n </div>\n </section>\n\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.typePreferences', 'Notification Types')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {TYPE_OPTIONS.map((type) =>\n renderPreferenceRow({\n key: `TYPE:${type.value}`,\n scope: 'TYPE',\n type: type.value,\n title: tr(type.labelKey, type.label),\n description: tr(\n 'notifications.typePreferenceDescription',\n 'Control delivery for this notification type.'\n ),\n })\n )}\n </div>\n </section>\n\n <div className=\"relative max-w-xl\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n aria-label={tr('notifications.searchTopics', 'Search topics...')}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"w-full rounded-lg border border-default bg-surface py-2 pl-9 pr-4 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </div>\n\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.topicPreferences', 'Topics')}\n </h2>\n {isLoading ? (\n <div className=\"rounded-lg border border-default bg-surface p-6 text-sm text-secondary\">\n {tr('notifications.loadingPreferences', 'Loading preferences...')}\n </div>\n ) : filteredTopics.length === 0 ? (\n <div className=\"rounded-lg border border-default bg-surface p-6 text-sm text-secondary\">\n {tr('notifications.noTopicsFound', 'No promotional topics available right now.')}\n </div>\n ) : (\n filteredTopics.map((topic) =>\n renderPreferenceRow({\n key: `TOPIC:${topic.id}`,\n scope: 'TOPIC',\n topicId: topic.id,\n title: topic.name,\n description: topic.description || topic.slug,\n })\n )\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAM,IAA0F;CAC9F;EAAE,OAAO;EAAU,UAAU;EAA8B,OAAO;EAAU;CAC5E;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;EAAS;CAC1E;EAAE,OAAO;EAAQ,UAAU;EAA6B,OAAO;EAAQ;CACvE;EAAE,OAAO;EAAO,UAAU;EAA4B,OAAO;EAAO;CACpE;EAAE,OAAO;EAAY,UAAU;EAAiC,OAAO;EAAY;CACnF;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;EAAS;CAC3E,EAEK,IAAoF;CACxF;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;EAAiB;CAC/F;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;EAAU;CAC1E;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;EAAU;CACxE;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;EAAa;CACpF;AAED,SAAS,EAAc,GAKpB;AAID,QAHI,EAAM,UAAU,YAAkB,WAAW,EAAM,WAAW,OAC9D,EAAM,UAAU,SAAe,QAAQ,EAAM,QAAQ,OACrD,EAAM,UAAU,UAAgB,SAAS,EAAM,WAAW,OACvD;;AAGT,SAAgB,IAA8B;CAC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5C,CAAA,EACJ,IACC,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAG,oCAAoC,yBAAyB;KAC7D,CAAA,GACJ,EAAe,WAAW,IAC5B,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAG,+BAA+B,6CAA6C;KAC5E,CAAA,GAEN,EAAe,KAAK,MAClB,EAAoB;KAClB,KAAK,SAAS,EAAM;KACpB,OAAO;KACP,SAAS,EAAM;KACf,OAAO,EAAM;KACb,aAAa,EAAM,eAAe,EAAM;KACzC,CAAC,CACH,CAEK;;GACN"}
1
+ {"version":3,"file":"NotificationPreferencesPage.js","names":[],"sources":["../../src/pages/NotificationPreferencesPage.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\nimport { BellRing, Search, ToggleLeft, ToggleRight } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useNotificationPreferences, useNotificationTopics } from '../hooks';\nimport { useNotificationAnalytics } from '../hooks/useNotificationAnalytics';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationChannel, NotificationPreferenceScope, NotificationType } from '../types';\nimport { nativeImpact, nativeNotify } from '../utils/nativeBridge';\n\nconst CHANNEL_OPTIONS: Array<{ value: NotificationChannel; labelKey: string; label: string }> = [\n { value: 'IN_APP', labelKey: 'notifications.channelInApp', label: 'In-app' },\n { value: 'EMAIL', labelKey: 'notifications.channelEmail', label: 'Email' },\n { value: 'PUSH', labelKey: 'notifications.channelPush', label: 'Push' },\n { value: 'SMS', labelKey: 'notifications.channelSms', label: 'SMS' },\n { value: 'WHATSAPP', labelKey: 'notifications.channelWhatsapp', label: 'WhatsApp' },\n { value: 'SLACK', labelKey: 'notifications.channelSlack', label: 'Slack' },\n];\n\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alerts' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\n\nfunction preferenceKey(input: {\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n}) {\n if (input.scope === 'CHANNEL') return `CHANNEL:${input.channel || ''}`;\n if (input.scope === 'TYPE') return `TYPE:${input.type || ''}`;\n if (input.scope === 'TOPIC') return `TOPIC:${input.topicId || ''}`;\n return 'GLOBAL';\n}\n\nexport function NotificationPreferencesPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics, isLoading: topicsLoading } = useNotificationTopics({\n type: 'MARKETING',\n isActive: true,\n });\n const {\n preferencesByKey,\n isLoading: preferencesLoading,\n setPreference,\n deletePreference,\n } = useNotificationPreferences();\n const { trackPreferenceUpdated } = useNotificationAnalytics();\n const [search, setSearch] = useState('');\n const [savingKey, setSavingKey] = useState<string | null>(null);\n const [saveFeedback, setSaveFeedback] = useState<{\n key: string;\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const feedbackTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const isLoading = topicsLoading || preferencesLoading;\n\n useEffect(() => {\n return () => {\n if (feedbackTimerRef.current) {\n clearTimeout(feedbackTimerRef.current);\n }\n };\n }, []);\n\n const showSaveFeedback = (feedback: {\n key: string;\n type: 'success' | 'error';\n message: string;\n }) => {\n if (feedbackTimerRef.current) {\n clearTimeout(feedbackTimerRef.current);\n }\n\n setSaveFeedback(feedback);\n feedbackTimerRef.current = setTimeout(() => {\n setSaveFeedback((current) => (current?.key === feedback.key ? null : current));\n feedbackTimerRef.current = null;\n }, 2500);\n };\n\n const filteredTopics = useMemo(() => {\n if (!search.trim()) {\n return topics;\n }\n\n const query = search.toLowerCase();\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\n\n const togglePreference = async (input: {\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n }) => {\n const key = preferenceKey(input);\n const existing = preferencesByKey.get(key);\n const nextEnabled = !(existing?.enabled ?? true);\n setSavingKey(key);\n nativeImpact('medium');\n try {\n await setPreference({\n ...input,\n enabled: nextEnabled,\n frequency: existing?.frequency || 'IMMEDIATE',\n });\n trackPreferenceUpdated({\n action: 'set',\n scope: input.scope,\n channel: input.channel,\n type: input.type,\n enabled: nextEnabled,\n });\n showSaveFeedback({\n key,\n type: 'success',\n message: tr('notifications.preferenceSaved', 'Preference saved.'),\n });\n void nativeNotify('success');\n } catch {\n showSaveFeedback({\n key,\n type: 'error',\n message: tr('notifications.preferenceSaveFailed', 'Could not save preference.'),\n });\n void nativeNotify('error');\n } finally {\n setSavingKey(null);\n }\n };\n\n const resetPreference = async (key: string) => {\n const existing = preferencesByKey.get(key);\n if (!existing) return;\n setSavingKey(key);\n try {\n await deletePreference(existing.id);\n trackPreferenceUpdated({\n action: 'reset',\n scope: existing.scope,\n channel: existing.channel,\n type: existing.type,\n });\n showSaveFeedback({\n key,\n type: 'success',\n message: tr('notifications.preferenceReset', 'Preference reset.'),\n });\n } catch {\n showSaveFeedback({\n key,\n type: 'error',\n message: tr('notifications.preferenceResetFailed', 'Could not reset preference.'),\n });\n } finally {\n setSavingKey(null);\n }\n };\n\n const renderPreferenceRow = (input: {\n key: string;\n title: string;\n description: string;\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n }) => {\n const existing = preferencesByKey.get(input.key);\n const isEnabled = existing?.enabled ?? true;\n const isSaving = savingKey === input.key;\n const feedback = saveFeedback?.key === input.key ? saveFeedback : null;\n\n return (\n <div key={input.key} className=\"rounded-lg border border-default bg-surface p-4 shadow-sm\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2\">\n <BellRing size={16} className=\"text-accent-primary\" />\n <h2 className=\"text-sm font-semibold text-primary\">{input.title}</h2>\n {existing && (\n <span className=\"rounded-full bg-muted px-2 py-0.5 text-xs text-secondary\">\n {existing.frequency.replace('_', ' ').toLowerCase()}\n </span>\n )}\n </div>\n <p className=\"text-sm text-secondary\">{input.description}</p>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {existing && (\n <button\n type=\"button\"\n disabled={isSaving}\n onClick={() => resetPreference(input.key)}\n className=\"rounded-md border border-default px-3 py-2 text-sm text-secondary hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {tr('notifications.reset', 'Reset')}\n </button>\n )}\n <button\n type=\"button\"\n aria-pressed={isEnabled}\n disabled={isSaving}\n onClick={() =>\n togglePreference({\n scope: input.scope,\n channel: input.channel,\n type: input.type,\n topicId: input.topicId,\n })\n }\n className={`inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors ${\n isEnabled\n ? 'border-accent-primary bg-action-primary-bg text-text-inverse hover:opacity-90'\n : 'border-default bg-muted text-secondary hover:bg-muted/80'\n } disabled:cursor-not-allowed disabled:opacity-50`}\n >\n {isEnabled ? <ToggleRight size={18} /> : <ToggleLeft size={18} />}\n {isSaving\n ? tr('notifications.saving', 'Saving...')\n : isEnabled\n ? tr('notifications.enabled', 'Enabled')\n : tr('notifications.disabled', 'Disabled')}\n </button>\n </div>\n </div>\n <div className=\"mt-3 min-h-5\" aria-live=\"polite\">\n {feedback && (\n <p className={`text-xs ${feedback.type === 'success' ? 'text-success' : 'text-error'}`}>\n {feedback.message}\n </p>\n )}\n </div>\n </div>\n );\n };\n\n if (permissionsLoading) {\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 if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionPreferences',\n \"You don't have permission to manage notification preferences.\"\n )}\n </div>\n );\n }\n\n return (\n <div data-tour=\"notification-preferences-page\" className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <h1 className=\"text-2xl font-bold text-primary\">\n {tr('notifications.preferencesTitle', 'Notification Preferences')}\n </h1>\n <p className=\"mt-1 text-sm text-secondary\">\n {tr(\n 'notifications.preferencesSubtitle',\n 'Control global, channel, type, and topic-level notification delivery.'\n )}\n </p>\n </div>\n\n <section data-tour=\"notification-preferences-global\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.globalPreferences', 'Global')}\n </h2>\n {renderPreferenceRow({\n key: 'GLOBAL',\n scope: 'GLOBAL',\n title: tr('notifications.allNotifications', 'All notifications'),\n description: tr(\n 'notifications.allNotificationsDescription',\n 'Master preference for notification delivery across all channels and types.'\n ),\n })}\n </section>\n\n <section data-tour=\"notification-preferences-channels\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.channelPreferences', 'Channels')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {CHANNEL_OPTIONS.map((channel) =>\n renderPreferenceRow({\n key: `CHANNEL:${channel.value}`,\n scope: 'CHANNEL',\n channel: channel.value,\n title: tr(channel.labelKey, channel.label),\n description: tr(\n 'notifications.channelPreferenceDescription',\n 'Control delivery for this channel.'\n ),\n })\n )}\n </div>\n </section>\n\n <section data-tour=\"notification-preferences-types\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.typePreferences', 'Notification Types')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {TYPE_OPTIONS.map((type) =>\n renderPreferenceRow({\n key: `TYPE:${type.value}`,\n scope: 'TYPE',\n type: type.value,\n title: tr(type.labelKey, type.label),\n description: tr(\n 'notifications.typePreferenceDescription',\n 'Control delivery for this notification type.'\n ),\n })\n )}\n </div>\n </section>\n\n <div className=\"relative max-w-xl\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n aria-label={tr('notifications.searchTopics', 'Search topics...')}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"w-full rounded-lg border border-default bg-surface py-2 pl-9 pr-4 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </div>\n\n <section data-tour=\"notification-preferences-topics\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.topicPreferences', 'Topics')}\n </h2>\n {isLoading ? (\n <div className=\"rounded-lg border border-default bg-surface p-6 text-sm text-secondary\">\n {tr('notifications.loadingPreferences', 'Loading preferences...')}\n </div>\n ) : filteredTopics.length === 0 ? (\n <div className=\"rounded-lg border border-default bg-surface p-6 text-sm text-secondary\">\n {tr('notifications.noTopicsFound', 'No promotional topics available right now.')}\n </div>\n ) : (\n filteredTopics.map((topic) =>\n renderPreferenceRow({\n key: `TOPIC:${topic.id}`,\n scope: 'TOPIC',\n topicId: topic.id,\n title: topic.name,\n description: topic.description || topic.slug,\n })\n )\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAM,IAA0F;CAC9F;EAAE,OAAO;EAAU,UAAU;EAA8B,OAAO;EAAU;CAC5E;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;EAAS;CAC1E;EAAE,OAAO;EAAQ,UAAU;EAA6B,OAAO;EAAQ;CACvE;EAAE,OAAO;EAAO,UAAU;EAA4B,OAAO;EAAO;CACpE;EAAE,OAAO;EAAY,UAAU;EAAiC,OAAO;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B;MAClB,KAAK,QAAQ,EAAK;MAClB,OAAO;MACP,MAAM,EAAK;MACX,OAAO,EAAG,EAAK,UAAU,EAAK,MAAM;MACpC,aAAa,EACX,2CACA,+CACD;MACF,CAAC,CACH;KACG,CAAA,CACE;;GAEV,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD;KAAQ,MAAM;KAAI,WAAU;KAA2D,CAAA,EACvF,kBAAC,SAAD;KACE,MAAK;KACL,OAAO;KACP,WAAW,MAAU,EAAU,EAAM,OAAO,MAAM;KAClD,cAAY,EAAG,8BAA8B,mBAAmB;KAChE,aAAa,EAAG,8BAA8B,mBAAmB;KACjE,WAAU;KACV,CAAA,CACE;;GAEN,kBAAC,WAAD;IAAS,aAAU;IAAkC,WAAU;cAA/D,CACE,kBAAC,MAAD;KAAI,WAAU;eACX,EAAG,kCAAkC,SAAS;KAC5C,CAAA,EACJ,IACC,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAG,oCAAoC,yBAAyB;KAC7D,CAAA,GACJ,EAAe,WAAW,IAC5B,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAG,+BAA+B,6CAA6C;KAC5E,CAAA,GAEN,EAAe,KAAK,MAClB,EAAoB;KAClB,KAAK,SAAS,EAAM;KACpB,OAAO;KACP,SAAS,EAAM;KACf,OAAO,EAAM;KACb,aAAa,EAAM,eAAe,EAAM;KACzC,CAAC,CACH,CAEK;;GACN"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-notification",
3
- "version": "2026.521.1",
3
+ "version": "2026.522.2",
4
4
  "description": "Notification microfrontend for multi-channel notification management",
5
5
  "type": "module",
6
6
  "imports": {