@contember/react-richtext-renderer 1.3.0-alpha.9 → 1.3.0-rc.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/development/components/RichText.cjs +12 -4
- package/dist/development/components/RichText.cjs.map +1 -1
- package/dist/development/components/RichText.js +12 -4
- package/dist/development/components/RichText.js.map +1 -1
- package/dist/development/components/RichTextBlocksRenderer.cjs +16 -4
- package/dist/development/components/RichTextBlocksRenderer.cjs.map +1 -1
- package/dist/development/components/RichTextBlocksRenderer.js +16 -4
- package/dist/development/components/RichTextBlocksRenderer.js.map +1 -1
- package/dist/development/components/RichTextFieldRenderer.cjs +11 -3
- package/dist/development/components/RichTextFieldRenderer.cjs.map +1 -1
- package/dist/development/components/RichTextFieldRenderer.js +11 -3
- package/dist/development/components/RichTextFieldRenderer.js.map +1 -1
- package/dist/development/components/RichTextRenderer.cjs +11 -3
- package/dist/development/components/RichTextRenderer.cjs.map +1 -1
- package/dist/development/components/RichTextRenderer.js +11 -3
- package/dist/development/components/RichTextRenderer.js.map +1 -1
- package/dist/development/hooks/useRichTextBlocksSource.cjs +4 -4
- package/dist/development/hooks/useRichTextBlocksSource.cjs.map +1 -1
- package/dist/development/hooks/useRichTextBlocksSource.js +4 -4
- package/dist/development/hooks/useRichTextBlocksSource.js.map +1 -1
- package/dist/development/internal/components/ElementRenderer.cjs +6 -2
- package/dist/development/internal/components/ElementRenderer.cjs.map +1 -1
- package/dist/development/internal/components/ElementRenderer.js +6 -2
- package/dist/development/internal/components/ElementRenderer.js.map +1 -1
- package/dist/development/internal/components/LeafRenderer.cjs +6 -2
- package/dist/development/internal/components/LeafRenderer.cjs.map +1 -1
- package/dist/development/internal/components/LeafRenderer.js +6 -2
- package/dist/development/internal/components/LeafRenderer.js.map +1 -1
- package/dist/development/internal/components/RenderElementFallback.cjs +100 -21
- package/dist/development/internal/components/RenderElementFallback.cjs.map +1 -1
- package/dist/development/internal/components/RenderElementFallback.js +100 -21
- package/dist/development/internal/components/RenderElementFallback.js.map +1 -1
- package/dist/development/internal/components/RenderLeafFallback.cjs +47 -11
- package/dist/development/internal/components/RenderLeafFallback.cjs.map +1 -1
- package/dist/development/internal/components/RenderLeafFallback.js +47 -11
- package/dist/development/internal/components/RenderLeafFallback.js.map +1 -1
- package/dist/development/internal/renderChildren.cjs +17 -5
- package/dist/development/internal/renderChildren.cjs.map +1 -1
- package/dist/development/internal/renderChildren.js +17 -5
- package/dist/development/internal/renderChildren.js.map +1 -1
- package/dist/development/internal/useReferenceMetadata.cjs +5 -0
- package/dist/development/internal/useReferenceMetadata.cjs.map +1 -1
- package/dist/development/internal/useReferenceMetadata.js +5 -0
- package/dist/development/internal/useReferenceMetadata.js.map +1 -1
- package/dist/production/hooks/useRichTextBlocksSource.cjs +4 -4
- package/dist/production/hooks/useRichTextBlocksSource.cjs.map +1 -1
- package/dist/production/hooks/useRichTextBlocksSource.js +4 -4
- package/dist/production/hooks/useRichTextBlocksSource.js.map +1 -1
- package/dist/types/components/RichText.d.ts.map +1 -1
- package/dist/types/components/RichTextBlocksRenderer.d.ts.map +1 -1
- package/dist/types/components/RichTextFieldRenderer.d.ts.map +1 -1
- package/dist/types/components/RichTextRenderer.d.ts.map +1 -1
- package/dist/types/hooks/useRichTextBlocksSource.d.ts.map +1 -1
- package/dist/types/hooks/useRichTextFieldSource.d.ts.map +1 -1
- package/dist/types/internal/defaultDeserialize.d.ts.map +1 -1
- package/dist/types/internal/renderChildren.d.ts.map +1 -1
- package/dist/types/internal/useReferenceMetadata.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/hooks/useRichTextBlocksSource.ts +4 -4
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const renderChildren = require("../internal/renderChildren.cjs");
|
|
6
6
|
const RichText = ({
|
|
7
7
|
blocks,
|
|
8
8
|
renderElement,
|
|
9
9
|
renderLeaf,
|
|
10
|
-
renderBlock = ({ children }) => /* @__PURE__ */
|
|
10
|
+
renderBlock = ({ children }) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children }, void 0, false, {
|
|
11
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichText.tsx",
|
|
12
|
+
lineNumber: 28,
|
|
13
|
+
columnNumber: 34
|
|
14
|
+
}, void 0),
|
|
11
15
|
attributeNamePrefix,
|
|
12
16
|
referenceRenderers,
|
|
13
17
|
undefinedReferenceHandler
|
|
14
18
|
}) => {
|
|
15
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: blocks.map((block, i) => react.createElement(
|
|
16
20
|
renderBlock,
|
|
17
21
|
{
|
|
18
22
|
block,
|
|
@@ -26,7 +30,11 @@ const RichText = ({
|
|
|
26
30
|
attributeNamePrefix,
|
|
27
31
|
undefinedReferenceHandler
|
|
28
32
|
}, block)
|
|
29
|
-
)) }
|
|
33
|
+
)) }, void 0, false, {
|
|
34
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichText.tsx",
|
|
35
|
+
lineNumber: 34,
|
|
36
|
+
columnNumber: 3
|
|
37
|
+
}, void 0);
|
|
30
38
|
};
|
|
31
39
|
exports.RichText = RichText;
|
|
32
40
|
//# sourceMappingURL=RichText.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.cjs","sources":["../../../src/components/RichText.tsx"],"sourcesContent":["import { createElement } from 'react'\nimport { renderChildren } from '../internal/renderChildren'\nimport type { RichTextBlock } from '../types'\nimport { RichTextElement, RichTextLeaf, RichTextRenderingOptions } from '../types'\n\nexport type RichTextProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t& {\n\t\tblocks: RichTextBlock<CustomElements, CustomLeaves>[]\n\t}\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts normalized decoded RichText blocks and renders them using the provided renderers.\n * To use decoders, use `RichTextBlocksRenderer` or `RichTextFieldRenderer` instead.\n *\n * @group Content rendering\n */\nexport const RichText = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\tblocks,\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\treferenceRenderers,\n\tundefinedReferenceHandler,\n}: RichTextProps<CustomElements, CustomLeaves>) => {\n\treturn (\n\t\t<>\n\t\t\t{blocks.map((block, i) => (\n\t\t\t\tcreateElement(\n\t\t\t\t\trenderBlock, {\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tkey: block.id ?? i,\n\t\t\t\t\t}, renderChildren(block.content.children, {\n\t\t\t\t\t\treferenceRenderers,\n\t\t\t\t\t\trenderBlock,\n\t\t\t\t\t\trenderLeaf,\n\t\t\t\t\t\trenderElement,\n\t\t\t\t\t\tattributeNamePrefix,\n\t\t\t\t\t\tundefinedReferenceHandler,\n\t\t\t\t\t}, block),\n\t\t\t\t)\n\t\t\t))}\n\t\t</>\n\t)\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"RichText.cjs","sources":["../../../src/components/RichText.tsx"],"sourcesContent":["import { createElement } from 'react'\nimport { renderChildren } from '../internal/renderChildren'\nimport type { RichTextBlock } from '../types'\nimport { RichTextElement, RichTextLeaf, RichTextRenderingOptions } from '../types'\n\nexport type RichTextProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t& {\n\t\tblocks: RichTextBlock<CustomElements, CustomLeaves>[]\n\t}\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts normalized decoded RichText blocks and renders them using the provided renderers.\n * To use decoders, use `RichTextBlocksRenderer` or `RichTextFieldRenderer` instead.\n *\n * @group Content rendering\n */\nexport const RichText = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\tblocks,\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\treferenceRenderers,\n\tundefinedReferenceHandler,\n}: RichTextProps<CustomElements, CustomLeaves>) => {\n\treturn (\n\t\t<>\n\t\t\t{blocks.map((block, i) => (\n\t\t\t\tcreateElement(\n\t\t\t\t\trenderBlock, {\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tkey: block.id ?? i,\n\t\t\t\t\t}, renderChildren(block.content.children, {\n\t\t\t\t\t\treferenceRenderers,\n\t\t\t\t\t\trenderBlock,\n\t\t\t\t\t\trenderLeaf,\n\t\t\t\t\t\trenderElement,\n\t\t\t\t\t\tattributeNamePrefix,\n\t\t\t\t\t\tundefinedReferenceHandler,\n\t\t\t\t\t}, block),\n\t\t\t\t)\n\t\t\t))}\n\t\t</>\n\t)\n}\n"],"names":["this","jsxDEV","Fragment","createElement","renderChildren"],"mappings":";;;;;AAoBO,MAAM,WAAW,CAGtB;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc,CAAC,EAAE,SAAS,qEAAS,SAAH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAY,GAAAA,MAAA;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AACD,MAAmD;AAClD,SAEGC,8BAAA,OAAAC,cAAA,UAAA,EAAA,UAAA,OAAO,IAAI,CAAC,OAAO,MACnBC,MAAA;AAAA,IACC;AAAA,IAAa;AAAA,MACZ;AAAA,MACA,KAAK,MAAM,MAAM;AAAA,IAClB;AAAA,IAAGC,8BAAe,MAAM,QAAQ,UAAU;AAAA,MACzC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,OACE,KAAK;AAAA,EAAA,CAET,EAfF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAgBA,GAAAJ,MAAA;AAEF;;"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
2
2
|
import { createElement } from "react";
|
|
3
3
|
import { renderChildren } from "../internal/renderChildren.js";
|
|
4
4
|
const RichText = ({
|
|
5
5
|
blocks,
|
|
6
6
|
renderElement,
|
|
7
7
|
renderLeaf,
|
|
8
|
-
renderBlock = ({ children }) => /* @__PURE__ */
|
|
8
|
+
renderBlock = ({ children }) => /* @__PURE__ */ jsxDEV(Fragment, { children }, void 0, false, {
|
|
9
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichText.tsx",
|
|
10
|
+
lineNumber: 28,
|
|
11
|
+
columnNumber: 34
|
|
12
|
+
}, void 0),
|
|
9
13
|
attributeNamePrefix,
|
|
10
14
|
referenceRenderers,
|
|
11
15
|
undefinedReferenceHandler
|
|
12
16
|
}) => {
|
|
13
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ jsxDEV(Fragment, { children: blocks.map((block, i) => createElement(
|
|
14
18
|
renderBlock,
|
|
15
19
|
{
|
|
16
20
|
block,
|
|
@@ -24,7 +28,11 @@ const RichText = ({
|
|
|
24
28
|
attributeNamePrefix,
|
|
25
29
|
undefinedReferenceHandler
|
|
26
30
|
}, block)
|
|
27
|
-
)) }
|
|
31
|
+
)) }, void 0, false, {
|
|
32
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichText.tsx",
|
|
33
|
+
lineNumber: 34,
|
|
34
|
+
columnNumber: 3
|
|
35
|
+
}, void 0);
|
|
28
36
|
};
|
|
29
37
|
export {
|
|
30
38
|
RichText
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.js","sources":["../../../src/components/RichText.tsx"],"sourcesContent":["import { createElement } from 'react'\nimport { renderChildren } from '../internal/renderChildren'\nimport type { RichTextBlock } from '../types'\nimport { RichTextElement, RichTextLeaf, RichTextRenderingOptions } from '../types'\n\nexport type RichTextProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t& {\n\t\tblocks: RichTextBlock<CustomElements, CustomLeaves>[]\n\t}\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts normalized decoded RichText blocks and renders them using the provided renderers.\n * To use decoders, use `RichTextBlocksRenderer` or `RichTextFieldRenderer` instead.\n *\n * @group Content rendering\n */\nexport const RichText = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\tblocks,\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\treferenceRenderers,\n\tundefinedReferenceHandler,\n}: RichTextProps<CustomElements, CustomLeaves>) => {\n\treturn (\n\t\t<>\n\t\t\t{blocks.map((block, i) => (\n\t\t\t\tcreateElement(\n\t\t\t\t\trenderBlock, {\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tkey: block.id ?? i,\n\t\t\t\t\t}, renderChildren(block.content.children, {\n\t\t\t\t\t\treferenceRenderers,\n\t\t\t\t\t\trenderBlock,\n\t\t\t\t\t\trenderLeaf,\n\t\t\t\t\t\trenderElement,\n\t\t\t\t\t\tattributeNamePrefix,\n\t\t\t\t\t\tundefinedReferenceHandler,\n\t\t\t\t\t}, block),\n\t\t\t\t)\n\t\t\t))}\n\t\t</>\n\t)\n}\n"],"names":[],"mappings":";;;AAoBO,MAAM,WAAW,CAGtB;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc,CAAC,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"RichText.js","sources":["../../../src/components/RichText.tsx"],"sourcesContent":["import { createElement } from 'react'\nimport { renderChildren } from '../internal/renderChildren'\nimport type { RichTextBlock } from '../types'\nimport { RichTextElement, RichTextLeaf, RichTextRenderingOptions } from '../types'\n\nexport type RichTextProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t& {\n\t\tblocks: RichTextBlock<CustomElements, CustomLeaves>[]\n\t}\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts normalized decoded RichText blocks and renders them using the provided renderers.\n * To use decoders, use `RichTextBlocksRenderer` or `RichTextFieldRenderer` instead.\n *\n * @group Content rendering\n */\nexport const RichText = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\tblocks,\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\treferenceRenderers,\n\tundefinedReferenceHandler,\n}: RichTextProps<CustomElements, CustomLeaves>) => {\n\treturn (\n\t\t<>\n\t\t\t{blocks.map((block, i) => (\n\t\t\t\tcreateElement(\n\t\t\t\t\trenderBlock, {\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tkey: block.id ?? i,\n\t\t\t\t\t}, renderChildren(block.content.children, {\n\t\t\t\t\t\treferenceRenderers,\n\t\t\t\t\t\trenderBlock,\n\t\t\t\t\t\trenderLeaf,\n\t\t\t\t\t\trenderElement,\n\t\t\t\t\t\tattributeNamePrefix,\n\t\t\t\t\t\tundefinedReferenceHandler,\n\t\t\t\t\t}, block),\n\t\t\t\t)\n\t\t\t))}\n\t\t</>\n\t)\n}\n"],"names":["this"],"mappings":";;;AAoBO,MAAM,WAAW,CAGtB;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc,CAAC,EAAE,SAAS,yCAAS,SAAH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAY,GAAAA,MAAA;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AACD,MAAmD;AAClD,SAEG,uBAAA,UAAA,EAAA,UAAA,OAAO,IAAI,CAAC,OAAO,MACnB;AAAA,IACC;AAAA,IAAa;AAAA,MACZ;AAAA,MACA,KAAK,MAAM,MAAM;AAAA,IAClB;AAAA,IAAG,eAAe,MAAM,QAAQ,UAAU;AAAA,MACzC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,OACE,KAAK;AAAA,EAAA,CAET,EAfF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAgBA,GAAAA,MAAA;AAEF;"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const RichText = require("./RichText.cjs");
|
|
5
5
|
const useRichTextBlocksSource = require("../hooks/useRichTextBlocksSource.cjs");
|
|
6
6
|
const RichTextBlocksRenderer = ({
|
|
7
7
|
renderElement,
|
|
8
8
|
renderLeaf,
|
|
9
|
-
renderBlock = ({ children }) => /* @__PURE__ */
|
|
9
|
+
renderBlock = ({ children }) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children }, void 0, false, {
|
|
10
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextBlocksRenderer.tsx",
|
|
11
|
+
lineNumber: 22,
|
|
12
|
+
columnNumber: 34
|
|
13
|
+
}, void 0),
|
|
10
14
|
attributeNamePrefix,
|
|
11
15
|
referenceRenderers,
|
|
12
16
|
undefinedReferenceHandler,
|
|
13
17
|
...props
|
|
14
18
|
}) => {
|
|
15
19
|
const blocks = useRichTextBlocksSource.useRichTextBlocksSource(props);
|
|
16
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
17
21
|
RichText.RichText,
|
|
18
22
|
{
|
|
19
23
|
blocks,
|
|
@@ -23,7 +27,15 @@ const RichTextBlocksRenderer = ({
|
|
|
23
27
|
referenceRenderers,
|
|
24
28
|
undefinedReferenceHandler,
|
|
25
29
|
attributeNamePrefix
|
|
26
|
-
}
|
|
30
|
+
},
|
|
31
|
+
void 0,
|
|
32
|
+
false,
|
|
33
|
+
{
|
|
34
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextBlocksRenderer.tsx",
|
|
35
|
+
lineNumber: 30,
|
|
36
|
+
columnNumber: 3
|
|
37
|
+
},
|
|
38
|
+
void 0
|
|
27
39
|
);
|
|
28
40
|
};
|
|
29
41
|
exports.RichTextBlocksRenderer = RichTextBlocksRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextBlocksRenderer.cjs","sources":["../../../src/components/RichTextBlocksRenderer.tsx"],"sourcesContent":["import { RichTextBlockSource, RichTextElement, RichTextLeaf, RichTextRenderingOptions } from '../types'\nimport { RichText } from './RichText'\nimport { useRichTextBlocksSource } from '../hooks'\n\nexport type { RichTextBlockSource }\n\nexport type RichTextBlocksRendererProps<CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf> =\n\t& RichTextBlockSource<CustomElements, CustomLeaves>\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts raw RichText blocks and renders them using the provided renderers.\n *\n * @group Content rendering\n */\nexport const RichTextBlocksRenderer = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\treferenceRenderers,\n\tundefinedReferenceHandler,\n\t...props\n}: RichTextBlocksRendererProps<CustomElements, CustomLeaves>) => {\n\tconst blocks = useRichTextBlocksSource<CustomElements, CustomLeaves>(props)\n\treturn (\n\t\t<RichText<CustomElements, CustomLeaves>\n\t\t\tblocks={blocks}\n\t\t\trenderElement={renderElement}\n\t\t\trenderLeaf={renderLeaf}\n\t\t\trenderBlock={renderBlock}\n\t\t\treferenceRenderers={referenceRenderers}\n\t\t\tundefinedReferenceHandler={undefinedReferenceHandler}\n\t\t\tattributeNamePrefix={attributeNamePrefix}\n\t\t/>\n\t)\n}\n"],"names":["useRichTextBlocksSource","
|
|
1
|
+
{"version":3,"file":"RichTextBlocksRenderer.cjs","sources":["../../../src/components/RichTextBlocksRenderer.tsx"],"sourcesContent":["import { RichTextBlockSource, RichTextElement, RichTextLeaf, RichTextRenderingOptions } from '../types'\nimport { RichText } from './RichText'\nimport { useRichTextBlocksSource } from '../hooks'\n\nexport type { RichTextBlockSource }\n\nexport type RichTextBlocksRendererProps<CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf> =\n\t& RichTextBlockSource<CustomElements, CustomLeaves>\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts raw RichText blocks and renders them using the provided renderers.\n *\n * @group Content rendering\n */\nexport const RichTextBlocksRenderer = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\treferenceRenderers,\n\tundefinedReferenceHandler,\n\t...props\n}: RichTextBlocksRendererProps<CustomElements, CustomLeaves>) => {\n\tconst blocks = useRichTextBlocksSource<CustomElements, CustomLeaves>(props)\n\treturn (\n\t\t<RichText<CustomElements, CustomLeaves>\n\t\t\tblocks={blocks}\n\t\t\trenderElement={renderElement}\n\t\t\trenderLeaf={renderLeaf}\n\t\t\trenderBlock={renderBlock}\n\t\t\treferenceRenderers={referenceRenderers}\n\t\t\tundefinedReferenceHandler={undefinedReferenceHandler}\n\t\t\tattributeNamePrefix={attributeNamePrefix}\n\t\t/>\n\t)\n}\n"],"names":["this","useRichTextBlocksSource","jsxDEV","RichText"],"mappings":";;;;;AAeO,MAAM,yBAAyB,CAGpC;AAAA,EACD;AAAA,EACA;AAAA,EACA,cAAc,CAAC,EAAE,SAAS,qEAAS,SAAH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAY,GAAAA,MAAA;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAiE;AAC1D,QAAA,SAASC,gDAAsD,KAAK;AAEzE,SAAAC,8BAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAPD;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAH;AAAAA,EAAA;AAUF;;"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
2
2
|
import { RichText } from "./RichText.js";
|
|
3
3
|
import { useRichTextBlocksSource } from "../hooks/useRichTextBlocksSource.js";
|
|
4
4
|
const RichTextBlocksRenderer = ({
|
|
5
5
|
renderElement,
|
|
6
6
|
renderLeaf,
|
|
7
|
-
renderBlock = ({ children }) => /* @__PURE__ */
|
|
7
|
+
renderBlock = ({ children }) => /* @__PURE__ */ jsxDEV(Fragment, { children }, void 0, false, {
|
|
8
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextBlocksRenderer.tsx",
|
|
9
|
+
lineNumber: 22,
|
|
10
|
+
columnNumber: 34
|
|
11
|
+
}, void 0),
|
|
8
12
|
attributeNamePrefix,
|
|
9
13
|
referenceRenderers,
|
|
10
14
|
undefinedReferenceHandler,
|
|
11
15
|
...props
|
|
12
16
|
}) => {
|
|
13
17
|
const blocks = useRichTextBlocksSource(props);
|
|
14
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ jsxDEV(
|
|
15
19
|
RichText,
|
|
16
20
|
{
|
|
17
21
|
blocks,
|
|
@@ -21,7 +25,15 @@ const RichTextBlocksRenderer = ({
|
|
|
21
25
|
referenceRenderers,
|
|
22
26
|
undefinedReferenceHandler,
|
|
23
27
|
attributeNamePrefix
|
|
24
|
-
}
|
|
28
|
+
},
|
|
29
|
+
void 0,
|
|
30
|
+
false,
|
|
31
|
+
{
|
|
32
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextBlocksRenderer.tsx",
|
|
33
|
+
lineNumber: 30,
|
|
34
|
+
columnNumber: 3
|
|
35
|
+
},
|
|
36
|
+
void 0
|
|
25
37
|
);
|
|
26
38
|
};
|
|
27
39
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextBlocksRenderer.js","sources":["../../../src/components/RichTextBlocksRenderer.tsx"],"sourcesContent":["import { RichTextBlockSource, RichTextElement, RichTextLeaf, RichTextRenderingOptions } from '../types'\nimport { RichText } from './RichText'\nimport { useRichTextBlocksSource } from '../hooks'\n\nexport type { RichTextBlockSource }\n\nexport type RichTextBlocksRendererProps<CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf> =\n\t& RichTextBlockSource<CustomElements, CustomLeaves>\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts raw RichText blocks and renders them using the provided renderers.\n *\n * @group Content rendering\n */\nexport const RichTextBlocksRenderer = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\treferenceRenderers,\n\tundefinedReferenceHandler,\n\t...props\n}: RichTextBlocksRendererProps<CustomElements, CustomLeaves>) => {\n\tconst blocks = useRichTextBlocksSource<CustomElements, CustomLeaves>(props)\n\treturn (\n\t\t<RichText<CustomElements, CustomLeaves>\n\t\t\tblocks={blocks}\n\t\t\trenderElement={renderElement}\n\t\t\trenderLeaf={renderLeaf}\n\t\t\trenderBlock={renderBlock}\n\t\t\treferenceRenderers={referenceRenderers}\n\t\t\tundefinedReferenceHandler={undefinedReferenceHandler}\n\t\t\tattributeNamePrefix={attributeNamePrefix}\n\t\t/>\n\t)\n}\n"],"names":[],"mappings":";;;AAeO,MAAM,yBAAyB,CAGpC;AAAA,EACD;AAAA,EACA;AAAA,EACA,cAAc,CAAC,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"RichTextBlocksRenderer.js","sources":["../../../src/components/RichTextBlocksRenderer.tsx"],"sourcesContent":["import { RichTextBlockSource, RichTextElement, RichTextLeaf, RichTextRenderingOptions } from '../types'\nimport { RichText } from './RichText'\nimport { useRichTextBlocksSource } from '../hooks'\n\nexport type { RichTextBlockSource }\n\nexport type RichTextBlocksRendererProps<CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf> =\n\t& RichTextBlockSource<CustomElements, CustomLeaves>\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts raw RichText blocks and renders them using the provided renderers.\n *\n * @group Content rendering\n */\nexport const RichTextBlocksRenderer = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\treferenceRenderers,\n\tundefinedReferenceHandler,\n\t...props\n}: RichTextBlocksRendererProps<CustomElements, CustomLeaves>) => {\n\tconst blocks = useRichTextBlocksSource<CustomElements, CustomLeaves>(props)\n\treturn (\n\t\t<RichText<CustomElements, CustomLeaves>\n\t\t\tblocks={blocks}\n\t\t\trenderElement={renderElement}\n\t\t\trenderLeaf={renderLeaf}\n\t\t\trenderBlock={renderBlock}\n\t\t\treferenceRenderers={referenceRenderers}\n\t\t\tundefinedReferenceHandler={undefinedReferenceHandler}\n\t\t\tattributeNamePrefix={attributeNamePrefix}\n\t\t/>\n\t)\n}\n"],"names":["this"],"mappings":";;;AAeO,MAAM,yBAAyB,CAGpC;AAAA,EACD;AAAA,EACA;AAAA,EACA,cAAc,CAAC,EAAE,SAAS,yCAAS,SAAH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAY,GAAAA,MAAA;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAiE;AAC1D,QAAA,SAAS,wBAAsD,KAAK;AAEzE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAPD;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAUF;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const RichText = require("./RichText.cjs");
|
|
5
5
|
const useRichTextFieldSource = require("../hooks/useRichTextFieldSource.cjs");
|
|
6
6
|
const RichTextFieldRenderer = ({
|
|
@@ -12,7 +12,7 @@ const RichTextFieldRenderer = ({
|
|
|
12
12
|
...source
|
|
13
13
|
}) => {
|
|
14
14
|
const blocks = useRichTextFieldSource.useRichTextFieldSource(source);
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
16
16
|
RichText.RichText,
|
|
17
17
|
{
|
|
18
18
|
blocks,
|
|
@@ -21,7 +21,15 @@ const RichTextFieldRenderer = ({
|
|
|
21
21
|
renderBlock,
|
|
22
22
|
attributeNamePrefix,
|
|
23
23
|
undefinedReferenceHandler
|
|
24
|
-
}
|
|
24
|
+
},
|
|
25
|
+
void 0,
|
|
26
|
+
false,
|
|
27
|
+
{
|
|
28
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextFieldRenderer.tsx",
|
|
29
|
+
lineNumber: 33,
|
|
30
|
+
columnNumber: 3
|
|
31
|
+
},
|
|
32
|
+
void 0
|
|
25
33
|
);
|
|
26
34
|
};
|
|
27
35
|
exports.RichTextFieldRenderer = RichTextFieldRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextFieldRenderer.cjs","sources":["../../../src/components/RichTextFieldRenderer.tsx"],"sourcesContent":["import { RichText } from './RichText'\nimport { RichTextElement, RichTextFieldSource, RichTextLeaf, RichTextRenderingOptions } from '../types'\nimport { useRichTextFieldSource } from '../hooks'\n\nexport type { RichTextFieldSource }\n\nexport type RichTextFieldRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t& RichTextFieldSource<CustomElements, CustomLeaves>\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts raw RichText field source and renders them using the provided renderers.\n *\n * @group Content rendering\n */\nexport const RichTextFieldRenderer = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\trenderLeaf,\n\trenderBlock,\n\trenderElement,\n\tattributeNamePrefix,\n\tundefinedReferenceHandler,\n\t...source\n}: RichTextFieldRendererProps<CustomElements, CustomLeaves>) => {\n\tconst blocks = useRichTextFieldSource(source)\n\n\treturn (\n\t\t<RichText<CustomElements, CustomLeaves>\n\t\t\tblocks={blocks}\n\t\t\trenderElement={renderElement}\n\t\t\trenderLeaf={renderLeaf}\n\t\t\trenderBlock={renderBlock}\n\t\t\tattributeNamePrefix={attributeNamePrefix}\n\t\t\tundefinedReferenceHandler={undefinedReferenceHandler}\n\t\t/>\n\t)\n}\n"],"names":["useRichTextFieldSource","
|
|
1
|
+
{"version":3,"file":"RichTextFieldRenderer.cjs","sources":["../../../src/components/RichTextFieldRenderer.tsx"],"sourcesContent":["import { RichText } from './RichText'\nimport { RichTextElement, RichTextFieldSource, RichTextLeaf, RichTextRenderingOptions } from '../types'\nimport { useRichTextFieldSource } from '../hooks'\n\nexport type { RichTextFieldSource }\n\nexport type RichTextFieldRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t& RichTextFieldSource<CustomElements, CustomLeaves>\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts raw RichText field source and renders them using the provided renderers.\n *\n * @group Content rendering\n */\nexport const RichTextFieldRenderer = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\trenderLeaf,\n\trenderBlock,\n\trenderElement,\n\tattributeNamePrefix,\n\tundefinedReferenceHandler,\n\t...source\n}: RichTextFieldRendererProps<CustomElements, CustomLeaves>) => {\n\tconst blocks = useRichTextFieldSource(source)\n\n\treturn (\n\t\t<RichText<CustomElements, CustomLeaves>\n\t\t\tblocks={blocks}\n\t\t\trenderElement={renderElement}\n\t\t\trenderLeaf={renderLeaf}\n\t\t\trenderBlock={renderBlock}\n\t\t\tattributeNamePrefix={attributeNamePrefix}\n\t\t\tundefinedReferenceHandler={undefinedReferenceHandler}\n\t\t/>\n\t)\n}\n"],"names":["useRichTextFieldSource","jsxDEV","RichText","this"],"mappings":";;;;;AAkBO,MAAM,wBAAwB,CAGnC;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAgE;AACzD,QAAA,SAASA,8CAAuB,MAAM;AAG3C,SAAAC,8BAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAND;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AASF;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { RichText } from "./RichText.js";
|
|
3
3
|
import { useRichTextFieldSource } from "../hooks/useRichTextFieldSource.js";
|
|
4
4
|
const RichTextFieldRenderer = ({
|
|
@@ -10,7 +10,7 @@ const RichTextFieldRenderer = ({
|
|
|
10
10
|
...source
|
|
11
11
|
}) => {
|
|
12
12
|
const blocks = useRichTextFieldSource(source);
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ jsxDEV(
|
|
14
14
|
RichText,
|
|
15
15
|
{
|
|
16
16
|
blocks,
|
|
@@ -19,7 +19,15 @@ const RichTextFieldRenderer = ({
|
|
|
19
19
|
renderBlock,
|
|
20
20
|
attributeNamePrefix,
|
|
21
21
|
undefinedReferenceHandler
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
|
+
void 0,
|
|
24
|
+
false,
|
|
25
|
+
{
|
|
26
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextFieldRenderer.tsx",
|
|
27
|
+
lineNumber: 33,
|
|
28
|
+
columnNumber: 3
|
|
29
|
+
},
|
|
30
|
+
void 0
|
|
23
31
|
);
|
|
24
32
|
};
|
|
25
33
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextFieldRenderer.js","sources":["../../../src/components/RichTextFieldRenderer.tsx"],"sourcesContent":["import { RichText } from './RichText'\nimport { RichTextElement, RichTextFieldSource, RichTextLeaf, RichTextRenderingOptions } from '../types'\nimport { useRichTextFieldSource } from '../hooks'\n\nexport type { RichTextFieldSource }\n\nexport type RichTextFieldRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t& RichTextFieldSource<CustomElements, CustomLeaves>\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts raw RichText field source and renders them using the provided renderers.\n *\n * @group Content rendering\n */\nexport const RichTextFieldRenderer = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\trenderLeaf,\n\trenderBlock,\n\trenderElement,\n\tattributeNamePrefix,\n\tundefinedReferenceHandler,\n\t...source\n}: RichTextFieldRendererProps<CustomElements, CustomLeaves>) => {\n\tconst blocks = useRichTextFieldSource(source)\n\n\treturn (\n\t\t<RichText<CustomElements, CustomLeaves>\n\t\t\tblocks={blocks}\n\t\t\trenderElement={renderElement}\n\t\t\trenderLeaf={renderLeaf}\n\t\t\trenderBlock={renderBlock}\n\t\t\tattributeNamePrefix={attributeNamePrefix}\n\t\t\tundefinedReferenceHandler={undefinedReferenceHandler}\n\t\t/>\n\t)\n}\n"],"names":[],"mappings":";;;AAkBO,MAAM,wBAAwB,CAGnC;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAgE;AACzD,QAAA,SAAS,uBAAuB,MAAM;AAG3C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;
|
|
1
|
+
{"version":3,"file":"RichTextFieldRenderer.js","sources":["../../../src/components/RichTextFieldRenderer.tsx"],"sourcesContent":["import { RichText } from './RichText'\nimport { RichTextElement, RichTextFieldSource, RichTextLeaf, RichTextRenderingOptions } from '../types'\nimport { useRichTextFieldSource } from '../hooks'\n\nexport type { RichTextFieldSource }\n\nexport type RichTextFieldRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t& RichTextFieldSource<CustomElements, CustomLeaves>\n\t& RichTextRenderingOptions<CustomElements, CustomLeaves>\n\n/**\n * Accepts raw RichText field source and renders them using the provided renderers.\n *\n * @group Content rendering\n */\nexport const RichTextFieldRenderer = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\trenderLeaf,\n\trenderBlock,\n\trenderElement,\n\tattributeNamePrefix,\n\tundefinedReferenceHandler,\n\t...source\n}: RichTextFieldRendererProps<CustomElements, CustomLeaves>) => {\n\tconst blocks = useRichTextFieldSource(source)\n\n\treturn (\n\t\t<RichText<CustomElements, CustomLeaves>\n\t\t\tblocks={blocks}\n\t\t\trenderElement={renderElement}\n\t\t\trenderLeaf={renderLeaf}\n\t\t\trenderBlock={renderBlock}\n\t\t\tattributeNamePrefix={attributeNamePrefix}\n\t\t\tundefinedReferenceHandler={undefinedReferenceHandler}\n\t\t/>\n\t)\n}\n"],"names":["this"],"mappings":";;;AAkBO,MAAM,wBAAwB,CAGnC;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAgE;AACzD,QAAA,SAAS,uBAAuB,MAAM;AAG3C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAND;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AASF;"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const RichTextFieldRenderer = require("./RichTextFieldRenderer.cjs");
|
|
6
6
|
const RichTextBlocksRenderer = require("./RichTextBlocksRenderer.cjs");
|
|
7
7
|
const RichTextRenderer = react.memo(function RichTextRenderer2(props) {
|
|
8
8
|
if ("source" in props) {
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(RichTextFieldRenderer.RichTextFieldRenderer, { ...props }, void 0, false, {
|
|
10
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextRenderer.tsx",
|
|
11
|
+
lineNumber: 25,
|
|
12
|
+
columnNumber: 10
|
|
13
|
+
}, this);
|
|
10
14
|
}
|
|
11
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(RichTextBlocksRenderer.RichTextBlocksRenderer, { ...props }, void 0, false, {
|
|
16
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextRenderer.tsx",
|
|
17
|
+
lineNumber: 28,
|
|
18
|
+
columnNumber: 9
|
|
19
|
+
}, this);
|
|
12
20
|
});
|
|
13
21
|
exports.RichTextRenderer = RichTextRenderer;
|
|
14
22
|
//# sourceMappingURL=RichTextRenderer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRenderer.cjs","sources":["../../../src/components/RichTextRenderer.tsx"],"sourcesContent":["import { memo, ReactElement } from 'react'\nimport type { RichTextElement } from '../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../types/structure/RichTextLeaf'\nimport { RichTextFieldRenderer, RichTextFieldRendererProps } from './RichTextFieldRenderer'\nimport { RichTextBlocksRenderer, RichTextBlocksRendererProps } from './RichTextBlocksRenderer'\n\n\nexport type RichTextRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t| RichTextFieldRendererProps<CustomElements, CustomLeaves>\n\t| RichTextBlocksRendererProps<CustomElements, CustomLeaves>\n\n/**\n * @deprecated Use `RichTextBlocksRenderer` or `RichTextFieldRenderer` instead, or directly use `RichText`.\n * @group Content rendering\n */\nexport const RichTextRenderer = memo(function RichTextRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>(props: RichTextRendererProps<CustomElements, CustomLeaves>) {\n\n\tif ('source' in props) {\n\t\treturn <RichTextFieldRenderer<CustomElements, CustomLeaves> {...props} />\n\t}\n\n\treturn <RichTextBlocksRenderer<CustomElements, CustomLeaves> {...props} />\n}) as <CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf>(\n\tprops: RichTextRendererProps<CustomElements, CustomLeaves>,\n) => ReactElement\n"],"names":["memo","RichTextRenderer","
|
|
1
|
+
{"version":3,"file":"RichTextRenderer.cjs","sources":["../../../src/components/RichTextRenderer.tsx"],"sourcesContent":["import { memo, ReactElement } from 'react'\nimport type { RichTextElement } from '../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../types/structure/RichTextLeaf'\nimport { RichTextFieldRenderer, RichTextFieldRendererProps } from './RichTextFieldRenderer'\nimport { RichTextBlocksRenderer, RichTextBlocksRendererProps } from './RichTextBlocksRenderer'\n\n\nexport type RichTextRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t| RichTextFieldRendererProps<CustomElements, CustomLeaves>\n\t| RichTextBlocksRendererProps<CustomElements, CustomLeaves>\n\n/**\n * @deprecated Use `RichTextBlocksRenderer` or `RichTextFieldRenderer` instead, or directly use `RichText`.\n * @group Content rendering\n */\nexport const RichTextRenderer = memo(function RichTextRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>(props: RichTextRendererProps<CustomElements, CustomLeaves>) {\n\n\tif ('source' in props) {\n\t\treturn <RichTextFieldRenderer<CustomElements, CustomLeaves> {...props} />\n\t}\n\n\treturn <RichTextBlocksRenderer<CustomElements, CustomLeaves> {...props} />\n}) as <CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf>(\n\tprops: RichTextRendererProps<CustomElements, CustomLeaves>,\n) => ReactElement\n"],"names":["memo","RichTextRenderer","jsxDEV","RichTextFieldRenderer","RichTextBlocksRenderer"],"mappings":";;;;;;AAkBO,MAAM,mBAAmBA,MAAA,KAAK,SAASC,kBAG5C,OAA4D;AAE7D,MAAI,YAAY,OAAO;AACf,WAAAC,8BAAAA,OAACC,sBAAAA,uBAAqD,EAAA,GAAG,MAAzD,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAgE,GAAA,IAAA;AAAA,EACxE;AAEO,SAAAD,8BAAAA,OAACE,uBAAAA,wBAAsD,EAAA,GAAG,MAA1D,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAiE,GAAA,IAAA;AACzE,CAAC;;"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { RichTextFieldRenderer } from "./RichTextFieldRenderer.js";
|
|
4
4
|
import { RichTextBlocksRenderer } from "./RichTextBlocksRenderer.js";
|
|
5
5
|
const RichTextRenderer = memo(function RichTextRenderer2(props) {
|
|
6
6
|
if ("source" in props) {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsxDEV(RichTextFieldRenderer, { ...props }, void 0, false, {
|
|
8
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextRenderer.tsx",
|
|
9
|
+
lineNumber: 25,
|
|
10
|
+
columnNumber: 10
|
|
11
|
+
}, this);
|
|
8
12
|
}
|
|
9
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ jsxDEV(RichTextBlocksRenderer, { ...props }, void 0, false, {
|
|
14
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/components/RichTextRenderer.tsx",
|
|
15
|
+
lineNumber: 28,
|
|
16
|
+
columnNumber: 9
|
|
17
|
+
}, this);
|
|
10
18
|
});
|
|
11
19
|
export {
|
|
12
20
|
RichTextRenderer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRenderer.js","sources":["../../../src/components/RichTextRenderer.tsx"],"sourcesContent":["import { memo, ReactElement } from 'react'\nimport type { RichTextElement } from '../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../types/structure/RichTextLeaf'\nimport { RichTextFieldRenderer, RichTextFieldRendererProps } from './RichTextFieldRenderer'\nimport { RichTextBlocksRenderer, RichTextBlocksRendererProps } from './RichTextBlocksRenderer'\n\n\nexport type RichTextRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t| RichTextFieldRendererProps<CustomElements, CustomLeaves>\n\t| RichTextBlocksRendererProps<CustomElements, CustomLeaves>\n\n/**\n * @deprecated Use `RichTextBlocksRenderer` or `RichTextFieldRenderer` instead, or directly use `RichText`.\n * @group Content rendering\n */\nexport const RichTextRenderer = memo(function RichTextRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>(props: RichTextRendererProps<CustomElements, CustomLeaves>) {\n\n\tif ('source' in props) {\n\t\treturn <RichTextFieldRenderer<CustomElements, CustomLeaves> {...props} />\n\t}\n\n\treturn <RichTextBlocksRenderer<CustomElements, CustomLeaves> {...props} />\n}) as <CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf>(\n\tprops: RichTextRendererProps<CustomElements, CustomLeaves>,\n) => ReactElement\n"],"names":["RichTextRenderer"],"mappings":";;;;AAkBO,MAAM,mBAAmB,KAAK,SAASA,kBAG5C,OAA4D;AAE7D,MAAI,YAAY,OAAO;AACf,WAAA,
|
|
1
|
+
{"version":3,"file":"RichTextRenderer.js","sources":["../../../src/components/RichTextRenderer.tsx"],"sourcesContent":["import { memo, ReactElement } from 'react'\nimport type { RichTextElement } from '../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../types/structure/RichTextLeaf'\nimport { RichTextFieldRenderer, RichTextFieldRendererProps } from './RichTextFieldRenderer'\nimport { RichTextBlocksRenderer, RichTextBlocksRendererProps } from './RichTextBlocksRenderer'\n\n\nexport type RichTextRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> =\n\t| RichTextFieldRendererProps<CustomElements, CustomLeaves>\n\t| RichTextBlocksRendererProps<CustomElements, CustomLeaves>\n\n/**\n * @deprecated Use `RichTextBlocksRenderer` or `RichTextFieldRenderer` instead, or directly use `RichText`.\n * @group Content rendering\n */\nexport const RichTextRenderer = memo(function RichTextRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>(props: RichTextRendererProps<CustomElements, CustomLeaves>) {\n\n\tif ('source' in props) {\n\t\treturn <RichTextFieldRenderer<CustomElements, CustomLeaves> {...props} />\n\t}\n\n\treturn <RichTextBlocksRenderer<CustomElements, CustomLeaves> {...props} />\n}) as <CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf>(\n\tprops: RichTextRendererProps<CustomElements, CustomLeaves>,\n) => ReactElement\n"],"names":["RichTextRenderer"],"mappings":";;;;AAkBO,MAAM,mBAAmB,KAAK,SAASA,kBAG5C,OAA4D;AAE7D,MAAI,YAAY,OAAO;AACf,WAAA,uBAAC,uBAAqD,EAAA,GAAG,MAAzD,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAgE,GAAA,IAAA;AAAA,EACxE;AAEO,SAAA,uBAAC,wBAAsD,EAAA,GAAG,MAA1D,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAiE,GAAA,IAAA;AACzE,CAAC;"}
|
|
@@ -6,16 +6,16 @@ const RichTextRendererError = require("../RichTextRendererError.cjs");
|
|
|
6
6
|
const useRichTextBlocksSource = ({
|
|
7
7
|
deserialize = defaultDeserialize.defaultDeserialize,
|
|
8
8
|
blocks,
|
|
9
|
-
referencesField
|
|
10
|
-
sourceField
|
|
11
|
-
referenceDiscriminationField
|
|
9
|
+
referencesField,
|
|
10
|
+
sourceField,
|
|
11
|
+
referenceDiscriminationField
|
|
12
12
|
}) => {
|
|
13
13
|
return react.useMemo(() => {
|
|
14
14
|
const sourceFieldResolved = sourceField ?? "source";
|
|
15
15
|
const referencesFieldResolved = referencesField ?? "references";
|
|
16
16
|
const referenceDiscriminationFieldResolved = referenceDiscriminationField ?? "type";
|
|
17
17
|
return blocks.map((block) => {
|
|
18
|
-
if (!(
|
|
18
|
+
if (!(sourceFieldResolved in block)) {
|
|
19
19
|
throw new RichTextRendererError.RichTextRendererError(
|
|
20
20
|
`Found a block without a '${sourceFieldResolved}' field. ` + (sourceField === void 0 ? `The 'sourceField' prop has not been supplied, and so '${sourceFieldResolved}' was used as a default.` : `That is what the 'sourceField' prop has been set to, and so either this is a typo, or the data supplied is invalid.`)
|
|
21
21
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRichTextBlocksSource.cjs","sources":["../../../src/hooks/useRichTextBlocksSource.ts"],"sourcesContent":["import { RichTextBlock, RichTextBlockSource, RichTextElement, RichTextLeaf, RichTextReference, RootEditorNode } from '../types'\nimport { defaultDeserialize } from '../internal/defaultDeserialize'\nimport { useMemo } from 'react'\nimport { RichTextRendererError } from '../RichTextRendererError'\n\nexport const useRichTextBlocksSource = <CustomElements extends RichTextElement, CustomLeaves extends RichTextLeaf>({\n\tdeserialize = defaultDeserialize,\n\tblocks,\n\treferencesField
|
|
1
|
+
{"version":3,"file":"useRichTextBlocksSource.cjs","sources":["../../../src/hooks/useRichTextBlocksSource.ts"],"sourcesContent":["import { RichTextBlock, RichTextBlockSource, RichTextElement, RichTextLeaf, RichTextReference, RootEditorNode } from '../types'\nimport { defaultDeserialize } from '../internal/defaultDeserialize'\nimport { useMemo } from 'react'\nimport { RichTextRendererError } from '../RichTextRendererError'\n\nexport const useRichTextBlocksSource = <CustomElements extends RichTextElement, CustomLeaves extends RichTextLeaf>({\n\tdeserialize = defaultDeserialize,\n\tblocks,\n\treferencesField,\n\tsourceField,\n\treferenceDiscriminationField,\n}: RichTextBlockSource<CustomElements, CustomLeaves>) => {\n\treturn useMemo((): RichTextBlock<CustomElements, CustomLeaves>[] => {\n\t\tconst sourceFieldResolved = sourceField ?? 'source'\n\t\tconst referencesFieldResolved = referencesField ?? 'references'\n\t\tconst referenceDiscriminationFieldResolved = referenceDiscriminationField ?? 'type'\n\n\t\treturn blocks.map(block => {\n\t\t\tif (!(sourceFieldResolved in block)) {\n\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t`Found a block without a '${sourceFieldResolved}' field. ` +\n\t\t\t\t\t(sourceField === undefined\n\t\t\t\t\t\t? `The 'sourceField' prop has not been supplied, and so '${sourceFieldResolved}' was used as a default.`\n\t\t\t\t\t\t: `That is what the 'sourceField' prop has been set to, and so either this is a typo, ` +\n\t\t\t\t\t\t`or the data supplied is invalid.`),\n\t\t\t\t)\n\t\t\t}\n\t\t\tconst source = block[sourceFieldResolved]\n\t\t\tif (typeof source !== 'string' && (typeof source !== 'object' || source === null)) {\n\t\t\t\tthrow new RichTextRendererError(`Found a block whose source is not a string or an object.`)\n\t\t\t}\n\n\t\t\tif (referencesField !== undefined && !(referencesFieldResolved in block)) {\n\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t`The 'referencesField' prop is set to '${referencesFieldResolved}' but a block without such field ` +\n\t\t\t\t\t`has been encountered. Unless this is just a typo, ` +\n\t\t\t\t\t`if you do not wish to use references, avoid supplying the 'referencesField' prop.`,\n\t\t\t\t)\n\t\t\t}\n\t\t\tconst references = block[referencesFieldResolved]\n\n\t\t\tlet normalizedReferences: Record<string, RichTextReference> | undefined = undefined\n\t\t\tif (references) {\n\t\t\t\tif (typeof Object(references)[Symbol.iterator] !== 'function') {\n\t\t\t\t\tthrow new RichTextRendererError(`The set of references must be an iterable!`)\n\t\t\t\t}\n\n\t\t\t\tnormalizedReferences = Object.fromEntries(Array.from(references as Iterable<RichTextReference>).map(reference => {\n\t\t\t\t\tif (!('id' in reference)) {\n\t\t\t\t\t\tthrow new RichTextRendererError(`Found a reference without an id field.`)\n\t\t\t\t\t}\n\t\t\t\t\tif (!(referenceDiscriminationFieldResolved in reference) || typeof reference[referenceDiscriminationFieldResolved] !== 'string') {\n\t\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t\t`Found a reference without a '${referenceDiscriminationFieldResolved}' field. ` +\n\t\t\t\t\t\t\t(referenceDiscriminationField === undefined\n\t\t\t\t\t\t\t\t? `The 'referenceDiscriminationField' prop has not been supplied, ` +\n\t\t\t\t\t\t\t\t`and so '${referenceDiscriminationFieldResolved}' was used as a default.`\n\t\t\t\t\t\t\t\t: `That is what the 'referenceDiscriminationField' prop has been set to, ` +\n\t\t\t\t\t\t\t\t`and so either this is a typo, or the data supplied is invalid.`),\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\treturn [reference.id, {\n\t\t\t\t\t\t...reference,\n\t\t\t\t\t\ttype: reference[referenceDiscriminationFieldResolved] as string,\n\t\t\t\t\t}]\n\t\t\t\t}))\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tid: typeof block.id === 'string' ? block.id : undefined,\n\t\t\t\tcontent: typeof source === 'string' ? deserialize(source) : source as RootEditorNode<CustomElements, CustomLeaves>,\n\t\t\t\treferences: normalizedReferences,\n\t\t\t}\n\t\t})\n\t}, [blocks, deserialize, referenceDiscriminationField, referencesField, sourceField])\n}\n"],"names":["defaultDeserialize","useMemo","RichTextRendererError"],"mappings":";;;;;AAKO,MAAM,0BAA0B,CAA4E;AAAA,EAClH,cAAcA,mBAAA;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAyD;AACxD,SAAOC,cAAQ,MAAqD;AACnE,UAAM,sBAAsB,eAAe;AAC3C,UAAM,0BAA0B,mBAAmB;AACnD,UAAM,uCAAuC,gCAAgC;AAEtE,WAAA,OAAO,IAAI,CAAS,UAAA;AACtB,UAAA,EAAE,uBAAuB,QAAQ;AACpC,cAAM,IAAIC,sBAAA;AAAA,UACT,4BAA4B,mBAAmB,eAC9C,gBAAgB,SACd,yDAAyD,mBAAmB,6BAC5E;AAAA,QAAA;AAAA,MAGL;AACM,YAAA,SAAS,MAAM,mBAAmB;AACxC,UAAI,OAAO,WAAW,aAAa,OAAO,WAAW,YAAY,WAAW,OAAO;AAC5E,cAAA,IAAIA,4CAAsB,0DAA0D;AAAA,MAC3F;AAEA,UAAI,oBAAoB,UAAa,EAAE,2BAA2B,QAAQ;AACzE,cAAM,IAAIA,sBAAA;AAAA,UACT,yCAAyC,uBAAuB;AAAA,QAAA;AAAA,MAIlE;AACM,YAAA,aAAa,MAAM,uBAAuB;AAEhD,UAAI,uBAAsE;AAC1E,UAAI,YAAY;AACf,YAAI,OAAO,OAAO,UAAU,EAAE,OAAO,QAAQ,MAAM,YAAY;AACxD,gBAAA,IAAIA,4CAAsB,4CAA4C;AAAA,QAC7E;AAEA,+BAAuB,OAAO,YAAY,MAAM,KAAK,UAAyC,EAAE,IAAI,CAAa,cAAA;AAC5G,cAAA,EAAE,QAAQ,YAAY;AACnB,kBAAA,IAAIA,4CAAsB,wCAAwC;AAAA,UACzE;AACA,cAAI,EAAE,wCAAwC,cAAc,OAAO,UAAU,oCAAoC,MAAM,UAAU;AAChI,kBAAM,IAAIA,sBAAA;AAAA,cACT,gCAAgC,oCAAoC,eACnE,iCAAiC,SAC/B,0EACS,oCAAoC,6BAC7C;AAAA,YAAA;AAAA,UAGL;AACO,iBAAA,CAAC,UAAU,IAAI;AAAA,YACrB,GAAG;AAAA,YACH,MAAM,UAAU,oCAAoC;AAAA,UAAA,CACpD;AAAA,QACD,CAAA,CAAC;AAAA,MACH;AACO,aAAA;AAAA,QACN,IAAI,OAAO,MAAM,OAAO,WAAW,MAAM,KAAK;AAAA,QAC9C,SAAS,OAAO,WAAW,WAAW,YAAY,MAAM,IAAI;AAAA,QAC5D,YAAY;AAAA,MAAA;AAAA,IACb,CACA;AAAA,EAAA,GACC,CAAC,QAAQ,aAAa,8BAA8B,iBAAiB,WAAW,CAAC;AACrF;;"}
|
|
@@ -4,16 +4,16 @@ import { RichTextRendererError } from "../RichTextRendererError.js";
|
|
|
4
4
|
const useRichTextBlocksSource = ({
|
|
5
5
|
deserialize = defaultDeserialize,
|
|
6
6
|
blocks,
|
|
7
|
-
referencesField
|
|
8
|
-
sourceField
|
|
9
|
-
referenceDiscriminationField
|
|
7
|
+
referencesField,
|
|
8
|
+
sourceField,
|
|
9
|
+
referenceDiscriminationField
|
|
10
10
|
}) => {
|
|
11
11
|
return useMemo(() => {
|
|
12
12
|
const sourceFieldResolved = sourceField ?? "source";
|
|
13
13
|
const referencesFieldResolved = referencesField ?? "references";
|
|
14
14
|
const referenceDiscriminationFieldResolved = referenceDiscriminationField ?? "type";
|
|
15
15
|
return blocks.map((block) => {
|
|
16
|
-
if (!(
|
|
16
|
+
if (!(sourceFieldResolved in block)) {
|
|
17
17
|
throw new RichTextRendererError(
|
|
18
18
|
`Found a block without a '${sourceFieldResolved}' field. ` + (sourceField === void 0 ? `The 'sourceField' prop has not been supplied, and so '${sourceFieldResolved}' was used as a default.` : `That is what the 'sourceField' prop has been set to, and so either this is a typo, or the data supplied is invalid.`)
|
|
19
19
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRichTextBlocksSource.js","sources":["../../../src/hooks/useRichTextBlocksSource.ts"],"sourcesContent":["import { RichTextBlock, RichTextBlockSource, RichTextElement, RichTextLeaf, RichTextReference, RootEditorNode } from '../types'\nimport { defaultDeserialize } from '../internal/defaultDeserialize'\nimport { useMemo } from 'react'\nimport { RichTextRendererError } from '../RichTextRendererError'\n\nexport const useRichTextBlocksSource = <CustomElements extends RichTextElement, CustomLeaves extends RichTextLeaf>({\n\tdeserialize = defaultDeserialize,\n\tblocks,\n\treferencesField
|
|
1
|
+
{"version":3,"file":"useRichTextBlocksSource.js","sources":["../../../src/hooks/useRichTextBlocksSource.ts"],"sourcesContent":["import { RichTextBlock, RichTextBlockSource, RichTextElement, RichTextLeaf, RichTextReference, RootEditorNode } from '../types'\nimport { defaultDeserialize } from '../internal/defaultDeserialize'\nimport { useMemo } from 'react'\nimport { RichTextRendererError } from '../RichTextRendererError'\n\nexport const useRichTextBlocksSource = <CustomElements extends RichTextElement, CustomLeaves extends RichTextLeaf>({\n\tdeserialize = defaultDeserialize,\n\tblocks,\n\treferencesField,\n\tsourceField,\n\treferenceDiscriminationField,\n}: RichTextBlockSource<CustomElements, CustomLeaves>) => {\n\treturn useMemo((): RichTextBlock<CustomElements, CustomLeaves>[] => {\n\t\tconst sourceFieldResolved = sourceField ?? 'source'\n\t\tconst referencesFieldResolved = referencesField ?? 'references'\n\t\tconst referenceDiscriminationFieldResolved = referenceDiscriminationField ?? 'type'\n\n\t\treturn blocks.map(block => {\n\t\t\tif (!(sourceFieldResolved in block)) {\n\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t`Found a block without a '${sourceFieldResolved}' field. ` +\n\t\t\t\t\t(sourceField === undefined\n\t\t\t\t\t\t? `The 'sourceField' prop has not been supplied, and so '${sourceFieldResolved}' was used as a default.`\n\t\t\t\t\t\t: `That is what the 'sourceField' prop has been set to, and so either this is a typo, ` +\n\t\t\t\t\t\t`or the data supplied is invalid.`),\n\t\t\t\t)\n\t\t\t}\n\t\t\tconst source = block[sourceFieldResolved]\n\t\t\tif (typeof source !== 'string' && (typeof source !== 'object' || source === null)) {\n\t\t\t\tthrow new RichTextRendererError(`Found a block whose source is not a string or an object.`)\n\t\t\t}\n\n\t\t\tif (referencesField !== undefined && !(referencesFieldResolved in block)) {\n\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t`The 'referencesField' prop is set to '${referencesFieldResolved}' but a block without such field ` +\n\t\t\t\t\t`has been encountered. Unless this is just a typo, ` +\n\t\t\t\t\t`if you do not wish to use references, avoid supplying the 'referencesField' prop.`,\n\t\t\t\t)\n\t\t\t}\n\t\t\tconst references = block[referencesFieldResolved]\n\n\t\t\tlet normalizedReferences: Record<string, RichTextReference> | undefined = undefined\n\t\t\tif (references) {\n\t\t\t\tif (typeof Object(references)[Symbol.iterator] !== 'function') {\n\t\t\t\t\tthrow new RichTextRendererError(`The set of references must be an iterable!`)\n\t\t\t\t}\n\n\t\t\t\tnormalizedReferences = Object.fromEntries(Array.from(references as Iterable<RichTextReference>).map(reference => {\n\t\t\t\t\tif (!('id' in reference)) {\n\t\t\t\t\t\tthrow new RichTextRendererError(`Found a reference without an id field.`)\n\t\t\t\t\t}\n\t\t\t\t\tif (!(referenceDiscriminationFieldResolved in reference) || typeof reference[referenceDiscriminationFieldResolved] !== 'string') {\n\t\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t\t`Found a reference without a '${referenceDiscriminationFieldResolved}' field. ` +\n\t\t\t\t\t\t\t(referenceDiscriminationField === undefined\n\t\t\t\t\t\t\t\t? `The 'referenceDiscriminationField' prop has not been supplied, ` +\n\t\t\t\t\t\t\t\t`and so '${referenceDiscriminationFieldResolved}' was used as a default.`\n\t\t\t\t\t\t\t\t: `That is what the 'referenceDiscriminationField' prop has been set to, ` +\n\t\t\t\t\t\t\t\t`and so either this is a typo, or the data supplied is invalid.`),\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\treturn [reference.id, {\n\t\t\t\t\t\t...reference,\n\t\t\t\t\t\ttype: reference[referenceDiscriminationFieldResolved] as string,\n\t\t\t\t\t}]\n\t\t\t\t}))\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tid: typeof block.id === 'string' ? block.id : undefined,\n\t\t\t\tcontent: typeof source === 'string' ? deserialize(source) : source as RootEditorNode<CustomElements, CustomLeaves>,\n\t\t\t\treferences: normalizedReferences,\n\t\t\t}\n\t\t})\n\t}, [blocks, deserialize, referenceDiscriminationField, referencesField, sourceField])\n}\n"],"names":[],"mappings":";;;AAKO,MAAM,0BAA0B,CAA4E;AAAA,EAClH,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAyD;AACxD,SAAO,QAAQ,MAAqD;AACnE,UAAM,sBAAsB,eAAe;AAC3C,UAAM,0BAA0B,mBAAmB;AACnD,UAAM,uCAAuC,gCAAgC;AAEtE,WAAA,OAAO,IAAI,CAAS,UAAA;AACtB,UAAA,EAAE,uBAAuB,QAAQ;AACpC,cAAM,IAAI;AAAA,UACT,4BAA4B,mBAAmB,eAC9C,gBAAgB,SACd,yDAAyD,mBAAmB,6BAC5E;AAAA,QAAA;AAAA,MAGL;AACM,YAAA,SAAS,MAAM,mBAAmB;AACxC,UAAI,OAAO,WAAW,aAAa,OAAO,WAAW,YAAY,WAAW,OAAO;AAC5E,cAAA,IAAI,sBAAsB,0DAA0D;AAAA,MAC3F;AAEA,UAAI,oBAAoB,UAAa,EAAE,2BAA2B,QAAQ;AACzE,cAAM,IAAI;AAAA,UACT,yCAAyC,uBAAuB;AAAA,QAAA;AAAA,MAIlE;AACM,YAAA,aAAa,MAAM,uBAAuB;AAEhD,UAAI,uBAAsE;AAC1E,UAAI,YAAY;AACf,YAAI,OAAO,OAAO,UAAU,EAAE,OAAO,QAAQ,MAAM,YAAY;AACxD,gBAAA,IAAI,sBAAsB,4CAA4C;AAAA,QAC7E;AAEA,+BAAuB,OAAO,YAAY,MAAM,KAAK,UAAyC,EAAE,IAAI,CAAa,cAAA;AAC5G,cAAA,EAAE,QAAQ,YAAY;AACnB,kBAAA,IAAI,sBAAsB,wCAAwC;AAAA,UACzE;AACA,cAAI,EAAE,wCAAwC,cAAc,OAAO,UAAU,oCAAoC,MAAM,UAAU;AAChI,kBAAM,IAAI;AAAA,cACT,gCAAgC,oCAAoC,eACnE,iCAAiC,SAC/B,0EACS,oCAAoC,6BAC7C;AAAA,YAAA;AAAA,UAGL;AACO,iBAAA,CAAC,UAAU,IAAI;AAAA,YACrB,GAAG;AAAA,YACH,MAAM,UAAU,oCAAoC;AAAA,UAAA,CACpD;AAAA,QACD,CAAA,CAAC;AAAA,MACH;AACO,aAAA;AAAA,QACN,IAAI,OAAO,MAAM,OAAO,WAAW,MAAM,KAAK;AAAA,QAC9C,SAAS,OAAO,WAAW,WAAW,YAAY,MAAM,IAAI;AAAA,QAC5D,YAAY;AAAA,MAAA;AAAA,IACb,CACA;AAAA,EAAA,GACC,CAAC,QAAQ,aAAa,8BAA8B,iBAAiB,WAAW,CAAC;AACrF;"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const renderChildren = require("../renderChildren.cjs");
|
|
6
6
|
const RenderElementFallback = require("./RenderElementFallback.cjs");
|
|
7
7
|
const useReferenceMetadata = require("../useReferenceMetadata.cjs");
|
|
8
8
|
function ElementRenderer({ element, children, options, block }) {
|
|
9
9
|
const referenceMetadata = useReferenceMetadata.useReferenceMetadata(element, options, block);
|
|
10
|
-
const fallback = /* @__PURE__ */
|
|
10
|
+
const fallback = /* @__PURE__ */ jsxDevRuntime.jsxDEV(RenderElementFallback.RenderElementFallback, { element, options, block, children }, void 0, false, {
|
|
11
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/internal/components/ElementRenderer.tsx",
|
|
12
|
+
lineNumber: 30,
|
|
13
|
+
columnNumber: 3
|
|
14
|
+
}, this);
|
|
11
15
|
return options.renderElement ? react.createElement(options.renderElement, {
|
|
12
16
|
...referenceMetadata,
|
|
13
17
|
formatVersion: block.content.formatVersion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementRenderer.cjs","sources":["../../../../src/internal/components/ElementRenderer.tsx"],"sourcesContent":["import type { ReactElement } from 'react'\nimport { createElement } from 'react'\nimport type { BuiltinElements } from '../../types/builtin/BuiltinElements'\nimport { renderChildren } from '../renderChildren'\nimport { RenderElementFallback } from './RenderElementFallback'\nimport { useReferenceMetadata } from '../useReferenceMetadata'\nimport type { RichTextElement } from '../../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../../types/structure/RichTextLeaf'\nimport { RichTextBlock } from '../../types/RichTextBlock'\nimport { RichTextRenderingOptions } from '../../types/RichTextRenderingOptions'\n\n\nexport interface ElementRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> {\n\telement: CustomElements | BuiltinElements<CustomElements, CustomLeaves>\n\tchildren: ReactElement\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n}\n\nexport function ElementRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({ element, children, options, block }: ElementRendererProps<CustomElements, CustomLeaves>) {\n\tconst referenceMetadata = useReferenceMetadata<CustomElements, CustomLeaves>(element, options, block)\n\n\tconst fallback = (\n\t\t<RenderElementFallback<CustomElements, CustomLeaves> element={element as BuiltinElements<CustomElements, CustomLeaves>} options={options} block={block}>\n\t\t\t{children}\n\t\t</RenderElementFallback>\n\t)\n\n\treturn options.renderElement\n\t\t? createElement(options.renderElement, {\n\t\t\t...referenceMetadata,\n\t\t\tformatVersion: block.content.formatVersion,\n\t\t\tblock,\n\t\t\toptions,\n\t\t\telement,\n\t\t\tfallback,\n\t\t\tchildren,\n\t\t\trenderChildren: (children, opts = options) => renderChildren(children, opts, block),\n\t\t\trenderChildrenOptions: options,\n\t\t})\n\t\t: fallback\n}\n"],"names":["useReferenceMetadata","
|
|
1
|
+
{"version":3,"file":"ElementRenderer.cjs","sources":["../../../../src/internal/components/ElementRenderer.tsx"],"sourcesContent":["import type { ReactElement } from 'react'\nimport { createElement } from 'react'\nimport type { BuiltinElements } from '../../types/builtin/BuiltinElements'\nimport { renderChildren } from '../renderChildren'\nimport { RenderElementFallback } from './RenderElementFallback'\nimport { useReferenceMetadata } from '../useReferenceMetadata'\nimport type { RichTextElement } from '../../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../../types/structure/RichTextLeaf'\nimport { RichTextBlock } from '../../types/RichTextBlock'\nimport { RichTextRenderingOptions } from '../../types/RichTextRenderingOptions'\n\n\nexport interface ElementRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> {\n\telement: CustomElements | BuiltinElements<CustomElements, CustomLeaves>\n\tchildren: ReactElement\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n}\n\nexport function ElementRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({ element, children, options, block }: ElementRendererProps<CustomElements, CustomLeaves>) {\n\tconst referenceMetadata = useReferenceMetadata<CustomElements, CustomLeaves>(element, options, block)\n\n\tconst fallback = (\n\t\t<RenderElementFallback<CustomElements, CustomLeaves> element={element as BuiltinElements<CustomElements, CustomLeaves>} options={options} block={block}>\n\t\t\t{children}\n\t\t</RenderElementFallback>\n\t)\n\n\treturn options.renderElement\n\t\t? createElement(options.renderElement, {\n\t\t\t...referenceMetadata,\n\t\t\tformatVersion: block.content.formatVersion,\n\t\t\tblock,\n\t\t\toptions,\n\t\t\telement,\n\t\t\tfallback,\n\t\t\tchildren,\n\t\t\trenderChildren: (children, opts = options) => renderChildren(children, opts, block),\n\t\t\trenderChildrenOptions: options,\n\t\t})\n\t\t: fallback\n}\n"],"names":["useReferenceMetadata","jsxDEV","RenderElementFallback","createElement","children","renderChildren"],"mappings":";;;;;;;AAsBO,SAAS,gBAGd,EAAE,SAAS,UAAU,SAAS,SAA6D;AAC5F,QAAM,oBAAoBA,qBAAA,qBAAmD,SAAS,SAAS,KAAK;AAEpG,QAAM,WACJC,8BAAAA,OAAAC,sBAAA,uBAAA,EAAoD,SAAmE,SAAkB,OACxI,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAEA,GAAA,IAAA;AAGD,SAAO,QAAQ,gBACZC,oBAAc,QAAQ,eAAe;AAAA,IACtC,GAAG;AAAA,IACH,eAAe,MAAM,QAAQ;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,CAACC,WAAU,OAAO,YAAYC,eAAAA,eAAeD,WAAU,MAAM,KAAK;AAAA,IAClF,uBAAuB;AAAA,EACvB,CAAA,IACC;AACJ;;"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { createElement } from "react";
|
|
3
3
|
import { renderChildren } from "../renderChildren.js";
|
|
4
4
|
import { RenderElementFallback } from "./RenderElementFallback.js";
|
|
5
5
|
import { useReferenceMetadata } from "../useReferenceMetadata.js";
|
|
6
6
|
function ElementRenderer({ element, children, options, block }) {
|
|
7
7
|
const referenceMetadata = useReferenceMetadata(element, options, block);
|
|
8
|
-
const fallback = /* @__PURE__ */
|
|
8
|
+
const fallback = /* @__PURE__ */ jsxDEV(RenderElementFallback, { element, options, block, children }, void 0, false, {
|
|
9
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/internal/components/ElementRenderer.tsx",
|
|
10
|
+
lineNumber: 30,
|
|
11
|
+
columnNumber: 3
|
|
12
|
+
}, this);
|
|
9
13
|
return options.renderElement ? createElement(options.renderElement, {
|
|
10
14
|
...referenceMetadata,
|
|
11
15
|
formatVersion: block.content.formatVersion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementRenderer.js","sources":["../../../../src/internal/components/ElementRenderer.tsx"],"sourcesContent":["import type { ReactElement } from 'react'\nimport { createElement } from 'react'\nimport type { BuiltinElements } from '../../types/builtin/BuiltinElements'\nimport { renderChildren } from '../renderChildren'\nimport { RenderElementFallback } from './RenderElementFallback'\nimport { useReferenceMetadata } from '../useReferenceMetadata'\nimport type { RichTextElement } from '../../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../../types/structure/RichTextLeaf'\nimport { RichTextBlock } from '../../types/RichTextBlock'\nimport { RichTextRenderingOptions } from '../../types/RichTextRenderingOptions'\n\n\nexport interface ElementRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> {\n\telement: CustomElements | BuiltinElements<CustomElements, CustomLeaves>\n\tchildren: ReactElement\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n}\n\nexport function ElementRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({ element, children, options, block }: ElementRendererProps<CustomElements, CustomLeaves>) {\n\tconst referenceMetadata = useReferenceMetadata<CustomElements, CustomLeaves>(element, options, block)\n\n\tconst fallback = (\n\t\t<RenderElementFallback<CustomElements, CustomLeaves> element={element as BuiltinElements<CustomElements, CustomLeaves>} options={options} block={block}>\n\t\t\t{children}\n\t\t</RenderElementFallback>\n\t)\n\n\treturn options.renderElement\n\t\t? createElement(options.renderElement, {\n\t\t\t...referenceMetadata,\n\t\t\tformatVersion: block.content.formatVersion,\n\t\t\tblock,\n\t\t\toptions,\n\t\t\telement,\n\t\t\tfallback,\n\t\t\tchildren,\n\t\t\trenderChildren: (children, opts = options) => renderChildren(children, opts, block),\n\t\t\trenderChildrenOptions: options,\n\t\t})\n\t\t: fallback\n}\n"],"names":["children"],"mappings":";;;;;AAsBO,SAAS,gBAGd,EAAE,SAAS,UAAU,SAAS,SAA6D;AAC5F,QAAM,oBAAoB,qBAAmD,SAAS,SAAS,KAAK;AAEpG,QAAM,WACJ,
|
|
1
|
+
{"version":3,"file":"ElementRenderer.js","sources":["../../../../src/internal/components/ElementRenderer.tsx"],"sourcesContent":["import type { ReactElement } from 'react'\nimport { createElement } from 'react'\nimport type { BuiltinElements } from '../../types/builtin/BuiltinElements'\nimport { renderChildren } from '../renderChildren'\nimport { RenderElementFallback } from './RenderElementFallback'\nimport { useReferenceMetadata } from '../useReferenceMetadata'\nimport type { RichTextElement } from '../../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../../types/structure/RichTextLeaf'\nimport { RichTextBlock } from '../../types/RichTextBlock'\nimport { RichTextRenderingOptions } from '../../types/RichTextRenderingOptions'\n\n\nexport interface ElementRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> {\n\telement: CustomElements | BuiltinElements<CustomElements, CustomLeaves>\n\tchildren: ReactElement\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n}\n\nexport function ElementRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({ element, children, options, block }: ElementRendererProps<CustomElements, CustomLeaves>) {\n\tconst referenceMetadata = useReferenceMetadata<CustomElements, CustomLeaves>(element, options, block)\n\n\tconst fallback = (\n\t\t<RenderElementFallback<CustomElements, CustomLeaves> element={element as BuiltinElements<CustomElements, CustomLeaves>} options={options} block={block}>\n\t\t\t{children}\n\t\t</RenderElementFallback>\n\t)\n\n\treturn options.renderElement\n\t\t? createElement(options.renderElement, {\n\t\t\t...referenceMetadata,\n\t\t\tformatVersion: block.content.formatVersion,\n\t\t\tblock,\n\t\t\toptions,\n\t\t\telement,\n\t\t\tfallback,\n\t\t\tchildren,\n\t\t\trenderChildren: (children, opts = options) => renderChildren(children, opts, block),\n\t\t\trenderChildrenOptions: options,\n\t\t})\n\t\t: fallback\n}\n"],"names":["children"],"mappings":";;;;;AAsBO,SAAS,gBAGd,EAAE,SAAS,UAAU,SAAS,SAA6D;AAC5F,QAAM,oBAAoB,qBAAmD,SAAS,SAAS,KAAK;AAEpG,QAAM,WACJ,uBAAA,uBAAA,EAAoD,SAAmE,SAAkB,OACxI,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAEA,GAAA,IAAA;AAGD,SAAO,QAAQ,gBACZ,cAAc,QAAQ,eAAe;AAAA,IACtC,GAAG;AAAA,IACH,eAAe,MAAM,QAAQ;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,CAACA,WAAU,OAAO,YAAY,eAAeA,WAAU,MAAM,KAAK;AAAA,IAClF,uBAAuB;AAAA,EACvB,CAAA,IACC;AACJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const RenderLeafFallback = require("./RenderLeafFallback.cjs");
|
|
6
6
|
function LeafRenderer({
|
|
@@ -8,7 +8,11 @@ function LeafRenderer({
|
|
|
8
8
|
options: { renderLeaf },
|
|
9
9
|
block: { content: { formatVersion } }
|
|
10
10
|
}) {
|
|
11
|
-
const fallback = /* @__PURE__ */
|
|
11
|
+
const fallback = /* @__PURE__ */ jsxDevRuntime.jsxDEV(RenderLeafFallback.RenderLeafFallback, { leaf }, void 0, false, {
|
|
12
|
+
fileName: "/__w/interface/interface/packages/react-richtext-renderer/src/internal/components/LeafRenderer.tsx",
|
|
13
|
+
lineNumber: 23,
|
|
14
|
+
columnNumber: 19
|
|
15
|
+
}, this);
|
|
12
16
|
return renderLeaf ? react.createElement(
|
|
13
17
|
renderLeaf,
|
|
14
18
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeafRenderer.cjs","sources":["../../../../src/internal/components/LeafRenderer.tsx"],"sourcesContent":["import { createElement } from 'react'\nimport type { BuiltinLeaves } from '../../types/builtin/BuiltinLeaves'\nimport { RenderLeafFallback } from './RenderLeafFallback'\nimport type { RichTextLeaf } from '../../types/structure/RichTextLeaf'\nimport { RichTextElement } from '../../types/structure/RichTextElement'\nimport { RichTextRenderingOptions } from '../../types/RichTextRenderingOptions'\nimport { RichTextBlock } from '../../types/RichTextBlock'\n\nexport interface LeafRendererProps<CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf> {\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n\tleaf: CustomLeaves & BuiltinLeaves\n}\n\nexport function LeafRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\tleaf,\n\toptions: { renderLeaf },\n\tblock: { content: { formatVersion } },\n}: LeafRendererProps<CustomElements, CustomLeaves>) {\n\tconst fallback = <RenderLeafFallback leaf={leaf} />\n\n\treturn renderLeaf\n\t\t? createElement(\n\t\t\t\trenderLeaf,\n\t\t\t\t{\n\t\t\t\t\tformatVersion,\n\t\t\t\t\tleaf,\n\t\t\t\t\tfallback,\n\t\t\t\t\tchildren: leaf.text,\n\t\t\t\t},\n\t\t )\n\t\t: fallback\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"LeafRenderer.cjs","sources":["../../../../src/internal/components/LeafRenderer.tsx"],"sourcesContent":["import { createElement } from 'react'\nimport type { BuiltinLeaves } from '../../types/builtin/BuiltinLeaves'\nimport { RenderLeafFallback } from './RenderLeafFallback'\nimport type { RichTextLeaf } from '../../types/structure/RichTextLeaf'\nimport { RichTextElement } from '../../types/structure/RichTextElement'\nimport { RichTextRenderingOptions } from '../../types/RichTextRenderingOptions'\nimport { RichTextBlock } from '../../types/RichTextBlock'\n\nexport interface LeafRendererProps<CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf> {\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n\tleaf: CustomLeaves & BuiltinLeaves\n}\n\nexport function LeafRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({\n\tleaf,\n\toptions: { renderLeaf },\n\tblock: { content: { formatVersion } },\n}: LeafRendererProps<CustomElements, CustomLeaves>) {\n\tconst fallback = <RenderLeafFallback leaf={leaf} />\n\n\treturn renderLeaf\n\t\t? createElement(\n\t\t\t\trenderLeaf,\n\t\t\t\t{\n\t\t\t\t\tformatVersion,\n\t\t\t\t\tleaf,\n\t\t\t\t\tfallback,\n\t\t\t\t\tchildren: leaf.text,\n\t\t\t\t},\n\t\t )\n\t\t: fallback\n}\n"],"names":["jsxDEV","RenderLeafFallback","createElement"],"mappings":";;;;;AAcO,SAAS,aAGd;AAAA,EACD;AAAA,EACA,SAAS,EAAE,WAAW;AAAA,EACtB,OAAO,EAAE,SAAS,EAAE,gBAAgB;AACrC,GAAoD;AAC7C,QAAA,WAAYA,8BAAAA,OAAAC,mBAAA,oBAAA,EAAmB,QAApB,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAgC,GAAA,IAAA;AAEjD,SAAO,aACJC,MAAA;AAAA,IACA;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,KAAK;AAAA,IAChB;AAAA,EAEA,IAAA;AACJ;;"}
|