remix-intlayer 9.6.0 → 9.7.1

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 (99) hide show
  1. package/dist/cjs/context.cjs +1 -2
  2. package/dist/cjs/format/index.cjs +9 -9
  3. package/dist/cjs/format/useCompact.cjs +3 -6
  4. package/dist/cjs/format/useCompact.cjs.map +1 -1
  5. package/dist/cjs/format/useCurrency.cjs +3 -6
  6. package/dist/cjs/format/useCurrency.cjs.map +1 -1
  7. package/dist/cjs/format/useDate.cjs +3 -6
  8. package/dist/cjs/format/useDate.cjs.map +1 -1
  9. package/dist/cjs/format/useIntl.cjs +5 -7
  10. package/dist/cjs/format/useIntl.cjs.map +1 -1
  11. package/dist/cjs/format/useList.cjs +3 -6
  12. package/dist/cjs/format/useList.cjs.map +1 -1
  13. package/dist/cjs/format/useNumber.cjs +3 -6
  14. package/dist/cjs/format/useNumber.cjs.map +1 -1
  15. package/dist/cjs/format/usePercentage.cjs +3 -6
  16. package/dist/cjs/format/usePercentage.cjs.map +1 -1
  17. package/dist/cjs/format/useRelativeTime.cjs +3 -6
  18. package/dist/cjs/format/useRelativeTime.cjs.map +1 -1
  19. package/dist/cjs/format/useUnit.cjs +3 -6
  20. package/dist/cjs/format/useUnit.cjs.map +1 -1
  21. package/dist/cjs/html/index.cjs +5 -5
  22. package/dist/cjs/index.cjs +7 -7
  23. package/dist/cjs/localeRouting.cjs +2 -3
  24. package/dist/cjs/markdown/index.cjs +7 -7
  25. package/dist/cjs/middleware.cjs +5 -6
  26. package/dist/cjs/persistLocale.cjs +1 -2
  27. package/dist/cjs/plugins.cjs +1 -2
  28. package/dist/cjs/plugins.cjs.map +1 -1
  29. package/dist/cjs/requestStorage.cjs +2 -3
  30. package/dist/cjs/useDictionary.cjs +3 -4
  31. package/dist/cjs/useIntlayer.cjs +3 -4
  32. package/dist/cjs/useLocale.cjs +2 -3
  33. package/dist/esm/context.mjs +1 -2
  34. package/dist/esm/format/index.mjs +5 -5
  35. package/dist/esm/format/useCompact.mjs +2 -5
  36. package/dist/esm/format/useCompact.mjs.map +1 -1
  37. package/dist/esm/format/useCurrency.mjs +2 -5
  38. package/dist/esm/format/useCurrency.mjs.map +1 -1
  39. package/dist/esm/format/useDate.mjs +2 -5
  40. package/dist/esm/format/useDate.mjs.map +1 -1
  41. package/dist/esm/format/useIntl.mjs +4 -6
  42. package/dist/esm/format/useIntl.mjs.map +1 -1
  43. package/dist/esm/format/useList.mjs +2 -5
  44. package/dist/esm/format/useList.mjs.map +1 -1
  45. package/dist/esm/format/useNumber.mjs +2 -5
  46. package/dist/esm/format/useNumber.mjs.map +1 -1
  47. package/dist/esm/format/usePercentage.mjs +2 -5
  48. package/dist/esm/format/usePercentage.mjs.map +1 -1
  49. package/dist/esm/format/useRelativeTime.mjs +2 -5
  50. package/dist/esm/format/useRelativeTime.mjs.map +1 -1
  51. package/dist/esm/format/useUnit.mjs +2 -5
  52. package/dist/esm/format/useUnit.mjs.map +1 -1
  53. package/dist/esm/index.mjs +2 -2
  54. package/dist/esm/localeRouting.mjs +2 -3
  55. package/dist/esm/middleware.mjs +2 -3
  56. package/dist/esm/persistLocale.mjs +1 -2
  57. package/dist/esm/plugins.mjs +1 -2
  58. package/dist/esm/plugins.mjs.map +1 -1
  59. package/dist/esm/requestStorage.mjs +1 -2
  60. package/dist/esm/useDictionary.mjs +2 -3
  61. package/dist/esm/useIntlayer.mjs +2 -3
  62. package/dist/esm/useLocale.mjs +1 -2
  63. package/dist/types/context.d.ts +0 -2
  64. package/dist/types/context.d.ts.map +1 -1
  65. package/dist/types/format/useCompact.d.ts +0 -2
  66. package/dist/types/format/useCompact.d.ts.map +1 -1
  67. package/dist/types/format/useCurrency.d.ts +0 -2
  68. package/dist/types/format/useCurrency.d.ts.map +1 -1
  69. package/dist/types/format/useDate.d.ts +0 -2
  70. package/dist/types/format/useDate.d.ts.map +1 -1
  71. package/dist/types/format/useIntl.d.ts +2 -3
  72. package/dist/types/format/useIntl.d.ts.map +1 -1
  73. package/dist/types/format/useList.d.ts +0 -2
  74. package/dist/types/format/useList.d.ts.map +1 -1
  75. package/dist/types/format/useNumber.d.ts +0 -2
  76. package/dist/types/format/useNumber.d.ts.map +1 -1
  77. package/dist/types/format/usePercentage.d.ts +0 -2
  78. package/dist/types/format/usePercentage.d.ts.map +1 -1
  79. package/dist/types/format/useRelativeTime.d.ts +0 -2
  80. package/dist/types/format/useRelativeTime.d.ts.map +1 -1
  81. package/dist/types/format/useUnit.d.ts +0 -2
  82. package/dist/types/format/useUnit.d.ts.map +1 -1
  83. package/dist/types/localeRouting.d.ts +0 -2
  84. package/dist/types/localeRouting.d.ts.map +1 -1
  85. package/dist/types/middleware.d.ts +0 -2
  86. package/dist/types/middleware.d.ts.map +1 -1
  87. package/dist/types/persistLocale.d.ts +0 -2
  88. package/dist/types/persistLocale.d.ts.map +1 -1
  89. package/dist/types/plugins.d.ts +1 -3
  90. package/dist/types/plugins.d.ts.map +1 -1
  91. package/dist/types/requestStorage.d.ts +0 -2
  92. package/dist/types/requestStorage.d.ts.map +1 -1
  93. package/dist/types/useDictionary.d.ts +0 -2
  94. package/dist/types/useDictionary.d.ts.map +1 -1
  95. package/dist/types/useIntlayer.d.ts +0 -2
  96. package/dist/types/useIntlayer.d.ts.map +1 -1
  97. package/dist/types/useLocale.d.ts +0 -2
  98. package/dist/types/useLocale.d.ts.map +1 -1
  99. package/package.json +11 -11
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_requestStorage = require('./requestStorage.cjs');
2
+ const require_requestStorage = require("./requestStorage.cjs");
3
3
  let _intlayer_config_built = require("@intlayer/config/built");
