preact-intlayer 8.10.1 → 8.11.0-canary.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.
@@ -1,4 +1,3 @@
1
- import { LocalesValues as LocalesValues$1 } from "../intlayer/dist/types/index.js";
2
1
  import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
3
2
 
4
3
  //#region src/client/useContent.d.ts
@@ -6,7 +5,7 @@ import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
6
5
  * On the client side, hook to get the translation content based on the locale
7
6
  */
8
7
  declare const useContent: <Content>(languageContent: StrictModeLocaleMap<Content>) => {
9
- locale: LocalesValues$1;
8
+ locale: import("@intlayer/types").LocalesValues;
10
9
  content: Content;
11
10
  t: <Content_1 = string>(languageContent: StrictModeLocaleMap<Content_1>) => Content_1;
12
11
  };
@@ -1 +1 @@
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
+ {"version":3,"file":"useContent.d.ts","names":[],"sources":["../../../src/client/useContent.ts"],"mappings":";;;;;AAOA;cAAa,UAAA,YACX,eAAA,EAAiB,mBAAA,CAAoB,OAAA"}
@@ -1,5 +1,4 @@
1
1
  import { IInterpreterPluginState } from "../plugins.js";
2
- import { Locale } from "../intlayer/dist/types/index.js";
3
2
  import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
4
3
  import { Dictionary } from "@intlayer/types/dictionary";
5
4
 
@@ -9,7 +8,7 @@ import { Dictionary } from "@intlayer/types/dictionary";
9
8
  *
10
9
  * If the locale is not provided, it will use the locale from the client context
11
10
  */
12
- declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => import("@intlayer/core/interpreter").DeepTransformContent<T["content"], IInterpreterPluginState, Locale>;
11
+ declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => import("@intlayer/core/interpreter").DeepTransformContent<T["content"], IInterpreterPluginState, import("@intlayer/types").Locale>;
13
12
  //#endregion
14
13
  export { useDictionary };
15
14
  //# sourceMappingURL=useDictionary.d.ts.map
@@ -1 +1 @@
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
+ {"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,4BAAA,MAAA"}
@@ -1,5 +1,4 @@
1
1
  import { IInterpreterPluginState } from "../plugins.js";
2
- import { Locale } from "../intlayer/dist/types/index.js";
3
2
  import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
4
3
  import { Dictionary } from "@intlayer/types/dictionary";
5
4
 
@@ -9,7 +8,7 @@ import { Dictionary } from "@intlayer/types/dictionary";
9
8
  *
10
9
  * If the locale is not provided, it will use the locale from the client context
11
10
  */
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>;
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, import("@intlayer/types").Locale>;
13
12
  //#endregion
14
13
  export { useDictionaryDynamic };
15
14
  //# sourceMappingURL=useDictionaryDynamic.d.ts.map
@@ -1 +1 @@
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
+ {"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,4BAAA,MAAA"}
@@ -1,14 +1,12 @@
1
- import { Locale, LocalesValues } from "../intlayer/dist/types/index.js";
2
-
3
1
  //#region src/client/useLocaleBase.d.ts
4
2
  /**
5
3
  * On the client side, hook to get the current locale and all related fields
6
4
  */
7
5
  declare const useLocaleBase: () => {
8
- locale: LocalesValues;
9
- defaultLocale: Locale;
10
- availableLocales: Locale[];
11
- setLocale: (newLocale: LocalesValues) => void;
6
+ locale: import("@intlayer/types").LocalesValues;
7
+ defaultLocale: import("@intlayer/types").Locale;
8
+ availableLocales: import("@intlayer/types").Locale[];
9
+ setLocale: (newLocale: import("@intlayer/types").LocalesValues) => void;
12
10
  };
13
11
  //#endregion
14
12
  export { useLocaleBase };
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"mappings":";;;;;;cASa,aAAA;UASZ,aAAA"}
1
+ {"version":3,"file":"useLocaleBase.d.ts","names":[],"sources":["../../../src/client/useLocaleBase.ts"],"mappings":";;AASA;;cAAa,aAAA"}
@@ -1,17 +1,16 @@
1
- import { Locale } from "../intlayer/dist/types/index.js";
2
1
  import { LocalesValues } from "@intlayer/types/module_augmentation";
3
2
 
4
3
  //#region src/client/useLocaleStorage.d.ts
5
4
  /**
6
5
  * Get the locale cookie
7
6
  */
8
- declare const localeInStorage: Locale;
7
+ declare const localeInStorage: import("@intlayer/types").Locale;
9
8
  /**
10
9
  * @deprecated Use localeInStorage instead
11
10
  *
12
11
  * Get the locale cookie
13
12
  */
