@carlonicora/nextjs-jsonapi 5.3.0 → 5.4.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-UJ6363LC.js → BlockNoteEditor-4YCAIEPT.js} +23 -22
- package/dist/BlockNoteEditor-4YCAIEPT.js.map +1 -0
- package/dist/{BlockNoteEditor-WTSQANKI.mjs → BlockNoteEditor-YQL2SGFR.mjs} +8 -7
- package/dist/BlockNoteEditor-YQL2SGFR.mjs.map +1 -0
- package/dist/{BlockNoteViewer-JVKWJZ6J.mjs → BlockNoteViewer-AEJKJ27Q.mjs} +2 -2
- package/dist/{BlockNoteViewer-EL4JFB6P.js → BlockNoteViewer-YL3J7J2Y.js} +3 -3
- package/dist/{BlockNoteViewer-EL4JFB6P.js.map → BlockNoteViewer-YL3J7J2Y.js.map} +1 -1
- package/dist/BlogCategoryFields-DO48vOTE.d.mts +14 -0
- package/dist/BlogCategoryFields-DO48vOTE.d.ts +14 -0
- package/dist/BlogPostInterface-BB_4wcDR.d.mts +124 -0
- package/dist/BlogPostInterface-bWAT1rfR.d.ts +124 -0
- package/dist/billing/index.js +441 -441
- package/dist/billing/index.mjs +3 -3
- package/dist/blog-public.types-BbrzsC1c.d.mts +30 -0
- package/dist/blog-public.types-BbrzsC1c.d.ts +30 -0
- package/dist/{chunk-3BAM23VA.js → chunk-3NLAXVIN.js} +860 -849
- package/dist/chunk-3NLAXVIN.js.map +1 -0
- package/dist/{chunk-QKZUE5OF.mjs → chunk-3YW35YHQ.mjs} +1 -101
- package/dist/chunk-3YW35YHQ.mjs.map +1 -0
- package/dist/{chunk-QQQE3N2X.js → chunk-5PPG6PL7.js} +3 -3
- package/dist/{chunk-QQQE3N2X.js.map → chunk-5PPG6PL7.js.map} +1 -1
- package/dist/{chunk-FNTQQFLH.mjs → chunk-6DC2WVVB.mjs} +2 -2
- package/dist/{chunk-MIZTWBPX.mjs → chunk-EUKTBOI2.mjs} +19 -8
- package/dist/chunk-EUKTBOI2.mjs.map +1 -0
- package/dist/{chunk-XGTQWBDJ.js → chunk-KSYQEKJX.js} +11 -111
- package/dist/chunk-KSYQEKJX.js.map +1 -0
- package/dist/{chunk-CRI4T47Y.js → chunk-NFBOSPNJ.js} +756 -41
- package/dist/chunk-NFBOSPNJ.js.map +1 -0
- package/dist/{chunk-6WU74VFU.mjs → chunk-QMYQRPQC.mjs} +2 -2
- package/dist/{chunk-JQWI62NV.mjs → chunk-WC63PJSC.mjs} +716 -1
- package/dist/chunk-WC63PJSC.mjs.map +1 -0
- package/dist/chunk-XCHSX3VC.mjs +107 -0
- package/dist/chunk-XCHSX3VC.mjs.map +1 -0
- package/dist/{chunk-EO75CV76.js → chunk-YNCQSWQW.js} +8 -8
- package/dist/{chunk-EO75CV76.js.map → chunk-YNCQSWQW.js.map} +1 -1
- package/dist/chunk-YW4ZCEWB.js +107 -0
- package/dist/chunk-YW4ZCEWB.js.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +13 -2
- package/dist/components/index.d.ts +13 -2
- 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.d.mts +214 -3
- package/dist/core/index.d.ts +214 -3
- package/dist/core/index.js +36 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +35 -1
- package/dist/email-automations/index.js +92 -92
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.js +122 -122
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +6 -5
- package/dist/features/analytics/server.js.map +1 -1
- package/dist/features/analytics/server.mjs +4 -3
- package/dist/features/analytics/server.mjs.map +1 -1
- package/dist/features/blog/index.css +30 -0
- package/dist/features/blog/index.css.map +1 -0
- package/dist/features/blog/index.d.mts +266 -0
- package/dist/features/blog/index.d.ts +266 -0
- package/dist/features/blog/index.js +1799 -0
- package/dist/features/blog/index.js.map +1 -0
- package/dist/features/blog/index.mjs +1799 -0
- package/dist/features/blog/index.mjs.map +1 -0
- package/dist/features/blog/server.d.mts +33 -0
- package/dist/features/blog/server.d.ts +33 -0
- package/dist/features/blog/server.js +139 -0
- package/dist/features/blog/server.js.map +1 -0
- package/dist/features/blog/server.mjs +139 -0
- package/dist/features/blog/server.mjs.map +1 -0
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +125 -125
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +37 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -2
- package/dist/{s3.service-CY-jgOAM.d.ts → s3.service-Bz_K-tjz.d.ts} +11 -0
- package/dist/{s3.service-Sri0QP7Z.d.mts → s3.service-D5zNCEW3.d.mts} +11 -0
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +8 -6
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +12 -10
- package/messages/en.json +93 -0
- package/messages/it.json +93 -0
- package/package.json +11 -1
- package/src/components/editors/BlockNoteEditor.tsx +13 -3
- package/src/components/forms/FormBlockNote.tsx +4 -0
- package/src/components/navigations/ContentTitle.tsx +14 -3
- package/src/core/index.ts +4 -0
- package/src/core/registry/ModuleRegistry.ts +6 -0
- package/src/features/blog/BlogModules.ts +49 -0
- package/src/features/blog/components/admin/BlogAdminContainer.tsx +32 -0
- package/src/features/blog/components/admin/BlogCategoriesList.tsx +56 -0
- package/src/features/blog/components/admin/BlogCategoryEditor.tsx +230 -0
- package/src/features/blog/components/admin/BlogCoverImageField.tsx +123 -0
- package/src/features/blog/components/admin/BlogLayoutSetting.tsx +86 -0
- package/src/features/blog/components/admin/BlogPostComparison.tsx +54 -0
- package/src/features/blog/components/admin/BlogPostContainer.tsx +102 -0
- package/src/features/blog/components/admin/BlogPostDeleter.tsx +35 -0
- package/src/features/blog/components/admin/BlogPostEditor.tsx +207 -0
- package/src/features/blog/components/admin/BlogPostPublishButton.tsx +50 -0
- package/src/features/blog/components/admin/BlogPostTranslationEditor.tsx +110 -0
- package/src/features/blog/components/admin/BlogPostTranslationPanel.tsx +136 -0
- package/src/features/blog/components/admin/BlogPostsList.tsx +58 -0
- package/src/features/blog/components/admin/BlogTranslationStatus.tsx +104 -0
- package/src/features/blog/components/admin/__tests__/BlogPostTranslationPanel.spec.tsx +100 -0
- package/src/features/blog/components/admin/__tests__/BlogPostsList.spec.tsx +30 -0
- package/src/features/blog/components/admin/index.ts +14 -0
- package/src/features/blog/components/public/BlogCategoryChips.tsx +59 -0
- package/src/features/blog/components/public/BlogList.tsx +21 -0
- package/src/features/blog/components/public/BlogListColumn.tsx +53 -0
- package/src/features/blog/components/public/BlogListFeatured.tsx +57 -0
- package/src/features/blog/components/public/BlogListParts.tsx +74 -0
- package/src/features/blog/components/public/BlogListRail.tsx +62 -0
- package/src/features/blog/components/public/BlogPostCard.tsx +132 -0
- package/src/features/blog/components/public/BlogPostMeta.tsx +49 -0
- package/src/features/blog/components/public/BlogPostView.tsx +74 -0
- package/src/features/blog/components/public/BlogSearchBox.tsx +52 -0
- package/src/features/blog/components/public/__tests__/BlogList.spec.tsx +173 -0
- package/src/features/blog/components/public/__tests__/BlogPostView.spec.tsx +128 -0
- package/src/features/blog/components/public/blogPublicHelpers.ts +30 -0
- package/src/features/blog/components/public/index.ts +3 -0
- package/src/features/blog/contexts/BlogPostContext.tsx +66 -0
- package/src/features/blog/contexts/index.ts +1 -0
- package/src/features/blog/data/BlogCategory.ts +93 -0
- package/src/features/blog/data/BlogCategoryFields.ts +4 -0
- package/src/features/blog/data/BlogCategoryInterface.ts +24 -0
- package/src/features/blog/data/BlogCategoryService.ts +54 -0
- package/src/features/blog/data/BlogCategoryTranslation.ts +90 -0
- package/src/features/blog/data/BlogCategoryTranslationInterface.ts +22 -0
- package/src/features/blog/data/BlogCategoryTranslationService.ts +30 -0
- package/src/features/blog/data/BlogPost.spec.ts +123 -0
- package/src/features/blog/data/BlogPost.ts +159 -0
- package/src/features/blog/data/BlogPostFields.ts +7 -0
- package/src/features/blog/data/BlogPostInterface.ts +39 -0
- package/src/features/blog/data/BlogPostService.ts +82 -0
- package/src/features/blog/data/BlogPostTranslation.spec.ts +73 -0
- package/src/features/blog/data/BlogPostTranslation.ts +110 -0
- package/src/features/blog/data/BlogPostTranslationInterface.ts +27 -0
- package/src/features/blog/data/BlogPostTranslationService.ts +30 -0
- package/src/features/blog/data/BlogSettings.ts +37 -0
- package/src/features/blog/data/BlogSettingsInterface.ts +11 -0
- package/src/features/blog/data/BlogSettingsService.ts +24 -0
- package/src/features/blog/data/index.ts +17 -0
- package/src/features/blog/hooks/index.ts +3 -0
- package/src/features/blog/hooks/useBlogCategoryNames.ts +34 -0
- package/src/features/blog/hooks/useBlogCategoryTableStructure.tsx +84 -0
- package/src/features/blog/hooks/useBlogPostTableStructure.tsx +126 -0
- package/src/features/blog/index.ts +15 -0
- package/src/features/blog/server/fetchers.ts +120 -0
- package/src/features/blog/server/toPublic.spec.ts +91 -0
- package/src/features/blog/server/toPublic.ts +36 -0
- package/src/features/blog/server-entry.ts +17 -0
- package/src/features/blog/types/blog-public.types.ts +34 -0
- package/src/features/blog/types/blog.constants.ts +40 -0
- package/src/features/s3/data/s3.service.ts +17 -0
- package/dist/BlockNoteEditor-UJ6363LC.js.map +0 -1
- package/dist/BlockNoteEditor-WTSQANKI.mjs.map +0 -1
- package/dist/chunk-3BAM23VA.js.map +0 -1
- package/dist/chunk-CRI4T47Y.js.map +0 -1
- package/dist/chunk-JQWI62NV.mjs.map +0 -1
- package/dist/chunk-MIZTWBPX.mjs.map +0 -1
- package/dist/chunk-QKZUE5OF.mjs.map +0 -1
- package/dist/chunk-XGTQWBDJ.js.map +0 -1
- /package/dist/{BlockNoteViewer-JVKWJZ6J.mjs.map → BlockNoteViewer-AEJKJ27Q.mjs.map} +0 -0
- /package/dist/{chunk-FNTQQFLH.mjs.map → chunk-6DC2WVVB.mjs.map} +0 -0
- /package/dist/{chunk-6WU74VFU.mjs.map → chunk-QMYQRPQC.mjs.map} +0 -0
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
36
|
-
require('../chunk-
|
|
35
|
+
var _chunk3NLAXVINjs = require('../chunk-3NLAXVIN.js');
|
|
36
|
+
require('../chunk-YNCQSWQW.js');
|
|
37
37
|
require('../chunk-G4JR3SFV.js');
|
|
38
38
|
|
|
39
39
|
|
|
@@ -45,7 +45,7 @@ require('../chunk-G4JR3SFV.js');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkNFBOSPNJjs = require('../chunk-NFBOSPNJ.js');
|
|
49
49
|
require('../chunk-LXKSUWAV.js');
|
|
50
50
|
require('../chunk-JTPRJNT2.js');
|
|
51
51
|
require('../chunk-GHE4VT2R.js');
|
|
@@ -78,12 +78,12 @@ function EmailAutomationEditorInternal({
|
|
|
78
78
|
onDialogOpenChange
|
|
79
79
|
}) {
|
|
80
80
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
81
|
-
const router =
|
|
81
|
+
const router = _chunkNFBOSPNJjs.useI18nRouter.call(void 0, );
|
|
82
82
|
const isEdit = !!automation;
|
|
83
83
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
84
84
|
_react.useEffect.call(void 0, () => {
|
|
85
85
|
let active = true;
|
|
86
|
-
|
|
86
|
+
_chunkNFBOSPNJjs.EmailAutomationService.findTriggers().then((list) => {
|
|
87
87
|
if (active) setTriggers(list);
|
|
88
88
|
}).catch(() => {
|
|
89
89
|
});
|
|
@@ -121,14 +121,14 @@ function EmailAutomationEditorInternal({
|
|
|
121
121
|
defaultValues: getDefaultValues()
|
|
122
122
|
});
|
|
123
123
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
124
|
-
|
|
124
|
+
_chunk3NLAXVINjs.EditorSheet,
|
|
125
125
|
{
|
|
126
126
|
form,
|
|
127
127
|
entityType: t("emailAutomations.admin.title"),
|
|
128
128
|
entityName: _optionalChain([automation, 'optionalAccess', _7 => _7.name]),
|
|
129
129
|
title: isEdit ? t("emailAutomations.admin.editAutomation") : t("emailAutomations.admin.newAutomation"),
|
|
130
130
|
isEdit,
|
|
131
|
-
module:
|
|
131
|
+
module: _chunkNFBOSPNJjs.Modules.EmailAutomation,
|
|
132
132
|
size: "md",
|
|
133
133
|
propagateChanges,
|
|
134
134
|
onSuccess,
|
|
@@ -142,7 +142,7 @@ function EmailAutomationEditorInternal({
|
|
|
142
142
|
replyTo: values.replyTo || void 0,
|
|
143
143
|
isActive: values.isActive
|
|
144
144
|
};
|
|
145
|
-
return isEdit ? await
|
|
145
|
+
return isEdit ? await _chunkNFBOSPNJjs.EmailAutomationService.update(payload) : await _chunkNFBOSPNJjs.EmailAutomationService.create(payload);
|
|
146
146
|
},
|
|
147
147
|
onReset: getDefaultValues,
|
|
148
148
|
trigger,
|
|
@@ -151,9 +151,9 @@ function EmailAutomationEditorInternal({
|
|
|
151
151
|
dialogOpen,
|
|
152
152
|
onDialogOpenChange,
|
|
153
153
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
154
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
154
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.FormInput, { form, id: "name", name: t("emailAutomations.fields.name.label"), isRequired: true }),
|
|
155
155
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
156
|
-
|
|
156
|
+
_chunk3NLAXVINjs.FormSelect,
|
|
157
157
|
{
|
|
158
158
|
form,
|
|
159
159
|
id: "trigger",
|
|
@@ -164,7 +164,7 @@ function EmailAutomationEditorInternal({
|
|
|
164
164
|
}
|
|
165
165
|
),
|
|
166
166
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
167
|
-
|
|
167
|
+
_chunk3NLAXVINjs.FormSelect,
|
|
168
168
|
{
|
|
169
169
|
form,
|
|
170
170
|
id: "exitTrigger",
|
|
@@ -174,9 +174,9 @@ function EmailAutomationEditorInternal({
|
|
|
174
174
|
allowEmpty: true
|
|
175
175
|
}
|
|
176
176
|
),
|
|
177
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
177
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.FormInput, { form, id: "replyTo", name: t("emailAutomations.fields.replyTo.label") }),
|
|
178
178
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
179
|
-
|
|
179
|
+
_chunk3NLAXVINjs.FormSwitch,
|
|
180
180
|
{
|
|
181
181
|
form,
|
|
182
182
|
id: "isActive",
|
|
@@ -200,14 +200,14 @@ var EmailAutomationEditor_default = EmailAutomationEditor;
|
|
|
200
200
|
function EmailAutomationsList({ fullWidth } = {}) {
|
|
201
201
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
202
202
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
203
|
-
const data =
|
|
204
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
203
|
+
const data = _chunk3NLAXVINjs.useDataListRetriever.call(void 0, {
|
|
204
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkNFBOSPNJjs.EmailAutomationService.findMany(params), "retriever"),
|
|
205
205
|
retrieverParams: {},
|
|
206
|
-
module:
|
|
206
|
+
module: _chunkNFBOSPNJjs.Modules.EmailAutomation
|
|
207
207
|
});
|
|
208
208
|
_react.useEffect.call(void 0, () => {
|
|
209
209
|
let active = true;
|
|
210
|
-
|
|
210
|
+
_chunkNFBOSPNJjs.EmailAutomationService.findTriggers().then((list) => {
|
|
211
211
|
if (active) setTriggers(list);
|
|
212
212
|
}).catch(() => {
|
|
213
213
|
});
|
|
@@ -221,7 +221,7 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
221
221
|
);
|
|
222
222
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationEditor_default, {}, "create-email-automation")];
|
|
223
223
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
224
|
-
|
|
224
|
+
_chunk3NLAXVINjs.ContentListTable,
|
|
225
225
|
{
|
|
226
226
|
data,
|
|
227
227
|
fields: [
|
|
@@ -233,12 +233,12 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
233
233
|
"completed" /* completed */,
|
|
234
234
|
"unsubscribed" /* unsubscribed */
|
|
235
235
|
],
|
|
236
|
-
tableGeneratorType:
|
|
236
|
+
tableGeneratorType: _chunkNFBOSPNJjs.Modules.EmailAutomation,
|
|
237
237
|
functions,
|
|
238
238
|
fullWidth,
|
|
239
239
|
title: t("emailAutomations.admin.title"),
|
|
240
240
|
context: { triggerLabels },
|
|
241
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
241
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.EmptyState, { icon: _lucidereact.MailIcon, title: t("emailAutomations.admin.empty") })
|
|
242
242
|
}
|
|
243
243
|
);
|
|
244
244
|
}
|
|
@@ -247,7 +247,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsList, "EmailAutomationsList
|
|
|
247
247
|
// src/features/email-automation/components/containers/EmailAutomationsListContainer.tsx
|
|
248
248
|
|
|
249
249
|
function EmailAutomationsListContainer() {
|
|
250
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.AdministrationProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.RoundPageContainer, { module: _chunkNFBOSPNJjs.Modules.EmailAutomation, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationsList, { fullWidth: true }) }) });
|
|
251
251
|
}
|
|
252
252
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsListContainer, "EmailAutomationsListContainer");
|
|
253
253
|
|
|
@@ -266,8 +266,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
266
266
|
const [selectedStepId, setSelectedStepId] = _react.useState.call(void 0, null);
|
|
267
267
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
268
268
|
const [loadedAutomation, loadedSteps] = await Promise.all([
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
_chunkNFBOSPNJjs.EmailAutomationService.findOne({ id: automationId }),
|
|
270
|
+
_chunkNFBOSPNJjs.EmailAutomationStepService.findByAutomation({ automationId })
|
|
271
271
|
]);
|
|
272
272
|
setAutomation(loadedAutomation);
|
|
273
273
|
setSteps(loadedSteps);
|
|
@@ -277,7 +277,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
277
277
|
}, [reload]);
|
|
278
278
|
_react.useEffect.call(void 0, () => {
|
|
279
279
|
let active = true;
|
|
280
|
-
|
|
280
|
+
_chunkNFBOSPNJjs.EmailAutomationService.findTriggers().then((list) => {
|
|
281
281
|
if (active) setTriggers(list);
|
|
282
282
|
}).catch(() => {
|
|
283
283
|
});
|
|
@@ -288,7 +288,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
288
288
|
const select = _react.useCallback.call(void 0, (id) => setSelectedStepId(id), []);
|
|
289
289
|
const createStep = _react.useCallback.call(void 0,
|
|
290
290
|
async (input) => {
|
|
291
|
-
const saved = await
|
|
291
|
+
const saved = await _chunkNFBOSPNJjs.EmailAutomationStepService.create({ ...input, id: _nullishCoalesce(input.id, () => ( _uuid.v4.call(void 0, ))), automationId });
|
|
292
292
|
await reload();
|
|
293
293
|
return saved;
|
|
294
294
|
},
|
|
@@ -296,7 +296,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
296
296
|
);
|
|
297
297
|
const updateStep = _react.useCallback.call(void 0,
|
|
298
298
|
async (input) => {
|
|
299
|
-
const saved = await
|
|
299
|
+
const saved = await _chunkNFBOSPNJjs.EmailAutomationStepService.update({ ...input, automationId });
|
|
300
300
|
await reload();
|
|
301
301
|
return saved;
|
|
302
302
|
},
|
|
@@ -304,7 +304,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
304
304
|
);
|
|
305
305
|
const deleteStep = _react.useCallback.call(void 0,
|
|
306
306
|
async (id) => {
|
|
307
|
-
await
|
|
307
|
+
await _chunkNFBOSPNJjs.EmailAutomationStepService.delete({ id });
|
|
308
308
|
if (selectedStepId === id) setSelectedStepId(null);
|
|
309
309
|
await reload();
|
|
310
310
|
},
|
|
@@ -312,8 +312,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
312
312
|
);
|
|
313
313
|
const setNext = _react.useCallback.call(void 0,
|
|
314
314
|
async (stepId, nextStepId) => {
|
|
315
|
-
if (nextStepId) await
|
|
316
|
-
else await
|
|
315
|
+
if (nextStepId) await _chunkNFBOSPNJjs.EmailAutomationStepService.setNext({ stepId, nextStepId });
|
|
316
|
+
else await _chunkNFBOSPNJjs.EmailAutomationStepService.clearNext({ stepId });
|
|
317
317
|
await reload();
|
|
318
318
|
},
|
|
319
319
|
[reload]
|
|
@@ -322,7 +322,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
322
322
|
async (stepId, x, y) => {
|
|
323
323
|
const step = steps.find((candidate) => candidate.id === stepId);
|
|
324
324
|
if (!step) return;
|
|
325
|
-
await
|
|
325
|
+
await _chunkNFBOSPNJjs.EmailAutomationStepService.update({
|
|
326
326
|
id: step.id,
|
|
327
327
|
automationId,
|
|
328
328
|
subject: step.subject,
|
|
@@ -336,7 +336,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
336
336
|
[automationId, reload, steps]
|
|
337
337
|
);
|
|
338
338
|
const tidy = _react.useCallback.call(void 0, async () => {
|
|
339
|
-
await
|
|
339
|
+
await _chunkNFBOSPNJjs.EmailAutomationService.tidy({ id: automationId });
|
|
340
340
|
await reload();
|
|
341
341
|
}, [automationId, reload]);
|
|
342
342
|
const value = _react.useMemo.call(void 0,
|
|
@@ -391,7 +391,7 @@ function EmailAutomationActiveSwitch() {
|
|
|
391
391
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (checked) => {
|
|
392
392
|
setSaving(true);
|
|
393
393
|
try {
|
|
394
|
-
await
|
|
394
|
+
await _chunkNFBOSPNJjs.EmailAutomationService.update({
|
|
395
395
|
id: automation.id,
|
|
396
396
|
name: automation.name,
|
|
397
397
|
trigger: automation.trigger,
|
|
@@ -401,17 +401,17 @@ function EmailAutomationActiveSwitch() {
|
|
|
401
401
|
});
|
|
402
402
|
await reload();
|
|
403
403
|
} catch (error) {
|
|
404
|
-
|
|
404
|
+
_chunk3NLAXVINjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
405
405
|
} finally {
|
|
406
406
|
setSaving(false);
|
|
407
407
|
}
|
|
408
408
|
}, "toggle");
|
|
409
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
410
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
411
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
409
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3NLAXVINjs.Tooltip, { children: [
|
|
410
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3NLAXVINjs.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "flex items-center gap-x-2" }), children: [
|
|
411
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.Switch, { checked: automation.isActive, onCheckedChange: (checked) => void toggle(checked), disabled: saving }),
|
|
412
412
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs", children: t("emailAutomations.fields.isActive.label") })
|
|
413
413
|
] }),
|
|
414
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
414
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.TooltipContent, { className: "max-w-xs", children: t("emailAutomations.fields.isActive.help") })
|
|
415
415
|
] });
|
|
416
416
|
}
|
|
417
417
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationActiveSwitch, "EmailAutomationActiveSwitch");
|
|
@@ -444,7 +444,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
444
444
|
const { zoomIn, zoomOut, fitView } = _react3.useReactFlow.call(void 0, );
|
|
445
445
|
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: [
|
|
446
446
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
447
|
-
|
|
447
|
+
_chunk3NLAXVINjs.Button,
|
|
448
448
|
{
|
|
449
449
|
type: "button",
|
|
450
450
|
variant: "outline",
|
|
@@ -455,7 +455,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
455
455
|
}
|
|
456
456
|
),
|
|
457
457
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
458
|
-
|
|
458
|
+
_chunk3NLAXVINjs.Button,
|
|
459
459
|
{
|
|
460
460
|
type: "button",
|
|
461
461
|
variant: "outline",
|
|
@@ -466,7 +466,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
466
466
|
}
|
|
467
467
|
),
|
|
468
468
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
469
|
-
|
|
469
|
+
_chunk3NLAXVINjs.Button,
|
|
470
470
|
{
|
|
471
471
|
type: "button",
|
|
472
472
|
variant: "outline",
|
|
@@ -477,7 +477,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
477
477
|
}
|
|
478
478
|
),
|
|
479
479
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
480
|
-
|
|
480
|
+
_chunk3NLAXVINjs.Button,
|
|
481
481
|
{
|
|
482
482
|
type: "button",
|
|
483
483
|
variant: "outline",
|
|
@@ -768,14 +768,14 @@ function EmailStepEditorInternal({
|
|
|
768
768
|
defaultValues: getDefaultValues()
|
|
769
769
|
});
|
|
770
770
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
771
|
-
|
|
771
|
+
_chunk3NLAXVINjs.EditorSheet,
|
|
772
772
|
{
|
|
773
773
|
form,
|
|
774
774
|
entityType: t("emailAutomations.step.title"),
|
|
775
775
|
entityName: _optionalChain([step, 'optionalAccess', _18 => _18.subject]),
|
|
776
776
|
title: isEdit ? t("emailAutomations.step.editTitle") : t("emailAutomations.step.title"),
|
|
777
777
|
isEdit,
|
|
778
|
-
module:
|
|
778
|
+
module: _chunkNFBOSPNJjs.Modules.EmailAutomationStep,
|
|
779
779
|
size: "lg",
|
|
780
780
|
onSubmit: async (values) => {
|
|
781
781
|
const payload = {
|
|
@@ -787,7 +787,7 @@ function EmailStepEditorInternal({
|
|
|
787
787
|
positionX: step ? step.positionX : _optionalChain([initialPosition, 'optionalAccess', _19 => _19.x]),
|
|
788
788
|
positionY: step ? step.positionY : _optionalChain([initialPosition, 'optionalAccess', _20 => _20.y])
|
|
789
789
|
};
|
|
790
|
-
return isEdit ? await
|
|
790
|
+
return isEdit ? await _chunkNFBOSPNJjs.EmailAutomationStepService.update(payload) : await _chunkNFBOSPNJjs.EmailAutomationStepService.create(payload);
|
|
791
791
|
},
|
|
792
792
|
onSuccess: async () => {
|
|
793
793
|
await reload();
|
|
@@ -800,9 +800,9 @@ function EmailStepEditorInternal({
|
|
|
800
800
|
dialogOpen,
|
|
801
801
|
onDialogOpenChange,
|
|
802
802
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
803
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
803
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.FormInput, { form, id: "subject", name: t("emailAutomations.step.fields.subject.label"), isRequired: true }),
|
|
804
804
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
805
|
-
|
|
805
|
+
_chunk3NLAXVINjs.FormInput,
|
|
806
806
|
{
|
|
807
807
|
form,
|
|
808
808
|
id: "delayHours",
|
|
@@ -812,7 +812,7 @@ function EmailStepEditorInternal({
|
|
|
812
812
|
}
|
|
813
813
|
),
|
|
814
814
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
815
|
-
|
|
815
|
+
_chunk3NLAXVINjs.FormTextarea,
|
|
816
816
|
{
|
|
817
817
|
form,
|
|
818
818
|
id: "body",
|
|
@@ -952,7 +952,7 @@ var stepIdOf = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (nodeId) =>
|
|
|
952
952
|
function EmailAutomationCanvas() {
|
|
953
953
|
const { automation, steps, triggers, select, reload, createStep, deleteStep, setNext, updatePosition, tidy } = useEmailAutomation();
|
|
954
954
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
955
|
-
const isMobile =
|
|
955
|
+
const isMobile = _chunkNFBOSPNJjs.useIsMobile.call(void 0, );
|
|
956
956
|
const [nodes, setNodes] = _react.useState.call(void 0, []);
|
|
957
957
|
const [edges, setEdges] = _react.useState.call(void 0, []);
|
|
958
958
|
const { screenToFlowPosition } = _react3.useReactFlow.call(void 0, );
|
|
@@ -991,7 +991,7 @@ function EmailAutomationCanvas() {
|
|
|
991
991
|
try {
|
|
992
992
|
await setNext(stepId, nextStepId);
|
|
993
993
|
} catch (error) {
|
|
994
|
-
|
|
994
|
+
_chunk3NLAXVINjs.errorToast.call(void 0, { title: t("emailAutomations.canvas.chainError"), error });
|
|
995
995
|
await reload();
|
|
996
996
|
}
|
|
997
997
|
},
|
|
@@ -1005,7 +1005,7 @@ function EmailAutomationCanvas() {
|
|
|
1005
1005
|
if (!_optionalChain([conn, 'access', _29 => _29.targetHandle, 'optionalAccess', _30 => _30.startsWith, 'call', _31 => _31(STEP_TARGET_HANDLE_PREFIX)])) return;
|
|
1006
1006
|
const targetStepId = conn.targetHandle.slice(STEP_TARGET_HANDLE_PREFIX.length);
|
|
1007
1007
|
if (from.handleId === TRIGGER_SOURCE_HANDLE) {
|
|
1008
|
-
|
|
1008
|
+
_chunkNFBOSPNJjs.showError.call(void 0, t("emailAutomations.canvas.chainError"));
|
|
1009
1009
|
return;
|
|
1010
1010
|
}
|
|
1011
1011
|
if (!from.handleId.startsWith(STEP_SOURCE_HANDLE_PREFIX)) return;
|
|
@@ -1123,7 +1123,7 @@ function EmailAutomationCanvas() {
|
|
|
1123
1123
|
try {
|
|
1124
1124
|
await deleteStep(stepId);
|
|
1125
1125
|
} catch (error) {
|
|
1126
|
-
|
|
1126
|
+
_chunk3NLAXVINjs.errorToast.call(void 0, { title: t("emailAutomations.canvas.deleteEmail"), error });
|
|
1127
1127
|
throw error;
|
|
1128
1128
|
}
|
|
1129
1129
|
}, [pendingDeleteStepId, deleteStep, t]);
|
|
@@ -1186,7 +1186,7 @@ function EmailAutomationCanvas() {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
),
|
|
1188
1188
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1189
|
-
|
|
1189
|
+
_chunk3NLAXVINjs.ConfirmDialog,
|
|
1190
1190
|
{
|
|
1191
1191
|
open: pendingDeleteStepId !== null,
|
|
1192
1192
|
onOpenChange: (open) => {
|
|
@@ -1201,20 +1201,20 @@ function EmailAutomationCanvas() {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
),
|
|
1203
1203
|
paneMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1204
|
-
|
|
1204
|
+
_chunk3NLAXVINjs.ContextMenu,
|
|
1205
1205
|
{
|
|
1206
1206
|
open: true,
|
|
1207
1207
|
onOpenChange: (open) => {
|
|
1208
1208
|
if (!open) setPaneMenu(null);
|
|
1209
1209
|
},
|
|
1210
1210
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1211
|
-
|
|
1211
|
+
_chunk3NLAXVINjs.ContextMenuContent,
|
|
1212
1212
|
{
|
|
1213
1213
|
anchor: pointAnchor(paneMenu.screenX, paneMenu.screenY),
|
|
1214
1214
|
side: "bottom",
|
|
1215
1215
|
align: "start",
|
|
1216
1216
|
sideOffset: 4,
|
|
1217
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1217
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3NLAXVINjs.ContextMenuItem, { onClick: handleCreateStepFromPane, children: [
|
|
1218
1218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PlusIcon, {}),
|
|
1219
1219
|
t("emailAutomations.canvas.addEmail")
|
|
1220
1220
|
] })
|
|
@@ -1223,21 +1223,21 @@ function EmailAutomationCanvas() {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
),
|
|
1225
1225
|
nodeMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1226
|
-
|
|
1226
|
+
_chunk3NLAXVINjs.ContextMenu,
|
|
1227
1227
|
{
|
|
1228
1228
|
open: true,
|
|
1229
1229
|
onOpenChange: (open) => {
|
|
1230
1230
|
if (!open) setNodeMenu(null);
|
|
1231
1231
|
},
|
|
1232
1232
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1233
|
-
|
|
1233
|
+
_chunk3NLAXVINjs.ContextMenuContent,
|
|
1234
1234
|
{
|
|
1235
1235
|
anchor: pointAnchor(nodeMenu.screenX, nodeMenu.screenY),
|
|
1236
1236
|
side: "bottom",
|
|
1237
1237
|
align: "start",
|
|
1238
1238
|
sideOffset: 4,
|
|
1239
1239
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1240
|
-
|
|
1240
|
+
_chunk3NLAXVINjs.ContextMenuItem,
|
|
1241
1241
|
{
|
|
1242
1242
|
onClick: () => {
|
|
1243
1243
|
const menu = nodeMenu;
|
|
@@ -1278,7 +1278,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, TriggerAutomationEditor, "TriggerAutomation
|
|
|
1278
1278
|
// src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx
|
|
1279
1279
|
|
|
1280
1280
|
function EmailAutomationCanvasTab() {
|
|
1281
|
-
const { open, setOpen } =
|
|
1281
|
+
const { open, setOpen } = _chunk3NLAXVINjs.useSidebar.call(void 0, );
|
|
1282
1282
|
_react.useEffect.call(void 0, () => {
|
|
1283
1283
|
const prev = open;
|
|
1284
1284
|
if (prev) setOpen(false);
|
|
@@ -1299,10 +1299,10 @@ function EmailAutomationRecipientsList() {
|
|
|
1299
1299
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1300
1300
|
const { automation } = useEmailAutomation();
|
|
1301
1301
|
const [statusFilter, setStatusFilter] = _react.useState.call(void 0, "all");
|
|
1302
|
-
const data =
|
|
1303
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1302
|
+
const data = _chunk3NLAXVINjs.useDataListRetriever.call(void 0, {
|
|
1303
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkNFBOSPNJjs.EmailAutomationService.findEnrollments(params), "retriever"),
|
|
1304
1304
|
retrieverParams: { automationId: _optionalChain([automation, 'optionalAccess', _44 => _44.id]) },
|
|
1305
|
-
module:
|
|
1305
|
+
module: _chunkNFBOSPNJjs.Modules.EmailAutomationEnrollment
|
|
1306
1306
|
});
|
|
1307
1307
|
const handleStatusChange = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => {
|
|
1308
1308
|
const status = _nullishCoalesce(value, () => ( "all"));
|
|
@@ -1321,21 +1321,21 @@ function EmailAutomationRecipientsList() {
|
|
|
1321
1321
|
[t]
|
|
1322
1322
|
);
|
|
1323
1323
|
const filters = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4", children: [
|
|
1324
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1325
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1326
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1327
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1328
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1329
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1331
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1332
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1324
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3NLAXVINjs.Select, { items: statusItems, value: statusFilter, onValueChange: handleStatusChange, children: [
|
|
1325
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SelectTrigger, { className: "w-40", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SelectValue, {}) }),
|
|
1326
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3NLAXVINjs.SelectContent, { children: [
|
|
1327
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SelectItem, { value: "all", children: t("emailAutomations.recipients.status.all") }),
|
|
1328
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SelectItem, { value: "active", children: t("emailAutomations.recipients.status.active") }),
|
|
1329
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SelectItem, { value: "completed", children: t("emailAutomations.recipients.status.completed") }),
|
|
1330
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SelectItem, { value: "unsubscribed", children: t("emailAutomations.recipients.status.unsubscribed") }),
|
|
1331
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SelectItem, { value: "exited", children: t("emailAutomations.recipients.status.exited") }),
|
|
1332
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SelectItem, { value: "failed", children: t("emailAutomations.recipients.status.failed") })
|
|
1333
1333
|
] })
|
|
1334
1334
|
] }),
|
|
1335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.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" : ""}` }) })
|
|
1336
1336
|
] });
|
|
1337
1337
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1338
|
-
|
|
1338
|
+
_chunk3NLAXVINjs.ContentListTable,
|
|
1339
1339
|
{
|
|
1340
1340
|
data,
|
|
1341
1341
|
fields: [
|
|
@@ -1346,7 +1346,7 @@ function EmailAutomationRecipientsList() {
|
|
|
1346
1346
|
"nextSendAt" /* nextSendAt */,
|
|
1347
1347
|
"sentCount" /* sentCount */
|
|
1348
1348
|
],
|
|
1349
|
-
tableGeneratorType:
|
|
1349
|
+
tableGeneratorType: _chunkNFBOSPNJjs.Modules.EmailAutomationEnrollment,
|
|
1350
1350
|
filters,
|
|
1351
1351
|
allowSearch: false,
|
|
1352
1352
|
emptyState: t("emailAutomations.recipients.empty")
|
|
@@ -1363,15 +1363,15 @@ function EmailAutomationContainer({ automationId }) {
|
|
|
1363
1363
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationContainer, "EmailAutomationContainer");
|
|
1364
1364
|
function EmailAutomationShell() {
|
|
1365
1365
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1366
|
-
const generateUrl =
|
|
1366
|
+
const generateUrl = _chunk3NLAXVINjs.usePageUrlGenerator.call(void 0, );
|
|
1367
1367
|
const { automation, reload } = useEmailAutomation();
|
|
1368
1368
|
if (!automation) return null;
|
|
1369
1369
|
const breadcrumbs = [
|
|
1370
|
-
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page:
|
|
1370
|
+
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page: _chunkNFBOSPNJjs.Modules.EmailAutomation }) },
|
|
1371
1371
|
{ name: automation.name }
|
|
1372
1372
|
];
|
|
1373
1373
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1374
|
-
|
|
1374
|
+
_chunk3NLAXVINjs.SharedProvider,
|
|
1375
1375
|
{
|
|
1376
1376
|
value: {
|
|
1377
1377
|
breadcrumbs,
|
|
@@ -1385,9 +1385,9 @@ function EmailAutomationShell() {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
},
|
|
1387
1387
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1388
|
-
|
|
1388
|
+
_chunk3NLAXVINjs.RoundPageContainer,
|
|
1389
1389
|
{
|
|
1390
|
-
module:
|
|
1390
|
+
module: _chunkNFBOSPNJjs.Modules.EmailAutomation,
|
|
1391
1391
|
id: automation.id,
|
|
1392
1392
|
fullWidth: true,
|
|
1393
1393
|
forceHeader: true,
|
|
@@ -1426,7 +1426,7 @@ function EmailUnsubscribe({ token, scope }) {
|
|
|
1426
1426
|
_react.useEffect.call(void 0, () => {
|
|
1427
1427
|
async function unsubscribe() {
|
|
1428
1428
|
try {
|
|
1429
|
-
const enrollment = await
|
|
1429
|
+
const enrollment = await _chunkNFBOSPNJjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope });
|
|
1430
1430
|
setAutomationName(_nullishCoalesce(_optionalChain([enrollment, 'optionalAccess', _45 => _45.automation, 'optionalAccess', _46 => _46.name]), () => ( "")));
|
|
1431
1431
|
setStoppedScope(scope);
|
|
1432
1432
|
setState("success");
|
|
@@ -1440,7 +1440,7 @@ function EmailUnsubscribe({ token, scope }) {
|
|
|
1440
1440
|
const stopAll = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1441
1441
|
setIsStoppingAll(true);
|
|
1442
1442
|
try {
|
|
1443
|
-
await
|
|
1443
|
+
await _chunkNFBOSPNJjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope: "all" });
|
|
1444
1444
|
setStoppedScope("all");
|
|
1445
1445
|
} catch (e3) {
|
|
1446
1446
|
setState("error");
|
|
@@ -1457,16 +1457,16 @@ function EmailUnsubscribe({ token, scope }) {
|
|
|
1457
1457
|
if (state === "error") {
|
|
1458
1458
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1459
1459
|
/* @__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" }) }),
|
|
1460
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1460
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.invalidTitle") }),
|
|
1461
1461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.invalidBody") })
|
|
1462
1462
|
] });
|
|
1463
1463
|
}
|
|
1464
1464
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1465
1465
|
/* @__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" }) }),
|
|
1466
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1466
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.title") }),
|
|
1467
1467
|
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: [
|
|
1468
1468
|
/* @__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 }) }),
|
|
1469
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1469
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3NLAXVINjs.Button, { variant: "secondary", onClick: stopAll, disabled: isStoppingAll, children: [
|
|
1470
1470
|
isStoppingAll && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
1471
1471
|
t("emailAutomations.unsubscribe.alsoStopAll")
|
|
1472
1472
|
] })
|
|
@@ -1481,7 +1481,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailUnsubscribe, "EmailUnsubscribe");
|
|
|
1481
1481
|
|
|
1482
1482
|
var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1483
1483
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1484
|
-
const generateUrl =
|
|
1484
|
+
const generateUrl = _chunk3NLAXVINjs.usePageUrlGenerator.call(void 0, );
|
|
1485
1485
|
const triggerLabels = _nullishCoalesce(_optionalChain([params, 'access', _47 => _47.context, 'optionalAccess', _48 => _48.triggerLabels]), () => ( {}));
|
|
1486
1486
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1487
1487
|
return params.data.map((automation) => {
|
|
@@ -1510,7 +1510,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1510
1510
|
header: t("emailAutomations.list.columns.name"),
|
|
1511
1511
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1512
1512
|
const automation = row.original.jsonApiData;
|
|
1513
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1513
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.Link, { href: generateUrl({ page: _chunkNFBOSPNJjs.Modules.EmailAutomation, id: automation.id }), children: automation.name });
|
|
1514
1514
|
}, "cell"),
|
|
1515
1515
|
enableSorting: false,
|
|
1516
1516
|
enableHiding: false
|
|
@@ -1533,7 +1533,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1533
1533
|
header: t("emailAutomations.list.columns.status"),
|
|
1534
1534
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1535
1535
|
const automation = row.original.jsonApiData;
|
|
1536
|
-
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1536
|
+
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.Badge, { variant: "softGreen", children: t("emailAutomations.list.status.on") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.Badge, { variant: "softGray", children: t("emailAutomations.list.status.off") });
|
|
1537
1537
|
}, "cell"),
|
|
1538
1538
|
enableSorting: false,
|
|
1539
1539
|
enableHiding: false
|
|
@@ -1556,7 +1556,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1556
1556
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
1557
1557
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1558
1558
|
}, "useEmailAutomationTableStructure");
|
|
1559
|
-
|
|
1559
|
+
_chunk3NLAXVINjs.registerTableGenerator.call(void 0, "email-automations", useEmailAutomationTableStructure);
|
|
1560
1560
|
|
|
1561
1561
|
// src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx
|
|
1562
1562
|
|
|
@@ -1571,7 +1571,7 @@ var STATUS_VARIANTS = {
|
|
|
1571
1571
|
};
|
|
1572
1572
|
var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1573
1573
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1574
|
-
const locale =
|
|
1574
|
+
const locale = _chunkNFBOSPNJjs.dateFormatLocale.call(void 0, _nextintl.useLocale.call(void 0, ));
|
|
1575
1575
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1576
1576
|
return params.data.map((enrollment) => {
|
|
1577
1577
|
const entry = { jsonApiData: enrollment };
|
|
@@ -1612,7 +1612,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1612
1612
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1613
1613
|
const enrollment = row.original.jsonApiData;
|
|
1614
1614
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1615
|
-
|
|
1615
|
+
_chunk3NLAXVINjs.Badge,
|
|
1616
1616
|
{
|
|
1617
1617
|
variant: _nullishCoalesce(STATUS_VARIANTS[enrollment.status], () => ( "softGray")),
|
|
1618
1618
|
title: enrollment.status === "failed" ? enrollment.lastError : void 0,
|
|
@@ -1641,7 +1641,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1641
1641
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1642
1642
|
const enrollment = row.original.jsonApiData;
|
|
1643
1643
|
if (!enrollment.nextSendAt) return empty;
|
|
1644
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children:
|
|
1644
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children: _chunkNFBOSPNJjs.formatDate.call(void 0, enrollment.nextSendAt, "dateTime", locale) });
|
|
1645
1645
|
}, "cell"),
|
|
1646
1646
|
enableSorting: false,
|
|
1647
1647
|
enableHiding: false
|
|
@@ -1663,7 +1663,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1663
1663
|
}, [params.fields, fieldColumnMap, t, locale]);
|
|
1664
1664
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1665
1665
|
}, "useEmailAutomationEnrollmentTableStructure");
|
|
1666
|
-
|
|
1666
|
+
_chunk3NLAXVINjs.registerTableGenerator.call(void 0, "email-automation-enrollments", useEmailAutomationEnrollmentTableStructure);
|
|
1667
1667
|
|
|
1668
1668
|
|
|
1669
1669
|
|
|
@@ -32,8 +32,8 @@ import {
|
|
|
32
32
|
useDataListRetriever,
|
|
33
33
|
usePageUrlGenerator,
|
|
34
34
|
useSidebar
|
|
35
|
-
} from "../chunk-
|
|
36
|
-
import "../chunk-
|
|
35
|
+
} from "../chunk-EUKTBOI2.mjs";
|
|
36
|
+
import "../chunk-QMYQRPQC.mjs";
|
|
37
37
|
import "../chunk-PW42LRSL.mjs";
|
|
38
38
|
import {
|
|
39
39
|
EmailAutomationEnrollmentService,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
showError,
|
|
46
46
|
useI18nRouter,
|
|
47
47
|
useIsMobile
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-WC63PJSC.mjs";
|
|
49
49
|
import "../chunk-AUXK7QSA.mjs";
|
|
50
50
|
import "../chunk-PI56A4DG.mjs";
|
|
51
51
|
import "../chunk-V5MI7RNB.mjs";
|