astro-intlayer 9.5.12 → 9.7.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.
Files changed (47) hide show
  1. package/dist/cjs/format/useCompact.cjs +1 -3
  2. package/dist/cjs/format/useCompact.cjs.map +1 -1
  3. package/dist/cjs/format/useCurrency.cjs +1 -3
  4. package/dist/cjs/format/useCurrency.cjs.map +1 -1
  5. package/dist/cjs/format/useDate.cjs +1 -3
  6. package/dist/cjs/format/useDate.cjs.map +1 -1
  7. package/dist/cjs/format/useIntl.cjs +3 -5
  8. package/dist/cjs/format/useIntl.cjs.map +1 -1
  9. package/dist/cjs/format/useList.cjs +1 -3
  10. package/dist/cjs/format/useList.cjs.map +1 -1
  11. package/dist/cjs/format/useNumber.cjs +1 -3
  12. package/dist/cjs/format/useNumber.cjs.map +1 -1
  13. package/dist/cjs/format/usePercentage.cjs +1 -3
  14. package/dist/cjs/format/usePercentage.cjs.map +1 -1
  15. package/dist/cjs/format/useRelativeTime.cjs +1 -3
  16. package/dist/cjs/format/useRelativeTime.cjs.map +1 -1
  17. package/dist/cjs/format/useUnit.cjs +1 -3
  18. package/dist/cjs/format/useUnit.cjs.map +1 -1
  19. package/dist/esm/format/useCompact.mjs +1 -3
  20. package/dist/esm/format/useCompact.mjs.map +1 -1
  21. package/dist/esm/format/useCurrency.mjs +1 -3
  22. package/dist/esm/format/useCurrency.mjs.map +1 -1
  23. package/dist/esm/format/useDate.mjs +1 -3
  24. package/dist/esm/format/useDate.mjs.map +1 -1
  25. package/dist/esm/format/useIntl.mjs +3 -5
  26. package/dist/esm/format/useIntl.mjs.map +1 -1
  27. package/dist/esm/format/useList.mjs +1 -3
  28. package/dist/esm/format/useList.mjs.map +1 -1
  29. package/dist/esm/format/useNumber.mjs +1 -3
  30. package/dist/esm/format/useNumber.mjs.map +1 -1
  31. package/dist/esm/format/usePercentage.mjs +1 -3
  32. package/dist/esm/format/usePercentage.mjs.map +1 -1
  33. package/dist/esm/format/useRelativeTime.mjs +1 -3
  34. package/dist/esm/format/useRelativeTime.mjs.map +1 -1
  35. package/dist/esm/format/useUnit.mjs +1 -3
  36. package/dist/esm/format/useUnit.mjs.map +1 -1
  37. package/dist/types/format/useCompact.d.ts.map +1 -1
  38. package/dist/types/format/useCurrency.d.ts.map +1 -1
  39. package/dist/types/format/useDate.d.ts.map +1 -1
  40. package/dist/types/format/useIntl.d.ts +2 -2
  41. package/dist/types/format/useIntl.d.ts.map +1 -1
  42. package/dist/types/format/useList.d.ts.map +1 -1
  43. package/dist/types/format/useNumber.d.ts.map +1 -1
  44. package/dist/types/format/usePercentage.d.ts.map +1 -1
  45. package/dist/types/format/useRelativeTime.d.ts.map +1 -1
  46. package/dist/types/format/useUnit.d.ts.map +1 -1
  47. package/package.json +10 -10
