@carlonicora/nextjs-jsonapi 6.10.1 → 6.11.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/{AbstractApiData-XLhBP5Tl.d.mts → AbstractApiData-CKy8tbde.d.mts} +6 -0
- package/dist/{AbstractApiData-DtitRWPz.d.ts → AbstractApiData-rgvs0cdY.d.ts} +6 -0
- package/dist/{BlockNoteEditor-GK3DRTOP.mjs → BlockNoteEditor-5WM5DX3J.mjs} +4 -4
- package/dist/{BlockNoteEditor-YOKJOVV3.js → BlockNoteEditor-GY5R25YI.js} +19 -19
- package/dist/{BlockNoteEditor-YOKJOVV3.js.map → BlockNoteEditor-GY5R25YI.js.map} +1 -1
- package/dist/{BlockNoteViewer-EKAWVLIR.js → BlockNoteViewer-FLUHEXE6.js} +3 -3
- package/dist/{BlockNoteViewer-EKAWVLIR.js.map → BlockNoteViewer-FLUHEXE6.js.map} +1 -1
- package/dist/{BlockNoteViewer-RWRI3QO2.mjs → BlockNoteViewer-UCA3LV3N.mjs} +2 -2
- package/dist/billing/index.js +491 -491
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-THZAK7S3.mjs → chunk-3PRLRCMF.mjs} +1281 -603
- package/dist/chunk-3PRLRCMF.mjs.map +1 -0
- package/dist/{chunk-AWLTSKMM.mjs → chunk-6RLATJ2L.mjs} +2 -2
- package/dist/{chunk-6HFRXEF5.mjs → chunk-BGLOFZ3K.mjs} +296 -6
- package/dist/chunk-BGLOFZ3K.mjs.map +1 -0
- package/dist/{chunk-KRQRJA4J.js → chunk-FNPXCYHO.js} +8 -8
- package/dist/{chunk-KRQRJA4J.js.map → chunk-FNPXCYHO.js.map} +1 -1
- package/dist/{chunk-4UFMLTL2.js → chunk-MP3DV2I5.js} +1647 -969
- package/dist/chunk-MP3DV2I5.js.map +1 -0
- package/dist/{chunk-RNZ3IK5J.js → chunk-OHJSI6L2.js} +4 -4
- package/dist/{chunk-RNZ3IK5J.js.map → chunk-OHJSI6L2.js.map} +1 -1
- package/dist/{chunk-SQTXJPRE.js → chunk-YGEOX2XX.js} +297 -7
- package/dist/chunk-YGEOX2XX.js.map +1 -0
- package/dist/{chunk-DPAM7BCE.mjs → chunk-YP6W4AB5.mjs} +2 -2
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +68 -30
- package/dist/components/index.d.ts +68 -30
- package/dist/components/index.js +10 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +160 -4
- package/dist/core/index.d.ts +160 -4
- package/dist/core/index.js +14 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +13 -1
- package/dist/email-automations/index.js +93 -93
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.d.mts +1 -1
- package/dist/features/analytics/index.d.ts +1 -1
- package/dist/features/analytics/index.js +120 -122
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/index.mjs +7 -9
- package/dist/features/analytics/index.mjs.map +1 -1
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/blog/index.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +16 -16
- 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.d.mts +1 -1
- package/dist/features/tokenusage/index.d.ts +1 -1
- package/dist/features/tokenusage/index.js +126 -128
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +14 -16
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -2
- package/dist/{HandbookSectionInterface-BPgqqwgw.d.mts → referral-admin.interface-C87ApGMR.d.mts} +42 -2
- package/dist/{HandbookSectionInterface-_51oA3om.d.ts → referral-admin.interface-CMwl5NiV.d.ts} +42 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/messages/en.json +78 -1
- package/messages/it.json +78 -1
- package/package.json +1 -1
- package/src/core/abstracts/AbstractApiData.ts +14 -3
- package/src/core/abstracts/__tests__/readIncludedWithMeta.spec.ts +103 -0
- package/src/core/index.ts +2 -0
- package/src/core/registry/ModuleRegistry.ts +5 -0
- package/src/features/referral/__tests__/referral-admin-models.spec.ts +122 -0
- package/src/features/referral/__tests__/referral-admin-service.spec.ts +70 -0
- package/src/features/referral/__tests__/referral-code-capture.spec.tsx +105 -0
- package/src/features/referral/__tests__/referral-invite-errors.spec.tsx +82 -0
- package/src/features/referral/__tests__/referral-visit-service.spec.ts +47 -0
- package/src/features/referral/__tests__/referrals-admin-container.spec.tsx +230 -0
- package/src/features/referral/components/ReferralCodeCapture.tsx +3 -0
- package/src/features/referral/components/ReferralDialog.tsx +9 -13
- package/src/features/referral/components/ReferralWidget.tsx +75 -45
- package/src/features/referral/components/ReferralsAdminFunnel.tsx +74 -0
- package/src/features/referral/components/ReferralsAdminTiles.tsx +128 -0
- package/src/features/referral/components/containers/ReferralsAdminContainer.tsx +205 -0
- package/src/features/referral/components/index.ts +3 -0
- package/src/features/referral/data/ReferralAdminReferral.ts +65 -0
- package/src/features/referral/data/ReferralAdminReferrer.ts +65 -0
- package/src/features/referral/data/ReferralAdminService.ts +51 -0
- package/src/features/referral/data/ReferralAdminSummary.ts +60 -0
- package/src/features/referral/data/ReferralService.ts +20 -0
- package/src/features/referral/data/ReferralVisit.ts +23 -0
- package/src/features/referral/data/index.ts +5 -0
- package/src/features/referral/hooks/index.ts +2 -0
- package/src/features/referral/hooks/useReferralAdminReferralTableStructure.tsx +127 -0
- package/src/features/referral/hooks/useReferralAdminReferrerTableStructure.tsx +229 -0
- package/src/features/referral/hooks/useReferralInvite.ts +2 -0
- package/src/features/referral/index.ts +1 -0
- package/src/features/referral/interfaces/index.ts +1 -0
- package/src/features/referral/interfaces/referral-admin.interface.ts +45 -0
- package/src/features/referral/referral-admin.modules.ts +32 -0
- package/dist/chunk-3TNGKMJU.mjs +0 -115
- package/dist/chunk-3TNGKMJU.mjs.map +0 -1
- package/dist/chunk-4UFMLTL2.js.map +0 -1
- package/dist/chunk-6HFRXEF5.mjs.map +0 -1
- package/dist/chunk-G3YKDIAL.js +0 -115
- package/dist/chunk-G3YKDIAL.js.map +0 -1
- package/dist/chunk-SQTXJPRE.js.map +0 -1
- package/dist/chunk-THZAK7S3.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-GK3DRTOP.mjs.map → BlockNoteEditor-5WM5DX3J.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-RWRI3QO2.mjs.map → BlockNoteViewer-UCA3LV3N.mjs.map} +0 -0
- /package/dist/{chunk-AWLTSKMM.mjs.map → chunk-6RLATJ2L.mjs.map} +0 -0
- /package/dist/{chunk-DPAM7BCE.mjs.map → chunk-YP6W4AB5.mjs.map} +0 -0
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
35
|
-
require('../chunk-
|
|
34
|
+
var _chunkMP3DV2I5js = require('../chunk-MP3DV2I5.js');
|
|
35
|
+
require('../chunk-FNPXCYHO.js');
|
|
36
36
|
require('../chunk-G4JR3SFV.js');
|
|
37
37
|
|
|
38
38
|
|
|
@@ -45,7 +45,7 @@ require('../chunk-G4JR3SFV.js');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkYGEOX2XXjs = require('../chunk-YGEOX2XX.js');
|
|
49
49
|
require('../chunk-GHE4VT2R.js');
|
|
50
50
|
require('../chunk-LXKSUWAV.js');
|
|
51
51
|
require('../chunk-JTPRJNT2.js');
|
|
@@ -81,12 +81,12 @@ function EmailAutomationEditorInternal({
|
|
|
81
81
|
onDialogOpenChange
|
|
82
82
|
}) {
|
|
83
83
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
84
|
-
const router =
|
|
84
|
+
const router = _chunkYGEOX2XXjs.useI18nRouter.call(void 0, );
|
|
85
85
|
const isEdit = !!automation;
|
|
86
86
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
87
87
|
_react.useEffect.call(void 0, () => {
|
|
88
88
|
let active = true;
|
|
89
|
-
|
|
89
|
+
_chunkYGEOX2XXjs.EmailAutomationService.findTriggers().then((list) => {
|
|
90
90
|
if (active) setTriggers(list);
|
|
91
91
|
}).catch(() => {
|
|
92
92
|
});
|
|
@@ -124,14 +124,14 @@ function EmailAutomationEditorInternal({
|
|
|
124
124
|
defaultValues: getDefaultValues()
|
|
125
125
|
});
|
|
126
126
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
127
|
-
|
|
127
|
+
_chunkMP3DV2I5js.EditorSheet,
|
|
128
128
|
{
|
|
129
129
|
form,
|
|
130
130
|
entityType: t("emailAutomations.admin.title"),
|
|
131
131
|
entityName: _optionalChain([automation, 'optionalAccess', _7 => _7.name]),
|
|
132
132
|
title: isEdit ? t("emailAutomations.admin.editAutomation") : t("emailAutomations.admin.newAutomation"),
|
|
133
133
|
isEdit,
|
|
134
|
-
module:
|
|
134
|
+
module: _chunkYGEOX2XXjs.Modules.EmailAutomation,
|
|
135
135
|
size: "md",
|
|
136
136
|
propagateChanges,
|
|
137
137
|
onSuccess,
|
|
@@ -145,7 +145,7 @@ function EmailAutomationEditorInternal({
|
|
|
145
145
|
replyTo: values.replyTo || void 0,
|
|
146
146
|
isActive: values.isActive
|
|
147
147
|
};
|
|
148
|
-
return isEdit ? await
|
|
148
|
+
return isEdit ? await _chunkYGEOX2XXjs.EmailAutomationService.update(payload) : await _chunkYGEOX2XXjs.EmailAutomationService.create(payload);
|
|
149
149
|
},
|
|
150
150
|
onReset: getDefaultValues,
|
|
151
151
|
trigger,
|
|
@@ -154,9 +154,9 @@ function EmailAutomationEditorInternal({
|
|
|
154
154
|
dialogOpen,
|
|
155
155
|
onDialogOpenChange,
|
|
156
156
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
157
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
157
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.FormInput, { form, id: "name", name: t("emailAutomations.fields.name.label"), isRequired: true }),
|
|
158
158
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
159
|
-
|
|
159
|
+
_chunkMP3DV2I5js.FormSelect,
|
|
160
160
|
{
|
|
161
161
|
form,
|
|
162
162
|
id: "trigger",
|
|
@@ -167,7 +167,7 @@ function EmailAutomationEditorInternal({
|
|
|
167
167
|
}
|
|
168
168
|
),
|
|
169
169
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
170
|
-
|
|
170
|
+
_chunkMP3DV2I5js.FormSelect,
|
|
171
171
|
{
|
|
172
172
|
form,
|
|
173
173
|
id: "exitTrigger",
|
|
@@ -177,9 +177,9 @@ function EmailAutomationEditorInternal({
|
|
|
177
177
|
allowEmpty: true
|
|
178
178
|
}
|
|
179
179
|
),
|
|
180
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
180
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.FormInput, { form, id: "replyTo", name: t("emailAutomations.fields.replyTo.label") }),
|
|
181
181
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
182
|
-
|
|
182
|
+
_chunkMP3DV2I5js.FormSwitch,
|
|
183
183
|
{
|
|
184
184
|
form,
|
|
185
185
|
id: "isActive",
|
|
@@ -203,14 +203,14 @@ var EmailAutomationEditor_default = EmailAutomationEditor;
|
|
|
203
203
|
function EmailAutomationsList({ fullWidth } = {}) {
|
|
204
204
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
205
205
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
206
|
-
const data =
|
|
207
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
206
|
+
const data = _chunkMP3DV2I5js.useDataListRetriever.call(void 0, {
|
|
207
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkYGEOX2XXjs.EmailAutomationService.findMany(params), "retriever"),
|
|
208
208
|
retrieverParams: {},
|
|
209
|
-
module:
|
|
209
|
+
module: _chunkYGEOX2XXjs.Modules.EmailAutomation
|
|
210
210
|
});
|
|
211
211
|
_react.useEffect.call(void 0, () => {
|
|
212
212
|
let active = true;
|
|
213
|
-
|
|
213
|
+
_chunkYGEOX2XXjs.EmailAutomationService.findTriggers().then((list) => {
|
|
214
214
|
if (active) setTriggers(list);
|
|
215
215
|
}).catch(() => {
|
|
216
216
|
});
|
|
@@ -224,7 +224,7 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
224
224
|
);
|
|
225
225
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationEditor_default, {}, "create-email-automation")];
|
|
226
226
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
227
|
-
|
|
227
|
+
_chunkMP3DV2I5js.ContentListTable,
|
|
228
228
|
{
|
|
229
229
|
data,
|
|
230
230
|
fields: [
|
|
@@ -236,12 +236,12 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
236
236
|
"completed" /* completed */,
|
|
237
237
|
"unsubscribed" /* unsubscribed */
|
|
238
238
|
],
|
|
239
|
-
tableGeneratorType:
|
|
239
|
+
tableGeneratorType: _chunkYGEOX2XXjs.Modules.EmailAutomation,
|
|
240
240
|
functions,
|
|
241
241
|
fullWidth,
|
|
242
242
|
title: t("emailAutomations.admin.title"),
|
|
243
243
|
context: { triggerLabels },
|
|
244
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
244
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.EmptyState, { icon: _lucidereact.MailIcon, title: t("emailAutomations.admin.empty") })
|
|
245
245
|
}
|
|
246
246
|
);
|
|
247
247
|
}
|
|
@@ -252,7 +252,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsList, "EmailAutomationsList
|
|
|
252
252
|
function EmailAutomationsListContainer() {
|
|
253
253
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
254
254
|
const breadcrumbs = [{ name: t("emailAutomations.admin.title") }];
|
|
255
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
255
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SharedProvider, { value: { breadcrumbs, title: { type: t("emailAutomations.admin.title") } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.RoundPageContainer, { module: _chunkYGEOX2XXjs.Modules.EmailAutomation, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationsList, { fullWidth: true }) }) });
|
|
256
256
|
}
|
|
257
257
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsListContainer, "EmailAutomationsListContainer");
|
|
258
258
|
|
|
@@ -271,8 +271,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
271
271
|
const [selectedStepId, setSelectedStepId] = _react.useState.call(void 0, null);
|
|
272
272
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
273
273
|
const [loadedAutomation, loadedSteps] = await Promise.all([
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
_chunkYGEOX2XXjs.EmailAutomationService.findOne({ id: automationId }),
|
|
275
|
+
_chunkYGEOX2XXjs.EmailAutomationStepService.findByAutomation({ automationId })
|
|
276
276
|
]);
|
|
277
277
|
setAutomation(loadedAutomation);
|
|
278
278
|
setSteps(loadedSteps);
|
|
@@ -282,7 +282,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
282
282
|
}, [reload]);
|
|
283
283
|
_react.useEffect.call(void 0, () => {
|
|
284
284
|
let active = true;
|
|
285
|
-
|
|
285
|
+
_chunkYGEOX2XXjs.EmailAutomationService.findTriggers().then((list) => {
|
|
286
286
|
if (active) setTriggers(list);
|
|
287
287
|
}).catch(() => {
|
|
288
288
|
});
|
|
@@ -293,7 +293,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
293
293
|
const select = _react.useCallback.call(void 0, (id) => setSelectedStepId(id), []);
|
|
294
294
|
const createStep = _react.useCallback.call(void 0,
|
|
295
295
|
async (input) => {
|
|
296
|
-
const saved = await
|
|
296
|
+
const saved = await _chunkYGEOX2XXjs.EmailAutomationStepService.create({ ...input, id: _nullishCoalesce(input.id, () => ( _uuid.v4.call(void 0, ))), automationId });
|
|
297
297
|
await reload();
|
|
298
298
|
return saved;
|
|
299
299
|
},
|
|
@@ -301,7 +301,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
301
301
|
);
|
|
302
302
|
const updateStep = _react.useCallback.call(void 0,
|
|
303
303
|
async (input) => {
|
|
304
|
-
const saved = await
|
|
304
|
+
const saved = await _chunkYGEOX2XXjs.EmailAutomationStepService.update({ ...input, automationId });
|
|
305
305
|
await reload();
|
|
306
306
|
return saved;
|
|
307
307
|
},
|
|
@@ -309,7 +309,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
309
309
|
);
|
|
310
310
|
const deleteStep = _react.useCallback.call(void 0,
|
|
311
311
|
async (id) => {
|
|
312
|
-
await
|
|
312
|
+
await _chunkYGEOX2XXjs.EmailAutomationStepService.delete({ id });
|
|
313
313
|
if (selectedStepId === id) setSelectedStepId(null);
|
|
314
314
|
await reload();
|
|
315
315
|
},
|
|
@@ -317,8 +317,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
317
317
|
);
|
|
318
318
|
const setNext = _react.useCallback.call(void 0,
|
|
319
319
|
async (stepId, nextStepId) => {
|
|
320
|
-
if (nextStepId) await
|
|
321
|
-
else await
|
|
320
|
+
if (nextStepId) await _chunkYGEOX2XXjs.EmailAutomationStepService.setNext({ stepId, nextStepId });
|
|
321
|
+
else await _chunkYGEOX2XXjs.EmailAutomationStepService.clearNext({ stepId });
|
|
322
322
|
await reload();
|
|
323
323
|
},
|
|
324
324
|
[reload]
|
|
@@ -327,7 +327,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
327
327
|
async (stepId, x, y) => {
|
|
328
328
|
const step = steps.find((candidate) => candidate.id === stepId);
|
|
329
329
|
if (!step) return;
|
|
330
|
-
await
|
|
330
|
+
await _chunkYGEOX2XXjs.EmailAutomationStepService.update({
|
|
331
331
|
id: step.id,
|
|
332
332
|
automationId,
|
|
333
333
|
subject: step.subject,
|
|
@@ -341,7 +341,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
341
341
|
[automationId, reload, steps]
|
|
342
342
|
);
|
|
343
343
|
const tidy = _react.useCallback.call(void 0, async () => {
|
|
344
|
-
await
|
|
344
|
+
await _chunkYGEOX2XXjs.EmailAutomationService.tidy({ id: automationId });
|
|
345
345
|
await reload();
|
|
346
346
|
}, [automationId, reload]);
|
|
347
347
|
const value = _react.useMemo.call(void 0,
|
|
@@ -396,7 +396,7 @@ function EmailAutomationActiveSwitch() {
|
|
|
396
396
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (checked) => {
|
|
397
397
|
setSaving(true);
|
|
398
398
|
try {
|
|
399
|
-
await
|
|
399
|
+
await _chunkYGEOX2XXjs.EmailAutomationService.update({
|
|
400
400
|
id: automation.id,
|
|
401
401
|
name: automation.name,
|
|
402
402
|
trigger: automation.trigger,
|
|
@@ -406,17 +406,17 @@ function EmailAutomationActiveSwitch() {
|
|
|
406
406
|
});
|
|
407
407
|
await reload();
|
|
408
408
|
} catch (error) {
|
|
409
|
-
|
|
409
|
+
_chunkMP3DV2I5js.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
410
410
|
} finally {
|
|
411
411
|
setSaving(false);
|
|
412
412
|
}
|
|
413
413
|
}, "toggle");
|
|
414
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
415
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
416
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
414
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Tooltip, { children: [
|
|
415
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "flex items-center gap-x-2" }), children: [
|
|
416
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Switch, { checked: automation.isActive, onCheckedChange: (checked) => void toggle(checked), disabled: saving }),
|
|
417
417
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs", children: t("emailAutomations.fields.isActive.label") })
|
|
418
418
|
] }),
|
|
419
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
419
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TooltipContent, { className: "max-w-xs", children: t("emailAutomations.fields.isActive.help") })
|
|
420
420
|
] });
|
|
421
421
|
}
|
|
422
422
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationActiveSwitch, "EmailAutomationActiveSwitch");
|
|
@@ -449,7 +449,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
449
449
|
const { zoomIn, zoomOut, fitView } = _react3.useReactFlow.call(void 0, );
|
|
450
450
|
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: [
|
|
451
451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
452
|
-
|
|
452
|
+
_chunkMP3DV2I5js.Button,
|
|
453
453
|
{
|
|
454
454
|
type: "button",
|
|
455
455
|
variant: "outline",
|
|
@@ -460,7 +460,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
460
460
|
}
|
|
461
461
|
),
|
|
462
462
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
463
|
-
|
|
463
|
+
_chunkMP3DV2I5js.Button,
|
|
464
464
|
{
|
|
465
465
|
type: "button",
|
|
466
466
|
variant: "outline",
|
|
@@ -471,7 +471,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
471
471
|
}
|
|
472
472
|
),
|
|
473
473
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
474
|
-
|
|
474
|
+
_chunkMP3DV2I5js.Button,
|
|
475
475
|
{
|
|
476
476
|
type: "button",
|
|
477
477
|
variant: "outline",
|
|
@@ -482,7 +482,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
482
482
|
}
|
|
483
483
|
),
|
|
484
484
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
485
|
-
|
|
485
|
+
_chunkMP3DV2I5js.Button,
|
|
486
486
|
{
|
|
487
487
|
type: "button",
|
|
488
488
|
variant: "outline",
|
|
@@ -773,14 +773,14 @@ function EmailStepEditorInternal({
|
|
|
773
773
|
defaultValues: getDefaultValues()
|
|
774
774
|
});
|
|
775
775
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
776
|
-
|
|
776
|
+
_chunkMP3DV2I5js.EditorSheet,
|
|
777
777
|
{
|
|
778
778
|
form,
|
|
779
779
|
entityType: t("emailAutomations.step.title"),
|
|
780
780
|
entityName: _optionalChain([step, 'optionalAccess', _18 => _18.subject]),
|
|
781
781
|
title: isEdit ? t("emailAutomations.step.editTitle") : t("emailAutomations.step.title"),
|
|
782
782
|
isEdit,
|
|
783
|
-
module:
|
|
783
|
+
module: _chunkYGEOX2XXjs.Modules.EmailAutomationStep,
|
|
784
784
|
size: "lg",
|
|
785
785
|
onSubmit: async (values) => {
|
|
786
786
|
const payload = {
|
|
@@ -792,7 +792,7 @@ function EmailStepEditorInternal({
|
|
|
792
792
|
positionX: step ? step.positionX : _optionalChain([initialPosition, 'optionalAccess', _19 => _19.x]),
|
|
793
793
|
positionY: step ? step.positionY : _optionalChain([initialPosition, 'optionalAccess', _20 => _20.y])
|
|
794
794
|
};
|
|
795
|
-
return isEdit ? await
|
|
795
|
+
return isEdit ? await _chunkYGEOX2XXjs.EmailAutomationStepService.update(payload) : await _chunkYGEOX2XXjs.EmailAutomationStepService.create(payload);
|
|
796
796
|
},
|
|
797
797
|
onSuccess: async () => {
|
|
798
798
|
await reload();
|
|
@@ -805,9 +805,9 @@ function EmailStepEditorInternal({
|
|
|
805
805
|
dialogOpen,
|
|
806
806
|
onDialogOpenChange,
|
|
807
807
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
808
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
808
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.FormInput, { form, id: "subject", name: t("emailAutomations.step.fields.subject.label"), isRequired: true }),
|
|
809
809
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
810
|
-
|
|
810
|
+
_chunkMP3DV2I5js.FormInput,
|
|
811
811
|
{
|
|
812
812
|
form,
|
|
813
813
|
id: "delayHours",
|
|
@@ -817,7 +817,7 @@ function EmailStepEditorInternal({
|
|
|
817
817
|
}
|
|
818
818
|
),
|
|
819
819
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
820
|
-
|
|
820
|
+
_chunkMP3DV2I5js.FormTextarea,
|
|
821
821
|
{
|
|
822
822
|
form,
|
|
823
823
|
id: "body",
|
|
@@ -957,7 +957,7 @@ var stepIdOf = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (nodeId) =>
|
|
|
957
957
|
function EmailAutomationCanvas() {
|
|
958
958
|
const { automation, steps, triggers, select, reload, createStep, deleteStep, setNext, updatePosition, tidy } = useEmailAutomation();
|
|
959
959
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
960
|
-
const isMobile =
|
|
960
|
+
const isMobile = _chunkYGEOX2XXjs.useIsMobile.call(void 0, );
|
|
961
961
|
const [nodes, setNodes] = _react.useState.call(void 0, []);
|
|
962
962
|
const [edges, setEdges] = _react.useState.call(void 0, []);
|
|
963
963
|
const { screenToFlowPosition } = _react3.useReactFlow.call(void 0, );
|
|
@@ -996,7 +996,7 @@ function EmailAutomationCanvas() {
|
|
|
996
996
|
try {
|
|
997
997
|
await setNext(stepId, nextStepId);
|
|
998
998
|
} catch (error) {
|
|
999
|
-
|
|
999
|
+
_chunkMP3DV2I5js.errorToast.call(void 0, { title: t("emailAutomations.canvas.chainError"), error });
|
|
1000
1000
|
await reload();
|
|
1001
1001
|
}
|
|
1002
1002
|
},
|
|
@@ -1010,7 +1010,7 @@ function EmailAutomationCanvas() {
|
|
|
1010
1010
|
if (!_optionalChain([conn, 'access', _29 => _29.targetHandle, 'optionalAccess', _30 => _30.startsWith, 'call', _31 => _31(STEP_TARGET_HANDLE_PREFIX)])) return;
|
|
1011
1011
|
const targetStepId = conn.targetHandle.slice(STEP_TARGET_HANDLE_PREFIX.length);
|
|
1012
1012
|
if (from.handleId === TRIGGER_SOURCE_HANDLE) {
|
|
1013
|
-
|
|
1013
|
+
_chunkYGEOX2XXjs.showError.call(void 0, t("emailAutomations.canvas.chainError"));
|
|
1014
1014
|
return;
|
|
1015
1015
|
}
|
|
1016
1016
|
if (!from.handleId.startsWith(STEP_SOURCE_HANDLE_PREFIX)) return;
|
|
@@ -1128,7 +1128,7 @@ function EmailAutomationCanvas() {
|
|
|
1128
1128
|
try {
|
|
1129
1129
|
await deleteStep(stepId);
|
|
1130
1130
|
} catch (error) {
|
|
1131
|
-
|
|
1131
|
+
_chunkMP3DV2I5js.errorToast.call(void 0, { title: t("emailAutomations.canvas.deleteEmail"), error });
|
|
1132
1132
|
throw error;
|
|
1133
1133
|
}
|
|
1134
1134
|
}, [pendingDeleteStepId, deleteStep, t]);
|
|
@@ -1191,7 +1191,7 @@ function EmailAutomationCanvas() {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
),
|
|
1193
1193
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1194
|
-
|
|
1194
|
+
_chunkMP3DV2I5js.ConfirmDialog,
|
|
1195
1195
|
{
|
|
1196
1196
|
open: pendingDeleteStepId !== null,
|
|
1197
1197
|
onOpenChange: (open) => {
|
|
@@ -1206,20 +1206,20 @@ function EmailAutomationCanvas() {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
),
|
|
1208
1208
|
paneMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1209
|
-
|
|
1209
|
+
_chunkMP3DV2I5js.ContextMenu,
|
|
1210
1210
|
{
|
|
1211
1211
|
open: true,
|
|
1212
1212
|
onOpenChange: (open) => {
|
|
1213
1213
|
if (!open) setPaneMenu(null);
|
|
1214
1214
|
},
|
|
1215
1215
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1216
|
-
|
|
1216
|
+
_chunkMP3DV2I5js.ContextMenuContent,
|
|
1217
1217
|
{
|
|
1218
1218
|
anchor: pointAnchor(paneMenu.screenX, paneMenu.screenY),
|
|
1219
1219
|
side: "bottom",
|
|
1220
1220
|
align: "start",
|
|
1221
1221
|
sideOffset: 4,
|
|
1222
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1222
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.ContextMenuItem, { onClick: handleCreateStepFromPane, children: [
|
|
1223
1223
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PlusIcon, {}),
|
|
1224
1224
|
t("emailAutomations.canvas.addEmail")
|
|
1225
1225
|
] })
|
|
@@ -1228,21 +1228,21 @@ function EmailAutomationCanvas() {
|
|
|
1228
1228
|
}
|
|
1229
1229
|
),
|
|
1230
1230
|
nodeMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1231
|
-
|
|
1231
|
+
_chunkMP3DV2I5js.ContextMenu,
|
|
1232
1232
|
{
|
|
1233
1233
|
open: true,
|
|
1234
1234
|
onOpenChange: (open) => {
|
|
1235
1235
|
if (!open) setNodeMenu(null);
|
|
1236
1236
|
},
|
|
1237
1237
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1238
|
-
|
|
1238
|
+
_chunkMP3DV2I5js.ContextMenuContent,
|
|
1239
1239
|
{
|
|
1240
1240
|
anchor: pointAnchor(nodeMenu.screenX, nodeMenu.screenY),
|
|
1241
1241
|
side: "bottom",
|
|
1242
1242
|
align: "start",
|
|
1243
1243
|
sideOffset: 4,
|
|
1244
1244
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1245
|
-
|
|
1245
|
+
_chunkMP3DV2I5js.ContextMenuItem,
|
|
1246
1246
|
{
|
|
1247
1247
|
onClick: () => {
|
|
1248
1248
|
const menu = nodeMenu;
|
|
@@ -1283,7 +1283,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, TriggerAutomationEditor, "TriggerAutomation
|
|
|
1283
1283
|
// src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx
|
|
1284
1284
|
|
|
1285
1285
|
function EmailAutomationCanvasTab() {
|
|
1286
|
-
const { open, setOpen } =
|
|
1286
|
+
const { open, setOpen } = _chunkMP3DV2I5js.useSidebar.call(void 0, );
|
|
1287
1287
|
_react.useEffect.call(void 0, () => {
|
|
1288
1288
|
const prev = open;
|
|
1289
1289
|
if (prev) setOpen(false);
|
|
@@ -1304,10 +1304,10 @@ function EmailAutomationRecipientsList() {
|
|
|
1304
1304
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1305
1305
|
const { automation } = useEmailAutomation();
|
|
1306
1306
|
const [statusFilter, setStatusFilter] = _react.useState.call(void 0, "all");
|
|
1307
|
-
const data =
|
|
1308
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1307
|
+
const data = _chunkMP3DV2I5js.useDataListRetriever.call(void 0, {
|
|
1308
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkYGEOX2XXjs.EmailAutomationService.findEnrollments(params), "retriever"),
|
|
1309
1309
|
retrieverParams: { automationId: _optionalChain([automation, 'optionalAccess', _44 => _44.id]) },
|
|
1310
|
-
module:
|
|
1310
|
+
module: _chunkYGEOX2XXjs.Modules.EmailAutomationEnrollment
|
|
1311
1311
|
});
|
|
1312
1312
|
const handleStatusChange = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => {
|
|
1313
1313
|
const status = _nullishCoalesce(value, () => ( "all"));
|
|
@@ -1326,21 +1326,21 @@ function EmailAutomationRecipientsList() {
|
|
|
1326
1326
|
[t]
|
|
1327
1327
|
);
|
|
1328
1328
|
const filters = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4", children: [
|
|
1329
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1331
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1332
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1333
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1334
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1336
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1337
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1329
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Select, { items: statusItems, value: statusFilter, onValueChange: handleStatusChange, children: [
|
|
1330
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectTrigger, { className: "w-40", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectValue, {}) }),
|
|
1331
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.SelectContent, { children: [
|
|
1332
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectItem, { value: "all", children: t("emailAutomations.recipients.status.all") }),
|
|
1333
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectItem, { value: "active", children: t("emailAutomations.recipients.status.active") }),
|
|
1334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectItem, { value: "completed", children: t("emailAutomations.recipients.status.completed") }),
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectItem, { value: "unsubscribed", children: t("emailAutomations.recipients.status.unsubscribed") }),
|
|
1336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectItem, { value: "exited", children: t("emailAutomations.recipients.status.exited") }),
|
|
1337
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectItem, { value: "failed", children: t("emailAutomations.recipients.status.failed") })
|
|
1338
1338
|
] })
|
|
1339
1339
|
] }),
|
|
1340
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.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" : ""}` }) })
|
|
1341
1341
|
] });
|
|
1342
1342
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1343
|
-
|
|
1343
|
+
_chunkMP3DV2I5js.ContentListTable,
|
|
1344
1344
|
{
|
|
1345
1345
|
data,
|
|
1346
1346
|
fields: [
|
|
@@ -1351,7 +1351,7 @@ function EmailAutomationRecipientsList() {
|
|
|
1351
1351
|
"nextSendAt" /* nextSendAt */,
|
|
1352
1352
|
"sentCount" /* sentCount */
|
|
1353
1353
|
],
|
|
1354
|
-
tableGeneratorType:
|
|
1354
|
+
tableGeneratorType: _chunkYGEOX2XXjs.Modules.EmailAutomationEnrollment,
|
|
1355
1355
|
filters,
|
|
1356
1356
|
allowSearch: false,
|
|
1357
1357
|
emptyState: t("emailAutomations.recipients.empty")
|
|
@@ -1368,15 +1368,15 @@ function EmailAutomationContainer({ automationId }) {
|
|
|
1368
1368
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationContainer, "EmailAutomationContainer");
|
|
1369
1369
|
function EmailAutomationShell() {
|
|
1370
1370
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1371
|
-
const generateUrl =
|
|
1371
|
+
const generateUrl = _chunkMP3DV2I5js.usePageUrlGenerator.call(void 0, );
|
|
1372
1372
|
const { automation, reload } = useEmailAutomation();
|
|
1373
1373
|
if (!automation) return null;
|
|
1374
1374
|
const breadcrumbs = [
|
|
1375
|
-
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page:
|
|
1375
|
+
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page: _chunkYGEOX2XXjs.Modules.EmailAutomation }) },
|
|
1376
1376
|
{ name: automation.name }
|
|
1377
1377
|
];
|
|
1378
1378
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1379
|
-
|
|
1379
|
+
_chunkMP3DV2I5js.SharedProvider,
|
|
1380
1380
|
{
|
|
1381
1381
|
value: {
|
|
1382
1382
|
breadcrumbs,
|
|
@@ -1390,9 +1390,9 @@ function EmailAutomationShell() {
|
|
|
1390
1390
|
}
|
|
1391
1391
|
},
|
|
1392
1392
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1393
|
-
|
|
1393
|
+
_chunkMP3DV2I5js.RoundPageContainer,
|
|
1394
1394
|
{
|
|
1395
|
-
module:
|
|
1395
|
+
module: _chunkYGEOX2XXjs.Modules.EmailAutomation,
|
|
1396
1396
|
id: automation.id,
|
|
1397
1397
|
fullWidth: true,
|
|
1398
1398
|
forceHeader: true,
|
|
@@ -1432,12 +1432,12 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1432
1432
|
async function unsubscribe() {
|
|
1433
1433
|
try {
|
|
1434
1434
|
if (source === "blast") {
|
|
1435
|
-
await
|
|
1435
|
+
await _chunkYGEOX2XXjs.EmailBlastDeliveryService.unsubscribe({ token });
|
|
1436
1436
|
setStoppedScope("all");
|
|
1437
1437
|
setState("success");
|
|
1438
1438
|
return;
|
|
1439
1439
|
}
|
|
1440
|
-
const enrollment = await
|
|
1440
|
+
const enrollment = await _chunkYGEOX2XXjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope });
|
|
1441
1441
|
setAutomationName(_nullishCoalesce(_optionalChain([enrollment, 'optionalAccess', _45 => _45.automation, 'optionalAccess', _46 => _46.name]), () => ( "")));
|
|
1442
1442
|
setStoppedScope(scope);
|
|
1443
1443
|
setState("success");
|
|
@@ -1451,7 +1451,7 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1451
1451
|
const stopAll = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1452
1452
|
setIsStoppingAll(true);
|
|
1453
1453
|
try {
|
|
1454
|
-
await
|
|
1454
|
+
await _chunkYGEOX2XXjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope: "all" });
|
|
1455
1455
|
setStoppedScope("all");
|
|
1456
1456
|
} catch (e3) {
|
|
1457
1457
|
setState("error");
|
|
@@ -1468,16 +1468,16 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1468
1468
|
if (state === "error") {
|
|
1469
1469
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1470
1470
|
/* @__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" }) }),
|
|
1471
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1471
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.invalidTitle") }),
|
|
1472
1472
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.invalidBody") })
|
|
1473
1473
|
] });
|
|
1474
1474
|
}
|
|
1475
1475
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1476
1476
|
/* @__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" }) }),
|
|
1477
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1477
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.title") }),
|
|
1478
1478
|
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: [
|
|
1479
1479
|
/* @__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 }) }),
|
|
1480
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1480
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Button, { variant: "secondary", onClick: stopAll, disabled: isStoppingAll, children: [
|
|
1481
1481
|
isStoppingAll && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
1482
1482
|
t("emailAutomations.unsubscribe.alsoStopAll")
|
|
1483
1483
|
] })
|
|
@@ -1492,7 +1492,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailUnsubscribe, "EmailUnsubscribe");
|
|
|
1492
1492
|
|
|
1493
1493
|
var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1494
1494
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1495
|
-
const generateUrl =
|
|
1495
|
+
const generateUrl = _chunkMP3DV2I5js.usePageUrlGenerator.call(void 0, );
|
|
1496
1496
|
const triggerLabels = _nullishCoalesce(_optionalChain([params, 'access', _47 => _47.context, 'optionalAccess', _48 => _48.triggerLabels]), () => ( {}));
|
|
1497
1497
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1498
1498
|
return params.data.map((automation) => {
|
|
@@ -1521,7 +1521,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1521
1521
|
header: t("emailAutomations.list.columns.name"),
|
|
1522
1522
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1523
1523
|
const automation = row.original.jsonApiData;
|
|
1524
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1524
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Link, { href: generateUrl({ page: _chunkYGEOX2XXjs.Modules.EmailAutomation, id: automation.id }), children: automation.name });
|
|
1525
1525
|
}, "cell"),
|
|
1526
1526
|
enableSorting: false,
|
|
1527
1527
|
enableHiding: false
|
|
@@ -1544,7 +1544,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1544
1544
|
header: t("emailAutomations.list.columns.status"),
|
|
1545
1545
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1546
1546
|
const automation = row.original.jsonApiData;
|
|
1547
|
-
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1547
|
+
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Badge, { variant: "softGreen", children: t("emailAutomations.list.status.on") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Badge, { variant: "softGray", children: t("emailAutomations.list.status.off") });
|
|
1548
1548
|
}, "cell"),
|
|
1549
1549
|
enableSorting: false,
|
|
1550
1550
|
enableHiding: false
|
|
@@ -1567,7 +1567,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1567
1567
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
1568
1568
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1569
1569
|
}, "useEmailAutomationTableStructure");
|
|
1570
|
-
|
|
1570
|
+
_chunkMP3DV2I5js.registerTableGenerator.call(void 0, "email-automations", useEmailAutomationTableStructure);
|
|
1571
1571
|
|
|
1572
1572
|
// src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx
|
|
1573
1573
|
|
|
@@ -1582,7 +1582,7 @@ var STATUS_VARIANTS = {
|
|
|
1582
1582
|
};
|
|
1583
1583
|
var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1584
1584
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1585
|
-
const locale =
|
|
1585
|
+
const locale = _chunkYGEOX2XXjs.dateFormatLocale.call(void 0, _nextintl.useLocale.call(void 0, ));
|
|
1586
1586
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1587
1587
|
return params.data.map((enrollment) => {
|
|
1588
1588
|
const entry = { jsonApiData: enrollment };
|
|
@@ -1623,7 +1623,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1623
1623
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1624
1624
|
const enrollment = row.original.jsonApiData;
|
|
1625
1625
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1626
|
-
|
|
1626
|
+
_chunkMP3DV2I5js.Badge,
|
|
1627
1627
|
{
|
|
1628
1628
|
variant: _nullishCoalesce(STATUS_VARIANTS[enrollment.status], () => ( "softGray")),
|
|
1629
1629
|
title: enrollment.status === "failed" ? enrollment.lastError : void 0,
|
|
@@ -1652,7 +1652,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1652
1652
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1653
1653
|
const enrollment = row.original.jsonApiData;
|
|
1654
1654
|
if (!enrollment.nextSendAt) return empty;
|
|
1655
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children:
|
|
1655
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children: _chunkYGEOX2XXjs.formatDate.call(void 0, enrollment.nextSendAt, "dateTime", locale) });
|
|
1656
1656
|
}, "cell"),
|
|
1657
1657
|
enableSorting: false,
|
|
1658
1658
|
enableHiding: false
|
|
@@ -1674,7 +1674,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1674
1674
|
}, [params.fields, fieldColumnMap, t, locale]);
|
|
1675
1675
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1676
1676
|
}, "useEmailAutomationEnrollmentTableStructure");
|
|
1677
|
-
|
|
1677
|
+
_chunkMP3DV2I5js.registerTableGenerator.call(void 0, "email-automation-enrollments", useEmailAutomationEnrollmentTableStructure);
|
|
1678
1678
|
|
|
1679
1679
|
|
|
1680
1680
|
|