@burdenoff/microfe-notification 2026.1109.1 → 2026.1113.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.
- package/dist/NotificationRoutes.js +108 -36
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/components/ConfirmDeleteDialog.d.ts +17 -0
- package/dist/components/ConfirmDeleteDialog.js +22 -0
- package/dist/components/ConfirmDeleteDialog.js.map +1 -0
- package/dist/components/NotificationCard.d.ts +10 -1
- package/dist/components/NotificationCard.js +103 -72
- package/dist/components/NotificationCard.js.map +1 -1
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/usePreferenceToggles.d.ts +27 -0
- package/dist/hooks/usePreferenceToggles.js +84 -0
- package/dist/hooks/usePreferenceToggles.js.map +1 -0
- package/dist/navigation-v2/AdminPageV2.d.ts +14 -0
- package/dist/navigation-v2/AdminPageV2.js +51 -0
- package/dist/navigation-v2/AdminPageV2.js.map +1 -0
- package/dist/navigation-v2/AdminToolsMenu.d.ts +6 -0
- package/dist/navigation-v2/AdminToolsMenu.js +32 -0
- package/dist/navigation-v2/AdminToolsMenu.js.map +1 -0
- package/dist/navigation-v2/BackToNotifications.d.ts +2 -0
- package/dist/navigation-v2/BackToNotifications.js +20 -0
- package/dist/navigation-v2/BackToNotifications.js.map +1 -0
- package/dist/navigation-v2/FilterControls.d.ts +25 -0
- package/dist/navigation-v2/FilterControls.js +64 -0
- package/dist/navigation-v2/FilterControls.js.map +1 -0
- package/dist/navigation-v2/NotificationArchivedV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationArchivedV2.js +174 -0
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -0
- package/dist/navigation-v2/NotificationInboxV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationInboxV2.js +309 -0
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -0
- package/dist/navigation-v2/NotificationSettingsV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationSettingsV2.js +203 -0
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -0
- package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -0
- package/dist/navigation-v2/NotificationsV2Landing.js +37 -0
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -0
- package/dist/navigation-v2/__tests__/uiMocks.d.ts +71 -0
- package/dist/navigation-v2/inboxFilters.d.ts +8 -0
- package/dist/navigation-v2/inboxFilters.js +10 -0
- package/dist/navigation-v2/inboxFilters.js.map +1 -0
- package/dist/navigation-v2/paths.d.ts +24 -0
- package/dist/navigation-v2/paths.js +31 -0
- package/dist/navigation-v2/paths.js.map +1 -0
- package/dist/navigation-v2/settingsOptions.d.ts +12 -0
- package/dist/navigation-v2/settingsOptions.js +58 -0
- package/dist/navigation-v2/settingsOptions.js.map +1 -0
- package/dist/navigation-v2/useAdminTools.d.ts +22 -0
- package/dist/navigation-v2/useAdminTools.js +76 -0
- package/dist/navigation-v2/useAdminTools.js.map +1 -0
- package/dist/pages/CreateNotificationPage.js +577 -558
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.d.ts +3 -1
- package/dist/pages/NotificationCenterPage.js +79 -74
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.d.ts +5 -1
- package/dist/pages/NotificationHistoryPage.js +52 -47
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.d.ts +4 -0
- package/dist/pages/NotificationPreferencesPage.js +97 -158
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +184 -166
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +123 -108
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +339 -308
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/providers/NotificationProvider.js +6 -5
- package/dist/providers/NotificationProvider.js.map +1 -1
- package/dist/types/index.d.ts +8 -0
- package/package.json +2 -2
|
@@ -6,17 +6,18 @@ import { filterNotifications as r, groupNotificationsByDate as i } from "../util
|
|
|
6
6
|
import { NOTIFICATION_PERMISSIONS as a } from "../constants/permissions.js";
|
|
7
7
|
import { useNotification as o } from "../providers/NotificationProvider.js";
|
|
8
8
|
import { useTr as s } from "../shared/hooks/useTr.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { NotificationInboxV2 as c } from "../navigation-v2/NotificationInboxV2.js";
|
|
10
|
+
import { useMemo as l } from "react";
|
|
11
|
+
import { usePermissions as u } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
12
|
+
import { BellRing as d, CheckCheck as f, Search as p } from "lucide-react";
|
|
13
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
|
+
import { PushOptInToggle as _ } from "@burdenoff/fe-libs/chrome";
|
|
15
|
+
import { AuroraBackground as v, Button as y, EmphasisPanel as b, GlassCard as x, GradientText as S, IllustratedEmptyState as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
|
|
15
16
|
// src/pages/NotificationCenterPage.tsx
|
|
16
|
-
var
|
|
17
|
+
var T = {
|
|
17
18
|
archived: !1,
|
|
18
19
|
channel: "IN_APP"
|
|
19
|
-
},
|
|
20
|
+
}, E = { channel: "IN_APP" }, D = [
|
|
20
21
|
{
|
|
21
22
|
value: "SYSTEM",
|
|
22
23
|
labelKey: "notifications.typeSystem",
|
|
@@ -37,7 +38,7 @@ var w = {
|
|
|
37
38
|
labelKey: "notifications.typeMarketing",
|
|
38
39
|
label: "Marketing"
|
|
39
40
|
}
|
|
40
|
-
],
|
|
41
|
+
], O = [
|
|
41
42
|
{
|
|
42
43
|
value: "URGENT",
|
|
43
44
|
labelKey: "notifications.priorityUrgent",
|
|
@@ -59,147 +60,151 @@ var w = {
|
|
|
59
60
|
label: "Low"
|
|
60
61
|
}
|
|
61
62
|
];
|
|
62
|
-
function
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
function k() {
|
|
64
|
+
let { navigationV2: e } = o();
|
|
65
|
+
return h(e ? c : A, {});
|
|
66
|
+
}
|
|
67
|
+
function A() {
|
|
68
|
+
let c = s(), { hasPermission: k, isLoading: A } = u(), { currentUser: j } = o(), { notifications: M, unreadCount: N, notificationFilter: P, markAsRead: F, markAllAsRead: I, archiveNotification: L, recordAction: R, updateFilter: z, resetFilter: B } = e({
|
|
69
|
+
baseFilter: T,
|
|
70
|
+
unreadFilter: E
|
|
71
|
+
}), { topics: V } = n({ isActive: !0 }), H = l(() => r(M, P), [M, P]), U = l(() => i(H, c), [H, c]);
|
|
72
|
+
return A ? /* @__PURE__ */ h("div", {
|
|
68
73
|
className: "flex h-64 items-center justify-center",
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
-
}) : !k(a.NOTIFICATION_LIST) && !j?.id ? /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ h("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
75
|
+
}) : !k(a.NOTIFICATION_LIST) && !j?.id ? /* @__PURE__ */ h("div", {
|
|
71
76
|
className: "p-8 text-center text-text-secondary",
|
|
72
|
-
children:
|
|
73
|
-
}) : /* @__PURE__ */
|
|
77
|
+
children: c("notifications.noPermissionView", "You don't have permission to view notifications.")
|
|
78
|
+
}) : /* @__PURE__ */ g("div", {
|
|
74
79
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200",
|
|
75
80
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
icon: /* @__PURE__ */
|
|
78
|
-
children:
|
|
81
|
+
/* @__PURE__ */ h(w, {
|
|
82
|
+
icon: /* @__PURE__ */ h(d, { size: 16 }),
|
|
83
|
+
children: c("notifications.centerPurpose", "Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.")
|
|
79
84
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ g("div", {
|
|
81
86
|
className: "relative overflow-hidden rounded-2xl",
|
|
82
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ h(v, { intensity: "subtle" }), /* @__PURE__ */ g(b, {
|
|
83
88
|
"data-tour": "notification-center-header",
|
|
84
89
|
className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
86
91
|
className: "text-xl sm:text-2xl font-bold text-primary",
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
-
}), /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ h(S, { children: c("notifications.centerTitle", "Notification Center") })
|
|
93
|
+
}), /* @__PURE__ */ h("p", {
|
|
89
94
|
className: "text-sm text-secondary mt-1",
|
|
90
|
-
children: N > 0 ? /* @__PURE__ */
|
|
91
|
-
|
|
95
|
+
children: N > 0 ? /* @__PURE__ */ g(m, { children: [
|
|
96
|
+
c("notifications.youHave", "You have"),
|
|
92
97
|
" ",
|
|
93
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ g("span", {
|
|
94
99
|
className: "inline-flex items-center gap-1.5 font-semibold text-primary",
|
|
95
100
|
"data-tour": "notification-center-unread-count",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ h("span", { className: "inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse" }), N]
|
|
97
102
|
}),
|
|
98
103
|
" ",
|
|
99
|
-
|
|
100
|
-
] }) :
|
|
101
|
-
})] }), N > 0 && /* @__PURE__ */
|
|
104
|
+
c(N === 1 ? "notifications.unreadNotification" : "notifications.unreadNotifications", N === 1 ? "unread notification" : "unread notifications")
|
|
105
|
+
] }) : c("notifications.allCaughtUp", "All caught up!")
|
|
106
|
+
})] }), N > 0 && /* @__PURE__ */ g(y, {
|
|
102
107
|
"data-tour": "notification-center-mark-all-read",
|
|
103
108
|
variant: "outline",
|
|
104
109
|
onClick: I,
|
|
105
110
|
className: "gap-2",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ h(f, { size: 16 }), c("notifications.markAllAsRead", "Mark All as Read")]
|
|
107
112
|
})]
|
|
108
113
|
})]
|
|
109
114
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ h(_, {}),
|
|
116
|
+
/* @__PURE__ */ g(x, {
|
|
112
117
|
treatment: "plain",
|
|
113
118
|
"data-tour": "notification-center-filters",
|
|
114
119
|
className: "flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4",
|
|
115
120
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ g("div", {
|
|
117
122
|
className: "relative flex-1",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ h(p, {
|
|
119
124
|
size: 16,
|
|
120
125
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
|
|
121
|
-
}), /* @__PURE__ */
|
|
126
|
+
}), /* @__PURE__ */ h("input", {
|
|
122
127
|
"data-tour": "notification-center-search",
|
|
123
128
|
type: "text",
|
|
124
|
-
placeholder:
|
|
129
|
+
placeholder: c("notifications.searchPlaceholder", "Search notifications..."),
|
|
125
130
|
value: P.search,
|
|
126
131
|
onChange: (e) => z({ search: e.target.value }),
|
|
127
132
|
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"
|
|
128
133
|
})]
|
|
129
134
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ g("select", {
|
|
131
136
|
value: P.type,
|
|
132
137
|
onChange: (e) => z({ type: e.target.value }),
|
|
133
138
|
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ h("option", {
|
|
135
140
|
value: "ALL",
|
|
136
|
-
children:
|
|
137
|
-
}),
|
|
141
|
+
children: c("notifications.allTypes", "All Types")
|
|
142
|
+
}), D.map((e) => /* @__PURE__ */ h("option", {
|
|
138
143
|
value: e.value,
|
|
139
|
-
children:
|
|
144
|
+
children: c(e.labelKey, e.label)
|
|
140
145
|
}, e.value))]
|
|
141
146
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ g("select", {
|
|
143
148
|
value: P.priority,
|
|
144
149
|
onChange: (e) => z({ priority: e.target.value }),
|
|
145
150
|
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ h("option", {
|
|
147
152
|
value: "ALL",
|
|
148
|
-
children:
|
|
149
|
-
}),
|
|
153
|
+
children: c("notifications.allPriorities", "All Priorities")
|
|
154
|
+
}), O.map((e) => /* @__PURE__ */ h("option", {
|
|
150
155
|
value: e.value,
|
|
151
|
-
children:
|
|
156
|
+
children: c(e.labelKey, e.label)
|
|
152
157
|
}, e.value))]
|
|
153
158
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ g("select", {
|
|
155
160
|
value: P.topicId || "",
|
|
156
161
|
onChange: (e) => z({ topicId: e.target.value || void 0 }),
|
|
157
162
|
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
158
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ h("option", {
|
|
159
164
|
value: "",
|
|
160
|
-
children:
|
|
161
|
-
}), V.map((e) => /* @__PURE__ */
|
|
165
|
+
children: c("notifications.allTopics", "All Topics")
|
|
166
|
+
}), V.map((e) => /* @__PURE__ */ h("option", {
|
|
162
167
|
value: e.id,
|
|
163
168
|
children: e.name
|
|
164
169
|
}, e.id))]
|
|
165
170
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ g("select", {
|
|
167
172
|
value: P.isRead === null ? "ALL" : P.isRead ? "READ" : "UNREAD",
|
|
168
173
|
onChange: (e) => z({ isRead: e.target.value === "ALL" ? null : e.target.value === "READ" }),
|
|
169
174
|
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
170
175
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ h("option", {
|
|
172
177
|
value: "ALL",
|
|
173
|
-
children:
|
|
178
|
+
children: c("notifications.filterAll", "All")
|
|
174
179
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ h("option", {
|
|
176
181
|
value: "UNREAD",
|
|
177
|
-
children:
|
|
182
|
+
children: c("notifications.filterUnread", "Unread")
|
|
178
183
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ h("option", {
|
|
180
185
|
value: "READ",
|
|
181
|
-
children:
|
|
186
|
+
children: c("notifications.filterRead", "Read")
|
|
182
187
|
})
|
|
183
188
|
]
|
|
184
189
|
}),
|
|
185
|
-
(P.search || P.type !== "ALL" || P.priority !== "ALL" || P.isRead !== null || !!P.topicId) && /* @__PURE__ */
|
|
190
|
+
(P.search || P.type !== "ALL" || P.priority !== "ALL" || P.isRead !== null || !!P.topicId) && /* @__PURE__ */ h("button", {
|
|
186
191
|
onClick: B,
|
|
187
192
|
className: "px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150",
|
|
188
|
-
children:
|
|
193
|
+
children: c("notifications.resetFilters", "Reset")
|
|
189
194
|
})
|
|
190
195
|
]
|
|
191
196
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ h("div", {
|
|
193
198
|
"data-tour": "notification-center-list",
|
|
194
199
|
className: "space-y-6",
|
|
195
|
-
children: H.length > 0 ? Object.entries(U).map(([e, n]) => /* @__PURE__ */
|
|
200
|
+
children: H.length > 0 ? Object.entries(U).map(([e, n]) => /* @__PURE__ */ g("div", {
|
|
196
201
|
className: "animate-in fade-in slide-in-from-bottom-2 duration-200",
|
|
197
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
198
203
|
className: "text-sm font-semibold text-tertiary mb-3",
|
|
199
204
|
children: e
|
|
200
|
-
}), /* @__PURE__ */
|
|
205
|
+
}), /* @__PURE__ */ h("div", {
|
|
201
206
|
className: "space-y-2",
|
|
202
|
-
children: n.map((e) => /* @__PURE__ */
|
|
207
|
+
children: n.map((e) => /* @__PURE__ */ h(t, {
|
|
203
208
|
notification: e,
|
|
204
209
|
onMarkAsRead: F,
|
|
205
210
|
onArchive: L,
|
|
@@ -207,18 +212,18 @@ function O() {
|
|
|
207
212
|
analyticsSource: "center"
|
|
208
213
|
}, e.id))
|
|
209
214
|
})]
|
|
210
|
-
}, e)) : /* @__PURE__ */
|
|
215
|
+
}, e)) : /* @__PURE__ */ h("div", {
|
|
211
216
|
className: "animate-in fade-in duration-200",
|
|
212
|
-
children: /* @__PURE__ */
|
|
217
|
+
children: /* @__PURE__ */ h(C, {
|
|
213
218
|
illustration: M.length === 0 ? "empty-notifications" : "empty-search",
|
|
214
|
-
title:
|
|
215
|
-
description: M.length === 0 ?
|
|
219
|
+
title: c("notifications.noNotificationsFound", "No notifications found"),
|
|
220
|
+
description: M.length === 0 ? c("notifications.noNotificationsYet", "You don't have any notifications yet. We'll notify you when something important happens.") : c("notifications.adjustFilters", "Try adjusting your filters to see more notifications.")
|
|
216
221
|
})
|
|
217
222
|
})
|
|
218
223
|
})
|
|
219
224
|
]
|
|
220
225
|
});
|
|
221
226
|
}
|
|
222
|
-
export {
|
|
227
|
+
export { k as NotificationCenterPage };
|
|
223
228
|
|
|
224
229
|
//# sourceMappingURL=NotificationCenterPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotification","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\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, tr),\n [filteredNotifications, tr]\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-200\">\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-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 <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\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 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 {/* 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\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 </GlassCard>\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-200\">\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=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\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 }\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,IAAMC,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAoF;CACxF;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;CAAS;CACzE;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;CAAQ;CACtE;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;CAAgB;CAC9F;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;CAAY;AACpF,GACMC,IAA4F;CAChG;EAAE,OAAO;EAAU,UAA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AU,CAAA;OAC3E,kBAAC,UAAD;QAAQ,OAAM;QAAQ,UAAAA,EAAG,4BAA4B,MAAM;OAAU,CAAA;MAC/D;;MAGNW,EAAmB,UACnBA,EAAmB,SAAS,SAC5BA,EAAmB,aAAa,SAChCA,EAAmB,WAAW,QAC9B,EAAQA,EAAmB,YAC3B,kBAAC,UAAD;MACE,SAASuB;MACT,WAAU;MAET,UAAAlC,EAAG,8BAA8B,OAAO;KACnC,CAAA;IAED;;GAGX,kBAAC,OAAD;IAAK,aAAU;IAA2B,WAAU;IACjD,UAAAO,EAAsB,SAAS,IAC9B,OAAO,QAAQK,CAAoB,CAAC,CAAC,KAAK,CAACuB,GAAOC,OAChD,kBAAC,OAAD;KAAiB,WAAU;KAA3B,UAAA,CACE,kBAAC,MAAD;MAAI,WAAU;MAA4C,UAAAD;KAAU,CAAA,GACpE,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAAC,EAAmB,KAAK,MACvB,kBAACC,GAAD;OAEgB;OACd,cAAcC;OACd,WAAWC;OACX,UAAUC;OACV,iBAAgB;MACjB,GANMC,EAAa,EAMnB,CACF;KACE,CAAA,CACF;IAdK,GAAAN,CAcL,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACO,GAAD;MACE,cAAchC,EAAc,WAAW,IAAI,wBAAwB;MACnE,OAAOV,EAAG,sCAAsC,wBAAwB;MACxE,aACEU,EAAc,WAAW,IACrBV,EACE,oCACA,0FACF,IACAA,EACE,+BACA,uDACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;EACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","useNotification","jsx","navigationV2","NotificationInboxV2","ClassicNotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\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';\nimport { NotificationInboxV2 } from '../navigation-v2/NotificationInboxV2';\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. Under FluidGrids'\n * Navigation v2 (BOFF-11872) it is the inbox layout instead; every other app\n * keeps the classic page.\n */\nexport function NotificationCenterPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationInboxV2 /> : <ClassicNotificationCenterPage />;\n}\n\nfunction ClassicNotificationCenterPage() {\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, tr),\n [filteredNotifications, tr]\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-200\">\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-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 <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\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 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 {/* 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\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 </GlassCard>\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-200\">\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=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\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 }\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,IAAMC,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAoF;CACxF;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;CAAS;CACzE;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;CAAQ;CACtE;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;CAAgB;CAC9F;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;CAAY;AACpF,GACMC,IAA4F;CAChG;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;CAAS;CAC7E;EAAE,OAAO;EAAQ,UAAU;EAA8B,OAAO;CAAO;CACvE;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;CAAS;CAC7E;EAAE,OAAO;EAAO,UAAU;EAA6B,OAAO;CAAM;AACtE;AASA,SAAgBC,IAAyB;CACvC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA0BC,GAA3B,CAAsB,CAAoC;AAClF;AAEA,SAASA,IAAgC;CACvC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBR,EAAgB,GAClC,EACJ,kBACA,gBACA,uBACA,eACA,kBACA,wBACA,iBACA,iBACA,mBACES,EAAiB;EAAE,YAAYd;EAAe,cAAcC;CAAqB,CAAC,GAChF,EAAE,cAAWc,EAAsB,E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AD;KAAiB,WAAU;KAA3B,UAAA,CACE,kBAAC,MAAD;MAAI,WAAU;MAA4C,UAAAD;KAAU,CAAA,GACpE,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAAC,EAAmB,KAAK,MACvB,kBAACC,GAAD;OAEgB;OACd,cAAcC;OACd,WAAWC;OACX,UAAUC;OACV,iBAAgB;MACjB,GANMC,EAAa,EAMnB,CACF;KACE,CAAA,CACF;IAdK,GAAAN,CAcL,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACO,GAAD;MACE,cAAchC,EAAc,WAAW,IAAI,wBAAwB;MACnE,OAAOT,EAAG,sCAAsC,wBAAwB;MACxE,aACES,EAAc,WAAW,IACrBT,EACE,oCACA,0FACF,IACAA,EACE,+BACA,uDACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;EACF;;AAET"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* User Notification History — personal history, filter, CSV export,
|
|
3
|
+
* archive/unarchive. Under FluidGrids' Navigation v2 (BOFF-11872) it is the
|
|
4
|
+
* "Archived" view instead; every other app keeps this page.
|
|
5
|
+
*/
|
|
2
6
|
export declare function NotificationHistoryPage(): import('react').JSX.Element;
|
|
@@ -6,80 +6,85 @@ import { NOTIFICATION_PERMISSIONS as r } from "../constants/permissions.js";
|
|
|
6
6
|
import { useNotification as i } from "../providers/NotificationProvider.js";
|
|
7
7
|
import { useTr as a } from "../shared/hooks/useTr.js";
|
|
8
8
|
import { exportNotificationsAsCsv as o } from "../utils/notificationHistoryExport.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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";
|
|
13
14
|
// src/pages/NotificationHistoryPage.tsx
|
|
14
|
-
var
|
|
15
|
+
var y = {
|
|
15
16
|
archived: null,
|
|
16
17
|
channel: "ALL"
|
|
17
18
|
};
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
return
|
|
19
|
+
function b() {
|
|
20
|
+
let { navigationV2: e } = i();
|
|
21
|
+
return f(e ? s : x, {});
|
|
22
|
+
}
|
|
23
|
+
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
26
|
className: "flex h-64 items-center justify-center",
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
-
}) : !b(r.NOTIFICATION_LIST) && !S?.id ? /* @__PURE__ */
|
|
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", {
|
|
24
29
|
className: "p-8 text-center text-text-secondary",
|
|
25
|
-
children:
|
|
26
|
-
}) : /* @__PURE__ */
|
|
30
|
+
children: s("notifications.noPermissionHistory", "You don't have permission to view notification history.")
|
|
31
|
+
}) : /* @__PURE__ */ p("div", {
|
|
27
32
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200",
|
|
28
33
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
icon: /* @__PURE__ */
|
|
31
|
-
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.")
|
|
32
37
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ p(h, {
|
|
34
39
|
"data-tour": "notification-history-header",
|
|
35
40
|
className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",
|
|
36
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
|
|
37
42
|
className: "text-xl sm:text-2xl font-bold text-primary",
|
|
38
|
-
children:
|
|
39
|
-
}), /* @__PURE__ */
|
|
43
|
+
children: s("notifications.historyTitle", "Notification History")
|
|
44
|
+
}), /* @__PURE__ */ f("p", {
|
|
40
45
|
className: "text-sm text-secondary mt-1",
|
|
41
|
-
children:
|
|
42
|
-
})] }), /* @__PURE__ */
|
|
46
|
+
children: s("notifications.historySubtitle", "View and search all your notifications")
|
|
47
|
+
})] }), /* @__PURE__ */ p(m, {
|
|
43
48
|
"data-tour": "notification-history-export",
|
|
44
49
|
variant: "outline",
|
|
45
|
-
onClick: () => o(
|
|
50
|
+
onClick: () => o(s, w),
|
|
46
51
|
disabled: w.length === 0,
|
|
47
52
|
className: "gap-2",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
53
|
+
children: [/* @__PURE__ */ f(l, { size: 16 }), s("notifications.export", "Export")]
|
|
49
54
|
})]
|
|
50
55
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ p(g, {
|
|
52
57
|
treatment: "plain",
|
|
53
58
|
className: "grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5",
|
|
54
59
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ p("div", {
|
|
56
61
|
className: "relative sm:col-span-2 xl:col-span-2",
|
|
57
|
-
children: [/* @__PURE__ */ d
|
|
62
|
+
children: [/* @__PURE__ */ f(d, {
|
|
58
63
|
size: 16,
|
|
59
64
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
|
|
60
|
-
}), /* @__PURE__ */
|
|
65
|
+
}), /* @__PURE__ */ f("input", {
|
|
61
66
|
type: "text",
|
|
62
|
-
placeholder:
|
|
67
|
+
placeholder: s("notifications.searchByTitleOrContent", "Search by title or content..."),
|
|
63
68
|
value: T.search,
|
|
64
69
|
onChange: (e) => E({ search: e.target.value }),
|
|
65
70
|
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"
|
|
66
71
|
})]
|
|
67
72
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ p("select", {
|
|
69
74
|
value: T.topicId || "",
|
|
70
75
|
onChange: (e) => E({ topicId: e.target.value || void 0 }),
|
|
71
76
|
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",
|
|
72
|
-
children: [/* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ f("option", {
|
|
73
78
|
value: "",
|
|
74
|
-
children:
|
|
75
|
-
}), C.map((e) => /* @__PURE__ */
|
|
79
|
+
children: s("notifications.allTopics", "All Topics")
|
|
80
|
+
}), C.map((e) => /* @__PURE__ */ f("option", {
|
|
76
81
|
value: e.id,
|
|
77
82
|
children: e.name
|
|
78
83
|
}, e.id))]
|
|
79
84
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ f("input", {
|
|
81
86
|
type: "date",
|
|
82
|
-
"aria-label":
|
|
87
|
+
"aria-label": s("notifications.startDate", "Start date"),
|
|
83
88
|
value: T.dateRange.start ? T.dateRange.start.toISOString().split("T")[0] : "",
|
|
84
89
|
onChange: (e) => E({ dateRange: {
|
|
85
90
|
...T.dateRange,
|
|
@@ -87,9 +92,9 @@ function y() {
|
|
|
87
92
|
} }),
|
|
88
93
|
className: "rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary"
|
|
89
94
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ f("input", {
|
|
91
96
|
type: "date",
|
|
92
|
-
"aria-label":
|
|
97
|
+
"aria-label": s("notifications.endDate", "End date"),
|
|
93
98
|
value: T.dateRange.end ? T.dateRange.end.toISOString().split("T")[0] : "",
|
|
94
99
|
onChange: (e) => E({ dateRange: {
|
|
95
100
|
...T.dateRange,
|
|
@@ -99,36 +104,36 @@ function y() {
|
|
|
99
104
|
})
|
|
100
105
|
]
|
|
101
106
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ f("div", {
|
|
103
108
|
className: "space-y-2",
|
|
104
|
-
children: w.length > 0 ? w.map((t) => /* @__PURE__ */
|
|
109
|
+
children: w.length > 0 ? w.map((t) => /* @__PURE__ */ p("div", {
|
|
105
110
|
className: "space-y-2",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ f(e, {
|
|
107
112
|
notification: t,
|
|
108
113
|
onArchive: D,
|
|
109
114
|
onAction: k,
|
|
110
115
|
showArchivedState: !0,
|
|
111
116
|
analyticsSource: "history"
|
|
112
|
-
}), t.archivedAt && /* @__PURE__ */
|
|
117
|
+
}), t.archivedAt && /* @__PURE__ */ f("div", {
|
|
113
118
|
className: "flex justify-end",
|
|
114
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ f("button", {
|
|
115
120
|
onClick: () => O(t.id),
|
|
116
121
|
className: "rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken",
|
|
117
|
-
children:
|
|
122
|
+
children: s("notifications.restore", "Restore")
|
|
118
123
|
})
|
|
119
124
|
})]
|
|
120
|
-
}, t.id)) : /* @__PURE__ */
|
|
125
|
+
}, t.id)) : /* @__PURE__ */ f("div", {
|
|
121
126
|
className: "animate-in fade-in duration-200",
|
|
122
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ f(_, {
|
|
123
128
|
illustration: A ? "empty-search" : "empty-notifications",
|
|
124
|
-
title: A ?
|
|
125
|
-
description: A ?
|
|
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.")
|
|
126
131
|
})
|
|
127
132
|
})
|
|
128
133
|
})
|
|
129
134
|
]
|
|
130
135
|
});
|
|
131
136
|
}
|
|
132
|
-
export {
|
|
137
|
+
export { b as NotificationHistoryPage };
|
|
133
138
|
|
|
134
139
|
//# sourceMappingURL=NotificationHistoryPage.js.map
|