react-intlayer 5.3.9 → 5.3.10

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 CHANGED
@@ -52,7 +52,7 @@ pnpm add react-intlayer
52
52
 
53
53
  With Intlayer, you can declare your content in a structured way anywhere in your codebase.
54
54
 
55
- By default, Intlayer scans for files with the extension `.content.{ts,tsx,js,jsx,mjs,cjs}`.
55
+ By default, Intlayer scans for files with the extension `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`.
56
56
 
57
57
  > You can modify the default extension by setting the `contentDir` property in the [configuration file](https://intlayer.org/doc/concept/configuration).
58
58
 
@@ -28,9 +28,10 @@ var import_jsx_runtime = require("react/jsx-runtime");
28
28
  var import_react = require("react");
29
29
  var import_core = require("@intlayer/core");
30
30
  var import_IntlayerNode = require('./IntlayerNode.cjs');
31
- var import_useEditedContentRenderer = require('./editor/useEditedContentRenderer.cjs');
32
31
  var import_editor = require('./editor/index.cjs');
32
+ var import_useEditedContentRenderer = require('./editor/useEditedContentRenderer.cjs');
33
33
  var import_markdown = require('./markdown/index.cjs');
34
+ var import_renderReactElement = require('./reactElement/renderReactElement.cjs');
34
35
  const intlayerNodePlugins = {
35
36
  id: "intlayer-node-plugin",
36
37
  canHandle: (node) => typeof node === "bigint" || typeof node === "string" || typeof node === "number",
@@ -47,14 +48,14 @@ const intlayerNodePlugins = {
47
48
  const reactNodePlugins = {
48
49
  id: "react-node-plugin",
49
50
  canHandle: (node) => typeof node === "object" && typeof node.props !== "undefined" && typeof node.key !== "undefined",
50
- transform: (_node, {
51
+ transform: (node, {
51
52
  plugins,
52
53
  // Removed to avoid next error - Functions cannot be passed directly to Client Components
53
54
  ...rest
54
55
  }) => (0, import_IntlayerNode.renderIntlayerNode)({
55
56
  ...rest,
56
57
  value: "[[react-element]]",
57
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.ContentSelectorRenderer, { ...rest, children: "renderReactElement(node)" })
58
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.ContentSelectorRenderer, { ...rest, children: (0, import_renderReactElement.renderReactElement)(node) })
58
59
  })
59
60
  };
60
61
  const markdownStringPlugin = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins.tsx"],"sourcesContent":["import {\n type Plugins,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n type DeepTransformContent as DeepTransformContentCore,\n type MarkdownContent,\n NodeType,\n KeyPath,\n getMarkdownMetadata,\n} from '@intlayer/core';\nimport type { ReactNode } from 'react';\nimport { renderIntlayerNode, type IntlayerNode } from './IntlayerNode';\nimport { EditedContentRenderer } from './editor/useEditedContentRenderer';\nimport { ContentSelectorRenderer } from './editor';\nimport { MarkdownMetadataRenderer, MarkdownRenderer } from './markdown';\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) =>\n renderIntlayerNode({\n ...rest,\n value: rest.children,\n children: (\n <ContentSelectorRenderer {...rest} key={rest.children}>\n <EditedContentRenderer {...rest}>\n {rest.children}\n </EditedContentRenderer>\n </ContentSelectorRenderer>\n ),\n }),\n};\n\n/** ---------------------------------------------\n * REACT NODE PLUGIN\n * --------------------------------------------- */\n\nexport type ReactNodeCond<T> = T extends {\n props: any;\n key: any;\n}\n ? ReactNode\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const reactNodePlugins: Plugins = {\n id: 'react-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n typeof node.props !== 'undefined' &&\n typeof node.key !== 'undefined',\n\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) =>\n renderIntlayerNode({\n ...rest,\n value: '[[react-element]]',\n children: (\n <ContentSelectorRenderer {...rest}>\n renderReactElement(node)\n </ContentSelectorRenderer>\n ),\n }),\n};\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<string, { metadata: DeepTransformContent<string> }>\n : never;\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins = {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node);\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children: (\n <ContentSelectorRenderer {...rest}>\n <MarkdownMetadataRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataRenderer>\n </ContentSelectorRenderer>\n ),\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n return renderIntlayerNode({\n ...props,\n value: node,\n children: (\n <ContentSelectorRenderer {...rest}>\n <MarkdownRenderer {...rest}>{node}</MarkdownRenderer>\n </ContentSelectorRenderer>\n ),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n },\n};\n\nexport type MarkdownCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeType.Markdown]: infer M;\n metadata?: infer U;\n}\n ? IntlayerNode<DeepTransformContent<M>, { metadata: DeepTransformContent<U> }>\n : never;\n\nexport const markdownPlugin: Plugins = {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Markdown,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeType.Markdown,\n },\n ];\n\n const children = node[NodeType.Markdown];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n};\n/** ---------------------------------------------\n * PLUGINS RESULT\n * --------------------------------------------- */\n\nexport interface IInterpreterPluginReact<T> {\n reactNode: ReactNodeCond<T>;\n intlayerNode: IntlayerNodeCond<T>;\n markdown: MarkdownCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `react-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = IInterpreterPluginStateCore & {\n reactNode: true;\n intlayerNode: true;\n markdown: true;\n};\n\nexport type DeepTransformContent<T> = DeepTransformContentCore<\n T,\n IInterpreterPluginState\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CU;AADF;AAzCR,kBAQO;AAEP,0BAAsD;AACtD,sCAAsC;AACtC,oBAAwC;AACxC,sBAA2D;AAWpD,MAAM,sBAA+B;AAAA,EAC1C,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAChB,OAAO,SAAS,YAChB,OAAO,SAAS;AAAA,EAClB,WAAW,CACT,OACA;AAAA,IACE;AAAA;AAAA,IACA,GAAG;AAAA,EACL,UAEA,wCAAmB;AAAA,IACjB,GAAG;AAAA,IACH,OAAO,KAAK;AAAA,IACZ,UACE,gDAAC,yCAAyB,GAAG,MAAM,KAAK,KAAK,YAC3C,4CAAC,yDAAuB,GA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AkB,GAAG,MAAO,gBAAK,GACpC;AAAA,MAEF,iBAAiB;AAAA,QACf,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAUO,MAAM,iBAA0B;AAAA,EACrC,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,MAAM,aAAa,qBAAS;AAAA,EAC1D,WAAW,CAAC,MAAuB,OAAO,sBAAsB;AAC9D,UAAM,aAAwB;AAAA,MAC5B,GAAG,MAAM;AAAA,MACT;AAAA,QACE,MAAM,qBAAS;AAAA,MACjB;AAAA,IACF;AAEA,UAAM,WAAW,KAAK,qBAAS,QAAQ;AAEvC,WAAO,kBAAkB,UAAU;AAAA,MACjC,GAAG;AAAA,MACH;AAAA,MACA,SAAS;AAAA,MACT,SAAS,CAAC,sBAAsB,GAAI,MAAM,WAAW,CAAC,CAAE;AAAA,IAC1D,CAAC;AAAA,EACH;AACF;","names":["props"]}
1
+ {"version":3,"sources":["../../src/plugins.tsx"],"sourcesContent":["import {\n KeyPath,\n NodeType,\n getMarkdownMetadata,\n type DeepTransformContent as DeepTransformContentCore,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n type MarkdownContent,\n type Plugins,\n} from '@intlayer/core';\nimport type { ReactNode } from 'react';\nimport { renderIntlayerNode, type IntlayerNode } from './IntlayerNode';\nimport { ContentSelectorRenderer } from './editor';\nimport { EditedContentRenderer } from './editor/useEditedContentRenderer';\nimport { MarkdownMetadataRenderer, MarkdownRenderer } from './markdown';\nimport { renderReactElement } from './reactElement/renderReactElement';\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) =>\n renderIntlayerNode({\n ...rest,\n value: rest.children,\n children: (\n <ContentSelectorRenderer {...rest} key={rest.children}>\n <EditedContentRenderer {...rest}>\n {rest.children}\n </EditedContentRenderer>\n </ContentSelectorRenderer>\n ),\n }),\n};\n\n/** ---------------------------------------------\n * REACT NODE PLUGIN\n * --------------------------------------------- */\n\nexport type ReactNodeCond<T> = T extends {\n props: any;\n key: any;\n}\n ? ReactNode\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const reactNodePlugins: Plugins = {\n id: 'react-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n typeof node.props !== 'undefined' &&\n typeof node.key !== 'undefined',\n\n transform: (\n node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) =>\n renderIntlayerNode({\n ...rest,\n value: '[[react-element]]',\n children: (\n <ContentSelectorRenderer {...rest}>\n {renderReactElement(node)}\n </ContentSelectorRenderer>\n ),\n }),\n};\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<string, { metadata: DeepTransformContent<string> }>\n : never;\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins = {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node);\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children: (\n <ContentSelectorRenderer {...rest}>\n <MarkdownMetadataRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataRenderer>\n </ContentSelectorRenderer>\n ),\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n return renderIntlayerNode({\n ...props,\n value: node,\n children: (\n <ContentSelectorRenderer {...rest}>\n <MarkdownRenderer {...rest}>{node}</MarkdownRenderer>\n </ContentSelectorRenderer>\n ),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n },\n};\n\nexport type MarkdownCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeType.Markdown]: infer M;\n metadata?: infer U;\n}\n ? IntlayerNode<DeepTransformContent<M>, { metadata: DeepTransformContent<U> }>\n : never;\n\nexport const markdownPlugin: Plugins = {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Markdown,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeType.Markdown,\n },\n ];\n\n const children = node[NodeType.Markdown];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n};\n/** ---------------------------------------------\n * PLUGINS RESULT\n * --------------------------------------------- */\n\nexport interface IInterpreterPluginReact<T> {\n reactNode: ReactNodeCond<T>;\n intlayerNode: IntlayerNodeCond<T>;\n markdown: MarkdownCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `react-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = IInterpreterPluginStateCore & {\n reactNode: true;\n intlayerNode: true;\n markdown: true;\n};\n\nexport type DeepTransformContent<T> = DeepTransformContentCore<\n T,\n IInterpreterPluginState\n>;\n"],"mappings":";;;;;;;;;;;;;;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;AAAA,MACH,WAAW,CAAC,cAAcA,eACxB,wCAAmB;AAAA,QACjB,GAAGA;AAAA,QACH,OAAO;AAAA,QACP,UACE,4CAAC,yCAAyB,GAAG,MAC3B;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,YACJ,iBAAiBA,OAAM;AAAA,YAEtB;AAAA;AAAA,QACH,GACF;AAAA,MAEJ,CAAC;AAAA,IACL;AAGA,UAAM,gBAAgB,kBAAkB,UAAU;AAAA,MAChD,SAAS,CAAC,eAAe;AAAA,MACzB,eAAe,KAAK;AAAA,MACpB,SAAS,CAAC;AAAA,IACZ,CAAC;AAED,eAAO,wCAAmB;AAAA,MACxB,GAAG;AAAA,MACH,OAAO;AAAA,MACP,UACE,4CAAC,yCAAyB,GAAG,MAC3B,sDAAC,oCAAkB,GAAG,MAAO,gBAAK,GACpC;AAAA,MAEF,iBAAiB;AAAA,QACf,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAUO,MAAM,iBAA0B;AAAA,EACrC,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,MAAM,aAAa,qBAAS;AAAA,EAC1D,WAAW,CAAC,MAAuB,OAAO,sBAAsB;AAC9D,UAAM,aAAwB;AAAA,MAC5B,GAAG,MAAM;AAAA,MACT;AAAA,QACE,MAAM,qBAAS;AAAA,MACjB;AAAA,IACF;AAEA,UAAM,WAAW,KAAK,qBAAS,QAAQ;AAEvC,WAAO,kBAAkB,UAAU;AAAA,MACjC,GAAG;AAAA,MACH;AAAA,MACA,SAAS;AAAA,MACT,SAAS,CAAC,sBAAsB,GAAI,MAAM,WAAW,CAAC,CAAE;AAAA,IAC1D,CAAC;AAAA,EACH;AACF;","names":["props"]}
@@ -5,9 +5,10 @@ import {
5
5
  getMarkdownMetadata
6
6
  } from "@intlayer/core";
7
7
  import { renderIntlayerNode } from "./IntlayerNode.mjs";
8
- import { EditedContentRenderer } from "./editor/useEditedContentRenderer.mjs";
9
8
  import { ContentSelectorRenderer } from "./editor/index.mjs";
9
+ import { EditedContentRenderer } from "./editor/useEditedContentRenderer.mjs";
10
10
  import { MarkdownMetadataRenderer, MarkdownRenderer } from "./markdown/index.mjs";
11
+ import { renderReactElement } from "./reactElement/renderReactElement.mjs";
11
12
  const intlayerNodePlugins = {
12
13
  id: "intlayer-node-plugin",
13
14
  canHandle: (node) => typeof node === "bigint" || typeof node === "string" || typeof node === "number",
@@ -24,14 +25,14 @@ const intlayerNodePlugins = {
24
25
  const reactNodePlugins = {
25
26
  id: "react-node-plugin",
26
27
  canHandle: (node) => typeof node === "object" && typeof node.props !== "undefined" && typeof node.key !== "undefined",
27
- transform: (_node, {
28
+ transform: (node, {
28
29
  plugins,
29
30
  // Removed to avoid next error - Functions cannot be passed directly to Client Components
30
31
  ...rest
31
32
  }) => renderIntlayerNode({
32
33
  ...rest,
33
34
  value: "[[react-element]]",
34
- children: /* @__PURE__ */ jsx(ContentSelectorRenderer, { ...rest, children: "renderReactElement(node)" })
35
+ children: /* @__PURE__ */ jsx(ContentSelectorRenderer, { ...rest, children: renderReactElement(node) })
35
36
  })
36
37
  };
37
38
  const markdownStringPlugin = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins.tsx"],"sourcesContent":["import {\n type Plugins,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n type DeepTransformContent as DeepTransformContentCore,\n type MarkdownContent,\n NodeType,\n KeyPath,\n getMarkdownMetadata,\n} from '@intlayer/core';\nimport type { ReactNode } from 'react';\nimport { renderIntlayerNode, type IntlayerNode } from './IntlayerNode';\nimport { EditedContentRenderer } from './editor/useEditedContentRenderer';\nimport { ContentSelectorRenderer } from './editor';\nimport { MarkdownMetadataRenderer, MarkdownRenderer } from './markdown';\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) =>\n renderIntlayerNode({\n ...rest,\n value: rest.children,\n children: (\n <ContentSelectorRenderer {...rest} key={rest.children}>\n <EditedContentRenderer {...rest}>\n {rest.children}\n </EditedContentRenderer>\n </ContentSelectorRenderer>\n ),\n }),\n};\n\n/** ---------------------------------------------\n * REACT NODE PLUGIN\n * --------------------------------------------- */\n\nexport type ReactNodeCond<T> = T extends {\n props: any;\n key: any;\n}\n ? ReactNode\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const reactNodePlugins: Plugins = {\n id: 'react-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n typeof node.props !== 'undefined' &&\n typeof node.key !== 'undefined',\n\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) =>\n renderIntlayerNode({\n ...rest,\n value: '[[react-element]]',\n children: (\n <ContentSelectorRenderer {...rest}>\n renderReactElement(node)\n </ContentSelectorRenderer>\n ),\n }),\n};\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<string, { metadata: DeepTransformContent<string> }>\n : never;\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins = {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node);\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children: (\n <ContentSelectorRenderer {...rest}>\n <MarkdownMetadataRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataRenderer>\n </ContentSelectorRenderer>\n ),\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n return renderIntlayerNode({\n ...props,\n value: node,\n children: (\n <ContentSelectorRenderer {...rest}>\n <MarkdownRenderer {...rest}>{node}</MarkdownRenderer>\n </ContentSelectorRenderer>\n ),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n },\n};\n\nexport type MarkdownCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeType.Markdown]: infer M;\n metadata?: infer U;\n}\n ? IntlayerNode<DeepTransformContent<M>, { metadata: DeepTransformContent<U> }>\n : never;\n\nexport const markdownPlugin: Plugins = {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Markdown,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeType.Markdown,\n },\n ];\n\n const children = node[NodeType.Markdown];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n};\n/** ---------------------------------------------\n * PLUGINS RESULT\n * --------------------------------------------- */\n\nexport interface IInterpreterPluginReact<T> {\n reactNode: ReactNodeCond<T>;\n intlayerNode: IntlayerNodeCond<T>;\n markdown: MarkdownCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `react-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = IInterpreterPluginStateCore & {\n reactNode: true;\n intlayerNode: true;\n markdown: true;\n};\n\nexport type DeepTransformContent<T> = DeepTransformContentCore<\n T,\n IInterpreterPluginState\n>;\n"],"mappings":"AA0CU;AADF;AAzCR;AAAA,EAKE;AAAA,EAEA;AAAA,OACK;AAEP,SAAS,0BAA6C;AACtD,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC,SAAS,0BAA0B,wBAAwB;AAWpD,MAAM,sBAA+B;AAAA,EAC1C,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAChB,OAAO,SAAS,YAChB,OAAO,SAAS;AAAA,EAClB,WAAW,CACT,OACA;AAAA,IACE;AAAA;AAAA,IACA,GAAG;AAAA,EACL,MAEA,mBAAmB;AAAA,IACjB,GAAG;AAAA,IACH,OAAO,KAAK;AAAA,IACZ,UACE,8BAAC,2BAAyB,GAAG,MAAM,KAAK,KAAK,YAC3C,oBAAC,yBAAuB,GAAG,MACxB,eAAK,UACR,CACF;AAAA,EAEJ,CAAC;AACL;AAcO,MAAM,mBAA4B;AAAA,EACvC,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAChB,OAAO,KAAK,UAAU,eACtB,OAAO,KAAK,QAAQ;AAAA,EAEtB,WAAW,CACT,OACA;AAAA,IACE;AAAA;AAAA,IACA,GAAG;AAAA,EACL,MAEA,mBAAmB;AAAA,IACjB,GAAG;AAAA,IACH,OAAO;AAAA,IACP,UACE,oBAAC,2BAAyB,GAAG,MAAM,sCAEnC;AAAA,EAEJ,CAAC;AACL;AAWO,MAAM,uBAAgC;AAAA,EAC3C,IAAI;AAAA,EACJ,WAAW,CAAC,SAAS,OAAO,SAAS;AAAA,EACrC,WAAW,CAAC,MAAc,OAAO,sBAAsB;AACrD,UAAM;AAAA,MACJ;AAAA;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AAEJ,UAAM,WAAW,oBAAoB,IAAI;AAEzC,UAAM,kBAA2B;AAAA,MAC/B,IAAI;AAAA,MACJ,WAAW,CAAC,iBACV,OAAO,iBAAiB,YACxB,OAAO,iBAAiB,YACxB,OAAO,iBAAiB,aACxB,CAAC;AAAA,MACH,WAAW,CAAC,cAAcA,WACxB,mBAAmB;AAAA,QACjB,GAAGA;AAAA,QACH,OAAO;AAAA,QACP,UACE,oBAAC,2BAAyB,GAAG,MAC3B;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,YACJ,iBAAiBA,OAAM;AAAA,YAEtB;AAAA;AAAA,QACH,GACF;AAAA,MAEJ,CAAC;AAAA,IACL;AAGA,UAAM,gBAAgB,kBAAkB,UAAU;AAAA,MAChD,SAAS,CAAC,eAAe;AAAA,MACzB,eAAe,KAAK;AAAA,MACpB,SAAS,CAAC;AAAA,IACZ,CAAC;AAED,WAAO,mBAAmB;AAAA,MACxB,GAAG;AAAA,MACH,OAAO;AAAA,MACP,UACE,oBAAC,2BAAyB,GAAG,MAC3B,8BAAC,oBAAkB,GAAG,MAAO,gBAAK,GACpC;AAAA,MAEF,iBAAiB;AAAA,QACf,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAUO,MAAM,iBAA0B;AAAA,EACrC,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,MAAM,aAAa,SAAS;AAAA,EAC1D,WAAW,CAAC,MAAuB,OAAO,sBAAsB;AAC9D,UAAM,aAAwB;AAAA,MAC5B,GAAG,MAAM;AAAA,MACT;AAAA,QACE,MAAM,SAAS;AAAA,MACjB;AAAA,IACF;AAEA,UAAM,WAAW,KAAK,SAAS,QAAQ;AAEvC,WAAO,kBAAkB,UAAU;AAAA,MACjC,GAAG;AAAA,MACH;AAAA,MACA,SAAS;AAAA,MACT,SAAS,CAAC,sBAAsB,GAAI,MAAM,WAAW,CAAC,CAAE;AAAA,IAC1D,CAAC;AAAA,EACH;AACF;","names":["props"]}
1
+ {"version":3,"sources":["../../src/plugins.tsx"],"sourcesContent":["import {\n KeyPath,\n NodeType,\n getMarkdownMetadata,\n type DeepTransformContent as DeepTransformContentCore,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n type MarkdownContent,\n type Plugins,\n} from '@intlayer/core';\nimport type { ReactNode } from 'react';\nimport { renderIntlayerNode, type IntlayerNode } from './IntlayerNode';\nimport { ContentSelectorRenderer } from './editor';\nimport { EditedContentRenderer } from './editor/useEditedContentRenderer';\nimport { MarkdownMetadataRenderer, MarkdownRenderer } from './markdown';\nimport { renderReactElement } from './reactElement/renderReactElement';\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) =>\n renderIntlayerNode({\n ...rest,\n value: rest.children,\n children: (\n <ContentSelectorRenderer {...rest} key={rest.children}>\n <EditedContentRenderer {...rest}>\n {rest.children}\n </EditedContentRenderer>\n </ContentSelectorRenderer>\n ),\n }),\n};\n\n/** ---------------------------------------------\n * REACT NODE PLUGIN\n * --------------------------------------------- */\n\nexport type ReactNodeCond<T> = T extends {\n props: any;\n key: any;\n}\n ? ReactNode\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const reactNodePlugins: Plugins = {\n id: 'react-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n typeof node.props !== 'undefined' &&\n typeof node.key !== 'undefined',\n\n transform: (\n node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) =>\n renderIntlayerNode({\n ...rest,\n value: '[[react-element]]',\n children: (\n <ContentSelectorRenderer {...rest}>\n {renderReactElement(node)}\n </ContentSelectorRenderer>\n ),\n }),\n};\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<string, { metadata: DeepTransformContent<string> }>\n : never;\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins = {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node);\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children: (\n <ContentSelectorRenderer {...rest}>\n <MarkdownMetadataRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataRenderer>\n </ContentSelectorRenderer>\n ),\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n return renderIntlayerNode({\n ...props,\n value: node,\n children: (\n <ContentSelectorRenderer {...rest}>\n <MarkdownRenderer {...rest}>{node}</MarkdownRenderer>\n </ContentSelectorRenderer>\n ),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n },\n};\n\nexport type MarkdownCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeType.Markdown]: infer M;\n metadata?: infer U;\n}\n ? IntlayerNode<DeepTransformContent<M>, { metadata: DeepTransformContent<U> }>\n : never;\n\nexport const markdownPlugin: Plugins = {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Markdown,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeType.Markdown,\n },\n ];\n\n const children = node[NodeType.Markdown];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n};\n/** ---------------------------------------------\n * PLUGINS RESULT\n * --------------------------------------------- */\n\nexport interface IInterpreterPluginReact<T> {\n reactNode: ReactNodeCond<T>;\n intlayerNode: IntlayerNodeCond<T>;\n markdown: MarkdownCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `react-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = IInterpreterPluginStateCore & {\n reactNode: true;\n intlayerNode: true;\n markdown: true;\n};\n\nexport type DeepTransformContent<T> = DeepTransformContentCore<\n T,\n IInterpreterPluginState\n>;\n"],"mappings":"AA2CU;AADF;AA1CR;AAAA,EAEE;AAAA,EACA;AAAA,OAKK;AAEP,SAAS,0BAA6C;AACtD,SAAS,+BAA+B;AACxC,SAAS,6BAA6B;AACtC,SAAS,0BAA0B,wBAAwB;AAC3D,SAAS,0BAA0B;AAW5B,MAAM,sBAA+B;AAAA,EAC1C,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAChB,OAAO,SAAS,YAChB,OAAO,SAAS;AAAA,EAClB,WAAW,CACT,OACA;AAAA,IACE;AAAA;AAAA,IACA,GAAG;AAAA,EACL,MAEA,mBAAmB;AAAA,IACjB,GAAG;AAAA,IACH,OAAO,KAAK;AAAA,IACZ,UACE,8BAAC,2BAAyB,GAAG,MAAM,KAAK,KAAK,YAC3C,oBAAC,yBAAuB,GAAG,MACxB,eAAK,UACR,CACF;AAAA,EAEJ,CAAC;AACL;AAcO,MAAM,mBAA4B;AAAA,EACvC,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAChB,OAAO,KAAK,UAAU,eACtB,OAAO,KAAK,QAAQ;AAAA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CAAC,SACV,OAAO,SAAS,YAAY,MAAM,aAAa,SAAS;AAAA,EAC1D,WAAW,CAAC,MAAuB,OAAO,sBAAsB;AAC9D,UAAM,aAAwB;AAAA,MAC5B,GAAG,MAAM;AAAA,MACT;AAAA,QACE,MAAM,SAAS;AAAA,MACjB;AAAA,IACF;AAEA,UAAM,WAAW,KAAK,SAAS,QAAQ;AAEvC,WAAO,kBAAkB,UAAU;AAAA,MACjC,GAAG;AAAA,MACH;AAAA,MACA,SAAS;AAAA,MACT,SAAS,CAAC,sBAAsB,GAAI,MAAM,WAAW,CAAC,CAAE;AAAA,IAC1D,CAAC;AAAA,EACH;AACF;","names":["props"]}
@@ -1,4 +1,4 @@
1
- import { type Plugins, type IInterpreterPluginState as IInterpreterPluginStateCore, type DeepTransformContent as DeepTransformContentCore, NodeType } from '@intlayer/core';
1
+ import { NodeType, type DeepTransformContent as DeepTransformContentCore, type IInterpreterPluginState as IInterpreterPluginStateCore, type Plugins } from '@intlayer/core';
2
2
  import type { ReactNode } from 'react';
3
3
  import { type IntlayerNode } from './IntlayerNode';
4
4
  /** ---------------------------------------------
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,KAAK,oBAAoB,IAAI,wBAAwB,EAErD,QAAQ,EAGT,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKvE;;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,OAwBjC,CAAC;AAEF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AAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;CACpB,GACG,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE;IAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,GAC5E,KAAK,CAAC;AAEV,eAAO,MAAM,cAAc,EAAE,OAqB5B,CAAC;AACF;;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-intlayer",
3
- "version": "5.3.9",
3
+ "version": "5.3.10",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your React applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -69,41 +69,41 @@
69
69
  ],
70
70
  "dependencies": {
71
71
  "js-cookie": "^3.0.5",
72
- "@intlayer/api": "5.3.9",
73
- "@intlayer/config": "5.3.9",
74
- "@intlayer/core": "5.3.9",
75
- "@intlayer/dictionaries-entry": "5.3.9",
76
- "@intlayer/editor-react": "5.3.9"
72
+ "@intlayer/api": "5.3.10",
73
+ "@intlayer/config": "5.3.10",
74
+ "@intlayer/core": "5.3.10",
75
+ "@intlayer/editor-react": "5.3.10",
76
+ "@intlayer/dictionaries-entry": "5.3.10"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@craco/types": "^7.1.0",
80
80
  "@types/js-cookie": "^3.0.6",
81
- "@types/node": "^22.10.6",
81
+ "@types/node": "^22.13.10",
82
82
  "@types/react": ">=16.0.0",
83
83
  "@types/react-dom": ">=16.0.0",
84
- "@typescript-eslint/parser": "^8.24.0",
84
+ "@typescript-eslint/parser": "^8.27.0",
85
85
  "concurrently": "^9.1.2",
86
- "eslint": "^9.20.0",
87
- "prettier": "^3.5.0",
86
+ "eslint": "^9.22.0",
87
+ "prettier": "^3.5.3",
88
88
  "rimraf": "^6.0.1",
89
- "tsc-alias": "^1.8.10",
90
- "tsup": "^8.3.5",
91
- "typescript": "^5.7.3",
89
+ "tsc-alias": "^1.8.11",
90
+ "tsup": "^8.4.0",
91
+ "typescript": "^5.8.2",
92
92
  "@utils/eslint-config": "1.0.4",
93
93
  "@utils/ts-config": "1.0.4",
94
- "@utils/ts-config-types": "1.0.4",
95
94
  "@utils/tsup-config": "1.0.4",
96
- "@intlayer/backend": "5.3.9"
95
+ "@utils/ts-config-types": "1.0.4",
96
+ "@intlayer/backend": "5.3.10"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "react": ">=16.0.0",
100
100
  "react-dom": ">=16.0.0",
101
- "@intlayer/api": "5.3.9",
102
- "@intlayer/config": "5.3.9",
103
- "@intlayer/core": "5.3.9",
104
- "@intlayer/editor-react": "5.3.9",
105
- "@intlayer/dictionaries-entry": "5.3.9",
106
- "intlayer": "5.3.9"
101
+ "@intlayer/api": "5.3.10",
102
+ "@intlayer/config": "5.3.10",
103
+ "@intlayer/dictionaries-entry": "5.3.10",
104
+ "@intlayer/editor-react": "5.3.10",
105
+ "intlayer": "5.3.10",
106
+ "@intlayer/core": "5.3.10"
107
107
  },
108
108
  "engines": {
109
109
  "node": ">=14.18"