strapi-plugin-magic-mail 2.3.11 → 2.4.0
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/_chunks/{App-BMaJu77a.js → App-58t1-H0G.js} +895 -534
- package/dist/_chunks/{App-DxiMl-Zd.mjs → App-ClJVoU2s.mjs} +896 -535
- package/dist/_chunks/PluginSettings-D2BUUHY1.js +376 -0
- package/dist/_chunks/PluginSettings-ywPWZVt0.mjs +374 -0
- package/dist/_chunks/{Settings-BSFLpt0H.js → Settings-CPPrGxLm.js} +38 -82
- package/dist/_chunks/{Settings-Ca5UE3c1.mjs → Settings-Cc-hhoLA.mjs} +39 -83
- package/dist/_chunks/StyledButtons-M7vUd2N4.js +435 -0
- package/dist/_chunks/StyledButtons-nt2C730e.mjs +434 -0
- package/dist/_chunks/{de-YhjDItIL.js → de-CF2ItE3Z.js} +1 -1
- package/dist/_chunks/{de-CpIQf94q.mjs → de-CwbYw2jT.mjs} +1 -1
- package/dist/_chunks/{en-BcdTnA2-.js → en-CK6UpShS.js} +1 -1
- package/dist/_chunks/{en-BHmOVzsP.mjs → en-ZRmfU4qX.mjs} +1 -1
- package/dist/admin/index.js +12 -3
- package/dist/admin/index.mjs +12 -3
- package/dist/server/index.js +298 -54
- package/dist/server/index.mjs +298 -54
- package/package.json +8 -8
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useRef, useEffect, useState, useCallback } from "react";
|
|
3
3
|
import { useNavigate, useLocation } from "react-router-dom";
|
|
4
|
-
import { Modal, Typography, Flex, Box, Field, TextInput, Alert, Textarea, NumberInput, Divider, Toggle, Badge, Button, Loader, SingleSelect, SingleSelectOption, Thead, Tr, Th, Tbody, Td, Table, Tabs } from "@strapi/design-system";
|
|
4
|
+
import { Modal, Typography, Flex, Box, Field, TextInput, Alert, Textarea, NumberInput, Divider, Toggle, Badge, Button, Loader, SingleSelect, SingleSelectOption, Thead, Tr, Th, Tbody, Td, Table, Tabs, Accordion } from "@strapi/design-system";
|
|
5
5
|
import { EnvelopeIcon, ServerIcon, SparklesIcon, PlusIcon, PencilIcon, PlayIcon, TrashIcon, MagnifyingGlassIcon, FunnelIcon, CheckIcon, Cog6ToothIcon, DocumentTextIcon, ChartBarIcon, BoltIcon, CheckCircleIcon, ArrowUpTrayIcon, ArrowDownTrayIcon, DocumentArrowDownIcon, CodeBracketIcon, DocumentDuplicateIcon, PaperAirplaneIcon, ClipboardDocumentIcon, ArrowLeftIcon, ClockIcon, XMarkIcon, ArrowUturnLeftIcon, EnvelopeOpenIcon, CursorArrowRaysIcon, ExclamationTriangleIcon, XCircleIcon, KeyIcon, ChatBubbleLeftIcon } from "@heroicons/react/24/outline";
|
|
6
6
|
import { useFetchClient, useNotification } from "@strapi/strapi/admin";
|
|
7
7
|
import styled, { css, keyframes } from "styled-components";
|
|
8
8
|
import { Star, Mail, Server, Lock, Cog, Check, Cloud, Key, ArrowLeft, ArrowRight, ArrowClockwise, Play, Cross } from "@strapi/icons";
|
|
9
|
+
import { T as TertiaryButton, G as GradientButton$1, C as CTAButton, I as IconButton, a as IconButtonPrimary, b as IconButtonDanger, S as SecondaryButton, c as IconButtonPurple, d as IconButtonSuccess, D as DangerButton } from "./StyledButtons-nt2C730e.mjs";
|
|
9
10
|
import * as ReactEmailEditor from "react-email-editor";
|
|
10
11
|
const useAuthRefresh = () => {
|
|
11
12
|
const { get } = useFetchClient();
|
|
@@ -41,18 +42,23 @@ const theme$3 = {
|
|
|
41
42
|
primary: {
|
|
42
43
|
50: "#F0F9FF",
|
|
43
44
|
100: "#E0F2FE",
|
|
45
|
+
200: "#BAE6FD",
|
|
44
46
|
500: "#0EA5E9",
|
|
45
|
-
600: "#0284C7"
|
|
47
|
+
600: "#0284C7",
|
|
48
|
+
700: "#0369A1"
|
|
46
49
|
},
|
|
47
50
|
secondary: {
|
|
48
51
|
50: "#FAF5FF",
|
|
49
52
|
100: "#F3E8FF",
|
|
53
|
+
500: "#A855F7",
|
|
50
54
|
600: "#9333EA"
|
|
51
55
|
},
|
|
52
56
|
success: {
|
|
57
|
+
50: "#F0FDF4",
|
|
53
58
|
100: "#DCFCE7",
|
|
54
59
|
500: "#22C55E",
|
|
55
|
-
600: "#16A34A"
|
|
60
|
+
600: "#16A34A",
|
|
61
|
+
700: "#15803D"
|
|
56
62
|
},
|
|
57
63
|
warning: {
|
|
58
64
|
100: "#FEF3C7",
|
|
@@ -1803,18 +1809,17 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1803
1809
|
] }) }),
|
|
1804
1810
|
/* @__PURE__ */ jsx(Modal.Footer, { children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", style: { width: "100%" }, children: [
|
|
1805
1811
|
/* @__PURE__ */ jsx("div", { children: currentStep > 1 && /* @__PURE__ */ jsx(
|
|
1806
|
-
|
|
1812
|
+
TertiaryButton,
|
|
1807
1813
|
{
|
|
1808
|
-
variant: "tertiary",
|
|
1809
1814
|
startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
1810
1815
|
onClick: () => setCurrentStep(currentStep - 1),
|
|
1811
1816
|
children: "Back"
|
|
1812
1817
|
}
|
|
1813
1818
|
) }),
|
|
1814
1819
|
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
1815
|
-
/* @__PURE__ */ jsx(
|
|
1820
|
+
/* @__PURE__ */ jsx(TertiaryButton, { onClick: onClose, children: "Cancel" }),
|
|
1816
1821
|
currentStep < 4 ? /* @__PURE__ */ jsx(
|
|
1817
|
-
|
|
1822
|
+
GradientButton$1,
|
|
1818
1823
|
{
|
|
1819
1824
|
endIcon: /* @__PURE__ */ jsx(ArrowRight, {}),
|
|
1820
1825
|
onClick: () => setCurrentStep(currentStep + 1),
|
|
@@ -1822,7 +1827,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1822
1827
|
children: "Continue"
|
|
1823
1828
|
}
|
|
1824
1829
|
) : /* @__PURE__ */ jsx(
|
|
1825
|
-
|
|
1830
|
+
GradientButton$1,
|
|
1826
1831
|
{
|
|
1827
1832
|
onClick: handleSubmit,
|
|
1828
1833
|
loading,
|
|
@@ -2187,6 +2192,137 @@ const StyledSearchInput$2 = styled.input`
|
|
|
2187
2192
|
color: ${(props) => props.theme.colors.neutral500};
|
|
2188
2193
|
}
|
|
2189
2194
|
`;
|
|
2195
|
+
const StyledModalContent$1 = styled(Modal.Content)`
|
|
2196
|
+
&& {
|
|
2197
|
+
border-radius: 16px;
|
|
2198
|
+
overflow: hidden;
|
|
2199
|
+
max-width: 560px;
|
|
2200
|
+
width: 90vw;
|
|
2201
|
+
}
|
|
2202
|
+
`;
|
|
2203
|
+
const StyledModalHeader$1 = styled(Modal.Header)`
|
|
2204
|
+
&& {
|
|
2205
|
+
background: linear-gradient(135deg, ${theme$3.colors.primary[500]} 0%, ${theme$3.colors.secondary[500]} 100%);
|
|
2206
|
+
padding: 24px 28px;
|
|
2207
|
+
border-bottom: none;
|
|
2208
|
+
|
|
2209
|
+
h2 {
|
|
2210
|
+
color: white;
|
|
2211
|
+
font-size: 1.25rem;
|
|
2212
|
+
font-weight: 700;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
button {
|
|
2216
|
+
color: white !important;
|
|
2217
|
+
opacity: 0.9;
|
|
2218
|
+
background: rgba(255, 255, 255, 0.15) !important;
|
|
2219
|
+
border-radius: 8px;
|
|
2220
|
+
|
|
2221
|
+
&:hover {
|
|
2222
|
+
opacity: 1;
|
|
2223
|
+
background: rgba(255, 255, 255, 0.25) !important;
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
svg {
|
|
2227
|
+
fill: white !important;
|
|
2228
|
+
color: white !important;
|
|
2229
|
+
path { fill: white !important; }
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
`;
|
|
2234
|
+
const StyledModalBody$1 = styled(Modal.Body)`
|
|
2235
|
+
&& {
|
|
2236
|
+
padding: 24px 28px;
|
|
2237
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
2238
|
+
width: 100%;
|
|
2239
|
+
box-sizing: border-box;
|
|
2240
|
+
}
|
|
2241
|
+
`;
|
|
2242
|
+
const StyledModalFooter$1 = styled(Modal.Footer)`
|
|
2243
|
+
&& {
|
|
2244
|
+
padding: 20px 28px;
|
|
2245
|
+
border-top: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
2246
|
+
background: ${(props) => props.theme.colors.neutral100};
|
|
2247
|
+
}
|
|
2248
|
+
`;
|
|
2249
|
+
const AccountInfoCard = styled(Box)`
|
|
2250
|
+
background: linear-gradient(135deg, ${theme$3.colors.primary[50]} 0%, ${theme$3.colors.secondary[50]} 100%);
|
|
2251
|
+
border: 1px solid ${theme$3.colors.primary[200]};
|
|
2252
|
+
border-radius: 12px;
|
|
2253
|
+
padding: 16px 20px;
|
|
2254
|
+
text-align: center;
|
|
2255
|
+
width: 100%;
|
|
2256
|
+
box-sizing: border-box;
|
|
2257
|
+
display: flex;
|
|
2258
|
+
flex-direction: column;
|
|
2259
|
+
align-items: center;
|
|
2260
|
+
gap: 2px;
|
|
2261
|
+
`;
|
|
2262
|
+
const TestOptionCard = styled(Box)`
|
|
2263
|
+
padding: 16px 20px;
|
|
2264
|
+
border: 2px solid ${(props) => props.$selected ? theme$3.colors.primary[500] : props.theme.colors.neutral200};
|
|
2265
|
+
border-radius: 12px;
|
|
2266
|
+
cursor: pointer;
|
|
2267
|
+
transition: all ${theme$3.transitions.fast};
|
|
2268
|
+
background: ${(props) => props.$selected ? theme$3.colors.primary[50] : props.theme.colors.neutral0};
|
|
2269
|
+
|
|
2270
|
+
&:hover {
|
|
2271
|
+
border-color: ${theme$3.colors.primary[400]};
|
|
2272
|
+
background: ${theme$3.colors.primary[50]};
|
|
2273
|
+
}
|
|
2274
|
+
`;
|
|
2275
|
+
const ModalFieldLabel = styled(Typography)`
|
|
2276
|
+
font-size: 13px;
|
|
2277
|
+
font-weight: 600;
|
|
2278
|
+
color: ${(props) => props.theme.colors.neutral700};
|
|
2279
|
+
margin-bottom: 8px;
|
|
2280
|
+
display: block;
|
|
2281
|
+
`;
|
|
2282
|
+
const ModalHint$1 = styled(Typography)`
|
|
2283
|
+
font-size: 12px;
|
|
2284
|
+
color: ${(props) => props.theme.colors.neutral500};
|
|
2285
|
+
margin-top: 6px;
|
|
2286
|
+
`;
|
|
2287
|
+
const StyledModalSelect = styled.select`
|
|
2288
|
+
width: 100%;
|
|
2289
|
+
padding: 12px 14px;
|
|
2290
|
+
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
2291
|
+
border-radius: 8px;
|
|
2292
|
+
font-size: 14px;
|
|
2293
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
2294
|
+
color: ${(props) => props.theme.colors.neutral800};
|
|
2295
|
+
cursor: pointer;
|
|
2296
|
+
transition: all ${theme$3.transitions.fast};
|
|
2297
|
+
box-sizing: border-box;
|
|
2298
|
+
|
|
2299
|
+
&:focus {
|
|
2300
|
+
outline: none;
|
|
2301
|
+
border-color: ${theme$3.colors.primary[500]};
|
|
2302
|
+
box-shadow: 0 0 0 3px ${theme$3.colors.primary[100]};
|
|
2303
|
+
}
|
|
2304
|
+
`;
|
|
2305
|
+
const StyledModalInput = styled.input`
|
|
2306
|
+
width: 100%;
|
|
2307
|
+
padding: 12px 14px;
|
|
2308
|
+
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
2309
|
+
border-radius: 8px;
|
|
2310
|
+
font-size: 14px;
|
|
2311
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
2312
|
+
color: ${(props) => props.theme.colors.neutral800};
|
|
2313
|
+
transition: all ${theme$3.transitions.fast};
|
|
2314
|
+
box-sizing: border-box;
|
|
2315
|
+
|
|
2316
|
+
&:focus {
|
|
2317
|
+
outline: none;
|
|
2318
|
+
border-color: ${theme$3.colors.primary[500]};
|
|
2319
|
+
box-shadow: 0 0 0 3px ${theme$3.colors.primary[100]};
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
&::placeholder {
|
|
2323
|
+
color: ${(props) => props.theme.colors.neutral400};
|
|
2324
|
+
}
|
|
2325
|
+
`;
|
|
2190
2326
|
const HomePage = () => {
|
|
2191
2327
|
useAuthRefresh();
|
|
2192
2328
|
const { get, post, del } = useFetchClient();
|
|
@@ -2344,11 +2480,10 @@ const HomePage = () => {
|
|
|
2344
2480
|
}
|
|
2345
2481
|
),
|
|
2346
2482
|
/* @__PURE__ */ jsx(
|
|
2347
|
-
|
|
2483
|
+
CTAButton,
|
|
2348
2484
|
{
|
|
2349
2485
|
startIcon: /* @__PURE__ */ jsx(PlusIcon, { style: { width: 20, height: 20 } }),
|
|
2350
2486
|
onClick: () => setShowAddModal(true),
|
|
2351
|
-
size: "L",
|
|
2352
2487
|
children: "Add First Account"
|
|
2353
2488
|
}
|
|
2354
2489
|
)
|
|
@@ -2356,7 +2491,7 @@ const HomePage = () => {
|
|
|
2356
2491
|
] }) : /* @__PURE__ */ jsxs(AccountsContainer, { children: [
|
|
2357
2492
|
/* @__PURE__ */ jsx(Box, { style: { marginBottom: theme$3.spacing.md }, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, children: [
|
|
2358
2493
|
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral700", style: { fontSize: "1.5rem", fontWeight: 600 }, children: "📧 Email Accounts" }),
|
|
2359
|
-
/* @__PURE__ */ jsx(
|
|
2494
|
+
/* @__PURE__ */ jsx(GradientButton$1, { startIcon: /* @__PURE__ */ jsx(PlusIcon, { style: { width: 16, height: 16 } }), onClick: () => setShowAddModal(true), children: "Add Account" })
|
|
2360
2495
|
] }) }),
|
|
2361
2496
|
/* @__PURE__ */ jsxs(FilterBar$3, { children: [
|
|
2362
2497
|
/* @__PURE__ */ jsxs(SearchInputWrapper$2, { children: [
|
|
@@ -2477,42 +2612,36 @@ const HomePage = () => {
|
|
|
2477
2612
|
}) }) : /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "Never" }) }),
|
|
2478
2613
|
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
2479
2614
|
/* @__PURE__ */ jsx(
|
|
2480
|
-
|
|
2615
|
+
IconButton,
|
|
2481
2616
|
{
|
|
2482
|
-
variant: "secondary",
|
|
2483
2617
|
onClick: (e) => {
|
|
2484
2618
|
e.stopPropagation();
|
|
2485
2619
|
setEditingAccount(account);
|
|
2486
2620
|
},
|
|
2487
|
-
size: "S",
|
|
2488
2621
|
"aria-label": "Edit Account",
|
|
2489
|
-
children: /* @__PURE__ */ jsx(PencilIcon, {
|
|
2622
|
+
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
2490
2623
|
}
|
|
2491
2624
|
),
|
|
2492
2625
|
/* @__PURE__ */ jsx(
|
|
2493
|
-
|
|
2626
|
+
IconButtonPrimary,
|
|
2494
2627
|
{
|
|
2495
|
-
variant: "secondary",
|
|
2496
2628
|
onClick: (e) => {
|
|
2497
2629
|
e.stopPropagation();
|
|
2498
2630
|
setTestingAccount(account);
|
|
2499
2631
|
},
|
|
2500
|
-
size: "S",
|
|
2501
2632
|
"aria-label": "Test Account",
|
|
2502
|
-
children: /* @__PURE__ */ jsx(PlayIcon, {
|
|
2633
|
+
children: /* @__PURE__ */ jsx(PlayIcon, {})
|
|
2503
2634
|
}
|
|
2504
2635
|
),
|
|
2505
2636
|
/* @__PURE__ */ jsx(
|
|
2506
|
-
|
|
2637
|
+
IconButtonDanger,
|
|
2507
2638
|
{
|
|
2508
|
-
variant: "danger-light",
|
|
2509
2639
|
onClick: (e) => {
|
|
2510
2640
|
e.stopPropagation();
|
|
2511
2641
|
deleteAccount(account.id, account.name);
|
|
2512
2642
|
},
|
|
2513
|
-
size: "S",
|
|
2514
2643
|
"aria-label": "Delete Account",
|
|
2515
|
-
children: /* @__PURE__ */ jsx(TrashIcon, {
|
|
2644
|
+
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
2516
2645
|
}
|
|
2517
2646
|
)
|
|
2518
2647
|
] }) })
|
|
@@ -2597,179 +2726,127 @@ const TestEmailModal = ({ account, onClose, onTest }) => {
|
|
|
2597
2726
|
const handleKeyDown = (e) => {
|
|
2598
2727
|
e.stopPropagation();
|
|
2599
2728
|
};
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
hasRadius: true,
|
|
2612
|
-
style: {
|
|
2613
|
-
borderRadius: "8px",
|
|
2614
|
-
width: "100%"
|
|
2615
|
-
},
|
|
2616
|
-
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, style: { width: "100%" }, children: [
|
|
2617
|
-
/* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", style: { fontSize: "14px", color: "#4B5563" }, children: "Testing Account" }),
|
|
2618
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", style: { fontSize: "18px", fontWeight: 600 }, children: account.name }),
|
|
2619
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "14px" }, children: account.fromEmail })
|
|
2620
|
-
] })
|
|
2621
|
-
}
|
|
2622
|
-
),
|
|
2623
|
-
/* @__PURE__ */ jsxs(Field.Root, { required: true, style: { width: "100%" }, children: [
|
|
2624
|
-
/* @__PURE__ */ jsx(Field.Label, { style: { fontSize: "14px" }, children: "Recipient Email Address" }),
|
|
2729
|
+
const [testMode, setTestMode] = useState("strapi");
|
|
2730
|
+
return /* @__PURE__ */ jsx(Modal.Root, { open: true, onOpenChange: onClose, children: /* @__PURE__ */ jsxs(StyledModalContent$1, { children: [
|
|
2731
|
+
/* @__PURE__ */ jsx(StyledModalHeader$1, { children: /* @__PURE__ */ jsx(Modal.Title, { children: "Test Email Account" }) }),
|
|
2732
|
+
/* @__PURE__ */ jsxs(StyledModalBody$1, { children: [
|
|
2733
|
+
/* @__PURE__ */ jsxs(AccountInfoCard, { children: [
|
|
2734
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", style: { color: theme$3.colors.primary[600], fontWeight: 500 }, children: "Testing Account" }),
|
|
2735
|
+
/* @__PURE__ */ jsx(Typography, { variant: "beta", textColor: "neutral800", style: { fontSize: "1.125rem", fontWeight: 700, marginTop: "4px" }, children: account.name }),
|
|
2736
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { marginTop: "2px" }, children: account.fromEmail })
|
|
2737
|
+
] }),
|
|
2738
|
+
/* @__PURE__ */ jsxs(Box, { style: { marginTop: "20px" }, children: [
|
|
2739
|
+
/* @__PURE__ */ jsx(ModalFieldLabel, { children: "Recipient Email *" }),
|
|
2625
2740
|
/* @__PURE__ */ jsx(
|
|
2626
|
-
|
|
2741
|
+
StyledModalInput,
|
|
2627
2742
|
{
|
|
2628
|
-
placeholder: "
|
|
2743
|
+
placeholder: "test@example.com",
|
|
2629
2744
|
value: testEmail,
|
|
2630
2745
|
onChange: handleInputChange,
|
|
2631
2746
|
onKeyDown: handleKeyDown,
|
|
2632
2747
|
onClick: (e) => e.stopPropagation(),
|
|
2633
|
-
onFocus: (e) => e.stopPropagation(),
|
|
2634
|
-
onBlur: (e) => e.stopPropagation(),
|
|
2635
2748
|
type: "email",
|
|
2636
|
-
autoFocus: true
|
|
2637
|
-
autoComplete: "off",
|
|
2638
|
-
name: "test-email-recipient",
|
|
2639
|
-
style: { width: "100%", fontSize: "14px" }
|
|
2749
|
+
autoFocus: true
|
|
2640
2750
|
}
|
|
2641
|
-
)
|
|
2642
|
-
/* @__PURE__ */ jsx(Field.Hint, { style: { fontSize: "13px" }, children: "Enter the email address where you want to receive the test email" })
|
|
2643
|
-
] }),
|
|
2644
|
-
/* @__PURE__ */ jsxs(Box, { style: { width: "100%" }, children: [
|
|
2645
|
-
/* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", marginBottom: 3, style: { fontSize: "14px", color: "#4B5563" }, children: "Email Configuration" }),
|
|
2646
|
-
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, style: { width: "100%" }, children: [
|
|
2647
|
-
/* @__PURE__ */ jsxs(Field.Root, { style: { width: "100%" }, children: [
|
|
2648
|
-
/* @__PURE__ */ jsx(Field.Label, { style: { fontSize: "14px" }, children: "Priority" }),
|
|
2649
|
-
/* @__PURE__ */ jsxs(
|
|
2650
|
-
SingleSelect,
|
|
2651
|
-
{
|
|
2652
|
-
value: priority,
|
|
2653
|
-
onChange: setPriority,
|
|
2654
|
-
style: { width: "100%" },
|
|
2655
|
-
children: [
|
|
2656
|
-
/* @__PURE__ */ jsx(SingleSelectOption, { value: "normal", children: "Normal Priority" }),
|
|
2657
|
-
/* @__PURE__ */ jsx(SingleSelectOption, { value: "high", children: "High Priority" })
|
|
2658
|
-
]
|
|
2659
|
-
}
|
|
2660
|
-
),
|
|
2661
|
-
/* @__PURE__ */ jsx(Field.Hint, { style: { fontSize: "13px" }, children: "High priority adds X-Priority and Importance headers" })
|
|
2662
|
-
] }),
|
|
2663
|
-
/* @__PURE__ */ jsxs(Field.Root, { style: { width: "100%" }, children: [
|
|
2664
|
-
/* @__PURE__ */ jsx(Field.Label, { style: { fontSize: "14px" }, children: "Email Type" }),
|
|
2665
|
-
/* @__PURE__ */ jsxs(
|
|
2666
|
-
SingleSelect,
|
|
2667
|
-
{
|
|
2668
|
-
value: emailType,
|
|
2669
|
-
onChange: setEmailType,
|
|
2670
|
-
style: { width: "100%" },
|
|
2671
|
-
children: [
|
|
2672
|
-
/* @__PURE__ */ jsx(SingleSelectOption, { value: "transactional", children: "Transactional" }),
|
|
2673
|
-
/* @__PURE__ */ jsx(SingleSelectOption, { value: "marketing", children: "Marketing" }),
|
|
2674
|
-
/* @__PURE__ */ jsx(SingleSelectOption, { value: "notification", children: "Notification" })
|
|
2675
|
-
]
|
|
2676
|
-
}
|
|
2677
|
-
),
|
|
2678
|
-
/* @__PURE__ */ jsx(Field.Hint, { style: { fontSize: "13px" }, children: "Marketing emails automatically include List-Unsubscribe headers" })
|
|
2679
|
-
] }),
|
|
2680
|
-
emailType === "marketing" && /* @__PURE__ */ jsxs(Field.Root, { style: { width: "100%" }, children: [
|
|
2681
|
-
/* @__PURE__ */ jsx(Field.Label, { style: { fontSize: "14px" }, children: "Unsubscribe URL (Required for Marketing)" }),
|
|
2682
|
-
/* @__PURE__ */ jsx(
|
|
2683
|
-
TextInput,
|
|
2684
|
-
{
|
|
2685
|
-
placeholder: "https://yoursite.com/unsubscribe",
|
|
2686
|
-
value: unsubscribeUrl,
|
|
2687
|
-
onChange: (e) => {
|
|
2688
|
-
e.stopPropagation();
|
|
2689
|
-
setUnsubscribeUrl(e.target.value);
|
|
2690
|
-
},
|
|
2691
|
-
style: { width: "100%", fontSize: "14px" }
|
|
2692
|
-
}
|
|
2693
|
-
),
|
|
2694
|
-
/* @__PURE__ */ jsx(Field.Hint, { style: { fontSize: "13px" }, children: "Required for GDPR/CAN-SPAM compliance. Adds List-Unsubscribe header." })
|
|
2695
|
-
] })
|
|
2696
|
-
] })
|
|
2751
|
+
)
|
|
2697
2752
|
] }),
|
|
2698
|
-
/* @__PURE__ */ jsxs(Box, { style: {
|
|
2699
|
-
/* @__PURE__ */ jsx(
|
|
2700
|
-
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, style: { width: "100%" }, children: [
|
|
2701
|
-
/* @__PURE__ */ jsx(
|
|
2702
|
-
Box,
|
|
2703
|
-
{
|
|
2704
|
-
padding: 4,
|
|
2705
|
-
background: "neutral0",
|
|
2706
|
-
hasRadius: true,
|
|
2707
|
-
style: {
|
|
2708
|
-
border: "2px solid #E5E7EB",
|
|
2709
|
-
borderRadius: "8px",
|
|
2710
|
-
width: "100%"
|
|
2711
|
-
},
|
|
2712
|
-
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
|
2713
|
-
/* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
|
|
2714
|
-
/* @__PURE__ */ jsx(PlayIcon, { style: { width: 18, height: 18, color: "#0EA5E9", flexShrink: 0 } }),
|
|
2715
|
-
/* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", style: { fontSize: "14px" }, children: "Direct Test" })
|
|
2716
|
-
] }),
|
|
2717
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "13px", lineHeight: "1.5" }, children: "Send test email directly through this specific account" })
|
|
2718
|
-
] })
|
|
2719
|
-
}
|
|
2720
|
-
),
|
|
2721
|
-
/* @__PURE__ */ jsx(
|
|
2722
|
-
Box,
|
|
2723
|
-
{
|
|
2724
|
-
padding: 4,
|
|
2725
|
-
background: "primary50",
|
|
2726
|
-
hasRadius: true,
|
|
2727
|
-
style: {
|
|
2728
|
-
border: "2px solid #0EA5E9",
|
|
2729
|
-
borderRadius: "8px",
|
|
2730
|
-
width: "100%"
|
|
2731
|
-
},
|
|
2732
|
-
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
|
2733
|
-
/* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
|
|
2734
|
-
/* @__PURE__ */ jsx(SparklesIcon, { style: { width: 18, height: 18, color: "#0369A1", flexShrink: 0 } }),
|
|
2735
|
-
/* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", style: { fontSize: "14px", color: "#0369A1" }, children: "Strapi Email Service Test" })
|
|
2736
|
-
] }),
|
|
2737
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "13px", lineHeight: "1.5" }, children: [
|
|
2738
|
-
"Test if MagicMail intercepts Strapi's native email service via THIS account (",
|
|
2739
|
-
account.name,
|
|
2740
|
-
")"
|
|
2741
|
-
] }),
|
|
2742
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "13px", lineHeight: "1.5" }, children: /* @__PURE__ */ jsx("strong", { style: { color: "#0369A1" }, children: "Use this to verify Email Designer compatibility" }) })
|
|
2743
|
-
] })
|
|
2744
|
-
}
|
|
2745
|
-
)
|
|
2746
|
-
] })
|
|
2747
|
-
] })
|
|
2748
|
-
] }) }),
|
|
2749
|
-
/* @__PURE__ */ jsx(Modal.Footer, { children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 2, style: { width: "100%" }, children: [
|
|
2750
|
-
/* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "tertiary", children: "Cancel" }),
|
|
2751
|
-
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
2753
|
+
/* @__PURE__ */ jsxs(Box, { style: { marginTop: "20px" }, children: [
|
|
2754
|
+
/* @__PURE__ */ jsx(ModalFieldLabel, { children: "Test Mode" }),
|
|
2752
2755
|
/* @__PURE__ */ jsx(
|
|
2753
|
-
|
|
2756
|
+
TestOptionCard,
|
|
2754
2757
|
{
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2758
|
+
$selected: testMode === "direct",
|
|
2759
|
+
onClick: () => setTestMode("direct"),
|
|
2760
|
+
style: { marginBottom: "10px" },
|
|
2761
|
+
children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 3, children: [
|
|
2762
|
+
/* @__PURE__ */ jsx(PlayIcon, { style: { width: 20, height: 20, color: testMode === "direct" ? theme$3.colors.primary[600] : "#6B7280", flexShrink: 0 } }),
|
|
2763
|
+
/* @__PURE__ */ jsxs(Box, { style: { flex: 1 }, children: [
|
|
2764
|
+
/* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", style: { fontSize: "14px", color: testMode === "direct" ? theme$3.colors.primary[700] : "#374151" }, children: "Direct Test" }),
|
|
2765
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", style: { fontSize: "12px" }, children: "Send directly through this account" })
|
|
2766
|
+
] })
|
|
2767
|
+
] })
|
|
2760
2768
|
}
|
|
2761
2769
|
),
|
|
2762
2770
|
/* @__PURE__ */ jsx(
|
|
2763
|
-
|
|
2771
|
+
TestOptionCard,
|
|
2764
2772
|
{
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2773
|
+
$selected: testMode === "strapi",
|
|
2774
|
+
onClick: () => setTestMode("strapi"),
|
|
2775
|
+
children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 3, children: [
|
|
2776
|
+
/* @__PURE__ */ jsx(SparklesIcon, { style: { width: 20, height: 20, color: testMode === "strapi" ? theme$3.colors.primary[600] : "#6B7280", flexShrink: 0 } }),
|
|
2777
|
+
/* @__PURE__ */ jsxs(Box, { style: { flex: 1 }, children: [
|
|
2778
|
+
/* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", style: { fontSize: "14px", color: testMode === "strapi" ? theme$3.colors.primary[700] : "#374151" }, children: "Strapi Service Test" }),
|
|
2779
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", style: { fontSize: "12px" }, children: "Verify MagicMail intercepts Strapi's email service" })
|
|
2780
|
+
] })
|
|
2781
|
+
] })
|
|
2770
2782
|
}
|
|
2771
2783
|
)
|
|
2784
|
+
] }),
|
|
2785
|
+
testMode === "direct" && /* @__PURE__ */ jsxs(Box, { style: { marginTop: "20px", padding: "16px", background: "#F9FAFB", borderRadius: "12px" }, children: [
|
|
2786
|
+
/* @__PURE__ */ jsx(ModalFieldLabel, { style: { marginBottom: "16px", fontSize: "14px" }, children: "Advanced Options" }),
|
|
2787
|
+
/* @__PURE__ */ jsxs(Box, { style: { marginBottom: "12px" }, children: [
|
|
2788
|
+
/* @__PURE__ */ jsx(ModalFieldLabel, { children: "Priority" }),
|
|
2789
|
+
/* @__PURE__ */ jsxs(
|
|
2790
|
+
StyledModalSelect,
|
|
2791
|
+
{
|
|
2792
|
+
value: priority,
|
|
2793
|
+
onChange: (e) => setPriority(e.target.value),
|
|
2794
|
+
children: [
|
|
2795
|
+
/* @__PURE__ */ jsx("option", { value: "normal", children: "Normal" }),
|
|
2796
|
+
/* @__PURE__ */ jsx("option", { value: "high", children: "High Priority" })
|
|
2797
|
+
]
|
|
2798
|
+
}
|
|
2799
|
+
)
|
|
2800
|
+
] }),
|
|
2801
|
+
/* @__PURE__ */ jsxs(Box, { style: { marginBottom: emailType === "marketing" ? "12px" : "0" }, children: [
|
|
2802
|
+
/* @__PURE__ */ jsx(ModalFieldLabel, { children: "Email Type" }),
|
|
2803
|
+
/* @__PURE__ */ jsxs(
|
|
2804
|
+
StyledModalSelect,
|
|
2805
|
+
{
|
|
2806
|
+
value: emailType,
|
|
2807
|
+
onChange: (e) => setEmailType(e.target.value),
|
|
2808
|
+
children: [
|
|
2809
|
+
/* @__PURE__ */ jsx("option", { value: "transactional", children: "Transactional" }),
|
|
2810
|
+
/* @__PURE__ */ jsx("option", { value: "marketing", children: "Marketing" }),
|
|
2811
|
+
/* @__PURE__ */ jsx("option", { value: "notification", children: "Notification" })
|
|
2812
|
+
]
|
|
2813
|
+
}
|
|
2814
|
+
)
|
|
2815
|
+
] }),
|
|
2816
|
+
emailType === "marketing" && /* @__PURE__ */ jsxs(Box, { children: [
|
|
2817
|
+
/* @__PURE__ */ jsx(ModalFieldLabel, { children: "Unsubscribe URL *" }),
|
|
2818
|
+
/* @__PURE__ */ jsx(
|
|
2819
|
+
StyledModalInput,
|
|
2820
|
+
{
|
|
2821
|
+
placeholder: "https://yoursite.com/unsubscribe",
|
|
2822
|
+
value: unsubscribeUrl,
|
|
2823
|
+
onChange: (e) => setUnsubscribeUrl(e.target.value)
|
|
2824
|
+
}
|
|
2825
|
+
),
|
|
2826
|
+
/* @__PURE__ */ jsx(ModalHint$1, { children: "Required for GDPR/CAN-SPAM compliance" })
|
|
2827
|
+
] })
|
|
2772
2828
|
] })
|
|
2829
|
+
] }),
|
|
2830
|
+
/* @__PURE__ */ jsx(StyledModalFooter$1, { children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", style: { width: "100%" }, children: [
|
|
2831
|
+
/* @__PURE__ */ jsx(TertiaryButton, { onClick: onClose, children: "Cancel" }),
|
|
2832
|
+
testMode === "direct" ? /* @__PURE__ */ jsx(
|
|
2833
|
+
GradientButton$1,
|
|
2834
|
+
{
|
|
2835
|
+
onClick: () => onTest(testEmail, { priority, type: emailType, unsubscribeUrl }),
|
|
2836
|
+
disabled: !testEmail || !testEmail.includes("@") || emailType === "marketing" && !unsubscribeUrl,
|
|
2837
|
+
startIcon: /* @__PURE__ */ jsx(PlayIcon, { style: { width: 16, height: 16 } }),
|
|
2838
|
+
children: "Send Test Email"
|
|
2839
|
+
}
|
|
2840
|
+
) : /* @__PURE__ */ jsx(
|
|
2841
|
+
GradientButton$1,
|
|
2842
|
+
{
|
|
2843
|
+
onClick: testStrapiService,
|
|
2844
|
+
disabled: !testEmail || !testEmail.includes("@"),
|
|
2845
|
+
loading: testingStrapiService,
|
|
2846
|
+
startIcon: /* @__PURE__ */ jsx(SparklesIcon, { style: { width: 16, height: 16 } }),
|
|
2847
|
+
children: "Test Strapi Service"
|
|
2848
|
+
}
|
|
2849
|
+
)
|
|
2773
2850
|
] }) })
|
|
2774
2851
|
] }) });
|
|
2775
2852
|
};
|
|
@@ -3311,11 +3388,10 @@ const RoutingRulesPage = () => {
|
|
|
3311
3388
|
}
|
|
3312
3389
|
),
|
|
3313
3390
|
/* @__PURE__ */ jsx(
|
|
3314
|
-
|
|
3391
|
+
CTAButton,
|
|
3315
3392
|
{
|
|
3316
3393
|
startIcon: /* @__PURE__ */ jsx(PlusIcon, { style: { width: 20, height: 20 } }),
|
|
3317
3394
|
onClick: () => setShowModal(true),
|
|
3318
|
-
size: "L",
|
|
3319
3395
|
children: "Create First Rule"
|
|
3320
3396
|
}
|
|
3321
3397
|
)
|
|
@@ -3323,7 +3399,7 @@ const RoutingRulesPage = () => {
|
|
|
3323
3399
|
] }) : /* @__PURE__ */ jsxs(RulesContainer, { children: [
|
|
3324
3400
|
/* @__PURE__ */ jsx(Box, { style: { marginBottom: theme$2.spacing.md }, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, children: [
|
|
3325
3401
|
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral700", style: { fontSize: "1.5rem", fontWeight: 600 }, children: "🎯 Routing Rules" }),
|
|
3326
|
-
/* @__PURE__ */ jsx(
|
|
3402
|
+
/* @__PURE__ */ jsx(GradientButton$1, { startIcon: /* @__PURE__ */ jsx(PlusIcon, { style: { width: 16, height: 16 } }), onClick: () => setShowModal(true), children: "Create Rule" })
|
|
3327
3403
|
] }) }),
|
|
3328
3404
|
/* @__PURE__ */ jsxs(FilterBar$2, { children: [
|
|
3329
3405
|
/* @__PURE__ */ jsxs(SearchInputWrapper$1, { children: [
|
|
@@ -3416,23 +3492,19 @@ const RoutingRulesPage = () => {
|
|
|
3416
3492
|
) }),
|
|
3417
3493
|
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
3418
3494
|
/* @__PURE__ */ jsx(
|
|
3419
|
-
|
|
3495
|
+
IconButton,
|
|
3420
3496
|
{
|
|
3421
|
-
variant: "secondary",
|
|
3422
3497
|
onClick: () => setEditingRule(rule),
|
|
3423
|
-
size: "S",
|
|
3424
3498
|
"aria-label": "Edit Rule",
|
|
3425
|
-
children: /* @__PURE__ */ jsx(PencilIcon, {
|
|
3499
|
+
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
3426
3500
|
}
|
|
3427
3501
|
),
|
|
3428
3502
|
/* @__PURE__ */ jsx(
|
|
3429
|
-
|
|
3503
|
+
IconButtonDanger,
|
|
3430
3504
|
{
|
|
3431
|
-
variant: "danger-light",
|
|
3432
3505
|
onClick: () => deleteRule(rule.id, rule.name),
|
|
3433
|
-
size: "S",
|
|
3434
3506
|
"aria-label": "Delete Rule",
|
|
3435
|
-
children: /* @__PURE__ */ jsx(TrashIcon, {
|
|
3507
|
+
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
3436
3508
|
}
|
|
3437
3509
|
)
|
|
3438
3510
|
] }) })
|
|
@@ -3706,9 +3778,9 @@ const RuleModal = ({ rule, accounts, onClose, onSave }) => {
|
|
|
3706
3778
|
)
|
|
3707
3779
|
] }) }) }),
|
|
3708
3780
|
/* @__PURE__ */ jsx(Modal.Footer, { children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "flex-end", gap: 2, style: { width: "100%" }, children: [
|
|
3709
|
-
/* @__PURE__ */ jsx(
|
|
3781
|
+
/* @__PURE__ */ jsx(TertiaryButton, { onClick: onClose, children: "Cancel" }),
|
|
3710
3782
|
/* @__PURE__ */ jsx(
|
|
3711
|
-
|
|
3783
|
+
GradientButton$1,
|
|
3712
3784
|
{
|
|
3713
3785
|
onClick: handleSubmit,
|
|
3714
3786
|
loading,
|
|
@@ -3841,7 +3913,7 @@ const useLicense = () => {
|
|
|
3841
3913
|
const theme$1 = {
|
|
3842
3914
|
colors: {
|
|
3843
3915
|
primary: { 50: "#F0F9FF", 100: "#E0F2FE", 500: "#0EA5E9", 600: "#0284C7", 700: "#0369A1" },
|
|
3844
|
-
secondary: { 50: "#F5F3FF", 100: "#EDE9FE", 600: "#9333EA" },
|
|
3916
|
+
secondary: { 50: "#F5F3FF", 100: "#EDE9FE", 500: "#A855F7", 600: "#9333EA" },
|
|
3845
3917
|
success: { 100: "#DCFCE7", 500: "#22C55E", 600: "#16A34A" },
|
|
3846
3918
|
warning: { 100: "#FEF3C7", 500: "#F59E0B", 600: "#D97706" }
|
|
3847
3919
|
},
|
|
@@ -3878,7 +3950,8 @@ styled.div`
|
|
|
3878
3950
|
const ScrollableDialogBody = styled(Box)`
|
|
3879
3951
|
overflow-y: auto;
|
|
3880
3952
|
max-height: calc(85vh - 160px);
|
|
3881
|
-
padding:
|
|
3953
|
+
padding: 24px 28px 28px 28px;
|
|
3954
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
3882
3955
|
|
|
3883
3956
|
/* Custom Scrollbar */
|
|
3884
3957
|
&::-webkit-scrollbar {
|
|
@@ -3898,19 +3971,19 @@ const ScrollableDialogBody = styled(Box)`
|
|
|
3898
3971
|
background: ${(props) => props.theme.colors.neutral300};
|
|
3899
3972
|
}
|
|
3900
3973
|
`;
|
|
3901
|
-
|
|
3974
|
+
styled(Box)`
|
|
3902
3975
|
margin-bottom: 32px;
|
|
3903
3976
|
|
|
3904
3977
|
&:last-child {
|
|
3905
3978
|
margin-bottom: 0;
|
|
3906
3979
|
}
|
|
3907
3980
|
`;
|
|
3908
|
-
|
|
3981
|
+
styled(Flex)`
|
|
3909
3982
|
align-items: center;
|
|
3910
3983
|
gap: 12px;
|
|
3911
3984
|
margin-bottom: 16px;
|
|
3912
3985
|
`;
|
|
3913
|
-
|
|
3986
|
+
styled(Typography)`
|
|
3914
3987
|
font-size: 15px;
|
|
3915
3988
|
font-weight: 600;
|
|
3916
3989
|
color: ${(props) => props.theme.colors.neutral800};
|
|
@@ -4293,8 +4366,34 @@ const StyledSearchInput = styled(TextInput)`
|
|
|
4293
4366
|
width: 100%;
|
|
4294
4367
|
padding-left: 36px;
|
|
4295
4368
|
`;
|
|
4369
|
+
const TableWrapper = styled(Box)`
|
|
4370
|
+
overflow-x: auto;
|
|
4371
|
+
border-radius: ${theme$1.borderRadius.lg};
|
|
4372
|
+
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
4373
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
4374
|
+
|
|
4375
|
+
&::-webkit-scrollbar {
|
|
4376
|
+
height: 8px;
|
|
4377
|
+
}
|
|
4378
|
+
|
|
4379
|
+
&::-webkit-scrollbar-track {
|
|
4380
|
+
background: ${(props) => props.theme.colors.neutral100};
|
|
4381
|
+
border-radius: 4px;
|
|
4382
|
+
}
|
|
4383
|
+
|
|
4384
|
+
&::-webkit-scrollbar-thumb {
|
|
4385
|
+
background: ${(props) => props.theme.colors.neutral300};
|
|
4386
|
+
border-radius: 4px;
|
|
4387
|
+
|
|
4388
|
+
&:hover {
|
|
4389
|
+
background: ${(props) => props.theme.colors.neutral400};
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
`;
|
|
4296
4393
|
const StyledTable$1 = styled(Table)`
|
|
4297
4394
|
width: 100%;
|
|
4395
|
+
min-width: 900px;
|
|
4396
|
+
|
|
4298
4397
|
thead {
|
|
4299
4398
|
background: ${(props) => props.theme.colors.neutral100};
|
|
4300
4399
|
border-bottom: 2px solid ${(props) => props.theme.colors.neutral200};
|
|
@@ -4302,10 +4401,11 @@ const StyledTable$1 = styled(Table)`
|
|
|
4302
4401
|
th {
|
|
4303
4402
|
font-weight: 600;
|
|
4304
4403
|
color: ${(props) => props.theme.colors.neutral800};
|
|
4305
|
-
font-size: 0.
|
|
4404
|
+
font-size: 0.75rem;
|
|
4306
4405
|
text-transform: uppercase;
|
|
4307
4406
|
letter-spacing: 0.025em;
|
|
4308
|
-
padding:
|
|
4407
|
+
padding: 12px 16px;
|
|
4408
|
+
white-space: nowrap;
|
|
4309
4409
|
}
|
|
4310
4410
|
}
|
|
4311
4411
|
|
|
@@ -4322,12 +4422,42 @@ const StyledTable$1 = styled(Table)`
|
|
|
4322
4422
|
}
|
|
4323
4423
|
|
|
4324
4424
|
td {
|
|
4325
|
-
padding:
|
|
4425
|
+
padding: 10px 12px;
|
|
4326
4426
|
color: ${(props) => props.theme.colors.neutral800};
|
|
4327
4427
|
vertical-align: middle;
|
|
4428
|
+
font-size: 13px;
|
|
4328
4429
|
}
|
|
4329
4430
|
}
|
|
4330
4431
|
`;
|
|
4432
|
+
const PaginationWrapper = styled(Flex)`
|
|
4433
|
+
padding: 16px 20px;
|
|
4434
|
+
background: ${(props) => props.theme.colors.neutral100};
|
|
4435
|
+
border-top: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
4436
|
+
border-radius: 0 0 ${theme$1.borderRadius.lg} ${theme$1.borderRadius.lg};
|
|
4437
|
+
`;
|
|
4438
|
+
const PaginationButton = styled.button`
|
|
4439
|
+
background: ${(props) => props.active ? "linear-gradient(135deg, #0EA5E9 0%, #A855F7 100%)" : "white"};
|
|
4440
|
+
color: ${(props) => props.active ? "white" : props.theme.colors.neutral700};
|
|
4441
|
+
border: 1px solid ${(props) => props.active ? "transparent" : props.theme.colors.neutral300};
|
|
4442
|
+
padding: 6px 12px;
|
|
4443
|
+
min-width: 36px;
|
|
4444
|
+
height: 36px;
|
|
4445
|
+
border-radius: 8px;
|
|
4446
|
+
font-weight: 500;
|
|
4447
|
+
font-size: 13px;
|
|
4448
|
+
cursor: pointer;
|
|
4449
|
+
transition: all 0.2s ease;
|
|
4450
|
+
|
|
4451
|
+
&:hover:not(:disabled) {
|
|
4452
|
+
background: ${(props) => props.active ? "linear-gradient(135deg, #0284C7 0%, #9333EA 100%)" : props.theme.colors.neutral100};
|
|
4453
|
+
border-color: ${(props) => props.active ? "transparent" : props.theme.colors.neutral400};
|
|
4454
|
+
}
|
|
4455
|
+
|
|
4456
|
+
&:disabled {
|
|
4457
|
+
opacity: 0.5;
|
|
4458
|
+
cursor: not-allowed;
|
|
4459
|
+
}
|
|
4460
|
+
`;
|
|
4331
4461
|
const EmptyState$1 = styled(Box)`
|
|
4332
4462
|
background: ${(props) => props.theme.colors.neutral0};
|
|
4333
4463
|
border-radius: ${theme$1.borderRadius.xl};
|
|
@@ -4422,6 +4552,120 @@ const EmptyButtonGroup = styled.div`
|
|
|
4422
4552
|
const HiddenFileInput = styled.input`
|
|
4423
4553
|
display: none;
|
|
4424
4554
|
`;
|
|
4555
|
+
const StyledModalContent = styled(Modal.Content)`
|
|
4556
|
+
&& {
|
|
4557
|
+
border-radius: 16px;
|
|
4558
|
+
overflow: hidden;
|
|
4559
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
4560
|
+
max-width: 480px;
|
|
4561
|
+
}
|
|
4562
|
+
`;
|
|
4563
|
+
const StyledModalHeader = styled(Modal.Header)`
|
|
4564
|
+
&& {
|
|
4565
|
+
background: linear-gradient(135deg, ${theme$1.colors.primary[500]} 0%, ${theme$1.colors.secondary[500]} 100%);
|
|
4566
|
+
padding: 24px 28px;
|
|
4567
|
+
border-bottom: none;
|
|
4568
|
+
|
|
4569
|
+
h2 {
|
|
4570
|
+
color: white;
|
|
4571
|
+
font-size: 1.25rem;
|
|
4572
|
+
font-weight: 700;
|
|
4573
|
+
}
|
|
4574
|
+
|
|
4575
|
+
/* Close button styling */
|
|
4576
|
+
button {
|
|
4577
|
+
color: white !important;
|
|
4578
|
+
opacity: 0.9;
|
|
4579
|
+
background: rgba(255, 255, 255, 0.15) !important;
|
|
4580
|
+
border-radius: 8px;
|
|
4581
|
+
|
|
4582
|
+
&:hover {
|
|
4583
|
+
opacity: 1;
|
|
4584
|
+
background: rgba(255, 255, 255, 0.25) !important;
|
|
4585
|
+
}
|
|
4586
|
+
|
|
4587
|
+
svg {
|
|
4588
|
+
fill: white !important;
|
|
4589
|
+
color: white !important;
|
|
4590
|
+
|
|
4591
|
+
path {
|
|
4592
|
+
fill: white !important;
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
}
|
|
4596
|
+
}
|
|
4597
|
+
`;
|
|
4598
|
+
const StyledModalBody = styled(Modal.Body)`
|
|
4599
|
+
&& {
|
|
4600
|
+
padding: 28px;
|
|
4601
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
4602
|
+
}
|
|
4603
|
+
`;
|
|
4604
|
+
const ModalField = styled(Box)`
|
|
4605
|
+
margin-bottom: 20px;
|
|
4606
|
+
|
|
4607
|
+
&:last-child {
|
|
4608
|
+
margin-bottom: 0;
|
|
4609
|
+
}
|
|
4610
|
+
`;
|
|
4611
|
+
const ModalLabel = styled(Typography)`
|
|
4612
|
+
&& {
|
|
4613
|
+
font-weight: 600;
|
|
4614
|
+
font-size: 13px;
|
|
4615
|
+
color: ${(props) => props.theme.colors.neutral700};
|
|
4616
|
+
margin-bottom: 8px;
|
|
4617
|
+
display: block;
|
|
4618
|
+
}
|
|
4619
|
+
`;
|
|
4620
|
+
const ModalHint = styled(Typography)`
|
|
4621
|
+
&& {
|
|
4622
|
+
font-size: 12px;
|
|
4623
|
+
color: ${(props) => props.theme.colors.neutral600};
|
|
4624
|
+
margin-top: 6px;
|
|
4625
|
+
display: block;
|
|
4626
|
+
}
|
|
4627
|
+
`;
|
|
4628
|
+
const ModalTemplateInfo = styled(Box)`
|
|
4629
|
+
background: linear-gradient(135deg, ${theme$1.colors.primary[50]} 0%, ${theme$1.colors.secondary[50]} 100%);
|
|
4630
|
+
border: 1px solid ${theme$1.colors.primary[100]};
|
|
4631
|
+
border-radius: 10px;
|
|
4632
|
+
padding: 14px 16px;
|
|
4633
|
+
|
|
4634
|
+
p {
|
|
4635
|
+
margin: 0;
|
|
4636
|
+
font-weight: 500;
|
|
4637
|
+
color: ${(props) => props.theme.colors.neutral800};
|
|
4638
|
+
}
|
|
4639
|
+
`;
|
|
4640
|
+
const StyledSelect = styled.select`
|
|
4641
|
+
width: 100%;
|
|
4642
|
+
padding: 10px 14px;
|
|
4643
|
+
border-radius: 8px;
|
|
4644
|
+
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
4645
|
+
font-size: 14px;
|
|
4646
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
4647
|
+
cursor: pointer;
|
|
4648
|
+
transition: all ${theme$1.transitions.fast};
|
|
4649
|
+
color: ${(props) => props.theme.colors.neutral700};
|
|
4650
|
+
|
|
4651
|
+
&:hover {
|
|
4652
|
+
border-color: ${theme$1.colors.primary[500]};
|
|
4653
|
+
}
|
|
4654
|
+
|
|
4655
|
+
&:focus {
|
|
4656
|
+
outline: none;
|
|
4657
|
+
border-color: ${theme$1.colors.primary[500]};
|
|
4658
|
+
box-shadow: 0 0 0 3px ${theme$1.colors.primary[100]};
|
|
4659
|
+
}
|
|
4660
|
+
`;
|
|
4661
|
+
const StyledModalFooter = styled(Modal.Footer)`
|
|
4662
|
+
&& {
|
|
4663
|
+
padding: 20px 28px;
|
|
4664
|
+
background: ${(props) => props.theme.colors.neutral100};
|
|
4665
|
+
border-top: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
4666
|
+
gap: 12px;
|
|
4667
|
+
}
|
|
4668
|
+
`;
|
|
4425
4669
|
const TemplateList = () => {
|
|
4426
4670
|
const { get, del, post } = useFetchClient();
|
|
4427
4671
|
const { toggleNotification } = useNotification();
|
|
@@ -4439,6 +4683,8 @@ const TemplateList = () => {
|
|
|
4439
4683
|
const [limits, setLimits] = useState(null);
|
|
4440
4684
|
const [showTestSendModal, setShowTestSendModal] = useState(false);
|
|
4441
4685
|
const [testEmail, setTestEmail] = useState("");
|
|
4686
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
4687
|
+
const [itemsPerPage, setItemsPerPage] = useState(10);
|
|
4442
4688
|
const [testAccount, setTestAccount] = useState("");
|
|
4443
4689
|
const [accounts, setAccounts] = useState([]);
|
|
4444
4690
|
const fileInputRef = useRef(null);
|
|
@@ -4723,6 +4969,12 @@ const TemplateList = () => {
|
|
|
4723
4969
|
const filteredTemplates = templates.filter(
|
|
4724
4970
|
(t) => t.name.toLowerCase().includes(searchTerm.toLowerCase()) || t.subject.toLowerCase().includes(searchTerm.toLowerCase()) || t.templateReferenceId.toString().includes(searchTerm)
|
|
4725
4971
|
);
|
|
4972
|
+
const totalPages = Math.ceil(filteredTemplates.length / itemsPerPage);
|
|
4973
|
+
const startIndex = (currentPage - 1) * itemsPerPage;
|
|
4974
|
+
const paginatedTemplates = filteredTemplates.slice(startIndex, startIndex + itemsPerPage);
|
|
4975
|
+
useEffect(() => {
|
|
4976
|
+
setCurrentPage(1);
|
|
4977
|
+
}, [searchTerm]);
|
|
4726
4978
|
const showSkeleton = loading && templates.length === 0;
|
|
4727
4979
|
return /* @__PURE__ */ jsxs(Container$2, { children: [
|
|
4728
4980
|
/* @__PURE__ */ jsx(Header$2, { children: /* @__PURE__ */ jsx(HeaderContent$1, { justifyContent: "flex-start", alignItems: "center", children: /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -4856,20 +5108,18 @@ const TemplateList = () => {
|
|
|
4856
5108
|
] }),
|
|
4857
5109
|
/* @__PURE__ */ jsxs(EmptyButtonGroup, { children: [
|
|
4858
5110
|
/* @__PURE__ */ jsx(
|
|
4859
|
-
|
|
5111
|
+
CTAButton,
|
|
4860
5112
|
{
|
|
4861
5113
|
startIcon: /* @__PURE__ */ jsx(PlusIcon, { style: { width: 20, height: 20 } }),
|
|
4862
5114
|
onClick: handleCreateTemplate,
|
|
4863
|
-
size: "L",
|
|
4864
5115
|
children: "Create Your First Template"
|
|
4865
5116
|
}
|
|
4866
5117
|
),
|
|
4867
5118
|
/* @__PURE__ */ jsx(
|
|
4868
|
-
|
|
5119
|
+
SecondaryButton,
|
|
4869
5120
|
{
|
|
4870
5121
|
startIcon: /* @__PURE__ */ jsx(ArrowUpTrayIcon, { style: { width: 20, height: 20 } }),
|
|
4871
5122
|
onClick: () => fileInputRef.current?.click(),
|
|
4872
|
-
size: "L",
|
|
4873
5123
|
children: "Import Template"
|
|
4874
5124
|
}
|
|
4875
5125
|
)
|
|
@@ -4878,11 +5128,10 @@ const TemplateList = () => {
|
|
|
4878
5128
|
/* @__PURE__ */ jsx(SectionHeader, { children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, children: [
|
|
4879
5129
|
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral700", style: { fontSize: "1.5rem", fontWeight: 600 }, children: "Email Templates" }),
|
|
4880
5130
|
/* @__PURE__ */ jsx(
|
|
4881
|
-
|
|
5131
|
+
GradientButton$1,
|
|
4882
5132
|
{
|
|
4883
5133
|
startIcon: /* @__PURE__ */ jsx(PlusIcon, { style: { width: 20, height: 20 } }),
|
|
4884
5134
|
onClick: handleCreateTemplate,
|
|
4885
|
-
size: "L",
|
|
4886
5135
|
children: "Create Template"
|
|
4887
5136
|
}
|
|
4888
5137
|
)
|
|
@@ -4901,125 +5150,182 @@ const TemplateList = () => {
|
|
|
4901
5150
|
)
|
|
4902
5151
|
] }),
|
|
4903
5152
|
/* @__PURE__ */ jsx(
|
|
4904
|
-
|
|
5153
|
+
SecondaryButton,
|
|
4905
5154
|
{
|
|
4906
|
-
startIcon: /* @__PURE__ */ jsx(ArrowUpTrayIcon, { style: { width:
|
|
5155
|
+
startIcon: /* @__PURE__ */ jsx(ArrowUpTrayIcon, { style: { width: 16, height: 16 } }),
|
|
4907
5156
|
onClick: () => fileInputRef.current?.click(),
|
|
4908
|
-
size: "L",
|
|
4909
5157
|
children: "Import"
|
|
4910
5158
|
}
|
|
4911
5159
|
),
|
|
4912
5160
|
/* @__PURE__ */ jsx(
|
|
4913
|
-
|
|
5161
|
+
TertiaryButton,
|
|
4914
5162
|
{
|
|
4915
|
-
startIcon: /* @__PURE__ */ jsx(ArrowDownTrayIcon, { style: { width:
|
|
5163
|
+
startIcon: /* @__PURE__ */ jsx(ArrowDownTrayIcon, { style: { width: 16, height: 16 } }),
|
|
4916
5164
|
onClick: handleExport,
|
|
4917
5165
|
disabled: templates.length === 0,
|
|
4918
|
-
size: "L",
|
|
4919
5166
|
children: "Export"
|
|
4920
5167
|
}
|
|
4921
5168
|
)
|
|
4922
5169
|
] }),
|
|
4923
|
-
filteredTemplates.length > 0 ? /* @__PURE__ */
|
|
4924
|
-
/* @__PURE__ */
|
|
4925
|
-
/* @__PURE__ */ jsx(
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
] }) }),
|
|
4932
|
-
/* @__PURE__ */ jsx(Tbody, { children: filteredTemplates.map((template) => /* @__PURE__ */ jsxs(Tr, { children: [
|
|
4933
|
-
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsxs(Typography, { variant: "omega", fontWeight: "bold", children: [
|
|
4934
|
-
"#",
|
|
4935
|
-
template.templateReferenceId
|
|
5170
|
+
filteredTemplates.length > 0 ? /* @__PURE__ */ jsxs(TableWrapper, { children: [
|
|
5171
|
+
/* @__PURE__ */ jsxs(StyledTable$1, { colCount: 5, rowCount: paginatedTemplates.length, children: [
|
|
5172
|
+
/* @__PURE__ */ jsx(Thead, { children: /* @__PURE__ */ jsxs(Tr, { children: [
|
|
5173
|
+
/* @__PURE__ */ jsx(Th, { style: { width: "100px" }, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "ID" }) }),
|
|
5174
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Name" }) }),
|
|
5175
|
+
/* @__PURE__ */ jsx(Th, { style: { width: "100px" }, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Category" }) }),
|
|
5176
|
+
/* @__PURE__ */ jsx(Th, { style: { width: "80px" }, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Status" }) }),
|
|
5177
|
+
/* @__PURE__ */ jsx(Th, { style: { width: "260px" }, children: /* @__PURE__ */ jsx(Box, { style: { textAlign: "right", width: "100%" }, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Actions" }) }) })
|
|
4936
5178
|
] }) }),
|
|
4937
|
-
/* @__PURE__ */ jsx(
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
/* @__PURE__ */ jsx(
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
5179
|
+
/* @__PURE__ */ jsx(Tbody, { children: paginatedTemplates.map((template) => /* @__PURE__ */ jsxs(Tr, { children: [
|
|
5180
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsxs(Typography, { variant: "omega", fontWeight: "bold", style: { fontSize: "13px" }, children: [
|
|
5181
|
+
"#",
|
|
5182
|
+
template.templateReferenceId
|
|
5183
|
+
] }) }),
|
|
5184
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { fontSize: "13px" }, children: template.name }) }),
|
|
5185
|
+
/* @__PURE__ */ jsx(Td, { children: getCategoryBadge(template.category) }),
|
|
5186
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Badge, { backgroundColor: template.isActive ? "success" : "neutral", children: template.isActive ? "ACTIVE" : "INACTIVE" }) }),
|
|
5187
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsxs(Flex, { gap: 2, justifyContent: "flex-end", children: [
|
|
5188
|
+
/* @__PURE__ */ jsx(
|
|
5189
|
+
IconButtonPrimary,
|
|
5190
|
+
{
|
|
5191
|
+
onClick: () => navigate(`/plugins/magic-mail/designer/${template.id}`),
|
|
5192
|
+
"aria-label": "Edit Template",
|
|
5193
|
+
title: "Edit Template",
|
|
5194
|
+
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
5195
|
+
}
|
|
5196
|
+
),
|
|
5197
|
+
/* @__PURE__ */ jsx(
|
|
5198
|
+
IconButton,
|
|
5199
|
+
{
|
|
5200
|
+
onClick: () => handleDownload(template.id, "html"),
|
|
5201
|
+
"aria-label": "Download HTML",
|
|
5202
|
+
title: "Download as HTML",
|
|
5203
|
+
children: /* @__PURE__ */ jsx(DocumentArrowDownIcon, {})
|
|
5204
|
+
}
|
|
5205
|
+
),
|
|
5206
|
+
/* @__PURE__ */ jsx(
|
|
5207
|
+
IconButton,
|
|
5208
|
+
{
|
|
5209
|
+
onClick: () => handleDownload(template.id, "json"),
|
|
5210
|
+
"aria-label": "Download JSON",
|
|
5211
|
+
title: "Download as JSON",
|
|
5212
|
+
children: /* @__PURE__ */ jsx(CodeBracketIcon, {})
|
|
5213
|
+
}
|
|
5214
|
+
),
|
|
5215
|
+
/* @__PURE__ */ jsx(
|
|
5216
|
+
IconButton,
|
|
5217
|
+
{
|
|
5218
|
+
onClick: () => handleDuplicate(template.id, template.name),
|
|
5219
|
+
"aria-label": "Duplicate Template",
|
|
5220
|
+
title: "Duplicate Template",
|
|
5221
|
+
children: /* @__PURE__ */ jsx(DocumentDuplicateIcon, {})
|
|
5222
|
+
}
|
|
5223
|
+
),
|
|
5224
|
+
/* @__PURE__ */ jsx(
|
|
5225
|
+
IconButtonPurple,
|
|
5226
|
+
{
|
|
5227
|
+
onClick: () => {
|
|
5228
|
+
setSelectedTemplate(template);
|
|
5229
|
+
setShowCodeExample(true);
|
|
5230
|
+
},
|
|
5231
|
+
"aria-label": "Code Example",
|
|
5232
|
+
title: "View Code Example",
|
|
5233
|
+
children: /* @__PURE__ */ jsx(BoltIcon, {})
|
|
5234
|
+
}
|
|
5235
|
+
),
|
|
5236
|
+
/* @__PURE__ */ jsx(
|
|
5237
|
+
IconButtonSuccess,
|
|
5238
|
+
{
|
|
5239
|
+
onClick: () => handleTestSend(template),
|
|
5240
|
+
"aria-label": "Send Test Email",
|
|
5241
|
+
title: "Send Test Email",
|
|
5242
|
+
children: /* @__PURE__ */ jsx(PaperAirplaneIcon, {})
|
|
5243
|
+
}
|
|
5244
|
+
),
|
|
5245
|
+
/* @__PURE__ */ jsx(
|
|
5246
|
+
IconButtonDanger,
|
|
5247
|
+
{
|
|
5248
|
+
onClick: () => handleDelete(template.id, template.name),
|
|
5249
|
+
"aria-label": "Delete Template",
|
|
5250
|
+
title: "Delete Template",
|
|
5251
|
+
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
5252
|
+
}
|
|
5253
|
+
)
|
|
5254
|
+
] }) })
|
|
5255
|
+
] }, template.id)) })
|
|
5256
|
+
] }),
|
|
5257
|
+
totalPages > 1 && /* @__PURE__ */ jsxs(PaginationWrapper, { justifyContent: "space-between", alignItems: "center", children: [
|
|
5258
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 3, alignItems: "center", children: [
|
|
5259
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
5260
|
+
"Showing ",
|
|
5261
|
+
startIndex + 1,
|
|
5262
|
+
"-",
|
|
5263
|
+
Math.min(startIndex + itemsPerPage, filteredTemplates.length),
|
|
5264
|
+
" of ",
|
|
5265
|
+
filteredTemplates.length
|
|
5266
|
+
] }),
|
|
5267
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
|
|
5268
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "per page:" }),
|
|
5269
|
+
/* @__PURE__ */ jsxs(
|
|
5270
|
+
StyledSelect,
|
|
5271
|
+
{
|
|
5272
|
+
value: itemsPerPage,
|
|
5273
|
+
onChange: (e) => {
|
|
5274
|
+
setItemsPerPage(Number(e.target.value));
|
|
5275
|
+
setCurrentPage(1);
|
|
5276
|
+
},
|
|
5277
|
+
style: { width: "70px", padding: "4px 8px", fontSize: "12px" },
|
|
5278
|
+
children: [
|
|
5279
|
+
/* @__PURE__ */ jsx("option", { value: 5, children: "5" }),
|
|
5280
|
+
/* @__PURE__ */ jsx("option", { value: 10, children: "10" }),
|
|
5281
|
+
/* @__PURE__ */ jsx("option", { value: 25, children: "25" }),
|
|
5282
|
+
/* @__PURE__ */ jsx("option", { value: 50, children: "50" })
|
|
5283
|
+
]
|
|
5284
|
+
}
|
|
5285
|
+
)
|
|
5286
|
+
] })
|
|
5287
|
+
] }),
|
|
5288
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
4963
5289
|
/* @__PURE__ */ jsx(
|
|
4964
|
-
|
|
5290
|
+
PaginationButton,
|
|
4965
5291
|
{
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
"aria-label": "Download JSON",
|
|
4970
|
-
title: "Download as JSON",
|
|
4971
|
-
children: /* @__PURE__ */ jsx(CodeBracketIcon, { style: { width: 16, height: 16 } })
|
|
5292
|
+
onClick: () => setCurrentPage((p) => Math.max(1, p - 1)),
|
|
5293
|
+
disabled: currentPage === 1,
|
|
5294
|
+
children: "Previous"
|
|
4972
5295
|
}
|
|
4973
5296
|
),
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
{
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
5297
|
+
Array.from({ length: Math.min(5, totalPages) }, (_, i) => {
|
|
5298
|
+
let pageNum;
|
|
5299
|
+
if (totalPages <= 5) {
|
|
5300
|
+
pageNum = i + 1;
|
|
5301
|
+
} else if (currentPage <= 3) {
|
|
5302
|
+
pageNum = i + 1;
|
|
5303
|
+
} else if (currentPage >= totalPages - 2) {
|
|
5304
|
+
pageNum = totalPages - 4 + i;
|
|
5305
|
+
} else {
|
|
5306
|
+
pageNum = currentPage - 2 + i;
|
|
4983
5307
|
}
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
setSelectedTemplate(template);
|
|
4991
|
-
setShowCodeExample(true);
|
|
5308
|
+
return /* @__PURE__ */ jsx(
|
|
5309
|
+
PaginationButton,
|
|
5310
|
+
{
|
|
5311
|
+
active: currentPage === pageNum,
|
|
5312
|
+
onClick: () => setCurrentPage(pageNum),
|
|
5313
|
+
children: pageNum
|
|
4992
5314
|
},
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
children: /* @__PURE__ */ jsx(BoltIcon, { style: { width: 16, height: 16 } })
|
|
4997
|
-
}
|
|
4998
|
-
),
|
|
5315
|
+
pageNum
|
|
5316
|
+
);
|
|
5317
|
+
}),
|
|
4999
5318
|
/* @__PURE__ */ jsx(
|
|
5000
|
-
|
|
5001
|
-
{
|
|
5002
|
-
variant: "success-light",
|
|
5003
|
-
onClick: () => handleTestSend(template),
|
|
5004
|
-
size: "S",
|
|
5005
|
-
"aria-label": "Send Test Email",
|
|
5006
|
-
title: "Send Test Email",
|
|
5007
|
-
children: /* @__PURE__ */ jsx(PaperAirplaneIcon, { style: { width: 16, height: 16 } })
|
|
5008
|
-
}
|
|
5009
|
-
),
|
|
5010
|
-
/* @__PURE__ */ jsx(
|
|
5011
|
-
Button,
|
|
5319
|
+
PaginationButton,
|
|
5012
5320
|
{
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
"aria-label": "Delete Template",
|
|
5017
|
-
children: /* @__PURE__ */ jsx(TrashIcon, { style: { width: 16, height: 16 } })
|
|
5321
|
+
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
5322
|
+
disabled: currentPage === totalPages,
|
|
5323
|
+
children: "Next"
|
|
5018
5324
|
}
|
|
5019
5325
|
)
|
|
5020
|
-
] })
|
|
5021
|
-
] }
|
|
5022
|
-
] })
|
|
5326
|
+
] })
|
|
5327
|
+
] })
|
|
5328
|
+
] }) : /* @__PURE__ */ jsxs(
|
|
5023
5329
|
Box,
|
|
5024
5330
|
{
|
|
5025
5331
|
background: "neutral100",
|
|
@@ -5065,13 +5371,12 @@ const TemplateList = () => {
|
|
|
5065
5371
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px" }, children: coreEmail.description })
|
|
5066
5372
|
] }) }),
|
|
5067
5373
|
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Flex, { gap: 2, justifyContent: "flex-end", children: /* @__PURE__ */ jsx(
|
|
5068
|
-
|
|
5374
|
+
IconButtonPrimary,
|
|
5069
5375
|
{
|
|
5070
|
-
variant: "secondary",
|
|
5071
5376
|
onClick: () => navigate(`/plugins/magic-mail/designer/core/${coreEmail.type}`),
|
|
5072
|
-
size: "S",
|
|
5073
5377
|
"aria-label": "Edit Core Email",
|
|
5074
|
-
|
|
5378
|
+
title: "Edit Template",
|
|
5379
|
+
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
5075
5380
|
}
|
|
5076
5381
|
) }) })
|
|
5077
5382
|
] }, coreEmail.type)) })
|
|
@@ -5083,81 +5388,93 @@ const TemplateList = () => {
|
|
|
5083
5388
|
width: "90vw",
|
|
5084
5389
|
maxHeight: "85vh",
|
|
5085
5390
|
display: "flex",
|
|
5086
|
-
flexDirection: "column"
|
|
5391
|
+
flexDirection: "column",
|
|
5392
|
+
borderRadius: "16px",
|
|
5393
|
+
overflow: "hidden"
|
|
5087
5394
|
}, children: [
|
|
5088
|
-
/* @__PURE__ */ jsx(
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
"Send Template: ",
|
|
5092
|
-
selectedTemplate.name
|
|
5093
|
-
] })
|
|
5395
|
+
/* @__PURE__ */ jsx(StyledModalHeader, { children: /* @__PURE__ */ jsxs(Modal.Title, { children: [
|
|
5396
|
+
"Code Snippets: ",
|
|
5397
|
+
selectedTemplate.name
|
|
5094
5398
|
] }) }),
|
|
5095
5399
|
/* @__PURE__ */ jsxs(ScrollableDialogBody, { children: [
|
|
5096
|
-
/* @__PURE__ */ jsxs(
|
|
5097
|
-
/* @__PURE__ */ jsxs(
|
|
5098
|
-
/* @__PURE__ */
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
] }),
|
|
5102
|
-
/* @__PURE__ */ jsx(RecommendedBadge, { children: "Empfohlen" })
|
|
5400
|
+
/* @__PURE__ */ jsx(InfoBox$1, { style: { marginTop: 0, marginBottom: "20px" }, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5401
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "pi", style: { color: theme$1.colors.primary[700] }, children: [
|
|
5402
|
+
/* @__PURE__ */ jsx("strong", { children: "Template ID:" }),
|
|
5403
|
+
" #",
|
|
5404
|
+
selectedTemplate.templateReferenceId
|
|
5103
5405
|
] }),
|
|
5104
|
-
/* @__PURE__ */
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5406
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "pi", style: { color: theme$1.colors.primary[700] }, children: [
|
|
5407
|
+
/* @__PURE__ */ jsx("strong", { children: "Status:" }),
|
|
5408
|
+
" ",
|
|
5409
|
+
selectedTemplate.isActive ? "Active" : "Inactive"
|
|
5410
|
+
] })
|
|
5411
|
+
] }) }),
|
|
5412
|
+
!selectedTemplate.isActive && /* @__PURE__ */ jsxs(WarningBox, { style: { marginTop: 0, marginBottom: "20px" }, children: [
|
|
5413
|
+
/* @__PURE__ */ jsx(SparklesIcon, { style: { width: 20, height: 20, color: theme$1.colors.warning[600] } }),
|
|
5414
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "pi", style: { color: theme$1.colors.warning[700], fontWeight: 500 }, children: [
|
|
5415
|
+
"This template is currently ",
|
|
5416
|
+
/* @__PURE__ */ jsx("strong", { children: "INACTIVE" }),
|
|
5417
|
+
" and will not be sent."
|
|
5418
|
+
] })
|
|
5419
|
+
] }),
|
|
5420
|
+
/* @__PURE__ */ jsxs(Accordion.Root, { defaultValue: "native", collapsible: true, children: [
|
|
5421
|
+
/* @__PURE__ */ jsxs(Accordion.Item, { value: "native", children: [
|
|
5422
|
+
/* @__PURE__ */ jsx(Accordion.Header, { children: /* @__PURE__ */ jsx(Accordion.Trigger, { icon: () => /* @__PURE__ */ jsx(CheckCircleIcon, { style: { width: 16, height: 16, color: theme$1.colors.success[600] } }), children: /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
|
|
5423
|
+
"Native Strapi Email Service",
|
|
5424
|
+
/* @__PURE__ */ jsx(RecommendedBadge, { children: "Recommended" })
|
|
5425
|
+
] }) }) }),
|
|
5426
|
+
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsxs(Box, { padding: 4, children: [
|
|
5427
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "16px", display: "block" }, children: "Use the standard Strapi Email function. MagicMail intercepts it automatically and applies all features." }),
|
|
5428
|
+
/* @__PURE__ */ jsxs(CodeBlockWrapper, { children: [
|
|
5429
|
+
/* @__PURE__ */ jsx(CodeBlock, { dangerouslySetInnerHTML: {
|
|
5430
|
+
__html: `<span class="comment">// Anywhere in your Strapi backend:</span>
|
|
5108
5431
|
<span class="keyword">await</span> strapi.plugins.email.services.email.<span class="function">send</span>({
|
|
5109
5432
|
<span class="keyword">to</span>: <span class="string">'user@example.com'</span>,
|
|
5110
|
-
<span class="keyword">subject</span>: <span class="string">'
|
|
5111
|
-
<span class="keyword">templateId</span>: <span class="number">${selectedTemplate.templateReferenceId}</span>, <span class="comment">//
|
|
5433
|
+
<span class="keyword">subject</span>: <span class="string">'Your Subject'</span>, <span class="comment">// Optional (overridden by template)</span>
|
|
5434
|
+
<span class="keyword">templateId</span>: <span class="number">${selectedTemplate.templateReferenceId}</span>, <span class="comment">// Template ID</span>
|
|
5112
5435
|
<span class="keyword">data</span>: {
|
|
5113
5436
|
<span class="keyword">name</span>: <span class="string">'John Doe'</span>,
|
|
5114
5437
|
<span class="keyword">code</span>: <span class="string">'123456'</span>,
|
|
5115
|
-
<span class="comment">// ...
|
|
5438
|
+
<span class="comment">// ... your dynamic variables</span>
|
|
5116
5439
|
}
|
|
5117
|
-
})
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
{
|
|
5127
|
-
size: "S",
|
|
5128
|
-
variant: "ghost",
|
|
5129
|
-
onClick: () => handleCopyCode(
|
|
5130
|
-
`await strapi.plugins.email.services.email.send({
|
|
5440
|
+
});`
|
|
5441
|
+
} }),
|
|
5442
|
+
/* @__PURE__ */ jsx(
|
|
5443
|
+
CopyButton,
|
|
5444
|
+
{
|
|
5445
|
+
size: "S",
|
|
5446
|
+
variant: "ghost",
|
|
5447
|
+
onClick: () => handleCopyCode(
|
|
5448
|
+
`await strapi.plugins.email.services.email.send({
|
|
5131
5449
|
to: 'user@example.com',
|
|
5132
|
-
subject: '
|
|
5450
|
+
subject: 'Your Subject',
|
|
5133
5451
|
templateId: ${selectedTemplate.templateReferenceId},
|
|
5134
5452
|
data: {
|
|
5135
5453
|
name: 'John Doe',
|
|
5136
5454
|
code: '123456'
|
|
5137
5455
|
}
|
|
5138
5456
|
});`,
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
/* @__PURE__ */
|
|
5154
|
-
/* @__PURE__ */ jsx(CodeBracketIcon, { style: { width:
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
__html: `<span class="comment">// Inside Strapi backend</span>
|
|
5457
|
+
"native"
|
|
5458
|
+
),
|
|
5459
|
+
children: copiedCode === "native" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5460
|
+
/* @__PURE__ */ jsx(CheckIcon, {}),
|
|
5461
|
+
" Copied!"
|
|
5462
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5463
|
+
/* @__PURE__ */ jsx(ClipboardDocumentIcon, {}),
|
|
5464
|
+
" Copy"
|
|
5465
|
+
] })
|
|
5466
|
+
}
|
|
5467
|
+
)
|
|
5468
|
+
] })
|
|
5469
|
+
] }) })
|
|
5470
|
+
] }),
|
|
5471
|
+
/* @__PURE__ */ jsxs(Accordion.Item, { value: "plugin", children: [
|
|
5472
|
+
/* @__PURE__ */ jsx(Accordion.Header, { children: /* @__PURE__ */ jsx(Accordion.Trigger, { icon: () => /* @__PURE__ */ jsx(CodeBracketIcon, { style: { width: 16, height: 16, color: theme$1.colors.primary[600] } }), children: "MagicMail Plugin Service" }) }),
|
|
5473
|
+
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsxs(Box, { padding: 4, children: [
|
|
5474
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "16px", display: "block" }, children: "Direct access to the MagicMail service for advanced options." }),
|
|
5475
|
+
/* @__PURE__ */ jsxs(CodeBlockWrapper, { children: [
|
|
5476
|
+
/* @__PURE__ */ jsx(CodeBlock, { dangerouslySetInnerHTML: {
|
|
5477
|
+
__html: `<span class="comment">// Inside Strapi backend</span>
|
|
5161
5478
|
<span class="keyword">await</span> strapi.<span class="function">plugin</span>(<span class="string">'magic-mail'</span>)
|
|
5162
5479
|
.<span class="function">service</span>(<span class="string">'email-router'</span>)
|
|
5163
5480
|
.<span class="function">send</span>({
|
|
@@ -5168,14 +5485,14 @@ const TemplateList = () => {
|
|
|
5168
5485
|
<span class="keyword">code</span>: <span class="string">'123456'</span>
|
|
5169
5486
|
}
|
|
5170
5487
|
});`
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5488
|
+
} }),
|
|
5489
|
+
/* @__PURE__ */ jsx(
|
|
5490
|
+
CopyButton,
|
|
5491
|
+
{
|
|
5492
|
+
size: "S",
|
|
5493
|
+
variant: "ghost",
|
|
5494
|
+
onClick: () => handleCopyCode(
|
|
5495
|
+
`await strapi.plugin('magic-mail')
|
|
5179
5496
|
.service('email-router')
|
|
5180
5497
|
.send({
|
|
5181
5498
|
to: 'user@example.com',
|
|
@@ -5185,28 +5502,27 @@ const TemplateList = () => {
|
|
|
5185
5502
|
code: '123456'
|
|
5186
5503
|
}
|
|
5187
5504
|
});`,
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
/* @__PURE__ */
|
|
5203
|
-
/* @__PURE__ */ jsx(DocumentArrowDownIcon, { style: { width:
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
__html: `curl -X POST http://localhost:1337/api/magic-mail/send \\
|
|
5505
|
+
"plugin"
|
|
5506
|
+
),
|
|
5507
|
+
children: copiedCode === "plugin" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5508
|
+
/* @__PURE__ */ jsx(CheckIcon, {}),
|
|
5509
|
+
" Copied!"
|
|
5510
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5511
|
+
/* @__PURE__ */ jsx(ClipboardDocumentIcon, {}),
|
|
5512
|
+
" Copy"
|
|
5513
|
+
] })
|
|
5514
|
+
}
|
|
5515
|
+
)
|
|
5516
|
+
] })
|
|
5517
|
+
] }) })
|
|
5518
|
+
] }),
|
|
5519
|
+
/* @__PURE__ */ jsxs(Accordion.Item, { value: "rest", children: [
|
|
5520
|
+
/* @__PURE__ */ jsx(Accordion.Header, { children: /* @__PURE__ */ jsx(Accordion.Trigger, { icon: () => /* @__PURE__ */ jsx(DocumentArrowDownIcon, { style: { width: 16, height: 16, color: theme$1.colors.secondary[600] } }), children: "REST API (cURL)" }) }),
|
|
5521
|
+
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsxs(Box, { padding: 4, children: [
|
|
5522
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "16px", display: "block" }, children: "For external applications, frontend calls, or Postman tests." }),
|
|
5523
|
+
/* @__PURE__ */ jsxs(CodeBlockWrapper, { children: [
|
|
5524
|
+
/* @__PURE__ */ jsx(CodeBlock, { dangerouslySetInnerHTML: {
|
|
5525
|
+
__html: `curl -X POST http://localhost:1337/api/magic-mail/send \\
|
|
5210
5526
|
-H <span class="string">"Content-Type: application/json"</span> \\
|
|
5211
5527
|
-H <span class="string">"Authorization: Bearer YOUR_API_TOKEN"</span> \\
|
|
5212
5528
|
-d <span class="string">'{
|
|
@@ -5217,14 +5533,14 @@ const TemplateList = () => {
|
|
|
5217
5533
|
"code": "123456"
|
|
5218
5534
|
}
|
|
5219
5535
|
}'</span>`
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5536
|
+
} }),
|
|
5537
|
+
/* @__PURE__ */ jsx(
|
|
5538
|
+
CopyButton,
|
|
5539
|
+
{
|
|
5540
|
+
size: "S",
|
|
5541
|
+
variant: "ghost",
|
|
5542
|
+
onClick: () => handleCopyCode(
|
|
5543
|
+
`curl -X POST http://localhost:1337/api/magic-mail/send \\
|
|
5228
5544
|
-H "Content-Type: application/json" \\
|
|
5229
5545
|
-H "Authorization: Bearer YOUR_API_TOKEN" \\
|
|
5230
5546
|
-d '{
|
|
@@ -5235,51 +5551,33 @@ const TemplateList = () => {
|
|
|
5235
5551
|
"code": "123456"
|
|
5236
5552
|
}
|
|
5237
5553
|
}'`,
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
/* @__PURE__ */ jsx(InfoBox$1, { children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5252
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "pi", style: { color: theme$1.colors.primary[700] }, children: [
|
|
5253
|
-
/* @__PURE__ */ jsx("strong", { children: "Template ID:" }),
|
|
5254
|
-
" #",
|
|
5255
|
-
selectedTemplate.templateReferenceId
|
|
5256
|
-
] }),
|
|
5257
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "pi", style: { color: theme$1.colors.primary[700] }, children: [
|
|
5258
|
-
/* @__PURE__ */ jsx("strong", { children: "Name:" }),
|
|
5259
|
-
" ",
|
|
5260
|
-
selectedTemplate.name
|
|
5261
|
-
] })
|
|
5262
|
-
] }) }),
|
|
5263
|
-
!selectedTemplate.isActive && /* @__PURE__ */ jsxs(WarningBox, { children: [
|
|
5264
|
-
/* @__PURE__ */ jsx(SparklesIcon, { style: { width: 20, height: 20, color: theme$1.colors.warning[600] } }),
|
|
5265
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "pi", style: { color: theme$1.colors.warning[700], fontWeight: 500 }, children: [
|
|
5266
|
-
"Dieses Template ist derzeit ",
|
|
5267
|
-
/* @__PURE__ */ jsx("strong", { children: "INAKTIV" }),
|
|
5268
|
-
" und wird nicht versendet."
|
|
5554
|
+
"curl"
|
|
5555
|
+
),
|
|
5556
|
+
children: copiedCode === "curl" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5557
|
+
/* @__PURE__ */ jsx(CheckIcon, {}),
|
|
5558
|
+
" Copied!"
|
|
5559
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5560
|
+
/* @__PURE__ */ jsx(ClipboardDocumentIcon, {}),
|
|
5561
|
+
" Copy"
|
|
5562
|
+
] })
|
|
5563
|
+
}
|
|
5564
|
+
)
|
|
5565
|
+
] })
|
|
5566
|
+
] }) })
|
|
5269
5567
|
] })
|
|
5270
5568
|
] })
|
|
5271
5569
|
] }),
|
|
5272
|
-
/* @__PURE__ */ jsx(
|
|
5570
|
+
/* @__PURE__ */ jsx(StyledModalFooter, { children: /* @__PURE__ */ jsx(TertiaryButton, { onClick: () => setShowCodeExample(false), children: "Close" }) })
|
|
5273
5571
|
] }) }),
|
|
5274
|
-
/* @__PURE__ */ jsx(Modal.Root, { open: showTestSendModal, onOpenChange: setShowTestSendModal, children: /* @__PURE__ */ jsxs(
|
|
5275
|
-
/* @__PURE__ */ jsx(
|
|
5276
|
-
/* @__PURE__ */
|
|
5277
|
-
/* @__PURE__ */ jsxs(
|
|
5278
|
-
/* @__PURE__ */ jsx(
|
|
5279
|
-
/* @__PURE__ */ jsx(
|
|
5572
|
+
/* @__PURE__ */ jsx(Modal.Root, { open: showTestSendModal, onOpenChange: setShowTestSendModal, children: /* @__PURE__ */ jsxs(StyledModalContent, { children: [
|
|
5573
|
+
/* @__PURE__ */ jsx(StyledModalHeader, { children: /* @__PURE__ */ jsx(Modal.Title, { children: "Send Test Email" }) }),
|
|
5574
|
+
/* @__PURE__ */ jsxs(StyledModalBody, { children: [
|
|
5575
|
+
/* @__PURE__ */ jsxs(ModalField, { children: [
|
|
5576
|
+
/* @__PURE__ */ jsx(ModalLabel, { children: "Template" }),
|
|
5577
|
+
/* @__PURE__ */ jsx(ModalTemplateInfo, { children: /* @__PURE__ */ jsx(Typography, { variant: "omega", children: selectedTemplate?.name }) })
|
|
5280
5578
|
] }),
|
|
5281
|
-
/* @__PURE__ */ jsxs(
|
|
5282
|
-
/* @__PURE__ */ jsx(
|
|
5579
|
+
/* @__PURE__ */ jsxs(ModalField, { children: [
|
|
5580
|
+
/* @__PURE__ */ jsx(ModalLabel, { children: "Recipient Email *" }),
|
|
5283
5581
|
/* @__PURE__ */ jsx(
|
|
5284
5582
|
TextInput,
|
|
5285
5583
|
{
|
|
@@ -5290,20 +5588,11 @@ const TemplateList = () => {
|
|
|
5290
5588
|
}
|
|
5291
5589
|
)
|
|
5292
5590
|
] }),
|
|
5293
|
-
/* @__PURE__ */ jsxs(
|
|
5294
|
-
/* @__PURE__ */ jsx(
|
|
5591
|
+
/* @__PURE__ */ jsxs(ModalField, { children: [
|
|
5592
|
+
/* @__PURE__ */ jsx(ModalLabel, { children: "Send from Account (optional)" }),
|
|
5295
5593
|
/* @__PURE__ */ jsxs(
|
|
5296
|
-
|
|
5594
|
+
StyledSelect,
|
|
5297
5595
|
{
|
|
5298
|
-
style: {
|
|
5299
|
-
width: "100%",
|
|
5300
|
-
padding: "8px 12px",
|
|
5301
|
-
borderRadius: "4px",
|
|
5302
|
-
border: "1px solid #dcdce4",
|
|
5303
|
-
fontSize: "14px",
|
|
5304
|
-
backgroundColor: "white",
|
|
5305
|
-
cursor: "pointer"
|
|
5306
|
-
},
|
|
5307
5596
|
value: testAccount,
|
|
5308
5597
|
onChange: (e) => setTestAccount(e.target.value),
|
|
5309
5598
|
children: [
|
|
@@ -5317,15 +5606,19 @@ const TemplateList = () => {
|
|
|
5317
5606
|
]
|
|
5318
5607
|
}
|
|
5319
5608
|
),
|
|
5320
|
-
/* @__PURE__ */ jsx(
|
|
5321
|
-
] })
|
|
5322
|
-
] }) }),
|
|
5323
|
-
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
5324
|
-
/* @__PURE__ */ jsx(Button, { onClick: () => setShowTestSendModal(false), variant: "tertiary", children: "Cancel" }),
|
|
5325
|
-
/* @__PURE__ */ jsxs(Button, { onClick: sendTestEmail, variant: "default", children: [
|
|
5326
|
-
/* @__PURE__ */ jsx(PaperAirplaneIcon, { style: { width: 16, height: 16, marginRight: "6px" } }),
|
|
5327
|
-
"Send Test Email"
|
|
5609
|
+
/* @__PURE__ */ jsx(ModalHint, { children: "Leave empty to use smart routing" })
|
|
5328
5610
|
] })
|
|
5611
|
+
] }),
|
|
5612
|
+
/* @__PURE__ */ jsxs(StyledModalFooter, { children: [
|
|
5613
|
+
/* @__PURE__ */ jsx(TertiaryButton, { onClick: () => setShowTestSendModal(false), children: "Cancel" }),
|
|
5614
|
+
/* @__PURE__ */ jsx(
|
|
5615
|
+
GradientButton$1,
|
|
5616
|
+
{
|
|
5617
|
+
onClick: sendTestEmail,
|
|
5618
|
+
startIcon: /* @__PURE__ */ jsx(PaperAirplaneIcon, { style: { width: 16, height: 16 } }),
|
|
5619
|
+
children: "Send Test Email"
|
|
5620
|
+
}
|
|
5621
|
+
)
|
|
5329
5622
|
] })
|
|
5330
5623
|
] }) }),
|
|
5331
5624
|
/* @__PURE__ */ jsx(
|
|
@@ -6954,18 +7247,9 @@ const Analytics = () => {
|
|
|
6954
7247
|
/* @__PURE__ */ jsx(Typography, { variant: "delta", fontWeight: "bold", style: { marginBottom: "12px", display: "block" }, children: "Analytics Available in Premium" }),
|
|
6955
7248
|
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { marginBottom: "32px", lineHeight: "1.6", display: "block" }, children: "Upgrade to Premium to unlock email analytics, tracking, open rates, click rates, and detailed reports about your email campaigns." }),
|
|
6956
7249
|
/* @__PURE__ */ jsx(
|
|
6957
|
-
|
|
7250
|
+
GradientButton$1,
|
|
6958
7251
|
{
|
|
6959
7252
|
onClick: () => window.location.href = "/admin/settings/magic-mail/upgrade",
|
|
6960
|
-
variant: "default",
|
|
6961
|
-
style: {
|
|
6962
|
-
background: "linear-gradient(135deg, #8B5CF6, #7C3AED)",
|
|
6963
|
-
color: "white",
|
|
6964
|
-
border: "none",
|
|
6965
|
-
padding: "12px 24px",
|
|
6966
|
-
fontSize: "15px",
|
|
6967
|
-
fontWeight: "600"
|
|
6968
|
-
},
|
|
6969
7253
|
children: "View Upgrade Plans"
|
|
6970
7254
|
}
|
|
6971
7255
|
)
|
|
@@ -7023,10 +7307,9 @@ const Analytics = () => {
|
|
|
7023
7307
|
}
|
|
7024
7308
|
),
|
|
7025
7309
|
emailLogs.length > 0 && /* @__PURE__ */ jsx(
|
|
7026
|
-
|
|
7310
|
+
DangerButton,
|
|
7027
7311
|
{
|
|
7028
|
-
|
|
7029
|
-
startIcon: /* @__PURE__ */ jsx(TrashIcon, {}),
|
|
7312
|
+
startIcon: /* @__PURE__ */ jsx(TrashIcon, { style: { width: 16, height: 16 } }),
|
|
7030
7313
|
onClick: () => setShowClearDialog(true),
|
|
7031
7314
|
disabled: isDeleting,
|
|
7032
7315
|
children: "Clear All"
|
|
@@ -7091,21 +7374,19 @@ const Analytics = () => {
|
|
|
7091
7374
|
] }) }),
|
|
7092
7375
|
/* @__PURE__ */ jsx(Modal.Footer, { children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "flex-end", gap: 2, children: [
|
|
7093
7376
|
/* @__PURE__ */ jsx(
|
|
7094
|
-
|
|
7377
|
+
TertiaryButton,
|
|
7095
7378
|
{
|
|
7096
|
-
variant: "tertiary",
|
|
7097
7379
|
onClick: () => setShowClearDialog(false),
|
|
7098
7380
|
disabled: isDeleting,
|
|
7099
7381
|
children: "Cancel"
|
|
7100
7382
|
}
|
|
7101
7383
|
),
|
|
7102
7384
|
/* @__PURE__ */ jsx(
|
|
7103
|
-
|
|
7385
|
+
DangerButton,
|
|
7104
7386
|
{
|
|
7105
|
-
variant: "danger",
|
|
7106
7387
|
onClick: handleClearAll,
|
|
7107
7388
|
loading: isDeleting,
|
|
7108
|
-
startIcon: /* @__PURE__ */ jsx(TrashIcon, {}),
|
|
7389
|
+
startIcon: /* @__PURE__ */ jsx(TrashIcon, { style: { width: 16, height: 16 } }),
|
|
7109
7390
|
children: "Delete All"
|
|
7110
7391
|
}
|
|
7111
7392
|
)
|
|
@@ -7321,20 +7602,20 @@ const ConnectedCard = styled(Box)`
|
|
|
7321
7602
|
text-align: center;
|
|
7322
7603
|
`;
|
|
7323
7604
|
const InfoBox = styled(Box)`
|
|
7324
|
-
background: ${colors.
|
|
7325
|
-
border: 1px solid ${colors.primary}
|
|
7605
|
+
background: linear-gradient(135deg, ${theme$3.colors.primary[50]} 0%, ${colors.whatsappLight} 100%);
|
|
7606
|
+
border: 1px solid ${theme$3.colors.primary[200]};
|
|
7326
7607
|
border-radius: 12px;
|
|
7327
|
-
padding:
|
|
7328
|
-
margin:
|
|
7608
|
+
padding: 24px;
|
|
7609
|
+
margin: 20px 0;
|
|
7329
7610
|
`;
|
|
7330
7611
|
const TestSection = styled(Box)`
|
|
7331
|
-
background: ${colors.
|
|
7612
|
+
background: ${(props) => props.theme.colors.neutral100};
|
|
7332
7613
|
border-radius: 12px;
|
|
7333
7614
|
padding: 24px;
|
|
7334
7615
|
margin-top: 24px;
|
|
7335
7616
|
`;
|
|
7336
7617
|
const UseCaseCard = styled(Box)`
|
|
7337
|
-
background: linear-gradient(135deg, ${colors.
|
|
7618
|
+
background: linear-gradient(135deg, ${colors.whatsappLight}, ${theme$3.colors.primary[50]});
|
|
7338
7619
|
border: 2px solid ${colors.whatsapp};
|
|
7339
7620
|
border-radius: 16px;
|
|
7340
7621
|
padding: 24px;
|
|
@@ -7343,7 +7624,59 @@ const UseCaseCard = styled(Box)`
|
|
|
7343
7624
|
const ButtonRow = styled(Flex)`
|
|
7344
7625
|
margin-top: 32px;
|
|
7345
7626
|
padding-top: 24px;
|
|
7346
|
-
border-top: 1px solid ${colors.
|
|
7627
|
+
border-top: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
7628
|
+
`;
|
|
7629
|
+
const AlertBox = styled(Box)`
|
|
7630
|
+
background: ${theme$3.colors.primary[50]};
|
|
7631
|
+
border: 1px solid ${theme$3.colors.primary[200]};
|
|
7632
|
+
border-radius: 12px;
|
|
7633
|
+
padding: 16px 20px;
|
|
7634
|
+
margin-top: 20px;
|
|
7635
|
+
display: flex;
|
|
7636
|
+
align-items: flex-start;
|
|
7637
|
+
gap: 12px;
|
|
7638
|
+
`;
|
|
7639
|
+
const AlertIcon = styled.div`
|
|
7640
|
+
width: 24px;
|
|
7641
|
+
height: 24px;
|
|
7642
|
+
border-radius: 50%;
|
|
7643
|
+
background: ${theme$3.colors.primary[500]};
|
|
7644
|
+
color: white;
|
|
7645
|
+
display: flex;
|
|
7646
|
+
align-items: center;
|
|
7647
|
+
justify-content: center;
|
|
7648
|
+
font-size: 14px;
|
|
7649
|
+
font-weight: bold;
|
|
7650
|
+
flex-shrink: 0;
|
|
7651
|
+
`;
|
|
7652
|
+
const SuccessBox = styled(Box)`
|
|
7653
|
+
background: ${theme$3.colors.success[50]};
|
|
7654
|
+
border: 1px solid ${theme$3.colors.success[200]};
|
|
7655
|
+
border-radius: 12px;
|
|
7656
|
+
padding: 16px 20px;
|
|
7657
|
+
display: flex;
|
|
7658
|
+
align-items: flex-start;
|
|
7659
|
+
gap: 12px;
|
|
7660
|
+
`;
|
|
7661
|
+
const SuccessIcon = styled.div`
|
|
7662
|
+
width: 24px;
|
|
7663
|
+
height: 24px;
|
|
7664
|
+
border-radius: 50%;
|
|
7665
|
+
background: ${theme$3.colors.success[500]};
|
|
7666
|
+
color: white;
|
|
7667
|
+
display: flex;
|
|
7668
|
+
align-items: center;
|
|
7669
|
+
justify-content: center;
|
|
7670
|
+
flex-shrink: 0;
|
|
7671
|
+
`;
|
|
7672
|
+
const WhatsAppButton = styled(GradientButton$1)`
|
|
7673
|
+
&& {
|
|
7674
|
+
background: linear-gradient(135deg, ${colors.whatsapp} 0%, ${colors.whatsappDark} 100%) !important;
|
|
7675
|
+
|
|
7676
|
+
&:hover:not(:disabled) {
|
|
7677
|
+
background: linear-gradient(135deg, ${colors.whatsappDark} 0%, ${colors.whatsapp} 100%) !important;
|
|
7678
|
+
}
|
|
7679
|
+
}
|
|
7347
7680
|
`;
|
|
7348
7681
|
const NotInstalledCard = styled(Box)`
|
|
7349
7682
|
background: linear-gradient(135deg, #FEF3C7, #FEE2E2);
|
|
@@ -7577,7 +7910,13 @@ const WhatsAppPage = () => {
|
|
|
7577
7910
|
currentStep === 1 && /* @__PURE__ */ jsxs(ContentCard, { children: [
|
|
7578
7911
|
/* @__PURE__ */ jsx(Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Check Installation" }),
|
|
7579
7912
|
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "First, we need to verify that the required dependencies are installed." }),
|
|
7580
|
-
isAvailable ? /* @__PURE__ */
|
|
7913
|
+
isAvailable ? /* @__PURE__ */ jsxs(SuccessBox, { children: [
|
|
7914
|
+
/* @__PURE__ */ jsx(SuccessIcon, { children: /* @__PURE__ */ jsx(Check, { style: { width: 14, height: 14 } }) }),
|
|
7915
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
7916
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { display: "block", marginBottom: "4px", color: theme$3.colors.success[700] }, children: "Dependencies Installed" }),
|
|
7917
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "Baileys library is installed and ready to use. You can proceed to connect your WhatsApp account." })
|
|
7918
|
+
] })
|
|
7919
|
+
] }) : /* @__PURE__ */ jsxs(NotInstalledCard, { children: [
|
|
7581
7920
|
/* @__PURE__ */ jsx(Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "12px", color: colors.danger }, children: "[WARNING] Dependencies Not Installed" }),
|
|
7582
7921
|
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "16px" }, children: "The WhatsApp integration requires additional dependencies. Please install them:" }),
|
|
7583
7922
|
/* @__PURE__ */ jsx(
|
|
@@ -7592,26 +7931,24 @@ const WhatsAppPage = () => {
|
|
|
7592
7931
|
border: `1px solid ${colors.border}`,
|
|
7593
7932
|
marginBottom: "16px"
|
|
7594
7933
|
},
|
|
7595
|
-
children: "npm install
|
|
7934
|
+
children: "npm install baileys pino qrcode"
|
|
7596
7935
|
}
|
|
7597
7936
|
),
|
|
7598
7937
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "After installing, restart your Strapi server and refresh this page." })
|
|
7599
7938
|
] }),
|
|
7600
|
-
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "flex-end", children: [
|
|
7939
|
+
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "flex-end", gap: 3, children: [
|
|
7601
7940
|
/* @__PURE__ */ jsx(
|
|
7602
|
-
|
|
7941
|
+
SecondaryButton,
|
|
7603
7942
|
{
|
|
7604
7943
|
onClick: () => {
|
|
7605
7944
|
checkAvailability();
|
|
7606
7945
|
},
|
|
7607
|
-
variant: "secondary",
|
|
7608
7946
|
startIcon: /* @__PURE__ */ jsx(ArrowClockwise, {}),
|
|
7609
|
-
style: { marginRight: "12px" },
|
|
7610
7947
|
children: "Refresh"
|
|
7611
7948
|
}
|
|
7612
7949
|
),
|
|
7613
7950
|
/* @__PURE__ */ jsx(
|
|
7614
|
-
|
|
7951
|
+
GradientButton$1,
|
|
7615
7952
|
{
|
|
7616
7953
|
onClick: () => setCurrentStep(2),
|
|
7617
7954
|
disabled: !isAvailable,
|
|
@@ -7625,31 +7962,35 @@ const WhatsAppPage = () => {
|
|
|
7625
7962
|
/* @__PURE__ */ jsx(Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Connect Your WhatsApp" }),
|
|
7626
7963
|
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "Click the button below to start the connection process. A QR code will be generated for you to scan." }),
|
|
7627
7964
|
/* @__PURE__ */ jsxs(InfoBox, { children: [
|
|
7628
|
-
/* @__PURE__ */ jsx(Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "
|
|
7629
|
-
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap:
|
|
7630
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", children: '1. Click "Connect WhatsApp" to generate a QR code' }),
|
|
7631
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", children: "2. Open WhatsApp on your phone" }),
|
|
7632
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", children: "3. Go to Settings - Linked Devices - Link a Device" }),
|
|
7633
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", children: "4. Scan the QR code with your phone" })
|
|
7965
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "16px", color: theme$3.colors.primary[700] }, children: "How it works" }),
|
|
7966
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, children: [
|
|
7967
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: '1. Click "Connect WhatsApp" to generate a QR code' }),
|
|
7968
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "2. Open WhatsApp on your phone" }),
|
|
7969
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "3. Go to Settings - Linked Devices - Link a Device" }),
|
|
7970
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "4. Scan the QR code with your phone" })
|
|
7971
|
+
] })
|
|
7972
|
+
] }),
|
|
7973
|
+
/* @__PURE__ */ jsxs(AlertBox, { children: [
|
|
7974
|
+
/* @__PURE__ */ jsx(AlertIcon, { children: "i" }),
|
|
7975
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
7976
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { display: "block", marginBottom: "4px" }, children: "Session Persistence" }),
|
|
7977
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "Your WhatsApp session will be saved. You won't need to scan the QR code again unless you manually disconnect or your session expires." })
|
|
7634
7978
|
] })
|
|
7635
7979
|
] }),
|
|
7636
|
-
/* @__PURE__ */ jsx(Alert, { variant: "default", title: "Session Persistence", style: { marginTop: "16px" }, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", children: "Your WhatsApp session will be saved. You won't need to scan the QR code again unless you manually disconnect or your session expires." }) }),
|
|
7637
7980
|
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
7638
7981
|
/* @__PURE__ */ jsx(
|
|
7639
|
-
|
|
7982
|
+
TertiaryButton,
|
|
7640
7983
|
{
|
|
7641
7984
|
onClick: () => setCurrentStep(1),
|
|
7642
|
-
variant: "tertiary",
|
|
7643
7985
|
startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
7644
7986
|
children: "Back"
|
|
7645
7987
|
}
|
|
7646
7988
|
),
|
|
7647
7989
|
/* @__PURE__ */ jsx(
|
|
7648
|
-
|
|
7990
|
+
WhatsAppButton,
|
|
7649
7991
|
{
|
|
7650
7992
|
onClick: handleConnect,
|
|
7651
7993
|
loading: connecting,
|
|
7652
|
-
style: { background: colors.whatsapp },
|
|
7653
7994
|
startIcon: /* @__PURE__ */ jsx(Play, {}),
|
|
7654
7995
|
children: "Connect WhatsApp"
|
|
7655
7996
|
}
|
|
@@ -7666,28 +8007,29 @@ const WhatsAppPage = () => {
|
|
|
7666
8007
|
/* @__PURE__ */ jsx(SpinningLoader, { style: { width: "40px", height: "40px" } }),
|
|
7667
8008
|
/* @__PURE__ */ jsx(Typography, { variant: "omega", children: "Generating QR code..." })
|
|
7668
8009
|
] }) }),
|
|
7669
|
-
/* @__PURE__ */ jsxs(
|
|
7670
|
-
/* @__PURE__ */ jsx(Typography, { variant: "
|
|
7671
|
-
/* @__PURE__ */
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
8010
|
+
/* @__PURE__ */ jsxs(InfoBox, { children: [
|
|
8011
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "16px", color: theme$3.colors.primary[700] }, children: "Instructions" }),
|
|
8012
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
|
8013
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "1. Open WhatsApp on your phone" }),
|
|
8014
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "2. Tap Menu or Settings" }),
|
|
8015
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: '3. Select "Linked Devices"' }),
|
|
8016
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: '4. Tap "Link a Device"' }),
|
|
8017
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "5. Point your phone camera at this QR code" })
|
|
8018
|
+
] })
|
|
7675
8019
|
] }),
|
|
7676
8020
|
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
7677
8021
|
/* @__PURE__ */ jsx(
|
|
7678
|
-
|
|
8022
|
+
TertiaryButton,
|
|
7679
8023
|
{
|
|
7680
8024
|
onClick: () => setCurrentStep(2),
|
|
7681
|
-
variant: "tertiary",
|
|
7682
8025
|
startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
7683
8026
|
children: "Back"
|
|
7684
8027
|
}
|
|
7685
8028
|
),
|
|
7686
8029
|
/* @__PURE__ */ jsx(
|
|
7687
|
-
|
|
8030
|
+
SecondaryButton,
|
|
7688
8031
|
{
|
|
7689
8032
|
onClick: handleConnect,
|
|
7690
|
-
variant: "secondary",
|
|
7691
8033
|
startIcon: /* @__PURE__ */ jsx(ArrowClockwise, {}),
|
|
7692
8034
|
children: "Refresh QR"
|
|
7693
8035
|
}
|
|
@@ -7733,11 +8075,10 @@ const WhatsAppPage = () => {
|
|
|
7733
8075
|
)
|
|
7734
8076
|
] }),
|
|
7735
8077
|
/* @__PURE__ */ jsx(
|
|
7736
|
-
|
|
8078
|
+
WhatsAppButton,
|
|
7737
8079
|
{
|
|
7738
8080
|
onClick: handleSendTest,
|
|
7739
8081
|
loading: sendingTest,
|
|
7740
|
-
style: { background: colors.whatsapp },
|
|
7741
8082
|
children: "Send Test Message"
|
|
7742
8083
|
}
|
|
7743
8084
|
)
|
|
@@ -7770,17 +8111,16 @@ await whatsapp.sendTemplateMessage('49123456789', 'welcome', {
|
|
|
7770
8111
|
});` })
|
|
7771
8112
|
}
|
|
7772
8113
|
),
|
|
7773
|
-
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
8114
|
+
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "space-between", alignItems: "center", children: [
|
|
7774
8115
|
/* @__PURE__ */ jsx(
|
|
7775
|
-
|
|
8116
|
+
DangerButton,
|
|
7776
8117
|
{
|
|
7777
8118
|
onClick: handleDisconnect,
|
|
7778
|
-
variant: "danger",
|
|
7779
8119
|
startIcon: /* @__PURE__ */ jsx(Cross, {}),
|
|
7780
8120
|
children: "Disconnect WhatsApp"
|
|
7781
8121
|
}
|
|
7782
8122
|
),
|
|
7783
|
-
/* @__PURE__ */ jsx(Badge, { backgroundColor: "success600", textColor: "neutral0", children: "FREE - No API costs!" })
|
|
8123
|
+
/* @__PURE__ */ jsx(Badge, { backgroundColor: "success600", textColor: "neutral0", style: { padding: "8px 16px", fontSize: "13px" }, children: "FREE - No API costs!" })
|
|
7784
8124
|
] })
|
|
7785
8125
|
] })
|
|
7786
8126
|
] })
|
|
@@ -7889,6 +8229,41 @@ const CloseButton = styled.button`
|
|
|
7889
8229
|
transform: scale(0.95);
|
|
7890
8230
|
}
|
|
7891
8231
|
`;
|
|
8232
|
+
const GradientButton = styled(Button)`
|
|
8233
|
+
&& {
|
|
8234
|
+
background: linear-gradient(135deg, #0EA5E9 0%, #A855F7 100%);
|
|
8235
|
+
color: white;
|
|
8236
|
+
font-weight: 600;
|
|
8237
|
+
border: none;
|
|
8238
|
+
box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
|
|
8239
|
+
padding: 12px 24px;
|
|
8240
|
+
min-height: 44px;
|
|
8241
|
+
|
|
8242
|
+
&:hover:not(:disabled) {
|
|
8243
|
+
background: linear-gradient(135deg, #0284C7 0%, #9333EA 100%);
|
|
8244
|
+
box-shadow: 0 6px 16px rgba(14, 165, 233, 0.5);
|
|
8245
|
+
}
|
|
8246
|
+
|
|
8247
|
+
&:disabled {
|
|
8248
|
+
opacity: 0.6;
|
|
8249
|
+
cursor: not-allowed;
|
|
8250
|
+
}
|
|
8251
|
+
}
|
|
8252
|
+
`;
|
|
8253
|
+
styled(Button)`
|
|
8254
|
+
&& {
|
|
8255
|
+
background: #f0f9ff;
|
|
8256
|
+
color: #0EA5E9;
|
|
8257
|
+
font-weight: 600;
|
|
8258
|
+
border: 2px solid #0EA5E9;
|
|
8259
|
+
padding: 12px 24px;
|
|
8260
|
+
min-height: 44px;
|
|
8261
|
+
|
|
8262
|
+
&:hover:not(:disabled) {
|
|
8263
|
+
background: #e0f2fe;
|
|
8264
|
+
}
|
|
8265
|
+
}
|
|
8266
|
+
`;
|
|
7892
8267
|
const ToggleButton = styled.button`
|
|
7893
8268
|
background: none;
|
|
7894
8269
|
border: none;
|
|
@@ -8159,37 +8534,23 @@ const LicenseGuard = ({ children }) => {
|
|
|
8159
8534
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", marginTop: 2, children: "Loading admin user data..." })
|
|
8160
8535
|
] }),
|
|
8161
8536
|
/* @__PURE__ */ jsx(Flex, { gap: 3, justifyContent: "center", style: { marginTop: "16px" }, children: useExistingKey ? /* @__PURE__ */ jsx(
|
|
8162
|
-
|
|
8537
|
+
GradientButton,
|
|
8163
8538
|
{
|
|
8164
8539
|
type: "submit",
|
|
8165
8540
|
size: "L",
|
|
8166
8541
|
startIcon: /* @__PURE__ */ jsx(CheckIcon, { style: { width: 20, height: 20 } }),
|
|
8167
8542
|
loading: isCreating,
|
|
8168
8543
|
disabled: isCreating || !existingLicenseKey.trim() || !existingEmail.trim(),
|
|
8169
|
-
style: {
|
|
8170
|
-
background: "linear-gradient(135deg, #0EA5E9 0%, #A855F7 100%)",
|
|
8171
|
-
color: "white",
|
|
8172
|
-
fontWeight: "600",
|
|
8173
|
-
border: "none",
|
|
8174
|
-
boxShadow: "0 4px 12px rgba(14, 165, 233, 0.4)"
|
|
8175
|
-
},
|
|
8176
8544
|
children: "Validate License"
|
|
8177
8545
|
}
|
|
8178
8546
|
) : /* @__PURE__ */ jsx(
|
|
8179
|
-
|
|
8547
|
+
GradientButton,
|
|
8180
8548
|
{
|
|
8181
8549
|
type: "submit",
|
|
8182
8550
|
size: "L",
|
|
8183
8551
|
startIcon: /* @__PURE__ */ jsx(CheckIcon, { style: { width: 20, height: 20 } }),
|
|
8184
8552
|
loading: isCreating,
|
|
8185
8553
|
disabled: isCreating || !adminUser,
|
|
8186
|
-
style: {
|
|
8187
|
-
background: "linear-gradient(135deg, #0EA5E9 0%, #A855F7 100%)",
|
|
8188
|
-
color: "white",
|
|
8189
|
-
fontWeight: "600",
|
|
8190
|
-
border: "none",
|
|
8191
|
-
boxShadow: "0 4px 12px rgba(14, 165, 233, 0.4)"
|
|
8192
|
-
},
|
|
8193
8554
|
children: "Activate License"
|
|
8194
8555
|
}
|
|
8195
8556
|
) })
|