react-intlayer 9.4.1 → 9.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/types/client/format/useCompact.d.ts +2 -1
- package/dist/types/client/format/useCompact.d.ts.map +1 -1
- package/dist/types/client/format/useCurrency.d.ts +2 -1
- package/dist/types/client/format/useCurrency.d.ts.map +1 -1
- package/dist/types/client/format/useList.d.ts +2 -1
- package/dist/types/client/format/useList.d.ts.map +1 -1
- package/dist/types/client/format/useNumber.d.ts +2 -1
- package/dist/types/client/format/useNumber.d.ts.map +1 -1
- package/dist/types/client/format/usePercentage.d.ts +2 -1
- package/dist/types/client/format/usePercentage.d.ts.map +1 -1
- package/dist/types/client/format/useRelativeTime.d.ts +2 -1
- package/dist/types/client/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/client/format/useUnit.d.ts +2 -1
- package/dist/types/client/format/useUnit.d.ts.map +1 -1
- package/dist/types/client/useI18n.d.ts +1 -1
- package/dist/types/client/useLocaleBase.d.ts +3 -2
- package/dist/types/client/useLocaleBase.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +4 -3
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/intlayer/dist/types/index.d.ts +14 -0
- package/dist/types/server/useI18n.d.ts +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -330,4 +330,4 @@ Contribute on [GitHub](https://github.com/aymericzip/intlayer), [GitLab](https:/
|
|
|
330
330
|
|
|
331
331
|
If you like Intlayer, give us a ⭐ on GitHub. It helps others discover the project! [See why GitHub Stars matter](https://github.com/aymericzip/intlayer/blob/main/CONTRIBUTING.md#why-github-stars-matter-).
|
|
332
332
|
|
|
333
|
-
[](https://api.star-history.com/#aymericzip/intlayer&Date)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalesValues } from "../../intlayer/dist/types/index.js";
|
|
1
2
|
//#region src/client/format/useCompact.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* React client hook that provides a compact number formatter
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
* ```
|
|
11
12
|
*/
|
|
12
13
|
declare const useCompact: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
13
|
-
locale?:
|
|
14
|
+
locale?: LocalesValues;
|
|
14
15
|
}) => string;
|
|
15
16
|
//#endregion
|
|
16
17
|
export { useCompact };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../../src/client/format/useCompact.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../../src/client/format/useCompact.ts"],"mappings":";;;;;;;;;;;;cAgBa,mBAAU,wBAAA,UAAA,KAAA;WAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalesValues } from "../../intlayer/dist/types/index.js";
|
|
1
2
|
//#region src/client/format/useCurrency.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* React client hook that provides a currency formatter
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
27
|
declare const useCurrency: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
27
|
-
locale?:
|
|
28
|
+
locale?: LocalesValues;
|
|
28
29
|
}) => string;
|
|
29
30
|
//#endregion
|
|
30
31
|
export { useCurrency };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../../src/client/format/useCurrency.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../../src/client/format/useCurrency.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;cA8Ba,oBAAW,wBAAA,UAAA,KAAA;WAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalesValues } from "../../intlayer/dist/types/index.js";
|
|
1
2
|
//#region src/client/format/useList.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* React client hook that provides a list formatter
|
|
@@ -25,7 +26,7 @@ declare const useList: () => (values: (string | number)[], options?: {
|
|
|
25
26
|
type?: 'conjunction' | 'disjunction' | 'unit';
|
|
26
27
|
style?: 'long' | 'short' | 'narrow';
|
|
27
28
|
} & {
|
|
28
|
-
locale?:
|
|
29
|
+
locale?: LocalesValues;
|
|
29
30
|
}) => string;
|
|
30
31
|
//#endregion
|
|
31
32
|
export { useList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useList.d.ts","names":[],"sources":["../../../../src/client/format/useList.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useList.d.ts","names":[],"sources":["../../../../src/client/format/useList.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;cA2Ba,gBAAO,6BAAA;;;;;WAAP"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalesValues } from "../../intlayer/dist/types/index.js";
|
|
1
2
|
//#region src/client/format/useNumber.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* React client hook that provides a localized number formatter.
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
* A number formatting function bound to the active locale.
|
|
23
24
|
*/
|
|
24
25
|
declare const useNumber: () => (value: string | number, args_1?: Intl.NumberFormatOptions & {
|
|
25
|
-
locale?:
|
|
26
|
+
locale?: LocalesValues;
|
|
26
27
|
}) => string;
|
|
27
28
|
//#endregion
|
|
28
29
|
export { useNumber };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../../src/client/format/useNumber.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../../src/client/format/useNumber.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;cA4Ba,kBAAS,wBAAA,SAAA,KAAA;WAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalesValues } from "../../intlayer/dist/types/index.js";
|
|
1
2
|
//#region src/client/format/usePercentage.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* React hook to provide a percentage formatter function
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
* A function that formats numbers or numeric strings into localized percentages.
|
|
19
20
|
*/
|
|
20
21
|
declare const usePercentage: () => (value: string | number, args_1?: Intl.NumberFormatOptions & {
|
|
21
|
-
locale?:
|
|
22
|
+
locale?: LocalesValues;
|
|
22
23
|
}) => string;
|
|
23
24
|
//#endregion
|
|
24
25
|
export { usePercentage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../../src/client/format/usePercentage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../../src/client/format/usePercentage.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAwBa,sBAAa,wBAAA,SAAA,KAAA;WAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalesValues } from "../../intlayer/dist/types/index.js";
|
|
1
2
|
//#region src/client/format/useRelativeTime.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* Client-side React hook for accessing a localized relative time formatter.
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
* bound to the current client locale.
|
|
19
20
|
*/
|
|
20
21
|
declare const useRelativeTime: () => (from: string | number | Date, to?: string | number | Date, options?: Intl.RelativeTimeFormatOptions & {
|
|
21
|
-
locale?:
|
|
22
|
+
locale?: LocalesValues;
|
|
22
23
|
unit?: Intl.RelativeTimeFormatUnit;
|
|
23
24
|
}) => string;
|
|
24
25
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../../src/client/format/useRelativeTime.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../../src/client/format/useRelativeTime.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAwBa,wBAAe,wBAAA,MAAA,uBAAA,MAAA,UAAA,KAAA;WAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalesValues } from "../../intlayer/dist/types/index.js";
|
|
1
2
|
//#region src/client/format/useUnit.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* React hook that provides a unit formatting function
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
* @returns {Function} A unit formatting function that accepts a value and optional formatting options.
|
|
18
19
|
*/
|
|
19
20
|
declare const useUnit: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
20
|
-
locale?:
|
|
21
|
+
locale?: LocalesValues;
|
|
21
22
|
}) => string;
|
|
22
23
|
//#endregion
|
|
23
24
|
export { useUnit };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../../src/client/format/useUnit.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../../src/client/format/useUnit.ts"],"mappings":";;;;;;;;;;;;;;;;;;;cAuBa,gBAAO,wBAAA,UAAA,KAAA;WAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeepTransformContent } from "../plugins.js";
|
|
2
2
|
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent } from "@intlayer/types/module_augmentation";
|
|
3
|
-
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
4
3
|
import { GetSubPath } from "@intlayer/types/dictionary";
|
|
4
|
+
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
5
5
|
//#region src/client/useI18n.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Hook that provides a translation function `t()` for accessing nested content by key.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
1
2
|
//#region src/client/useLocaleBase.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* On the client side, hook to get the current locale and all related fields
|
|
4
5
|
*/
|
|
5
6
|
declare const useLocaleBase: () => {
|
|
6
|
-
locale:
|
|
7
|
+
locale: LocalesValues;
|
|
7
8
|
defaultLocale: any;
|
|
8
9
|
availableLocales: any;
|
|
9
|
-
setLocale: (newLocale:
|
|
10
|
+
setLocale: (newLocale: LocalesValues) => void;
|
|
10
11
|
};
|
|
11
12
|
//#endregion
|
|
12
13
|
export { useLocaleBase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"mappings":";;;;;cAWa;UAAA;;;yBAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Locale } from "../intlayer/dist/types/index.js";
|
|
1
2
|
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
3
|
//#region src/client/useLocaleStorage.d.ts
|
|
3
4
|
/**
|
|
@@ -6,13 +7,13 @@ import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
|
6
7
|
/**
|
|
7
8
|
* Get the locale cookie
|
|
8
9
|
*/
|
|
9
|
-
declare const localeInStorage:
|
|
10
|
+
declare const localeInStorage: Locale;
|
|
10
11
|
/**
|
|
11
12
|
* @deprecated Use localeInStorage instead
|
|
12
13
|
*
|
|
13
14
|
* Get the locale cookie
|
|
14
15
|
*/
|
|
15
|
-
declare const localeCookie:
|
|
16
|
+
declare const localeCookie: Locale;
|
|
16
17
|
/**
|
|
17
18
|
* Set the locale cookie
|
|
18
19
|
*/
|
|
@@ -27,7 +28,7 @@ declare const setLocaleCookie: typeof setLocaleInStorage;
|
|
|
27
28
|
* Hook that provides the locale cookie and a function to set it
|
|
28
29
|
*/
|
|
29
30
|
declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
30
|
-
getLocale: () =>
|
|
31
|
+
getLocale: () => Locale;
|
|
31
32
|
setLocale: (locale: LocalesValues) => void;
|
|
32
33
|
};
|
|
33
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"mappings":";;;;;;;;;cAea,iBAAA;;;;;;cAMA,cAAA;;;;cAKA,qBAAkB,QACrB,eAAa;;;;;;cAaV,wBAAe;;;;cAKf,mBAAgB;mBAAhB;sBAAA;;;;;;;;;cAiBA,wBAAe"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "@intlayer/core/interpreter";
|
|
2
|
+
import { LocalesValues as LocalesValues$1 } from "@intlayer/types/module_augmentation";
|
|
3
|
+
import "@intlayer/types/config";
|
|
4
|
+
import { Dictionary } from "@intlayer/types/dictionary";
|
|
5
|
+
import { Locale } from "@intlayer/types/allLocales";
|
|
6
|
+
import "@intlayer/types/locales";
|
|
7
|
+
import "@intlayer/config/built";
|
|
8
|
+
import "@intlayer/core/file";
|
|
9
|
+
import "@intlayer/core/formatters";
|
|
10
|
+
import "@intlayer/core/localization";
|
|
11
|
+
import "@intlayer/core/markdown";
|
|
12
|
+
import "@intlayer/core/transpiler";
|
|
13
|
+
import "@intlayer/core/utils";
|
|
14
|
+
export type { Locale, LocalesValues$1 as LocalesValues };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeepTransformContent } from "../plugins.js";
|
|
2
2
|
import { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
|
-
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
4
3
|
import { GetSubPath } from "@intlayer/types/dictionary";
|
|
4
|
+
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
5
5
|
//#region src/server/useI18n.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Hook that provides a translation function `t()` for accessing nested content by key.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intlayer",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your React applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -132,17 +132,17 @@
|
|
|
132
132
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
133
133
|
},
|
|
134
134
|
"dependencies": {
|
|
135
|
-
"@intlayer/api": "9.4.
|
|
136
|
-
"@intlayer/config": "9.4.
|
|
137
|
-
"@intlayer/core": "9.4.
|
|
138
|
-
"@intlayer/dictionaries-entry": "9.4.
|
|
139
|
-
"@intlayer/editor": "9.4.
|
|
140
|
-
"@intlayer/types": "9.4.
|
|
135
|
+
"@intlayer/api": "9.4.3",
|
|
136
|
+
"@intlayer/config": "9.4.3",
|
|
137
|
+
"@intlayer/core": "9.4.3",
|
|
138
|
+
"@intlayer/dictionaries-entry": "9.4.3",
|
|
139
|
+
"@intlayer/editor": "9.4.3",
|
|
140
|
+
"@intlayer/types": "9.4.3"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@craco/types": "7.1.0",
|
|
144
|
-
"@testing-library/react": "16.3.
|
|
145
|
-
"@types/node": "26.
|
|
144
|
+
"@testing-library/react": "16.3.3",
|
|
145
|
+
"@types/node": "26.4.1",
|
|
146
146
|
"@types/react": ">=16.0.0",
|
|
147
147
|
"@types/react-dom": ">=16.0.0",
|
|
148
148
|
"@utils/ts-config": "1.0.4",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"react-dom": ">=16.0.0"
|
|
159
159
|
},
|
|
160
160
|
"optionalDependencies": {
|
|
161
|
-
"@intlayer/analytics": "9.4.
|
|
161
|
+
"@intlayer/analytics": "9.4.3"
|
|
162
162
|
},
|
|
163
163
|
"engines": {
|
|
164
164
|
"node": ">=14.18"
|