14
- declare const localeCookie: Locale;
13
+ declare const localeCookie: import("@intlayer/types").Locale;
15
14
  /**
16
15
  * Set the locale cookie
17
16
  */
@@ -26,7 +25,7 @@ declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: boolean)
26
25
  * Hook that provides the locale storage and a function to set it
27
26
  */
28
27
  declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
29
- getLocale: () => Locale;
28
+ getLocale: () => import("@intlayer/types").Locale;
30
29
  setLocale: (locale: LocalesValues) => void;
31
30
  };
32
31
  /**
@@ -37,7 +36,7 @@ declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
37
36
  * Hook that provides the locale cookie and a function to set it
38
37
  */
39
38
  declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
40
- getLocale: () => Locale;
39
+ getLocale: () => import("@intlayer/types").Locale;
41
40
  setLocale: (locale: LocalesValues) => void;
42
41
  };
43
42
  //#endregion
@@ -1 +1 @@
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
+ {"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"mappings":";;;;;AAYA;cAAa,eAAA,4BAAe,MAAmD;;;AAAA;AAM/E;;cAAa,YAAA,4BAAY,MAAkB;;AAAA;AAK3C;cAAa,kBAAA,GACX,MAAA,EAAQ,aAAa,EACrB,eAAA;;;;;;cAYW,eAAA,GAAe,MAAA,EAblB,aAAa,EAAA,eAAA;AACG;AAY1B;;AAZ0B,cAiBb,gBAAA,GAAoB,eAAA;;sBAQ9B,aAAA;AAAA;;;AAzBuB;AAiB1B;;;;cAiBa,eAAA,GAAe,eAAA;;sBAAmB,aAAA;AAAA"}
@@ -1,5 +1,3 @@
1
- import { LocalesValues } from "../intlayer/dist/types/index.js";
2
-
3
1
  //#region src/format/useCompact.d.ts
4
2
  /**
5
3
  * React client hook that provides a compact number formatter
@@ -12,7 +10,7 @@ import { LocalesValues } from "../intlayer/dist/types/index.js";
12
10
  * ```
13
11
  */
14
12
  declare const useCompact: () => (value: string | number, options?: Intl.NumberFormatOptions & {
15
- locale?: LocalesValues;
13
+ locale?: import("@intlayer/types").LocalesValues;
16
14
  }) => string;
17
15
  //#endregion
18
16
  export { useCompact };
@@ -1 +1 @@
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
+ {"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":";;AAcA;;;;;;;;;cAAa,UAAA,SAAU,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA"}
@@ -1,5 +1,3 @@
1
- import { LocalesValues } from "../intlayer/dist/types/index.js";
2
-
3
1
  //#region src/format/useCurrency.d.ts
4
2
  /**
5
3
  * React client hook that provides a currency formatter
@@ -26,7 +24,7 @@ import { LocalesValues } from "../intlayer/dist/types/index.js";
26
24
  * ```
27
25
  */
28
26
  declare const useCurrency: () => (value: string | number, options?: Intl.NumberFormatOptions & {
29
- locale?: LocalesValues;
27
+ locale?: import("@intlayer/types").LocalesValues;
30
28
  }) => string;
31
29
  //#endregion
32
30
  export { useCurrency };
@@ -1 +1 @@
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
+ {"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../src/format/useCurrency.ts"],"mappings":";;AA4BA;;;;;;;;;;;;;;;;;;;;;;;cAAa,WAAA,SAAW,KAAA,mBAAA,OAAA,GAAA,IAAA,CAAA,mBAAA"}
@@ -1,5 +1,3 @@
1
- import { LocalesValues } from "../intlayer/dist/types/index.js";
2
-
3
1
  //#region src/format/useList.d.ts
4
2
  /**
5
3
  * React client hook that provides a list formatter
@@ -27,7 +25,7 @@ declare const useList: () => (values: (string | number)[], options?: {
27
25
  type?: "conjunction" | "disjunction" | "unit";
28
26
  style?: "long" | "short" | "narrow";
29
27
  } & {
30
- locale?: LocalesValues;
28
+ locale?: import("@intlayer/types").LocalesValues;
31
29
  }) => string;
32
30
  //#endregion
33
31
  export { useList };
@@ -1 +1 @@
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
+ {"version":3,"file":"useList.d.ts","names":[],"sources":["../../../src/format/useList.ts"],"mappings":";;AAyBA;;;;;;;;;;;;;;;;;;;;cAAa,OAAA,SAAO,MAAA,uBAAA,OAAA"}
@@ -1,5 +1,3 @@
1
- import { LocalesValues } from "../intlayer/dist/types/index.js";
2
-
3
1
  //#region src/format/useNumber.d.ts
4
2
  /**
5
3
  * React client hook that provides a localized number formatter.
@@ -24,7 +22,7 @@ import { LocalesValues } from "../intlayer/dist/types/index.js";
24
22
  * A number formatting function bound to the active locale.
25
23
  */
