@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.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
@@ -26,7 +36,7 @@ __export(src_exports, {
|
|
|
26
36
|
Delete: () => Delete,
|
|
27
37
|
Divider: () => Divider,
|
|
28
38
|
Emphasis: () => Emphasis,
|
|
29
|
-
Fragment: () =>
|
|
39
|
+
Fragment: () => Fragment,
|
|
30
40
|
Heading: () => Heading,
|
|
31
41
|
Image: () => Image,
|
|
32
42
|
InlineCode: () => InlineCode,
|
|
@@ -62,8 +72,7 @@ __export(src_exports, {
|
|
|
62
72
|
module.exports = __toCommonJS(src_exports);
|
|
63
73
|
|
|
64
74
|
// src/renderer.tsx
|
|
65
|
-
var import_react = require("react");
|
|
66
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
75
|
+
var import_react = __toESM(require("react"));
|
|
67
76
|
var RendererContext = (0, import_react.createContext)({});
|
|
68
77
|
function RenderContextProvider(props) {
|
|
69
78
|
const overrideBlocks = props.blocks;
|
|
@@ -80,7 +89,7 @@ function RenderContextProvider(props) {
|
|
|
80
89
|
return prev;
|
|
81
90
|
}, {});
|
|
82
91
|
const value = { blocks, decorators, components: props.components };
|
|
83
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ import_react.default.createElement(RendererContext.Provider, { value }, props.children);
|
|
84
93
|
}
|
|
85
94
|
function useBlocks() {
|
|
86
95
|
const value = (0, import_react.useContext)(RendererContext);
|
|
@@ -97,10 +106,10 @@ function useComponents() {
|
|
|
97
106
|
function RenderBlock(props) {
|
|
98
107
|
const blocks = useBlocks();
|
|
99
108
|
const Component2 = blocks[props.block.type];
|
|
100
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ import_react.default.createElement(Component2, { block: props.block });
|
|
101
110
|
}
|
|
102
111
|
function RenderBlocks(props) {
|
|
103
|
-
return /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.blocks.map((block) => /* @__PURE__ */ import_react.default.createElement(RenderBlock, { block, key: block.id })));
|
|
104
113
|
}
|
|
105
114
|
function RenderContents(props) {
|
|
106
115
|
return props.contents ? props.contents : props.fallback;
|
|
@@ -110,20 +119,20 @@ function RenderChildren(props) {
|
|
|
110
119
|
const isString = typeof props.block?.value === "string";
|
|
111
120
|
const render = () => {
|
|
112
121
|
if (isArray) {
|
|
113
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderBlocks, { blocks: props.block.value });
|
|
114
123
|
} else if (isString) {
|
|
115
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderText, { text: props.block.value });
|
|
116
125
|
} else {
|
|
117
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderText, { text: "" });
|
|
118
127
|
}
|
|
119
128
|
};
|
|
120
129
|
return render();
|
|
121
130
|
}
|
|
122
131
|
function RenderText(props) {
|
|
123
|
-
return /* @__PURE__ */
|
|
132
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.text);
|
|
124
133
|
}
|
|
125
134
|
function Renderer(props) {
|
|
126
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderBlocks, { blocks: props.data });
|
|
127
136
|
}
|
|
128
137
|
function getAttributes(props, extra = {}) {
|
|
129
138
|
const { block, ...rest } = props;
|
|
@@ -136,24 +145,21 @@ function getAttributes(props, extra = {}) {
|
|
|
136
145
|
return attributes;
|
|
137
146
|
}
|
|
138
147
|
function WithCaption(props) {
|
|
139
|
-
return !!props.caption ? /* @__PURE__ */ (
|
|
140
|
-
props.children,
|
|
141
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("figcaption", { children: props.caption })
|
|
142
|
-
] }) : props.children || null;
|
|
148
|
+
return !!props.caption ? /* @__PURE__ */ import_react.default.createElement("figure", null, props.children, /* @__PURE__ */ import_react.default.createElement("figcaption", null, props.caption)) : props.children || null;
|
|
143
149
|
}
|
|
144
150
|
function RenderBlockChildrenFactory() {
|
|
145
151
|
return function(props) {
|
|
146
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderChildren, { block: props.block });
|
|
147
153
|
};
|
|
148
154
|
}
|
|
149
155
|
function EmptyChildrenFactory() {
|
|
150
156
|
return function(props) {
|
|
151
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
152
158
|
};
|
|
153
159
|
}
|
|
154
160
|
function Anchor(props) {
|
|
155
161
|
const attributes = getAttributes(props);
|
|
156
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ import_react.default.createElement("a", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Anchor.Children, { block: props.block }) }));
|
|
157
163
|
}
|
|
158
164
|
Anchor.Children = RenderBlockChildrenFactory();
|
|
159
165
|
function Code(props) {
|
|
@@ -163,13 +169,13 @@ function Code(props) {
|
|
|
163
169
|
const codeAttributes = getAttributes(props, {
|
|
164
170
|
className: `language-${props.block?.value?.language}`
|
|
165
171
|
});
|
|
166
|
-
return /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ import_react.default.createElement("pre", { ...attributes }, /* @__PURE__ */ import_react.default.createElement("code", { ...codeAttributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Code.Children, { block: props.block }) })));
|
|
167
173
|
}
|
|
168
174
|
Code.Children = function(props) {
|
|
169
|
-
return /* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.block?.value?.code);
|
|
170
176
|
};
|
|
171
177
|
function CodeWithCaption(props) {
|
|
172
|
-
return /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ import_react.default.createElement(WithCaption, { caption: props.block?.value?.caption }, /* @__PURE__ */ import_react.default.createElement(Code, { ...props }));
|
|
173
179
|
}
|
|
174
180
|
function Component(props) {
|
|
175
181
|
const component = props?.block.properties?.component;
|
|
@@ -181,46 +187,43 @@ function Component(props) {
|
|
|
181
187
|
"data-component": props.block.properties?.component,
|
|
182
188
|
"data-component-value": value
|
|
183
189
|
});
|
|
184
|
-
return !!ComponentElement ? /* @__PURE__ */
|
|
190
|
+
return !!ComponentElement ? /* @__PURE__ */ import_react.default.createElement(ComponentElement, { ...props }) : /* @__PURE__ */ import_react.default.createElement("div", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Component.Children, { block: props.block }) }));
|
|
185
191
|
}
|
|
186
192
|
Component.Children = function(props) {
|
|
187
|
-
return /* @__PURE__ */
|
|
188
|
-
"Component: ",
|
|
189
|
-
props.block?.properties?.component
|
|
190
|
-
] });
|
|
193
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, "Component: ", props.block?.properties?.component);
|
|
191
194
|
};
|
|
192
195
|
function Divider(props) {
|
|
193
196
|
const attributes = getAttributes(props);
|
|
194
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ import_react.default.createElement("hr", { ...attributes });
|
|
195
198
|
}
|
|
196
199
|
Divider.Children = EmptyChildrenFactory();
|
|
197
|
-
function
|
|
200
|
+
function Fragment(props) {
|
|
198
201
|
const hasDecorators = !!props.block?.properties?.decorators?.length;
|
|
199
202
|
const decorators = props.block?.properties?.decorators;
|
|
200
|
-
return hasDecorators ? /* @__PURE__ */
|
|
203
|
+
return hasDecorators ? /* @__PURE__ */ import_react.default.createElement(Decorators, { block: props.block, decorators }) : /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Fragment.Children, { block: props.block }) });
|
|
201
204
|
}
|
|
202
|
-
|
|
205
|
+
Fragment.Children = RenderBlockChildrenFactory();
|
|
203
206
|
function Heading(props) {
|
|
204
207
|
const attributes = getAttributes(props);
|
|
205
208
|
const render = () => {
|
|
206
209
|
switch (props?.block?.properties?.level) {
|
|
207
210
|
case 2: {
|
|
208
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ import_react.default.createElement("h2", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
|
|
209
212
|
}
|
|
210
213
|
case 3: {
|
|
211
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ import_react.default.createElement("h3", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
|
|
212
215
|
}
|
|
213
216
|
case 4: {
|
|
214
|
-
return /* @__PURE__ */
|
|
217
|
+
return /* @__PURE__ */ import_react.default.createElement("h4", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
|
|
215
218
|
}
|
|
216
219
|
case 5: {
|
|
217
|
-
return /* @__PURE__ */
|
|
220
|
+
return /* @__PURE__ */ import_react.default.createElement("h5", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
|
|
218
221
|
}
|
|
219
222
|
case 6: {
|
|
220
|
-
return /* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ import_react.default.createElement("h6", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
|
|
221
224
|
}
|
|
222
225
|
default: {
|
|
223
|
-
return /* @__PURE__ */
|
|
226
|
+
return /* @__PURE__ */ import_react.default.createElement("h1", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
|
|
224
227
|
}
|
|
225
228
|
}
|
|
226
229
|
};
|
|
@@ -234,22 +237,22 @@ function Image(props) {
|
|
|
234
237
|
alt: props.block?.value?.altText,
|
|
235
238
|
title: props?.block?.value?.caption
|
|
236
239
|
});
|
|
237
|
-
return /* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ import_react.default.createElement("img", { ...attributes });
|
|
238
241
|
}
|
|
239
242
|
Image.Children = EmptyChildrenFactory();
|
|
240
243
|
function ImageWithCaption(props) {
|
|
241
|
-
return /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ import_react.default.createElement(WithCaption, { caption: props.block?.value?.caption }, /* @__PURE__ */ import_react.default.createElement(Image, { ...props }));
|
|
242
245
|
}
|
|
243
246
|
function InlineEntry(props) {
|
|
244
247
|
const href = props?.block?.value?.sys?.uri;
|
|
245
248
|
const attributes = getAttributes(props, {
|
|
246
249
|
href
|
|
247
250
|
});
|
|
248
|
-
return !!attributes.href ? /* @__PURE__ */
|
|
251
|
+
return !!attributes.href ? /* @__PURE__ */ import_react.default.createElement("a", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(InlineEntry.Children, { block: props.block }) })) : /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(InlineEntry.Children, { block: props.block }) });
|
|
249
252
|
}
|
|
250
253
|
InlineEntry.Children = function(props) {
|
|
251
254
|
const entryTitle = props?.block?.value?.entryTitle || "";
|
|
252
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, entryTitle);
|
|
253
256
|
};
|
|
254
257
|
function Link(props) {
|
|
255
258
|
const linkValue = props?.block?.properties?.link;
|
|
@@ -258,7 +261,7 @@ function Link(props) {
|
|
|
258
261
|
target: props?.block?.properties?.newTab ? "_blank" : null,
|
|
259
262
|
rel: props?.block?.properties?.newTab ? "noopener noreferrer" : null
|
|
260
263
|
});
|
|
261
|
-
return !!attributes.href ? /* @__PURE__ */
|
|
264
|
+
return !!attributes.href ? /* @__PURE__ */ import_react.default.createElement("a", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Link.Children, { block: props.block }) })) : /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Link.Children, { block: props.block }) });
|
|
262
265
|
}
|
|
263
266
|
Link.Children = RenderBlockChildrenFactory();
|
|
264
267
|
function List(props) {
|
|
@@ -266,85 +269,78 @@ function List(props) {
|
|
|
266
269
|
const attributes = getAttributes(props, {
|
|
267
270
|
start: isOrdered ? props.block?.properties?.start : null
|
|
268
271
|
});
|
|
269
|
-
return isOrdered ? /* @__PURE__ */
|
|
272
|
+
return isOrdered ? /* @__PURE__ */ import_react.default.createElement("ol", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(List.Children, { block: props.block }) })) : /* @__PURE__ */ import_react.default.createElement("ul", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(List.Children, { block: props.block }) }));
|
|
270
273
|
}
|
|
271
274
|
List.Children = RenderBlockChildrenFactory();
|
|
272
275
|
function ListItem(props) {
|
|
273
276
|
const attributes = getAttributes(props);
|
|
274
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ import_react.default.createElement("li", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(ListItem.Children, { block: props.block }) }));
|
|
275
278
|
}
|
|
276
279
|
ListItem.Children = RenderBlockChildrenFactory();
|
|
277
280
|
function Panel(props) {
|
|
278
281
|
const attributes = getAttributes(props, {
|
|
279
282
|
className: ["panel", props.block?.properties?.panelType || "info"].join(" ")
|
|
280
283
|
});
|
|
281
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ import_react.default.createElement("aside", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Panel.Children, { block: props.block }) }));
|
|
282
285
|
}
|
|
283
286
|
Panel.Children = RenderBlockChildrenFactory();
|
|
284
287
|
function Paragraph(props) {
|
|
285
288
|
const attributes = getAttributes(props, {
|
|
286
289
|
className: props.block?.properties?.paragraphType
|
|
287
290
|
});
|
|
288
|
-
return /* @__PURE__ */
|
|
291
|
+
return /* @__PURE__ */ import_react.default.createElement("p", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Paragraph.Children, { block: props.block }) }));
|
|
289
292
|
}
|
|
290
293
|
Paragraph.Children = RenderBlockChildrenFactory();
|
|
291
294
|
function Quote(props) {
|
|
292
295
|
const attributes = getAttributes(props, {
|
|
293
296
|
"cite": props.block?.properties?.url
|
|
294
297
|
});
|
|
295
|
-
return /* @__PURE__ */
|
|
298
|
+
return /* @__PURE__ */ import_react.default.createElement("blockquote", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Quote.Children, { block: props.block }) }));
|
|
296
299
|
}
|
|
297
300
|
Quote.Children = function(props) {
|
|
298
301
|
const source = props.block?.properties?.source;
|
|
299
302
|
const citation = props.block?.properties?.citation;
|
|
300
303
|
const hasChildren = !!source || !!citation;
|
|
301
|
-
return hasChildren ? /* @__PURE__ */ (
|
|
302
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RenderChildren, { block: props.block }) }),
|
|
303
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("footer", { children: [
|
|
304
|
-
source,
|
|
305
|
-
" ",
|
|
306
|
-
!!citation ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("cite", { children: citation }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {})
|
|
307
|
-
] })
|
|
308
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RenderChildren, { block: props.block });
|
|
304
|
+
return hasChildren ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("p", null, /* @__PURE__ */ import_react.default.createElement(RenderChildren, { block: props.block })), /* @__PURE__ */ import_react.default.createElement("footer", null, source, " ", !!citation ? /* @__PURE__ */ import_react.default.createElement("cite", null, citation) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null))) : /* @__PURE__ */ import_react.default.createElement(RenderChildren, { block: props.block });
|
|
309
305
|
};
|
|
310
306
|
function Table(props) {
|
|
311
307
|
const attributes = getAttributes(props);
|
|
312
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ import_react.default.createElement("table", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Table.Children, { block: props.block }) }));
|
|
313
309
|
}
|
|
314
310
|
Table.Children = RenderBlockChildrenFactory();
|
|
315
311
|
function TableBody(props) {
|
|
316
312
|
const attributes = getAttributes(props);
|
|
317
|
-
return /* @__PURE__ */
|
|
313
|
+
return /* @__PURE__ */ import_react.default.createElement("tbody", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableBody.Children, { block: props.block }) }));
|
|
318
314
|
}
|
|
319
315
|
TableBody.Children = RenderBlockChildrenFactory();
|
|
320
316
|
function TableCaption(props) {
|
|
321
317
|
const attributes = getAttributes(props);
|
|
322
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ import_react.default.createElement("caption", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableCaption.Children, { block: props.block }) }));
|
|
323
319
|
}
|
|
324
320
|
TableCaption.Children = RenderBlockChildrenFactory();
|
|
325
321
|
function TableCell(props) {
|
|
326
322
|
const attributes = getAttributes(props);
|
|
327
|
-
return /* @__PURE__ */
|
|
323
|
+
return /* @__PURE__ */ import_react.default.createElement("td", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableCell.Children, { block: props.block }) }));
|
|
328
324
|
}
|
|
329
325
|
TableCell.Children = RenderBlockChildrenFactory();
|
|
330
326
|
function TableFooter(props) {
|
|
331
327
|
const attributes = getAttributes(props);
|
|
332
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ import_react.default.createElement("tfoot", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableFooter.Children, { block: props.block }) }));
|
|
333
329
|
}
|
|
334
330
|
TableFooter.Children = RenderBlockChildrenFactory();
|
|
335
331
|
function TableHeader(props) {
|
|
336
332
|
const attributes = getAttributes(props);
|
|
337
|
-
return /* @__PURE__ */
|
|
333
|
+
return /* @__PURE__ */ import_react.default.createElement("thead", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableHeader.Children, { block: props.block }) }));
|
|
338
334
|
}
|
|
339
335
|
TableHeader.Children = RenderBlockChildrenFactory();
|
|
340
336
|
function TableHeaderCell(props) {
|
|
341
337
|
const attributes = getAttributes(props);
|
|
342
|
-
return /* @__PURE__ */
|
|
338
|
+
return /* @__PURE__ */ import_react.default.createElement("th", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableHeaderCell.Children, { block: props.block }) }));
|
|
343
339
|
}
|
|
344
340
|
TableHeaderCell.Children = RenderBlockChildrenFactory();
|
|
345
341
|
function TableRow(props) {
|
|
346
342
|
const attributes = getAttributes(props);
|
|
347
|
-
return /* @__PURE__ */
|
|
343
|
+
return /* @__PURE__ */ import_react.default.createElement("tr", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableRow.Children, { block: props.block }) }));
|
|
348
344
|
}
|
|
349
345
|
TableRow.Children = RenderBlockChildrenFactory();
|
|
350
346
|
function Decorators(props) {
|
|
@@ -354,83 +350,83 @@ function Decorators(props) {
|
|
|
354
350
|
const DecoratorComponent = !!firstDecorator ? decorators[firstDecorator] : void 0;
|
|
355
351
|
const render = () => {
|
|
356
352
|
if (!!DecoratorComponent) {
|
|
357
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ import_react.default.createElement(DecoratorComponent, { block: props.block, decorator: firstDecorator, otherDecorators: remainingDecorators });
|
|
358
354
|
} else if (firstDecorator) {
|
|
359
|
-
return /* @__PURE__ */
|
|
355
|
+
return /* @__PURE__ */ import_react.default.createElement(Decorators, { block: props.block, decorators: remainingDecorators });
|
|
360
356
|
} else {
|
|
361
|
-
return /* @__PURE__ */
|
|
357
|
+
return /* @__PURE__ */ import_react.default.createElement(Fragment.Children, { block: props.block });
|
|
362
358
|
}
|
|
363
359
|
};
|
|
364
360
|
return render();
|
|
365
361
|
}
|
|
366
362
|
function DecoratorChildren(props) {
|
|
367
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ import_react.default.createElement(Decorators, { block: props.block, decorators: props.otherDecorators });
|
|
368
364
|
}
|
|
369
365
|
function InlineCode(props) {
|
|
370
366
|
const attributes = getAttributes(props);
|
|
371
|
-
return /* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ import_react.default.createElement("code", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(InlineCode.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
372
368
|
}
|
|
373
369
|
InlineCode.Children = DecoratorChildren;
|
|
374
370
|
function Delete(props) {
|
|
375
371
|
const attributes = getAttributes(props);
|
|
376
|
-
return /* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ import_react.default.createElement("del", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Delete.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
377
373
|
}
|
|
378
374
|
Delete.Children = DecoratorChildren;
|
|
379
375
|
function Emphasis(props) {
|
|
380
376
|
const attributes = getAttributes(props);
|
|
381
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ import_react.default.createElement("em", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Emphasis.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
382
378
|
}
|
|
383
379
|
Emphasis.Children = DecoratorChildren;
|
|
384
380
|
function Insert(props) {
|
|
385
381
|
const attributes = getAttributes(props);
|
|
386
|
-
return /* @__PURE__ */
|
|
382
|
+
return /* @__PURE__ */ import_react.default.createElement("ins", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Insert.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
387
383
|
}
|
|
388
384
|
Insert.Children = DecoratorChildren;
|
|
389
385
|
function Keyboard(props) {
|
|
390
386
|
const attributes = getAttributes(props);
|
|
391
|
-
return /* @__PURE__ */
|
|
387
|
+
return /* @__PURE__ */ import_react.default.createElement("kbd", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Keyboard.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
392
388
|
}
|
|
393
389
|
Keyboard.Children = DecoratorChildren;
|
|
394
390
|
function LineBreak(props) {
|
|
395
391
|
const attributes = getAttributes(props);
|
|
396
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ import_react.default.createElement("br", { ...attributes });
|
|
397
393
|
}
|
|
398
394
|
LineBreak.Children = function(props) {
|
|
399
|
-
return /* @__PURE__ */
|
|
395
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
400
396
|
};
|
|
401
397
|
function Mark(props) {
|
|
402
398
|
const attributes = getAttributes(props);
|
|
403
|
-
return /* @__PURE__ */
|
|
399
|
+
return /* @__PURE__ */ import_react.default.createElement("mark", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Mark.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
404
400
|
}
|
|
405
401
|
Mark.Children = DecoratorChildren;
|
|
406
402
|
function Strong(props) {
|
|
407
403
|
const attributes = getAttributes(props);
|
|
408
|
-
return /* @__PURE__ */
|
|
404
|
+
return /* @__PURE__ */ import_react.default.createElement("strong", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Strong.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
409
405
|
}
|
|
410
406
|
Strong.Children = DecoratorChildren;
|
|
411
407
|
function Strikethrough(props) {
|
|
412
408
|
const attributes = getAttributes(props);
|
|
413
|
-
return /* @__PURE__ */
|
|
409
|
+
return /* @__PURE__ */ import_react.default.createElement("s", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Strikethrough.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
414
410
|
}
|
|
415
411
|
Strikethrough.Children = DecoratorChildren;
|
|
416
412
|
function Subscript(props) {
|
|
417
413
|
const attributes = getAttributes(props);
|
|
418
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ import_react.default.createElement("sub", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Subscript.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
419
415
|
}
|
|
420
416
|
Subscript.Children = DecoratorChildren;
|
|
421
417
|
function Superscript(props) {
|
|
422
418
|
const attributes = getAttributes(props);
|
|
423
|
-
return /* @__PURE__ */
|
|
419
|
+
return /* @__PURE__ */ import_react.default.createElement("sup", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Superscript.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
424
420
|
}
|
|
425
421
|
Superscript.Children = DecoratorChildren;
|
|
426
422
|
function Underline(props) {
|
|
427
423
|
const attributes = getAttributes(props);
|
|
428
|
-
return /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ import_react.default.createElement("u", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Underline.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
429
425
|
}
|
|
430
426
|
Underline.Children = DecoratorChildren;
|
|
431
427
|
function Variable(props) {
|
|
432
428
|
const attributes = getAttributes(props);
|
|
433
|
-
return /* @__PURE__ */
|
|
429
|
+
return /* @__PURE__ */ import_react.default.createElement("var", { ...attributes }, /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Variable.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
434
430
|
}
|
|
435
431
|
Variable.Children = DecoratorChildren;
|
|
436
432
|
var BLOCK_RENDERERS = {
|
|
@@ -438,7 +434,7 @@ var BLOCK_RENDERERS = {
|
|
|
438
434
|
"_code": CodeWithCaption,
|
|
439
435
|
"_component": Component,
|
|
440
436
|
"_divider": Divider,
|
|
441
|
-
"_fragment":
|
|
437
|
+
"_fragment": Fragment,
|
|
442
438
|
"_heading": Heading,
|
|
443
439
|
"_image": ImageWithCaption,
|
|
444
440
|
"_inlineEntry": InlineEntry,
|