strapi-plugin-magic-mail 2.2.6 → 2.3.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/README.md +168 -10
- package/dist/_chunks/{App-Bze8Ixs_.js → App-BMaJu77a.js} +787 -71
- package/dist/_chunks/{App-BZaHrE0R.mjs → App-DxiMl-Zd.mjs} +790 -74
- package/dist/_chunks/{de-DS04rP54.mjs → de-CpIQf94q.mjs} +21 -1
- package/dist/_chunks/{de-CN-G9j1S.js → de-YhjDItIL.js} +21 -1
- package/dist/_chunks/{en-BEFQJXvR.mjs → en-BHmOVzsP.mjs} +21 -1
- package/dist/_chunks/{en-BDc7Jk8u.js → en-BcdTnA2-.js} +21 -1
- package/dist/admin/index.js +2 -2
- package/dist/admin/index.mjs +2 -2
- package/dist/server/index.js +1102 -5
- package/dist/server/index.mjs +1100 -5
- package/package.json +10 -5
|
@@ -108,7 +108,7 @@ const theme$3 = {
|
|
|
108
108
|
xl: "16px"
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
-
const fadeIn$
|
|
111
|
+
const fadeIn$6 = styled.keyframes`
|
|
112
112
|
from {
|
|
113
113
|
opacity: 0;
|
|
114
114
|
transform: translateY(10px);
|
|
@@ -118,7 +118,7 @@ const fadeIn$5 = styled.keyframes`
|
|
|
118
118
|
transform: translateY(0);
|
|
119
119
|
}
|
|
120
120
|
`;
|
|
121
|
-
const pulse$
|
|
121
|
+
const pulse$3 = styled.keyframes`
|
|
122
122
|
0%, 100% {
|
|
123
123
|
transform: scale(1);
|
|
124
124
|
}
|
|
@@ -136,7 +136,7 @@ const slideIn = styled.keyframes`
|
|
|
136
136
|
opacity: 1;
|
|
137
137
|
}
|
|
138
138
|
`;
|
|
139
|
-
const colors = {
|
|
139
|
+
const colors$1 = {
|
|
140
140
|
primary: "#4945ff",
|
|
141
141
|
// Strapi Primary Blue
|
|
142
142
|
primaryLight: "#f0f0ff",
|
|
@@ -156,7 +156,7 @@ const StepHeader = styled__default.default(designSystem.Box)`
|
|
|
156
156
|
padding-bottom: 24px;
|
|
157
157
|
margin-bottom: 32px;
|
|
158
158
|
position: relative;
|
|
159
|
-
animation: ${fadeIn$
|
|
159
|
+
animation: ${fadeIn$6} 0.4s ease;
|
|
160
160
|
|
|
161
161
|
&::after {
|
|
162
162
|
content: '';
|
|
@@ -165,11 +165,11 @@ const StepHeader = styled__default.default(designSystem.Box)`
|
|
|
165
165
|
left: -24px;
|
|
166
166
|
right: -24px;
|
|
167
167
|
height: 1px;
|
|
168
|
-
background: linear-gradient(90deg, transparent, ${colors.border}, transparent);
|
|
168
|
+
background: linear-gradient(90deg, transparent, ${colors$1.border}, transparent);
|
|
169
169
|
}
|
|
170
170
|
`;
|
|
171
171
|
const StepTitle = styled__default.default(designSystem.Typography)`
|
|
172
|
-
color: ${colors.text};
|
|
172
|
+
color: ${colors$1.text};
|
|
173
173
|
font-size: 24px;
|
|
174
174
|
font-weight: 600;
|
|
175
175
|
margin-bottom: 8px;
|
|
@@ -178,11 +178,11 @@ const StepTitle = styled__default.default(designSystem.Typography)`
|
|
|
178
178
|
gap: 12px;
|
|
179
179
|
`;
|
|
180
180
|
const StepSubtitle = styled__default.default(designSystem.Typography)`
|
|
181
|
-
color: ${colors.textLight};
|
|
181
|
+
color: ${colors$1.textLight};
|
|
182
182
|
font-size: 14px;
|
|
183
183
|
line-height: 1.5;
|
|
184
184
|
`;
|
|
185
|
-
const StepperContainer = styled__default.default(designSystem.Box)`
|
|
185
|
+
const StepperContainer$1 = styled__default.default(designSystem.Box)`
|
|
186
186
|
display: flex;
|
|
187
187
|
align-items: flex-start;
|
|
188
188
|
justify-content: center;
|
|
@@ -192,7 +192,7 @@ const StepperContainer = styled__default.default(designSystem.Box)`
|
|
|
192
192
|
position: relative;
|
|
193
193
|
padding: 0 40px;
|
|
194
194
|
`;
|
|
195
|
-
const StepWrapper = styled__default.default.div`
|
|
195
|
+
const StepWrapper$1 = styled__default.default.div`
|
|
196
196
|
flex: 1;
|
|
197
197
|
display: flex;
|
|
198
198
|
flex-direction: column;
|
|
@@ -206,18 +206,18 @@ const StepWrapper = styled__default.default.div`
|
|
|
206
206
|
left: 50%;
|
|
207
207
|
width: 100%;
|
|
208
208
|
height: 3px;
|
|
209
|
-
background: ${(props) => props.$completed ? colors.success : colors.neutralLight};
|
|
209
|
+
background: ${(props) => props.$completed ? colors$1.success : colors$1.neutralLight};
|
|
210
210
|
transition: all 0.4s ease;
|
|
211
211
|
z-index: 0;
|
|
212
212
|
}
|
|
213
213
|
`;
|
|
214
|
-
const StepDot = styled__default.default.div`
|
|
214
|
+
const StepDot$1 = styled__default.default.div`
|
|
215
215
|
width: 56px;
|
|
216
216
|
height: 56px;
|
|
217
217
|
border-radius: 50%;
|
|
218
|
-
background: ${(props) => props.$active ? colors.primary : props.$completed ? colors.success : colors.white};
|
|
219
|
-
color: ${(props) => props.$active || props.$completed ? colors.white : colors.textLight};
|
|
220
|
-
border: 4px solid ${(props) => props.$active ? colors.primary : props.$completed ? colors.success : colors.border};
|
|
218
|
+
background: ${(props) => props.$active ? colors$1.primary : props.$completed ? colors$1.success : colors$1.white};
|
|
219
|
+
color: ${(props) => props.$active || props.$completed ? colors$1.white : colors$1.textLight};
|
|
220
|
+
border: 4px solid ${(props) => props.$active ? colors$1.primary : props.$completed ? colors$1.success : colors$1.border};
|
|
221
221
|
display: flex;
|
|
222
222
|
align-items: center;
|
|
223
223
|
justify-content: center;
|
|
@@ -227,20 +227,20 @@ const StepDot = styled__default.default.div`
|
|
|
227
227
|
position: relative;
|
|
228
228
|
z-index: 1;
|
|
229
229
|
cursor: ${(props) => props.$completed ? "pointer" : "default"};
|
|
230
|
-
box-shadow: ${(props) => props.$active ? `0 4px 16px ${colors.primary}40, 0 0 0 8px ${colors.primaryLight}` : props.$completed ? `0 4px 12px ${colors.success}30` : "0 2px 8px rgba(0,0,0,0.08)"};
|
|
230
|
+
box-shadow: ${(props) => props.$active ? `0 4px 16px ${colors$1.primary}40, 0 0 0 8px ${colors$1.primaryLight}` : props.$completed ? `0 4px 12px ${colors$1.success}30` : "0 2px 8px rgba(0,0,0,0.08)"};
|
|
231
231
|
|
|
232
232
|
${(props) => props.$active && styled.css`
|
|
233
|
-
animation: ${pulse$
|
|
233
|
+
animation: ${pulse$3} 2s infinite;
|
|
234
234
|
`}
|
|
235
235
|
|
|
236
236
|
&:hover {
|
|
237
237
|
transform: ${(props) => props.$completed ? "scale(1.1)" : props.$active ? "scale(1.05)" : "scale(1)"};
|
|
238
238
|
}
|
|
239
239
|
`;
|
|
240
|
-
const StepLabel = styled__default.default(designSystem.Typography)`
|
|
240
|
+
const StepLabel$1 = styled__default.default(designSystem.Typography)`
|
|
241
241
|
margin-top: 12px;
|
|
242
242
|
font-size: 13px;
|
|
243
|
-
color: ${(props) => props.$active ? colors.primary : props.$completed ? colors.success : colors.textLight};
|
|
243
|
+
color: ${(props) => props.$active ? colors$1.primary : props.$completed ? colors$1.success : colors$1.textLight};
|
|
244
244
|
white-space: nowrap;
|
|
245
245
|
font-weight: ${(props) => props.$active ? 600 : 500};
|
|
246
246
|
text-align: center;
|
|
@@ -257,8 +257,8 @@ const ProvidersGrid = styled__default.default(designSystem.Box)`
|
|
|
257
257
|
margin-right: auto;
|
|
258
258
|
`;
|
|
259
259
|
const ProviderCard = styled__default.default(designSystem.Box)`
|
|
260
|
-
background: ${(props) => props.$selected ? colors.successLight : colors.white};
|
|
261
|
-
border: 2px solid ${(props) => props.$selected ? colors.success : colors.border};
|
|
260
|
+
background: ${(props) => props.$selected ? colors$1.successLight : colors$1.white};
|
|
261
|
+
border: 2px solid ${(props) => props.$selected ? colors$1.success : colors$1.border};
|
|
262
262
|
border-radius: 12px;
|
|
263
263
|
padding: 24px;
|
|
264
264
|
cursor: pointer;
|
|
@@ -289,7 +289,7 @@ const ProviderCard = styled__default.default(designSystem.Box)`
|
|
|
289
289
|
&:hover {
|
|
290
290
|
transform: translateY(-4px);
|
|
291
291
|
box-shadow: 0 8px 24px rgba(73, 69, 255, 0.12);
|
|
292
|
-
border-color: ${(props) => props.$selected ? colors.success : colors.primary};
|
|
292
|
+
border-color: ${(props) => props.$selected ? colors$1.success : colors$1.primary};
|
|
293
293
|
|
|
294
294
|
&::before {
|
|
295
295
|
opacity: 1;
|
|
@@ -304,7 +304,7 @@ const ProviderCard = styled__default.default(designSystem.Box)`
|
|
|
304
304
|
right: 8px;
|
|
305
305
|
width: 24px;
|
|
306
306
|
height: 24px;
|
|
307
|
-
background: ${colors.success};
|
|
307
|
+
background: ${colors$1.success};
|
|
308
308
|
color: white;
|
|
309
309
|
border-radius: 50%;
|
|
310
310
|
display: flex;
|
|
@@ -319,33 +319,33 @@ const ProviderIcon = styled__default.default.div`
|
|
|
319
319
|
width: 56px;
|
|
320
320
|
height: 56px;
|
|
321
321
|
border-radius: ${(props) => props.$round ? "50%" : "12px"};
|
|
322
|
-
background: ${(props) => props.$bgColor || colors.primaryLight};
|
|
322
|
+
background: ${(props) => props.$bgColor || colors$1.primaryLight};
|
|
323
323
|
display: flex;
|
|
324
324
|
align-items: center;
|
|
325
325
|
justify-content: center;
|
|
326
326
|
font-size: ${(props) => props.$fontSize || "24px"};
|
|
327
327
|
font-weight: bold;
|
|
328
|
-
color: ${(props) => props.$color || colors.primary};
|
|
328
|
+
color: ${(props) => props.$color || colors$1.primary};
|
|
329
329
|
box-shadow: 0 4px 12px ${(props) => props.$shadowColor || "rgba(73, 69, 255, 0.15)"};
|
|
330
330
|
`;
|
|
331
331
|
const ProviderName = styled__default.default(designSystem.Typography)`
|
|
332
332
|
font-weight: 600;
|
|
333
333
|
font-size: 15px;
|
|
334
|
-
color: ${colors.text};
|
|
334
|
+
color: ${colors$1.text};
|
|
335
335
|
margin: 0;
|
|
336
336
|
`;
|
|
337
337
|
styled__default.default(designSystem.Typography)`
|
|
338
338
|
font-size: 12px;
|
|
339
|
-
color: ${colors.textLight};
|
|
339
|
+
color: ${colors$1.textLight};
|
|
340
340
|
margin: 0;
|
|
341
341
|
`;
|
|
342
342
|
const InfoAlert = styled__default.default(designSystem.Alert)`
|
|
343
|
-
background: ${colors.primaryLight};
|
|
344
|
-
border: 1px solid ${colors.primary}33;
|
|
345
|
-
animation: ${fadeIn$
|
|
343
|
+
background: ${colors$1.primaryLight};
|
|
344
|
+
border: 1px solid ${colors$1.primary}33;
|
|
345
|
+
animation: ${fadeIn$6} 0.4s ease;
|
|
346
346
|
|
|
347
347
|
svg {
|
|
348
|
-
color: ${colors.primary};
|
|
348
|
+
color: ${colors$1.primary};
|
|
349
349
|
}
|
|
350
350
|
`;
|
|
351
351
|
const FormSection = styled__default.default(designSystem.Box)`
|
|
@@ -365,7 +365,7 @@ const FullWidthField = styled__default.default(designSystem.Box)`
|
|
|
365
365
|
}
|
|
366
366
|
`;
|
|
367
367
|
const SectionTitle = styled__default.default(designSystem.Typography)`
|
|
368
|
-
color: ${colors.text};
|
|
368
|
+
color: ${colors$1.text};
|
|
369
369
|
font-weight: 600;
|
|
370
370
|
font-size: 16px;
|
|
371
371
|
margin-bottom: 16px;
|
|
@@ -374,14 +374,14 @@ const SectionTitle = styled__default.default(designSystem.Typography)`
|
|
|
374
374
|
gap: 8px;
|
|
375
375
|
`;
|
|
376
376
|
styled__default.default(designSystem.Box)`
|
|
377
|
-
background: linear-gradient(135deg, ${colors.primaryLight}, ${colors.successLight});
|
|
378
|
-
border: 2px solid ${colors.primary}33;
|
|
377
|
+
background: linear-gradient(135deg, ${colors$1.primaryLight}, ${colors$1.successLight});
|
|
378
|
+
border: 2px solid ${colors$1.primary}33;
|
|
379
379
|
border-radius: 12px;
|
|
380
380
|
padding: 20px;
|
|
381
381
|
transition: all 0.3s;
|
|
382
382
|
|
|
383
383
|
&:hover {
|
|
384
|
-
border-color: ${colors.primary}66;
|
|
384
|
+
border-color: ${colors$1.primary}66;
|
|
385
385
|
box-shadow: 0 4px 12px rgba(73, 69, 255, 0.1);
|
|
386
386
|
}
|
|
387
387
|
`;
|
|
@@ -881,13 +881,13 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
881
881
|
currentStep === 4 && "Set rate limits and priority for this account"
|
|
882
882
|
] })
|
|
883
883
|
] }),
|
|
884
|
-
/* @__PURE__ */ jsxRuntime.jsx(StepperContainer, { children: [1, 2, 3, 4].map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
885
|
-
StepWrapper,
|
|
884
|
+
/* @__PURE__ */ jsxRuntime.jsx(StepperContainer$1, { children: [1, 2, 3, 4].map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
885
|
+
StepWrapper$1,
|
|
886
886
|
{
|
|
887
887
|
$completed: currentStep > step,
|
|
888
888
|
children: [
|
|
889
889
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
890
|
-
StepDot,
|
|
890
|
+
StepDot$1,
|
|
891
891
|
{
|
|
892
892
|
$active: currentStep === step,
|
|
893
893
|
$completed: currentStep > step,
|
|
@@ -896,7 +896,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
896
896
|
}
|
|
897
897
|
),
|
|
898
898
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
899
|
-
StepLabel,
|
|
899
|
+
StepLabel$1,
|
|
900
900
|
{
|
|
901
901
|
$active: currentStep === step,
|
|
902
902
|
$completed: currentStep > step,
|
|
@@ -1228,7 +1228,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1228
1228
|
background: "neutral100",
|
|
1229
1229
|
hasRadius: true,
|
|
1230
1230
|
style: {
|
|
1231
|
-
border: `1px solid ${colors.border}`,
|
|
1231
|
+
border: `1px solid ${colors$1.border}`,
|
|
1232
1232
|
borderRadius: "8px"
|
|
1233
1233
|
},
|
|
1234
1234
|
children: [
|
|
@@ -1245,7 +1245,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1245
1245
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1246
1246
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "1." }),
|
|
1247
1247
|
" Go to ",
|
|
1248
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://console.cloud.google.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors.primary, textDecoration: "underline" }, children: "console.cloud.google.com" })
|
|
1248
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://console.cloud.google.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors$1.primary, textDecoration: "underline" }, children: "console.cloud.google.com" })
|
|
1249
1249
|
] }),
|
|
1250
1250
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1251
1251
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "2." }),
|
|
@@ -1271,7 +1271,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1271
1271
|
fontFamily: "monospace",
|
|
1272
1272
|
fontSize: "13px",
|
|
1273
1273
|
wordBreak: "break-all",
|
|
1274
|
-
border: `1px solid ${colors.border}`
|
|
1274
|
+
border: `1px solid ${colors$1.border}`
|
|
1275
1275
|
},
|
|
1276
1276
|
children: [
|
|
1277
1277
|
window.location.origin,
|
|
@@ -1372,7 +1372,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1372
1372
|
background: "neutral100",
|
|
1373
1373
|
hasRadius: true,
|
|
1374
1374
|
style: {
|
|
1375
|
-
border: `1px solid ${colors.border}`,
|
|
1375
|
+
border: `1px solid ${colors$1.border}`,
|
|
1376
1376
|
borderRadius: "8px"
|
|
1377
1377
|
},
|
|
1378
1378
|
children: [
|
|
@@ -1389,7 +1389,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1389
1389
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1390
1390
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "1." }),
|
|
1391
1391
|
" Go to ",
|
|
1392
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://portal.azure.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors.primary, textDecoration: "underline" }, children: "portal.azure.com" })
|
|
1392
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://portal.azure.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors$1.primary, textDecoration: "underline" }, children: "portal.azure.com" })
|
|
1393
1393
|
] }),
|
|
1394
1394
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1395
1395
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "2." }),
|
|
@@ -1423,8 +1423,8 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1423
1423
|
fontFamily: "monospace",
|
|
1424
1424
|
fontSize: "13px",
|
|
1425
1425
|
wordBreak: "break-all",
|
|
1426
|
-
color: colors.textSecondary,
|
|
1427
|
-
border: `1px solid ${colors.border}`
|
|
1426
|
+
color: colors$1.textSecondary,
|
|
1427
|
+
border: `1px solid ${colors$1.border}`
|
|
1428
1428
|
},
|
|
1429
1429
|
children: `${window.location.origin}/magic-mail/oauth/microsoft/callback`
|
|
1430
1430
|
}
|
|
@@ -1549,7 +1549,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1549
1549
|
background: "neutral100",
|
|
1550
1550
|
hasRadius: true,
|
|
1551
1551
|
style: {
|
|
1552
|
-
border: `1px solid ${colors.border}`,
|
|
1552
|
+
border: `1px solid ${colors$1.border}`,
|
|
1553
1553
|
borderRadius: "8px"
|
|
1554
1554
|
},
|
|
1555
1555
|
children: [
|
|
@@ -1566,7 +1566,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1566
1566
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1567
1567
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "1." }),
|
|
1568
1568
|
" Go to ",
|
|
1569
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://developer.yahoo.com/apps/", target: "_blank", rel: "noopener noreferrer", style: { color: colors.primary, textDecoration: "underline" }, children: "developer.yahoo.com/apps" })
|
|
1569
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://developer.yahoo.com/apps/", target: "_blank", rel: "noopener noreferrer", style: { color: colors$1.primary, textDecoration: "underline" }, children: "developer.yahoo.com/apps" })
|
|
1570
1570
|
] }),
|
|
1571
1571
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1572
1572
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "2." }),
|
|
@@ -1592,8 +1592,8 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1592
1592
|
fontFamily: "monospace",
|
|
1593
1593
|
fontSize: "13px",
|
|
1594
1594
|
wordBreak: "break-all",
|
|
1595
|
-
color: colors.textSecondary,
|
|
1596
|
-
border: `1px solid ${colors.border}`
|
|
1595
|
+
color: colors$1.textSecondary,
|
|
1596
|
+
border: `1px solid ${colors$1.border}`
|
|
1597
1597
|
},
|
|
1598
1598
|
children: `${window.location.origin}/magic-mail/oauth/yahoo/callback`
|
|
1599
1599
|
}
|
|
@@ -1800,7 +1800,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1800
1800
|
background: formData.isPrimary ? "#FEF3C7" : "neutral100",
|
|
1801
1801
|
hasRadius: true,
|
|
1802
1802
|
style: {
|
|
1803
|
-
border: formData.isPrimary ? `2px solid #F59E0B` : `1px solid ${colors.border}`,
|
|
1803
|
+
border: formData.isPrimary ? `2px solid #F59E0B` : `1px solid ${colors$1.border}`,
|
|
1804
1804
|
borderRadius: "8px",
|
|
1805
1805
|
transition: "all 0.2s ease"
|
|
1806
1806
|
},
|
|
@@ -1858,7 +1858,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1858
1858
|
] }) })
|
|
1859
1859
|
] }) });
|
|
1860
1860
|
};
|
|
1861
|
-
const fadeIn$
|
|
1861
|
+
const fadeIn$5 = styled.keyframes`
|
|
1862
1862
|
from { opacity: 0; transform: translateY(10px); }
|
|
1863
1863
|
to { opacity: 1; transform: translateY(0); }
|
|
1864
1864
|
`;
|
|
@@ -1870,7 +1870,7 @@ const float$3 = styled.keyframes`
|
|
|
1870
1870
|
0%, 100% { transform: translateY(0px); }
|
|
1871
1871
|
50% { transform: translateY(-5px); }
|
|
1872
1872
|
`;
|
|
1873
|
-
const pulse$
|
|
1873
|
+
const pulse$2 = styled.keyframes`
|
|
1874
1874
|
0%, 100% { opacity: 1; }
|
|
1875
1875
|
50% { opacity: 0.5; }
|
|
1876
1876
|
`;
|
|
@@ -1886,7 +1886,7 @@ const breakpoints$3 = {
|
|
|
1886
1886
|
mobile: "768px"
|
|
1887
1887
|
};
|
|
1888
1888
|
const Container$4 = styled__default.default(designSystem.Box)`
|
|
1889
|
-
${styled.css`animation: ${fadeIn$
|
|
1889
|
+
${styled.css`animation: ${fadeIn$5} ${theme$3.transitions.slow};`}
|
|
1890
1890
|
min-height: 100vh;
|
|
1891
1891
|
max-width: 1440px;
|
|
1892
1892
|
margin: 0 auto;
|
|
@@ -2004,7 +2004,7 @@ const StatCard$3 = styled__default.default(designSystem.Box)`
|
|
|
2004
2004
|
position: relative;
|
|
2005
2005
|
overflow: hidden;
|
|
2006
2006
|
transition: all ${theme$3.transitions.normal};
|
|
2007
|
-
${styled.css`animation: ${fadeIn$
|
|
2007
|
+
${styled.css`animation: ${fadeIn$5} ${theme$3.transitions.slow} backwards;`}
|
|
2008
2008
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
2009
2009
|
box-shadow: ${theme$3.shadows.sm};
|
|
2010
2010
|
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
@@ -2130,7 +2130,7 @@ const OnlineBadge$1 = styled__default.default.div`
|
|
|
2130
2130
|
background: ${(props) => props.$active ? theme$3.colors.success[500] : props.theme.colors.neutral400};
|
|
2131
2131
|
display: inline-block;
|
|
2132
2132
|
margin-right: 8px;
|
|
2133
|
-
${styled.css`animation: ${(props) => props.$active ? pulse$
|
|
2133
|
+
${styled.css`animation: ${(props) => props.$active ? pulse$2 : "none"} 2s ease-in-out infinite;`}
|
|
2134
2134
|
`;
|
|
2135
2135
|
const StyledTable$3 = styled__default.default(designSystem.Table)`
|
|
2136
2136
|
thead {
|
|
@@ -2821,6 +2821,10 @@ const theme$2 = {
|
|
|
2821
2821
|
danger: {
|
|
2822
2822
|
100: "#FEE2E2",
|
|
2823
2823
|
600: "#DC2626"
|
|
2824
|
+
},
|
|
2825
|
+
neutral: {
|
|
2826
|
+
100: "#F3F4F6",
|
|
2827
|
+
200: "#E5E7EB"
|
|
2824
2828
|
}
|
|
2825
2829
|
},
|
|
2826
2830
|
shadows: {
|
|
@@ -2846,7 +2850,7 @@ const theme$2 = {
|
|
|
2846
2850
|
xl: "16px"
|
|
2847
2851
|
}
|
|
2848
2852
|
};
|
|
2849
|
-
const fadeIn$
|
|
2853
|
+
const fadeIn$4 = styled.keyframes`
|
|
2850
2854
|
from { opacity: 0; transform: translateY(10px); }
|
|
2851
2855
|
to { opacity: 1; transform: translateY(0); }
|
|
2852
2856
|
`;
|
|
@@ -2858,7 +2862,7 @@ const float$2 = styled.keyframes`
|
|
|
2858
2862
|
0%, 100% { transform: translateY(0px); }
|
|
2859
2863
|
50% { transform: translateY(-5px); }
|
|
2860
2864
|
`;
|
|
2861
|
-
const pulse = styled.keyframes`
|
|
2865
|
+
const pulse$1 = styled.keyframes`
|
|
2862
2866
|
0%, 100% { opacity: 1; }
|
|
2863
2867
|
50% { opacity: 0.5; }
|
|
2864
2868
|
`;
|
|
@@ -2874,7 +2878,7 @@ const breakpoints$2 = {
|
|
|
2874
2878
|
mobile: "768px"
|
|
2875
2879
|
};
|
|
2876
2880
|
const Container$3 = styled__default.default(designSystem.Box)`
|
|
2877
|
-
${styled.css`animation: ${fadeIn$
|
|
2881
|
+
${styled.css`animation: ${fadeIn$4} ${theme$2.transitions.slow};`}
|
|
2878
2882
|
min-height: 100vh;
|
|
2879
2883
|
max-width: 1440px;
|
|
2880
2884
|
margin: 0 auto;
|
|
@@ -2992,7 +2996,7 @@ const StatCard$2 = styled__default.default(designSystem.Box)`
|
|
|
2992
2996
|
position: relative;
|
|
2993
2997
|
overflow: hidden;
|
|
2994
2998
|
transition: all ${theme$2.transitions.normal};
|
|
2995
|
-
${styled.css`animation: ${fadeIn$
|
|
2999
|
+
${styled.css`animation: ${fadeIn$4} ${theme$2.transitions.slow} backwards;`}
|
|
2996
3000
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
2997
3001
|
box-shadow: ${theme$2.shadows.sm};
|
|
2998
3002
|
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
@@ -3118,7 +3122,7 @@ const OnlineBadge = styled__default.default.div`
|
|
|
3118
3122
|
background: ${(props) => props.$active ? theme$2.colors.success[500] : props.theme.colors.neutral400};
|
|
3119
3123
|
display: inline-block;
|
|
3120
3124
|
margin-right: 8px;
|
|
3121
|
-
${styled.css`animation: ${(props) => props.$active ? pulse : "none"} 2s ease-in-out infinite;`}
|
|
3125
|
+
${styled.css`animation: ${(props) => props.$active ? pulse$1 : "none"} 2s ease-in-out infinite;`}
|
|
3122
3126
|
`;
|
|
3123
3127
|
const StyledTable$2 = styled__default.default(designSystem.Table)`
|
|
3124
3128
|
thead {
|
|
@@ -3417,7 +3421,8 @@ const RoutingRulesPage = () => {
|
|
|
3417
3421
|
rule.fallbackAccountName && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
3418
3422
|
"Fallback: ",
|
|
3419
3423
|
rule.fallbackAccountName
|
|
3420
|
-
] })
|
|
3424
|
+
] }),
|
|
3425
|
+
rule.whatsappFallback && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success100", textColor: "success700", size: "S", children: "+ WhatsApp" })
|
|
3421
3426
|
] }) }),
|
|
3422
3427
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3423
3428
|
designSystem.Badge,
|
|
@@ -3484,7 +3489,8 @@ const RuleModal = ({ rule, accounts, onClose, onSave }) => {
|
|
|
3484
3489
|
matchType: rule?.matchType || "emailType",
|
|
3485
3490
|
matchValue: rule?.matchValue || "",
|
|
3486
3491
|
accountName: rule?.accountName || "",
|
|
3487
|
-
fallbackAccountName: rule?.fallbackAccountName || ""
|
|
3492
|
+
fallbackAccountName: rule?.fallbackAccountName || "",
|
|
3493
|
+
whatsappFallback: rule?.whatsappFallback || false
|
|
3488
3494
|
});
|
|
3489
3495
|
const handleChange = (field, value) => {
|
|
3490
3496
|
setFormData((prev) => ({ ...prev, [field]: value }));
|
|
@@ -3639,6 +3645,36 @@ const RuleModal = ({ rule, accounts, onClose, onSave }) => {
|
|
|
3639
3645
|
),
|
|
3640
3646
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, { children: "Use this account if the target account is unavailable or rate-limited" })
|
|
3641
3647
|
] }),
|
|
3648
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3649
|
+
designSystem.Box,
|
|
3650
|
+
{
|
|
3651
|
+
padding: 4,
|
|
3652
|
+
background: formData.whatsappFallback ? theme$2.colors.success[100] : theme$2.colors.neutral[100],
|
|
3653
|
+
hasRadius: true,
|
|
3654
|
+
style: {
|
|
3655
|
+
width: "100%",
|
|
3656
|
+
border: formData.whatsappFallback ? `2px solid ${theme$2.colors.success[600]}` : `1px solid ${theme$2.colors.neutral[200]}`,
|
|
3657
|
+
borderRadius: theme$2.borderRadius.md,
|
|
3658
|
+
transition: "all 0.2s ease"
|
|
3659
|
+
},
|
|
3660
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", children: [
|
|
3661
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3662
|
+
designSystem.Toggle,
|
|
3663
|
+
{
|
|
3664
|
+
checked: formData.whatsappFallback,
|
|
3665
|
+
onChange: () => handleChange("whatsappFallback", !formData.whatsappFallback)
|
|
3666
|
+
}
|
|
3667
|
+
),
|
|
3668
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { flex: 1 }, children: [
|
|
3669
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, children: [
|
|
3670
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "semiBold", children: "WhatsApp Fallback" }),
|
|
3671
|
+
formData.whatsappFallback && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success600", textColor: "neutral0", size: "S", children: "ENABLED" })
|
|
3672
|
+
] }),
|
|
3673
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", marginTop: 1, children: formData.whatsappFallback ? "If ALL email accounts fail, message will be sent via WhatsApp (requires connected WhatsApp & phone number in email data)" : "Enable to use WhatsApp as last-resort fallback when email delivery fails" })
|
|
3674
|
+
] })
|
|
3675
|
+
] })
|
|
3676
|
+
}
|
|
3677
|
+
),
|
|
3642
3678
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { style: { width: "100%" }, children: [
|
|
3643
3679
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Rule Priority" }),
|
|
3644
3680
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3842,7 +3878,7 @@ const theme$1 = {
|
|
|
3842
3878
|
spacing: { xs: "4px", sm: "8px", md: "16px", lg: "24px", xl: "32px", "2xl": "48px" },
|
|
3843
3879
|
borderRadius: { md: "8px", lg: "12px", xl: "16px" }
|
|
3844
3880
|
};
|
|
3845
|
-
const fadeIn$
|
|
3881
|
+
const fadeIn$3 = styled.keyframes`
|
|
3846
3882
|
from { opacity: 0; transform: translateY(10px); }
|
|
3847
3883
|
to { opacity: 1; transform: translateY(0); }
|
|
3848
3884
|
`;
|
|
@@ -3995,7 +4031,7 @@ const CopyButton = styled__default.default(designSystem.Button)`
|
|
|
3995
4031
|
height: 14px;
|
|
3996
4032
|
}
|
|
3997
4033
|
`;
|
|
3998
|
-
const InfoBox = styled__default.default(designSystem.Box)`
|
|
4034
|
+
const InfoBox$1 = styled__default.default(designSystem.Box)`
|
|
3999
4035
|
background: linear-gradient(135deg, ${theme$1.colors.primary[50]}, ${theme$1.colors.primary[100]});
|
|
4000
4036
|
border-left: 4px solid ${theme$1.colors.primary[500]};
|
|
4001
4037
|
border-radius: 8px;
|
|
@@ -4042,7 +4078,7 @@ const breakpoints$1 = {
|
|
|
4042
4078
|
tablet: "1024px"
|
|
4043
4079
|
};
|
|
4044
4080
|
const Container$2 = styled__default.default(designSystem.Box)`
|
|
4045
|
-
${styled.css`animation: ${fadeIn$
|
|
4081
|
+
${styled.css`animation: ${fadeIn$3} ${theme$1.transitions.slow};`}
|
|
4046
4082
|
min-height: 100vh;
|
|
4047
4083
|
max-width: 1440px;
|
|
4048
4084
|
margin: 0 auto;
|
|
@@ -4155,7 +4191,7 @@ const StatCard$1 = styled__default.default(designSystem.Box)`
|
|
|
4155
4191
|
position: relative;
|
|
4156
4192
|
overflow: hidden;
|
|
4157
4193
|
transition: all ${theme$1.transitions.normal};
|
|
4158
|
-
${styled.css`animation: ${fadeIn$
|
|
4194
|
+
${styled.css`animation: ${fadeIn$3} ${theme$1.transitions.slow} backwards;`}
|
|
4159
4195
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
4160
4196
|
box-shadow: ${theme$1.shadows.sm};
|
|
4161
4197
|
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
@@ -5235,7 +5271,7 @@ const TemplateList = () => {
|
|
|
5235
5271
|
)
|
|
5236
5272
|
] })
|
|
5237
5273
|
] }),
|
|
5238
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoBox, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5274
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoBox$1, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5239
5275
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { color: theme$1.colors.primary[700] }, children: [
|
|
5240
5276
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Template ID:" }),
|
|
5241
5277
|
" #",
|
|
@@ -6535,7 +6571,7 @@ const theme = {
|
|
|
6535
6571
|
spacing: { xs: "4px", sm: "8px", md: "16px", lg: "24px", xl: "32px", "2xl": "48px" },
|
|
6536
6572
|
borderRadius: { lg: "12px", xl: "16px" }
|
|
6537
6573
|
};
|
|
6538
|
-
const fadeIn$
|
|
6574
|
+
const fadeIn$2 = styled.keyframes`
|
|
6539
6575
|
from { opacity: 0; transform: translateY(10px); }
|
|
6540
6576
|
to { opacity: 1; transform: translateY(0); }
|
|
6541
6577
|
`;
|
|
@@ -6551,7 +6587,7 @@ const breakpoints = {
|
|
|
6551
6587
|
mobile: "768px"
|
|
6552
6588
|
};
|
|
6553
6589
|
const Container = styled__default.default(designSystem.Box)`
|
|
6554
|
-
${styled.css`animation: ${fadeIn$
|
|
6590
|
+
${styled.css`animation: ${fadeIn$2} ${theme.transitions.slow};`}
|
|
6555
6591
|
min-height: 100vh;
|
|
6556
6592
|
max-width: 1440px;
|
|
6557
6593
|
margin: 0 auto;
|
|
@@ -6664,7 +6700,7 @@ const StatCard = styled__default.default(designSystem.Box)`
|
|
|
6664
6700
|
position: relative;
|
|
6665
6701
|
overflow: hidden;
|
|
6666
6702
|
transition: all ${theme.transitions.normal};
|
|
6667
|
-
${styled.css`animation: ${fadeIn$
|
|
6703
|
+
${styled.css`animation: ${fadeIn$2} ${theme.transitions.slow} backwards;`}
|
|
6668
6704
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
6669
6705
|
box-shadow: ${theme.shadows.sm};
|
|
6670
6706
|
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
@@ -7100,6 +7136,679 @@ const Analytics = () => {
|
|
|
7100
7136
|
] }) })
|
|
7101
7137
|
] });
|
|
7102
7138
|
};
|
|
7139
|
+
const fadeIn$1 = styled.keyframes`
|
|
7140
|
+
from {
|
|
7141
|
+
opacity: 0;
|
|
7142
|
+
transform: translateY(10px);
|
|
7143
|
+
}
|
|
7144
|
+
to {
|
|
7145
|
+
opacity: 1;
|
|
7146
|
+
transform: translateY(0);
|
|
7147
|
+
}
|
|
7148
|
+
`;
|
|
7149
|
+
const pulse = styled.keyframes`
|
|
7150
|
+
0%, 100% {
|
|
7151
|
+
transform: scale(1);
|
|
7152
|
+
}
|
|
7153
|
+
50% {
|
|
7154
|
+
transform: scale(1.05);
|
|
7155
|
+
}
|
|
7156
|
+
`;
|
|
7157
|
+
const spin = styled.keyframes`
|
|
7158
|
+
from {
|
|
7159
|
+
transform: rotate(0deg);
|
|
7160
|
+
}
|
|
7161
|
+
to {
|
|
7162
|
+
transform: rotate(360deg);
|
|
7163
|
+
}
|
|
7164
|
+
`;
|
|
7165
|
+
const colors = {
|
|
7166
|
+
whatsapp: "#25D366",
|
|
7167
|
+
whatsappDark: "#128C7E",
|
|
7168
|
+
whatsappLight: "#DCF8C6",
|
|
7169
|
+
primary: "#4945ff",
|
|
7170
|
+
primaryLight: "#f0f0ff",
|
|
7171
|
+
success: "#5cb176",
|
|
7172
|
+
successLight: "#eafaf1",
|
|
7173
|
+
danger: "#d02b20",
|
|
7174
|
+
neutral: "#8e8ea9",
|
|
7175
|
+
neutralLight: "#f6f6f9",
|
|
7176
|
+
white: "#ffffff",
|
|
7177
|
+
border: "#dcdce4",
|
|
7178
|
+
textLight: "#666687"
|
|
7179
|
+
};
|
|
7180
|
+
const PageContainer = styled__default.default(designSystem.Box)`
|
|
7181
|
+
padding: 40px;
|
|
7182
|
+
max-width: 900px;
|
|
7183
|
+
margin: 0 auto;
|
|
7184
|
+
animation: ${fadeIn$1} 0.4s ease;
|
|
7185
|
+
`;
|
|
7186
|
+
const HeaderSection = styled__default.default(designSystem.Box)`
|
|
7187
|
+
text-align: center;
|
|
7188
|
+
margin-bottom: 48px;
|
|
7189
|
+
`;
|
|
7190
|
+
const WhatsAppLogo = styled__default.default.div`
|
|
7191
|
+
width: 80px;
|
|
7192
|
+
height: 80px;
|
|
7193
|
+
border-radius: 50%;
|
|
7194
|
+
background: linear-gradient(135deg, ${colors.whatsapp}, ${colors.whatsappDark});
|
|
7195
|
+
display: flex;
|
|
7196
|
+
align-items: center;
|
|
7197
|
+
justify-content: center;
|
|
7198
|
+
margin: 0 auto 24px;
|
|
7199
|
+
box-shadow: 0 8px 32px ${colors.whatsapp}40;
|
|
7200
|
+
`;
|
|
7201
|
+
const PhoneIcon = styled__default.default.div`
|
|
7202
|
+
width: 40px;
|
|
7203
|
+
height: 40px;
|
|
7204
|
+
color: white;
|
|
7205
|
+
font-size: 32px;
|
|
7206
|
+
`;
|
|
7207
|
+
const StepperContainer = styled__default.default(designSystem.Box)`
|
|
7208
|
+
display: flex;
|
|
7209
|
+
align-items: flex-start;
|
|
7210
|
+
justify-content: center;
|
|
7211
|
+
gap: 0;
|
|
7212
|
+
margin-bottom: 48px;
|
|
7213
|
+
position: relative;
|
|
7214
|
+
padding: 0 40px;
|
|
7215
|
+
`;
|
|
7216
|
+
const StepWrapper = styled__default.default.div`
|
|
7217
|
+
flex: 1;
|
|
7218
|
+
display: flex;
|
|
7219
|
+
flex-direction: column;
|
|
7220
|
+
align-items: center;
|
|
7221
|
+
position: relative;
|
|
7222
|
+
|
|
7223
|
+
&:not(:last-child)::after {
|
|
7224
|
+
content: '';
|
|
7225
|
+
position: absolute;
|
|
7226
|
+
top: 28px;
|
|
7227
|
+
left: 50%;
|
|
7228
|
+
width: 100%;
|
|
7229
|
+
height: 3px;
|
|
7230
|
+
background: ${(props) => props.$completed ? colors.success : colors.neutralLight};
|
|
7231
|
+
transition: all 0.4s ease;
|
|
7232
|
+
z-index: 0;
|
|
7233
|
+
}
|
|
7234
|
+
`;
|
|
7235
|
+
const StepDot = styled__default.default.div`
|
|
7236
|
+
width: 56px;
|
|
7237
|
+
height: 56px;
|
|
7238
|
+
border-radius: 50%;
|
|
7239
|
+
background: ${(props) => props.$active ? colors.whatsapp : props.$completed ? colors.success : colors.white};
|
|
7240
|
+
color: ${(props) => props.$active || props.$completed ? colors.white : colors.textLight};
|
|
7241
|
+
border: 4px solid ${(props) => props.$active ? colors.whatsapp : props.$completed ? colors.success : colors.border};
|
|
7242
|
+
display: flex;
|
|
7243
|
+
align-items: center;
|
|
7244
|
+
justify-content: center;
|
|
7245
|
+
font-weight: 700;
|
|
7246
|
+
font-size: 18px;
|
|
7247
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
7248
|
+
position: relative;
|
|
7249
|
+
z-index: 1;
|
|
7250
|
+
cursor: ${(props) => props.$completed ? "pointer" : "default"};
|
|
7251
|
+
box-shadow: ${(props) => props.$active ? `0 4px 16px ${colors.whatsapp}40, 0 0 0 8px ${colors.whatsappLight}` : props.$completed ? `0 4px 12px ${colors.success}30` : "0 2px 8px rgba(0,0,0,0.08)"};
|
|
7252
|
+
|
|
7253
|
+
${(props) => props.$active && styled.css`
|
|
7254
|
+
animation: ${pulse} 2s infinite;
|
|
7255
|
+
`}
|
|
7256
|
+
|
|
7257
|
+
&:hover {
|
|
7258
|
+
transform: ${(props) => props.$completed ? "scale(1.1)" : props.$active ? "scale(1.05)" : "scale(1)"};
|
|
7259
|
+
}
|
|
7260
|
+
`;
|
|
7261
|
+
const StepLabel = styled__default.default(designSystem.Typography)`
|
|
7262
|
+
margin-top: 12px;
|
|
7263
|
+
font-size: 13px;
|
|
7264
|
+
color: ${(props) => props.$active ? colors.whatsapp : props.$completed ? colors.success : colors.textLight};
|
|
7265
|
+
white-space: nowrap;
|
|
7266
|
+
font-weight: ${(props) => props.$active ? 600 : 500};
|
|
7267
|
+
text-align: center;
|
|
7268
|
+
transition: all 0.3s ease;
|
|
7269
|
+
`;
|
|
7270
|
+
const ContentCard = styled__default.default(designSystem.Box)`
|
|
7271
|
+
background: ${colors.white};
|
|
7272
|
+
border: 1px solid ${colors.border};
|
|
7273
|
+
border-radius: 16px;
|
|
7274
|
+
padding: 32px;
|
|
7275
|
+
margin-bottom: 24px;
|
|
7276
|
+
animation: ${fadeIn$1} 0.4s ease;
|
|
7277
|
+
box-shadow: 0 4px 24px rgba(0,0,0,0.06);
|
|
7278
|
+
`;
|
|
7279
|
+
const QRCodeContainer = styled__default.default.div`
|
|
7280
|
+
display: flex;
|
|
7281
|
+
flex-direction: column;
|
|
7282
|
+
align-items: center;
|
|
7283
|
+
padding: 32px;
|
|
7284
|
+
background: ${colors.neutralLight};
|
|
7285
|
+
border-radius: 16px;
|
|
7286
|
+
margin: 24px 0;
|
|
7287
|
+
`;
|
|
7288
|
+
const QRImage = styled__default.default.img`
|
|
7289
|
+
width: 280px;
|
|
7290
|
+
height: 280px;
|
|
7291
|
+
border-radius: 12px;
|
|
7292
|
+
box-shadow: 0 4px 24px rgba(0,0,0,0.1);
|
|
7293
|
+
`;
|
|
7294
|
+
const StatusBadge = styled__default.default.div`
|
|
7295
|
+
display: inline-flex;
|
|
7296
|
+
align-items: center;
|
|
7297
|
+
gap: 8px;
|
|
7298
|
+
padding: 8px 16px;
|
|
7299
|
+
border-radius: 20px;
|
|
7300
|
+
font-weight: 600;
|
|
7301
|
+
font-size: 14px;
|
|
7302
|
+
background: ${(props) => {
|
|
7303
|
+
switch (props.$status) {
|
|
7304
|
+
case "connected":
|
|
7305
|
+
return colors.successLight;
|
|
7306
|
+
case "connecting":
|
|
7307
|
+
return colors.primaryLight;
|
|
7308
|
+
case "qr_pending":
|
|
7309
|
+
return colors.whatsappLight;
|
|
7310
|
+
case "disconnected":
|
|
7311
|
+
return colors.neutralLight;
|
|
7312
|
+
default:
|
|
7313
|
+
return colors.neutralLight;
|
|
7314
|
+
}
|
|
7315
|
+
}};
|
|
7316
|
+
color: ${(props) => {
|
|
7317
|
+
switch (props.$status) {
|
|
7318
|
+
case "connected":
|
|
7319
|
+
return colors.success;
|
|
7320
|
+
case "connecting":
|
|
7321
|
+
return colors.primary;
|
|
7322
|
+
case "qr_pending":
|
|
7323
|
+
return colors.whatsappDark;
|
|
7324
|
+
case "disconnected":
|
|
7325
|
+
return colors.neutral;
|
|
7326
|
+
default:
|
|
7327
|
+
return colors.neutral;
|
|
7328
|
+
}
|
|
7329
|
+
}};
|
|
7330
|
+
`;
|
|
7331
|
+
const SpinningLoader = styled__default.default.div`
|
|
7332
|
+
width: 20px;
|
|
7333
|
+
height: 20px;
|
|
7334
|
+
border: 2px solid ${colors.primary}40;
|
|
7335
|
+
border-top-color: ${colors.primary};
|
|
7336
|
+
border-radius: 50%;
|
|
7337
|
+
animation: ${spin} 1s linear infinite;
|
|
7338
|
+
`;
|
|
7339
|
+
const ConnectedCard = styled__default.default(designSystem.Box)`
|
|
7340
|
+
background: linear-gradient(135deg, ${colors.successLight}, ${colors.whatsappLight});
|
|
7341
|
+
border: 2px solid ${colors.success};
|
|
7342
|
+
border-radius: 16px;
|
|
7343
|
+
padding: 32px;
|
|
7344
|
+
text-align: center;
|
|
7345
|
+
`;
|
|
7346
|
+
const InfoBox = styled__default.default(designSystem.Box)`
|
|
7347
|
+
background: ${colors.primaryLight};
|
|
7348
|
+
border: 1px solid ${colors.primary}33;
|
|
7349
|
+
border-radius: 12px;
|
|
7350
|
+
padding: 20px;
|
|
7351
|
+
margin: 16px 0;
|
|
7352
|
+
`;
|
|
7353
|
+
const TestSection = styled__default.default(designSystem.Box)`
|
|
7354
|
+
background: ${colors.neutralLight};
|
|
7355
|
+
border-radius: 12px;
|
|
7356
|
+
padding: 24px;
|
|
7357
|
+
margin-top: 24px;
|
|
7358
|
+
`;
|
|
7359
|
+
const UseCaseCard = styled__default.default(designSystem.Box)`
|
|
7360
|
+
background: linear-gradient(135deg, ${colors.primaryLight}, ${colors.whatsappLight});
|
|
7361
|
+
border: 2px solid ${colors.whatsapp};
|
|
7362
|
+
border-radius: 16px;
|
|
7363
|
+
padding: 24px;
|
|
7364
|
+
margin-bottom: 32px;
|
|
7365
|
+
`;
|
|
7366
|
+
const ButtonRow = styled__default.default(designSystem.Flex)`
|
|
7367
|
+
margin-top: 32px;
|
|
7368
|
+
padding-top: 24px;
|
|
7369
|
+
border-top: 1px solid ${colors.border};
|
|
7370
|
+
`;
|
|
7371
|
+
const NotInstalledCard = styled__default.default(designSystem.Box)`
|
|
7372
|
+
background: linear-gradient(135deg, #FEF3C7, #FEE2E2);
|
|
7373
|
+
border: 2px solid #F59E0B;
|
|
7374
|
+
border-radius: 16px;
|
|
7375
|
+
padding: 32px;
|
|
7376
|
+
text-align: center;
|
|
7377
|
+
`;
|
|
7378
|
+
const WhatsAppPage = () => {
|
|
7379
|
+
const { get, post } = admin.useFetchClient();
|
|
7380
|
+
const { toggleNotification } = admin.useNotification();
|
|
7381
|
+
const [currentStep, setCurrentStep] = React.useState(1);
|
|
7382
|
+
const [loading, setLoading] = React.useState(true);
|
|
7383
|
+
const [connecting, setConnecting] = React.useState(false);
|
|
7384
|
+
const [isAvailable, setIsAvailable] = React.useState(false);
|
|
7385
|
+
const [status, setStatus] = React.useState({
|
|
7386
|
+
status: "disconnected",
|
|
7387
|
+
qrCode: null,
|
|
7388
|
+
isConnected: false,
|
|
7389
|
+
session: null
|
|
7390
|
+
});
|
|
7391
|
+
const [testPhone, setTestPhone] = React.useState("");
|
|
7392
|
+
const [testMessage, setTestMessage] = React.useState("");
|
|
7393
|
+
const [sendingTest, setSendingTest] = React.useState(false);
|
|
7394
|
+
const stepTitles = ["Check Installation", "Connect WhatsApp", "Scan QR Code", "Ready to Use"];
|
|
7395
|
+
const checkAvailability = React.useCallback(async () => {
|
|
7396
|
+
try {
|
|
7397
|
+
const { data } = await get("/magic-mail/whatsapp/available");
|
|
7398
|
+
setIsAvailable(data.data.available);
|
|
7399
|
+
return data.data.available;
|
|
7400
|
+
} catch (error) {
|
|
7401
|
+
console.error("[MagicMail WhatsApp] Error checking availability:", error);
|
|
7402
|
+
setIsAvailable(false);
|
|
7403
|
+
return false;
|
|
7404
|
+
}
|
|
7405
|
+
}, [get]);
|
|
7406
|
+
const fetchStatus = React.useCallback(async () => {
|
|
7407
|
+
try {
|
|
7408
|
+
const { data } = await get("/magic-mail/whatsapp/status");
|
|
7409
|
+
setStatus(data.data);
|
|
7410
|
+
if (data.data.isConnected) {
|
|
7411
|
+
setCurrentStep(4);
|
|
7412
|
+
} else if (data.data.qrCode) {
|
|
7413
|
+
setCurrentStep(3);
|
|
7414
|
+
} else if (isAvailable) {
|
|
7415
|
+
setCurrentStep(2);
|
|
7416
|
+
}
|
|
7417
|
+
return data.data;
|
|
7418
|
+
} catch (error) {
|
|
7419
|
+
console.error("[MagicMail WhatsApp] Error fetching status:", error);
|
|
7420
|
+
return null;
|
|
7421
|
+
}
|
|
7422
|
+
}, [get, isAvailable]);
|
|
7423
|
+
React.useEffect(() => {
|
|
7424
|
+
const init = async () => {
|
|
7425
|
+
setLoading(true);
|
|
7426
|
+
const available = await checkAvailability();
|
|
7427
|
+
if (available) {
|
|
7428
|
+
await fetchStatus();
|
|
7429
|
+
}
|
|
7430
|
+
setLoading(false);
|
|
7431
|
+
};
|
|
7432
|
+
init();
|
|
7433
|
+
}, [checkAvailability, fetchStatus]);
|
|
7434
|
+
React.useEffect(() => {
|
|
7435
|
+
let pollInterval;
|
|
7436
|
+
if (connecting || status.status === "connecting" || status.status === "qr_pending") {
|
|
7437
|
+
pollInterval = setInterval(async () => {
|
|
7438
|
+
const newStatus = await fetchStatus();
|
|
7439
|
+
if (newStatus?.isConnected) {
|
|
7440
|
+
setConnecting(false);
|
|
7441
|
+
setCurrentStep(4);
|
|
7442
|
+
toggleNotification({
|
|
7443
|
+
type: "success",
|
|
7444
|
+
message: "[SUCCESS] WhatsApp connected successfully!"
|
|
7445
|
+
});
|
|
7446
|
+
}
|
|
7447
|
+
}, 2e3);
|
|
7448
|
+
}
|
|
7449
|
+
return () => {
|
|
7450
|
+
if (pollInterval) clearInterval(pollInterval);
|
|
7451
|
+
};
|
|
7452
|
+
}, [connecting, status.status, fetchStatus, toggleNotification]);
|
|
7453
|
+
const handleConnect = async () => {
|
|
7454
|
+
setConnecting(true);
|
|
7455
|
+
try {
|
|
7456
|
+
const { data } = await post("/magic-mail/whatsapp/connect", {});
|
|
7457
|
+
if (data.data.qrCode) {
|
|
7458
|
+
setStatus((prev) => ({ ...prev, qrCode: data.data.qrCode, status: "qr_pending" }));
|
|
7459
|
+
setCurrentStep(3);
|
|
7460
|
+
} else if (data.data.status === "connected") {
|
|
7461
|
+
setStatus((prev) => ({ ...prev, isConnected: true, status: "connected" }));
|
|
7462
|
+
setCurrentStep(4);
|
|
7463
|
+
toggleNotification({
|
|
7464
|
+
type: "success",
|
|
7465
|
+
message: "[SUCCESS] WhatsApp already connected!"
|
|
7466
|
+
});
|
|
7467
|
+
}
|
|
7468
|
+
} catch (error) {
|
|
7469
|
+
toggleNotification({
|
|
7470
|
+
type: "danger",
|
|
7471
|
+
message: "[ERROR] Failed to connect: " + (error.response?.data?.error?.message || error.message)
|
|
7472
|
+
});
|
|
7473
|
+
setConnecting(false);
|
|
7474
|
+
}
|
|
7475
|
+
};
|
|
7476
|
+
const handleDisconnect = async () => {
|
|
7477
|
+
try {
|
|
7478
|
+
await post("/magic-mail/whatsapp/disconnect", {});
|
|
7479
|
+
setStatus({
|
|
7480
|
+
status: "disconnected",
|
|
7481
|
+
qrCode: null,
|
|
7482
|
+
isConnected: false,
|
|
7483
|
+
session: null
|
|
7484
|
+
});
|
|
7485
|
+
setCurrentStep(2);
|
|
7486
|
+
toggleNotification({
|
|
7487
|
+
type: "success",
|
|
7488
|
+
message: "[SUCCESS] WhatsApp disconnected"
|
|
7489
|
+
});
|
|
7490
|
+
} catch (error) {
|
|
7491
|
+
toggleNotification({
|
|
7492
|
+
type: "danger",
|
|
7493
|
+
message: "[ERROR] Failed to disconnect"
|
|
7494
|
+
});
|
|
7495
|
+
}
|
|
7496
|
+
};
|
|
7497
|
+
const handleSendTest = async () => {
|
|
7498
|
+
if (!testPhone) {
|
|
7499
|
+
toggleNotification({
|
|
7500
|
+
type: "warning",
|
|
7501
|
+
message: "Please enter a phone number"
|
|
7502
|
+
});
|
|
7503
|
+
return;
|
|
7504
|
+
}
|
|
7505
|
+
setSendingTest(true);
|
|
7506
|
+
try {
|
|
7507
|
+
const { data } = await post("/magic-mail/whatsapp/send-test", {
|
|
7508
|
+
phoneNumber: testPhone,
|
|
7509
|
+
message: testMessage || void 0
|
|
7510
|
+
});
|
|
7511
|
+
if (data.success) {
|
|
7512
|
+
toggleNotification({
|
|
7513
|
+
type: "success",
|
|
7514
|
+
message: "[SUCCESS] Test message sent!"
|
|
7515
|
+
});
|
|
7516
|
+
setTestPhone("");
|
|
7517
|
+
setTestMessage("");
|
|
7518
|
+
} else {
|
|
7519
|
+
toggleNotification({
|
|
7520
|
+
type: "danger",
|
|
7521
|
+
message: "[ERROR] " + (data.data.error || "Failed to send message")
|
|
7522
|
+
});
|
|
7523
|
+
}
|
|
7524
|
+
} catch (error) {
|
|
7525
|
+
toggleNotification({
|
|
7526
|
+
type: "danger",
|
|
7527
|
+
message: "[ERROR] " + (error.response?.data?.error?.message || error.message)
|
|
7528
|
+
});
|
|
7529
|
+
} finally {
|
|
7530
|
+
setSendingTest(false);
|
|
7531
|
+
}
|
|
7532
|
+
};
|
|
7533
|
+
const renderStatusBadge = () => {
|
|
7534
|
+
const statusText = {
|
|
7535
|
+
connected: "Connected",
|
|
7536
|
+
connecting: "Connecting...",
|
|
7537
|
+
qr_pending: "Waiting for QR Scan",
|
|
7538
|
+
disconnected: "Disconnected"
|
|
7539
|
+
};
|
|
7540
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(StatusBadge, { $status: status.status, children: [
|
|
7541
|
+
status.status === "connecting" && /* @__PURE__ */ jsxRuntime.jsx(SpinningLoader, {}),
|
|
7542
|
+
status.status === "connected" && /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
|
|
7543
|
+
statusText[status.status] || "Unknown"
|
|
7544
|
+
] });
|
|
7545
|
+
};
|
|
7546
|
+
if (loading) {
|
|
7547
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PageContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, {}) }) });
|
|
7548
|
+
}
|
|
7549
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(PageContainer, { children: [
|
|
7550
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HeaderSection, { children: [
|
|
7551
|
+
/* @__PURE__ */ jsxRuntime.jsx(WhatsAppLogo, { children: /* @__PURE__ */ jsxRuntime.jsx(PhoneIcon, { children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "40", height: "40", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z" }) }) }) }),
|
|
7552
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "WhatsApp Integration" }),
|
|
7553
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", style: { display: "block" }, children: "Send messages via WhatsApp - completely free!" }),
|
|
7554
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 3, children: renderStatusBadge() })
|
|
7555
|
+
] }),
|
|
7556
|
+
/* @__PURE__ */ jsxRuntime.jsx(StepperContainer, { children: [1, 2, 3, 4].map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7557
|
+
StepWrapper,
|
|
7558
|
+
{
|
|
7559
|
+
$completed: currentStep > step,
|
|
7560
|
+
children: [
|
|
7561
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7562
|
+
StepDot,
|
|
7563
|
+
{
|
|
7564
|
+
$active: currentStep === step,
|
|
7565
|
+
$completed: currentStep > step,
|
|
7566
|
+
onClick: () => currentStep > step && setCurrentStep(step),
|
|
7567
|
+
children: currentStep > step ? /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}) : step
|
|
7568
|
+
}
|
|
7569
|
+
),
|
|
7570
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7571
|
+
StepLabel,
|
|
7572
|
+
{
|
|
7573
|
+
$active: currentStep === step,
|
|
7574
|
+
$completed: currentStep > step,
|
|
7575
|
+
children: stepTitles[step - 1]
|
|
7576
|
+
}
|
|
7577
|
+
)
|
|
7578
|
+
]
|
|
7579
|
+
},
|
|
7580
|
+
step
|
|
7581
|
+
)) }),
|
|
7582
|
+
/* @__PURE__ */ jsxRuntime.jsxs(UseCaseCard, { children: [
|
|
7583
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "12px" }, children: "What can you do with WhatsApp?" }),
|
|
7584
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", style: { display: "block", marginBottom: "16px" }, children: "WhatsApp integration provides free messaging as an alternative or backup to email delivery." }),
|
|
7585
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
|
|
7586
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 3, background: "neutral0", hasRadius: true, style: { border: `1px solid ${colors.border}` }, children: [
|
|
7587
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "1. FALLBACK-KANAL" }),
|
|
7588
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { display: "block" }, children: "Wenn alle Email-Accounts fehlschlagen, wird die Nachricht automatisch via WhatsApp zugestellt." })
|
|
7589
|
+
] }),
|
|
7590
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 3, background: "neutral0", hasRadius: true, style: { border: `1px solid ${colors.border}` }, children: [
|
|
7591
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "2. ADMIN-BENACHRICHTIGUNGEN" }),
|
|
7592
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { display: "block" }, children: "Bei Email-Bounces, Quota-Limits oder Account-Fehlern wird der Admin via WhatsApp benachrichtigt." })
|
|
7593
|
+
] }),
|
|
7594
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 3, background: "neutral0", hasRadius: true, style: { border: `1px solid ${colors.border}` }, children: [
|
|
7595
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "3. ROUTING-INTEGRATION" }),
|
|
7596
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { display: "block" }, children: "In Routing-Regeln kann WhatsApp als Fallback-Kanal definiert werden (Routing Rules Tab)." })
|
|
7597
|
+
] })
|
|
7598
|
+
] })
|
|
7599
|
+
] }),
|
|
7600
|
+
currentStep === 1 && /* @__PURE__ */ jsxRuntime.jsxs(ContentCard, { children: [
|
|
7601
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Check Installation" }),
|
|
7602
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "First, we need to verify that the required dependencies are installed." }),
|
|
7603
|
+
isAvailable ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Alert, { variant: "success", title: "[SUCCESS] Dependencies Installed", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { display: "block" }, children: "Baileys library is installed and ready to use. You can proceed to connect your WhatsApp account." }) }) : /* @__PURE__ */ jsxRuntime.jsxs(NotInstalledCard, { children: [
|
|
7604
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "12px", color: colors.danger }, children: "[WARNING] Dependencies Not Installed" }),
|
|
7605
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "16px" }, children: "The WhatsApp integration requires additional dependencies. Please install them:" }),
|
|
7606
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7607
|
+
designSystem.Box,
|
|
7608
|
+
{
|
|
7609
|
+
padding: 4,
|
|
7610
|
+
background: "neutral0",
|
|
7611
|
+
hasRadius: true,
|
|
7612
|
+
style: {
|
|
7613
|
+
fontFamily: "monospace",
|
|
7614
|
+
fontSize: "14px",
|
|
7615
|
+
border: `1px solid ${colors.border}`,
|
|
7616
|
+
marginBottom: "16px"
|
|
7617
|
+
},
|
|
7618
|
+
children: "npm install @whiskeysockets/baileys pino qrcode"
|
|
7619
|
+
}
|
|
7620
|
+
),
|
|
7621
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "After installing, restart your Strapi server and refresh this page." })
|
|
7622
|
+
] }),
|
|
7623
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ButtonRow, { justifyContent: "flex-end", children: [
|
|
7624
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7625
|
+
designSystem.Button,
|
|
7626
|
+
{
|
|
7627
|
+
onClick: () => {
|
|
7628
|
+
checkAvailability();
|
|
7629
|
+
},
|
|
7630
|
+
variant: "secondary",
|
|
7631
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowClockwise, {}),
|
|
7632
|
+
style: { marginRight: "12px" },
|
|
7633
|
+
children: "Refresh"
|
|
7634
|
+
}
|
|
7635
|
+
),
|
|
7636
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7637
|
+
designSystem.Button,
|
|
7638
|
+
{
|
|
7639
|
+
onClick: () => setCurrentStep(2),
|
|
7640
|
+
disabled: !isAvailable,
|
|
7641
|
+
endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowRight, {}),
|
|
7642
|
+
children: "Continue"
|
|
7643
|
+
}
|
|
7644
|
+
)
|
|
7645
|
+
] })
|
|
7646
|
+
] }),
|
|
7647
|
+
currentStep === 2 && /* @__PURE__ */ jsxRuntime.jsxs(ContentCard, { children: [
|
|
7648
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Connect Your WhatsApp" }),
|
|
7649
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.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." }),
|
|
7650
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoBox, { children: [
|
|
7651
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "12px" }, children: "How it works" }),
|
|
7652
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
|
|
7653
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: '1. Click "Connect WhatsApp" to generate a QR code' }),
|
|
7654
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: "2. Open WhatsApp on your phone" }),
|
|
7655
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: "3. Go to Settings - Linked Devices - Link a Device" }),
|
|
7656
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: "4. Scan the QR code with your phone" })
|
|
7657
|
+
] })
|
|
7658
|
+
] }),
|
|
7659
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Alert, { variant: "default", title: "Session Persistence", style: { marginTop: "16px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.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." }) }),
|
|
7660
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
7661
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7662
|
+
designSystem.Button,
|
|
7663
|
+
{
|
|
7664
|
+
onClick: () => setCurrentStep(1),
|
|
7665
|
+
variant: "tertiary",
|
|
7666
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeft, {}),
|
|
7667
|
+
children: "Back"
|
|
7668
|
+
}
|
|
7669
|
+
),
|
|
7670
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7671
|
+
designSystem.Button,
|
|
7672
|
+
{
|
|
7673
|
+
onClick: handleConnect,
|
|
7674
|
+
loading: connecting,
|
|
7675
|
+
style: { background: colors.whatsapp },
|
|
7676
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Play, {}),
|
|
7677
|
+
children: "Connect WhatsApp"
|
|
7678
|
+
}
|
|
7679
|
+
)
|
|
7680
|
+
] })
|
|
7681
|
+
] }),
|
|
7682
|
+
currentStep === 3 && /* @__PURE__ */ jsxRuntime.jsxs(ContentCard, { children: [
|
|
7683
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Scan QR Code" }),
|
|
7684
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "Open WhatsApp on your phone and scan this QR code to connect." }),
|
|
7685
|
+
/* @__PURE__ */ jsxRuntime.jsx(QRCodeContainer, { children: status.qrCode ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7686
|
+
/* @__PURE__ */ jsxRuntime.jsx(QRImage, { src: status.qrCode, alt: "WhatsApp QR Code" }),
|
|
7687
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginTop: "16px" }, children: 'QR code expires in 60 seconds. If it expires, click "Refresh QR".' })
|
|
7688
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 3, children: [
|
|
7689
|
+
/* @__PURE__ */ jsxRuntime.jsx(SpinningLoader, { style: { width: "40px", height: "40px" } }),
|
|
7690
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: "Generating QR code..." })
|
|
7691
|
+
] }) }),
|
|
7692
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Alert, { variant: "default", title: "Instructions", children: [
|
|
7693
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", children: "1. Open WhatsApp on your phone" }),
|
|
7694
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", children: "2. Tap Menu or Settings" }),
|
|
7695
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", children: '3. Select "Linked Devices"' }),
|
|
7696
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", children: '4. Tap "Link a Device"' }),
|
|
7697
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", children: "5. Point your phone camera at this QR code" })
|
|
7698
|
+
] }),
|
|
7699
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
7700
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7701
|
+
designSystem.Button,
|
|
7702
|
+
{
|
|
7703
|
+
onClick: () => setCurrentStep(2),
|
|
7704
|
+
variant: "tertiary",
|
|
7705
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeft, {}),
|
|
7706
|
+
children: "Back"
|
|
7707
|
+
}
|
|
7708
|
+
),
|
|
7709
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7710
|
+
designSystem.Button,
|
|
7711
|
+
{
|
|
7712
|
+
onClick: handleConnect,
|
|
7713
|
+
variant: "secondary",
|
|
7714
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowClockwise, {}),
|
|
7715
|
+
children: "Refresh QR"
|
|
7716
|
+
}
|
|
7717
|
+
)
|
|
7718
|
+
] })
|
|
7719
|
+
] }),
|
|
7720
|
+
currentStep === 4 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7721
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ConnectedCard, { children: [
|
|
7722
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, { style: { width: "48px", height: "48px", color: colors.success } }) }),
|
|
7723
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "WhatsApp Connected" }),
|
|
7724
|
+
status.session && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block" }, children: [
|
|
7725
|
+
"Connected as: ",
|
|
7726
|
+
status.session.phoneNumber,
|
|
7727
|
+
" ",
|
|
7728
|
+
status.session.name && `(${status.session.name})`
|
|
7729
|
+
] })
|
|
7730
|
+
] }),
|
|
7731
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ContentCard, { style: { marginTop: "24px" }, children: [
|
|
7732
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Send Test Message" }),
|
|
7733
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "Test your WhatsApp connection by sending a message." }),
|
|
7734
|
+
/* @__PURE__ */ jsxRuntime.jsx(TestSection, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 4, children: [
|
|
7735
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
7736
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Phone Number" }),
|
|
7737
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7738
|
+
designSystem.TextInput,
|
|
7739
|
+
{
|
|
7740
|
+
placeholder: "49123456789 (with country code, no +)",
|
|
7741
|
+
value: testPhone,
|
|
7742
|
+
onChange: (e) => setTestPhone(e.target.value)
|
|
7743
|
+
}
|
|
7744
|
+
),
|
|
7745
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, { children: "Enter phone number with country code (e.g., 49 for Germany)" })
|
|
7746
|
+
] }),
|
|
7747
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
7748
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Message (optional)" }),
|
|
7749
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7750
|
+
designSystem.TextInput,
|
|
7751
|
+
{
|
|
7752
|
+
placeholder: "Leave empty for default test message",
|
|
7753
|
+
value: testMessage,
|
|
7754
|
+
onChange: (e) => setTestMessage(e.target.value)
|
|
7755
|
+
}
|
|
7756
|
+
)
|
|
7757
|
+
] }),
|
|
7758
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7759
|
+
designSystem.Button,
|
|
7760
|
+
{
|
|
7761
|
+
onClick: handleSendTest,
|
|
7762
|
+
loading: sendingTest,
|
|
7763
|
+
style: { background: colors.whatsapp },
|
|
7764
|
+
children: "Send Test Message"
|
|
7765
|
+
}
|
|
7766
|
+
)
|
|
7767
|
+
] }) }),
|
|
7768
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { margin: "24px 0" } }),
|
|
7769
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Using WhatsApp in Your Code" }),
|
|
7770
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "16px" }, children: "Use the WhatsApp service programmatically in your Strapi code." }),
|
|
7771
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7772
|
+
designSystem.Box,
|
|
7773
|
+
{
|
|
7774
|
+
padding: 4,
|
|
7775
|
+
background: "neutral100",
|
|
7776
|
+
hasRadius: true,
|
|
7777
|
+
style: {
|
|
7778
|
+
fontFamily: "monospace",
|
|
7779
|
+
fontSize: "13px",
|
|
7780
|
+
lineHeight: "1.6",
|
|
7781
|
+
overflow: "auto"
|
|
7782
|
+
},
|
|
7783
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("pre", { style: { margin: 0 }, children: `// Send a message via WhatsApp
|
|
7784
|
+
const whatsapp = strapi.plugin('magic-mail').service('whatsapp');
|
|
7785
|
+
|
|
7786
|
+
// Send simple message
|
|
7787
|
+
await whatsapp.sendMessage('49123456789', 'Hello from MagicMail!');
|
|
7788
|
+
|
|
7789
|
+
// Send template message
|
|
7790
|
+
await whatsapp.sendTemplateMessage('49123456789', 'welcome', {
|
|
7791
|
+
name: 'John',
|
|
7792
|
+
company: 'ACME Corp',
|
|
7793
|
+
});` })
|
|
7794
|
+
}
|
|
7795
|
+
),
|
|
7796
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
7797
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7798
|
+
designSystem.Button,
|
|
7799
|
+
{
|
|
7800
|
+
onClick: handleDisconnect,
|
|
7801
|
+
variant: "danger",
|
|
7802
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}),
|
|
7803
|
+
children: "Disconnect WhatsApp"
|
|
7804
|
+
}
|
|
7805
|
+
),
|
|
7806
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success600", textColor: "neutral0", children: "FREE - No API costs!" })
|
|
7807
|
+
] })
|
|
7808
|
+
] })
|
|
7809
|
+
] })
|
|
7810
|
+
] });
|
|
7811
|
+
};
|
|
7103
7812
|
const fadeIn = styled.keyframes`
|
|
7104
7813
|
from { opacity: 0; }
|
|
7105
7814
|
to { opacity: 1; }
|
|
@@ -7523,6 +8232,7 @@ const App = () => {
|
|
|
7523
8232
|
if (location.pathname.includes("/analytics")) return "analytics";
|
|
7524
8233
|
if (location.pathname.includes("/routing")) return "routing";
|
|
7525
8234
|
if (location.pathname.includes("/designer") && !isEditorRoute) return "templates";
|
|
8235
|
+
if (location.pathname.includes("/whatsapp")) return "whatsapp";
|
|
7526
8236
|
return "accounts";
|
|
7527
8237
|
};
|
|
7528
8238
|
const [activeTab, setActiveTab] = React.useState(getActiveTab());
|
|
@@ -7532,6 +8242,7 @@ const App = () => {
|
|
|
7532
8242
|
if (tab === "routing") navigate("/plugins/magic-mail/routing");
|
|
7533
8243
|
if (tab === "templates") navigate("/plugins/magic-mail/designer");
|
|
7534
8244
|
if (tab === "analytics") navigate("/plugins/magic-mail/analytics");
|
|
8245
|
+
if (tab === "whatsapp") navigate("/plugins/magic-mail/whatsapp");
|
|
7535
8246
|
};
|
|
7536
8247
|
if (isEditorRoute) {
|
|
7537
8248
|
return /* @__PURE__ */ jsxRuntime.jsx(LicenseGuard, { children: /* @__PURE__ */ jsxRuntime.jsx(EditorPage, {}) });
|
|
@@ -7553,12 +8264,17 @@ const App = () => {
|
|
|
7553
8264
|
hasAnalytics && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Trigger, { value: "analytics", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
|
|
7554
8265
|
/* @__PURE__ */ jsxRuntime.jsx(outline.ChartBarIcon, { style: { width: 16, height: 16 } }),
|
|
7555
8266
|
"Analytics"
|
|
8267
|
+
] }) }),
|
|
8268
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Trigger, { value: "whatsapp", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
|
|
8269
|
+
/* @__PURE__ */ jsxRuntime.jsx(outline.ChatBubbleLeftIcon, { style: { width: 16, height: 16 } }),
|
|
8270
|
+
"WhatsApp"
|
|
7556
8271
|
] }) })
|
|
7557
8272
|
] }),
|
|
7558
8273
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "accounts", children: /* @__PURE__ */ jsxRuntime.jsx(HomePage, {}) }),
|
|
7559
8274
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "routing", children: /* @__PURE__ */ jsxRuntime.jsx(RoutingRulesPage, {}) }),
|
|
7560
8275
|
hasEmailDesigner && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "templates", children: /* @__PURE__ */ jsxRuntime.jsx(TemplateList, {}) }),
|
|
7561
|
-
hasAnalytics && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "analytics", children: /* @__PURE__ */ jsxRuntime.jsx(Analytics, {}) })
|
|
8276
|
+
hasAnalytics && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "analytics", children: /* @__PURE__ */ jsxRuntime.jsx(Analytics, {}) }),
|
|
8277
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "whatsapp", children: /* @__PURE__ */ jsxRuntime.jsx(WhatsAppPage, {}) })
|
|
7562
8278
|
] }) }) });
|
|
7563
8279
|
};
|
|
7564
8280
|
exports.default = App;
|