strapi-plugin-magic-mail 3.0.3 → 3.1.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/CHANGELOG.md +22 -0
- package/README.md +31 -217
- package/dist/admin/{App-bZGJVVWn.mjs → App-Bmav09Ol.mjs} +87 -929
- package/dist/admin/{App-pjasEbqe.js → App-mX8QtU1Q.js} +85 -927
- package/dist/admin/{PluginSettings-DTqdZ-nW.mjs → PluginSettings-D5F5y7n2.mjs} +5 -5
- package/dist/admin/{PluginSettings-B6TdA1qd.js → PluginSettings-DE2PMxlS.js} +5 -5
- package/dist/admin/{de-SKsLY2de.mjs → de-BXyjQhJQ.mjs} +1 -21
- package/dist/admin/{de-DKEFnBGC.js → de-VtWzTjWV.js} +1 -21
- package/dist/admin/{en-CvtZE1HH.js → en-DL_aZYfg.js} +1 -21
- package/dist/admin/{en-Ds2Q7fue.mjs → en-DMdnprlB.mjs} +1 -21
- package/dist/admin/{es-BbLLes3D.js → es-BJ1KgkMA.js} +1 -21
- package/dist/admin/{es-BEvzLtTg.mjs → es-g3CHX4iu.mjs} +1 -21
- package/dist/admin/{fr-nH9uN6s9.js → fr-Bmh5-45j.js} +1 -21
- package/dist/admin/{fr-CRpwImX6.mjs → fr-CN1X3dM-.mjs} +1 -21
- package/dist/admin/index.js +3 -3
- package/dist/admin/index.mjs +3 -3
- package/dist/admin/{pt-qt_48NxL.js → pt-DJ6GNCKb.js} +1 -21
- package/dist/admin/{pt-CjOe2N_n.mjs → pt-m8_Gnsqe.mjs} +1 -21
- package/dist/server/index.js +119 -1245
- package/dist/server/index.mjs +119 -1245
- package/package.json +31 -36
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const React = require("react");
|
|
5
4
|
const reactRouterDom = require("react-router-dom");
|
|
6
5
|
const designSystem = require("@strapi/design-system");
|
|
7
6
|
const admin = require("@strapi/strapi/admin");
|
|
8
7
|
const outline = require("@heroicons/react/24/outline");
|
|
8
|
+
const React = require("react");
|
|
9
9
|
const styled = require("styled-components");
|
|
10
10
|
const icons = require("@strapi/icons");
|
|
11
11
|
const StyledButtons = require("./StyledButtons-jHF7TXal.js");
|
|
@@ -84,7 +84,7 @@ const theme$3 = {
|
|
|
84
84
|
xl: "16px"
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
const fadeIn$
|
|
87
|
+
const fadeIn$4 = styled.keyframes`
|
|
88
88
|
from {
|
|
89
89
|
opacity: 0;
|
|
90
90
|
transform: translateY(10px);
|
|
@@ -94,7 +94,7 @@ const fadeIn$5 = styled.keyframes`
|
|
|
94
94
|
transform: translateY(0);
|
|
95
95
|
}
|
|
96
96
|
`;
|
|
97
|
-
const pulse$
|
|
97
|
+
const pulse$2 = styled.keyframes`
|
|
98
98
|
0%, 100% {
|
|
99
99
|
transform: scale(1);
|
|
100
100
|
}
|
|
@@ -112,7 +112,7 @@ const slideIn = styled.keyframes`
|
|
|
112
112
|
opacity: 1;
|
|
113
113
|
}
|
|
114
114
|
`;
|
|
115
|
-
const colors
|
|
115
|
+
const colors = {
|
|
116
116
|
primary: "#4945ff",
|
|
117
117
|
// Strapi Primary Blue
|
|
118
118
|
primaryLight: "rgba(73, 69, 255, 0.06)",
|
|
@@ -130,7 +130,7 @@ const StepHeader = styled__default.default(designSystem.Box)`
|
|
|
130
130
|
padding-bottom: 24px;
|
|
131
131
|
margin-bottom: 32px;
|
|
132
132
|
position: relative;
|
|
133
|
-
animation: ${fadeIn$
|
|
133
|
+
animation: ${fadeIn$4} 0.4s ease;
|
|
134
134
|
|
|
135
135
|
&::after {
|
|
136
136
|
content: '';
|
|
@@ -139,11 +139,11 @@ const StepHeader = styled__default.default(designSystem.Box)`
|
|
|
139
139
|
left: -24px;
|
|
140
140
|
right: -24px;
|
|
141
141
|
height: 1px;
|
|
142
|
-
background: linear-gradient(90deg, transparent, ${colors
|
|
142
|
+
background: linear-gradient(90deg, transparent, ${colors.border}, transparent);
|
|
143
143
|
}
|
|
144
144
|
`;
|
|
145
145
|
const StepTitle = styled__default.default(designSystem.Typography)`
|
|
146
|
-
color: ${colors
|
|
146
|
+
color: ${colors.text};
|
|
147
147
|
font-size: 24px;
|
|
148
148
|
font-weight: 600;
|
|
149
149
|
margin-bottom: 8px;
|
|
@@ -152,11 +152,11 @@ const StepTitle = styled__default.default(designSystem.Typography)`
|
|
|
152
152
|
gap: 12px;
|
|
153
153
|
`;
|
|
154
154
|
const StepSubtitle = styled__default.default(designSystem.Typography)`
|
|
155
|
-
color: ${colors
|
|
155
|
+
color: ${colors.textLight};
|
|
156
156
|
font-size: 14px;
|
|
157
157
|
line-height: 1.5;
|
|
158
158
|
`;
|
|
159
|
-
const StepperContainer
|
|
159
|
+
const StepperContainer = styled__default.default(designSystem.Box)`
|
|
160
160
|
display: flex;
|
|
161
161
|
align-items: flex-start;
|
|
162
162
|
justify-content: center;
|
|
@@ -166,7 +166,7 @@ const StepperContainer$1 = styled__default.default(designSystem.Box)`
|
|
|
166
166
|
position: relative;
|
|
167
167
|
padding: 0 40px;
|
|
168
168
|
`;
|
|
169
|
-
const StepWrapper
|
|
169
|
+
const StepWrapper = styled__default.default.div`
|
|
170
170
|
flex: 1;
|
|
171
171
|
display: flex;
|
|
172
172
|
flex-direction: column;
|
|
@@ -180,18 +180,18 @@ const StepWrapper$1 = styled__default.default.div`
|
|
|
180
180
|
left: 50%;
|
|
181
181
|
width: 100%;
|
|
182
182
|
height: 3px;
|
|
183
|
-
background: ${(props) => props.$completed ? colors
|
|
183
|
+
background: ${(props) => props.$completed ? colors.success : colors.neutralLight};
|
|
184
184
|
transition: all 0.4s ease;
|
|
185
185
|
z-index: 0;
|
|
186
186
|
}
|
|
187
187
|
`;
|
|
188
|
-
const StepDot
|
|
188
|
+
const StepDot = styled__default.default.div`
|
|
189
189
|
width: 56px;
|
|
190
190
|
height: 56px;
|
|
191
191
|
border-radius: 50%;
|
|
192
|
-
background: ${(props) => props.$active ? colors
|
|
193
|
-
color: ${(props) => props.$active || props.$completed ? "#ffffff" : colors
|
|
194
|
-
border: 4px solid ${(props) => props.$active ? colors
|
|
192
|
+
background: ${(props) => props.$active ? colors.primary : props.$completed ? colors.success : props.theme.colors.neutral0};
|
|
193
|
+
color: ${(props) => props.$active || props.$completed ? "#ffffff" : colors.textLight};
|
|
194
|
+
border: 4px solid ${(props) => props.$active ? colors.primary : props.$completed ? colors.success : colors.border};
|
|
195
195
|
display: flex;
|
|
196
196
|
align-items: center;
|
|
197
197
|
justify-content: center;
|
|
@@ -201,20 +201,20 @@ const StepDot$1 = styled__default.default.div`
|
|
|
201
201
|
position: relative;
|
|
202
202
|
z-index: 1;
|
|
203
203
|
cursor: ${(props) => props.$completed ? "pointer" : "default"};
|
|
204
|
-
box-shadow: ${(props) => props.$active ? `0 4px 16px ${colors
|
|
204
|
+
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)"};
|
|
205
205
|
|
|
206
206
|
${(props) => props.$active && styled.css`
|
|
207
|
-
animation: ${pulse$
|
|
207
|
+
animation: ${pulse$2} 2s infinite;
|
|
208
208
|
`}
|
|
209
209
|
|
|
210
210
|
&:hover {
|
|
211
211
|
transform: ${(props) => props.$completed ? "scale(1.1)" : props.$active ? "scale(1.05)" : "scale(1)"};
|
|
212
212
|
}
|
|
213
213
|
`;
|
|
214
|
-
const StepLabel
|
|
214
|
+
const StepLabel = styled__default.default(designSystem.Typography)`
|
|
215
215
|
margin-top: 12px;
|
|
216
216
|
font-size: 13px;
|
|
217
|
-
color: ${(props) => props.$active ? colors
|
|
217
|
+
color: ${(props) => props.$active ? colors.primary : props.$completed ? colors.success : colors.textLight};
|
|
218
218
|
white-space: nowrap;
|
|
219
219
|
font-weight: ${(props) => props.$active ? 600 : 500};
|
|
220
220
|
text-align: center;
|
|
@@ -225,13 +225,13 @@ const ProviderCategoryHeader = styled__default.default(designSystem.Box)`
|
|
|
225
225
|
align-items: center;
|
|
226
226
|
gap: 12px;
|
|
227
227
|
margin: 0 0 16px;
|
|
228
|
-
animation: ${fadeIn$
|
|
228
|
+
animation: ${fadeIn$4} 0.4s ease;
|
|
229
229
|
|
|
230
230
|
&::after {
|
|
231
231
|
content: '';
|
|
232
232
|
flex: 1;
|
|
233
233
|
height: 1px;
|
|
234
|
-
background: linear-gradient(90deg, ${colors
|
|
234
|
+
background: linear-gradient(90deg, ${colors.border}, transparent);
|
|
235
235
|
}
|
|
236
236
|
`;
|
|
237
237
|
const ProviderCategoryLabel = styled__default.default(designSystem.Typography)`
|
|
@@ -239,15 +239,15 @@ const ProviderCategoryLabel = styled__default.default(designSystem.Typography)`
|
|
|
239
239
|
font-weight: 600;
|
|
240
240
|
letter-spacing: 0.08em;
|
|
241
241
|
text-transform: uppercase;
|
|
242
|
-
color: ${colors
|
|
242
|
+
color: ${colors.textLight};
|
|
243
243
|
`;
|
|
244
244
|
const ProviderCategoryHint = styled__default.default.span`
|
|
245
245
|
font-size: 11px;
|
|
246
246
|
font-weight: 500;
|
|
247
247
|
padding: 3px 10px;
|
|
248
248
|
border-radius: 999px;
|
|
249
|
-
background: ${colors
|
|
250
|
-
color: ${colors
|
|
249
|
+
background: ${colors.primaryLight};
|
|
250
|
+
color: ${colors.primary};
|
|
251
251
|
letter-spacing: 0.02em;
|
|
252
252
|
text-transform: none;
|
|
253
253
|
`;
|
|
@@ -267,8 +267,8 @@ const ProvidersGrid = styled__default.default(designSystem.Box)`
|
|
|
267
267
|
}
|
|
268
268
|
`;
|
|
269
269
|
const ProviderCard = styled__default.default(designSystem.Box)`
|
|
270
|
-
background: ${(props) => props.$selected ? `linear-gradient(180deg, ${colors
|
|
271
|
-
border: 1.5px solid ${(props) => props.$selected ? colors
|
|
270
|
+
background: ${(props) => props.$selected ? `linear-gradient(180deg, ${colors.successLight}, rgba(92, 177, 118, 0.04))` : "var(--colors-neutral100, rgba(255,255,255,0.02))"};
|
|
271
|
+
border: 1.5px solid ${(props) => props.$selected ? colors.success : colors.border};
|
|
272
272
|
border-radius: 14px;
|
|
273
273
|
padding: 22px 20px 20px;
|
|
274
274
|
cursor: pointer;
|
|
@@ -294,7 +294,7 @@ const ProviderCard = styled__default.default(designSystem.Box)`
|
|
|
294
294
|
&:hover {
|
|
295
295
|
transform: translateY(-3px);
|
|
296
296
|
box-shadow: 0 10px 28px rgba(73, 69, 255, 0.18);
|
|
297
|
-
border-color: ${(props) => props.$selected ? colors
|
|
297
|
+
border-color: ${(props) => props.$selected ? colors.success : colors.primary};
|
|
298
298
|
|
|
299
299
|
&::before {
|
|
300
300
|
opacity: 1;
|
|
@@ -302,12 +302,12 @@ const ProviderCard = styled__default.default(designSystem.Box)`
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
&:focus-visible {
|
|
305
|
-
outline: 2px solid ${colors
|
|
305
|
+
outline: 2px solid ${colors.primary};
|
|
306
306
|
outline-offset: 2px;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
${(props) => props.$selected && styled.css`
|
|
310
|
-
box-shadow: 0 0 0 1px ${colors
|
|
310
|
+
box-shadow: 0 0 0 1px ${colors.success}, 0 10px 28px rgba(92, 177, 118, 0.18);
|
|
311
311
|
|
|
312
312
|
&::after {
|
|
313
313
|
content: '✓';
|
|
@@ -316,7 +316,7 @@ const ProviderCard = styled__default.default(designSystem.Box)`
|
|
|
316
316
|
right: 12px;
|
|
317
317
|
width: 24px;
|
|
318
318
|
height: 24px;
|
|
319
|
-
background: ${colors
|
|
319
|
+
background: ${colors.success};
|
|
320
320
|
color: #fff;
|
|
321
321
|
border-radius: 50%;
|
|
322
322
|
display: flex;
|
|
@@ -341,7 +341,7 @@ const ProviderIcon = styled__default.default.div`
|
|
|
341
341
|
justify-content: center;
|
|
342
342
|
font-size: ${(props) => props.$fontSize || "22px"};
|
|
343
343
|
font-weight: 700;
|
|
344
|
-
color: ${(props) => props.$color || colors
|
|
344
|
+
color: ${(props) => props.$color || colors.primary};
|
|
345
345
|
box-shadow: 0 4px 14px ${(props) => props.$shadowColor || "rgba(73, 69, 255, 0.25)"};
|
|
346
346
|
flex-shrink: 0;
|
|
347
347
|
`;
|
|
@@ -355,22 +355,22 @@ const ProviderName = styled__default.default(designSystem.Typography)`
|
|
|
355
355
|
font-weight: 600;
|
|
356
356
|
font-size: 16px;
|
|
357
357
|
line-height: 1.25;
|
|
358
|
-
color: ${colors
|
|
358
|
+
color: ${colors.text};
|
|
359
359
|
margin: 0;
|
|
360
360
|
`;
|
|
361
361
|
const ProviderTagline = styled__default.default(designSystem.Typography)`
|
|
362
362
|
font-size: 12.5px;
|
|
363
363
|
line-height: 1.4;
|
|
364
|
-
color: ${colors
|
|
364
|
+
color: ${colors.textLight};
|
|
365
365
|
margin: 0;
|
|
366
366
|
`;
|
|
367
367
|
const InfoAlert = styled__default.default(designSystem.Alert)`
|
|
368
|
-
background: ${colors
|
|
369
|
-
border: 1px solid ${colors
|
|
370
|
-
animation: ${fadeIn$
|
|
368
|
+
background: ${colors.primaryLight};
|
|
369
|
+
border: 1px solid ${colors.primary}33;
|
|
370
|
+
animation: ${fadeIn$4} 0.4s ease;
|
|
371
371
|
|
|
372
372
|
svg {
|
|
373
|
-
color: ${colors
|
|
373
|
+
color: ${colors.primary};
|
|
374
374
|
}
|
|
375
375
|
`;
|
|
376
376
|
const FormSection = styled__default.default(designSystem.Box)`
|
|
@@ -390,7 +390,7 @@ const FullWidthField = styled__default.default(designSystem.Box)`
|
|
|
390
390
|
}
|
|
391
391
|
`;
|
|
392
392
|
const SectionTitle = styled__default.default(designSystem.Typography)`
|
|
393
|
-
color: ${colors
|
|
393
|
+
color: ${colors.text};
|
|
394
394
|
font-weight: 600;
|
|
395
395
|
font-size: 16px;
|
|
396
396
|
margin-bottom: 16px;
|
|
@@ -888,13 +888,13 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
888
888
|
currentStep === 4 && "Set rate limits and priority for this account"
|
|
889
889
|
] })
|
|
890
890
|
] }),
|
|
891
|
-
/* @__PURE__ */ jsxRuntime.jsx(StepperContainer
|
|
892
|
-
StepWrapper
|
|
891
|
+
/* @__PURE__ */ jsxRuntime.jsx(StepperContainer, { children: [1, 2, 3, 4].map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
892
|
+
StepWrapper,
|
|
893
893
|
{
|
|
894
894
|
$completed: currentStep > step,
|
|
895
895
|
children: [
|
|
896
896
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
897
|
-
StepDot
|
|
897
|
+
StepDot,
|
|
898
898
|
{
|
|
899
899
|
$active: currentStep === step,
|
|
900
900
|
$completed: currentStep > step,
|
|
@@ -903,7 +903,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
903
903
|
}
|
|
904
904
|
),
|
|
905
905
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
906
|
-
StepLabel
|
|
906
|
+
StepLabel,
|
|
907
907
|
{
|
|
908
908
|
$active: currentStep === step,
|
|
909
909
|
$completed: currentStep > step,
|
|
@@ -1295,7 +1295,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1295
1295
|
background: "neutral100",
|
|
1296
1296
|
hasRadius: true,
|
|
1297
1297
|
style: {
|
|
1298
|
-
border: `1px solid ${colors
|
|
1298
|
+
border: `1px solid ${colors.border}`,
|
|
1299
1299
|
borderRadius: "8px"
|
|
1300
1300
|
},
|
|
1301
1301
|
children: [
|
|
@@ -1312,7 +1312,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1312
1312
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1313
1313
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "1." }),
|
|
1314
1314
|
" Go to ",
|
|
1315
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://console.cloud.google.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors
|
|
1315
|
+
/* @__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" })
|
|
1316
1316
|
] }),
|
|
1317
1317
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1318
1318
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "2." }),
|
|
@@ -1338,7 +1338,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1338
1338
|
fontFamily: "monospace",
|
|
1339
1339
|
fontSize: "13px",
|
|
1340
1340
|
wordBreak: "break-all",
|
|
1341
|
-
border: `1px solid ${colors
|
|
1341
|
+
border: `1px solid ${colors.border}`
|
|
1342
1342
|
},
|
|
1343
1343
|
children: [
|
|
1344
1344
|
window.location.origin,
|
|
@@ -1439,7 +1439,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1439
1439
|
background: "neutral100",
|
|
1440
1440
|
hasRadius: true,
|
|
1441
1441
|
style: {
|
|
1442
|
-
border: `1px solid ${colors
|
|
1442
|
+
border: `1px solid ${colors.border}`,
|
|
1443
1443
|
borderRadius: "8px"
|
|
1444
1444
|
},
|
|
1445
1445
|
children: [
|
|
@@ -1456,7 +1456,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1456
1456
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1457
1457
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "1." }),
|
|
1458
1458
|
" Go to ",
|
|
1459
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://portal.azure.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors
|
|
1459
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://portal.azure.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors.primary, textDecoration: "underline" }, children: "portal.azure.com" })
|
|
1460
1460
|
] }),
|
|
1461
1461
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1462
1462
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "2." }),
|
|
@@ -1490,8 +1490,8 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1490
1490
|
fontFamily: "monospace",
|
|
1491
1491
|
fontSize: "13px",
|
|
1492
1492
|
wordBreak: "break-all",
|
|
1493
|
-
color: colors
|
|
1494
|
-
border: `1px solid ${colors
|
|
1493
|
+
color: colors.textSecondary,
|
|
1494
|
+
border: `1px solid ${colors.border}`
|
|
1495
1495
|
},
|
|
1496
1496
|
children: `${window.location.origin}/magic-mail/oauth/microsoft/callback`
|
|
1497
1497
|
}
|
|
@@ -1616,7 +1616,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1616
1616
|
background: "neutral100",
|
|
1617
1617
|
hasRadius: true,
|
|
1618
1618
|
style: {
|
|
1619
|
-
border: `1px solid ${colors
|
|
1619
|
+
border: `1px solid ${colors.border}`,
|
|
1620
1620
|
borderRadius: "8px"
|
|
1621
1621
|
},
|
|
1622
1622
|
children: [
|
|
@@ -1633,7 +1633,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1633
1633
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1634
1634
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "1." }),
|
|
1635
1635
|
" Go to ",
|
|
1636
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://developer.yahoo.com/apps/", target: "_blank", rel: "noopener noreferrer", style: { color: colors
|
|
1636
|
+
/* @__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" })
|
|
1637
1637
|
] }),
|
|
1638
1638
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
1639
1639
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "2." }),
|
|
@@ -1659,8 +1659,8 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1659
1659
|
fontFamily: "monospace",
|
|
1660
1660
|
fontSize: "13px",
|
|
1661
1661
|
wordBreak: "break-all",
|
|
1662
|
-
color: colors
|
|
1663
|
-
border: `1px solid ${colors
|
|
1662
|
+
color: colors.textSecondary,
|
|
1663
|
+
border: `1px solid ${colors.border}`
|
|
1664
1664
|
},
|
|
1665
1665
|
children: `${window.location.origin}/magic-mail/oauth/yahoo/callback`
|
|
1666
1666
|
}
|
|
@@ -1925,7 +1925,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1925
1925
|
] }) })
|
|
1926
1926
|
] }) });
|
|
1927
1927
|
};
|
|
1928
|
-
const fadeIn$
|
|
1928
|
+
const fadeIn$3 = styled.keyframes`
|
|
1929
1929
|
from { opacity: 0; transform: translateY(10px); }
|
|
1930
1930
|
to { opacity: 1; transform: translateY(0); }
|
|
1931
1931
|
`;
|
|
@@ -1937,7 +1937,7 @@ const float$3 = styled.keyframes`
|
|
|
1937
1937
|
0%, 100% { transform: translateY(0px); }
|
|
1938
1938
|
50% { transform: translateY(-5px); }
|
|
1939
1939
|
`;
|
|
1940
|
-
const pulse$
|
|
1940
|
+
const pulse$1 = styled.keyframes`
|
|
1941
1941
|
0%, 100% { opacity: 1; }
|
|
1942
1942
|
50% { opacity: 0.5; }
|
|
1943
1943
|
`;
|
|
@@ -1953,7 +1953,7 @@ const breakpoints$3 = {
|
|
|
1953
1953
|
mobile: "768px"
|
|
1954
1954
|
};
|
|
1955
1955
|
const Container$4 = styled__default.default(designSystem.Box)`
|
|
1956
|
-
${styled.css`animation: ${fadeIn$
|
|
1956
|
+
${styled.css`animation: ${fadeIn$3} ${theme$3.transitions.slow};`}
|
|
1957
1957
|
min-height: 100vh;
|
|
1958
1958
|
max-width: 1440px;
|
|
1959
1959
|
margin: 0 auto;
|
|
@@ -2071,7 +2071,7 @@ const StatCard$3 = styled__default.default(designSystem.Box)`
|
|
|
2071
2071
|
position: relative;
|
|
2072
2072
|
overflow: hidden;
|
|
2073
2073
|
transition: all ${theme$3.transitions.normal};
|
|
2074
|
-
${styled.css`animation: ${fadeIn$
|
|
2074
|
+
${styled.css`animation: ${fadeIn$3} ${theme$3.transitions.slow} backwards;`}
|
|
2075
2075
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
2076
2076
|
box-shadow: ${theme$3.shadows.sm};
|
|
2077
2077
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
@@ -2197,7 +2197,7 @@ const OnlineBadge$1 = styled__default.default.div`
|
|
|
2197
2197
|
background: ${(props) => props.$active ? "var(--colors-success600, #22C55E)" : "rgba(128, 128, 128, 0.4)"};
|
|
2198
2198
|
display: inline-block;
|
|
2199
2199
|
margin-right: 8px;
|
|
2200
|
-
${styled.css`animation: ${(props) => props.$active ? pulse$
|
|
2200
|
+
${styled.css`animation: ${(props) => props.$active ? pulse$1 : "none"} 2s ease-in-out infinite;`}
|
|
2201
2201
|
`;
|
|
2202
2202
|
const StyledTable$3 = styled__default.default(designSystem.Table)`
|
|
2203
2203
|
thead {
|
|
@@ -2959,7 +2959,7 @@ const theme$2 = {
|
|
|
2959
2959
|
xl: "16px"
|
|
2960
2960
|
}
|
|
2961
2961
|
};
|
|
2962
|
-
const fadeIn$
|
|
2962
|
+
const fadeIn$2 = styled.keyframes`
|
|
2963
2963
|
from { opacity: 0; transform: translateY(10px); }
|
|
2964
2964
|
to { opacity: 1; transform: translateY(0); }
|
|
2965
2965
|
`;
|
|
@@ -2971,7 +2971,7 @@ const float$2 = styled.keyframes`
|
|
|
2971
2971
|
0%, 100% { transform: translateY(0px); }
|
|
2972
2972
|
50% { transform: translateY(-5px); }
|
|
2973
2973
|
`;
|
|
2974
|
-
const pulse
|
|
2974
|
+
const pulse = styled.keyframes`
|
|
2975
2975
|
0%, 100% { opacity: 1; }
|
|
2976
2976
|
50% { opacity: 0.5; }
|
|
2977
2977
|
`;
|
|
@@ -2987,7 +2987,7 @@ const breakpoints$2 = {
|
|
|
2987
2987
|
mobile: "768px"
|
|
2988
2988
|
};
|
|
2989
2989
|
const Container$3 = styled__default.default(designSystem.Box)`
|
|
2990
|
-
${styled.css`animation: ${fadeIn$
|
|
2990
|
+
${styled.css`animation: ${fadeIn$2} ${theme$2.transitions.slow};`}
|
|
2991
2991
|
min-height: 100vh;
|
|
2992
2992
|
max-width: 1440px;
|
|
2993
2993
|
margin: 0 auto;
|
|
@@ -3105,7 +3105,7 @@ const StatCard$2 = styled__default.default(designSystem.Box)`
|
|
|
3105
3105
|
position: relative;
|
|
3106
3106
|
overflow: hidden;
|
|
3107
3107
|
transition: all ${theme$2.transitions.normal};
|
|
3108
|
-
${styled.css`animation: ${fadeIn$
|
|
3108
|
+
${styled.css`animation: ${fadeIn$2} ${theme$2.transitions.slow} backwards;`}
|
|
3109
3109
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
3110
3110
|
box-shadow: ${theme$2.shadows.sm};
|
|
3111
3111
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
@@ -3231,7 +3231,7 @@ const OnlineBadge = styled__default.default.div`
|
|
|
3231
3231
|
background: ${(props) => props.$active ? "var(--colors-success600, #22C55E)" : "rgba(128, 128, 128, 0.4)"};
|
|
3232
3232
|
display: inline-block;
|
|
3233
3233
|
margin-right: 8px;
|
|
3234
|
-
${styled.css`animation: ${(props) => props.$active ? pulse
|
|
3234
|
+
${styled.css`animation: ${(props) => props.$active ? pulse : "none"} 2s ease-in-out infinite;`}
|
|
3235
3235
|
`;
|
|
3236
3236
|
const StyledTable$2 = styled__default.default(designSystem.Table)`
|
|
3237
3237
|
thead {
|
|
@@ -3529,8 +3529,7 @@ const RoutingRulesPage = () => {
|
|
|
3529
3529
|
rule.fallbackAccountName && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
3530
3530
|
"Fallback: ",
|
|
3531
3531
|
rule.fallbackAccountName
|
|
3532
|
-
] })
|
|
3533
|
-
rule.whatsappFallback && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success100", textColor: "success700", size: "S", children: "+ WhatsApp" })
|
|
3532
|
+
] })
|
|
3534
3533
|
] }) }),
|
|
3535
3534
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3536
3535
|
designSystem.Badge,
|
|
@@ -3593,8 +3592,7 @@ const RuleModal = ({ rule, accounts, onClose, onSave }) => {
|
|
|
3593
3592
|
matchType: rule?.matchType || "emailType",
|
|
3594
3593
|
matchValue: rule?.matchValue || "",
|
|
3595
3594
|
accountName: rule?.accountName || "",
|
|
3596
|
-
fallbackAccountName: rule?.fallbackAccountName || ""
|
|
3597
|
-
whatsappFallback: rule?.whatsappFallback || false
|
|
3595
|
+
fallbackAccountName: rule?.fallbackAccountName || ""
|
|
3598
3596
|
});
|
|
3599
3597
|
const handleChange = (field, value) => {
|
|
3600
3598
|
setFormData((prev) => ({ ...prev, [field]: value }));
|
|
@@ -3749,38 +3747,6 @@ const RuleModal = ({ rule, accounts, onClose, onSave }) => {
|
|
|
3749
3747
|
),
|
|
3750
3748
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, { children: "Use this account if the target account is unavailable or rate-limited" })
|
|
3751
3749
|
] }),
|
|
3752
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3753
|
-
designSystem.Box,
|
|
3754
|
-
{
|
|
3755
|
-
padding: 4,
|
|
3756
|
-
background: "neutral100",
|
|
3757
|
-
hasRadius: true,
|
|
3758
|
-
borderColor: "neutral200",
|
|
3759
|
-
borderStyle: "solid",
|
|
3760
|
-
borderWidth: "1px",
|
|
3761
|
-
style: {
|
|
3762
|
-
width: "100%",
|
|
3763
|
-
borderRadius: theme$2.borderRadius.md
|
|
3764
|
-
},
|
|
3765
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", justifyContent: "space-between", children: [
|
|
3766
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { flex: 1, minWidth: 0 }, children: [
|
|
3767
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "semiBold", children: "WhatsApp Fallback" }),
|
|
3768
|
-
/* @__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" })
|
|
3769
|
-
] }),
|
|
3770
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3771
|
-
designSystem.Switch,
|
|
3772
|
-
{
|
|
3773
|
-
checked: formData.whatsappFallback,
|
|
3774
|
-
onCheckedChange: (checked) => handleChange("whatsappFallback", checked),
|
|
3775
|
-
"aria-label": "WhatsApp fallback",
|
|
3776
|
-
onLabel: "Enabled",
|
|
3777
|
-
offLabel: "Disabled",
|
|
3778
|
-
visibleLabels: false
|
|
3779
|
-
}
|
|
3780
|
-
) })
|
|
3781
|
-
] })
|
|
3782
|
-
}
|
|
3783
|
-
),
|
|
3784
3750
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { style: { width: "100%" }, children: [
|
|
3785
3751
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Rule Priority" }),
|
|
3786
3752
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3854,7 +3820,7 @@ const theme$1 = {
|
|
|
3854
3820
|
spacing: { xs: "4px", sm: "8px", md: "16px", lg: "24px", xl: "32px", "2xl": "48px" },
|
|
3855
3821
|
borderRadius: { md: "8px", lg: "12px", xl: "16px" }
|
|
3856
3822
|
};
|
|
3857
|
-
const fadeIn$
|
|
3823
|
+
const fadeIn$1 = styled.keyframes`
|
|
3858
3824
|
from { opacity: 0; transform: translateY(10px); }
|
|
3859
3825
|
to { opacity: 1; transform: translateY(0); }
|
|
3860
3826
|
`;
|
|
@@ -4008,7 +3974,7 @@ const CopyButton = styled__default.default(designSystem.Button)`
|
|
|
4008
3974
|
height: 14px;
|
|
4009
3975
|
}
|
|
4010
3976
|
`;
|
|
4011
|
-
const InfoBox
|
|
3977
|
+
const InfoBox = styled__default.default(designSystem.Box)`
|
|
4012
3978
|
background: linear-gradient(135deg, ${"rgba(2, 132, 199, 0.06)"}, ${"rgba(2, 132, 199, 0.12)"});
|
|
4013
3979
|
border-left: 4px solid ${"var(--colors-primary600, #0EA5E9)"};
|
|
4014
3980
|
border-radius: 8px;
|
|
@@ -4030,7 +3996,7 @@ const breakpoints$1 = {
|
|
|
4030
3996
|
tablet: "1024px"
|
|
4031
3997
|
};
|
|
4032
3998
|
const Container$2 = styled__default.default(designSystem.Box)`
|
|
4033
|
-
${styled.css`animation: ${fadeIn$
|
|
3999
|
+
${styled.css`animation: ${fadeIn$1} ${theme$1.transitions.slow};`}
|
|
4034
4000
|
min-height: 100vh;
|
|
4035
4001
|
max-width: 1440px;
|
|
4036
4002
|
margin: 0 auto;
|
|
@@ -4143,7 +4109,7 @@ const StatCard$1 = styled__default.default(designSystem.Box)`
|
|
|
4143
4109
|
position: relative;
|
|
4144
4110
|
overflow: hidden;
|
|
4145
4111
|
transition: all ${theme$1.transitions.normal};
|
|
4146
|
-
${styled.css`animation: ${fadeIn$
|
|
4112
|
+
${styled.css`animation: ${fadeIn$1} ${theme$1.transitions.slow} backwards;`}
|
|
4147
4113
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
4148
4114
|
box-shadow: ${theme$1.shadows.sm};
|
|
4149
4115
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
@@ -5182,7 +5148,7 @@ const TemplateList = () => {
|
|
|
5182
5148
|
selectedTemplate.name
|
|
5183
5149
|
] }) }),
|
|
5184
5150
|
/* @__PURE__ */ jsxRuntime.jsxs(ScrollableDialogBody, { children: [
|
|
5185
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoBox
|
|
5151
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoBox, { style: { marginTop: 0, marginBottom: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5186
5152
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { color: "var(--colors-primary600, #075985)" }, children: [
|
|
5187
5153
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Template ID:" }),
|
|
5188
5154
|
" #",
|
|
@@ -5673,6 +5639,7 @@ const ImportLabel = styled__default.default.label`
|
|
|
5673
5639
|
const BackButton = styled__default.default.button`
|
|
5674
5640
|
background: ${(p) => p.theme.colors.neutral0};
|
|
5675
5641
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
5642
|
+
color: ${(p) => p.theme.colors.neutral800};
|
|
5676
5643
|
border-radius: 4px;
|
|
5677
5644
|
padding: 8px 10px;
|
|
5678
5645
|
height: 36px;
|
|
@@ -6219,7 +6186,15 @@ const EditorPage = () => {
|
|
|
6219
6186
|
/* @__PURE__ */ jsxRuntime.jsxs(Header$1, { children: [
|
|
6220
6187
|
/* @__PURE__ */ jsxRuntime.jsxs(HeaderRow, { children: [
|
|
6221
6188
|
/* @__PURE__ */ jsxRuntime.jsxs(HeaderLeft, { children: [
|
|
6222
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6189
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6190
|
+
BackButton,
|
|
6191
|
+
{
|
|
6192
|
+
type: "button",
|
|
6193
|
+
"aria-label": "Back to email templates",
|
|
6194
|
+
onClick: () => navigate("/plugins/magic-mail/designer"),
|
|
6195
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(outline.ArrowLeftIcon, {})
|
|
6196
|
+
}
|
|
6197
|
+
),
|
|
6223
6198
|
/* @__PURE__ */ jsxRuntime.jsxs(TitleContainer, { children: [
|
|
6224
6199
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", children: isCoreEmail ? `${coreEmailType === "reset-password" ? "Reset Password" : "Email Confirmation"}` : isNewTemplate ? "New Template" : `${templateData.name}` }),
|
|
6225
6200
|
!isNewTemplate && !isCoreEmail && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Versioning enabled" }),
|
|
@@ -6612,7 +6587,7 @@ const theme = {
|
|
|
6612
6587
|
spacing: { xs: "4px", sm: "8px", md: "16px", lg: "24px", xl: "32px", "2xl": "48px" },
|
|
6613
6588
|
borderRadius: { lg: "12px", xl: "16px" }
|
|
6614
6589
|
};
|
|
6615
|
-
const fadeIn
|
|
6590
|
+
const fadeIn = styled.keyframes`
|
|
6616
6591
|
from { opacity: 0; transform: translateY(10px); }
|
|
6617
6592
|
to { opacity: 1; transform: translateY(0); }
|
|
6618
6593
|
`;
|
|
@@ -6628,7 +6603,7 @@ const breakpoints = {
|
|
|
6628
6603
|
mobile: "768px"
|
|
6629
6604
|
};
|
|
6630
6605
|
const Container = styled__default.default(designSystem.Box)`
|
|
6631
|
-
${styled.css`animation: ${fadeIn
|
|
6606
|
+
${styled.css`animation: ${fadeIn} ${theme.transitions.slow};`}
|
|
6632
6607
|
min-height: 100vh;
|
|
6633
6608
|
max-width: 1440px;
|
|
6634
6609
|
margin: 0 auto;
|
|
@@ -6741,7 +6716,7 @@ const StatCard = styled__default.default(designSystem.Box)`
|
|
|
6741
6716
|
position: relative;
|
|
6742
6717
|
overflow: hidden;
|
|
6743
6718
|
transition: all ${theme.transitions.normal};
|
|
6744
|
-
${styled.css`animation: ${fadeIn
|
|
6719
|
+
${styled.css`animation: ${fadeIn} ${theme.transitions.slow} backwards;`}
|
|
6745
6720
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
6746
6721
|
box-shadow: ${theme.shadows.sm};
|
|
6747
6722
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
@@ -7150,814 +7125,6 @@ const Analytics = () => {
|
|
|
7150
7125
|
] }) })
|
|
7151
7126
|
] });
|
|
7152
7127
|
};
|
|
7153
|
-
const fadeIn = styled.keyframes`
|
|
7154
|
-
from {
|
|
7155
|
-
opacity: 0;
|
|
7156
|
-
transform: translateY(10px);
|
|
7157
|
-
}
|
|
7158
|
-
to {
|
|
7159
|
-
opacity: 1;
|
|
7160
|
-
transform: translateY(0);
|
|
7161
|
-
}
|
|
7162
|
-
`;
|
|
7163
|
-
const pulse = styled.keyframes`
|
|
7164
|
-
0%, 100% {
|
|
7165
|
-
transform: scale(1);
|
|
7166
|
-
}
|
|
7167
|
-
50% {
|
|
7168
|
-
transform: scale(1.05);
|
|
7169
|
-
}
|
|
7170
|
-
`;
|
|
7171
|
-
const spin = styled.keyframes`
|
|
7172
|
-
from {
|
|
7173
|
-
transform: rotate(0deg);
|
|
7174
|
-
}
|
|
7175
|
-
to {
|
|
7176
|
-
transform: rotate(360deg);
|
|
7177
|
-
}
|
|
7178
|
-
`;
|
|
7179
|
-
const colors = {
|
|
7180
|
-
whatsapp: "#25D366",
|
|
7181
|
-
whatsappDark: "#128C7E",
|
|
7182
|
-
whatsappLight: "rgba(37, 211, 102, 0.2)",
|
|
7183
|
-
primary: "#4945ff",
|
|
7184
|
-
primaryLight: "rgba(73, 69, 255, 0.06)",
|
|
7185
|
-
success: "#5cb176",
|
|
7186
|
-
successLight: "rgba(92, 177, 118, 0.12)",
|
|
7187
|
-
danger: "#d02b20",
|
|
7188
|
-
neutral: "#8e8ea9",
|
|
7189
|
-
neutralLight: "rgba(142, 142, 169, 0.08)",
|
|
7190
|
-
border: "rgba(128, 128, 128, 0.2)",
|
|
7191
|
-
textLight: "var(--colors-neutral600, #666687)"
|
|
7192
|
-
};
|
|
7193
|
-
const PageContainer = styled__default.default(designSystem.Box)`
|
|
7194
|
-
padding: 40px;
|
|
7195
|
-
max-width: 900px;
|
|
7196
|
-
margin: 0 auto;
|
|
7197
|
-
animation: ${fadeIn} 0.4s ease;
|
|
7198
|
-
`;
|
|
7199
|
-
const HeaderSection = styled__default.default(designSystem.Box)`
|
|
7200
|
-
text-align: center;
|
|
7201
|
-
margin-bottom: 48px;
|
|
7202
|
-
`;
|
|
7203
|
-
const WhatsAppLogo = styled__default.default.div`
|
|
7204
|
-
width: 80px;
|
|
7205
|
-
height: 80px;
|
|
7206
|
-
border-radius: 50%;
|
|
7207
|
-
background: linear-gradient(135deg, ${colors.whatsapp}, ${colors.whatsappDark});
|
|
7208
|
-
display: flex;
|
|
7209
|
-
align-items: center;
|
|
7210
|
-
justify-content: center;
|
|
7211
|
-
margin: 0 auto 24px;
|
|
7212
|
-
box-shadow: 0 8px 32px ${colors.whatsapp}40;
|
|
7213
|
-
`;
|
|
7214
|
-
const PhoneIcon = styled__default.default.div`
|
|
7215
|
-
width: 40px;
|
|
7216
|
-
height: 40px;
|
|
7217
|
-
color: white;
|
|
7218
|
-
font-size: 32px;
|
|
7219
|
-
`;
|
|
7220
|
-
const StepperContainer = styled__default.default(designSystem.Box)`
|
|
7221
|
-
display: flex;
|
|
7222
|
-
align-items: flex-start;
|
|
7223
|
-
justify-content: center;
|
|
7224
|
-
gap: 0;
|
|
7225
|
-
margin-bottom: 48px;
|
|
7226
|
-
position: relative;
|
|
7227
|
-
padding: 0 40px;
|
|
7228
|
-
`;
|
|
7229
|
-
const StepWrapper = styled__default.default.div`
|
|
7230
|
-
flex: 1;
|
|
7231
|
-
display: flex;
|
|
7232
|
-
flex-direction: column;
|
|
7233
|
-
align-items: center;
|
|
7234
|
-
position: relative;
|
|
7235
|
-
|
|
7236
|
-
&:not(:last-child)::after {
|
|
7237
|
-
content: '';
|
|
7238
|
-
position: absolute;
|
|
7239
|
-
top: 28px;
|
|
7240
|
-
left: 50%;
|
|
7241
|
-
width: 100%;
|
|
7242
|
-
height: 3px;
|
|
7243
|
-
background: ${(props) => props.$completed ? colors.success : colors.neutralLight};
|
|
7244
|
-
transition: all 0.4s ease;
|
|
7245
|
-
z-index: 0;
|
|
7246
|
-
}
|
|
7247
|
-
`;
|
|
7248
|
-
const StepDot = styled__default.default.div`
|
|
7249
|
-
width: 56px;
|
|
7250
|
-
height: 56px;
|
|
7251
|
-
border-radius: 50%;
|
|
7252
|
-
background: ${(props) => props.$active ? colors.whatsapp : props.$completed ? colors.success : props.theme.colors.neutral0};
|
|
7253
|
-
color: ${(props) => props.$active || props.$completed ? "#ffffff" : colors.textLight};
|
|
7254
|
-
border: 4px solid ${(props) => props.$active ? colors.whatsapp : props.$completed ? colors.success : colors.border};
|
|
7255
|
-
display: flex;
|
|
7256
|
-
align-items: center;
|
|
7257
|
-
justify-content: center;
|
|
7258
|
-
font-weight: 700;
|
|
7259
|
-
font-size: 18px;
|
|
7260
|
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
7261
|
-
position: relative;
|
|
7262
|
-
z-index: 1;
|
|
7263
|
-
cursor: ${(props) => props.$completed ? "pointer" : "default"};
|
|
7264
|
-
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)"};
|
|
7265
|
-
|
|
7266
|
-
${(props) => props.$active && styled.css`
|
|
7267
|
-
animation: ${pulse} 2s infinite;
|
|
7268
|
-
`}
|
|
7269
|
-
|
|
7270
|
-
&:hover {
|
|
7271
|
-
transform: ${(props) => props.$completed ? "scale(1.1)" : props.$active ? "scale(1.05)" : "scale(1)"};
|
|
7272
|
-
}
|
|
7273
|
-
`;
|
|
7274
|
-
const StepLabel = styled__default.default(designSystem.Typography)`
|
|
7275
|
-
margin-top: 12px;
|
|
7276
|
-
font-size: 13px;
|
|
7277
|
-
color: ${(props) => props.$active ? colors.whatsapp : props.$completed ? colors.success : colors.textLight};
|
|
7278
|
-
white-space: nowrap;
|
|
7279
|
-
font-weight: ${(props) => props.$active ? 600 : 500};
|
|
7280
|
-
text-align: center;
|
|
7281
|
-
transition: all 0.3s ease;
|
|
7282
|
-
`;
|
|
7283
|
-
const ContentCard = styled__default.default(designSystem.Box)`
|
|
7284
|
-
background: ${(p) => p.theme.colors.neutral0};
|
|
7285
|
-
border: 1px solid ${colors.border};
|
|
7286
|
-
border-radius: 16px;
|
|
7287
|
-
padding: 32px;
|
|
7288
|
-
margin-bottom: 24px;
|
|
7289
|
-
animation: ${fadeIn} 0.4s ease;
|
|
7290
|
-
box-shadow: 0 4px 24px rgba(0,0,0,0.06);
|
|
7291
|
-
`;
|
|
7292
|
-
const QRCodeContainer = styled__default.default.div`
|
|
7293
|
-
display: flex;
|
|
7294
|
-
flex-direction: column;
|
|
7295
|
-
align-items: center;
|
|
7296
|
-
padding: 32px;
|
|
7297
|
-
background: ${colors.neutralLight};
|
|
7298
|
-
border-radius: 16px;
|
|
7299
|
-
margin: 24px 0;
|
|
7300
|
-
`;
|
|
7301
|
-
const QRImage = styled__default.default.img`
|
|
7302
|
-
width: 280px;
|
|
7303
|
-
height: 280px;
|
|
7304
|
-
border-radius: 12px;
|
|
7305
|
-
box-shadow: 0 4px 24px rgba(0,0,0,0.1);
|
|
7306
|
-
`;
|
|
7307
|
-
const StatusBadge = styled__default.default.div`
|
|
7308
|
-
display: inline-flex;
|
|
7309
|
-
align-items: center;
|
|
7310
|
-
gap: 8px;
|
|
7311
|
-
padding: 8px 16px;
|
|
7312
|
-
border-radius: 20px;
|
|
7313
|
-
font-weight: 600;
|
|
7314
|
-
font-size: 14px;
|
|
7315
|
-
background: ${(props) => {
|
|
7316
|
-
switch (props.$status) {
|
|
7317
|
-
case "connected":
|
|
7318
|
-
return colors.successLight;
|
|
7319
|
-
case "connecting":
|
|
7320
|
-
return colors.primaryLight;
|
|
7321
|
-
case "qr_pending":
|
|
7322
|
-
return colors.whatsappLight;
|
|
7323
|
-
case "disconnected":
|
|
7324
|
-
return colors.neutralLight;
|
|
7325
|
-
default:
|
|
7326
|
-
return colors.neutralLight;
|
|
7327
|
-
}
|
|
7328
|
-
}};
|
|
7329
|
-
color: ${(props) => {
|
|
7330
|
-
switch (props.$status) {
|
|
7331
|
-
case "connected":
|
|
7332
|
-
return colors.success;
|
|
7333
|
-
case "connecting":
|
|
7334
|
-
return colors.primary;
|
|
7335
|
-
case "qr_pending":
|
|
7336
|
-
return colors.whatsappDark;
|
|
7337
|
-
case "disconnected":
|
|
7338
|
-
return colors.neutral;
|
|
7339
|
-
default:
|
|
7340
|
-
return colors.neutral;
|
|
7341
|
-
}
|
|
7342
|
-
}};
|
|
7343
|
-
`;
|
|
7344
|
-
const SpinningLoader = styled__default.default.div`
|
|
7345
|
-
width: 20px;
|
|
7346
|
-
height: 20px;
|
|
7347
|
-
border: 2px solid ${colors.primary}40;
|
|
7348
|
-
border-top-color: ${colors.primary};
|
|
7349
|
-
border-radius: 50%;
|
|
7350
|
-
animation: ${spin} 1s linear infinite;
|
|
7351
|
-
`;
|
|
7352
|
-
const ConnectedCard = styled__default.default(designSystem.Box)`
|
|
7353
|
-
background: linear-gradient(135deg, ${colors.successLight}, ${colors.whatsappLight});
|
|
7354
|
-
border: 2px solid ${colors.success};
|
|
7355
|
-
border-radius: 16px;
|
|
7356
|
-
padding: 32px;
|
|
7357
|
-
text-align: center;
|
|
7358
|
-
`;
|
|
7359
|
-
const InfoBox = styled__default.default(designSystem.Box)`
|
|
7360
|
-
background: linear-gradient(135deg, rgba(2, 132, 199, 0.06) 0%, ${colors.whatsappLight} 100%);
|
|
7361
|
-
border: 1px solid rgba(2, 132, 199, 0.2);
|
|
7362
|
-
border-radius: 12px;
|
|
7363
|
-
padding: 24px;
|
|
7364
|
-
margin: 20px 0;
|
|
7365
|
-
`;
|
|
7366
|
-
const TestSection = styled__default.default(designSystem.Box)`
|
|
7367
|
-
background: linear-gradient(135deg, ${colors.whatsappLight} 0%, rgba(34, 197, 94, 0.1) 100%);
|
|
7368
|
-
border: 1px solid ${colors.whatsapp}40;
|
|
7369
|
-
border-radius: 16px;
|
|
7370
|
-
padding: 24px;
|
|
7371
|
-
margin-top: 24px;
|
|
7372
|
-
`;
|
|
7373
|
-
const WhatsAppInput = styled__default.default.input`
|
|
7374
|
-
width: 100%;
|
|
7375
|
-
padding: 14px 16px;
|
|
7376
|
-
border: 2px solid rgba(128, 128, 128, 0.2);
|
|
7377
|
-
border-radius: 12px;
|
|
7378
|
-
font-size: 15px;
|
|
7379
|
-
background: ${(p) => p.theme.colors.neutral0};
|
|
7380
|
-
color: var(--colors-neutral800);
|
|
7381
|
-
transition: all 0.2s ease;
|
|
7382
|
-
box-sizing: border-box;
|
|
7383
|
-
|
|
7384
|
-
&:focus {
|
|
7385
|
-
outline: none;
|
|
7386
|
-
border-color: ${colors.whatsapp};
|
|
7387
|
-
box-shadow: 0 0 0 3px ${colors.whatsapp}20;
|
|
7388
|
-
}
|
|
7389
|
-
|
|
7390
|
-
&::placeholder {
|
|
7391
|
-
color: rgba(128, 128, 128, 0.4);
|
|
7392
|
-
}
|
|
7393
|
-
`;
|
|
7394
|
-
const WhatsAppTextarea = styled__default.default.textarea`
|
|
7395
|
-
width: 100%;
|
|
7396
|
-
padding: 14px 16px;
|
|
7397
|
-
border: 2px solid rgba(128, 128, 128, 0.2);
|
|
7398
|
-
border-radius: 12px;
|
|
7399
|
-
font-size: 15px;
|
|
7400
|
-
background: ${(p) => p.theme.colors.neutral0};
|
|
7401
|
-
color: var(--colors-neutral800);
|
|
7402
|
-
transition: all 0.2s ease;
|
|
7403
|
-
box-sizing: border-box;
|
|
7404
|
-
resize: vertical;
|
|
7405
|
-
min-height: 80px;
|
|
7406
|
-
font-family: inherit;
|
|
7407
|
-
|
|
7408
|
-
&:focus {
|
|
7409
|
-
outline: none;
|
|
7410
|
-
border-color: ${colors.whatsapp};
|
|
7411
|
-
box-shadow: 0 0 0 3px ${colors.whatsapp}20;
|
|
7412
|
-
}
|
|
7413
|
-
|
|
7414
|
-
&::placeholder {
|
|
7415
|
-
color: rgba(128, 128, 128, 0.4);
|
|
7416
|
-
}
|
|
7417
|
-
`;
|
|
7418
|
-
const InputLabel = styled__default.default.label`
|
|
7419
|
-
display: flex;
|
|
7420
|
-
align-items: center;
|
|
7421
|
-
gap: 8px;
|
|
7422
|
-
font-size: 14px;
|
|
7423
|
-
font-weight: 600;
|
|
7424
|
-
color: ${colors.whatsappDark};
|
|
7425
|
-
margin-bottom: 8px;
|
|
7426
|
-
`;
|
|
7427
|
-
const InputHint = styled__default.default.span`
|
|
7428
|
-
font-size: 12px;
|
|
7429
|
-
color: var(--colors-neutral500);
|
|
7430
|
-
margin-top: 6px;
|
|
7431
|
-
display: block;
|
|
7432
|
-
`;
|
|
7433
|
-
const PhoneSymbol = styled__default.default.span`
|
|
7434
|
-
font-size: 16px;
|
|
7435
|
-
font-weight: 700;
|
|
7436
|
-
`;
|
|
7437
|
-
const MessageSymbol = styled__default.default.span`
|
|
7438
|
-
font-size: 16px;
|
|
7439
|
-
`;
|
|
7440
|
-
const UseCaseCard = styled__default.default(designSystem.Box)`
|
|
7441
|
-
background: linear-gradient(135deg, ${colors.whatsappLight}, rgba(2, 132, 199, 0.06));
|
|
7442
|
-
border: 2px solid ${colors.whatsapp};
|
|
7443
|
-
border-radius: 16px;
|
|
7444
|
-
padding: 24px;
|
|
7445
|
-
margin-bottom: 32px;
|
|
7446
|
-
`;
|
|
7447
|
-
const ButtonRow = styled__default.default(designSystem.Flex)`
|
|
7448
|
-
margin-top: 32px;
|
|
7449
|
-
padding-top: 24px;
|
|
7450
|
-
border-top: 1px solid rgba(128, 128, 128, 0.2);
|
|
7451
|
-
`;
|
|
7452
|
-
const AlertBox = styled__default.default(designSystem.Box)`
|
|
7453
|
-
background: rgba(2, 132, 199, 0.06);
|
|
7454
|
-
border: 1px solid rgba(2, 132, 199, 0.2);
|
|
7455
|
-
border-radius: 12px;
|
|
7456
|
-
padding: 16px 20px;
|
|
7457
|
-
margin-top: 20px;
|
|
7458
|
-
display: flex;
|
|
7459
|
-
align-items: flex-start;
|
|
7460
|
-
gap: 12px;
|
|
7461
|
-
`;
|
|
7462
|
-
const AlertIcon = styled__default.default.div`
|
|
7463
|
-
width: 24px;
|
|
7464
|
-
height: 24px;
|
|
7465
|
-
border-radius: 50%;
|
|
7466
|
-
background: var(--colors-primary600, #0EA5E9);
|
|
7467
|
-
color: white;
|
|
7468
|
-
display: flex;
|
|
7469
|
-
align-items: center;
|
|
7470
|
-
justify-content: center;
|
|
7471
|
-
font-size: 14px;
|
|
7472
|
-
font-weight: bold;
|
|
7473
|
-
flex-shrink: 0;
|
|
7474
|
-
`;
|
|
7475
|
-
const SuccessBox = styled__default.default(designSystem.Box)`
|
|
7476
|
-
background: rgba(22, 163, 74, 0.06);
|
|
7477
|
-
border: 1px solid rgba(22, 163, 74, 0.2);
|
|
7478
|
-
border-radius: 12px;
|
|
7479
|
-
padding: 16px 20px;
|
|
7480
|
-
display: flex;
|
|
7481
|
-
align-items: flex-start;
|
|
7482
|
-
gap: 12px;
|
|
7483
|
-
`;
|
|
7484
|
-
const SuccessIcon = styled__default.default.div`
|
|
7485
|
-
width: 24px;
|
|
7486
|
-
height: 24px;
|
|
7487
|
-
border-radius: 50%;
|
|
7488
|
-
background: var(--colors-success600, #22C55E);
|
|
7489
|
-
color: white;
|
|
7490
|
-
display: flex;
|
|
7491
|
-
align-items: center;
|
|
7492
|
-
justify-content: center;
|
|
7493
|
-
flex-shrink: 0;
|
|
7494
|
-
`;
|
|
7495
|
-
const WhatsAppButton = styled__default.default(StyledButtons.GradientButton)`
|
|
7496
|
-
&& {
|
|
7497
|
-
background: linear-gradient(135deg, ${colors.whatsapp} 0%, ${colors.whatsappDark} 100%) !important;
|
|
7498
|
-
|
|
7499
|
-
&:hover:not(:disabled) {
|
|
7500
|
-
background: linear-gradient(135deg, ${colors.whatsappDark} 0%, ${colors.whatsapp} 100%) !important;
|
|
7501
|
-
}
|
|
7502
|
-
}
|
|
7503
|
-
`;
|
|
7504
|
-
const NotInstalledCard = styled__default.default(designSystem.Box)`
|
|
7505
|
-
background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(220, 38, 38, 0.12));
|
|
7506
|
-
border: 2px solid var(--colors-warning600, #F59E0B);
|
|
7507
|
-
border-radius: 16px;
|
|
7508
|
-
padding: 32px;
|
|
7509
|
-
text-align: center;
|
|
7510
|
-
`;
|
|
7511
|
-
const WhatsAppPage = () => {
|
|
7512
|
-
const { get, post } = admin.useFetchClient();
|
|
7513
|
-
const { toggleNotification } = admin.useNotification();
|
|
7514
|
-
const [currentStep, setCurrentStep] = React.useState(1);
|
|
7515
|
-
const [loading, setLoading] = React.useState(true);
|
|
7516
|
-
const [connecting, setConnecting] = React.useState(false);
|
|
7517
|
-
const [isAvailable, setIsAvailable] = React.useState(false);
|
|
7518
|
-
const [status, setStatus] = React.useState({
|
|
7519
|
-
status: "disconnected",
|
|
7520
|
-
qrCode: null,
|
|
7521
|
-
isConnected: false,
|
|
7522
|
-
session: null
|
|
7523
|
-
});
|
|
7524
|
-
const [testPhone, setTestPhone] = React.useState("");
|
|
7525
|
-
const [testMessage, setTestMessage] = React.useState("");
|
|
7526
|
-
const [sendingTest, setSendingTest] = React.useState(false);
|
|
7527
|
-
const stepTitles = ["Check Installation", "Connect WhatsApp", "Scan QR Code", "Ready to Use"];
|
|
7528
|
-
const checkAvailability = React.useCallback(async () => {
|
|
7529
|
-
try {
|
|
7530
|
-
const { data } = await get("/magic-mail/whatsapp/available");
|
|
7531
|
-
setIsAvailable(data.data.available);
|
|
7532
|
-
return data.data.available;
|
|
7533
|
-
} catch (error) {
|
|
7534
|
-
console.error("[MagicMail WhatsApp] Error checking availability:", error);
|
|
7535
|
-
setIsAvailable(false);
|
|
7536
|
-
return false;
|
|
7537
|
-
}
|
|
7538
|
-
}, [get]);
|
|
7539
|
-
const fetchStatus = React.useCallback(async () => {
|
|
7540
|
-
try {
|
|
7541
|
-
const { data } = await get("/magic-mail/whatsapp/status");
|
|
7542
|
-
setStatus(data.data);
|
|
7543
|
-
if (data.data.isConnected) {
|
|
7544
|
-
setCurrentStep(4);
|
|
7545
|
-
} else if (data.data.qrCode) {
|
|
7546
|
-
setCurrentStep(3);
|
|
7547
|
-
} else if (isAvailable) {
|
|
7548
|
-
setCurrentStep(2);
|
|
7549
|
-
}
|
|
7550
|
-
return data.data;
|
|
7551
|
-
} catch (error) {
|
|
7552
|
-
console.error("[MagicMail WhatsApp] Error fetching status:", error);
|
|
7553
|
-
return null;
|
|
7554
|
-
}
|
|
7555
|
-
}, [get, isAvailable]);
|
|
7556
|
-
React.useEffect(() => {
|
|
7557
|
-
const init = async () => {
|
|
7558
|
-
setLoading(true);
|
|
7559
|
-
const available = await checkAvailability();
|
|
7560
|
-
if (available) {
|
|
7561
|
-
await fetchStatus();
|
|
7562
|
-
}
|
|
7563
|
-
setLoading(false);
|
|
7564
|
-
};
|
|
7565
|
-
init();
|
|
7566
|
-
}, [checkAvailability, fetchStatus]);
|
|
7567
|
-
React.useEffect(() => {
|
|
7568
|
-
let pollInterval;
|
|
7569
|
-
if (connecting || status.status === "connecting" || status.status === "qr_pending") {
|
|
7570
|
-
pollInterval = setInterval(async () => {
|
|
7571
|
-
const newStatus = await fetchStatus();
|
|
7572
|
-
if (newStatus?.isConnected) {
|
|
7573
|
-
setConnecting(false);
|
|
7574
|
-
setCurrentStep(4);
|
|
7575
|
-
toggleNotification({
|
|
7576
|
-
type: "success",
|
|
7577
|
-
message: "[SUCCESS] WhatsApp connected successfully!"
|
|
7578
|
-
});
|
|
7579
|
-
}
|
|
7580
|
-
}, 2e3);
|
|
7581
|
-
}
|
|
7582
|
-
return () => {
|
|
7583
|
-
if (pollInterval) clearInterval(pollInterval);
|
|
7584
|
-
};
|
|
7585
|
-
}, [connecting, status.status, fetchStatus, toggleNotification]);
|
|
7586
|
-
const handleConnect = async () => {
|
|
7587
|
-
setConnecting(true);
|
|
7588
|
-
try {
|
|
7589
|
-
const { data } = await post("/magic-mail/whatsapp/connect", {});
|
|
7590
|
-
if (data.data.qrCode) {
|
|
7591
|
-
setStatus((prev) => ({ ...prev, qrCode: data.data.qrCode, status: "qr_pending" }));
|
|
7592
|
-
setCurrentStep(3);
|
|
7593
|
-
} else if (data.data.status === "connected") {
|
|
7594
|
-
setStatus((prev) => ({ ...prev, isConnected: true, status: "connected" }));
|
|
7595
|
-
setCurrentStep(4);
|
|
7596
|
-
toggleNotification({
|
|
7597
|
-
type: "success",
|
|
7598
|
-
message: "[SUCCESS] WhatsApp already connected!"
|
|
7599
|
-
});
|
|
7600
|
-
}
|
|
7601
|
-
} catch (error) {
|
|
7602
|
-
toggleNotification({
|
|
7603
|
-
type: "danger",
|
|
7604
|
-
message: "[ERROR] Failed to connect: " + (error.response?.data?.error?.message || error.message)
|
|
7605
|
-
});
|
|
7606
|
-
setConnecting(false);
|
|
7607
|
-
}
|
|
7608
|
-
};
|
|
7609
|
-
const handleDisconnect = async () => {
|
|
7610
|
-
try {
|
|
7611
|
-
await post("/magic-mail/whatsapp/disconnect", {});
|
|
7612
|
-
setStatus({
|
|
7613
|
-
status: "disconnected",
|
|
7614
|
-
qrCode: null,
|
|
7615
|
-
isConnected: false,
|
|
7616
|
-
session: null
|
|
7617
|
-
});
|
|
7618
|
-
setCurrentStep(2);
|
|
7619
|
-
toggleNotification({
|
|
7620
|
-
type: "success",
|
|
7621
|
-
message: "[SUCCESS] WhatsApp disconnected"
|
|
7622
|
-
});
|
|
7623
|
-
} catch (error) {
|
|
7624
|
-
toggleNotification({
|
|
7625
|
-
type: "danger",
|
|
7626
|
-
message: "[ERROR] Failed to disconnect"
|
|
7627
|
-
});
|
|
7628
|
-
}
|
|
7629
|
-
};
|
|
7630
|
-
const handleSendTest = async () => {
|
|
7631
|
-
if (!testPhone) {
|
|
7632
|
-
toggleNotification({
|
|
7633
|
-
type: "warning",
|
|
7634
|
-
message: "Please enter a phone number"
|
|
7635
|
-
});
|
|
7636
|
-
return;
|
|
7637
|
-
}
|
|
7638
|
-
setSendingTest(true);
|
|
7639
|
-
try {
|
|
7640
|
-
const { data } = await post("/magic-mail/whatsapp/send-test", {
|
|
7641
|
-
phoneNumber: testPhone,
|
|
7642
|
-
message: testMessage || void 0
|
|
7643
|
-
});
|
|
7644
|
-
if (data.success) {
|
|
7645
|
-
toggleNotification({
|
|
7646
|
-
type: "success",
|
|
7647
|
-
message: "[SUCCESS] Test message sent!"
|
|
7648
|
-
});
|
|
7649
|
-
setTestPhone("");
|
|
7650
|
-
setTestMessage("");
|
|
7651
|
-
} else {
|
|
7652
|
-
toggleNotification({
|
|
7653
|
-
type: "danger",
|
|
7654
|
-
message: "[ERROR] " + (data.data.error || "Failed to send message")
|
|
7655
|
-
});
|
|
7656
|
-
}
|
|
7657
|
-
} catch (error) {
|
|
7658
|
-
toggleNotification({
|
|
7659
|
-
type: "danger",
|
|
7660
|
-
message: "[ERROR] " + (error.response?.data?.error?.message || error.message)
|
|
7661
|
-
});
|
|
7662
|
-
} finally {
|
|
7663
|
-
setSendingTest(false);
|
|
7664
|
-
}
|
|
7665
|
-
};
|
|
7666
|
-
const renderStatusBadge = () => {
|
|
7667
|
-
const statusText = {
|
|
7668
|
-
connected: "Connected",
|
|
7669
|
-
connecting: "Connecting...",
|
|
7670
|
-
qr_pending: "Waiting for QR Scan",
|
|
7671
|
-
disconnected: "Disconnected"
|
|
7672
|
-
};
|
|
7673
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(StatusBadge, { $status: status.status, children: [
|
|
7674
|
-
status.status === "connecting" && /* @__PURE__ */ jsxRuntime.jsx(SpinningLoader, {}),
|
|
7675
|
-
status.status === "connected" && /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
|
|
7676
|
-
statusText[status.status] || "Unknown"
|
|
7677
|
-
] });
|
|
7678
|
-
};
|
|
7679
|
-
if (loading) {
|
|
7680
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PageContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, {}) }) });
|
|
7681
|
-
}
|
|
7682
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(PageContainer, { children: [
|
|
7683
|
-
/* @__PURE__ */ jsxRuntime.jsxs(HeaderSection, { children: [
|
|
7684
|
-
/* @__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" }) }) }) }),
|
|
7685
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "WhatsApp Integration" }),
|
|
7686
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", style: { display: "block" }, children: "Send messages via WhatsApp - completely free!" }),
|
|
7687
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 3, children: renderStatusBadge() })
|
|
7688
|
-
] }),
|
|
7689
|
-
/* @__PURE__ */ jsxRuntime.jsx(StepperContainer, { children: [1, 2, 3, 4].map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7690
|
-
StepWrapper,
|
|
7691
|
-
{
|
|
7692
|
-
$completed: currentStep > step,
|
|
7693
|
-
children: [
|
|
7694
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7695
|
-
StepDot,
|
|
7696
|
-
{
|
|
7697
|
-
$active: currentStep === step,
|
|
7698
|
-
$completed: currentStep > step,
|
|
7699
|
-
onClick: () => currentStep > step && setCurrentStep(step),
|
|
7700
|
-
children: currentStep > step ? /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}) : step
|
|
7701
|
-
}
|
|
7702
|
-
),
|
|
7703
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7704
|
-
StepLabel,
|
|
7705
|
-
{
|
|
7706
|
-
$active: currentStep === step,
|
|
7707
|
-
$completed: currentStep > step,
|
|
7708
|
-
children: stepTitles[step - 1]
|
|
7709
|
-
}
|
|
7710
|
-
)
|
|
7711
|
-
]
|
|
7712
|
-
},
|
|
7713
|
-
step
|
|
7714
|
-
)) }),
|
|
7715
|
-
/* @__PURE__ */ jsxRuntime.jsxs(UseCaseCard, { children: [
|
|
7716
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "12px" }, children: "What can you do with WhatsApp?" }),
|
|
7717
|
-
/* @__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." }),
|
|
7718
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
|
|
7719
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 3, background: "neutral0", hasRadius: true, style: { border: `1px solid ${colors.border}` }, children: [
|
|
7720
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "1. FALLBACK-KANAL" }),
|
|
7721
|
-
/* @__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." })
|
|
7722
|
-
] }),
|
|
7723
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 3, background: "neutral0", hasRadius: true, style: { border: `1px solid ${colors.border}` }, children: [
|
|
7724
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "2. ADMIN-BENACHRICHTIGUNGEN" }),
|
|
7725
|
-
/* @__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." })
|
|
7726
|
-
] }),
|
|
7727
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 3, background: "neutral0", hasRadius: true, style: { border: `1px solid ${colors.border}` }, children: [
|
|
7728
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "3. ROUTING-INTEGRATION" }),
|
|
7729
|
-
/* @__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)." })
|
|
7730
|
-
] })
|
|
7731
|
-
] })
|
|
7732
|
-
] }),
|
|
7733
|
-
currentStep === 1 && /* @__PURE__ */ jsxRuntime.jsxs(ContentCard, { children: [
|
|
7734
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Check Installation" }),
|
|
7735
|
-
/* @__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." }),
|
|
7736
|
-
isAvailable ? /* @__PURE__ */ jsxRuntime.jsxs(SuccessBox, { children: [
|
|
7737
|
-
/* @__PURE__ */ jsxRuntime.jsx(SuccessIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, { style: { width: 14, height: 14 } }) }),
|
|
7738
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
7739
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "semiBold", style: { display: "block", marginBottom: "4px", color: "var(--colors-success600, #15803D)" }, children: "Dependencies Installed" }),
|
|
7740
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Baileys library is installed and ready to use. You can proceed to connect your WhatsApp account." })
|
|
7741
|
-
] })
|
|
7742
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(NotInstalledCard, { children: [
|
|
7743
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "12px", color: colors.danger }, children: "[WARNING] Dependencies Not Installed" }),
|
|
7744
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "16px" }, children: "The WhatsApp integration requires additional dependencies. Please install them:" }),
|
|
7745
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7746
|
-
designSystem.Box,
|
|
7747
|
-
{
|
|
7748
|
-
padding: 4,
|
|
7749
|
-
background: "neutral0",
|
|
7750
|
-
hasRadius: true,
|
|
7751
|
-
style: {
|
|
7752
|
-
fontFamily: "monospace",
|
|
7753
|
-
fontSize: "14px",
|
|
7754
|
-
border: `1px solid ${colors.border}`,
|
|
7755
|
-
marginBottom: "16px"
|
|
7756
|
-
},
|
|
7757
|
-
children: "npm install baileys pino qrcode"
|
|
7758
|
-
}
|
|
7759
|
-
),
|
|
7760
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "After installing, restart your Strapi server and refresh this page." })
|
|
7761
|
-
] }),
|
|
7762
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ButtonRow, { justifyContent: "flex-end", gap: 3, children: [
|
|
7763
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7764
|
-
StyledButtons.SecondaryButton,
|
|
7765
|
-
{
|
|
7766
|
-
onClick: () => {
|
|
7767
|
-
checkAvailability();
|
|
7768
|
-
},
|
|
7769
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowClockwise, {}),
|
|
7770
|
-
children: "Refresh"
|
|
7771
|
-
}
|
|
7772
|
-
),
|
|
7773
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7774
|
-
StyledButtons.GradientButton,
|
|
7775
|
-
{
|
|
7776
|
-
onClick: () => setCurrentStep(2),
|
|
7777
|
-
disabled: !isAvailable,
|
|
7778
|
-
endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowRight, {}),
|
|
7779
|
-
children: "Continue"
|
|
7780
|
-
}
|
|
7781
|
-
)
|
|
7782
|
-
] })
|
|
7783
|
-
] }),
|
|
7784
|
-
currentStep === 2 && /* @__PURE__ */ jsxRuntime.jsxs(ContentCard, { children: [
|
|
7785
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Connect Your WhatsApp" }),
|
|
7786
|
-
/* @__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." }),
|
|
7787
|
-
/* @__PURE__ */ jsxRuntime.jsxs(InfoBox, { children: [
|
|
7788
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "16px", color: "var(--colors-primary600, #075985)" }, children: "How it works" }),
|
|
7789
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
|
|
7790
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", children: '1. Click "Connect WhatsApp" to generate a QR code' }),
|
|
7791
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", children: "2. Open WhatsApp on your phone" }),
|
|
7792
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", children: "3. Go to Settings - Linked Devices - Link a Device" }),
|
|
7793
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", children: "4. Scan the QR code with your phone" })
|
|
7794
|
-
] })
|
|
7795
|
-
] }),
|
|
7796
|
-
/* @__PURE__ */ jsxRuntime.jsxs(AlertBox, { children: [
|
|
7797
|
-
/* @__PURE__ */ jsxRuntime.jsx(AlertIcon, { children: "i" }),
|
|
7798
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
7799
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "semiBold", style: { display: "block", marginBottom: "4px" }, children: "Session Persistence" }),
|
|
7800
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.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." })
|
|
7801
|
-
] })
|
|
7802
|
-
] }),
|
|
7803
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
7804
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7805
|
-
StyledButtons.TertiaryButton,
|
|
7806
|
-
{
|
|
7807
|
-
onClick: () => setCurrentStep(1),
|
|
7808
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeft, {}),
|
|
7809
|
-
children: "Back"
|
|
7810
|
-
}
|
|
7811
|
-
),
|
|
7812
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7813
|
-
WhatsAppButton,
|
|
7814
|
-
{
|
|
7815
|
-
onClick: handleConnect,
|
|
7816
|
-
loading: connecting,
|
|
7817
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Play, {}),
|
|
7818
|
-
children: "Connect WhatsApp"
|
|
7819
|
-
}
|
|
7820
|
-
)
|
|
7821
|
-
] })
|
|
7822
|
-
] }),
|
|
7823
|
-
currentStep === 3 && /* @__PURE__ */ jsxRuntime.jsxs(ContentCard, { children: [
|
|
7824
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Scan QR Code" }),
|
|
7825
|
-
/* @__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." }),
|
|
7826
|
-
/* @__PURE__ */ jsxRuntime.jsx(QRCodeContainer, { children: status.qrCode ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7827
|
-
/* @__PURE__ */ jsxRuntime.jsx(QRImage, { src: status.qrCode, alt: "WhatsApp QR Code" }),
|
|
7828
|
-
/* @__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".' })
|
|
7829
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 3, children: [
|
|
7830
|
-
/* @__PURE__ */ jsxRuntime.jsx(SpinningLoader, { style: { width: "40px", height: "40px" } }),
|
|
7831
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: "Generating QR code..." })
|
|
7832
|
-
] }) }),
|
|
7833
|
-
/* @__PURE__ */ jsxRuntime.jsxs(InfoBox, { children: [
|
|
7834
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "16px", color: "var(--colors-primary600, #075985)" }, children: "Instructions" }),
|
|
7835
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
|
|
7836
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", children: "1. Open WhatsApp on your phone" }),
|
|
7837
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", children: "2. Tap Menu or Settings" }),
|
|
7838
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", children: '3. Select "Linked Devices"' }),
|
|
7839
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", children: '4. Tap "Link a Device"' }),
|
|
7840
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral700", children: "5. Point your phone camera at this QR code" })
|
|
7841
|
-
] })
|
|
7842
|
-
] }),
|
|
7843
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
7844
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7845
|
-
StyledButtons.TertiaryButton,
|
|
7846
|
-
{
|
|
7847
|
-
onClick: () => setCurrentStep(2),
|
|
7848
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeft, {}),
|
|
7849
|
-
children: "Back"
|
|
7850
|
-
}
|
|
7851
|
-
),
|
|
7852
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7853
|
-
StyledButtons.SecondaryButton,
|
|
7854
|
-
{
|
|
7855
|
-
onClick: handleConnect,
|
|
7856
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowClockwise, {}),
|
|
7857
|
-
children: "Refresh QR"
|
|
7858
|
-
}
|
|
7859
|
-
)
|
|
7860
|
-
] })
|
|
7861
|
-
] }),
|
|
7862
|
-
currentStep === 4 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7863
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ConnectedCard, { children: [
|
|
7864
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, { style: { width: "48px", height: "48px", color: colors.success } }) }),
|
|
7865
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "WhatsApp Connected" }),
|
|
7866
|
-
status.session && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block" }, children: [
|
|
7867
|
-
"Connected as: ",
|
|
7868
|
-
status.session.phoneNumber,
|
|
7869
|
-
" ",
|
|
7870
|
-
status.session.name && `(${status.session.name})`
|
|
7871
|
-
] })
|
|
7872
|
-
] }),
|
|
7873
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ContentCard, { style: { marginTop: "24px" }, children: [
|
|
7874
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Send Test Message" }),
|
|
7875
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "Test your WhatsApp connection by sending a message." }),
|
|
7876
|
-
/* @__PURE__ */ jsxRuntime.jsxs(TestSection, { children: [
|
|
7877
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { marginBottom: "20px" }, children: [
|
|
7878
|
-
/* @__PURE__ */ jsxRuntime.jsxs(InputLabel, { children: [
|
|
7879
|
-
/* @__PURE__ */ jsxRuntime.jsx(PhoneSymbol, { children: "+" }),
|
|
7880
|
-
"Phone Number"
|
|
7881
|
-
] }),
|
|
7882
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7883
|
-
WhatsAppInput,
|
|
7884
|
-
{
|
|
7885
|
-
placeholder: "49123456789",
|
|
7886
|
-
value: testPhone,
|
|
7887
|
-
onChange: (e) => setTestPhone(e.target.value)
|
|
7888
|
-
}
|
|
7889
|
-
),
|
|
7890
|
-
/* @__PURE__ */ jsxRuntime.jsx(InputHint, { children: "Enter with country code, without + (e.g., 49 for Germany, 1 for USA)" })
|
|
7891
|
-
] }),
|
|
7892
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { marginBottom: "24px" }, children: [
|
|
7893
|
-
/* @__PURE__ */ jsxRuntime.jsxs(InputLabel, { children: [
|
|
7894
|
-
/* @__PURE__ */ jsxRuntime.jsx(MessageSymbol, { children: "@" }),
|
|
7895
|
-
"Message (optional)"
|
|
7896
|
-
] }),
|
|
7897
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7898
|
-
WhatsAppTextarea,
|
|
7899
|
-
{
|
|
7900
|
-
placeholder: "Type your message here... or leave empty for default test message",
|
|
7901
|
-
value: testMessage,
|
|
7902
|
-
onChange: (e) => setTestMessage(e.target.value),
|
|
7903
|
-
rows: 3
|
|
7904
|
-
}
|
|
7905
|
-
)
|
|
7906
|
-
] }),
|
|
7907
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7908
|
-
WhatsAppButton,
|
|
7909
|
-
{
|
|
7910
|
-
onClick: handleSendTest,
|
|
7911
|
-
loading: sendingTest,
|
|
7912
|
-
disabled: !testPhone,
|
|
7913
|
-
style: { width: "100%" },
|
|
7914
|
-
children: "Send Test Message"
|
|
7915
|
-
}
|
|
7916
|
-
)
|
|
7917
|
-
] }),
|
|
7918
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { margin: "24px 0" } }),
|
|
7919
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Using WhatsApp in Your Code" }),
|
|
7920
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "16px" }, children: "Use the WhatsApp service programmatically in your Strapi code." }),
|
|
7921
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7922
|
-
designSystem.Box,
|
|
7923
|
-
{
|
|
7924
|
-
padding: 4,
|
|
7925
|
-
background: "neutral100",
|
|
7926
|
-
hasRadius: true,
|
|
7927
|
-
style: {
|
|
7928
|
-
fontFamily: "monospace",
|
|
7929
|
-
fontSize: "13px",
|
|
7930
|
-
lineHeight: "1.6",
|
|
7931
|
-
overflow: "auto"
|
|
7932
|
-
},
|
|
7933
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("pre", { style: { margin: 0 }, children: `// Send a message via WhatsApp
|
|
7934
|
-
const whatsapp = strapi.plugin('magic-mail').service('whatsapp');
|
|
7935
|
-
|
|
7936
|
-
// Send simple message
|
|
7937
|
-
await whatsapp.sendMessage('49123456789', 'Hello from MagicMail!');
|
|
7938
|
-
|
|
7939
|
-
// Send template message
|
|
7940
|
-
await whatsapp.sendTemplateMessage('49123456789', 'welcome', {
|
|
7941
|
-
name: 'John',
|
|
7942
|
-
company: 'ACME Corp',
|
|
7943
|
-
});` })
|
|
7944
|
-
}
|
|
7945
|
-
),
|
|
7946
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ButtonRow, { justifyContent: "space-between", alignItems: "center", children: [
|
|
7947
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7948
|
-
StyledButtons.DangerButton,
|
|
7949
|
-
{
|
|
7950
|
-
onClick: handleDisconnect,
|
|
7951
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}),
|
|
7952
|
-
children: "Disconnect WhatsApp"
|
|
7953
|
-
}
|
|
7954
|
-
),
|
|
7955
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success600", textColor: "neutral0", style: { padding: "8px 16px", fontSize: "13px" }, children: "FREE - No API costs!" })
|
|
7956
|
-
] })
|
|
7957
|
-
] })
|
|
7958
|
-
] })
|
|
7959
|
-
] });
|
|
7960
|
-
};
|
|
7961
7128
|
const pluginId = "magic-mail";
|
|
7962
7129
|
const pluginPermissions = {
|
|
7963
7130
|
access: [{ action: `plugin::${pluginId}.access`, subject: null }]
|
|
@@ -7971,22 +7138,18 @@ const App = () => {
|
|
|
7971
7138
|
if (location.pathname.includes("/analytics")) return "analytics";
|
|
7972
7139
|
if (location.pathname.includes("/routing")) return "routing";
|
|
7973
7140
|
if (location.pathname.includes("/designer") && !isEditorRoute) return "templates";
|
|
7974
|
-
if (location.pathname.includes("/whatsapp")) return "whatsapp";
|
|
7975
7141
|
return "accounts";
|
|
7976
7142
|
};
|
|
7977
|
-
const [activeTab, setActiveTab] = React.useState(getActiveTab());
|
|
7978
7143
|
const handleTabChange = (tab) => {
|
|
7979
|
-
setActiveTab(tab);
|
|
7980
7144
|
if (tab === "accounts") navigate("/plugins/magic-mail");
|
|
7981
7145
|
if (tab === "routing") navigate("/plugins/magic-mail/routing");
|
|
7982
7146
|
if (tab === "templates") navigate("/plugins/magic-mail/designer");
|
|
7983
7147
|
if (tab === "analytics") navigate("/plugins/magic-mail/analytics");
|
|
7984
|
-
if (tab === "whatsapp") navigate("/plugins/magic-mail/whatsapp");
|
|
7985
7148
|
};
|
|
7986
7149
|
if (isEditorRoute) {
|
|
7987
7150
|
return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Protect, { permissions: pluginPermissions.access, children: /* @__PURE__ */ jsxRuntime.jsx(EditorPage, {}) });
|
|
7988
7151
|
}
|
|
7989
|
-
return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Protect, { permissions: pluginPermissions.access, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs.Root, { value:
|
|
7152
|
+
return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Protect, { permissions: pluginPermissions.access, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs.Root, { value: getActiveTab(), onValueChange: handleTabChange, children: [
|
|
7990
7153
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs.List, { children: [
|
|
7991
7154
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Trigger, { value: "accounts", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
|
|
7992
7155
|
/* @__PURE__ */ jsxRuntime.jsx(outline.EnvelopeIcon, { style: { width: 16, height: 16 } }),
|
|
@@ -8003,17 +7166,12 @@ const App = () => {
|
|
|
8003
7166
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Trigger, { value: "analytics", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
|
|
8004
7167
|
/* @__PURE__ */ jsxRuntime.jsx(outline.ChartBarIcon, { style: { width: 16, height: 16 } }),
|
|
8005
7168
|
"Analytics"
|
|
8006
|
-
] }) }),
|
|
8007
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Trigger, { value: "whatsapp", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
|
|
8008
|
-
/* @__PURE__ */ jsxRuntime.jsx(outline.ChatBubbleLeftIcon, { style: { width: 16, height: 16 } }),
|
|
8009
|
-
"WhatsApp"
|
|
8010
7169
|
] }) })
|
|
8011
7170
|
] }),
|
|
8012
7171
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "accounts", children: /* @__PURE__ */ jsxRuntime.jsx(HomePage, {}) }),
|
|
8013
7172
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "routing", children: /* @__PURE__ */ jsxRuntime.jsx(RoutingRulesPage, {}) }),
|
|
8014
7173
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "templates", children: /* @__PURE__ */ jsxRuntime.jsx(TemplateList, {}) }),
|
|
8015
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "analytics", children: /* @__PURE__ */ jsxRuntime.jsx(Analytics, {}) })
|
|
8016
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "whatsapp", children: /* @__PURE__ */ jsxRuntime.jsx(WhatsAppPage, {}) })
|
|
7174
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "analytics", children: /* @__PURE__ */ jsxRuntime.jsx(Analytics, {}) })
|
|
8017
7175
|
] }) }) });
|
|
8018
7176
|
};
|
|
8019
7177
|
exports.default = App;
|