@carlonicora/nextjs-jsonapi 6.32.0 → 6.32.2
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-HQTBH527.mjs → BlockNoteEditor-KRNC6EAX.mjs} +4 -4
- package/dist/{BlockNoteEditor-YONN45A3.js → BlockNoteEditor-VXSVY6OY.js} +24 -24
- package/dist/{BlockNoteEditor-YONN45A3.js.map → BlockNoteEditor-VXSVY6OY.js.map} +1 -1
- package/dist/{BlockNoteViewer-BNZEXGVT.mjs → BlockNoteViewer-NVSR67X5.mjs} +2 -2
- package/dist/{BlockNoteViewer-YONLBNXW.js → BlockNoteViewer-RQBYHBQL.js} +3 -3
- package/dist/{BlockNoteViewer-YONLBNXW.js.map → BlockNoteViewer-RQBYHBQL.js.map} +1 -1
- package/dist/billing/index.js +465 -465
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-HNK2O6YE.mjs → chunk-4JVLLBRS.mjs} +4 -16
- package/dist/chunk-4JVLLBRS.mjs.map +1 -0
- package/dist/{chunk-6DNGLY5Y.mjs → chunk-4SXHRANW.mjs} +55 -42
- package/dist/chunk-4SXHRANW.mjs.map +1 -0
- package/dist/{chunk-NQL2NDKH.js → chunk-5H25LM2Z.js} +10 -10
- package/dist/chunk-5H25LM2Z.js.map +1 -0
- package/dist/{chunk-FDKAVSZ6.mjs → chunk-AEBZ67JJ.mjs} +8 -8
- package/dist/chunk-AEBZ67JJ.mjs.map +1 -0
- package/dist/{chunk-JL6XL5NK.mjs → chunk-AMQFKCAX.mjs} +2 -2
- package/dist/{chunk-J37GJKCB.js → chunk-GPVLFNLB.js} +1242 -1229
- package/dist/chunk-GPVLFNLB.js.map +1 -0
- package/dist/{chunk-5XP5G45B.js → chunk-NPGX2GJD.js} +4 -16
- package/dist/chunk-NPGX2GJD.js.map +1 -0
- package/dist/{chunk-Q5SMFSE4.js → chunk-PNCO3HMJ.js} +3 -3
- package/dist/{chunk-Q5SMFSE4.js.map → chunk-PNCO3HMJ.js.map} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/email-automations/index.js +105 -105
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.js +114 -114
- package/dist/features/analytics/index.mjs +3 -3
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/auth/components/forms/RefreshUser.d.ts.map +1 -1
- package/dist/features/auth/config.d.ts +0 -9
- package/dist/features/auth/config.d.ts.map +1 -1
- package/dist/features/auth/data/auth.service.d.ts.map +1 -1
- package/dist/features/auth/data/two-factor.service.d.ts.map +1 -1
- package/dist/features/auth/utils/AuthCookies.d.ts +0 -9
- package/dist/features/auth/utils/AuthCookies.d.ts.map +1 -1
- package/dist/features/blog/index.js +129 -129
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +7 -7
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +114 -114
- package/dist/features/tokenusage/index.mjs +3 -3
- package/dist/features/user/contexts/CurrentUserContext.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/server/ServerSession.d.ts.map +1 -1
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/dist/shadcnui/ui/calendar.d.ts +1 -1
- package/dist/shadcnui/ui/calendar.d.ts.map +1 -1
- package/messages/en.json +11 -0
- package/messages/it.json +11 -0
- package/package.json +1 -1
- package/src/features/auth/components/forms/RefreshUser.tsx +0 -3
- package/src/features/auth/config.ts +0 -9
- package/src/features/auth/data/auth.service.ts +0 -8
- package/src/features/auth/data/two-factor.service.ts +0 -4
- package/src/features/auth/utils/AuthCookies.ts +1 -23
- package/src/features/user/contexts/CurrentUserContext.tsx +0 -4
- package/src/features/user/contexts/__tests__/CurrentUserContext.spec.tsx +2 -0
- package/src/server/ServerSession.ts +10 -26
- package/src/server/__tests__/ServerSession.hasPermissionToModule.spec.ts +78 -0
- package/src/shadcnui/ui/__tests__/calendar.spec.tsx +222 -0
- package/src/shadcnui/ui/calendar.tsx +28 -1
- package/dist/chunk-5XP5G45B.js.map +0 -1
- package/dist/chunk-6DNGLY5Y.mjs.map +0 -1
- package/dist/chunk-FDKAVSZ6.mjs.map +0 -1
- package/dist/chunk-HNK2O6YE.mjs.map +0 -1
- package/dist/chunk-J37GJKCB.js.map +0 -1
- package/dist/chunk-NQL2NDKH.js.map +0 -1
- /package/dist/{BlockNoteEditor-HQTBH527.mjs.map → BlockNoteEditor-KRNC6EAX.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-BNZEXGVT.mjs.map → BlockNoteViewer-NVSR67X5.mjs.map} +0 -0
- /package/dist/{chunk-JL6XL5NK.mjs.map → chunk-AMQFKCAX.mjs.map} +0 -0
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
isReferralEnabled,
|
|
29
29
|
isRegistrationAllowed,
|
|
30
30
|
useWaitlistText
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-AMQFKCAX.mjs";
|
|
32
32
|
import {
|
|
33
33
|
getRoleId,
|
|
34
34
|
isRolesConfigured
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
useIsMobile,
|
|
104
104
|
validateItalianTaxCode,
|
|
105
105
|
validatePartitaIva
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-4JVLLBRS.mjs";
|
|
107
107
|
import {
|
|
108
108
|
dateFormatLocale,
|
|
109
109
|
formatDate
|
|
@@ -710,7 +710,7 @@ __name(BreadcrumbEllipsis, "BreadcrumbEllipsis");
|
|
|
710
710
|
|
|
711
711
|
// src/shadcnui/ui/calendar.tsx
|
|
712
712
|
import * as React2 from "react";
|
|
713
|
-
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
713
|
+
import { DateLib, DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
714
714
|
import { ChevronLeftIcon, ChevronRightIcon as ChevronRightIcon2, ChevronDownIcon as ChevronDownIcon2 } from "lucide-react";
|
|
715
715
|
|
|
716
716
|
// src/contexts/DirectionContext.tsx
|
|
@@ -727,6 +727,31 @@ function useDir() {
|
|
|
727
727
|
}
|
|
728
728
|
__name(useDir, "useDir");
|
|
729
729
|
|
|
730
|
+
// src/shadcnui/ui/use-ui-text.ts
|
|
731
|
+
import { useCallback } from "react";
|
|
732
|
+
function interpolate(text, values) {
|
|
733
|
+
if (!values) return text;
|
|
734
|
+
return text.replace(/\{(\w+)\}/g, (match, name) => name in values ? String(values[name]) : match);
|
|
735
|
+
}
|
|
736
|
+
__name(interpolate, "interpolate");
|
|
737
|
+
function useUiText() {
|
|
738
|
+
const t = useI18nTranslations();
|
|
739
|
+
return useCallback(
|
|
740
|
+
(key, fallback, values) => {
|
|
741
|
+
if (typeof t.has === "function" && !t.has(key)) return interpolate(fallback, values);
|
|
742
|
+
try {
|
|
743
|
+
const text = t(key, values);
|
|
744
|
+
if (!text || text === key || text.endsWith(`.${key}`)) return interpolate(fallback, values);
|
|
745
|
+
return text;
|
|
746
|
+
} catch {
|
|
747
|
+
return interpolate(fallback, values);
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
[t]
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
__name(useUiText, "useUiText");
|
|
754
|
+
|
|
730
755
|
// src/shadcnui/ui/calendar.tsx
|
|
731
756
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
732
757
|
function Calendar({
|
|
@@ -737,10 +762,31 @@ function Calendar({
|
|
|
737
762
|
buttonVariant = "ghost",
|
|
738
763
|
formatters,
|
|
739
764
|
components,
|
|
765
|
+
labels,
|
|
740
766
|
...props
|
|
741
767
|
}) {
|
|
742
768
|
const defaultClassNames = getDefaultClassNames();
|
|
743
769
|
const dir = useDir();
|
|
770
|
+
const uiText = useUiText();
|
|
771
|
+
const translatedLabels = {
|
|
772
|
+
labelPrevious: /* @__PURE__ */ __name(() => uiText("ui.calendar.previous_month", "Go to the Previous Month"), "labelPrevious"),
|
|
773
|
+
labelNext: /* @__PURE__ */ __name(() => uiText("ui.calendar.next_month", "Go to the Next Month"), "labelNext"),
|
|
774
|
+
labelNav: /* @__PURE__ */ __name(() => uiText("ui.calendar.navigation", ""), "labelNav"),
|
|
775
|
+
labelMonthDropdown: /* @__PURE__ */ __name(() => uiText("ui.calendar.choose_month", "Choose the Month"), "labelMonthDropdown"),
|
|
776
|
+
labelYearDropdown: /* @__PURE__ */ __name(() => uiText("ui.calendar.choose_year", "Choose the Year"), "labelYearDropdown"),
|
|
777
|
+
labelDayButton: /* @__PURE__ */ __name((date, modifiers, options, dateLib) => {
|
|
778
|
+
let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
|
|
779
|
+
if (modifiers.today) label = uiText("ui.calendar.today", "Today, {date}", { date: label });
|
|
780
|
+
if (modifiers.selected) label = uiText("ui.calendar.selected", "{date}, selected", { date: label });
|
|
781
|
+
return label;
|
|
782
|
+
}, "labelDayButton"),
|
|
783
|
+
labelGridcell: /* @__PURE__ */ __name((date, modifiers, options, dateLib) => {
|
|
784
|
+
const label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
|
|
785
|
+
return modifiers?.today ? uiText("ui.calendar.today", "Today, {date}", { date: label }) : label;
|
|
786
|
+
}, "labelGridcell"),
|
|
787
|
+
labelWeekNumber: /* @__PURE__ */ __name((weekNumber) => uiText("ui.calendar.week_number", "Week {number}", { number: weekNumber }), "labelWeekNumber"),
|
|
788
|
+
labelWeekNumberHeader: /* @__PURE__ */ __name(() => uiText("ui.calendar.week_number_header", "Week Number"), "labelWeekNumberHeader")
|
|
789
|
+
};
|
|
744
790
|
return /* @__PURE__ */ jsx8(
|
|
745
791
|
DayPicker,
|
|
746
792
|
{
|
|
@@ -751,6 +797,7 @@ function Calendar({
|
|
|
751
797
|
className
|
|
752
798
|
),
|
|
753
799
|
captionLayout,
|
|
800
|
+
labels: { ...translatedLabels, ...labels },
|
|
754
801
|
formatters: {
|
|
755
802
|
formatMonthDropdown: /* @__PURE__ */ __name((date) => date.toLocaleString(props.locale?.code ?? "default", { month: "short" }), "formatMonthDropdown"),
|
|
756
803
|
...formatters
|
|
@@ -944,33 +991,6 @@ __name(CardFooter, "CardFooter");
|
|
|
944
991
|
import * as React3 from "react";
|
|
945
992
|
import useEmblaCarousel from "embla-carousel-react";
|
|
946
993
|
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon3 } from "lucide-react";
|
|
947
|
-
|
|
948
|
-
// src/shadcnui/ui/use-ui-text.ts
|
|
949
|
-
import { useCallback } from "react";
|
|
950
|
-
function interpolate(text, values) {
|
|
951
|
-
if (!values) return text;
|
|
952
|
-
return text.replace(/\{(\w+)\}/g, (match, name) => name in values ? String(values[name]) : match);
|
|
953
|
-
}
|
|
954
|
-
__name(interpolate, "interpolate");
|
|
955
|
-
function useUiText() {
|
|
956
|
-
const t = useI18nTranslations();
|
|
957
|
-
return useCallback(
|
|
958
|
-
(key, fallback, values) => {
|
|
959
|
-
if (typeof t.has === "function" && !t.has(key)) return interpolate(fallback, values);
|
|
960
|
-
try {
|
|
961
|
-
const text = t(key, values);
|
|
962
|
-
if (!text || text === key || text.endsWith(`.${key}`)) return interpolate(fallback, values);
|
|
963
|
-
return text;
|
|
964
|
-
} catch {
|
|
965
|
-
return interpolate(fallback, values);
|
|
966
|
-
}
|
|
967
|
-
},
|
|
968
|
-
[t]
|
|
969
|
-
);
|
|
970
|
-
}
|
|
971
|
-
__name(useUiText, "useUiText");
|
|
972
|
-
|
|
973
|
-
// src/shadcnui/ui/carousel.tsx
|
|
974
994
|
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
975
995
|
var CarouselContext = React3.createContext(null);
|
|
976
996
|
function useCarousel() {
|
|
@@ -8085,11 +8105,7 @@ var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
8085
8105
|
userId: fullUser.id,
|
|
8086
8106
|
companyId: fullUser.company?.id,
|
|
8087
8107
|
roles: fullUser.roles.map((role) => role.id),
|
|
8088
|
-
features: fullUser.company?.features?.map((feature) => feature.id) ?? []
|
|
8089
|
-
modules: fullUser.modules.map((module) => ({
|
|
8090
|
-
id: module.id,
|
|
8091
|
-
permissions: module.permissions
|
|
8092
|
-
}))
|
|
8108
|
+
features: fullUser.company?.features?.map((feature) => feature.id) ?? []
|
|
8093
8109
|
});
|
|
8094
8110
|
}
|
|
8095
8111
|
setDehydratedUser(fullUser.dehydrate());
|
|
@@ -10883,7 +10899,7 @@ import { useRef as useRef18 } from "react";
|
|
|
10883
10899
|
import dynamic from "next/dynamic";
|
|
10884
10900
|
import React18 from "react";
|
|
10885
10901
|
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
10886
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10902
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-KRNC6EAX.mjs"), {
|
|
10887
10903
|
ssr: false
|
|
10888
10904
|
});
|
|
10889
10905
|
var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -17317,7 +17333,7 @@ __name(removeTrailingEmptyBlocks, "removeTrailingEmptyBlocks");
|
|
|
17317
17333
|
import dynamic2 from "next/dynamic";
|
|
17318
17334
|
import React29 from "react";
|
|
17319
17335
|
import { jsx as jsx178 } from "react/jsx-runtime";
|
|
17320
|
-
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-
|
|
17336
|
+
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-NVSR67X5.mjs").then((m) => m.BlockNoteViewer), { ssr: false });
|
|
17321
17337
|
var BlockNoteViewerContainer = React29.memo(/* @__PURE__ */ __name(function ViewerContainer(props) {
|
|
17322
17338
|
return /* @__PURE__ */ jsx178(BlockNoteViewer, { ...props });
|
|
17323
17339
|
}, "ViewerContainer"));
|
|
@@ -22144,10 +22160,7 @@ function RefreshUser() {
|
|
|
22144
22160
|
userId: fullUser.id,
|
|
22145
22161
|
companyId: fullUser.company?.id,
|
|
22146
22162
|
roles: fullUser.roles.map((role) => role.id),
|
|
22147
|
-
features: fullUser.company?.features?.map((feature) => feature.id) ?? []
|
|
22148
|
-
modules: fullUser.modules.map((module) => {
|
|
22149
|
-
return { id: module.id, permissions: module.permissions };
|
|
22150
|
-
})
|
|
22163
|
+
features: fullUser.company?.features?.map((feature) => feature.id) ?? []
|
|
22151
22164
|
};
|
|
22152
22165
|
await getTokenHandler()?.updateToken(token);
|
|
22153
22166
|
deleteCookie("reloadData");
|
|
@@ -31097,4 +31110,4 @@ export {
|
|
|
31097
31110
|
useOAuthClients,
|
|
31098
31111
|
useOAuthClient
|
|
31099
31112
|
};
|
|
31100
|
-
//# sourceMappingURL=chunk-
|
|
31113
|
+
//# sourceMappingURL=chunk-4SXHRANW.mjs.map
|