26
24
  declare const useNumber: () => (value: string | number, args_1?: Intl.NumberFormatOptions & {
27
- locale?: LocalesValues;
25
+ locale?: import("@intlayer/types").LocalesValues;
28
26
  }) => string;
29
27
  //#endregion
30
28
  export { useNumber };
@@ -1 +1 @@
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
+ {"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../src/format/useNumber.ts"],"mappings":";;AA0BA;;;;;;;;;;;;;;;;;;;;;cAAa,SAAA,SAAS,KAAA,mBAAA,MAAA,GAAA,IAAA,CAAA,mBAAA"}
@@ -1,5 +1,3 @@
1
- import { LocalesValues } from "../intlayer/dist/types/index.js";
2
-
3
1
  //#region src/format/usePercentage.d.ts
4
2
  /**
5
3
  * React hook to provide a percentage formatter function
@@ -20,7 +18,7 @@ import { LocalesValues } from "../intlayer/dist/types/index.js";
20
18
  * A function that formats numbers or numeric strings into localized percentages.
21
19
  */
22
20
  declare const usePercentage: () => (value: string | number, args_1?: Intl.NumberFormatOptions & {
23
- locale?: LocalesValues;
21
+ locale?: import("@intlayer/types").LocalesValues;
24
22
  }) => string;
25
23
  //#endregion
26
24
  export { usePercentage };
@@ -1 +1 @@
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
+ {"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../src/format/usePercentage.ts"],"mappings":";;AAsBA;;;;;;;;;;;;;;;;;cAAa,aAAA,SAAa,KAAA,mBAAA,MAAA,GAAA,IAAA,CAAA,mBAAA"}
@@ -1,5 +1,3 @@
1
- import { LocalesValues } from "../intlayer/dist/types/index.js";
2
-
3
1
  //#region src/format/useRelativeTime.d.ts
4
2
  /**
5
3
  * Client-side React hook for accessing a localized relative time formatter.
@@ -20,7 +18,7 @@ import { LocalesValues } from "../intlayer/dist/types/index.js";
20
18
  * bound to the current client locale.
21
19
  */
22
20
  declare const useRelativeTime: () => (from: string | number | Date, to?: string | number | Date, options?: Intl.RelativeTimeFormatOptions & {
23
- locale?: LocalesValues;
21
+ locale?: import("@intlayer/types").LocalesValues;
24
22
  unit?: Intl.RelativeTimeFormatUnit;
25
23
  }) => string;
26
24
  //#endregion
@@ -1 +1 @@
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
+ {"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"}
@@ -1,5 +1,3 @@
1
- import { LocalesValues } from "../intlayer/dist/types/index.js";
2
-
3
1
  //#region src/format/useUnit.d.ts
4
2
  /**
5
3
  * React hook that provides a unit formatting function
@@ -19,7 +17,7 @@ import { LocalesValues } from "../intlayer/dist/types/index.js";
19
17
  * @returns {Function} A unit formatting function that accepts a value and optional formatting options.
20
18
  */
21
19
  declare const useUnit: () => (value: string | number, options?: Intl.NumberFormatOptions & {
22
- locale?: LocalesValues;
20
+ locale?: import("@intlayer/types").LocalesValues;
23
21
  }) => string;
24
22
  //#endregion
25
23
  export { useUnit };
@@ -1 +1 @@
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"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "preact-intlayer",
3
- "version": "8.10.1",
3
+ "version": "8.11.0-canary.0",
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.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"
103
+ "@intlayer/api": "8.11.0-canary.0",
104
+ "@intlayer/chokidar": "8.11.0-canary.0",
105
+ "@intlayer/config": "8.11.0-canary.0",
106
+ "@intlayer/core": "8.11.0-canary.0",
107
+ "@intlayer/editor": "8.11.0-canary.0",
108
+ "@intlayer/types": "8.11.0-canary.0"
109
109
  },
110
110
  "devDependencies": {
111
111
  "@types/node": "25.9.1",
@@ -1,4 +0,0 @@
1
- import { LocalesValues as LocalesValues$1 } from "@intlayer/types/module_augmentation";
2
- import { Locale as Locale$1 } from "@intlayer/types/allLocales";
3
- import { Dictionary } from "@intlayer/types/dictionary";
4
- export type { Locale$1 as Locale, LocalesValues$1 as LocalesValues };