react-intlayer 3.5.4 → 3.5.5
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 +4 -4
- package/dist/cjs/cli/react-intlayer.cjs +4 -4
- package/dist/cjs/cli/react-intlayer.cjs.map +1 -1
- package/dist/cjs/client/index.cjs +3 -0
- package/dist/cjs/client/index.cjs.map +1 -1
- package/dist/cjs/client/useIntlayerAsync.cjs +55 -0
- package/dist/cjs/client/useIntlayerAsync.cjs.map +1 -0
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs +59 -0
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs.map +1 -0
- package/dist/cjs/editor/ContentSelectorWrapper.cjs.map +1 -1
- package/dist/cjs/editor/IntlayerEditorProvider.cjs +5 -1
- package/dist/cjs/editor/IntlayerEditorProvider.cjs.map +1 -1
- package/dist/cjs/editor/renderContentEditor.cjs.map +1 -1
- package/dist/cjs/getDictionary.cjs +1 -1
- package/dist/cjs/getDictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayer.cjs.map +1 -1
- package/dist/cjs/getIntlayerAsync.cjs +42 -0
- package/dist/cjs/getIntlayerAsync.cjs.map +1 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/processDictionary/contentDictionary.cjs.map +1 -1
- package/dist/cjs/processDictionary/index.cjs +13 -13
- package/dist/cjs/processDictionary/index.cjs.map +1 -1
- package/dist/cjs/utils/PoweredByMeta/index.cjs +40 -0
- package/dist/cjs/utils/PoweredByMeta/index.cjs.map +1 -0
- package/dist/esm/cli/react-intlayer.mjs +5 -5
- package/dist/esm/cli/react-intlayer.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/useIntlayerAsync.mjs +34 -0
- package/dist/esm/client/useIntlayerAsync.mjs.map +1 -0
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +36 -0
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs.map +1 -0
- package/dist/esm/editor/ContentSelectorWrapper.mjs.map +1 -1
- package/dist/esm/editor/IntlayerEditorProvider.mjs +6 -2
- package/dist/esm/editor/IntlayerEditorProvider.mjs.map +1 -1
- package/dist/esm/editor/renderContentEditor.mjs.map +1 -1
- package/dist/esm/getDictionary.mjs +1 -1
- package/dist/esm/getDictionary.mjs.map +1 -1
- package/dist/esm/getIntlayer.mjs.map +1 -1
- package/dist/esm/getIntlayerAsync.mjs +19 -0
- package/dist/esm/getIntlayerAsync.mjs.map +1 -0
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/processDictionary/index.mjs +13 -13
- package/dist/esm/processDictionary/index.mjs.map +1 -1
- package/dist/esm/utils/PoweredByMeta/index.mjs +17 -0
- package/dist/esm/utils/PoweredByMeta/index.mjs.map +1 -0
- package/dist/types/client/index.d.ts +1 -0
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/client/useIntlayerAsync.d.ts +15 -0
- package/dist/types/client/useIntlayerAsync.d.ts.map +1 -0
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts +6 -0
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts.map +1 -0
- package/dist/types/editor/ContentSelectorWrapper.d.ts +1 -1
- package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -1
- package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -1
- package/dist/types/editor/renderContentEditor.d.ts +1 -1
- package/dist/types/editor/renderContentEditor.d.ts.map +1 -1
- package/dist/types/getIntlayer.d.ts +1 -2
- package/dist/types/getIntlayer.d.ts.map +1 -1
- package/dist/types/getIntlayerAsync.d.ts +13 -0
- package/dist/types/getIntlayerAsync.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/processDictionary/contentDictionary.d.ts +1 -1
- package/dist/types/processDictionary/contentDictionary.d.ts.map +1 -1
- package/dist/types/processDictionary/index.d.ts +2 -2
- package/dist/types/processDictionary/index.d.ts.map +1 -1
- package/dist/types/utils/PoweredByMeta/index.d.ts +3 -0
- package/dist/types/utils/PoweredByMeta/index.d.ts.map +1 -0
- package/package.json +15 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIntlayer.d.ts","sourceRoot":"","sources":["../../src/getIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAQhD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,iBAAiB,CAAC;AAGzB;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,CACzC,MAAM,gCAAgC,CACvC,CAAC;AAEF;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"getIntlayer.d.ts","sourceRoot":"","sources":["../../src/getIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAQhD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,iBAAiB,CAAC;AAGzB;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,CACzC,MAAM,gCAAgC,CACvC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAC/B,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,OAAO,GAAG,KAAK,IACvB,oBAAoB,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,CACxB,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,OAAO,GAAG,KAAK,EAEzB,GAAG,EAAE,CAAC,EACN,MAAM,CAAC,EAAE,CAAC,EACV,cAAc,CAAC,EAAE,CAAC,KACf,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,CAChC,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,OAAO,GAAG,IAAI,EAExB,GAAG,EAAE,CAAC,EACN,MAAM,CAAC,EAAE,CAAC,EACV,cAAc,CAAC,EAAE,CAAC,KACf,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAEpC,eAAO,MAAM,WAAW,EAAE,WA2BzB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Locales } from '@intlayer/config/client';
|
|
2
|
+
import { DictionaryKeys, DataFromDictionaryKey } from './getIntlayer';
|
|
3
|
+
export type GetIntlayerAsync = <T extends DictionaryKeys, L extends Locales, R extends boolean = true>(key: T, locale?: L, isRenderEditor?: R) => Promise<DataFromDictionaryKey<T, L, R> | null>;
|
|
4
|
+
/**
|
|
5
|
+
* On the client side, Hook that picking one dictionary by its key and return the content
|
|
6
|
+
*
|
|
7
|
+
* This hook will prerender the locale dictionary and fetch simultaneously the distant dictionaries to hydrate it.
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* If the locale is not provided, it will use the locale from the client context
|
|
11
|
+
*/
|
|
12
|
+
export declare const getIntlayerAsync: GetIntlayerAsync;
|
|
13
|
+
//# sourceMappingURL=getIntlayerAsync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getIntlayerAsync.d.ts","sourceRoot":"","sources":["../../src/getIntlayerAsync.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAIvD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtE,MAAM,MAAM,gBAAgB,GAAG,CAC7B,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,OAAO,GAAG,IAAI,EAExB,GAAG,EAAE,CAAC,EACN,MAAM,CAAC,EAAE,CAAC,EACV,cAAc,CAAC,EAAE,CAAC,KACf,OAAO,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAoB9B,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { getTranslation } from './getTranslation';
|
|
2
|
-
export { IntlayerProvider, type IntlayerProviderProps, IntlayerClientContext, useIntlayer, useDictionary, useLocale, useTraduction, useLocaleCookie, useIntlayerContext, localeCookie, setLocaleCookie, getBrowserLocale, useLocaleBase, t, } from './client/index';
|
|
2
|
+
export { IntlayerProvider, type IntlayerProviderProps, IntlayerClientContext, useIntlayer, useIntlayerAsync, useDictionary, useLocale, useTraduction, useLocaleCookie, useIntlayerContext, localeCookie, setLocaleCookie, getBrowserLocale, useLocaleBase, t, } from './client/index';
|
|
3
3
|
export { getDictionary } from './getDictionary';
|
|
4
4
|
export { getIntlayer } from './getIntlayer';
|
|
5
5
|
export { type IntlayerNode } from './editor/renderContentEditor';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,SAAS,EACT,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,CAAC,GACF,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,CAAC,GACF,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -4,7 +4,7 @@ export type TransformedContentValue = string | ReactNode | {
|
|
|
4
4
|
[key: string]: TransformedContentValue;
|
|
5
5
|
} | undefined | ((quantity: number) => TransformedContentValue);
|
|
6
6
|
export type TransformedContentObject = {
|
|
7
|
-
|
|
7
|
+
dictionaryKey: string;
|
|
8
8
|
dictionaryPath: string;
|
|
9
9
|
keyPath: KeyPath[];
|
|
10
10
|
locale: Locales;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentDictionary.d.ts","sourceRoot":"","sources":["../../../src/processDictionary/contentDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,SAAS,GACT;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC;CACxC,GACD,SAAS,GACT,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,uBAAuB,CAAC,CAAC;AAEpD,MAAM,MAAM,wBAAwB,GAAG;IACrC,
|
|
1
|
+
{"version":3,"file":"contentDictionary.d.ts","sourceRoot":"","sources":["../../../src/processDictionary/contentDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,SAAS,GACT;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC;CACxC,GACD,SAAS,GACT,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,uBAAuB,CAAC,CAAC;AAEpD,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,uBAAuB,GAAG,uBAAuB,EAAE,GAAG,SAAS,CAAC;CAC1E,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,MAAM,CACJ,MAAM,EACJ,uBAAuB,GACvB,uBAAuB,EAAE,GACzB,wBAAwB,GACxB,SAAS,CACZ,GACD,SAAS,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Locales } from '@intlayer/config/client';
|
|
2
2
|
import { type KeyPath, type DictionaryValue } from '@intlayer/core';
|
|
3
3
|
import type { TransformedContent, TransformedContentValue } from './contentDictionary';
|
|
4
|
-
export declare const processNode: (field: DictionaryValue | undefined, locale: Locales,
|
|
4
|
+
export declare const processNode: (field: DictionaryValue | undefined, locale: Locales, dictionaryKey: string, dictionaryPath?: string, keyPath?: KeyPath[]) => TransformedContentValue;
|
|
5
5
|
/**
|
|
6
6
|
* Function that process a dictionary and return the result to be used in the application.
|
|
7
7
|
*/
|
|
8
|
-
export declare const processDictionary: (content: DictionaryValue,
|
|
8
|
+
export declare const processDictionary: (content: DictionaryValue, dictionaryKey: string, dictionaryPath?: string, keyPath?: KeyPath[], locale?: Locales) => TransformedContent;
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/processDictionary/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,eAAe,EAIrB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAoE7B,eAAO,MAAM,WAAW,UACf,eAAe,GAAG,SAAS,UAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/processDictionary/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,eAAe,EAIrB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAoE7B,eAAO,MAAM,WAAW,UACf,eAAe,GAAG,SAAS,UAC1B,OAAO,iBACA,MAAM,mBACJ,MAAM,YACd,OAAO,EAAE,KACjB,uBAyCF,CAAC;AAyCF;;GAEG;AACH,eAAO,MAAM,iBAAiB,YACnB,eAAe,iBACT,MAAM,mBACJ,MAAM,YACd,OAAO,EAAE,WACV,OAAO,KACd,kBA0EF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/PoweredByMeta/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAa,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,aAAa,EAAE,EAW3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intlayer",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Internationalization layer for React applications. Declare your multilingual contant in the same lever than your component. Powered by TypeScript, declaration files.",
|
|
6
6
|
"keywords": [
|
|
@@ -86,16 +86,17 @@
|
|
|
86
86
|
],
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@craco/craco": "^7.1.0",
|
|
89
|
+
"@intlayer/design-system": "^3.5.4",
|
|
89
90
|
"cross-spawn": "^7.0.6",
|
|
90
91
|
"js-cookie": "^3.0.5",
|
|
91
92
|
"react-cookie": "^7.2.2",
|
|
92
93
|
"vite": "^6.0.3",
|
|
93
94
|
"webpack": "^5.96.1",
|
|
94
|
-
"@intlayer/chokidar": "^3.5.
|
|
95
|
-
"@intlayer/
|
|
96
|
-
"@intlayer/dictionaries-entry": "^3.5.
|
|
97
|
-
"@intlayer/webpack": "^3.5.
|
|
98
|
-
"@intlayer/
|
|
95
|
+
"@intlayer/chokidar": "^3.5.5",
|
|
96
|
+
"@intlayer/config": "^3.5.5",
|
|
97
|
+
"@intlayer/dictionaries-entry": "^3.5.5",
|
|
98
|
+
"@intlayer/webpack": "^3.5.5",
|
|
99
|
+
"@intlayer/core": "^3.5.5"
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
102
|
"@craco/types": "^7.1.0",
|
|
@@ -114,20 +115,20 @@
|
|
|
114
115
|
"tsup": "^8.3.5",
|
|
115
116
|
"typescript": "^5.7.2",
|
|
116
117
|
"@utils/eslint-config": "^1.0.4",
|
|
117
|
-
"@utils/tsup-config": "^1.0.4",
|
|
118
118
|
"@utils/ts-config": "^1.0.4",
|
|
119
|
-
"@utils/ts-config-types": "^1.0.4"
|
|
119
|
+
"@utils/ts-config-types": "^1.0.4",
|
|
120
|
+
"@utils/tsup-config": "^1.0.4"
|
|
120
121
|
},
|
|
121
122
|
"peerDependencies": {
|
|
122
123
|
"react": ">=16.0.0 <19.0.0",
|
|
123
124
|
"react-dom": ">=16.0.0 <19.0.0",
|
|
124
125
|
"vite": ">=4.0.0",
|
|
125
|
-
"@intlayer/
|
|
126
|
-
"@intlayer/
|
|
127
|
-
"@intlayer/core": "^3.5.
|
|
128
|
-
"intlayer": "^3.5.
|
|
129
|
-
"
|
|
130
|
-
"@intlayer/dictionaries-entry": "^3.5.
|
|
126
|
+
"@intlayer/config": "^3.5.5",
|
|
127
|
+
"@intlayer/chokidar": "^3.5.5",
|
|
128
|
+
"@intlayer/core": "^3.5.5",
|
|
129
|
+
"@intlayer/webpack": "^3.5.5",
|
|
130
|
+
"intlayer": "^3.5.5",
|
|
131
|
+
"@intlayer/dictionaries-entry": "^3.5.5"
|
|
131
132
|
},
|
|
132
133
|
"engines": {
|
|
133
134
|
"node": ">=14.18"
|