@burdenoff/microfe-notification 2026.1117.1 → 2026.1118.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,139 +1,146 @@
1
1
  import { NotificationCard as e } from "../components/NotificationCard.js";
2
2
  import { useNotifications as t } from "../hooks/useNotifications.js";
3
3
  import { useNotificationTopics as n } from "../hooks/useNotificationTopics.js";
4
+ import { NotificationListFooter as r } from "../components/NotificationListFooter.js";
4
5
  import "../hooks/index.js";
5
- import { NOTIFICATION_PERMISSIONS as r } from "../constants/permissions.js";
6
- import { useNotification as i } from "../providers/NotificationProvider.js";
7
- import { useTr as a } from "../shared/hooks/useTr.js";
8
- import { exportNotificationsAsCsv as o } from "../utils/notificationHistoryExport.js";
9
- import { NotificationArchivedV2 as s } from "../navigation-v2/NotificationArchivedV2.js";
10
- import { usePermissions as c } from "@burdenoff/fe-libs/shared/providers/shell";
11
- import { Download as l, History as u, Search as d } from "lucide-react";
12
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
13
- import { Button as m, EmphasisPanel as h, GlassCard as g, IllustratedEmptyState as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
6
+ import { NOTIFICATION_PERMISSIONS as i } from "../constants/permissions.js";
7
+ import { useNotification as a } from "../providers/NotificationProvider.js";
8
+ import { useTr as o } from "../shared/hooks/useTr.js";
9
+ import { exportNotificationsAsCsv as s } from "../utils/notificationHistoryExport.js";
10
+ import { NotificationArchivedV2 as c } from "../navigation-v2/NotificationArchivedV2.js";
11
+ import { usePermissions as l } from "@burdenoff/fe-libs/shared/providers/shell";
12
+ import { Download as u, History as d, Search as f } from "lucide-react";
13
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
14
+ import { Button as h, EmphasisPanel as g, GlassCard as _, IllustratedEmptyState as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
14
15
  // src/pages/NotificationHistoryPage.tsx
15
- var y = {
16
+ var b = {
16
17
  archived: null,
17
18
  channel: "ALL"
18
19
  };
19
- function b() {
20
- let { navigationV2: e } = i();
21
- return f(e ? s : x, {});
22
- }
23
20
  function x() {
24
- let s = a(), { hasPermission: b, isLoading: x } = c(), { currentUser: S } = i(), { topics: C } = n({ isActive: !0 }), { notifications: w, notificationFilter: T, updateFilter: E, archiveNotification: D, unarchiveNotification: O, recordAction: k } = t({ baseFilter: y }), A = !!(T.search || T.topicId || T.dateRange.start || T.dateRange.end);
25
- return x ? /* @__PURE__ */ f("div", {
21
+ let { navigationV2: e } = a();
22
+ return p(e ? c : S, {});
23
+ }
24
+ function S() {
25
+ let c = o(), { hasPermission: x, isLoading: S } = l(), { currentUser: C } = a(), { topics: w } = n({ isActive: !0 }), { notifications: T, hasMore: E, isLoadingMore: D, loadMore: O, notificationFilter: k, updateFilter: A, archiveNotification: j, unarchiveNotification: M, recordAction: N } = t({ baseFilter: b }), P = !!(k.search || k.topicId || k.dateRange.start || k.dateRange.end);
26
+ return S ? /* @__PURE__ */ p("div", {
26
27
  className: "flex h-64 items-center justify-center",
27
- children: /* @__PURE__ */ f("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
28
- }) : !b(r.NOTIFICATION_LIST) && !S?.id ? /* @__PURE__ */ f("div", {
28
+ children: /* @__PURE__ */ p("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
29
+ }) : !x(i.NOTIFICATION_LIST) && !C?.id ? /* @__PURE__ */ p("div", {
29
30
  className: "p-8 text-center text-text-secondary",
30
- children: s("notifications.noPermissionHistory", "You don't have permission to view notification history.")
31
- }) : /* @__PURE__ */ p("div", {
31
+ children: c("notifications.noPermissionHistory", "You don't have permission to view notification history.")
32
+ }) : /* @__PURE__ */ m("div", {
32
33
  className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200",
33
34
  children: [
34
- /* @__PURE__ */ f(v, {
35
- icon: /* @__PURE__ */ f(u, { size: 16 }),
36
- children: s("notifications.historyPurpose", "A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.")
35
+ /* @__PURE__ */ p(y, {
36
+ icon: /* @__PURE__ */ p(d, { size: 16 }),
37
+ children: c("notifications.historyPurpose", "A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.")
37
38
  }),
38
- /* @__PURE__ */ p(h, {
39
+ /* @__PURE__ */ m(g, {
39
40
  "data-tour": "notification-history-header",
40
41
  className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",
41
- children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
42
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
42
43
  className: "text-xl sm:text-2xl font-bold text-primary",
43
- children: s("notifications.historyTitle", "Notification History")
44
- }), /* @__PURE__ */ f("p", {
44
+ children: c("notifications.historyTitle", "Notification History")
45
+ }), /* @__PURE__ */ p("p", {
45
46
  className: "text-sm text-text-secondary mt-1",
46
- children: s("notifications.historySubtitle", "View and search all your notifications")
47
- })] }), /* @__PURE__ */ p(m, {
47
+ children: c("notifications.historySubtitle", "View and search all your notifications")
48
+ })] }), /* @__PURE__ */ m(h, {
48
49
  "data-tour": "notification-history-export",
49
50
  variant: "outline",
50
- onClick: () => o(s, w),
51
- disabled: w.length === 0,
51
+ onClick: () => s(c, T),
52
+ disabled: T.length === 0,
52
53
  className: "gap-2",
53
- children: [/* @__PURE__ */ f(l, { size: 16 }), s("notifications.export", "Export")]
54
+ children: [/* @__PURE__ */ p(u, { size: 16 }), c("notifications.export", "Export")]
54
55
  })]
55
56
  }),
56
- /* @__PURE__ */ p(g, {
57
+ /* @__PURE__ */ m(_, {
57
58
  treatment: "plain",
58
59
  className: "grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5",
59
60
  children: [
60
- /* @__PURE__ */ p("div", {
61
+ /* @__PURE__ */ m("div", {
61
62
  className: "relative sm:col-span-2 xl:col-span-2",
62
- children: [/* @__PURE__ */ f(d, {
63
+ children: [/* @__PURE__ */ p(f, {
63
64
  size: 16,
64
65
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
65
- }), /* @__PURE__ */ f("input", {
66
+ }), /* @__PURE__ */ p("input", {
66
67
  type: "text",
67
- placeholder: s("notifications.searchByTitleOrContent", "Search by title or content..."),
68
- value: T.search,
69
- onChange: (e) => E({ search: e.target.value }),
68
+ placeholder: c("notifications.searchByTitleOrContent", "Search by title or content..."),
69
+ value: k.search,
70
+ onChange: (e) => A({ search: e.target.value }),
70
71
  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"
71
72
  })]
72
73
  }),
73
- /* @__PURE__ */ p("select", {
74
- value: T.topicId || "",
75
- onChange: (e) => E({ topicId: e.target.value || void 0 }),
74
+ /* @__PURE__ */ m("select", {
75
+ value: k.topicId || "",
76
+ onChange: (e) => A({ topicId: e.target.value || void 0 }),
76
77
  className: "rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
77
- children: [/* @__PURE__ */ f("option", {
78
+ children: [/* @__PURE__ */ p("option", {
78
79
  value: "",
79
- children: s("notifications.allTopics", "All Topics")
80
- }), C.map((e) => /* @__PURE__ */ f("option", {
80
+ children: c("notifications.allTopics", "All Topics")
81
+ }), w.map((e) => /* @__PURE__ */ p("option", {
81
82
  value: e.id,
82
83
  children: e.name
83
84
  }, e.id))]
84
85
  }),
85
- /* @__PURE__ */ f("input", {
86
+ /* @__PURE__ */ p("input", {
86
87
  type: "date",
87
- "aria-label": s("notifications.startDate", "Start date"),
88
- value: T.dateRange.start ? T.dateRange.start.toISOString().split("T")[0] : "",
89
- onChange: (e) => E({ dateRange: {
90
- ...T.dateRange,
88
+ "aria-label": c("notifications.startDate", "Start date"),
89
+ value: k.dateRange.start ? k.dateRange.start.toISOString().split("T")[0] : "",
90
+ onChange: (e) => A({ dateRange: {
91
+ ...k.dateRange,
91
92
  start: e.target.value ? new Date(e.target.value) : null
92
93
  } }),
93
94
  className: "rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary"
94
95
  }),
95
- /* @__PURE__ */ f("input", {
96
+ /* @__PURE__ */ p("input", {
96
97
  type: "date",
97
- "aria-label": s("notifications.endDate", "End date"),
98
- value: T.dateRange.end ? T.dateRange.end.toISOString().split("T")[0] : "",
99
- onChange: (e) => E({ dateRange: {
100
- ...T.dateRange,
98
+ "aria-label": c("notifications.endDate", "End date"),
99
+ value: k.dateRange.end ? k.dateRange.end.toISOString().split("T")[0] : "",
100
+ onChange: (e) => A({ dateRange: {
101
+ ...k.dateRange,
101
102
  end: e.target.value ? new Date(e.target.value) : null
102
103
  } }),
103
104
  className: "rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary"
104
105
  })
105
106
  ]
106
107
  }),
107
- /* @__PURE__ */ f("div", {
108
+ /* @__PURE__ */ p("div", {
108
109
  className: "space-y-2",
109
- children: w.length > 0 ? w.map((t) => /* @__PURE__ */ p("div", {
110
+ children: T.length > 0 ? T.map((t) => /* @__PURE__ */ m("div", {
110
111
  className: "space-y-2",
111
- children: [/* @__PURE__ */ f(e, {
112
+ children: [/* @__PURE__ */ p(e, {
112
113
  notification: t,
113
- onArchive: D,
114
- onAction: k,
114
+ onArchive: j,
115
+ onAction: N,
115
116
  showArchivedState: !0,
116
117
  analyticsSource: "history"
117
- }), t.archivedAt && /* @__PURE__ */ f("div", {
118
+ }), t.archivedAt && /* @__PURE__ */ p("div", {
118
119
  className: "flex justify-end",
119
- children: /* @__PURE__ */ f("button", {
120
- onClick: () => O(t.id),
120
+ children: /* @__PURE__ */ p("button", {
121
+ onClick: () => M(t.id),
121
122
  className: "rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken",
122
- children: s("notifications.restore", "Restore")
123
+ children: c("notifications.restore", "Restore")
123
124
  })
124
125
  })]
125
- }, t.id)) : /* @__PURE__ */ f("div", {
126
+ }, t.id)) : /* @__PURE__ */ p("div", {
126
127
  className: "animate-in fade-in duration-200",
127
- children: /* @__PURE__ */ f(_, {
128
- illustration: A ? "empty-search" : "empty-notifications",
129
- title: A ? s("notifications.noNotificationsFound", "No notifications found") : s("notifications.historyEmptyTitle", "No history yet"),
130
- description: A ? s("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : s("notifications.historyEmptyDescription", "Notifications you receive will be archived here so you can always find them again.")
128
+ children: /* @__PURE__ */ p(v, {
129
+ illustration: P ? "empty-search" : "empty-notifications",
130
+ title: P ? c("notifications.noNotificationsFound", "No notifications found") : c("notifications.historyEmptyTitle", "No history yet"),
131
+ description: P ? c("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : c("notifications.historyEmptyDescription", "Notifications you receive will be archived here so you can always find them again.")
131
132
  })
132
133
  })
134
+ }),
135
+ /* @__PURE__ */ p(r, {
136
+ hasMore: E,
137
+ isLoadingMore: D,
138
+ onLoadMore: O,
139
+ shownCount: T.length
133
140
  })
134
141
  ]
135
142
  });
136
143
  }
137
- export { b as NotificationHistoryPage };
144
+ export { x as NotificationHistoryPage };
138
145
 
139
146
  //# sourceMappingURL=NotificationHistoryPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationHistoryPage.js","names":["HISTORY_FILTER","NotificationHistoryPage","useNotification","jsx","navigationV2","NotificationArchivedV2","ClassicNotificationHistoryPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotifications","hasActiveFilters","notificationFilter","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","History","EmphasisPanel","Button","exportNotificationsAsCsv","notifications","Download","GlassCard","Search","updateFilter","event","topics","topic","NotificationCard","archiveNotification","recordAction","notification","unarchiveNotification","IllustratedEmptyState"],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Download, History, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\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';\nimport { NotificationArchivedV2 } from '../navigation-v2/NotificationArchivedV2';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/**\n * User Notification History — personal history, filter, CSV export,\n * archive/unarchive. Under FluidGrids' Navigation v2 (BOFF-11872) it is the\n * \"Archived\" view instead; every other app keeps this page.\n */\nexport function NotificationHistoryPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationArchivedV2 /> : <ClassicNotificationHistoryPage />;\n}\n\nfunction ClassicNotificationHistoryPage() {\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 const hasActiveFilters = Boolean(\n notificationFilter.search ||\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\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.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-200\">\n <PagePurpose icon={<History size={16} />}>\n {tr(\n 'notifications.historyPurpose',\n 'A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.'\n )}\n </PagePurpose>\n\n {/* Single emphasis zone — the header summary + the one export CTA. */}\n <EmphasisPanel\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\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-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 variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </EmphasisPanel>\n\n <GlassCard\n treatment=\"plain\"\n className=\"grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5\"\n >\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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-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 </GlassCard>\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-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe;AAOjE,SAAgBC,IAA0B;CACxC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA6BC,GAA9B,CAAyB,CAAqC;AACtF;AAEA,SAASA,IAAiC;CACxC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBR,EAAgB,GAClC,EAAE,cAAWS,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,EACJ,kBACA,uBACA,iBACA,wBACA,0BACA,oBACEC,EAAiB,EAAE,YAAYZ,EAAe,CAAC,GAE7Ca,IAAmB,GACvBC,EAAmB,UACnBA,EAAmB,WACnBA,EAAmB,UAAU,SAC7BA,EAAmB,UAAU;CAsB/B,OAnBIL,IAEA,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA,IAIL,CAACM,EAAcC,EAAyB,iBAAiB,KAAK,CAACC,GAAa,KAE5E,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAV,EACC,qCACA,yDACF;CACG,CAAA,IAKP,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAACW,GAAD;IAAa,MAAM,kBAACC,GAAD,EAAS,MAAM,GAAK,CAAA;IACpC,UAAAZ,EACC,gCACA,4PACF;GACW,CAAA;GAGb,kBAACa,GAAD;IACE,aAAU;IACV,WAAU;IAFZ,UAAA,CAIE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;KACX,UAAAb,EAAG,8BAA8B,sBAAsB;IACtD,CAAA,GACJ,kBAAC,KAAD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OAAO,KAAK,IAAI;MACrD,EACF,CAAC;MAEH,WAAU;KACX,CAAA;KAED,kBAAC,SAAD;MACE,MAAK;MACL,cAAYP,EAAG,yBAAyB,UAAU;MAClD,OACEO,EAAmB,UAAU,MACzBA,EAAmB,UAAU,IAAI,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAC1D;MAEN,WAAW,MACTa,EAAa,EACX,WAAW;OACT,GAAGb,EAAmB;OACtB,KAAK,EAAE,OAAO,QAAQ,IAAI,KAAK,EAAE,OAAO,KAAK,IAAI;MACnD,EACF,CAAC;MAEH,WAAU;KACX,CAAA;IACQ;;GAEX,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAS,EAAc,SAAS,IACtBA,EAAc,KAAK,MACjB,kBAAC,OAAD;KAA2B,WAAU;KAArC,UAAA,CACE,kBAACQ,GAAD;MACgB;MACd,WAAWC;MACX,UAAUC;MACV,mBAAA;MACA,iBAAgB;KACjB,CAAA,GACAC,EAAa,cACZ,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAAC,UAAD;OACE,eAAeC,EAAsBD,EAAa,EAAE;OACpD,WAAU;OAET,UAAA3B,EAAG,yBAAyB,SAAS;MAChC,CAAA;KACL,CAAA,CAEJ;IAlBK,GAAA2B,EAAa,EAkBlB,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACE,GAAD;MACE,cAAcvB,IAAmB,iBAAiB;MAClD,OACEA,IACIN,EAAG,sCAAsC,wBAAwB,IACjEA,EAAG,mCAAmC,gBAAgB;MAE5D,aACEM,IACIN,EAAG,yCAAyC,4BAA4B,IACxEA,EACE,yCACA,oFACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;EACF;;AAET"}
1
+ {"version":3,"file":"NotificationHistoryPage.js","names":["HISTORY_FILTER","NotificationHistoryPage","useNotification","jsx","navigationV2","NotificationArchivedV2","ClassicNotificationHistoryPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotifications","hasActiveFilters","notificationFilter","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","History","EmphasisPanel","Button","exportNotificationsAsCsv","notifications","Download","GlassCard","Search","updateFilter","event","topics","topic","NotificationCard","archiveNotification","recordAction","notification","unarchiveNotification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Download, History, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\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';\nimport { NotificationArchivedV2 } from '../navigation-v2/NotificationArchivedV2';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/**\n * User Notification History — personal history, filter, CSV export,\n * archive/unarchive. Under FluidGrids' Navigation v2 (BOFF-11872) it is the\n * \"Archived\" view instead; every other app keeps this page.\n */\nexport function NotificationHistoryPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationArchivedV2 /> : <ClassicNotificationHistoryPage />;\n}\n\nfunction ClassicNotificationHistoryPage() {\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 hasMore,\n isLoadingMore,\n loadMore,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n\n const hasActiveFilters = Boolean(\n notificationFilter.search ||\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\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.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-200\">\n <PagePurpose icon={<History size={16} />}>\n {tr(\n 'notifications.historyPurpose',\n 'A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.'\n )}\n </PagePurpose>\n\n {/* Single emphasis zone — the header summary + the one export CTA. */}\n <EmphasisPanel\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\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-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 variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </EmphasisPanel>\n\n <GlassCard\n treatment=\"plain\"\n className=\"grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5\"\n >\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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-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 </GlassCard>\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-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={notifications.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe;AAOjE,SAAgBC,IAA0B;CACxC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA6BC,GAA9B,CAAyB,CAAqC;AACtF;AAEA,SAASA,IAAiC;CACxC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBR,EAAgB,GAClC,EAAE,cAAWS,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,EACJ,kBACA,YACA,kBACA,aACA,uBACA,iBACA,wBACA,0BACA,oBACEC,EAAiB,EAAE,YAAYZ,EAAe,CAAC,GAE7Ca,IAAmB,GACvBC,EAAmB,UACnBA,EAAmB,WACnBA,EAAmB,UAAU,SAC7BA,EAAmB,UAAU;CAsB/B,OAnBIL,IAEA,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA,IAIL,CAACM,EAAcC,EAAyB,iBAAiB,KAAK,CAACC,GAAa,KAE5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WAAU;KACb,UAAA,kBAACE,GAAD;MACE,cAAcvB,IAAmB,iBAAiB;MAClD,OACEA,IACIN,EAAG,sCAAsC,wBAAwB,IACjEA,EAAG,mCAAmC,gBAAgB;MAE5D,aACEM,IACIN,EAAG,yCAAyC,4BAA4B,IACxEA,EACE,yCACA,oFACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;GAEL,kBAAC8B,GAAD;IACW;IACM;IACf,YAAYC;IACZ,YAAYf,EAAc;GAC3B,CAAA;EACE;;AAET"}
@@ -328,6 +328,9 @@ export declare const enTranslations: {
328
328
  htmlPlaceholder: string;
329
329
  inAppUsers: string;
330
330
  includeHtmlVersion: string;
331
+ listEnd: string;
332
+ loadMore: string;
333
+ loadingMore: string;
331
334
  loadingPreferences: string;
332
335
  loadingTopics: string;
333
336
  manualRecipients: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-notification",
3
- "version": "2026.1117.1",
3
+ "version": "2026.1118.1",
4
4
  "description": "Notification microfrontend for multi-channel notification management",
5
5
  "type": "module",
6
6
  "imports": {
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@apollo/client": "^4.3.7",
55
- "@burdenoff/fe-libs": "2026.1113.6",
55
+ "@burdenoff/fe-libs": "2026.1118.3",
56
56
  "@types/lodash-es": "^4.17.12",
57
57
  "graphql": "^16.15.0",
58
58
  "graphql-ws": "^6.4.1",
@@ -62,13 +62,13 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@burdenoff/toolchain": "2026.1107.14",
65
- "@graphql-codegen/add": "7.1.1",
66
- "@graphql-codegen/cli": "7.4.6",
67
- "@graphql-codegen/import-types-preset": "4.0.1",
68
- "@graphql-codegen/schema-ast": "6.1.1",
69
- "@graphql-codegen/typescript": "6.1.2",
70
- "@graphql-codegen/typescript-operations": "6.2.0",
71
- "@graphql-codegen/typescript-react-apollo": "5.0.0",
65
+ "@graphql-codegen/add": "8.0.0",
66
+ "@graphql-codegen/cli": "8.0.0",
67
+ "@graphql-codegen/import-types-preset": "5.0.0",
68
+ "@graphql-codegen/schema-ast": "7.0.0",
69
+ "@graphql-codegen/typescript": "7.0.1",
70
+ "@graphql-codegen/typescript-operations": "7.0.1",
71
+ "@graphql-codegen/typescript-react-apollo": "6.0.1",
72
72
  "@happy-dom/global-registrator": "^21.0.4",
73
73
  "@testing-library/jest-dom": "^6.9.1",
74
74
  "@testing-library/react": "^16.3.3",