react-intlayer 5.2.8 → 5.2.9
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.
|
@@ -28,7 +28,14 @@ const rendererIntlayerNode = ({
|
|
|
28
28
|
children
|
|
29
29
|
}) => {
|
|
30
30
|
const element = (0, import_react.isValidElement)(children) ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
31
|
-
return
|
|
31
|
+
return new Proxy(element, {
|
|
32
|
+
get(target, prop, receiver) {
|
|
33
|
+
if (prop === "value") {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
return Reflect.get(target, prop, receiver);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
32
39
|
};
|
|
33
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
41
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/IntlayerNode.tsx"],"sourcesContent":["import type { NodeProps } from '@intlayer/core';\nimport {\n type PropsWithChildren,\n type ReactNode,\n type ReactElement,\n isValidElement,\n} from 'react';\n\nexport type IntlayerNode<T = NodeProps['content']> = ReactNode & {\n value: T;\n};\n\nexport const rendererIntlayerNode = <\n T extends number | string | boolean | undefined | null,\n>({\n value,\n children,\n}: PropsWithChildren<{\n value: T;\n}>): IntlayerNode => {\n // If children is not a valid ReactElement, wrap it in a fragment\n const element: ReactElement<any> = isValidElement(children) ? (\n children\n ) : (\n <>{children}</>\n );\n\n //
|
|
1
|
+
{"version":3,"sources":["../../src/IntlayerNode.tsx"],"sourcesContent":["import type { NodeProps } from '@intlayer/core';\nimport {\n type PropsWithChildren,\n type ReactNode,\n type ReactElement,\n isValidElement,\n} from 'react';\n\nexport type IntlayerNode<T = NodeProps['content']> = ReactNode & {\n value: T;\n};\n\nexport const rendererIntlayerNode = <\n T extends number | string | boolean | undefined | null,\n>({\n value,\n children,\n}: PropsWithChildren<{\n value: T;\n}>): IntlayerNode => {\n // If children is not a valid ReactElement, wrap it in a fragment\n const element: ReactElement<any> = isValidElement(children) ? (\n children\n ) : (\n <>{children}</>\n );\n\n // Return a Proxy that pretends to be the original element\n // but also has a .value getter.\n return new Proxy(element as ReactElement, {\n get(target, prop, receiver) {\n if (prop === 'value') {\n return value;\n }\n return Reflect.get(target, prop, receiver);\n },\n }) as IntlayerNode<T>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBI;AAvBJ,mBAKO;AAMA,MAAM,uBAAuB,CAElC;AAAA,EACA;AAAA,EACA;AACF,MAEqB;AAEnB,QAAM,cAA6B,6BAAe,QAAQ,IACxD,WAEA,2EAAG,UAAS;AAKd,SAAO,IAAI,MAAM,SAAyB;AAAA,IACxC,IAAI,QAAQ,MAAM,UAAU;AAC1B,UAAI,SAAS,SAAS;AACpB,eAAO;AAAA,MACT;AACA,aAAO,QAAQ,IAAI,QAAQ,MAAM,QAAQ;AAAA,IAC3C;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -7,7 +7,14 @@ const rendererIntlayerNode = ({
|
|
|
7
7
|
children
|
|
8
8
|
}) => {
|
|
9
9
|
const element = isValidElement(children) ? children : /* @__PURE__ */ jsx(Fragment, { children });
|
|
10
|
-
return
|
|
10
|
+
return new Proxy(element, {
|
|
11
|
+
get(target, prop, receiver) {
|
|
12
|
+
if (prop === "value") {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
return Reflect.get(target, prop, receiver);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
11
18
|
};
|
|
12
19
|
export {
|
|
13
20
|
rendererIntlayerNode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/IntlayerNode.tsx"],"sourcesContent":["import type { NodeProps } from '@intlayer/core';\nimport {\n type PropsWithChildren,\n type ReactNode,\n type ReactElement,\n isValidElement,\n} from 'react';\n\nexport type IntlayerNode<T = NodeProps['content']> = ReactNode & {\n value: T;\n};\n\nexport const rendererIntlayerNode = <\n T extends number | string | boolean | undefined | null,\n>({\n value,\n children,\n}: PropsWithChildren<{\n value: T;\n}>): IntlayerNode => {\n // If children is not a valid ReactElement, wrap it in a fragment\n const element: ReactElement<any> = isValidElement(children) ? (\n children\n ) : (\n <>{children}</>\n );\n\n //
|
|
1
|
+
{"version":3,"sources":["../../src/IntlayerNode.tsx"],"sourcesContent":["import type { NodeProps } from '@intlayer/core';\nimport {\n type PropsWithChildren,\n type ReactNode,\n type ReactElement,\n isValidElement,\n} from 'react';\n\nexport type IntlayerNode<T = NodeProps['content']> = ReactNode & {\n value: T;\n};\n\nexport const rendererIntlayerNode = <\n T extends number | string | boolean | undefined | null,\n>({\n value,\n children,\n}: PropsWithChildren<{\n value: T;\n}>): IntlayerNode => {\n // If children is not a valid ReactElement, wrap it in a fragment\n const element: ReactElement<any> = isValidElement(children) ? (\n children\n ) : (\n <>{children}</>\n );\n\n // Return a Proxy that pretends to be the original element\n // but also has a .value getter.\n return new Proxy(element as ReactElement, {\n get(target, prop, receiver) {\n if (prop === 'value') {\n return value;\n }\n return Reflect.get(target, prop, receiver);\n },\n }) as IntlayerNode<T>;\n};\n"],"mappings":"AAwBI;AAvBJ;AAAA,EAIE;AAAA,OACK;AAMA,MAAM,uBAAuB,CAElC;AAAA,EACA;AAAA,EACA;AACF,MAEqB;AAEnB,QAAM,UAA6B,eAAe,QAAQ,IACxD,WAEA,gCAAG,UAAS;AAKd,SAAO,IAAI,MAAM,SAAyB;AAAA,IACxC,IAAI,QAAQ,MAAM,UAAU;AAC1B,UAAI,SAAS,SAAS;AACpB,eAAO;AAAA,MACT;AACA,aAAO,QAAQ,IAAI,QAAQ,MAAM,QAAQ;AAAA,IAC3C;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerNode.d.ts","sourceRoot":"","sources":["../../src/IntlayerNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG;IAC/D,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,EACtD,sBAGC,iBAAiB,CAAC;IACnB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,KAAG,
|
|
1
|
+
{"version":3,"file":"IntlayerNode.d.ts","sourceRoot":"","sources":["../../src/IntlayerNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG;IAC/D,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,EACtD,sBAGC,iBAAiB,CAAC;IACnB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,KAAG,YAkBJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intlayer",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.9",
|
|
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.2.
|
|
72
|
-
"@intlayer/
|
|
73
|
-
"@intlayer/
|
|
74
|
-
"@intlayer/
|
|
75
|
-
"@intlayer/
|
|
71
|
+
"@intlayer/api": "5.2.9",
|
|
72
|
+
"@intlayer/config": "5.2.9",
|
|
73
|
+
"@intlayer/core": "5.2.9",
|
|
74
|
+
"@intlayer/dictionaries-entry": "5.2.9",
|
|
75
|
+
"@intlayer/editor-react": "5.2.9"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@craco/types": "^7.1.0",
|
|
@@ -88,21 +88,21 @@
|
|
|
88
88
|
"tsc-alias": "^1.8.10",
|
|
89
89
|
"tsup": "^8.3.5",
|
|
90
90
|
"typescript": "^5.7.3",
|
|
91
|
-
"@intlayer/backend": "5.2.8",
|
|
92
91
|
"@utils/eslint-config": "1.0.4",
|
|
93
|
-
"@utils/ts-config": "1.0.4",
|
|
94
92
|
"@utils/ts-config-types": "1.0.4",
|
|
95
|
-
"@utils/
|
|
93
|
+
"@utils/ts-config": "1.0.4",
|
|
94
|
+
"@utils/tsup-config": "1.0.4",
|
|
95
|
+
"@intlayer/backend": "5.2.9"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
98
98
|
"react": ">=16.0.0",
|
|
99
99
|
"react-dom": ">=16.0.0",
|
|
100
|
-
"@intlayer/
|
|
101
|
-
"@intlayer/
|
|
102
|
-
"intlayer": "5.2.
|
|
103
|
-
"@intlayer/dictionaries-entry": "5.2.
|
|
104
|
-
"
|
|
105
|
-
"@intlayer/
|
|
100
|
+
"@intlayer/config": "5.2.9",
|
|
101
|
+
"@intlayer/editor-react": "5.2.9",
|
|
102
|
+
"@intlayer/api": "5.2.9",
|
|
103
|
+
"@intlayer/dictionaries-entry": "5.2.9",
|
|
104
|
+
"intlayer": "5.2.9",
|
|
105
|
+
"@intlayer/core": "5.2.9"
|
|
106
106
|
},
|
|
107
107
|
"engines": {
|
|
108
108
|
"node": ">=14.18"
|