@burdenoff/microfe-notification 2026.1109.1 → 2026.1114.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NotificationRoutes.js +108 -36
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/components/ConfirmDeleteDialog.d.ts +17 -0
- package/dist/components/ConfirmDeleteDialog.js +22 -0
- package/dist/components/ConfirmDeleteDialog.js.map +1 -0
- package/dist/components/NotificationCard.d.ts +10 -1
- package/dist/components/NotificationCard.js +103 -72
- package/dist/components/NotificationCard.js.map +1 -1
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/usePreferenceToggles.d.ts +27 -0
- package/dist/hooks/usePreferenceToggles.js +84 -0
- package/dist/hooks/usePreferenceToggles.js.map +1 -0
- package/dist/navigation-v2/AdminPageV2.d.ts +14 -0
- package/dist/navigation-v2/AdminPageV2.js +51 -0
- package/dist/navigation-v2/AdminPageV2.js.map +1 -0
- package/dist/navigation-v2/AdminToolsMenu.d.ts +6 -0
- package/dist/navigation-v2/AdminToolsMenu.js +32 -0
- package/dist/navigation-v2/AdminToolsMenu.js.map +1 -0
- package/dist/navigation-v2/BackToNotifications.d.ts +2 -0
- package/dist/navigation-v2/BackToNotifications.js +20 -0
- package/dist/navigation-v2/BackToNotifications.js.map +1 -0
- package/dist/navigation-v2/FilterControls.d.ts +25 -0
- package/dist/navigation-v2/FilterControls.js +64 -0
- package/dist/navigation-v2/FilterControls.js.map +1 -0
- package/dist/navigation-v2/NotificationArchivedV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationArchivedV2.js +174 -0
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -0
- package/dist/navigation-v2/NotificationInboxV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationInboxV2.js +309 -0
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -0
- package/dist/navigation-v2/NotificationSettingsV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationSettingsV2.js +203 -0
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -0
- package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -0
- package/dist/navigation-v2/NotificationsV2Landing.js +37 -0
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -0
- package/dist/navigation-v2/__tests__/uiMocks.d.ts +71 -0
- package/dist/navigation-v2/inboxFilters.d.ts +8 -0
- package/dist/navigation-v2/inboxFilters.js +10 -0
- package/dist/navigation-v2/inboxFilters.js.map +1 -0
- package/dist/navigation-v2/paths.d.ts +24 -0
- package/dist/navigation-v2/paths.js +31 -0
- package/dist/navigation-v2/paths.js.map +1 -0
- package/dist/navigation-v2/settingsOptions.d.ts +12 -0
- package/dist/navigation-v2/settingsOptions.js +58 -0
- package/dist/navigation-v2/settingsOptions.js.map +1 -0
- package/dist/navigation-v2/useAdminTools.d.ts +22 -0
- package/dist/navigation-v2/useAdminTools.js +76 -0
- package/dist/navigation-v2/useAdminTools.js.map +1 -0
- package/dist/pages/CreateNotificationPage.js +577 -558
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.d.ts +3 -1
- package/dist/pages/NotificationCenterPage.js +79 -74
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.d.ts +5 -1
- package/dist/pages/NotificationHistoryPage.js +52 -47
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.d.ts +4 -0
- package/dist/pages/NotificationPreferencesPage.js +97 -158
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +184 -166
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +123 -108
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +339 -308
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/providers/NotificationProvider.js +6 -5
- package/dist/providers/NotificationProvider.js.map +1 -1
- package/dist/types/index.d.ts +8 -0
- package/package.json +2 -2
|
@@ -2,354 +2,372 @@ import { useNotificationTemplates as e } from "../hooks/useNotificationTemplates
|
|
|
2
2
|
import { NOTIFICATION_PERMISSIONS as t } from "../constants/permissions.js";
|
|
3
3
|
import { useTr as n } from "../shared/hooks/useTr.js";
|
|
4
4
|
import { nativeConfirm as r, nativeImpact as i, nativeNotify as a } from "../utils/nativeBridge.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import { ConfirmDeleteDialog as o } from "../components/ConfirmDeleteDialog.js";
|
|
6
|
+
import { useNavigationV2 as s, useNotificationPaths as c } from "../navigation-v2/paths.js";
|
|
7
|
+
import { useMemo as ee, useState as l } from "react";
|
|
8
|
+
import { usePermissions as te } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
|
+
import { AlertCircle as u, FileText as d, Loader2 as f, Plus as p, RefreshCw as ne, Search as re, Trash2 as m } from "lucide-react";
|
|
10
|
+
import { useNavigate as ie } from "react-router";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { Button as _, EmphasisPanel as v, GlassCard as y, IllustratedEmptyState as b, NextSteps as ae, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
14
|
// src/pages/NotificationTemplatesPage.tsx
|
|
13
|
-
var
|
|
15
|
+
var S = {
|
|
14
16
|
TRANSACTIONAL: "text-status-info-text bg-status-info-bg-subtle border-status-info-bg-subtle",
|
|
15
17
|
MARKETING: "text-accent-purple bg-accent-purple-subtle border-accent-purple-subtle",
|
|
16
18
|
SYSTEM: "text-status-warning-text bg-status-warning-bg-subtle border-status-warning-bg-subtle",
|
|
17
19
|
ALERT: "text-status-error-text bg-status-error-bg-subtle border-status-error-bg-subtle"
|
|
18
|
-
},
|
|
20
|
+
}, se = {
|
|
19
21
|
TRANSACTIONAL: "Transactional",
|
|
20
22
|
MARKETING: "Marketing",
|
|
21
23
|
SYSTEM: "System",
|
|
22
24
|
ALERT: "Alert"
|
|
23
25
|
};
|
|
24
|
-
function
|
|
26
|
+
function C(e, t) {
|
|
25
27
|
return new Date(e).toLocaleDateString(t || "en-US", {
|
|
26
28
|
month: "short",
|
|
27
29
|
day: "numeric",
|
|
28
30
|
year: "numeric"
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
let
|
|
33
|
+
function w() {
|
|
34
|
+
let w = ie(), T = n(), E = c(), D = s(), [O, k] = l(null), A = (e, t) => D ? new Promise((n) => k({
|
|
35
|
+
title: e,
|
|
36
|
+
message: t,
|
|
37
|
+
resolve: n
|
|
38
|
+
})) : Promise.resolve(window.confirm(t)), { locale: j } = x(), { hasPermission: M, isLoading: ce } = te(), { templates: N, isLoading: P, isDeleting: F, error: I, total: L, hasMore: R, filter: z, refetch: B, loadMore: V, deleteTemplate: H, updateFilter: U } = e(), [W, G] = l(null), [K, q] = l(null), [J, Y] = l(/* @__PURE__ */ new Set()), X = ee(() => N.filter((e) => J.has(e.id)), [J, N]), Z = N.length > 0 && N.every((e) => J.has(e.id)), le = N.some((e) => J.has(e.id)) && !Z, Q = M(t.TEMPLATE_CREATE), $ = M(t.TEMPLATE_DELETE), ue = async (e, t) => {
|
|
33
39
|
e.stopPropagation(), i("medium");
|
|
34
|
-
let n =
|
|
35
|
-
title:
|
|
40
|
+
let n = T("notifTemplates.confirmDelete", `Delete template "${t.name}"? This cannot be undone.`), o = await r({
|
|
41
|
+
title: T("notifTemplates.deleteTitle", "Delete template"),
|
|
36
42
|
message: n,
|
|
37
|
-
okButtonTitle:
|
|
43
|
+
okButtonTitle: T("notifTemplates.delete", "Delete")
|
|
38
44
|
});
|
|
39
|
-
if (o === null ?
|
|
40
|
-
|
|
45
|
+
if (o === null ? await A(T("notifTemplates.deleteTitle", "Delete template"), n) : o) {
|
|
46
|
+
G(t.id), q(null);
|
|
41
47
|
try {
|
|
42
|
-
await
|
|
48
|
+
await H(t.id), a("success");
|
|
43
49
|
} catch (e) {
|
|
44
|
-
a("error"),
|
|
50
|
+
a("error"), q(e instanceof Error ? e.message : T("notifTemplates.deleteFailed", "Failed to delete template"));
|
|
45
51
|
} finally {
|
|
46
|
-
|
|
52
|
+
G(null);
|
|
47
53
|
}
|
|
48
54
|
}
|
|
49
|
-
},
|
|
50
|
-
if (
|
|
55
|
+
}, de = async () => {
|
|
56
|
+
if (X.length === 0) return;
|
|
51
57
|
i("medium");
|
|
52
|
-
let e =
|
|
53
|
-
title:
|
|
58
|
+
let e = T("notifTemplates.confirmBulkDelete", `Delete ${X.length} selected template${X.length === 1 ? "" : "s"}? This cannot be undone.`), t = await r({
|
|
59
|
+
title: T("notifTemplates.bulkDeleteTitle", "Delete templates"),
|
|
54
60
|
message: e,
|
|
55
|
-
okButtonTitle:
|
|
61
|
+
okButtonTitle: T("notifTemplates.delete", "Delete")
|
|
56
62
|
});
|
|
57
|
-
if (!(t === null ?
|
|
58
|
-
|
|
59
|
-
let n = (await Promise.allSettled(
|
|
60
|
-
a(n ? "error" : "success"),
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
+
if (!(t === null ? await A(T("notifTemplates.bulkDeleteTitle", "Delete templates"), e) : t)) return;
|
|
64
|
+
q(null);
|
|
65
|
+
let n = (await Promise.allSettled(X.map((e) => H(e.id)))).some((e) => e.status === "rejected");
|
|
66
|
+
a(n ? "error" : "success"), Y(/* @__PURE__ */ new Set());
|
|
67
|
+
}, fe = (e, t) => {
|
|
68
|
+
Y((n) => {
|
|
63
69
|
let r = new Set(n);
|
|
64
70
|
return t ? r.add(e) : r.delete(e), r;
|
|
65
71
|
});
|
|
66
|
-
},
|
|
67
|
-
|
|
72
|
+
}, pe = (e) => {
|
|
73
|
+
Y((t) => {
|
|
68
74
|
let n = new Set(t);
|
|
69
|
-
return
|
|
75
|
+
return N.forEach((t) => {
|
|
70
76
|
e ? n.add(t.id) : n.delete(t.id);
|
|
71
77
|
}), n;
|
|
72
78
|
});
|
|
73
79
|
};
|
|
74
|
-
return
|
|
80
|
+
return ce ? /* @__PURE__ */ h("div", {
|
|
75
81
|
className: "flex h-64 items-center justify-center",
|
|
76
|
-
children: /* @__PURE__ */
|
|
77
|
-
}) :
|
|
82
|
+
children: /* @__PURE__ */ h("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
83
|
+
}) : M(t.TEMPLATE_LIST) || Q || $ || M(t.TEMPLATE_UPDATE) ? P && N.length === 0 ? /* @__PURE__ */ g("div", {
|
|
78
84
|
className: "flex flex-col items-center justify-center h-64 gap-3",
|
|
79
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ h(f, {
|
|
80
86
|
size: 28,
|
|
81
87
|
className: "animate-spin text-accent-primary"
|
|
82
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ h("p", {
|
|
83
89
|
className: "text-sm text-secondary",
|
|
84
|
-
children:
|
|
90
|
+
children: T("notifTemplates.loading", "Loading templates...")
|
|
85
91
|
})]
|
|
86
|
-
}) :
|
|
92
|
+
}) : I && N.length === 0 ? /* @__PURE__ */ g("div", {
|
|
87
93
|
className: "flex flex-col items-center justify-center h-64 gap-4",
|
|
88
94
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ h(u, {
|
|
90
96
|
size: 28,
|
|
91
97
|
className: "text-error"
|
|
92
98
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ h("p", {
|
|
94
100
|
className: "text-sm text-error",
|
|
95
|
-
children:
|
|
101
|
+
children: I
|
|
96
102
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
onClick:
|
|
103
|
+
/* @__PURE__ */ g("button", {
|
|
104
|
+
onClick: B,
|
|
99
105
|
className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-accent-primary hover:bg-accent-primary/90 rounded-lg transition-all duration-150",
|
|
100
|
-
children: [/* @__PURE__ */
|
|
106
|
+
children: [/* @__PURE__ */ h(ne, { size: 14 }), T("notifTemplates.retry", "Retry")]
|
|
101
107
|
})
|
|
102
108
|
]
|
|
103
|
-
}) : /* @__PURE__ */
|
|
109
|
+
}) : /* @__PURE__ */ g("div", {
|
|
104
110
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200",
|
|
105
111
|
children: [
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
icon: /* @__PURE__ */
|
|
108
|
-
children:
|
|
112
|
+
/* @__PURE__ */ h(oe, {
|
|
113
|
+
icon: /* @__PURE__ */ h(d, { size: 16 }),
|
|
114
|
+
children: T("notifTemplates.purpose", "Reusable, versioned message blueprints — subject lines, bodies and channel layouts with {{variables}} you fill in at send time. Build a template once (e.g. a welcome email or a payment receipt) and reuse it from the Send page so every notification stays on-brand and consistent.")
|
|
109
115
|
}),
|
|
110
|
-
/* @__PURE__ */ v
|
|
116
|
+
/* @__PURE__ */ g(v, {
|
|
111
117
|
className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
113
119
|
className: "text-xl sm:text-2xl font-bold text-primary",
|
|
114
|
-
children:
|
|
115
|
-
}), /* @__PURE__ */
|
|
120
|
+
children: T("notifTemplates.title", "Notification Templates")
|
|
121
|
+
}), /* @__PURE__ */ g("p", {
|
|
116
122
|
className: "text-sm text-secondary mt-1",
|
|
117
123
|
children: [
|
|
118
|
-
|
|
124
|
+
L,
|
|
119
125
|
" ",
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
T("notifTemplates.templateCount", "template"),
|
|
127
|
+
L === 1 ? "" : "s",
|
|
122
128
|
" ",
|
|
123
|
-
|
|
129
|
+
T("notifTemplates.total", "total")
|
|
124
130
|
]
|
|
125
|
-
})] }), Q && /* @__PURE__ */
|
|
126
|
-
onClick: () =>
|
|
131
|
+
})] }), Q && /* @__PURE__ */ g(_, {
|
|
132
|
+
onClick: () => w(E.newTemplate),
|
|
127
133
|
className: "gap-2",
|
|
128
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ h(p, { size: 16 }), T("notifTemplates.createTemplate", "Create Template")]
|
|
129
135
|
})]
|
|
130
136
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ h(ae, {
|
|
132
138
|
storageKey: "notification-templates",
|
|
133
139
|
steps: [
|
|
134
140
|
...Q ? [{
|
|
135
141
|
id: "create-template",
|
|
136
|
-
label:
|
|
137
|
-
description:
|
|
138
|
-
onClick: () =>
|
|
142
|
+
label: T("notifTemplates.nextCreateLabel", "Create your first template"),
|
|
143
|
+
description: T("notifTemplates.nextCreateDesc", "Build a reusable message blueprint with {{variables}} you fill in at send time."),
|
|
144
|
+
onClick: () => w(E.newTemplate)
|
|
139
145
|
}] : [],
|
|
140
146
|
{
|
|
141
147
|
id: "filter-type",
|
|
142
|
-
label:
|
|
143
|
-
description:
|
|
144
|
-
onClick: () =>
|
|
148
|
+
label: T("notifTemplates.nextFilterLabel", "Filter by type"),
|
|
149
|
+
description: T("notifTemplates.nextFilterDesc", "Narrow to Transactional, Marketing, System or Alert templates to find one fast."),
|
|
150
|
+
onClick: () => U({ type: "TRANSACTIONAL" })
|
|
145
151
|
},
|
|
146
152
|
{
|
|
147
153
|
id: "use-on-send",
|
|
148
|
-
label:
|
|
149
|
-
description:
|
|
150
|
-
href:
|
|
154
|
+
label: T("notifTemplates.nextUseLabel", "Send with a template"),
|
|
155
|
+
description: T("notifTemplates.nextUseDesc", "Pick any saved template from the Send page so every notification stays on-brand."),
|
|
156
|
+
href: E.send
|
|
151
157
|
}
|
|
152
158
|
]
|
|
153
159
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ g("div", {
|
|
155
161
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
156
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ g("div", {
|
|
157
163
|
className: "relative flex-1",
|
|
158
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ h(re, {
|
|
159
165
|
size: 16,
|
|
160
166
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
|
|
161
|
-
}), /* @__PURE__ */
|
|
167
|
+
}), /* @__PURE__ */ h("input", {
|
|
162
168
|
type: "text",
|
|
163
|
-
value:
|
|
164
|
-
onChange: (e) =>
|
|
165
|
-
placeholder:
|
|
169
|
+
value: z.search || "",
|
|
170
|
+
onChange: (e) => U({ search: e.target.value }),
|
|
171
|
+
placeholder: T("notifTemplates.searchPlaceholder", "Search templates..."),
|
|
166
172
|
className: "w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150"
|
|
167
173
|
})]
|
|
168
|
-
}), /* @__PURE__ */
|
|
169
|
-
value:
|
|
170
|
-
onChange: (e) =>
|
|
174
|
+
}), /* @__PURE__ */ g("select", {
|
|
175
|
+
value: z.type || "",
|
|
176
|
+
onChange: (e) => U({ type: e.target.value || void 0 }),
|
|
171
177
|
className: "px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
172
178
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ h("option", {
|
|
174
180
|
value: "",
|
|
175
|
-
children:
|
|
181
|
+
children: T("notifTemplates.allTypes", "All Types")
|
|
176
182
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ h("option", {
|
|
178
184
|
value: "TRANSACTIONAL",
|
|
179
|
-
children:
|
|
185
|
+
children: T("notifTemplates.typeTransactional", "Transactional")
|
|
180
186
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ h("option", {
|
|
182
188
|
value: "MARKETING",
|
|
183
|
-
children:
|
|
189
|
+
children: T("notifTemplates.typeMarketing", "Marketing")
|
|
184
190
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ h("option", {
|
|
186
192
|
value: "SYSTEM",
|
|
187
|
-
children:
|
|
193
|
+
children: T("notifTemplates.typeSystem", "System")
|
|
188
194
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ h("option", {
|
|
190
196
|
value: "ALERT",
|
|
191
|
-
children:
|
|
197
|
+
children: T("notifTemplates.typeAlert", "Alert")
|
|
192
198
|
})
|
|
193
199
|
]
|
|
194
200
|
})]
|
|
195
201
|
}),
|
|
196
|
-
|
|
202
|
+
N.length > 0 && /* @__PURE__ */ g(y, {
|
|
197
203
|
treatment: "plain",
|
|
198
204
|
className: "flex flex-col gap-3 border-border-seam p-4 sm:flex-row sm:items-center sm:justify-between",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ g("label", {
|
|
200
206
|
className: "flex items-center gap-2 text-sm text-primary",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ h("input", {
|
|
202
208
|
type: "checkbox",
|
|
203
|
-
checked:
|
|
209
|
+
checked: Z,
|
|
204
210
|
ref: (e) => {
|
|
205
|
-
e && (e.indeterminate =
|
|
211
|
+
e && (e.indeterminate = le && !Z);
|
|
206
212
|
},
|
|
207
|
-
onChange: (e) =>
|
|
208
|
-
"aria-label":
|
|
213
|
+
onChange: (e) => pe(e.target.checked),
|
|
214
|
+
"aria-label": T("notifTemplates.selectAllVisibleAria", "Select all notification templates"),
|
|
209
215
|
className: "h-4 w-4 rounded border-default text-accent-primary"
|
|
210
|
-
}), /* @__PURE__ */
|
|
211
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ h("span", { children: T("notifTemplates.selectAllVisible", "Select all visible") })]
|
|
217
|
+
}), /* @__PURE__ */ g("div", {
|
|
212
218
|
className: "flex items-center gap-2",
|
|
213
219
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ g("span", {
|
|
215
221
|
className: "text-sm text-secondary",
|
|
216
222
|
children: [
|
|
217
|
-
|
|
223
|
+
J.size,
|
|
218
224
|
" ",
|
|
219
|
-
|
|
225
|
+
T("notifTemplates.selected", "selected")
|
|
220
226
|
]
|
|
221
227
|
}),
|
|
222
|
-
|
|
223
|
-
onClick: () =>
|
|
228
|
+
J.size > 0 && /* @__PURE__ */ h("button", {
|
|
229
|
+
onClick: () => Y(/* @__PURE__ */ new Set()),
|
|
224
230
|
className: "text-sm text-secondary hover:text-primary",
|
|
225
|
-
children:
|
|
231
|
+
children: T("notifTemplates.clearSelection", "Clear selection")
|
|
226
232
|
}),
|
|
227
|
-
$ && /* @__PURE__ */
|
|
228
|
-
onClick:
|
|
229
|
-
disabled:
|
|
233
|
+
$ && /* @__PURE__ */ g("button", {
|
|
234
|
+
onClick: de,
|
|
235
|
+
disabled: X.length === 0 || F,
|
|
230
236
|
className: "flex items-center gap-2 px-3 py-2 text-sm font-medium text-error border border-error/30 hover:bg-error/10 rounded-lg transition-all duration-150 disabled:opacity-50",
|
|
231
237
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
|
|
234
|
-
|
|
238
|
+
/* @__PURE__ */ h(m, { size: 14 }),
|
|
239
|
+
T("notifTemplates.deleteSelected", "Delete Selected"),
|
|
240
|
+
X.length > 0 ? ` (${X.length})` : ""
|
|
235
241
|
]
|
|
236
242
|
})
|
|
237
243
|
]
|
|
238
244
|
})]
|
|
239
245
|
}),
|
|
240
|
-
|
|
246
|
+
K && /* @__PURE__ */ g("div", {
|
|
241
247
|
className: "flex items-center gap-3 p-3 bg-error/10 border border-error/30 rounded-lg",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ h(u, {
|
|
243
249
|
size: 16,
|
|
244
250
|
className: "text-error shrink-0"
|
|
245
|
-
}), /* @__PURE__ */
|
|
251
|
+
}), /* @__PURE__ */ h("p", {
|
|
246
252
|
className: "text-sm text-error",
|
|
247
|
-
children:
|
|
253
|
+
children: K
|
|
248
254
|
})]
|
|
249
255
|
}),
|
|
250
|
-
|
|
251
|
-
illustration:
|
|
252
|
-
title:
|
|
253
|
-
description:
|
|
254
|
-
action: !
|
|
255
|
-
onClick: () =>
|
|
256
|
+
N.length === 0 && !P && /* @__PURE__ */ h(b, {
|
|
257
|
+
illustration: z.search || z.type ? "empty-search" : "empty-files",
|
|
258
|
+
title: z.search || z.type ? T("notifTemplates.noMatchingTemplates", "No templates match your filters") : T("notifTemplates.noTemplatesYet", "No templates yet. Create your first one!"),
|
|
259
|
+
description: z.search || z.type ? T("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : T("notifTemplates.noTemplatesDescription", "Reusable templates let you send consistent notifications fast."),
|
|
260
|
+
action: !z.search && !z.type && Q ? /* @__PURE__ */ g(_, {
|
|
261
|
+
onClick: () => w(E.newTemplate),
|
|
256
262
|
className: "gap-2",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ h(p, { size: 16 }), T("notifTemplates.createTemplate", "Create Template")]
|
|
258
264
|
}) : void 0
|
|
259
265
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ h("div", {
|
|
261
267
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
262
|
-
children:
|
|
263
|
-
onClick: () =>
|
|
264
|
-
className: `group relative p-4 bg-gloss-card border rounded-lg cursor-pointer transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)] hover:border-accent-primary/30 ${
|
|
268
|
+
children: N.map((e) => /* @__PURE__ */ g("div", {
|
|
269
|
+
onClick: () => w(E.template(e.slug)),
|
|
270
|
+
className: `group relative p-4 bg-gloss-card border rounded-lg cursor-pointer transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)] hover:border-accent-primary/30 ${J.has(e.id) ? "border-accent-primary/50 ring-1 ring-accent-primary/20" : "border-border-seam"}`,
|
|
265
271
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ g("div", {
|
|
267
273
|
className: "flex items-start justify-between mb-3",
|
|
268
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ g("div", {
|
|
269
275
|
className: "flex items-center gap-2",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ h("input", {
|
|
271
277
|
type: "checkbox",
|
|
272
|
-
checked:
|
|
278
|
+
checked: J.has(e.id),
|
|
273
279
|
onChange: (t) => {
|
|
274
|
-
t.stopPropagation(),
|
|
280
|
+
t.stopPropagation(), fe(e.id, t.target.checked);
|
|
275
281
|
},
|
|
276
282
|
onClick: (e) => e.stopPropagation(),
|
|
277
|
-
"aria-label":
|
|
283
|
+
"aria-label": T("notifTemplates.selectTemplateAria", "Select template {{name}}").replace("{{name}}", e.name),
|
|
278
284
|
className: "h-4 w-4 rounded border-default text-accent-primary"
|
|
279
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ h(d, {
|
|
280
286
|
size: 20,
|
|
281
287
|
className: "text-accent-primary"
|
|
282
288
|
})]
|
|
283
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ g("div", {
|
|
284
290
|
className: "flex items-center gap-2",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
286
|
-
className: `px-2 py-0.5 text-[10px] font-semibold rounded-full border ${
|
|
287
|
-
children:
|
|
288
|
-
}), $ && /* @__PURE__ */
|
|
289
|
-
onClick: (t) =>
|
|
290
|
-
disabled:
|
|
291
|
+
children: [/* @__PURE__ */ h("span", {
|
|
292
|
+
className: `px-2 py-0.5 text-[10px] font-semibold rounded-full border ${S[e.type] || "text-tertiary bg-bg-sunken border-default"}`,
|
|
293
|
+
children: T(`notifTemplates.type.${e.type}`, se[e.type] || e.type)
|
|
294
|
+
}), $ && /* @__PURE__ */ h("button", {
|
|
295
|
+
onClick: (t) => ue(t, e),
|
|
296
|
+
disabled: F && W === e.id,
|
|
291
297
|
className: "opacity-0 group-hover:opacity-100 p-1 text-tertiary hover:text-error rounded transition-all duration-150",
|
|
292
|
-
title:
|
|
293
|
-
children:
|
|
298
|
+
title: T("notifTemplates.deleteTemplate", "Delete template"),
|
|
299
|
+
children: F && W === e.id ? /* @__PURE__ */ h(f, {
|
|
294
300
|
size: 14,
|
|
295
301
|
className: "animate-spin"
|
|
296
|
-
}) : /* @__PURE__ */
|
|
302
|
+
}) : /* @__PURE__ */ h(m, { size: 14 })
|
|
297
303
|
})]
|
|
298
304
|
})]
|
|
299
305
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ h("h3", {
|
|
301
307
|
className: "text-sm font-semibold text-primary mb-1 truncate",
|
|
302
308
|
children: e.name
|
|
303
309
|
}),
|
|
304
|
-
e.description && /* @__PURE__ */
|
|
310
|
+
e.description && /* @__PURE__ */ h("p", {
|
|
305
311
|
className: "text-xs text-secondary mb-2 line-clamp-2",
|
|
306
312
|
children: e.description
|
|
307
313
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ g("div", {
|
|
309
315
|
className: "flex items-center gap-2 text-[11px] text-tertiary mt-auto pt-2 border-t border-default/50",
|
|
310
316
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ h("code", {
|
|
312
318
|
className: "px-1.5 py-0.5 bg-bg-sunken rounded text-[10px]",
|
|
313
319
|
children: e.slug
|
|
314
320
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ h("span", { children: "•" }),
|
|
322
|
+
/* @__PURE__ */ h("span", { children: e.locale || "en" }),
|
|
323
|
+
/* @__PURE__ */ h("span", { children: "•" }),
|
|
324
|
+
/* @__PURE__ */ h("span", {
|
|
319
325
|
className: e.enabled ? "text-success" : "text-tertiary",
|
|
320
|
-
children: e.enabled ?
|
|
326
|
+
children: e.enabled ? T("notifTemplates.enabled", "Enabled") : T("notifTemplates.disabled", "Disabled")
|
|
321
327
|
})
|
|
322
328
|
]
|
|
323
329
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ g("p", {
|
|
325
331
|
className: "text-[10px] text-tertiary mt-1.5",
|
|
326
332
|
children: [
|
|
327
|
-
|
|
333
|
+
T("notifTemplates.updated", "Updated"),
|
|
328
334
|
" ",
|
|
329
|
-
|
|
335
|
+
C(e.updatedAt, j)
|
|
330
336
|
]
|
|
331
337
|
})
|
|
332
338
|
]
|
|
333
339
|
}, e.id))
|
|
334
340
|
}),
|
|
335
|
-
|
|
341
|
+
R && /* @__PURE__ */ h("div", {
|
|
336
342
|
className: "flex justify-center pt-2",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
-
onClick:
|
|
339
|
-
disabled:
|
|
343
|
+
children: /* @__PURE__ */ g("button", {
|
|
344
|
+
onClick: V,
|
|
345
|
+
disabled: P,
|
|
340
346
|
className: "flex items-center gap-2 px-4 py-2 text-sm text-secondary hover:text-primary border border-default rounded-lg transition-all duration-150 hover:shadow-sm",
|
|
341
|
-
children: [
|
|
347
|
+
children: [P ? /* @__PURE__ */ h(f, {
|
|
342
348
|
size: 14,
|
|
343
349
|
className: "animate-spin"
|
|
344
|
-
}) : null,
|
|
350
|
+
}) : null, T("notifTemplates.loadMore", "Load More")]
|
|
345
351
|
})
|
|
352
|
+
}),
|
|
353
|
+
D && /* @__PURE__ */ h(o, {
|
|
354
|
+
open: O !== null,
|
|
355
|
+
title: O?.title ?? "",
|
|
356
|
+
description: O?.message ?? "",
|
|
357
|
+
confirmLabel: T("notifTemplates.delete", "Delete"),
|
|
358
|
+
onCancel: () => {
|
|
359
|
+
O?.resolve(!1), k(null);
|
|
360
|
+
},
|
|
361
|
+
onConfirm: () => {
|
|
362
|
+
O?.resolve(!0), k(null);
|
|
363
|
+
}
|
|
346
364
|
})
|
|
347
365
|
]
|
|
348
|
-
}) : /* @__PURE__ */
|
|
366
|
+
}) : /* @__PURE__ */ h("div", {
|
|
349
367
|
className: "p-8 text-center text-text-secondary",
|
|
350
|
-
children:
|
|
368
|
+
children: T("notifTemplates.noPermissionView", "You don't have permission to view notification templates.")
|
|
351
369
|
});
|
|
352
370
|
}
|
|
353
|
-
export {
|
|
371
|
+
export { w as NotificationTemplatesPage };
|
|
354
372
|
|
|
355
373
|
//# sourceMappingURL=NotificationTemplatesPage.js.map
|