@carlonicora/nextjs-jsonapi 6.12.2 → 6.13.1
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/{ApiData-DPKNfY-9.d.mts → ApiData-Be8yxCOX.d.mts} +2 -0
- package/dist/{ApiData-DPKNfY-9.d.ts → ApiData-Be8yxCOX.d.ts} +2 -0
- package/dist/{BlockNoteEditor-7M5QW2YQ.js → BlockNoteEditor-UBVEUFNR.js} +34 -22
- package/dist/BlockNoteEditor-UBVEUFNR.js.map +1 -0
- package/dist/{BlockNoteEditor-75ED2CN2.mjs → BlockNoteEditor-VXMDSQAA.mjs} +20 -8
- package/dist/BlockNoteEditor-VXMDSQAA.mjs.map +1 -0
- package/dist/{BlockNoteViewer-WGCDB7IJ.js → BlockNoteViewer-2XYASA5Y.js} +8 -5
- package/dist/BlockNoteViewer-2XYASA5Y.js.map +1 -0
- package/dist/{BlockNoteViewer-MTGS6YJV.mjs → BlockNoteViewer-NBW2H6LC.mjs} +7 -4
- package/dist/{BlockNoteViewer-MTGS6YJV.mjs.map → BlockNoteViewer-NBW2H6LC.mjs.map} +1 -1
- package/dist/{JsonApiRequest-A66XK5WT.mjs → JsonApiRequest-F6TMJ42G.mjs} +2 -2
- package/dist/JsonApiRequest-WISJZSDE.js +26 -0
- package/dist/{JsonApiRequest-FZGPLNUF.js.map → JsonApiRequest-WISJZSDE.js.map} +1 -1
- package/dist/billing/index.js +499 -494
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +13 -8
- package/dist/billing/index.mjs.map +1 -1
- package/dist/chunk-27LQDGNP.mjs +317 -0
- package/dist/chunk-27LQDGNP.mjs.map +1 -0
- package/dist/{chunk-KSYQEKJX.js → chunk-2SV4SS6N.js} +14 -14
- package/dist/{chunk-KSYQEKJX.js.map → chunk-2SV4SS6N.js.map} +1 -1
- package/dist/{chunk-4FNGWALA.mjs → chunk-47BBY5KA.mjs} +6 -4
- package/dist/{chunk-4FNGWALA.mjs.map → chunk-47BBY5KA.mjs.map} +1 -1
- package/dist/chunk-6JUCIWDC.mjs +570 -0
- package/dist/chunk-6JUCIWDC.mjs.map +1 -0
- package/dist/chunk-7DBJTNSU.mjs +1049 -0
- package/dist/chunk-7DBJTNSU.mjs.map +1 -0
- package/dist/chunk-7JZHPMGW.mjs +704 -0
- package/dist/chunk-7JZHPMGW.mjs.map +1 -0
- package/dist/{chunk-L6PYFQTO.js → chunk-7ZHTPFFT.js} +16 -14
- package/dist/chunk-7ZHTPFFT.js.map +1 -0
- package/dist/chunk-B6JGKDP2.js +214 -0
- package/dist/chunk-B6JGKDP2.js.map +1 -0
- package/dist/{chunk-3YW35YHQ.mjs → chunk-BH6JWIKI.mjs} +5 -5
- package/dist/chunk-BZ5J2FIV.js +570 -0
- package/dist/chunk-BZ5J2FIV.js.map +1 -0
- package/dist/{chunk-V5MI7RNB.mjs → chunk-DGWOVYEC.mjs} +2 -2
- package/dist/chunk-DOCIFE6A.mjs +212 -0
- package/dist/chunk-DOCIFE6A.mjs.map +1 -0
- package/dist/chunk-GB6DBFYY.js +25 -0
- package/dist/chunk-GB6DBFYY.js.map +1 -0
- package/dist/{chunk-EWCY6QJA.mjs → chunk-JJMMT24D.mjs} +37 -3
- package/dist/chunk-JJMMT24D.mjs.map +1 -0
- package/dist/{chunk-JTPRJNT2.js → chunk-KMW7UNL2.js} +38 -3
- package/dist/chunk-KMW7UNL2.js.map +1 -0
- package/dist/chunk-MHB36MYE.js +317 -0
- package/dist/chunk-MHB36MYE.js.map +1 -0
- package/dist/{chunk-FF4EIQ6H.js → chunk-MOGEGWXW.js} +1039 -1680
- package/dist/chunk-MOGEGWXW.js.map +1 -0
- package/dist/{chunk-RXQYEEKZ.mjs → chunk-N4RZZKL5.mjs} +58 -25
- package/dist/chunk-N4RZZKL5.mjs.map +1 -0
- package/dist/{chunk-AA52ORW2.mjs → chunk-P445QGOC.mjs} +61 -702
- package/dist/chunk-P445QGOC.mjs.map +1 -0
- package/dist/chunk-PV4Z5W6V.js +212 -0
- package/dist/chunk-PV4Z5W6V.js.map +1 -0
- package/dist/chunk-PXDUJ47N.js +1049 -0
- package/dist/chunk-PXDUJ47N.js.map +1 -0
- package/dist/{chunk-V3YDVJ63.js → chunk-PYRZCKC2.js} +1209 -1176
- package/dist/chunk-PYRZCKC2.js.map +1 -0
- package/dist/{chunk-GHE4VT2R.js → chunk-QKNGZDSQ.js} +2 -2
- package/dist/{chunk-GHE4VT2R.js.map → chunk-QKNGZDSQ.js.map} +1 -1
- package/dist/chunk-W62MHDWM.js +704 -0
- package/dist/chunk-W62MHDWM.js.map +1 -0
- package/dist/chunk-XXP3TQHF.mjs +25 -0
- package/dist/chunk-XXP3TQHF.mjs.map +1 -0
- package/dist/chunk-YRKIFYOE.mjs +214 -0
- package/dist/chunk-YRKIFYOE.mjs.map +1 -0
- package/dist/{chunk-O3PDL2CV.js → chunk-Z4POQWFG.js} +40 -6
- package/dist/chunk-Z4POQWFG.js.map +1 -0
- package/dist/{chunk-PI56A4DG.mjs → chunk-ZLTOUZN2.mjs} +37 -2
- package/dist/chunk-ZLTOUZN2.mjs.map +1 -0
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +14 -9
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +24 -19
- package/dist/components/index.d.mts +7 -1
- package/dist/components/index.d.ts +7 -1
- package/dist/components/index.js +11 -7
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +10 -6
- package/dist/contexts/index.d.mts +1 -1
- package/dist/contexts/index.d.ts +1 -1
- package/dist/contexts/index.js +11 -7
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +10 -6
- package/dist/core/index.d.mts +128 -2
- package/dist/core/index.d.ts +128 -2
- package/dist/core/index.js +17 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +22 -9
- package/dist/email-automations/index.js +101 -96
- package/dist/email-automations/index.js.map +1 -1
- package/dist/email-automations/index.mjs +13 -8
- package/dist/email-automations/index.mjs.map +1 -1
- package/dist/features/analytics/index.js +128 -123
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/index.mjs +13 -8
- package/dist/features/analytics/index.mjs.map +1 -1
- package/dist/features/analytics/server.js +11 -8
- package/dist/features/analytics/server.js.map +1 -1
- package/dist/features/analytics/server.mjs +9 -6
- package/dist/features/analytics/server.mjs.map +1 -1
- package/dist/features/blog/index.js +158 -153
- package/dist/features/blog/index.js.map +1 -1
- package/dist/features/blog/index.mjs +14 -9
- package/dist/features/blog/index.mjs.map +1 -1
- package/dist/features/blog/server.js +30 -26
- package/dist/features/blog/server.js.map +1 -1
- package/dist/features/blog/server.mjs +10 -6
- package/dist/features/blog/server.mjs.map +1 -1
- package/dist/features/help/index.js +44 -40
- package/dist/features/help/index.js.map +1 -1
- package/dist/features/help/index.mjs +10 -6
- package/dist/features/help/index.mjs.map +1 -1
- package/dist/features/tokenusage/index.js +134 -129
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +13 -8
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -11
- package/dist/lifecycle-4GUOTB46.js +23 -0
- package/dist/lifecycle-4GUOTB46.js.map +1 -0
- package/dist/lifecycle-LKGPRBS7.mjs +23 -0
- package/dist/local-transport-7H3SPZSA.js +15 -0
- package/dist/local-transport-7H3SPZSA.js.map +1 -0
- package/dist/local-transport-QYFKA6AN.mjs +15 -0
- package/dist/local-transport-QYFKA6AN.mjs.map +1 -0
- package/dist/offline/index.d.mts +607 -0
- package/dist/offline/index.d.ts +607 -0
- package/dist/offline/index.js +1052 -0
- package/dist/offline/index.js.map +1 -0
- package/dist/offline/index.mjs +1052 -0
- package/dist/offline/index.mjs.map +1 -0
- package/dist/offline/sqlite/device-worker.mjs +62 -0
- package/dist/offline/sqlite/index.mjs +17392 -0
- package/dist/offline/sqlite/sqlite3-opfs-async-proxy.js +881 -0
- package/dist/offline/sqlite/sqlite3.wasm +0 -0
- package/dist/request-KTBV6HHH.js +10 -0
- package/dist/request-KTBV6HHH.js.map +1 -0
- package/dist/request-SQOUNWZ4.mjs +10 -0
- package/dist/request-SQOUNWZ4.mjs.map +1 -0
- package/dist/server/cachedGet.d.mts +1 -1
- package/dist/server/cachedGet.d.ts +1 -1
- package/dist/server/cachedGet.stub.d.mts +1 -1
- package/dist/server/cachedGet.stub.d.ts +1 -1
- package/dist/server/index.d.mts +28 -2
- package/dist/server/index.d.ts +28 -2
- package/dist/server/index.js +18 -8
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +18 -8
- package/dist/{useSocket-IRHtk2xc.d.ts → useSocket-Bo9M0t0J.d.ts} +3 -1
- package/dist/{useSocket-C8fqU4od.d.mts → useSocket-J5qanQPN.d.mts} +3 -1
- package/dist/write-through-FDQ7N4YI.js +15 -0
- package/dist/write-through-FDQ7N4YI.js.map +1 -0
- package/dist/write-through-R25VQMH6.mjs +15 -0
- package/dist/write-through-R25VQMH6.mjs.map +1 -0
- package/package.json +7 -1
- package/pwa/sw.js +277 -26
- package/src/client/request.ts +37 -0
- package/src/components/editors/BlockNoteEditor.tsx +14 -0
- package/src/components/editors/__tests__/BlockNoteEditor.empty-change.spec.tsx +205 -0
- package/src/contexts/SocketContext.tsx +7 -1
- package/src/contexts/__tests__/SocketContext.session.spec.tsx +52 -5
- package/src/core/factories/RehydrationFactory.ts +28 -8
- package/src/core/factories/__tests__/RehydrationFactory.spec.ts +33 -0
- package/src/core/index.ts +3 -0
- package/src/core/interfaces/ApiData.ts +2 -0
- package/src/core/registry/ModuleRegistry.ts +3 -0
- package/src/features/auth/components/forms/Logout.tsx +8 -1
- package/src/features/auth/components/forms/__tests__/Logout.spec.tsx +62 -0
- package/src/features/onboarding/contexts/OnboardingContext.spec.tsx +42 -1
- package/src/features/onboarding/contexts/OnboardingContext.tsx +11 -1
- package/src/hooks/__tests__/useSocket.pause.spec.ts +39 -0
- package/src/hooks/useSocket.ts +20 -1
- package/src/offline/__tests__/answer-builders.spec.ts +176 -0
- package/src/offline/__tests__/device-switch.spec.ts +179 -0
- package/src/offline/__tests__/generic-answers.spec.ts +380 -0
- package/src/offline/__tests__/local-transport.spec.ts +150 -0
- package/src/offline/__tests__/logout.spec.ts +122 -0
- package/src/offline/__tests__/offline-fixtures.ts +89 -0
- package/src/offline/__tests__/router.spec.ts +56 -0
- package/src/offline/__tests__/state.spec.ts +62 -0
- package/src/offline/__tests__/write-through.spec.ts +137 -0
- package/src/offline/config.ts +229 -0
- package/src/offline/configure.ts +14 -0
- package/src/offline/device-switch.ts +75 -0
- package/src/offline/generic-answers.ts +706 -0
- package/src/offline/index.ts +67 -0
- package/src/offline/local-transport.ts +189 -0
- package/src/offline/logout.ts +41 -0
- package/src/offline/router.ts +41 -0
- package/src/offline/server/__tests__/build-offline-manifest.spec.ts +76 -0
- package/src/offline/server/build-offline-manifest.ts +49 -0
- package/src/offline/state-hooks.ts +10 -0
- package/src/offline/state.ts +143 -0
- package/src/offline/store/DeviceStore.ts +112 -0
- package/src/offline/store/__tests__/device-store-lifecycle.spec.ts +343 -0
- package/src/offline/store/__tests__/shared-database.spec.ts +151 -0
- package/src/offline/store/__tests__/sql-device-store.spec.ts +399 -0
- package/src/offline/store/lifecycle.ts +315 -0
- package/src/offline/store/schema.ts +101 -0
- package/src/offline/store/shared-database.ts +321 -0
- package/src/offline/store/sql-device-store.ts +469 -0
- package/src/offline/store/worker-client.ts +71 -0
- package/src/offline/store/worker.ts +87 -0
- package/src/offline/sync/__tests__/conflicts.spec.ts +185 -0
- package/src/offline/sync/__tests__/queue-drain.spec.ts +364 -0
- package/src/offline/sync/__tests__/runtime.spec.ts +337 -0
- package/src/offline/sync/__tests__/sync-fixtures.ts +103 -0
- package/src/offline/sync/__tests__/sync-root.spec.ts +727 -0
- package/src/offline/sync/artwork-cache.ts +67 -0
- package/src/offline/sync/conflicts.ts +211 -0
- package/src/offline/sync/counts.ts +39 -0
- package/src/offline/sync/drain-queue.ts +246 -0
- package/src/offline/sync/known-roots.ts +37 -0
- package/src/offline/sync/models/OfflineChangeSet.ts +34 -0
- package/src/offline/sync/models/OfflineChangeSetInterface.ts +54 -0
- package/src/offline/sync/models/RootSync.ts +68 -0
- package/src/offline/sync/models/RootSyncInterface.ts +20 -0
- package/src/offline/sync/models/__tests__/OfflineChangeSet.spec.ts +47 -0
- package/src/offline/sync/models/__tests__/RootSync.spec.ts +54 -0
- package/src/offline/sync/models/index.ts +5 -0
- package/src/offline/sync/models/offline.modules.ts +14 -0
- package/src/offline/sync/runtime.ts +226 -0
- package/src/offline/sync/session-refresh.ts +32 -0
- package/src/offline/sync/sync-root.ts +336 -0
- package/src/offline/sync/waiting.ts +40 -0
- package/src/offline/types.ts +115 -0
- package/src/offline/write-through.ts +189 -0
- package/src/pwa/__tests__/sw.spec.ts +358 -1
- package/src/server/index.ts +5 -0
- package/src/unified/__tests__/JsonApiRequest.offline.spec.ts +243 -0
- package/dist/BlockNoteEditor-75ED2CN2.mjs.map +0 -1
- package/dist/BlockNoteEditor-7M5QW2YQ.js.map +0 -1
- package/dist/BlockNoteViewer-WGCDB7IJ.js.map +0 -1
- package/dist/JsonApiRequest-FZGPLNUF.js +0 -26
- package/dist/chunk-AA52ORW2.mjs.map +0 -1
- package/dist/chunk-EWCY6QJA.mjs.map +0 -1
- package/dist/chunk-FF4EIQ6H.js.map +0 -1
- package/dist/chunk-JTPRJNT2.js.map +0 -1
- package/dist/chunk-L6PYFQTO.js.map +0 -1
- package/dist/chunk-O3PDL2CV.js.map +0 -1
- package/dist/chunk-PI56A4DG.mjs.map +0 -1
- package/dist/chunk-RXQYEEKZ.mjs.map +0 -1
- package/dist/chunk-V3YDVJ63.js.map +0 -1
- package/dist/request-5RLK2AM3.mjs +0 -9
- package/dist/request-EUGTI3BE.js +0 -9
- package/dist/request-EUGTI3BE.js.map +0 -1
- /package/dist/{JsonApiRequest-A66XK5WT.mjs.map → JsonApiRequest-F6TMJ42G.mjs.map} +0 -0
- /package/dist/{chunk-3YW35YHQ.mjs.map → chunk-BH6JWIKI.mjs.map} +0 -0
- /package/dist/{chunk-V5MI7RNB.mjs.map → chunk-DGWOVYEC.mjs.map} +0 -0
- /package/dist/{request-5RLK2AM3.mjs.map → lifecycle-LKGPRBS7.mjs.map} +0 -0
|
@@ -31,8 +31,9 @@
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
35
|
-
require('../chunk-
|
|
34
|
+
var _chunkPYRZCKC2js = require('../chunk-PYRZCKC2.js');
|
|
35
|
+
require('../chunk-3EPNHTMH.js');
|
|
36
|
+
require('../chunk-7ZHTPFFT.js');
|
|
36
37
|
require('../chunk-G4JR3SFV.js');
|
|
37
38
|
|
|
38
39
|
|
|
@@ -43,13 +44,17 @@ require('../chunk-G4JR3SFV.js');
|
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
|
|
47
|
+
var _chunkMOGEGWXWjs = require('../chunk-MOGEGWXW.js');
|
|
48
|
+
require('../chunk-GB6DBFYY.js');
|
|
49
|
+
|
|
46
50
|
|
|
47
51
|
|
|
48
|
-
var
|
|
49
|
-
require('../chunk-
|
|
52
|
+
var _chunkBZ5J2FIVjs = require('../chunk-BZ5J2FIV.js');
|
|
53
|
+
require('../chunk-PV4Z5W6V.js');
|
|
54
|
+
require('../chunk-KMW7UNL2.js');
|
|
55
|
+
require('../chunk-MHB36MYE.js');
|
|
56
|
+
require('../chunk-QKNGZDSQ.js');
|
|
50
57
|
require('../chunk-LXKSUWAV.js');
|
|
51
|
-
require('../chunk-JTPRJNT2.js');
|
|
52
|
-
require('../chunk-3EPNHTMH.js');
|
|
53
58
|
|
|
54
59
|
|
|
55
60
|
var _chunk7QVYU63Ejs = require('../chunk-7QVYU63E.js');
|
|
@@ -81,12 +86,12 @@ function EmailAutomationEditorInternal({
|
|
|
81
86
|
onDialogOpenChange
|
|
82
87
|
}) {
|
|
83
88
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
84
|
-
const router =
|
|
89
|
+
const router = _chunkBZ5J2FIVjs.useI18nRouter.call(void 0, );
|
|
85
90
|
const isEdit = !!automation;
|
|
86
91
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
87
92
|
_react.useEffect.call(void 0, () => {
|
|
88
93
|
let active = true;
|
|
89
|
-
|
|
94
|
+
_chunkMOGEGWXWjs.EmailAutomationService.findTriggers().then((list) => {
|
|
90
95
|
if (active) setTriggers(list);
|
|
91
96
|
}).catch(() => {
|
|
92
97
|
});
|
|
@@ -124,14 +129,14 @@ function EmailAutomationEditorInternal({
|
|
|
124
129
|
defaultValues: getDefaultValues()
|
|
125
130
|
});
|
|
126
131
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
127
|
-
|
|
132
|
+
_chunkPYRZCKC2js.EditorSheet,
|
|
128
133
|
{
|
|
129
134
|
form,
|
|
130
135
|
entityType: t("emailAutomations.admin.title"),
|
|
131
136
|
entityName: _optionalChain([automation, 'optionalAccess', _7 => _7.name]),
|
|
132
137
|
title: isEdit ? t("emailAutomations.admin.editAutomation") : t("emailAutomations.admin.newAutomation"),
|
|
133
138
|
isEdit,
|
|
134
|
-
module:
|
|
139
|
+
module: _chunkBZ5J2FIVjs.Modules.EmailAutomation,
|
|
135
140
|
size: "md",
|
|
136
141
|
propagateChanges,
|
|
137
142
|
onSuccess,
|
|
@@ -145,7 +150,7 @@ function EmailAutomationEditorInternal({
|
|
|
145
150
|
replyTo: values.replyTo || void 0,
|
|
146
151
|
isActive: values.isActive
|
|
147
152
|
};
|
|
148
|
-
return isEdit ? await
|
|
153
|
+
return isEdit ? await _chunkMOGEGWXWjs.EmailAutomationService.update(payload) : await _chunkMOGEGWXWjs.EmailAutomationService.create(payload);
|
|
149
154
|
},
|
|
150
155
|
onReset: getDefaultValues,
|
|
151
156
|
trigger,
|
|
@@ -154,9 +159,9 @@ function EmailAutomationEditorInternal({
|
|
|
154
159
|
dialogOpen,
|
|
155
160
|
onDialogOpenChange,
|
|
156
161
|
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,
|
|
162
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.FormInput, { form, id: "name", name: t("emailAutomations.fields.name.label"), isRequired: true }),
|
|
158
163
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
159
|
-
|
|
164
|
+
_chunkPYRZCKC2js.FormSelect,
|
|
160
165
|
{
|
|
161
166
|
form,
|
|
162
167
|
id: "trigger",
|
|
@@ -167,7 +172,7 @@ function EmailAutomationEditorInternal({
|
|
|
167
172
|
}
|
|
168
173
|
),
|
|
169
174
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
170
|
-
|
|
175
|
+
_chunkPYRZCKC2js.FormSelect,
|
|
171
176
|
{
|
|
172
177
|
form,
|
|
173
178
|
id: "exitTrigger",
|
|
@@ -177,9 +182,9 @@ function EmailAutomationEditorInternal({
|
|
|
177
182
|
allowEmpty: true
|
|
178
183
|
}
|
|
179
184
|
),
|
|
180
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
185
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.FormInput, { form, id: "replyTo", name: t("emailAutomations.fields.replyTo.label") }),
|
|
181
186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
182
|
-
|
|
187
|
+
_chunkPYRZCKC2js.FormSwitch,
|
|
183
188
|
{
|
|
184
189
|
form,
|
|
185
190
|
id: "isActive",
|
|
@@ -203,14 +208,14 @@ var EmailAutomationEditor_default = EmailAutomationEditor;
|
|
|
203
208
|
function EmailAutomationsList({ fullWidth } = {}) {
|
|
204
209
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
205
210
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
206
|
-
const data =
|
|
207
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
211
|
+
const data = _chunkPYRZCKC2js.useDataListRetriever.call(void 0, {
|
|
212
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkMOGEGWXWjs.EmailAutomationService.findMany(params), "retriever"),
|
|
208
213
|
retrieverParams: {},
|
|
209
|
-
module:
|
|
214
|
+
module: _chunkBZ5J2FIVjs.Modules.EmailAutomation
|
|
210
215
|
});
|
|
211
216
|
_react.useEffect.call(void 0, () => {
|
|
212
217
|
let active = true;
|
|
213
|
-
|
|
218
|
+
_chunkMOGEGWXWjs.EmailAutomationService.findTriggers().then((list) => {
|
|
214
219
|
if (active) setTriggers(list);
|
|
215
220
|
}).catch(() => {
|
|
216
221
|
});
|
|
@@ -224,7 +229,7 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
224
229
|
);
|
|
225
230
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationEditor_default, {}, "create-email-automation")];
|
|
226
231
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
227
|
-
|
|
232
|
+
_chunkPYRZCKC2js.ContentListTable,
|
|
228
233
|
{
|
|
229
234
|
data,
|
|
230
235
|
fields: [
|
|
@@ -236,12 +241,12 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
236
241
|
"completed" /* completed */,
|
|
237
242
|
"unsubscribed" /* unsubscribed */
|
|
238
243
|
],
|
|
239
|
-
tableGeneratorType:
|
|
244
|
+
tableGeneratorType: _chunkBZ5J2FIVjs.Modules.EmailAutomation,
|
|
240
245
|
functions,
|
|
241
246
|
fullWidth,
|
|
242
247
|
title: t("emailAutomations.admin.title"),
|
|
243
248
|
context: { triggerLabels },
|
|
244
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
249
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.EmptyState, { icon: _lucidereact.MailIcon, title: t("emailAutomations.admin.empty") })
|
|
245
250
|
}
|
|
246
251
|
);
|
|
247
252
|
}
|
|
@@ -252,7 +257,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsList, "EmailAutomationsList
|
|
|
252
257
|
function EmailAutomationsListContainer() {
|
|
253
258
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
254
259
|
const breadcrumbs = [{ name: t("emailAutomations.admin.title") }];
|
|
255
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
260
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SharedProvider, { value: { breadcrumbs, title: { type: t("emailAutomations.admin.title") } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.RoundPageContainer, { module: _chunkBZ5J2FIVjs.Modules.EmailAutomation, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationsList, { fullWidth: true }) }) });
|
|
256
261
|
}
|
|
257
262
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsListContainer, "EmailAutomationsListContainer");
|
|
258
263
|
|
|
@@ -271,8 +276,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
271
276
|
const [selectedStepId, setSelectedStepId] = _react.useState.call(void 0, null);
|
|
272
277
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
273
278
|
const [loadedAutomation, loadedSteps] = await Promise.all([
|
|
274
|
-
|
|
275
|
-
|
|
279
|
+
_chunkMOGEGWXWjs.EmailAutomationService.findOne({ id: automationId }),
|
|
280
|
+
_chunkMOGEGWXWjs.EmailAutomationStepService.findByAutomation({ automationId })
|
|
276
281
|
]);
|
|
277
282
|
setAutomation(loadedAutomation);
|
|
278
283
|
setSteps(loadedSteps);
|
|
@@ -282,7 +287,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
282
287
|
}, [reload]);
|
|
283
288
|
_react.useEffect.call(void 0, () => {
|
|
284
289
|
let active = true;
|
|
285
|
-
|
|
290
|
+
_chunkMOGEGWXWjs.EmailAutomationService.findTriggers().then((list) => {
|
|
286
291
|
if (active) setTriggers(list);
|
|
287
292
|
}).catch(() => {
|
|
288
293
|
});
|
|
@@ -293,7 +298,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
293
298
|
const select = _react.useCallback.call(void 0, (id) => setSelectedStepId(id), []);
|
|
294
299
|
const createStep = _react.useCallback.call(void 0,
|
|
295
300
|
async (input) => {
|
|
296
|
-
const saved = await
|
|
301
|
+
const saved = await _chunkMOGEGWXWjs.EmailAutomationStepService.create({ ...input, id: _nullishCoalesce(input.id, () => ( _uuid.v4.call(void 0, ))), automationId });
|
|
297
302
|
await reload();
|
|
298
303
|
return saved;
|
|
299
304
|
},
|
|
@@ -301,7 +306,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
301
306
|
);
|
|
302
307
|
const updateStep = _react.useCallback.call(void 0,
|
|
303
308
|
async (input) => {
|
|
304
|
-
const saved = await
|
|
309
|
+
const saved = await _chunkMOGEGWXWjs.EmailAutomationStepService.update({ ...input, automationId });
|
|
305
310
|
await reload();
|
|
306
311
|
return saved;
|
|
307
312
|
},
|
|
@@ -309,7 +314,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
309
314
|
);
|
|
310
315
|
const deleteStep = _react.useCallback.call(void 0,
|
|
311
316
|
async (id) => {
|
|
312
|
-
await
|
|
317
|
+
await _chunkMOGEGWXWjs.EmailAutomationStepService.delete({ id });
|
|
313
318
|
if (selectedStepId === id) setSelectedStepId(null);
|
|
314
319
|
await reload();
|
|
315
320
|
},
|
|
@@ -317,8 +322,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
317
322
|
);
|
|
318
323
|
const setNext = _react.useCallback.call(void 0,
|
|
319
324
|
async (stepId, nextStepId) => {
|
|
320
|
-
if (nextStepId) await
|
|
321
|
-
else await
|
|
325
|
+
if (nextStepId) await _chunkMOGEGWXWjs.EmailAutomationStepService.setNext({ stepId, nextStepId });
|
|
326
|
+
else await _chunkMOGEGWXWjs.EmailAutomationStepService.clearNext({ stepId });
|
|
322
327
|
await reload();
|
|
323
328
|
},
|
|
324
329
|
[reload]
|
|
@@ -327,7 +332,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
327
332
|
async (stepId, x, y) => {
|
|
328
333
|
const step = steps.find((candidate) => candidate.id === stepId);
|
|
329
334
|
if (!step) return;
|
|
330
|
-
await
|
|
335
|
+
await _chunkMOGEGWXWjs.EmailAutomationStepService.update({
|
|
331
336
|
id: step.id,
|
|
332
337
|
automationId,
|
|
333
338
|
subject: step.subject,
|
|
@@ -341,7 +346,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
341
346
|
[automationId, reload, steps]
|
|
342
347
|
);
|
|
343
348
|
const tidy = _react.useCallback.call(void 0, async () => {
|
|
344
|
-
await
|
|
349
|
+
await _chunkMOGEGWXWjs.EmailAutomationService.tidy({ id: automationId });
|
|
345
350
|
await reload();
|
|
346
351
|
}, [automationId, reload]);
|
|
347
352
|
const value = _react.useMemo.call(void 0,
|
|
@@ -396,7 +401,7 @@ function EmailAutomationActiveSwitch() {
|
|
|
396
401
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (checked) => {
|
|
397
402
|
setSaving(true);
|
|
398
403
|
try {
|
|
399
|
-
await
|
|
404
|
+
await _chunkMOGEGWXWjs.EmailAutomationService.update({
|
|
400
405
|
id: automation.id,
|
|
401
406
|
name: automation.name,
|
|
402
407
|
trigger: automation.trigger,
|
|
@@ -406,17 +411,17 @@ function EmailAutomationActiveSwitch() {
|
|
|
406
411
|
});
|
|
407
412
|
await reload();
|
|
408
413
|
} catch (error) {
|
|
409
|
-
|
|
414
|
+
_chunkPYRZCKC2js.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
410
415
|
} finally {
|
|
411
416
|
setSaving(false);
|
|
412
417
|
}
|
|
413
418
|
}, "toggle");
|
|
414
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
415
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
416
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
419
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPYRZCKC2js.Tooltip, { children: [
|
|
420
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPYRZCKC2js.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "flex items-center gap-x-2" }), children: [
|
|
421
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.Switch, { checked: automation.isActive, onCheckedChange: (checked) => void toggle(checked), disabled: saving }),
|
|
417
422
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs", children: t("emailAutomations.fields.isActive.label") })
|
|
418
423
|
] }),
|
|
419
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
424
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.TooltipContent, { className: "max-w-xs", children: t("emailAutomations.fields.isActive.help") })
|
|
420
425
|
] });
|
|
421
426
|
}
|
|
422
427
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationActiveSwitch, "EmailAutomationActiveSwitch");
|
|
@@ -449,7 +454,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
449
454
|
const { zoomIn, zoomOut, fitView } = _react3.useReactFlow.call(void 0, );
|
|
450
455
|
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
456
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
452
|
-
|
|
457
|
+
_chunkPYRZCKC2js.Button,
|
|
453
458
|
{
|
|
454
459
|
type: "button",
|
|
455
460
|
variant: "outline",
|
|
@@ -460,7 +465,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
460
465
|
}
|
|
461
466
|
),
|
|
462
467
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
463
|
-
|
|
468
|
+
_chunkPYRZCKC2js.Button,
|
|
464
469
|
{
|
|
465
470
|
type: "button",
|
|
466
471
|
variant: "outline",
|
|
@@ -471,7 +476,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
471
476
|
}
|
|
472
477
|
),
|
|
473
478
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
474
|
-
|
|
479
|
+
_chunkPYRZCKC2js.Button,
|
|
475
480
|
{
|
|
476
481
|
type: "button",
|
|
477
482
|
variant: "outline",
|
|
@@ -482,7 +487,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
482
487
|
}
|
|
483
488
|
),
|
|
484
489
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
485
|
-
|
|
490
|
+
_chunkPYRZCKC2js.Button,
|
|
486
491
|
{
|
|
487
492
|
type: "button",
|
|
488
493
|
variant: "outline",
|
|
@@ -773,14 +778,14 @@ function EmailStepEditorInternal({
|
|
|
773
778
|
defaultValues: getDefaultValues()
|
|
774
779
|
});
|
|
775
780
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
776
|
-
|
|
781
|
+
_chunkPYRZCKC2js.EditorSheet,
|
|
777
782
|
{
|
|
778
783
|
form,
|
|
779
784
|
entityType: t("emailAutomations.step.title"),
|
|
780
785
|
entityName: _optionalChain([step, 'optionalAccess', _18 => _18.subject]),
|
|
781
786
|
title: isEdit ? t("emailAutomations.step.editTitle") : t("emailAutomations.step.title"),
|
|
782
787
|
isEdit,
|
|
783
|
-
module:
|
|
788
|
+
module: _chunkBZ5J2FIVjs.Modules.EmailAutomationStep,
|
|
784
789
|
size: "lg",
|
|
785
790
|
onSubmit: async (values) => {
|
|
786
791
|
const payload = {
|
|
@@ -792,7 +797,7 @@ function EmailStepEditorInternal({
|
|
|
792
797
|
positionX: step ? step.positionX : _optionalChain([initialPosition, 'optionalAccess', _19 => _19.x]),
|
|
793
798
|
positionY: step ? step.positionY : _optionalChain([initialPosition, 'optionalAccess', _20 => _20.y])
|
|
794
799
|
};
|
|
795
|
-
return isEdit ? await
|
|
800
|
+
return isEdit ? await _chunkMOGEGWXWjs.EmailAutomationStepService.update(payload) : await _chunkMOGEGWXWjs.EmailAutomationStepService.create(payload);
|
|
796
801
|
},
|
|
797
802
|
onSuccess: async () => {
|
|
798
803
|
await reload();
|
|
@@ -805,9 +810,9 @@ function EmailStepEditorInternal({
|
|
|
805
810
|
dialogOpen,
|
|
806
811
|
onDialogOpenChange,
|
|
807
812
|
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,
|
|
813
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.FormInput, { form, id: "subject", name: t("emailAutomations.step.fields.subject.label"), isRequired: true }),
|
|
809
814
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
810
|
-
|
|
815
|
+
_chunkPYRZCKC2js.FormInput,
|
|
811
816
|
{
|
|
812
817
|
form,
|
|
813
818
|
id: "delayHours",
|
|
@@ -817,7 +822,7 @@ function EmailStepEditorInternal({
|
|
|
817
822
|
}
|
|
818
823
|
),
|
|
819
824
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
820
|
-
|
|
825
|
+
_chunkPYRZCKC2js.FormTextarea,
|
|
821
826
|
{
|
|
822
827
|
form,
|
|
823
828
|
id: "body",
|
|
@@ -957,7 +962,7 @@ var stepIdOf = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (nodeId) =>
|
|
|
957
962
|
function EmailAutomationCanvas() {
|
|
958
963
|
const { automation, steps, triggers, select, reload, createStep, deleteStep, setNext, updatePosition, tidy } = useEmailAutomation();
|
|
959
964
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
960
|
-
const isMobile =
|
|
965
|
+
const isMobile = _chunkMOGEGWXWjs.useIsMobile.call(void 0, );
|
|
961
966
|
const [nodes, setNodes] = _react.useState.call(void 0, []);
|
|
962
967
|
const [edges, setEdges] = _react.useState.call(void 0, []);
|
|
963
968
|
const { screenToFlowPosition } = _react3.useReactFlow.call(void 0, );
|
|
@@ -996,7 +1001,7 @@ function EmailAutomationCanvas() {
|
|
|
996
1001
|
try {
|
|
997
1002
|
await setNext(stepId, nextStepId);
|
|
998
1003
|
} catch (error) {
|
|
999
|
-
|
|
1004
|
+
_chunkPYRZCKC2js.errorToast.call(void 0, { title: t("emailAutomations.canvas.chainError"), error });
|
|
1000
1005
|
await reload();
|
|
1001
1006
|
}
|
|
1002
1007
|
},
|
|
@@ -1010,7 +1015,7 @@ function EmailAutomationCanvas() {
|
|
|
1010
1015
|
if (!_optionalChain([conn, 'access', _29 => _29.targetHandle, 'optionalAccess', _30 => _30.startsWith, 'call', _31 => _31(STEP_TARGET_HANDLE_PREFIX)])) return;
|
|
1011
1016
|
const targetStepId = conn.targetHandle.slice(STEP_TARGET_HANDLE_PREFIX.length);
|
|
1012
1017
|
if (from.handleId === TRIGGER_SOURCE_HANDLE) {
|
|
1013
|
-
|
|
1018
|
+
_chunkMOGEGWXWjs.showError.call(void 0, t("emailAutomations.canvas.chainError"));
|
|
1014
1019
|
return;
|
|
1015
1020
|
}
|
|
1016
1021
|
if (!from.handleId.startsWith(STEP_SOURCE_HANDLE_PREFIX)) return;
|
|
@@ -1128,7 +1133,7 @@ function EmailAutomationCanvas() {
|
|
|
1128
1133
|
try {
|
|
1129
1134
|
await deleteStep(stepId);
|
|
1130
1135
|
} catch (error) {
|
|
1131
|
-
|
|
1136
|
+
_chunkPYRZCKC2js.errorToast.call(void 0, { title: t("emailAutomations.canvas.deleteEmail"), error });
|
|
1132
1137
|
throw error;
|
|
1133
1138
|
}
|
|
1134
1139
|
}, [pendingDeleteStepId, deleteStep, t]);
|
|
@@ -1191,7 +1196,7 @@ function EmailAutomationCanvas() {
|
|
|
1191
1196
|
}
|
|
1192
1197
|
),
|
|
1193
1198
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1194
|
-
|
|
1199
|
+
_chunkPYRZCKC2js.ConfirmDialog,
|
|
1195
1200
|
{
|
|
1196
1201
|
open: pendingDeleteStepId !== null,
|
|
1197
1202
|
onOpenChange: (open) => {
|
|
@@ -1206,20 +1211,20 @@ function EmailAutomationCanvas() {
|
|
|
1206
1211
|
}
|
|
1207
1212
|
),
|
|
1208
1213
|
paneMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1209
|
-
|
|
1214
|
+
_chunkPYRZCKC2js.ContextMenu,
|
|
1210
1215
|
{
|
|
1211
1216
|
open: true,
|
|
1212
1217
|
onOpenChange: (open) => {
|
|
1213
1218
|
if (!open) setPaneMenu(null);
|
|
1214
1219
|
},
|
|
1215
1220
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1216
|
-
|
|
1221
|
+
_chunkPYRZCKC2js.ContextMenuContent,
|
|
1217
1222
|
{
|
|
1218
1223
|
anchor: pointAnchor(paneMenu.screenX, paneMenu.screenY),
|
|
1219
1224
|
side: "bottom",
|
|
1220
1225
|
align: "start",
|
|
1221
1226
|
sideOffset: 4,
|
|
1222
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1227
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPYRZCKC2js.ContextMenuItem, { onClick: handleCreateStepFromPane, children: [
|
|
1223
1228
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PlusIcon, {}),
|
|
1224
1229
|
t("emailAutomations.canvas.addEmail")
|
|
1225
1230
|
] })
|
|
@@ -1228,21 +1233,21 @@ function EmailAutomationCanvas() {
|
|
|
1228
1233
|
}
|
|
1229
1234
|
),
|
|
1230
1235
|
nodeMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1231
|
-
|
|
1236
|
+
_chunkPYRZCKC2js.ContextMenu,
|
|
1232
1237
|
{
|
|
1233
1238
|
open: true,
|
|
1234
1239
|
onOpenChange: (open) => {
|
|
1235
1240
|
if (!open) setNodeMenu(null);
|
|
1236
1241
|
},
|
|
1237
1242
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1238
|
-
|
|
1243
|
+
_chunkPYRZCKC2js.ContextMenuContent,
|
|
1239
1244
|
{
|
|
1240
1245
|
anchor: pointAnchor(nodeMenu.screenX, nodeMenu.screenY),
|
|
1241
1246
|
side: "bottom",
|
|
1242
1247
|
align: "start",
|
|
1243
1248
|
sideOffset: 4,
|
|
1244
1249
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1245
|
-
|
|
1250
|
+
_chunkPYRZCKC2js.ContextMenuItem,
|
|
1246
1251
|
{
|
|
1247
1252
|
onClick: () => {
|
|
1248
1253
|
const menu = nodeMenu;
|
|
@@ -1283,7 +1288,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, TriggerAutomationEditor, "TriggerAutomation
|
|
|
1283
1288
|
// src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx
|
|
1284
1289
|
|
|
1285
1290
|
function EmailAutomationCanvasTab() {
|
|
1286
|
-
const { open, setOpen } =
|
|
1291
|
+
const { open, setOpen } = _chunkPYRZCKC2js.useSidebar.call(void 0, );
|
|
1287
1292
|
_react.useEffect.call(void 0, () => {
|
|
1288
1293
|
const prev = open;
|
|
1289
1294
|
if (prev) setOpen(false);
|
|
@@ -1304,10 +1309,10 @@ function EmailAutomationRecipientsList() {
|
|
|
1304
1309
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1305
1310
|
const { automation } = useEmailAutomation();
|
|
1306
1311
|
const [statusFilter, setStatusFilter] = _react.useState.call(void 0, "all");
|
|
1307
|
-
const data =
|
|
1308
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1312
|
+
const data = _chunkPYRZCKC2js.useDataListRetriever.call(void 0, {
|
|
1313
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkMOGEGWXWjs.EmailAutomationService.findEnrollments(params), "retriever"),
|
|
1309
1314
|
retrieverParams: { automationId: _optionalChain([automation, 'optionalAccess', _44 => _44.id]) },
|
|
1310
|
-
module:
|
|
1315
|
+
module: _chunkBZ5J2FIVjs.Modules.EmailAutomationEnrollment
|
|
1311
1316
|
});
|
|
1312
1317
|
const handleStatusChange = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => {
|
|
1313
1318
|
const status = _nullishCoalesce(value, () => ( "all"));
|
|
@@ -1326,21 +1331,21 @@ function EmailAutomationRecipientsList() {
|
|
|
1326
1331
|
[t]
|
|
1327
1332
|
);
|
|
1328
1333
|
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,
|
|
1334
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPYRZCKC2js.Select, { items: statusItems, value: statusFilter, onValueChange: handleStatusChange, children: [
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SelectTrigger, { className: "w-40", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SelectValue, {}) }),
|
|
1336
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPYRZCKC2js.SelectContent, { children: [
|
|
1337
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SelectItem, { value: "all", children: t("emailAutomations.recipients.status.all") }),
|
|
1338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SelectItem, { value: "active", children: t("emailAutomations.recipients.status.active") }),
|
|
1339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SelectItem, { value: "completed", children: t("emailAutomations.recipients.status.completed") }),
|
|
1340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SelectItem, { value: "unsubscribed", children: t("emailAutomations.recipients.status.unsubscribed") }),
|
|
1341
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SelectItem, { value: "exited", children: t("emailAutomations.recipients.status.exited") }),
|
|
1342
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SelectItem, { value: "failed", children: t("emailAutomations.recipients.status.failed") })
|
|
1338
1343
|
] })
|
|
1339
1344
|
] }),
|
|
1340
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1345
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.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
1346
|
] });
|
|
1342
1347
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1343
|
-
|
|
1348
|
+
_chunkPYRZCKC2js.ContentListTable,
|
|
1344
1349
|
{
|
|
1345
1350
|
data,
|
|
1346
1351
|
fields: [
|
|
@@ -1351,7 +1356,7 @@ function EmailAutomationRecipientsList() {
|
|
|
1351
1356
|
"nextSendAt" /* nextSendAt */,
|
|
1352
1357
|
"sentCount" /* sentCount */
|
|
1353
1358
|
],
|
|
1354
|
-
tableGeneratorType:
|
|
1359
|
+
tableGeneratorType: _chunkBZ5J2FIVjs.Modules.EmailAutomationEnrollment,
|
|
1355
1360
|
filters,
|
|
1356
1361
|
allowSearch: false,
|
|
1357
1362
|
emptyState: t("emailAutomations.recipients.empty")
|
|
@@ -1368,15 +1373,15 @@ function EmailAutomationContainer({ automationId }) {
|
|
|
1368
1373
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationContainer, "EmailAutomationContainer");
|
|
1369
1374
|
function EmailAutomationShell() {
|
|
1370
1375
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1371
|
-
const generateUrl =
|
|
1376
|
+
const generateUrl = _chunkPYRZCKC2js.usePageUrlGenerator.call(void 0, );
|
|
1372
1377
|
const { automation, reload } = useEmailAutomation();
|
|
1373
1378
|
if (!automation) return null;
|
|
1374
1379
|
const breadcrumbs = [
|
|
1375
|
-
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page:
|
|
1380
|
+
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page: _chunkBZ5J2FIVjs.Modules.EmailAutomation }) },
|
|
1376
1381
|
{ name: automation.name }
|
|
1377
1382
|
];
|
|
1378
1383
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1379
|
-
|
|
1384
|
+
_chunkPYRZCKC2js.SharedProvider,
|
|
1380
1385
|
{
|
|
1381
1386
|
value: {
|
|
1382
1387
|
breadcrumbs,
|
|
@@ -1390,9 +1395,9 @@ function EmailAutomationShell() {
|
|
|
1390
1395
|
}
|
|
1391
1396
|
},
|
|
1392
1397
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1393
|
-
|
|
1398
|
+
_chunkPYRZCKC2js.RoundPageContainer,
|
|
1394
1399
|
{
|
|
1395
|
-
module:
|
|
1400
|
+
module: _chunkBZ5J2FIVjs.Modules.EmailAutomation,
|
|
1396
1401
|
id: automation.id,
|
|
1397
1402
|
fullWidth: true,
|
|
1398
1403
|
forceHeader: true,
|
|
@@ -1432,12 +1437,12 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1432
1437
|
async function unsubscribe() {
|
|
1433
1438
|
try {
|
|
1434
1439
|
if (source === "blast") {
|
|
1435
|
-
await
|
|
1440
|
+
await _chunkMOGEGWXWjs.EmailBlastDeliveryService.unsubscribe({ token });
|
|
1436
1441
|
setStoppedScope("all");
|
|
1437
1442
|
setState("success");
|
|
1438
1443
|
return;
|
|
1439
1444
|
}
|
|
1440
|
-
const enrollment = await
|
|
1445
|
+
const enrollment = await _chunkMOGEGWXWjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope });
|
|
1441
1446
|
setAutomationName(_nullishCoalesce(_optionalChain([enrollment, 'optionalAccess', _45 => _45.automation, 'optionalAccess', _46 => _46.name]), () => ( "")));
|
|
1442
1447
|
setStoppedScope(scope);
|
|
1443
1448
|
setState("success");
|
|
@@ -1451,7 +1456,7 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1451
1456
|
const stopAll = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1452
1457
|
setIsStoppingAll(true);
|
|
1453
1458
|
try {
|
|
1454
|
-
await
|
|
1459
|
+
await _chunkMOGEGWXWjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope: "all" });
|
|
1455
1460
|
setStoppedScope("all");
|
|
1456
1461
|
} catch (e3) {
|
|
1457
1462
|
setState("error");
|
|
@@ -1468,16 +1473,16 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1468
1473
|
if (state === "error") {
|
|
1469
1474
|
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
1475
|
/* @__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,
|
|
1476
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.invalidTitle") }),
|
|
1472
1477
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.invalidBody") })
|
|
1473
1478
|
] });
|
|
1474
1479
|
}
|
|
1475
1480
|
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
1481
|
/* @__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,
|
|
1482
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.title") }),
|
|
1478
1483
|
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
1484
|
/* @__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,
|
|
1485
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPYRZCKC2js.Button, { variant: "secondary", onClick: stopAll, disabled: isStoppingAll, children: [
|
|
1481
1486
|
isStoppingAll && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
1482
1487
|
t("emailAutomations.unsubscribe.alsoStopAll")
|
|
1483
1488
|
] })
|
|
@@ -1492,7 +1497,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailUnsubscribe, "EmailUnsubscribe");
|
|
|
1492
1497
|
|
|
1493
1498
|
var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1494
1499
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1495
|
-
const generateUrl =
|
|
1500
|
+
const generateUrl = _chunkPYRZCKC2js.usePageUrlGenerator.call(void 0, );
|
|
1496
1501
|
const triggerLabels = _nullishCoalesce(_optionalChain([params, 'access', _47 => _47.context, 'optionalAccess', _48 => _48.triggerLabels]), () => ( {}));
|
|
1497
1502
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1498
1503
|
return params.data.map((automation) => {
|
|
@@ -1521,7 +1526,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1521
1526
|
header: t("emailAutomations.list.columns.name"),
|
|
1522
1527
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1523
1528
|
const automation = row.original.jsonApiData;
|
|
1524
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1529
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.Link, { href: generateUrl({ page: _chunkBZ5J2FIVjs.Modules.EmailAutomation, id: automation.id }), children: automation.name });
|
|
1525
1530
|
}, "cell"),
|
|
1526
1531
|
enableSorting: false,
|
|
1527
1532
|
enableHiding: false
|
|
@@ -1544,7 +1549,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1544
1549
|
header: t("emailAutomations.list.columns.status"),
|
|
1545
1550
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1546
1551
|
const automation = row.original.jsonApiData;
|
|
1547
|
-
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1552
|
+
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.Badge, { variant: "softGreen", children: t("emailAutomations.list.status.on") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPYRZCKC2js.Badge, { variant: "softGray", children: t("emailAutomations.list.status.off") });
|
|
1548
1553
|
}, "cell"),
|
|
1549
1554
|
enableSorting: false,
|
|
1550
1555
|
enableHiding: false
|
|
@@ -1567,7 +1572,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1567
1572
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
1568
1573
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1569
1574
|
}, "useEmailAutomationTableStructure");
|
|
1570
|
-
|
|
1575
|
+
_chunkPYRZCKC2js.registerTableGenerator.call(void 0, "email-automations", useEmailAutomationTableStructure);
|
|
1571
1576
|
|
|
1572
1577
|
// src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx
|
|
1573
1578
|
|
|
@@ -1582,7 +1587,7 @@ var STATUS_VARIANTS = {
|
|
|
1582
1587
|
};
|
|
1583
1588
|
var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1584
1589
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1585
|
-
const locale =
|
|
1590
|
+
const locale = _chunkMOGEGWXWjs.dateFormatLocale.call(void 0, _nextintl.useLocale.call(void 0, ));
|
|
1586
1591
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1587
1592
|
return params.data.map((enrollment) => {
|
|
1588
1593
|
const entry = { jsonApiData: enrollment };
|
|
@@ -1623,7 +1628,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1623
1628
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1624
1629
|
const enrollment = row.original.jsonApiData;
|
|
1625
1630
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1626
|
-
|
|
1631
|
+
_chunkPYRZCKC2js.Badge,
|
|
1627
1632
|
{
|
|
1628
1633
|
variant: _nullishCoalesce(STATUS_VARIANTS[enrollment.status], () => ( "softGray")),
|
|
1629
1634
|
title: enrollment.status === "failed" ? enrollment.lastError : void 0,
|
|
@@ -1652,7 +1657,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1652
1657
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1653
1658
|
const enrollment = row.original.jsonApiData;
|
|
1654
1659
|
if (!enrollment.nextSendAt) return empty;
|
|
1655
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children:
|
|
1660
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children: _chunkMOGEGWXWjs.formatDate.call(void 0, enrollment.nextSendAt, "dateTime", locale) });
|
|
1656
1661
|
}, "cell"),
|
|
1657
1662
|
enableSorting: false,
|
|
1658
1663
|
enableHiding: false
|
|
@@ -1674,7 +1679,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1674
1679
|
}, [params.fields, fieldColumnMap, t, locale]);
|
|
1675
1680
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1676
1681
|
}, "useEmailAutomationEnrollmentTableStructure");
|
|
1677
|
-
|
|
1682
|
+
_chunkPYRZCKC2js.registerTableGenerator.call(void 0, "email-automation-enrollments", useEmailAutomationEnrollmentTableStructure);
|
|
1678
1683
|
|
|
1679
1684
|
|
|
1680
1685
|
|