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