@carlonicora/nextjs-jsonapi 6.12.0 → 6.12.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.
Files changed (83) hide show
  1. package/dist/{AbstractService-Ckm2X5fW.d.mts → AbstractService-N0wFgaHD.d.mts} +1 -1
  2. package/dist/{AbstractService-V3VGQMhL.d.ts → AbstractService-kNAykPDk.d.ts} +1 -1
  3. package/dist/{BlockNoteEditor-ZJPGGUQQ.mjs → BlockNoteEditor-75ED2CN2.mjs} +4 -4
  4. package/dist/{BlockNoteEditor-R2SLOYS6.js → BlockNoteEditor-7M5QW2YQ.js} +19 -19
  5. package/dist/{BlockNoteEditor-R2SLOYS6.js.map → BlockNoteEditor-7M5QW2YQ.js.map} +1 -1
  6. package/dist/{BlockNoteViewer-UCA3LV3N.mjs → BlockNoteViewer-MTGS6YJV.mjs} +2 -2
  7. package/dist/{BlockNoteViewer-FLUHEXE6.js → BlockNoteViewer-WGCDB7IJ.js} +3 -3
  8. package/dist/{BlockNoteViewer-FLUHEXE6.js.map → BlockNoteViewer-WGCDB7IJ.js.map} +1 -1
  9. package/dist/billing/index.js +491 -491
  10. package/dist/billing/index.mjs +3 -3
  11. package/dist/{chunk-6RLATJ2L.mjs → chunk-4FNGWALA.mjs} +2 -2
  12. package/dist/{chunk-BGLOFZ3K.mjs → chunk-AA52ORW2.mjs} +11 -15
  13. package/dist/chunk-AA52ORW2.mjs.map +1 -0
  14. package/dist/{chunk-YP6W4AB5.mjs → chunk-EWCY6QJA.mjs} +2 -2
  15. package/dist/{chunk-YGEOX2XX.js → chunk-FF4EIQ6H.js} +11 -15
  16. package/dist/chunk-FF4EIQ6H.js.map +1 -0
  17. package/dist/{chunk-FNPXCYHO.js → chunk-L6PYFQTO.js} +8 -8
  18. package/dist/{chunk-FNPXCYHO.js.map → chunk-L6PYFQTO.js.map} +1 -1
  19. package/dist/{chunk-OHJSI6L2.js → chunk-O3PDL2CV.js} +4 -4
  20. package/dist/{chunk-OHJSI6L2.js.map → chunk-O3PDL2CV.js.map} +1 -1
  21. package/dist/{chunk-SQUMPLNN.mjs → chunk-RXQYEEKZ.mjs} +13 -13
  22. package/dist/chunk-RXQYEEKZ.mjs.map +1 -0
  23. package/dist/{chunk-BXR36J25.js → chunk-V3YDVJ63.js} +916 -916
  24. package/dist/chunk-V3YDVJ63.js.map +1 -0
  25. package/dist/client/index.js +4 -4
  26. package/dist/client/index.mjs +3 -3
  27. package/dist/components/index.d.mts +3 -3
  28. package/dist/components/index.d.ts +3 -3
  29. package/dist/components/index.js +4 -4
  30. package/dist/components/index.mjs +3 -3
  31. package/dist/contexts/index.js +4 -4
  32. package/dist/contexts/index.mjs +3 -3
  33. package/dist/core/index.d.mts +7 -7
  34. package/dist/core/index.d.ts +7 -7
  35. package/dist/core/index.js +2 -2
  36. package/dist/core/index.mjs +1 -1
  37. package/dist/email-automations/index.js +93 -93
  38. package/dist/email-automations/index.mjs +3 -3
  39. package/dist/features/analytics/index.d.mts +1 -1
  40. package/dist/features/analytics/index.d.ts +1 -1
  41. package/dist/features/analytics/index.js +120 -120
  42. package/dist/features/analytics/index.mjs +3 -3
  43. package/dist/features/analytics/server.js +4 -4
  44. package/dist/features/analytics/server.mjs +2 -2
  45. package/dist/features/blog/index.js +150 -150
  46. package/dist/features/blog/index.mjs +3 -3
  47. package/dist/features/blog/server.js +16 -16
  48. package/dist/features/blog/server.mjs +1 -1
  49. package/dist/features/help/index.js +37 -37
  50. package/dist/features/help/index.mjs +3 -3
  51. package/dist/features/tokenusage/index.d.mts +1 -1
  52. package/dist/features/tokenusage/index.d.ts +1 -1
  53. package/dist/features/tokenusage/index.js +126 -126
  54. package/dist/features/tokenusage/index.mjs +3 -3
  55. package/dist/index.d.mts +4 -4
  56. package/dist/index.d.ts +4 -4
  57. package/dist/index.js +3 -3
  58. package/dist/index.mjs +2 -2
  59. package/dist/{referral-admin.interface-CMwl5NiV.d.ts → referral-admin.interface-CnytdDaQ.d.ts} +1 -1
  60. package/dist/{referral-admin.interface-C87ApGMR.d.mts → referral-admin.interface-RVO-ZTJz.d.mts} +1 -1
  61. package/dist/{s3.service-BG136Btz.d.mts → s3.service-CeUsKm-d.d.mts} +1 -1
  62. package/dist/{s3.service-CsrsRPRn.d.ts → s3.service-SkZnngeR.d.ts} +1 -1
  63. package/dist/server/index.d.mts +2 -2
  64. package/dist/server/index.d.ts +2 -2
  65. package/dist/server/index.js +3 -3
  66. package/dist/server/index.mjs +2 -2
  67. package/package.json +1 -1
  68. package/src/components/containers/RoundPageContainer.tsx +8 -8
  69. package/src/core/abstracts/AbstractService.ts +5 -11
  70. package/src/core/abstracts/ClientAbstractService.ts +5 -11
  71. package/src/core/abstracts/__tests__/AbstractService.locale.spec.ts +43 -0
  72. package/src/core/abstracts/__tests__/ClientAbstractService.locale.spec.ts +69 -0
  73. package/src/i18n/__tests__/config.spec.ts +22 -1
  74. package/src/i18n/config.ts +5 -0
  75. package/src/i18n/index.ts +1 -0
  76. package/dist/chunk-BGLOFZ3K.mjs.map +0 -1
  77. package/dist/chunk-BXR36J25.js.map +0 -1
  78. package/dist/chunk-SQUMPLNN.mjs.map +0 -1
  79. package/dist/chunk-YGEOX2XX.js.map +0 -1
  80. /package/dist/{BlockNoteEditor-ZJPGGUQQ.mjs.map → BlockNoteEditor-75ED2CN2.mjs.map} +0 -0
  81. /package/dist/{BlockNoteViewer-UCA3LV3N.mjs.map → BlockNoteViewer-MTGS6YJV.mjs.map} +0 -0
  82. /package/dist/{chunk-6RLATJ2L.mjs.map → chunk-4FNGWALA.mjs.map} +0 -0
  83. /package/dist/{chunk-YP6W4AB5.mjs.map → chunk-EWCY6QJA.mjs.map} +0 -0
