preact-intlayer 8.10.0-canary.1 → 8.10.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.
- package/dist/types/client/useContent.d.ts +2 -1
- package/dist/types/client/useContent.d.ts.map +1 -1
- package/dist/types/client/useDictionary.d.ts +2 -1
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +2 -1
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/client/useLocaleBase.d.ts +6 -4
- package/dist/types/client/useLocaleBase.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +5 -4
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/format/useCompact.d.ts +3 -1
- package/dist/types/format/useCompact.d.ts.map +1 -1
- package/dist/types/format/useCurrency.d.ts +3 -1
- package/dist/types/format/useCurrency.d.ts.map +1 -1
- package/dist/types/format/useList.d.ts +3 -1
- package/dist/types/format/useList.d.ts.map +1 -1
- package/dist/types/format/useNumber.d.ts +3 -1
- package/dist/types/format/useNumber.d.ts.map +1 -1
- package/dist/types/format/usePercentage.d.ts +3 -1
- package/dist/types/format/usePercentage.d.ts.map +1 -1
- package/dist/types/format/useRelativeTime.d.ts +3 -1
- package/dist/types/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/format/useUnit.d.ts +3 -1
- package/dist/types/format/useUnit.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalesValues as LocalesValues$1 } from "../intlayer/dist/types/index.js";
|
|
1
2
|
import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
2
3
|
|
|
3
4
|
//#region src/client/useContent.d.ts
|
|
@@ -5,7 +6,7 @@ import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
|
5
6
|
* On the client side, hook to get the translation content based on the locale
|
|
6
7
|
*/
|
|
7
8
|
declare const useContent: <Content>(languageContent: StrictModeLocaleMap<Content>) => {
|
|
8
|
-
locale:
|
|
9
|
+
locale: LocalesValues$1;
|
|
9
10
|
content: Content;
|
|
10
11
|
t: <Content_1 = string>(languageContent: StrictModeLocaleMap<Content_1>) => Content_1;
|
|
11
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContent.d.ts","names":[],"sources":["../../../src/client/useContent.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useContent.d.ts","names":[],"sources":["../../../src/client/useContent.ts"],"mappings":";;;;;;;cAOa,UAAA,YACX,eAAA,EAAiB,mBAAA,CAAoB,OAAA;UAAD,eAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IInterpreterPluginState } from "../plugins.js";
|
|
2
|
+
import { Locale } from "../intlayer/dist/types/index.js";
|
|
2
3
|
import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
4
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
4
5
|
|
|
@@ -8,7 +9,7 @@ import { Dictionary } from "@intlayer/types/dictionary";
|
|
|
8
9
|
*
|
|
9
10
|
* If the locale is not provided, it will use the locale from the client context
|
|
10
11
|
*/
|
|
11
|
-
declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => import("@intlayer/core/interpreter").DeepTransformContent<T["content"], IInterpreterPluginState,
|
|
12
|
+
declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => import("@intlayer/core/interpreter").DeepTransformContent<T["content"], IInterpreterPluginState, Locale>;
|
|
12
13
|
//#endregion
|
|
13
14
|
export { useDictionary };
|
|
14
15
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"mappings":";;;;;;;;;;AAcA;cAAa,aAAA,aACD,UAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,UAAA,EAAY,CAAA,EACZ,MAAA,GAAS,CAAA,0CAAC,oBAAA,CAAA,CAAA,aAAA,uBAAA,EAAA,MAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IInterpreterPluginState } from "../plugins.js";
|
|
2
|
+
import { Locale } from "../intlayer/dist/types/index.js";
|
|
2
3
|
import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
3
4
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
4
5
|
|
|
@@ -8,7 +9,7 @@ import { Dictionary } from "@intlayer/types/dictionary";
|
|
|
8
9
|
*
|
|
9
10
|
* If the locale is not provided, it will use the locale from the client context
|
|
10
11
|
*/
|
|
11
|
-
declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import("@intlayer/core/interpreter").DeepTransformContent<T["content"], IInterpreterPluginState,
|
|
12
|
+
declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import("@intlayer/core/interpreter").DeepTransformContent<T["content"], IInterpreterPluginState, Locale>;
|
|
12
13
|
//#endregion
|
|
13
14
|
export { useDictionaryDynamic };
|
|
14
15
|
//# sourceMappingURL=useDictionaryDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;;AAgBA;cAAa,oBAAA,aACD,UAAA,YACA,cAAA,EAEV,iBAAA,EAAmB,mBAAA,OAA0B,OAAA,CAAQ,CAAA,IACrD,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,aAAA,0CAAa,oBAAA,CAAA,CAAA,aAAA,uBAAA,EAAA,MAAA"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { Locale, LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
|
+
|
|
1
3
|
//#region src/client/useLocaleBase.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* On the client side, hook to get the current locale and all related fields
|
|
4
6
|
*/
|
|
5
7
|
declare const useLocaleBase: () => {
|
|
6
|
-
locale:
|
|
7
|
-
defaultLocale:
|
|
8
|
-
availableLocales:
|
|
9
|
-
setLocale: (newLocale:
|
|
8
|
+
locale: LocalesValues;
|
|
9
|
+
defaultLocale: Locale;
|
|
10
|
+
availableLocales: Locale[];
|
|
11
|
+
setLocale: (newLocale: LocalesValues) => void;
|
|
10
12
|
};
|
|
11
13
|
//#endregion
|
|
12
14
|
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":";;;;;;cASa,aAAA;UASZ,aAAA"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import { Locale } from "../intlayer/dist/types/index.js";
|
|
1
2
|
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
3
|
|
|
3
4
|
//#region src/client/useLocaleStorage.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Get the locale cookie
|
|
6
7
|
*/
|
|
7
|
-
declare const localeInStorage:
|
|
8
|
+
declare const localeInStorage: Locale;
|
|
8
9
|
/**
|
|
9
10
|
* @deprecated Use localeInStorage instead
|
|
10
11
|
*
|
|
11
12
|
* Get the locale cookie
|
|
12
13
|
*/
|
|
13
|
-
declare const localeCookie:
|
|
14
|
+
declare const localeCookie: Locale;
|
|
14
15
|
/**
|
|
15
16
|
* Set the locale cookie
|
|
16
17
|
*/
|
|
@@ -25,7 +26,7 @@ declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: boolean)
|
|
|
25
26
|
* Hook that provides the locale storage and a function to set it
|
|
26
27
|
*/
|
|
27
28
|
declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
28
|
-
getLocale: () =>
|
|
29
|
+
getLocale: () => Locale;
|
|
29
30
|
setLocale: (locale: LocalesValues) => void;
|
|
30
31
|
};
|
|
31
32
|
/**
|
|
@@ -36,7 +37,7 @@ declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
|
36
37
|
* Hook that provides the locale cookie and a function to set it
|
|
37
38
|
*/
|
|
38
39
|
declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
|
|
39
|
-
getLocale: () =>
|
|
40
|
+
getLocale: () => Locale;
|
|
40
41
|
setLocale: (locale: LocalesValues) => void;
|
|
41
42
|
};
|
|
42
43
|
//#endregion
|
|
@@ -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":";;;;;;;cAYa,eAAA,EAAkE,MAAA;;;;AAAA;AAM/E;cAAa,YAAA,EAA8B,MAAA;;;AAAA;cAK9B,kBAAA,GACX,MAAA,EAAQ,aAAa,EACrB,eAAA;;;;;;cAYW,eAAA,GAAe,MAAA,EAblB,aAAa,EAAA,eAAA;;AACG;AAY1B;cAKa,gBAAA,GAAoB,eAAA;mBAQ9B,MAAA;sBAAA,aAAA;AAAA;;;;AAzBuB;AAiB1B;;;cAiBa,eAAA,GAAe,eAAA;mBAAmB,MAAA;sBAAA,aAAA;AAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
|
+
|
|
1
3
|
//#region src/format/useCompact.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* React client hook that provides a compact number formatter
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
* ```
|
|
11
13
|
*/
|
|
12
14
|
declare const useCompact: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
13
|
-
locale?:
|
|
15
|
+
locale?: LocalesValues;
|
|
14
16
|
}) => string;
|
|
15
17
|
//#endregion
|
|
16
18
|
export { useCompact };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":";;;;;;AAcA;;;;;;;cAAa,UAAA,SAAU,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,aAAA;AAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
|
+
|
|
1
3
|
//#region src/format/useCurrency.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* React client hook that provides a currency formatter
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
* ```
|
|
25
27
|
*/
|
|
26
28
|
declare const useCurrency: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
27
|
-
locale?:
|
|
29
|
+
locale?: LocalesValues;
|
|
28
30
|
}) => string;
|
|
29
31
|
//#endregion
|
|
30
32
|
export { useCurrency };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../src/format/useCurrency.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../src/format/useCurrency.ts"],"mappings":";;;;;;AA4BA;;;;;;;;;;;;;;;;;;;;;cAAa,WAAA,SAAW,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,aAAA;AAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
|
+
|
|
1
3
|
//#region src/format/useList.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* React client hook that provides a list formatter
|
|
@@ -25,7 +27,7 @@ declare const useList: () => (values: (string | number)[], options?: {
|
|
|
25
27
|
type?: "conjunction" | "disjunction" | "unit";
|
|
26
28
|
style?: "long" | "short" | "narrow";
|
|
27
29
|
} & {
|
|
28
|
-
locale?:
|
|
30
|
+
locale?: LocalesValues;
|
|
29
31
|
}) => string;
|
|
30
32
|
//#endregion
|
|
31
33
|
export { useList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useList.d.ts","names":[],"sources":["../../../src/format/useList.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useList.d.ts","names":[],"sources":["../../../src/format/useList.ts"],"mappings":";;;;;;AAyBA;;;;;;;;;;;;;;;;;;cAAa,OAAA,SAAO,MAAA,uBAAA,OAAA;;;;;WAWnB,aAAA;AAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
|
+
|
|
1
3
|
//#region src/format/useNumber.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* React client hook that provides a localized number formatter.
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
* A number formatting function bound to the active locale.
|
|
23
25
|
*/
|
|
24
26
|
declare const useNumber: () => (value: string | number, args_1?: Intl.NumberFormatOptions & {
|
|
25
|
-
locale?:
|
|
27
|
+
locale?: LocalesValues;
|
|
26
28
|
}) => string;
|
|
27
29
|
//#endregion
|
|
28
30
|
export { useNumber };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../src/format/useNumber.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../src/format/useNumber.ts"],"mappings":";;;;;;AA0BA;;;;;;;;;;;;;;;;;;;cAAa,SAAA,SAAS,KAAA,mBAAA,MAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,aAAA;AAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
|
+
|
|
1
3
|
//#region src/format/usePercentage.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* React hook to provide a percentage formatter function
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
* A function that formats numbers or numeric strings into localized percentages.
|
|
19
21
|
*/
|
|
20
22
|
declare const usePercentage: () => (value: string | number, args_1?: Intl.NumberFormatOptions & {
|
|
21
|
-
locale?:
|
|
23
|
+
locale?: LocalesValues;
|
|
22
24
|
}) => string;
|
|
23
25
|
//#endregion
|
|
24
26
|
export { usePercentage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../src/format/usePercentage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../src/format/usePercentage.ts"],"mappings":";;;;;;AAsBA;;;;;;;;;;;;;;;cAAa,aAAA,SAAa,KAAA,mBAAA,MAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,aAAA;AAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
|
+
|
|
1
3
|
//#region src/format/useRelativeTime.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* Client-side React hook for accessing a localized relative time formatter.
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
* bound to the current client locale.
|
|
19
21
|
*/
|
|
20
22
|
declare const useRelativeTime: () => (from: string | number | Date, to?: string | number | Date, options?: Intl.RelativeTimeFormatOptions & {
|
|
21
|
-
locale?:
|
|
23
|
+
locale?: LocalesValues;
|
|
22
24
|
unit?: Intl.RelativeTimeFormatUnit;
|
|
23
25
|
}) => string;
|
|
24
26
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../src/format/useRelativeTime.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../src/format/useRelativeTime.ts"],"mappings":";;;;;;AAsBA;;;;;;;;;;;;;;;cAAa,eAAA,SAAe,IAAA,oBAAA,IAAA,EAAA,EAAA,qBAAA,IAAA,EAAA,OAAA,GAAA,IAAA,CAAA,yBAAA;WAAA,aAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
|
+
|
|
1
3
|
//#region src/format/useUnit.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* React hook that provides a unit formatting function
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
* @returns {Function} A unit formatting function that accepts a value and optional formatting options.
|
|
18
20
|
*/
|
|
19
21
|
declare const useUnit: () => (value: string | number, options?: Intl.NumberFormatOptions & {
|
|
20
|
-
locale?:
|
|
22
|
+
locale?: LocalesValues;
|
|
21
23
|
}) => string;
|
|
22
24
|
//#endregion
|
|
23
25
|
export { useUnit };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../src/format/useUnit.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../src/format/useUnit.ts"],"mappings":";;;;;;AAqBA;;;;;;;;;;;;;;cAAa,OAAA,SAAO,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA;WAAA,aAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "preact-intlayer",
|
|
3
|
-
"version": "8.10.
|
|
3
|
+
"version": "8.10.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Preact applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -100,12 +100,12 @@
|
|
|
100
100
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@intlayer/api": "8.10.
|
|
104
|
-
"@intlayer/chokidar": "8.10.
|
|
105
|
-
"@intlayer/config": "8.10.
|
|
106
|
-
"@intlayer/core": "8.10.
|
|
107
|
-
"@intlayer/editor": "8.10.
|
|
108
|
-
"@intlayer/types": "8.10.
|
|
103
|
+
"@intlayer/api": "8.10.1",
|
|
104
|
+
"@intlayer/chokidar": "8.10.1",
|
|
105
|
+
"@intlayer/config": "8.10.1",
|
|
106
|
+
"@intlayer/core": "8.10.1",
|
|
107
|
+
"@intlayer/editor": "8.10.1",
|
|
108
|
+
"@intlayer/types": "8.10.1"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@types/node": "25.9.1",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"rimraf": "6.1.3",
|
|
116
116
|
"tsdown": "0.22.00",
|
|
117
117
|
"typescript": "6.0.3",
|
|
118
|
-
"vitest": "4.1.
|
|
118
|
+
"vitest": "4.1.7"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
121
|
"preact": ">=8.0.0"
|