@carlonicora/nextjs-jsonapi 6.0.0 → 6.2.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-FZNU4YQT.mjs → BlockNoteEditor-D6VMXRZH.mjs} +4 -4
- package/dist/{BlockNoteEditor-SAU3G6H7.js → BlockNoteEditor-Q757ZLCO.js} +19 -19
- package/dist/{BlockNoteEditor-SAU3G6H7.js.map → BlockNoteEditor-Q757ZLCO.js.map} +1 -1
- package/dist/{BlockNoteViewer-6XDDVTN6.mjs → BlockNoteViewer-GI5LVQHZ.mjs} +2 -2
- package/dist/{BlockNoteViewer-7BTV7QQA.js → BlockNoteViewer-KG4CIJC5.js} +3 -3
- package/dist/{BlockNoteViewer-7BTV7QQA.js.map → BlockNoteViewer-KG4CIJC5.js.map} +1 -1
- package/dist/billing/index.js +491 -491
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-F4JB7YAP.js → chunk-3P3IYUWQ.js} +8 -8
- package/dist/{chunk-F4JB7YAP.js.map → chunk-3P3IYUWQ.js.map} +1 -1
- package/dist/{chunk-U7DR5VDT.mjs → chunk-6PW3562E.mjs} +5 -5
- package/dist/{chunk-JVJS5RHB.mjs → chunk-CUNSPLOD.mjs} +2 -2
- package/dist/{chunk-T3YQ47EF.js → chunk-GSHMGL6N.js} +2 -1
- package/dist/chunk-GSHMGL6N.js.map +1 -0
- package/dist/{chunk-GFGKMUPZ.mjs → chunk-HLW3SUMD.mjs} +2 -2
- package/dist/{chunk-RYZYKG6W.mjs → chunk-MHBE4KQR.mjs} +2 -2
- package/dist/{chunk-USYZNWKS.mjs → chunk-QKDPCZ3G.mjs} +2 -1
- package/dist/{chunk-USYZNWKS.mjs.map → chunk-QKDPCZ3G.mjs.map} +1 -1
- package/dist/{chunk-TPZS46IM.js → chunk-S332ZCIE.js} +3 -3
- package/dist/{chunk-TPZS46IM.js.map → chunk-S332ZCIE.js.map} +1 -1
- package/dist/{chunk-MTI2UXDA.js → chunk-UEWDYVLW.js} +4 -4
- package/dist/{chunk-MTI2UXDA.js.map → chunk-UEWDYVLW.js.map} +1 -1
- package/dist/{chunk-IPYXT7MH.js → chunk-XQEYBESH.js} +868 -868
- package/dist/{chunk-IPYXT7MH.js.map → chunk-XQEYBESH.js.map} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- 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 +92 -92
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.d.mts +9 -1
- package/dist/features/analytics/index.d.ts +9 -1
- package/dist/features/analytics/index.js +129 -127
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/index.mjs +12 -10
- 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.js +158 -125
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +38 -5
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/messages/en.json +23 -0
- package/messages/it.json +23 -0
- package/package.json +1 -1
- package/scripts/validate-messages.mjs +4 -1
- package/src/features/analytics/components/AnalyticsTracker.tsx +22 -9
- package/src/features/analytics/components/__tests__/AnalyticsTracker.spec.tsx +67 -0
- package/src/features/analytics/data/__tests__/models.spec.ts +13 -0
- package/src/features/analytics/data/analytics-event.ts +1 -0
- package/src/features/analytics/data/analytics.types.ts +2 -0
- package/src/features/tokenusage/components/TokenUsageRankedBar.tsx +34 -2
- package/src/features/tokenusage/components/__tests__/TokenUsageRankedBar.spec.tsx +22 -0
- package/src/features/tokenusage/lib/operation-label.ts +20 -0
- package/dist/chunk-T3YQ47EF.js.map +0 -1
- /package/dist/{BlockNoteEditor-FZNU4YQT.mjs.map → BlockNoteEditor-D6VMXRZH.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-6XDDVTN6.mjs.map → BlockNoteViewer-GI5LVQHZ.mjs.map} +0 -0
- /package/dist/{chunk-U7DR5VDT.mjs.map → chunk-6PW3562E.mjs.map} +0 -0
- /package/dist/{chunk-JVJS5RHB.mjs.map → chunk-CUNSPLOD.mjs.map} +0 -0
- /package/dist/{chunk-GFGKMUPZ.mjs.map → chunk-HLW3SUMD.mjs.map} +0 -0
- /package/dist/{chunk-RYZYKG6W.mjs.map → chunk-MHBE4KQR.mjs.map} +0 -0
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
35
|
-
require('../chunk-
|
|
34
|
+
var _chunkXQEYBESHjs = require('../chunk-XQEYBESH.js');
|
|
35
|
+
require('../chunk-3P3IYUWQ.js');
|
|
36
36
|
require('../chunk-G4JR3SFV.js');
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,7 +44,7 @@ require('../chunk-G4JR3SFV.js');
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var _chunkGSHMGL6Njs = require('../chunk-GSHMGL6N.js');
|
|
48
48
|
require('../chunk-GHE4VT2R.js');
|
|
49
49
|
require('../chunk-LXKSUWAV.js');
|
|
50
50
|
require('../chunk-JTPRJNT2.js');
|
|
@@ -80,12 +80,12 @@ function EmailAutomationEditorInternal({
|
|
|
80
80
|
onDialogOpenChange
|
|
81
81
|
}) {
|
|
82
82
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
83
|
-
const router =
|
|
83
|
+
const router = _chunkGSHMGL6Njs.useI18nRouter.call(void 0, );
|
|
84
84
|
const isEdit = !!automation;
|
|
85
85
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
86
86
|
_react.useEffect.call(void 0, () => {
|
|
87
87
|
let active = true;
|
|
88
|
-
|
|
88
|
+
_chunkGSHMGL6Njs.EmailAutomationService.findTriggers().then((list) => {
|
|
89
89
|
if (active) setTriggers(list);
|
|
90
90
|
}).catch(() => {
|
|
91
91
|
});
|
|
@@ -123,14 +123,14 @@ function EmailAutomationEditorInternal({
|
|
|
123
123
|
defaultValues: getDefaultValues()
|
|
124
124
|
});
|
|
125
125
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
126
|
-
|
|
126
|
+
_chunkXQEYBESHjs.EditorSheet,
|
|
127
127
|
{
|
|
128
128
|
form,
|
|
129
129
|
entityType: t("emailAutomations.admin.title"),
|
|
130
130
|
entityName: _optionalChain([automation, 'optionalAccess', _7 => _7.name]),
|
|
131
131
|
title: isEdit ? t("emailAutomations.admin.editAutomation") : t("emailAutomations.admin.newAutomation"),
|
|
132
132
|
isEdit,
|
|
133
|
-
module:
|
|
133
|
+
module: _chunkGSHMGL6Njs.Modules.EmailAutomation,
|
|
134
134
|
size: "md",
|
|
135
135
|
propagateChanges,
|
|
136
136
|
onSuccess,
|
|
@@ -144,7 +144,7 @@ function EmailAutomationEditorInternal({
|
|
|
144
144
|
replyTo: values.replyTo || void 0,
|
|
145
145
|
isActive: values.isActive
|
|
146
146
|
};
|
|
147
|
-
return isEdit ? await
|
|
147
|
+
return isEdit ? await _chunkGSHMGL6Njs.EmailAutomationService.update(payload) : await _chunkGSHMGL6Njs.EmailAutomationService.create(payload);
|
|
148
148
|
},
|
|
149
149
|
onReset: getDefaultValues,
|
|
150
150
|
trigger,
|
|
@@ -153,9 +153,9 @@ function EmailAutomationEditorInternal({
|
|
|
153
153
|
dialogOpen,
|
|
154
154
|
onDialogOpenChange,
|
|
155
155
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
156
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
156
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.FormInput, { form, id: "name", name: t("emailAutomations.fields.name.label"), isRequired: true }),
|
|
157
157
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
158
|
-
|
|
158
|
+
_chunkXQEYBESHjs.FormSelect,
|
|
159
159
|
{
|
|
160
160
|
form,
|
|
161
161
|
id: "trigger",
|
|
@@ -166,7 +166,7 @@ function EmailAutomationEditorInternal({
|
|
|
166
166
|
}
|
|
167
167
|
),
|
|
168
168
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
169
|
-
|
|
169
|
+
_chunkXQEYBESHjs.FormSelect,
|
|
170
170
|
{
|
|
171
171
|
form,
|
|
172
172
|
id: "exitTrigger",
|
|
@@ -176,9 +176,9 @@ function EmailAutomationEditorInternal({
|
|
|
176
176
|
allowEmpty: true
|
|
177
177
|
}
|
|
178
178
|
),
|
|
179
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
179
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.FormInput, { form, id: "replyTo", name: t("emailAutomations.fields.replyTo.label") }),
|
|
180
180
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
181
|
-
|
|
181
|
+
_chunkXQEYBESHjs.FormSwitch,
|
|
182
182
|
{
|
|
183
183
|
form,
|
|
184
184
|
id: "isActive",
|
|
@@ -202,14 +202,14 @@ var EmailAutomationEditor_default = EmailAutomationEditor;
|
|
|
202
202
|
function EmailAutomationsList({ fullWidth } = {}) {
|
|
203
203
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
204
204
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
205
|
-
const data =
|
|
206
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
205
|
+
const data = _chunkXQEYBESHjs.useDataListRetriever.call(void 0, {
|
|
206
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkGSHMGL6Njs.EmailAutomationService.findMany(params), "retriever"),
|
|
207
207
|
retrieverParams: {},
|
|
208
|
-
module:
|
|
208
|
+
module: _chunkGSHMGL6Njs.Modules.EmailAutomation
|
|
209
209
|
});
|
|
210
210
|
_react.useEffect.call(void 0, () => {
|
|
211
211
|
let active = true;
|
|
212
|
-
|
|
212
|
+
_chunkGSHMGL6Njs.EmailAutomationService.findTriggers().then((list) => {
|
|
213
213
|
if (active) setTriggers(list);
|
|
214
214
|
}).catch(() => {
|
|
215
215
|
});
|
|
@@ -223,7 +223,7 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
223
223
|
);
|
|
224
224
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationEditor_default, {}, "create-email-automation")];
|
|
225
225
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
226
|
-
|
|
226
|
+
_chunkXQEYBESHjs.ContentListTable,
|
|
227
227
|
{
|
|
228
228
|
data,
|
|
229
229
|
fields: [
|
|
@@ -235,12 +235,12 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
235
235
|
"completed" /* completed */,
|
|
236
236
|
"unsubscribed" /* unsubscribed */
|
|
237
237
|
],
|
|
238
|
-
tableGeneratorType:
|
|
238
|
+
tableGeneratorType: _chunkGSHMGL6Njs.Modules.EmailAutomation,
|
|
239
239
|
functions,
|
|
240
240
|
fullWidth,
|
|
241
241
|
title: t("emailAutomations.admin.title"),
|
|
242
242
|
context: { triggerLabels },
|
|
243
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
243
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.EmptyState, { icon: _lucidereact.MailIcon, title: t("emailAutomations.admin.empty") })
|
|
244
244
|
}
|
|
245
245
|
);
|
|
246
246
|
}
|
|
@@ -251,7 +251,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsList, "EmailAutomationsList
|
|
|
251
251
|
function EmailAutomationsListContainer() {
|
|
252
252
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
253
253
|
const breadcrumbs = [{ name: t("emailAutomations.admin.title") }];
|
|
254
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
254
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SharedProvider, { value: { breadcrumbs, title: { type: t("emailAutomations.admin.title") } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.RoundPageContainer, { module: _chunkGSHMGL6Njs.Modules.EmailAutomation, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationsList, { fullWidth: true }) }) });
|
|
255
255
|
}
|
|
256
256
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsListContainer, "EmailAutomationsListContainer");
|
|
257
257
|
|
|
@@ -270,8 +270,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
270
270
|
const [selectedStepId, setSelectedStepId] = _react.useState.call(void 0, null);
|
|
271
271
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
272
272
|
const [loadedAutomation, loadedSteps] = await Promise.all([
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
_chunkGSHMGL6Njs.EmailAutomationService.findOne({ id: automationId }),
|
|
274
|
+
_chunkGSHMGL6Njs.EmailAutomationStepService.findByAutomation({ automationId })
|
|
275
275
|
]);
|
|
276
276
|
setAutomation(loadedAutomation);
|
|
277
277
|
setSteps(loadedSteps);
|
|
@@ -281,7 +281,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
281
281
|
}, [reload]);
|
|
282
282
|
_react.useEffect.call(void 0, () => {
|
|
283
283
|
let active = true;
|
|
284
|
-
|
|
284
|
+
_chunkGSHMGL6Njs.EmailAutomationService.findTriggers().then((list) => {
|
|
285
285
|
if (active) setTriggers(list);
|
|
286
286
|
}).catch(() => {
|
|
287
287
|
});
|
|
@@ -292,7 +292,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
292
292
|
const select = _react.useCallback.call(void 0, (id) => setSelectedStepId(id), []);
|
|
293
293
|
const createStep = _react.useCallback.call(void 0,
|
|
294
294
|
async (input) => {
|
|
295
|
-
const saved = await
|
|
295
|
+
const saved = await _chunkGSHMGL6Njs.EmailAutomationStepService.create({ ...input, id: _nullishCoalesce(input.id, () => ( _uuid.v4.call(void 0, ))), automationId });
|
|
296
296
|
await reload();
|
|
297
297
|
return saved;
|
|
298
298
|
},
|
|
@@ -300,7 +300,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
300
300
|
);
|
|
301
301
|
const updateStep = _react.useCallback.call(void 0,
|
|
302
302
|
async (input) => {
|
|
303
|
-
const saved = await
|
|
303
|
+
const saved = await _chunkGSHMGL6Njs.EmailAutomationStepService.update({ ...input, automationId });
|
|
304
304
|
await reload();
|
|
305
305
|
return saved;
|
|
306
306
|
},
|
|
@@ -308,7 +308,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
308
308
|
);
|
|
309
309
|
const deleteStep = _react.useCallback.call(void 0,
|
|
310
310
|
async (id) => {
|
|
311
|
-
await
|
|
311
|
+
await _chunkGSHMGL6Njs.EmailAutomationStepService.delete({ id });
|
|
312
312
|
if (selectedStepId === id) setSelectedStepId(null);
|
|
313
313
|
await reload();
|
|
314
314
|
},
|
|
@@ -316,8 +316,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
316
316
|
);
|
|
317
317
|
const setNext = _react.useCallback.call(void 0,
|
|
318
318
|
async (stepId, nextStepId) => {
|
|
319
|
-
if (nextStepId) await
|
|
320
|
-
else await
|
|
319
|
+
if (nextStepId) await _chunkGSHMGL6Njs.EmailAutomationStepService.setNext({ stepId, nextStepId });
|
|
320
|
+
else await _chunkGSHMGL6Njs.EmailAutomationStepService.clearNext({ stepId });
|
|
321
321
|
await reload();
|
|
322
322
|
},
|
|
323
323
|
[reload]
|
|
@@ -326,7 +326,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
326
326
|
async (stepId, x, y) => {
|
|
327
327
|
const step = steps.find((candidate) => candidate.id === stepId);
|
|
328
328
|
if (!step) return;
|
|
329
|
-
await
|
|
329
|
+
await _chunkGSHMGL6Njs.EmailAutomationStepService.update({
|
|
330
330
|
id: step.id,
|
|
331
331
|
automationId,
|
|
332
332
|
subject: step.subject,
|
|
@@ -340,7 +340,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
340
340
|
[automationId, reload, steps]
|
|
341
341
|
);
|
|
342
342
|
const tidy = _react.useCallback.call(void 0, async () => {
|
|
343
|
-
await
|
|
343
|
+
await _chunkGSHMGL6Njs.EmailAutomationService.tidy({ id: automationId });
|
|
344
344
|
await reload();
|
|
345
345
|
}, [automationId, reload]);
|
|
346
346
|
const value = _react.useMemo.call(void 0,
|
|
@@ -395,7 +395,7 @@ function EmailAutomationActiveSwitch() {
|
|
|
395
395
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (checked) => {
|
|
396
396
|
setSaving(true);
|
|
397
397
|
try {
|
|
398
|
-
await
|
|
398
|
+
await _chunkGSHMGL6Njs.EmailAutomationService.update({
|
|
399
399
|
id: automation.id,
|
|
400
400
|
name: automation.name,
|
|
401
401
|
trigger: automation.trigger,
|
|
@@ -405,17 +405,17 @@ function EmailAutomationActiveSwitch() {
|
|
|
405
405
|
});
|
|
406
406
|
await reload();
|
|
407
407
|
} catch (error) {
|
|
408
|
-
|
|
408
|
+
_chunkXQEYBESHjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
409
409
|
} finally {
|
|
410
410
|
setSaving(false);
|
|
411
411
|
}
|
|
412
412
|
}, "toggle");
|
|
413
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
414
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
415
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
413
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkXQEYBESHjs.Tooltip, { children: [
|
|
414
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkXQEYBESHjs.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "flex items-center gap-x-2" }), children: [
|
|
415
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.Switch, { checked: automation.isActive, onCheckedChange: (checked) => void toggle(checked), disabled: saving }),
|
|
416
416
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs", children: t("emailAutomations.fields.isActive.label") })
|
|
417
417
|
] }),
|
|
418
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
418
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.TooltipContent, { className: "max-w-xs", children: t("emailAutomations.fields.isActive.help") })
|
|
419
419
|
] });
|
|
420
420
|
}
|
|
421
421
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationActiveSwitch, "EmailAutomationActiveSwitch");
|
|
@@ -448,7 +448,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
448
448
|
const { zoomIn, zoomOut, fitView } = _react3.useReactFlow.call(void 0, );
|
|
449
449
|
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: [
|
|
450
450
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
451
|
-
|
|
451
|
+
_chunkXQEYBESHjs.Button,
|
|
452
452
|
{
|
|
453
453
|
type: "button",
|
|
454
454
|
variant: "outline",
|
|
@@ -459,7 +459,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
459
459
|
}
|
|
460
460
|
),
|
|
461
461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
462
|
-
|
|
462
|
+
_chunkXQEYBESHjs.Button,
|
|
463
463
|
{
|
|
464
464
|
type: "button",
|
|
465
465
|
variant: "outline",
|
|
@@ -470,7 +470,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
470
470
|
}
|
|
471
471
|
),
|
|
472
472
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
473
|
-
|
|
473
|
+
_chunkXQEYBESHjs.Button,
|
|
474
474
|
{
|
|
475
475
|
type: "button",
|
|
476
476
|
variant: "outline",
|
|
@@ -481,7 +481,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
481
481
|
}
|
|
482
482
|
),
|
|
483
483
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
484
|
-
|
|
484
|
+
_chunkXQEYBESHjs.Button,
|
|
485
485
|
{
|
|
486
486
|
type: "button",
|
|
487
487
|
variant: "outline",
|
|
@@ -772,14 +772,14 @@ function EmailStepEditorInternal({
|
|
|
772
772
|
defaultValues: getDefaultValues()
|
|
773
773
|
});
|
|
774
774
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
775
|
-
|
|
775
|
+
_chunkXQEYBESHjs.EditorSheet,
|
|
776
776
|
{
|
|
777
777
|
form,
|
|
778
778
|
entityType: t("emailAutomations.step.title"),
|
|
779
779
|
entityName: _optionalChain([step, 'optionalAccess', _18 => _18.subject]),
|
|
780
780
|
title: isEdit ? t("emailAutomations.step.editTitle") : t("emailAutomations.step.title"),
|
|
781
781
|
isEdit,
|
|
782
|
-
module:
|
|
782
|
+
module: _chunkGSHMGL6Njs.Modules.EmailAutomationStep,
|
|
783
783
|
size: "lg",
|
|
784
784
|
onSubmit: async (values) => {
|
|
785
785
|
const payload = {
|
|
@@ -791,7 +791,7 @@ function EmailStepEditorInternal({
|
|
|
791
791
|
positionX: step ? step.positionX : _optionalChain([initialPosition, 'optionalAccess', _19 => _19.x]),
|
|
792
792
|
positionY: step ? step.positionY : _optionalChain([initialPosition, 'optionalAccess', _20 => _20.y])
|
|
793
793
|
};
|
|
794
|
-
return isEdit ? await
|
|
794
|
+
return isEdit ? await _chunkGSHMGL6Njs.EmailAutomationStepService.update(payload) : await _chunkGSHMGL6Njs.EmailAutomationStepService.create(payload);
|
|
795
795
|
},
|
|
796
796
|
onSuccess: async () => {
|
|
797
797
|
await reload();
|
|
@@ -804,9 +804,9 @@ function EmailStepEditorInternal({
|
|
|
804
804
|
dialogOpen,
|
|
805
805
|
onDialogOpenChange,
|
|
806
806
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
807
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
807
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.FormInput, { form, id: "subject", name: t("emailAutomations.step.fields.subject.label"), isRequired: true }),
|
|
808
808
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
809
|
-
|
|
809
|
+
_chunkXQEYBESHjs.FormInput,
|
|
810
810
|
{
|
|
811
811
|
form,
|
|
812
812
|
id: "delayHours",
|
|
@@ -816,7 +816,7 @@ function EmailStepEditorInternal({
|
|
|
816
816
|
}
|
|
817
817
|
),
|
|
818
818
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
819
|
-
|
|
819
|
+
_chunkXQEYBESHjs.FormTextarea,
|
|
820
820
|
{
|
|
821
821
|
form,
|
|
822
822
|
id: "body",
|
|
@@ -956,7 +956,7 @@ var stepIdOf = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (nodeId) =>
|
|
|
956
956
|
function EmailAutomationCanvas() {
|
|
957
957
|
const { automation, steps, triggers, select, reload, createStep, deleteStep, setNext, updatePosition, tidy } = useEmailAutomation();
|
|
958
958
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
959
|
-
const isMobile =
|
|
959
|
+
const isMobile = _chunkGSHMGL6Njs.useIsMobile.call(void 0, );
|
|
960
960
|
const [nodes, setNodes] = _react.useState.call(void 0, []);
|
|
961
961
|
const [edges, setEdges] = _react.useState.call(void 0, []);
|
|
962
962
|
const { screenToFlowPosition } = _react3.useReactFlow.call(void 0, );
|
|
@@ -995,7 +995,7 @@ function EmailAutomationCanvas() {
|
|
|
995
995
|
try {
|
|
996
996
|
await setNext(stepId, nextStepId);
|
|
997
997
|
} catch (error) {
|
|
998
|
-
|
|
998
|
+
_chunkXQEYBESHjs.errorToast.call(void 0, { title: t("emailAutomations.canvas.chainError"), error });
|
|
999
999
|
await reload();
|
|
1000
1000
|
}
|
|
1001
1001
|
},
|
|
@@ -1009,7 +1009,7 @@ function EmailAutomationCanvas() {
|
|
|
1009
1009
|
if (!_optionalChain([conn, 'access', _29 => _29.targetHandle, 'optionalAccess', _30 => _30.startsWith, 'call', _31 => _31(STEP_TARGET_HANDLE_PREFIX)])) return;
|
|
1010
1010
|
const targetStepId = conn.targetHandle.slice(STEP_TARGET_HANDLE_PREFIX.length);
|
|
1011
1011
|
if (from.handleId === TRIGGER_SOURCE_HANDLE) {
|
|
1012
|
-
|
|
1012
|
+
_chunkGSHMGL6Njs.showError.call(void 0, t("emailAutomations.canvas.chainError"));
|
|
1013
1013
|
return;
|
|
1014
1014
|
}
|
|
1015
1015
|
if (!from.handleId.startsWith(STEP_SOURCE_HANDLE_PREFIX)) return;
|
|
@@ -1127,7 +1127,7 @@ function EmailAutomationCanvas() {
|
|
|
1127
1127
|
try {
|
|
1128
1128
|
await deleteStep(stepId);
|
|
1129
1129
|
} catch (error) {
|
|
1130
|
-
|
|
1130
|
+
_chunkXQEYBESHjs.errorToast.call(void 0, { title: t("emailAutomations.canvas.deleteEmail"), error });
|
|
1131
1131
|
throw error;
|
|
1132
1132
|
}
|
|
1133
1133
|
}, [pendingDeleteStepId, deleteStep, t]);
|
|
@@ -1190,7 +1190,7 @@ function EmailAutomationCanvas() {
|
|
|
1190
1190
|
}
|
|
1191
1191
|
),
|
|
1192
1192
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1193
|
-
|
|
1193
|
+
_chunkXQEYBESHjs.ConfirmDialog,
|
|
1194
1194
|
{
|
|
1195
1195
|
open: pendingDeleteStepId !== null,
|
|
1196
1196
|
onOpenChange: (open) => {
|
|
@@ -1205,20 +1205,20 @@ function EmailAutomationCanvas() {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
),
|
|
1207
1207
|
paneMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1208
|
-
|
|
1208
|
+
_chunkXQEYBESHjs.ContextMenu,
|
|
1209
1209
|
{
|
|
1210
1210
|
open: true,
|
|
1211
1211
|
onOpenChange: (open) => {
|
|
1212
1212
|
if (!open) setPaneMenu(null);
|
|
1213
1213
|
},
|
|
1214
1214
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1215
|
-
|
|
1215
|
+
_chunkXQEYBESHjs.ContextMenuContent,
|
|
1216
1216
|
{
|
|
1217
1217
|
anchor: pointAnchor(paneMenu.screenX, paneMenu.screenY),
|
|
1218
1218
|
side: "bottom",
|
|
1219
1219
|
align: "start",
|
|
1220
1220
|
sideOffset: 4,
|
|
1221
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1221
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkXQEYBESHjs.ContextMenuItem, { onClick: handleCreateStepFromPane, children: [
|
|
1222
1222
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PlusIcon, {}),
|
|
1223
1223
|
t("emailAutomations.canvas.addEmail")
|
|
1224
1224
|
] })
|
|
@@ -1227,21 +1227,21 @@ function EmailAutomationCanvas() {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
),
|
|
1229
1229
|
nodeMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1230
|
-
|
|
1230
|
+
_chunkXQEYBESHjs.ContextMenu,
|
|
1231
1231
|
{
|
|
1232
1232
|
open: true,
|
|
1233
1233
|
onOpenChange: (open) => {
|
|
1234
1234
|
if (!open) setNodeMenu(null);
|
|
1235
1235
|
},
|
|
1236
1236
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1237
|
-
|
|
1237
|
+
_chunkXQEYBESHjs.ContextMenuContent,
|
|
1238
1238
|
{
|
|
1239
1239
|
anchor: pointAnchor(nodeMenu.screenX, nodeMenu.screenY),
|
|
1240
1240
|
side: "bottom",
|
|
1241
1241
|
align: "start",
|
|
1242
1242
|
sideOffset: 4,
|
|
1243
1243
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1244
|
-
|
|
1244
|
+
_chunkXQEYBESHjs.ContextMenuItem,
|
|
1245
1245
|
{
|
|
1246
1246
|
onClick: () => {
|
|
1247
1247
|
const menu = nodeMenu;
|
|
@@ -1282,7 +1282,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, TriggerAutomationEditor, "TriggerAutomation
|
|
|
1282
1282
|
// src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx
|
|
1283
1283
|
|
|
1284
1284
|
function EmailAutomationCanvasTab() {
|
|
1285
|
-
const { open, setOpen } =
|
|
1285
|
+
const { open, setOpen } = _chunkXQEYBESHjs.useSidebar.call(void 0, );
|
|
1286
1286
|
_react.useEffect.call(void 0, () => {
|
|
1287
1287
|
const prev = open;
|
|
1288
1288
|
if (prev) setOpen(false);
|
|
@@ -1303,10 +1303,10 @@ function EmailAutomationRecipientsList() {
|
|
|
1303
1303
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1304
1304
|
const { automation } = useEmailAutomation();
|
|
1305
1305
|
const [statusFilter, setStatusFilter] = _react.useState.call(void 0, "all");
|
|
1306
|
-
const data =
|
|
1307
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1306
|
+
const data = _chunkXQEYBESHjs.useDataListRetriever.call(void 0, {
|
|
1307
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkGSHMGL6Njs.EmailAutomationService.findEnrollments(params), "retriever"),
|
|
1308
1308
|
retrieverParams: { automationId: _optionalChain([automation, 'optionalAccess', _44 => _44.id]) },
|
|
1309
|
-
module:
|
|
1309
|
+
module: _chunkGSHMGL6Njs.Modules.EmailAutomationEnrollment
|
|
1310
1310
|
});
|
|
1311
1311
|
const handleStatusChange = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => {
|
|
1312
1312
|
const status = _nullishCoalesce(value, () => ( "all"));
|
|
@@ -1325,21 +1325,21 @@ function EmailAutomationRecipientsList() {
|
|
|
1325
1325
|
[t]
|
|
1326
1326
|
);
|
|
1327
1327
|
const filters = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4", children: [
|
|
1328
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1329
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1330
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1331
|
-
/* @__PURE__ */ _jsxruntime.jsx.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,
|
|
1328
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkXQEYBESHjs.Select, { items: statusItems, value: statusFilter, onValueChange: handleStatusChange, children: [
|
|
1329
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SelectTrigger, { className: "w-40", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SelectValue, {}) }),
|
|
1330
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkXQEYBESHjs.SelectContent, { children: [
|
|
1331
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SelectItem, { value: "all", children: t("emailAutomations.recipients.status.all") }),
|
|
1332
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SelectItem, { value: "active", children: t("emailAutomations.recipients.status.active") }),
|
|
1333
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SelectItem, { value: "completed", children: t("emailAutomations.recipients.status.completed") }),
|
|
1334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SelectItem, { value: "unsubscribed", children: t("emailAutomations.recipients.status.unsubscribed") }),
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SelectItem, { value: "exited", children: t("emailAutomations.recipients.status.exited") }),
|
|
1336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SelectItem, { value: "failed", children: t("emailAutomations.recipients.status.failed") })
|
|
1337
1337
|
] })
|
|
1338
1338
|
] }),
|
|
1339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.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" : ""}` }) })
|
|
1340
1340
|
] });
|
|
1341
1341
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1342
|
-
|
|
1342
|
+
_chunkXQEYBESHjs.ContentListTable,
|
|
1343
1343
|
{
|
|
1344
1344
|
data,
|
|
1345
1345
|
fields: [
|
|
@@ -1350,7 +1350,7 @@ function EmailAutomationRecipientsList() {
|
|
|
1350
1350
|
"nextSendAt" /* nextSendAt */,
|
|
1351
1351
|
"sentCount" /* sentCount */
|
|
1352
1352
|
],
|
|
1353
|
-
tableGeneratorType:
|
|
1353
|
+
tableGeneratorType: _chunkGSHMGL6Njs.Modules.EmailAutomationEnrollment,
|
|
1354
1354
|
filters,
|
|
1355
1355
|
allowSearch: false,
|
|
1356
1356
|
emptyState: t("emailAutomations.recipients.empty")
|
|
@@ -1367,15 +1367,15 @@ function EmailAutomationContainer({ automationId }) {
|
|
|
1367
1367
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationContainer, "EmailAutomationContainer");
|
|
1368
1368
|
function EmailAutomationShell() {
|
|
1369
1369
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1370
|
-
const generateUrl =
|
|
1370
|
+
const generateUrl = _chunkXQEYBESHjs.usePageUrlGenerator.call(void 0, );
|
|
1371
1371
|
const { automation, reload } = useEmailAutomation();
|
|
1372
1372
|
if (!automation) return null;
|
|
1373
1373
|
const breadcrumbs = [
|
|
1374
|
-
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page:
|
|
1374
|
+
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page: _chunkGSHMGL6Njs.Modules.EmailAutomation }) },
|
|
1375
1375
|
{ name: automation.name }
|
|
1376
1376
|
];
|
|
1377
1377
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1378
|
-
|
|
1378
|
+
_chunkXQEYBESHjs.SharedProvider,
|
|
1379
1379
|
{
|
|
1380
1380
|
value: {
|
|
1381
1381
|
breadcrumbs,
|
|
@@ -1389,9 +1389,9 @@ function EmailAutomationShell() {
|
|
|
1389
1389
|
}
|
|
1390
1390
|
},
|
|
1391
1391
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1392
|
-
|
|
1392
|
+
_chunkXQEYBESHjs.RoundPageContainer,
|
|
1393
1393
|
{
|
|
1394
|
-
module:
|
|
1394
|
+
module: _chunkGSHMGL6Njs.Modules.EmailAutomation,
|
|
1395
1395
|
id: automation.id,
|
|
1396
1396
|
fullWidth: true,
|
|
1397
1397
|
forceHeader: true,
|
|
@@ -1430,7 +1430,7 @@ function EmailUnsubscribe({ token, scope }) {
|
|
|
1430
1430
|
_react.useEffect.call(void 0, () => {
|
|
1431
1431
|
async function unsubscribe() {
|
|
1432
1432
|
try {
|
|
1433
|
-
const enrollment = await
|
|
1433
|
+
const enrollment = await _chunkGSHMGL6Njs.EmailAutomationEnrollmentService.unsubscribe({ token, scope });
|
|
1434
1434
|
setAutomationName(_nullishCoalesce(_optionalChain([enrollment, 'optionalAccess', _45 => _45.automation, 'optionalAccess', _46 => _46.name]), () => ( "")));
|
|
1435
1435
|
setStoppedScope(scope);
|
|
1436
1436
|
setState("success");
|
|
@@ -1444,7 +1444,7 @@ function EmailUnsubscribe({ token, scope }) {
|
|
|
1444
1444
|
const stopAll = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1445
1445
|
setIsStoppingAll(true);
|
|
1446
1446
|
try {
|
|
1447
|
-
await
|
|
1447
|
+
await _chunkGSHMGL6Njs.EmailAutomationEnrollmentService.unsubscribe({ token, scope: "all" });
|
|
1448
1448
|
setStoppedScope("all");
|
|
1449
1449
|
} catch (e3) {
|
|
1450
1450
|
setState("error");
|
|
@@ -1461,16 +1461,16 @@ function EmailUnsubscribe({ token, scope }) {
|
|
|
1461
1461
|
if (state === "error") {
|
|
1462
1462
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1463
1463
|
/* @__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" }) }),
|
|
1464
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1464
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.invalidTitle") }),
|
|
1465
1465
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.invalidBody") })
|
|
1466
1466
|
] });
|
|
1467
1467
|
}
|
|
1468
1468
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1469
1469
|
/* @__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" }) }),
|
|
1470
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1470
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.title") }),
|
|
1471
1471
|
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: [
|
|
1472
1472
|
/* @__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 }) }),
|
|
1473
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1473
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkXQEYBESHjs.Button, { variant: "secondary", onClick: stopAll, disabled: isStoppingAll, children: [
|
|
1474
1474
|
isStoppingAll && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
1475
1475
|
t("emailAutomations.unsubscribe.alsoStopAll")
|
|
1476
1476
|
] })
|
|
@@ -1485,7 +1485,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailUnsubscribe, "EmailUnsubscribe");
|
|
|
1485
1485
|
|
|
1486
1486
|
var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1487
1487
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1488
|
-
const generateUrl =
|
|
1488
|
+
const generateUrl = _chunkXQEYBESHjs.usePageUrlGenerator.call(void 0, );
|
|
1489
1489
|
const triggerLabels = _nullishCoalesce(_optionalChain([params, 'access', _47 => _47.context, 'optionalAccess', _48 => _48.triggerLabels]), () => ( {}));
|
|
1490
1490
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1491
1491
|
return params.data.map((automation) => {
|
|
@@ -1514,7 +1514,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1514
1514
|
header: t("emailAutomations.list.columns.name"),
|
|
1515
1515
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1516
1516
|
const automation = row.original.jsonApiData;
|
|
1517
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1517
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.Link, { href: generateUrl({ page: _chunkGSHMGL6Njs.Modules.EmailAutomation, id: automation.id }), children: automation.name });
|
|
1518
1518
|
}, "cell"),
|
|
1519
1519
|
enableSorting: false,
|
|
1520
1520
|
enableHiding: false
|
|
@@ -1537,7 +1537,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1537
1537
|
header: t("emailAutomations.list.columns.status"),
|
|
1538
1538
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1539
1539
|
const automation = row.original.jsonApiData;
|
|
1540
|
-
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1540
|
+
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.Badge, { variant: "softGreen", children: t("emailAutomations.list.status.on") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXQEYBESHjs.Badge, { variant: "softGray", children: t("emailAutomations.list.status.off") });
|
|
1541
1541
|
}, "cell"),
|
|
1542
1542
|
enableSorting: false,
|
|
1543
1543
|
enableHiding: false
|
|
@@ -1560,7 +1560,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1560
1560
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
1561
1561
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1562
1562
|
}, "useEmailAutomationTableStructure");
|
|
1563
|
-
|
|
1563
|
+
_chunkXQEYBESHjs.registerTableGenerator.call(void 0, "email-automations", useEmailAutomationTableStructure);
|
|
1564
1564
|
|
|
1565
1565
|
// src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx
|
|
1566
1566
|
|
|
@@ -1575,7 +1575,7 @@ var STATUS_VARIANTS = {
|
|
|
1575
1575
|
};
|
|
1576
1576
|
var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1577
1577
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1578
|
-
const locale =
|
|
1578
|
+
const locale = _chunkGSHMGL6Njs.dateFormatLocale.call(void 0, _nextintl.useLocale.call(void 0, ));
|
|
1579
1579
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1580
1580
|
return params.data.map((enrollment) => {
|
|
1581
1581
|
const entry = { jsonApiData: enrollment };
|
|
@@ -1616,7 +1616,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1616
1616
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1617
1617
|
const enrollment = row.original.jsonApiData;
|
|
1618
1618
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1619
|
-
|
|
1619
|
+
_chunkXQEYBESHjs.Badge,
|
|
1620
1620
|
{
|
|
1621
1621
|
variant: _nullishCoalesce(STATUS_VARIANTS[enrollment.status], () => ( "softGray")),
|
|
1622
1622
|
title: enrollment.status === "failed" ? enrollment.lastError : void 0,
|
|
@@ -1645,7 +1645,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1645
1645
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1646
1646
|
const enrollment = row.original.jsonApiData;
|
|
1647
1647
|
if (!enrollment.nextSendAt) return empty;
|
|
1648
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children:
|
|
1648
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children: _chunkGSHMGL6Njs.formatDate.call(void 0, enrollment.nextSendAt, "dateTime", locale) });
|
|
1649
1649
|
}, "cell"),
|
|
1650
1650
|
enableSorting: false,
|
|
1651
1651
|
enableHiding: false
|
|
@@ -1667,7 +1667,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1667
1667
|
}, [params.fields, fieldColumnMap, t, locale]);
|
|
1668
1668
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1669
1669
|
}, "useEmailAutomationEnrollmentTableStructure");
|
|
1670
|
-
|
|
1670
|
+
_chunkXQEYBESHjs.registerTableGenerator.call(void 0, "email-automation-enrollments", useEmailAutomationEnrollmentTableStructure);
|
|
1671
1671
|
|
|
1672
1672
|
|
|
1673
1673
|
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
useDataListRetriever,
|
|
32
32
|
usePageUrlGenerator,
|
|
33
33
|
useSidebar
|
|
34
|
-
} from "../chunk-
|
|
35
|
-
import "../chunk-
|
|
34
|
+
} from "../chunk-6PW3562E.mjs";
|
|
35
|
+
import "../chunk-CUNSPLOD.mjs";
|
|
36
36
|
import "../chunk-PW42LRSL.mjs";
|
|
37
37
|
import {
|
|
38
38
|
EmailAutomationEnrollmentService,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
showError,
|
|
45
45
|
useI18nRouter,
|
|
46
46
|
useIsMobile
|
|
47
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-QKDPCZ3G.mjs";
|
|
48
48
|
import "../chunk-V5MI7RNB.mjs";
|
|
49
49
|
import "../chunk-AUXK7QSA.mjs";
|
|
50
50
|
import "../chunk-PI56A4DG.mjs";
|