@burdenoff/microfe-notification 2026.1124.1 → 2026.1127.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/AdminNotificationRoutes.js +59 -51
- package/dist/AdminNotificationRoutes.js.map +1 -1
- package/dist/NotificationRoutes.js +76 -68
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/UserNotificationRoutes.js +39 -31
- package/dist/UserNotificationRoutes.js.map +1 -1
- package/dist/components/NotificationListFooter.js +1 -1
- package/dist/components/NotificationListFooter.js.map +1 -1
- package/dist/components/NotificationPanel.js +0 -1
- package/dist/components/NotificationPanel.js.map +1 -1
- package/dist/components/loadingSystem.d.ts +64 -0
- package/dist/components/loadingSystem.js +34 -0
- package/dist/components/loadingSystem.js.map +1 -0
- package/dist/graphql/global-client.js +34 -34
- package/dist/index.js +9 -11
- package/dist/navigation-v2/AdminPageV2.js +23 -16
- package/dist/navigation-v2/AdminPageV2.js.map +1 -1
- package/dist/navigation-v2/NotificationArchivedV2.js +104 -98
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
- package/dist/navigation-v2/NotificationInboxV2.js +133 -127
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
- package/dist/navigation-v2/NotificationSettingsV2.js +91 -85
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -1
- package/dist/navigation-v2/NotificationsV2Landing.js +31 -23
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -1
- package/dist/pages/CreateNotificationPage.js +442 -432
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.js +93 -87
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.js +231 -225
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.js +72 -66
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationLandingPage.js +42 -34
- package/dist/pages/NotificationLandingPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.js +80 -71
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +192 -181
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +124 -118
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +248 -233
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/package.json +5 -2
- package/dist/components/index.js +0 -4
- package/dist/hooks/index.js +0 -8
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +0 -23
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +0 -15
- package/dist/node_modules/@apollo/client/errors/utils.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +0 -51
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +0 -40
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +0 -33
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -5
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +0 -15
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +0 -18
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +0 -20
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +0 -16
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -7
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -7
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +0 -22
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +0 -56
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
- package/dist/node_modules/@apollo/client/version.js +0 -5
- package/dist/node_modules/@apollo/client/version.js.map +0 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +0 -66
- package/dist/node_modules/@wry/caches/lib/weak.js.map +0 -1
- package/dist/node_modules/@wry/trie/lib/index.js +0 -52
- package/dist/node_modules/@wry/trie/lib/index.js.map +0 -1
- package/dist/node_modules/graphql-ws/dist/client.js +0 -279
- package/dist/node_modules/graphql-ws/dist/client.js.map +0 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +0 -61
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +0 -20
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -77
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -116
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -96
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +0 -11
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +0 -8
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -12
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -21
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -5
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -12
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -13
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
- package/dist/node_modules/tslib/tslib.es6.js +0 -51
- package/dist/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -1,53 +1,59 @@
|
|
|
1
1
|
import { NotificationCard as e } from "../components/NotificationCard.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "../
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { needsAction as ee } from "./inboxFilters.js";
|
|
2
|
+
import { NotificationListFooter as t } from "../components/NotificationListFooter.js";
|
|
3
|
+
import { NOTIFICATION_PERMISSIONS as n } from "../constants/permissions.js";
|
|
4
|
+
import { useNotifications as r } from "../hooks/useNotifications.js";
|
|
5
|
+
import { useNotificationTopics as ee } from "../hooks/useNotificationTopics.js";
|
|
6
|
+
import { useNotification as i } from "../providers/NotificationProvider.js";
|
|
7
|
+
import { useTr as a } from "../shared/hooks/useTr.js";
|
|
8
|
+
import { needsAction as o } from "./inboxFilters.js";
|
|
10
9
|
import { filterNotifications as s, groupNotificationsByDate as c } from "../utils/index.js";
|
|
11
10
|
import { AdminToolsMenu as l } from "./AdminToolsMenu.js";
|
|
12
11
|
import { MoreFiltersButton as u, SearchField as d, ViewChips as f } from "./FilterControls.js";
|
|
13
12
|
import { useNotificationPaths as p } from "./paths.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
13
|
+
import { CompactMarkOr as m, SectionLoaderOr as h } from "../components/loadingSystem.js";
|
|
14
|
+
import { useMemo as g, useState as _ } from "react";
|
|
15
|
+
import { usePermissions as v } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
16
|
+
import { Archive as y, CheckCheck as b, Settings as x } from "lucide-react";
|
|
17
|
+
import { Link as S } from "react-router";
|
|
18
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
19
|
+
import { PushOptInToggle as T } from "@burdenoff/fe-libs/chrome";
|
|
20
|
+
import { Button as E, IllustratedEmptyState as te, NativeSelect as D, useRememberedOpen as O } from "@burdenoff/fe-libs/ui";
|
|
21
21
|
// src/navigation-v2/NotificationInboxV2.tsx
|
|
22
|
-
var
|
|
22
|
+
var k = {
|
|
23
23
|
archived: !1,
|
|
24
24
|
channel: "IN_APP"
|
|
25
|
-
},
|
|
26
|
-
function
|
|
27
|
-
let l =
|
|
28
|
-
baseFilter:
|
|
29
|
-
unreadFilter:
|
|
30
|
-
}), { topics:
|
|
31
|
-
let e = s(
|
|
32
|
-
return
|
|
25
|
+
}, A = { channel: "IN_APP" }, j = "ALL";
|
|
26
|
+
function M() {
|
|
27
|
+
let l = a(), y = p(), { hasPermission: b, isLoading: x } = v(), { currentUser: M } = i(), { notifications: P, hasMore: F, isLoadingMore: I, loadMore: L, unreadCount: R, notificationFilter: z, markAsRead: B, markAllAsRead: V, archiveNotification: H, recordAction: ne, updateFilter: U, resetFilter: W } = r({
|
|
28
|
+
baseFilter: k,
|
|
29
|
+
unreadFilter: A
|
|
30
|
+
}), { topics: G } = ee({ isActive: !0 }), [K, q] = _(!1), [J, Y] = O("notifications.inbox.moreFilters", !1), X = K ? "action" : z.isRead === !1 ? "unread" : z.isRead === null ? "all" : null, Z = g(() => {
|
|
31
|
+
let e = s(P, z);
|
|
32
|
+
return K ? e.filter(o) : e;
|
|
33
33
|
}, [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
]),
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
|
|
34
|
+
P,
|
|
35
|
+
z,
|
|
36
|
+
K
|
|
37
|
+
]), re = g(() => c(Z, l), [Z, l]), Q = z.type !== j || z.priority !== j || !!z.topicId || z.isRead === !0, ie = !!z.search || Q || X !== "all", ae = (e) => {
|
|
38
|
+
q(e === "action"), U({ isRead: e !== "unread" && null });
|
|
39
|
+
}, $ = () => {
|
|
40
|
+
q(!1), W();
|
|
41
41
|
};
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
if (x) return /* @__PURE__ */ C(h, {
|
|
43
|
+
minHeight: "16rem",
|
|
44
|
+
today: /* @__PURE__ */ C("div", {
|
|
45
|
+
className: "flex h-64 items-center justify-center",
|
|
46
|
+
children: /* @__PURE__ */ C(m, {
|
|
47
|
+
className: "h-8 w-8",
|
|
48
|
+
today: /* @__PURE__ */ C("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
49
|
+
})
|
|
50
|
+
})
|
|
45
51
|
});
|
|
46
|
-
if (!
|
|
52
|
+
if (!b(n.NOTIFICATION_LIST) && !M?.id) return /* @__PURE__ */ C("div", {
|
|
47
53
|
className: "p-8 text-center text-text-secondary",
|
|
48
54
|
children: l("notifications.noPermissionView", "You don't have permission to view notifications.")
|
|
49
55
|
});
|
|
50
|
-
let
|
|
56
|
+
let oe = [
|
|
51
57
|
{
|
|
52
58
|
id: "all",
|
|
53
59
|
label: l("notifications.filterAll", "All")
|
|
@@ -60,9 +66,9 @@ function A() {
|
|
|
60
66
|
id: "action",
|
|
61
67
|
label: l("notifications.v2.needsAction", "Needs action")
|
|
62
68
|
}
|
|
63
|
-
],
|
|
69
|
+
], se = [
|
|
64
70
|
{
|
|
65
|
-
value:
|
|
71
|
+
value: j,
|
|
66
72
|
label: l("notifications.allTypes", "All Types")
|
|
67
73
|
},
|
|
68
74
|
{
|
|
@@ -81,9 +87,9 @@ function A() {
|
|
|
81
87
|
value: "MARKETING",
|
|
82
88
|
label: l("notifications.typeMarketing", "Marketing")
|
|
83
89
|
}
|
|
84
|
-
],
|
|
90
|
+
], ce = [
|
|
85
91
|
{
|
|
86
|
-
value:
|
|
92
|
+
value: j,
|
|
87
93
|
label: l("notifications.allPriorities", "All Priorities")
|
|
88
94
|
},
|
|
89
95
|
{
|
|
@@ -102,13 +108,13 @@ function A() {
|
|
|
102
108
|
value: "LOW",
|
|
103
109
|
label: l("notifications.priorityLow", "Low")
|
|
104
110
|
}
|
|
105
|
-
],
|
|
106
|
-
value:
|
|
111
|
+
], le = [{
|
|
112
|
+
value: j,
|
|
107
113
|
label: l("notifications.allTopics", "All Topics")
|
|
108
|
-
}, ...
|
|
114
|
+
}, ...G.map((e) => ({
|
|
109
115
|
value: e.id,
|
|
110
116
|
label: e.name
|
|
111
|
-
}))],
|
|
117
|
+
}))], ue = [
|
|
112
118
|
{
|
|
113
119
|
value: "ALL",
|
|
114
120
|
label: l("notifications.filterAll", "All")
|
|
@@ -121,197 +127,197 @@ function A() {
|
|
|
121
127
|
value: "READ",
|
|
122
128
|
label: l("notifications.filterRead", "Read")
|
|
123
129
|
}
|
|
124
|
-
],
|
|
125
|
-
return /* @__PURE__ */
|
|
130
|
+
], de = z.isRead === null ? "ALL" : z.isRead ? "READ" : "UNREAD";
|
|
131
|
+
return /* @__PURE__ */ w("div", {
|
|
126
132
|
className: "mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6",
|
|
127
133
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
unreadCount:
|
|
130
|
-
onMarkAllAsRead:
|
|
134
|
+
/* @__PURE__ */ C(N, {
|
|
135
|
+
unreadCount: R,
|
|
136
|
+
onMarkAllAsRead: V
|
|
131
137
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ C(T, {}),
|
|
139
|
+
/* @__PURE__ */ w("section", {
|
|
134
140
|
"data-tour": "notification-center-filters",
|
|
135
141
|
"aria-label": l("notifications.v2.filters", "Filters"),
|
|
136
142
|
className: "space-y-3",
|
|
137
143
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ w("div", {
|
|
139
145
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ C(d, {
|
|
141
147
|
label: l("notifications.searchPlaceholder", "Search notifications..."),
|
|
142
|
-
value:
|
|
143
|
-
onChange: (e) =>
|
|
148
|
+
value: z.search,
|
|
149
|
+
onChange: (e) => U({ search: e }),
|
|
144
150
|
tour: "notification-center-search"
|
|
145
|
-
}), /* @__PURE__ */
|
|
151
|
+
}), /* @__PURE__ */ w("div", {
|
|
146
152
|
className: "flex flex-wrap items-center gap-2",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
148
|
-
chips:
|
|
149
|
-
value:
|
|
150
|
-
onChange:
|
|
153
|
+
children: [/* @__PURE__ */ C(f, {
|
|
154
|
+
chips: oe,
|
|
155
|
+
value: X,
|
|
156
|
+
onChange: ae,
|
|
151
157
|
testIdPrefix: "notifications-view"
|
|
152
|
-
}), /* @__PURE__ */
|
|
153
|
-
open:
|
|
154
|
-
active:
|
|
158
|
+
}), /* @__PURE__ */ C(u, {
|
|
159
|
+
open: J,
|
|
160
|
+
active: Q,
|
|
155
161
|
controls: "notifications-more-filters",
|
|
156
|
-
onToggle: () =>
|
|
162
|
+
onToggle: () => Y(!J)
|
|
157
163
|
})]
|
|
158
164
|
})]
|
|
159
165
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ w("div", {
|
|
161
167
|
id: "notifications-more-filters",
|
|
162
|
-
hidden: !
|
|
168
|
+
hidden: !J,
|
|
163
169
|
className: "grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
164
170
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ C(D, {
|
|
166
172
|
"aria-label": l("notifications.v2.typeFilter", "Type"),
|
|
167
|
-
options:
|
|
168
|
-
value:
|
|
169
|
-
onValueChange: (e) =>
|
|
173
|
+
options: se,
|
|
174
|
+
value: z.type,
|
|
175
|
+
onValueChange: (e) => U({ type: e })
|
|
170
176
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ C(D, {
|
|
172
178
|
"aria-label": l("notifications.v2.priorityFilter", "Priority"),
|
|
173
|
-
options:
|
|
174
|
-
value:
|
|
175
|
-
onValueChange: (e) =>
|
|
179
|
+
options: ce,
|
|
180
|
+
value: z.priority,
|
|
181
|
+
onValueChange: (e) => U({ priority: e })
|
|
176
182
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ C(D, {
|
|
178
184
|
"aria-label": l("notifications.v2.topicFilter", "Topic"),
|
|
179
|
-
options:
|
|
180
|
-
value:
|
|
181
|
-
onValueChange: (e) =>
|
|
185
|
+
options: le,
|
|
186
|
+
value: z.topicId || j,
|
|
187
|
+
onValueChange: (e) => U({ topicId: e === j ? void 0 : e })
|
|
182
188
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ C(D, {
|
|
184
190
|
"aria-label": l("notifications.v2.readFilter", "Read state"),
|
|
185
|
-
options:
|
|
186
|
-
value:
|
|
191
|
+
options: ue,
|
|
192
|
+
value: de,
|
|
187
193
|
onValueChange: (e) => {
|
|
188
|
-
|
|
194
|
+
q(!1), U({ isRead: e === "ALL" ? null : e === "READ" });
|
|
189
195
|
}
|
|
190
196
|
})
|
|
191
197
|
]
|
|
192
198
|
}),
|
|
193
|
-
|
|
199
|
+
ie && /* @__PURE__ */ C("button", {
|
|
194
200
|
type: "button",
|
|
195
|
-
onClick:
|
|
201
|
+
onClick: $,
|
|
196
202
|
className: "text-sm text-text-tertiary transition-colors hover:text-text-primary",
|
|
197
203
|
children: l("notifications.v2.clearFilters", "Clear filters")
|
|
198
204
|
})
|
|
199
205
|
]
|
|
200
206
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ C("div", {
|
|
202
208
|
"data-tour": "notification-center-list",
|
|
203
209
|
className: "space-y-6",
|
|
204
|
-
children:
|
|
210
|
+
children: Z.length > 0 ? Object.entries(re).map(([t, n]) => /* @__PURE__ */ w("section", {
|
|
205
211
|
"aria-label": t,
|
|
206
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
207
213
|
className: "mb-3 text-sm font-semibold text-text-tertiary",
|
|
208
214
|
children: t
|
|
209
|
-
}), /* @__PURE__ */
|
|
215
|
+
}), /* @__PURE__ */ C("div", {
|
|
210
216
|
className: "space-y-2",
|
|
211
|
-
children: n.map((t) => /* @__PURE__ */
|
|
217
|
+
children: n.map((t) => /* @__PURE__ */ C(e, {
|
|
212
218
|
notification: t,
|
|
213
|
-
onMarkAsRead:
|
|
214
|
-
onArchive:
|
|
215
|
-
onAction:
|
|
219
|
+
onMarkAsRead: B,
|
|
220
|
+
onArchive: H,
|
|
221
|
+
onAction: ne,
|
|
216
222
|
analyticsSource: "center",
|
|
217
223
|
navigationV2: !0,
|
|
218
|
-
showTopic:
|
|
224
|
+
showTopic: J
|
|
219
225
|
}, t.id))
|
|
220
226
|
})]
|
|
221
|
-
}, t)) : /* @__PURE__ */
|
|
222
|
-
illustration:
|
|
223
|
-
title:
|
|
224
|
-
description:
|
|
225
|
-
action:
|
|
227
|
+
}, t)) : /* @__PURE__ */ C(te, {
|
|
228
|
+
illustration: P.length === 0 ? "empty-notifications" : "empty-search",
|
|
229
|
+
title: P.length === 0 ? l("notifications.v2.emptyTitle", "You're all caught up") : l("notifications.noNotificationsFound", "No notifications found"),
|
|
230
|
+
description: P.length === 0 ? l("notifications.v2.emptyDescription", "Nothing here yet. We'll let you know when something needs you.") : l("notifications.adjustFilters", "Try adjusting your filters to see more notifications."),
|
|
231
|
+
action: P.length === 0 ? /* @__PURE__ */ C(E, {
|
|
226
232
|
asChild: !0,
|
|
227
233
|
variant: "outline",
|
|
228
|
-
children: /* @__PURE__ */
|
|
229
|
-
to:
|
|
234
|
+
children: /* @__PURE__ */ C(S, {
|
|
235
|
+
to: y.preferences,
|
|
230
236
|
children: l("notifications.v2.chooseHow", "Choose how we reach you")
|
|
231
237
|
})
|
|
232
|
-
}) : /* @__PURE__ */
|
|
238
|
+
}) : /* @__PURE__ */ C(E, {
|
|
233
239
|
type: "button",
|
|
234
240
|
variant: "outline",
|
|
235
|
-
onClick:
|
|
241
|
+
onClick: $,
|
|
236
242
|
children: l("notifications.v2.clearFilters", "Clear filters")
|
|
237
243
|
}),
|
|
238
|
-
kind:
|
|
244
|
+
kind: z.search ? "no-results" : Q ? "filtered" : "all-done"
|
|
239
245
|
})
|
|
240
246
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
hasMore:
|
|
243
|
-
isLoadingMore:
|
|
244
|
-
onLoadMore:
|
|
245
|
-
shownCount:
|
|
247
|
+
/* @__PURE__ */ C(t, {
|
|
248
|
+
hasMore: F,
|
|
249
|
+
isLoadingMore: I,
|
|
250
|
+
onLoadMore: L,
|
|
251
|
+
shownCount: Z.length
|
|
246
252
|
})
|
|
247
253
|
]
|
|
248
254
|
});
|
|
249
255
|
}
|
|
250
|
-
function
|
|
251
|
-
let n =
|
|
252
|
-
return /* @__PURE__ */
|
|
256
|
+
function N({ unreadCount: e, onMarkAllAsRead: t }) {
|
|
257
|
+
let n = a(), r = p();
|
|
258
|
+
return /* @__PURE__ */ w("header", {
|
|
253
259
|
"data-tour": "notification-center-header",
|
|
254
260
|
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ w("div", {
|
|
256
262
|
className: "min-w-0",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ w("h1", {
|
|
258
264
|
className: "flex flex-wrap items-center gap-2 text-xl font-semibold text-text-primary sm:text-2xl",
|
|
259
|
-
children: [n("notifications.v2.title", "Notifications"), e > 0 && /* @__PURE__ */
|
|
265
|
+
children: [n("notifications.v2.title", "Notifications"), e > 0 && /* @__PURE__ */ w("span", {
|
|
260
266
|
"data-tour": "notification-center-unread-count",
|
|
261
267
|
className: "inline-flex items-center gap-1.5 rounded-full bg-accent-primary/10 px-2.5 py-0.5 text-sm font-medium text-accent-primary",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ C("span", {
|
|
263
269
|
className: "inline-block h-2 w-2 rounded-full bg-accent-primary",
|
|
264
270
|
"aria-hidden": "true"
|
|
265
271
|
}), n("notifications.v2.unreadCount", "{{count}} unread", { count: e })]
|
|
266
272
|
})]
|
|
267
|
-
}), /* @__PURE__ */
|
|
273
|
+
}), /* @__PURE__ */ C("p", {
|
|
268
274
|
className: "mt-1 text-sm text-text-secondary",
|
|
269
275
|
children: n("notifications.v2.subtitle", "Everything the platform told you, in one place.")
|
|
270
276
|
})]
|
|
271
|
-
}), /* @__PURE__ */
|
|
277
|
+
}), /* @__PURE__ */ w("div", {
|
|
272
278
|
className: "flex flex-wrap items-center gap-2",
|
|
273
279
|
children: [
|
|
274
|
-
e > 0 && /* @__PURE__ */
|
|
280
|
+
e > 0 && /* @__PURE__ */ w(E, {
|
|
275
281
|
"data-tour": "notification-center-mark-all-read",
|
|
276
282
|
variant: "outline",
|
|
277
283
|
onClick: t,
|
|
278
284
|
className: "gap-2",
|
|
279
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ C(b, {
|
|
280
286
|
size: 16,
|
|
281
287
|
"aria-hidden": "true"
|
|
282
288
|
}), n("notifications.v2.markAllAsRead", "Mark all as read")]
|
|
283
289
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ C(E, {
|
|
285
291
|
asChild: !0,
|
|
286
292
|
variant: "outline",
|
|
287
293
|
className: "gap-2",
|
|
288
|
-
children: /* @__PURE__ */ S
|
|
294
|
+
children: /* @__PURE__ */ w(S, {
|
|
289
295
|
to: r.preferences,
|
|
290
296
|
"data-testid": "notifications-settings-link",
|
|
291
|
-
children: [/* @__PURE__ */ x
|
|
297
|
+
children: [/* @__PURE__ */ C(x, {
|
|
292
298
|
size: 16,
|
|
293
299
|
"aria-hidden": "true"
|
|
294
300
|
}), n("notifications.v2.settings", "Notification settings")]
|
|
295
301
|
})
|
|
296
302
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ C(E, {
|
|
298
304
|
asChild: !0,
|
|
299
305
|
variant: "ghost",
|
|
300
306
|
className: "gap-2",
|
|
301
|
-
children: /* @__PURE__ */ S
|
|
307
|
+
children: /* @__PURE__ */ w(S, {
|
|
302
308
|
to: r.archived,
|
|
303
309
|
"data-testid": "notifications-archived-link",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ C(y, {
|
|
305
311
|
size: 16,
|
|
306
312
|
"aria-hidden": "true"
|
|
307
313
|
}), n("notifications.v2.archived", "Archived")]
|
|
308
314
|
})
|
|
309
315
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ C(l, {})
|
|
311
317
|
]
|
|
312
318
|
})]
|
|
313
319
|
});
|
|
314
320
|
}
|
|
315
|
-
export {
|
|
321
|
+
export { M as NotificationInboxV2 };
|
|
316
322
|
|
|
317
323
|
//# sourceMappingURL=NotificationInboxV2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationInboxV2.js","names":["CENTER_FILTER","CENTER_UNREAD_FILTER","ALL","NotificationInboxV2","tr","useTr","paths","useNotificationPaths","permissionsLoading","usePermissions","useNotification","useNotifications","useNotificationTopics","onlyNeedsAction","setOnlyNeedsAction","useState","moreFiltersOpen","setMoreFiltersOpen","useRememberedOpen","view","notificationFilter","visible","useMemo","filtered","filterNotifications","notifications","needsAction","grouped","groupNotificationsByDate","moreFiltersActive","anyFilterActive","chooseView","next","updateFilter","clearFilters","resetFilter","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","chips","typeOptions","priorityOptions","topicOptions","topics","topic","readOptions","readValue","InboxHeader","markAllAsRead","PushOptInToggle","SearchField","ViewChips","MoreFiltersButton","NativeSelect","value","group","items","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState","Button","Link","NotificationListFooter","loadMore","unreadCount","onMarkAllAsRead","CheckCheck","Settings","Archive","AdminToolsMenu"],"sources":["../../src/navigation-v2/NotificationInboxV2.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Archive, CheckCheck, Settings } from 'lucide-react';\nimport { Link } from 'react-router';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n IllustratedEmptyState,\n NativeSelect,\n useRememberedOpen,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { needsAction, type InboxView } from './inboxFilters';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { AdminToolsMenu } from './AdminToolsMenu';\nimport { MoreFiltersButton, SearchField, ViewChips } from './FilterControls';\nimport { useNotificationPaths } from './paths';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst ALL = 'ALL';\n\n/**\n * Notifications, Navigation v2 (BOFF-11872, mockup 41). Level 1: the title\n * with the unread count, \"Mark all as read\", \"Notification settings\",\n * \"Archived\", search and the All · Unread · Needs action chips. Level 2: the\n * admin tools under \"More\", and Type, Priority, Topic and the full read state\n * under \"More filters\" (remembered per profile). Same queries as the classic\n * Notification Center.\n */\nexport function NotificationInboxV2() {\n const tr = useTr();\n const paths = useNotificationPaths();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\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 const [onlyNeedsAction, setOnlyNeedsAction] = useState(false);\n const [moreFiltersOpen, setMoreFiltersOpen] = useRememberedOpen(\n 'notifications.inbox.moreFilters',\n false\n );\n\n const view: InboxView | null = onlyNeedsAction\n ? 'action'\n : notificationFilter.isRead === false\n ? 'unread'\n : notificationFilter.isRead === null\n ? 'all'\n : null;\n\n const visible = useMemo(() => {\n const filtered = filterNotifications(notifications, notificationFilter);\n return onlyNeedsAction ? filtered.filter(needsAction) : filtered;\n }, [notifications, notificationFilter, onlyNeedsAction]);\n const grouped = useMemo(() => groupNotificationsByDate(visible, tr), [visible, tr]);\n\n const moreFiltersActive =\n notificationFilter.type !== ALL ||\n notificationFilter.priority !== ALL ||\n Boolean(notificationFilter.topicId) ||\n notificationFilter.isRead === true;\n const anyFilterActive = Boolean(notificationFilter.search) || moreFiltersActive || view !== 'all';\n\n const chooseView = (next: InboxView) => {\n setOnlyNeedsAction(next === 'action');\n updateFilter({ isRead: next === 'unread' ? false : null });\n };\n\n const clearFilters = () => {\n setOnlyNeedsAction(false);\n resetFilter();\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 // The permission-fallback state (NOTIF-CTR-15), unchanged.\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 const chips: Array<{ id: InboxView; label: string }> = [\n { id: 'all', label: tr('notifications.filterAll', 'All') },\n { id: 'unread', label: tr('notifications.filterUnread', 'Unread') },\n { id: 'action', label: tr('notifications.v2.needsAction', 'Needs action') },\n ];\n\n const typeOptions = [\n { value: ALL, label: tr('notifications.allTypes', 'All Types') },\n { value: 'SYSTEM', label: tr('notifications.typeSystem', 'System') },\n { value: 'ALERT', label: tr('notifications.typeAlert', 'Alert') },\n { value: 'TRANSACTIONAL', label: tr('notifications.typeTransactional', 'Transactional') },\n { value: 'MARKETING', label: tr('notifications.typeMarketing', 'Marketing') },\n ];\n const priorityOptions = [\n { value: ALL, label: tr('notifications.allPriorities', 'All Priorities') },\n { value: 'URGENT', label: tr('notifications.priorityUrgent', 'Urgent') },\n { value: 'HIGH', label: tr('notifications.priorityHigh', 'High') },\n { value: 'NORMAL', label: tr('notifications.priorityNormal', 'Normal') },\n { value: 'LOW', label: tr('notifications.priorityLow', 'Low') },\n ];\n const topicOptions = [\n { value: ALL, label: tr('notifications.allTopics', 'All Topics') },\n ...topics.map((topic) => ({ value: topic.id, label: topic.name })),\n ];\n const readOptions = [\n { value: 'ALL', label: tr('notifications.filterAll', 'All') },\n { value: 'UNREAD', label: tr('notifications.filterUnread', 'Unread') },\n { value: 'READ', label: tr('notifications.filterRead', 'Read') },\n ];\n const readValue =\n notificationFilter.isRead === null ? 'ALL' : notificationFilter.isRead ? 'READ' : 'UNREAD';\n\n return (\n <div className=\"mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6\">\n <InboxHeader unreadCount={unreadCount} onMarkAllAsRead={markAllAsRead} />\n\n <PushOptInToggle />\n\n <section\n data-tour=\"notification-center-filters\"\n aria-label={tr('notifications.v2.filters', 'Filters')}\n className=\"space-y-3\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center\">\n <SearchField\n label={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(search) => updateFilter({ search })}\n tour=\"notification-center-search\"\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <ViewChips\n chips={chips}\n value={view}\n onChange={chooseView}\n testIdPrefix=\"notifications-view\"\n />\n <MoreFiltersButton\n open={moreFiltersOpen}\n active={moreFiltersActive}\n controls=\"notifications-more-filters\"\n onToggle={() => setMoreFiltersOpen(!moreFiltersOpen)}\n />\n </div>\n </div>\n\n <div\n id=\"notifications-more-filters\"\n hidden={!moreFiltersOpen}\n className=\"grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-2 lg:grid-cols-4\"\n >\n <NativeSelect\n aria-label={tr('notifications.v2.typeFilter', 'Type')}\n options={typeOptions}\n value={notificationFilter.type}\n // The options above are exactly ALL plus the NotificationType values.\n onValueChange={(value) => updateFilter({ type: value as NotificationType | 'ALL' })}\n />\n <NativeSelect\n aria-label={tr('notifications.v2.priorityFilter', 'Priority')}\n options={priorityOptions}\n value={notificationFilter.priority}\n // The options above are exactly ALL plus the NotificationPriority values.\n onValueChange={(value) =>\n updateFilter({ priority: value as NotificationPriority | 'ALL' })\n }\n />\n <NativeSelect\n aria-label={tr('notifications.v2.topicFilter', 'Topic')}\n options={topicOptions}\n value={notificationFilter.topicId || ALL}\n onValueChange={(value) => updateFilter({ topicId: value === ALL ? undefined : value })}\n />\n <NativeSelect\n aria-label={tr('notifications.v2.readFilter', 'Read state')}\n options={readOptions}\n value={readValue}\n onValueChange={(value) => {\n setOnlyNeedsAction(false);\n updateFilter({ isRead: value === 'ALL' ? null : value === 'READ' });\n }}\n />\n </div>\n\n {anyFilterActive && (\n <button\n type=\"button\"\n onClick={clearFilters}\n className=\"text-sm text-text-tertiary transition-colors hover:text-text-primary\"\n >\n {tr('notifications.v2.clearFilters', 'Clear filters')}\n </button>\n )}\n </section>\n\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {visible.length > 0 ? (\n Object.entries(grouped).map(([group, items]) => (\n <section key={group} aria-label={group}>\n <h2 className=\"mb-3 text-sm font-semibold text-text-tertiary\">{group}</h2>\n <div className=\"space-y-2\">\n {items.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n navigationV2\n showTopic={moreFiltersOpen}\n />\n ))}\n </div>\n </section>\n ))\n ) : (\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={\n notifications.length === 0\n ? tr('notifications.v2.emptyTitle', \"You're all caught up\")\n : tr('notifications.noNotificationsFound', 'No notifications found')\n }\n description={\n notifications.length === 0\n ? tr(\n 'notifications.v2.emptyDescription',\n \"Nothing here yet. We'll let you know when something needs you.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n action={\n notifications.length === 0 ? (\n <Button asChild variant=\"outline\">\n <Link to={paths.preferences}>\n {tr('notifications.v2.chooseHow', 'Choose how we reach you')}\n </Link>\n </Button>\n ) : (\n <Button type=\"button\" variant=\"outline\" onClick={clearFilters}>\n {tr('notifications.v2.clearFilters', 'Clear filters')}\n </Button>\n )\n }\n // The server applies the search and the filters, so an empty list says nothing about\n // whether there are notifications: the kind follows the filters. An empty inbox, or an\n // empty Unread / Needs action view, means everything is handled.\n kind={\n notificationFilter.search ? 'no-results' : moreFiltersActive ? 'filtered' : 'all-done'\n }\n />\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={visible.length}\n />\n </div>\n );\n}\n\n/** The inbox header: title with the unread count and the level-1 actions. */\nfunction InboxHeader({\n unreadCount,\n onMarkAllAsRead,\n}: {\n unreadCount: number;\n onMarkAllAsRead: () => void;\n}) {\n const tr = useTr();\n const paths = useNotificationPaths();\n return (\n <header\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div className=\"min-w-0\">\n <h1 className=\"flex flex-wrap items-center gap-2 text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.title', 'Notifications')}\n {unreadCount > 0 && (\n <span\n data-tour=\"notification-center-unread-count\"\n className=\"inline-flex items-center gap-1.5 rounded-full bg-accent-primary/10 px-2.5 py-0.5 text-sm font-medium text-accent-primary\"\n >\n <span\n className=\"inline-block h-2 w-2 rounded-full bg-accent-primary\"\n aria-hidden=\"true\"\n />\n {tr('notifications.v2.unreadCount', '{{count}} unread', { count: unreadCount })}\n </span>\n )}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr('notifications.v2.subtitle', 'Everything the platform told you, in one place.')}\n </p>\n </div>\n <div className=\"flex flex-wrap items-center gap-2\">\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={onMarkAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.markAllAsRead', 'Mark all as read')}\n </Button>\n )}\n <Button asChild variant=\"outline\" className=\"gap-2\">\n <Link to={paths.preferences} data-testid=\"notifications-settings-link\">\n <Settings size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.settings', 'Notification settings')}\n </Link>\n </Button>\n <Button asChild variant=\"ghost\" className=\"gap-2\">\n <Link to={paths.archived} data-testid=\"notifications-archived-link\">\n <Archive size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.archived', 'Archived')}\n </Link>\n </Button>\n <AdminToolsMenu />\n </div>\n </header>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,IAAMA,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAM;AAUZ,SAAgBC,IAAsB;CACpC,IAAMC,IAAKC,EAAM,GACXC,IAAQC,EAAqB,GAC7B,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBC,EAAgB,GAClC,EACJ,kBACA,YACA,kBACA,aACA,gBACA,uBACA,eACA,kBACA,wBACA,iBACA,iBACA,oBACEC,EAAiB;EAAE,YAAYX;EAAe,cAAcC;CAAqB,CAAC,GAChF,EAAE,cAAWW,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,CAACC,GAAiBC,KAAsBC,EAAS,EAAK,GACtD,CAACC,GAAiBC,KAAsBC,GAC5C,mCACA,EACF,GAEMC,IAAyBN,IAC3B,WACAO,EAAmB,WAAW,KAC5B,WACAA,EAAmB,WAAW,OAC5B,QACA,MAEFC,IAAUC,QAAc;EAC5B,IAAMC,IAAWC,EAAoBC,GAAeL,CAAkB;EACtE,OAAOP,IAAkBU,EAAS,OAAOG,EAAW,IAAIH;CAC1D,GAAG;EAACE;EAAeL;EAAoBP;CAAe,CAAC,GACjDc,IAAUL,QAAcM,EAAyBP,GAASjB,CAAE,GAAG,CAACiB,GAASjB,CAAE,CAAC,GAE5EyB,IACJT,EAAmB,SAASlB,KAC5BkB,EAAmB,aAAalB,KAChC,EAAQkB,EAAmB,WAC3BA,EAAmB,WAAW,IAC1BU,KAAkB,EAAQV,EAAmB,UAAWS,KAAqBV,MAA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AAA,CACA;EACL,CAAA,GAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACG+D,IAAc,KACb,kBAACJ,GAAD;KACE,aAAU;KACV,SAAQ;KACR,SAASK;KACT,WAAU;KAJZ,UAAA,CAME,kBAACC,GAAD;MAAY,MAAM;MAAI,eAAY;KAAQ,CAAA,GACzCjE,EAAG,kCAAkC,kBAAkB,CAClD;;IAEV,kBAAC2D,GAAD;KAAQ,SAAA;KAAQ,SAAQ;KAAU,WAAU;KAC1C,UAAA,kBAACC,GAAD;MAAM,IAAI1D,EAAM;MAAa,eAAY;MAAzC,UAAA,CACE,kBAACgE,GAAD;OAAU,MAAM;OAAI,eAAY;MAAQ,CAAA,GACvClE,EAAG,6BAA6B,uBAAuB,CACpD;;IACA,CAAA;IACR,kBAAC2D,GAAD;KAAQ,SAAA;KAAQ,SAAQ;KAAQ,WAAU;KACxC,UAAA,kBAACC,GAAD;MAAM,IAAI1D,EAAM;MAAU,eAAY;MAAtC,UAAA,CACE,kBAACiE,GAAD;OAAS,MAAM;OAAI,eAAY;MAAQ,CAAA,GACtCnE,EAAG,6BAA6B,UAAU,CACvC;;IACA,CAAA;IACR,kBAACoE,GAAD,CAAiB,CAAA;GACd;EACC,CAAA,CAAA;;AAEZ"}
|
|
1
|
+
{"version":3,"file":"NotificationInboxV2.js","names":["CENTER_FILTER","CENTER_UNREAD_FILTER","ALL","NotificationInboxV2","tr","useTr","paths","useNotificationPaths","permissionsLoading","usePermissions","useNotification","useNotifications","useNotificationTopics","onlyNeedsAction","setOnlyNeedsAction","useState","moreFiltersOpen","setMoreFiltersOpen","useRememberedOpen","view","notificationFilter","visible","useMemo","filtered","filterNotifications","notifications","needsAction","grouped","groupNotificationsByDate","moreFiltersActive","anyFilterActive","chooseView","next","updateFilter","clearFilters","resetFilter","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","chips","typeOptions","priorityOptions","topicOptions","topics","topic","readOptions","readValue","InboxHeader","markAllAsRead","PushOptInToggle","SearchField","ViewChips","MoreFiltersButton","NativeSelect","value","group","items","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState","Button","Link","NotificationListFooter","loadMore","unreadCount","onMarkAllAsRead","CheckCheck","Settings","Archive","AdminToolsMenu"],"sources":["../../src/navigation-v2/NotificationInboxV2.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Archive, CheckCheck, Settings } from 'lucide-react';\nimport { Link } from 'react-router';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n IllustratedEmptyState,\n NativeSelect,\n useRememberedOpen,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { needsAction, type InboxView } from './inboxFilters';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { AdminToolsMenu } from './AdminToolsMenu';\nimport { MoreFiltersButton, SearchField, ViewChips } from './FilterControls';\nimport { useNotificationPaths } from './paths';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst ALL = 'ALL';\n\n/**\n * Notifications, Navigation v2 (BOFF-11872, mockup 41). Level 1: the title\n * with the unread count, \"Mark all as read\", \"Notification settings\",\n * \"Archived\", search and the All · Unread · Needs action chips. Level 2: the\n * admin tools under \"More\", and Type, Priority, Topic and the full read state\n * under \"More filters\" (remembered per profile). Same queries as the classic\n * Notification Center.\n */\nexport function NotificationInboxV2() {\n const tr = useTr();\n const paths = useNotificationPaths();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\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 const [onlyNeedsAction, setOnlyNeedsAction] = useState(false);\n const [moreFiltersOpen, setMoreFiltersOpen] = useRememberedOpen(\n 'notifications.inbox.moreFilters',\n false\n );\n\n const view: InboxView | null = onlyNeedsAction\n ? 'action'\n : notificationFilter.isRead === false\n ? 'unread'\n : notificationFilter.isRead === null\n ? 'all'\n : null;\n\n const visible = useMemo(() => {\n const filtered = filterNotifications(notifications, notificationFilter);\n return onlyNeedsAction ? filtered.filter(needsAction) : filtered;\n }, [notifications, notificationFilter, onlyNeedsAction]);\n const grouped = useMemo(() => groupNotificationsByDate(visible, tr), [visible, tr]);\n\n const moreFiltersActive =\n notificationFilter.type !== ALL ||\n notificationFilter.priority !== ALL ||\n Boolean(notificationFilter.topicId) ||\n notificationFilter.isRead === true;\n const anyFilterActive = Boolean(notificationFilter.search) || moreFiltersActive || view !== 'all';\n\n const chooseView = (next: InboxView) => {\n setOnlyNeedsAction(next === 'action');\n updateFilter({ isRead: next === 'unread' ? false : null });\n };\n\n const clearFilters = () => {\n setOnlyNeedsAction(false);\n resetFilter();\n };\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n }\n\n // The permission-fallback state (NOTIF-CTR-15), unchanged.\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 const chips: Array<{ id: InboxView; label: string }> = [\n { id: 'all', label: tr('notifications.filterAll', 'All') },\n { id: 'unread', label: tr('notifications.filterUnread', 'Unread') },\n { id: 'action', label: tr('notifications.v2.needsAction', 'Needs action') },\n ];\n\n const typeOptions = [\n { value: ALL, label: tr('notifications.allTypes', 'All Types') },\n { value: 'SYSTEM', label: tr('notifications.typeSystem', 'System') },\n { value: 'ALERT', label: tr('notifications.typeAlert', 'Alert') },\n { value: 'TRANSACTIONAL', label: tr('notifications.typeTransactional', 'Transactional') },\n { value: 'MARKETING', label: tr('notifications.typeMarketing', 'Marketing') },\n ];\n const priorityOptions = [\n { value: ALL, label: tr('notifications.allPriorities', 'All Priorities') },\n { value: 'URGENT', label: tr('notifications.priorityUrgent', 'Urgent') },\n { value: 'HIGH', label: tr('notifications.priorityHigh', 'High') },\n { value: 'NORMAL', label: tr('notifications.priorityNormal', 'Normal') },\n { value: 'LOW', label: tr('notifications.priorityLow', 'Low') },\n ];\n const topicOptions = [\n { value: ALL, label: tr('notifications.allTopics', 'All Topics') },\n ...topics.map((topic) => ({ value: topic.id, label: topic.name })),\n ];\n const readOptions = [\n { value: 'ALL', label: tr('notifications.filterAll', 'All') },\n { value: 'UNREAD', label: tr('notifications.filterUnread', 'Unread') },\n { value: 'READ', label: tr('notifications.filterRead', 'Read') },\n ];\n const readValue =\n notificationFilter.isRead === null ? 'ALL' : notificationFilter.isRead ? 'READ' : 'UNREAD';\n\n return (\n <div className=\"mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6\">\n <InboxHeader unreadCount={unreadCount} onMarkAllAsRead={markAllAsRead} />\n\n <PushOptInToggle />\n\n <section\n data-tour=\"notification-center-filters\"\n aria-label={tr('notifications.v2.filters', 'Filters')}\n className=\"space-y-3\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center\">\n <SearchField\n label={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(search) => updateFilter({ search })}\n tour=\"notification-center-search\"\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <ViewChips\n chips={chips}\n value={view}\n onChange={chooseView}\n testIdPrefix=\"notifications-view\"\n />\n <MoreFiltersButton\n open={moreFiltersOpen}\n active={moreFiltersActive}\n controls=\"notifications-more-filters\"\n onToggle={() => setMoreFiltersOpen(!moreFiltersOpen)}\n />\n </div>\n </div>\n\n <div\n id=\"notifications-more-filters\"\n hidden={!moreFiltersOpen}\n className=\"grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-2 lg:grid-cols-4\"\n >\n <NativeSelect\n aria-label={tr('notifications.v2.typeFilter', 'Type')}\n options={typeOptions}\n value={notificationFilter.type}\n // The options above are exactly ALL plus the NotificationType values.\n onValueChange={(value) => updateFilter({ type: value as NotificationType | 'ALL' })}\n />\n <NativeSelect\n aria-label={tr('notifications.v2.priorityFilter', 'Priority')}\n options={priorityOptions}\n value={notificationFilter.priority}\n // The options above are exactly ALL plus the NotificationPriority values.\n onValueChange={(value) =>\n updateFilter({ priority: value as NotificationPriority | 'ALL' })\n }\n />\n <NativeSelect\n aria-label={tr('notifications.v2.topicFilter', 'Topic')}\n options={topicOptions}\n value={notificationFilter.topicId || ALL}\n onValueChange={(value) => updateFilter({ topicId: value === ALL ? undefined : value })}\n />\n <NativeSelect\n aria-label={tr('notifications.v2.readFilter', 'Read state')}\n options={readOptions}\n value={readValue}\n onValueChange={(value) => {\n setOnlyNeedsAction(false);\n updateFilter({ isRead: value === 'ALL' ? null : value === 'READ' });\n }}\n />\n </div>\n\n {anyFilterActive && (\n <button\n type=\"button\"\n onClick={clearFilters}\n className=\"text-sm text-text-tertiary transition-colors hover:text-text-primary\"\n >\n {tr('notifications.v2.clearFilters', 'Clear filters')}\n </button>\n )}\n </section>\n\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {visible.length > 0 ? (\n Object.entries(grouped).map(([group, items]) => (\n <section key={group} aria-label={group}>\n <h2 className=\"mb-3 text-sm font-semibold text-text-tertiary\">{group}</h2>\n <div className=\"space-y-2\">\n {items.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n navigationV2\n showTopic={moreFiltersOpen}\n />\n ))}\n </div>\n </section>\n ))\n ) : (\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={\n notifications.length === 0\n ? tr('notifications.v2.emptyTitle', \"You're all caught up\")\n : tr('notifications.noNotificationsFound', 'No notifications found')\n }\n description={\n notifications.length === 0\n ? tr(\n 'notifications.v2.emptyDescription',\n \"Nothing here yet. We'll let you know when something needs you.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n action={\n notifications.length === 0 ? (\n <Button asChild variant=\"outline\">\n <Link to={paths.preferences}>\n {tr('notifications.v2.chooseHow', 'Choose how we reach you')}\n </Link>\n </Button>\n ) : (\n <Button type=\"button\" variant=\"outline\" onClick={clearFilters}>\n {tr('notifications.v2.clearFilters', 'Clear filters')}\n </Button>\n )\n }\n // The server applies the search and the filters, so an empty list says nothing about\n // whether there are notifications: the kind follows the filters. An empty inbox, or an\n // empty Unread / Needs action view, means everything is handled.\n kind={\n notificationFilter.search ? 'no-results' : moreFiltersActive ? 'filtered' : 'all-done'\n }\n />\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={visible.length}\n />\n </div>\n );\n}\n\n/** The inbox header: title with the unread count and the level-1 actions. */\nfunction InboxHeader({\n unreadCount,\n onMarkAllAsRead,\n}: {\n unreadCount: number;\n onMarkAllAsRead: () => void;\n}) {\n const tr = useTr();\n const paths = useNotificationPaths();\n return (\n <header\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div className=\"min-w-0\">\n <h1 className=\"flex flex-wrap items-center gap-2 text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.title', 'Notifications')}\n {unreadCount > 0 && (\n <span\n data-tour=\"notification-center-unread-count\"\n className=\"inline-flex items-center gap-1.5 rounded-full bg-accent-primary/10 px-2.5 py-0.5 text-sm font-medium text-accent-primary\"\n >\n <span\n className=\"inline-block h-2 w-2 rounded-full bg-accent-primary\"\n aria-hidden=\"true\"\n />\n {tr('notifications.v2.unreadCount', '{{count}} unread', { count: unreadCount })}\n </span>\n )}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr('notifications.v2.subtitle', 'Everything the platform told you, in one place.')}\n </p>\n </div>\n <div className=\"flex flex-wrap items-center gap-2\">\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={onMarkAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.markAllAsRead', 'Mark all as read')}\n </Button>\n )}\n <Button asChild variant=\"outline\" className=\"gap-2\">\n <Link to={paths.preferences} data-testid=\"notifications-settings-link\">\n <Settings size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.settings', 'Notification settings')}\n </Link>\n </Button>\n <Button asChild variant=\"ghost\" className=\"gap-2\">\n <Link to={paths.archived} data-testid=\"notifications-archived-link\">\n <Archive size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.archived', 'Archived')}\n </Link>\n </Button>\n <AdminToolsMenu />\n </div>\n </header>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBA,IAAMA,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAM;AAUZ,SAAgBC,IAAsB;CACpC,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