react-intlayer 9.5.9 → 9.5.11
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/IntlayerNode.cjs +18 -18
- package/dist/cjs/IntlayerNode.cjs.map +1 -1
- package/dist/cjs/client/IntlayerProvider.cjs +28 -14
- package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs.map +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs.map +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +10 -2
- package/dist/cjs/client/useLocaleStorage.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/plugins.cjs +29 -44
- package/dist/cjs/plugins.cjs.map +1 -1
- package/dist/esm/IntlayerNode.mjs +18 -18
- package/dist/esm/IntlayerNode.mjs.map +1 -1
- package/dist/esm/client/IntlayerProvider.mjs +30 -16
- package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/useDictionary.mjs +1 -1
- package/dist/esm/client/useDictionary.mjs.map +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs.map +1 -1
- package/dist/esm/client/useLocaleStorage.mjs +11 -4
- package/dist/esm/client/useLocaleStorage.mjs.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/plugins.mjs +29 -44
- package/dist/esm/plugins.mjs.map +1 -1
- package/dist/types/IntlayerNode.d.ts +24 -2
- package/dist/types/IntlayerNode.d.ts.map +1 -1
- package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +8 -1
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markdown/index.d.ts +2 -2
- package/dist/types/plugins.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -2,9 +2,19 @@ import { NodeProps } from "@intlayer/core/interpreter";
|
|
|
2
2
|
import { ResolvedEditor } from "@intlayer/types/module_augmentation";
|
|
3
3
|
import { PropsWithChildren, ReactNode } from "react";
|
|
4
4
|
//#region src/IntlayerNode.d.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Content node returned by `useIntlayer`.
|
|
7
|
+
*
|
|
8
|
+
* Without the editor it is typed as its value (`"Hello" & { value: "Hello" }`)
|
|
9
|
+
* so it can go straight into string props (`aria-label={content.title}`).
|
|
10
|
+
* With the editor, it is a React node wrapping the editable selector, so
|
|
11
|
+
* string props must use `.value`.
|
|
12
|
+
*/
|
|
13
|
+
export type IntlayerNode<T = NodeProps['children'], AdditionalProps = unknown> = ResolvedEditor<T & {
|
|
6
14
|
value: T;
|
|
7
|
-
} & AdditionalProps &
|
|
15
|
+
} & AdditionalProps, ReactNode & {
|
|
16
|
+
value: T;
|
|
17
|
+
} & AdditionalProps>;
|
|
8
18
|
type RenderIntlayerNodeProps<T> = PropsWithChildren<{
|
|
9
19
|
value: T;
|
|
10
20
|
children: ReactNode;
|
|
@@ -12,6 +22,18 @@ type RenderIntlayerNodeProps<T> = PropsWithChildren<{
|
|
|
12
22
|
[key: string]: any;
|
|
13
23
|
};
|
|
14
24
|
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Renders content as a React element that also behaves like its value
|
|
27
|
+
* (`node.value`, `${node}`, `node.toUpperCase()`).
|
|
28
|
+
*
|
|
29
|
+
* The node is a copy of the element built on a shared prototype serving the
|
|
30
|
+
* value's members, rather than a Proxy: React reads an element's fields many
|
|
31
|
+
* times while reconciling, and a Proxy trap makes each read several times
|
|
32
|
+
* slower.
|
|
33
|
+
*
|
|
34
|
+
* @param props - The value, the rendered children and extra node members.
|
|
35
|
+
* @returns The renderable node.
|
|
36
|
+
*/
|
|
15
37
|
export declare const renderIntlayerNode: <T>({ children, value, additionalProps }: RenderIntlayerNodeProps<T>) => IntlayerNode<T>;
|
|
16
38
|
//#endregion
|
|
17
39
|
//# sourceMappingURL=IntlayerNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerNode.d.ts","names":[],"sources":["../../src/IntlayerNode.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntlayerNode.d.ts","names":[],"sources":["../../src/IntlayerNode.tsx"],"mappings":";;;;;;;;;;;;YAaY,aACV,IAAI,uBACJ,6BACE,eACF;EAAM,OAAO;IAAM,iBACnB;EAAc,OAAO;IAAM;KAGxB,wBAAwB,KAAK;EAChC,OAAO;EACP,UAAU;EACV;KAAqB;;;;;;;;;;;;;;;qBAeV,qBACX,KAAC,UAAA,OAAA,mBAKA,wBAAwB,OAAK,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerProvider.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IntlayerProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerProvider.tsx"],"mappings":";;;KAuBK;EACH,QAAQ;EACR,YAAY,WAAW;;;;;EAKvB,UAAU;EACV;EACA;;;;;qBAMW,uCAAqB,QAAA;;;;;;qBAcrB;;;;YAKD,wBAAwB;;;;EAIlC,SAAS;;;;;;;;;;;;;;;;;;;EAmBT,UAAU;;;;EAIV,gBAAgB;;;;EAIhB,aAAa,QAAQ;;;;EAIrB;;;;EAIA;;;;;;;;;;qBAWW,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;qBA+F5B,kBAAkB,GAAG"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
2
|
//#region src/client/useLocaleStorage.d.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Reads the locale persisted in the browser storage (cookie, localStorage…).
|
|
5
|
+
*
|
|
6
|
+
* Unlike `localeInStorage`, read on first call rather than at import, then
|
|
7
|
+
* cached until the next `setLocaleInStorage`. Never cached on the server.
|
|
5
8
|
*/
|
|
9
|
+
export declare const getLocaleInStorage: () => import("@intlayer/types").Locale | undefined;
|
|
6
10
|
/**
|
|
7
11
|
* Get the locale cookie
|
|
12
|
+
*
|
|
13
|
+
* Read once at import time; marked pure so bundlers drop the read when nothing
|
|
14
|
+
* imports it.
|
|
8
15
|
*/
|
|
9
16
|
export declare const localeInStorage: import("@intlayer/types").Locale;
|
|
10
17
|
/**
|
|
@@ -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":";;;;;;;;qBAgBa,oDAAkB;;;;;;;qBAQlB,2CAAe;;;;;;qBAOf,wCAAY;;;;qBAKZ,qBAAkB,QACrB,eAAa;;;;;;qBAaV,wBAAe;;;;qBAKf,mBAAgB;;sBAAhB;;;;;;;;;qBAiBA,wBAAe"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { useLoadDynamic } from "./client/useLoadDynamic.js";
|
|
|
16
16
|
import { UseLocaleProps, UseLocaleResult, useLocale } from "./client/useLocale.js";
|
|
17
17
|
import { useLocaleBase } from "./client/useLocaleBase.js";
|
|
18
18
|
import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./client/useLocaleStorage.js";
|
|
19
|
+
import { usePathname } from "./client/usePathname.js";
|
|
19
20
|
import { useRewriteURL } from "./client/useRewriteURL.js";
|
|
20
21
|
import { getDictionary } from "./getDictionary.js";
|
|
21
22
|
import { getIntlayer } from "./getIntlayer.js";
|
|
@@ -60,5 +61,5 @@ export type RenderMarkdownProps = RenderMarkdownProps$1;
|
|
|
60
61
|
*/
|
|
61
62
|
export type MarkdownRendererProps = MarkdownRendererProps$1;
|
|
62
63
|
//#endregion
|
|
63
|
-
export { AnalyticsProvider, type ConversionParams, type ExperimentState, IntlayerClientContext, type IntlayerNode, IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, type UseLocaleProps, type UseLocaleResult, getDictionary, getIntlayer, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useAnalytics, useConversion, useDictionary, useDictionaryAsync, useDictionaryDynamic, useExperiment, useI18n, useIntl, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, useLocaleStorage, useRewriteURL };
|
|
64
|
+
export { AnalyticsProvider, type ConversionParams, type ExperimentState, IntlayerClientContext, type IntlayerNode, IntlayerProvider, IntlayerProviderContent, type IntlayerProviderProps, type UseLocaleProps, type UseLocaleResult, getDictionary, getIntlayer, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useAnalytics, useConversion, useDictionary, useDictionaryAsync, useDictionaryDynamic, useExperiment, useI18n, useIntl, useIntlayer, useIntlayerContext, useLoadDynamic, useLocale, useLocaleBase, useLocaleCookie, useLocaleStorage, usePathname, useRewriteURL };
|
|
64
65
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;YAIY,mBAAmB,GAAG,GAAG,UAAU,uBACnC,wBAAwB,GAAG,GAAG;;;;;qBA4D7B,kCAAgB,GAAhB;;;;qBAIA,2BAAkB;;;;YAInB,0BAA0B;;;;qBAIzB,uBAAc;;;;qBAId,4BAAmB;;;;qBAInB,kCAAgB,GAAA;;;;YAIjB,sBAAsB;;;;YAItB,wBAAwB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MarkdownRendererOptions, ParsedMarkdown, compileMarkdown, parseMarkdown } from "./processor.js";
|
|
2
|
-
import { MarkdownProvider, MarkdownProviderOptions, useMarkdownContext } from "./MarkdownProvider.js";
|
|
2
|
+
import { MarkdownContextValue, MarkdownProvider, MarkdownProviderOptions, MarkdownProviderProps, useMarkdownContext } from "./MarkdownProvider.js";
|
|
3
3
|
import { MarkdownRenderer, MarkdownRendererProps, RenderMarkdownProps, renderMarkdown, useMarkdownRenderer } from "./MarkdownRenderer.js";
|
|
4
|
-
export { MarkdownProvider, type MarkdownProviderOptions, MarkdownRenderer, type MarkdownRendererOptions, type MarkdownRendererProps, type ParsedMarkdown, type RenderMarkdownProps, compileMarkdown, parseMarkdown, renderMarkdown, useMarkdownContext, useMarkdownRenderer };
|
|
4
|
+
export { type MarkdownContextValue, MarkdownProvider, type MarkdownProviderOptions, type MarkdownProviderProps, MarkdownRenderer, type MarkdownRendererOptions, type MarkdownRendererProps, type ParsedMarkdown, type RenderMarkdownProps, compileMarkdown, parseMarkdown, renderMarkdown, useMarkdownContext, useMarkdownRenderer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../src/plugins.tsx"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../src/plugins.tsx"],"mappings":";;;;;;;;;;;YA+DY,iBAAiB,KAAK,4BAC9B,aAAa;;qBAIJ,qBAAqB;;;;YA2CtB,cAAc,KAAK;EAC7B;EACA;IAEE;;qBAIS,kBAAkB;;;;YA8CnB,cAAc,KAAK;EAC7B,UAAU;GACT,UAAU,kBAAkB;EAC7B;KAEG,aAAa,KAAK,sBAAsB,cACvC,QAAQ,MACL,mBACD,QAAQ,6BACN,uBACA,aAAa,aACf,qBAAqB;;qBA4BhB,iBAAiB;;;;YAuFlB,mBAAmB,KAAK,mBAChC;EAGI,UAAU;EACV,MAAM,YAAY,qCAAqC;;;qBAiBlD,sBAAsB;YAqEvB,aAAa,KAAK;EAC5B,UAAU;GACT,UAAU,iBAAiB;EAC5B,aAAa;EACb,iBAAiB;IAEf,aACE;EAEE,MAAM,aAAa,6BAA6B,OAAO;EACvD,UAAU,qBAAqB;;qBAK1B,gBAAgB;;;;;;;;;;;;YAsCjB,eAAe,KAAK;EAC9B,UAAU;GACT,UAAU,aAAa;EACxB,aAAa;IAEX,aACE;EAEE,MAAM,aAAa,6BAA6B,OAAO;;;qBAclD,YAAY;;;;YA6Cb,wBAAwB,GAAG,IAAI,WAAW;EACpD,WAAW,cAAc;EACzB,mBAAmB,iBAAiB;EACpC,gBAAgB,cAAc;EAC9B,eAAe,aAAa;EAC5B,WAAW,eAAe;;;;;;;YAQhB,0BAA0B,KACpC;EAGA;EACA;EACA;EACA;EACA;;YAGU,qBACV,GACA,UAAU,gBAAgB,mBACxB,uBAAyB,GAAG,yBAAyB;;;;;qBAQ5C,aAAU,SACZ,eAAa,uBAErB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intlayer",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your React applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -133,12 +133,12 @@
|
|
|
133
133
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
134
134
|
},
|
|
135
135
|
"dependencies": {
|
|
136
|
-
"@intlayer/api": "9.5.
|
|
137
|
-
"@intlayer/config": "9.5.
|
|
138
|
-
"@intlayer/core": "9.5.
|
|
139
|
-
"@intlayer/dictionaries-entry": "9.5.
|
|
140
|
-
"@intlayer/editor": "9.5.
|
|
141
|
-
"@intlayer/types": "9.5.
|
|
136
|
+
"@intlayer/api": "9.5.11",
|
|
137
|
+
"@intlayer/config": "9.5.11",
|
|
138
|
+
"@intlayer/core": "9.5.11",
|
|
139
|
+
"@intlayer/dictionaries-entry": "9.5.11",
|
|
140
|
+
"@intlayer/editor": "9.5.11",
|
|
141
|
+
"@intlayer/types": "9.5.11"
|
|
142
142
|
},
|
|
143
143
|
"devDependencies": {
|
|
144
144
|
"@craco/types": "7.1.0",
|
|
@@ -152,14 +152,14 @@
|
|
|
152
152
|
"rimraf": "6.1.3",
|
|
153
153
|
"tsdown": "0.23.0",
|
|
154
154
|
"typescript": "7.0.2",
|
|
155
|
-
"vitest": "5.0.
|
|
155
|
+
"vitest": "5.0.2"
|
|
156
156
|
},
|
|
157
157
|
"peerDependencies": {
|
|
158
158
|
"react": ">=16.0.0",
|
|
159
159
|
"react-dom": ">=16.0.0"
|
|
160
160
|
},
|
|
161
161
|
"optionalDependencies": {
|
|
162
|
-
"@intlayer/analytics": "9.5.
|
|
162
|
+
"@intlayer/analytics": "9.5.11"
|
|
163
163
|
},
|
|
164
164
|
"engines": {
|
|
165
165
|
"node": ">=14.18"
|