4
4
 
5
- //#region src/useLocale.ts
5
+ // src/useLocale.ts
6
6
  const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization;
7
7
  /**
8
8
  * Returns the locale of the request being handled, with the configured
@@ -28,6 +28,5 @@ const useLocale = () => {
28
28
  };
29
29
  };
30
30
 
31
- //#endregion
32
31
  exports.useLocale = useLocale;
33
32
  //# sourceMappingURL=useLocale.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { createContextKey } from "remix/router";
2
2
 
3
- //#region src/context.ts
3
+ // src/context.ts
4
4
  /**
5
5
  * Request-context key holding the {@link IntlayerState} of the current request.
6
6
  *
@@ -16,6 +16,5 @@ const Intlayer = createContextKey();
16
16
  */
17
17
  const INTLAYER_CONTEXT_PROPERTY = "intlayer";
18
18
 
19
- //#endregion
20
19
  export { INTLAYER_CONTEXT_PROPERTY, Intlayer };
21
20
  //# sourceMappingURL=context.mjs.map
@@ -1,11 +1,11 @@
1
- import { usePercentage } from "./usePercentage.mjs";
2
- import { useUnit } from "./useUnit.mjs";
3
1
  import { useCompact } from "./useCompact.mjs";
4
- import { useNumber } from "./useNumber.mjs";
5
- import { useIntl } from "./useIntl.mjs";
6
- import { useList } from "./useList.mjs";
7
2
  import { useCurrency } from "./useCurrency.mjs";
