@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
@@ -81,10 +81,10 @@ import {
81
81
  useCurrentUserContext,
82
82
  useDataListRetriever,
83
83
  usePageUrlGenerator
84
- } from "../chunk-SQUMPLNN.mjs";
84
+ } from "../chunk-RXQYEEKZ.mjs";
85
85
  import {
86
86
  getStripePublishableKey
87
- } from "../chunk-6RLATJ2L.mjs";
87
+ } from "../chunk-4FNGWALA.mjs";
88
88
  import {
89
89
  getRoleId
90
90
  } from "../chunk-PW42LRSL.mjs";
@@ -114,7 +114,7 @@ import {
114
114
  toPromotionCodeResult,
115
115
  useI18nLocale,
116
116
  useI18nRouter
117
- } from "../chunk-BGLOFZ3K.mjs";
117
+ } from "../chunk-AA52ORW2.mjs";
118
118
  import "../chunk-V5MI7RNB.mjs";
119
119
  import "../chunk-AUXK7QSA.mjs";
120
120
  import "../chunk-PI56A4DG.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  EndpointCreator,
4
4
  Modules,
5
5
  useI18nTranslations
6
- } from "./chunk-BGLOFZ3K.mjs";
6
+ } from "./chunk-AA52ORW2.mjs";
7
7
  import {
8
8
  ENV,
9
9
  setBootstrapper
@@ -340,4 +340,4 @@ export {
340
340
  ACTION_TYPES,
341
341
  RbacService
342
342
  };
343
- //# sourceMappingURL=chunk-6RLATJ2L.mjs.map
343
+ //# sourceMappingURL=chunk-4FNGWALA.mjs.map
@@ -336,6 +336,10 @@ function getI18nSupportedLocales() {
336
336
  return ["en"];
337
337
  }
338
338
  __name(getI18nSupportedLocales, "getI18nSupportedLocales");
339
+ function getI18nDefaultLocale() {
340
+ return getI18nSupportedLocales()[0];
341
+ }
342
+ __name(getI18nDefaultLocale, "getI18nDefaultLocale");
339
343
 
340
344
  // src/core/abstracts/AbstractService.ts
341
345
  var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
@@ -362,11 +366,11 @@ var AbstractService = class {
362
366
  /**
363
367
  * Extract locale from client-side URL pathname
364
368
  * URL structure: /{locale}/route-path (e.g., /it/accounts)
365
- * Fallback chain: URL locale → navigator.language → "en"
369
+ * Fallback chain: URL locale → the app's default locale (first supported locale)
366
370
  */
367
371
  static getClientLocale() {
368
372
  if (typeof window === "undefined") {
369
- return "en";
373
+ return getI18nDefaultLocale();
370
374
  }
371
375
  const pathSegments = window.location.pathname.split("/").filter(Boolean);
372
376
  const urlLocale = pathSegments[0];
@@ -374,11 +378,7 @@ var AbstractService = class {
374
378
  if (urlLocale && supportedLocales.includes(urlLocale)) {
375
379
  return urlLocale;
376
380
  }
377
- const navigatorLocale = navigator.language.split("-")[0];
378
- if (navigatorLocale && supportedLocales.includes(navigatorLocale)) {
379
- return navigatorLocale;
380
- }
381
- return "en";
381
+ return getI18nDefaultLocale();
382
382
  }
383
383
  static async next(params) {
384
384
  return await this.callApi({
@@ -825,11 +825,11 @@ var ClientAbstractService = class {
825
825
  /**
826
826
  * Extract locale from client-side URL pathname
827
827
  * URL structure: /{locale}/route-path (e.g., /it/accounts)
828
- * Fallback chain: URL locale → navigator.language → "en"
828
+ * Fallback chain: URL locale → the app's default locale (first supported locale)
829
829
  */
830
830
  static getClientLocale() {
831
831
  if (typeof window === "undefined") {
832
- return "en";
832
+ return getI18nDefaultLocale();
833
833
  }
834
834
  const pathSegments = window.location.pathname.split("/").filter(Boolean);
835
835
  const urlLocale = pathSegments[0];
@@ -837,11 +837,7 @@ var ClientAbstractService = class {
837
837
  if (urlLocale && supportedLocales.includes(urlLocale)) {
838
838
  return urlLocale;
839
839
  }
840
- const navigatorLocale = navigator.language.split("-")[0];
841
- if (navigatorLocale && supportedLocales.includes(navigatorLocale)) {
842
- return navigatorLocale;
843
- }
844
- return "en";
840
+ return getI18nDefaultLocale();
845
841
  }
846
842
  /**
847
843
  * Fetch the next page of results.
@@ -13281,4 +13277,4 @@ export {
13281
13277
  AuditLogService,
13282
13278
  AuditLogModule
13283
13279
  };
13284
- //# sourceMappingURL=chunk-BGLOFZ3K.mjs.map
13280
+ //# sourceMappingURL=chunk-AA52ORW2.mjs.map