@contember/react-richtext-renderer 2.1.0-alpha.9 → 2.1.0-beta.2
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/index.cjs +4 -4
- package/dist/development/index.js +2 -2
- package/dist/development/src/components/RichText.cjs.map +1 -1
- package/dist/development/src/components/RichText.js.map +1 -1
- package/dist/development/src/components/RichTextBlocksRenderer.cjs.map +1 -1
- package/dist/development/src/components/RichTextBlocksRenderer.js.map +1 -1
- package/dist/development/src/components/RichTextFieldRenderer.cjs.map +1 -1
- package/dist/development/src/components/RichTextFieldRenderer.js.map +1 -1
- package/dist/development/src/components/RichTextRenderer.cjs +2 -2
- package/dist/development/src/components/RichTextRenderer.cjs.map +1 -1
- package/dist/development/src/components/RichTextRenderer.js +2 -2
- package/dist/development/src/components/RichTextRenderer.js.map +1 -1
- package/dist/development/src/hooks/useRichTextBlocksSource.cjs +17 -15
- package/dist/development/src/hooks/useRichTextBlocksSource.cjs.map +1 -1
- package/dist/development/src/hooks/useRichTextBlocksSource.js +17 -15
- package/dist/development/src/hooks/useRichTextBlocksSource.js.map +1 -1
- package/dist/development/src/hooks/useRichTextFieldSource.cjs.map +1 -1
- package/dist/development/src/hooks/useRichTextFieldSource.js.map +1 -1
- package/dist/development/src/internal/components/ElementRenderer.cjs +17 -5
- package/dist/development/src/internal/components/ElementRenderer.cjs.map +1 -1
- package/dist/development/src/internal/components/ElementRenderer.js +17 -5
- package/dist/development/src/internal/components/ElementRenderer.js.map +1 -1
- package/dist/development/src/internal/components/LeafRenderer.cjs.map +1 -1
- package/dist/development/src/internal/components/LeafRenderer.js.map +1 -1
- package/dist/development/src/internal/components/RenderElementFallback.cjs.map +1 -1
- package/dist/development/src/internal/components/RenderElementFallback.js.map +1 -1
- package/dist/development/src/internal/components/RenderLeafFallback.cjs.map +1 -1
- package/dist/development/src/internal/components/RenderLeafFallback.js.map +1 -1
- package/dist/development/src/internal/defaultDeserialize.cjs.map +1 -1
- package/dist/development/src/internal/defaultDeserialize.js.map +1 -1
- package/dist/development/src/internal/renderChildren.cjs.map +1 -1
- package/dist/development/src/internal/renderChildren.js.map +1 -1
- package/dist/development/src/internal/useReferenceMetadata.cjs.map +1 -1
- package/dist/development/src/internal/useReferenceMetadata.js.map +1 -1
- package/dist/production/index.cjs +4 -4
- package/dist/production/index.js +2 -2
- package/dist/production/src/components/RichText.cjs.map +1 -1
- package/dist/production/src/components/RichText.js.map +1 -1
- package/dist/production/src/components/RichTextBlocksRenderer.cjs.map +1 -1
- package/dist/production/src/components/RichTextBlocksRenderer.js.map +1 -1
- package/dist/production/src/components/RichTextFieldRenderer.cjs.map +1 -1
- package/dist/production/src/components/RichTextFieldRenderer.js.map +1 -1
- package/dist/production/src/components/RichTextRenderer.cjs.map +1 -1
- package/dist/production/src/components/RichTextRenderer.js.map +1 -1
- package/dist/production/src/hooks/useRichTextBlocksSource.cjs +17 -15
- package/dist/production/src/hooks/useRichTextBlocksSource.cjs.map +1 -1
- package/dist/production/src/hooks/useRichTextBlocksSource.js +17 -15
- package/dist/production/src/hooks/useRichTextBlocksSource.js.map +1 -1
- package/dist/production/src/hooks/useRichTextFieldSource.cjs.map +1 -1
- package/dist/production/src/hooks/useRichTextFieldSource.js.map +1 -1
- package/dist/production/src/internal/components/ElementRenderer.cjs +9 -1
- package/dist/production/src/internal/components/ElementRenderer.cjs.map +1 -1
- package/dist/production/src/internal/components/ElementRenderer.js +9 -1
- package/dist/production/src/internal/components/ElementRenderer.js.map +1 -1
- package/dist/production/src/internal/components/LeafRenderer.cjs.map +1 -1
- package/dist/production/src/internal/components/LeafRenderer.js.map +1 -1
- package/dist/production/src/internal/components/RenderElementFallback.cjs.map +1 -1
- package/dist/production/src/internal/components/RenderElementFallback.js.map +1 -1
- package/dist/production/src/internal/components/RenderLeafFallback.cjs.map +1 -1
- package/dist/production/src/internal/components/RenderLeafFallback.js.map +1 -1
- package/dist/production/src/internal/defaultDeserialize.cjs.map +1 -1
- package/dist/production/src/internal/defaultDeserialize.js.map +1 -1
- package/dist/production/src/internal/renderChildren.cjs.map +1 -1
- package/dist/production/src/internal/renderChildren.js.map +1 -1
- package/dist/production/src/internal/useReferenceMetadata.cjs.map +1 -1
- package/dist/production/src/internal/useReferenceMetadata.js.map +1 -1
- package/dist/types/components/RichText.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/internal/components/ElementRenderer.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/custom/RenderLeaf.d.ts.map +1 -1
- package/package.json +5 -6
- package/src/components/RichText.tsx +4 -2
- package/src/components/RichTextRenderer.tsx +0 -2
- package/src/hooks/useRichTextBlocksSource.ts +30 -28
- package/src/index.ts +0 -1
- package/src/internal/components/ElementRenderer.tsx +5 -2
- package/src/internal/components/LeafRenderer.tsx +1 -1
- package/src/internal/components/RenderElementFallback.tsx +3 -3
- package/src/types/RichTextRenderingOptions.ts +1 -1
- package/src/types/custom/RenderLeaf.ts +6 -8
- package/tests/decodeBlockSource.test.tsx +18 -17
- package/tests/renderElement.test.tsx +130 -83
- package/tests/renderLeaf.test.tsx +31 -23
- package/tests/renderReferences.test.tsx +82 -38
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const RichTextRendererError = require("./src/RichTextRendererError.cjs");
|
|
4
4
|
const RichText = require("./src/components/RichText.cjs");
|
|
5
|
-
const RichTextFieldRenderer = require("./src/components/RichTextFieldRenderer.cjs");
|
|
6
5
|
const RichTextBlocksRenderer = require("./src/components/RichTextBlocksRenderer.cjs");
|
|
6
|
+
const RichTextFieldRenderer = require("./src/components/RichTextFieldRenderer.cjs");
|
|
7
7
|
const RichTextRenderer = require("./src/components/RichTextRenderer.cjs");
|
|
8
|
-
const useRichTextFieldSource = require("./src/hooks/useRichTextFieldSource.cjs");
|
|
9
8
|
const useRichTextBlocksSource = require("./src/hooks/useRichTextBlocksSource.cjs");
|
|
9
|
+
const useRichTextFieldSource = require("./src/hooks/useRichTextFieldSource.cjs");
|
|
10
10
|
exports.RichTextRendererError = RichTextRendererError.RichTextRendererError;
|
|
11
11
|
exports.RichText = RichText.RichText;
|
|
12
|
-
exports.RichTextFieldRenderer = RichTextFieldRenderer.RichTextFieldRenderer;
|
|
13
12
|
exports.RichTextBlocksRenderer = RichTextBlocksRenderer.RichTextBlocksRenderer;
|
|
13
|
+
exports.RichTextFieldRenderer = RichTextFieldRenderer.RichTextFieldRenderer;
|
|
14
14
|
exports.RichTextRenderer = RichTextRenderer.RichTextRenderer;
|
|
15
|
-
exports.useRichTextFieldSource = useRichTextFieldSource.useRichTextFieldSource;
|
|
16
15
|
exports.useRichTextBlocksSource = useRichTextBlocksSource.useRichTextBlocksSource;
|
|
16
|
+
exports.useRichTextFieldSource = useRichTextFieldSource.useRichTextFieldSource;
|
|
17
17
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RichTextRendererError } from "./src/RichTextRendererError.js";
|
|
2
2
|
import { RichText } from "./src/components/RichText.js";
|
|
3
|
-
import { RichTextFieldRenderer } from "./src/components/RichTextFieldRenderer.js";
|
|
4
3
|
import { RichTextBlocksRenderer } from "./src/components/RichTextBlocksRenderer.js";
|
|
4
|
+
import { RichTextFieldRenderer } from "./src/components/RichTextFieldRenderer.js";
|
|
5
5
|
import { RichTextRenderer } from "./src/components/RichTextRenderer.js";
|
|
6
|
-
import { useRichTextFieldSource } from "./src/hooks/useRichTextFieldSource.js";
|
|
7
6
|
import { useRichTextBlocksSource } from "./src/hooks/useRichTextBlocksSource.js";
|
|
7
|
+
import { useRichTextFieldSource } from "./src/hooks/useRichTextFieldSource.js";
|
|
8
8
|
export {
|
|
9
9
|
RichText,
|
|
10
10
|
RichTextBlocksRenderer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.cjs","sources":["../../../../../packages/react-richtext-renderer/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
|
|
1
|
+
{"version":3,"file":"RichText.cjs","sources":["../../../../../packages/react-richtext-renderer/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{\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tkey: block.id ?? i,\n\t\t\t\t\t},\n\t\t\t\t\trenderChildren(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,SAAA,qEAAkB,SAAA,GAAH,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAAY;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AACD,MAAmD;AAClD,SACCC,8BAAAA,OAAAC,cAAAA,UAAA,EACE,UAAA,OAAO,IAAI,CAAC,OAAO,MACnBC,MAAAA;AAAAA,IACC;AAAA,IACA;AAAA,MACC;AAAA,MACA,KAAK,MAAM,MAAM;AAAA,IAAA;AAAA,IAElBC,8BAAe,MAAM,QAAQ,UAAU;AAAA,MACtC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACE,KAAK;AAAA,EAAA,CAET,EAAA,GAjBF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAJ,MAkBA;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.js","sources":["../../../../../packages/react-richtext-renderer/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
|
|
1
|
+
{"version":3,"file":"RichText.js","sources":["../../../../../packages/react-richtext-renderer/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{\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tkey: block.id ?? i,\n\t\t\t\t\t},\n\t\t\t\t\trenderChildren(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,SAAA,yCAAkB,SAAA,GAAH,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAAY;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AACD,MAAmD;AAClD,SACC,uBAAA,UAAA,EACE,UAAA,OAAO,IAAI,CAAC,OAAO,MACnB;AAAA,IACC;AAAA,IACA;AAAA,MACC;AAAA,MACA,KAAK,MAAM,MAAM;AAAA,IAAA;AAAA,IAElB,eAAe,MAAM,QAAQ,UAAU;AAAA,MACtC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACE,KAAK;AAAA,EAAA,CAET,EAAA,GAjBF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAkBA;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextBlocksRenderer.cjs","sources":["../../../../../packages/react-richtext-renderer/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,
|
|
1
|
+
{"version":3,"file":"RichTextBlocksRenderer.cjs","sources":["../../../../../packages/react-richtext-renderer/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,SAAA,qEAAkB,SAAA,GAAH,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAAY;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAiE;AAChE,QAAM,SAASC,wBAAAA,wBAAsD,KAAK;AAC1E,SACCC,8BAAAA;AAAAA,IAACC,SAAAA;AAAAA,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextBlocksRenderer.js","sources":["../../../../../packages/react-richtext-renderer/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,
|
|
1
|
+
{"version":3,"file":"RichTextBlocksRenderer.js","sources":["../../../../../packages/react-richtext-renderer/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,SAAA,yCAAkB,SAAA,GAAH,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAAY;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAiE;AAChE,QAAM,SAAS,wBAAsD,KAAK;AAC1E,SACC;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextFieldRenderer.cjs","sources":["../../../../../packages/react-richtext-renderer/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;
|
|
1
|
+
{"version":3,"file":"RichTextFieldRenderer.cjs","sources":["../../../../../packages/react-richtext-renderer/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;AAC/D,QAAM,SAASA,uBAAAA,uBAAuB,MAAM;AAE5C,SACCC,8BAAAA;AAAAA,IAACC,SAAAA;AAAAA,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextFieldRenderer.js","sources":["../../../../../packages/react-richtext-renderer/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;
|
|
1
|
+
{"version":3,"file":"RichTextFieldRenderer.js","sources":["../../../../../packages/react-richtext-renderer/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;AAC/D,QAAM,SAAS,uBAAuB,MAAM;AAE5C,SACC;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;"}
|
|
@@ -8,13 +8,13 @@ const RichTextRenderer = React.memo(function RichTextRenderer2(props) {
|
|
|
8
8
|
if ("source" in props) {
|
|
9
9
|
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(RichTextFieldRenderer.RichTextFieldRenderer, { ...props }, void 0, false, {
|
|
10
10
|
fileName: "/home/runner/work/contember/contember/packages/react-richtext-renderer/src/components/RichTextRenderer.tsx",
|
|
11
|
-
lineNumber:
|
|
11
|
+
lineNumber: 23,
|
|
12
12
|
columnNumber: 10
|
|
13
13
|
}, this);
|
|
14
14
|
}
|
|
15
15
|
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(RichTextBlocksRenderer.RichTextBlocksRenderer, { ...props }, void 0, false, {
|
|
16
16
|
fileName: "/home/runner/work/contember/contember/packages/react-richtext-renderer/src/components/RichTextRenderer.tsx",
|
|
17
|
-
lineNumber:
|
|
17
|
+
lineNumber: 26,
|
|
18
18
|
columnNumber: 9
|
|
19
19
|
}, this);
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRenderer.cjs","sources":["../../../../../packages/react-richtext-renderer/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\
|
|
1
|
+
{"version":3,"file":"RichTextRenderer.cjs","sources":["../../../../../packages/react-richtext-renderer/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\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\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":";;;;;;AAiBO,MAAM,mBAAmBA,MAAAA,KAAK,SAASC,kBAG5C,OAA4D;AAC7D,MAAI,YAAY,OAAO;AACtB,WAAOC,8BAAAA,OAACC,sBAAAA,uBAAA,EAAqD,GAAG,MAAA,GAAzD,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAA,IAAgE;AAAA,EACxE;AAEA,SAAOD,8BAAAA,OAACE,uBAAAA,wBAAA,EAAsD,GAAG,MAAA,GAA1D,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAAiE;AACzE,CAAC;;"}
|
|
@@ -6,13 +6,13 @@ const RichTextRenderer = memo(function RichTextRenderer2(props) {
|
|
|
6
6
|
if ("source" in props) {
|
|
7
7
|
return /* @__PURE__ */ jsxDEV(RichTextFieldRenderer, { ...props }, void 0, false, {
|
|
8
8
|
fileName: "/home/runner/work/contember/contember/packages/react-richtext-renderer/src/components/RichTextRenderer.tsx",
|
|
9
|
-
lineNumber:
|
|
9
|
+
lineNumber: 23,
|
|
10
10
|
columnNumber: 10
|
|
11
11
|
}, this);
|
|
12
12
|
}
|
|
13
13
|
return /* @__PURE__ */ jsxDEV(RichTextBlocksRenderer, { ...props }, void 0, false, {
|
|
14
14
|
fileName: "/home/runner/work/contember/contember/packages/react-richtext-renderer/src/components/RichTextRenderer.tsx",
|
|
15
|
-
lineNumber:
|
|
15
|
+
lineNumber: 26,
|
|
16
16
|
columnNumber: 9
|
|
17
17
|
}, this);
|
|
18
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRenderer.js","sources":["../../../../../packages/react-richtext-renderer/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\
|
|
1
|
+
{"version":3,"file":"RichTextRenderer.js","sources":["../../../../../packages/react-richtext-renderer/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\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\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":";;;;AAiBO,MAAM,mBAAmB,KAAK,SAASA,kBAG5C,OAA4D;AAC7D,MAAI,YAAY,OAAO;AACtB,WAAO,uBAAC,uBAAA,EAAqD,GAAG,MAAA,GAAzD,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAA,IAAgE;AAAA,EACxE;AAEA,SAAO,uBAAC,wBAAA,EAAsD,GAAG,MAAA,GAA1D,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAAiE;AACzE,CAAC;"}
|
|
@@ -30,25 +30,27 @@ const useRichTextBlocksSource = ({
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
const references = block[referencesFieldResolved];
|
|
33
|
-
let normalizedReferences
|
|
33
|
+
let normalizedReferences;
|
|
34
34
|
if (references) {
|
|
35
35
|
if (typeof Object(references)[Symbol.iterator] !== "function") {
|
|
36
36
|
throw new RichTextRendererError.RichTextRendererError(`The set of references must be an iterable!`);
|
|
37
37
|
}
|
|
38
|
-
normalizedReferences = Object.fromEntries(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
normalizedReferences = Object.fromEntries(
|
|
39
|
+
Array.from(references).map((reference) => {
|
|
40
|
+
if (!("id" in reference)) {
|
|
41
|
+
throw new RichTextRendererError.RichTextRendererError(`Found a reference without an id field.`);
|
|
42
|
+
}
|
|
43
|
+
if (!(referenceDiscriminationFieldResolved in reference) || typeof reference[referenceDiscriminationFieldResolved] !== "string") {
|
|
44
|
+
throw new RichTextRendererError.RichTextRendererError(
|
|
45
|
+
`Found a reference without a '${referenceDiscriminationFieldResolved}' field. ` + (referenceDiscriminationField === void 0 ? `The 'referenceDiscriminationField' prop has not been supplied, and so '${referenceDiscriminationFieldResolved}' was used as a default.` : `That is what the 'referenceDiscriminationField' prop has been set to, and so either this is a typo, or the data supplied is invalid.`)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return [reference.id, {
|
|
49
|
+
...reference,
|
|
50
|
+
type: reference[referenceDiscriminationFieldResolved]
|
|
51
|
+
}];
|
|
52
|
+
})
|
|
53
|
+
);
|
|
52
54
|
}
|
|
53
55
|
return {
|
|
54
56
|
id: typeof block.id === "string" ? block.id : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRichTextBlocksSource.cjs","sources":["../../../../../packages/react-richtext-renderer/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.
|
|
1
|
+
{"version":3,"file":"useRichTextBlocksSource.cjs","sources":["../../../../../packages/react-richtext-renderer/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\t+ (sourceField === undefined\n\t\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\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\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\t+ `has been encountered. Unless this is just a typo, `\n\t\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\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(\n\t\t\t\t\tArray.from(references as Iterable<RichTextReference>).map(reference => {\n\t\t\t\t\t\tif (!('id' in reference)) {\n\t\t\t\t\t\t\tthrow new RichTextRendererError(`Found a reference without an id field.`)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!(referenceDiscriminationFieldResolved in reference) || typeof reference[referenceDiscriminationFieldResolved] !== 'string') {\n\t\t\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t\t\t`Found a reference without a '${referenceDiscriminationFieldResolved}' field. `\n\t\t\t\t\t\t\t\t\t+ (referenceDiscriminationField === undefined\n\t\t\t\t\t\t\t\t\t\t? `The 'referenceDiscriminationField' prop has not been supplied, `\n\t\t\t\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\t\t: `That is what the 'referenceDiscriminationField' prop has been set to, `\n\t\t\t\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\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn [reference.id, {\n\t\t\t\t\t\t\t...reference,\n\t\t\t\t\t\t\ttype: reference[referenceDiscriminationFieldResolved] as string,\n\t\t\t\t\t\t}]\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","RichTextRenderer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oC,6BAChD;AAAA,cAAA;AAAA,YAGN;AACA,mBAAO,CAAC,UAAU,IAAI;AAAA,cACrB,GAAG;AAAA,cACH,MAAM,UAAU,oCAAoC;AAAA,YAAA,CACpD;AAAA,UACF,CAAC;AAAA,QAAA;AAAA,MAEH;AACA,aAAO;AAAA,QACN,IAAI,OAAO,MAAM,OAAO,WAAW,MAAM,KAAK;AAAA,QAC9C,SAAS,OAAO,WAAW,WAAW,YAAY,MAAM,IAAI;AAAA,QAC5D,YAAY;AAAA,MAAA;AAAA,IAEd,CAAC;AAAA,EACF,GAAG,CAAC,QAAQ,aAAa,8BAA8B,iBAAiB,WAAW,CAAC;AACrF;;"}
|
|
@@ -28,25 +28,27 @@ const useRichTextBlocksSource = ({
|
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
const references = block[referencesFieldResolved];
|
|
31
|
-
let normalizedReferences
|
|
31
|
+
let normalizedReferences;
|
|
32
32
|
if (references) {
|
|
33
33
|
if (typeof Object(references)[Symbol.iterator] !== "function") {
|
|
34
34
|
throw new RichTextRendererError(`The set of references must be an iterable!`);
|
|
35
35
|
}
|
|
36
|
-
normalizedReferences = Object.fromEntries(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
normalizedReferences = Object.fromEntries(
|
|
37
|
+
Array.from(references).map((reference) => {
|
|
38
|
+
if (!("id" in reference)) {
|
|
39
|
+
throw new RichTextRendererError(`Found a reference without an id field.`);
|
|
40
|
+
}
|
|
41
|
+
if (!(referenceDiscriminationFieldResolved in reference) || typeof reference[referenceDiscriminationFieldResolved] !== "string") {
|
|
42
|
+
throw new RichTextRendererError(
|
|
43
|
+
`Found a reference without a '${referenceDiscriminationFieldResolved}' field. ` + (referenceDiscriminationField === void 0 ? `The 'referenceDiscriminationField' prop has not been supplied, and so '${referenceDiscriminationFieldResolved}' was used as a default.` : `That is what the 'referenceDiscriminationField' prop has been set to, and so either this is a typo, or the data supplied is invalid.`)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
return [reference.id, {
|
|
47
|
+
...reference,
|
|
48
|
+
type: reference[referenceDiscriminationFieldResolved]
|
|
49
|
+
}];
|
|
50
|
+
})
|
|
51
|
+
);
|
|
50
52
|
}
|
|
51
53
|
return {
|
|
52
54
|
id: typeof block.id === "string" ? block.id : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRichTextBlocksSource.js","sources":["../../../../../packages/react-richtext-renderer/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.
|
|
1
|
+
{"version":3,"file":"useRichTextBlocksSource.js","sources":["../../../../../packages/react-richtext-renderer/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\t+ (sourceField === undefined\n\t\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\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\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\t+ `has been encountered. Unless this is just a typo, `\n\t\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\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(\n\t\t\t\t\tArray.from(references as Iterable<RichTextReference>).map(reference => {\n\t\t\t\t\t\tif (!('id' in reference)) {\n\t\t\t\t\t\t\tthrow new RichTextRendererError(`Found a reference without an id field.`)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!(referenceDiscriminationFieldResolved in reference) || typeof reference[referenceDiscriminationFieldResolved] !== 'string') {\n\t\t\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t\t\t`Found a reference without a '${referenceDiscriminationFieldResolved}' field. `\n\t\t\t\t\t\t\t\t\t+ (referenceDiscriminationField === undefined\n\t\t\t\t\t\t\t\t\t\t? `The 'referenceDiscriminationField' prop has not been supplied, `\n\t\t\t\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\t\t: `That is what the 'referenceDiscriminationField' prop has been set to, `\n\t\t\t\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\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn [reference.id, {\n\t\t\t\t\t\t\t...reference,\n\t\t\t\t\t\t\ttype: reference[referenceDiscriminationFieldResolved] as string,\n\t\t\t\t\t\t}]\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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F,CAAC;AAAA,QAAA;AAAA,MAEH;AACA,aAAO;AAAA,QACN,IAAI,OAAO,MAAM,OAAO,WAAW,MAAM,KAAK;AAAA,QAC9C,SAAS,OAAO,WAAW,WAAW,YAAY,MAAM,IAAI;AAAA,QAC5D,YAAY;AAAA,MAAA;AAAA,IAEd,CAAC;AAAA,EACF,GAAG,CAAC,QAAQ,aAAa,8BAA8B,iBAAiB,WAAW,CAAC;AACrF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRichTextFieldSource.cjs","sources":["../../../../../packages/react-richtext-renderer/src/hooks/useRichTextFieldSource.ts"],"sourcesContent":["import { RichTextBlock, RichTextElement, RichTextFieldSource, RichTextLeaf } from '../types'\nimport { useMemo } from 'react'\nimport { defaultDeserialize } from '../internal/defaultDeserialize'\n\nexport const useRichTextFieldSource = <CustomElements extends RichTextElement, CustomLeaves extends RichTextLeaf>({\n\tsource,\n\tdeserialize = defaultDeserialize,\n}: RichTextFieldSource<CustomElements, CustomLeaves>): RichTextBlock<CustomElements, CustomLeaves>[] => {\n\treturn useMemo(() => {\n\t\treturn [\n\t\t\t{\n\t\t\t\tcontent: source\n\t\t\t\t\t? (typeof source === 'string' ? deserialize(source) : source)\n\t\t\t\t\t: {\n\t\t\t\t\t\tformatVersion: 0,\n\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t},\n\t\t\t\tid: undefined,\n\t\t\t\treferencesField: undefined,\n\t\t\t\treferenceDiscriminationField: undefined,\n\t\t\t\treferenceRenderers: {},\n\t\t\t\treferences: undefined,\n\t\t\t},\n\t\t]\n\t}, [deserialize, source])\n}\n"],"names":["defaultDeserialize","useMemo"],"mappings":";;;;AAIO,MAAM,yBAAyB,CAA4E;AAAA,EACjH;AAAA,EACA,cAAcA,mBAAAA;AACf,MAAwG;AACvG,SAAOC,
|
|
1
|
+
{"version":3,"file":"useRichTextFieldSource.cjs","sources":["../../../../../packages/react-richtext-renderer/src/hooks/useRichTextFieldSource.ts"],"sourcesContent":["import { RichTextBlock, RichTextElement, RichTextFieldSource, RichTextLeaf } from '../types'\nimport { useMemo } from 'react'\nimport { defaultDeserialize } from '../internal/defaultDeserialize'\n\nexport const useRichTextFieldSource = <CustomElements extends RichTextElement, CustomLeaves extends RichTextLeaf>({\n\tsource,\n\tdeserialize = defaultDeserialize,\n}: RichTextFieldSource<CustomElements, CustomLeaves>): RichTextBlock<CustomElements, CustomLeaves>[] => {\n\treturn useMemo(() => {\n\t\treturn [\n\t\t\t{\n\t\t\t\tcontent: source\n\t\t\t\t\t? (typeof source === 'string' ? deserialize(source) : source)\n\t\t\t\t\t: {\n\t\t\t\t\t\tformatVersion: 0,\n\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t},\n\t\t\t\tid: undefined,\n\t\t\t\treferencesField: undefined,\n\t\t\t\treferenceDiscriminationField: undefined,\n\t\t\t\treferenceRenderers: {},\n\t\t\t\treferences: undefined,\n\t\t\t},\n\t\t]\n\t}, [deserialize, source])\n}\n"],"names":["defaultDeserialize","useMemo"],"mappings":";;;;AAIO,MAAM,yBAAyB,CAA4E;AAAA,EACjH;AAAA,EACA,cAAcA,mBAAAA;AACf,MAAwG;AACvG,SAAOC,MAAAA,QAAQ,MAAM;AACpB,WAAO;AAAA,MACN;AAAA,QACC,SAAS,SACL,OAAO,WAAW,WAAW,YAAY,MAAM,IAAI,SACpD;AAAA,UACD,eAAe;AAAA,UACf,UAAU,CAAA;AAAA,QAAC;AAAA,QAEb,IAAI;AAAA,QACJ,iBAAiB;AAAA,QACjB,8BAA8B;AAAA,QAC9B,oBAAoB,CAAA;AAAA,QACpB,YAAY;AAAA,MAAA;AAAA,IACb;AAAA,EAEF,GAAG,CAAC,aAAa,MAAM,CAAC;AACzB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRichTextFieldSource.js","sources":["../../../../../packages/react-richtext-renderer/src/hooks/useRichTextFieldSource.ts"],"sourcesContent":["import { RichTextBlock, RichTextElement, RichTextFieldSource, RichTextLeaf } from '../types'\nimport { useMemo } from 'react'\nimport { defaultDeserialize } from '../internal/defaultDeserialize'\n\nexport const useRichTextFieldSource = <CustomElements extends RichTextElement, CustomLeaves extends RichTextLeaf>({\n\tsource,\n\tdeserialize = defaultDeserialize,\n}: RichTextFieldSource<CustomElements, CustomLeaves>): RichTextBlock<CustomElements, CustomLeaves>[] => {\n\treturn useMemo(() => {\n\t\treturn [\n\t\t\t{\n\t\t\t\tcontent: source\n\t\t\t\t\t? (typeof source === 'string' ? deserialize(source) : source)\n\t\t\t\t\t: {\n\t\t\t\t\t\tformatVersion: 0,\n\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t},\n\t\t\t\tid: undefined,\n\t\t\t\treferencesField: undefined,\n\t\t\t\treferenceDiscriminationField: undefined,\n\t\t\t\treferenceRenderers: {},\n\t\t\t\treferences: undefined,\n\t\t\t},\n\t\t]\n\t}, [deserialize, source])\n}\n"],"names":[],"mappings":";;AAIO,MAAM,yBAAyB,CAA4E;AAAA,EACjH;AAAA,EACA,cAAc;AACf,MAAwG;AACvG,SAAO,QAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"useRichTextFieldSource.js","sources":["../../../../../packages/react-richtext-renderer/src/hooks/useRichTextFieldSource.ts"],"sourcesContent":["import { RichTextBlock, RichTextElement, RichTextFieldSource, RichTextLeaf } from '../types'\nimport { useMemo } from 'react'\nimport { defaultDeserialize } from '../internal/defaultDeserialize'\n\nexport const useRichTextFieldSource = <CustomElements extends RichTextElement, CustomLeaves extends RichTextLeaf>({\n\tsource,\n\tdeserialize = defaultDeserialize,\n}: RichTextFieldSource<CustomElements, CustomLeaves>): RichTextBlock<CustomElements, CustomLeaves>[] => {\n\treturn useMemo(() => {\n\t\treturn [\n\t\t\t{\n\t\t\t\tcontent: source\n\t\t\t\t\t? (typeof source === 'string' ? deserialize(source) : source)\n\t\t\t\t\t: {\n\t\t\t\t\t\tformatVersion: 0,\n\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t},\n\t\t\t\tid: undefined,\n\t\t\t\treferencesField: undefined,\n\t\t\t\treferenceDiscriminationField: undefined,\n\t\t\t\treferenceRenderers: {},\n\t\t\t\treferences: undefined,\n\t\t\t},\n\t\t]\n\t}, [deserialize, source])\n}\n"],"names":[],"mappings":";;AAIO,MAAM,yBAAyB,CAA4E;AAAA,EACjH;AAAA,EACA,cAAc;AACf,MAAwG;AACvG,SAAO,QAAQ,MAAM;AACpB,WAAO;AAAA,MACN;AAAA,QACC,SAAS,SACL,OAAO,WAAW,WAAW,YAAY,MAAM,IAAI,SACpD;AAAA,UACD,eAAe;AAAA,UACf,UAAU,CAAA;AAAA,QAAC;AAAA,QAEb,IAAI;AAAA,QACJ,iBAAiB;AAAA,QACjB,8BAA8B;AAAA,QAC9B,oBAAoB,CAAA;AAAA,QACpB,YAAY;AAAA,MAAA;AAAA,IACb;AAAA,EAEF,GAAG,CAAC,aAAa,MAAM,CAAC;AACzB;"}
|
|
@@ -7,11 +7,23 @@ 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__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const fallback = /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
RenderElementFallback.RenderElementFallback,
|
|
12
|
+
{
|
|
13
|
+
element,
|
|
14
|
+
options,
|
|
15
|
+
block,
|
|
16
|
+
children
|
|
17
|
+
},
|
|
18
|
+
void 0,
|
|
19
|
+
false,
|
|
20
|
+
{
|
|
21
|
+
fileName: "/home/runner/work/contember/contember/packages/react-richtext-renderer/src/internal/components/ElementRenderer.tsx",
|
|
22
|
+
lineNumber: 29,
|
|
23
|
+
columnNumber: 3
|
|
24
|
+
},
|
|
25
|
+
this
|
|
26
|
+
);
|
|
15
27
|
return options.renderElement ? React.createElement(options.renderElement, {
|
|
16
28
|
...referenceMetadata,
|
|
17
29
|
formatVersion: block.content.formatVersion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementRenderer.cjs","sources":["../../../../../../packages/react-richtext-renderer/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\
|
|
1
|
+
{"version":3,"file":"ElementRenderer.cjs","sources":["../../../../../../packages/react-richtext-renderer/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\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>\n\t\t\telement={element as BuiltinElements<CustomElements, CustomLeaves>}\n\t\t\toptions={options}\n\t\t\tblock={block}\n\t\t>\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":";;;;;;;AAqBO,SAAS,gBAGd,EAAE,SAAS,UAAU,SAAS,SAA6D;AAC5F,QAAM,oBAAoBA,qBAAAA,qBAAmD,SAAS,SAAS,KAAK;AAEpG,QAAM,WACLC,8BAAAA;AAAAA,IAACC,sBAAAA;AAAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,IALF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAA;AAAA,EAAA;AASD,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,EAAA,CACvB,IACC;AACJ;;"}
|
|
@@ -5,11 +5,23 @@ 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__ */ jsxDEV(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const fallback = /* @__PURE__ */ jsxDEV(
|
|
9
|
+
RenderElementFallback,
|
|
10
|
+
{
|
|
11
|
+
element,
|
|
12
|
+
options,
|
|
13
|
+
block,
|
|
14
|
+
children
|
|
15
|
+
},
|
|
16
|
+
void 0,
|
|
17
|
+
false,
|
|
18
|
+
{
|
|
19
|
+
fileName: "/home/runner/work/contember/contember/packages/react-richtext-renderer/src/internal/components/ElementRenderer.tsx",
|
|
20
|
+
lineNumber: 29,
|
|
21
|
+
columnNumber: 3
|
|
22
|
+
},
|
|
23
|
+
this
|
|
24
|
+
);
|
|
13
25
|
return options.renderElement ? createElement(options.renderElement, {
|
|
14
26
|
...referenceMetadata,
|
|
15
27
|
formatVersion: block.content.formatVersion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementRenderer.js","sources":["../../../../../../packages/react-richtext-renderer/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\
|
|
1
|
+
{"version":3,"file":"ElementRenderer.js","sources":["../../../../../../packages/react-richtext-renderer/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\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>\n\t\t\telement={element as BuiltinElements<CustomElements, CustomLeaves>}\n\t\t\toptions={options}\n\t\t\tblock={block}\n\t\t>\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":";;;;;AAqBO,SAAS,gBAGd,EAAE,SAAS,UAAU,SAAS,SAA6D;AAC5F,QAAM,oBAAoB,qBAAmD,SAAS,SAAS,KAAK;AAEpG,QAAM,WACL;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,IALF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAA;AAAA,EAAA;AASD,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,EAAA,CACvB,IACC;AACJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeafRenderer.cjs","sources":["../../../../../../packages/react-richtext-renderer/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\trenderLeaf,\n\t\t\t{\n\t\t\t\tformatVersion,\n\t\t\t\tleaf,\n\t\t\t\tfallback,\n\t\t\t\tchildren: leaf.text,\n\t\t\t},\n\t\t
|
|
1
|
+
{"version":3,"file":"LeafRenderer.cjs","sources":["../../../../../../packages/react-richtext-renderer/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\trenderLeaf,\n\t\t\t{\n\t\t\t\tformatVersion,\n\t\t\t\tleaf,\n\t\t\t\tfallback,\n\t\t\t\tchildren: leaf.text,\n\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,WAAA;AAAA,EACX,OAAO,EAAE,SAAS,EAAE,gBAAc;AACnC,GAAoD;AACnD,QAAM,WAAWA,8BAAAA,OAACC,mBAAAA,oBAAA,EAAmB,KAAA,GAApB,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAAgC;AAEjD,SAAO,aACJC,MAAAA;AAAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,KAAK;AAAA,IAAA;AAAA,EAChB,IAEC;AACJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeafRenderer.js","sources":["../../../../../../packages/react-richtext-renderer/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\trenderLeaf,\n\t\t\t{\n\t\t\t\tformatVersion,\n\t\t\t\tleaf,\n\t\t\t\tfallback,\n\t\t\t\tchildren: leaf.text,\n\t\t\t},\n\t\t
|
|
1
|
+
{"version":3,"file":"LeafRenderer.js","sources":["../../../../../../packages/react-richtext-renderer/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\trenderLeaf,\n\t\t\t{\n\t\t\t\tformatVersion,\n\t\t\t\tleaf,\n\t\t\t\tfallback,\n\t\t\t\tchildren: leaf.text,\n\t\t\t},\n\t\t)\n\t\t: fallback\n}\n"],"names":[],"mappings":";;;AAcO,SAAS,aAGd;AAAA,EACD;AAAA,EACA,SAAS,EAAE,WAAA;AAAA,EACX,OAAO,EAAE,SAAS,EAAE,gBAAc;AACnC,GAAoD;AACnD,QAAM,WAAW,uBAAC,oBAAA,EAAmB,KAAA,GAApB,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAAgC;AAEjD,SAAO,aACJ;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,KAAK;AAAA,IAAA;AAAA,EAChB,IAEC;AACJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderElementFallback.cjs","sources":["../../../../../../packages/react-richtext-renderer/src/internal/components/RenderElementFallback.tsx"],"sourcesContent":["import { createElement, ReactElement } from 'react'\nimport type { BuiltinElements, RichTextReferenceElement, RichTextTableRowElement } from '../../types/builtin/BuiltinElements'\nimport { renderChildren } from '../renderChildren'\nimport { useReferenceMetadata } from '../useReferenceMetadata'\nimport type { RichTextElement } from '../../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../../types/structure/RichTextLeaf'\nimport { RichTextRendererError } from '../../RichTextRendererError'\nimport { RichTextBlock } from '../../types/RichTextBlock'\nimport { RichTextRenderingOptions } from '../../types/RichTextRenderingOptions'\n\nexport interface RenderElementFallbackProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> {\n\telement: BuiltinElements<CustomElements, CustomLeaves>\n\tchildren: ReactElement\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n}\n\nconst getElementDataAttributes = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>(\n\telement: RichTextElement<CustomElements, CustomLeaves>,\n\tattributeNamePrefix: string = 'contember-',\n): {\n\t[dataAttribute: string]: string | number | boolean\n} => {\n\tconst { children, referenceId, ...extendedSpecifics } = element\n\n\treturn Object.fromEntries(\n\t\tObject.entries(extendedSpecifics)\n\t\t\t.filter(([, value]) => {\n\t\t\t\tconst t = typeof value\n\t\t\t\treturn t === 'string' || t === 'number' || t === 'boolean'\n\t\t\t})\n\t\t\t.map(([attribute, value]) => [`data-${attributeNamePrefix}${attribute.toLowerCase()}`, value]),\n\t)\n}\n\nexport function RenderElementFallback<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({ element, children, options, block }: RenderElementFallbackProps<CustomElements, CustomLeaves>) {\n\tconst attributes = getElementDataAttributes(element, options.attributeNamePrefix)\n\n\tswitch (element.type) {\n\t\tcase 'anchor':\n\t\t\treturn (\n\t\t\t\t<a {...attributes} href={element.href}>\n\t\t\t\t\t{children}\n\t\t\t\t</a>\n\t\t\t)\n\t\tcase 'heading':\n\t\t\treturn createElement(`h${element.level}`, attributes, children) // TODO numbered\n\t\tcase 'horizontalRule':\n\t\t\treturn <hr {...attributes} />\n\t\tcase 'listItem':\n\t\t\treturn <li {...attributes}>{children}</li>\n\t\tcase 'orderedList':\n\t\t\treturn <ol {...attributes}>{children}</ol>\n\t\tcase 'paragraph':\n\t\t\treturn <p {...attributes}>{children}</p>\n\t\tcase 'reference': {\n\t\t\treturn <ReferenceElementFallback element={element} children={children} options={options} block={block} />\n\t\t}\n\t\tcase 'scrollTarget':\n\t\t\treturn (\n\t\t\t\t<span {...attributes} id={element.identifier}>\n\t\t\t\t\t{children}\n\t\t\t\t</span>\n\t\t\t)\n\t\tcase 'table': {\n\t\t\tconst firstRow = element.children[0] as RichTextTableRowElement<CustomElements, CustomLeaves> | undefined\n\t\t\tif (!firstRow || firstRow.headerScope !== 'table') {\n\t\t\t\treturn (\n\t\t\t\t\t<table {...attributes}>\n\t\t\t\t\t\t<tbody>{children}</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<table {...attributes}>\n\t\t\t\t\t<thead>{renderChildren<CustomElements, CustomLeaves>([firstRow], options, block)}</thead>\n\t\t\t\t\t<tbody>{renderChildren<CustomElements, CustomLeaves>(element.children.slice(1) as any, options, block)}</tbody>\n\t\t\t\t</table>\n\t\t\t)\n\t\t}\n\t\tcase 'tableRow':\n\t\t\treturn <tr {...attributes}>{children}</tr>\n\t\tcase 'tableCell': {\n\t\t\tif (element.headerScope) {\n\t\t\t\treturn (\n\t\t\t\t\t<th {...attributes} scope={element.headerScope}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</th>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn <td {...attributes}>{children}</td>\n\t\t}\n\t\tcase 'unorderedList':\n\t\t\treturn <ul {...attributes}>{children}</ul>\n\t\tdefault: {\n\t\t\tif (import.meta.env.DEV) {\n\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t`RichTextRenderer: unknown element of type '${(element as { type: string }).type}'.`,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\treturn children // At least render the text contents\n\t\t\t}\n\t\t}\n\t}\n}\n\ntype ReferenceElementFallbackProps<CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf> = {\n\telement: RichTextReferenceElement<CustomElements, CustomLeaves>\n\tchildren: ReactElement\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n}\n\nfunction ReferenceElementFallback<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({ element, children, options, block }: ReferenceElementFallbackProps<CustomElements, CustomLeaves>) {\n\tconst elementMetadata = useReferenceMetadata<CustomElements, CustomLeaves>(element, options, block, true)\n\n\tif (\n\t\telementMetadata.referenceRenderer === undefined
|
|
1
|
+
{"version":3,"file":"RenderElementFallback.cjs","sources":["../../../../../../packages/react-richtext-renderer/src/internal/components/RenderElementFallback.tsx"],"sourcesContent":["import { createElement, ReactElement } from 'react'\nimport type { BuiltinElements, RichTextReferenceElement, RichTextTableRowElement } from '../../types/builtin/BuiltinElements'\nimport { renderChildren } from '../renderChildren'\nimport { useReferenceMetadata } from '../useReferenceMetadata'\nimport type { RichTextElement } from '../../types/structure/RichTextElement'\nimport type { RichTextLeaf } from '../../types/structure/RichTextLeaf'\nimport { RichTextRendererError } from '../../RichTextRendererError'\nimport { RichTextBlock } from '../../types/RichTextBlock'\nimport { RichTextRenderingOptions } from '../../types/RichTextRenderingOptions'\n\nexport interface RenderElementFallbackProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n> {\n\telement: BuiltinElements<CustomElements, CustomLeaves>\n\tchildren: ReactElement\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n}\n\nconst getElementDataAttributes = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>(\n\telement: RichTextElement<CustomElements, CustomLeaves>,\n\tattributeNamePrefix: string = 'contember-',\n): {\n\t[dataAttribute: string]: string | number | boolean\n} => {\n\tconst { children, referenceId, ...extendedSpecifics } = element\n\n\treturn Object.fromEntries(\n\t\tObject.entries(extendedSpecifics)\n\t\t\t.filter(([, value]) => {\n\t\t\t\tconst t = typeof value\n\t\t\t\treturn t === 'string' || t === 'number' || t === 'boolean'\n\t\t\t})\n\t\t\t.map(([attribute, value]) => [`data-${attributeNamePrefix}${attribute.toLowerCase()}`, value]),\n\t)\n}\n\nexport function RenderElementFallback<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({ element, children, options, block }: RenderElementFallbackProps<CustomElements, CustomLeaves>) {\n\tconst attributes = getElementDataAttributes(element, options.attributeNamePrefix)\n\n\tswitch (element.type) {\n\t\tcase 'anchor':\n\t\t\treturn (\n\t\t\t\t<a {...attributes} href={element.href}>\n\t\t\t\t\t{children}\n\t\t\t\t</a>\n\t\t\t)\n\t\tcase 'heading':\n\t\t\treturn createElement(`h${element.level}`, attributes, children) // TODO numbered\n\t\tcase 'horizontalRule':\n\t\t\treturn <hr {...attributes} />\n\t\tcase 'listItem':\n\t\t\treturn <li {...attributes}>{children}</li>\n\t\tcase 'orderedList':\n\t\t\treturn <ol {...attributes}>{children}</ol>\n\t\tcase 'paragraph':\n\t\t\treturn <p {...attributes}>{children}</p>\n\t\tcase 'reference': {\n\t\t\treturn <ReferenceElementFallback element={element} children={children} options={options} block={block} />\n\t\t}\n\t\tcase 'scrollTarget':\n\t\t\treturn (\n\t\t\t\t<span {...attributes} id={element.identifier}>\n\t\t\t\t\t{children}\n\t\t\t\t</span>\n\t\t\t)\n\t\tcase 'table': {\n\t\t\tconst firstRow = element.children[0] as RichTextTableRowElement<CustomElements, CustomLeaves> | undefined\n\t\t\tif (!firstRow || firstRow.headerScope !== 'table') {\n\t\t\t\treturn (\n\t\t\t\t\t<table {...attributes}>\n\t\t\t\t\t\t<tbody>{children}</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<table {...attributes}>\n\t\t\t\t\t<thead>{renderChildren<CustomElements, CustomLeaves>([firstRow], options, block)}</thead>\n\t\t\t\t\t<tbody>{renderChildren<CustomElements, CustomLeaves>(element.children.slice(1) as any, options, block)}</tbody>\n\t\t\t\t</table>\n\t\t\t)\n\t\t}\n\t\tcase 'tableRow':\n\t\t\treturn <tr {...attributes}>{children}</tr>\n\t\tcase 'tableCell': {\n\t\t\tif (element.headerScope) {\n\t\t\t\treturn (\n\t\t\t\t\t<th {...attributes} scope={element.headerScope}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</th>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn <td {...attributes}>{children}</td>\n\t\t}\n\t\tcase 'unorderedList':\n\t\t\treturn <ul {...attributes}>{children}</ul>\n\t\tdefault: {\n\t\t\tif (import.meta.env.DEV) {\n\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t`RichTextRenderer: unknown element of type '${(element as { type: string }).type}'.`,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\treturn children // At least render the text contents\n\t\t\t}\n\t\t}\n\t}\n}\n\ntype ReferenceElementFallbackProps<CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = RichTextLeaf> = {\n\telement: RichTextReferenceElement<CustomElements, CustomLeaves>\n\tchildren: ReactElement\n\toptions: RichTextRenderingOptions<CustomElements, CustomLeaves>\n\tblock: RichTextBlock<CustomElements, CustomLeaves>\n}\n\nfunction ReferenceElementFallback<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = RichTextLeaf,\n>({ element, children, options, block }: ReferenceElementFallbackProps<CustomElements, CustomLeaves>) {\n\tconst elementMetadata = useReferenceMetadata<CustomElements, CustomLeaves>(element, options, block, true)\n\n\tif (\n\t\telementMetadata.referenceRenderer === undefined\n\t\t|| elementMetadata.referenceType === undefined\n\t\t|| elementMetadata.reference === undefined\n\t) {\n\t\treturn children // At least render the text contents\n\t}\n\n\tlet Renderer = elementMetadata.referenceRenderer\n\treturn (\n\t\t<>\n\t\t\t<Renderer\n\t\t\t\treferenceType={elementMetadata.referenceType}\n\t\t\t\treferenceRenderer={elementMetadata.referenceRenderer}\n\t\t\t\treference={elementMetadata.reference}\n\t\t\t\tformatVersion={block.content.formatVersion}\n\t\t\t\tblock={block}\n\t\t\t\toptions={options}\n\t\t\t\telement={element}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Renderer>\n\t\t</>\n\t)\n}\n"],"names":["createElement","jsxDEV","renderChildren","RichTextRendererError","useReferenceMetadata","Fragment"],"mappings":";;;;;;;AAoBA,MAAM,2BAA2B,CAIhC,SACA,sBAA8B,iBAG1B;AACJ,QAAM,EAAE,UAAU,aAAa,GAAG,sBAAsB;AAExD,SAAO,OAAO;AAAA,IACb,OAAO,QAAQ,iBAAiB,EAC9B,OAAO,CAAC,CAAA,EAAG,KAAK,MAAM;AACtB,YAAM,IAAI,OAAO;AACjB,aAAO,MAAM,YAAY,MAAM,YAAY,MAAM;AAAA,IAClD,CAAC,EACA,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC,QAAQ,mBAAmB,GAAG,UAAU,aAAa,IAAI,KAAK,CAAC;AAAA,EAAA;AAEhG;AA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