@contensis/canvas-react 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/canvas-react.d.mts +36 -10
- package/dist/canvas-react.d.ts +36 -10
- package/dist/canvas-react.js +81 -82
- package/dist/canvas-react.js.map +1 -1
- package/dist/canvas-react.mjs +70 -82
- package/dist/canvas-react.mjs.map +1 -1
- package/package.json +2 -1
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,
|
|
@@ -40,6 +50,7 @@ __export(src_exports, {
|
|
|
40
50
|
Mark: () => Mark,
|
|
41
51
|
Panel: () => Panel,
|
|
42
52
|
Paragraph: () => Paragraph,
|
|
53
|
+
Quote: () => Quote,
|
|
43
54
|
RenderContextProvider: () => RenderContextProvider,
|
|
44
55
|
Renderer: () => Renderer,
|
|
45
56
|
RendererContext: () => RendererContext,
|
|
@@ -61,14 +72,14 @@ __export(src_exports, {
|
|
|
61
72
|
module.exports = __toCommonJS(src_exports);
|
|
62
73
|
|
|
63
74
|
// src/renderer.tsx
|
|
64
|
-
var import_react = require("react");
|
|
65
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
75
|
+
var import_react = __toESM(require("react"));
|
|
66
76
|
var RendererContext = (0, import_react.createContext)({});
|
|
67
77
|
function RenderContextProvider(props) {
|
|
68
78
|
const overrideBlocks = props.blocks;
|
|
69
79
|
const blocks = Object.keys(BLOCK_RENDERERS).reduce((prev, type) => {
|
|
70
80
|
const blockType = type;
|
|
71
|
-
|
|
81
|
+
const renderer = overrideBlocks?.[blockType] || BLOCK_RENDERERS[blockType];
|
|
82
|
+
prev[blockType] = renderer;
|
|
72
83
|
return prev;
|
|
73
84
|
}, {});
|
|
74
85
|
const overrideDecorators = props.decorators;
|
|
@@ -78,7 +89,7 @@ function RenderContextProvider(props) {
|
|
|
78
89
|
return prev;
|
|
79
90
|
}, {});
|
|
80
91
|
const value = { blocks, decorators, components: props.components };
|
|
81
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ import_react.default.createElement(RendererContext.Provider, { value }, props.children);
|
|
82
93
|
}
|
|
83
94
|
function useBlocks() {
|
|
84
95
|
const value = (0, import_react.useContext)(RendererContext);
|
|
@@ -95,10 +106,10 @@ function useComponents() {
|
|
|
95
106
|
function RenderBlock(props) {
|
|
96
107
|
const blocks = useBlocks();
|
|
97
108
|
const Component2 = blocks[props.block.type];
|
|
98
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ import_react.default.createElement(Component2, { block: props.block });
|
|
99
110
|
}
|
|
100
111
|
function RenderBlocks(props) {
|
|
101
|
-
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 })));
|
|
102
113
|
}
|
|
103
114
|
function RenderContents(props) {
|
|
104
115
|
return props.contents ? props.contents : props.fallback;
|
|
@@ -108,20 +119,20 @@ function RenderChildren(props) {
|
|
|
108
119
|
const isString = typeof props.block?.value === "string";
|
|
109
120
|
const render = () => {
|
|
110
121
|
if (isArray) {
|
|
111
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderBlocks, { blocks: props.block.value });
|
|
112
123
|
} else if (isString) {
|
|
113
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderText, { text: props.block.value });
|
|
114
125
|
} else {
|
|
115
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderText, { text: "" });
|
|
116
127
|
}
|
|
117
128
|
};
|
|
118
129
|
return render();
|
|
119
130
|
}
|
|
120
131
|
function RenderText(props) {
|
|
121
|
-
return /* @__PURE__ */
|
|
132
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.text);
|
|
122
133
|
}
|
|
123
134
|
function Renderer(props) {
|
|
124
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderBlocks, { blocks: props.data });
|
|
125
136
|
}
|
|
126
137
|
function getAttributes(props, extra = {}) {
|
|
127
138
|
const { block, ...rest } = props;
|
|
@@ -134,24 +145,21 @@ function getAttributes(props, extra = {}) {
|
|
|
134
145
|
return attributes;
|
|
135
146
|
}
|
|
136
147
|
function WithCaption(props) {
|
|
137
|
-
return !!props.caption ? /* @__PURE__ */ (
|
|
138
|
-
props.children,
|
|
139
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("figcaption", { children: props.caption })
|
|
140
|
-
] }) : props.children;
|
|
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;
|
|
141
149
|
}
|
|
142
150
|
function RenderBlockChildrenFactory() {
|
|
143
151
|
return function(props) {
|
|
144
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderChildren, { block: props.block });
|
|
145
153
|
};
|
|
146
154
|
}
|
|
147
155
|
function EmptyChildrenFactory() {
|
|
148
156
|
return function(props) {
|
|
149
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
150
158
|
};
|
|
151
159
|
}
|
|
152
160
|
function Anchor(props) {
|
|
153
161
|
const attributes = getAttributes(props);
|
|
154
|
-
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 }) }));
|
|
155
163
|
}
|
|
156
164
|
Anchor.Children = RenderBlockChildrenFactory();
|
|
157
165
|
function Code(props) {
|
|
@@ -161,13 +169,13 @@ function Code(props) {
|
|
|
161
169
|
const codeAttributes = getAttributes(props, {
|
|
162
170
|
className: `language-${props.block?.value?.language}`
|
|
163
171
|
});
|
|
164
|
-
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 }) })));
|
|
165
173
|
}
|
|
166
174
|
Code.Children = function(props) {
|
|
167
|
-
return /* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.block?.value?.code);
|
|
168
176
|
};
|
|
169
177
|
function CodeWithCaption(props) {
|
|
170
|
-
return /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ import_react.default.createElement(WithCaption, { caption: props.block?.value?.caption }, /* @__PURE__ */ import_react.default.createElement(Code, { ...props }));
|
|
171
179
|
}
|
|
172
180
|
function Component(props) {
|
|
173
181
|
const component = props?.block.properties?.component;
|
|
@@ -179,46 +187,43 @@ function Component(props) {
|
|
|
179
187
|
"data-component": props.block.properties?.component,
|
|
180
188
|
"data-component-value": value
|
|
181
189
|
});
|
|
182
|
-
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 }) }));
|
|
183
191
|
}
|
|
184
192
|
Component.Children = function(props) {
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
"Component: ",
|
|
187
|
-
props.block?.properties?.component
|
|
188
|
-
] });
|
|
193
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, "Component: ", props.block?.properties?.component);
|
|
189
194
|
};
|
|
190
195
|
function Divider(props) {
|
|
191
196
|
const attributes = getAttributes(props);
|
|
192
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ import_react.default.createElement("hr", { ...attributes });
|
|
193
198
|
}
|
|
194
199
|
Divider.Children = EmptyChildrenFactory();
|
|
195
|
-
function
|
|
200
|
+
function Fragment(props) {
|
|
196
201
|
const hasDecorators = !!props.block?.properties?.decorators?.length;
|
|
197
202
|
const decorators = props.block?.properties?.decorators;
|
|
198
|
-
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 }) });
|
|
199
204
|
}
|
|
200
|
-
|
|
205
|
+
Fragment.Children = RenderBlockChildrenFactory();
|
|
201
206
|
function Heading(props) {
|
|
202
207
|
const attributes = getAttributes(props);
|
|
203
208
|
const render = () => {
|
|
204
209
|
switch (props?.block?.properties?.level) {
|
|
205
210
|
case 2: {
|
|
206
|
-
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 }) }));
|
|
207
212
|
}
|
|
208
213
|
case 3: {
|
|
209
|
-
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 }) }));
|
|
210
215
|
}
|
|
211
216
|
case 4: {
|
|
212
|
-
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 }) }));
|
|
213
218
|
}
|
|
214
219
|
case 5: {
|
|
215
|
-
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 }) }));
|
|
216
221
|
}
|
|
217
222
|
case 6: {
|
|
218
|
-
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 }) }));
|
|
219
224
|
}
|
|
220
225
|
default: {
|
|
221
|
-
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 }) }));
|
|
222
227
|
}
|
|
223
228
|
}
|
|
224
229
|
};
|
|
@@ -232,22 +237,22 @@ function Image(props) {
|
|
|
232
237
|
alt: props.block?.value?.altText,
|
|
233
238
|
title: props?.block?.value?.caption
|
|
234
239
|
});
|
|
235
|
-
return /* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ import_react.default.createElement("img", { ...attributes });
|
|
236
241
|
}
|
|
237
242
|
Image.Children = EmptyChildrenFactory();
|
|
238
243
|
function ImageWithCaption(props) {
|
|
239
|
-
return /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ import_react.default.createElement(WithCaption, { caption: props.block?.value?.caption }, /* @__PURE__ */ import_react.default.createElement(Image, { ...props }));
|
|
240
245
|
}
|
|
241
246
|
function InlineEntry(props) {
|
|
242
247
|
const href = props?.block?.value?.sys?.uri;
|
|
243
248
|
const attributes = getAttributes(props, {
|
|
244
249
|
href
|
|
245
250
|
});
|
|
246
|
-
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 }) });
|
|
247
252
|
}
|
|
248
253
|
InlineEntry.Children = function(props) {
|
|
249
254
|
const entryTitle = props?.block?.value?.entryTitle || "";
|
|
250
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, entryTitle);
|
|
251
256
|
};
|
|
252
257
|
function Link(props) {
|
|
253
258
|
const linkValue = props?.block?.properties?.link;
|
|
@@ -256,7 +261,7 @@ function Link(props) {
|
|
|
256
261
|
target: props?.block?.properties?.newTab ? "_blank" : null,
|
|
257
262
|
rel: props?.block?.properties?.newTab ? "noopener noreferrer" : null
|
|
258
263
|
});
|
|
259
|
-
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 }) });
|
|
260
265
|
}
|
|
261
266
|
Link.Children = RenderBlockChildrenFactory();
|
|
262
267
|
function List(props) {
|
|
@@ -264,85 +269,78 @@ function List(props) {
|
|
|
264
269
|
const attributes = getAttributes(props, {
|
|
265
270
|
start: isOrdered ? props.block?.properties?.start : null
|
|
266
271
|
});
|
|
267
|
-
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 }) }));
|
|
268
273
|
}
|
|
269
274
|
List.Children = RenderBlockChildrenFactory();
|
|
270
275
|
function ListItem(props) {
|
|
271
276
|
const attributes = getAttributes(props);
|
|
272
|
-
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 }) }));
|
|
273
278
|
}
|
|
274
279
|
ListItem.Children = RenderBlockChildrenFactory();
|
|
275
280
|
function Panel(props) {
|
|
276
281
|
const attributes = getAttributes(props, {
|
|
277
282
|
className: ["panel", props.block?.properties?.panelType || "info"].join(" ")
|
|
278
283
|
});
|
|
279
|
-
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 }) }));
|
|
280
285
|
}
|
|
281
286
|
Panel.Children = RenderBlockChildrenFactory();
|
|
282
287
|
function Paragraph(props) {
|
|
283
288
|
const attributes = getAttributes(props, {
|
|
284
289
|
className: props.block?.properties?.paragraphType
|
|
285
290
|
});
|
|
286
|
-
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 }) }));
|
|
287
292
|
}
|
|
288
293
|
Paragraph.Children = RenderBlockChildrenFactory();
|
|
289
294
|
function Quote(props) {
|
|
290
295
|
const attributes = getAttributes(props, {
|
|
291
296
|
"cite": props.block?.properties?.url
|
|
292
297
|
});
|
|
293
|
-
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 }) }));
|
|
294
299
|
}
|
|
295
300
|
Quote.Children = function(props) {
|
|
296
301
|
const source = props.block?.properties?.source;
|
|
297
302
|
const citation = props.block?.properties?.citation;
|
|
298
303
|
const hasChildren = !!source || !!citation;
|
|
299
|
-
return hasChildren ? /* @__PURE__ */ (
|
|
300
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RenderChildren, { block: props.block }) }),
|
|
301
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("footer", { children: [
|
|
302
|
-
source,
|
|
303
|
-
" ",
|
|
304
|
-
!!citation ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("cite", { children: citation }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {})
|
|
305
|
-
] })
|
|
306
|
-
] }) : /* @__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 });
|
|
307
305
|
};
|
|
308
306
|
function Table(props) {
|
|
309
307
|
const attributes = getAttributes(props);
|
|
310
|
-
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 }) }));
|
|
311
309
|
}
|
|
312
310
|
Table.Children = RenderBlockChildrenFactory();
|
|
313
311
|
function TableBody(props) {
|
|
314
312
|
const attributes = getAttributes(props);
|
|
315
|
-
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 }) }));
|
|
316
314
|
}
|
|
317
315
|
TableBody.Children = RenderBlockChildrenFactory();
|
|
318
316
|
function TableCaption(props) {
|
|
319
317
|
const attributes = getAttributes(props);
|
|
320
|
-
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 }) }));
|
|
321
319
|
}
|
|
322
320
|
TableCaption.Children = RenderBlockChildrenFactory();
|
|
323
321
|
function TableCell(props) {
|
|
324
322
|
const attributes = getAttributes(props);
|
|
325
|
-
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 }) }));
|
|
326
324
|
}
|
|
327
325
|
TableCell.Children = RenderBlockChildrenFactory();
|
|
328
326
|
function TableFooter(props) {
|
|
329
327
|
const attributes = getAttributes(props);
|
|
330
|
-
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 }) }));
|
|
331
329
|
}
|
|
332
330
|
TableFooter.Children = RenderBlockChildrenFactory();
|
|
333
331
|
function TableHeader(props) {
|
|
334
332
|
const attributes = getAttributes(props);
|
|
335
|
-
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 }) }));
|
|
336
334
|
}
|
|
337
335
|
TableHeader.Children = RenderBlockChildrenFactory();
|
|
338
336
|
function TableHeaderCell(props) {
|
|
339
337
|
const attributes = getAttributes(props);
|
|
340
|
-
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 }) }));
|
|
341
339
|
}
|
|
342
340
|
TableHeaderCell.Children = RenderBlockChildrenFactory();
|
|
343
341
|
function TableRow(props) {
|
|
344
342
|
const attributes = getAttributes(props);
|
|
345
|
-
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 }) }));
|
|
346
344
|
}
|
|
347
345
|
TableRow.Children = RenderBlockChildrenFactory();
|
|
348
346
|
function Decorators(props) {
|
|
@@ -352,83 +350,83 @@ function Decorators(props) {
|
|
|
352
350
|
const DecoratorComponent = !!firstDecorator ? decorators[firstDecorator] : void 0;
|
|
353
351
|
const render = () => {
|
|
354
352
|
if (!!DecoratorComponent) {
|
|
355
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ import_react.default.createElement(DecoratorComponent, { block: props.block, decorator: firstDecorator, otherDecorators: remainingDecorators });
|
|
356
354
|
} else if (firstDecorator) {
|
|
357
|
-
return /* @__PURE__ */
|
|
355
|
+
return /* @__PURE__ */ import_react.default.createElement(Decorators, { block: props.block, decorators: remainingDecorators });
|
|
358
356
|
} else {
|
|
359
|
-
return /* @__PURE__ */
|
|
357
|
+
return /* @__PURE__ */ import_react.default.createElement(Fragment.Children, { block: props.block });
|
|
360
358
|
}
|
|
361
359
|
};
|
|
362
360
|
return render();
|
|
363
361
|
}
|
|
364
362
|
function DecoratorChildren(props) {
|
|
365
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ import_react.default.createElement(Decorators, { block: props.block, decorators: props.otherDecorators });
|
|
366
364
|
}
|
|
367
365
|
function InlineCode(props) {
|
|
368
366
|
const attributes = getAttributes(props);
|
|
369
|
-
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 }) }));
|
|
370
368
|
}
|
|
371
369
|
InlineCode.Children = DecoratorChildren;
|
|
372
370
|
function Delete(props) {
|
|
373
371
|
const attributes = getAttributes(props);
|
|
374
|
-
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 }) }));
|
|
375
373
|
}
|
|
376
374
|
Delete.Children = DecoratorChildren;
|
|
377
375
|
function Emphasis(props) {
|
|
378
376
|
const attributes = getAttributes(props);
|
|
379
|
-
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 }) }));
|
|
380
378
|
}
|
|
381
379
|
Emphasis.Children = DecoratorChildren;
|
|
382
380
|
function Insert(props) {
|
|
383
381
|
const attributes = getAttributes(props);
|
|
384
|
-
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 }) }));
|
|
385
383
|
}
|
|
386
384
|
Insert.Children = DecoratorChildren;
|
|
387
385
|
function Keyboard(props) {
|
|
388
386
|
const attributes = getAttributes(props);
|
|
389
|
-
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 }) }));
|
|
390
388
|
}
|
|
391
389
|
Keyboard.Children = DecoratorChildren;
|
|
392
390
|
function LineBreak(props) {
|
|
393
391
|
const attributes = getAttributes(props);
|
|
394
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ import_react.default.createElement("br", { ...attributes });
|
|
395
393
|
}
|
|
396
394
|
LineBreak.Children = function(props) {
|
|
397
|
-
return /* @__PURE__ */
|
|
395
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
398
396
|
};
|
|
399
397
|
function Mark(props) {
|
|
400
398
|
const attributes = getAttributes(props);
|
|
401
|
-
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 }) }));
|
|
402
400
|
}
|
|
403
401
|
Mark.Children = DecoratorChildren;
|
|
404
402
|
function Strong(props) {
|
|
405
403
|
const attributes = getAttributes(props);
|
|
406
|
-
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 }) }));
|
|
407
405
|
}
|
|
408
406
|
Strong.Children = DecoratorChildren;
|
|
409
407
|
function Strikethrough(props) {
|
|
410
408
|
const attributes = getAttributes(props);
|
|
411
|
-
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 }) }));
|
|
412
410
|
}
|
|
413
411
|
Strikethrough.Children = DecoratorChildren;
|
|
414
412
|
function Subscript(props) {
|
|
415
413
|
const attributes = getAttributes(props);
|
|
416
|
-
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 }) }));
|
|
417
415
|
}
|
|
418
416
|
Subscript.Children = DecoratorChildren;
|
|
419
417
|
function Superscript(props) {
|
|
420
418
|
const attributes = getAttributes(props);
|
|
421
|
-
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 }) }));
|
|
422
420
|
}
|
|
423
421
|
Superscript.Children = DecoratorChildren;
|
|
424
422
|
function Underline(props) {
|
|
425
423
|
const attributes = getAttributes(props);
|
|
426
|
-
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 }) }));
|
|
427
425
|
}
|
|
428
426
|
Underline.Children = DecoratorChildren;
|
|
429
427
|
function Variable(props) {
|
|
430
428
|
const attributes = getAttributes(props);
|
|
431
|
-
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 }) }));
|
|
432
430
|
}
|
|
433
431
|
Variable.Children = DecoratorChildren;
|
|
434
432
|
var BLOCK_RENDERERS = {
|
|
@@ -436,7 +434,7 @@ var BLOCK_RENDERERS = {
|
|
|
436
434
|
"_code": CodeWithCaption,
|
|
437
435
|
"_component": Component,
|
|
438
436
|
"_divider": Divider,
|
|
439
|
-
"_fragment":
|
|
437
|
+
"_fragment": Fragment,
|
|
440
438
|
"_heading": Heading,
|
|
441
439
|
"_image": ImageWithCaption,
|
|
442
440
|
"_inlineEntry": InlineEntry,
|
|
@@ -492,6 +490,7 @@ var DECORATOR_RENDERERS = {
|
|
|
492
490
|
Mark,
|
|
493
491
|
Panel,
|
|
494
492
|
Paragraph,
|
|
493
|
+
Quote,
|
|
495
494
|
RenderContextProvider,
|
|
496
495
|
Renderer,
|
|
497
496
|
RendererContext,
|