preact-intlayer 5.5.11 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/client/index.cjs +3 -0
- package/dist/cjs/client/index.cjs.map +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +38 -0
- package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/client/index.mjs +2 -0
- package/dist/esm/client/index.mjs.map +1 -1
- package/dist/esm/client/useDictionaryAsync.mjs +14 -0
- package/dist/esm/client/useDictionaryAsync.mjs.map +1 -0
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/client/index.d.ts +1 -0
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts +9 -0
- package/dist/types/client/useDictionaryAsync.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<a href="https://www.facebook.com/intlayer" target="blank"><img align="center"
|
|
34
34
|
src="https://img.shields.io/badge/facebook-4267B2.svg?style=for-the-badge&logo=facebook&logoColor=white"
|
|
35
35
|
alt="Intlayer Facebook" height="30"/></a>
|
|
36
|
-
<a href="https://www.instagram.com/
|
|
36
|
+
<a href="https://www.instagram.com/intlayer/" target="blank"><img align="center"
|
|
37
37
|
src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
|
|
38
38
|
alt="Intlayer Instagram" height="30"/></a>
|
|
39
39
|
<a href="https://x.com/Intlayer183096" target="blank"><img align="center"
|
|
@@ -26,6 +26,7 @@ __export(client_exports, {
|
|
|
26
26
|
setLocaleCookie: () => import_useLocaleCookie.setLocaleCookie,
|
|
27
27
|
t: () => import_t.t,
|
|
28
28
|
useDictionary: () => import_useDictionary.useDictionary,
|
|
29
|
+
useDictionaryAsync: () => import_useDictionaryAsync.useDictionaryAsync,
|
|
29
30
|
useDictionaryDynamic: () => import_useDictionaryDynamic.useDictionaryDynamic,
|
|
30
31
|
useIntlayer: () => import_useIntlayer.useIntlayer,
|
|
31
32
|
useIntlayerAsync: () => import_useIntlayerAsync.useIntlayerAsync,
|
|
@@ -40,6 +41,7 @@ var import_getBrowserLocale = require('./getBrowserLocale.cjs');
|
|
|
40
41
|
var import_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
41
42
|
var import_t = require('./t.cjs');
|
|
42
43
|
var import_useDictionary = require('./useDictionary.cjs');
|
|
44
|
+
var import_useDictionaryAsync = require('./useDictionaryAsync.cjs');
|
|
43
45
|
var import_useDictionaryDynamic = require('./useDictionaryDynamic.cjs');
|
|
44
46
|
var import_useIntlayer = require('./useIntlayer.cjs');
|
|
45
47
|
var import_useIntlayerAsync = require('./useIntlayerAsync.cjs');
|
|
@@ -57,6 +59,7 @@ var import_useLocaleCookie = require('./useLocaleCookie.cjs');
|
|
|
57
59
|
setLocaleCookie,
|
|
58
60
|
t,
|
|
59
61
|
useDictionary,
|
|
62
|
+
useDictionaryAsync,
|
|
60
63
|
useDictionaryDynamic,
|
|
61
64
|
useIntlayer,
|
|
62
65
|
useIntlayerAsync,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client/index.ts"],"sourcesContent":["export { getBrowserLocale } from './getBrowserLocale';\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n useIntlayerContext,\n type IntlayerProviderProps,\n} from './IntlayerProvider';\nexport { t } from './t';\nexport { useDictionary } from './useDictionary';\nexport { useDictionaryDynamic } from './useDictionaryDynamic';\nexport { useIntlayer } from './useIntlayer';\nexport { useIntlayerAsync } from './useIntlayerAsync';\nexport { useLoadDynamic } from './useLoadDynamic';\nexport { useLocale } from './useLocale';\nexport { useLocaleBase } from './useLocaleBase';\nexport {\n localeCookie,\n setLocaleCookie,\n useLocaleCookie,\n} from './useLocaleCookie';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAiC;AACjC,8BAMO;AACP,eAAkB;AAClB,2BAA8B;AAC9B,kCAAqC;AACrC,yBAA4B;AAC5B,8BAAiC;AACjC,4BAA+B;AAC/B,uBAA0B;AAC1B,2BAA8B;AAC9B,6BAIO;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/client/index.ts"],"sourcesContent":["export { getBrowserLocale } from './getBrowserLocale';\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n useIntlayerContext,\n type IntlayerProviderProps,\n} from './IntlayerProvider';\nexport { t } from './t';\nexport { useDictionary } from './useDictionary';\nexport { useDictionaryAsync } from './useDictionaryAsync';\nexport { useDictionaryDynamic } from './useDictionaryDynamic';\nexport { useIntlayer } from './useIntlayer';\nexport { useIntlayerAsync } from './useIntlayerAsync';\nexport { useLoadDynamic } from './useLoadDynamic';\nexport { useLocale } from './useLocale';\nexport { useLocaleBase } from './useLocaleBase';\nexport {\n localeCookie,\n setLocaleCookie,\n useLocaleCookie,\n} from './useLocaleCookie';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAiC;AACjC,8BAMO;AACP,eAAkB;AAClB,2BAA8B;AAC9B,gCAAmC;AACnC,kCAAqC;AACrC,yBAA4B;AAC5B,8BAAiC;AACjC,4BAA+B;AAC/B,uBAA0B;AAC1B,2BAA8B;AAC9B,6BAIO;","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var useDictionaryAsync_exports = {};
|
|
21
|
+
__export(useDictionaryAsync_exports, {
|
|
22
|
+
useDictionaryAsync: () => useDictionaryAsync
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useDictionaryAsync_exports);
|
|
25
|
+
var import_hooks = require("preact/hooks");
|
|
26
|
+
var import_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
27
|
+
var import_useDictionary = require('./useDictionary.cjs');
|
|
28
|
+
const useDictionaryAsync = async (dictionaryPromise, locale) => {
|
|
29
|
+
const { locale: currentLocale } = (0, import_hooks.useContext)(import_IntlayerProvider.IntlayerClientContext);
|
|
30
|
+
const localeTarget = locale ?? currentLocale;
|
|
31
|
+
const dictionary = await dictionaryPromise[localeTarget]();
|
|
32
|
+
return (0, import_useDictionary.useDictionary)(dictionary, localeTarget);
|
|
33
|
+
};
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
useDictionaryAsync
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=useDictionaryAsync.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport type { LocalesValues } from '@intlayer/config/client';\nimport type { Dictionary, LanguageContent } from '@intlayer/core';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: LanguageContent<() => Promise<T>>,\n locale?: LocalesValues\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n const localeTarget = locale ?? currentLocale;\n\n const dictionary = await dictionaryPromise[localeTarget]!();\n\n return useDictionary(dictionary, localeTarget);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAA2B;AAC3B,8BAAsC;AACtC,2BAA8B;AAOvB,MAAM,qBAAqB,OAChC,mBACA,WACG;AACH,QAAM,EAAE,QAAQ,cAAc,QAAI,yBAAW,6CAAqB;AAClE,QAAM,eAAe,UAAU;AAE/B,QAAM,aAAa,MAAM,kBAAkB,YAAY,EAAG;AAE1D,aAAO,oCAAc,YAAY,YAAY;AAC/C;","names":[]}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
setLocaleCookie: () => import_client.setLocaleCookie,
|
|
28
28
|
t: () => import_client.t,
|
|
29
29
|
useDictionary: () => import_client.useDictionary,
|
|
30
|
+
useDictionaryAsync: () => import_client.useDictionaryAsync,
|
|
30
31
|
useDictionaryDynamic: () => import_client.useDictionaryDynamic,
|
|
31
32
|
useIntlayer: () => import_client.useIntlayer,
|
|
32
33
|
useIntlayerAsync: () => import_client.useIntlayerAsync,
|
|
@@ -50,6 +51,7 @@ var import_markdown = require('./markdown/index.cjs');
|
|
|
50
51
|
setLocaleCookie,
|
|
51
52
|
t,
|
|
52
53
|
useDictionary,
|
|
54
|
+
useDictionaryAsync,
|
|
53
55
|
useDictionaryDynamic,
|
|
54
56
|
useIntlayer,
|
|
55
57
|
useIntlayerAsync,
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { IInterpreterPluginPreact } from './plugins';\n\ndeclare module '@intlayer/core' {\n interface IInterpreterPlugin<T, S> extends IInterpreterPluginPreact<T> {}\n}\n\nexport {\n getBrowserLocale,\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n localeCookie,\n setLocaleCookie,\n t,\n useDictionary,\n useDictionaryDynamic,\n useIntlayer,\n useIntlayerAsync,\n useIntlayerContext,\n useLoadDynamic,\n useLocale,\n useLocaleBase,\n useLocaleCookie,\n type IntlayerProviderProps,\n} from './client/index';\nexport { type IntlayerNode } from './IntlayerNode';\nexport { MarkdownProvider } from './markdown/index';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { IInterpreterPluginPreact } from './plugins';\n\ndeclare module '@intlayer/core' {\n interface IInterpreterPlugin<T, S> extends IInterpreterPluginPreact<T> {}\n}\n\nexport {\n getBrowserLocale,\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n localeCookie,\n setLocaleCookie,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useIntlayer,\n useIntlayerAsync,\n useIntlayerContext,\n useLoadDynamic,\n useLocale,\n useLocaleBase,\n useLocaleCookie,\n type IntlayerProviderProps,\n} from './client/index';\nexport { type IntlayerNode } from './IntlayerNode';\nexport { MarkdownProvider } from './markdown/index';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAmBO;AAEP,sBAAiC;","names":[]}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from "./IntlayerProvider.mjs";
|
|
8
8
|
import { t } from "./t.mjs";
|
|
9
9
|
import { useDictionary } from "./useDictionary.mjs";
|
|
10
|
+
import { useDictionaryAsync } from "./useDictionaryAsync.mjs";
|
|
10
11
|
import { useDictionaryDynamic } from "./useDictionaryDynamic.mjs";
|
|
11
12
|
import { useIntlayer } from "./useIntlayer.mjs";
|
|
12
13
|
import { useIntlayerAsync } from "./useIntlayerAsync.mjs";
|
|
@@ -27,6 +28,7 @@ export {
|
|
|
27
28
|
setLocaleCookie,
|
|
28
29
|
t,
|
|
29
30
|
useDictionary,
|
|
31
|
+
useDictionaryAsync,
|
|
30
32
|
useDictionaryDynamic,
|
|
31
33
|
useIntlayer,
|
|
32
34
|
useIntlayerAsync,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client/index.ts"],"sourcesContent":["export { getBrowserLocale } from './getBrowserLocale';\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n useIntlayerContext,\n type IntlayerProviderProps,\n} from './IntlayerProvider';\nexport { t } from './t';\nexport { useDictionary } from './useDictionary';\nexport { useDictionaryDynamic } from './useDictionaryDynamic';\nexport { useIntlayer } from './useIntlayer';\nexport { useIntlayerAsync } from './useIntlayerAsync';\nexport { useLoadDynamic } from './useLoadDynamic';\nexport { useLocale } from './useLocale';\nexport { useLocaleBase } from './useLocaleBase';\nexport {\n localeCookie,\n setLocaleCookie,\n useLocaleCookie,\n} from './useLocaleCookie';\n"],"mappings":"AAAA,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,SAAS;AAClB,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/client/index.ts"],"sourcesContent":["export { getBrowserLocale } from './getBrowserLocale';\nexport {\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n useIntlayerContext,\n type IntlayerProviderProps,\n} from './IntlayerProvider';\nexport { t } from './t';\nexport { useDictionary } from './useDictionary';\nexport { useDictionaryAsync } from './useDictionaryAsync';\nexport { useDictionaryDynamic } from './useDictionaryDynamic';\nexport { useIntlayer } from './useIntlayer';\nexport { useIntlayerAsync } from './useIntlayerAsync';\nexport { useLoadDynamic } from './useLoadDynamic';\nexport { useLocale } from './useLocale';\nexport { useLocaleBase } from './useLocaleBase';\nexport {\n localeCookie,\n setLocaleCookie,\n useLocaleCookie,\n} from './useLocaleCookie';\n"],"mappings":"AAAA,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,SAAS;AAClB,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useContext } from "preact/hooks";
|
|
3
|
+
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
|
+
import { useDictionary } from "./useDictionary.mjs";
|
|
5
|
+
const useDictionaryAsync = async (dictionaryPromise, locale) => {
|
|
6
|
+
const { locale: currentLocale } = useContext(IntlayerClientContext);
|
|
7
|
+
const localeTarget = locale ?? currentLocale;
|
|
8
|
+
const dictionary = await dictionaryPromise[localeTarget]();
|
|
9
|
+
return useDictionary(dictionary, localeTarget);
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
useDictionaryAsync
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useDictionaryAsync.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport type { LocalesValues } from '@intlayer/config/client';\nimport type { Dictionary, LanguageContent } from '@intlayer/core';\nimport { useContext } from 'preact/hooks';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: LanguageContent<() => Promise<T>>,\n locale?: LocalesValues\n) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext);\n const localeTarget = locale ?? currentLocale;\n\n const dictionary = await dictionaryPromise[localeTarget]!();\n\n return useDictionary(dictionary, localeTarget);\n};\n"],"mappings":";AAIA,SAAS,kBAAkB;AAC3B,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAOvB,MAAM,qBAAqB,OAChC,mBACA,WACG;AACH,QAAM,EAAE,QAAQ,cAAc,IAAI,WAAW,qBAAqB;AAClE,QAAM,eAAe,UAAU;AAE/B,QAAM,aAAa,MAAM,kBAAkB,YAAY,EAAG;AAE1D,SAAO,cAAc,YAAY,YAAY;AAC/C;","names":[]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
setLocaleCookie,
|
|
8
8
|
t,
|
|
9
9
|
useDictionary,
|
|
10
|
+
useDictionaryAsync,
|
|
10
11
|
useDictionaryDynamic,
|
|
11
12
|
useIntlayer,
|
|
12
13
|
useIntlayerAsync,
|
|
@@ -27,6 +28,7 @@ export {
|
|
|
27
28
|
setLocaleCookie,
|
|
28
29
|
t,
|
|
29
30
|
useDictionary,
|
|
31
|
+
useDictionaryAsync,
|
|
30
32
|
useDictionaryDynamic,
|
|
31
33
|
useIntlayer,
|
|
32
34
|
useIntlayerAsync,
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { IInterpreterPluginPreact } from './plugins';\n\ndeclare module '@intlayer/core' {\n interface IInterpreterPlugin<T, S> extends IInterpreterPluginPreact<T> {}\n}\n\nexport {\n getBrowserLocale,\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n localeCookie,\n setLocaleCookie,\n t,\n useDictionary,\n useDictionaryDynamic,\n useIntlayer,\n useIntlayerAsync,\n useIntlayerContext,\n useLoadDynamic,\n useLocale,\n useLocaleBase,\n useLocaleCookie,\n type IntlayerProviderProps,\n} from './client/index';\nexport { type IntlayerNode } from './IntlayerNode';\nexport { MarkdownProvider } from './markdown/index';\n"],"mappings":"AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,wBAAwB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { IInterpreterPluginPreact } from './plugins';\n\ndeclare module '@intlayer/core' {\n interface IInterpreterPlugin<T, S> extends IInterpreterPluginPreact<T> {}\n}\n\nexport {\n getBrowserLocale,\n IntlayerClientContext,\n IntlayerProvider,\n IntlayerProviderContent,\n localeCookie,\n setLocaleCookie,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useIntlayer,\n useIntlayerAsync,\n useIntlayerContext,\n useLoadDynamic,\n useLocale,\n useLocaleBase,\n useLocaleCookie,\n type IntlayerProviderProps,\n} from './client/index';\nexport { type IntlayerNode } from './IntlayerNode';\nexport { MarkdownProvider } from './markdown/index';\n"],"mappings":"AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,wBAAwB;","names":[]}
|
|
@@ -2,6 +2,7 @@ export { getBrowserLocale } from './getBrowserLocale';
|
|
|
2
2
|
export { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext, type IntlayerProviderProps, } from './IntlayerProvider';
|
|
3
3
|
export { t } from './t';
|
|
4
4
|
export { useDictionary } from './useDictionary';
|
|
5
|
+
export { useDictionaryAsync } from './useDictionaryAsync';
|
|
5
6
|
export { useDictionaryDynamic } from './useDictionaryDynamic';
|
|
6
7
|
export { useIntlayer } from './useIntlayer';
|
|
7
8
|
export { useIntlayerAsync } from './useIntlayerAsync';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LocalesValues } from '@intlayer/config/client';
|
|
2
|
+
import type { Dictionary, LanguageContent } from '@intlayer/core';
|
|
3
|
+
/**
|
|
4
|
+
* On the server side, Hook that transform a dictionary and return the content
|
|
5
|
+
*
|
|
6
|
+
* If the locale is not provided, it will use the locale from the client context
|
|
7
|
+
*/
|
|
8
|
+
export declare const useDictionaryAsync: <T extends Dictionary>(dictionaryPromise: LanguageContent<() => Promise<T>>, locale?: LocalesValues) => Promise<any>;
|
|
9
|
+
//# sourceMappingURL=useDictionaryAsync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDictionaryAsync.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryAsync.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKlE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAU,CAAC,SAAS,UAAU,EAC3D,mBAAmB,eAAe,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,SAAS,aAAa,iBAQvB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare module '@intlayer/core' {
|
|
|
3
3
|
interface IInterpreterPlugin<T, S> extends IInterpreterPluginPreact<T> {
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
-
export { getBrowserLocale, IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, localeCookie, setLocaleCookie, t, useDictionary, useDictionaryDynamic, useIntlayer, useIntlayerAsync, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, type IntlayerProviderProps, } from './client/index';
|
|
6
|
+
export { getBrowserLocale, IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, localeCookie, setLocaleCookie, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useIntlayer, useIntlayerAsync, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, type IntlayerProviderProps, } from './client/index';
|
|
7
7
|
export { type IntlayerNode } from './IntlayerNode';
|
|
8
8
|
export { MarkdownProvider } from './markdown/index';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,wBAAwB,CAAC,CAAC,CAAC;KAAG;CAC1E;AAED,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,CAAC,EACD,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,wBAAwB,CAAC,CAAC,CAAC;KAAG;CAC1E;AAED,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,CAAC,EACD,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "preact-intlayer",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Preact applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"js-cookie": "^3.0.5",
|
|
60
60
|
"uuid": "^11.1.0",
|
|
61
|
-
"@intlayer/
|
|
62
|
-
"@intlayer/
|
|
63
|
-
"@intlayer/core": "5.
|
|
64
|
-
"@intlayer/editor": "5.
|
|
65
|
-
"@intlayer/
|
|
61
|
+
"@intlayer/chokidar": "5.7.0",
|
|
62
|
+
"@intlayer/config": "5.7.0",
|
|
63
|
+
"@intlayer/core": "5.7.0",
|
|
64
|
+
"@intlayer/editor": "5.7.0",
|
|
65
|
+
"@intlayer/api": "5.7.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/node": "^22.15.30",
|
|
@@ -76,18 +76,18 @@
|
|
|
76
76
|
"tsup": "^8.5.0",
|
|
77
77
|
"typescript": "^5.8.3",
|
|
78
78
|
"vitest": "^3.2.2",
|
|
79
|
-
"@utils/eslint-config": "1.0.4",
|
|
80
79
|
"@utils/ts-config": "1.0.4",
|
|
81
80
|
"@utils/ts-config-types": "1.0.4",
|
|
82
|
-
"@utils/tsup-config": "1.0.4"
|
|
81
|
+
"@utils/tsup-config": "1.0.4",
|
|
82
|
+
"@utils/eslint-config": "1.0.4"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"preact": "^10.26.4",
|
|
86
|
-
"@intlayer/
|
|
87
|
-
"@intlayer/
|
|
88
|
-
"@intlayer/config": "5.
|
|
89
|
-
"@intlayer/
|
|
90
|
-
"@intlayer/
|
|
86
|
+
"@intlayer/api": "5.7.0",
|
|
87
|
+
"@intlayer/chokidar": "5.7.0",
|
|
88
|
+
"@intlayer/config": "5.7.0",
|
|
89
|
+
"@intlayer/core": "5.7.0",
|
|
90
|
+
"@intlayer/editor": "5.7.0"
|
|
91
91
|
},
|
|
92
92
|
"engines": {
|
|
93
93
|
"node": ">=14.18"
|