@@ -1,5 +1,11 @@
1
1
  import { afterEach, describe, expect, it, vi } from "vitest";
2
- import { configureI18n, getI18nServerLocale, getI18nSupportedLocales, type I18nConfig } from "../config";
2
+ import {
3
+ configureI18n,
4
+ getI18nDefaultLocale,
5
+ getI18nServerLocale,
6
+ getI18nSupportedLocales,
7
+ type I18nConfig,
8
+ } from "../config";
3
9
 
4
10
  function config(getLocale: I18nConfig["getLocale"]): I18nConfig {
5
11
  return {
@@ -45,3 +51,18 @@ describe("getI18nSupportedLocales", () => {
45
51
  expect(getI18nSupportedLocales()).toEqual(["en", "it"]);
46
52
  });
47
53
  });
54
+
55
+ describe("getI18nDefaultLocale", () => {
56
+ afterEach(() => {
57
+ configureI18n(null as unknown as I18nConfig);
58
+ });
59
+
60
+ it('returns "en" when i18n is not configured', () => {
61
+ expect(getI18nDefaultLocale()).toBe("en");
62
+ });
63
+
64
+ it("returns the first configured supported locale", () => {
65
+ configureI18n({ ...config(async () => "en"), supportedLocales: ["it", "en"] });
66
+ expect(getI18nDefaultLocale()).toBe("it");
67
+ });
68
+ });
@@ -102,3 +102,8 @@ export function getI18nSupportedLocales(): string[] {
102
102
  }
103
103
  return ["en"];
104
104
  }
105
+
106
+ /** The app's default locale: the first supported locale (`"en"` when not configured). */
107
+ export function getI18nDefaultLocale(): string {
108
+ return getI18nSupportedLocales()[0];
109
+ }
package/src/i18n/index.ts CHANGED
@@ -7,6 +7,7 @@ export {
7
7
  getI18nLink,
8
8
  getI18nServerLocale,
9
9
  getI18nSupportedLocales,
10
+ getI18nDefaultLocale,
10
11
  } from "./config";
11
12
 
12
13
  export type {