@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,84 +1,92 @@
|
|
|
1
1
|
import { NotificationCenterPage as e } from "./NotificationCenterPage.js";
|
|
2
2
|
import { useTr as t } from "../shared/hooks/useTr.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { CompactMarkOr as n, SectionLoaderOr as r } from "../components/loadingSystem.js";
|
|
4
|
+
import { Suspense as i, lazy as a, useEffect as o, useMemo as s } from "react";
|
|
5
|
+
import { useFeatureFlagDetails as c } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
6
|
+
import { useSearchParams as l } from "react-router";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { Tabs as f } from "@burdenoff/fe-libs/chrome";
|
|
8
9
|
// src/pages/NotificationLandingPage.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
var p = a(() => import("./NotificationHistoryAdminPage.js").then((e) => ({ default: e.NotificationHistoryAdminPage }))), m = a(() => import("./NotificationTemplatesPage.js").then((e) => ({ default: e.NotificationTemplatesPage }))), h = a(() => import("./CreateNotificationPage.js").then((e) => ({ default: e.CreateNotificationPage }))), g = a(() => import("./NotificationTopicsPage.js").then((e) => ({ default: e.NotificationTopicsPage })));
|
|
11
|
+
function _() {
|
|
12
|
+
return /* @__PURE__ */ u(r, {
|
|
13
|
+
route: !0,
|
|
14
|
+
minHeight: "16rem",
|
|
15
|
+
today: /* @__PURE__ */ u("div", {
|
|
16
|
+
className: "flex h-64 items-center justify-center",
|
|
17
|
+
children: /* @__PURE__ */ u(n, {
|
|
18
|
+
className: "h-8 w-8",
|
|
19
|
+
today: /* @__PURE__ */ u("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
20
|
+
})
|
|
21
|
+
})
|
|
14
22
|
});
|
|
15
23
|
}
|
|
16
|
-
function
|
|
17
|
-
let [
|
|
24
|
+
function v() {
|
|
25
|
+
let [n, r] = l(), a = t(), v = c("notification.templates"), y = c("notification.create"), b = c("notification.history"), x = v ? !!v.value : !1, S = y ? !!y.value : !1, C = b ? !!b.value : !1, w = s(() => [
|
|
18
26
|
{
|
|
19
27
|
id: "inbox",
|
|
20
|
-
label:
|
|
28
|
+
label: a("notification.landing.tabs.inbox", "Inbox")
|
|
21
29
|
},
|
|
22
30
|
...S ? [{
|
|
23
31
|
id: "send",
|
|
24
|
-
label:
|
|
32
|
+
label: a("notification.landing.tabs.send", "Send")
|
|
25
33
|
}] : [],
|
|
26
34
|
...C ? [{
|
|
27
35
|
id: "history",
|
|
28
|
-
label:
|
|
36
|
+
label: a("notification.landing.tabs.history", "History")
|
|
29
37
|
}] : [],
|
|
30
38
|
...x ? [{
|
|
31
39
|
id: "templates",
|
|
32
|
-
label:
|
|
40
|
+
label: a("notification.landing.tabs.templates", "Templates")
|
|
33
41
|
}] : [],
|
|
34
42
|
...S ? [{
|
|
35
43
|
id: "topics",
|
|
36
|
-
label:
|
|
44
|
+
label: a("notification.landing.tabs.topics", "Topics")
|
|
37
45
|
}] : []
|
|
38
46
|
], [
|
|
39
|
-
|
|
47
|
+
a,
|
|
40
48
|
x,
|
|
41
49
|
S,
|
|
42
50
|
C
|
|
43
|
-
]), T =
|
|
44
|
-
return
|
|
45
|
-
T && !w.some((e) => e.id === T) &&
|
|
51
|
+
]), T = n.get("tab"), E = T && w.some((e) => e.id === T) ? T : w[0].id;
|
|
52
|
+
return o(() => {
|
|
53
|
+
T && !w.some((e) => e.id === T) && r((e) => {
|
|
46
54
|
let t = new URLSearchParams(e);
|
|
47
55
|
return t.delete("tab"), t;
|
|
48
56
|
}, { replace: !0 });
|
|
49
57
|
}, [
|
|
50
58
|
T,
|
|
51
59
|
w,
|
|
52
|
-
|
|
53
|
-
]), /* @__PURE__ */
|
|
60
|
+
r
|
|
61
|
+
]), /* @__PURE__ */ d("div", {
|
|
54
62
|
className: "flex flex-col h-full",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
63
|
+
children: [/* @__PURE__ */ u("div", {
|
|
56
64
|
className: "border-b border-border-seam px-4 pt-3",
|
|
57
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ u(f, {
|
|
58
66
|
items: w,
|
|
59
67
|
activeTabId: E,
|
|
60
68
|
onTabChange: (e) => {
|
|
61
|
-
|
|
69
|
+
r((t) => {
|
|
62
70
|
let n = new URLSearchParams(t);
|
|
63
71
|
return e === w[0].id ? n.delete("tab") : n.set("tab", e), n;
|
|
64
72
|
}, { replace: !0 });
|
|
65
73
|
},
|
|
66
74
|
variant: "underline"
|
|
67
75
|
})
|
|
68
|
-
}), /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ d("div", {
|
|
69
77
|
className: "flex-1 min-h-0 overflow-auto",
|
|
70
|
-
children: [E === "inbox" && /* @__PURE__ */
|
|
71
|
-
fallback: /* @__PURE__ */
|
|
78
|
+
children: [E === "inbox" && /* @__PURE__ */ u(e, {}), /* @__PURE__ */ d(i, {
|
|
79
|
+
fallback: /* @__PURE__ */ u(_, {}),
|
|
72
80
|
children: [
|
|
73
|
-
E === "send" && S && /* @__PURE__ */
|
|
74
|
-
E === "history" && C && /* @__PURE__ */
|
|
75
|
-
E === "templates" && x && /* @__PURE__ */
|
|
76
|
-
E === "topics" && S && /* @__PURE__ */
|
|
81
|
+
E === "send" && S && /* @__PURE__ */ u(h, {}),
|
|
82
|
+
E === "history" && C && /* @__PURE__ */ u(p, {}),
|
|
83
|
+
E === "templates" && x && /* @__PURE__ */ u(m, {}),
|
|
84
|
+
E === "topics" && S && /* @__PURE__ */ u(g, {})
|
|
77
85
|
]
|
|
78
86
|
})]
|
|
79
87
|
})]
|
|
80
88
|
});
|
|
81
89
|
}
|
|
82
|
-
export {
|
|
90
|
+
export { v as NotificationLandingPage };
|
|
83
91
|
|
|
84
92
|
//# sourceMappingURL=NotificationLandingPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationLandingPage.js","names":["NotificationHistoryAdminPage","lazy","m","NotificationTemplatesPage","CreateNotificationPage","NotificationTopicsPage","TabBodyLoader","NotificationLandingPage","params","setParams","useSearchParams","tr","useTr","templatesDetails","useFeatureFlagDetails","createDetails","historyDetails","templatesEnabled","createEnabled","historyEnabled","tabs","useMemo","rawTab","activeId","t","useEffect","next","prev","Tabs","id","NotificationCenterPage","Suspense"],"sources":["../../src/pages/NotificationLandingPage.tsx"],"sourcesContent":["import { Suspense, lazy, useEffect, useMemo } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { Tabs, type TabItem } from '@burdenoff/fe-libs/chrome';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\n\nimport { NotificationCenterPage } from './NotificationCenterPage';\nimport { useTr } from '../shared/hooks/useTr';\n\n// Lazy-load admin tab bodies — each tab pulls its bundle only when activated,\n// matching the code-splitting done in AdminNotificationRoutes.\nconst NotificationHistoryAdminPage = lazy(() =>\n import('./NotificationHistoryAdminPage').then((m) => ({\n default: m.NotificationHistoryAdminPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./CreateNotificationPage').then((m) => ({\n default: m.CreateNotificationPage,\n }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./NotificationTopicsPage').then((m) => ({\n default: m.NotificationTopicsPage,\n }))\n);\n\nfunction TabBodyLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n
|
|
1
|
+
{"version":3,"file":"NotificationLandingPage.js","names":["NotificationHistoryAdminPage","lazy","m","NotificationTemplatesPage","CreateNotificationPage","NotificationTopicsPage","TabBodyLoader","SectionLoaderOr","CompactMarkOr","NotificationLandingPage","params","setParams","useSearchParams","tr","useTr","templatesDetails","useFeatureFlagDetails","createDetails","historyDetails","templatesEnabled","createEnabled","historyEnabled","tabs","useMemo","rawTab","activeId","t","useEffect","next","prev","Tabs","id","NotificationCenterPage","Suspense"],"sources":["../../src/pages/NotificationLandingPage.tsx"],"sourcesContent":["import { Suspense, lazy, useEffect, useMemo } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { Tabs, type TabItem } from '@burdenoff/fe-libs/chrome';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\n\nimport { NotificationCenterPage } from './NotificationCenterPage';\nimport { useTr } from '../shared/hooks/useTr';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\n// Lazy-load admin tab bodies — each tab pulls its bundle only when activated,\n// matching the code-splitting done in AdminNotificationRoutes.\nconst NotificationHistoryAdminPage = lazy(() =>\n import('./NotificationHistoryAdminPage').then((m) => ({\n default: m.NotificationHistoryAdminPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./CreateNotificationPage').then((m) => ({\n default: m.CreateNotificationPage,\n }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./NotificationTopicsPage').then((m) => ({\n default: m.NotificationTopicsPage,\n }))\n);\n\nfunction TabBodyLoader() {\n return (\n <SectionLoaderOr\n route\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/**\n * Tabbed landing page for the Notification microfrontend.\n *\n * Admin-only tabs (Send, History, Templates, Topics) are gated by the\n * notification.* feature flags. Gating is applied here because this\n * page bypasses the route-level flag gates in AdminNotificationRoutes:\n * without this check an admin landing on /notifications could click\n * into any tab regardless of flag state.\n */\nexport function NotificationLandingPage() {\n const [params, setParams] = useSearchParams();\n const tr = useTr();\n\n // Explicit `false` fallback prevents the provider's default-allow from\n // leaking unseeded flags — same pattern as AdminNotificationRoot.tsx.\n const templatesDetails = useFeatureFlagDetails('notification.templates');\n const createDetails = useFeatureFlagDetails('notification.create');\n const historyDetails = useFeatureFlagDetails('notification.history');\n const templatesEnabled = templatesDetails ? Boolean(templatesDetails.value) : false;\n const createEnabled = createDetails ? Boolean(createDetails.value) : false;\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n const tabs: TabItem[] = useMemo(\n () => [\n { id: 'inbox', label: tr('notification.landing.tabs.inbox', 'Inbox') },\n ...(createEnabled\n ? [{ id: 'send', label: tr('notification.landing.tabs.send', 'Send') }]\n : []),\n ...(historyEnabled\n ? [{ id: 'history', label: tr('notification.landing.tabs.history', 'History') }]\n : []),\n ...(templatesEnabled\n ? [{ id: 'templates', label: tr('notification.landing.tabs.templates', 'Templates') }]\n : []),\n // Topics CRUD maps to `notification.create` per the backend @rbac (see\n // AdminNotificationRoutes.tsx: topics route is gated by createEnabled).\n ...(createEnabled\n ? [{ id: 'topics', label: tr('notification.landing.tabs.topics', 'Topics') }]\n : []),\n ],\n [tr, templatesEnabled, createEnabled, historyEnabled]\n );\n\n // Validate the `?tab=` query param against the filtered tab list — an\n // unknown value (stale URL, disabled flag) would otherwise leave the body\n // empty and the Tabs strip with no active item.\n const rawTab = params.get('tab');\n const activeId = rawTab && tabs.some((t) => t.id === rawTab) ? rawTab : tabs[0].id;\n\n // Rule 3 of COMPONENT_LEVEL_GATING.md: when a flag flips off while the\n // user is viewing that tab, clear the `tab` query param so subsequent\n // reloads don't resurrect the disabled view. Using the functional setter\n // form avoids depending on the `params` reference (which would re-fire\n // this effect on every update).\n useEffect(() => {\n if (rawTab && !tabs.some((t) => t.id === rawTab)) {\n setParams(\n (prev) => {\n const next = new URLSearchParams(prev);\n next.delete('tab');\n return next;\n },\n { replace: true }\n );\n }\n }, [rawTab, tabs, setParams]);\n\n // Functional setter avoids capturing a stale `params` reference in the\n // closure — prevents dropping a concurrent query param on rapid clicks.\n const handleTabChange = (id: string) => {\n setParams(\n (prev) => {\n const next = new URLSearchParams(prev);\n if (id === tabs[0].id) {\n next.delete('tab');\n } else {\n next.set('tab', id);\n }\n return next;\n },\n { replace: true }\n );\n };\n\n return (\n <div className=\"flex flex-col h-full\">\n <div className=\"border-b border-border-seam px-4 pt-3\">\n <Tabs\n items={tabs}\n activeTabId={activeId}\n onTabChange={handleTabChange}\n variant=\"underline\"\n />\n </div>\n <div className=\"flex-1 min-h-0 overflow-auto\">\n {/*\n History tab is flag-gated but not PermissionGate-wrapped at this layer\n — it mirrors AdminNotificationRoutes where the /history route is the\n same: the admin page itself requires NOTIFICATION_LIST permission and\n renders its own no-permission fallback when missing. Templates and\n Create tabs go through separate flag-gated routes with PermissionGate\n in AdminNotificationRoutes, so when navigated via tab here they\n bypass that gate — but the inner pages (TemplateEditor, CreateNotificationPage,\n NotificationTemplatesPage) each perform their own permission checks\n and hide write actions for read-only users.\n */}\n {activeId === 'inbox' && <NotificationCenterPage />}\n <Suspense fallback={<TabBodyLoader />}>\n {activeId === 'send' && createEnabled && <CreateNotificationPage />}\n {activeId === 'history' && historyEnabled && <NotificationHistoryAdminPage />}\n {activeId === 'templates' && templatesEnabled && <NotificationTemplatesPage />}\n {activeId === 'topics' && createEnabled && <NotificationTopicsPage />}\n </Suspense>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,IAAMA,IAA+BC,QACnC,OAAO,oCAAiC,CAAC,MAAM,OAAO,EACpD,SAASC,EAAE,6BACb,EAAE,CACJ,GACMC,IAA4BF,QAChC,OAAO,iCAA8B,CAAC,MAAM,OAAO,EACjD,SAASC,EAAE,0BACb,EAAE,CACJ,GACME,IAAyBH,QAC7B,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAC9C,SAASC,EAAE,uBACb,EAAE,CACJ,GACMG,IAAyBJ,QAC7B,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAC9C,SAASC,EAAE,uBACb,EAAE,CACJ;AAEA,SAASI,IAAgB;CACvB,OACE,kBAACC,GAAD;EACE,OAAA;EACA,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA;AAEL;AAWA,SAAgBC,IAA0B;CACxC,IAAM,CAACC,GAAQC,KAAaC,EAAgB,GACtCC,IAAKC,EAAM,GAIXC,IAAmBC,EAAsB,wBAAwB,GACjEC,IAAgBD,EAAsB,qBAAqB,GAC3DE,IAAiBF,EAAsB,sBAAsB,GAC7DG,IAAmBJ,IAAmB,EAAQA,EAAiB,QAAS,IACxEK,IAAgBH,IAAgB,EAAQA,EAAc,QAAS,IAC/DI,IAAiBH,IAAiB,EAAQA,EAAe,QAAS,IAElEI,IAAkBC,QAChB;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,CAAA;EACE,CAAA,GACL,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CAYGH,MAAa,WAAW,kBAACO,GAAD,CAAyB,CAAA,GAClD,kBAACC,GAAD;IAAU,UAAU,kBAAC3B,GAAD,CAAgB,CAAA;IAApC,UAAA;KACGmB,MAAa,UAAUL,KAAiB,kBAAChB,GAAD,CAAyB,CAAA;KACjEqB,MAAa,aAAaJ,KAAkB,kBAACrB,GAAD,CAA+B,CAAA;KAC3EyB,MAAa,eAAeN,KAAoB,kBAAChB,GAAD,CAA4B,CAAA;KAC5EsB,MAAa,YAAYL,KAAiB,kBAACf,GAAD,CAAyB,CAAA;IAC5D;GACP,CAAA,CAAA;EACF,CAAA,CAAA;;AAET"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import "../hooks/index.js";
|
|
2
1
|
import { useNotificationTopics as e } from "../hooks/useNotificationTopics.js";
|
|
3
2
|
import { usePreferenceToggles as t } from "../hooks/usePreferenceToggles.js";
|
|
4
3
|
import { NOTIFICATION_PERMISSIONS as n } from "../constants/permissions.js";
|
|
5
4
|
import { useNotification as r } from "../providers/NotificationProvider.js";
|
|
6
5
|
import { useTr as i } from "../shared/hooks/useTr.js";
|
|
7
6
|
import { NotificationSettingsV2 as a } from "../navigation-v2/NotificationSettingsV2.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { CompactMarkOr as o, SectionLoaderOr as s } from "../components/loadingSystem.js";
|
|
8
|
+
import { useMemo as c, useState as l } from "react";
|
|
9
|
+
import { usePermissions as u } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
10
|
+
import { BellRing as d, Search as f, ToggleLeft as p, ToggleRight as m } from "lucide-react";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { EmphasisPanel as _, IllustratedEmptyState as v, OptionalFields as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
// src/pages/NotificationPreferencesPage.tsx
|
|
14
|
-
var
|
|
14
|
+
var x = [
|
|
15
15
|
{
|
|
16
16
|
value: "IN_APP",
|
|
17
17
|
labelKey: "notifications.channelInApp",
|
|
@@ -42,7 +42,7 @@ var y = [
|
|
|
42
42
|
labelKey: "notifications.channelSlack",
|
|
43
43
|
label: "Slack"
|
|
44
44
|
}
|
|
45
|
-
],
|
|
45
|
+
], S = [
|
|
46
46
|
{
|
|
47
47
|
value: "TRANSACTIONAL",
|
|
48
48
|
labelKey: "notifications.typeTransactional",
|
|
@@ -64,124 +64,133 @@ var y = [
|
|
|
64
64
|
label: "Marketing"
|
|
65
65
|
}
|
|
66
66
|
];
|
|
67
|
-
function
|
|
67
|
+
function C() {
|
|
68
68
|
let { navigationV2: e } = r();
|
|
69
|
-
return
|
|
69
|
+
return h(e ? a : T, {});
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
71
|
+
function w() {
|
|
72
|
+
return /* @__PURE__ */ h(s, {
|
|
73
|
+
minHeight: "16rem",
|
|
74
|
+
today: /* @__PURE__ */ h("div", {
|
|
75
|
+
className: "flex h-64 items-center justify-center",
|
|
76
|
+
children: /* @__PURE__ */ h(o, {
|
|
77
|
+
className: "h-8 w-8",
|
|
78
|
+
today: /* @__PURE__ */ h("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function T() {
|
|
84
|
+
let a = i(), { hasPermission: o, isLoading: s } = u(), { currentUser: C } = r(), { topics: T, isLoading: E, isForbidden: D } = e({
|
|
73
85
|
type: "MARKETING",
|
|
74
86
|
isActive: !0
|
|
75
|
-
}), { preferencesByKey:
|
|
76
|
-
if (!
|
|
77
|
-
let e =
|
|
78
|
-
return
|
|
79
|
-
}, [
|
|
80
|
-
let t =
|
|
81
|
-
return /* @__PURE__ */
|
|
87
|
+
}), { preferencesByKey: O, preferencesLoading: k, savingKey: A, saveFeedback: j, togglePreference: M, resetPreference: N } = t(), [P, F] = l(""), I = E || k, L = c(() => {
|
|
88
|
+
if (!P.trim()) return T;
|
|
89
|
+
let e = P.toLowerCase();
|
|
90
|
+
return T.filter((t) => t.name.toLowerCase().includes(e) || t.slug.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
|
|
91
|
+
}, [P, T]), R = (e) => {
|
|
92
|
+
let t = O.get(e.key), n = t?.enabled ?? !0, r = A === e.key, i = j?.key === e.key ? j : null;
|
|
93
|
+
return /* @__PURE__ */ g("div", {
|
|
82
94
|
className: "rounded-lg border border-border-seam bg-gloss-card p-4 transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)]",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ g("div", {
|
|
84
96
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ g("div", {
|
|
86
98
|
className: "space-y-1",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ g("div", {
|
|
88
100
|
className: "flex items-center gap-2",
|
|
89
101
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ h(d, {
|
|
91
103
|
size: 16,
|
|
92
104
|
className: "text-accent-primary"
|
|
93
105
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ h("h2", {
|
|
95
107
|
className: "text-sm font-semibold text-primary",
|
|
96
108
|
children: e.title
|
|
97
109
|
}),
|
|
98
|
-
t && /* @__PURE__ */
|
|
110
|
+
t && /* @__PURE__ */ h("span", {
|
|
99
111
|
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
100
112
|
children: t.frequency.replace("_", " ").toLowerCase()
|
|
101
113
|
})
|
|
102
114
|
]
|
|
103
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ h("p", {
|
|
104
116
|
className: "text-sm text-text-secondary",
|
|
105
117
|
children: e.description
|
|
106
118
|
})]
|
|
107
|
-
}), /* @__PURE__ */
|
|
119
|
+
}), /* @__PURE__ */ g("div", {
|
|
108
120
|
className: "flex items-center gap-2",
|
|
109
|
-
children: [t && /* @__PURE__ */
|
|
121
|
+
children: [t && /* @__PURE__ */ h("button", {
|
|
110
122
|
type: "button",
|
|
111
123
|
disabled: r,
|
|
112
|
-
onClick: () =>
|
|
124
|
+
onClick: () => N(e.key),
|
|
113
125
|
className: "rounded-md border border-default px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50",
|
|
114
126
|
children: a("notifications.reset", "Reset")
|
|
115
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ g("button", {
|
|
116
128
|
type: "button",
|
|
117
129
|
"aria-pressed": n,
|
|
118
130
|
disabled: r,
|
|
119
|
-
onClick: () =>
|
|
131
|
+
onClick: () => M({
|
|
120
132
|
scope: e.scope,
|
|
121
133
|
channel: e.channel,
|
|
122
134
|
type: e.type,
|
|
123
135
|
topicId: e.topicId
|
|
124
136
|
}),
|
|
125
137
|
className: `inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors ${n ? "border-accent-primary bg-action-primary-bg text-text-inverse hover:opacity-90" : "border-default bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"} disabled:cursor-not-allowed disabled:opacity-50`,
|
|
126
|
-
children: [
|
|
138
|
+
children: [h(n ? m : p, { size: 18 }), r ? a("notifications.saving", "Saving...") : n ? a("notifications.enabled", "Enabled") : a("notifications.disabled", "Disabled")]
|
|
127
139
|
})]
|
|
128
140
|
})]
|
|
129
|
-
}), /* @__PURE__ */
|
|
141
|
+
}), /* @__PURE__ */ h("div", {
|
|
130
142
|
className: "mt-3 min-h-5",
|
|
131
143
|
"aria-live": "polite",
|
|
132
|
-
children: i && /* @__PURE__ */
|
|
144
|
+
children: i && /* @__PURE__ */ h("p", {
|
|
133
145
|
className: `text-xs ${i.type === "success" ? "text-success" : "text-error"}`,
|
|
134
146
|
children: i.message
|
|
135
147
|
})
|
|
136
148
|
})]
|
|
137
149
|
}, e.key);
|
|
138
150
|
};
|
|
139
|
-
return
|
|
140
|
-
className: "flex h-64 items-center justify-center",
|
|
141
|
-
children: /* @__PURE__ */ p("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
142
|
-
}) : !x(n.NOTIFICATION_LIST) && !C?.id ? /* @__PURE__ */ p("div", {
|
|
151
|
+
return s ? /* @__PURE__ */ h(w, {}) : !o(n.NOTIFICATION_LIST) && !C?.id ? /* @__PURE__ */ h("div", {
|
|
143
152
|
className: "p-8 text-center text-text-secondary",
|
|
144
153
|
children: a("notifications.noPermissionPreferences", "You don't have permission to manage notification preferences.")
|
|
145
|
-
}) : /* @__PURE__ */
|
|
154
|
+
}) : /* @__PURE__ */ g("div", {
|
|
146
155
|
"data-tour": "notification-preferences-page",
|
|
147
156
|
className: "space-y-6 p-4 sm:p-6",
|
|
148
157
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
150
159
|
className: "text-2xl font-bold text-primary",
|
|
151
160
|
children: a("notifications.preferencesTitle", "Notification Preferences")
|
|
152
|
-
}), /* @__PURE__ */
|
|
161
|
+
}), /* @__PURE__ */ h("p", {
|
|
153
162
|
className: "mt-1 text-sm text-text-secondary",
|
|
154
163
|
children: a("notifications.preferencesSubtitle", "Control global, channel, type, and topic-level notification delivery.")
|
|
155
164
|
})] }),
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
icon: /* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ h(b, {
|
|
166
|
+
icon: /* @__PURE__ */ h(d, { size: 16 }),
|
|
158
167
|
children: a("notifications.preferencesPurpose", "Decide how and when we reach you. The Global switch is your master on/off, then you can fine-tune individual channels (email, push, SMS…), notification types and the marketing topics you have subscribed to. Settings cascade — turning a channel off silences it everywhere.")
|
|
159
168
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ g(_, {
|
|
161
170
|
"data-tour": "notification-preferences-global",
|
|
162
171
|
className: "space-y-3 p-5 sm:p-6",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
164
173
|
className: "text-sm font-semibold uppercase tracking-wide text-tertiary",
|
|
165
174
|
children: a("notifications.globalPreferences", "Global")
|
|
166
|
-
}),
|
|
175
|
+
}), R({
|
|
167
176
|
key: "GLOBAL",
|
|
168
177
|
scope: "GLOBAL",
|
|
169
178
|
title: a("notifications.allNotifications", "All notifications"),
|
|
170
179
|
description: a("notifications.allNotificationsDescription", "Master preference for notification delivery across all channels and types.")
|
|
171
180
|
})]
|
|
172
181
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ g(y, {
|
|
174
183
|
title: a("notifications.advancedPreferences", "Advanced settings"),
|
|
175
184
|
description: a("notifications.advancedPreferencesDescription", "Per-channel filter rules, notification-type filters, and quiet-hour overrides."),
|
|
176
|
-
children: [/* @__PURE__ */
|
|
185
|
+
children: [/* @__PURE__ */ g("section", {
|
|
177
186
|
"data-tour": "notification-preferences-channels",
|
|
178
187
|
className: "space-y-3",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
180
189
|
className: "text-sm font-semibold uppercase tracking-wide text-tertiary",
|
|
181
190
|
children: a("notifications.channelPreferences", "Channels")
|
|
182
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ h("div", {
|
|
183
192
|
className: "grid gap-3 lg:grid-cols-2",
|
|
184
|
-
children:
|
|
193
|
+
children: x.map((e) => R({
|
|
185
194
|
key: `CHANNEL:${e.value}`,
|
|
186
195
|
scope: "CHANNEL",
|
|
187
196
|
channel: e.value,
|
|
@@ -189,15 +198,15 @@ function S() {
|
|
|
189
198
|
description: a("notifications.channelPreferenceDescription", "Control delivery for this channel.")
|
|
190
199
|
}))
|
|
191
200
|
})]
|
|
192
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ g("section", {
|
|
193
202
|
"data-tour": "notification-preferences-types",
|
|
194
203
|
className: "mt-6 space-y-3",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
196
205
|
className: "text-sm font-semibold uppercase tracking-wide text-tertiary",
|
|
197
206
|
children: a("notifications.typePreferences", "Notification Types")
|
|
198
|
-
}), /* @__PURE__ */
|
|
207
|
+
}), /* @__PURE__ */ h("div", {
|
|
199
208
|
className: "grid gap-3 lg:grid-cols-2",
|
|
200
|
-
children:
|
|
209
|
+
children: S.map((e) => R({
|
|
201
210
|
key: `TYPE:${e.value}`,
|
|
202
211
|
scope: "TYPE",
|
|
203
212
|
type: e.value,
|
|
@@ -207,43 +216,43 @@ function S() {
|
|
|
207
216
|
})]
|
|
208
217
|
})]
|
|
209
218
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ g("div", {
|
|
211
220
|
className: "relative max-w-xl",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ h(f, {
|
|
213
222
|
size: 16,
|
|
214
223
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
|
|
215
|
-
}), /* @__PURE__ */
|
|
224
|
+
}), /* @__PURE__ */ h("input", {
|
|
216
225
|
type: "text",
|
|
217
|
-
value:
|
|
218
|
-
onChange: (e) =>
|
|
226
|
+
value: P,
|
|
227
|
+
onChange: (e) => F(e.target.value),
|
|
219
228
|
"aria-label": a("notifications.searchTopics", "Search topics..."),
|
|
220
229
|
placeholder: a("notifications.searchTopics", "Search topics..."),
|
|
221
230
|
className: "w-full rounded-lg border border-default bg-surface py-2 pl-9 pr-4 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent"
|
|
222
231
|
})]
|
|
223
232
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ g("section", {
|
|
225
234
|
"data-tour": "notification-preferences-topics",
|
|
226
235
|
className: "space-y-3",
|
|
227
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
228
237
|
className: "text-sm font-semibold uppercase tracking-wide text-tertiary",
|
|
229
238
|
children: a("notifications.topicPreferences", "Topics")
|
|
230
|
-
}),
|
|
239
|
+
}), I ? /* @__PURE__ */ h("div", {
|
|
231
240
|
className: "rounded-lg border border-default bg-surface p-6 text-sm text-text-secondary",
|
|
232
241
|
children: a("notifications.loadingPreferences", "Loading preferences...")
|
|
233
|
-
}) :
|
|
242
|
+
}) : D ? /* @__PURE__ */ h(v, {
|
|
234
243
|
illustration: "empty-generic",
|
|
235
244
|
title: a("notifications.topicsNoAccessTitle", "You don't have access to notification topics"),
|
|
236
245
|
description: a("notifications.topicsNoAccessDescription", "Your role doesn't include permission to read notification topics. Ask a workspace admin if you need access."),
|
|
237
246
|
kind: "no-access",
|
|
238
247
|
size: "panel"
|
|
239
|
-
}) :
|
|
240
|
-
illustration:
|
|
241
|
-
title:
|
|
242
|
-
description:
|
|
243
|
-
kind:
|
|
248
|
+
}) : L.length === 0 ? /* @__PURE__ */ h(v, {
|
|
249
|
+
illustration: P.trim() ? "empty-search" : "empty-data",
|
|
250
|
+
title: P.trim() ? a("notifications.noTopicsFound", "No topics match your search") : a("notifications.noTopicsAvailableTitle", "No subscribable topics yet"),
|
|
251
|
+
description: P.trim() ? a("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : a("notifications.noTopicsAvailableDescription", "When marketing topics are published you can subscribe or unsubscribe from each one here."),
|
|
252
|
+
kind: P.trim() ? "no-results" : "first-use",
|
|
244
253
|
glassIllustration: "notifications",
|
|
245
254
|
size: "panel"
|
|
246
|
-
}) :
|
|
255
|
+
}) : L.map((e) => R({
|
|
247
256
|
key: `TOPIC:${e.id}`,
|
|
248
257
|
scope: "TOPIC",
|
|
249
258
|
topicId: e.id,
|
|
@@ -254,6 +263,6 @@ function S() {
|
|
|
254
263
|
]
|
|
255
264
|
});
|
|
256
265
|
}
|
|
257
|
-
export {
|
|
266
|
+
export { C as NotificationPreferencesPage };
|
|
258
267
|
|
|
259
268
|
//# sourceMappingURL=NotificationPreferencesPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationPreferencesPage.js","names":["CHANNEL_OPTIONS","TYPE_OPTIONS","NotificationPreferencesPage","useNotification","jsx","navigationV2","NotificationSettingsV2","ClassicNotificationPreferencesPage","tr","useTr","permissionsLoading","usePermissions","topicsLoading","topicsForbidden","useNotificationTopics","usePreferenceToggles","search","setSearch","useState","isLoading","preferencesLoading","filteredTopics","useMemo","topics","query","topic","renderPreferenceRow","existing","preferencesByKey","input","isEnabled","isSaving","savingKey","feedback","saveFeedback","BellRing","resetPreference","togglePreference","ToggleRight","ToggleLeft","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","EmphasisPanel","OptionalFields","channel","type","Search","event","IllustratedEmptyState"],"sources":["../../src/pages/NotificationPreferencesPage.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { BellRing, Search, ToggleLeft, ToggleRight } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n EmphasisPanel,\n IllustratedEmptyState,\n OptionalFields,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotificationTopics } from '../hooks';\nimport { usePreferenceToggles } from '../hooks/usePreferenceToggles';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationChannel, NotificationPreferenceScope, NotificationType } from '../types';\nimport { NotificationSettingsV2 } from '../navigation-v2/NotificationSettingsV2';\n\nconst CHANNEL_OPTIONS: Array<{ value: NotificationChannel; labelKey: string; label: string }> = [\n { value: 'IN_APP', labelKey: 'notifications.channelInApp', label: 'In-app' },\n { value: 'EMAIL', labelKey: 'notifications.channelEmail', label: 'Email' },\n { value: 'PUSH', labelKey: 'notifications.channelPush', label: 'Push' },\n { value: 'SMS', labelKey: 'notifications.channelSms', label: 'SMS' },\n { value: 'WHATSAPP', labelKey: 'notifications.channelWhatsapp', label: 'WhatsApp' },\n { value: 'SLACK', labelKey: 'notifications.channelSlack', label: 'Slack' },\n];\n\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alerts' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\n\n/**\n * Notification preferences. Under FluidGrids' Navigation v2 (BOFF-11872) it\n * is \"Notification settings\" instead; every other app keeps this page.\n */\nexport function NotificationPreferencesPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationSettingsV2 /> : <ClassicNotificationPreferencesPage />;\n}\n\nfunction ClassicNotificationPreferencesPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n topics,\n isLoading: topicsLoading,\n isForbidden: topicsForbidden,\n } = useNotificationTopics({\n type: 'MARKETING',\n isActive: true,\n });\n const {\n preferencesByKey,\n preferencesLoading,\n savingKey,\n saveFeedback,\n togglePreference,\n resetPreference,\n } = usePreferenceToggles();\n const [search, setSearch] = useState('');\n\n const isLoading = topicsLoading || preferencesLoading;\n\n const filteredTopics = useMemo(() => {\n if (!search.trim()) {\n return topics;\n }\n\n const query = search.toLowerCase();\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\n\n const renderPreferenceRow = (input: {\n key: string;\n title: string;\n description: string;\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n }) => {\n const existing = preferencesByKey.get(input.key);\n const isEnabled = existing?.enabled ?? true;\n const isSaving = savingKey === input.key;\n const feedback = saveFeedback?.key === input.key ? saveFeedback : null;\n\n return (\n <div\n key={input.key}\n className=\"rounded-lg border border-border-seam bg-gloss-card p-4 transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)]\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2\">\n <BellRing size={16} className=\"text-accent-primary\" />\n <h2 className=\"text-sm font-semibold text-primary\">{input.title}</h2>\n {existing && (\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n {existing.frequency.replace('_', ' ').toLowerCase()}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary\">{input.description}</p>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {existing && (\n <button\n type=\"button\"\n disabled={isSaving}\n onClick={() => resetPreference(input.key)}\n className=\"rounded-md border border-default px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {tr('notifications.reset', 'Reset')}\n </button>\n )}\n <button\n type=\"button\"\n aria-pressed={isEnabled}\n disabled={isSaving}\n onClick={() =>\n togglePreference({\n scope: input.scope,\n channel: input.channel,\n type: input.type,\n topicId: input.topicId,\n })\n }\n className={`inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors ${\n isEnabled\n ? 'border-accent-primary bg-action-primary-bg text-text-inverse hover:opacity-90'\n : 'border-default bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80'\n } disabled:cursor-not-allowed disabled:opacity-50`}\n >\n {isEnabled ? <ToggleRight size={18} /> : <ToggleLeft size={18} />}\n {isSaving\n ? tr('notifications.saving', 'Saving...')\n : isEnabled\n ? tr('notifications.enabled', 'Enabled')\n : tr('notifications.disabled', 'Disabled')}\n </button>\n </div>\n </div>\n <div className=\"mt-3 min-h-5\" aria-live=\"polite\">\n {feedback && (\n <p className={`text-xs ${feedback.type === 'success' ? 'text-success' : 'text-error'}`}>\n {feedback.message}\n </p>\n )}\n </div>\n </div>\n );\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionPreferences',\n \"You don't have permission to manage notification preferences.\"\n )}\n </div>\n );\n }\n\n return (\n <div data-tour=\"notification-preferences-page\" className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <h1 className=\"text-2xl font-bold text-primary\">\n {tr('notifications.preferencesTitle', 'Notification Preferences')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.preferencesSubtitle',\n 'Control global, channel, type, and topic-level notification delivery.'\n )}\n </p>\n </div>\n\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.preferencesPurpose',\n 'Decide how and when we reach you. The Global switch is your master on/off, then you can fine-tune individual channels (email, push, SMS…), notification types and the marketing topics you have subscribed to. Settings cascade — turning a channel off silences it everywhere.'\n )}\n </PagePurpose>\n\n <EmphasisPanel data-tour=\"notification-preferences-global\" className=\"space-y-3 p-5 sm:p-6\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.globalPreferences', 'Global')}\n </h2>\n {renderPreferenceRow({\n key: 'GLOBAL',\n scope: 'GLOBAL',\n title: tr('notifications.allNotifications', 'All notifications'),\n description: tr(\n 'notifications.allNotificationsDescription',\n 'Master preference for notification delivery across all channels and types.'\n ),\n })}\n </EmphasisPanel>\n\n {/* Advanced: per-channel filter rules / quiet hours / custom templates — collapse the long-tail knobs */}\n <OptionalFields\n title={tr('notifications.advancedPreferences', 'Advanced settings')}\n description={tr(\n 'notifications.advancedPreferencesDescription',\n 'Per-channel filter rules, notification-type filters, and quiet-hour overrides.'\n )}\n >\n <section data-tour=\"notification-preferences-channels\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.channelPreferences', 'Channels')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {CHANNEL_OPTIONS.map((channel) =>\n renderPreferenceRow({\n key: `CHANNEL:${channel.value}`,\n scope: 'CHANNEL',\n channel: channel.value,\n title: tr(channel.labelKey, channel.label),\n description: tr(\n 'notifications.channelPreferenceDescription',\n 'Control delivery for this channel.'\n ),\n })\n )}\n </div>\n </section>\n\n <section data-tour=\"notification-preferences-types\" className=\"mt-6 space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.typePreferences', 'Notification Types')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {TYPE_OPTIONS.map((type) =>\n renderPreferenceRow({\n key: `TYPE:${type.value}`,\n scope: 'TYPE',\n type: type.value,\n title: tr(type.labelKey, type.label),\n description: tr(\n 'notifications.typePreferenceDescription',\n 'Control delivery for this notification type.'\n ),\n })\n )}\n </div>\n </section>\n </OptionalFields>\n\n <div className=\"relative max-w-xl\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n aria-label={tr('notifications.searchTopics', 'Search topics...')}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"w-full rounded-lg border border-default bg-surface py-2 pl-9 pr-4 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </div>\n\n <section data-tour=\"notification-preferences-topics\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.topicPreferences', 'Topics')}\n </h2>\n {isLoading ? (\n <div className=\"rounded-lg border border-default bg-surface p-6 text-sm text-text-secondary\">\n {tr('notifications.loadingPreferences', 'Loading preferences...')}\n </div>\n ) : topicsForbidden ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title={tr(\n 'notifications.topicsNoAccessTitle',\n \"You don't have access to notification topics\"\n )}\n description={tr(\n 'notifications.topicsNoAccessDescription',\n \"Your role doesn't include permission to read notification topics. Ask a workspace admin if you need access.\"\n )}\n kind=\"no-access\"\n size=\"panel\"\n />\n ) : filteredTopics.length === 0 ? (\n <IllustratedEmptyState\n illustration={search.trim() ? 'empty-search' : 'empty-data'}\n title={\n search.trim()\n ? tr('notifications.noTopicsFound', 'No topics match your search')\n : tr('notifications.noTopicsAvailableTitle', 'No subscribable topics yet')\n }\n description={\n search.trim()\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.noTopicsAvailableDescription',\n 'When marketing topics are published you can subscribe or unsubscribe from each one here.'\n )\n }\n kind={search.trim() ? 'no-results' : 'first-use'}\n glassIllustration=\"notifications\"\n size=\"panel\"\n />\n ) : (\n filteredTopics.map((topic) =>\n renderPreferenceRow({\n key: `TOPIC:${topic.id}`,\n scope: 'TOPIC',\n topicId: topic.id,\n title: topic.name,\n description: topic.description || topic.slug,\n })\n )\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,IAAMA,IAA0F;CAC9F;EAAE,OAAO;EAAU,UAAU;EAA8B,OAAO;CAAS;CAC3E;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;CAAQ;CACzE;EAAE,OAAO;EAAQ,UAAU;EAA6B,OAAO;CAA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,8CACF;KACA,aAAaA,EACX,2CACA,6GACF;KACA,MAAK;KACL,MAAK;IACN,CAAA,IACCa,EAAe,WAAW,IAC5B,kBAAC6B,GAAD;KACE,cAAclC,EAAO,KAAK,IAAI,iBAAiB;KAC/C,OACEA,EAAO,KAAK,IACRR,EAAG,+BAA+B,6BAA6B,IAC/DA,EAAG,wCAAwC,4BAA4B;KAE7E,aACEQ,EAAO,KAAK,IACRR,EAAG,yCAAyC,4BAA4B,IACxEA,EACE,8CACA,0FACF;KAEN,MAAMQ,EAAO,KAAK,IAAI,eAAe;KACrC,mBAAkB;KAClB,MAAK;IACN,CAAA,IAEDK,EAAe,KAAK,MAClBK,EAAoB;KAClB,KAAK,SAASD,EAAM;KACpB,OAAO;KACP,SAASA,EAAM;KACf,OAAOA,EAAM;KACb,aAAaA,EAAM,eAAeA,EAAM;IAC1C,CAAC,CACH,CAEK;;EACN;;AAET"}
|
|
1
|
+
{"version":3,"file":"NotificationPreferencesPage.js","names":["CHANNEL_OPTIONS","TYPE_OPTIONS","NotificationPreferencesPage","useNotification","jsx","navigationV2","NotificationSettingsV2","ClassicNotificationPreferencesPage","PreferencesLoading","SectionLoaderOr","CompactMarkOr","tr","useTr","permissionsLoading","usePermissions","topicsLoading","topicsForbidden","useNotificationTopics","usePreferenceToggles","search","setSearch","useState","isLoading","preferencesLoading","filteredTopics","useMemo","topics","query","topic","renderPreferenceRow","existing","preferencesByKey","input","isEnabled","isSaving","savingKey","feedback","saveFeedback","BellRing","resetPreference","togglePreference","ToggleRight","ToggleLeft","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","EmphasisPanel","OptionalFields","channel","type","Search","event","IllustratedEmptyState"],"sources":["../../src/pages/NotificationPreferencesPage.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { BellRing, Search, ToggleLeft, ToggleRight } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n EmphasisPanel,\n IllustratedEmptyState,\n OptionalFields,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotificationTopics } from '../hooks';\nimport { usePreferenceToggles } from '../hooks/usePreferenceToggles';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationChannel, NotificationPreferenceScope, NotificationType } from '../types';\nimport { NotificationSettingsV2 } from '../navigation-v2/NotificationSettingsV2';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst CHANNEL_OPTIONS: Array<{ value: NotificationChannel; labelKey: string; label: string }> = [\n { value: 'IN_APP', labelKey: 'notifications.channelInApp', label: 'In-app' },\n { value: 'EMAIL', labelKey: 'notifications.channelEmail', label: 'Email' },\n { value: 'PUSH', labelKey: 'notifications.channelPush', label: 'Push' },\n { value: 'SMS', labelKey: 'notifications.channelSms', label: 'SMS' },\n { value: 'WHATSAPP', labelKey: 'notifications.channelWhatsapp', label: 'WhatsApp' },\n { value: 'SLACK', labelKey: 'notifications.channelSlack', label: 'Slack' },\n];\n\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alerts' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\n\n/**\n * Notification preferences. Under FluidGrids' Navigation v2 (BOFF-11872) it\n * is \"Notification settings\" instead; every other app keeps this page.\n */\nexport function NotificationPreferencesPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationSettingsV2 /> : <ClassicNotificationPreferencesPage />;\n}\n\n/** While the reader's permissions load: today's ring, or the loading system's section loader. */\nfunction PreferencesLoading() {\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\nfunction ClassicNotificationPreferencesPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n topics,\n isLoading: topicsLoading,\n isForbidden: topicsForbidden,\n } = useNotificationTopics({\n type: 'MARKETING',\n isActive: true,\n });\n const {\n preferencesByKey,\n preferencesLoading,\n savingKey,\n saveFeedback,\n togglePreference,\n resetPreference,\n } = usePreferenceToggles();\n const [search, setSearch] = useState('');\n\n const isLoading = topicsLoading || preferencesLoading;\n\n const filteredTopics = useMemo(() => {\n if (!search.trim()) {\n return topics;\n }\n\n const query = search.toLowerCase();\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\n\n const renderPreferenceRow = (input: {\n key: string;\n title: string;\n description: string;\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n }) => {\n const existing = preferencesByKey.get(input.key);\n const isEnabled = existing?.enabled ?? true;\n const isSaving = savingKey === input.key;\n const feedback = saveFeedback?.key === input.key ? saveFeedback : null;\n\n return (\n <div\n key={input.key}\n className=\"rounded-lg border border-border-seam bg-gloss-card p-4 transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)]\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2\">\n <BellRing size={16} className=\"text-accent-primary\" />\n <h2 className=\"text-sm font-semibold text-primary\">{input.title}</h2>\n {existing && (\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n {existing.frequency.replace('_', ' ').toLowerCase()}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary\">{input.description}</p>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {existing && (\n <button\n type=\"button\"\n disabled={isSaving}\n onClick={() => resetPreference(input.key)}\n className=\"rounded-md border border-default px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {tr('notifications.reset', 'Reset')}\n </button>\n )}\n <button\n type=\"button\"\n aria-pressed={isEnabled}\n disabled={isSaving}\n onClick={() =>\n togglePreference({\n scope: input.scope,\n channel: input.channel,\n type: input.type,\n topicId: input.topicId,\n })\n }\n className={`inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors ${\n isEnabled\n ? 'border-accent-primary bg-action-primary-bg text-text-inverse hover:opacity-90'\n : 'border-default bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80'\n } disabled:cursor-not-allowed disabled:opacity-50`}\n >\n {isEnabled ? <ToggleRight size={18} /> : <ToggleLeft size={18} />}\n {isSaving\n ? tr('notifications.saving', 'Saving...')\n : isEnabled\n ? tr('notifications.enabled', 'Enabled')\n : tr('notifications.disabled', 'Disabled')}\n </button>\n </div>\n </div>\n <div className=\"mt-3 min-h-5\" aria-live=\"polite\">\n {feedback && (\n <p className={`text-xs ${feedback.type === 'success' ? 'text-success' : 'text-error'}`}>\n {feedback.message}\n </p>\n )}\n </div>\n </div>\n );\n };\n\n if (permissionsLoading) {\n return <PreferencesLoading />;\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionPreferences',\n \"You don't have permission to manage notification preferences.\"\n )}\n </div>\n );\n }\n\n return (\n <div data-tour=\"notification-preferences-page\" className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <h1 className=\"text-2xl font-bold text-primary\">\n {tr('notifications.preferencesTitle', 'Notification Preferences')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.preferencesSubtitle',\n 'Control global, channel, type, and topic-level notification delivery.'\n )}\n </p>\n </div>\n\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.preferencesPurpose',\n 'Decide how and when we reach you. The Global switch is your master on/off, then you can fine-tune individual channels (email, push, SMS…), notification types and the marketing topics you have subscribed to. Settings cascade — turning a channel off silences it everywhere.'\n )}\n </PagePurpose>\n\n <EmphasisPanel data-tour=\"notification-preferences-global\" className=\"space-y-3 p-5 sm:p-6\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.globalPreferences', 'Global')}\n </h2>\n {renderPreferenceRow({\n key: 'GLOBAL',\n scope: 'GLOBAL',\n title: tr('notifications.allNotifications', 'All notifications'),\n description: tr(\n 'notifications.allNotificationsDescription',\n 'Master preference for notification delivery across all channels and types.'\n ),\n })}\n </EmphasisPanel>\n\n {/* Advanced: per-channel filter rules / quiet hours / custom templates — collapse the long-tail knobs */}\n <OptionalFields\n title={tr('notifications.advancedPreferences', 'Advanced settings')}\n description={tr(\n 'notifications.advancedPreferencesDescription',\n 'Per-channel filter rules, notification-type filters, and quiet-hour overrides.'\n )}\n >\n <section data-tour=\"notification-preferences-channels\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.channelPreferences', 'Channels')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {CHANNEL_OPTIONS.map((channel) =>\n renderPreferenceRow({\n key: `CHANNEL:${channel.value}`,\n scope: 'CHANNEL',\n channel: channel.value,\n title: tr(channel.labelKey, channel.label),\n description: tr(\n 'notifications.channelPreferenceDescription',\n 'Control delivery for this channel.'\n ),\n })\n )}\n </div>\n </section>\n\n <section data-tour=\"notification-preferences-types\" className=\"mt-6 space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.typePreferences', 'Notification Types')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {TYPE_OPTIONS.map((type) =>\n renderPreferenceRow({\n key: `TYPE:${type.value}`,\n scope: 'TYPE',\n type: type.value,\n title: tr(type.labelKey, type.label),\n description: tr(\n 'notifications.typePreferenceDescription',\n 'Control delivery for this notification type.'\n ),\n })\n )}\n </div>\n </section>\n </OptionalFields>\n\n <div className=\"relative max-w-xl\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n aria-label={tr('notifications.searchTopics', 'Search topics...')}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"w-full rounded-lg border border-default bg-surface py-2 pl-9 pr-4 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </div>\n\n <section data-tour=\"notification-preferences-topics\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.topicPreferences', 'Topics')}\n </h2>\n {isLoading ? (\n <div className=\"rounded-lg border border-default bg-surface p-6 text-sm text-text-secondary\">\n {tr('notifications.loadingPreferences', 'Loading preferences...')}\n </div>\n ) : topicsForbidden ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title={tr(\n 'notifications.topicsNoAccessTitle',\n \"You don't have access to notification topics\"\n )}\n description={tr(\n 'notifications.topicsNoAccessDescription',\n \"Your role doesn't include permission to read notification topics. Ask a workspace admin if you need access.\"\n )}\n kind=\"no-access\"\n size=\"panel\"\n />\n ) : filteredTopics.length === 0 ? (\n <IllustratedEmptyState\n illustration={search.trim() ? 'empty-search' : 'empty-data'}\n title={\n search.trim()\n ? tr('notifications.noTopicsFound', 'No topics match your search')\n : tr('notifications.noTopicsAvailableTitle', 'No subscribable topics yet')\n }\n description={\n search.trim()\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.noTopicsAvailableDescription',\n 'When marketing topics are published you can subscribe or unsubscribe from each one here.'\n )\n }\n kind={search.trim() ? 'no-results' : 'first-use'}\n glassIllustration=\"notifications\"\n size=\"panel\"\n />\n ) : (\n filteredTopics.map((topic) =>\n renderPreferenceRow({\n key: `TOPIC:${topic.id}`,\n scope: 'TOPIC',\n topicId: topic.id,\n title: topic.name,\n description: topic.description || topic.slug,\n })\n )\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAMA,IAA0F;CAC9F;EAAE,OAAO;EAAU,UAAU;EAA8B,OAAO;CAAS;CAC3E;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;CAAQ;CACzE;EAAE,OAAO;EAAQ,UAAU;EAA6B,OAAO;CAAO;CACtE;EAAE,OAAO;EAAO,UAAU;EAA4B,OAAO;CAAM;CACnE;EAAE,OAAO;EAAY,UAAU;EAAiC,OAAO;CAAW;CAClF;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;CAAQ;AAC3E,GAEMC,IAAoF;CACxF;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;CAAgB;CAC9F;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;CAAS;CACzE;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;CAAS;CACvE;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;CAAY;AACpF;AAMA,SAAgBC,IAA8B;CAC5C,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA6BC,GAA9B,CAAyB,CAAyC;AAC1F;AAGA,SAASC,IAAqB;CAC5B,OACE,kBAACC,GAAD;EACE,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA;AAEL;AAEA,SAASH,IAAqC;CAC5C,IAAMI,IAAKC,EAAM,GACX,EAAE,kBAAe,W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