@burdenoff/microfe-notification 2026.1029.2 → 2026.1113.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/AdminNotificationRoot.d.ts +33 -0
- package/dist/AdminNotificationRoot.js +9 -6
- package/dist/AdminNotificationRoot.js.map +1 -1
- package/dist/AdminNotificationRoutes.d.ts +1 -0
- package/dist/AdminNotificationRoutes.js +22 -23
- package/dist/AdminNotificationRoutes.js.map +1 -1
- package/dist/NotificationRoot.d.ts +29 -0
- package/dist/NotificationRoot.js +9 -6
- package/dist/NotificationRoot.js.map +1 -1
- package/dist/NotificationRoutes.d.ts +18 -0
- package/dist/NotificationRoutes.js +109 -38
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/UserNotificationRoot.d.ts +32 -0
- package/dist/UserNotificationRoot.js +9 -6
- package/dist/UserNotificationRoot.js.map +1 -1
- package/dist/UserNotificationRoutes.d.ts +16 -0
- package/dist/UserNotificationRoutes.js +9 -10
- package/dist/UserNotificationRoutes.js.map +1 -1
- package/dist/components/ConfirmDeleteDialog.d.ts +17 -0
- package/dist/components/ConfirmDeleteDialog.js +22 -0
- package/dist/components/ConfirmDeleteDialog.js.map +1 -0
- package/dist/components/FeatureDisabledPage.d.ts +6 -0
- package/dist/components/FeatureDisabledPage.js +1 -2
- package/dist/components/FeatureDisabledPage.js.map +1 -1
- package/dist/components/NotificationBell.d.ts +13 -0
- package/dist/components/NotificationBell.js +6 -7
- package/dist/components/NotificationBell.js.map +1 -1
- package/dist/components/NotificationCard.d.ts +27 -0
- package/dist/components/NotificationCard.js +106 -76
- package/dist/components/NotificationCard.js.map +1 -1
- package/dist/components/NotificationPanel.d.ts +10 -0
- package/dist/components/NotificationPanel.js +5 -6
- package/dist/components/NotificationPanel.js.map +1 -1
- package/dist/components/RecipientSelector.d.ts +32 -0
- package/dist/components/RecipientSelector.js +2 -3
- package/dist/components/RecipientSelector.js.map +1 -1
- package/dist/components/TemplatePreview.d.ts +21 -0
- package/dist/components/TemplatePreview.js +3 -4
- package/dist/components/TemplatePreview.js.map +1 -1
- package/dist/components/VariableInserter.d.ts +11 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +4 -3
- package/dist/constants/permissions.d.ts +23 -0
- package/dist/constants/permissions.js +1 -2
- package/dist/constants/permissions.js.map +1 -1
- package/dist/dev/main.d.ts +0 -0
- package/dist/generated/global-operations.d.ts +2119 -0
- package/dist/generated/global-operations.js +80 -69
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +23507 -0
- package/dist/generated/wspace-operations.d.ts +4 -0
- package/dist/generated/wspace-types.d.ts +57831 -0
- package/dist/graphql/global-client.d.ts +32 -0
- package/dist/graphql/global-client.js +23 -30
- package/dist/graphql/global-client.js.map +1 -1
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +7 -6
- package/dist/hooks/useNotificationAdmin.d.ts +46 -0
- package/dist/hooks/useNotificationAdmin.js +18 -17
- package/dist/hooks/useNotificationAdmin.js.map +1 -1
- package/dist/hooks/useNotificationAnalytics.d.ts +65 -0
- package/dist/hooks/useNotificationAnalytics.js +1 -2
- package/dist/hooks/useNotificationAnalytics.js.map +1 -1
- package/dist/hooks/useNotificationPreferences.d.ts +10 -0
- package/dist/hooks/useNotificationPreferences.js +7 -7
- package/dist/hooks/useNotificationPreferences.js.map +1 -1
- package/dist/hooks/useNotificationTemplates.d.ts +131 -0
- package/dist/hooks/useNotificationTemplates.js +1 -2
- package/dist/hooks/useNotificationTemplates.js.map +1 -1
- package/dist/hooks/useNotificationTopics.d.ts +35 -0
- package/dist/hooks/useNotificationTopics.js +22 -22
- package/dist/hooks/useNotificationTopics.js.map +1 -1
- package/dist/hooks/useNotifications.d.ts +39 -0
- package/dist/hooks/useNotifications.js +6 -4
- package/dist/hooks/useNotifications.js.map +1 -1
- package/dist/hooks/usePreferenceToggles.d.ts +27 -0
- package/dist/hooks/usePreferenceToggles.js +84 -0
- package/dist/hooks/usePreferenceToggles.js.map +1 -0
- package/dist/hooks/useSendNotification.d.ts +158 -0
- package/dist/hooks/useSendNotification.js +12 -10
- package/dist/hooks/useSendNotification.js.map +1 -1
- package/dist/hooks/useUserSearch.d.ts +26 -0
- package/dist/hooks/useUserSearch.js +8 -10
- package/dist/hooks/useUserSearch.js.map +1 -1
- package/dist/index.d.ts +36 -0
- package/dist/index.js +8 -8
- package/dist/navigation-v2/AdminPageV2.d.ts +14 -0
- package/dist/navigation-v2/AdminPageV2.js +51 -0
- package/dist/navigation-v2/AdminPageV2.js.map +1 -0
- package/dist/navigation-v2/AdminToolsMenu.d.ts +6 -0
- package/dist/navigation-v2/AdminToolsMenu.js +32 -0
- package/dist/navigation-v2/AdminToolsMenu.js.map +1 -0
- package/dist/navigation-v2/BackToNotifications.d.ts +2 -0
- package/dist/navigation-v2/BackToNotifications.js +20 -0
- package/dist/navigation-v2/BackToNotifications.js.map +1 -0
- package/dist/navigation-v2/FilterControls.d.ts +25 -0
- package/dist/navigation-v2/FilterControls.js +64 -0
- package/dist/navigation-v2/FilterControls.js.map +1 -0
- package/dist/navigation-v2/NotificationArchivedV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationArchivedV2.js +174 -0
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -0
- package/dist/navigation-v2/NotificationInboxV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationInboxV2.js +309 -0
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -0
- package/dist/navigation-v2/NotificationSettingsV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationSettingsV2.js +203 -0
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -0
- package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -0
- package/dist/navigation-v2/NotificationsV2Landing.js +37 -0
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -0
- package/dist/navigation-v2/__tests__/uiMocks.d.ts +71 -0
- package/dist/navigation-v2/inboxFilters.d.ts +8 -0
- package/dist/navigation-v2/inboxFilters.js +10 -0
- package/dist/navigation-v2/inboxFilters.js.map +1 -0
- package/dist/navigation-v2/paths.d.ts +24 -0
- package/dist/navigation-v2/paths.js +31 -0
- package/dist/navigation-v2/paths.js.map +1 -0
- package/dist/navigation-v2/settingsOptions.d.ts +12 -0
- package/dist/navigation-v2/settingsOptions.js +58 -0
- package/dist/navigation-v2/settingsOptions.js.map +1 -0
- package/dist/navigation-v2/useAdminTools.d.ts +22 -0
- package/dist/navigation-v2/useAdminTools.js +76 -0
- package/dist/navigation-v2/useAdminTools.js.map +1 -0
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
- package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +9 -10
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/version.js +2 -3
- package/dist/node_modules/@apollo/client/version.js.map +1 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
- package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
- package/dist/node_modules/@wry/trie/lib/index.js +2 -3
- package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/client.js +76 -69
- package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
- package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/pages/CreateNotificationPage.d.ts +5 -0
- package/dist/pages/CreateNotificationPage.js +591 -573
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.d.ts +8 -0
- package/dist/pages/NotificationCenterPage.js +87 -83
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.d.ts +2 -0
- package/dist/pages/NotificationHistoryAdminPage.js +7 -8
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.d.ts +6 -0
- package/dist/pages/NotificationHistoryPage.js +59 -55
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationLandingPage.d.ts +10 -0
- package/dist/pages/NotificationLandingPage.js +5 -6
- package/dist/pages/NotificationLandingPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.d.ts +5 -0
- package/dist/pages/NotificationPreferencesPage.js +97 -159
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.d.ts +7 -0
- package/dist/pages/NotificationTemplatesPage.js +192 -172
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.d.ts +1 -0
- package/dist/pages/NotificationTopicsPage.js +126 -112
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.d.ts +12 -0
- package/dist/pages/TemplateEditorPage.js +381 -341
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/providers/NotificationProvider.d.ts +11 -0
- package/dist/providers/NotificationProvider.js +7 -7
- package/dist/providers/NotificationProvider.js.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +13 -0
- package/dist/shared/hooks/useTr.js +1 -2
- package/dist/shared/hooks/useTr.js.map +1 -1
- package/dist/store/notificationStore.d.ts +30 -0
- package/dist/store/notificationStore.js +1 -2
- package/dist/store/notificationStore.js.map +1 -1
- package/dist/test/happydom.d.ts +1 -0
- package/dist/translations/en.d.ts +468 -0
- package/dist/types/index.d.ts +257 -0
- package/dist/utils/inAppNavigation.d.ts +37 -0
- package/dist/utils/inAppNavigation.js +2 -3
- package/dist/utils/inAppNavigation.js.map +1 -1
- package/dist/utils/index.d.ts +68 -0
- package/dist/utils/index.js +1 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +2 -0
- package/dist/utils/nativeBridge.js +1 -2
- package/dist/utils/notificationHistoryExport.d.ts +12 -0
- package/dist/utils/notificationHistoryExport.js +1 -2
- package/dist/utils/notificationHistoryExport.js.map +1 -1
- package/package.json +67 -49
- package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useNavigationV2 as e } from "../navigation-v2/paths.js";
|
|
2
2
|
import { isPermissionError as t } from "../utils/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { useNotificationTemplate as n, useNotificationTemplates as r } from "../hooks/useNotificationTemplates.js";
|
|
4
|
+
import { useNotificationAnalytics as i } from "../hooks/useNotificationAnalytics.js";
|
|
5
|
+
import { TemplatePreview as ee } from "../components/TemplatePreview.js";
|
|
6
|
+
import { NOTIFICATION_PERMISSIONS as te } from "../constants/permissions.js";
|
|
7
|
+
import { useTr as ne } from "../shared/hooks/useTr.js";
|
|
8
|
+
import { useCallback as a, useEffect as o, useMemo as s, useRef as re, useState as c } from "react";
|
|
9
|
+
import { useGlobalUi as ie, usePermissions as ae } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
10
|
+
import { AlertCircle as l, ArrowLeft as oe, Code as se, Eye as u, EyeOff as d, Loader2 as f, Plus as ce, Save as p, Trash2 as le, Type as m, Variable as ue } from "lucide-react";
|
|
10
11
|
import { useNavigate as de, useParams as fe } from "react-router";
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { useI18n as
|
|
14
|
-
|
|
15
|
-
var
|
|
12
|
+
import { Fragment as pe, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
13
|
+
import { Button as me, NextSteps as he, OptionalFields as ge, PagePurpose as _e } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
import { useI18n as ve } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
15
|
+
// src/pages/TemplateEditorPage.tsx
|
|
16
|
+
var ye = [
|
|
16
17
|
{
|
|
17
18
|
value: "TRANSACTIONAL",
|
|
18
19
|
label: "Transactional",
|
|
@@ -33,7 +34,7 @@ var _e = [
|
|
|
33
34
|
label: "Alert",
|
|
34
35
|
description: "Urgent alerts and warnings"
|
|
35
36
|
}
|
|
36
|
-
],
|
|
37
|
+
], be = [
|
|
37
38
|
{
|
|
38
39
|
value: "EMAIL",
|
|
39
40
|
label: "Email"
|
|
@@ -70,7 +71,7 @@ var _e = [
|
|
|
70
71
|
value: "TELEGRAM",
|
|
71
72
|
label: "Telegram"
|
|
72
73
|
}
|
|
73
|
-
],
|
|
74
|
+
], xe = [
|
|
74
75
|
{
|
|
75
76
|
value: "string",
|
|
76
77
|
label: "String"
|
|
@@ -88,10 +89,10 @@ var _e = [
|
|
|
88
89
|
label: "Date"
|
|
89
90
|
}
|
|
90
91
|
];
|
|
91
|
-
function
|
|
92
|
+
function Se(e) {
|
|
92
93
|
return e.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
+
function _(e, t, n) {
|
|
95
96
|
return e ? e.replace(/\{\{(\w+)\}\}/g, (e, r) => {
|
|
96
97
|
let i = t.find((e) => e.name === r);
|
|
97
98
|
if (!i) return e;
|
|
@@ -104,7 +105,7 @@ function g(e, t, n) {
|
|
|
104
105
|
}
|
|
105
106
|
}) : "";
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function Ce(e) {
|
|
108
109
|
let t = {};
|
|
109
110
|
for (let n of e) {
|
|
110
111
|
let e = n.name.trim();
|
|
@@ -116,51 +117,60 @@ function _(e) {
|
|
|
116
117
|
}
|
|
117
118
|
return t;
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
-
return e
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
function v(e) {
|
|
121
|
+
return typeof e == "object" && !!e;
|
|
122
|
+
}
|
|
123
|
+
function y(e) {
|
|
124
|
+
return e ? String(e) : "";
|
|
125
|
+
}
|
|
126
|
+
function b(e) {
|
|
127
|
+
return e === "number" || e === "boolean" || e === "date" ? e : "string";
|
|
128
|
+
}
|
|
129
|
+
function we(e) {
|
|
130
|
+
return e ? Array.isArray(e) ? e.filter(v).map((e) => ({
|
|
131
|
+
name: typeof e.name == "string" ? e.name : "",
|
|
132
|
+
type: b(e.type),
|
|
133
|
+
defaultValue: y(e.defaultValue)
|
|
134
|
+
})) : v(e) ? Object.entries(e).map(([e, t]) => ({
|
|
125
135
|
name: e,
|
|
126
|
-
type: t
|
|
127
|
-
defaultValue: t
|
|
136
|
+
type: b(v(t) ? t.type : void 0),
|
|
137
|
+
defaultValue: y(v(t) ? t.defaultValue : void 0)
|
|
128
138
|
})) : [] : [];
|
|
129
139
|
}
|
|
130
|
-
function
|
|
131
|
-
let v = de(), y =
|
|
140
|
+
function x() {
|
|
141
|
+
let v = de(), y = ne(), { locale: b } = ve(), { templateId: x } = fe(), S = !!x, { hasPermission: Te, isLoading: Ee, refreshPermissions: De } = ae(), { showToast: Oe } = ie(), { createTemplate: ke, updateTemplate: Ae, isCreating: je, isUpdating: Me } = r(), { trackTemplateSaved: C } = i(), { template: w, isLoading: Ne, error: T } = n(S ? x : void 0), [E, D] = c(""), [O, k] = c(""), [A, j] = c(!1), M = e(), [Pe, Fe] = c(!1), [N, P] = c(""), [F, I] = c("TRANSACTIONAL"), [L, Ie] = c(""), [Le, Re] = c("en"), [R, ze] = c(""), [z, B] = c(""), [V, H] = c(""), [U, W] = c([]), [G, K] = c("text"), Be = re(null), Ve = re(null), [He, q] = c(null), [Ue, J] = c(null), [Y, X] = c(!0), [We, Ge] = c("email");
|
|
132
142
|
o(() => {
|
|
133
|
-
w && (D(w.name), k(w.slug),
|
|
143
|
+
w && (D(w.name), k(w.slug), j(!0), P(w.description || ""), I(w.type), Re(w.locale || "en"), ze(w.subject || ""), B(w.bodyTemplate || ""), H(w.htmlTemplate || ""), W(we(w.variables)), w.htmlTemplate && K("html"));
|
|
134
144
|
}, [w]), o(() => {
|
|
135
|
-
!
|
|
136
|
-
}, [E,
|
|
137
|
-
let
|
|
145
|
+
!A && E && k(Se(E));
|
|
146
|
+
}, [E, A]);
|
|
147
|
+
let Ke = s(() => _(R, U, b), [
|
|
138
148
|
b,
|
|
139
|
-
|
|
149
|
+
R,
|
|
140
150
|
U
|
|
141
|
-
]),
|
|
151
|
+
]), qe = s(() => _(z, U, b), [
|
|
142
152
|
z,
|
|
143
153
|
b,
|
|
144
154
|
U
|
|
145
|
-
]),
|
|
155
|
+
]), Je = s(() => _(V, U, b), [
|
|
146
156
|
b,
|
|
147
157
|
V,
|
|
148
158
|
U
|
|
149
|
-
]),
|
|
159
|
+
]), Ye = a(() => {
|
|
150
160
|
W((e) => [...e, {
|
|
151
161
|
name: "",
|
|
152
162
|
type: "string",
|
|
153
163
|
defaultValue: ""
|
|
154
164
|
}]);
|
|
155
|
-
}, []),
|
|
165
|
+
}, []), Xe = a((e) => {
|
|
156
166
|
W((t) => t.filter((t, n) => n !== e));
|
|
157
167
|
}, []), Z = a((e, t, n) => {
|
|
158
168
|
W((r) => r.map((r, i) => i === e ? {
|
|
159
169
|
...r,
|
|
160
170
|
[t]: n
|
|
161
171
|
} : r));
|
|
162
|
-
}, []),
|
|
163
|
-
let t = `{{${e}}}`, n = G === "html", r = n ?
|
|
172
|
+
}, []), Ze = a((e) => {
|
|
173
|
+
let t = `{{${e}}}`, n = G === "html", r = n ? Ve.current : Be.current, i = n ? H : B;
|
|
164
174
|
if (r) {
|
|
165
175
|
let e = r.selectionStart, n = r.selectionEnd;
|
|
166
176
|
i((r) => r.substring(0, e) + t + r.substring(n)), requestAnimationFrame(() => {
|
|
@@ -187,165 +197,249 @@ function v() {
|
|
|
187
197
|
return;
|
|
188
198
|
}
|
|
189
199
|
let n = U.map((e) => e.name.trim()), r = n.filter((e, t) => n.indexOf(e) !== t);
|
|
190
|
-
if (r.length > 0) {
|
|
191
|
-
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
try {
|
|
200
|
+
if (r.length > 0) q(`${y("notifTemplates.duplicateVariableName", "Duplicate variable name")}: ${r[0]}`);
|
|
201
|
+
else try {
|
|
195
202
|
if (S && w) {
|
|
196
203
|
let e = {
|
|
197
204
|
name: E.trim(),
|
|
198
|
-
description:
|
|
199
|
-
subject:
|
|
205
|
+
description: N.trim() || void 0,
|
|
206
|
+
subject: R.trim() || void 0,
|
|
200
207
|
bodyTemplate: z.trim(),
|
|
201
208
|
htmlTemplate: V.trim() || void 0,
|
|
202
|
-
variables:
|
|
209
|
+
variables: Ce(U)
|
|
203
210
|
};
|
|
204
|
-
await
|
|
211
|
+
await Ae(w.id, e), C({
|
|
205
212
|
action: "update",
|
|
206
|
-
channel:
|
|
213
|
+
channel: L || void 0,
|
|
207
214
|
type: w.type,
|
|
208
215
|
variableCount: U.length,
|
|
209
216
|
hasHtml: !!V.trim()
|
|
210
217
|
}), J(y("notifTemplates.updateSuccess", "Template updated successfully"));
|
|
211
|
-
} else
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
218
|
+
} else {
|
|
219
|
+
let e = {
|
|
220
|
+
slug: O.trim(),
|
|
221
|
+
name: E.trim(),
|
|
222
|
+
description: N.trim() || void 0,
|
|
223
|
+
type: F,
|
|
224
|
+
locale: Le || "en",
|
|
225
|
+
subject: R.trim() || void 0,
|
|
226
|
+
bodyTemplate: z.trim(),
|
|
227
|
+
htmlTemplate: V.trim() || void 0,
|
|
228
|
+
variables: Ce(U),
|
|
229
|
+
...L ? { channel: L } : {}
|
|
230
|
+
};
|
|
231
|
+
await ke(e), C({
|
|
232
|
+
action: "create",
|
|
233
|
+
channel: L || void 0,
|
|
234
|
+
type: F,
|
|
235
|
+
variableCount: U.length,
|
|
236
|
+
hasHtml: !!V.trim()
|
|
237
|
+
}), J(y("notifTemplates.createSuccess", "Template created successfully")), setTimeout(() => v("..", { relative: "path" }), 1200);
|
|
238
|
+
}
|
|
229
239
|
} catch (e) {
|
|
230
240
|
if (t(e)) {
|
|
231
|
-
|
|
241
|
+
Oe(y("notifTemplates.permissionDeniedOnSave", "You don't have permission to save this template. Refreshing access…"), "warning"), De().catch((e) => console.warn("[permissions] refresh failed after template save denial:", e));
|
|
232
242
|
return;
|
|
233
243
|
}
|
|
234
|
-
|
|
244
|
+
let n = e instanceof Error ? e.message : y("notifTemplates.saveFailed", "Failed to save template");
|
|
245
|
+
q(n);
|
|
235
246
|
}
|
|
236
247
|
};
|
|
237
|
-
if (
|
|
248
|
+
if (Ee) return /* @__PURE__ */ h("div", {
|
|
238
249
|
className: "flex h-64 items-center justify-center",
|
|
239
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ h("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
240
251
|
});
|
|
241
|
-
if (!
|
|
252
|
+
if (!Te(S ? te.TEMPLATE_UPDATE : te.TEMPLATE_CREATE)) return /* @__PURE__ */ h("div", {
|
|
242
253
|
className: "p-8 text-center text-text-secondary",
|
|
243
254
|
children: S ? y("notifTemplates.noPermissionEdit", "You don't have permission to edit notification templates.") : y("notifTemplates.noPermissionCreate", "You don't have permission to create notification templates.")
|
|
244
255
|
});
|
|
245
|
-
if (S &&
|
|
256
|
+
if (S && Ne) return /* @__PURE__ */ g("div", {
|
|
246
257
|
className: "flex flex-col items-center justify-center h-64 gap-3",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ h(f, {
|
|
248
259
|
size: 28,
|
|
249
260
|
className: "animate-spin text-accent-primary"
|
|
250
|
-
}), /* @__PURE__ */
|
|
261
|
+
}), /* @__PURE__ */ h("p", {
|
|
251
262
|
className: "text-sm text-secondary",
|
|
252
263
|
children: y("notifTemplates.loadingTemplate", "Loading template...")
|
|
253
264
|
})]
|
|
254
265
|
});
|
|
255
|
-
if (S && T) return /* @__PURE__ */
|
|
266
|
+
if (S && T) return /* @__PURE__ */ g("div", {
|
|
256
267
|
className: "flex flex-col items-center justify-center h-64 gap-4",
|
|
257
268
|
children: [
|
|
258
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ h(l, {
|
|
259
270
|
size: 28,
|
|
260
271
|
className: "text-error"
|
|
261
272
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ h("p", {
|
|
263
274
|
className: "text-sm text-error",
|
|
264
275
|
children: T
|
|
265
276
|
}),
|
|
266
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ h("button", {
|
|
267
278
|
onClick: () => v("..", { relative: "path" }),
|
|
268
279
|
className: "px-4 py-2 text-sm text-secondary hover:text-primary border border-default rounded-lg transition-all",
|
|
269
280
|
children: y("notifTemplates.backToTemplates", "Back to Templates")
|
|
270
281
|
})
|
|
271
282
|
]
|
|
272
283
|
});
|
|
273
|
-
let $ =
|
|
274
|
-
|
|
284
|
+
let $ = je || Me, Qe = /* @__PURE__ */ h(pe, { children: /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
285
|
+
className: "block text-sm font-medium text-primary mb-1.5",
|
|
286
|
+
children: y("notifTemplates.descriptionLabel", "Description")
|
|
287
|
+
}), /* @__PURE__ */ h("textarea", {
|
|
288
|
+
value: N,
|
|
289
|
+
onChange: (e) => P(e.target.value),
|
|
290
|
+
rows: 2,
|
|
291
|
+
placeholder: y("notifTemplates.descriptionPlaceholder", "Brief description of this template"),
|
|
292
|
+
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"
|
|
293
|
+
})] }) }), $e = /* @__PURE__ */ g(pe, { children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
294
|
+
className: "block text-sm font-medium text-primary mb-1.5",
|
|
295
|
+
children: y("notifTemplates.defaultChannel", "Default Channel")
|
|
296
|
+
}), /* @__PURE__ */ g("select", {
|
|
297
|
+
"aria-label": y("notifTemplates.defaultChannel", "Default Channel"),
|
|
298
|
+
value: L,
|
|
299
|
+
onChange: (e) => Ie(e.target.value),
|
|
300
|
+
disabled: S,
|
|
301
|
+
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
302
|
+
children: [/* @__PURE__ */ h("option", {
|
|
303
|
+
value: "",
|
|
304
|
+
children: y("notifTemplates.none", "None")
|
|
305
|
+
}), be.map((e) => /* @__PURE__ */ h("option", {
|
|
306
|
+
value: e.value,
|
|
307
|
+
children: y(`notifTemplates.channel.${e.value}`, e.label)
|
|
308
|
+
}, e.value))]
|
|
309
|
+
})] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
310
|
+
className: "block text-sm font-medium text-primary mb-1.5",
|
|
311
|
+
children: y("notifTemplates.localeLabel", "Locale")
|
|
312
|
+
}), /* @__PURE__ */ h("input", {
|
|
313
|
+
type: "text",
|
|
314
|
+
"aria-label": y("notifTemplates.localeLabel", "Locale"),
|
|
315
|
+
value: Le,
|
|
316
|
+
onChange: (e) => Re(e.target.value),
|
|
317
|
+
placeholder: "en",
|
|
318
|
+
disabled: S,
|
|
319
|
+
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"
|
|
320
|
+
})] })] }), et = w ? /* @__PURE__ */ g("div", {
|
|
321
|
+
className: "text-[11px] text-tertiary space-y-1",
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ g("p", { children: [
|
|
324
|
+
/* @__PURE__ */ g("span", {
|
|
325
|
+
className: "font-medium",
|
|
326
|
+
children: [y("notifTemplates.metaId", "ID"), ":"]
|
|
327
|
+
}),
|
|
328
|
+
" ",
|
|
329
|
+
/* @__PURE__ */ h("code", {
|
|
330
|
+
className: "text-[10px]",
|
|
331
|
+
children: w.id
|
|
332
|
+
})
|
|
333
|
+
] }),
|
|
334
|
+
/* @__PURE__ */ g("p", { children: [
|
|
335
|
+
/* @__PURE__ */ g("span", {
|
|
336
|
+
className: "font-medium",
|
|
337
|
+
children: [y("notifTemplates.metaVersion", "Version"), ":"]
|
|
338
|
+
}),
|
|
339
|
+
" ",
|
|
340
|
+
w.version
|
|
341
|
+
] }),
|
|
342
|
+
/* @__PURE__ */ g("p", { children: [
|
|
343
|
+
/* @__PURE__ */ g("span", {
|
|
344
|
+
className: "font-medium",
|
|
345
|
+
children: [y("notifTemplates.metaCreated", "Created"), ":"]
|
|
346
|
+
}),
|
|
347
|
+
" ",
|
|
348
|
+
new Date(w.createdAt).toLocaleString(b || "en-US")
|
|
349
|
+
] }),
|
|
350
|
+
/* @__PURE__ */ g("p", { children: [
|
|
351
|
+
/* @__PURE__ */ g("span", {
|
|
352
|
+
className: "font-medium",
|
|
353
|
+
children: [y("notifTemplates.metaUpdated", "Updated"), ":"]
|
|
354
|
+
}),
|
|
355
|
+
" ",
|
|
356
|
+
new Date(w.updatedAt).toLocaleString(b || "en-US")
|
|
357
|
+
] }),
|
|
358
|
+
/* @__PURE__ */ g("p", { children: [
|
|
359
|
+
/* @__PURE__ */ g("span", {
|
|
360
|
+
className: "font-medium",
|
|
361
|
+
children: [y("notifTemplates.metaEnabled", "Enabled"), ":"]
|
|
362
|
+
}),
|
|
363
|
+
" ",
|
|
364
|
+
w.enabled ? y("notifTemplates.yes", "Yes") : y("notifTemplates.no", "No")
|
|
365
|
+
] })
|
|
366
|
+
]
|
|
367
|
+
}) : null;
|
|
368
|
+
return /* @__PURE__ */ g("div", {
|
|
275
369
|
className: "animate-in fade-in duration-200 h-full flex flex-col",
|
|
276
370
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ g("div", {
|
|
278
372
|
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__ */
|
|
373
|
+
children: [/* @__PURE__ */ g("div", {
|
|
280
374
|
className: "flex items-center gap-3",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ h("button", {
|
|
282
376
|
onClick: () => v("..", { relative: "path" }),
|
|
283
377
|
className: "p-2 hover:bg-bg-sunken rounded-lg transition-all duration-150",
|
|
284
|
-
children: /* @__PURE__ */
|
|
378
|
+
children: /* @__PURE__ */ h(oe, {
|
|
285
379
|
size: 20,
|
|
286
380
|
className: "text-primary"
|
|
287
381
|
})
|
|
288
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
289
383
|
className: "text-lg font-bold text-primary",
|
|
290
384
|
children: S ? y("notifTemplates.editTemplate", "Edit Template") : y("notifTemplates.createTemplate", "Create Template")
|
|
291
|
-
}), S && w && /* @__PURE__ */
|
|
385
|
+
}), S && w && /* @__PURE__ */ g("p", {
|
|
292
386
|
className: "text-xs text-tertiary",
|
|
293
387
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ h("code", { children: w.slug }),
|
|
295
389
|
" · v",
|
|
296
390
|
w.version
|
|
297
391
|
]
|
|
298
392
|
})] })]
|
|
299
|
-
}), /* @__PURE__ */
|
|
393
|
+
}), /* @__PURE__ */ g(me, {
|
|
300
394
|
onClick: Q,
|
|
301
395
|
disabled: $,
|
|
302
396
|
className: "gap-2",
|
|
303
|
-
children: [$ ? /* @__PURE__ */
|
|
397
|
+
children: [$ ? /* @__PURE__ */ h(f, {
|
|
304
398
|
size: 16,
|
|
305
399
|
className: "animate-spin"
|
|
306
|
-
}) : /* @__PURE__ */
|
|
400
|
+
}) : /* @__PURE__ */ h(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
|
|
307
401
|
})]
|
|
308
402
|
}),
|
|
309
|
-
|
|
403
|
+
He && /* @__PURE__ */ g("div", {
|
|
310
404
|
className: "mx-3 sm:mx-6 mt-3 flex items-center gap-3 p-3 bg-error/10 border border-error/30 rounded-lg",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
405
|
+
children: [/* @__PURE__ */ h(l, {
|
|
312
406
|
size: 16,
|
|
313
407
|
className: "text-error shrink-0"
|
|
314
|
-
}), /* @__PURE__ */
|
|
408
|
+
}), /* @__PURE__ */ h("p", {
|
|
315
409
|
className: "text-sm text-error",
|
|
316
|
-
children:
|
|
410
|
+
children: He
|
|
317
411
|
})]
|
|
318
412
|
}),
|
|
319
|
-
|
|
413
|
+
Ue && /* @__PURE__ */ g("div", {
|
|
320
414
|
className: "mx-3 sm:mx-6 mt-3 flex items-center gap-3 p-3 bg-success/10 border border-success/30 rounded-lg",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
415
|
+
children: [/* @__PURE__ */ h(p, {
|
|
322
416
|
size: 16,
|
|
323
417
|
className: "text-success shrink-0"
|
|
324
|
-
}), /* @__PURE__ */
|
|
418
|
+
}), /* @__PURE__ */ h("p", {
|
|
325
419
|
className: "text-sm text-success",
|
|
326
|
-
children:
|
|
420
|
+
children: Ue
|
|
327
421
|
})]
|
|
328
422
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ g("div", {
|
|
330
424
|
className: "px-3 sm:px-6 pt-3 space-y-3 shrink-0",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
332
|
-
icon: /* @__PURE__ */ m
|
|
425
|
+
children: [/* @__PURE__ */ h(_e, {
|
|
426
|
+
icon: /* @__PURE__ */ h(m, { size: 16 }),
|
|
333
427
|
children: y("notifTemplates.editorPurpose", S ? "Refine this template’s content and {{variables}} placeholders. Switch the live preview between email, SMS and push to see how the same template renders per channel, then save a new version — existing scheduled sends keep using the version they were created with." : "Build a reusable message blueprint: write the subject and body with {{variables}} that get filled in at send time, define each variable with a type and default, and watch the live preview render it per channel. Once saved, anyone can pick this template from the Send page.")
|
|
334
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ h(he, {
|
|
335
429
|
storageKey: "notification-template-editor",
|
|
336
430
|
steps: [
|
|
337
431
|
{
|
|
338
432
|
id: "add-variable",
|
|
339
433
|
label: y("notifTemplates.nextAddVarLabel", "Add a variable"),
|
|
340
434
|
description: y("notifTemplates.nextAddVarDesc", "Define a {{placeholder}} (e.g. userName) so the same template personalises every send."),
|
|
341
|
-
onClick:
|
|
435
|
+
onClick: Ye
|
|
342
436
|
},
|
|
343
437
|
{
|
|
344
438
|
id: "preview-channel",
|
|
345
439
|
label: y("notifTemplates.nextPreviewLabel", "Preview each channel"),
|
|
346
440
|
description: y("notifTemplates.nextPreviewDesc", "Flip the live preview to SMS or push to confirm the template reads well everywhere."),
|
|
347
441
|
onClick: () => {
|
|
348
|
-
X(!0),
|
|
442
|
+
X(!0), Ge("sms");
|
|
349
443
|
}
|
|
350
444
|
},
|
|
351
445
|
{
|
|
@@ -357,238 +451,221 @@ function v() {
|
|
|
357
451
|
]
|
|
358
452
|
})]
|
|
359
453
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ g("div", {
|
|
361
455
|
className: "flex-1 overflow-hidden flex flex-col lg:flex-row",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
456
|
+
children: [/* @__PURE__ */ h("div", {
|
|
363
457
|
className: "flex-1 overflow-y-auto p-3 sm:p-5 lg:border-r lg:border-border-seam",
|
|
364
|
-
children: /* @__PURE__ */
|
|
458
|
+
children: /* @__PURE__ */ g("form", {
|
|
365
459
|
onSubmit: Q,
|
|
366
460
|
className: "space-y-5",
|
|
367
461
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ g("section", {
|
|
369
463
|
className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
|
|
370
464
|
children: [
|
|
371
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ h("h2", {
|
|
372
466
|
className: "text-sm font-semibold text-primary uppercase tracking-wider",
|
|
373
467
|
children: y("notifTemplates.basicInformation", "Basic Information")
|
|
374
468
|
}),
|
|
375
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ g("div", {
|
|
376
470
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
471
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
|
|
378
472
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
379
473
|
children: [
|
|
380
474
|
y("notifTemplates.nameLabel", "Name"),
|
|
381
475
|
" ",
|
|
382
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ h("span", {
|
|
383
477
|
className: "text-error",
|
|
384
478
|
children: "*"
|
|
385
479
|
})
|
|
386
480
|
]
|
|
387
|
-
}), /* @__PURE__ */
|
|
481
|
+
}), /* @__PURE__ */ h("input", {
|
|
388
482
|
type: "text",
|
|
389
483
|
value: E,
|
|
390
484
|
onChange: (e) => D(e.target.value),
|
|
391
485
|
placeholder: y("notifTemplates.namePlaceholder", "e.g., Welcome Email"),
|
|
392
486
|
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"
|
|
393
|
-
})] }), /* @__PURE__ */
|
|
394
|
-
/* @__PURE__ */
|
|
487
|
+
})] }), /* @__PURE__ */ g("div", { children: [
|
|
488
|
+
/* @__PURE__ */ g("label", {
|
|
395
489
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
396
490
|
children: [
|
|
397
491
|
y("notifTemplates.slugLabel", "Slug"),
|
|
398
492
|
" ",
|
|
399
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ h("span", {
|
|
400
494
|
className: "text-error",
|
|
401
495
|
children: "*"
|
|
402
496
|
})
|
|
403
497
|
]
|
|
404
498
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
499
|
+
M && !Pe ? /* @__PURE__ */ g("div", {
|
|
500
|
+
className: "flex min-h-9 items-center gap-2",
|
|
501
|
+
children: [/* @__PURE__ */ h("code", {
|
|
502
|
+
className: "truncate font-mono text-sm text-text-primary",
|
|
503
|
+
children: O || "—"
|
|
504
|
+
}), !S && /* @__PURE__ */ h("button", {
|
|
505
|
+
type: "button",
|
|
506
|
+
onClick: () => Fe(!0),
|
|
507
|
+
className: "text-sm font-medium text-accent-primary hover:underline",
|
|
508
|
+
children: y("notifTemplates.editSlug", "Edit")
|
|
509
|
+
})]
|
|
510
|
+
}) : /* @__PURE__ */ h("input", {
|
|
406
511
|
type: "text",
|
|
407
512
|
value: O,
|
|
408
513
|
onChange: (e) => {
|
|
409
|
-
k(e.target.value),
|
|
514
|
+
k(e.target.value), j(!0);
|
|
410
515
|
},
|
|
411
516
|
placeholder: y("notifTemplates.slugPlaceholder", "e.g., welcome-email"),
|
|
412
517
|
disabled: S,
|
|
413
518
|
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"
|
|
414
519
|
}),
|
|
415
|
-
!S && /* @__PURE__ */
|
|
520
|
+
!S && /* @__PURE__ */ h("p", {
|
|
416
521
|
className: "mt-1 text-[11px] text-tertiary",
|
|
417
522
|
children: y("notifTemplates.autoGeneratedFromName", "Auto-generated from name.")
|
|
418
523
|
})
|
|
419
524
|
] })]
|
|
420
525
|
}),
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}), /* @__PURE__ */ m("select", {
|
|
445
|
-
value: M,
|
|
446
|
-
onChange: (e) => N(e.target.value),
|
|
447
|
-
disabled: S,
|
|
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 disabled:opacity-60 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
449
|
-
children: _e.map((e) => /* @__PURE__ */ m("option", {
|
|
450
|
-
value: e.value,
|
|
451
|
-
children: y(`notifTemplates.type.${e.value}`, e.label)
|
|
452
|
-
}, e.value))
|
|
453
|
-
})] }),
|
|
454
|
-
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
455
|
-
className: "block text-sm font-medium text-primary mb-1.5",
|
|
456
|
-
children: y("notifTemplates.defaultChannel", "Default Channel")
|
|
457
|
-
}), /* @__PURE__ */ h("select", {
|
|
458
|
-
value: P,
|
|
459
|
-
onChange: (e) => Ne(e.target.value),
|
|
460
|
-
disabled: S,
|
|
461
|
-
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
462
|
-
children: [/* @__PURE__ */ m("option", {
|
|
463
|
-
value: "",
|
|
464
|
-
children: y("notifTemplates.none", "None")
|
|
465
|
-
}), ve.map((e) => /* @__PURE__ */ m("option", {
|
|
466
|
-
value: e.value,
|
|
467
|
-
children: y(`notifTemplates.channel.${e.value}`, e.label)
|
|
468
|
-
}, e.value))]
|
|
469
|
-
})] }),
|
|
470
|
-
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
471
|
-
className: "block text-sm font-medium text-primary mb-1.5",
|
|
472
|
-
children: y("notifTemplates.localeLabel", "Locale")
|
|
473
|
-
}), /* @__PURE__ */ m("input", {
|
|
474
|
-
type: "text",
|
|
475
|
-
value: F,
|
|
476
|
-
onChange: (e) => I(e.target.value),
|
|
477
|
-
placeholder: "en",
|
|
478
|
-
disabled: S,
|
|
479
|
-
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"
|
|
480
|
-
})] })
|
|
481
|
-
]
|
|
526
|
+
!M && Qe,
|
|
527
|
+
/* @__PURE__ */ g("div", {
|
|
528
|
+
className: `grid grid-cols-1 gap-4 ${M ? "sm:grid-cols-2" : "sm:grid-cols-3"}`,
|
|
529
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
|
|
530
|
+
className: "block text-sm font-medium text-primary mb-1.5",
|
|
531
|
+
children: [
|
|
532
|
+
y("notifTemplates.typeLabel", "Type"),
|
|
533
|
+
" ",
|
|
534
|
+
/* @__PURE__ */ h("span", {
|
|
535
|
+
className: "text-error",
|
|
536
|
+
children: "*"
|
|
537
|
+
})
|
|
538
|
+
]
|
|
539
|
+
}), /* @__PURE__ */ h("select", {
|
|
540
|
+
value: F,
|
|
541
|
+
onChange: (e) => I(e.target.value),
|
|
542
|
+
disabled: S,
|
|
543
|
+
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
544
|
+
children: ye.map((e) => /* @__PURE__ */ h("option", {
|
|
545
|
+
value: e.value,
|
|
546
|
+
children: y(`notifTemplates.type.${e.value}`, e.label)
|
|
547
|
+
}, e.value))
|
|
548
|
+
})] }), !M && $e]
|
|
482
549
|
})
|
|
483
550
|
]
|
|
484
551
|
}),
|
|
485
|
-
/* @__PURE__ */ h(
|
|
552
|
+
M && /* @__PURE__ */ h(ge, {
|
|
553
|
+
storageKey: "notifications.templateEditor.more",
|
|
554
|
+
children: /* @__PURE__ */ g("div", {
|
|
555
|
+
className: "space-y-4",
|
|
556
|
+
children: [Qe, /* @__PURE__ */ h("div", {
|
|
557
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
558
|
+
children: $e
|
|
559
|
+
})]
|
|
560
|
+
})
|
|
561
|
+
}),
|
|
562
|
+
/* @__PURE__ */ g("section", {
|
|
486
563
|
className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
|
|
487
564
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ g("div", {
|
|
489
566
|
className: "flex items-center justify-between",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
491
568
|
className: "text-sm font-semibold text-primary uppercase tracking-wider",
|
|
492
569
|
children: y("notifTemplates.templateContent", "Template Content")
|
|
493
|
-
}), /* @__PURE__ */
|
|
570
|
+
}), /* @__PURE__ */ g("div", {
|
|
494
571
|
className: "flex items-center bg-bg-sunken rounded-lg p-0.5",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
572
|
+
children: [/* @__PURE__ */ g("button", {
|
|
496
573
|
type: "button",
|
|
497
574
|
onClick: () => K("text"),
|
|
498
575
|
className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${G === "text" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
|
|
499
|
-
children: [/* @__PURE__ */ m
|
|
500
|
-
}), /* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ h(m, { size: 12 }), y("notifTemplates.contentMode.text", "Text")]
|
|
577
|
+
}), /* @__PURE__ */ g("button", {
|
|
501
578
|
type: "button",
|
|
502
579
|
onClick: () => K("html"),
|
|
503
580
|
className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${G === "html" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
|
|
504
|
-
children: [/* @__PURE__ */
|
|
581
|
+
children: [/* @__PURE__ */ h(se, { size: 12 }), y("notifTemplates.contentMode.html", "HTML")]
|
|
505
582
|
})]
|
|
506
583
|
})]
|
|
507
584
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ g("div", { children: [
|
|
586
|
+
/* @__PURE__ */ h("label", {
|
|
510
587
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
511
588
|
children: y("notifTemplates.subjectLabel", "Subject")
|
|
512
589
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ h("input", {
|
|
514
591
|
type: "text",
|
|
515
|
-
value:
|
|
516
|
-
onChange: (e) =>
|
|
592
|
+
value: R,
|
|
593
|
+
onChange: (e) => ze(e.target.value),
|
|
517
594
|
placeholder: y("notifTemplates.subjectPlaceholder", "e.g., Welcome to {{appName}}, {{userName}}!"),
|
|
518
595
|
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"
|
|
519
596
|
}),
|
|
520
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ h("p", {
|
|
521
598
|
className: "mt-1 text-[11px] text-tertiary",
|
|
522
599
|
children: y("notifTemplates.subjectHint", "Used for email subject lines. Supports {{variables}}.")
|
|
523
600
|
})
|
|
524
601
|
] }),
|
|
525
|
-
G === "text" && /* @__PURE__ */
|
|
602
|
+
G === "text" && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
|
|
526
603
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
527
604
|
children: [
|
|
528
605
|
y("notifTemplates.bodyTemplateLabel", "Body Template"),
|
|
529
606
|
" ",
|
|
530
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ h("span", {
|
|
531
608
|
className: "text-error",
|
|
532
609
|
children: "*"
|
|
533
610
|
})
|
|
534
611
|
]
|
|
535
|
-
}), /* @__PURE__ */
|
|
536
|
-
ref:
|
|
612
|
+
}), /* @__PURE__ */ h("textarea", {
|
|
613
|
+
ref: Be,
|
|
537
614
|
value: z,
|
|
538
615
|
onChange: (e) => B(e.target.value),
|
|
539
616
|
rows: 8,
|
|
540
617
|
placeholder: y("notifTemplates.bodyPlaceholder", "Hello {{userName}},\n\nWelcome to {{appName}}! Your account has been created.\n\nBest regards,\nThe Team"),
|
|
541
618
|
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"
|
|
542
619
|
})] }),
|
|
543
|
-
G === "html" && /* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
620
|
+
G === "html" && /* @__PURE__ */ g("div", { children: [
|
|
621
|
+
/* @__PURE__ */ h("label", {
|
|
545
622
|
className: "block text-sm font-medium text-primary mb-1.5",
|
|
546
623
|
children: y("notifTemplates.htmlTemplateLabel", "HTML Template")
|
|
547
624
|
}),
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
ref:
|
|
625
|
+
/* @__PURE__ */ h("textarea", {
|
|
626
|
+
ref: Ve,
|
|
550
627
|
value: V,
|
|
551
628
|
onChange: (e) => H(e.target.value),
|
|
552
629
|
rows: 12,
|
|
553
630
|
placeholder: y("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>"),
|
|
554
631
|
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"
|
|
555
632
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ h("p", {
|
|
557
634
|
className: "mt-1 text-[11px] text-tertiary",
|
|
558
635
|
children: y("notifTemplates.htmlHint", "HTML content for email. Falls back to text body if not provided.")
|
|
559
636
|
})
|
|
560
637
|
] }),
|
|
561
|
-
U.length > 0 && /* @__PURE__ */
|
|
638
|
+
U.length > 0 && /* @__PURE__ */ g("div", {
|
|
562
639
|
className: "flex items-center gap-2 flex-wrap",
|
|
563
|
-
children: [/* @__PURE__ */
|
|
640
|
+
children: [/* @__PURE__ */ g("span", {
|
|
564
641
|
className: "text-[11px] text-tertiary font-medium",
|
|
565
642
|
children: [y("notifTemplates.insert", "Insert"), ":"]
|
|
566
|
-
}), U.filter((e) => e.name.trim()).map((e, t) => /* @__PURE__ */
|
|
643
|
+
}), U.filter((e) => e.name.trim()).map((e, t) => /* @__PURE__ */ h("button", {
|
|
567
644
|
type: "button",
|
|
568
|
-
onClick: () =>
|
|
645
|
+
onClick: () => Ze(e.name),
|
|
569
646
|
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",
|
|
570
647
|
children: `{{${e.name}}}`
|
|
571
648
|
}, t))]
|
|
572
649
|
})
|
|
573
650
|
]
|
|
574
651
|
}),
|
|
575
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ g("section", {
|
|
576
653
|
className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
|
|
577
654
|
children: [
|
|
578
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ g("div", {
|
|
579
656
|
className: "flex items-center justify-between",
|
|
580
|
-
children: [/* @__PURE__ */
|
|
657
|
+
children: [/* @__PURE__ */ g("div", {
|
|
581
658
|
className: "flex items-center gap-2",
|
|
582
659
|
children: [
|
|
583
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ h(ue, {
|
|
584
661
|
size: 16,
|
|
585
662
|
className: "text-accent-primary"
|
|
586
663
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ h("h2", {
|
|
588
665
|
className: "text-sm font-semibold text-primary uppercase tracking-wider",
|
|
589
666
|
children: y("notifTemplates.variables", "Variables")
|
|
590
667
|
}),
|
|
591
|
-
/* @__PURE__ */
|
|
668
|
+
/* @__PURE__ */ g("span", {
|
|
592
669
|
className: "text-[11px] text-tertiary",
|
|
593
670
|
children: [
|
|
594
671
|
"(",
|
|
@@ -597,33 +674,33 @@ function v() {
|
|
|
597
674
|
]
|
|
598
675
|
})
|
|
599
676
|
]
|
|
600
|
-
}), /* @__PURE__ */
|
|
677
|
+
}), /* @__PURE__ */ g("button", {
|
|
601
678
|
type: "button",
|
|
602
|
-
onClick:
|
|
679
|
+
onClick: Ye,
|
|
603
680
|
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",
|
|
604
|
-
children: [/* @__PURE__ */
|
|
681
|
+
children: [/* @__PURE__ */ h(ce, { size: 12 }), y("notifTemplates.addVariable", "Add Variable")]
|
|
605
682
|
})]
|
|
606
683
|
}),
|
|
607
|
-
U.length === 0 && /* @__PURE__ */
|
|
684
|
+
U.length === 0 && /* @__PURE__ */ g("p", {
|
|
608
685
|
className: "text-sm text-tertiary text-center py-4",
|
|
609
686
|
children: [
|
|
610
687
|
y("notifTemplates.noVariables", "No variables defined. Add variables to use dynamic content like"),
|
|
611
688
|
" ",
|
|
612
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ h("code", {
|
|
613
690
|
className: "px-1.5 py-0.5 bg-bg-sunken rounded text-[11px] font-mono",
|
|
614
691
|
children: "{{userName}}"
|
|
615
692
|
})
|
|
616
693
|
]
|
|
617
694
|
}),
|
|
618
|
-
U.map((e, t) => /* @__PURE__ */
|
|
695
|
+
U.map((e, t) => /* @__PURE__ */ g("div", {
|
|
619
696
|
className: "flex items-start gap-3 p-3 bg-bg-sunken/50 rounded-lg border border-default/50",
|
|
620
697
|
children: [
|
|
621
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ g("div", {
|
|
622
699
|
className: "flex-1",
|
|
623
|
-
children: [/* @__PURE__ */
|
|
700
|
+
children: [/* @__PURE__ */ h("label", {
|
|
624
701
|
className: "block text-[11px] font-medium text-tertiary mb-1",
|
|
625
702
|
children: y("notifTemplates.variableName", "Name")
|
|
626
|
-
}), /* @__PURE__ */
|
|
703
|
+
}), /* @__PURE__ */ h("input", {
|
|
627
704
|
type: "text",
|
|
628
705
|
value: e.name,
|
|
629
706
|
onChange: (e) => Z(t, "name", e.target.value.replace(/[^a-zA-Z0-9_]/g, "")),
|
|
@@ -631,27 +708,27 @@ function v() {
|
|
|
631
708
|
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"
|
|
632
709
|
})]
|
|
633
710
|
}),
|
|
634
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ g("div", {
|
|
635
712
|
className: "w-28",
|
|
636
|
-
children: [/* @__PURE__ */
|
|
713
|
+
children: [/* @__PURE__ */ h("label", {
|
|
637
714
|
className: "block text-[11px] font-medium text-tertiary mb-1",
|
|
638
715
|
children: y("notifTemplates.variableType", "Type")
|
|
639
|
-
}), /* @__PURE__ */
|
|
716
|
+
}), /* @__PURE__ */ h("select", {
|
|
640
717
|
value: e.type,
|
|
641
718
|
onChange: (e) => Z(t, "type", e.target.value),
|
|
642
719
|
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
643
|
-
children:
|
|
720
|
+
children: xe.map((e) => /* @__PURE__ */ h("option", {
|
|
644
721
|
value: e.value,
|
|
645
722
|
children: y(`notifTemplates.variableType.${e.value}`, e.label)
|
|
646
723
|
}, e.value))
|
|
647
724
|
})]
|
|
648
725
|
}),
|
|
649
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ g("div", {
|
|
650
727
|
className: "flex-1",
|
|
651
|
-
children: [/* @__PURE__ */
|
|
728
|
+
children: [/* @__PURE__ */ h("label", {
|
|
652
729
|
className: "block text-[11px] font-medium text-tertiary mb-1",
|
|
653
730
|
children: y("notifTemplates.sampleValue", "Sample Value")
|
|
654
|
-
}), /* @__PURE__ */
|
|
731
|
+
}), /* @__PURE__ */ h("input", {
|
|
655
732
|
type: "text",
|
|
656
733
|
value: e.defaultValue,
|
|
657
734
|
onChange: (e) => Z(t, "defaultValue", e.target.value),
|
|
@@ -659,163 +736,127 @@ function v() {
|
|
|
659
736
|
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"
|
|
660
737
|
})]
|
|
661
738
|
}),
|
|
662
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ h("button", {
|
|
663
740
|
type: "button",
|
|
664
|
-
onClick: () =>
|
|
741
|
+
onClick: () => Xe(t),
|
|
665
742
|
className: "mt-5 p-1.5 text-tertiary hover:text-error rounded transition-colors",
|
|
666
|
-
children: /* @__PURE__ */
|
|
743
|
+
children: /* @__PURE__ */ h(le, { size: 14 })
|
|
667
744
|
})
|
|
668
745
|
]
|
|
669
746
|
}, t))
|
|
670
747
|
]
|
|
671
748
|
}),
|
|
672
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ g("div", {
|
|
673
750
|
className: "flex justify-end gap-3 lg:hidden pb-4",
|
|
674
|
-
children: [/* @__PURE__ */
|
|
751
|
+
children: [/* @__PURE__ */ h("button", {
|
|
675
752
|
type: "button",
|
|
676
753
|
onClick: () => v("..", { relative: "path" }),
|
|
677
754
|
className: "px-4 py-2 text-sm font-medium text-tertiary hover:text-primary border border-default rounded-lg transition-all duration-150",
|
|
678
755
|
children: y("notifTemplates.cancel", "Cancel")
|
|
679
|
-
}), /* @__PURE__ */
|
|
756
|
+
}), /* @__PURE__ */ g("button", {
|
|
680
757
|
type: "submit",
|
|
681
758
|
disabled: $,
|
|
682
759
|
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",
|
|
683
|
-
children: [$ ? /* @__PURE__ */
|
|
760
|
+
children: [$ ? /* @__PURE__ */ h(f, {
|
|
684
761
|
size: 16,
|
|
685
762
|
className: "animate-spin"
|
|
686
|
-
}) : /* @__PURE__ */
|
|
763
|
+
}) : /* @__PURE__ */ h(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
|
|
687
764
|
})]
|
|
688
765
|
})
|
|
689
766
|
]
|
|
690
767
|
})
|
|
691
|
-
}), /* @__PURE__ */
|
|
768
|
+
}), /* @__PURE__ */ g("div", {
|
|
692
769
|
className: "hidden lg:flex lg:flex-col lg:w-[440px] xl:w-[500px] bg-bg-sunken/30",
|
|
693
|
-
children: [/* @__PURE__ */
|
|
770
|
+
children: [/* @__PURE__ */ g("div", {
|
|
694
771
|
className: "flex items-center gap-2 px-4 py-3 border-b border-border-seam bg-accent-wash shrink-0",
|
|
695
772
|
children: [
|
|
696
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ h(u, {
|
|
697
774
|
size: 16,
|
|
698
775
|
className: "text-primary"
|
|
699
776
|
}),
|
|
700
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ h("span", {
|
|
701
778
|
className: "text-sm font-semibold text-primary",
|
|
702
779
|
children: y("notifTemplates.livePreview", "Live Preview")
|
|
703
780
|
}),
|
|
704
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ g("button", {
|
|
705
782
|
type: "button",
|
|
706
783
|
onClick: () => X((e) => !e),
|
|
707
784
|
className: `ml-auto flex items-center gap-1.5 px-2.5 py-1 text-[11px] font-medium rounded-md transition-all duration-150 ${Y ? "bg-accent-primary/10 text-accent-primary" : "bg-bg-sunken text-tertiary hover:text-primary"}`,
|
|
708
|
-
children: [
|
|
785
|
+
children: [h(Y ? u : d, { size: 12 }), Y ? y("notifTemplates.previewOn", "On") : y("notifTemplates.previewOffShort", "Off")]
|
|
709
786
|
})
|
|
710
787
|
]
|
|
711
|
-
}), Y ? /* @__PURE__ */
|
|
788
|
+
}), Y ? /* @__PURE__ */ g("div", {
|
|
712
789
|
className: "flex-1 flex flex-col overflow-hidden",
|
|
713
|
-
children: [/* @__PURE__ */
|
|
714
|
-
channel:
|
|
715
|
-
subject:
|
|
716
|
-
body:
|
|
717
|
-
html: G === "html" && V ?
|
|
790
|
+
children: [/* @__PURE__ */ h(ee, {
|
|
791
|
+
channel: We,
|
|
792
|
+
subject: Ke,
|
|
793
|
+
body: qe,
|
|
794
|
+
html: G === "html" && V ? Je : "",
|
|
718
795
|
appName: U.find((e) => e.name === "appName")?.defaultValue || "Burdenoff",
|
|
719
|
-
onChannelChange:
|
|
720
|
-
}), /* @__PURE__ */
|
|
796
|
+
onChannelChange: Ge
|
|
797
|
+
}), /* @__PURE__ */ g("div", {
|
|
721
798
|
className: "shrink-0 border-t border-default overflow-y-auto max-h-[240px]",
|
|
722
|
-
children: [
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
className: "
|
|
754
|
-
children:
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
] }),
|
|
769
|
-
/* @__PURE__ */ h("p", { children: [
|
|
770
|
-
/* @__PURE__ */ h("span", {
|
|
771
|
-
className: "font-medium",
|
|
772
|
-
children: [y("notifTemplates.metaVersion", "Version"), ":"]
|
|
773
|
-
}),
|
|
774
|
-
" ",
|
|
775
|
-
w.version
|
|
776
|
-
] }),
|
|
777
|
-
/* @__PURE__ */ h("p", { children: [
|
|
778
|
-
/* @__PURE__ */ h("span", {
|
|
779
|
-
className: "font-medium",
|
|
780
|
-
children: [y("notifTemplates.metaCreated", "Created"), ":"]
|
|
781
|
-
}),
|
|
782
|
-
" ",
|
|
783
|
-
new Date(w.createdAt).toLocaleString(b || "en-US")
|
|
784
|
-
] }),
|
|
785
|
-
/* @__PURE__ */ h("p", { children: [
|
|
786
|
-
/* @__PURE__ */ h("span", {
|
|
787
|
-
className: "font-medium",
|
|
788
|
-
children: [y("notifTemplates.metaUpdated", "Updated"), ":"]
|
|
789
|
-
}),
|
|
790
|
-
" ",
|
|
791
|
-
new Date(w.updatedAt).toLocaleString(b || "en-US")
|
|
792
|
-
] }),
|
|
793
|
-
/* @__PURE__ */ h("p", { children: [
|
|
794
|
-
/* @__PURE__ */ h("span", {
|
|
795
|
-
className: "font-medium",
|
|
796
|
-
children: [y("notifTemplates.metaEnabled", "Enabled"), ":"]
|
|
797
|
-
}),
|
|
798
|
-
" ",
|
|
799
|
-
w.enabled ? y("notifTemplates.yes", "Yes") : y("notifTemplates.no", "No")
|
|
800
|
-
] })
|
|
801
|
-
]
|
|
802
|
-
})]
|
|
803
|
-
})]
|
|
799
|
+
children: [
|
|
800
|
+
U.length > 0 && /* @__PURE__ */ g("div", {
|
|
801
|
+
className: "p-3 border-b border-default/50",
|
|
802
|
+
children: [/* @__PURE__ */ g("p", {
|
|
803
|
+
className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-2",
|
|
804
|
+
children: [
|
|
805
|
+
y("notifTemplates.variables", "Variables"),
|
|
806
|
+
" (",
|
|
807
|
+
U.length,
|
|
808
|
+
")"
|
|
809
|
+
]
|
|
810
|
+
}), /* @__PURE__ */ h("div", {
|
|
811
|
+
className: "space-y-1.5",
|
|
812
|
+
children: U.map((e, t) => /* @__PURE__ */ g("div", {
|
|
813
|
+
className: "flex items-center justify-between text-xs",
|
|
814
|
+
children: [/* @__PURE__ */ h("code", {
|
|
815
|
+
className: "text-primary font-mono",
|
|
816
|
+
children: `{{${e.name || "..."}}}`
|
|
817
|
+
}), /* @__PURE__ */ g("span", {
|
|
818
|
+
className: "text-tertiary",
|
|
819
|
+
children: [
|
|
820
|
+
e.type,
|
|
821
|
+
" =",
|
|
822
|
+
" ",
|
|
823
|
+
e.defaultValue || /* @__PURE__ */ h("em", { children: y("notifTemplates.noDefault", "no default") })
|
|
824
|
+
]
|
|
825
|
+
})]
|
|
826
|
+
}, t))
|
|
827
|
+
})]
|
|
828
|
+
}),
|
|
829
|
+
S && w && M && /* @__PURE__ */ h("div", {
|
|
830
|
+
className: "p-3",
|
|
831
|
+
children: /* @__PURE__ */ h(ge, {
|
|
832
|
+
storageKey: "notifications.templateEditor.details",
|
|
833
|
+
label: y("notifTemplates.details", "Details"),
|
|
834
|
+
children: et
|
|
835
|
+
})
|
|
836
|
+
}),
|
|
837
|
+
S && w && !M && /* @__PURE__ */ g("div", {
|
|
838
|
+
className: "p-3",
|
|
839
|
+
children: [/* @__PURE__ */ h("p", {
|
|
840
|
+
className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-1",
|
|
841
|
+
children: y("notifTemplates.metadata", "Metadata")
|
|
842
|
+
}), et]
|
|
843
|
+
})
|
|
844
|
+
]
|
|
804
845
|
})]
|
|
805
|
-
}) : /* @__PURE__ */
|
|
846
|
+
}) : /* @__PURE__ */ h("div", {
|
|
806
847
|
className: "flex-1 flex items-center justify-center",
|
|
807
|
-
children: /* @__PURE__ */
|
|
848
|
+
children: /* @__PURE__ */ g("div", {
|
|
808
849
|
className: "text-center",
|
|
809
850
|
children: [
|
|
810
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ h(d, {
|
|
811
852
|
size: 32,
|
|
812
853
|
className: "mx-auto text-tertiary mb-3"
|
|
813
854
|
}),
|
|
814
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ h("p", {
|
|
815
856
|
className: "text-sm text-tertiary",
|
|
816
857
|
children: y("notifTemplates.previewOff", "Preview is off")
|
|
817
858
|
}),
|
|
818
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ h("button", {
|
|
819
860
|
type: "button",
|
|
820
861
|
onClick: () => X(!0),
|
|
821
862
|
className: "mt-2 text-xs text-accent-primary hover:underline",
|
|
@@ -829,7 +870,6 @@ function v() {
|
|
|
829
870
|
]
|
|
830
871
|
});
|
|
831
872
|
}
|
|
832
|
-
|
|
833
|
-
export { v as TemplateEditorPage };
|
|
873
|
+
export { x as TemplateEditorPage };
|
|
834
874
|
|
|
835
875
|
//# sourceMappingURL=TemplateEditorPage.js.map
|