react-intlayer 5.0.1 → 5.0.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/dist/cjs/client/IntlayerProvider.cjs +13 -9
- package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
- package/dist/cjs/client/index.cjs +2 -0
- package/dist/cjs/client/index.cjs.map +1 -1
- package/dist/cjs/client/useDictionary.cjs +4 -1
- package/dist/cjs/client/useDictionary.cjs.map +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -4
- package/dist/cjs/client/useIntlayer.cjs.map +1 -1
- package/dist/cjs/client/useIntlayerAsync.cjs.map +1 -1
- package/dist/cjs/client/useLocale.cjs.map +1 -1
- package/dist/cjs/client/useLocaleCookie.cjs.map +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +4 -2
- package/dist/cjs/editor/ContentSelectorWrapper.cjs.map +1 -1
- package/dist/cjs/getDictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayer.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/plugins.cjs +2 -35
- package/dist/cjs/plugins.cjs.map +1 -1
- package/dist/cjs/reactElement/renderReactElement.cjs +62 -0
- package/dist/cjs/reactElement/renderReactElement.cjs.map +1 -0
- package/dist/cjs/server/IntlayerServerProvider.cjs.map +1 -1
- package/dist/cjs/server/t.cjs +1 -3
- package/dist/cjs/server/t.cjs.map +1 -1
- package/dist/cjs/server/useDictionary.cjs +1 -1
- package/dist/cjs/server/useDictionary.cjs.map +1 -1
- package/dist/cjs/server/useIntlayer.cjs +1 -1
- package/dist/cjs/server/useIntlayer.cjs.map +1 -1
- package/dist/esm/client/IntlayerProvider.mjs +12 -9
- package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
- package/dist/esm/client/index.mjs +2 -0
- package/dist/esm/client/index.mjs.map +1 -1
- package/dist/esm/client/useDictionary.mjs +4 -1
- package/dist/esm/client/useDictionary.mjs.map +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -4
- package/dist/esm/client/useIntlayer.mjs.map +1 -1
- package/dist/esm/client/useIntlayerAsync.mjs.map +1 -1
- package/dist/esm/client/useLocale.mjs.map +1 -1
- package/dist/esm/client/useLocaleCookie.mjs.map +1 -1
- package/dist/esm/editor/ContentSelectorWrapper.mjs +4 -2
- package/dist/esm/editor/ContentSelectorWrapper.mjs.map +1 -1
- package/dist/esm/getDictionary.mjs.map +1 -1
- package/dist/esm/getIntlayer.mjs.map +1 -1
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/plugins.mjs +2 -35
- package/dist/esm/plugins.mjs.map +1 -1
- package/dist/esm/reactElement/renderReactElement.mjs +38 -0
- package/dist/esm/reactElement/renderReactElement.mjs.map +1 -0
- package/dist/esm/server/IntlayerServerProvider.mjs.map +1 -1
- package/dist/esm/server/t.mjs +1 -3
- package/dist/esm/server/t.mjs.map +1 -1
- package/dist/esm/server/useDictionary.mjs +1 -1
- package/dist/esm/server/useDictionary.mjs.map +1 -1
- package/dist/esm/server/useIntlayer.mjs +1 -1
- package/dist/esm/server/useIntlayer.mjs.map +1 -1
- package/dist/types/client/IntlayerProvider.d.ts +12 -6
- package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +1 -1
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/client/useContent.d.ts +1 -1
- package/dist/types/client/useDictionary.d.ts +3 -3
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useIntlayer.d.ts +3 -2
- package/dist/types/client/useIntlayer.d.ts.map +1 -1
- package/dist/types/client/useIntlayerAsync.d.ts +2 -2
- package/dist/types/client/useIntlayerAsync.d.ts.map +1 -1
- package/dist/types/client/useLocale.d.ts +7 -7
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/useLocaleBase.d.ts +2 -2
- package/dist/types/client/useLocaleCookie.d.ts +5 -5
- package/dist/types/client/useLocaleCookie.d.ts.map +1 -1
- package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -1
- package/dist/types/getDictionary.d.ts +2 -2
- package/dist/types/getDictionary.d.ts.map +1 -1
- package/dist/types/getIntlayer.d.ts +2 -2
- package/dist/types/getIntlayer.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +8 -8
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/reactElement/renderReactElement.d.ts +3 -0
- package/dist/types/reactElement/renderReactElement.d.ts.map +1 -0
- package/dist/types/server/IntlayerServerProvider.d.ts +8 -8
- package/dist/types/server/IntlayerServerProvider.d.ts.map +1 -1
- package/dist/types/server/t.d.ts +2 -2
- package/dist/types/server/t.d.ts.map +1 -1
- package/dist/types/server/useDictionary.d.ts +2 -2
- package/dist/types/server/useDictionary.d.ts.map +1 -1
- package/dist/types/server/useIntlayer.d.ts +2 -2
- package/dist/types/server/useIntlayer.d.ts.map +1 -1
- package/package.json +15 -15
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LocalesValues } from '@intlayer/config/client';
|
|
2
2
|
type useLocaleProps = {
|
|
3
|
-
onLocaleChange?: (locale:
|
|
3
|
+
onLocaleChange?: (locale: LocalesValues) => void;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* On the client side, hook to get the current locale and all related fields
|
|
7
7
|
*/
|
|
8
8
|
export declare const useLocale: ({ onLocaleChange }?: useLocaleProps) => {
|
|
9
|
-
locale:
|
|
10
|
-
defaultLocale: Locales;
|
|
11
|
-
availableLocales: Locales[];
|
|
12
|
-
localeList: Locales[];
|
|
13
|
-
setLocale: (locale:
|
|
9
|
+
locale: LocalesValues;
|
|
10
|
+
defaultLocale: import("intlayer").Locales;
|
|
11
|
+
availableLocales: import("intlayer").Locales[];
|
|
12
|
+
localeList: import("intlayer").Locales[];
|
|
13
|
+
setLocale: (locale: LocalesValues) => void;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=useLocale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../../src/client/useLocale.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../../src/client/useLocale.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,yBAAyB,CAAC;AAM/E,KAAK,cAAc,GAAG;IACpB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,wBAAwB,cAAc;;;;;wBAsB/C,aAAa;CA0BzB,CAAC"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* On the client side, hook to get the current locale and all related fields
|
|
3
3
|
*/
|
|
4
4
|
export declare const useLocaleBase: () => {
|
|
5
|
-
locale:
|
|
5
|
+
locale: import("intlayer").LocalesValues;
|
|
6
6
|
defaultLocale: import("intlayer").Locales;
|
|
7
7
|
availableLocales: import("intlayer").Locales[];
|
|
8
8
|
localeList: import("intlayer").Locales[];
|
|
9
|
-
setLocale: (newLocale: import("intlayer").
|
|
9
|
+
setLocale: (newLocale: import("intlayer").LocalesValues) => void;
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=useLocaleBase.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LocalesValues } from '@intlayer/config/client';
|
|
2
2
|
/**
|
|
3
3
|
* Get the locale cookie
|
|
4
4
|
*/
|
|
5
|
-
export declare const localeCookie:
|
|
5
|
+
export declare const localeCookie: LocalesValues | undefined;
|
|
6
6
|
/**
|
|
7
7
|
* Set the locale cookie
|
|
8
8
|
*/
|
|
9
|
-
export declare const setLocaleCookie: (locale:
|
|
9
|
+
export declare const setLocaleCookie: (locale: LocalesValues) => void;
|
|
10
10
|
/**
|
|
11
11
|
* Hook that provides the locale cookie and a function to set it
|
|
12
12
|
*/
|
|
13
13
|
export declare const useLocaleCookie: () => {
|
|
14
|
-
localeCookie:
|
|
15
|
-
setLocaleCookie: (locale:
|
|
14
|
+
localeCookie: LocalesValues;
|
|
15
|
+
setLocaleCookie: (locale: LocalesValues) => void;
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=useLocaleCookie.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleCookie.d.ts","sourceRoot":"","sources":["../../../src/client/useLocaleCookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"useLocaleCookie.d.ts","sourceRoot":"","sources":["../../../src/client/useLocaleCookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,yBAAyB,CAAC;AAa/E;;GAEG;AACH,eAAO,MAAM,YAAY,EACrB,aAAa,GACb,SAAS,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,eAAe,WAAY,aAAa,SAEpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;8BAPY,aAAa;CAUnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelectorWrapper.d.ts","sourceRoot":"","sources":["../../../src/editor/ContentSelectorWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAM/D,OAAO,EAKL,KAAK,EAAE,EAEP,cAAc,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentSelectorWrapper.d.ts","sourceRoot":"","sources":["../../../src/editor/ContentSelectorWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAM/D,OAAO,EAKL,KAAK,EAAE,EAEP,cAAc,EACf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,2BAA2B,GAAG,SAAS,GACjD,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,CAAC;AAqDlD,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAgBlE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Dictionary, type Plugins } from '@intlayer/core';
|
|
2
2
|
import { type DeepTransformContent } from './plugins';
|
|
3
|
-
import type { Locales } from '@intlayer/config/client';
|
|
4
|
-
export declare const getDictionary: <T extends Dictionary, L extends
|
|
3
|
+
import type { Locales, LocalesValues } from '@intlayer/config/client';
|
|
4
|
+
export declare const getDictionary: <T extends Dictionary, L extends LocalesValues = Locales>(dictionary: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<T["content"]>;
|
|
5
5
|
//# sourceMappingURL=getDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDictionary.d.ts","sourceRoot":"","sources":["../../src/getDictionary.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,OAAO,EAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"getDictionary.d.ts","sourceRoot":"","sources":["../../src/getDictionary.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,OAAO,EAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEtE,eAAO,MAAM,aAAa,GACxB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,aAAa,wBAEX,CAAC,WACJ,CAAC,sBACU,OAAO,EAAE,KAajB,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAC9C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DictionaryKeys, type Plugins } from '@intlayer/core';
|
|
2
2
|
import { type DeepTransformContent } from './plugins';
|
|
3
|
-
import type { IntlayerDictionaryTypesConnector,
|
|
4
|
-
export declare const getIntlayer: <T extends DictionaryKeys, L extends
|
|
3
|
+
import type { IntlayerDictionaryTypesConnector, LocalesValues } from 'intlayer';
|
|
4
|
+
export declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues>(key: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]>;
|
|
5
5
|
//# sourceMappingURL=getIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIntlayer.d.ts","sourceRoot":"","sources":["../../src/getIntlayer.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,OAAO,EAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,gCAAgC,EAAE,
|
|
1
|
+
{"version":3,"file":"getIntlayer.d.ts","sourceRoot":"","sources":["../../src/getIntlayer.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,OAAO,EAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,gCAAgC,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhF,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,aAAa,OACtE,CAAC,WACG,CAAC,sBACU,OAAO,EAAE,KAS0B,oBAAoB,CACzE,gCAAgC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAEjD,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IInterpreterPluginReact } from './plugins';
|
|
2
2
|
declare module '@intlayer/core' {
|
|
3
|
-
interface IInterpreterPlugin<T, S> extends IInterpreterPluginReact<T
|
|
3
|
+
interface IInterpreterPlugin<T, S> extends IInterpreterPluginReact<T> {
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
-
export { IntlayerProvider, type IntlayerProviderProps, IntlayerClientContext, useIntlayer, useIntlayerAsync, useDictionary, useLocale, useLocaleCookie, useIntlayerContext, localeCookie, setLocaleCookie, getBrowserLocale, useLocaleBase, t, } from './client/index';
|
|
6
|
+
export { IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, IntlayerClientContext, useIntlayer, useIntlayerAsync, useDictionary, useLocale, useLocaleCookie, useIntlayerContext, localeCookie, setLocaleCookie, getBrowserLocale, useLocaleBase, t, } 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,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,uBAAuB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,uBAAuB,CAAC,CAAC,CAAC;KAAG;CACzE;AAED,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,CAAC,GACF,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type Plugins, type IInterpreterPluginState as IInterpreterPluginStateCore, type DeepTransformContent as DeepTransformContentCore, NodeType } from '@intlayer/core';
|
|
2
|
-
import {
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
3
|
import type { IntlayerNode } from './IntlayerNode';
|
|
4
4
|
/** ---------------------------------------------
|
|
5
5
|
* INTLAYER NODE PLUGIN
|
|
6
6
|
* --------------------------------------------- */
|
|
7
|
-
export type IntlayerNodeCond<T
|
|
7
|
+
export type IntlayerNodeCond<T> = T extends number | string ? IntlayerNode<T> : never;
|
|
8
8
|
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
9
9
|
export declare const intlayerNodePlugins: Plugins;
|
|
10
10
|
/** ---------------------------------------------
|
|
11
11
|
* REACT NODE PLUGIN
|
|
12
12
|
* --------------------------------------------- */
|
|
13
|
-
export type ReactNodeCond<T
|
|
13
|
+
export type ReactNodeCond<T> = T extends {
|
|
14
14
|
ref: any;
|
|
15
15
|
props: any;
|
|
16
16
|
key: any;
|
|
@@ -20,7 +20,7 @@ export declare const reactNodePlugins: Plugins;
|
|
|
20
20
|
/**
|
|
21
21
|
* MARKDOWN PLUGIN
|
|
22
22
|
*/
|
|
23
|
-
export type MarkdownCond<T
|
|
23
|
+
export type MarkdownCond<T> = T extends {
|
|
24
24
|
nodeType: NodeType | string;
|
|
25
25
|
[NodeType.Markdown]: string;
|
|
26
26
|
} ? IntlayerNode<string> : never;
|
|
@@ -29,10 +29,10 @@ export declare const markdownPlugin: Plugins;
|
|
|
29
29
|
/** ---------------------------------------------
|
|
30
30
|
* PLUGINS RESULT
|
|
31
31
|
* --------------------------------------------- */
|
|
32
|
-
export interface IInterpreterPluginReact<T
|
|
33
|
-
reactNode: ReactNodeCond<T
|
|
34
|
-
intlayerNode: IntlayerNodeCond<T
|
|
35
|
-
markdown: MarkdownCond<T
|
|
32
|
+
export interface IInterpreterPluginReact<T> {
|
|
33
|
+
reactNode: ReactNodeCond<T>;
|
|
34
|
+
intlayerNode: IntlayerNodeCond<T>;
|
|
35
|
+
markdown: MarkdownCond<T>;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,KAAK,oBAAoB,IAAI,wBAAwB,EAErD,QAAQ,EACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD;;oDAEoD;AAEpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,MAAM,GACvD,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC;AAEV,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,EAAE,OAYjC,CAAC;AAEF;;oDAEoD;AAEpD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS;IACvC,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,GAAG,CAAC;IACX,GAAG,EAAE,GAAG,CAAC;CACV,GACG,SAAS,GACT,KAAK,CAAC;AAEV,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,EAAE,OAQ9B,CAAC;AAEF;;GAEG;AAEH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS;IACtC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC7B,GACG,YAAY,CAAC,MAAM,CAAC,GACpB,KAAK,CAAC;AAEV,oFAAoF;AACpF,eAAO,MAAM,cAAc,EAAE,OAI5B,CAAC;AAEF;;oDAEoD;AAEpD,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAClC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,GAAG;IAClE,SAAS,EAAE,IAAI,CAAC;IAChB,YAAY,EAAE,IAAI,CAAC;IACnB,QAAQ,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,wBAAwB,CAC5D,CAAC,EACD,uBAAuB,CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderReactElement.d.ts","sourceRoot":"","sources":["../../../src/reactElement/renderReactElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAiC,MAAM,OAAO,CAAC;AAGzE,eAAO,MAAM,kBAAkB,YAAa,YAAY,2EA4CvD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LocalesValues } from '@intlayer/config/client';
|
|
2
2
|
import type { FC, PropsWithChildren } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Context that store the current locale on the server side
|
|
@@ -6,26 +6,26 @@ import type { FC, PropsWithChildren } from 'react';
|
|
|
6
6
|
export declare const IntlayerServerContext: {
|
|
7
7
|
Provider: ({ children, value, }: {
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
-
value:
|
|
9
|
+
value: LocalesValues;
|
|
10
10
|
}) => React.ReactNode;
|
|
11
11
|
Consumer: ({ children, }: {
|
|
12
|
-
children: (context:
|
|
12
|
+
children: (context: LocalesValues) => React.ReactNode;
|
|
13
13
|
}) => React.ReactNode;
|
|
14
14
|
_storage: () => {
|
|
15
|
-
value:
|
|
15
|
+
value: LocalesValues;
|
|
16
16
|
};
|
|
17
|
-
_defaultValue:
|
|
17
|
+
_defaultValue: LocalesValues;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* Hook that provides the current locale
|
|
21
21
|
*/
|
|
22
|
-
export declare const useIntlayer: () =>
|
|
22
|
+
export declare const useIntlayer: () => LocalesValues;
|
|
23
23
|
/**
|
|
24
24
|
* Get the current locale
|
|
25
25
|
*/
|
|
26
|
-
export declare const locale:
|
|
26
|
+
export declare const locale: LocalesValues;
|
|
27
27
|
export type IntlayerServerProviderProps = PropsWithChildren & {
|
|
28
|
-
locale?:
|
|
28
|
+
locale?: LocalesValues;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Provider that store the current locale on the server side
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerServerProvider.d.ts","sourceRoot":"","sources":["../../../src/server/IntlayerServerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"IntlayerServerProvider.d.ts","sourceRoot":"","sources":["../../../src/server/IntlayerServerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKnD;;GAEG;AACH,eAAO,MAAM,qBAAqB;;kBA4B0b,MAAO,SAAS;;UAAuB,MAAO,SAAS;;8CAA+E,MAAO,SAAS;UAAS,MAAO,SAAS;;;;;CA3BxlB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,WAAW,qBAAgD,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,MAAM,eAA0C,CAAC;AAE9D,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,GAAG;IAC5D,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAOlE,CAAC"}
|
package/dist/types/server/t.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalesValues } from '@intlayer/config/client';
|
|
2
2
|
import { type LanguageContent } from '@intlayer/core';
|
|
3
3
|
/**
|
|
4
4
|
* On the server side, hook to get the translation content based on the locale
|
|
@@ -21,5 +21,5 @@ import { type LanguageContent } from '@intlayer/core';
|
|
|
21
21
|
* - this function will require each locale to be defined if defined in the project configuration.
|
|
22
22
|
* - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
|
|
23
23
|
*/
|
|
24
|
-
export declare const t: <Content = string>(multilangContent: LanguageContent<Content>, locale?:
|
|
24
|
+
export declare const t: <Content = string>(multilangContent: LanguageContent<Content>, locale?: LocalesValues) => Content;
|
|
25
25
|
//# sourceMappingURL=t.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"t.d.ts","sourceRoot":"","sources":["../../../src/server/t.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"t.d.ts","sourceRoot":"","sources":["../../../src/server/t.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,CAAC,GAAI,OAAO,6BACL,eAAe,CAAC,OAAO,CAAC,WACjC,aAAa,YAMvB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalesValues } from '@intlayer/config/client';
|
|
2
2
|
import { type Dictionary } from '@intlayer/core';
|
|
3
3
|
/**
|
|
4
4
|
* On the server side, Hook that transform a dictionary and return the content
|
|
5
5
|
*
|
|
6
6
|
* If the locale is not provided, it will use the locale from the server context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?:
|
|
8
|
+
export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => import("@intlayer/core").DeepTransformContent<T["content"], import("../plugins").IInterpreterPluginState>;
|
|
9
9
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../../src/server/useDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../../src/server/useDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKjD;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,UAAU,cACpC,CAAC,WACJ,aAAa,8GAMvB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalesValues } from '@intlayer/config/client';
|
|
2
2
|
import { type DictionaryKeys } from '@intlayer/core';
|
|
3
3
|
/**
|
|
4
4
|
* On the server side, Hook that picking one dictionary by its key and return the content
|
|
5
5
|
*
|
|
6
6
|
* If the locale is not provided, it will use the locale from the server context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useIntlayer: <T extends DictionaryKeys, K extends
|
|
8
|
+
export declare const useIntlayer: <T extends DictionaryKeys, K extends LocalesValues>(key: T, locale?: K) => import("@intlayer/core").DeepTransformContent<import("intlayer").IntlayerDictionaryTypesConnector[T]["content"], import("../plugins").IInterpreterPluginState>;
|
|
9
9
|
//# sourceMappingURL=useIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayer.d.ts","sourceRoot":"","sources":["../../../src/server/useIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useIntlayer.d.ts","sourceRoot":"","sources":["../../../src/server/useIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,aAAa,OACtE,CAAC,WACG,CAAC,mKAMX,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intlayer",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your React applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
],
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"js-cookie": "^3.0.5",
|
|
71
|
-
"@intlayer/api": "5.0.
|
|
72
|
-
"@intlayer/config": "5.0.
|
|
73
|
-
"@intlayer/
|
|
74
|
-
"@intlayer/core": "5.0.
|
|
75
|
-
"@intlayer/
|
|
71
|
+
"@intlayer/api": "5.0.3",
|
|
72
|
+
"@intlayer/config": "5.0.3",
|
|
73
|
+
"@intlayer/dictionaries-entry": "5.0.3",
|
|
74
|
+
"@intlayer/core": "5.0.3",
|
|
75
|
+
"@intlayer/editor-react": "5.0.3"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@craco/types": "^7.1.0",
|
|
@@ -87,21 +87,21 @@
|
|
|
87
87
|
"tsc-alias": "^1.8.10",
|
|
88
88
|
"tsup": "^8.3.5",
|
|
89
89
|
"typescript": "^5.7.3",
|
|
90
|
-
"@intlayer/backend": "5.0.1",
|
|
91
|
-
"@utils/ts-config": "1.0.4",
|
|
92
90
|
"@utils/eslint-config": "1.0.4",
|
|
91
|
+
"@utils/ts-config": "1.0.4",
|
|
92
|
+
"@utils/ts-config-types": "1.0.4",
|
|
93
93
|
"@utils/tsup-config": "1.0.4",
|
|
94
|
-
"@
|
|
94
|
+
"@intlayer/backend": "5.0.3"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"react": ">=16.0.0",
|
|
98
98
|
"react-dom": ">=16.0.0",
|
|
99
|
-
"@intlayer/api": "5.0.
|
|
100
|
-
"@intlayer/config": "5.0.
|
|
101
|
-
"@intlayer/core": "5.0.
|
|
102
|
-
"@intlayer/
|
|
103
|
-
"@intlayer/
|
|
104
|
-
"intlayer": "5.0.
|
|
99
|
+
"@intlayer/api": "5.0.3",
|
|
100
|
+
"@intlayer/config": "5.0.3",
|
|
101
|
+
"@intlayer/core": "5.0.3",
|
|
102
|
+
"@intlayer/editor-react": "5.0.3",
|
|
103
|
+
"@intlayer/dictionaries-entry": "5.0.3",
|
|
104
|
+
"intlayer": "5.0.3"
|
|
105
105
|
},
|
|
106
106
|
"engines": {
|
|
107
107
|
"node": ">=14.18"
|