8
3
  import { useDate } from "./useDate.mjs";
4
+ import { useIntl } from "./useIntl.mjs";
5
+ import { useList } from "./useList.mjs";
6
+ import { useNumber } from "./useNumber.mjs";
7
+ import { usePercentage } from "./usePercentage.mjs";
9
8
  import { useRelativeTime } from "./useRelativeTime.mjs";
9
+ import { useUnit } from "./useUnit.mjs";
10
10
 
11
11
  export { useCompact, useCurrency, useDate, useIntl, useList, useNumber, usePercentage, useRelativeTime, useUnit };
@@ -1,17 +1,14 @@
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
- //#region src/format/useCompact.ts
6
- const { defaultLocale } = internationalization;
4
+ // src/format/useCompact.ts
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
12
10
  });
13
11
  };
14
12
 
15
- //#endregion
16
13
  export { useCompact };
17
14
  //# sourceMappingURL=useCompact.mjs.map
@@ -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,17 +1,14 @@
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
- //#region src/format/useCurrency.ts
6
- const { defaultLocale } = internationalization;
4
+ // src/format/useCurrency.ts
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
12
10
  });
13
11
  };
14
12
 
15
- //#endregion
16
13
  export { useCurrency };
17
14
  //# sourceMappingURL=useCurrency.mjs.map
@@ -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
- //#region src/format/useDate.ts
6
- const { defaultLocale } = internationalization;
4
+ // src/format/useDate.ts
7
5
  /**
8
6
  * Remix 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]],
@@ -21,6 +19,5 @@ const useDate = () => {
21
19
  };
22
20
  };
23
21
 
24
- //#endregion
25
22
  export { useDate };
26
23
  //# sourceMappingURL=useDate.mjs.map
@@ -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 * Remix 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 * Remix 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,23 +1,21 @@
1
1
  import { getRequestLocale } from "../requestStorage.mjs";
2
2
  import { bindIntl } from "@intlayer/core/utils";
3
- import { internationalization } from "@intlayer/config/built";
4
3
 
5
- //#region src/format/useIntl.ts
6
- const { defaultLocale } = internationalization;
4
+ // src/format/useIntl.ts
7
5
  /**
8
6
  * Remix hook that provides a locale-bound `Intl` object.
9
7
  *
10
8
  * It uses the request locale when running inside a request handler,
11
- * falling back to the configured default locale.
9
+ * falling back to the stored locale in the browser, then to the default
10
+ * locale.
12
11
  */
13
12
  const useIntl = (locale) => {
14
- const currentLocale = locale ?? getRequestLocale() ?? defaultLocale;
13
+ const currentLocale = locale ?? getRequestLocale();
15
14
  return {
16
15
  intl: bindIntl(currentLocale),
17
16
  subscribe: () => () => {}
18
17
  };
19
18
  };
20
19
 
21
- //#endregion
22
20
  export { useIntl };
23
21
  //# sourceMappingURL=useIntl.mjs.map
@@ -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 * Remix hook that provides a locale-bound `Intl` object.\n *\n * It uses the request locale when running inside a request handler,\n * falling back to the configured 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 * Remix hook that provides a locale-bound `Intl` object.\n *\n * It uses the request locale when running inside a request handler,\n * falling back to the stored locale in the browser, then to the default\n * 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":";;;;;;;;;;;AAWA,MAAa,WACX,WAIG;CACH,MAAM,gBAAgB,UAAU,iBAAiB;CAGjD,OAAO;EACL,MAHW,SAAS,aAGjB;EACH,uBAAuB,CAAC;CAC1B;AACF"}
@@ -1,17 +1,14 @@
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
- //#region src/format/useList.ts
6
- const { defaultLocale } = internationalization;
4
+ // src/format/useList.ts
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
12
10
  });
