@burdenoff/microfe-notification 2026.624.2 → 2026.625.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/FeatureDisabledPage.js +1 -1
- package/dist/components/FeatureDisabledPage.js.map +1 -1
- package/dist/components/NotificationCard.js +4 -3
- package/dist/components/NotificationCard.js.map +1 -1
- package/dist/components/NotificationPanel.js +2 -2
- package/dist/components/NotificationPanel.js.map +1 -1
- package/dist/pages/CreateNotificationPage.js +473 -471
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.js +83 -80
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.js +117 -111
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.js +41 -38
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationLandingPage.js +1 -1
- package/dist/pages/NotificationLandingPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.js +74 -74
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +96 -94
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +58 -56
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +308 -307
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,11 +4,12 @@ import { isPermissionError as n } from "../utils/index.js";
|
|
|
4
4
|
import { NOTIFICATION_PERMISSIONS as r } from "../constants/permissions.js";
|
|
5
5
|
import { useNotificationTemplate as i, useNotificationTemplates as ee } from "../hooks/useNotificationTemplates.js";
|
|
6
6
|
import { TemplatePreview as te } from "../components/TemplatePreview.js";
|
|
7
|
-
import { useCallback as a, useEffect as o, useMemo as s, useRef as
|
|
8
|
-
import { useGlobalUi as
|
|
9
|
-
import { AlertCircle as
|
|
10
|
-
import { useNavigate as
|
|
11
|
-
import { jsx as
|
|
7
|
+
import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
8
|
+
import { useGlobalUi as ne, usePermissions as re } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
|
+
import { AlertCircle as u, ArrowLeft as ie, Code as ae, Eye as d, EyeOff as f, Loader2 as p, Plus as oe, Save as m, Trash2 as se, Type as ce, Variable as le } from "lucide-react";
|
|
10
|
+
import { useNavigate as ue, useParams as de } from "react-router-dom";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { Button as fe } from "@burdenoff/fe-libs/ui";
|
|
12
13
|
import { useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
14
|
//#region src/pages/TemplateEditorPage.tsx
|
|
14
15
|
var me = [
|
|
@@ -90,7 +91,7 @@ var me = [
|
|
|
90
91
|
function _e(e) {
|
|
91
92
|
return e.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
+
function _(e, t, n) {
|
|
94
95
|
return e ? e.replace(/\{\{(\w+)\}\}/g, (e, r) => {
|
|
95
96
|
let i = t.find((e) => e.name === r);
|
|
96
97
|
if (!i) return e;
|
|
@@ -103,7 +104,7 @@ function g(e, t, n) {
|
|
|
103
104
|
}
|
|
104
105
|
}) : "";
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
+
function v(e) {
|
|
107
108
|
let t = {};
|
|
108
109
|
for (let n of e) {
|
|
109
110
|
let e = n.name.trim();
|
|
@@ -126,40 +127,40 @@ function ve(e) {
|
|
|
126
127
|
defaultValue: t?.defaultValue || ""
|
|
127
128
|
})) : [] : [];
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
-
let
|
|
130
|
+
function y() {
|
|
131
|
+
let y = ue(), b = t(), { locale: x } = pe(), { templateId: ye } = de(), S = !!ye, { hasPermission: be, isLoading: xe, refreshPermissions: Se } = re(), { showToast: Ce } = ne(), { createTemplate: we, updateTemplate: Te, isCreating: Ee, isUpdating: De } = ee(), { trackTemplateSaved: Oe } = e(), { template: C, isLoading: ke, error: Ae } = i(S ? ye : void 0), [w, T] = l(""), [E, D] = l(""), [O, k] = l(!1), [A, j] = l(""), [M, je] = l("TRANSACTIONAL"), [N, Me] = l(""), [P, F] = l("en"), [I, L] = l(""), [R, z] = l(""), [B, V] = l(""), [H, U] = l([]), [W, G] = l("text"), K = c(null), q = c(null), [J, Y] = l(null), [Ne, X] = l(null), [Z, Pe] = l(!0), [Fe, Ie] = l("email");
|
|
131
132
|
o(() => {
|
|
132
|
-
C && (T(C.name), D(C.slug), k(!0), j(C.description || ""),
|
|
133
|
+
C && (T(C.name), D(C.slug), k(!0), j(C.description || ""), je(C.type), F(C.locale || "en"), L(C.subject || ""), z(C.bodyTemplate || ""), V(C.htmlTemplate || ""), U(ve(C.variables)), C.htmlTemplate && G("html"));
|
|
133
134
|
}, [C]), o(() => {
|
|
134
135
|
!O && w && D(_e(w));
|
|
135
136
|
}, [w, O]);
|
|
136
|
-
let
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
]),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
]),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
]),
|
|
149
|
-
|
|
137
|
+
let Le = s(() => _(I, H, x), [
|
|
138
|
+
x,
|
|
139
|
+
I,
|
|
140
|
+
H
|
|
141
|
+
]), Re = s(() => _(R, H, x), [
|
|
142
|
+
R,
|
|
143
|
+
x,
|
|
144
|
+
H
|
|
145
|
+
]), ze = s(() => _(B, H, x), [
|
|
146
|
+
x,
|
|
147
|
+
B,
|
|
148
|
+
H
|
|
149
|
+
]), Be = a(() => {
|
|
150
|
+
U((e) => [...e, {
|
|
150
151
|
name: "",
|
|
151
152
|
type: "string",
|
|
152
153
|
defaultValue: ""
|
|
153
154
|
}]);
|
|
154
|
-
}, []),
|
|
155
|
-
|
|
155
|
+
}, []), Ve = a((e) => {
|
|
156
|
+
U((t) => t.filter((t, n) => n !== e));
|
|
156
157
|
}, []), Q = a((e, t, n) => {
|
|
157
|
-
|
|
158
|
+
U((r) => r.map((r, i) => i === e ? {
|
|
158
159
|
...r,
|
|
159
160
|
[t]: n
|
|
160
161
|
} : r));
|
|
161
|
-
}, []),
|
|
162
|
-
let t = `{{${e}}}`, n =
|
|
162
|
+
}, []), He = a((e) => {
|
|
163
|
+
let t = `{{${e}}}`, n = W === "html", r = n ? q.current : K.current, i = n ? V : z;
|
|
163
164
|
if (r) {
|
|
164
165
|
let e = r.selectionStart, n = r.selectionEnd;
|
|
165
166
|
i((r) => r.substring(0, e) + t + r.substring(n)), requestAnimationFrame(() => {
|
|
@@ -168,26 +169,26 @@ function v() {
|
|
|
168
169
|
r.selectionStart = n, r.selectionEnd = n;
|
|
169
170
|
});
|
|
170
171
|
} else i((e) => e + t);
|
|
171
|
-
}, [
|
|
172
|
-
if (e.preventDefault(),
|
|
173
|
-
|
|
172
|
+
}, [W]), Ue = async (e) => {
|
|
173
|
+
if (e.preventDefault(), Y(null), X(null), !w.trim()) {
|
|
174
|
+
Y(b("notifTemplates.nameRequired", "Template name is required"));
|
|
174
175
|
return;
|
|
175
176
|
}
|
|
176
177
|
if (!E.trim()) {
|
|
177
|
-
|
|
178
|
+
Y(b("notifTemplates.slugRequired", "Template slug is required"));
|
|
178
179
|
return;
|
|
179
180
|
}
|
|
180
|
-
if (!
|
|
181
|
-
|
|
181
|
+
if (!R.trim()) {
|
|
182
|
+
Y(b("notifTemplates.bodyRequired", "Body template is required"));
|
|
182
183
|
return;
|
|
183
184
|
}
|
|
184
|
-
if (
|
|
185
|
-
|
|
185
|
+
if (H.filter((e) => !e.name.trim()).length > 0) {
|
|
186
|
+
Y(b("notifTemplates.variablesNeedName", "All variables must have a name"));
|
|
186
187
|
return;
|
|
187
188
|
}
|
|
188
|
-
let t =
|
|
189
|
+
let t = H.map((e) => e.name.trim()), r = t.filter((e, n) => t.indexOf(e) !== n);
|
|
189
190
|
if (r.length > 0) {
|
|
190
|
-
|
|
191
|
+
Y(`${b("notifTemplates.duplicateVariableName", "Duplicate variable name")}: ${r[0]}`);
|
|
191
192
|
return;
|
|
192
193
|
}
|
|
193
194
|
try {
|
|
@@ -195,599 +196,599 @@ function v() {
|
|
|
195
196
|
let e = {
|
|
196
197
|
name: w.trim(),
|
|
197
198
|
description: A.trim() || void 0,
|
|
198
|
-
subject:
|
|
199
|
-
bodyTemplate:
|
|
200
|
-
htmlTemplate:
|
|
201
|
-
variables:
|
|
199
|
+
subject: I.trim() || void 0,
|
|
200
|
+
bodyTemplate: R.trim(),
|
|
201
|
+
htmlTemplate: B.trim() || void 0,
|
|
202
|
+
variables: v(H)
|
|
202
203
|
};
|
|
203
|
-
await
|
|
204
|
+
await Te(C.id, e), Oe({
|
|
204
205
|
action: "update",
|
|
205
|
-
channel:
|
|
206
|
+
channel: N || void 0,
|
|
206
207
|
type: C.type,
|
|
207
|
-
variableCount:
|
|
208
|
-
hasHtml: !!
|
|
209
|
-
}), X(
|
|
210
|
-
} else await
|
|
208
|
+
variableCount: H.length,
|
|
209
|
+
hasHtml: !!B.trim()
|
|
210
|
+
}), X(b("notifTemplates.updateSuccess", "Template updated successfully"));
|
|
211
|
+
} else await we({
|
|
211
212
|
slug: E.trim(),
|
|
212
213
|
name: w.trim(),
|
|
213
214
|
description: A.trim() || void 0,
|
|
214
215
|
type: M,
|
|
215
|
-
locale:
|
|
216
|
-
subject:
|
|
217
|
-
bodyTemplate:
|
|
218
|
-
htmlTemplate:
|
|
219
|
-
variables:
|
|
220
|
-
...
|
|
221
|
-
}),
|
|
216
|
+
locale: P || "en",
|
|
217
|
+
subject: I.trim() || void 0,
|
|
218
|
+
bodyTemplate: R.trim(),
|
|
219
|
+
htmlTemplate: B.trim() || void 0,
|
|
220
|
+
variables: v(H),
|
|
221
|
+
...N ? { channel: N } : {}
|
|
222
|
+
}), Oe({
|
|
222
223
|
action: "create",
|
|
223
|
-
channel:
|
|
224
|
+
channel: N || void 0,
|
|
224
225
|
type: M,
|
|
225
|
-
variableCount:
|
|
226
|
-
hasHtml: !!
|
|
227
|
-
}), X(
|
|
226
|
+
variableCount: H.length,
|
|
227
|
+
hasHtml: !!B.trim()
|
|
228
|
+
}), X(b("notifTemplates.createSuccess", "Template created successfully")), setTimeout(() => y("..", { relative: "path" }), 1200);
|
|
228
229
|
} catch (e) {
|
|
229
230
|
if (n(e)) {
|
|
230
|
-
|
|
231
|
+
Ce(b("notifTemplates.permissionDeniedOnSave", "You don't have permission to save this template. Refreshing access…"), "warning"), Se().catch((e) => console.warn("[permissions] refresh failed after template save denial:", e));
|
|
231
232
|
return;
|
|
232
233
|
}
|
|
233
|
-
|
|
234
|
+
Y(e instanceof Error ? e.message : b("notifTemplates.saveFailed", "Failed to save template"));
|
|
234
235
|
}
|
|
235
236
|
};
|
|
236
|
-
if (
|
|
237
|
+
if (xe) return /* @__PURE__ */ h("div", {
|
|
237
238
|
className: "flex h-64 items-center justify-center",
|
|
238
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ h("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
239
240
|
});
|
|
240
|
-
if (!
|
|
241
|
+
if (!be(S ? r.TEMPLATE_UPDATE : r.TEMPLATE_CREATE)) return /* @__PURE__ */ h("div", {
|
|
241
242
|
className: "p-8 text-center text-text-secondary",
|
|
242
|
-
children: S ?
|
|
243
|
+
children: S ? b("notifTemplates.noPermissionEdit", "You don't have permission to edit notification templates.") : b("notifTemplates.noPermissionCreate", "You don't have permission to create notification templates.")
|
|
243
244
|
});
|
|
244
|
-
if (S &&
|
|
245
|
+
if (S && ke) return /* @__PURE__ */ g("div", {
|
|
245
246
|
className: "flex flex-col items-center justify-center h-64 gap-3",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
247
|
+
children: [/* @__PURE__ */ h(p, {
|
|
247
248
|
size: 28,
|
|
248
249
|
className: "animate-spin text-accent-primary"
|
|
249
|
-
}), /* @__PURE__ */
|
|
250
|
+
}), /* @__PURE__ */ h("p", {
|
|
250
251
|
className: "text-sm text-secondary",
|
|
251
|
-
children:
|
|
252
|
+
children: b("notifTemplates.loadingTemplate", "Loading template...")
|
|
252
253
|
})]
|
|
253
254
|
});
|
|
254
|
-
if (S &&
|
|
255
|
+
if (S && Ae) return /* @__PURE__ */ g("div", {
|
|
255
256
|
className: "flex flex-col items-center justify-center h-64 gap-4",
|
|
256
257
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ h(u, {
|
|
258
259
|
size: 28,
|
|
259
260
|
className: "text-error"
|
|
260
261
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ h("p", {
|
|
262
263
|
className: "text-sm text-error",
|
|
263
|
-
children:
|
|
264
|
+
children: Ae
|
|
264
265
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
onClick: () =>
|
|
266
|
+
/* @__PURE__ */ h("button", {
|
|
267
|
+
onClick: () => y("..", { relative: "path" }),
|
|
267
268
|
className: "px-4 py-2 text-sm text-secondary hover:text-primary border border-default rounded-lg transition-all",
|
|
268
|
-
children:
|
|
269
|
+
children: b("notifTemplates.backToTemplates", "Back to Templates")
|
|
269
270
|
})
|
|
270
271
|
]
|
|
271
272
|
});
|
|
272
|
-
let $ =
|
|
273
|
-
return /* @__PURE__ */
|
|
273
|
+
let $ = Ee || De;
|
|
274
|
+
return /* @__PURE__ */ g("div", {
|
|
274
275
|
className: "animate-in fade-in duration-200 h-full flex flex-col",
|
|
275
276
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
className: "flex items-center justify-between p-3 sm:px-6 sm:py-4 border-b border-
|
|
278
|
-
children: [/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ g("div", {
|
|
278
|
+
className: "flex items-center justify-between gap-3 p-3 sm:px-6 sm:py-4 border-b border-border-seam bg-surface/50 shrink-0",
|
|
279
|
+
children: [/* @__PURE__ */ g("div", {
|
|
279
280
|
className: "flex items-center gap-3",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
281
|
-
onClick: () =>
|
|
281
|
+
children: [/* @__PURE__ */ h("button", {
|
|
282
|
+
onClick: () => y("..", { relative: "path" }),
|
|
282
283
|
className: "p-2 hover:bg-bg-sunken rounded-lg transition-all duration-150",
|
|
283
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ h(ie, {
|
|
284
285
|
size: 20,
|
|
285
286
|
className: "text-primary"
|
|
286
287
|
})
|
|
287
|
-
}), /* @__PURE__ */
|
|
288
|
+
}), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
288
289
|
className: "text-lg font-bold text-primary",
|
|
289
|
-
children: S ?
|
|
290
|
-
}), S && C && /* @__PURE__ */
|
|
290
|
+
children: S ? b("notifTemplates.editTemplate", "Edit Template") : b("notifTemplates.createTemplate", "Create Template")
|
|
291
|
+
}), S && C && /* @__PURE__ */ g("p", {
|
|
291
292
|
className: "text-xs text-tertiary",
|
|
292
293
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ h("code", { children: C.slug }),
|
|
294
295
|
" · v",
|
|
295
296
|
C.version
|
|
296
297
|
]
|
|
297
298
|
})] })]
|
|
298
|
-
}), /* @__PURE__ */
|
|
299
|
-
onClick:
|
|
299
|
+
}), /* @__PURE__ */ g(fe, {
|
|
300
|
+
onClick: Ue,
|
|
300
301
|
disabled: $,
|
|
301
|
-
className: "
|
|
302
|
-
children: [$ ? /* @__PURE__ */
|
|
302
|
+
className: "gap-2",
|
|
303
|
+
children: [$ ? /* @__PURE__ */ h(p, {
|
|
303
304
|
size: 16,
|
|
304
305
|
className: "animate-spin"
|
|
305
|
-
}) : /* @__PURE__ */ m
|
|
306
|
+
}) : /* @__PURE__ */ h(m, { size: 16 }), S ? b("notifTemplates.saveChanges", "Save Changes") : b("notifTemplates.createTemplate", "Create Template")]
|
|
306
307
|
})]
|
|
307
308
|
}),
|
|
308
|
-
|
|
309
|
+
J && /* @__PURE__ */ g("div", {
|
|
309
310
|
className: "mx-3 sm:mx-6 mt-3 flex items-center gap-3 p-3 bg-error/10 border border-error/30 rounded-lg",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ h(u, {
|
|
311
312
|
size: 16,
|
|
312
313
|
className: "text-error shrink-0"
|
|
313
|
-
}), /* @__PURE__ */
|
|
314
|
+
}), /* @__PURE__ */ h("p", {
|
|
314
315
|
className: "text-sm text-error",
|
|
315
|
-
children:
|
|
316
|
+
children: J
|
|
316
317
|
})]
|
|
317
318
|
}),
|
|
318
|
-
|
|
319
|
+
Ne && /* @__PURE__ */ g("div", {
|
|
319
320
|
className: "mx-3 sm:mx-6 mt-3 flex items-center gap-3 p-3 bg-success/10 border border-success/30 rounded-lg",
|
|
320
|
-
children: [/* @__PURE__ */ m
|
|
321
|
+
children: [/* @__PURE__ */ h(m, {
|
|
321
322
|
size: 16,
|
|
322
323
|
className: "text-success shrink-0"
|
|
323
|
-
}), /* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ h("p", {
|
|
324
325
|
className: "text-sm text-success",
|
|
325
|
-
children:
|
|
326
|
+
children: Ne
|
|
326
327
|
})]
|
|
327
328
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ g("div", {
|
|
329
330
|
className: "flex-1 overflow-hidden flex flex-col lg:flex-row",
|
|
330
|
-
children: [/* @__PURE__ */
|
|
331
|
-
className: "flex-1 overflow-y-auto p-3 sm:p-5 lg:border-r lg:border-
|
|
332
|
-
children: /* @__PURE__ */
|
|
333
|
-
onSubmit:
|
|
331
|
+
children: [/* @__PURE__ */ h("div", {
|
|
332
|
+
className: "flex-1 overflow-y-auto p-3 sm:p-5 lg:border-r lg:border-border-seam",
|
|
333
|
+
children: /* @__PURE__ */ g("form", {
|
|
334
|
+
onSubmit: Ue,
|
|
334
335
|
className: "space-y-5",
|
|
335
336
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
className: "p-4 bg-
|
|
337
|
+
/* @__PURE__ */ g("section", {
|
|
338
|
+
className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
|
|
338
339
|
children: [
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ h("h2", {
|
|
340
341
|
className: "text-sm font-semibold text-primary uppercase tracking-wider",
|
|
341
|
-
children:
|
|
342
|
+
children: b("notifTemplates.basicInformation", "Basic Information")
|
|
342
343
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ g("div", {
|
|
344
345
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
345
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
|
|
346
347
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
347
348
|
children: [
|
|
348
|
-
|
|
349
|
+
b("notifTemplates.nameLabel", "Name"),
|
|
349
350
|
" ",
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ h("span", {
|
|
351
352
|
className: "text-error",
|
|
352
353
|
children: "*"
|
|
353
354
|
})
|
|
354
355
|
]
|
|
355
|
-
}), /* @__PURE__ */
|
|
356
|
+
}), /* @__PURE__ */ h("input", {
|
|
356
357
|
type: "text",
|
|
357
358
|
value: w,
|
|
358
359
|
onChange: (e) => T(e.target.value),
|
|
359
|
-
placeholder:
|
|
360
|
-
className: "w-full px-3 py-2 text-sm text-primary bg-
|
|
361
|
-
})] }), /* @__PURE__ */
|
|
362
|
-
/* @__PURE__ */
|
|
360
|
+
placeholder: b("notifTemplates.namePlaceholder", "e.g., Welcome Email"),
|
|
361
|
+
className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150"
|
|
362
|
+
})] }), /* @__PURE__ */ g("div", { children: [
|
|
363
|
+
/* @__PURE__ */ g("label", {
|
|
363
364
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
364
365
|
children: [
|
|
365
|
-
|
|
366
|
+
b("notifTemplates.slugLabel", "Slug"),
|
|
366
367
|
" ",
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ h("span", {
|
|
368
369
|
className: "text-error",
|
|
369
370
|
children: "*"
|
|
370
371
|
})
|
|
371
372
|
]
|
|
372
373
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ h("input", {
|
|
374
375
|
type: "text",
|
|
375
376
|
value: E,
|
|
376
377
|
onChange: (e) => {
|
|
377
378
|
D(e.target.value), k(!0);
|
|
378
379
|
},
|
|
379
|
-
placeholder:
|
|
380
|
+
placeholder: b("notifTemplates.slugPlaceholder", "e.g., welcome-email"),
|
|
380
381
|
disabled: S,
|
|
381
|
-
className: "w-full px-3 py-2 text-sm text-primary bg-
|
|
382
|
+
className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono disabled:opacity-60 disabled:cursor-not-allowed"
|
|
382
383
|
}),
|
|
383
|
-
!S && /* @__PURE__ */
|
|
384
|
+
!S && /* @__PURE__ */ h("p", {
|
|
384
385
|
className: "mt-1 text-[11px] text-tertiary",
|
|
385
|
-
children:
|
|
386
|
+
children: b("notifTemplates.autoGeneratedFromName", "Auto-generated from name.")
|
|
386
387
|
})
|
|
387
388
|
] })]
|
|
388
389
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
390
391
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
391
|
-
children:
|
|
392
|
-
}), /* @__PURE__ */
|
|
392
|
+
children: b("notifTemplates.descriptionLabel", "Description")
|
|
393
|
+
}), /* @__PURE__ */ h("textarea", {
|
|
393
394
|
value: A,
|
|
394
395
|
onChange: (e) => j(e.target.value),
|
|
395
396
|
rows: 2,
|
|
396
|
-
placeholder:
|
|
397
|
-
className: "w-full px-3 py-2 text-sm text-primary bg-
|
|
397
|
+
placeholder: b("notifTemplates.descriptionPlaceholder", "Brief description of this template"),
|
|
398
|
+
className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 resize-none"
|
|
398
399
|
})] }),
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ g("div", {
|
|
400
401
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
401
402
|
children: [
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
|
|
403
404
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
404
405
|
children: [
|
|
405
|
-
|
|
406
|
+
b("notifTemplates.typeLabel", "Type"),
|
|
406
407
|
" ",
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ h("span", {
|
|
408
409
|
className: "text-error",
|
|
409
410
|
children: "*"
|
|
410
411
|
})
|
|
411
412
|
]
|
|
412
|
-
}), /* @__PURE__ */
|
|
413
|
+
}), /* @__PURE__ */ h("select", {
|
|
413
414
|
value: M,
|
|
414
|
-
onChange: (e) =>
|
|
415
|
+
onChange: (e) => je(e.target.value),
|
|
415
416
|
disabled: S,
|
|
416
|
-
className: "w-full px-3 py-2 text-sm text-primary bg-
|
|
417
|
-
children: me.map((e) => /* @__PURE__ */
|
|
417
|
+
className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 disabled:opacity-60",
|
|
418
|
+
children: me.map((e) => /* @__PURE__ */ h("option", {
|
|
418
419
|
value: e.value,
|
|
419
|
-
children:
|
|
420
|
+
children: b(`notifTemplates.type.${e.value}`, e.label)
|
|
420
421
|
}, e.value))
|
|
421
422
|
})] }),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
423
424
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
424
|
-
children:
|
|
425
|
-
}), /* @__PURE__ */
|
|
426
|
-
value:
|
|
427
|
-
onChange: (e) =>
|
|
425
|
+
children: b("notifTemplates.defaultChannel", "Default Channel")
|
|
426
|
+
}), /* @__PURE__ */ g("select", {
|
|
427
|
+
value: N,
|
|
428
|
+
onChange: (e) => Me(e.target.value),
|
|
428
429
|
disabled: S,
|
|
429
|
-
className: "w-full px-3 py-2 text-sm text-primary bg-
|
|
430
|
-
children: [/* @__PURE__ */
|
|
430
|
+
className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 disabled:opacity-60",
|
|
431
|
+
children: [/* @__PURE__ */ h("option", {
|
|
431
432
|
value: "",
|
|
432
|
-
children:
|
|
433
|
-
}), he.map((e) => /* @__PURE__ */
|
|
433
|
+
children: b("notifTemplates.none", "None")
|
|
434
|
+
}), he.map((e) => /* @__PURE__ */ h("option", {
|
|
434
435
|
value: e.value,
|
|
435
|
-
children:
|
|
436
|
+
children: b(`notifTemplates.channel.${e.value}`, e.label)
|
|
436
437
|
}, e.value))]
|
|
437
438
|
})] }),
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
439
440
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
440
|
-
children:
|
|
441
|
-
}), /* @__PURE__ */
|
|
441
|
+
children: b("notifTemplates.localeLabel", "Locale")
|
|
442
|
+
}), /* @__PURE__ */ h("input", {
|
|
442
443
|
type: "text",
|
|
443
|
-
value:
|
|
444
|
-
onChange: (e) =>
|
|
444
|
+
value: P,
|
|
445
|
+
onChange: (e) => F(e.target.value),
|
|
445
446
|
placeholder: "en",
|
|
446
447
|
disabled: S,
|
|
447
|
-
className: "w-full px-3 py-2 text-sm text-primary bg-
|
|
448
|
+
className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono disabled:opacity-60"
|
|
448
449
|
})] })
|
|
449
450
|
]
|
|
450
451
|
})
|
|
451
452
|
]
|
|
452
453
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
className: "p-4 bg-
|
|
454
|
+
/* @__PURE__ */ g("section", {
|
|
455
|
+
className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
|
|
455
456
|
children: [
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ g("div", {
|
|
457
458
|
className: "flex items-center justify-between",
|
|
458
|
-
children: [/* @__PURE__ */
|
|
459
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
459
460
|
className: "text-sm font-semibold text-primary uppercase tracking-wider",
|
|
460
|
-
children:
|
|
461
|
-
}), /* @__PURE__ */
|
|
461
|
+
children: b("notifTemplates.templateContent", "Template Content")
|
|
462
|
+
}), /* @__PURE__ */ g("div", {
|
|
462
463
|
className: "flex items-center bg-bg-sunken rounded-lg p-0.5",
|
|
463
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ g("button", {
|
|
464
465
|
type: "button",
|
|
465
|
-
onClick: () =>
|
|
466
|
-
className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${
|
|
467
|
-
children: [/* @__PURE__ */
|
|
468
|
-
}), /* @__PURE__ */
|
|
466
|
+
onClick: () => G("text"),
|
|
467
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${W === "text" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
|
|
468
|
+
children: [/* @__PURE__ */ h(ce, { size: 12 }), b("notifTemplates.contentMode.text", "Text")]
|
|
469
|
+
}), /* @__PURE__ */ g("button", {
|
|
469
470
|
type: "button",
|
|
470
|
-
onClick: () =>
|
|
471
|
-
className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${
|
|
472
|
-
children: [/* @__PURE__ */
|
|
471
|
+
onClick: () => G("html"),
|
|
472
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${W === "html" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
|
|
473
|
+
children: [/* @__PURE__ */ h(ae, { size: 12 }), b("notifTemplates.contentMode.html", "HTML")]
|
|
473
474
|
})]
|
|
474
475
|
})]
|
|
475
476
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ g("div", { children: [
|
|
478
|
+
/* @__PURE__ */ h("label", {
|
|
478
479
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
479
|
-
children:
|
|
480
|
+
children: b("notifTemplates.subjectLabel", "Subject")
|
|
480
481
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ h("input", {
|
|
482
483
|
type: "text",
|
|
483
|
-
value:
|
|
484
|
-
onChange: (e) =>
|
|
485
|
-
placeholder:
|
|
486
|
-
className: "w-full px-3 py-2 text-sm text-primary bg-
|
|
484
|
+
value: I,
|
|
485
|
+
onChange: (e) => L(e.target.value),
|
|
486
|
+
placeholder: b("notifTemplates.subjectPlaceholder", "e.g., Welcome to {{appName}}, {{userName}}!"),
|
|
487
|
+
className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono"
|
|
487
488
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ h("p", {
|
|
489
490
|
className: "mt-1 text-[11px] text-tertiary",
|
|
490
|
-
children:
|
|
491
|
+
children: b("notifTemplates.subjectHint", "Used for email subject lines. Supports {{variables}}.")
|
|
491
492
|
})
|
|
492
493
|
] }),
|
|
493
|
-
|
|
494
|
+
W === "text" && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
|
|
494
495
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
495
496
|
children: [
|
|
496
|
-
|
|
497
|
+
b("notifTemplates.bodyTemplateLabel", "Body Template"),
|
|
497
498
|
" ",
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ h("span", {
|
|
499
500
|
className: "text-error",
|
|
500
501
|
children: "*"
|
|
501
502
|
})
|
|
502
503
|
]
|
|
503
|
-
}), /* @__PURE__ */
|
|
504
|
-
ref:
|
|
505
|
-
value:
|
|
506
|
-
onChange: (e) =>
|
|
504
|
+
}), /* @__PURE__ */ h("textarea", {
|
|
505
|
+
ref: K,
|
|
506
|
+
value: R,
|
|
507
|
+
onChange: (e) => z(e.target.value),
|
|
507
508
|
rows: 8,
|
|
508
|
-
placeholder:
|
|
509
|
-
className: "w-full px-3 py-2 text-sm text-primary bg-
|
|
509
|
+
placeholder: b("notifTemplates.bodyPlaceholder", "Hello {{userName}},\n\nWelcome to {{appName}}! Your account has been created.\n\nBest regards,\nThe Team"),
|
|
510
|
+
className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono resize-y"
|
|
510
511
|
})] }),
|
|
511
|
-
|
|
512
|
-
/* @__PURE__ */
|
|
512
|
+
W === "html" && /* @__PURE__ */ g("div", { children: [
|
|
513
|
+
/* @__PURE__ */ h("label", {
|
|
513
514
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
514
|
-
children:
|
|
515
|
+
children: b("notifTemplates.htmlTemplateLabel", "HTML Template")
|
|
515
516
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
-
ref:
|
|
518
|
-
value:
|
|
519
|
-
onChange: (e) =>
|
|
517
|
+
/* @__PURE__ */ h("textarea", {
|
|
518
|
+
ref: q,
|
|
519
|
+
value: B,
|
|
520
|
+
onChange: (e) => V(e.target.value),
|
|
520
521
|
rows: 12,
|
|
521
|
-
placeholder:
|
|
522
|
-
className: "w-full px-3 py-2 text-sm text-primary bg-
|
|
522
|
+
placeholder: b("notifTemplates.htmlPlaceholder", "<div style=\"font-family: sans-serif; max-width: 600px; margin: 0 auto;\">\n <h1>Welcome, {{userName}}!</h1>\n <p>Thank you for joining {{appName}}.</p>\n</div>"),
|
|
523
|
+
className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono resize-y"
|
|
523
524
|
}),
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ h("p", {
|
|
525
526
|
className: "mt-1 text-[11px] text-tertiary",
|
|
526
|
-
children:
|
|
527
|
+
children: b("notifTemplates.htmlHint", "HTML content for email. Falls back to text body if not provided.")
|
|
527
528
|
})
|
|
528
529
|
] }),
|
|
529
|
-
|
|
530
|
+
H.length > 0 && /* @__PURE__ */ g("div", {
|
|
530
531
|
className: "flex items-center gap-2 flex-wrap",
|
|
531
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ g("span", {
|
|
532
533
|
className: "text-[11px] text-tertiary font-medium",
|
|
533
|
-
children: [
|
|
534
|
-
}),
|
|
534
|
+
children: [b("notifTemplates.insert", "Insert"), ":"]
|
|
535
|
+
}), H.filter((e) => e.name.trim()).map((e, t) => /* @__PURE__ */ h("button", {
|
|
535
536
|
type: "button",
|
|
536
|
-
onClick: () =>
|
|
537
|
+
onClick: () => He(e.name),
|
|
537
538
|
className: "px-2 py-1 text-[11px] font-mono text-primary bg-bg-sunken border border-default rounded hover:bg-bg-sunken/80 transition-colors",
|
|
538
539
|
children: `{{${e.name}}}`
|
|
539
540
|
}, t))]
|
|
540
541
|
})
|
|
541
542
|
]
|
|
542
543
|
}),
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
-
className: "p-4 bg-
|
|
544
|
+
/* @__PURE__ */ g("section", {
|
|
545
|
+
className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
|
|
545
546
|
children: [
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ g("div", {
|
|
547
548
|
className: "flex items-center justify-between",
|
|
548
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ g("div", {
|
|
549
550
|
className: "flex items-center gap-2",
|
|
550
551
|
children: [
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ h(le, {
|
|
552
553
|
size: 16,
|
|
553
554
|
className: "text-accent-primary"
|
|
554
555
|
}),
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ h("h2", {
|
|
556
557
|
className: "text-sm font-semibold text-primary uppercase tracking-wider",
|
|
557
|
-
children:
|
|
558
|
+
children: b("notifTemplates.variables", "Variables")
|
|
558
559
|
}),
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ g("span", {
|
|
560
561
|
className: "text-[11px] text-tertiary",
|
|
561
562
|
children: [
|
|
562
563
|
"(",
|
|
563
|
-
|
|
564
|
+
H.length,
|
|
564
565
|
")"
|
|
565
566
|
]
|
|
566
567
|
})
|
|
567
568
|
]
|
|
568
|
-
}), /* @__PURE__ */
|
|
569
|
+
}), /* @__PURE__ */ g("button", {
|
|
569
570
|
type: "button",
|
|
570
|
-
onClick:
|
|
571
|
+
onClick: Be,
|
|
571
572
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-accent-primary bg-accent-primary/10 border border-accent-primary/20 rounded-lg hover:bg-accent-primary/20 transition-colors",
|
|
572
|
-
children: [/* @__PURE__ */
|
|
573
|
+
children: [/* @__PURE__ */ h(oe, { size: 12 }), b("notifTemplates.addVariable", "Add Variable")]
|
|
573
574
|
})]
|
|
574
575
|
}),
|
|
575
|
-
|
|
576
|
+
H.length === 0 && /* @__PURE__ */ g("p", {
|
|
576
577
|
className: "text-sm text-tertiary text-center py-4",
|
|
577
578
|
children: [
|
|
578
|
-
|
|
579
|
+
b("notifTemplates.noVariables", "No variables defined. Add variables to use dynamic content like"),
|
|
579
580
|
" ",
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ h("code", {
|
|
581
582
|
className: "px-1.5 py-0.5 bg-bg-sunken rounded text-[11px] font-mono",
|
|
582
583
|
children: "{{userName}}"
|
|
583
584
|
})
|
|
584
585
|
]
|
|
585
586
|
}),
|
|
586
|
-
|
|
587
|
+
H.map((e, t) => /* @__PURE__ */ g("div", {
|
|
587
588
|
className: "flex items-start gap-3 p-3 bg-bg-sunken/50 rounded-lg border border-default/50",
|
|
588
589
|
children: [
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ g("div", {
|
|
590
591
|
className: "flex-1",
|
|
591
|
-
children: [/* @__PURE__ */
|
|
592
|
+
children: [/* @__PURE__ */ h("label", {
|
|
592
593
|
className: "block text-[11px] font-medium text-tertiary mb-1",
|
|
593
|
-
children:
|
|
594
|
-
}), /* @__PURE__ */
|
|
594
|
+
children: b("notifTemplates.variableName", "Name")
|
|
595
|
+
}), /* @__PURE__ */ h("input", {
|
|
595
596
|
type: "text",
|
|
596
597
|
value: e.name,
|
|
597
598
|
onChange: (e) => Q(t, "name", e.target.value.replace(/[^a-zA-Z0-9_]/g, "")),
|
|
598
|
-
placeholder:
|
|
599
|
+
placeholder: b("notifTemplates.variableNamePlaceholder", "e.g., userName"),
|
|
599
600
|
className: "w-full px-2.5 py-1.5 text-xs text-primary bg-surface border border-default rounded-md focus:outline-none focus:ring-2 focus:ring-accent font-mono"
|
|
600
601
|
})]
|
|
601
602
|
}),
|
|
602
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ g("div", {
|
|
603
604
|
className: "w-28",
|
|
604
|
-
children: [/* @__PURE__ */
|
|
605
|
+
children: [/* @__PURE__ */ h("label", {
|
|
605
606
|
className: "block text-[11px] font-medium text-tertiary mb-1",
|
|
606
|
-
children:
|
|
607
|
-
}), /* @__PURE__ */
|
|
607
|
+
children: b("notifTemplates.variableType", "Type")
|
|
608
|
+
}), /* @__PURE__ */ h("select", {
|
|
608
609
|
value: e.type,
|
|
609
610
|
onChange: (e) => Q(t, "type", e.target.value),
|
|
610
611
|
className: "w-full px-2.5 py-1.5 text-xs text-primary bg-surface border border-default rounded-md focus:outline-none focus:ring-2 focus:ring-accent",
|
|
611
|
-
children: ge.map((e) => /* @__PURE__ */
|
|
612
|
+
children: ge.map((e) => /* @__PURE__ */ h("option", {
|
|
612
613
|
value: e.value,
|
|
613
|
-
children:
|
|
614
|
+
children: b(`notifTemplates.variableType.${e.value}`, e.label)
|
|
614
615
|
}, e.value))
|
|
615
616
|
})]
|
|
616
617
|
}),
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ g("div", {
|
|
618
619
|
className: "flex-1",
|
|
619
|
-
children: [/* @__PURE__ */
|
|
620
|
+
children: [/* @__PURE__ */ h("label", {
|
|
620
621
|
className: "block text-[11px] font-medium text-tertiary mb-1",
|
|
621
|
-
children:
|
|
622
|
-
}), /* @__PURE__ */
|
|
622
|
+
children: b("notifTemplates.sampleValue", "Sample Value")
|
|
623
|
+
}), /* @__PURE__ */ h("input", {
|
|
623
624
|
type: "text",
|
|
624
625
|
value: e.defaultValue,
|
|
625
626
|
onChange: (e) => Q(t, "defaultValue", e.target.value),
|
|
626
|
-
placeholder:
|
|
627
|
+
placeholder: b("notifTemplates.previewValue", "Preview value"),
|
|
627
628
|
className: "w-full px-2.5 py-1.5 text-xs text-primary bg-surface border border-default rounded-md focus:outline-none focus:ring-2 focus:ring-accent"
|
|
628
629
|
})]
|
|
629
630
|
}),
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ h("button", {
|
|
631
632
|
type: "button",
|
|
632
|
-
onClick: () =>
|
|
633
|
+
onClick: () => Ve(t),
|
|
633
634
|
className: "mt-5 p-1.5 text-tertiary hover:text-error rounded transition-colors",
|
|
634
|
-
children: /* @__PURE__ */
|
|
635
|
+
children: /* @__PURE__ */ h(se, { size: 14 })
|
|
635
636
|
})
|
|
636
637
|
]
|
|
637
638
|
}, t))
|
|
638
639
|
]
|
|
639
640
|
}),
|
|
640
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ g("div", {
|
|
641
642
|
className: "flex justify-end gap-3 lg:hidden pb-4",
|
|
642
|
-
children: [/* @__PURE__ */
|
|
643
|
+
children: [/* @__PURE__ */ h("button", {
|
|
643
644
|
type: "button",
|
|
644
|
-
onClick: () =>
|
|
645
|
+
onClick: () => y("..", { relative: "path" }),
|
|
645
646
|
className: "px-4 py-2 text-sm font-medium text-tertiary hover:text-primary border border-default rounded-lg transition-all duration-150",
|
|
646
|
-
children:
|
|
647
|
-
}), /* @__PURE__ */
|
|
647
|
+
children: b("notifTemplates.cancel", "Cancel")
|
|
648
|
+
}), /* @__PURE__ */ g("button", {
|
|
648
649
|
type: "submit",
|
|
649
650
|
disabled: $,
|
|
650
651
|
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 disabled:opacity-50",
|
|
651
|
-
children: [$ ? /* @__PURE__ */
|
|
652
|
+
children: [$ ? /* @__PURE__ */ h(p, {
|
|
652
653
|
size: 16,
|
|
653
654
|
className: "animate-spin"
|
|
654
|
-
}) : /* @__PURE__ */ m
|
|
655
|
+
}) : /* @__PURE__ */ h(m, { size: 16 }), S ? b("notifTemplates.saveChanges", "Save Changes") : b("notifTemplates.createTemplate", "Create Template")]
|
|
655
656
|
})]
|
|
656
657
|
})
|
|
657
658
|
]
|
|
658
659
|
})
|
|
659
|
-
}), /* @__PURE__ */
|
|
660
|
+
}), /* @__PURE__ */ g("div", {
|
|
660
661
|
className: "hidden lg:flex lg:flex-col lg:w-[440px] xl:w-[500px] bg-bg-sunken/30",
|
|
661
|
-
children: [/* @__PURE__ */
|
|
662
|
-
className: "flex items-center gap-2 px-4 py-3 border-b border-
|
|
662
|
+
children: [/* @__PURE__ */ g("div", {
|
|
663
|
+
className: "flex items-center gap-2 px-4 py-3 border-b border-border-seam bg-accent-wash shrink-0",
|
|
663
664
|
children: [
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ h(d, {
|
|
665
666
|
size: 16,
|
|
666
667
|
className: "text-primary"
|
|
667
668
|
}),
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ h("span", {
|
|
669
670
|
className: "text-sm font-semibold text-primary",
|
|
670
|
-
children:
|
|
671
|
+
children: b("notifTemplates.livePreview", "Live Preview")
|
|
671
672
|
}),
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ g("button", {
|
|
673
674
|
type: "button",
|
|
674
|
-
onClick: () =>
|
|
675
|
+
onClick: () => Pe((e) => !e),
|
|
675
676
|
className: `ml-auto flex items-center gap-1.5 px-2.5 py-1 text-[11px] font-medium rounded-md transition-all duration-150 ${Z ? "bg-accent-primary/10 text-accent-primary" : "bg-bg-sunken text-tertiary hover:text-primary"}`,
|
|
676
|
-
children: [
|
|
677
|
+
children: [h(Z ? d : f, { size: 12 }), Z ? b("notifTemplates.previewOn", "On") : b("notifTemplates.previewOffShort", "Off")]
|
|
677
678
|
})
|
|
678
679
|
]
|
|
679
|
-
}), Z ? /* @__PURE__ */
|
|
680
|
+
}), Z ? /* @__PURE__ */ g("div", {
|
|
680
681
|
className: "flex-1 flex flex-col overflow-hidden",
|
|
681
|
-
children: [/* @__PURE__ */
|
|
682
|
-
channel:
|
|
683
|
-
subject:
|
|
684
|
-
body:
|
|
685
|
-
html:
|
|
686
|
-
appName:
|
|
687
|
-
onChannelChange:
|
|
688
|
-
}), /* @__PURE__ */
|
|
682
|
+
children: [/* @__PURE__ */ h(te, {
|
|
683
|
+
channel: Fe,
|
|
684
|
+
subject: Le,
|
|
685
|
+
body: Re,
|
|
686
|
+
html: W === "html" && B ? ze : "",
|
|
687
|
+
appName: H.find((e) => e.name === "appName")?.defaultValue || "Burdenoff",
|
|
688
|
+
onChannelChange: Ie
|
|
689
|
+
}), /* @__PURE__ */ g("div", {
|
|
689
690
|
className: "shrink-0 border-t border-default overflow-y-auto max-h-[240px]",
|
|
690
|
-
children: [
|
|
691
|
+
children: [H.length > 0 && /* @__PURE__ */ g("div", {
|
|
691
692
|
className: "p-3 border-b border-default/50",
|
|
692
|
-
children: [/* @__PURE__ */
|
|
693
|
+
children: [/* @__PURE__ */ g("p", {
|
|
693
694
|
className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-2",
|
|
694
695
|
children: [
|
|
695
|
-
|
|
696
|
+
b("notifTemplates.variables", "Variables"),
|
|
696
697
|
" (",
|
|
697
|
-
|
|
698
|
+
H.length,
|
|
698
699
|
")"
|
|
699
700
|
]
|
|
700
|
-
}), /* @__PURE__ */
|
|
701
|
+
}), /* @__PURE__ */ h("div", {
|
|
701
702
|
className: "space-y-1.5",
|
|
702
|
-
children:
|
|
703
|
+
children: H.map((e, t) => /* @__PURE__ */ g("div", {
|
|
703
704
|
className: "flex items-center justify-between text-xs",
|
|
704
|
-
children: [/* @__PURE__ */
|
|
705
|
+
children: [/* @__PURE__ */ h("code", {
|
|
705
706
|
className: "text-primary font-mono",
|
|
706
707
|
children: `{{${e.name || "..."}}}`
|
|
707
|
-
}), /* @__PURE__ */
|
|
708
|
+
}), /* @__PURE__ */ g("span", {
|
|
708
709
|
className: "text-tertiary",
|
|
709
710
|
children: [
|
|
710
711
|
e.type,
|
|
711
712
|
" =",
|
|
712
713
|
" ",
|
|
713
|
-
e.defaultValue || /* @__PURE__ */
|
|
714
|
+
e.defaultValue || /* @__PURE__ */ h("em", { children: b("notifTemplates.noDefault", "no default") })
|
|
714
715
|
]
|
|
715
716
|
})]
|
|
716
717
|
}, t))
|
|
717
718
|
})]
|
|
718
|
-
}), S && C && /* @__PURE__ */
|
|
719
|
+
}), S && C && /* @__PURE__ */ g("div", {
|
|
719
720
|
className: "p-3",
|
|
720
|
-
children: [/* @__PURE__ */
|
|
721
|
+
children: [/* @__PURE__ */ h("p", {
|
|
721
722
|
className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-1",
|
|
722
|
-
children:
|
|
723
|
-
}), /* @__PURE__ */
|
|
723
|
+
children: b("notifTemplates.metadata", "Metadata")
|
|
724
|
+
}), /* @__PURE__ */ g("div", {
|
|
724
725
|
className: "text-[11px] text-tertiary space-y-1",
|
|
725
726
|
children: [
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ g("p", { children: [
|
|
728
|
+
/* @__PURE__ */ g("span", {
|
|
728
729
|
className: "font-medium",
|
|
729
|
-
children: [
|
|
730
|
+
children: [b("notifTemplates.metaId", "ID"), ":"]
|
|
730
731
|
}),
|
|
731
732
|
" ",
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ h("code", {
|
|
733
734
|
className: "text-[10px]",
|
|
734
735
|
children: C.id
|
|
735
736
|
})
|
|
736
737
|
] }),
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ g("p", { children: [
|
|
739
|
+
/* @__PURE__ */ g("span", {
|
|
739
740
|
className: "font-medium",
|
|
740
|
-
children: [
|
|
741
|
+
children: [b("notifTemplates.metaVersion", "Version"), ":"]
|
|
741
742
|
}),
|
|
742
743
|
" ",
|
|
743
744
|
C.version
|
|
744
745
|
] }),
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ g("p", { children: [
|
|
747
|
+
/* @__PURE__ */ g("span", {
|
|
747
748
|
className: "font-medium",
|
|
748
|
-
children: [
|
|
749
|
+
children: [b("notifTemplates.metaCreated", "Created"), ":"]
|
|
749
750
|
}),
|
|
750
751
|
" ",
|
|
751
|
-
new Date(C.createdAt).toLocaleString(
|
|
752
|
+
new Date(C.createdAt).toLocaleString(x || "en-US")
|
|
752
753
|
] }),
|
|
753
|
-
/* @__PURE__ */
|
|
754
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ g("p", { children: [
|
|
755
|
+
/* @__PURE__ */ g("span", {
|
|
755
756
|
className: "font-medium",
|
|
756
|
-
children: [
|
|
757
|
+
children: [b("notifTemplates.metaUpdated", "Updated"), ":"]
|
|
757
758
|
}),
|
|
758
759
|
" ",
|
|
759
|
-
new Date(C.updatedAt).toLocaleString(
|
|
760
|
+
new Date(C.updatedAt).toLocaleString(x || "en-US")
|
|
760
761
|
] }),
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ g("p", { children: [
|
|
763
|
+
/* @__PURE__ */ g("span", {
|
|
763
764
|
className: "font-medium",
|
|
764
|
-
children: [
|
|
765
|
+
children: [b("notifTemplates.metaEnabled", "Enabled"), ":"]
|
|
765
766
|
}),
|
|
766
767
|
" ",
|
|
767
|
-
C.enabled ?
|
|
768
|
+
C.enabled ? b("notifTemplates.yes", "Yes") : b("notifTemplates.no", "No")
|
|
768
769
|
] })
|
|
769
770
|
]
|
|
770
771
|
})]
|
|
771
772
|
})]
|
|
772
773
|
})]
|
|
773
|
-
}) : /* @__PURE__ */
|
|
774
|
+
}) : /* @__PURE__ */ h("div", {
|
|
774
775
|
className: "flex-1 flex items-center justify-center",
|
|
775
|
-
children: /* @__PURE__ */
|
|
776
|
+
children: /* @__PURE__ */ g("div", {
|
|
776
777
|
className: "text-center",
|
|
777
778
|
children: [
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ h(f, {
|
|
779
780
|
size: 32,
|
|
780
781
|
className: "mx-auto text-tertiary mb-3"
|
|
781
782
|
}),
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ h("p", {
|
|
783
784
|
className: "text-sm text-tertiary",
|
|
784
|
-
children:
|
|
785
|
+
children: b("notifTemplates.previewOff", "Preview is off")
|
|
785
786
|
}),
|
|
786
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ h("button", {
|
|
787
788
|
type: "button",
|
|
788
|
-
onClick: () =>
|
|
789
|
+
onClick: () => Pe(!0),
|
|
789
790
|
className: "mt-2 text-xs text-accent-primary hover:underline",
|
|
790
|
-
children:
|
|
791
|
+
children: b("notifTemplates.turnOn", "Turn on")
|
|
791
792
|
})
|
|
792
793
|
]
|
|
793
794
|
})
|
|
@@ -798,6 +799,6 @@ function v() {
|
|
|
798
799
|
});
|
|
799
800
|
}
|
|
800
801
|
//#endregion
|
|
801
|
-
export {
|
|
802
|
+
export { y as TemplateEditorPage };
|
|
802
803
|
|
|
803
804
|
//# sourceMappingURL=TemplateEditorPage.js.map
|