@carlonicora/nextjs-jsonapi 1.131.1 → 1.132.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-BR3IRGJW.js → BlockNoteEditor-JAELO23S.js} +19 -19
- package/dist/{BlockNoteEditor-BR3IRGJW.js.map → BlockNoteEditor-JAELO23S.js.map} +1 -1
- package/dist/{BlockNoteEditor-PVBZYPMF.mjs → BlockNoteEditor-WZFEJS2B.mjs} +4 -4
- package/dist/billing/index.js +357 -357
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-LBMNRFCY.js → chunk-5IE6DZ2D.js} +153 -77
- package/dist/chunk-5IE6DZ2D.js.map +1 -0
- package/dist/{chunk-MDXT47V4.mjs → chunk-67LIVKYU.mjs} +198 -203
- package/dist/chunk-67LIVKYU.mjs.map +1 -0
- package/dist/{chunk-5MNE72ZE.mjs → chunk-DZL2G7NB.mjs} +77 -1
- package/dist/chunk-DZL2G7NB.mjs.map +1 -0
- package/dist/{chunk-XTLTQQ7X.js → chunk-F6KBHC2X.js} +7 -7
- package/dist/{chunk-XTLTQQ7X.js.map → chunk-F6KBHC2X.js.map} +1 -1
- package/dist/{chunk-5SQFK35K.js → chunk-MP5VURBB.js} +1028 -1033
- package/dist/chunk-MP5VURBB.js.map +1 -0
- package/dist/{chunk-NATPK5ME.mjs → chunk-VSAAVVHY.mjs} +2 -2
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +3 -2
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.d.mts +9 -2
- package/dist/contexts/index.d.ts +9 -2
- package/dist/contexts/index.js +6 -4
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +5 -3
- package/dist/core/index.d.mts +11 -1
- package/dist/core/index.d.ts +11 -1
- package/dist/core/index.js +12 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +13 -3
- package/dist/features/help/index.js +39 -39
- package/dist/features/help/index.js.map +1 -1
- package/dist/features/help/index.mjs +5 -5
- package/dist/features/help/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -4
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/containers/ReactMarkdownContainer.tsx +1 -1
- package/src/components/containers/RoundPageContainer.tsx +7 -0
- package/src/components/forms/EditorSheet.tsx +24 -1
- package/src/components/forms/FormDateTime.tsx +5 -0
- package/src/components/navigations/Breadcrumb.tsx +13 -11
- package/src/components/navigations/Header.tsx +3 -1
- package/src/contexts/HeaderChildrenContext.tsx +17 -2
- package/src/features/assistant-message/components/MessageItem.tsx +1 -1
- package/src/features/auth/components/GdprConsentSection.tsx +2 -2
- package/src/features/auth/components/forms/Register.tsx +2 -2
- package/src/features/help/components/HelpArticleBody.tsx +2 -2
- package/src/features/notification/components/common/NotificationErrorBoundary.tsx +1 -4
- package/src/features/notification/contexts/__tests__/NotificationContext.spec.tsx +34 -8
- package/src/features/oauth/components/consent/OAuthConsentScreen.tsx +2 -2
- package/src/features/user/contexts/CurrentUserContext.tsx +43 -9
- package/src/features/user/contexts/__tests__/CurrentUserContext.spec.tsx +149 -6
- package/src/features/waitlist/components/forms/WaitlistForm.tsx +2 -2
- package/src/features/waitlist/components/lists/WaitlistList.tsx +13 -2
- package/src/shadcnui/custom/link.tsx +1 -1
- package/src/shadcnui/ui/accordion.tsx +1 -1
- package/src/shadcnui/ui/alert-dialog.tsx +1 -1
- package/src/shadcnui/ui/alert.tsx +2 -5
- package/src/shadcnui/ui/badge.tsx +1 -1
- package/src/shadcnui/ui/button.tsx +1 -1
- package/src/shadcnui/ui/dialog.tsx +1 -4
- package/src/shadcnui/ui/field.tsx +1 -1
- package/src/utils/__tests__/italian-validators.test.ts +63 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/italian-validators.ts +18 -5
- package/dist/chunk-5MNE72ZE.mjs.map +0 -1
- package/dist/chunk-5SQFK35K.js.map +0 -1
- package/dist/chunk-LBMNRFCY.js.map +0 -1
- package/dist/chunk-MDXT47V4.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-PVBZYPMF.mjs.map → BlockNoteEditor-WZFEJS2B.mjs.map} +0 -0
- /package/dist/{chunk-NATPK5ME.mjs.map → chunk-VSAAVVHY.mjs.map} +0 -0
|
@@ -1322,6 +1322,77 @@ function getInitials(firstOrName, lastName) {
|
|
|
1322
1322
|
}
|
|
1323
1323
|
__name(getInitials, "getInitials");
|
|
1324
1324
|
|
|
1325
|
+
// src/utils/italian-validators.ts
|
|
1326
|
+
import CodiceFiscale from "codice-fiscale-js";
|
|
1327
|
+
function validatePartitaIva(partitaIva) {
|
|
1328
|
+
if (!partitaIva || typeof partitaIva !== "string") {
|
|
1329
|
+
return false;
|
|
1330
|
+
}
|
|
1331
|
+
const cleaned = partitaIva.replace(/\s/g, "");
|
|
1332
|
+
if (!/^\d{11}$/.test(cleaned)) {
|
|
1333
|
+
return false;
|
|
1334
|
+
}
|
|
1335
|
+
const digits = cleaned.split("").map(Number);
|
|
1336
|
+
const oddSum = digits[0] + digits[2] + digits[4] + digits[6] + digits[8] + digits[10];
|
|
1337
|
+
let evenSum = 0;
|
|
1338
|
+
for (let i = 1; i < 10; i += 2) {
|
|
1339
|
+
let doubled = digits[i] * 2;
|
|
1340
|
+
if (doubled > 9) {
|
|
1341
|
+
doubled -= 9;
|
|
1342
|
+
}
|
|
1343
|
+
evenSum += doubled;
|
|
1344
|
+
}
|
|
1345
|
+
const totalSum = oddSum + evenSum;
|
|
1346
|
+
return totalSum % 10 === 0;
|
|
1347
|
+
}
|
|
1348
|
+
__name(validatePartitaIva, "validatePartitaIva");
|
|
1349
|
+
function validateCodiceFiscale(codiceFiscale, options) {
|
|
1350
|
+
if (!codiceFiscale || typeof codiceFiscale !== "string") {
|
|
1351
|
+
return false;
|
|
1352
|
+
}
|
|
1353
|
+
const cleaned = codiceFiscale.replace(/\s/g, "").toUpperCase();
|
|
1354
|
+
try {
|
|
1355
|
+
if (CodiceFiscale.check(cleaned)) {
|
|
1356
|
+
return true;
|
|
1357
|
+
}
|
|
1358
|
+
} catch (error) {
|
|
1359
|
+
}
|
|
1360
|
+
return options?.allowPartitaIva === true && validatePartitaIva(cleaned);
|
|
1361
|
+
}
|
|
1362
|
+
__name(validateCodiceFiscale, "validateCodiceFiscale");
|
|
1363
|
+
function validateItalianTaxCode(value, type, options) {
|
|
1364
|
+
if (!value || typeof value !== "string") {
|
|
1365
|
+
return false;
|
|
1366
|
+
}
|
|
1367
|
+
switch (type) {
|
|
1368
|
+
case "partitaIva":
|
|
1369
|
+
return validatePartitaIva(value);
|
|
1370
|
+
case "codiceFiscale":
|
|
1371
|
+
return validateCodiceFiscale(value, options);
|
|
1372
|
+
default:
|
|
1373
|
+
return false;
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
__name(validateItalianTaxCode, "validateItalianTaxCode");
|
|
1377
|
+
function formatPartitaIva(partitaIva) {
|
|
1378
|
+
if (!partitaIva) return "";
|
|
1379
|
+
const cleaned = partitaIva.replace(/\s/g, "");
|
|
1380
|
+
if (/^\d{11}$/.test(cleaned)) {
|
|
1381
|
+
return `${cleaned.substring(0, 7)} ${cleaned.substring(7, 10)} ${cleaned.substring(10)}`;
|
|
1382
|
+
}
|
|
1383
|
+
return partitaIva;
|
|
1384
|
+
}
|
|
1385
|
+
__name(formatPartitaIva, "formatPartitaIva");
|
|
1386
|
+
function formatCodiceFiscale(codiceFiscale) {
|
|
1387
|
+
if (!codiceFiscale) return "";
|
|
1388
|
+
const cleaned = codiceFiscale.replace(/\s/g, "").toUpperCase();
|
|
1389
|
+
if (/^[A-Z0-9]{16}$/.test(cleaned)) {
|
|
1390
|
+
return `${cleaned.substring(0, 6)} ${cleaned.substring(6, 11)} ${cleaned.substring(11, 15)} ${cleaned.substring(15)}`;
|
|
1391
|
+
}
|
|
1392
|
+
return codiceFiscale;
|
|
1393
|
+
}
|
|
1394
|
+
__name(formatCodiceFiscale, "formatCodiceFiscale");
|
|
1395
|
+
|
|
1325
1396
|
// src/utils/blocknote-diff.util.ts
|
|
1326
1397
|
import { v4 } from "uuid";
|
|
1327
1398
|
var BlockNoteDiffUtil = class {
|
|
@@ -7706,6 +7777,11 @@ export {
|
|
|
7706
7777
|
userObjectSchema,
|
|
7707
7778
|
entityObjectSchema,
|
|
7708
7779
|
getInitials,
|
|
7780
|
+
validatePartitaIva,
|
|
7781
|
+
validateCodiceFiscale,
|
|
7782
|
+
validateItalianTaxCode,
|
|
7783
|
+
formatPartitaIva,
|
|
7784
|
+
formatCodiceFiscale,
|
|
7709
7785
|
BlockNoteDiffUtil,
|
|
7710
7786
|
BlockNoteWordDiffRendererUtil,
|
|
7711
7787
|
getIconByModule,
|
|
@@ -7854,4 +7930,4 @@ export {
|
|
|
7854
7930
|
AuditLogService,
|
|
7855
7931
|
AuditLogModule
|
|
7856
7932
|
};
|
|
7857
|
-
//# sourceMappingURL=chunk-
|
|
7933
|
+
//# sourceMappingURL=chunk-DZL2G7NB.mjs.map
|