@contensis/canvas-react 1.0.2 → 1.0.4
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/canvas-react.d.mts +63 -64
- package/dist/canvas-react.d.ts +63 -64
- package/dist/canvas-react.js +77 -81
- package/dist/canvas-react.js.map +1 -1
- package/dist/canvas-react.mjs +67 -81
- package/dist/canvas-react.mjs.map +1 -1
- package/package.json +3 -5
package/dist/canvas-react.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/renderer.tsx
|
|
2
|
-
import { createContext, useContext } from "react";
|
|
3
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { createContext, useContext } from "react";
|
|
4
3
|
var RendererContext = createContext({});
|
|
5
4
|
function RenderContextProvider(props) {
|
|
6
5
|
const overrideBlocks = props.blocks;
|
|
@@ -17,7 +16,7 @@ function RenderContextProvider(props) {
|
|
|
17
16
|
return prev;
|
|
18
17
|
}, {});
|
|
19
18
|
const value = { blocks, decorators, components: props.components };
|
|
20
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ React.createElement(RendererContext.Provider, { value }, props.children);
|
|
21
20
|
}
|
|
22
21
|
function useBlocks() {
|
|
23
22
|
const value = useContext(RendererContext);
|
|
@@ -34,10 +33,10 @@ function useComponents() {
|
|
|
34
33
|
function RenderBlock(props) {
|
|
35
34
|
const blocks = useBlocks();
|
|
36
35
|
const Component2 = blocks[props.block.type];
|
|
37
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ React.createElement(Component2, { block: props.block });
|
|
38
37
|
}
|
|
39
38
|
function RenderBlocks(props) {
|
|
40
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.blocks.map((block) => /* @__PURE__ */ React.createElement(RenderBlock, { block, key: block.id })));
|
|
41
40
|
}
|
|
42
41
|
function RenderContents(props) {
|
|
43
42
|
return props.contents ? props.contents : props.fallback;
|
|
@@ -47,20 +46,20 @@ function RenderChildren(props) {
|
|
|
47
46
|
const isString = typeof props.block?.value === "string";
|
|
48
47
|
const render = () => {
|
|
49
48
|
if (isArray) {
|
|
50
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ React.createElement(RenderBlocks, { blocks: props.block.value });
|
|
51
50
|
} else if (isString) {
|
|
52
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ React.createElement(RenderText, { text: props.block.value });
|
|
53
52
|
} else {
|
|
54
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ React.createElement(RenderText, { text: "" });
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
56
|
return render();
|
|
58
57
|
}
|
|
59
58
|
function RenderText(props) {
|
|
60
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.text);
|
|
61
60
|
}
|
|
62
61
|
function Renderer(props) {
|
|
63
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ React.createElement(RenderBlocks, { blocks: props.data });
|
|
64
63
|
}
|
|
65
64
|
function getAttributes(props, extra = {}) {
|
|
66
65
|
const { block, ...rest } = props;
|
|
@@ -73,24 +72,21 @@ function getAttributes(props, extra = {}) {
|
|
|
73
72
|
return attributes;
|
|
74
73
|
}
|
|
75
74
|
function WithCaption(props) {
|
|
76
|
-
return !!props.caption ? /* @__PURE__ */
|
|
77
|
-
props.children,
|
|
78
|
-
/* @__PURE__ */ jsx("figcaption", { children: props.caption })
|
|
79
|
-
] }) : props.children || null;
|
|
75
|
+
return !!props.caption ? /* @__PURE__ */ React.createElement("figure", null, props.children, /* @__PURE__ */ React.createElement("figcaption", null, props.caption)) : props.children || null;
|
|
80
76
|
}
|
|
81
77
|
function RenderBlockChildrenFactory() {
|
|
82
78
|
return function(props) {
|
|
83
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ React.createElement(RenderChildren, { block: props.block });
|
|
84
80
|
};
|
|
85
81
|
}
|
|
86
82
|
function EmptyChildrenFactory() {
|
|
87
83
|
return function(props) {
|
|
88
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
89
85
|
};
|
|
90
86
|
}
|
|
91
87
|
function Anchor(props) {
|
|
92
88
|
const attributes = getAttributes(props);
|
|
93
|
-
return /* @__PURE__ */
|
|
89
|
+
return /* @__PURE__ */ React.createElement("a", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Anchor.Children, { block: props.block }) }));
|
|
94
90
|
}
|
|
95
91
|
Anchor.Children = RenderBlockChildrenFactory();
|
|
96
92
|
function Code(props) {
|
|
@@ -100,13 +96,13 @@ function Code(props) {
|
|
|
100
96
|
const codeAttributes = getAttributes(props, {
|
|
101
97
|
className: `language-${props.block?.value?.language}`
|
|
102
98
|
});
|
|
103
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ React.createElement("pre", { ...attributes }, /* @__PURE__ */ React.createElement("code", { ...codeAttributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Code.Children, { block: props.block }) })));
|
|
104
100
|
}
|
|
105
101
|
Code.Children = function(props) {
|
|
106
|
-
return /* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.block?.value?.code);
|
|
107
103
|
};
|
|
108
104
|
function CodeWithCaption(props) {
|
|
109
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ React.createElement(WithCaption, { caption: props.block?.value?.caption }, /* @__PURE__ */ React.createElement(Code, { ...props }));
|
|
110
106
|
}
|
|
111
107
|
function Component(props) {
|
|
112
108
|
const component = props?.block.properties?.component;
|
|
@@ -118,46 +114,43 @@ function Component(props) {
|
|
|
118
114
|
"data-component": props.block.properties?.component,
|
|
119
115
|
"data-component-value": value
|
|
120
116
|
});
|
|
121
|
-
return !!ComponentElement ? /* @__PURE__ */
|
|
117
|
+
return !!ComponentElement ? /* @__PURE__ */ React.createElement(ComponentElement, { ...props }) : /* @__PURE__ */ React.createElement("div", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Component.Children, { block: props.block }) }));
|
|
122
118
|
}
|
|
123
119
|
Component.Children = function(props) {
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
"Component: ",
|
|
126
|
-
props.block?.properties?.component
|
|
127
|
-
] });
|
|
120
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, "Component: ", props.block?.properties?.component);
|
|
128
121
|
};
|
|
129
122
|
function Divider(props) {
|
|
130
123
|
const attributes = getAttributes(props);
|
|
131
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ React.createElement("hr", { ...attributes });
|
|
132
125
|
}
|
|
133
126
|
Divider.Children = EmptyChildrenFactory();
|
|
134
|
-
function
|
|
127
|
+
function Fragment(props) {
|
|
135
128
|
const hasDecorators = !!props.block?.properties?.decorators?.length;
|
|
136
129
|
const decorators = props.block?.properties?.decorators;
|
|
137
|
-
return hasDecorators ? /* @__PURE__ */
|
|
130
|
+
return hasDecorators ? /* @__PURE__ */ React.createElement(Decorators, { block: props.block, decorators }) : /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Fragment.Children, { block: props.block }) });
|
|
138
131
|
}
|
|
139
|
-
|
|
132
|
+
Fragment.Children = RenderBlockChildrenFactory();
|
|
140
133
|
function Heading(props) {
|
|
141
134
|
const attributes = getAttributes(props);
|
|
142
135
|
const render = () => {
|
|
143
136
|
switch (props?.block?.properties?.level) {
|
|
144
137
|
case 2: {
|
|
145
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ React.createElement("h2", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
146
139
|
}
|
|
147
140
|
case 3: {
|
|
148
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ React.createElement("h3", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
149
142
|
}
|
|
150
143
|
case 4: {
|
|
151
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ React.createElement("h4", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
152
145
|
}
|
|
153
146
|
case 5: {
|
|
154
|
-
return /* @__PURE__ */
|
|
147
|
+
return /* @__PURE__ */ React.createElement("h5", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
155
148
|
}
|
|
156
149
|
case 6: {
|
|
157
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ React.createElement("h6", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
158
151
|
}
|
|
159
152
|
default: {
|
|
160
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ React.createElement("h1", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
161
154
|
}
|
|
162
155
|
}
|
|
163
156
|
};
|
|
@@ -171,22 +164,22 @@ function Image(props) {
|
|
|
171
164
|
alt: props.block?.value?.altText,
|
|
172
165
|
title: props?.block?.value?.caption
|
|
173
166
|
});
|
|
174
|
-
return /* @__PURE__ */
|
|
167
|
+
return /* @__PURE__ */ React.createElement("img", { ...attributes });
|
|
175
168
|
}
|
|
176
169
|
Image.Children = EmptyChildrenFactory();
|
|
177
170
|
function ImageWithCaption(props) {
|
|
178
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ React.createElement(WithCaption, { caption: props.block?.value?.caption }, /* @__PURE__ */ React.createElement(Image, { ...props }));
|
|
179
172
|
}
|
|
180
173
|
function InlineEntry(props) {
|
|
181
174
|
const href = props?.block?.value?.sys?.uri;
|
|
182
175
|
const attributes = getAttributes(props, {
|
|
183
176
|
href
|
|
184
177
|
});
|
|
185
|
-
return !!attributes.href ? /* @__PURE__ */
|
|
178
|
+
return !!attributes.href ? /* @__PURE__ */ React.createElement("a", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(InlineEntry.Children, { block: props.block }) })) : /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(InlineEntry.Children, { block: props.block }) });
|
|
186
179
|
}
|
|
187
180
|
InlineEntry.Children = function(props) {
|
|
188
181
|
const entryTitle = props?.block?.value?.entryTitle || "";
|
|
189
|
-
return /* @__PURE__ */
|
|
182
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, entryTitle);
|
|
190
183
|
};
|
|
191
184
|
function Link(props) {
|
|
192
185
|
const linkValue = props?.block?.properties?.link;
|
|
@@ -195,7 +188,7 @@ function Link(props) {
|
|
|
195
188
|
target: props?.block?.properties?.newTab ? "_blank" : null,
|
|
196
189
|
rel: props?.block?.properties?.newTab ? "noopener noreferrer" : null
|
|
197
190
|
});
|
|
198
|
-
return !!attributes.href ? /* @__PURE__ */
|
|
191
|
+
return !!attributes.href ? /* @__PURE__ */ React.createElement("a", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Link.Children, { block: props.block }) })) : /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Link.Children, { block: props.block }) });
|
|
199
192
|
}
|
|
200
193
|
Link.Children = RenderBlockChildrenFactory();
|
|
201
194
|
function List(props) {
|
|
@@ -203,85 +196,78 @@ function List(props) {
|
|
|
203
196
|
const attributes = getAttributes(props, {
|
|
204
197
|
start: isOrdered ? props.block?.properties?.start : null
|
|
205
198
|
});
|
|
206
|
-
return isOrdered ? /* @__PURE__ */
|
|
199
|
+
return isOrdered ? /* @__PURE__ */ React.createElement("ol", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(List.Children, { block: props.block }) })) : /* @__PURE__ */ React.createElement("ul", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(List.Children, { block: props.block }) }));
|
|
207
200
|
}
|
|
208
201
|
List.Children = RenderBlockChildrenFactory();
|
|
209
202
|
function ListItem(props) {
|
|
210
203
|
const attributes = getAttributes(props);
|
|
211
|
-
return /* @__PURE__ */
|
|
204
|
+
return /* @__PURE__ */ React.createElement("li", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(ListItem.Children, { block: props.block }) }));
|
|
212
205
|
}
|
|
213
206
|
ListItem.Children = RenderBlockChildrenFactory();
|
|
214
207
|
function Panel(props) {
|
|
215
208
|
const attributes = getAttributes(props, {
|
|
216
209
|
className: ["panel", props.block?.properties?.panelType || "info"].join(" ")
|
|
217
210
|
});
|
|
218
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ React.createElement("aside", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Panel.Children, { block: props.block }) }));
|
|
219
212
|
}
|
|
220
213
|
Panel.Children = RenderBlockChildrenFactory();
|
|
221
214
|
function Paragraph(props) {
|
|
222
215
|
const attributes = getAttributes(props, {
|
|
223
216
|
className: props.block?.properties?.paragraphType
|
|
224
217
|
});
|
|
225
|
-
return /* @__PURE__ */
|
|
218
|
+
return /* @__PURE__ */ React.createElement("p", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Paragraph.Children, { block: props.block }) }));
|
|
226
219
|
}
|
|
227
220
|
Paragraph.Children = RenderBlockChildrenFactory();
|
|
228
221
|
function Quote(props) {
|
|
229
222
|
const attributes = getAttributes(props, {
|
|
230
223
|
"cite": props.block?.properties?.url
|
|
231
224
|
});
|
|
232
|
-
return /* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ React.createElement("blockquote", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Quote.Children, { block: props.block }) }));
|
|
233
226
|
}
|
|
234
227
|
Quote.Children = function(props) {
|
|
235
228
|
const source = props.block?.properties?.source;
|
|
236
229
|
const citation = props.block?.properties?.citation;
|
|
237
230
|
const hasChildren = !!source || !!citation;
|
|
238
|
-
return hasChildren ? /* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx(RenderChildren, { block: props.block }) }),
|
|
240
|
-
/* @__PURE__ */ jsxs("footer", { children: [
|
|
241
|
-
source,
|
|
242
|
-
" ",
|
|
243
|
-
!!citation ? /* @__PURE__ */ jsx("cite", { children: citation }) : /* @__PURE__ */ jsx(Fragment, {})
|
|
244
|
-
] })
|
|
245
|
-
] }) : /* @__PURE__ */ jsx(RenderChildren, { block: props.block });
|
|
231
|
+
return hasChildren ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement(RenderChildren, { block: props.block })), /* @__PURE__ */ React.createElement("footer", null, source, " ", !!citation ? /* @__PURE__ */ React.createElement("cite", null, citation) : /* @__PURE__ */ React.createElement(React.Fragment, null))) : /* @__PURE__ */ React.createElement(RenderChildren, { block: props.block });
|
|
246
232
|
};
|
|
247
233
|
function Table(props) {
|
|
248
234
|
const attributes = getAttributes(props);
|
|
249
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ React.createElement("table", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Table.Children, { block: props.block }) }));
|
|
250
236
|
}
|
|
251
237
|
Table.Children = RenderBlockChildrenFactory();
|
|
252
238
|
function TableBody(props) {
|
|
253
239
|
const attributes = getAttributes(props);
|
|
254
|
-
return /* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ React.createElement("tbody", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableBody.Children, { block: props.block }) }));
|
|
255
241
|
}
|
|
256
242
|
TableBody.Children = RenderBlockChildrenFactory();
|
|
257
243
|
function TableCaption(props) {
|
|
258
244
|
const attributes = getAttributes(props);
|
|
259
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ React.createElement("caption", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableCaption.Children, { block: props.block }) }));
|
|
260
246
|
}
|
|
261
247
|
TableCaption.Children = RenderBlockChildrenFactory();
|
|
262
248
|
function TableCell(props) {
|
|
263
249
|
const attributes = getAttributes(props);
|
|
264
|
-
return /* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ React.createElement("td", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableCell.Children, { block: props.block }) }));
|
|
265
251
|
}
|
|
266
252
|
TableCell.Children = RenderBlockChildrenFactory();
|
|
267
253
|
function TableFooter(props) {
|
|
268
254
|
const attributes = getAttributes(props);
|
|
269
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ React.createElement("tfoot", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableFooter.Children, { block: props.block }) }));
|
|
270
256
|
}
|
|
271
257
|
TableFooter.Children = RenderBlockChildrenFactory();
|
|
272
258
|
function TableHeader(props) {
|
|
273
259
|
const attributes = getAttributes(props);
|
|
274
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ React.createElement("thead", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableHeader.Children, { block: props.block }) }));
|
|
275
261
|
}
|
|
276
262
|
TableHeader.Children = RenderBlockChildrenFactory();
|
|
277
263
|
function TableHeaderCell(props) {
|
|
278
264
|
const attributes = getAttributes(props);
|
|
279
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ React.createElement("th", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableHeaderCell.Children, { block: props.block }) }));
|
|
280
266
|
}
|
|
281
267
|
TableHeaderCell.Children = RenderBlockChildrenFactory();
|
|
282
268
|
function TableRow(props) {
|
|
283
269
|
const attributes = getAttributes(props);
|
|
284
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ React.createElement("tr", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableRow.Children, { block: props.block }) }));
|
|
285
271
|
}
|
|
286
272
|
TableRow.Children = RenderBlockChildrenFactory();
|
|
287
273
|
function Decorators(props) {
|
|
@@ -291,83 +277,83 @@ function Decorators(props) {
|
|
|
291
277
|
const DecoratorComponent = !!firstDecorator ? decorators[firstDecorator] : void 0;
|
|
292
278
|
const render = () => {
|
|
293
279
|
if (!!DecoratorComponent) {
|
|
294
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ React.createElement(DecoratorComponent, { block: props.block, decorator: firstDecorator, otherDecorators: remainingDecorators });
|
|
295
281
|
} else if (firstDecorator) {
|
|
296
|
-
return /* @__PURE__ */
|
|
282
|
+
return /* @__PURE__ */ React.createElement(Decorators, { block: props.block, decorators: remainingDecorators });
|
|
297
283
|
} else {
|
|
298
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ React.createElement(Fragment.Children, { block: props.block });
|
|
299
285
|
}
|
|
300
286
|
};
|
|
301
287
|
return render();
|
|
302
288
|
}
|
|
303
289
|
function DecoratorChildren(props) {
|
|
304
|
-
return /* @__PURE__ */
|
|
290
|
+
return /* @__PURE__ */ React.createElement(Decorators, { block: props.block, decorators: props.otherDecorators });
|
|
305
291
|
}
|
|
306
292
|
function InlineCode(props) {
|
|
307
293
|
const attributes = getAttributes(props);
|
|
308
|
-
return /* @__PURE__ */
|
|
294
|
+
return /* @__PURE__ */ React.createElement("code", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(InlineCode.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
309
295
|
}
|
|
310
296
|
InlineCode.Children = DecoratorChildren;
|
|
311
297
|
function Delete(props) {
|
|
312
298
|
const attributes = getAttributes(props);
|
|
313
|
-
return /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ React.createElement("del", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Delete.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
314
300
|
}
|
|
315
301
|
Delete.Children = DecoratorChildren;
|
|
316
302
|
function Emphasis(props) {
|
|
317
303
|
const attributes = getAttributes(props);
|
|
318
|
-
return /* @__PURE__ */
|
|
304
|
+
return /* @__PURE__ */ React.createElement("em", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Emphasis.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
319
305
|
}
|
|
320
306
|
Emphasis.Children = DecoratorChildren;
|
|
321
307
|
function Insert(props) {
|
|
322
308
|
const attributes = getAttributes(props);
|
|
323
|
-
return /* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ React.createElement("ins", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Insert.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
324
310
|
}
|
|
325
311
|
Insert.Children = DecoratorChildren;
|
|
326
312
|
function Keyboard(props) {
|
|
327
313
|
const attributes = getAttributes(props);
|
|
328
|
-
return /* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ React.createElement("kbd", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Keyboard.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
329
315
|
}
|
|
330
316
|
Keyboard.Children = DecoratorChildren;
|
|
331
317
|
function LineBreak(props) {
|
|
332
318
|
const attributes = getAttributes(props);
|
|
333
|
-
return /* @__PURE__ */
|
|
319
|
+
return /* @__PURE__ */ React.createElement("br", { ...attributes });
|
|
334
320
|
}
|
|
335
321
|
LineBreak.Children = function(props) {
|
|
336
|
-
return /* @__PURE__ */
|
|
322
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
337
323
|
};
|
|
338
324
|
function Mark(props) {
|
|
339
325
|
const attributes = getAttributes(props);
|
|
340
|
-
return /* @__PURE__ */
|
|
326
|
+
return /* @__PURE__ */ React.createElement("mark", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Mark.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
341
327
|
}
|
|
342
328
|
Mark.Children = DecoratorChildren;
|
|
343
329
|
function Strong(props) {
|
|
344
330
|
const attributes = getAttributes(props);
|
|
345
|
-
return /* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ React.createElement("strong", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Strong.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
346
332
|
}
|
|
347
333
|
Strong.Children = DecoratorChildren;
|
|
348
334
|
function Strikethrough(props) {
|
|
349
335
|
const attributes = getAttributes(props);
|
|
350
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ React.createElement("s", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Strikethrough.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
351
337
|
}
|
|
352
338
|
Strikethrough.Children = DecoratorChildren;
|
|
353
339
|
function Subscript(props) {
|
|
354
340
|
const attributes = getAttributes(props);
|
|
355
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ React.createElement("sub", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Subscript.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
356
342
|
}
|
|
357
343
|
Subscript.Children = DecoratorChildren;
|
|
358
344
|
function Superscript(props) {
|
|
359
345
|
const attributes = getAttributes(props);
|
|
360
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ React.createElement("sup", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Superscript.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
361
347
|
}
|
|
362
348
|
Superscript.Children = DecoratorChildren;
|
|
363
349
|
function Underline(props) {
|
|
364
350
|
const attributes = getAttributes(props);
|
|
365
|
-
return /* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ React.createElement("u", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Underline.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
366
352
|
}
|
|
367
353
|
Underline.Children = DecoratorChildren;
|
|
368
354
|
function Variable(props) {
|
|
369
355
|
const attributes = getAttributes(props);
|
|
370
|
-
return /* @__PURE__ */
|
|
356
|
+
return /* @__PURE__ */ React.createElement("var", { ...attributes }, /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Variable.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
371
357
|
}
|
|
372
358
|
Variable.Children = DecoratorChildren;
|
|
373
359
|
var BLOCK_RENDERERS = {
|
|
@@ -375,7 +361,7 @@ var BLOCK_RENDERERS = {
|
|
|
375
361
|
"_code": CodeWithCaption,
|
|
376
362
|
"_component": Component,
|
|
377
363
|
"_divider": Divider,
|
|
378
|
-
"_fragment":
|
|
364
|
+
"_fragment": Fragment,
|
|
379
365
|
"_heading": Heading,
|
|
380
366
|
"_image": ImageWithCaption,
|
|
381
367
|
"_inlineEntry": InlineEntry,
|
|
@@ -416,7 +402,7 @@ export {
|
|
|
416
402
|
Delete,
|
|
417
403
|
Divider,
|
|
418
404
|
Emphasis,
|
|
419
|
-
|
|
405
|
+
Fragment,
|
|
420
406
|
Heading,
|
|
421
407
|
Image,
|
|
422
408
|
InlineCode,
|