@contember/react-client 1.3.0-alpha.2 → 1.3.0-alpha.21
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 +9 -5
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +1 -4
- package/dist/development/index.js.map +1 -1
- package/dist/development/upload/fileUploadReducer.cjs +2 -3
- package/dist/development/upload/fileUploadReducer.cjs.map +1 -1
- package/dist/development/upload/fileUploadReducer.js +2 -3
- package/dist/development/upload/fileUploadReducer.js.map +1 -1
- package/dist/development/upload/useFileUpload.cjs.map +1 -1
- package/dist/development/upload/useFileUpload.js.map +1 -1
- package/dist/development/useGraphQlClient.cjs.map +1 -1
- package/dist/development/useGraphQlClient.js.map +1 -1
- package/dist/production/index.cjs +9 -5
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +1 -4
- package/dist/production/index.js.map +1 -1
- package/dist/production/upload/fileUploadReducer.cjs +2 -3
- package/dist/production/upload/fileUploadReducer.cjs.map +1 -1
- package/dist/production/upload/fileUploadReducer.js +2 -3
- package/dist/production/upload/fileUploadReducer.js.map +1 -1
- package/dist/production/upload/useFileUpload.cjs.map +1 -1
- package/dist/production/upload/useFileUpload.js.map +1 -1
- package/dist/production/useGraphQlClient.cjs.map +1 -1
- package/dist/production/useGraphQlClient.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/upload/SingleFileUploadState.d.ts +8 -4
- package/dist/types/upload/SingleFileUploadState.d.ts.map +1 -1
- package/dist/types/upload/fileUploadReducer.d.ts.map +1 -1
- package/dist/types/upload/index.d.ts +1 -1
- package/dist/types/upload/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/index.ts +1 -1
- package/src/tsconfig.json +1 -0
- package/src/upload/SingleFileUploadState.ts +40 -32
- package/src/upload/fileUploadReducer.ts +4 -3
- package/src/upload/index.ts +1 -1
- package/dist/development/components/RichTextRenderer/ElementRenderer.cjs +0 -27
- package/dist/development/components/RichTextRenderer/ElementRenderer.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/ElementRenderer.js +0 -27
- package/dist/development/components/RichTextRenderer/ElementRenderer.js.map +0 -1
- package/dist/development/components/RichTextRenderer/LeafRenderer.cjs +0 -28
- package/dist/development/components/RichTextRenderer/LeafRenderer.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/LeafRenderer.js +0 -28
- package/dist/development/components/RichTextRenderer/LeafRenderer.js.map +0 -1
- package/dist/development/components/RichTextRenderer/RenderElementFallback.cjs +0 -155
- package/dist/development/components/RichTextRenderer/RenderElementFallback.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/RenderElementFallback.js +0 -155
- package/dist/development/components/RichTextRenderer/RenderElementFallback.js.map +0 -1
- package/dist/development/components/RichTextRenderer/RenderLeafFallback.cjs +0 -74
- package/dist/development/components/RichTextRenderer/RenderLeafFallback.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/RenderLeafFallback.js +0 -74
- package/dist/development/components/RichTextRenderer/RenderLeafFallback.js.map +0 -1
- package/dist/development/components/RichTextRenderer/RichTextRenderMetadataContext.cjs +0 -15
- package/dist/development/components/RichTextRenderer/RichTextRenderMetadataContext.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/RichTextRenderMetadataContext.js +0 -15
- package/dist/development/components/RichTextRenderer/RichTextRenderMetadataContext.js.map +0 -1
- package/dist/development/components/RichTextRenderer/RichTextRenderer.cjs +0 -124
- package/dist/development/components/RichTextRenderer/RichTextRenderer.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/RichTextRenderer.js +0 -124
- package/dist/development/components/RichTextRenderer/RichTextRenderer.js.map +0 -1
- package/dist/development/components/RichTextRenderer/RichTextRendererError.cjs +0 -6
- package/dist/development/components/RichTextRenderer/RichTextRendererError.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/RichTextRendererError.js +0 -6
- package/dist/development/components/RichTextRenderer/RichTextRendererError.js.map +0 -1
- package/dist/development/components/RichTextRenderer/defaultDeserialize.cjs +0 -14
- package/dist/development/components/RichTextRenderer/defaultDeserialize.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/defaultDeserialize.js +0 -14
- package/dist/development/components/RichTextRenderer/defaultDeserialize.js.map +0 -1
- package/dist/development/components/RichTextRenderer/renderChildren.cjs +0 -33
- package/dist/development/components/RichTextRenderer/renderChildren.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/renderChildren.js +0 -33
- package/dist/development/components/RichTextRenderer/renderChildren.js.map +0 -1
- package/dist/development/components/RichTextRenderer/resolveRichTextElementMetadata.cjs +0 -29
- package/dist/development/components/RichTextRenderer/resolveRichTextElementMetadata.cjs.map +0 -1
- package/dist/development/components/RichTextRenderer/resolveRichTextElementMetadata.js +0 -29
- package/dist/development/components/RichTextRenderer/resolveRichTextElementMetadata.js.map +0 -1
- package/dist/production/components/RichTextRenderer/ElementRenderer.cjs +0 -23
- package/dist/production/components/RichTextRenderer/ElementRenderer.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/ElementRenderer.js +0 -23
- package/dist/production/components/RichTextRenderer/ElementRenderer.js.map +0 -1
- package/dist/production/components/RichTextRenderer/LeafRenderer.cjs +0 -24
- package/dist/production/components/RichTextRenderer/LeafRenderer.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/LeafRenderer.js +0 -24
- package/dist/production/components/RichTextRenderer/LeafRenderer.js.map +0 -1
- package/dist/production/components/RichTextRenderer/RenderElementFallback.cjs +0 -82
- package/dist/production/components/RichTextRenderer/RenderElementFallback.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/RenderElementFallback.js +0 -82
- package/dist/production/components/RichTextRenderer/RenderElementFallback.js.map +0 -1
- package/dist/production/components/RichTextRenderer/RenderLeafFallback.cjs +0 -38
- package/dist/production/components/RichTextRenderer/RenderLeafFallback.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/RenderLeafFallback.js +0 -38
- package/dist/production/components/RichTextRenderer/RenderLeafFallback.js.map +0 -1
- package/dist/production/components/RichTextRenderer/RichTextRenderMetadataContext.cjs +0 -15
- package/dist/production/components/RichTextRenderer/RichTextRenderMetadataContext.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/RichTextRenderMetadataContext.js +0 -15
- package/dist/production/components/RichTextRenderer/RichTextRenderMetadataContext.js.map +0 -1
- package/dist/production/components/RichTextRenderer/RichTextRenderer.cjs +0 -109
- package/dist/production/components/RichTextRenderer/RichTextRenderer.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/RichTextRenderer.js +0 -109
- package/dist/production/components/RichTextRenderer/RichTextRenderer.js.map +0 -1
- package/dist/production/components/RichTextRenderer/RichTextRendererError.cjs +0 -6
- package/dist/production/components/RichTextRenderer/RichTextRendererError.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/RichTextRendererError.js +0 -6
- package/dist/production/components/RichTextRenderer/RichTextRendererError.js.map +0 -1
- package/dist/production/components/RichTextRenderer/defaultDeserialize.cjs +0 -14
- package/dist/production/components/RichTextRenderer/defaultDeserialize.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/defaultDeserialize.js +0 -14
- package/dist/production/components/RichTextRenderer/defaultDeserialize.js.map +0 -1
- package/dist/production/components/RichTextRenderer/renderChildren.cjs +0 -21
- package/dist/production/components/RichTextRenderer/renderChildren.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/renderChildren.js +0 -21
- package/dist/production/components/RichTextRenderer/renderChildren.js.map +0 -1
- package/dist/production/components/RichTextRenderer/resolveRichTextElementMetadata.cjs +0 -29
- package/dist/production/components/RichTextRenderer/resolveRichTextElementMetadata.cjs.map +0 -1
- package/dist/production/components/RichTextRenderer/resolveRichTextElementMetadata.js +0 -29
- package/dist/production/components/RichTextRenderer/resolveRichTextElementMetadata.js.map +0 -1
- package/dist/types/components/RichTextRenderer/BuiltinElements.d.ts +0 -49
- package/dist/types/components/RichTextRenderer/BuiltinElements.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/BuiltinLeaves.d.ts +0 -21
- package/dist/types/components/RichTextRenderer/BuiltinLeaves.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/ElementRenderer.d.ts +0 -22
- package/dist/types/components/RichTextRenderer/ElementRenderer.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/LeafRenderer.d.ts +0 -14
- package/dist/types/components/RichTextRenderer/LeafRenderer.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/NormalizedRichTextBlock.d.ts +0 -14
- package/dist/types/components/RichTextRenderer/NormalizedRichTextBlock.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/ReferenceRenderer.d.ts +0 -14
- package/dist/types/components/RichTextRenderer/ReferenceRenderer.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RenderElementFallback.d.ts +0 -12
- package/dist/types/components/RichTextRenderer/RenderElementFallback.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RenderLeafFallback.d.ts +0 -6
- package/dist/types/components/RichTextRenderer/RenderLeafFallback.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextBlock.d.ts +0 -2
- package/dist/types/components/RichTextRenderer/RichTextBlock.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextElement.d.ts +0 -7
- package/dist/types/components/RichTextRenderer/RichTextElement.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextElementMetadata.d.ts +0 -11
- package/dist/types/components/RichTextRenderer/RichTextElementMetadata.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextLeaf.d.ts +0 -4
- package/dist/types/components/RichTextRenderer/RichTextLeaf.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextLeafMetadata.d.ts +0 -4
- package/dist/types/components/RichTextRenderer/RichTextLeafMetadata.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextReference.d.ts +0 -4
- package/dist/types/components/RichTextRenderer/RichTextReference.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextRenderMetadata.d.ts +0 -12
- package/dist/types/components/RichTextRenderer/RichTextRenderMetadata.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextRenderMetadataContext.d.ts +0 -7
- package/dist/types/components/RichTextRenderer/RichTextRenderMetadataContext.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextRenderer.d.ts +0 -33
- package/dist/types/components/RichTextRenderer/RichTextRenderer.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RichTextRendererError.d.ts +0 -3
- package/dist/types/components/RichTextRenderer/RichTextRendererError.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/RootEditorNode.d.ts +0 -9
- package/dist/types/components/RichTextRenderer/RootEditorNode.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/defaultDeserialize.d.ts +0 -5
- package/dist/types/components/RichTextRenderer/defaultDeserialize.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/index.d.ts +0 -16
- package/dist/types/components/RichTextRenderer/index.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/renderChildren.d.ts +0 -14
- package/dist/types/components/RichTextRenderer/renderChildren.d.ts.map +0 -1
- package/dist/types/components/RichTextRenderer/resolveRichTextElementMetadata.d.ts +0 -8
- package/dist/types/components/RichTextRenderer/resolveRichTextElementMetadata.d.ts.map +0 -1
- package/dist/types/components/index.d.ts +0 -2
- package/dist/types/components/index.d.ts.map +0 -1
- package/src/components/RichTextRenderer/BuiltinElements.ts +0 -112
- package/src/components/RichTextRenderer/BuiltinLeaves.ts +0 -32
- package/src/components/RichTextRenderer/ElementRenderer.tsx +0 -71
- package/src/components/RichTextRenderer/LeafRenderer.tsx +0 -39
- package/src/components/RichTextRenderer/NormalizedRichTextBlock.ts +0 -17
- package/src/components/RichTextRenderer/ReferenceRenderer.ts +0 -26
- package/src/components/RichTextRenderer/RenderElementFallback.tsx +0 -147
- package/src/components/RichTextRenderer/RenderLeafFallback.tsx +0 -43
- package/src/components/RichTextRenderer/RichTextBlock.ts +0 -1
- package/src/components/RichTextRenderer/RichTextElement.ts +0 -10
- package/src/components/RichTextRenderer/RichTextElementMetadata.ts +0 -15
- package/src/components/RichTextRenderer/RichTextLeaf.ts +0 -3
- package/src/components/RichTextRenderer/RichTextLeafMetadata.ts +0 -3
- package/src/components/RichTextRenderer/RichTextReference.ts +0 -3
- package/src/components/RichTextRenderer/RichTextRenderMetadata.ts +0 -16
- package/src/components/RichTextRenderer/RichTextRenderMetadataContext.ts +0 -20
- package/src/components/RichTextRenderer/RichTextRenderer.tsx +0 -168
- package/src/components/RichTextRenderer/RichTextRendererError.ts +0 -1
- package/src/components/RichTextRenderer/RootEditorNode.ts +0 -12
- package/src/components/RichTextRenderer/defaultDeserialize.ts +0 -19
- package/src/components/RichTextRenderer/index.ts +0 -15
- package/src/components/RichTextRenderer/renderChildren.tsx +0 -50
- package/src/components/RichTextRenderer/resolveRichTextElementMetadata.ts +0 -50
- package/src/components/index.ts +0 -1
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
-
const react = require("react");
|
|
5
|
-
function jsxN2br(text) {
|
|
6
|
-
const lines = text.split("\n");
|
|
7
|
-
if (lines.length <= 1) {
|
|
8
|
-
return text;
|
|
9
|
-
}
|
|
10
|
-
return lines.map((line, i) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(react.Fragment, { children: [
|
|
11
|
-
!!i && /* @__PURE__ */ jsxDevRuntime.jsxDEV("br", {}, void 0, false, {
|
|
12
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
13
|
-
lineNumber: 15,
|
|
14
|
-
columnNumber: 12
|
|
15
|
-
}, this),
|
|
16
|
-
line
|
|
17
|
-
] }, i, true, {
|
|
18
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
19
|
-
lineNumber: 14,
|
|
20
|
-
columnNumber: 3
|
|
21
|
-
}, this));
|
|
22
|
-
}
|
|
23
|
-
function RenderLeafFallback({ leaf }) {
|
|
24
|
-
let element = jsxN2br(leaf.text);
|
|
25
|
-
if ("isCode" in leaf && leaf.isCode === true) {
|
|
26
|
-
element = /* @__PURE__ */ jsxDevRuntime.jsxDEV("code", { children: element }, void 0, false, {
|
|
27
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
28
|
-
lineNumber: 25,
|
|
29
|
-
columnNumber: 13
|
|
30
|
-
}, this);
|
|
31
|
-
}
|
|
32
|
-
if ("isStruckThrough" in leaf && leaf.isStruckThrough === true) {
|
|
33
|
-
element = /* @__PURE__ */ jsxDevRuntime.jsxDEV("s", { children: element }, void 0, false, {
|
|
34
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
35
|
-
lineNumber: 28,
|
|
36
|
-
columnNumber: 13
|
|
37
|
-
}, this);
|
|
38
|
-
}
|
|
39
|
-
if ("isHighlighted" in leaf && leaf.isHighlighted === true) {
|
|
40
|
-
element = /* @__PURE__ */ jsxDevRuntime.jsxDEV("em", { children: element }, void 0, false, {
|
|
41
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
42
|
-
lineNumber: 31,
|
|
43
|
-
columnNumber: 13
|
|
44
|
-
}, this);
|
|
45
|
-
}
|
|
46
|
-
if ("isUnderlined" in leaf && leaf.isUnderlined === true) {
|
|
47
|
-
element = /* @__PURE__ */ jsxDevRuntime.jsxDEV("u", { children: element }, void 0, false, {
|
|
48
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
49
|
-
lineNumber: 34,
|
|
50
|
-
columnNumber: 13
|
|
51
|
-
}, this);
|
|
52
|
-
}
|
|
53
|
-
if ("isItalic" in leaf && leaf.isItalic === true) {
|
|
54
|
-
element = /* @__PURE__ */ jsxDevRuntime.jsxDEV("i", { children: element }, void 0, false, {
|
|
55
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
56
|
-
lineNumber: 37,
|
|
57
|
-
columnNumber: 13
|
|
58
|
-
}, this);
|
|
59
|
-
}
|
|
60
|
-
if ("isBold" in leaf && leaf.isBold === true) {
|
|
61
|
-
element = /* @__PURE__ */ jsxDevRuntime.jsxDEV("b", { children: element }, void 0, false, {
|
|
62
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
63
|
-
lineNumber: 40,
|
|
64
|
-
columnNumber: 13
|
|
65
|
-
}, this);
|
|
66
|
-
}
|
|
67
|
-
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: element }, void 0, false, {
|
|
68
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
69
|
-
lineNumber: 42,
|
|
70
|
-
columnNumber: 9
|
|
71
|
-
}, this);
|
|
72
|
-
}
|
|
73
|
-
exports.RenderLeafFallback = RenderLeafFallback;
|
|
74
|
-
//# sourceMappingURL=RenderLeafFallback.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderLeafFallback.cjs","sources":["../../../../src/components/RichTextRenderer/RenderLeafFallback.tsx"],"sourcesContent":["import { Fragment, ReactNode } from 'react'\nimport type { BuiltinLeaves } from './BuiltinLeaves'\n\nexport interface RenderLeafFallbackProps {\n\tleaf: BuiltinLeaves\n}\n\nfunction jsxN2br(text: string): ReactNode {\n\tconst lines = text.split('\\n')\n\tif (lines.length <= 1) {\n\t\treturn text\n\t}\n\treturn lines.map((line, i) => (\n\t\t<Fragment key={i}>\n\t\t\t{!!i && <br />}\n\t\t\t{line}\n\t\t</Fragment>\n\t))\n}\n\nexport function RenderLeafFallback({ leaf }: RenderLeafFallbackProps) {\n\tlet element = jsxN2br(leaf.text)\n\n\tif ('isCode' in leaf && leaf.isCode === true) {\n\t\telement = <code>{element}</code>\n\t}\n\tif ('isStruckThrough' in leaf && leaf.isStruckThrough === true) {\n\t\telement = <s>{element}</s>\n\t}\n\tif ('isHighlighted' in leaf && leaf.isHighlighted === true) {\n\t\telement = <em>{element}</em>\n\t}\n\tif ('isUnderlined' in leaf && leaf.isUnderlined === true) {\n\t\telement = <u>{element}</u>\n\t}\n\tif ('isItalic' in leaf && leaf.isItalic === true) {\n\t\telement = <i>{element}</i>\n\t}\n\tif ('isBold' in leaf && leaf.isBold === true) {\n\t\telement = <b>{element}</b>\n\t}\n\treturn <>{element}</>\n}\n"],"names":["jsxDEV","Fragment"],"mappings":";;;;AAOA,SAAS,QAAQ,MAAyB;AACnC,QAAA,QAAQ,KAAK,MAAM,IAAI;AACzB,MAAA,MAAM,UAAU,GAAG;AACf,WAAA;AAAA,EACR;AACA,SAAO,MAAM,IAAI,CAAC,MAAM,MACvBA,qCAACC,MAAAA,UAAA,EACC,UAAA;AAAA,IAAC,CAAA,CAAC,KAAKD,qCAAC,MAAD,CAAA,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAI,GAAA,IAAA;AAAA,IACX;AAAA,EAAA,EAAA,GAFa,GAAf,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAGA,CACA;AACF;AAEgB,SAAA,mBAAmB,EAAE,QAAiC;AACjE,MAAA,UAAU,QAAQ,KAAK,IAAI;AAE/B,MAAI,YAAY,QAAQ,KAAK,WAAW,MAAM;AACnC,cAAAA,8BAAAA,OAAC,UAAM,UAAP,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAe,GAAA,IAAA;AAAA,EAC1B;AACA,MAAI,qBAAqB,QAAQ,KAAK,oBAAoB,MAAM;AACrD,cAAAA,8BAAAA,OAAC,OAAG,UAAJ,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAA,IAAA;AAAA,EACvB;AACA,MAAI,mBAAmB,QAAQ,KAAK,kBAAkB,MAAM;AACjD,cAAAA,8BAAAA,OAAC,QAAI,UAAL,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAa,GAAA,IAAA;AAAA,EACxB;AACA,MAAI,kBAAkB,QAAQ,KAAK,iBAAiB,MAAM;AAC/C,cAAAA,8BAAAA,OAAC,OAAG,UAAJ,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAA,IAAA;AAAA,EACvB;AACA,MAAI,cAAc,QAAQ,KAAK,aAAa,MAAM;AACvC,cAAAA,8BAAAA,OAAC,OAAG,UAAJ,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAA,IAAA;AAAA,EACvB;AACA,MAAI,YAAY,QAAQ,KAAK,WAAW,MAAM;AACnC,cAAAA,8BAAAA,OAAC,OAAG,UAAJ,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAA,IAAA;AAAA,EACvB;AACA,wEAAU,UAAH,WAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAW,GAAA,IAAA;AACnB;;"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
2
|
-
import { Fragment as Fragment$1 } from "react";
|
|
3
|
-
function jsxN2br(text) {
|
|
4
|
-
const lines = text.split("\n");
|
|
5
|
-
if (lines.length <= 1) {
|
|
6
|
-
return text;
|
|
7
|
-
}
|
|
8
|
-
return lines.map((line, i) => /* @__PURE__ */ jsxDEV(Fragment$1, { children: [
|
|
9
|
-
!!i && /* @__PURE__ */ jsxDEV("br", {}, void 0, false, {
|
|
10
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
11
|
-
lineNumber: 15,
|
|
12
|
-
columnNumber: 12
|
|
13
|
-
}, this),
|
|
14
|
-
line
|
|
15
|
-
] }, i, true, {
|
|
16
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
17
|
-
lineNumber: 14,
|
|
18
|
-
columnNumber: 3
|
|
19
|
-
}, this));
|
|
20
|
-
}
|
|
21
|
-
function RenderLeafFallback({ leaf }) {
|
|
22
|
-
let element = jsxN2br(leaf.text);
|
|
23
|
-
if ("isCode" in leaf && leaf.isCode === true) {
|
|
24
|
-
element = /* @__PURE__ */ jsxDEV("code", { children: element }, void 0, false, {
|
|
25
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
26
|
-
lineNumber: 25,
|
|
27
|
-
columnNumber: 13
|
|
28
|
-
}, this);
|
|
29
|
-
}
|
|
30
|
-
if ("isStruckThrough" in leaf && leaf.isStruckThrough === true) {
|
|
31
|
-
element = /* @__PURE__ */ jsxDEV("s", { children: element }, void 0, false, {
|
|
32
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
33
|
-
lineNumber: 28,
|
|
34
|
-
columnNumber: 13
|
|
35
|
-
}, this);
|
|
36
|
-
}
|
|
37
|
-
if ("isHighlighted" in leaf && leaf.isHighlighted === true) {
|
|
38
|
-
element = /* @__PURE__ */ jsxDEV("em", { children: element }, void 0, false, {
|
|
39
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
40
|
-
lineNumber: 31,
|
|
41
|
-
columnNumber: 13
|
|
42
|
-
}, this);
|
|
43
|
-
}
|
|
44
|
-
if ("isUnderlined" in leaf && leaf.isUnderlined === true) {
|
|
45
|
-
element = /* @__PURE__ */ jsxDEV("u", { children: element }, void 0, false, {
|
|
46
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
47
|
-
lineNumber: 34,
|
|
48
|
-
columnNumber: 13
|
|
49
|
-
}, this);
|
|
50
|
-
}
|
|
51
|
-
if ("isItalic" in leaf && leaf.isItalic === true) {
|
|
52
|
-
element = /* @__PURE__ */ jsxDEV("i", { children: element }, void 0, false, {
|
|
53
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
54
|
-
lineNumber: 37,
|
|
55
|
-
columnNumber: 13
|
|
56
|
-
}, this);
|
|
57
|
-
}
|
|
58
|
-
if ("isBold" in leaf && leaf.isBold === true) {
|
|
59
|
-
element = /* @__PURE__ */ jsxDEV("b", { children: element }, void 0, false, {
|
|
60
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
61
|
-
lineNumber: 40,
|
|
62
|
-
columnNumber: 13
|
|
63
|
-
}, this);
|
|
64
|
-
}
|
|
65
|
-
return /* @__PURE__ */ jsxDEV(Fragment, { children: element }, void 0, false, {
|
|
66
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RenderLeafFallback.tsx",
|
|
67
|
-
lineNumber: 42,
|
|
68
|
-
columnNumber: 9
|
|
69
|
-
}, this);
|
|
70
|
-
}
|
|
71
|
-
export {
|
|
72
|
-
RenderLeafFallback
|
|
73
|
-
};
|
|
74
|
-
//# sourceMappingURL=RenderLeafFallback.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderLeafFallback.js","sources":["../../../../src/components/RichTextRenderer/RenderLeafFallback.tsx"],"sourcesContent":["import { Fragment, ReactNode } from 'react'\nimport type { BuiltinLeaves } from './BuiltinLeaves'\n\nexport interface RenderLeafFallbackProps {\n\tleaf: BuiltinLeaves\n}\n\nfunction jsxN2br(text: string): ReactNode {\n\tconst lines = text.split('\\n')\n\tif (lines.length <= 1) {\n\t\treturn text\n\t}\n\treturn lines.map((line, i) => (\n\t\t<Fragment key={i}>\n\t\t\t{!!i && <br />}\n\t\t\t{line}\n\t\t</Fragment>\n\t))\n}\n\nexport function RenderLeafFallback({ leaf }: RenderLeafFallbackProps) {\n\tlet element = jsxN2br(leaf.text)\n\n\tif ('isCode' in leaf && leaf.isCode === true) {\n\t\telement = <code>{element}</code>\n\t}\n\tif ('isStruckThrough' in leaf && leaf.isStruckThrough === true) {\n\t\telement = <s>{element}</s>\n\t}\n\tif ('isHighlighted' in leaf && leaf.isHighlighted === true) {\n\t\telement = <em>{element}</em>\n\t}\n\tif ('isUnderlined' in leaf && leaf.isUnderlined === true) {\n\t\telement = <u>{element}</u>\n\t}\n\tif ('isItalic' in leaf && leaf.isItalic === true) {\n\t\telement = <i>{element}</i>\n\t}\n\tif ('isBold' in leaf && leaf.isBold === true) {\n\t\telement = <b>{element}</b>\n\t}\n\treturn <>{element}</>\n}\n"],"names":["Fragment"],"mappings":";;AAOA,SAAS,QAAQ,MAAyB;AACnC,QAAA,QAAQ,KAAK,MAAM,IAAI;AACzB,MAAA,MAAM,UAAU,GAAG;AACf,WAAA;AAAA,EACR;AACA,SAAO,MAAM,IAAI,CAAC,MAAM,MACvB,uBAACA,YAAA,EACC,UAAA;AAAA,IAAC,CAAA,CAAC,KAAK,uBAAC,MAAD,CAAA,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAI,GAAA,IAAA;AAAA,IACX;AAAA,EAAA,EAAA,GAFa,GAAf,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAGA,CACA;AACF;AAEgB,SAAA,mBAAmB,EAAE,QAAiC;AACjE,MAAA,UAAU,QAAQ,KAAK,IAAI;AAE/B,MAAI,YAAY,QAAQ,KAAK,WAAW,MAAM;AACnC,cAAA,uBAAC,UAAM,UAAP,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAe,GAAA,IAAA;AAAA,EAC1B;AACA,MAAI,qBAAqB,QAAQ,KAAK,oBAAoB,MAAM;AACrD,cAAA,uBAAC,OAAG,UAAJ,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAA,IAAA;AAAA,EACvB;AACA,MAAI,mBAAmB,QAAQ,KAAK,kBAAkB,MAAM;AACjD,cAAA,uBAAC,QAAI,UAAL,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAa,GAAA,IAAA;AAAA,EACxB;AACA,MAAI,kBAAkB,QAAQ,KAAK,iBAAiB,MAAM;AAC/C,cAAA,uBAAC,OAAG,UAAJ,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAA,IAAA;AAAA,EACvB;AACA,MAAI,cAAc,QAAQ,KAAK,aAAa,MAAM;AACvC,cAAA,uBAAC,OAAG,UAAJ,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAA,IAAA;AAAA,EACvB;AACA,MAAI,YAAY,QAAQ,KAAK,WAAW,MAAM;AACnC,cAAA,uBAAC,OAAG,UAAJ,WAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAA,IAAA;AAAA,EACvB;AACA,4CAAU,UAAH,WAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAW,GAAA,IAAA;AACnB;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const react = require("react");
|
|
4
|
-
const RichTextRenderMetadataContext = react.createContext({
|
|
5
|
-
formatVersion: 0,
|
|
6
|
-
referencesField: void 0,
|
|
7
|
-
referenceDiscriminationField: void 0,
|
|
8
|
-
referenceRenderers: {},
|
|
9
|
-
references: void 0
|
|
10
|
-
});
|
|
11
|
-
RichTextRenderMetadataContext.displayName = "RichTextRenderMetadataContext";
|
|
12
|
-
const useRichTextRenderMetadata = () => react.useContext(RichTextRenderMetadataContext);
|
|
13
|
-
exports.RichTextRenderMetadataContext = RichTextRenderMetadataContext;
|
|
14
|
-
exports.useRichTextRenderMetadata = useRichTextRenderMetadata;
|
|
15
|
-
//# sourceMappingURL=RichTextRenderMetadataContext.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRenderMetadataContext.cjs","sources":["../../../../src/components/RichTextRenderer/RichTextRenderMetadataContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RichTextReference } from './RichTextReference'\nimport type { RichTextRenderMetadata } from './RichTextRenderMetadata'\n\nexport const RichTextRenderMetadataContext = createContext<RichTextRenderMetadata<any, any, any>>({\n\tformatVersion: 0,\n\treferencesField: undefined,\n\treferenceDiscriminationField: undefined,\n\treferenceRenderers: {},\n\treferences: undefined,\n})\nRichTextRenderMetadataContext.displayName = 'RichTextRenderMetadataContext'\n\nexport const useRichTextRenderMetadata = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n\tReference extends RichTextReference = RichTextReference,\n>() => useContext(RichTextRenderMetadataContext) as RichTextRenderMetadata<CustomElements, CustomLeaves, Reference>\n"],"names":["createContext","useContext"],"mappings":";;;AAMO,MAAM,gCAAgCA,MAAAA,cAAqD;AAAA,EACjG,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,8BAA8B;AAAA,EAC9B,oBAAoB,CAAC;AAAA,EACrB,YAAY;AACb,CAAC;AACD,8BAA8B,cAAc;AAE/B,MAAA,4BAA4B,MAIlCC,MAAAA,WAAW,6BAA6B;;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
const RichTextRenderMetadataContext = createContext({
|
|
3
|
-
formatVersion: 0,
|
|
4
|
-
referencesField: void 0,
|
|
5
|
-
referenceDiscriminationField: void 0,
|
|
6
|
-
referenceRenderers: {},
|
|
7
|
-
references: void 0
|
|
8
|
-
});
|
|
9
|
-
RichTextRenderMetadataContext.displayName = "RichTextRenderMetadataContext";
|
|
10
|
-
const useRichTextRenderMetadata = () => useContext(RichTextRenderMetadataContext);
|
|
11
|
-
export {
|
|
12
|
-
RichTextRenderMetadataContext,
|
|
13
|
-
useRichTextRenderMetadata
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=RichTextRenderMetadataContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRenderMetadataContext.js","sources":["../../../../src/components/RichTextRenderer/RichTextRenderMetadataContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RichTextReference } from './RichTextReference'\nimport type { RichTextRenderMetadata } from './RichTextRenderMetadata'\n\nexport const RichTextRenderMetadataContext = createContext<RichTextRenderMetadata<any, any, any>>({\n\tformatVersion: 0,\n\treferencesField: undefined,\n\treferenceDiscriminationField: undefined,\n\treferenceRenderers: {},\n\treferences: undefined,\n})\nRichTextRenderMetadataContext.displayName = 'RichTextRenderMetadataContext'\n\nexport const useRichTextRenderMetadata = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n\tReference extends RichTextReference = RichTextReference,\n>() => useContext(RichTextRenderMetadataContext) as RichTextRenderMetadata<CustomElements, CustomLeaves, Reference>\n"],"names":[],"mappings":";AAMO,MAAM,gCAAgC,cAAqD;AAAA,EACjG,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,8BAA8B;AAAA,EAC9B,oBAAoB,CAAC;AAAA,EACrB,YAAY;AACb,CAAC;AACD,8BAA8B,cAAc;AAE/B,MAAA,4BAA4B,MAIlC,WAAW,6BAA6B;"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
-
const react = require("react");
|
|
5
|
-
const defaultDeserialize = require("./defaultDeserialize.cjs");
|
|
6
|
-
const renderChildren = require("./renderChildren.cjs");
|
|
7
|
-
const RichTextRendererError = require("./RichTextRendererError.cjs");
|
|
8
|
-
const RichTextRenderMetadataContext = require("./RichTextRenderMetadataContext.cjs");
|
|
9
|
-
const RichTextRenderer = react.memo(function RichTextRenderer2({
|
|
10
|
-
deserialize = defaultDeserialize.defaultDeserialize,
|
|
11
|
-
renderElement,
|
|
12
|
-
renderLeaf,
|
|
13
|
-
renderBlock = ({ children }) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children }, void 0, false, {
|
|
14
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RichTextRenderer.tsx",
|
|
15
|
-
lineNumber: 52,
|
|
16
|
-
columnNumber: 34
|
|
17
|
-
}, this),
|
|
18
|
-
attributeNamePrefix,
|
|
19
|
-
...sourceProps
|
|
20
|
-
}) {
|
|
21
|
-
const normalizedSource = react.useMemo(() => {
|
|
22
|
-
if ("source" in sourceProps && !("blocks" in sourceProps)) {
|
|
23
|
-
return [
|
|
24
|
-
{
|
|
25
|
-
content: sourceProps.source ? deserialize(sourceProps.source) : {
|
|
26
|
-
formatVersion: 0,
|
|
27
|
-
children: []
|
|
28
|
-
},
|
|
29
|
-
id: void 0,
|
|
30
|
-
referencesField: void 0,
|
|
31
|
-
referenceDiscriminationField: void 0,
|
|
32
|
-
referenceRenderers: {},
|
|
33
|
-
references: void 0
|
|
34
|
-
}
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
if (!("source" in sourceProps)) {
|
|
38
|
-
const sourceField = sourceProps.sourceField ?? "source";
|
|
39
|
-
const referencesField = sourceProps.referencesField ?? "references";
|
|
40
|
-
const referenceDiscriminationField = sourceProps.referenceDiscriminationField ?? "type";
|
|
41
|
-
return sourceProps.blocks.map((block) => {
|
|
42
|
-
if (!(sourceField in block)) {
|
|
43
|
-
throw new RichTextRendererError.RichTextRendererError(
|
|
44
|
-
`Found a block without a '${sourceField}' field. ` + (sourceProps.sourceField === void 0 ? `The 'sourceField' prop has not been supplied, and so '${sourceField}' 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.`)
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
const source = block[sourceField];
|
|
48
|
-
if (typeof source !== "string") {
|
|
49
|
-
throw new RichTextRendererError.RichTextRendererError(`Found a block whose source is not a string.`);
|
|
50
|
-
}
|
|
51
|
-
if (sourceProps.referencesField !== void 0 && !(referencesField in block)) {
|
|
52
|
-
throw new RichTextRendererError.RichTextRendererError(
|
|
53
|
-
`The 'referencesField' prop is set to '${referencesField}' but a block without such field has been encountered. Unless this is just a typo, if you do not wish to use references, avoid supplying the 'referencesField' prop.`
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
const references = block[referencesField];
|
|
57
|
-
let normalizedReferences = void 0;
|
|
58
|
-
if (references) {
|
|
59
|
-
if (typeof Object(references)[Symbol.iterator] !== "function") {
|
|
60
|
-
throw new RichTextRendererError.RichTextRendererError(`The set of references must be an iterable!`);
|
|
61
|
-
}
|
|
62
|
-
normalizedReferences = /* @__PURE__ */ new Map();
|
|
63
|
-
for (const reference of references) {
|
|
64
|
-
if (!("id" in reference)) {
|
|
65
|
-
throw new RichTextRendererError.RichTextRendererError(`Found a reference without an id field.`);
|
|
66
|
-
}
|
|
67
|
-
if (!(referenceDiscriminationField in reference)) {
|
|
68
|
-
throw new RichTextRendererError.RichTextRendererError(
|
|
69
|
-
`Found a reference without a '${referenceDiscriminationField}' field. ` + (sourceProps.referenceDiscriminationField === void 0 ? `The 'referenceDiscriminationField' prop has not been supplied, and so '${referenceDiscriminationField}' 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.`)
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
normalizedReferences.set(reference.id, reference);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
id: typeof block.id === "string" ? block.id : void 0,
|
|
77
|
-
content: deserialize(source),
|
|
78
|
-
referenceDiscriminationField,
|
|
79
|
-
referenceRenderers: sourceProps.referenceRenderers ?? {},
|
|
80
|
-
referencesField,
|
|
81
|
-
references: normalizedReferences
|
|
82
|
-
};
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
throw new RichTextRendererError.RichTextRendererError(`RichTextRenderer: invalid data supplied.`);
|
|
86
|
-
}, [deserialize, sourceProps]);
|
|
87
|
-
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: normalizedSource.map((block, i) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
88
|
-
RichTextRenderMetadataContext.RichTextRenderMetadataContext.Provider,
|
|
89
|
-
{
|
|
90
|
-
value: {
|
|
91
|
-
formatVersion: block.content.formatVersion,
|
|
92
|
-
referenceRenderers: block.referenceRenderers,
|
|
93
|
-
referencesField: block.referencesField,
|
|
94
|
-
referenceDiscriminationField: block.referenceDiscriminationField,
|
|
95
|
-
references: block.references
|
|
96
|
-
},
|
|
97
|
-
children: react.createElement(
|
|
98
|
-
renderBlock,
|
|
99
|
-
{
|
|
100
|
-
block
|
|
101
|
-
},
|
|
102
|
-
renderChildren.renderChildren(block.content.children, {
|
|
103
|
-
renderLeaf,
|
|
104
|
-
renderElement,
|
|
105
|
-
attributeNamePrefix
|
|
106
|
-
})
|
|
107
|
-
)
|
|
108
|
-
},
|
|
109
|
-
block.id ?? i,
|
|
110
|
-
false,
|
|
111
|
-
{
|
|
112
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RichTextRenderer.tsx",
|
|
113
|
-
lineNumber: 143,
|
|
114
|
-
columnNumber: 5
|
|
115
|
-
},
|
|
116
|
-
this
|
|
117
|
-
)) }, void 0, false, {
|
|
118
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RichTextRenderer.tsx",
|
|
119
|
-
lineNumber: 141,
|
|
120
|
-
columnNumber: 3
|
|
121
|
-
}, this);
|
|
122
|
-
});
|
|
123
|
-
exports.RichTextRenderer = RichTextRenderer;
|
|
124
|
-
//# sourceMappingURL=RichTextRenderer.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRenderer.cjs","sources":["../../../../src/components/RichTextRenderer/RichTextRenderer.tsx"],"sourcesContent":["import { ComponentType, createElement, memo, ReactElement, ReactNode, useMemo } from 'react'\nimport { defaultDeserialize } from './defaultDeserialize'\nimport type { RenderElement } from './ElementRenderer'\nimport type { RenderLeaf } from './LeafRenderer'\nimport type { NormalizedRichTextBlock } from './NormalizedRichTextBlock'\nimport type { ReferenceRenderer } from './ReferenceRenderer'\nimport { renderChildren } from './renderChildren'\nimport type { RichTextBlock } from './RichTextBlock'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RichTextReference } from './RichTextReference'\nimport { RichTextRendererError } from './RichTextRendererError'\nimport { RichTextRenderMetadataContext } from './RichTextRenderMetadataContext'\nimport type { RootEditorNode } from './RootEditorNode'\n\nexport interface RichTextRendererFieldProps {\n\tsource: string | null\n}\n\nexport interface RichTextRendererBlockProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n> {\n\tblocks: readonly RichTextBlock[]\n\treferenceRenderers?: Record<string, ReferenceRenderer<any, CustomElements, CustomLeaves>>\n\tsourceField?: string\n\treferencesField?: string\n\treferenceDiscriminationField?: string\n}\n\nexport type RichTextRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n> = {\n\tdeserialize?: (source: string) => RootEditorNode<CustomElements, CustomLeaves>\n\trenderElement?: RenderElement<CustomElements, CustomLeaves>\n\trenderLeaf?: RenderLeaf<CustomLeaves>\n\tattributeNamePrefix?: string\n\trenderBlock?: ComponentType<{ block: unknown, children?: ReactNode }>\n} & (RichTextRendererFieldProps | RichTextRendererBlockProps<CustomElements, CustomLeaves>)\n\n/**\n * @group Content rendering\n */\nexport const RichTextRenderer = memo(function RichTextRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>({\n\tdeserialize = defaultDeserialize,\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\t...sourceProps\n}: RichTextRendererProps<CustomElements, CustomLeaves>) {\n\tconst normalizedSource = useMemo<NormalizedRichTextBlock<CustomElements, CustomLeaves>[]>(() => {\n\t\tif ('source' in sourceProps && !('blocks' in sourceProps)) {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tcontent: sourceProps.source\n\t\t\t\t\t\t? deserialize(sourceProps.source)\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\tformatVersion: 0,\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\tid: undefined,\n\t\t\t\t\treferencesField: undefined,\n\t\t\t\t\treferenceDiscriminationField: undefined,\n\t\t\t\t\treferenceRenderers: {},\n\t\t\t\t\treferences: undefined,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t\tif (!('source' in sourceProps)) {\n\t\t\tconst sourceField = sourceProps.sourceField ?? 'source'\n\t\t\tconst referencesField = sourceProps.referencesField ?? 'references'\n\t\t\tconst referenceDiscriminationField = sourceProps.referenceDiscriminationField ?? 'type'\n\n\t\t\treturn sourceProps.blocks.map(block => {\n\t\t\t\tif (!(sourceField in block)) {\n\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t`Found a block without a '${sourceField}' field. ` +\n\t\t\t\t\t\t(sourceProps.sourceField === undefined\n\t\t\t\t\t\t\t? `The 'sourceField' prop has not been supplied, and so '${sourceField}' 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`or the data supplied is invalid.`),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tconst source = block[sourceField]\n\t\t\t\tif (typeof source !== 'string') {\n\t\t\t\t\tthrow new RichTextRendererError(`Found a block whose source is not a string.`)\n\t\t\t\t}\n\n\t\t\t\tif (sourceProps.referencesField !== undefined && !(referencesField in block)) {\n\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t`The 'referencesField' prop is set to '${referencesField}' 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\t)\n\t\t\t\t}\n\t\t\t\tconst references = block[referencesField]\n\n\t\t\t\tlet normalizedReferences: Map<string, RichTextReference> | undefined = undefined\n\t\t\t\tif (references) {\n\t\t\t\t\tif (typeof Object(references)[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new RichTextRendererError(`The set of references must be an iterable!`)\n\t\t\t\t\t}\n\n\t\t\t\t\tnormalizedReferences = new Map()\n\t\t\t\t\tfor (const reference of references as Iterable<RichTextReference>) {\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 (!(referenceDiscriminationField in reference)) {\n\t\t\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t\t\t`Found a reference without a '${referenceDiscriminationField}' field. ` +\n\t\t\t\t\t\t\t\t(sourceProps.referenceDiscriminationField === undefined\n\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`and so '${referenceDiscriminationField}' was used as a default.`\n\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`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\tnormalizedReferences.set(reference.id, reference)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tid: typeof block.id === 'string' ? block.id : undefined,\n\t\t\t\t\tcontent: deserialize(source),\n\t\t\t\t\treferenceDiscriminationField,\n\t\t\t\t\treferenceRenderers: sourceProps.referenceRenderers ?? {},\n\t\t\t\t\treferencesField,\n\t\t\t\t\treferences: normalizedReferences,\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tthrow new RichTextRendererError(`RichTextRenderer: invalid data supplied.`)\n\t}, [deserialize, sourceProps])\n\n\treturn (\n\t\t<>\n\t\t\t{normalizedSource.map((block, i) => (\n\t\t\t\t<RichTextRenderMetadataContext.Provider\n\t\t\t\t\tkey={block.id ?? i}\n\t\t\t\t\tvalue={{\n\t\t\t\t\t\tformatVersion: block.content.formatVersion,\n\t\t\t\t\t\treferenceRenderers: block.referenceRenderers,\n\t\t\t\t\t\treferencesField: block.referencesField,\n\t\t\t\t\t\treferenceDiscriminationField: block.referenceDiscriminationField,\n\t\t\t\t\t\treferences: block.references,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{createElement(\n\t\t\t\t\t\trenderBlock, {\n\t\t\t\t\t\tblock,\n\t\t\t\t\t}, renderChildren(block.content.children, {\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}),\n\t\t\t\t\t)}\n\t\t\t\t</RichTextRenderMetadataContext.Provider>\n\t\t\t))}\n\t\t</>\n\t)\n}) as <CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = never>(\n\tprops: RichTextRendererProps<CustomElements, CustomLeaves>,\n) => ReactElement\n"],"names":["memo","RichTextRenderer","defaultDeserialize","useMemo","RichTextRendererError","jsxDEV","Fragment","RichTextRenderMetadataContext","createElement","renderChildren"],"mappings":"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"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
2
|
-
import { memo, useMemo, createElement } from "react";
|
|
3
|
-
import { defaultDeserialize } from "./defaultDeserialize.js";
|
|
4
|
-
import { renderChildren } from "./renderChildren.js";
|
|
5
|
-
import { RichTextRendererError } from "./RichTextRendererError.js";
|
|
6
|
-
import { RichTextRenderMetadataContext } from "./RichTextRenderMetadataContext.js";
|
|
7
|
-
const RichTextRenderer = memo(function RichTextRenderer2({
|
|
8
|
-
deserialize = defaultDeserialize,
|
|
9
|
-
renderElement,
|
|
10
|
-
renderLeaf,
|
|
11
|
-
renderBlock = ({ children }) => /* @__PURE__ */ jsxDEV(Fragment, { children }, void 0, false, {
|
|
12
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RichTextRenderer.tsx",
|
|
13
|
-
lineNumber: 52,
|
|
14
|
-
columnNumber: 34
|
|
15
|
-
}, this),
|
|
16
|
-
attributeNamePrefix,
|
|
17
|
-
...sourceProps
|
|
18
|
-
}) {
|
|
19
|
-
const normalizedSource = useMemo(() => {
|
|
20
|
-
if ("source" in sourceProps && !("blocks" in sourceProps)) {
|
|
21
|
-
return [
|
|
22
|
-
{
|
|
23
|
-
content: sourceProps.source ? deserialize(sourceProps.source) : {
|
|
24
|
-
formatVersion: 0,
|
|
25
|
-
children: []
|
|
26
|
-
},
|
|
27
|
-
id: void 0,
|
|
28
|
-
referencesField: void 0,
|
|
29
|
-
referenceDiscriminationField: void 0,
|
|
30
|
-
referenceRenderers: {},
|
|
31
|
-
references: void 0
|
|
32
|
-
}
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
if (!("source" in sourceProps)) {
|
|
36
|
-
const sourceField = sourceProps.sourceField ?? "source";
|
|
37
|
-
const referencesField = sourceProps.referencesField ?? "references";
|
|
38
|
-
const referenceDiscriminationField = sourceProps.referenceDiscriminationField ?? "type";
|
|
39
|
-
return sourceProps.blocks.map((block) => {
|
|
40
|
-
if (!(sourceField in block)) {
|
|
41
|
-
throw new RichTextRendererError(
|
|
42
|
-
`Found a block without a '${sourceField}' field. ` + (sourceProps.sourceField === void 0 ? `The 'sourceField' prop has not been supplied, and so '${sourceField}' 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.`)
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
const source = block[sourceField];
|
|
46
|
-
if (typeof source !== "string") {
|
|
47
|
-
throw new RichTextRendererError(`Found a block whose source is not a string.`);
|
|
48
|
-
}
|
|
49
|
-
if (sourceProps.referencesField !== void 0 && !(referencesField in block)) {
|
|
50
|
-
throw new RichTextRendererError(
|
|
51
|
-
`The 'referencesField' prop is set to '${referencesField}' but a block without such field has been encountered. Unless this is just a typo, if you do not wish to use references, avoid supplying the 'referencesField' prop.`
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
const references = block[referencesField];
|
|
55
|
-
let normalizedReferences = void 0;
|
|
56
|
-
if (references) {
|
|
57
|
-
if (typeof Object(references)[Symbol.iterator] !== "function") {
|
|
58
|
-
throw new RichTextRendererError(`The set of references must be an iterable!`);
|
|
59
|
-
}
|
|
60
|
-
normalizedReferences = /* @__PURE__ */ new Map();
|
|
61
|
-
for (const reference of references) {
|
|
62
|
-
if (!("id" in reference)) {
|
|
63
|
-
throw new RichTextRendererError(`Found a reference without an id field.`);
|
|
64
|
-
}
|
|
65
|
-
if (!(referenceDiscriminationField in reference)) {
|
|
66
|
-
throw new RichTextRendererError(
|
|
67
|
-
`Found a reference without a '${referenceDiscriminationField}' field. ` + (sourceProps.referenceDiscriminationField === void 0 ? `The 'referenceDiscriminationField' prop has not been supplied, and so '${referenceDiscriminationField}' 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.`)
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
normalizedReferences.set(reference.id, reference);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
id: typeof block.id === "string" ? block.id : void 0,
|
|
75
|
-
content: deserialize(source),
|
|
76
|
-
referenceDiscriminationField,
|
|
77
|
-
referenceRenderers: sourceProps.referenceRenderers ?? {},
|
|
78
|
-
referencesField,
|
|
79
|
-
references: normalizedReferences
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
throw new RichTextRendererError(`RichTextRenderer: invalid data supplied.`);
|
|
84
|
-
}, [deserialize, sourceProps]);
|
|
85
|
-
return /* @__PURE__ */ jsxDEV(Fragment, { children: normalizedSource.map((block, i) => /* @__PURE__ */ jsxDEV(
|
|
86
|
-
RichTextRenderMetadataContext.Provider,
|
|
87
|
-
{
|
|
88
|
-
value: {
|
|
89
|
-
formatVersion: block.content.formatVersion,
|
|
90
|
-
referenceRenderers: block.referenceRenderers,
|
|
91
|
-
referencesField: block.referencesField,
|
|
92
|
-
referenceDiscriminationField: block.referenceDiscriminationField,
|
|
93
|
-
references: block.references
|
|
94
|
-
},
|
|
95
|
-
children: createElement(
|
|
96
|
-
renderBlock,
|
|
97
|
-
{
|
|
98
|
-
block
|
|
99
|
-
},
|
|
100
|
-
renderChildren(block.content.children, {
|
|
101
|
-
renderLeaf,
|
|
102
|
-
renderElement,
|
|
103
|
-
attributeNamePrefix
|
|
104
|
-
})
|
|
105
|
-
)
|
|
106
|
-
},
|
|
107
|
-
block.id ?? i,
|
|
108
|
-
false,
|
|
109
|
-
{
|
|
110
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RichTextRenderer.tsx",
|
|
111
|
-
lineNumber: 143,
|
|
112
|
-
columnNumber: 5
|
|
113
|
-
},
|
|
114
|
-
this
|
|
115
|
-
)) }, void 0, false, {
|
|
116
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/RichTextRenderer.tsx",
|
|
117
|
-
lineNumber: 141,
|
|
118
|
-
columnNumber: 3
|
|
119
|
-
}, this);
|
|
120
|
-
});
|
|
121
|
-
export {
|
|
122
|
-
RichTextRenderer
|
|
123
|
-
};
|
|
124
|
-
//# sourceMappingURL=RichTextRenderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRenderer.js","sources":["../../../../src/components/RichTextRenderer/RichTextRenderer.tsx"],"sourcesContent":["import { ComponentType, createElement, memo, ReactElement, ReactNode, useMemo } from 'react'\nimport { defaultDeserialize } from './defaultDeserialize'\nimport type { RenderElement } from './ElementRenderer'\nimport type { RenderLeaf } from './LeafRenderer'\nimport type { NormalizedRichTextBlock } from './NormalizedRichTextBlock'\nimport type { ReferenceRenderer } from './ReferenceRenderer'\nimport { renderChildren } from './renderChildren'\nimport type { RichTextBlock } from './RichTextBlock'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RichTextReference } from './RichTextReference'\nimport { RichTextRendererError } from './RichTextRendererError'\nimport { RichTextRenderMetadataContext } from './RichTextRenderMetadataContext'\nimport type { RootEditorNode } from './RootEditorNode'\n\nexport interface RichTextRendererFieldProps {\n\tsource: string | null\n}\n\nexport interface RichTextRendererBlockProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n> {\n\tblocks: readonly RichTextBlock[]\n\treferenceRenderers?: Record<string, ReferenceRenderer<any, CustomElements, CustomLeaves>>\n\tsourceField?: string\n\treferencesField?: string\n\treferenceDiscriminationField?: string\n}\n\nexport type RichTextRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n> = {\n\tdeserialize?: (source: string) => RootEditorNode<CustomElements, CustomLeaves>\n\trenderElement?: RenderElement<CustomElements, CustomLeaves>\n\trenderLeaf?: RenderLeaf<CustomLeaves>\n\tattributeNamePrefix?: string\n\trenderBlock?: ComponentType<{ block: unknown, children?: ReactNode }>\n} & (RichTextRendererFieldProps | RichTextRendererBlockProps<CustomElements, CustomLeaves>)\n\n/**\n * @group Content rendering\n */\nexport const RichTextRenderer = memo(function RichTextRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>({\n\tdeserialize = defaultDeserialize,\n\trenderElement,\n\trenderLeaf,\n\trenderBlock = ({ children }) => <>{children}</>,\n\tattributeNamePrefix,\n\t...sourceProps\n}: RichTextRendererProps<CustomElements, CustomLeaves>) {\n\tconst normalizedSource = useMemo<NormalizedRichTextBlock<CustomElements, CustomLeaves>[]>(() => {\n\t\tif ('source' in sourceProps && !('blocks' in sourceProps)) {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tcontent: sourceProps.source\n\t\t\t\t\t\t? deserialize(sourceProps.source)\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\tformatVersion: 0,\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\tid: undefined,\n\t\t\t\t\treferencesField: undefined,\n\t\t\t\t\treferenceDiscriminationField: undefined,\n\t\t\t\t\treferenceRenderers: {},\n\t\t\t\t\treferences: undefined,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t\tif (!('source' in sourceProps)) {\n\t\t\tconst sourceField = sourceProps.sourceField ?? 'source'\n\t\t\tconst referencesField = sourceProps.referencesField ?? 'references'\n\t\t\tconst referenceDiscriminationField = sourceProps.referenceDiscriminationField ?? 'type'\n\n\t\t\treturn sourceProps.blocks.map(block => {\n\t\t\t\tif (!(sourceField in block)) {\n\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t`Found a block without a '${sourceField}' field. ` +\n\t\t\t\t\t\t(sourceProps.sourceField === undefined\n\t\t\t\t\t\t\t? `The 'sourceField' prop has not been supplied, and so '${sourceField}' 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`or the data supplied is invalid.`),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tconst source = block[sourceField]\n\t\t\t\tif (typeof source !== 'string') {\n\t\t\t\t\tthrow new RichTextRendererError(`Found a block whose source is not a string.`)\n\t\t\t\t}\n\n\t\t\t\tif (sourceProps.referencesField !== undefined && !(referencesField in block)) {\n\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t`The 'referencesField' prop is set to '${referencesField}' 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\t)\n\t\t\t\t}\n\t\t\t\tconst references = block[referencesField]\n\n\t\t\t\tlet normalizedReferences: Map<string, RichTextReference> | undefined = undefined\n\t\t\t\tif (references) {\n\t\t\t\t\tif (typeof Object(references)[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new RichTextRendererError(`The set of references must be an iterable!`)\n\t\t\t\t\t}\n\n\t\t\t\t\tnormalizedReferences = new Map()\n\t\t\t\t\tfor (const reference of references as Iterable<RichTextReference>) {\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 (!(referenceDiscriminationField in reference)) {\n\t\t\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t\t\t`Found a reference without a '${referenceDiscriminationField}' field. ` +\n\t\t\t\t\t\t\t\t(sourceProps.referenceDiscriminationField === undefined\n\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`and so '${referenceDiscriminationField}' was used as a default.`\n\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`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\tnormalizedReferences.set(reference.id, reference)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tid: typeof block.id === 'string' ? block.id : undefined,\n\t\t\t\t\tcontent: deserialize(source),\n\t\t\t\t\treferenceDiscriminationField,\n\t\t\t\t\treferenceRenderers: sourceProps.referenceRenderers ?? {},\n\t\t\t\t\treferencesField,\n\t\t\t\t\treferences: normalizedReferences,\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tthrow new RichTextRendererError(`RichTextRenderer: invalid data supplied.`)\n\t}, [deserialize, sourceProps])\n\n\treturn (\n\t\t<>\n\t\t\t{normalizedSource.map((block, i) => (\n\t\t\t\t<RichTextRenderMetadataContext.Provider\n\t\t\t\t\tkey={block.id ?? i}\n\t\t\t\t\tvalue={{\n\t\t\t\t\t\tformatVersion: block.content.formatVersion,\n\t\t\t\t\t\treferenceRenderers: block.referenceRenderers,\n\t\t\t\t\t\treferencesField: block.referencesField,\n\t\t\t\t\t\treferenceDiscriminationField: block.referenceDiscriminationField,\n\t\t\t\t\t\treferences: block.references,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{createElement(\n\t\t\t\t\t\trenderBlock, {\n\t\t\t\t\t\tblock,\n\t\t\t\t\t}, renderChildren(block.content.children, {\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}),\n\t\t\t\t\t)}\n\t\t\t\t</RichTextRenderMetadataContext.Provider>\n\t\t\t))}\n\t\t</>\n\t)\n}) as <CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = never>(\n\tprops: RichTextRendererProps<CustomElements, CustomLeaves>,\n) => ReactElement\n"],"names":["RichTextRenderer"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRendererError.cjs","sources":["../../../../src/components/RichTextRenderer/RichTextRendererError.ts"],"sourcesContent":["export class RichTextRendererError extends Error {}\n"],"names":[],"mappings":";;AAAO,MAAM,8BAA8B,MAAM;AAAC;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRendererError.js","sources":["../../../../src/components/RichTextRenderer/RichTextRendererError.ts"],"sourcesContent":["export class RichTextRendererError extends Error {}\n"],"names":[],"mappings":"AAAO,MAAM,8BAA8B,MAAM;AAAC;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const defaultDeserialize = (source) => {
|
|
4
|
-
try {
|
|
5
|
-
return JSON.parse(source);
|
|
6
|
-
} catch (e) {
|
|
7
|
-
return {
|
|
8
|
-
formatVersion: 0,
|
|
9
|
-
children: []
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
exports.defaultDeserialize = defaultDeserialize;
|
|
14
|
-
//# sourceMappingURL=defaultDeserialize.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultDeserialize.cjs","sources":["../../../../src/components/RichTextRenderer/defaultDeserialize.ts"],"sourcesContent":["import type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RootEditorNode } from './RootEditorNode'\n\nexport const defaultDeserialize = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>(\n\tsource: string,\n): RootEditorNode<CustomElements, CustomLeaves> => {\n\ttry {\n\t\treturn JSON.parse(source)\n\t} catch (e) {\n\t\treturn {\n\t\t\tformatVersion: 0,\n\t\t\tchildren: [],\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAIa,MAAA,qBAAqB,CAIjC,WACkD;AAC9C,MAAA;AACI,WAAA,KAAK,MAAM,MAAM;AAAA,WAChB;AACD,WAAA;AAAA,MACN,eAAe;AAAA,MACf,UAAU,CAAC;AAAA,IAAA;AAAA,EAEb;AACD;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultDeserialize.js","sources":["../../../../src/components/RichTextRenderer/defaultDeserialize.ts"],"sourcesContent":["import type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RootEditorNode } from './RootEditorNode'\n\nexport const defaultDeserialize = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>(\n\tsource: string,\n): RootEditorNode<CustomElements, CustomLeaves> => {\n\ttry {\n\t\treturn JSON.parse(source)\n\t} catch (e) {\n\t\treturn {\n\t\t\tformatVersion: 0,\n\t\t\tchildren: [],\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAIa,MAAA,qBAAqB,CAIjC,WACkD;AAC9C,MAAA;AACI,WAAA,KAAK,MAAM,MAAM;AAAA,WAChB;AACD,WAAA;AAAA,MACN,eAAe;AAAA,MACf,UAAU,CAAC;AAAA,IAAA;AAAA,EAEb;AACD;"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
-
const ElementRenderer = require("./ElementRenderer.cjs");
|
|
5
|
-
const LeafRenderer = require("./LeafRenderer.cjs");
|
|
6
|
-
const renderChildren = (children, options) => {
|
|
7
|
-
if (!Array.isArray(children)) {
|
|
8
|
-
children = [children];
|
|
9
|
-
}
|
|
10
|
-
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: children.map((child, i) => {
|
|
11
|
-
if ("text" in child) {
|
|
12
|
-
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(LeafRenderer.LeafRenderer, { leaf: child, renderLeaf: options.renderLeaf }, i, false, {
|
|
13
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/renderChildren.tsx",
|
|
14
|
-
lineNumber: 37,
|
|
15
|
-
columnNumber: 13
|
|
16
|
-
}, globalThis);
|
|
17
|
-
}
|
|
18
|
-
if ("children" in child) {
|
|
19
|
-
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(ElementRenderer.ElementRenderer, { element: child, options, children: renderChildren(child.children, options) }, i, false, {
|
|
20
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/renderChildren.tsx",
|
|
21
|
-
lineNumber: 41,
|
|
22
|
-
columnNumber: 7
|
|
23
|
-
}, globalThis);
|
|
24
|
-
}
|
|
25
|
-
return null;
|
|
26
|
-
}) }, void 0, false, {
|
|
27
|
-
fileName: "/__w/interface/interface/packages/react-client/src/components/RichTextRenderer/renderChildren.tsx",
|
|
28
|
-
lineNumber: 34,
|
|
29
|
-
columnNumber: 3
|
|
30
|
-
}, globalThis);
|
|
31
|
-
};
|
|
32
|
-
exports.renderChildren = renderChildren;
|
|
33
|
-
//# sourceMappingURL=renderChildren.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderChildren.cjs","sources":["../../../../src/components/RichTextRenderer/renderChildren.tsx"],"sourcesContent":["import type { ReactElement } from 'react'\nimport type { BuiltinElements } from './BuiltinElements'\nimport type { BuiltinLeaves } from './BuiltinLeaves'\nimport { ElementRenderer, RenderElement } from './ElementRenderer'\nimport { LeafRenderer, RenderLeaf } from './LeafRenderer'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\n\nexport interface RenderChildrenOptions<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n> {\n\trenderElement?: RenderElement<CustomElements, CustomLeaves>\n\trenderLeaf?: RenderLeaf<CustomLeaves>\n\tattributeNamePrefix?: string\n}\n\nexport const renderChildren = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>(\n\tchildren:\n\t\t| CustomElements\n\t\t| BuiltinElements<CustomElements, CustomLeaves>\n\t\t| CustomLeaves\n\t\t| BuiltinLeaves\n\t\t| Array<CustomElements | BuiltinElements<CustomElements, CustomLeaves> | CustomLeaves | BuiltinLeaves>,\n\toptions: RenderChildrenOptions<CustomElements, CustomLeaves>,\n): ReactElement => {\n\tif (!Array.isArray(children)) {\n\t\tchildren = [children]\n\t}\n\treturn (\n\t\t<>\n\t\t\t{children.map((child, i) => {\n\t\t\t\tif ('text' in child) {\n\t\t\t\t\treturn <LeafRenderer<CustomLeaves> key={i} leaf={child} renderLeaf={options.renderLeaf} />\n\t\t\t\t}\n\t\t\t\tif ('children' in child) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ElementRenderer<CustomElements, CustomLeaves> key={i} element={child} options={options}>\n\t\t\t\t\t\t\t{renderChildren<CustomElements, CustomLeaves>(child.children as typeof children, options)}\n\t\t\t\t\t\t</ElementRenderer>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\treturn null // Throw?\n\t\t\t})}\n\t\t</>\n\t)\n}\n"],"names":["jsxDEV","Fragment","LeafRenderer","this","ElementRenderer"],"mappings":";;;;;AAiBa,MAAA,iBAAiB,CAI7B,UAMA,YACkB;AAClB,MAAI,CAAC,MAAM,QAAQ,QAAQ,GAAG;AAC7B,eAAW,CAAC,QAAQ;AAAA,EACrB;AACA,SAEGA,8BAAA,OAAAC,cAAA,UAAA,EAAA,UAAA,SAAS,IAAI,CAAC,OAAO,MAAM;AAC3B,QAAI,UAAU,OAAO;AACpB,kDAAQC,aAAAA,cAAmC,EAAA,MAAM,OAAO,YAAY,QAAQ,cAApC,GAAjC,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAiF,GAAAC,UAAA;AAAA,IACzF;AACA,QAAI,cAAc,OAAO;AAEvB,aAAAH,8BAAA,OAACI,gBAAsD,iBAAA,EAAA,SAAS,OAAO,SACrE,yBAA6C,MAAM,UAA6B,OAAO,EAAA,GADrC,GAApD,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAEA,GAAAD,UAAA;AAAA,IAEF;AACO,WAAA;AAAA,EAAA,CACP,EAbF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAcA,GAAAA,UAAA;AAEF;;"}
|