@@ -1,12 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_requestStorage = require('../requestStorage.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
5
4
 
6
5
  //#region src/format/useCompact.ts
7
- const { defaultLocale } = _intlayer_config_built.internationalization;
8
6
  const useCompact = () => {
9
- const locale = require_requestStorage.getRequestLocale() ?? defaultLocale;
7
+ const locale = require_requestStorage.getRequestLocale();
10
8
  return (...args) => (0, _intlayer_core_formatters.compact)(args[0], {
11
9
  ...args[1],
12
10
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useCompact.cjs","names":["internationalization","getRequestLocale","compact"],"sources":["../../../src/format/useCompact.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { compact } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useCompact = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;AAKA,MAAM,EAAE,kBAAkBA;AAE1B,MAAa,mBAAmB;CAC9B,MAAM,SAASC,wCAAiB,KAAM;CAEtC,QAAQ,GAAG,aACTC,mCAAQ,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useCompact.cjs","names":["getRequestLocale","compact"],"sources":["../../../src/format/useCompact.ts"],"sourcesContent":["import { compact } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useCompact = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAGA,MAAa,mBAAmB;CAC9B,MAAM,SAASA,wCAAiB;CAEhC,QAAQ,GAAG,aACTC,mCAAQ,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,12 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_requestStorage = require('../requestStorage.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
5
4
 
6
5
  //#region src/format/useCurrency.ts
7
- const { defaultLocale } = _intlayer_config_built.internationalization;
8
6
  const useCurrency = () => {
9
- const locale = require_requestStorage.getRequestLocale() ?? defaultLocale;
7
+ const locale = require_requestStorage.getRequestLocale();
10
8
  return (...args) => (0, _intlayer_core_formatters.currency)(args[0], {
11
9
  ...args[1],
12
10
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrency.cjs","names":["internationalization","getRequestLocale","currency"],"sources":["../../../src/format/useCurrency.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { currency } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useCurrency = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;AAKA,MAAM,EAAE,kBAAkBA;AAE1B,MAAa,oBAAoB;CAC/B,MAAM,SAASC,wCAAiB,KAAM;CAEtC,QAAQ,GAAG,aACTC,oCAAS,KAAK,IAAI;EAChB,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useCurrency.cjs","names":["getRequestLocale","currency"],"sources":["../../../src/format/useCurrency.ts"],"sourcesContent":["import { currency } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useCurrency = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAGA,MAAa,oBAAoB;CAC/B,MAAM,SAASA,wCAAiB;CAEhC,QAAQ,GAAG,aACTC,oCAAS,KAAK,IAAI;EAChB,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,15 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_requestStorage = require('../requestStorage.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
5
4
 
6
5
  //#region src/format/useDate.ts
7
- const { defaultLocale } = _intlayer_config_built.internationalization;
8
6
  /**
9
7
  * Astro hook that provides a localized date/time formatter bound to the request locale.
10
8
  */
11
9
  const useDate = () => {
12
- const locale = require_requestStorage.getRequestLocale() ?? defaultLocale;
10
+ const locale = require_requestStorage.getRequestLocale();
13
11
  return (...args) => {
14
12
  const options = typeof args[1] === "string" ? {
15
13
  ..._intlayer_core_formatters.presets[args[1]],
@@ -1 +1 @@
1
- {"version":3,"file":"useDate.cjs","names":["internationalization","getRequestLocale","presets","date"],"sources":["../../../src/format/useDate.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { date, presets } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\n/**\n * Astro hook that provides a localized date/time formatter bound to the request locale.\n */\nexport const useDate = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof date>) => {\n const options =\n typeof args[1] === 'string'\n ? { ...presets[args[1]], locale }\n : { ...args[1], locale: args[1]?.locale ?? locale };\n\n return date(args[0], options as Parameters<typeof date>[1]);\n };\n};\n"],"mappings":";;;;;;AAKA,MAAM,EAAE,kBAAkBA;;;;AAK1B,MAAa,gBAAgB;CAC3B,MAAM,SAASC,wCAAiB,KAAM;CAEtC,QAAQ,GAAG,SAAkC;EAC3C,MAAM,UACJ,OAAO,KAAK,OAAO,WACf;GAAE,GAAGC,kCAAQ,KAAK;GAAK;EAAO,IAC9B;GAAE,GAAG,KAAK;GAAI,QAAQ,KAAK,EAAE,EAAE,UAAU;EAAO;EAEtD,WAAOC,gCAAK,KAAK,IAAI,OAAqC;CAC5D;AACF"}
1
+ {"version":3,"file":"useDate.cjs","names":["getRequestLocale","presets","date"],"sources":["../../../src/format/useDate.ts"],"sourcesContent":["import { date, presets } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\n/**\n * Astro hook that provides a localized date/time formatter bound to the request locale.\n */\nexport const useDate = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof date>) => {\n const options =\n typeof args[1] === 'string'\n ? { ...presets[args[1]], locale }\n : { ...args[1], locale: args[1]?.locale ?? locale };\n\n return date(args[0], options as Parameters<typeof date>[1]);\n };\n};\n"],"mappings":";;;;;;;;AAMA,MAAa,gBAAgB;CAC3B,MAAM,SAASA,wCAAiB;CAEhC,QAAQ,GAAG,SAAkC;EAC3C,MAAM,UACJ,OAAO,KAAK,OAAO,WACf;GAAE,GAAGC,kCAAQ,KAAK;GAAK;EAAO,IAC9B;GAAE,GAAG,KAAK;GAAI,QAAQ,KAAK,EAAE,EAAE,UAAU;EAAO;EAEtD,WAAOC,gCAAK,KAAK,IAAI,OAAqC;CAC5D;AACF"}
@@ -1,18 +1,16 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_requestStorage = require('../requestStorage.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let _intlayer_core_utils = require("@intlayer/core/utils");
5
4
 
6
5
  //#region src/format/useIntl.ts
7
- const { defaultLocale } = _intlayer_config_built.internationalization;
8
6
  /**
9
7
  * Astro hook that provides a locale-bound `Intl` object.
10
8
  *
11
- * It uses the request locale on the server, falling back to the configured
12
- * default locale.
9
+ * It uses the request locale on the server, falling back to the stored
10
+ * locale in the browser, then to the default locale.
13
11
  */
14
12
  const useIntl = (locale) => {
15
- const currentLocale = locale ?? require_requestStorage.getRequestLocale() ?? defaultLocale;
13
+ const currentLocale = locale ?? require_requestStorage.getRequestLocale();
16
14
  return {
17
15
  intl: (0, _intlayer_core_utils.bindIntl)(currentLocale),
18
16
  subscribe: () => () => {}
@@ -1 +1 @@
1
- {"version":3,"file":"useIntl.cjs","names":["internationalization","getRequestLocale","bindIntl"],"sources":["../../../src/format/useIntl.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { bindIntl, type WrappedIntl } from '@intlayer/core/utils';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\n/**\n * Astro hook that provides a locale-bound `Intl` object.\n *\n * It uses the request locale on the server, falling back to the configured\n * default locale.\n */\nexport const useIntl = (\n locale?: LocalesValues\n): {\n intl: WrappedIntl;\n subscribe: (callback: (intl: WrappedIntl) => void) => () => void;\n} => {\n const currentLocale =\n locale ?? getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n const intl = bindIntl(currentLocale);\n\n return {\n intl,\n subscribe: () => () => {},\n };\n};\n"],"mappings":";;;;;;AAQA,MAAM,EAAE,kBAAkBA;;;;;;;AAQ1B,MAAa,WACX,WAIG;CACH,MAAM,gBACJ,UAAUC,wCAAiB,KAAM;CAGnC,OAAO;EACL,UAHWC,+BAAS,aAGjB;EACH,uBAAuB,CAAC;CAC1B;AACF"}
1
+ {"version":3,"file":"useIntl.cjs","names":["getRequestLocale","bindIntl"],"sources":["../../../src/format/useIntl.ts"],"sourcesContent":["import { bindIntl, type WrappedIntl } from '@intlayer/core/utils';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\n/**\n * Astro hook that provides a locale-bound `Intl` object.\n *\n * It uses the request locale on the server, falling back to the stored\n * locale in the browser, then to the default locale.\n */\nexport const useIntl = (\n locale?: LocalesValues\n): {\n intl: WrappedIntl;\n subscribe: (callback: (intl: WrappedIntl) => void) => () => void;\n} => {\n const currentLocale = locale ?? getRequestLocale();\n const intl = bindIntl(currentLocale);\n\n return {\n intl,\n subscribe: () => () => {},\n };\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,WACX,WAIG;CACH,MAAM,gBAAgB,UAAUA,wCAAiB;CAGjD,OAAO;EACL,UAHWC,+BAAS,aAGjB;EACH,uBAAuB,CAAC;CAC1B;AACF"}
@@ -1,12 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_requestStorage = require('../requestStorage.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
5
4
 
6
5
  //#region src/format/useList.ts
7
- const { defaultLocale } = _intlayer_config_built.internationalization;
8
6
  const useList = () => {
9
- const locale = require_requestStorage.getRequestLocale() ?? defaultLocale;
7
+ const locale = require_requestStorage.getRequestLocale();
10
8
  return (...args) => (0, _intlayer_core_formatters.list)(args[0], {
11
9
  ...args[1],
12
10
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useList.cjs","names":["internationalization","getRequestLocale","list"],"sources":["../../../src/format/useList.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { list } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useList = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;AAKA,MAAM,EAAE,kBAAkBA;AAE1B,MAAa,gBAAgB;CAC3B,MAAM,SAASC,wCAAiB,KAAM;CAEtC,QAAQ,GAAG,aACTC,gCAAK,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useList.cjs","names":["getRequestLocale","list"],"sources":["../../../src/format/useList.ts"],"sourcesContent":["import { list } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useList = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAGA,MAAa,gBAAgB;CAC3B,MAAM,SAASA,wCAAiB;CAEhC,QAAQ,GAAG,aACTC,gCAAK,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,15 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_requestStorage = require('../requestStorage.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
5
4
 
6
5
  //#region src/format/useNumber.ts
7
- const { defaultLocale } = _intlayer_config_built.internationalization;
8
6
  /**
9
7
  * Astro hook that provides a localized number formatter bound to the request locale.
10
8
  */
11
9
  const useNumber = () => {
12
- const locale = require_requestStorage.getRequestLocale() ?? defaultLocale;
10
+ const locale = require_requestStorage.getRequestLocale();
13
11
  return (...args) => (0, _intlayer_core_formatters.number)(args[0], {
14
12
  ...args[1],
15
13
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useNumber.cjs","names":["internationalization","getRequestLocale","number"],"sources":["../../../src/format/useNumber.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { number } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\n/**\n * Astro hook that provides a localized number formatter bound to the request locale.\n */\nexport const useNumber = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;AAKA,MAAM,EAAE,kBAAkBA;;;;AAK1B,MAAa,kBAAkB;CAC7B,MAAM,SAASC,wCAAiB,KAAM;CAEtC,QAAQ,GAAG,aACTC,kCAAO,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useNumber.cjs","names":["getRequestLocale","number"],"sources":["../../../src/format/useNumber.ts"],"sourcesContent":["import { number } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\n/**\n * Astro hook that provides a localized number formatter bound to the request locale.\n */\nexport const useNumber = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;;AAMA,MAAa,kBAAkB;CAC7B,MAAM,SAASA,wCAAiB;CAEhC,QAAQ,GAAG,aACTC,kCAAO,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,12 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_requestStorage = require('../requestStorage.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
5
4
 
6
5
  //#region src/format/usePercentage.ts
7
- const { defaultLocale } = _intlayer_config_built.internationalization;
8
6
  const usePercentage = () => {
9
- const locale = require_requestStorage.getRequestLocale() ?? defaultLocale;
7
+ const locale = require_requestStorage.getRequestLocale();
10
8
  return (...args) => (0, _intlayer_core_formatters.percentage)(args[0], {
11
9
  ...args[1],
12
10
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"usePercentage.cjs","names":["internationalization","getRequestLocale","percentage"],"sources":["../../../src/format/usePercentage.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { percentage } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const usePercentage = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;AAKA,MAAM,EAAE,kBAAkBA;AAE1B,MAAa,sBAAsB;CACjC,MAAM,SAASC,wCAAiB,KAAM;CAEtC,QAAQ,GAAG,aACTC,sCAAW,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"usePercentage.cjs","names":["getRequestLocale","percentage"],"sources":["../../../src/format/usePercentage.ts"],"sourcesContent":["import { percentage } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const usePercentage = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAGA,MAAa,sBAAsB;CACjC,MAAM,SAASA,wCAAiB;CAEhC,QAAQ,GAAG,aACTC,sCAAW,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,12 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_requestStorage = require('../requestStorage.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
5
4
 
6
5
  //#region src/format/useRelativeTime.ts
7
- const { defaultLocale } = _intlayer_config_built.internationalization;
8
6
  const useRelativeTime = () => {
9
- const locale = require_requestStorage.getRequestLocale() ?? defaultLocale;
7
+ const locale = require_requestStorage.getRequestLocale();
10
8
  return (...args) => (0, _intlayer_core_formatters.relativeTime)(args[0], args[1], {
11
9
  ...args[2],
12
10
  locale: args[2]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useRelativeTime.cjs","names":["internationalization","getRequestLocale","relativeTime"],"sources":["../../../src/format/useRelativeTime.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { relativeTime } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useRelativeTime = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;AAKA,MAAM,EAAE,kBAAkBA;AAE1B,MAAa,wBAAwB;CACnC,MAAM,SAASC,wCAAiB,KAAM;CAEtC,QAAQ,GAAG,aACTC,wCAAa,KAAK,IAAI,KAAK,IAAI;EAC7B,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useRelativeTime.cjs","names":["getRequestLocale","relativeTime"],"sources":["../../../src/format/useRelativeTime.ts"],"sourcesContent":["import { relativeTime } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useRelativeTime = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAGA,MAAa,wBAAwB;CACnC,MAAM,SAASA,wCAAiB;CAEhC,QAAQ,GAAG,aACTC,wCAAa,KAAK,IAAI,KAAK,IAAI;EAC7B,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,12 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_requestStorage = require('../requestStorage.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let _intlayer_core_formatters = require("@intlayer/core/formatters");
5
4
 
6
5
  //#region src/format/useUnit.ts
7
- const { defaultLocale } = _intlayer_config_built.internationalization;
8
6
  const useUnit = () => {
9
- const locale = require_requestStorage.getRequestLocale() ?? defaultLocale;
7
+ const locale = require_requestStorage.getRequestLocale();
10
8
  return (...args) => (0, _intlayer_core_formatters.units)(args[0], {
11
9
  ...args[1],
12
10
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useUnit.cjs","names":["internationalization","getRequestLocale","units"],"sources":["../../../src/format/useUnit.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { units } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useUnit = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;AAKA,MAAM,EAAE,kBAAkBA;AAE1B,MAAa,gBAAgB;CAC3B,MAAM,SAASC,wCAAiB,KAAM;CAEtC,QAAQ,GAAG,aACTC,iCAAM,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useUnit.cjs","names":["getRequestLocale","units"],"sources":["../../../src/format/useUnit.ts"],"sourcesContent":["import { units } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useUnit = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAGA,MAAa,gBAAgB;CAC3B,MAAM,SAASA,wCAAiB;CAEhC,QAAQ,GAAG,aACTC,iCAAM,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,11 +1,9 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { compact } from "@intlayer/core/formatters";
4
3
 
5
4
  //#region src/format/useCompact.ts
6
- const { defaultLocale } = internationalization;
7
5
  const useCompact = () => {
8
- const locale = getRequestLocale() ?? defaultLocale;
6
+ const locale = getRequestLocale();
9
7
  return (...args) => compact(args[0], {
10
8
  ...args[1],
11
9
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useCompact.mjs","names":[],"sources":["../../../src/format/useCompact.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { compact } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useCompact = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,kBAAkB;AAE1B,MAAa,mBAAmB;CAC9B,MAAM,SAAS,iBAAiB,KAAM;CAEtC,QAAQ,GAAG,SACT,QAAQ,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useCompact.mjs","names":[],"sources":["../../../src/format/useCompact.ts"],"sourcesContent":["import { compact } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useCompact = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof compact>) =>\n compact(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;AAGA,MAAa,mBAAmB;CAC9B,MAAM,SAAS,iBAAiB;CAEhC,QAAQ,GAAG,SACT,QAAQ,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,11 +1,9 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { currency } from "@intlayer/core/formatters";
4
3
 
5
4
  //#region src/format/useCurrency.ts
6
- const { defaultLocale } = internationalization;
7
5
  const useCurrency = () => {
8
- const locale = getRequestLocale() ?? defaultLocale;
6
+ const locale = getRequestLocale();
9
7
  return (...args) => currency(args[0], {
10
8
  ...args[1],
11
9
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrency.mjs","names":[],"sources":["../../../src/format/useCurrency.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { currency } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useCurrency = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,kBAAkB;AAE1B,MAAa,oBAAoB;CAC/B,MAAM,SAAS,iBAAiB,KAAM;CAEtC,QAAQ,GAAG,SACT,SAAS,KAAK,IAAI;EAChB,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useCurrency.mjs","names":[],"sources":["../../../src/format/useCurrency.ts"],"sourcesContent":["import { currency } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useCurrency = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof currency>) =>\n currency(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;AAGA,MAAa,oBAAoB;CAC/B,MAAM,SAAS,iBAAiB;CAEhC,QAAQ,GAAG,SACT,SAAS,KAAK,IAAI;EAChB,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,14 +1,12 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { date, presets } from "@intlayer/core/formatters";
4
3
 
5
4
  //#region src/format/useDate.ts
6
- const { defaultLocale } = internationalization;
7
5
  /**
8
6
  * Astro hook that provides a localized date/time formatter bound to the request locale.
9
7
  */
10
8
  const useDate = () => {
11
- const locale = getRequestLocale() ?? defaultLocale;
9
+ const locale = getRequestLocale();
12
10
  return (...args) => {
13
11
  const options = typeof args[1] === "string" ? {
14
12
  ...presets[args[1]],
@@ -1 +1 @@
1
- {"version":3,"file":"useDate.mjs","names":[],"sources":["../../../src/format/useDate.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { date, presets } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\n/**\n * Astro hook that provides a localized date/time formatter bound to the request locale.\n */\nexport const useDate = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof date>) => {\n const options =\n typeof args[1] === 'string'\n ? { ...presets[args[1]], locale }\n : { ...args[1], locale: args[1]?.locale ?? locale };\n\n return date(args[0], options as Parameters<typeof date>[1]);\n };\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,kBAAkB;;;;AAK1B,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAiB,KAAM;CAEtC,QAAQ,GAAG,SAAkC;EAC3C,MAAM,UACJ,OAAO,KAAK,OAAO,WACf;GAAE,GAAG,QAAQ,KAAK;GAAK;EAAO,IAC9B;GAAE,GAAG,KAAK;GAAI,QAAQ,KAAK,EAAE,EAAE,UAAU;EAAO;EAEtD,OAAO,KAAK,KAAK,IAAI,OAAqC;CAC5D;AACF"}
1
+ {"version":3,"file":"useDate.mjs","names":[],"sources":["../../../src/format/useDate.ts"],"sourcesContent":["import { date, presets } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\n/**\n * Astro hook that provides a localized date/time formatter bound to the request locale.\n */\nexport const useDate = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof date>) => {\n const options =\n typeof args[1] === 'string'\n ? { ...presets[args[1]], locale }\n : { ...args[1], locale: args[1]?.locale ?? locale };\n\n return date(args[0], options as Parameters<typeof date>[1]);\n };\n};\n"],"mappings":";;;;;;;AAMA,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAiB;CAEhC,QAAQ,GAAG,SAAkC;EAC3C,MAAM,UACJ,OAAO,KAAK,OAAO,WACf;GAAE,GAAG,QAAQ,KAAK;GAAK;EAAO,IAC9B;GAAE,GAAG,KAAK;GAAI,QAAQ,KAAK,EAAE,EAAE,UAAU;EAAO;EAEtD,OAAO,KAAK,KAAK,IAAI,OAAqC;CAC5D;AACF"}
@@ -1,17 +1,15 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { bindIntl } from "@intlayer/core/utils";
4
3
 
5
4
  //#region src/format/useIntl.ts
6
- const { defaultLocale } = internationalization;
7
5
  /**
8
6
  * Astro hook that provides a locale-bound `Intl` object.
9
7
  *
10
- * It uses the request locale on the server, falling back to the configured
11
- * default locale.
8
+ * It uses the request locale on the server, falling back to the stored
9
+ * locale in the browser, then to the default locale.
12
10
  */
13
11
  const useIntl = (locale) => {
14
- const currentLocale = locale ?? getRequestLocale() ?? defaultLocale;
12
+ const currentLocale = locale ?? getRequestLocale();
15
13
  return {
16
14
  intl: bindIntl(currentLocale),
17
15
  subscribe: () => () => {}
@@ -1 +1 @@
1
- {"version":3,"file":"useIntl.mjs","names":[],"sources":["../../../src/format/useIntl.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { bindIntl, type WrappedIntl } from '@intlayer/core/utils';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\n/**\n * Astro hook that provides a locale-bound `Intl` object.\n *\n * It uses the request locale on the server, falling back to the configured\n * default locale.\n */\nexport const useIntl = (\n locale?: LocalesValues\n): {\n intl: WrappedIntl;\n subscribe: (callback: (intl: WrappedIntl) => void) => () => void;\n} => {\n const currentLocale =\n locale ?? getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n const intl = bindIntl(currentLocale);\n\n return {\n intl,\n subscribe: () => () => {},\n };\n};\n"],"mappings":";;;;;AAQA,MAAM,EAAE,kBAAkB;;;;;;;AAQ1B,MAAa,WACX,WAIG;CACH,MAAM,gBACJ,UAAU,iBAAiB,KAAM;CAGnC,OAAO;EACL,MAHW,SAAS,aAGjB;EACH,uBAAuB,CAAC;CAC1B;AACF"}
1
+ {"version":3,"file":"useIntl.mjs","names":[],"sources":["../../../src/format/useIntl.ts"],"sourcesContent":["import { bindIntl, type WrappedIntl } from '@intlayer/core/utils';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\n/**\n * Astro hook that provides a locale-bound `Intl` object.\n *\n * It uses the request locale on the server, falling back to the stored\n * locale in the browser, then to the default locale.\n */\nexport const useIntl = (\n locale?: LocalesValues\n): {\n intl: WrappedIntl;\n subscribe: (callback: (intl: WrappedIntl) => void) => () => void;\n} => {\n const currentLocale = locale ?? getRequestLocale();\n const intl = bindIntl(currentLocale);\n\n return {\n intl,\n subscribe: () => () => {},\n };\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAa,WACX,WAIG;CACH,MAAM,gBAAgB,UAAU,iBAAiB;CAGjD,OAAO;EACL,MAHW,SAAS,aAGjB;EACH,uBAAuB,CAAC;CAC1B;AACF"}
@@ -1,11 +1,9 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { list } from "@intlayer/core/formatters";
4
3
 
5
4
  //#region src/format/useList.ts
6
- const { defaultLocale } = internationalization;
7
5
  const useList = () => {
8
- const locale = getRequestLocale() ?? defaultLocale;
6
+ const locale = getRequestLocale();
9
7
  return (...args) => list(args[0], {
10
8
  ...args[1],
11
9
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useList.mjs","names":[],"sources":["../../../src/format/useList.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { list } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useList = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,kBAAkB;AAE1B,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAiB,KAAM;CAEtC,QAAQ,GAAG,SACT,KAAK,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useList.mjs","names":[],"sources":["../../../src/format/useList.ts"],"sourcesContent":["import { list } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useList = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof list>) =>\n list(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;AAGA,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAiB;CAEhC,QAAQ,GAAG,SACT,KAAK,KAAK,IAAI;EACZ,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,14 +1,12 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { number } from "@intlayer/core/formatters";
4
3
 
5
4
  //#region src/format/useNumber.ts
6
- const { defaultLocale } = internationalization;
7
5
  /**
8
6
  * Astro hook that provides a localized number formatter bound to the request locale.
9
7
  */
10
8
  const useNumber = () => {
11
- const locale = getRequestLocale() ?? defaultLocale;
9
+ const locale = getRequestLocale();
12
10
  return (...args) => number(args[0], {
13
11
  ...args[1],
14
12
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useNumber.mjs","names":[],"sources":["../../../src/format/useNumber.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { number } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\n/**\n * Astro hook that provides a localized number formatter bound to the request locale.\n */\nexport const useNumber = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,kBAAkB;;;;AAK1B,MAAa,kBAAkB;CAC7B,MAAM,SAAS,iBAAiB,KAAM;CAEtC,QAAQ,GAAG,SACT,OAAO,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useNumber.mjs","names":[],"sources":["../../../src/format/useNumber.ts"],"sourcesContent":["import { number } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\n/**\n * Astro hook that provides a localized number formatter bound to the request locale.\n */\nexport const useNumber = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof number>) =>\n number(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;;;AAMA,MAAa,kBAAkB;CAC7B,MAAM,SAAS,iBAAiB;CAEhC,QAAQ,GAAG,SACT,OAAO,KAAK,IAAI;EACd,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,11 +1,9 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { percentage } from "@intlayer/core/formatters";
4
3
 
5
4
  //#region src/format/usePercentage.ts
6
- const { defaultLocale } = internationalization;
7
5
  const usePercentage = () => {
8
- const locale = getRequestLocale() ?? defaultLocale;
6
+ const locale = getRequestLocale();
9
7
  return (...args) => percentage(args[0], {
10
8
  ...args[1],
11
9
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"usePercentage.mjs","names":[],"sources":["../../../src/format/usePercentage.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { percentage } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const usePercentage = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,kBAAkB;AAE1B,MAAa,sBAAsB;CACjC,MAAM,SAAS,iBAAiB,KAAM;CAEtC,QAAQ,GAAG,SACT,WAAW,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"usePercentage.mjs","names":[],"sources":["../../../src/format/usePercentage.ts"],"sourcesContent":["import { percentage } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const usePercentage = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof percentage>) =>\n percentage(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;AAGA,MAAa,sBAAsB;CACjC,MAAM,SAAS,iBAAiB;CAEhC,QAAQ,GAAG,SACT,WAAW,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,11 +1,9 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { relativeTime } from "@intlayer/core/formatters";
4
3
 
5
4
  //#region src/format/useRelativeTime.ts
6
- const { defaultLocale } = internationalization;
7
5
  const useRelativeTime = () => {
8
- const locale = getRequestLocale() ?? defaultLocale;
6
+ const locale = getRequestLocale();
9
7
  return (...args) => relativeTime(args[0], args[1], {
10
8
  ...args[2],
11
9
  locale: args[2]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useRelativeTime.mjs","names":[],"sources":["../../../src/format/useRelativeTime.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { relativeTime } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useRelativeTime = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,kBAAkB;AAE1B,MAAa,wBAAwB;CACnC,MAAM,SAAS,iBAAiB,KAAM;CAEtC,QAAQ,GAAG,SACT,aAAa,KAAK,IAAI,KAAK,IAAI;EAC7B,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useRelativeTime.mjs","names":[],"sources":["../../../src/format/useRelativeTime.ts"],"sourcesContent":["import { relativeTime } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useRelativeTime = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof relativeTime>) =>\n relativeTime(args[0], args[1], {\n ...args[2],\n locale: args[2]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;AAGA,MAAa,wBAAwB;CACnC,MAAM,SAAS,iBAAiB;CAEhC,QAAQ,GAAG,SACT,aAAa,KAAK,IAAI,KAAK,IAAI;EAC7B,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1,11 +1,9 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { units } from "@intlayer/core/formatters";
4
3
 
5
4
  //#region src/format/useUnit.ts
6
- const { defaultLocale } = internationalization;
7
5
  const useUnit = () => {
8
- const locale = getRequestLocale() ?? defaultLocale;
6
+ const locale = getRequestLocale();
9
7
  return (...args) => units(args[0], {
10
8
  ...args[1],
11
9
  locale: args[1]?.locale ?? locale
@@ -1 +1 @@
1
- {"version":3,"file":"useUnit.mjs","names":[],"sources":["../../../src/format/useUnit.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport { units } from '@intlayer/core/formatters';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { getRequestLocale } from '../requestStorage';\n\nconst { defaultLocale } = internationalization;\n\nexport const useUnit = () => {\n const locale = getRequestLocale() ?? (defaultLocale as DeclaredLocales);\n\n return (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,kBAAkB;AAE1B,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAiB,KAAM;CAEtC,QAAQ,GAAG,SACT,MAAM,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
1
+ {"version":3,"file":"useUnit.mjs","names":[],"sources":["../../../src/format/useUnit.ts"],"sourcesContent":["import { units } from '@intlayer/core/formatters';\nimport { getRequestLocale } from '../requestStorage';\n\nexport const useUnit = () => {\n const locale = getRequestLocale();\n\n return (...args: Parameters<typeof units>) =>\n units(args[0], {\n ...args[1],\n locale: args[1]?.locale ?? locale,\n });\n};\n"],"mappings":";;;;AAGA,MAAa,gBAAgB;CAC3B,MAAM,SAAS,iBAAiB;CAEhC,QAAQ,GAAG,SACT,MAAM,KAAK,IAAI;EACb,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":";;qBAOa,sBAAU,MAGJ,kBAAkB"}
1
+ {"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":";;qBAGa,sBAAU,MAGJ,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../src/format/useCurrency.ts"],"mappings":";;qBAOa,uBAAW,MAGL,kBAAkB"}
1
+ {"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../src/format/useCurrency.ts"],"mappings":";;qBAGa,uBAAW,MAGL,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDate.d.ts","names":[],"sources":["../../../src/format/useDate.ts"],"mappings":";;;;;qBAUa,mBAAO,MAGD,kBAAkB"}
1
+ {"version":3,"file":"useDate.d.ts","names":[],"sources":["../../../src/format/useDate.ts"],"mappings":";;;;;qBAMa,mBAAO,MAGD,kBAAkB"}
@@ -4,8 +4,8 @@ import { LocalesValues } from "@intlayer/types/module_augmentation";
4
4
  /**
5
5
  * Astro hook that provides a locale-bound `Intl` object.
6
6
  *
7
- * It uses the request locale on the server, falling back to the configured
8
- * default locale.
7
+ * It uses the request locale on the server, falling back to the stored
8
+ * locale in the browser, then to the default locale.
9
9
  */
10
10
  export declare const useIntl: (locale?: LocalesValues) => {
11
11
  intl: WrappedIntl;
@@ -1 +1 @@
1
- {"version":3,"file":"useIntl.d.ts","names":[],"sources":["../../../src/format/useIntl.ts"],"mappings":";;;;;;;;;qBAgBa,UAAO,SACT;EAET,MAAM;EACN,YAAY,WAAW,MAAM"}
1
+ {"version":3,"file":"useIntl.d.ts","names":[],"sources":["../../../src/format/useIntl.ts"],"mappings":";;;;;;;;;qBAUa,UAAO,SACT;EAET,MAAM;EACN,YAAY,WAAW,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"useList.d.ts","names":[],"sources":["../../../src/format/useList.ts"],"mappings":";;qBAOa,mBAAO,MAGD,kBAAkB"}
1
+ {"version":3,"file":"useList.d.ts","names":[],"sources":["../../../src/format/useList.ts"],"mappings":";;qBAGa,mBAAO,MAGD,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../src/format/useNumber.ts"],"mappings":";;;;;qBAUa,qBAAS,MAGH,kBAAkB"}
1
+ {"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../src/format/useNumber.ts"],"mappings":";;;;;qBAMa,qBAAS,MAGH,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../src/format/usePercentage.ts"],"mappings":";;qBAOa,yBAAa,MAGP,kBAAkB"}
1
+ {"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../src/format/usePercentage.ts"],"mappings":";;qBAGa,yBAAa,MAGP,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../src/format/useRelativeTime.ts"],"mappings":";;qBAOa,2BAAe,MAGT,kBAAkB"}
1
+ {"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../src/format/useRelativeTime.ts"],"mappings":";;qBAGa,2BAAe,MAGT,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../src/format/useUnit.ts"],"mappings":";;qBAOa,mBAAO,MAGD,kBAAkB"}
1
+ {"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../src/format/useUnit.ts"],"mappings":";;qBAGa,mBAAO,MAGD,kBAAkB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-intlayer",
3
- "version": "9.5.12",
3
+ "version": "9.7.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Astro applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -167,16 +167,16 @@
167
167
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
168
168
  },
169
169
  "dependencies": {
170
- "@intlayer/config": "9.5.12",
171
- "@intlayer/core": "9.5.12",
172
- "@intlayer/engine": "9.5.12",
173
- "@intlayer/types": "9.5.12",
174
- "vanilla-intlayer": "9.5.12",
175
- "vite-intlayer": "9.5.12"
170
+ "@intlayer/config": "9.7.0",
171
+ "@intlayer/core": "9.7.0",
172
+ "@intlayer/engine": "9.7.0",
173
+ "@intlayer/types": "9.7.0",
174
+ "vanilla-intlayer": "9.7.0",
175
+ "vite-intlayer": "9.7.0"
176
176
  },
177
177
  "devDependencies": {
178
- "@intlayer/dictionaries-entry": "9.5.12",
179
- "@types/node": "^22",
178
+ "@intlayer/dictionaries-entry": "9.7.0",
179
+ "@types/node": "^26",
180
180
  "@utils/ts-config": "1.0.4",
181
181
  "@utils/ts-config-types": "1.0.4",
182
182
  "@utils/tsdown-config": "1.0.4",
@@ -184,7 +184,7 @@
184
184
  "rimraf": "6.1.3",
185
185
  "tsdown": "0.23.0",
186
186
  "typescript": "7.0.2",
187
- "vitest": "5.0.2"
187
+ "vitest": "5.0.3"
188
188
  },
189
189
  "peerDependencies": {
190
190
  "astro": ">=4.0.0",