@carlonicora/nextjs-jsonapi 6.29.1 → 6.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BlockNoteEditor-K4HWQLPJ.js → BlockNoteEditor-ICGGCW6N.js} +24 -24
- package/dist/{BlockNoteEditor-K4HWQLPJ.js.map → BlockNoteEditor-ICGGCW6N.js.map} +1 -1
- package/dist/{BlockNoteEditor-TDX2RC7I.mjs → BlockNoteEditor-O4E67ECL.mjs} +4 -4
- package/dist/{BlockNoteViewer-76CKL6W5.mjs → BlockNoteViewer-BNZEXGVT.mjs} +2 -2
- package/dist/{BlockNoteViewer-B25WKYQP.js → BlockNoteViewer-YONLBNXW.js} +3 -3
- package/dist/{BlockNoteViewer-B25WKYQP.js.map → BlockNoteViewer-YONLBNXW.js.map} +1 -1
- package/dist/billing/index.js +465 -465
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-77JC2UCF.js → chunk-5XP5G45B.js} +23 -10
- package/dist/chunk-5XP5G45B.js.map +1 -0
- package/dist/{chunk-OVSR72CZ.mjs → chunk-BT3VFB3I.mjs} +333 -299
- package/dist/chunk-BT3VFB3I.mjs.map +1 -0
- package/dist/{chunk-7MGXQIEP.mjs → chunk-FDKAVSZ6.mjs} +2 -2
- package/dist/{chunk-FJUKLVVX.mjs → chunk-HNK2O6YE.mjs} +23 -10
- package/dist/chunk-HNK2O6YE.mjs.map +1 -0
- package/dist/{chunk-M7YK5CCE.mjs → chunk-JL6XL5NK.mjs} +9 -2
- package/dist/chunk-JL6XL5NK.mjs.map +1 -0
- package/dist/{chunk-QI4SCGPB.js → chunk-M7FA63QE.js} +803 -769
- package/dist/chunk-M7FA63QE.js.map +1 -0
- package/dist/{chunk-F3EVYBMA.js → chunk-NQL2NDKH.js} +4 -4
- package/dist/{chunk-F3EVYBMA.js.map → chunk-NQL2NDKH.js.map} +1 -1
- package/dist/{chunk-ONU4WCDG.js → chunk-Q5SMFSE4.js} +11 -4
- package/dist/chunk-Q5SMFSE4.js.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/forms/CommonEditorButtons.d.ts.map +1 -1
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/email-automations/index.js +105 -105
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.js +114 -114
- package/dist/features/analytics/index.mjs +3 -3
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/auth/components/GdprConsentSection.d.ts +2 -1
- package/dist/features/auth/components/GdprConsentSection.d.ts.map +1 -1
- package/dist/features/auth/components/forms/Login.d.ts.map +1 -1
- package/dist/features/auth/components/forms/Register.d.ts.map +1 -1
- package/dist/features/auth/data/auth.service.d.ts +8 -3
- package/dist/features/auth/data/auth.service.d.ts.map +1 -1
- package/dist/features/auth/data/pending-registration.d.ts +2 -0
- package/dist/features/auth/data/pending-registration.d.ts.map +1 -1
- package/dist/features/auth/data/pending-registration.interface.d.ts +1 -0
- package/dist/features/auth/data/pending-registration.interface.d.ts.map +1 -1
- package/dist/features/auth/hooks/useCompleteLogin.d.ts +9 -0
- package/dist/features/auth/hooks/useCompleteLogin.d.ts.map +1 -0
- package/dist/features/blog/index.js +129 -129
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +7 -7
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +114 -114
- package/dist/features/tokenusage/index.mjs +3 -3
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/login/config.d.ts +3 -0
- package/dist/login/config.d.ts.map +1 -1
- package/dist/login/index.d.ts +1 -1
- package/dist/login/index.d.ts.map +1 -1
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/messages/en.json +1 -0
- package/messages/it.json +1 -0
- package/package.json +1 -1
- package/src/components/forms/CommonEditorButtons.tsx +16 -2
- package/src/features/auth/components/GdprConsentSection.tsx +3 -1
- package/src/features/auth/components/forms/Login.tsx +4 -32
- package/src/features/auth/components/forms/Register.tsx +66 -36
- package/src/features/auth/data/__tests__/auth.oauth-completion.spec.ts +44 -0
- package/src/features/auth/data/__tests__/pending-registration.spec.ts +8 -0
- package/src/features/auth/data/auth.service.ts +21 -15
- package/src/features/auth/data/pending-registration.interface.ts +1 -0
- package/src/features/auth/data/pending-registration.ts +6 -0
- package/src/features/auth/hooks/__tests__/useCompleteLogin.spec.tsx +85 -0
- package/src/features/auth/hooks/useCompleteLogin.ts +47 -0
- package/src/login/__tests__/config.spec.ts +21 -0
- package/src/login/config.ts +8 -0
- package/src/login/index.ts +1 -0
- package/dist/chunk-77JC2UCF.js.map +0 -1
- package/dist/chunk-FJUKLVVX.mjs.map +0 -1
- package/dist/chunk-M7YK5CCE.mjs.map +0 -1
- package/dist/chunk-ONU4WCDG.js.map +0 -1
- package/dist/chunk-OVSR72CZ.mjs.map +0 -1
- package/dist/chunk-QI4SCGPB.js.map +0 -1
- /package/dist/{BlockNoteEditor-TDX2RC7I.mjs.map → BlockNoteEditor-O4E67ECL.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-76CKL6W5.mjs.map → BlockNoteViewer-BNZEXGVT.mjs.map} +0 -0
- /package/dist/{chunk-7MGXQIEP.mjs.map → chunk-FDKAVSZ6.mjs.map} +0 -0
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkM7FA63QEjs = require('../chunk-M7FA63QE.js');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
var _chunkSYMI4IDWjs = require('../chunk-SYMI4IDW.js');
|
|
53
53
|
require('../chunk-3EPNHTMH.js');
|
|
54
|
-
require('../chunk-
|
|
54
|
+
require('../chunk-Q5SMFSE4.js');
|
|
55
55
|
require('../chunk-G4JR3SFV.js');
|
|
56
56
|
|
|
57
57
|
|
|
@@ -62,7 +62,7 @@ require('../chunk-G4JR3SFV.js');
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunk5XP5G45Bjs = require('../chunk-5XP5G45B.js');
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
var _chunkHROKKUBQjs = require('../chunk-HROKKUBQ.js');
|
|
@@ -114,7 +114,7 @@ function EmailAutomationEditorInternal({
|
|
|
114
114
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
115
115
|
_react.useEffect.call(void 0, () => {
|
|
116
116
|
let active = true;
|
|
117
|
-
|
|
117
|
+
_chunk5XP5G45Bjs.EmailAutomationService.findTriggers().then((list) => {
|
|
118
118
|
if (active) setTriggers(list);
|
|
119
119
|
}).catch(() => {
|
|
120
120
|
});
|
|
@@ -163,7 +163,7 @@ function EmailAutomationEditorInternal({
|
|
|
163
163
|
[t]
|
|
164
164
|
);
|
|
165
165
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
166
|
-
|
|
166
|
+
_chunkM7FA63QEjs.EditorSheet,
|
|
167
167
|
{
|
|
168
168
|
form,
|
|
169
169
|
entityType: t("emailAutomations.admin.title"),
|
|
@@ -185,7 +185,7 @@ function EmailAutomationEditorInternal({
|
|
|
185
185
|
isActive: values.isActive,
|
|
186
186
|
purpose: values.purpose
|
|
187
187
|
};
|
|
188
|
-
return isEdit ? await
|
|
188
|
+
return isEdit ? await _chunk5XP5G45Bjs.EmailAutomationService.update(payload) : await _chunk5XP5G45Bjs.EmailAutomationService.create(payload);
|
|
189
189
|
},
|
|
190
190
|
onReset: getDefaultValues,
|
|
191
191
|
trigger,
|
|
@@ -194,9 +194,9 @@ function EmailAutomationEditorInternal({
|
|
|
194
194
|
dialogOpen,
|
|
195
195
|
onDialogOpenChange,
|
|
196
196
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
197
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
197
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.FormInput, { form, id: "name", name: t("emailAutomations.fields.name.label"), isRequired: true }),
|
|
198
198
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
199
|
-
|
|
199
|
+
_chunkM7FA63QEjs.FormSelect,
|
|
200
200
|
{
|
|
201
201
|
form,
|
|
202
202
|
id: "purpose",
|
|
@@ -208,7 +208,7 @@ function EmailAutomationEditorInternal({
|
|
|
208
208
|
}
|
|
209
209
|
),
|
|
210
210
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
211
|
-
|
|
211
|
+
_chunkM7FA63QEjs.FormSelect,
|
|
212
212
|
{
|
|
213
213
|
form,
|
|
214
214
|
id: "trigger",
|
|
@@ -219,7 +219,7 @@ function EmailAutomationEditorInternal({
|
|
|
219
219
|
}
|
|
220
220
|
),
|
|
221
221
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
222
|
-
|
|
222
|
+
_chunkM7FA63QEjs.FormSelect,
|
|
223
223
|
{
|
|
224
224
|
form,
|
|
225
225
|
id: "exitTrigger",
|
|
@@ -229,9 +229,9 @@ function EmailAutomationEditorInternal({
|
|
|
229
229
|
allowEmpty: true
|
|
230
230
|
}
|
|
231
231
|
),
|
|
232
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
232
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.FormInput, { form, id: "replyTo", name: t("emailAutomations.fields.replyTo.label") }),
|
|
233
233
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
234
|
-
|
|
234
|
+
_chunkM7FA63QEjs.FormSwitch,
|
|
235
235
|
{
|
|
236
236
|
form,
|
|
237
237
|
id: "isActive",
|
|
@@ -255,14 +255,14 @@ var EmailAutomationEditor_default = EmailAutomationEditor;
|
|
|
255
255
|
function EmailAutomationsList({ fullWidth } = {}) {
|
|
256
256
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
257
257
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
258
|
-
const data =
|
|
259
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
258
|
+
const data = _chunkM7FA63QEjs.useDataListRetriever.call(void 0, {
|
|
259
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk5XP5G45Bjs.EmailAutomationService.findMany(params), "retriever"),
|
|
260
260
|
retrieverParams: {},
|
|
261
261
|
module: _chunkZ6T2575Ajs.Modules.EmailAutomation
|
|
262
262
|
});
|
|
263
263
|
_react.useEffect.call(void 0, () => {
|
|
264
264
|
let active = true;
|
|
265
|
-
|
|
265
|
+
_chunk5XP5G45Bjs.EmailAutomationService.findTriggers().then((list) => {
|
|
266
266
|
if (active) setTriggers(list);
|
|
267
267
|
}).catch(() => {
|
|
268
268
|
});
|
|
@@ -276,7 +276,7 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
276
276
|
);
|
|
277
277
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationEditor_default, {}, "create-email-automation")];
|
|
278
278
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
279
|
-
|
|
279
|
+
_chunkM7FA63QEjs.ContentListTable,
|
|
280
280
|
{
|
|
281
281
|
data,
|
|
282
282
|
fields: [
|
|
@@ -294,7 +294,7 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
294
294
|
fullWidth,
|
|
295
295
|
title: t("emailAutomations.admin.title"),
|
|
296
296
|
context: { triggerLabels },
|
|
297
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
297
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.EmptyState, { icon: _lucidereact.MailIcon, title: t("emailAutomations.admin.empty") })
|
|
298
298
|
}
|
|
299
299
|
);
|
|
300
300
|
}
|
|
@@ -305,7 +305,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsList, "EmailAutomationsList
|
|
|
305
305
|
function EmailAutomationsListContainer() {
|
|
306
306
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
307
307
|
const breadcrumbs = [{ name: t("emailAutomations.admin.title") }];
|
|
308
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
308
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SharedProvider, { value: { breadcrumbs, title: { type: t("emailAutomations.admin.title") } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.RoundPageContainer, { module: _chunkZ6T2575Ajs.Modules.EmailAutomation, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationsList, { fullWidth: true }) }) });
|
|
309
309
|
}
|
|
310
310
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsListContainer, "EmailAutomationsListContainer");
|
|
311
311
|
|
|
@@ -324,8 +324,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
324
324
|
const [selectedStepId, setSelectedStepId] = _react.useState.call(void 0, null);
|
|
325
325
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
326
326
|
const [loadedAutomation, loadedSteps] = await Promise.all([
|
|
327
|
-
|
|
328
|
-
|
|
327
|
+
_chunk5XP5G45Bjs.EmailAutomationService.findOne({ id: automationId }),
|
|
328
|
+
_chunk5XP5G45Bjs.EmailAutomationStepService.findByAutomation({ automationId })
|
|
329
329
|
]);
|
|
330
330
|
setAutomation(loadedAutomation);
|
|
331
331
|
setSteps(loadedSteps);
|
|
@@ -335,7 +335,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
335
335
|
}, [reload]);
|
|
336
336
|
_react.useEffect.call(void 0, () => {
|
|
337
337
|
let active = true;
|
|
338
|
-
|
|
338
|
+
_chunk5XP5G45Bjs.EmailAutomationService.findTriggers().then((list) => {
|
|
339
339
|
if (active) setTriggers(list);
|
|
340
340
|
}).catch(() => {
|
|
341
341
|
});
|
|
@@ -346,7 +346,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
346
346
|
const select = _react.useCallback.call(void 0, (id) => setSelectedStepId(id), []);
|
|
347
347
|
const createStep = _react.useCallback.call(void 0,
|
|
348
348
|
async (input) => {
|
|
349
|
-
const saved = await
|
|
349
|
+
const saved = await _chunk5XP5G45Bjs.EmailAutomationStepService.create({ ...input, id: _nullishCoalesce(input.id, () => ( _uuid.v4.call(void 0, ))), automationId });
|
|
350
350
|
await reload();
|
|
351
351
|
return saved;
|
|
352
352
|
},
|
|
@@ -354,7 +354,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
354
354
|
);
|
|
355
355
|
const updateStep = _react.useCallback.call(void 0,
|
|
356
356
|
async (input) => {
|
|
357
|
-
const saved = await
|
|
357
|
+
const saved = await _chunk5XP5G45Bjs.EmailAutomationStepService.update({ ...input, automationId });
|
|
358
358
|
await reload();
|
|
359
359
|
return saved;
|
|
360
360
|
},
|
|
@@ -362,7 +362,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
362
362
|
);
|
|
363
363
|
const deleteStep = _react.useCallback.call(void 0,
|
|
364
364
|
async (id) => {
|
|
365
|
-
await
|
|
365
|
+
await _chunk5XP5G45Bjs.EmailAutomationStepService.delete({ id });
|
|
366
366
|
if (selectedStepId === id) setSelectedStepId(null);
|
|
367
367
|
await reload();
|
|
368
368
|
},
|
|
@@ -370,8 +370,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
370
370
|
);
|
|
371
371
|
const setNext = _react.useCallback.call(void 0,
|
|
372
372
|
async (stepId, nextStepId) => {
|
|
373
|
-
if (nextStepId) await
|
|
374
|
-
else await
|
|
373
|
+
if (nextStepId) await _chunk5XP5G45Bjs.EmailAutomationStepService.setNext({ stepId, nextStepId });
|
|
374
|
+
else await _chunk5XP5G45Bjs.EmailAutomationStepService.clearNext({ stepId });
|
|
375
375
|
await reload();
|
|
376
376
|
},
|
|
377
377
|
[reload]
|
|
@@ -380,7 +380,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
380
380
|
async (stepId, x, y) => {
|
|
381
381
|
const step = steps.find((candidate) => candidate.id === stepId);
|
|
382
382
|
if (!step) return;
|
|
383
|
-
await
|
|
383
|
+
await _chunk5XP5G45Bjs.EmailAutomationStepService.update({
|
|
384
384
|
id: step.id,
|
|
385
385
|
automationId,
|
|
386
386
|
subject: step.subject,
|
|
@@ -394,7 +394,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
394
394
|
[automationId, reload, steps]
|
|
395
395
|
);
|
|
396
396
|
const tidy = _react.useCallback.call(void 0, async () => {
|
|
397
|
-
await
|
|
397
|
+
await _chunk5XP5G45Bjs.EmailAutomationService.tidy({ id: automationId });
|
|
398
398
|
await reload();
|
|
399
399
|
}, [automationId, reload]);
|
|
400
400
|
const value = _react.useMemo.call(void 0,
|
|
@@ -449,7 +449,7 @@ function EmailAutomationActiveSwitch() {
|
|
|
449
449
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (checked) => {
|
|
450
450
|
setSaving(true);
|
|
451
451
|
try {
|
|
452
|
-
await
|
|
452
|
+
await _chunk5XP5G45Bjs.EmailAutomationService.update({
|
|
453
453
|
id: automation.id,
|
|
454
454
|
name: automation.name,
|
|
455
455
|
trigger: automation.trigger,
|
|
@@ -459,17 +459,17 @@ function EmailAutomationActiveSwitch() {
|
|
|
459
459
|
});
|
|
460
460
|
await reload();
|
|
461
461
|
} catch (error) {
|
|
462
|
-
|
|
462
|
+
_chunkM7FA63QEjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
463
463
|
} finally {
|
|
464
464
|
setSaving(false);
|
|
465
465
|
}
|
|
466
466
|
}, "toggle");
|
|
467
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
468
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
469
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
467
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.Tooltip, { children: [
|
|
468
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "flex items-center gap-x-2" }), children: [
|
|
469
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.Switch, { checked: automation.isActive, onCheckedChange: (checked) => void toggle(checked), disabled: saving }),
|
|
470
470
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs", children: t("emailAutomations.fields.isActive.label") })
|
|
471
471
|
] }),
|
|
472
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
472
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.TooltipContent, { className: "max-w-xs", children: t("emailAutomations.fields.isActive.help") })
|
|
473
473
|
] });
|
|
474
474
|
}
|
|
475
475
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationActiveSwitch, "EmailAutomationActiveSwitch");
|
|
@@ -502,7 +502,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
502
502
|
const { zoomIn, zoomOut, fitView } = _react3.useReactFlow.call(void 0, );
|
|
503
503
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-help": "canvas.toolbar", className: "absolute end-2 top-2 z-10 flex flex-col gap-1 max-md:top-14", children: [
|
|
504
504
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
505
|
-
|
|
505
|
+
_chunkM7FA63QEjs.Button,
|
|
506
506
|
{
|
|
507
507
|
type: "button",
|
|
508
508
|
variant: "outline",
|
|
@@ -513,7 +513,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
513
513
|
}
|
|
514
514
|
),
|
|
515
515
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
516
|
-
|
|
516
|
+
_chunkM7FA63QEjs.Button,
|
|
517
517
|
{
|
|
518
518
|
type: "button",
|
|
519
519
|
variant: "outline",
|
|
@@ -524,7 +524,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
524
524
|
}
|
|
525
525
|
),
|
|
526
526
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
527
|
-
|
|
527
|
+
_chunkM7FA63QEjs.Button,
|
|
528
528
|
{
|
|
529
529
|
type: "button",
|
|
530
530
|
variant: "outline",
|
|
@@ -535,7 +535,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
535
535
|
}
|
|
536
536
|
),
|
|
537
537
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
538
|
-
|
|
538
|
+
_chunkM7FA63QEjs.Button,
|
|
539
539
|
{
|
|
540
540
|
type: "button",
|
|
541
541
|
variant: "outline",
|
|
@@ -828,7 +828,7 @@ function EmailStepEditorInternal({
|
|
|
828
828
|
defaultValues: getDefaultValues()
|
|
829
829
|
});
|
|
830
830
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
831
|
-
|
|
831
|
+
_chunkM7FA63QEjs.EditorSheet,
|
|
832
832
|
{
|
|
833
833
|
form,
|
|
834
834
|
entityType: t("emailAutomations.step.title"),
|
|
@@ -847,7 +847,7 @@ function EmailStepEditorInternal({
|
|
|
847
847
|
positionX: step ? step.positionX : _optionalChain([initialPosition, 'optionalAccess', _21 => _21.x]),
|
|
848
848
|
positionY: step ? step.positionY : _optionalChain([initialPosition, 'optionalAccess', _22 => _22.y])
|
|
849
849
|
};
|
|
850
|
-
return isEdit ? await
|
|
850
|
+
return isEdit ? await _chunk5XP5G45Bjs.EmailAutomationStepService.update(payload) : await _chunk5XP5G45Bjs.EmailAutomationStepService.create(payload);
|
|
851
851
|
},
|
|
852
852
|
onSuccess: async () => {
|
|
853
853
|
await reload();
|
|
@@ -860,9 +860,9 @@ function EmailStepEditorInternal({
|
|
|
860
860
|
dialogOpen,
|
|
861
861
|
onDialogOpenChange,
|
|
862
862
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
863
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
863
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.FormInput, { form, id: "subject", name: t("emailAutomations.step.fields.subject.label"), isRequired: true }),
|
|
864
864
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
865
|
-
|
|
865
|
+
_chunkM7FA63QEjs.FormInput,
|
|
866
866
|
{
|
|
867
867
|
form,
|
|
868
868
|
id: "delayHours",
|
|
@@ -872,7 +872,7 @@ function EmailStepEditorInternal({
|
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
874
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
875
|
-
|
|
875
|
+
_chunkM7FA63QEjs.FormTextarea,
|
|
876
876
|
{
|
|
877
877
|
form,
|
|
878
878
|
id: "body",
|
|
@@ -1012,7 +1012,7 @@ var stepIdOf = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (nodeId) =>
|
|
|
1012
1012
|
function EmailAutomationCanvas() {
|
|
1013
1013
|
const { automation, steps, triggers, select, reload, createStep, deleteStep, setNext, updatePosition, tidy } = useEmailAutomation();
|
|
1014
1014
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1015
|
-
const isMobile =
|
|
1015
|
+
const isMobile = _chunk5XP5G45Bjs.useIsMobile.call(void 0, );
|
|
1016
1016
|
const [nodes, setNodes] = _react.useState.call(void 0, []);
|
|
1017
1017
|
const [edges, setEdges] = _react.useState.call(void 0, []);
|
|
1018
1018
|
const { screenToFlowPosition } = _react3.useReactFlow.call(void 0, );
|
|
@@ -1051,7 +1051,7 @@ function EmailAutomationCanvas() {
|
|
|
1051
1051
|
try {
|
|
1052
1052
|
await setNext(stepId, nextStepId);
|
|
1053
1053
|
} catch (error) {
|
|
1054
|
-
|
|
1054
|
+
_chunkM7FA63QEjs.errorToast.call(void 0, { title: t("emailAutomations.canvas.chainError"), error });
|
|
1055
1055
|
await reload();
|
|
1056
1056
|
}
|
|
1057
1057
|
},
|
|
@@ -1065,7 +1065,7 @@ function EmailAutomationCanvas() {
|
|
|
1065
1065
|
if (!_optionalChain([conn, 'access', _31 => _31.targetHandle, 'optionalAccess', _32 => _32.startsWith, 'call', _33 => _33(STEP_TARGET_HANDLE_PREFIX)])) return;
|
|
1066
1066
|
const targetStepId = conn.targetHandle.slice(STEP_TARGET_HANDLE_PREFIX.length);
|
|
1067
1067
|
if (from.handleId === TRIGGER_SOURCE_HANDLE) {
|
|
1068
|
-
|
|
1068
|
+
_chunk5XP5G45Bjs.showError.call(void 0, t("emailAutomations.canvas.chainError"));
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
1071
|
if (!from.handleId.startsWith(STEP_SOURCE_HANDLE_PREFIX)) return;
|
|
@@ -1183,7 +1183,7 @@ function EmailAutomationCanvas() {
|
|
|
1183
1183
|
try {
|
|
1184
1184
|
await deleteStep(stepId);
|
|
1185
1185
|
} catch (error) {
|
|
1186
|
-
|
|
1186
|
+
_chunkM7FA63QEjs.errorToast.call(void 0, { title: t("emailAutomations.canvas.deleteEmail"), error });
|
|
1187
1187
|
throw error;
|
|
1188
1188
|
}
|
|
1189
1189
|
}, [pendingDeleteStepId, deleteStep, t]);
|
|
@@ -1246,7 +1246,7 @@ function EmailAutomationCanvas() {
|
|
|
1246
1246
|
}
|
|
1247
1247
|
),
|
|
1248
1248
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1249
|
-
|
|
1249
|
+
_chunkM7FA63QEjs.ConfirmDialog,
|
|
1250
1250
|
{
|
|
1251
1251
|
open: pendingDeleteStepId !== null,
|
|
1252
1252
|
onOpenChange: (open) => {
|
|
@@ -1261,20 +1261,20 @@ function EmailAutomationCanvas() {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
),
|
|
1263
1263
|
paneMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1264
|
-
|
|
1264
|
+
_chunkM7FA63QEjs.ContextMenu,
|
|
1265
1265
|
{
|
|
1266
1266
|
open: true,
|
|
1267
1267
|
onOpenChange: (open) => {
|
|
1268
1268
|
if (!open) setPaneMenu(null);
|
|
1269
1269
|
},
|
|
1270
1270
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1271
|
-
|
|
1271
|
+
_chunkM7FA63QEjs.ContextMenuContent,
|
|
1272
1272
|
{
|
|
1273
1273
|
anchor: pointAnchor(paneMenu.screenX, paneMenu.screenY),
|
|
1274
1274
|
side: "bottom",
|
|
1275
1275
|
align: "start",
|
|
1276
1276
|
sideOffset: 4,
|
|
1277
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1277
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.ContextMenuItem, { onClick: handleCreateStepFromPane, children: [
|
|
1278
1278
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PlusIcon, {}),
|
|
1279
1279
|
t("emailAutomations.canvas.addEmail")
|
|
1280
1280
|
] })
|
|
@@ -1283,21 +1283,21 @@ function EmailAutomationCanvas() {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
),
|
|
1285
1285
|
nodeMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1286
|
-
|
|
1286
|
+
_chunkM7FA63QEjs.ContextMenu,
|
|
1287
1287
|
{
|
|
1288
1288
|
open: true,
|
|
1289
1289
|
onOpenChange: (open) => {
|
|
1290
1290
|
if (!open) setNodeMenu(null);
|
|
1291
1291
|
},
|
|
1292
1292
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1293
|
-
|
|
1293
|
+
_chunkM7FA63QEjs.ContextMenuContent,
|
|
1294
1294
|
{
|
|
1295
1295
|
anchor: pointAnchor(nodeMenu.screenX, nodeMenu.screenY),
|
|
1296
1296
|
side: "bottom",
|
|
1297
1297
|
align: "start",
|
|
1298
1298
|
sideOffset: 4,
|
|
1299
1299
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1300
|
-
|
|
1300
|
+
_chunkM7FA63QEjs.ContextMenuItem,
|
|
1301
1301
|
{
|
|
1302
1302
|
onClick: () => {
|
|
1303
1303
|
const menu = nodeMenu;
|
|
@@ -1338,7 +1338,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, TriggerAutomationEditor, "TriggerAutomation
|
|
|
1338
1338
|
// src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx
|
|
1339
1339
|
|
|
1340
1340
|
function EmailAutomationCanvasTab() {
|
|
1341
|
-
const { open, setOpen } =
|
|
1341
|
+
const { open, setOpen } = _chunkM7FA63QEjs.useSidebar.call(void 0, );
|
|
1342
1342
|
_react.useEffect.call(void 0, () => {
|
|
1343
1343
|
const prev = open;
|
|
1344
1344
|
if (prev) setOpen(false);
|
|
@@ -1371,9 +1371,9 @@ function EmailAutomationAddPersonDialog({
|
|
|
1371
1371
|
const searchTermRef = _react.useRef.call(void 0, "");
|
|
1372
1372
|
const [searchTerm, setSearchTerm] = _react.useState.call(void 0, "");
|
|
1373
1373
|
const sentinelRef = _react.useRef.call(void 0, null);
|
|
1374
|
-
const data =
|
|
1374
|
+
const data = _chunkM7FA63QEjs.useDataListRetriever.call(void 0, {
|
|
1375
1375
|
ready: open,
|
|
1376
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1376
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk5XP5G45Bjs.EmailAutomationService.findCandidates(params), "retriever"),
|
|
1377
1377
|
retrieverParams: { automationId },
|
|
1378
1378
|
module: _chunkZ6T2575Ajs.Modules.EmailAutomationCandidate
|
|
1379
1379
|
});
|
|
@@ -1388,7 +1388,7 @@ function EmailAutomationAddPersonDialog({
|
|
|
1388
1388
|
},
|
|
1389
1389
|
[data]
|
|
1390
1390
|
);
|
|
1391
|
-
const updateSearchTerm =
|
|
1391
|
+
const updateSearchTerm = _chunkM7FA63QEjs.useDebounce.call(void 0, refreshList, 500);
|
|
1392
1392
|
_react.useEffect.call(void 0, () => {
|
|
1393
1393
|
if (open) updateSearchTerm(searchTerm);
|
|
1394
1394
|
}, [open, searchTerm]);
|
|
@@ -1423,22 +1423,22 @@ function EmailAutomationAddPersonDialog({
|
|
|
1423
1423
|
const add = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (candidate) => {
|
|
1424
1424
|
if (!candidate.addable) return;
|
|
1425
1425
|
try {
|
|
1426
|
-
await
|
|
1426
|
+
await _chunk5XP5G45Bjs.EmailAutomationService.addEnrollment({
|
|
1427
1427
|
automationId,
|
|
1428
1428
|
input: { id: _uuid.v4.call(void 0, ), recipientType: candidate.recipientType, recipientId: candidate.recipientId }
|
|
1429
1429
|
});
|
|
1430
1430
|
setOpen(false);
|
|
1431
|
-
|
|
1431
|
+
_chunk5XP5G45Bjs.showToast.call(void 0, t("emailAutomations.recipients.addDialog.added", { email: candidate.email }));
|
|
1432
1432
|
onAdded();
|
|
1433
1433
|
} catch (error) {
|
|
1434
|
-
|
|
1434
|
+
_chunkM7FA63QEjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
1435
1435
|
}
|
|
1436
1436
|
}, "add");
|
|
1437
1437
|
const candidates = _nullishCoalesce(data.data, () => ( []));
|
|
1438
1438
|
const addable = candidates.filter((candidate) => candidate.addable);
|
|
1439
1439
|
const blocked = candidates.filter((candidate) => !candidate.addable);
|
|
1440
1440
|
const renderCandidate = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (candidate) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1441
|
-
|
|
1441
|
+
_chunkM7FA63QEjs.CommandItem,
|
|
1442
1442
|
{
|
|
1443
1443
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
1444
1444
|
value: candidate.id,
|
|
@@ -1447,20 +1447,20 @@ function EmailAutomationAddPersonDialog({
|
|
|
1447
1447
|
"data-addable": candidate.addable ? "true" : "false",
|
|
1448
1448
|
onSelect: () => void add(candidate),
|
|
1449
1449
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-1 flex-row items-center px-4 py-1", children: [
|
|
1450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1450
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.Avatar, { className: "h-6 w-6", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.AvatarFallback, { children: _chunk5XP5G45Bjs.getInitials.call(void 0, candidate.name || candidate.email) }) }) }),
|
|
1451
1451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "ms-5 me-3 flex min-w-0 flex-1 flex-col", children: candidate.name ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1452
1452
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate text-sm font-medium", children: candidate.name }),
|
|
1453
1453
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate text-xs font-normal", children: candidate.email })
|
|
1454
1454
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate text-sm font-medium", children: candidate.email }) }),
|
|
1455
1455
|
candidate.addable ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1456
|
-
|
|
1456
|
+
_chunkM7FA63QEjs.Badge,
|
|
1457
1457
|
{
|
|
1458
1458
|
variant: candidate.recipientType === "waitlist" ? "softBlue" : "softGray",
|
|
1459
1459
|
className: "ms-auto shrink-0",
|
|
1460
1460
|
children: t(`emailAutomations.recipients.addDialog.kind.${candidate.recipientType}`)
|
|
1461
1461
|
}
|
|
1462
1462
|
) : candidate.reason && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1463
|
-
|
|
1463
|
+
_chunkM7FA63QEjs.Badge,
|
|
1464
1464
|
{
|
|
1465
1465
|
variant: "softAmber",
|
|
1466
1466
|
className: "ms-auto shrink-0",
|
|
@@ -1473,11 +1473,11 @@ function EmailAutomationAddPersonDialog({
|
|
|
1473
1473
|
candidate.id
|
|
1474
1474
|
), "renderCandidate");
|
|
1475
1475
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
1476
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1476
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.Dialog, { open, onOpenChange: handleOpenChange, children: [
|
|
1477
1477
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1478
|
-
|
|
1478
|
+
_chunkM7FA63QEjs.DialogTrigger,
|
|
1479
1479
|
{
|
|
1480
|
-
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1480
|
+
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.Button, { variant: "outline", size: "sm", "data-testid": "email-automation-add-person" }),
|
|
1481
1481
|
disabled,
|
|
1482
1482
|
children: [
|
|
1483
1483
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UserPlusIcon, { className: "h-3.5 w-3.5" }),
|
|
@@ -1485,11 +1485,11 @@ function EmailAutomationAddPersonDialog({
|
|
|
1485
1485
|
]
|
|
1486
1486
|
}
|
|
1487
1487
|
),
|
|
1488
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1489
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1490
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1488
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.DialogContent, { className: "sm:max-w-2xl", "data-testid": "email-automation-add-person-dialog", children: [
|
|
1489
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.DialogTitle, { children: t("emailAutomations.recipients.addDialog.title") }) }),
|
|
1490
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.Command, { shouldFilter: false, children: [
|
|
1491
1491
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1492
|
-
|
|
1492
|
+
_chunkM7FA63QEjs.CommandInput,
|
|
1493
1493
|
{
|
|
1494
1494
|
"data-testid": "email-automation-add-person-search",
|
|
1495
1495
|
placeholder: t("emailAutomations.recipients.addDialog.search"),
|
|
@@ -1497,10 +1497,10 @@ function EmailAutomationAddPersonDialog({
|
|
|
1497
1497
|
onValueChange: setSearchTerm
|
|
1498
1498
|
}
|
|
1499
1499
|
),
|
|
1500
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1501
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1502
|
-
addable.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1503
|
-
blocked.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1500
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.CommandList, { className: "mt-2", children: [
|
|
1501
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.CommandEmpty, { children: t("emailAutomations.recipients.addDialog.empty") }),
|
|
1502
|
+
addable.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.CommandGroup, { heading: t("emailAutomations.recipients.addDialog.groups.addable"), children: addable.map(renderCandidate) }),
|
|
1503
|
+
blocked.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.CommandGroup, { heading: t("emailAutomations.recipients.addDialog.groups.blocked"), children: blocked.map(renderCandidate) }),
|
|
1504
1504
|
data.next && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: sentinelRef, style: { height: 1 } })
|
|
1505
1505
|
] })
|
|
1506
1506
|
] })
|
|
@@ -1517,8 +1517,8 @@ function EmailAutomationRecipientsList() {
|
|
|
1517
1517
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1518
1518
|
const { automation, reload } = useEmailAutomation();
|
|
1519
1519
|
const [statusFilter, setStatusFilter] = _react.useState.call(void 0, "all");
|
|
1520
|
-
const data =
|
|
1521
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1520
|
+
const data = _chunkM7FA63QEjs.useDataListRetriever.call(void 0, {
|
|
1521
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk5XP5G45Bjs.EmailAutomationService.findEnrollments(params), "retriever"),
|
|
1522
1522
|
retrieverParams: { automationId: _optionalChain([automation, 'optionalAccess', _50 => _50.id]) },
|
|
1523
1523
|
module: _chunkZ6T2575Ajs.Modules.EmailAutomationEnrollment
|
|
1524
1524
|
});
|
|
@@ -1550,21 +1550,21 @@ function EmailAutomationRecipientsList() {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
}
|
|
1552
1552
|
),
|
|
1553
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1554
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1555
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1556
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1558
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1559
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1560
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1561
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1553
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.Select, { items: statusItems, value: statusFilter, onValueChange: handleStatusChange, children: [
|
|
1554
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SelectTrigger, { className: "w-40", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SelectValue, {}) }),
|
|
1555
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.SelectContent, { children: [
|
|
1556
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SelectItem, { value: "all", children: t("emailAutomations.recipients.status.all") }),
|
|
1557
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SelectItem, { value: "active", children: t("emailAutomations.recipients.status.active") }),
|
|
1558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SelectItem, { value: "completed", children: t("emailAutomations.recipients.status.completed") }),
|
|
1559
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SelectItem, { value: "unsubscribed", children: t("emailAutomations.recipients.status.unsubscribed") }),
|
|
1560
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SelectItem, { value: "exited", children: t("emailAutomations.recipients.status.exited") }),
|
|
1561
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SelectItem, { value: "failed", children: t("emailAutomations.recipients.status.failed") })
|
|
1562
1562
|
] })
|
|
1563
1563
|
] }),
|
|
1564
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1564
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.Button, { variant: "outline", size: "icon", onClick: () => void data.refresh(), disabled: !data.isLoaded, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: `h-4 w-4 ${!data.isLoaded ? "animate-spin" : ""}` }) })
|
|
1565
1565
|
] });
|
|
1566
1566
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-testid": "email-automation-recipients", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1567
|
-
|
|
1567
|
+
_chunkM7FA63QEjs.ContentListTable,
|
|
1568
1568
|
{
|
|
1569
1569
|
data,
|
|
1570
1570
|
fields: [
|
|
@@ -1593,7 +1593,7 @@ function EmailAutomationContainer({ automationId }) {
|
|
|
1593
1593
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationContainer, "EmailAutomationContainer");
|
|
1594
1594
|
function EmailAutomationShell() {
|
|
1595
1595
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1596
|
-
const generateUrl =
|
|
1596
|
+
const generateUrl = _chunkM7FA63QEjs.usePageUrlGenerator.call(void 0, );
|
|
1597
1597
|
const { automation, reload } = useEmailAutomation();
|
|
1598
1598
|
if (!automation) return null;
|
|
1599
1599
|
const breadcrumbs = [
|
|
@@ -1601,7 +1601,7 @@ function EmailAutomationShell() {
|
|
|
1601
1601
|
{ name: automation.name }
|
|
1602
1602
|
];
|
|
1603
1603
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1604
|
-
|
|
1604
|
+
_chunkM7FA63QEjs.SharedProvider,
|
|
1605
1605
|
{
|
|
1606
1606
|
value: {
|
|
1607
1607
|
breadcrumbs,
|
|
@@ -1615,7 +1615,7 @@ function EmailAutomationShell() {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
},
|
|
1617
1617
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1618
|
-
|
|
1618
|
+
_chunkM7FA63QEjs.RoundPageContainer,
|
|
1619
1619
|
{
|
|
1620
1620
|
module: _chunkZ6T2575Ajs.Modules.EmailAutomation,
|
|
1621
1621
|
id: automation.id,
|
|
@@ -1658,12 +1658,12 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1658
1658
|
async function unsubscribe() {
|
|
1659
1659
|
try {
|
|
1660
1660
|
if (source === "blast") {
|
|
1661
|
-
await
|
|
1661
|
+
await _chunk5XP5G45Bjs.EmailBlastDeliveryService.unsubscribe({ token });
|
|
1662
1662
|
setStoppedScope("all");
|
|
1663
1663
|
setState("success");
|
|
1664
1664
|
return;
|
|
1665
1665
|
}
|
|
1666
|
-
const enrollment = await
|
|
1666
|
+
const enrollment = await _chunk5XP5G45Bjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope });
|
|
1667
1667
|
setAutomationName(_nullishCoalesce(_optionalChain([enrollment, 'optionalAccess', _51 => _51.automation, 'optionalAccess', _52 => _52.name]), () => ( "")));
|
|
1668
1668
|
setIsServiceAutomation(_optionalChain([enrollment, 'optionalAccess', _53 => _53.automation, 'optionalAccess', _54 => _54.purpose]) === "service");
|
|
1669
1669
|
setStoppedScope(scope);
|
|
@@ -1678,7 +1678,7 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1678
1678
|
const stopAll = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1679
1679
|
setIsStoppingAll(true);
|
|
1680
1680
|
try {
|
|
1681
|
-
await
|
|
1681
|
+
await _chunk5XP5G45Bjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope: "all" });
|
|
1682
1682
|
setStoppedScope("all");
|
|
1683
1683
|
} catch (e3) {
|
|
1684
1684
|
setState("error");
|
|
@@ -1695,16 +1695,16 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1695
1695
|
if (state === "error") {
|
|
1696
1696
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1697
1697
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-destructive/10 rounded-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.XCircle, { className: "text-destructive h-12 w-12" }) }),
|
|
1698
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1698
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.invalidTitle") }),
|
|
1699
1699
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.invalidBody") })
|
|
1700
1700
|
] });
|
|
1701
1701
|
}
|
|
1702
1702
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1703
1703
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-primary/10 rounded-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CheckCircle, { className: "text-primary h-12 w-12" }) }),
|
|
1704
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1704
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.title") }),
|
|
1705
1705
|
stoppedScope === "all" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.stoppedAll") }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1706
1706
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.stoppedAutomation", { name: automationName }) }),
|
|
1707
|
-
!isServiceAutomation && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1707
|
+
!isServiceAutomation && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkM7FA63QEjs.Button, { variant: "secondary", onClick: stopAll, disabled: isStoppingAll, children: [
|
|
1708
1708
|
isStoppingAll && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
1709
1709
|
t("emailAutomations.unsubscribe.alsoStopAll")
|
|
1710
1710
|
] })
|
|
@@ -1719,7 +1719,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailUnsubscribe, "EmailUnsubscribe");
|
|
|
1719
1719
|
|
|
1720
1720
|
var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1721
1721
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1722
|
-
const generateUrl =
|
|
1722
|
+
const generateUrl = _chunkM7FA63QEjs.usePageUrlGenerator.call(void 0, );
|
|
1723
1723
|
const triggerLabels = _nullishCoalesce(_optionalChain([params, 'access', _55 => _55.context, 'optionalAccess', _56 => _56.triggerLabels]), () => ( {}));
|
|
1724
1724
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1725
1725
|
return params.data.map((automation) => {
|
|
@@ -1748,7 +1748,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1748
1748
|
header: t("emailAutomations.list.columns.name"),
|
|
1749
1749
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1750
1750
|
const automation = row.original.jsonApiData;
|
|
1751
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1751
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.Link, { href: generateUrl({ page: _chunkZ6T2575Ajs.Modules.EmailAutomation, id: automation.id }), children: automation.name });
|
|
1752
1752
|
}, "cell"),
|
|
1753
1753
|
enableSorting: false,
|
|
1754
1754
|
enableHiding: false
|
|
@@ -1759,7 +1759,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1759
1759
|
header: t("emailAutomations.list.columns.purpose"),
|
|
1760
1760
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1761
1761
|
const automation = row.original.jsonApiData;
|
|
1762
|
-
return automation.purpose === "service" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1762
|
+
return automation.purpose === "service" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.Badge, { variant: "softBlue", "data-testid": "email-automation-purpose-badge", children: t("emailPurpose.service") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.Badge, { variant: "softGray", "data-testid": "email-automation-purpose-badge", children: t("emailPurpose.marketing") });
|
|
1763
1763
|
}, "cell"),
|
|
1764
1764
|
enableSorting: false,
|
|
1765
1765
|
enableHiding: false
|
|
@@ -1782,7 +1782,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1782
1782
|
header: t("emailAutomations.list.columns.status"),
|
|
1783
1783
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1784
1784
|
const automation = row.original.jsonApiData;
|
|
1785
|
-
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1785
|
+
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.Badge, { variant: "softGreen", children: t("emailAutomations.list.status.on") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7FA63QEjs.Badge, { variant: "softGray", children: t("emailAutomations.list.status.off") });
|
|
1786
1786
|
}, "cell"),
|
|
1787
1787
|
enableSorting: false,
|
|
1788
1788
|
enableHiding: false
|
|
@@ -1805,7 +1805,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1805
1805
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
1806
1806
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1807
1807
|
}, "useEmailAutomationTableStructure");
|
|
1808
|
-
|
|
1808
|
+
_chunkM7FA63QEjs.registerTableGenerator.call(void 0, "email-automations", useEmailAutomationTableStructure);
|
|
1809
1809
|
|
|
1810
1810
|
// src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx
|
|
1811
1811
|
|
|
@@ -1862,7 +1862,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1862
1862
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1863
1863
|
const enrollment = row.original.jsonApiData;
|
|
1864
1864
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1865
|
-
|
|
1865
|
+
_chunkM7FA63QEjs.Badge,
|
|
1866
1866
|
{
|
|
1867
1867
|
variant: _nullishCoalesce(STATUS_VARIANTS[enrollment.status], () => ( "softGray")),
|
|
1868
1868
|
title: enrollment.status === "failed" ? enrollment.lastError : void 0,
|
|
@@ -1913,7 +1913,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1913
1913
|
}, [params.fields, fieldColumnMap, t, locale, now]);
|
|
1914
1914
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1915
1915
|
}, "useEmailAutomationEnrollmentTableStructure");
|
|
1916
|
-
|
|
1916
|
+
_chunkM7FA63QEjs.registerTableGenerator.call(void 0, "email-automation-enrollments", useEmailAutomationEnrollmentTableStructure);
|
|
1917
1917
|
|
|
1918
1918
|
|
|
1919
1919
|
|