@burdenoff/microfe-notification 2026.1117.2 → 2026.1119.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/components/NotificationListFooter.d.ts +18 -0
- package/dist/components/NotificationListFooter.js +43 -0
- package/dist/components/NotificationListFooter.js.map +1 -0
- package/dist/hooks/notificationPaging.d.ts +51 -0
- package/dist/hooks/notificationPaging.js +43 -0
- package/dist/hooks/notificationPaging.js.map +1 -0
- package/dist/hooks/useNotifications.d.ts +2 -0
- package/dist/hooks/useNotifications.js +177 -129
- package/dist/hooks/useNotifications.js.map +1 -1
- package/dist/navigation-v2/NotificationArchivedV2.js +98 -91
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
- package/dist/navigation-v2/NotificationInboxV2.js +78 -71
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
- package/dist/pages/CreateNotificationPage.js +108 -108
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.js +105 -98
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.js +122 -122
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.js +77 -70
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +140 -140
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +74 -74
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +361 -361
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/translations/en.d.ts +3 -0
- package/package.json +2 -2
|
@@ -14,7 +14,7 @@ import { useGlobalUi as ce, usePermissions as le } from "@burdenoff/fe-libs/shar
|
|
|
14
14
|
import { AlertCircle as ue, ArrowLeft as de, Bell as fe, CheckCircle2 as s, Eye as pe, EyeOff as me, FileText as he, ImagePlus as ge, Link2 as _e, Loader2 as c, Mail as ve, MessageSquare as l, Send as ye, Smartphone as u, User as d, Users as be, X as xe } from "lucide-react";
|
|
15
15
|
import { useNavigate as Se } from "react-router";
|
|
16
16
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
17
|
-
import { CTAOverflowMenu as Ce, GlassCard as we, IllustratedEmptyState as Te, NextSteps as Ee, OptionalFields as De, PagePurpose as Oe } from "@burdenoff/fe-libs/ui";
|
|
17
|
+
import { CTAOverflowMenu as Ce, GlassCard as we, IllustratedEmptyState as Te, NextSteps as Ee, OptionalFields as De, PagePurpose as Oe, ThemedSelect as h } from "@burdenoff/fe-libs/ui";
|
|
18
18
|
// src/pages/CreateNotificationPage.tsx
|
|
19
19
|
var ke = [
|
|
20
20
|
{
|
|
@@ -176,24 +176,24 @@ var ke = [
|
|
|
176
176
|
label: "Inactive"
|
|
177
177
|
}
|
|
178
178
|
];
|
|
179
|
-
function
|
|
180
|
-
let ve = Se(), l = ie(), u = se(),
|
|
179
|
+
function g() {
|
|
180
|
+
let ve = Se(), l = ie(), u = se(), g = oe(), { hasPermission: Pe, isLoading: Fe, refreshPermissions: Ie } = le(), { showToast: Le } = ce(), { sendNotification: Re, sendBatch: ze, sendWithTemplate: Be, isSending: Ve, error: He, lastResult: Ue, clearError: We, clearResult: Ge } = t(), { templates: Ke, isLoading: qe } = n(), { trackNotificationSent: Je } = te(), { searchUsers: _, fetchAllUsers: Ye, results: v, isLoading: Xe, error: y } = r(), { topics: Ze } = ee({ isActive: !0 }), [b, Qe] = o("compose"), [x, $e] = o("EMAIL"), [S, et] = o("MARKETING"), [C, tt] = o("MEDIUM"), [w, nt] = o([]), [T, E] = o("manual"), [D, O] = o([]), [k, rt] = o(!1), [A, it] = o(""), [j, at] = o(""), [M, ot] = o(""), [N, st] = o(""), [ct, lt] = o(""), [ut, dt] = o(!1), [P, ft] = o(""), [pt, F] = o([{
|
|
181
181
|
url: "",
|
|
182
182
|
label: "",
|
|
183
183
|
kind: "image"
|
|
184
|
-
}]), [
|
|
184
|
+
}]), [mt, I] = o([{
|
|
185
185
|
id: "primary-action",
|
|
186
186
|
label: "",
|
|
187
187
|
url: "",
|
|
188
188
|
style: "primary"
|
|
189
|
-
}]), [L,
|
|
189
|
+
}]), [L, ht] = o(!1), [R, z] = o([]), [B, V] = o(""), [H, gt] = o(""), [U, _t] = o({}), [W, vt] = o(!1), [G, yt] = o(""), [K, bt] = o(!0), [xt, q] = o(null), [J, Y] = o(!1), X = a(() => Ke.find((e) => e.slug === H), [Ke, H]), Z = a(() => {
|
|
190
190
|
if (!X?.variables) return null;
|
|
191
191
|
try {
|
|
192
192
|
return typeof X.variables == "string" ? JSON.parse(X.variables) : X.variables;
|
|
193
193
|
} catch {
|
|
194
194
|
return null;
|
|
195
195
|
}
|
|
196
|
-
}, [X]),
|
|
196
|
+
}, [X]), St = a(() => Z ? Array.isArray(Z) ? Z.filter((e) => e && typeof e.name == "string").map((e) => ({
|
|
197
197
|
key: e.name,
|
|
198
198
|
type: e.type || "string",
|
|
199
199
|
required: !!e.required,
|
|
@@ -205,44 +205,44 @@ function h() {
|
|
|
205
205
|
required: !1,
|
|
206
206
|
description: "",
|
|
207
207
|
defaultValue: ""
|
|
208
|
-
})) : [] : [], [Z]),
|
|
208
|
+
})) : [] : [], [Z]), Ct = (e) => {
|
|
209
209
|
let t = e;
|
|
210
210
|
for (let [e, n] of Object.entries(U)) t = t.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), n || `{{${e}}}`);
|
|
211
211
|
return t;
|
|
212
|
-
},
|
|
212
|
+
}, wt = a(() => b === "template" && X ? Ct(X.bodyTemplate || "") : N, [
|
|
213
213
|
b,
|
|
214
214
|
X,
|
|
215
215
|
U,
|
|
216
216
|
N
|
|
217
|
-
]),
|
|
217
|
+
]), Tt = a(() => b === "template" && X?.subject ? Ct(X.subject) : M, [
|
|
218
218
|
b,
|
|
219
219
|
X,
|
|
220
220
|
U,
|
|
221
221
|
M
|
|
222
|
-
]),
|
|
222
|
+
]), Et = [
|
|
223
223
|
"EMAIL",
|
|
224
224
|
"SMS",
|
|
225
225
|
"WHATSAPP"
|
|
226
|
-
].includes(x), Q = a(() =>
|
|
226
|
+
].includes(x), Q = a(() => mt.filter((e) => e.label.trim() && e.url.trim()).map((e) => ({
|
|
227
227
|
id: e.id,
|
|
228
228
|
label: e.label.trim(),
|
|
229
229
|
url: e.url.trim(),
|
|
230
230
|
style: e.style
|
|
231
|
-
})), [
|
|
231
|
+
})), [mt]), $ = a(() => pt.filter((e) => e.url.trim()).map((e) => ({
|
|
232
232
|
url: e.url.trim(),
|
|
233
233
|
label: e.label.trim() || void 0,
|
|
234
234
|
kind: e.kind
|
|
235
|
-
})), [
|
|
235
|
+
})), [pt]);
|
|
236
236
|
if (Fe) return /* @__PURE__ */ p("div", {
|
|
237
237
|
className: "flex h-64 items-center justify-center",
|
|
238
238
|
children: /* @__PURE__ */ p("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
239
239
|
});
|
|
240
|
-
let
|
|
241
|
-
if (!
|
|
240
|
+
let Dt = Pe(re.NOTIFICATION_CREATE), Ot = Pe(re.NOTIFICATION_SEND);
|
|
241
|
+
if (!Dt || !Ot) return /* @__PURE__ */ p("div", {
|
|
242
242
|
className: "p-8 text-center text-text-secondary",
|
|
243
243
|
children: l("notifications.noPermissionCreateAndSend", "You don't have permission to create and send notifications.")
|
|
244
244
|
});
|
|
245
|
-
let
|
|
245
|
+
let kt = (e) => x === "EMAIL" ? {
|
|
246
246
|
userId: e.id,
|
|
247
247
|
email: e.email
|
|
248
248
|
} : x === "SMS" ? e.phoneNumber ? {
|
|
@@ -254,11 +254,11 @@ function h() {
|
|
|
254
254
|
} : null : {
|
|
255
255
|
userId: e.id,
|
|
256
256
|
email: e.email
|
|
257
|
-
},
|
|
257
|
+
}, At = async () => (k ? await Ye({
|
|
258
258
|
search: B,
|
|
259
259
|
role: A || void 0,
|
|
260
260
|
status: j || void 0
|
|
261
|
-
}) : D).map((e) =>
|
|
261
|
+
}) : D).map((e) => kt(e)).filter((e) => !!e), jt = () => w.map((e) => ({
|
|
262
262
|
email: e.email,
|
|
263
263
|
phoneNumber: e.phoneNumber,
|
|
264
264
|
pushToken: e.pushToken,
|
|
@@ -267,7 +267,7 @@ function h() {
|
|
|
267
267
|
teamsUserId: e.teamsUserId,
|
|
268
268
|
webhookUrl: e.webhookUrl,
|
|
269
269
|
userId: e.userId
|
|
270
|
-
})),
|
|
270
|
+
})), Mt = () => {
|
|
271
271
|
if (q(null), T === "manual" && w.length === 0) return q(l("notifications.addRecipientRequired", "Please add at least one recipient")), !1;
|
|
272
272
|
if (T === "directory" && D.length === 0 && !k) return q(l("notifications.selectDirectoryUsersRequired", "Please select at least one user")), !1;
|
|
273
273
|
if (L && R.length === 0) return q(l("notifications.selectUsersRequired", "Please select users for in-app notifications")), !1;
|
|
@@ -277,12 +277,12 @@ function h() {
|
|
|
277
277
|
if (x === "EMAIL" && !M.trim()) return q(l("notifications.subjectRequired", "Subject is required for email notifications")), !1;
|
|
278
278
|
} else if (!H) return q(l("notifications.selectTemplateRequired", "Please select a template")), !1;
|
|
279
279
|
return !0;
|
|
280
|
-
},
|
|
281
|
-
if (ae("light"),
|
|
282
|
-
|
|
280
|
+
}, Nt = async () => {
|
|
281
|
+
if (ae("light"), Mt()) {
|
|
282
|
+
We(), Ge(), Y(!1);
|
|
283
283
|
try {
|
|
284
|
-
let e = T === "directory" ? await
|
|
285
|
-
|
|
284
|
+
let e = T === "directory" ? await At() : jt(), t = e.length + (L ? R.length : 0), n = (e, n) => {
|
|
285
|
+
Je({
|
|
286
286
|
mode: b,
|
|
287
287
|
channel: x,
|
|
288
288
|
type: b === "template" && X?.type || S,
|
|
@@ -328,7 +328,7 @@ function h() {
|
|
|
328
328
|
channel: x,
|
|
329
329
|
recipient: e,
|
|
330
330
|
subject: x === "EMAIL" ? M : void 0,
|
|
331
|
-
htmlBody:
|
|
331
|
+
htmlBody: ut && ct ? ct : void 0,
|
|
332
332
|
type: S,
|
|
333
333
|
priority: C,
|
|
334
334
|
topicId: P || void 0,
|
|
@@ -356,14 +356,14 @@ function h() {
|
|
|
356
356
|
}
|
|
357
357
|
} catch (t) {
|
|
358
358
|
if (i("error"), e(t)) {
|
|
359
|
-
|
|
359
|
+
We(), Le(l("notifications.permissionDeniedOnSend", "You don't have permission to send that notification. Refreshing access…"), "warning"), Ie().catch((e) => console.warn("[permissions] refresh failed after send denial:", e));
|
|
360
360
|
return;
|
|
361
361
|
}
|
|
362
362
|
console.error("Failed to send notification:", t);
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
},
|
|
366
|
-
|
|
365
|
+
}, Pt = () => {
|
|
366
|
+
nt([]), E("manual"), O([]), rt(!1), it(""), at(""), ot(""), st(""), lt(""), ft(""), F([{
|
|
367
367
|
url: "",
|
|
368
368
|
label: "",
|
|
369
369
|
kind: "image"
|
|
@@ -372,8 +372,8 @@ function h() {
|
|
|
372
372
|
label: "",
|
|
373
373
|
url: "",
|
|
374
374
|
style: "primary"
|
|
375
|
-
}]),
|
|
376
|
-
},
|
|
375
|
+
}]), gt(""), _t({}), ht(!1), z([]), V(""), vt(!1), yt(""), Y(!1), We(), Ge();
|
|
376
|
+
}, Ft = xt || He, It = /* @__PURE__ */ p(f, { children: /* @__PURE__ */ m("div", {
|
|
377
377
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
378
378
|
children: [/* @__PURE__ */ m("label", {
|
|
379
379
|
className: "flex items-center gap-3 cursor-pointer",
|
|
@@ -381,7 +381,7 @@ function h() {
|
|
|
381
381
|
type: "checkbox",
|
|
382
382
|
checked: W,
|
|
383
383
|
onChange: (e) => {
|
|
384
|
-
|
|
384
|
+
vt(e.target.checked), e.target.checked || yt("");
|
|
385
385
|
},
|
|
386
386
|
className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
|
|
387
387
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -395,7 +395,7 @@ function h() {
|
|
|
395
395
|
"aria-label": l("notifications.scheduleDateTime", "Send date and time"),
|
|
396
396
|
value: G,
|
|
397
397
|
min: (/* @__PURE__ */ new Date()).toISOString().slice(0, 16),
|
|
398
|
-
onChange: (e) =>
|
|
398
|
+
onChange: (e) => yt(e.target.value),
|
|
399
399
|
className: "px-4 py-2 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
400
400
|
}), /* @__PURE__ */ m("p", {
|
|
401
401
|
className: "text-xs text-text-tertiary mt-1",
|
|
@@ -407,17 +407,17 @@ function h() {
|
|
|
407
407
|
]
|
|
408
408
|
})]
|
|
409
409
|
})]
|
|
410
|
-
}) }),
|
|
410
|
+
}) }), Lt = /* @__PURE__ */ p(f, { children: /* @__PURE__ */ p("div", {
|
|
411
411
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
412
412
|
children: /* @__PURE__ */ m("div", {
|
|
413
413
|
className: "grid grid-cols-2 gap-4",
|
|
414
414
|
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
415
415
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
416
416
|
children: l("notifications.typeLabel", "Type")
|
|
417
|
-
}), /* @__PURE__ */ p(
|
|
417
|
+
}), /* @__PURE__ */ p(h, {
|
|
418
418
|
"aria-label": l("notifications.typeLabel", "Type"),
|
|
419
419
|
value: S,
|
|
420
|
-
onChange: (e) =>
|
|
420
|
+
onChange: (e) => et(e.target.value),
|
|
421
421
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
422
422
|
children: Ae.map((e) => /* @__PURE__ */ p("option", {
|
|
423
423
|
value: e.value,
|
|
@@ -426,10 +426,10 @@ function h() {
|
|
|
426
426
|
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
427
427
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
428
428
|
children: l("notifications.priorityLabel", "Priority")
|
|
429
|
-
}), /* @__PURE__ */ p(
|
|
429
|
+
}), /* @__PURE__ */ p(h, {
|
|
430
430
|
"aria-label": l("notifications.priorityLabel", "Priority"),
|
|
431
431
|
value: C,
|
|
432
|
-
onChange: (e) =>
|
|
432
|
+
onChange: (e) => tt(e.target.value),
|
|
433
433
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
434
434
|
children: je.map((e) => /* @__PURE__ */ p("option", {
|
|
435
435
|
value: e.value,
|
|
@@ -437,7 +437,7 @@ function h() {
|
|
|
437
437
|
}, e.value))
|
|
438
438
|
})] })]
|
|
439
439
|
})
|
|
440
|
-
}) }),
|
|
440
|
+
}) }), Rt = /* @__PURE__ */ p(f, { children: /* @__PURE__ */ m("div", {
|
|
441
441
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
442
442
|
children: [/* @__PURE__ */ m("div", {
|
|
443
443
|
className: "mb-4 flex items-center gap-2",
|
|
@@ -450,7 +450,7 @@ function h() {
|
|
|
450
450
|
})]
|
|
451
451
|
}), /* @__PURE__ */ m("div", {
|
|
452
452
|
className: "space-y-3",
|
|
453
|
-
children: [
|
|
453
|
+
children: [mt.map((e, t) => /* @__PURE__ */ m("div", {
|
|
454
454
|
className: "grid gap-3 rounded-lg border border-border-subtle bg-bg-canvas p-3 md:grid-cols-[1fr,1fr,160px,auto]",
|
|
455
455
|
children: [
|
|
456
456
|
/* @__PURE__ */ p("input", {
|
|
@@ -473,7 +473,7 @@ function h() {
|
|
|
473
473
|
placeholder: l("notifications.actionUrl", "https://..."),
|
|
474
474
|
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
475
475
|
}),
|
|
476
|
-
/* @__PURE__ */ m(
|
|
476
|
+
/* @__PURE__ */ m(h, {
|
|
477
477
|
"aria-label": l("notifications.actionStyle", "Action style"),
|
|
478
478
|
value: e.style,
|
|
479
479
|
onChange: (e) => I((n) => n.map((n, r) => r === t ? {
|
|
@@ -520,7 +520,7 @@ function h() {
|
|
|
520
520
|
children: l("notifications.addAction", "Add action")
|
|
521
521
|
})]
|
|
522
522
|
})]
|
|
523
|
-
}) }),
|
|
523
|
+
}) }), zt = /* @__PURE__ */ p(f, { children: /* @__PURE__ */ m("div", {
|
|
524
524
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
525
525
|
children: [/* @__PURE__ */ m("div", {
|
|
526
526
|
className: "mb-4 flex items-center gap-2",
|
|
@@ -533,7 +533,7 @@ function h() {
|
|
|
533
533
|
})]
|
|
534
534
|
}), /* @__PURE__ */ m("div", {
|
|
535
535
|
className: "space-y-3",
|
|
536
|
-
children: [
|
|
536
|
+
children: [pt.map((e, t) => /* @__PURE__ */ m("div", {
|
|
537
537
|
className: "grid gap-3 rounded-lg border border-border-subtle bg-bg-canvas p-3 md:grid-cols-[1fr,220px,140px,auto]",
|
|
538
538
|
children: [
|
|
539
539
|
/* @__PURE__ */ p("input", {
|
|
@@ -556,7 +556,7 @@ function h() {
|
|
|
556
556
|
placeholder: l("notifications.mediaLabel", "Caption / label"),
|
|
557
557
|
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
558
558
|
}),
|
|
559
|
-
/* @__PURE__ */ m(
|
|
559
|
+
/* @__PURE__ */ m(h, {
|
|
560
560
|
"aria-label": l("notifications.mediaKindLabel", "Media kind"),
|
|
561
561
|
value: e.kind,
|
|
562
562
|
onChange: (e) => F((n) => n.map((n, r) => r === t ? {
|
|
@@ -611,7 +611,7 @@ function h() {
|
|
|
611
611
|
children: [/* @__PURE__ */ m("div", {
|
|
612
612
|
className: "flex items-center gap-4",
|
|
613
613
|
children: [/* @__PURE__ */ p("button", {
|
|
614
|
-
onClick: () => ve(
|
|
614
|
+
onClick: () => ve(g ? u.inbox : u.center),
|
|
615
615
|
"aria-label": l("notifications.back", "Back"),
|
|
616
616
|
className: "p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-lg transition-colors",
|
|
617
617
|
children: /* @__PURE__ */ p(de, { size: 20 })
|
|
@@ -624,17 +624,17 @@ function h() {
|
|
|
624
624
|
})] })]
|
|
625
625
|
}), /* @__PURE__ */ p(Ce, {
|
|
626
626
|
primary: {
|
|
627
|
-
label:
|
|
628
|
-
onSelect:
|
|
629
|
-
disabled:
|
|
630
|
-
icon:
|
|
627
|
+
label: Ve ? l("notifications.sending", "Sending...") : J ? l("notifications.sent", "Sent!") : W ? l("notifications.schedule", "Schedule") : l("notifications.sendNotification", "Send Notification"),
|
|
628
|
+
onSelect: Nt,
|
|
629
|
+
disabled: Ve || J,
|
|
630
|
+
icon: Ve ? /* @__PURE__ */ p(c, {
|
|
631
631
|
size: 16,
|
|
632
632
|
className: "animate-spin"
|
|
633
633
|
}) : p(J ? s : ye, { size: 16 })
|
|
634
634
|
},
|
|
635
635
|
actions: [{
|
|
636
636
|
label: K ? l("notifications.hidePreview", "Hide preview") : l("notifications.showPreview", "Show preview"),
|
|
637
|
-
onSelect: () =>
|
|
637
|
+
onSelect: () => bt(!K),
|
|
638
638
|
icon: p(K ? me : pe, { size: 16 })
|
|
639
639
|
}]
|
|
640
640
|
})]
|
|
@@ -659,19 +659,19 @@ function h() {
|
|
|
659
659
|
]
|
|
660
660
|
})]
|
|
661
661
|
}), /* @__PURE__ */ p("button", {
|
|
662
|
-
onClick:
|
|
662
|
+
onClick: Pt,
|
|
663
663
|
className: "px-3 py-1.5 text-sm font-medium text-status-success-text hover:bg-status-success-bg-subtle rounded-lg transition-colors",
|
|
664
664
|
children: l("notifications.sendAnother", "Send Another")
|
|
665
665
|
})]
|
|
666
666
|
}),
|
|
667
|
-
|
|
667
|
+
Ft && /* @__PURE__ */ m("div", {
|
|
668
668
|
className: "mx-6 mt-4 flex items-center gap-3 p-4 bg-status-error-bg-subtle border border-border-seam rounded-lg",
|
|
669
669
|
children: [/* @__PURE__ */ p(ue, {
|
|
670
670
|
size: 20,
|
|
671
671
|
className: "text-status-error-text flex-shrink-0"
|
|
672
672
|
}), /* @__PURE__ */ p("p", {
|
|
673
673
|
className: "text-sm text-status-error-text",
|
|
674
|
-
children:
|
|
674
|
+
children: Ft
|
|
675
675
|
})]
|
|
676
676
|
}),
|
|
677
677
|
/* @__PURE__ */ m("div", {
|
|
@@ -686,7 +686,7 @@ function h() {
|
|
|
686
686
|
id: "template",
|
|
687
687
|
label: l("notifications.nextUseTemplateLabel", "Start from a template"),
|
|
688
688
|
description: l("notifications.nextUseTemplateDesc", "Reuse an approved template instead of writing the message from scratch."),
|
|
689
|
-
onClick: () =>
|
|
689
|
+
onClick: () => Qe("template")
|
|
690
690
|
},
|
|
691
691
|
{
|
|
692
692
|
id: "recipients",
|
|
@@ -698,7 +698,7 @@ function h() {
|
|
|
698
698
|
id: "preview",
|
|
699
699
|
label: l("notifications.nextPreviewLabel", "Check the live preview"),
|
|
700
700
|
description: l("notifications.nextPreviewDesc", "Confirm the rendered message, recipients and actions look right before you send."),
|
|
701
|
-
onClick: () =>
|
|
701
|
+
onClick: () => bt(!0)
|
|
702
702
|
}
|
|
703
703
|
]
|
|
704
704
|
})]
|
|
@@ -722,11 +722,11 @@ function h() {
|
|
|
722
722
|
}), /* @__PURE__ */ m("div", {
|
|
723
723
|
className: "flex gap-2",
|
|
724
724
|
children: [/* @__PURE__ */ p("button", {
|
|
725
|
-
onClick: () =>
|
|
725
|
+
onClick: () => Qe("compose"),
|
|
726
726
|
className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${b === "compose" ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
|
|
727
727
|
children: l("notifications.composeMessage", "Compose Message")
|
|
728
728
|
}), /* @__PURE__ */ p("button", {
|
|
729
|
-
onClick: () =>
|
|
729
|
+
onClick: () => Qe("template"),
|
|
730
730
|
className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${b === "template" ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
|
|
731
731
|
children: l("notifications.useTemplate", "Use Template")
|
|
732
732
|
})]
|
|
@@ -745,11 +745,11 @@ function h() {
|
|
|
745
745
|
let t = e.icon;
|
|
746
746
|
return /* @__PURE__ */ m("button", {
|
|
747
747
|
onClick: () => {
|
|
748
|
-
|
|
748
|
+
$e(e.value), nt([]), O([]), [
|
|
749
749
|
"EMAIL",
|
|
750
750
|
"SMS",
|
|
751
751
|
"WHATSAPP"
|
|
752
|
-
].includes(e.value) || (E("manual"),
|
|
752
|
+
].includes(e.value) || (E("manual"), rt(!1));
|
|
753
753
|
},
|
|
754
754
|
className: `flex flex-col items-center gap-2 p-3 rounded-lg border transition-colors ${x === e.value ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
|
|
755
755
|
children: [/* @__PURE__ */ p(t, { size: 20 }), /* @__PURE__ */ p("span", {
|
|
@@ -767,7 +767,7 @@ function h() {
|
|
|
767
767
|
type: "checkbox",
|
|
768
768
|
checked: L,
|
|
769
769
|
onChange: (e) => {
|
|
770
|
-
|
|
770
|
+
ht(e.target.checked), e.target.checked || (z([]), V(""));
|
|
771
771
|
},
|
|
772
772
|
className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
|
|
773
773
|
}), /* @__PURE__ */ m("div", {
|
|
@@ -787,7 +787,7 @@ function h() {
|
|
|
787
787
|
})
|
|
788
788
|
]
|
|
789
789
|
}),
|
|
790
|
-
!
|
|
790
|
+
!g && It,
|
|
791
791
|
/* @__PURE__ */ m("div", {
|
|
792
792
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
793
793
|
children: [
|
|
@@ -798,14 +798,14 @@ function h() {
|
|
|
798
798
|
children: "*"
|
|
799
799
|
})]
|
|
800
800
|
}),
|
|
801
|
-
/* @__PURE__ */ m(
|
|
801
|
+
/* @__PURE__ */ m(h, {
|
|
802
802
|
value: P,
|
|
803
|
-
onChange: (e) =>
|
|
803
|
+
onChange: (e) => ft(e.target.value),
|
|
804
804
|
className: "w-full rounded-lg border border-border-subtle bg-bg-canvas px-4 py-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
805
805
|
children: [/* @__PURE__ */ p("option", {
|
|
806
806
|
value: "",
|
|
807
807
|
children: l("notifications.selectTopic", "Select a topic")
|
|
808
|
-
}),
|
|
808
|
+
}), Ze.map((e) => /* @__PURE__ */ m("option", {
|
|
809
809
|
value: e.id,
|
|
810
810
|
children: [
|
|
811
811
|
e.name,
|
|
@@ -841,7 +841,7 @@ function h() {
|
|
|
841
841
|
]
|
|
842
842
|
})]
|
|
843
843
|
}),
|
|
844
|
-
|
|
844
|
+
Et && /* @__PURE__ */ m("div", {
|
|
845
845
|
className: "mb-4 flex gap-2",
|
|
846
846
|
children: [/* @__PURE__ */ p("button", {
|
|
847
847
|
onClick: () => E("manual"),
|
|
@@ -853,11 +853,11 @@ function h() {
|
|
|
853
853
|
children: l("notifications.userDirectory", "User directory")
|
|
854
854
|
})]
|
|
855
855
|
}),
|
|
856
|
-
T === "manual" || !
|
|
856
|
+
T === "manual" || !Et ? /* @__PURE__ */ p(ne, {
|
|
857
857
|
recipients: w,
|
|
858
|
-
onChange:
|
|
858
|
+
onChange: nt,
|
|
859
859
|
channel: x,
|
|
860
|
-
disabled:
|
|
860
|
+
disabled: Ve || J
|
|
861
861
|
}) : /* @__PURE__ */ m("div", {
|
|
862
862
|
className: "space-y-4",
|
|
863
863
|
children: [
|
|
@@ -870,14 +870,14 @@ function h() {
|
|
|
870
870
|
type: "text",
|
|
871
871
|
value: B,
|
|
872
872
|
onChange: (e) => {
|
|
873
|
-
V(e.target.value),
|
|
873
|
+
V(e.target.value), _(e.target.value, {
|
|
874
874
|
role: A || void 0,
|
|
875
875
|
status: j || void 0
|
|
876
876
|
});
|
|
877
877
|
},
|
|
878
878
|
placeholder: l("notifications.searchUsersPlaceholder", "Search users by email or name..."),
|
|
879
879
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
880
|
-
}),
|
|
880
|
+
}), Xe && /* @__PURE__ */ p("div", {
|
|
881
881
|
className: "absolute right-3 top-1/2 -translate-y-1/2",
|
|
882
882
|
children: /* @__PURE__ */ p(c, {
|
|
883
883
|
size: 16,
|
|
@@ -885,10 +885,10 @@ function h() {
|
|
|
885
885
|
})
|
|
886
886
|
})]
|
|
887
887
|
}),
|
|
888
|
-
/* @__PURE__ */ p(
|
|
888
|
+
/* @__PURE__ */ p(h, {
|
|
889
889
|
value: A,
|
|
890
890
|
onChange: (e) => {
|
|
891
|
-
|
|
891
|
+
it(e.target.value), _(B, {
|
|
892
892
|
role: e.target.value || void 0,
|
|
893
893
|
status: j || void 0
|
|
894
894
|
});
|
|
@@ -899,10 +899,10 @@ function h() {
|
|
|
899
899
|
children: l(e.labelKey, e.label)
|
|
900
900
|
}, e.value))
|
|
901
901
|
}),
|
|
902
|
-
/* @__PURE__ */ p(
|
|
902
|
+
/* @__PURE__ */ p(h, {
|
|
903
903
|
value: j,
|
|
904
904
|
onChange: (e) => {
|
|
905
|
-
|
|
905
|
+
at(e.target.value), _(B, {
|
|
906
906
|
role: A || void 0,
|
|
907
907
|
status: e.target.value || void 0
|
|
908
908
|
});
|
|
@@ -920,13 +920,13 @@ function h() {
|
|
|
920
920
|
children: [/* @__PURE__ */ p("input", {
|
|
921
921
|
type: "checkbox",
|
|
922
922
|
checked: k,
|
|
923
|
-
onChange: (e) =>
|
|
923
|
+
onChange: (e) => rt(e.target.checked),
|
|
924
924
|
className: "h-4 w-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
|
|
925
925
|
}), /* @__PURE__ */ p("span", { children: l("notifications.sendToAllMatchingUsers", "Send to all users matching the current search and filters") })]
|
|
926
926
|
}),
|
|
927
927
|
B && /* @__PURE__ */ p("div", {
|
|
928
928
|
className: "max-h-56 overflow-y-auto rounded-lg border border-border-subtle",
|
|
929
|
-
children:
|
|
929
|
+
children: v.length > 0 ? v.map((e) => {
|
|
930
930
|
let t = D.some((t) => t.id === e.id), n = x === "EMAIL" ? !!e.email : x === "SMS" || x === "WHATSAPP" ? !!e.phoneNumber : !0;
|
|
931
931
|
return /* @__PURE__ */ m("button", {
|
|
932
932
|
type: "button",
|
|
@@ -1035,14 +1035,14 @@ function h() {
|
|
|
1035
1035
|
type: "text",
|
|
1036
1036
|
value: B,
|
|
1037
1037
|
onChange: (e) => {
|
|
1038
|
-
V(e.target.value),
|
|
1038
|
+
V(e.target.value), _(e.target.value, {
|
|
1039
1039
|
role: A || void 0,
|
|
1040
1040
|
status: j || void 0
|
|
1041
1041
|
});
|
|
1042
1042
|
},
|
|
1043
1043
|
placeholder: l("notifications.searchUsersPlaceholder", "Search users by email or name..."),
|
|
1044
1044
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
1045
|
-
}),
|
|
1045
|
+
}), Xe && /* @__PURE__ */ p("div", {
|
|
1046
1046
|
className: "absolute right-3 top-1/2 transform -translate-y-1/2",
|
|
1047
1047
|
children: /* @__PURE__ */ p(c, {
|
|
1048
1048
|
size: 16,
|
|
@@ -1052,9 +1052,9 @@ function h() {
|
|
|
1052
1052
|
}),
|
|
1053
1053
|
B && /* @__PURE__ */ p("div", {
|
|
1054
1054
|
className: "mb-4",
|
|
1055
|
-
children:
|
|
1055
|
+
children: v.length > 0 ? /* @__PURE__ */ p("div", {
|
|
1056
1056
|
className: "max-h-48 overflow-y-auto border border-border-subtle rounded-lg",
|
|
1057
|
-
children:
|
|
1057
|
+
children: v.map((e) => {
|
|
1058
1058
|
let t = R.some((t) => t.id === e.id);
|
|
1059
1059
|
return /* @__PURE__ */ m("button", {
|
|
1060
1060
|
type: "button",
|
|
@@ -1138,13 +1138,13 @@ function h() {
|
|
|
1138
1138
|
})
|
|
1139
1139
|
]
|
|
1140
1140
|
}),
|
|
1141
|
-
|
|
1141
|
+
qe ? /* @__PURE__ */ p("div", {
|
|
1142
1142
|
className: "flex items-center justify-center py-8",
|
|
1143
1143
|
children: /* @__PURE__ */ p(c, {
|
|
1144
1144
|
size: 24,
|
|
1145
1145
|
className: "animate-spin text-text-tertiary"
|
|
1146
1146
|
})
|
|
1147
|
-
}) :
|
|
1147
|
+
}) : Ke.length === 0 ? /* @__PURE__ */ p(Te, {
|
|
1148
1148
|
illustration: "empty-files",
|
|
1149
1149
|
title: l("notifications.noTemplatesAvailable", "No templates available"),
|
|
1150
1150
|
description: l("notifications.noTemplatesAvailableDesc", "Create a reusable template once and pick it here every time you send."),
|
|
@@ -1153,16 +1153,16 @@ function h() {
|
|
|
1153
1153
|
className: "text-sm text-primary-600 hover:text-primary-700",
|
|
1154
1154
|
children: l("notifications.createATemplate", "Create a template")
|
|
1155
1155
|
})
|
|
1156
|
-
}) : /* @__PURE__ */ m(
|
|
1156
|
+
}) : /* @__PURE__ */ m(h, {
|
|
1157
1157
|
value: H,
|
|
1158
1158
|
onChange: (e) => {
|
|
1159
|
-
|
|
1159
|
+
gt(e.target.value), _t({});
|
|
1160
1160
|
},
|
|
1161
1161
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
1162
1162
|
children: [/* @__PURE__ */ p("option", {
|
|
1163
1163
|
value: "",
|
|
1164
1164
|
children: l("notifications.selectATemplate", "Select a template...")
|
|
1165
|
-
}),
|
|
1165
|
+
}), Ke.filter((e) => e.enabled).map((e) => /* @__PURE__ */ m("option", {
|
|
1166
1166
|
value: e.slug,
|
|
1167
1167
|
children: [
|
|
1168
1168
|
e.name,
|
|
@@ -1172,12 +1172,12 @@ function h() {
|
|
|
1172
1172
|
]
|
|
1173
1173
|
}, e.id))]
|
|
1174
1174
|
}),
|
|
1175
|
-
X &&
|
|
1175
|
+
X && St.length > 0 && /* @__PURE__ */ m("div", {
|
|
1176
1176
|
className: "mt-4 space-y-3",
|
|
1177
1177
|
children: [/* @__PURE__ */ p("h3", {
|
|
1178
1178
|
className: "text-sm font-medium text-text-secondary",
|
|
1179
1179
|
children: l("notifications.templateVariables", "Template Variables")
|
|
1180
|
-
}),
|
|
1180
|
+
}), St.map((e) => /* @__PURE__ */ m("div", { children: [
|
|
1181
1181
|
/* @__PURE__ */ m("label", {
|
|
1182
1182
|
className: "block text-xs text-text-secondary mb-1",
|
|
1183
1183
|
children: [
|
|
@@ -1203,7 +1203,7 @@ function h() {
|
|
|
1203
1203
|
/* @__PURE__ */ p("input", {
|
|
1204
1204
|
type: "text",
|
|
1205
1205
|
value: U[e.key] || "",
|
|
1206
|
-
onChange: (t) =>
|
|
1206
|
+
onChange: (t) => _t((n) => ({
|
|
1207
1207
|
...n,
|
|
1208
1208
|
[e.key]: t.target.value
|
|
1209
1209
|
})),
|
|
@@ -1215,7 +1215,7 @@ function h() {
|
|
|
1215
1215
|
]
|
|
1216
1216
|
}),
|
|
1217
1217
|
b === "compose" && /* @__PURE__ */ m(f, { children: [
|
|
1218
|
-
!
|
|
1218
|
+
!g && Lt,
|
|
1219
1219
|
x === "EMAIL" && /* @__PURE__ */ m("div", {
|
|
1220
1220
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
1221
1221
|
children: [/* @__PURE__ */ m("label", {
|
|
@@ -1231,7 +1231,7 @@ function h() {
|
|
|
1231
1231
|
}), /* @__PURE__ */ p("input", {
|
|
1232
1232
|
type: "text",
|
|
1233
1233
|
value: M,
|
|
1234
|
-
onChange: (e) =>
|
|
1234
|
+
onChange: (e) => ot(e.target.value),
|
|
1235
1235
|
placeholder: l("notifications.enterSubjectPlaceholder", "Enter email subject..."),
|
|
1236
1236
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
1237
1237
|
})]
|
|
@@ -1255,8 +1255,8 @@ function h() {
|
|
|
1255
1255
|
className: "flex items-center gap-2 text-sm text-text-secondary cursor-pointer",
|
|
1256
1256
|
children: [/* @__PURE__ */ p("input", {
|
|
1257
1257
|
type: "checkbox",
|
|
1258
|
-
checked:
|
|
1259
|
-
onChange: (e) =>
|
|
1258
|
+
checked: ut,
|
|
1259
|
+
onChange: (e) => dt(e.target.checked),
|
|
1260
1260
|
className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
|
|
1261
1261
|
}), l("notifications.includeHtmlVersion", "Include HTML version")]
|
|
1262
1262
|
})]
|
|
@@ -1264,19 +1264,19 @@ function h() {
|
|
|
1264
1264
|
/* @__PURE__ */ p("textarea", {
|
|
1265
1265
|
rows: 6,
|
|
1266
1266
|
value: N,
|
|
1267
|
-
onChange: (e) =>
|
|
1267
|
+
onChange: (e) => st(e.target.value),
|
|
1268
1268
|
placeholder: l("notifications.enterMessagePlaceholder", "Enter your message..."),
|
|
1269
1269
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none"
|
|
1270
1270
|
}),
|
|
1271
|
-
x === "EMAIL" &&
|
|
1271
|
+
x === "EMAIL" && ut && /* @__PURE__ */ m("div", {
|
|
1272
1272
|
className: "mt-4",
|
|
1273
1273
|
children: [/* @__PURE__ */ p("label", {
|
|
1274
1274
|
className: "block text-sm font-medium text-text-secondary mb-2",
|
|
1275
1275
|
children: l("notifications.htmlContent", "HTML Content")
|
|
1276
1276
|
}), /* @__PURE__ */ p("textarea", {
|
|
1277
1277
|
rows: 8,
|
|
1278
|
-
value:
|
|
1279
|
-
onChange: (e) =>
|
|
1278
|
+
value: ct,
|
|
1279
|
+
onChange: (e) => lt(e.target.value),
|
|
1280
1280
|
placeholder: l("notifications.htmlPlaceholder", "<html>...</html>"),
|
|
1281
1281
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none font-mono"
|
|
1282
1282
|
})]
|
|
@@ -1284,17 +1284,17 @@ function h() {
|
|
|
1284
1284
|
]
|
|
1285
1285
|
})
|
|
1286
1286
|
] }),
|
|
1287
|
-
!
|
|
1288
|
-
!
|
|
1289
|
-
|
|
1287
|
+
!g && Rt,
|
|
1288
|
+
!g && zt,
|
|
1289
|
+
g && /* @__PURE__ */ p(De, {
|
|
1290
1290
|
storageKey: "notifications.send.more",
|
|
1291
1291
|
children: /* @__PURE__ */ m("div", {
|
|
1292
1292
|
className: "space-y-6",
|
|
1293
1293
|
children: [
|
|
1294
|
-
|
|
1295
|
-
b === "compose" &&
|
|
1296
|
-
|
|
1297
|
-
|
|
1294
|
+
It,
|
|
1295
|
+
b === "compose" && Lt,
|
|
1296
|
+
Rt,
|
|
1297
|
+
zt
|
|
1298
1298
|
]
|
|
1299
1299
|
})
|
|
1300
1300
|
})
|
|
@@ -1353,24 +1353,24 @@ function h() {
|
|
|
1353
1353
|
]
|
|
1354
1354
|
})]
|
|
1355
1355
|
}),
|
|
1356
|
-
x === "EMAIL" &&
|
|
1356
|
+
x === "EMAIL" && Tt && /* @__PURE__ */ m("div", {
|
|
1357
1357
|
className: "mb-4",
|
|
1358
1358
|
children: [/* @__PURE__ */ p("p", {
|
|
1359
1359
|
className: "text-xs text-text-secondary mb-1",
|
|
1360
1360
|
children: l("notifications.subjectLabel", "Subject")
|
|
1361
1361
|
}), /* @__PURE__ */ p("p", {
|
|
1362
1362
|
className: "text-sm font-medium text-text-primary",
|
|
1363
|
-
children:
|
|
1363
|
+
children: Tt
|
|
1364
1364
|
})]
|
|
1365
1365
|
}),
|
|
1366
1366
|
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
1367
1367
|
className: "text-xs text-text-secondary mb-1",
|
|
1368
1368
|
children: l("notifications.messageLabel", "Message")
|
|
1369
|
-
}),
|
|
1369
|
+
}), wt ? /* @__PURE__ */ p("div", {
|
|
1370
1370
|
className: "p-3 bg-bg-canvas rounded-lg",
|
|
1371
1371
|
children: /* @__PURE__ */ p("p", {
|
|
1372
1372
|
className: "text-sm text-text-secondary whitespace-pre-wrap",
|
|
1373
|
-
children:
|
|
1373
|
+
children: wt
|
|
1374
1374
|
})
|
|
1375
1375
|
}) : /* @__PURE__ */ p("p", {
|
|
1376
1376
|
className: "text-sm text-text-tertiary italic",
|
|
@@ -1383,7 +1383,7 @@ function h() {
|
|
|
1383
1383
|
children: l("notifications.topic", "Topic")
|
|
1384
1384
|
}), /* @__PURE__ */ p("p", {
|
|
1385
1385
|
className: "text-sm text-text-primary",
|
|
1386
|
-
children:
|
|
1386
|
+
children: Ze.find((e) => e.id === P)?.name || P
|
|
1387
1387
|
})]
|
|
1388
1388
|
}),
|
|
1389
1389
|
Q.length > 0 && /* @__PURE__ */ m("div", {
|
|
@@ -1434,6 +1434,6 @@ function h() {
|
|
|
1434
1434
|
]
|
|
1435
1435
|
});
|
|
1436
1436
|
}
|
|
1437
|
-
export {
|
|
1437
|
+
export { g as CreateNotificationPage };
|
|
1438
1438
|
|
|
1439
1439
|
//# sourceMappingURL=CreateNotificationPage.js.map
|