@carlonicora/nextjs-jsonapi 6.15.0 → 6.17.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-UIAX72XW.js → BlockNoteEditor-FAUTV5FW.js} +20 -20
- package/dist/{BlockNoteEditor-UIAX72XW.js.map → BlockNoteEditor-FAUTV5FW.js.map} +1 -1
- package/dist/{BlockNoteEditor-I3J6YYXK.mjs → BlockNoteEditor-IGUHTERQ.mjs} +5 -5
- package/dist/{BlockNoteViewer-HIUAJQRI.mjs → BlockNoteViewer-X4UEVI2A.mjs} +3 -3
- package/dist/{BlockNoteViewer-APBOPT4B.js → BlockNoteViewer-XYKFY77F.js} +4 -4
- package/dist/{BlockNoteViewer-APBOPT4B.js.map → BlockNoteViewer-XYKFY77F.js.map} +1 -1
- package/dist/EmailPurpose-DOsSqM5K.d.mts +3 -0
- package/dist/EmailPurpose-DOsSqM5K.d.ts +3 -0
- package/dist/billing/index.js +492 -492
- package/dist/billing/index.mjs +4 -4
- package/dist/{chunk-RT7XFGIN.js → chunk-4OCBNCKH.js} +1041 -999
- package/dist/chunk-4OCBNCKH.js.map +1 -0
- package/dist/{chunk-4XLDBOSE.js → chunk-A7Y5YW7Q.js} +1 -1
- package/dist/{chunk-4XLDBOSE.js.map → chunk-A7Y5YW7Q.js.map} +1 -1
- package/dist/{chunk-ZYSNJKOP.js → chunk-DFA566KY.js} +4 -4
- package/dist/{chunk-ZYSNJKOP.js.map → chunk-DFA566KY.js.map} +1 -1
- package/dist/{chunk-DJXSCARG.js → chunk-I5BQLY7V.js} +9 -9
- package/dist/{chunk-DJXSCARG.js.map → chunk-I5BQLY7V.js.map} +1 -1
- package/dist/{chunk-RFKSJIQB.mjs → chunk-KMPBSOFB.mjs} +138 -5
- package/dist/chunk-KMPBSOFB.mjs.map +1 -0
- package/dist/{chunk-UOTHRJD2.mjs → chunk-OKBJEIOP.mjs} +1 -1
- package/dist/chunk-OKBJEIOP.mjs.map +1 -0
- package/dist/{chunk-PMESKNKL.js → chunk-OO2DBP6L.js} +1106 -973
- package/dist/chunk-OO2DBP6L.js.map +1 -0
- package/dist/{chunk-RYY7USSW.mjs → chunk-RINMQQZH.mjs} +56 -14
- package/dist/{chunk-RYY7USSW.mjs.map → chunk-RINMQQZH.mjs.map} +1 -1
- package/dist/{chunk-HAW5PNJG.mjs → chunk-TY5YWBLL.mjs} +3 -3
- package/dist/{chunk-OUEYZOLB.mjs → chunk-YVKWACDP.mjs} +2 -2
- package/dist/client/index.js +5 -5
- package/dist/client/index.mjs +4 -4
- package/dist/components/index.d.mts +10 -3
- package/dist/components/index.d.ts +10 -3
- package/dist/components/index.js +5 -5
- package/dist/components/index.mjs +4 -4
- package/dist/contexts/index.js +5 -5
- package/dist/contexts/index.mjs +4 -4
- package/dist/core/index.d.mts +92 -7
- package/dist/core/index.d.ts +92 -7
- package/dist/core/index.js +7 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +6 -2
- package/dist/{email-automation-enrollment.fields-BZvF14qx.d.mts → email-automation-enrollment.fields-CPsgxLif.d.mts} +11 -1
- package/dist/{email-automation-enrollment.fields-Cp3VMzFq.d.ts → email-automation-enrollment.fields-CVicSamF.d.ts} +11 -1
- package/dist/email-automations/index.d.mts +19 -5
- package/dist/email-automations/index.d.ts +19 -5
- package/dist/email-automations/index.js +356 -129
- package/dist/email-automations/index.js.map +1 -1
- package/dist/email-automations/index.mjs +306 -79
- package/dist/email-automations/index.mjs.map +1 -1
- package/dist/features/analytics/index.js +121 -121
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +5 -5
- package/dist/features/analytics/server.mjs +3 -3
- package/dist/features/blog/index.js +151 -151
- package/dist/features/blog/index.mjs +4 -4
- package/dist/features/blog/server.js +17 -17
- package/dist/features/blog/server.mjs +2 -2
- package/dist/features/help/index.js +38 -38
- package/dist/features/help/index.mjs +4 -4
- package/dist/features/tokenusage/index.js +127 -127
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/offline/index.js +14 -14
- package/dist/offline/index.mjs +1 -1
- package/dist/{referral-admin.interface-RVO-ZTJz.d.mts → referral-admin.interface-DTj4LzXx.d.mts} +3 -0
- package/dist/{referral-admin.interface-CnytdDaQ.d.ts → referral-admin.interface-DeSCw3Pp.d.ts} +3 -0
- package/dist/server/index.js +4 -4
- package/dist/server/index.mjs +3 -3
- package/messages/en.json +35 -3
- package/messages/it.json +35 -3
- package/package.json +1 -1
- package/src/core/index.ts +1 -0
- package/src/core/registry/ModuleRegistry.ts +1 -0
- package/src/features/email-automation/EmailAutomationCandidateModule.ts +12 -0
- package/src/features/email-automation/EmailAutomationModule.ts +1 -0
- package/src/features/email-automation/components/__tests__/EmailAutomationEditor.spec.tsx +74 -9
- package/src/features/email-automation/components/forms/EmailAutomationAddPersonDialog.tsx +226 -0
- package/src/features/email-automation/components/forms/EmailAutomationEditor.tsx +23 -0
- package/src/features/email-automation/components/forms/EmailStepEditor.tsx +7 -3
- package/src/features/email-automation/components/index.ts +1 -0
- package/src/features/email-automation/components/lists/EmailAutomationRecipientsList.tsx +38 -20
- package/src/features/email-automation/components/lists/EmailAutomationsList.tsx +1 -0
- package/src/features/email-automation/components/unsubscribe/EmailUnsubscribe.tsx +9 -4
- package/src/features/email-automation/data/EmailAutomation.ts +9 -0
- package/src/features/email-automation/data/EmailAutomationCandidate.ts +66 -0
- package/src/features/email-automation/data/EmailAutomationCandidateInterface.ts +19 -0
- package/src/features/email-automation/data/EmailAutomationEnrollment.ts +16 -2
- package/src/features/email-automation/data/EmailAutomationEnrollmentInterface.ts +7 -0
- package/src/features/email-automation/data/EmailAutomationInterface.ts +3 -0
- package/src/features/email-automation/data/EmailAutomationService.ts +53 -1
- package/src/features/email-automation/data/EmailPurpose.ts +1 -0
- package/src/features/email-automation/data/__tests__/email-automation-models.spec.ts +70 -0
- package/src/features/email-automation/data/email-automation.fields.ts +1 -0
- package/src/features/email-automation/data/index.ts +2 -0
- package/src/features/email-automation/hooks/useEmailAutomationTableStructure.tsx +19 -0
- package/src/features/email-automation/index.ts +2 -0
- package/src/features/email-blast/EmailBlastModule.ts +1 -0
- package/src/features/email-blast/components/forms/EmailBlastEditor.tsx +33 -4
- package/src/features/email-blast/components/lists/EmailBlastsList.tsx +1 -0
- package/src/features/email-blast/data/EmailBlast.ts +10 -1
- package/src/features/email-blast/data/EmailBlastInterface.ts +3 -0
- package/src/features/email-blast/data/__tests__/EmailBlast.spec.ts +18 -0
- package/src/features/email-blast/data/email-blast.fields.ts +1 -0
- package/src/features/email-blast/hooks/useEmailBlastTableStructure.tsx +15 -0
- package/src/features/notification/components/notifications/PushNotificationProvider.tsx +14 -2
- package/src/features/notification/components/notifications/__tests__/PushNotificationProvider.spec.tsx +11 -0
- package/dist/chunk-PMESKNKL.js.map +0 -1
- package/dist/chunk-RFKSJIQB.mjs.map +0 -1
- package/dist/chunk-RT7XFGIN.js.map +0 -1
- package/dist/chunk-UOTHRJD2.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-I3J6YYXK.mjs.map → BlockNoteEditor-IGUHTERQ.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-HIUAJQRI.mjs.map → BlockNoteViewer-X4UEVI2A.mjs.map} +0 -0
- /package/dist/{chunk-HAW5PNJG.mjs.map → chunk-TY5YWBLL.mjs.map} +0 -0
- /package/dist/{chunk-OUEYZOLB.mjs.map → chunk-YVKWACDP.mjs.map} +0 -0
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isReferralEnabled,
|
|
20
20
|
isRegistrationAllowed,
|
|
21
21
|
useWaitlistText
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TY5YWBLL.mjs";
|
|
23
23
|
import {
|
|
24
24
|
getRoleId,
|
|
25
25
|
isRolesConfigured
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
useIsMobile,
|
|
97
97
|
validateItalianTaxCode,
|
|
98
98
|
validatePartitaIva
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-KMPBSOFB.mjs";
|
|
100
100
|
import {
|
|
101
101
|
useOfflineState
|
|
102
102
|
} from "./chunk-OY65RYD3.mjs";
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
useI18nLocale,
|
|
111
111
|
useI18nRouter,
|
|
112
112
|
useI18nTranslations
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-OKBJEIOP.mjs";
|
|
114
114
|
import {
|
|
115
115
|
CURRENT_USER_STORAGE_KEY
|
|
116
116
|
} from "./chunk-AUD6ZLBB.mjs";
|
|
@@ -10852,7 +10852,7 @@ import { useRef as useRef18 } from "react";
|
|
|
10852
10852
|
import dynamic from "next/dynamic";
|
|
10853
10853
|
import React18 from "react";
|
|
10854
10854
|
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
10855
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10855
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-IGUHTERQ.mjs"), {
|
|
10856
10856
|
ssr: false
|
|
10857
10857
|
});
|
|
10858
10858
|
var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -17085,7 +17085,7 @@ __name(BlockNoteEditorMentionSuggestionMenu, "BlockNoteEditorMentionSuggestionMe
|
|
|
17085
17085
|
import dynamic2 from "next/dynamic";
|
|
17086
17086
|
import React29 from "react";
|
|
17087
17087
|
import { jsx as jsx178 } from "react/jsx-runtime";
|
|
17088
|
-
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-
|
|
17088
|
+
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-X4UEVI2A.mjs").then((m) => m.BlockNoteViewer), { ssr: false });
|
|
17089
17089
|
var BlockNoteViewerContainer = React29.memo(/* @__PURE__ */ __name(function ViewerContainer(props) {
|
|
17090
17090
|
return /* @__PURE__ */ jsx178(BlockNoteViewer, { ...props });
|
|
17091
17091
|
}, "ViewerContainer"));
|
|
@@ -23121,6 +23121,17 @@ var useEmailBlastTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
23121
23121
|
enableSorting: false,
|
|
23122
23122
|
enableHiding: false
|
|
23123
23123
|
}),
|
|
23124
|
+
["purpose" /* purpose */]: () => ({
|
|
23125
|
+
id: "purpose",
|
|
23126
|
+
accessorKey: "purpose",
|
|
23127
|
+
header: t("emailBlasts.list.columns.purpose"),
|
|
23128
|
+
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
23129
|
+
const blast = row.original.jsonApiData;
|
|
23130
|
+
return blast.purpose === "service" ? /* @__PURE__ */ jsx245(Badge, { variant: "softBlue", children: t("emailPurpose.service") }) : /* @__PURE__ */ jsx245(Badge, { variant: "softGray", children: t("emailPurpose.marketing") });
|
|
23131
|
+
}, "cell"),
|
|
23132
|
+
enableSorting: false,
|
|
23133
|
+
enableHiding: false
|
|
23134
|
+
}),
|
|
23124
23135
|
["status" /* status */]: () => ({
|
|
23125
23136
|
id: "status",
|
|
23126
23137
|
accessorKey: "status",
|
|
@@ -23167,7 +23178,8 @@ import { useForm as useForm12 } from "react-hook-form";
|
|
|
23167
23178
|
import { v4 as v413 } from "uuid";
|
|
23168
23179
|
import { z as z13 } from "zod";
|
|
23169
23180
|
import { Fragment as Fragment47, jsx as jsx246, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
23170
|
-
var TEMPLATE_VARIABLES = ["{{name}}", "{{email}}", "{{url}}"
|
|
23181
|
+
var TEMPLATE_VARIABLES = ["{{name}}", "{{email}}", "{{url}}"];
|
|
23182
|
+
var MARKETING_ONLY_VARIABLES = ["{{unsubscribeAllUrl}}"];
|
|
23171
23183
|
function EmailBlastEditorInternal({
|
|
23172
23184
|
blast,
|
|
23173
23185
|
propagateChanges,
|
|
@@ -23188,7 +23200,8 @@ function EmailBlastEditorInternal({
|
|
|
23188
23200
|
body: z13.string().min(1, { message: t("emailBlasts.editor.fields.body.error") }),
|
|
23189
23201
|
replyTo: z13.string().refine((value) => value === "" || z13.email().safeParse(value).success, {
|
|
23190
23202
|
message: t("emailBlasts.editor.fields.replyTo.error")
|
|
23191
|
-
})
|
|
23203
|
+
}),
|
|
23204
|
+
purpose: z13.enum(["service", "marketing"], { message: t("emailPurpose.error") })
|
|
23192
23205
|
}),
|
|
23193
23206
|
[t]
|
|
23194
23207
|
);
|
|
@@ -23197,7 +23210,9 @@ function EmailBlastEditorInternal({
|
|
|
23197
23210
|
id: blast?.id ?? v413(),
|
|
23198
23211
|
subject: blast?.subject ?? "",
|
|
23199
23212
|
body: blast?.body ?? "",
|
|
23200
|
-
replyTo: blast?.replyTo ?? ""
|
|
23213
|
+
replyTo: blast?.replyTo ?? "",
|
|
23214
|
+
// No preselected value on create: the form refuses to save without a choice.
|
|
23215
|
+
purpose: blast?.purpose ?? ""
|
|
23201
23216
|
}),
|
|
23202
23217
|
[blast]
|
|
23203
23218
|
);
|
|
@@ -23205,6 +23220,15 @@ function EmailBlastEditorInternal({
|
|
|
23205
23220
|
resolver: zodResolver12(formSchema),
|
|
23206
23221
|
defaultValues: getDefaultValues()
|
|
23207
23222
|
});
|
|
23223
|
+
const purpose = form.watch("purpose");
|
|
23224
|
+
const templateVariables = purpose === "service" ? TEMPLATE_VARIABLES : [...TEMPLATE_VARIABLES, ...MARKETING_ONLY_VARIABLES];
|
|
23225
|
+
const purposeValues = useMemo46(
|
|
23226
|
+
() => [
|
|
23227
|
+
{ id: "service", text: t("emailPurpose.service") },
|
|
23228
|
+
{ id: "marketing", text: t("emailPurpose.marketing") }
|
|
23229
|
+
],
|
|
23230
|
+
[t]
|
|
23231
|
+
);
|
|
23208
23232
|
return /* @__PURE__ */ jsx246(
|
|
23209
23233
|
EditorSheet,
|
|
23210
23234
|
{
|
|
@@ -23223,7 +23247,8 @@ function EmailBlastEditorInternal({
|
|
|
23223
23247
|
id: values.id,
|
|
23224
23248
|
subject: values.subject,
|
|
23225
23249
|
body: values.body,
|
|
23226
|
-
replyTo: values.replyTo || void 0
|
|
23250
|
+
replyTo: values.replyTo || void 0,
|
|
23251
|
+
purpose: values.purpose
|
|
23227
23252
|
};
|
|
23228
23253
|
return isEdit ? await EmailBlastService.update(payload) : await EmailBlastService.create(payload);
|
|
23229
23254
|
},
|
|
@@ -23235,6 +23260,18 @@ function EmailBlastEditorInternal({
|
|
|
23235
23260
|
onDialogOpenChange,
|
|
23236
23261
|
children: /* @__PURE__ */ jsxs143("div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
23237
23262
|
/* @__PURE__ */ jsx246(FormInput, { form, id: "subject", name: t("emailBlasts.editor.fields.subject.label"), isRequired: true }),
|
|
23263
|
+
/* @__PURE__ */ jsx246(
|
|
23264
|
+
FormSelect,
|
|
23265
|
+
{
|
|
23266
|
+
form,
|
|
23267
|
+
id: "purpose",
|
|
23268
|
+
name: t("emailPurpose.label"),
|
|
23269
|
+
placeholder: t("emailPurpose.placeholder"),
|
|
23270
|
+
values: purposeValues,
|
|
23271
|
+
description: purpose === "service" ? t("emailPurpose.serviceWarning") : void 0,
|
|
23272
|
+
isRequired: true
|
|
23273
|
+
}
|
|
23274
|
+
),
|
|
23238
23275
|
/* @__PURE__ */ jsx246(FormInput, { form, id: "replyTo", name: t("emailBlasts.editor.fields.replyTo.label") }),
|
|
23239
23276
|
/* @__PURE__ */ jsx246(
|
|
23240
23277
|
FormTextarea,
|
|
@@ -23248,9 +23285,9 @@ function EmailBlastEditorInternal({
|
|
|
23248
23285
|
/* @__PURE__ */ jsxs143("span", { className: "block", children: [
|
|
23249
23286
|
t("emailBlasts.editor.variablesHint"),
|
|
23250
23287
|
" ",
|
|
23251
|
-
|
|
23288
|
+
templateVariables.map((variable) => /* @__PURE__ */ jsx246("span", { className: "me-2 text-foreground", children: variable }, variable))
|
|
23252
23289
|
] }),
|
|
23253
|
-
/* @__PURE__ */ jsx246("span", { className: "mt-1 block", children: t("emailBlasts.editor.unsubscribeHint") })
|
|
23290
|
+
/* @__PURE__ */ jsx246("span", { className: "mt-1 block", children: purpose === "service" ? t("emailBlasts.editor.serviceHint") : t("emailBlasts.editor.unsubscribeHint") })
|
|
23254
23291
|
] })
|
|
23255
23292
|
}
|
|
23256
23293
|
)
|
|
@@ -23281,6 +23318,7 @@ function EmailBlastsList({ fullWidth } = {}) {
|
|
|
23281
23318
|
data,
|
|
23282
23319
|
fields: [
|
|
23283
23320
|
"subject" /* subject */,
|
|
23321
|
+
"purpose" /* purpose */,
|
|
23284
23322
|
"status" /* status */,
|
|
23285
23323
|
"sentAt" /* sentAt */,
|
|
23286
23324
|
"sent" /* sent */,
|
|
@@ -26960,9 +26998,13 @@ __name(NotificationModal, "NotificationModal");
|
|
|
26960
26998
|
|
|
26961
26999
|
// src/features/notification/components/notifications/PushNotificationProvider.tsx
|
|
26962
27000
|
import { Fragment as Fragment62, jsx as jsx302 } from "react/jsx-runtime";
|
|
26963
|
-
function PushNotificationProvider({
|
|
27001
|
+
function PushNotificationProvider({
|
|
27002
|
+
children,
|
|
27003
|
+
excludedRoleIds = []
|
|
27004
|
+
}) {
|
|
26964
27005
|
const { currentUser, hasRole } = useCurrentUserContext();
|
|
26965
|
-
|
|
27006
|
+
const canSubscribe = !hasRole(getRoleId().Administrator) && !excludedRoleIds.some((roleId) => hasRole(roleId));
|
|
27007
|
+
usePushNotifications_default({ currentUser: currentUser ?? void 0, canSubscribe });
|
|
26966
27008
|
return /* @__PURE__ */ jsx302(Fragment62, { children });
|
|
26967
27009
|
}
|
|
26968
27010
|
__name(PushNotificationProvider, "PushNotificationProvider");
|
|
@@ -30788,4 +30830,4 @@ export {
|
|
|
30788
30830
|
useOAuthClients,
|
|
30789
30831
|
useOAuthClient
|
|
30790
30832
|
};
|
|
30791
|
-
//# sourceMappingURL=chunk-
|
|
30833
|
+
//# sourceMappingURL=chunk-RINMQQZH.mjs.map
|