13
11
  };
14
12
 
15
- //#endregion
16
13
  export { useList };
17
14
  //# sourceMappingURL=useList.mjs.map
@@ -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,20 +1,17 @@
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
- //#region src/format/useNumber.ts
6
- const { defaultLocale } = internationalization;
4
+ // src/format/useNumber.ts
7
5
  /**
8
6
  * Remix 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
15
13
  });
16
14
  };
17
15
 
18
- //#endregion
19
16
  export { useNumber };
20
17
  //# sourceMappingURL=useNumber.mjs.map
@@ -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 * Remix 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 * Remix 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,17 +1,14 @@
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
- //#region src/format/usePercentage.ts
6
- const { defaultLocale } = internationalization;
4
+ // src/format/usePercentage.ts
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
12
10
  });
13
11
  };
14
12
 
15
- //#endregion
16
13
  export { usePercentage };
17
14
  //# sourceMappingURL=usePercentage.mjs.map
@@ -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,17 +1,14 @@
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
- //#region src/format/useRelativeTime.ts
6
- const { defaultLocale } = internationalization;
4
+ // src/format/useRelativeTime.ts
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
12
10
  });
13
11
  };
14
12
 
15
- //#endregion
16
13
  export { useRelativeTime };
17
14
  //# sourceMappingURL=useRelativeTime.mjs.map
@@ -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,17 +1,14 @@
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
- //#region src/format/useUnit.ts
6
- const { defaultLocale } = internationalization;
4
+ // src/format/useUnit.ts
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
12
10
  });
13
11
  };
14
12
 
15
- //#endregion
16
13
  export { useUnit };
17
14
  //# sourceMappingURL=useUnit.mjs.map
@@ -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,9 +1,9 @@
1
1
  import { INTLAYER_CONTEXT_PROPERTY, Intlayer } from "./context.mjs";
2
2
  import { createLocaleRouting } from "./localeRouting.mjs";
3
- import { getIntlayerState } from "./requestStorage.mjs";
4
3
  import { intlayer } from "./middleware.mjs";
4
+ import { getIntlayerState } from "./requestStorage.mjs";
5
+ import { useDictionary } from "./useDictionary.mjs";
5
6
  import { useIntlayer } from "./useIntlayer.mjs";
6
7
  import { useLocale } from "./useLocale.mjs";
7
- import { useDictionary } from "./useDictionary.mjs";
8
8
 
9
9
  export { INTLAYER_CONTEXT_PROPERTY, Intlayer, createLocaleRouting, getIntlayerState, intlayer, useDictionary, useIntlayer, useLocale };
@@ -1,8 +1,8 @@
1
- import { getCookie, getLocaleFromStorageServer } from "@intlayer/core/utils";
2
1
  import { getCanonicalPath, getDomainHostname, getDomainOrigin, getLocaleFromDomain, getRewriteRules, isProxyStorageLocaleEnabled, localeDetector, resolveLocalizedPath, resolveProxyMode } from "@intlayer/core/localization";
3
2
  import { ROUTING_MODE } from "@intlayer/config/defaultValues";
3
+ import { getCookie, getLocaleFromStorageServer } from "@intlayer/core/utils";
4
4
 
5
- //#region src/localeRouting.ts
5
+ // src/localeRouting.ts
6
6
  /** Matches a pathname ending with a file extension (`/logo.svg`). */
7
7
  const STATIC_ASSET_PATTERN = /\.[a-zA-Z0-9]+$/;
8
8
  const PASS = { kind: "pass" };
@@ -205,6 +205,5 @@ const createLocaleRouting = (configuration, options = {}) => {
205
205
  };
