@carlonicora/nextjs-jsonapi 5.4.0 → 5.6.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-4YCAIEPT.js → BlockNoteEditor-AE3ZTEEH.js} +20 -20
- package/dist/{BlockNoteEditor-4YCAIEPT.js.map → BlockNoteEditor-AE3ZTEEH.js.map} +1 -1
- package/dist/{BlockNoteEditor-YQL2SGFR.mjs → BlockNoteEditor-NEYG5L6W.mjs} +5 -5
- package/dist/{BlockNoteViewer-AEJKJ27Q.mjs → BlockNoteViewer-3OUT5UFY.mjs} +3 -3
- package/dist/{BlockNoteViewer-YL3J7J2Y.js → BlockNoteViewer-4CFKQM7U.js} +4 -4
- package/dist/{BlockNoteViewer-YL3J7J2Y.js.map → BlockNoteViewer-4CFKQM7U.js.map} +1 -1
- package/dist/billing/index.d.mts +186 -25
- package/dist/billing/index.d.ts +186 -25
- package/dist/billing/index.js +1149 -588
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +786 -225
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-5PPG6PL7.js → chunk-3I5AAJXV.js} +3 -3
- package/dist/{chunk-5PPG6PL7.js.map → chunk-3I5AAJXV.js.map} +1 -1
- package/dist/{chunk-YW4ZCEWB.js → chunk-53BAULDP.js} +4 -4
- package/dist/{chunk-YW4ZCEWB.js.map → chunk-53BAULDP.js.map} +1 -1
- package/dist/{chunk-XCHSX3VC.mjs → chunk-BTPUYUQ3.mjs} +2 -2
- package/dist/{chunk-WC63PJSC.mjs → chunk-EYA2F6AN.mjs} +756 -24
- package/dist/chunk-EYA2F6AN.mjs.map +1 -0
- package/dist/{chunk-NFBOSPNJ.js → chunk-HKZAESS6.js} +954 -222
- package/dist/chunk-HKZAESS6.js.map +1 -0
- package/dist/{chunk-6DC2WVVB.mjs → chunk-KQHBONL4.mjs} +2 -2
- package/dist/{chunk-3NLAXVIN.js → chunk-LQ4DK4JF.js} +1988 -1089
- package/dist/chunk-LQ4DK4JF.js.map +1 -0
- package/dist/{chunk-YNCQSWQW.js → chunk-RL3PL3KV.js} +8 -8
- package/dist/{chunk-YNCQSWQW.js.map → chunk-RL3PL3KV.js.map} +1 -1
- package/dist/{chunk-EUKTBOI2.mjs → chunk-SFYPXCK4.mjs} +3382 -2483
- package/dist/chunk-SFYPXCK4.mjs.map +1 -0
- package/dist/{chunk-QMYQRPQC.mjs → chunk-Y7RR57EW.mjs} +2 -2
- package/dist/client/index.js +5 -5
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +4 -4
- package/dist/components/editors/server.d.mts +15 -0
- package/dist/components/editors/server.d.ts +15 -0
- package/dist/components/editors/server.js +38 -0
- package/dist/components/editors/server.js.map +1 -0
- package/dist/components/editors/server.mjs +38 -0
- package/dist/components/editors/server.mjs.map +1 -0
- package/dist/components/index.d.mts +33 -10
- package/dist/components/index.d.ts +33 -10
- package/dist/components/index.js +7 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +8 -6
- package/dist/contexts/index.d.mts +9 -1
- package/dist/contexts/index.d.ts +9 -1
- package/dist/contexts/index.js +5 -5
- package/dist/contexts/index.mjs +4 -4
- package/dist/core/index.d.mts +242 -3
- package/dist/core/index.d.ts +242 -3
- package/dist/core/index.js +36 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +35 -3
- package/dist/email-automations/index.d.mts +3 -0
- package/dist/email-automations/index.d.ts +3 -0
- package/dist/email-automations/index.js +99 -95
- package/dist/email-automations/index.js.map +1 -1
- package/dist/email-automations/index.mjs +30 -26
- package/dist/email-automations/index.mjs.map +1 -1
- package/dist/features/analytics/index.d.mts +11 -4
- package/dist/features/analytics/index.d.ts +11 -4
- package/dist/features/analytics/index.js +127 -135
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/index.mjs +16 -24
- package/dist/features/analytics/index.mjs.map +1 -1
- package/dist/features/analytics/server.d.mts +5 -2
- package/dist/features/analytics/server.d.ts +5 -2
- package/dist/features/analytics/server.js +7 -7
- package/dist/features/analytics/server.js.map +1 -1
- package/dist/features/analytics/server.mjs +5 -5
- package/dist/features/analytics/server.mjs.map +1 -1
- package/dist/features/blog/index.d.mts +12 -2
- package/dist/features/blog/index.d.ts +12 -2
- package/dist/features/blog/index.js +206 -195
- package/dist/features/blog/index.js.map +1 -1
- package/dist/features/blog/index.mjs +71 -60
- package/dist/features/blog/index.mjs.map +1 -1
- package/dist/features/blog/server.d.mts +4 -1
- package/dist/features/blog/server.d.ts +4 -1
- package/dist/features/blog/server.js +49 -21
- package/dist/features/blog/server.js.map +1 -1
- package/dist/features/blog/server.mjs +36 -8
- package/dist/features/blog/server.mjs.map +1 -1
- package/dist/features/help/index.js +38 -38
- package/dist/features/help/index.mjs +4 -4
- package/dist/features/tokenusage/index.d.mts +1 -3
- package/dist/features/tokenusage/index.d.ts +1 -3
- package/dist/features/tokenusage/index.js +127 -135
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +10 -18
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/{stripe-promotion-code.interface-C3qqh3mi.d.ts → format-options-BtX3o0Yu.d.ts} +104 -1
- package/dist/{stripe-promotion-code.interface-ClZ7DxS9.d.mts → format-options-D6c7FNDi.d.mts} +104 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +37 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -4
- package/dist/server/index.js +4 -4
- package/dist/server/index.mjs +3 -3
- package/messages/en.json +125 -3
- package/messages/it.json +125 -3
- package/package.json +9 -1
- package/scripts/validate-messages.mjs +1 -0
- package/src/billing/index.ts +1 -0
- package/src/client/index.ts +4 -0
- package/src/components/editors/server/BlockNoteServerContent.tsx +28 -0
- package/src/components/editors/server/__tests__/renderBlockNoteHTML.spec.ts +44 -0
- package/src/components/editors/server/renderBlockNoteHTML.ts +26 -0
- package/src/components/editors/server-entry.ts +7 -0
- package/src/components/index.ts +1 -0
- package/src/components/viewers/BlockNoteStaticViewer.tsx +44 -0
- package/src/core/index.ts +1 -0
- package/src/core/registry/ModuleRegistry.ts +3 -0
- package/src/features/administration/components/AdminIndexContainer.tsx +61 -33
- package/src/features/administration/components/__tests__/AdminIndexContainer.spec.tsx +61 -1
- package/src/features/administration/components/index.ts +2 -1
- package/src/features/administration/contexts/AdministrationContext.tsx +11 -3
- package/src/features/administration/contexts/__tests__/AdministrationContext.spec.tsx +40 -0
- package/src/features/ai-connection/ai-connection.module.ts +2 -0
- package/src/features/ai-connection/contexts/AiConnectionsContext.tsx +3 -16
- package/src/features/ai-connection/contexts/__tests__/AiConnectionsContext.spec.tsx +33 -0
- package/src/features/analytics/__tests__/server-entry.spec.tsx +2 -1
- package/src/features/analytics/analytics.modules.ts +22 -5
- package/src/features/analytics/components/AnalyticsAdminContainer.tsx +4 -3
- package/src/features/analytics/components/AnalyticsAdminPageContainer.tsx +6 -3
- package/src/features/analytics/components/AnalyticsJourneyContainer.tsx +4 -3
- package/src/features/analytics/components/__tests__/AnalyticsJourneyContainer.spec.tsx +11 -0
- package/src/features/analytics/components/__tests__/AnalyticsPageContainers.spec.tsx +12 -1
- package/src/features/analytics/components/server/AnalyticsAdminPage.tsx +6 -3
- package/src/features/analytics/contexts/AnalyticsAdminContext.tsx +8 -17
- package/src/features/analytics/contexts/__tests__/AnalyticsAdminContext.spec.tsx +17 -0
- package/src/features/billing/components/cards/InvoicesSummaryCard.tsx +3 -2
- package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +4 -3
- package/src/features/billing/components/containers/BillingDashboardContainer.tsx +22 -5
- package/src/features/billing/components/utils/__tests__/discount.spec.ts +59 -0
- package/src/features/billing/components/utils/__tests__/url.spec.ts +32 -0
- package/src/features/billing/components/utils/discount.ts +38 -0
- package/src/features/billing/components/utils/index.ts +2 -0
- package/src/features/billing/components/utils/url.ts +12 -0
- package/src/features/billing/contexts/CouponContext.tsx +211 -0
- package/src/features/billing/contexts/index.ts +1 -0
- package/src/features/billing/i18n-keys.ts +79 -0
- package/src/features/billing/stripe-coupon/components/containers/CouponContainer.tsx +38 -0
- package/src/features/billing/stripe-coupon/components/containers/index.ts +1 -0
- package/src/features/billing/stripe-coupon/components/details/CouponDetails.tsx +69 -0
- package/src/features/billing/stripe-coupon/components/details/index.ts +1 -0
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeEditor.tsx +79 -0
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeFields.tsx +192 -0
- package/src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx +333 -0
- package/src/features/billing/stripe-coupon/components/forms/CouponRefresher.tsx +45 -0
- package/src/features/billing/stripe-coupon/components/forms/index.ts +6 -0
- package/src/features/billing/stripe-coupon/components/index.ts +5 -0
- package/src/features/billing/stripe-coupon/components/lists/CouponCodesList.tsx +61 -0
- package/src/features/billing/stripe-coupon/components/lists/CouponsList.tsx +67 -0
- package/src/features/billing/stripe-coupon/components/lists/index.ts +2 -0
- package/src/features/billing/stripe-coupon/components/widgets/CouponCodeActions.tsx +80 -0
- package/src/features/billing/stripe-coupon/components/widgets/index.ts +1 -0
- package/src/features/billing/stripe-coupon/data/__tests__/stripe-coupon-models.spec.ts +114 -0
- package/src/features/billing/stripe-coupon/data/index.ts +10 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.fields.ts +8 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.interface.ts +44 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.service.ts +92 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.ts +132 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-offer.interface.ts +17 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-offer.ts +70 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.fields.ts +7 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.interface.ts +51 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.service.ts +93 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.ts +165 -0
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx +154 -0
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.tsx +113 -0
- package/src/features/billing/stripe-coupon/index.ts +5 -0
- package/src/features/billing/stripe-coupon/stripe-coupon-code.module.ts +14 -0
- package/src/features/billing/stripe-coupon/stripe-coupon-offer.module.ts +10 -0
- package/src/features/billing/stripe-coupon/stripe-coupon.module.ts +18 -0
- package/src/features/billing/stripe-coupon/utils/__tests__/coupon-places.spec.ts +19 -0
- package/src/features/billing/stripe-coupon/utils/__tests__/to-promotion-code-result.spec.ts +41 -0
- package/src/features/billing/stripe-coupon/utils/coupon-places.ts +23 -0
- package/src/features/billing/stripe-coupon/utils/format-coupon-discount.ts +36 -0
- package/src/features/billing/stripe-coupon/utils/index.ts +3 -0
- package/src/features/billing/stripe-coupon/utils/to-promotion-code-result.ts +23 -0
- package/src/features/billing/stripe-customer/components/forms/PaymentMethodForm.tsx +24 -8
- package/src/features/billing/stripe-price/stripe-price.module.ts +2 -0
- package/src/features/billing/stripe-product/components/containers/ProductsListContainer.tsx +21 -6
- package/src/features/billing/stripe-product/stripe-product.module.ts +2 -0
- package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +60 -19
- package/src/features/billing/stripe-promotion-code/data/stripe-promotion-code.interface.ts +2 -0
- package/src/features/billing/stripe-subscription/components/containers/SubscriptionsContainer.tsx +24 -5
- package/src/features/billing/stripe-subscription/components/lists/SubscriptionsList.tsx +21 -2
- package/src/features/billing/stripe-subscription/components/wizards/SubscriptionWizard.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepPaymentMethod.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +60 -49
- package/src/features/billing/stripe-subscription/components/wizards/__tests__/review-card.spec.ts +34 -0
- package/src/features/billing/stripe-subscription/components/wizards/review-card.ts +24 -0
- package/src/features/billing/stripe-subscription/data/__tests__/stripe-subscription.discount.spec.ts +67 -0
- package/src/features/billing/stripe-subscription/data/stripe-subscription.interface.ts +14 -0
- package/src/features/billing/stripe-subscription/data/stripe-subscription.service.ts +39 -0
- package/src/features/billing/stripe-subscription/data/stripe-subscription.ts +21 -0
- package/src/features/billing/stripe-subscription/hooks/__tests__/wizard-payment.spec.ts +48 -0
- package/src/features/billing/stripe-subscription/hooks/__tests__/wizard-promotion.spec.ts +132 -0
- package/src/features/billing/stripe-subscription/hooks/useSubscriptionWizard.ts +138 -12
- package/src/features/billing/stripe-subscription/hooks/wizard-payment.ts +30 -0
- package/src/features/billing/stripe-subscription/hooks/wizard-promotion.ts +54 -0
- package/src/features/blog/components/admin/BlogAdminContainer.tsx +13 -6
- package/src/features/blog/components/admin/BlogCategoriesList.tsx +1 -1
- package/src/features/blog/components/admin/BlogCoverImageField.tsx +1 -1
- package/src/features/blog/components/admin/BlogPostContainer.tsx +0 -1
- package/src/features/blog/components/admin/BlogPostEditor.tsx +42 -33
- package/src/features/blog/components/admin/BlogPostTranslationEditor.tsx +12 -4
- package/src/features/blog/components/admin/BlogPostsList.tsx +1 -1
- package/src/features/blog/components/public/BlogPostCard.tsx +2 -9
- package/src/features/blog/components/public/BlogPostMeta.tsx +2 -2
- package/src/features/blog/components/public/BlogPostView.tsx +9 -3
- package/src/features/blog/components/public/__tests__/BlogList.spec.tsx +2 -0
- package/src/features/blog/components/public/__tests__/BlogPostView.spec.tsx +17 -11
- package/src/features/blog/server/fetchers.ts +57 -8
- package/src/features/email-automation/components/containers/EmailAutomationsListContainer.tsx +12 -3
- package/src/features/rbac/contexts/RbacContext.tsx +4 -7
- package/src/features/rbac/contexts/__tests__/RbacContext.spec.tsx +42 -0
- package/src/features/tokenusage/components/TokenUsageAdminContainer.tsx +4 -3
- package/src/features/tokenusage/contexts/TokenUsageAdminContext.tsx +3 -18
- package/src/features/tokenusage/contexts/__tests__/TokenUsageAdminContext.spec.tsx +17 -0
- package/src/features/tokenusage/tokenusage-admin.module.ts +4 -3
- package/src/features/tokenusage/tokenusage.modules.ts +12 -2
- package/src/features/user/contexts/CurrentUserContext.tsx +25 -0
- package/src/features/user/contexts/UserContext.tsx +18 -3
- package/src/features/user/contexts/__tests__/CurrentUserContext.spec.tsx +121 -2
- package/src/features/user/contexts/__tests__/UserContext.spec.tsx +95 -0
- package/dist/chunk-3NLAXVIN.js.map +0 -1
- package/dist/chunk-EUKTBOI2.mjs.map +0 -1
- package/dist/chunk-NFBOSPNJ.js.map +0 -1
- package/dist/chunk-WC63PJSC.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-YQL2SGFR.mjs.map → BlockNoteEditor-NEYG5L6W.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-AEJKJ27Q.mjs.map → BlockNoteViewer-3OUT5UFY.mjs.map} +0 -0
- /package/dist/{chunk-XCHSX3VC.mjs.map → chunk-BTPUYUQ3.mjs.map} +0 -0
- /package/dist/{chunk-6DC2WVVB.mjs.map → chunk-KQHBONL4.mjs.map} +0 -0
- /package/dist/{chunk-QMYQRPQC.mjs.map → chunk-Y7RR57EW.mjs.map} +0 -0
|
@@ -31,9 +31,8 @@
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
require('../chunk-YNCQSWQW.js');
|
|
34
|
+
var _chunkLQ4DK4JFjs = require('../chunk-LQ4DK4JF.js');
|
|
35
|
+
require('../chunk-RL3PL3KV.js');
|
|
37
36
|
require('../chunk-G4JR3SFV.js');
|
|
38
37
|
|
|
39
38
|
|
|
@@ -45,18 +44,21 @@ require('../chunk-G4JR3SFV.js');
|
|
|
45
44
|
|
|
46
45
|
|
|
47
46
|
|
|
48
|
-
var
|
|
47
|
+
var _chunkHKZAESS6js = require('../chunk-HKZAESS6.js');
|
|
48
|
+
require('../chunk-GHE4VT2R.js');
|
|
49
49
|
require('../chunk-LXKSUWAV.js');
|
|
50
50
|
require('../chunk-JTPRJNT2.js');
|
|
51
|
-
require('../chunk-GHE4VT2R.js');
|
|
52
51
|
require('../chunk-3EPNHTMH.js');
|
|
53
52
|
|
|
54
53
|
|
|
55
54
|
var _chunk7QVYU63Ejs = require('../chunk-7QVYU63E.js');
|
|
56
55
|
|
|
56
|
+
// src/features/email-automation/components/containers/EmailAutomationsListContainer.tsx
|
|
57
|
+
var _nextintl = require('next-intl');
|
|
58
|
+
|
|
57
59
|
// src/features/email-automation/components/lists/EmailAutomationsList.tsx
|
|
58
60
|
var _lucidereact = require('lucide-react');
|
|
59
|
-
|
|
61
|
+
|
|
60
62
|
var _react = require('react');
|
|
61
63
|
|
|
62
64
|
// src/features/email-automation/components/forms/EmailAutomationEditor.tsx
|
|
@@ -78,12 +80,12 @@ function EmailAutomationEditorInternal({
|
|
|
78
80
|
onDialogOpenChange
|
|
79
81
|
}) {
|
|
80
82
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
81
|
-
const router =
|
|
83
|
+
const router = _chunkHKZAESS6js.useI18nRouter.call(void 0, );
|
|
82
84
|
const isEdit = !!automation;
|
|
83
85
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
84
86
|
_react.useEffect.call(void 0, () => {
|
|
85
87
|
let active = true;
|
|
86
|
-
|
|
88
|
+
_chunkHKZAESS6js.EmailAutomationService.findTriggers().then((list) => {
|
|
87
89
|
if (active) setTriggers(list);
|
|
88
90
|
}).catch(() => {
|
|
89
91
|
});
|
|
@@ -121,14 +123,14 @@ function EmailAutomationEditorInternal({
|
|
|
121
123
|
defaultValues: getDefaultValues()
|
|
122
124
|
});
|
|
123
125
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
124
|
-
|
|
126
|
+
_chunkLQ4DK4JFjs.EditorSheet,
|
|
125
127
|
{
|
|
126
128
|
form,
|
|
127
129
|
entityType: t("emailAutomations.admin.title"),
|
|
128
130
|
entityName: _optionalChain([automation, 'optionalAccess', _7 => _7.name]),
|
|
129
131
|
title: isEdit ? t("emailAutomations.admin.editAutomation") : t("emailAutomations.admin.newAutomation"),
|
|
130
132
|
isEdit,
|
|
131
|
-
module:
|
|
133
|
+
module: _chunkHKZAESS6js.Modules.EmailAutomation,
|
|
132
134
|
size: "md",
|
|
133
135
|
propagateChanges,
|
|
134
136
|
onSuccess,
|
|
@@ -142,7 +144,7 @@ function EmailAutomationEditorInternal({
|
|
|
142
144
|
replyTo: values.replyTo || void 0,
|
|
143
145
|
isActive: values.isActive
|
|
144
146
|
};
|
|
145
|
-
return isEdit ? await
|
|
147
|
+
return isEdit ? await _chunkHKZAESS6js.EmailAutomationService.update(payload) : await _chunkHKZAESS6js.EmailAutomationService.create(payload);
|
|
146
148
|
},
|
|
147
149
|
onReset: getDefaultValues,
|
|
148
150
|
trigger,
|
|
@@ -151,9 +153,9 @@ function EmailAutomationEditorInternal({
|
|
|
151
153
|
dialogOpen,
|
|
152
154
|
onDialogOpenChange,
|
|
153
155
|
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,
|
|
156
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "name", name: t("emailAutomations.fields.name.label"), isRequired: true }),
|
|
155
157
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
156
|
-
|
|
158
|
+
_chunkLQ4DK4JFjs.FormSelect,
|
|
157
159
|
{
|
|
158
160
|
form,
|
|
159
161
|
id: "trigger",
|
|
@@ -164,7 +166,7 @@ function EmailAutomationEditorInternal({
|
|
|
164
166
|
}
|
|
165
167
|
),
|
|
166
168
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
167
|
-
|
|
169
|
+
_chunkLQ4DK4JFjs.FormSelect,
|
|
168
170
|
{
|
|
169
171
|
form,
|
|
170
172
|
id: "exitTrigger",
|
|
@@ -174,9 +176,9 @@ function EmailAutomationEditorInternal({
|
|
|
174
176
|
allowEmpty: true
|
|
175
177
|
}
|
|
176
178
|
),
|
|
177
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
179
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "replyTo", name: t("emailAutomations.fields.replyTo.label") }),
|
|
178
180
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
179
|
-
|
|
181
|
+
_chunkLQ4DK4JFjs.FormSwitch,
|
|
180
182
|
{
|
|
181
183
|
form,
|
|
182
184
|
id: "isActive",
|
|
@@ -200,14 +202,14 @@ var EmailAutomationEditor_default = EmailAutomationEditor;
|
|
|
200
202
|
function EmailAutomationsList({ fullWidth } = {}) {
|
|
201
203
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
202
204
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
203
|
-
const data =
|
|
204
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
205
|
+
const data = _chunkLQ4DK4JFjs.useDataListRetriever.call(void 0, {
|
|
206
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkHKZAESS6js.EmailAutomationService.findMany(params), "retriever"),
|
|
205
207
|
retrieverParams: {},
|
|
206
|
-
module:
|
|
208
|
+
module: _chunkHKZAESS6js.Modules.EmailAutomation
|
|
207
209
|
});
|
|
208
210
|
_react.useEffect.call(void 0, () => {
|
|
209
211
|
let active = true;
|
|
210
|
-
|
|
212
|
+
_chunkHKZAESS6js.EmailAutomationService.findTriggers().then((list) => {
|
|
211
213
|
if (active) setTriggers(list);
|
|
212
214
|
}).catch(() => {
|
|
213
215
|
});
|
|
@@ -221,7 +223,7 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
221
223
|
);
|
|
222
224
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationEditor_default, {}, "create-email-automation")];
|
|
223
225
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
224
|
-
|
|
226
|
+
_chunkLQ4DK4JFjs.ContentListTable,
|
|
225
227
|
{
|
|
226
228
|
data,
|
|
227
229
|
fields: [
|
|
@@ -233,12 +235,12 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
233
235
|
"completed" /* completed */,
|
|
234
236
|
"unsubscribed" /* unsubscribed */
|
|
235
237
|
],
|
|
236
|
-
tableGeneratorType:
|
|
238
|
+
tableGeneratorType: _chunkHKZAESS6js.Modules.EmailAutomation,
|
|
237
239
|
functions,
|
|
238
240
|
fullWidth,
|
|
239
241
|
title: t("emailAutomations.admin.title"),
|
|
240
242
|
context: { triggerLabels },
|
|
241
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
243
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.EmptyState, { icon: _lucidereact.MailIcon, title: t("emailAutomations.admin.empty") })
|
|
242
244
|
}
|
|
243
245
|
);
|
|
244
246
|
}
|
|
@@ -247,7 +249,9 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsList, "EmailAutomationsList
|
|
|
247
249
|
// src/features/email-automation/components/containers/EmailAutomationsListContainer.tsx
|
|
248
250
|
|
|
249
251
|
function EmailAutomationsListContainer() {
|
|
250
|
-
|
|
252
|
+
const t = _nextintl.useTranslations.call(void 0, );
|
|
253
|
+
const breadcrumbs = [{ name: t("emailAutomations.admin.title") }];
|
|
254
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SharedProvider, { value: { breadcrumbs, title: { type: t("emailAutomations.admin.title") } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.RoundPageContainer, { module: _chunkHKZAESS6js.Modules.EmailAutomation, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationsList, { fullWidth: true }) }) });
|
|
251
255
|
}
|
|
252
256
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsListContainer, "EmailAutomationsListContainer");
|
|
253
257
|
|
|
@@ -266,8 +270,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
266
270
|
const [selectedStepId, setSelectedStepId] = _react.useState.call(void 0, null);
|
|
267
271
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
268
272
|
const [loadedAutomation, loadedSteps] = await Promise.all([
|
|
269
|
-
|
|
270
|
-
|
|
273
|
+
_chunkHKZAESS6js.EmailAutomationService.findOne({ id: automationId }),
|
|
274
|
+
_chunkHKZAESS6js.EmailAutomationStepService.findByAutomation({ automationId })
|
|
271
275
|
]);
|
|
272
276
|
setAutomation(loadedAutomation);
|
|
273
277
|
setSteps(loadedSteps);
|
|
@@ -277,7 +281,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
277
281
|
}, [reload]);
|
|
278
282
|
_react.useEffect.call(void 0, () => {
|
|
279
283
|
let active = true;
|
|
280
|
-
|
|
284
|
+
_chunkHKZAESS6js.EmailAutomationService.findTriggers().then((list) => {
|
|
281
285
|
if (active) setTriggers(list);
|
|
282
286
|
}).catch(() => {
|
|
283
287
|
});
|
|
@@ -288,7 +292,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
288
292
|
const select = _react.useCallback.call(void 0, (id) => setSelectedStepId(id), []);
|
|
289
293
|
const createStep = _react.useCallback.call(void 0,
|
|
290
294
|
async (input) => {
|
|
291
|
-
const saved = await
|
|
295
|
+
const saved = await _chunkHKZAESS6js.EmailAutomationStepService.create({ ...input, id: _nullishCoalesce(input.id, () => ( _uuid.v4.call(void 0, ))), automationId });
|
|
292
296
|
await reload();
|
|
293
297
|
return saved;
|
|
294
298
|
},
|
|
@@ -296,7 +300,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
296
300
|
);
|
|
297
301
|
const updateStep = _react.useCallback.call(void 0,
|
|
298
302
|
async (input) => {
|
|
299
|
-
const saved = await
|
|
303
|
+
const saved = await _chunkHKZAESS6js.EmailAutomationStepService.update({ ...input, automationId });
|
|
300
304
|
await reload();
|
|
301
305
|
return saved;
|
|
302
306
|
},
|
|
@@ -304,7 +308,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
304
308
|
);
|
|
305
309
|
const deleteStep = _react.useCallback.call(void 0,
|
|
306
310
|
async (id) => {
|
|
307
|
-
await
|
|
311
|
+
await _chunkHKZAESS6js.EmailAutomationStepService.delete({ id });
|
|
308
312
|
if (selectedStepId === id) setSelectedStepId(null);
|
|
309
313
|
await reload();
|
|
310
314
|
},
|
|
@@ -312,8 +316,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
312
316
|
);
|
|
313
317
|
const setNext = _react.useCallback.call(void 0,
|
|
314
318
|
async (stepId, nextStepId) => {
|
|
315
|
-
if (nextStepId) await
|
|
316
|
-
else await
|
|
319
|
+
if (nextStepId) await _chunkHKZAESS6js.EmailAutomationStepService.setNext({ stepId, nextStepId });
|
|
320
|
+
else await _chunkHKZAESS6js.EmailAutomationStepService.clearNext({ stepId });
|
|
317
321
|
await reload();
|
|
318
322
|
},
|
|
319
323
|
[reload]
|
|
@@ -322,7 +326,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
322
326
|
async (stepId, x, y) => {
|
|
323
327
|
const step = steps.find((candidate) => candidate.id === stepId);
|
|
324
328
|
if (!step) return;
|
|
325
|
-
await
|
|
329
|
+
await _chunkHKZAESS6js.EmailAutomationStepService.update({
|
|
326
330
|
id: step.id,
|
|
327
331
|
automationId,
|
|
328
332
|
subject: step.subject,
|
|
@@ -336,7 +340,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
336
340
|
[automationId, reload, steps]
|
|
337
341
|
);
|
|
338
342
|
const tidy = _react.useCallback.call(void 0, async () => {
|
|
339
|
-
await
|
|
343
|
+
await _chunkHKZAESS6js.EmailAutomationService.tidy({ id: automationId });
|
|
340
344
|
await reload();
|
|
341
345
|
}, [automationId, reload]);
|
|
342
346
|
const value = _react.useMemo.call(void 0,
|
|
@@ -391,7 +395,7 @@ function EmailAutomationActiveSwitch() {
|
|
|
391
395
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (checked) => {
|
|
392
396
|
setSaving(true);
|
|
393
397
|
try {
|
|
394
|
-
await
|
|
398
|
+
await _chunkHKZAESS6js.EmailAutomationService.update({
|
|
395
399
|
id: automation.id,
|
|
396
400
|
name: automation.name,
|
|
397
401
|
trigger: automation.trigger,
|
|
@@ -401,17 +405,17 @@ function EmailAutomationActiveSwitch() {
|
|
|
401
405
|
});
|
|
402
406
|
await reload();
|
|
403
407
|
} catch (error) {
|
|
404
|
-
|
|
408
|
+
_chunkLQ4DK4JFjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
405
409
|
} finally {
|
|
406
410
|
setSaving(false);
|
|
407
411
|
}
|
|
408
412
|
}, "toggle");
|
|
409
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
410
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
411
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
413
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.Tooltip, { children: [
|
|
414
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "flex items-center gap-x-2" }), children: [
|
|
415
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Switch, { checked: automation.isActive, onCheckedChange: (checked) => void toggle(checked), disabled: saving }),
|
|
412
416
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs", children: t("emailAutomations.fields.isActive.label") })
|
|
413
417
|
] }),
|
|
414
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
418
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.TooltipContent, { className: "max-w-xs", children: t("emailAutomations.fields.isActive.help") })
|
|
415
419
|
] });
|
|
416
420
|
}
|
|
417
421
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationActiveSwitch, "EmailAutomationActiveSwitch");
|
|
@@ -444,7 +448,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
444
448
|
const { zoomIn, zoomOut, fitView } = _react3.useReactFlow.call(void 0, );
|
|
445
449
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-help": "canvas.toolbar", className: "absolute end-2 top-2 z-10 flex flex-col gap-1 max-md:top-14", children: [
|
|
446
450
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
447
|
-
|
|
451
|
+
_chunkLQ4DK4JFjs.Button,
|
|
448
452
|
{
|
|
449
453
|
type: "button",
|
|
450
454
|
variant: "outline",
|
|
@@ -455,7 +459,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
455
459
|
}
|
|
456
460
|
),
|
|
457
461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
458
|
-
|
|
462
|
+
_chunkLQ4DK4JFjs.Button,
|
|
459
463
|
{
|
|
460
464
|
type: "button",
|
|
461
465
|
variant: "outline",
|
|
@@ -466,7 +470,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
466
470
|
}
|
|
467
471
|
),
|
|
468
472
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
469
|
-
|
|
473
|
+
_chunkLQ4DK4JFjs.Button,
|
|
470
474
|
{
|
|
471
475
|
type: "button",
|
|
472
476
|
variant: "outline",
|
|
@@ -477,7 +481,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
477
481
|
}
|
|
478
482
|
),
|
|
479
483
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
480
|
-
|
|
484
|
+
_chunkLQ4DK4JFjs.Button,
|
|
481
485
|
{
|
|
482
486
|
type: "button",
|
|
483
487
|
variant: "outline",
|
|
@@ -768,14 +772,14 @@ function EmailStepEditorInternal({
|
|
|
768
772
|
defaultValues: getDefaultValues()
|
|
769
773
|
});
|
|
770
774
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
771
|
-
|
|
775
|
+
_chunkLQ4DK4JFjs.EditorSheet,
|
|
772
776
|
{
|
|
773
777
|
form,
|
|
774
778
|
entityType: t("emailAutomations.step.title"),
|
|
775
779
|
entityName: _optionalChain([step, 'optionalAccess', _18 => _18.subject]),
|
|
776
780
|
title: isEdit ? t("emailAutomations.step.editTitle") : t("emailAutomations.step.title"),
|
|
777
781
|
isEdit,
|
|
778
|
-
module:
|
|
782
|
+
module: _chunkHKZAESS6js.Modules.EmailAutomationStep,
|
|
779
783
|
size: "lg",
|
|
780
784
|
onSubmit: async (values) => {
|
|
781
785
|
const payload = {
|
|
@@ -787,7 +791,7 @@ function EmailStepEditorInternal({
|
|
|
787
791
|
positionX: step ? step.positionX : _optionalChain([initialPosition, 'optionalAccess', _19 => _19.x]),
|
|
788
792
|
positionY: step ? step.positionY : _optionalChain([initialPosition, 'optionalAccess', _20 => _20.y])
|
|
789
793
|
};
|
|
790
|
-
return isEdit ? await
|
|
794
|
+
return isEdit ? await _chunkHKZAESS6js.EmailAutomationStepService.update(payload) : await _chunkHKZAESS6js.EmailAutomationStepService.create(payload);
|
|
791
795
|
},
|
|
792
796
|
onSuccess: async () => {
|
|
793
797
|
await reload();
|
|
@@ -800,9 +804,9 @@ function EmailStepEditorInternal({
|
|
|
800
804
|
dialogOpen,
|
|
801
805
|
onDialogOpenChange,
|
|
802
806
|
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,
|
|
807
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "subject", name: t("emailAutomations.step.fields.subject.label"), isRequired: true }),
|
|
804
808
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
805
|
-
|
|
809
|
+
_chunkLQ4DK4JFjs.FormInput,
|
|
806
810
|
{
|
|
807
811
|
form,
|
|
808
812
|
id: "delayHours",
|
|
@@ -812,7 +816,7 @@ function EmailStepEditorInternal({
|
|
|
812
816
|
}
|
|
813
817
|
),
|
|
814
818
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
815
|
-
|
|
819
|
+
_chunkLQ4DK4JFjs.FormTextarea,
|
|
816
820
|
{
|
|
817
821
|
form,
|
|
818
822
|
id: "body",
|
|
@@ -952,7 +956,7 @@ var stepIdOf = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (nodeId) =>
|
|
|
952
956
|
function EmailAutomationCanvas() {
|
|
953
957
|
const { automation, steps, triggers, select, reload, createStep, deleteStep, setNext, updatePosition, tidy } = useEmailAutomation();
|
|
954
958
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
955
|
-
const isMobile =
|
|
959
|
+
const isMobile = _chunkHKZAESS6js.useIsMobile.call(void 0, );
|
|
956
960
|
const [nodes, setNodes] = _react.useState.call(void 0, []);
|
|
957
961
|
const [edges, setEdges] = _react.useState.call(void 0, []);
|
|
958
962
|
const { screenToFlowPosition } = _react3.useReactFlow.call(void 0, );
|
|
@@ -991,7 +995,7 @@ function EmailAutomationCanvas() {
|
|
|
991
995
|
try {
|
|
992
996
|
await setNext(stepId, nextStepId);
|
|
993
997
|
} catch (error) {
|
|
994
|
-
|
|
998
|
+
_chunkLQ4DK4JFjs.errorToast.call(void 0, { title: t("emailAutomations.canvas.chainError"), error });
|
|
995
999
|
await reload();
|
|
996
1000
|
}
|
|
997
1001
|
},
|
|
@@ -1005,7 +1009,7 @@ function EmailAutomationCanvas() {
|
|
|
1005
1009
|
if (!_optionalChain([conn, 'access', _29 => _29.targetHandle, 'optionalAccess', _30 => _30.startsWith, 'call', _31 => _31(STEP_TARGET_HANDLE_PREFIX)])) return;
|
|
1006
1010
|
const targetStepId = conn.targetHandle.slice(STEP_TARGET_HANDLE_PREFIX.length);
|
|
1007
1011
|
if (from.handleId === TRIGGER_SOURCE_HANDLE) {
|
|
1008
|
-
|
|
1012
|
+
_chunkHKZAESS6js.showError.call(void 0, t("emailAutomations.canvas.chainError"));
|
|
1009
1013
|
return;
|
|
1010
1014
|
}
|
|
1011
1015
|
if (!from.handleId.startsWith(STEP_SOURCE_HANDLE_PREFIX)) return;
|
|
@@ -1123,7 +1127,7 @@ function EmailAutomationCanvas() {
|
|
|
1123
1127
|
try {
|
|
1124
1128
|
await deleteStep(stepId);
|
|
1125
1129
|
} catch (error) {
|
|
1126
|
-
|
|
1130
|
+
_chunkLQ4DK4JFjs.errorToast.call(void 0, { title: t("emailAutomations.canvas.deleteEmail"), error });
|
|
1127
1131
|
throw error;
|
|
1128
1132
|
}
|
|
1129
1133
|
}, [pendingDeleteStepId, deleteStep, t]);
|
|
@@ -1186,7 +1190,7 @@ function EmailAutomationCanvas() {
|
|
|
1186
1190
|
}
|
|
1187
1191
|
),
|
|
1188
1192
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1189
|
-
|
|
1193
|
+
_chunkLQ4DK4JFjs.ConfirmDialog,
|
|
1190
1194
|
{
|
|
1191
1195
|
open: pendingDeleteStepId !== null,
|
|
1192
1196
|
onOpenChange: (open) => {
|
|
@@ -1201,20 +1205,20 @@ function EmailAutomationCanvas() {
|
|
|
1201
1205
|
}
|
|
1202
1206
|
),
|
|
1203
1207
|
paneMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1204
|
-
|
|
1208
|
+
_chunkLQ4DK4JFjs.ContextMenu,
|
|
1205
1209
|
{
|
|
1206
1210
|
open: true,
|
|
1207
1211
|
onOpenChange: (open) => {
|
|
1208
1212
|
if (!open) setPaneMenu(null);
|
|
1209
1213
|
},
|
|
1210
1214
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1211
|
-
|
|
1215
|
+
_chunkLQ4DK4JFjs.ContextMenuContent,
|
|
1212
1216
|
{
|
|
1213
1217
|
anchor: pointAnchor(paneMenu.screenX, paneMenu.screenY),
|
|
1214
1218
|
side: "bottom",
|
|
1215
1219
|
align: "start",
|
|
1216
1220
|
sideOffset: 4,
|
|
1217
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1221
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.ContextMenuItem, { onClick: handleCreateStepFromPane, children: [
|
|
1218
1222
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PlusIcon, {}),
|
|
1219
1223
|
t("emailAutomations.canvas.addEmail")
|
|
1220
1224
|
] })
|
|
@@ -1223,21 +1227,21 @@ function EmailAutomationCanvas() {
|
|
|
1223
1227
|
}
|
|
1224
1228
|
),
|
|
1225
1229
|
nodeMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1226
|
-
|
|
1230
|
+
_chunkLQ4DK4JFjs.ContextMenu,
|
|
1227
1231
|
{
|
|
1228
1232
|
open: true,
|
|
1229
1233
|
onOpenChange: (open) => {
|
|
1230
1234
|
if (!open) setNodeMenu(null);
|
|
1231
1235
|
},
|
|
1232
1236
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1233
|
-
|
|
1237
|
+
_chunkLQ4DK4JFjs.ContextMenuContent,
|
|
1234
1238
|
{
|
|
1235
1239
|
anchor: pointAnchor(nodeMenu.screenX, nodeMenu.screenY),
|
|
1236
1240
|
side: "bottom",
|
|
1237
1241
|
align: "start",
|
|
1238
1242
|
sideOffset: 4,
|
|
1239
1243
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1240
|
-
|
|
1244
|
+
_chunkLQ4DK4JFjs.ContextMenuItem,
|
|
1241
1245
|
{
|
|
1242
1246
|
onClick: () => {
|
|
1243
1247
|
const menu = nodeMenu;
|
|
@@ -1278,7 +1282,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, TriggerAutomationEditor, "TriggerAutomation
|
|
|
1278
1282
|
// src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx
|
|
1279
1283
|
|
|
1280
1284
|
function EmailAutomationCanvasTab() {
|
|
1281
|
-
const { open, setOpen } =
|
|
1285
|
+
const { open, setOpen } = _chunkLQ4DK4JFjs.useSidebar.call(void 0, );
|
|
1282
1286
|
_react.useEffect.call(void 0, () => {
|
|
1283
1287
|
const prev = open;
|
|
1284
1288
|
if (prev) setOpen(false);
|
|
@@ -1299,10 +1303,10 @@ function EmailAutomationRecipientsList() {
|
|
|
1299
1303
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1300
1304
|
const { automation } = useEmailAutomation();
|
|
1301
1305
|
const [statusFilter, setStatusFilter] = _react.useState.call(void 0, "all");
|
|
1302
|
-
const data =
|
|
1303
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1306
|
+
const data = _chunkLQ4DK4JFjs.useDataListRetriever.call(void 0, {
|
|
1307
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkHKZAESS6js.EmailAutomationService.findEnrollments(params), "retriever"),
|
|
1304
1308
|
retrieverParams: { automationId: _optionalChain([automation, 'optionalAccess', _44 => _44.id]) },
|
|
1305
|
-
module:
|
|
1309
|
+
module: _chunkHKZAESS6js.Modules.EmailAutomationEnrollment
|
|
1306
1310
|
});
|
|
1307
1311
|
const handleStatusChange = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => {
|
|
1308
1312
|
const status = _nullishCoalesce(value, () => ( "all"));
|
|
@@ -1321,21 +1325,21 @@ function EmailAutomationRecipientsList() {
|
|
|
1321
1325
|
[t]
|
|
1322
1326
|
);
|
|
1323
1327
|
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,
|
|
1328
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.Select, { items: statusItems, value: statusFilter, onValueChange: handleStatusChange, children: [
|
|
1329
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SelectTrigger, { className: "w-40", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SelectValue, {}) }),
|
|
1330
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.SelectContent, { children: [
|
|
1331
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SelectItem, { value: "all", children: t("emailAutomations.recipients.status.all") }),
|
|
1332
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SelectItem, { value: "active", children: t("emailAutomations.recipients.status.active") }),
|
|
1333
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SelectItem, { value: "completed", children: t("emailAutomations.recipients.status.completed") }),
|
|
1334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SelectItem, { value: "unsubscribed", children: t("emailAutomations.recipients.status.unsubscribed") }),
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SelectItem, { value: "exited", children: t("emailAutomations.recipients.status.exited") }),
|
|
1336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SelectItem, { value: "failed", children: t("emailAutomations.recipients.status.failed") })
|
|
1333
1337
|
] })
|
|
1334
1338
|
] }),
|
|
1335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.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
1340
|
] });
|
|
1337
1341
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1338
|
-
|
|
1342
|
+
_chunkLQ4DK4JFjs.ContentListTable,
|
|
1339
1343
|
{
|
|
1340
1344
|
data,
|
|
1341
1345
|
fields: [
|
|
@@ -1346,7 +1350,7 @@ function EmailAutomationRecipientsList() {
|
|
|
1346
1350
|
"nextSendAt" /* nextSendAt */,
|
|
1347
1351
|
"sentCount" /* sentCount */
|
|
1348
1352
|
],
|
|
1349
|
-
tableGeneratorType:
|
|
1353
|
+
tableGeneratorType: _chunkHKZAESS6js.Modules.EmailAutomationEnrollment,
|
|
1350
1354
|
filters,
|
|
1351
1355
|
allowSearch: false,
|
|
1352
1356
|
emptyState: t("emailAutomations.recipients.empty")
|
|
@@ -1363,15 +1367,15 @@ function EmailAutomationContainer({ automationId }) {
|
|
|
1363
1367
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationContainer, "EmailAutomationContainer");
|
|
1364
1368
|
function EmailAutomationShell() {
|
|
1365
1369
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1366
|
-
const generateUrl =
|
|
1370
|
+
const generateUrl = _chunkLQ4DK4JFjs.usePageUrlGenerator.call(void 0, );
|
|
1367
1371
|
const { automation, reload } = useEmailAutomation();
|
|
1368
1372
|
if (!automation) return null;
|
|
1369
1373
|
const breadcrumbs = [
|
|
1370
|
-
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page:
|
|
1374
|
+
{ name: t("emailAutomations.admin.title"), href: generateUrl({ page: _chunkHKZAESS6js.Modules.EmailAutomation }) },
|
|
1371
1375
|
{ name: automation.name }
|
|
1372
1376
|
];
|
|
1373
1377
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1374
|
-
|
|
1378
|
+
_chunkLQ4DK4JFjs.SharedProvider,
|
|
1375
1379
|
{
|
|
1376
1380
|
value: {
|
|
1377
1381
|
breadcrumbs,
|
|
@@ -1385,9 +1389,9 @@ function EmailAutomationShell() {
|
|
|
1385
1389
|
}
|
|
1386
1390
|
},
|
|
1387
1391
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1388
|
-
|
|
1392
|
+
_chunkLQ4DK4JFjs.RoundPageContainer,
|
|
1389
1393
|
{
|
|
1390
|
-
module:
|
|
1394
|
+
module: _chunkHKZAESS6js.Modules.EmailAutomation,
|
|
1391
1395
|
id: automation.id,
|
|
1392
1396
|
fullWidth: true,
|
|
1393
1397
|
forceHeader: true,
|
|
@@ -1426,7 +1430,7 @@ function EmailUnsubscribe({ token, scope }) {
|
|
|
1426
1430
|
_react.useEffect.call(void 0, () => {
|
|
1427
1431
|
async function unsubscribe() {
|
|
1428
1432
|
try {
|
|
1429
|
-
const enrollment = await
|
|
1433
|
+
const enrollment = await _chunkHKZAESS6js.EmailAutomationEnrollmentService.unsubscribe({ token, scope });
|
|
1430
1434
|
setAutomationName(_nullishCoalesce(_optionalChain([enrollment, 'optionalAccess', _45 => _45.automation, 'optionalAccess', _46 => _46.name]), () => ( "")));
|
|
1431
1435
|
setStoppedScope(scope);
|
|
1432
1436
|
setState("success");
|
|
@@ -1440,7 +1444,7 @@ function EmailUnsubscribe({ token, scope }) {
|
|
|
1440
1444
|
const stopAll = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1441
1445
|
setIsStoppingAll(true);
|
|
1442
1446
|
try {
|
|
1443
|
-
await
|
|
1447
|
+
await _chunkHKZAESS6js.EmailAutomationEnrollmentService.unsubscribe({ token, scope: "all" });
|
|
1444
1448
|
setStoppedScope("all");
|
|
1445
1449
|
} catch (e3) {
|
|
1446
1450
|
setState("error");
|
|
@@ -1457,16 +1461,16 @@ function EmailUnsubscribe({ token, scope }) {
|
|
|
1457
1461
|
if (state === "error") {
|
|
1458
1462
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1459
1463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-destructive/10 rounded-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.XCircle, { className: "text-destructive h-12 w-12" }) }),
|
|
1460
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1464
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.invalidTitle") }),
|
|
1461
1465
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.invalidBody") })
|
|
1462
1466
|
] });
|
|
1463
1467
|
}
|
|
1464
1468
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1465
1469
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-primary/10 rounded-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CheckCircle, { className: "text-primary h-12 w-12" }) }),
|
|
1466
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1470
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.title") }),
|
|
1467
1471
|
stoppedScope === "all" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.stoppedAll") }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1468
1472
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.stoppedAutomation", { name: automationName }) }),
|
|
1469
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1473
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.Button, { variant: "secondary", onClick: stopAll, disabled: isStoppingAll, children: [
|
|
1470
1474
|
isStoppingAll && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
1471
1475
|
t("emailAutomations.unsubscribe.alsoStopAll")
|
|
1472
1476
|
] })
|
|
@@ -1481,7 +1485,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailUnsubscribe, "EmailUnsubscribe");
|
|
|
1481
1485
|
|
|
1482
1486
|
var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1483
1487
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1484
|
-
const generateUrl =
|
|
1488
|
+
const generateUrl = _chunkLQ4DK4JFjs.usePageUrlGenerator.call(void 0, );
|
|
1485
1489
|
const triggerLabels = _nullishCoalesce(_optionalChain([params, 'access', _47 => _47.context, 'optionalAccess', _48 => _48.triggerLabels]), () => ( {}));
|
|
1486
1490
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1487
1491
|
return params.data.map((automation) => {
|
|
@@ -1510,7 +1514,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1510
1514
|
header: t("emailAutomations.list.columns.name"),
|
|
1511
1515
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1512
1516
|
const automation = row.original.jsonApiData;
|
|
1513
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1517
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Link, { href: generateUrl({ page: _chunkHKZAESS6js.Modules.EmailAutomation, id: automation.id }), children: automation.name });
|
|
1514
1518
|
}, "cell"),
|
|
1515
1519
|
enableSorting: false,
|
|
1516
1520
|
enableHiding: false
|
|
@@ -1533,7 +1537,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1533
1537
|
header: t("emailAutomations.list.columns.status"),
|
|
1534
1538
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1535
1539
|
const automation = row.original.jsonApiData;
|
|
1536
|
-
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1540
|
+
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Badge, { variant: "softGreen", children: t("emailAutomations.list.status.on") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Badge, { variant: "softGray", children: t("emailAutomations.list.status.off") });
|
|
1537
1541
|
}, "cell"),
|
|
1538
1542
|
enableSorting: false,
|
|
1539
1543
|
enableHiding: false
|
|
@@ -1556,7 +1560,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1556
1560
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
1557
1561
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1558
1562
|
}, "useEmailAutomationTableStructure");
|
|
1559
|
-
|
|
1563
|
+
_chunkLQ4DK4JFjs.registerTableGenerator.call(void 0, "email-automations", useEmailAutomationTableStructure);
|
|
1560
1564
|
|
|
1561
1565
|
// src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx
|
|
1562
1566
|
|
|
@@ -1571,7 +1575,7 @@ var STATUS_VARIANTS = {
|
|
|
1571
1575
|
};
|
|
1572
1576
|
var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1573
1577
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1574
|
-
const locale =
|
|
1578
|
+
const locale = _chunkHKZAESS6js.dateFormatLocale.call(void 0, _nextintl.useLocale.call(void 0, ));
|
|
1575
1579
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1576
1580
|
return params.data.map((enrollment) => {
|
|
1577
1581
|
const entry = { jsonApiData: enrollment };
|
|
@@ -1612,7 +1616,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1612
1616
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1613
1617
|
const enrollment = row.original.jsonApiData;
|
|
1614
1618
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1615
|
-
|
|
1619
|
+
_chunkLQ4DK4JFjs.Badge,
|
|
1616
1620
|
{
|
|
1617
1621
|
variant: _nullishCoalesce(STATUS_VARIANTS[enrollment.status], () => ( "softGray")),
|
|
1618
1622
|
title: enrollment.status === "failed" ? enrollment.lastError : void 0,
|
|
@@ -1641,7 +1645,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1641
1645
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1642
1646
|
const enrollment = row.original.jsonApiData;
|
|
1643
1647
|
if (!enrollment.nextSendAt) return empty;
|
|
1644
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children:
|
|
1648
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children: _chunkHKZAESS6js.formatDate.call(void 0, enrollment.nextSendAt, "dateTime", locale) });
|
|
1645
1649
|
}, "cell"),
|
|
1646
1650
|
enableSorting: false,
|
|
1647
1651
|
enableHiding: false
|
|
@@ -1663,7 +1667,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1663
1667
|
}, [params.fields, fieldColumnMap, t, locale]);
|
|
1664
1668
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1665
1669
|
}, "useEmailAutomationEnrollmentTableStructure");
|
|
1666
|
-
|
|
1670
|
+
_chunkLQ4DK4JFjs.registerTableGenerator.call(void 0, "email-automation-enrollments", useEmailAutomationEnrollmentTableStructure);
|
|
1667
1671
|
|
|
1668
1672
|
|
|
1669
1673
|
|