206
206
  };
207
207
 
208
- //#endregion
209
208
  export { createLocaleRouting };
210
209
  //# sourceMappingURL=localeRouting.mjs.map
@@ -1,13 +1,13 @@
1
1
  import { INTLAYER_CONTEXT_PROPERTY, Intlayer } from "./context.mjs";
2
- import { withLocaleHeaders, writeLocaleHeaders } from "./persistLocale.mjs";
3
2
  import { createLocaleRouting } from "./localeRouting.mjs";
3
+ import { withLocaleHeaders, writeLocaleHeaders } from "./persistLocale.mjs";
4
4
  import { requestStorage } from "./requestStorage.mjs";
5
5
  import { internationalization, routing } from "@intlayer/config/built";
6
6
  import { getConfiguration } from "@intlayer/config/node";
7
7
  import { getLocaleFromRequest } from "@intlayer/core/localization";
8
8
  import { prepareIntlayerServer } from "@intlayer/engine/build";
9
9
 
10
- //#region src/middleware.ts
10
+ // src/middleware.ts
11
11
  /**
12
12
  * Builds the redirect response of a locale-routing decision.
13
13
  *
@@ -86,6 +86,5 @@ const intlayer = (options = {}) => {
86
86
  };
87
87
  };
88
88
 
89
- //#endregion
90
89
  export { intlayer };
91
90
  //# sourceMappingURL=middleware.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { setLocaleInStorageServer } from "@intlayer/core/utils";
2
2
  import { SetCookie } from "remix/headers";
3
3
 
4
- //#region src/persistLocale.ts
4
+ // src/persistLocale.ts
5
5
  /**
6
6
  * Serializes a locale cookie as a `Set-Cookie` header value.
7
7
  */
@@ -44,6 +44,5 @@ const withLocaleHeaders = (response, locale) => {
44
44
  }
45
45
  };
46
46
 
47
- //#endregion
48
47
  export { withLocaleHeaders, writeLocaleHeaders };
49
48
  //# sourceMappingURL=persistLocale.mjs.map
@@ -2,7 +2,7 @@ import { internationalization } from "@intlayer/config/built";
2
2
  import { fallbackPlugin, getBasePlugins } from "@intlayer/core/interpreter";
3
3
  import { htmlPlugin, markdownPlugin } from "vanilla-intlayer";
4
4
 
5
- //#region src/plugins.ts
5
+ // src/plugins.ts
6
6
  const pluginsCache = /* @__PURE__ */ new Map();
7
7
  /**
8
8
  * Returns the plugin array for a locale, memoized so the interpreter's
@@ -21,6 +21,5 @@ const getPlugins = (locale, fallback = true) => {
21
21
  return plugins;
22
22
  };
23
23
 
24
- //#endregion
25
24
  export { getPlugins };
26
25
  //# sourceMappingURL=plugins.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.mjs","names":[],"sources":["../../src/plugins.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport {\n type DeepTransformContent as DeepTransformContentCore,\n fallbackPlugin,\n getBasePlugins,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n type Plugins,\n} from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { htmlPlugin, markdownPlugin } from 'vanilla-intlayer';\n\n/**\n * Plugins applied by the hooks of this package.\n *\n * The base interpreter leaves `md()` and `html()` nodes untouched, so they are\n * handed to the string renderers of `vanilla-intlayer`: the node exposes the\n * rendered HTML as `.value` and `.use(components)` to override tags. Plain\n * strings stay primitives — a `remix/ui` child must be a string, not a wrapper.\n */\nexport type IInterpreterPluginState = IInterpreterPluginStateCore & {\n vanillaMarkdown: true;\n vanillaHtml: true;\n};\n\nexport type DeepTransformContent<\n T,\n L extends LocalesValues = DeclaredLocales,\n> = DeepTransformContentCore<T, IInterpreterPluginState, L>;\n\nconst pluginsCache = new Map<string, Plugins[]>();\n\n/**\n * Returns the plugin array for a locale, memoized so the interpreter's\n * transform cache can key on its identity.\n */\nexport const getPlugins = (\n locale?: LocalesValues,\n fallback = true\n): Plugins[] => {\n const cacheKey = `${locale ?? internationalization.defaultLocale}_${fallback}`;\n\n const cached = pluginsCache.get(cacheKey);\n if (cached) return cached;\n\n const plugins = [\n ...getBasePlugins(locale, fallback),\n markdownPlugin,\n htmlPlugin,\n ].filter(\n // Plugins disabled at build time never match: skip them on every node\n (plugin) => plugin !== fallbackPlugin\n );\n\n pluginsCache.set(cacheKey, plugins);\n\n return plugins;\n};\n"],"mappings":";;;;;AAgCA,MAAM,+BAAe,IAAI,IAAuB;;;;;AAMhD,MAAa,cACX,QACA,WAAW,SACG;CACd,MAAM,WAAW,GAAG,UAAU,qBAAqB,cAAc,GAAG;CAEpE,MAAM,SAAS,aAAa,IAAI,QAAQ;CACxC,IAAI,QAAQ,OAAO;CAEnB,MAAM,UAAU;EACd,GAAG,eAAe,QAAQ,QAAQ;EAClC;EACA;CACF,CAAC,CAAC,QAEC,WAAW,WAAW,cACzB;CAEA,aAAa,IAAI,UAAU,OAAO;CAElC,OAAO;AACT"}
1
+ {"version":3,"file":"plugins.mjs","names":[],"sources":["../../src/plugins.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport {\n type DeepTransformContent as DeepTransformContentCore,\n fallbackPlugin,\n getBasePlugins,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n type Plugins,\n} from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { htmlPlugin, markdownPlugin } from 'vanilla-intlayer';\n\n/**\n * Plugins applied by the hooks of this package.\n *\n * The base interpreter leaves `md()` and `html()` nodes untouched, so they are\n * handed to the string renderers of `vanilla-intlayer`: the node exposes the\n * rendered HTML as `.value` and `.use(components)` to override tags. Plain\n * strings stay primitives — a `remix/component` child must be a string, not a wrapper.\n */\nexport type IInterpreterPluginState = IInterpreterPluginStateCore & {\n vanillaMarkdown: true;\n vanillaHtml: true;\n};\n\nexport type DeepTransformContent<\n T,\n L extends LocalesValues = DeclaredLocales,\n> = DeepTransformContentCore<T, IInterpreterPluginState, L>;\n\nconst pluginsCache = new Map<string, Plugins[]>();\n\n/**\n * Returns the plugin array for a locale, memoized so the interpreter's\n * transform cache can key on its identity.\n */\nexport const getPlugins = (\n locale?: LocalesValues,\n fallback = true\n): Plugins[] => {\n const cacheKey = `${locale ?? internationalization.defaultLocale}_${fallback}`;\n\n const cached = pluginsCache.get(cacheKey);\n if (cached) return cached;\n\n const plugins = [\n ...getBasePlugins(locale, fallback),\n markdownPlugin,\n htmlPlugin,\n ].filter(\n // Plugins disabled at build time never match: skip them on every node\n (plugin) => plugin !== fallbackPlugin\n );\n\n pluginsCache.set(cacheKey, plugins);\n\n return plugins;\n};\n"],"mappings":";;;;;AAgCA,MAAM,+BAAe,IAAI,IAAuB;;;;;AAMhD,MAAa,cACX,QACA,WAAW,SACG;CACd,MAAM,WAAW,GAAG,UAAU,qBAAqB,cAAc,GAAG;CAEpE,MAAM,SAAS,aAAa,IAAI,QAAQ;CACxC,IAAI,QAAQ,OAAO;CAEnB,MAAM,UAAU;EACd,GAAG,eAAe,QAAQ,QAAQ;EAClC;EACA;CACF,CAAC,CAAC,QAEC,WAAW,WAAW,cACzB;CAEA,aAAa,IAAI,UAAU,OAAO;CAElC,OAAO;AACT"}
@@ -2,7 +2,7 @@ import { Intlayer } from "./context.mjs";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  import { registerAmbientLocaleResolver } from "@intlayer/core/interpreter";
4
4
 
5
- //#region src/requestStorage.ts
5
+ // src/requestStorage.ts
6
6
  /**
7
7
  * Request context of the request being handled, made available to every
8
8
  * function running inside the `intlayer()` middleware scope — route handlers,
@@ -19,6 +19,5 @@ const getIntlayerState = () => requestStorage.getStore()?.get(Intlayer);
19
19
  const getRequestLocale = () => getIntlayerState()?.locale;
20
20
  registerAmbientLocaleResolver(getRequestLocale);
21
21
 
22
- //#endregion
23
22
  export { getIntlayerState, getRequestLocale, requestStorage };
24
23
  //# sourceMappingURL=requestStorage.mjs.map
@@ -1,9 +1,9 @@
1
- import { getRequestLocale } from "./requestStorage.mjs";
2
1
  import { getPlugins } from "./plugins.mjs";
2
+ import { getRequestLocale } from "./requestStorage.mjs";
3
3
  import { getDictionary } from "@intlayer/core/interpreter";
4
4
  import { parseDictionarySelector, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
5
5
 
6
- //#region src/useDictionary.ts
6
+ // src/useDictionary.ts
7
7
  /**
8
8
  * Transforms an imported dictionary (or qualified dictionary group) and returns
9
9
  * its content for the locale of the request being handled.
@@ -36,6 +36,5 @@ const useDictionary = (dictionary, localeOrSelector) => {
36
36
  return getDictionary(dictionary, argument, getPlugins(locale));
37
37
  };
38
38
 
39
- //#endregion
40
39
  export { useDictionary };
41
40
  //# sourceMappingURL=useDictionary.mjs.map
@@ -1,9 +1,9 @@
1
- import { getRequestLocale } from "./requestStorage.mjs";
2
1
  import { getPlugins } from "./plugins.mjs";
2
+ import { getRequestLocale } from "./requestStorage.mjs";
3
3
  import { getIntlayer } from "@intlayer/core/interpreter";
4
4
  import { parseDictionarySelector, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
5
5
 
6
- //#region src/useIntlayer.ts
6
+ // src/useIntlayer.ts
7
7
  /**
8
8
  * Picks one dictionary by its key and returns its content for the locale of
9
9
  * the request being handled.
@@ -34,6 +34,5 @@ const useIntlayer = (key, localeOrSelector) => {
34
34
  return getIntlayer(key, argument, getPlugins(locale));
35
35
  };
36
36
 
37
- //#endregion
38
37
  export { useIntlayer };
39
38
  //# sourceMappingURL=useIntlayer.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { getIntlayerState } from "./requestStorage.mjs";
2
2
  import { internationalization } from "@intlayer/config/built";
3
3
 
4
- //#region src/useLocale.ts
4
+ // src/useLocale.ts
5
5
  const { defaultLocale, locales: availableLocales } = internationalization;
6
6
  /**
7
7
  * Returns the locale of the request being handled, with the configured
@@ -27,6 +27,5 @@ const useLocale = () => {
27
27
  };
28
28
  };
29
29
 
30
- //#endregion
31
30
  export { useLocale };
32
31
  //# sourceMappingURL=useLocale.mjs.map
@@ -1,5 +1,4 @@
1
1
  import { DeclaredLocales } from "@intlayer/types/module_augmentation";
2
- //#region src/context.d.ts
3
2
  /**
4
3
  * Intlayer state attached to the Remix `RequestContext` by the {@link intlayer} middleware.
5
4
  */
@@ -27,5 +26,4 @@ export declare const Intlayer: {
27
26
  * so `context.intlayer` mirrors `context.get(Intlayer)`.
28
27
  */
29
28
  export declare const INTLAYER_CONTEXT_PROPERTY = "intlayer";
30
- //#endregion
31
29
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","names":[],"sources":["../../src/context.ts"],"mappings":";;;;;YAMY;;EAEV,QAAQ;;EAER,eAAe;;EAEf,kBAAkB;;;;;;;;;;qBAWP;EAAY,eAAe;;;;;;qBAO3B"}
1
+ {"version":3,"file":"context.d.ts","names":[],"sources":["../../src/context.ts"],"mappings":";;;;YAMY;;EAEV,QAAQ;;EAER,eAAe;;EAEf,kBAAkB;;;;;;;;;;qBAWP;EAAY,eAAe;;;;;;qBAO3B"}
@@ -1,5 +1,3 @@
1
1
  import { compact } from "@intlayer/core/formatters";
2
- //#region src/format/useCompact.d.ts
3
2
  export declare const useCompact: () => (...args: Parameters<typeof compact>) => string;
4
- //#endregion
5
3
  //# sourceMappingURL=useCompact.d.ts.map
@@ -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,5 +1,3 @@
1
1
  import { currency } from "@intlayer/core/formatters";
2
- //#region src/format/useCurrency.d.ts
3
2
  export declare const useCurrency: () => (...args: Parameters<typeof currency>) => string;
4
- //#endregion
5
3
  //# sourceMappingURL=useCurrency.d.ts.map
@@ -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,8 +1,6 @@
1
1
  import { date } from "@intlayer/core/formatters";
2
- //#region src/format/useDate.d.ts
3
2
  /**
4
3
  * Remix hook that provides a localized date/time formatter bound to the request locale.
5
4
  */
6
5
  export declare const useDate: () => (...args: Parameters<typeof date>) => string;
7
- //#endregion
8
6
  //# sourceMappingURL=useDate.d.ts.map
@@ -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"}
@@ -1,15 +1,14 @@
1
1
  import { LocalesValues } from "@intlayer/types/module_augmentation";
2
2
  import { WrappedIntl } from "@intlayer/core/utils";
3
- //#region src/format/useIntl.d.ts
4
3
  /**
5
4
  * Remix hook that provides a locale-bound `Intl` object.
6
5
  *
7
6
  * It uses the request locale when running inside a request handler,
8
- * falling back to the configured default locale.
7
+ * falling back to the stored locale in the browser, then to the default
8
+ * locale.
9
9
  */
10
10
  export declare const useIntl: (locale?: LocalesValues) => {
11
11
  intl: WrappedIntl;
12
12
  subscribe: (callback: (intl: WrappedIntl) => void) => () => void;
13
13
  };
14
- //#endregion
15
14
  //# sourceMappingURL=useIntl.d.ts.map
@@ -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":";;;;;;;;;qBAWa,UAAO,SACT;EAET,MAAM;EACN,YAAY,WAAW,MAAM"}
@@ -1,5 +1,3 @@
1
1
  import { list } from "@intlayer/core/formatters";
2
- //#region src/format/useList.d.ts
3
2
  export declare const useList: () => (...args: Parameters<typeof list>) => string;
4
- //#endregion
5
3
  //# sourceMappingURL=useList.d.ts.map
@@ -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,8 +1,6 @@
1
1
  import { number } from "@intlayer/core/formatters";
2
- //#region src/format/useNumber.d.ts
3
2
  /**
4
3
  * Remix hook that provides a localized number formatter bound to the request locale.
5
4
  */
6
5
  export declare const useNumber: () => (...args: Parameters<typeof number>) => string;
7
- //#endregion
8
6
  //# sourceMappingURL=useNumber.d.ts.map
@@ -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,5 +1,3 @@
1
1
  import { percentage } from "@intlayer/core/formatters";
2
- //#region src/format/usePercentage.d.ts
3
2
  export declare const usePercentage: () => (...args: Parameters<typeof percentage>) => string;
4
- //#endregion
5
3
  //# sourceMappingURL=usePercentage.d.ts.map
@@ -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"}