@contensis/canvas-react 1.0.4 → 1.0.5

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.
@@ -3,8 +3,34 @@ var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
7
  var __getProtoOf = Object.getPrototypeOf;
7
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __objRest = (source, exclude) => {
23
+ var target = {};
24
+ for (var prop in source)
25
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
26
+ target[prop] = source[prop];
27
+ if (source != null && __getOwnPropSymbols)
28
+ for (var prop of __getOwnPropSymbols(source)) {
29
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
30
+ target[prop] = source[prop];
31
+ }
32
+ return target;
33
+ };
8
34
  var __export = (target, all) => {
9
35
  for (var name in all)
10
36
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -78,14 +104,14 @@ function RenderContextProvider(props) {
78
104
  const overrideBlocks = props.blocks;
79
105
  const blocks = Object.keys(BLOCK_RENDERERS).reduce((prev, type) => {
80
106
  const blockType = type;
81
- const renderer = overrideBlocks?.[blockType] || BLOCK_RENDERERS[blockType];
107
+ const renderer = (overrideBlocks == null ? void 0 : overrideBlocks[blockType]) || BLOCK_RENDERERS[blockType];
82
108
  prev[blockType] = renderer;
83
109
  return prev;
84
110
  }, {});
85
111
  const overrideDecorators = props.decorators;
86
112
  const decorators = Object.keys(DECORATOR_RENDERERS).reduce((prev, type) => {
87
113
  const decoratorType = type;
88
- prev[decoratorType] = overrideDecorators?.[decoratorType] || DECORATOR_RENDERERS[decoratorType];
114
+ prev[decoratorType] = (overrideDecorators == null ? void 0 : overrideDecorators[decoratorType]) || DECORATOR_RENDERERS[decoratorType];
89
115
  return prev;
90
116
  }, {});
91
117
  const value = { blocks, decorators, components: props.components };
@@ -115,8 +141,9 @@ function RenderContents(props) {
115
141
  return props.contents ? props.contents : props.fallback;
116
142
  }
117
143
  function RenderChildren(props) {
118
- const isArray = Array.isArray(props.block?.value);
119
- const isString = typeof props.block?.value === "string";
144
+ var _a, _b;
145
+ const isArray = Array.isArray((_a = props.block) == null ? void 0 : _a.value);
146
+ const isString = typeof ((_b = props.block) == null ? void 0 : _b.value) === "string";
120
147
  const render = () => {
121
148
  if (isArray) {
122
149
  return /* @__PURE__ */ import_react.default.createElement(RenderBlocks, { blocks: props.block.value });
@@ -135,13 +162,12 @@ function Renderer(props) {
135
162
  return /* @__PURE__ */ import_react.default.createElement(RenderBlocks, { blocks: props.data });
136
163
  }
137
164
  function getAttributes(props, extra = {}) {
138
- const { block, ...rest } = props;
139
- let { children, decorator, otherDecorators, ...attributes } = rest;
140
- attributes = {
141
- id: block?.properties?.id,
142
- ...extra,
143
- ...attributes
144
- };
165
+ var _c;
166
+ const _a = props, { block } = _a, rest = __objRest(_a, ["block"]);
167
+ let _b = rest, { children, decorator, otherDecorators } = _b, attributes = __objRest(_b, ["children", "decorator", "otherDecorators"]);
168
+ attributes = __spreadValues(__spreadValues({
169
+ id: (_c = block == null ? void 0 : block.properties) == null ? void 0 : _c.id
170
+ }, extra), attributes);
145
171
  return attributes;
146
172
  }
147
173
  function WithCaption(props) {
@@ -159,71 +185,78 @@ function EmptyChildrenFactory() {
159
185
  }
160
186
  function Anchor(props) {
161
187
  const attributes = getAttributes(props);
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 }) }));
188
+ return /* @__PURE__ */ import_react.default.createElement("a", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Anchor.Children, { block: props.block }) }));
163
189
  }
164
190
  Anchor.Children = RenderBlockChildrenFactory();
165
191
  function Code(props) {
192
+ var _a, _b, _c, _d;
166
193
  const attributes = getAttributes(props, {
167
- "data-language": props.block?.value?.language
194
+ "data-language": (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.language
168
195
  });
169
196
  const codeAttributes = getAttributes(props, {
170
- className: `language-${props.block?.value?.language}`
197
+ className: `language-${(_d = (_c = props.block) == null ? void 0 : _c.value) == null ? void 0 : _d.language}`
171
198
  });
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 }) })));
199
+ return /* @__PURE__ */ import_react.default.createElement("pre", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement("code", __spreadValues({}, codeAttributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Code.Children, { block: props.block }) })));
173
200
  }
174
201
  Code.Children = function(props) {
175
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.block?.value?.code);
202
+ var _a, _b;
203
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.code);
176
204
  };
177
205
  function CodeWithCaption(props) {
178
- return /* @__PURE__ */ import_react.default.createElement(WithCaption, { caption: props.block?.value?.caption }, /* @__PURE__ */ import_react.default.createElement(Code, { ...props }));
206
+ var _a, _b;
207
+ return /* @__PURE__ */ import_react.default.createElement(WithCaption, { caption: (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.caption }, /* @__PURE__ */ import_react.default.createElement(Code, __spreadValues({}, props)));
179
208
  }
180
209
  function Component(props) {
181
- const component = props?.block.properties?.component;
210
+ var _a, _b;
211
+ const component = (_a = props == null ? void 0 : props.block.properties) == null ? void 0 : _a.component;
182
212
  const components = useComponents();
183
- const ComponentElement = !!component ? components?.[component] : void 0;
213
+ const ComponentElement = !!component ? components == null ? void 0 : components[component] : void 0;
184
214
  const value = props.block.value ? JSON.stringify(props.block.value) : "";
185
215
  const attributes = getAttributes(props, {
186
216
  className: "component",
187
- "data-component": props.block.properties?.component,
217
+ "data-component": (_b = props.block.properties) == null ? void 0 : _b.component,
188
218
  "data-component-value": value
189
219
  });
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 }) }));
220
+ return !!ComponentElement ? /* @__PURE__ */ import_react.default.createElement(ComponentElement, __spreadValues({}, props)) : /* @__PURE__ */ import_react.default.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Component.Children, { block: props.block }) }));
191
221
  }
192
222
  Component.Children = function(props) {
193
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, "Component: ", props.block?.properties?.component);
223
+ var _a, _b;
224
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, "Component: ", (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.component);
194
225
  };
195
226
  function Divider(props) {
196
227
  const attributes = getAttributes(props);
197
- return /* @__PURE__ */ import_react.default.createElement("hr", { ...attributes });
228
+ return /* @__PURE__ */ import_react.default.createElement("hr", __spreadValues({}, attributes));
198
229
  }
199
230
  Divider.Children = EmptyChildrenFactory();
200
231
  function Fragment(props) {
201
- const hasDecorators = !!props.block?.properties?.decorators?.length;
202
- const decorators = props.block?.properties?.decorators;
232
+ var _a, _b, _c, _d, _e;
233
+ const hasDecorators = !!((_c = (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.decorators) == null ? void 0 : _c.length);
234
+ const decorators = (_e = (_d = props.block) == null ? void 0 : _d.properties) == null ? void 0 : _e.decorators;
203
235
  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 }) });
204
236
  }
205
237
  Fragment.Children = RenderBlockChildrenFactory();
206
238
  function Heading(props) {
207
239
  const attributes = getAttributes(props);
208
240
  const render = () => {
209
- switch (props?.block?.properties?.level) {
241
+ var _a, _b;
242
+ switch ((_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.level) {
210
243
  case 2: {
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 }) }));
244
+ return /* @__PURE__ */ import_react.default.createElement("h2", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
212
245
  }
213
246
  case 3: {
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 }) }));
247
+ return /* @__PURE__ */ import_react.default.createElement("h3", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
215
248
  }
216
249
  case 4: {
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 }) }));
250
+ return /* @__PURE__ */ import_react.default.createElement("h4", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
218
251
  }
219
252
  case 5: {
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 }) }));
253
+ return /* @__PURE__ */ import_react.default.createElement("h5", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
221
254
  }
222
255
  case 6: {
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 }) }));
256
+ return /* @__PURE__ */ import_react.default.createElement("h6", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
224
257
  }
225
258
  default: {
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 }) }));
259
+ return /* @__PURE__ */ import_react.default.createElement("h1", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Heading.Children, { block: props.block }) }));
227
260
  }
228
261
  }
229
262
  };
@@ -231,116 +264,126 @@ function Heading(props) {
231
264
  }
232
265
  Heading.Children = RenderBlockChildrenFactory();
233
266
  function Image(props) {
234
- const src = props.block?.value?.asset?.sys?.uri;
267
+ var _a, _b, _c, _d, _e, _f, _g, _h;
268
+ const src = (_d = (_c = (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.asset) == null ? void 0 : _c.sys) == null ? void 0 : _d.uri;
235
269
  const attributes = getAttributes(props, {
236
270
  src,
237
- alt: props.block?.value?.altText,
238
- title: props?.block?.value?.caption
271
+ alt: (_f = (_e = props.block) == null ? void 0 : _e.value) == null ? void 0 : _f.altText,
272
+ title: (_h = (_g = props == null ? void 0 : props.block) == null ? void 0 : _g.value) == null ? void 0 : _h.caption
239
273
  });
240
- return /* @__PURE__ */ import_react.default.createElement("img", { ...attributes });
274
+ return /* @__PURE__ */ import_react.default.createElement("img", __spreadValues({}, attributes));
241
275
  }
242
276
  Image.Children = EmptyChildrenFactory();
243
277
  function ImageWithCaption(props) {
244
- return /* @__PURE__ */ import_react.default.createElement(WithCaption, { caption: props.block?.value?.caption }, /* @__PURE__ */ import_react.default.createElement(Image, { ...props }));
278
+ var _a, _b;
279
+ return /* @__PURE__ */ import_react.default.createElement(WithCaption, { caption: (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.caption }, /* @__PURE__ */ import_react.default.createElement(Image, __spreadValues({}, props)));
245
280
  }
246
281
  function InlineEntry(props) {
247
- const href = props?.block?.value?.sys?.uri;
282
+ var _a, _b, _c;
283
+ const href = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.uri;
248
284
  const attributes = getAttributes(props, {
249
285
  href
250
286
  });
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 }) });
287
+ return !!attributes.href ? /* @__PURE__ */ import_react.default.createElement("a", __spreadValues({}, 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 }) });
252
288
  }
253
289
  InlineEntry.Children = function(props) {
254
- const entryTitle = props?.block?.value?.entryTitle || "";
290
+ var _a, _b;
291
+ const entryTitle = ((_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.entryTitle) || "";
255
292
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, entryTitle);
256
293
  };
257
294
  function Link(props) {
258
- const linkValue = props?.block?.properties?.link;
295
+ var _a, _b, _c, _d, _e, _f, _g;
296
+ const linkValue = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.link;
259
297
  const attributes = getAttributes(props, {
260
- href: linkValue?.sys?.uri,
261
- target: props?.block?.properties?.newTab ? "_blank" : null,
262
- rel: props?.block?.properties?.newTab ? "noopener noreferrer" : null
298
+ href: (_c = linkValue == null ? void 0 : linkValue.sys) == null ? void 0 : _c.uri,
299
+ target: ((_e = (_d = props == null ? void 0 : props.block) == null ? void 0 : _d.properties) == null ? void 0 : _e.newTab) ? "_blank" : null,
300
+ rel: ((_g = (_f = props == null ? void 0 : props.block) == null ? void 0 : _f.properties) == null ? void 0 : _g.newTab) ? "noopener noreferrer" : null
263
301
  });
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 }) });
302
+ return !!attributes.href ? /* @__PURE__ */ import_react.default.createElement("a", __spreadValues({}, 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 }) });
265
303
  }
266
304
  Link.Children = RenderBlockChildrenFactory();
267
305
  function List(props) {
268
- const isOrdered = props.block?.properties?.listType === "ordered";
306
+ var _a, _b, _c, _d;
307
+ const isOrdered = ((_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.listType) === "ordered";
269
308
  const attributes = getAttributes(props, {
270
- start: isOrdered ? props.block?.properties?.start : null
309
+ start: isOrdered ? (_d = (_c = props.block) == null ? void 0 : _c.properties) == null ? void 0 : _d.start : null
271
310
  });
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 }) }));
311
+ return isOrdered ? /* @__PURE__ */ import_react.default.createElement("ol", __spreadValues({}, 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", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(List.Children, { block: props.block }) }));
273
312
  }
274
313
  List.Children = RenderBlockChildrenFactory();
275
314
  function ListItem(props) {
276
315
  const attributes = getAttributes(props);
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 }) }));
316
+ return /* @__PURE__ */ import_react.default.createElement("li", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(ListItem.Children, { block: props.block }) }));
278
317
  }
279
318
  ListItem.Children = RenderBlockChildrenFactory();
280
319
  function Panel(props) {
320
+ var _a, _b;
281
321
  const attributes = getAttributes(props, {
282
- className: ["panel", props.block?.properties?.panelType || "info"].join(" ")
322
+ className: ["panel", ((_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.panelType) || "info"].join(" ")
283
323
  });
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 }) }));
324
+ return /* @__PURE__ */ import_react.default.createElement("aside", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Panel.Children, { block: props.block }) }));
285
325
  }
286
326
  Panel.Children = RenderBlockChildrenFactory();
287
327
  function Paragraph(props) {
328
+ var _a, _b;
288
329
  const attributes = getAttributes(props, {
289
- className: props.block?.properties?.paragraphType
330
+ className: (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.paragraphType
290
331
  });
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 }) }));
332
+ return /* @__PURE__ */ import_react.default.createElement("p", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Paragraph.Children, { block: props.block }) }));
292
333
  }
293
334
  Paragraph.Children = RenderBlockChildrenFactory();
294
335
  function Quote(props) {
336
+ var _a, _b;
295
337
  const attributes = getAttributes(props, {
296
- "cite": props.block?.properties?.url
338
+ "cite": (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.url
297
339
  });
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 }) }));
340
+ return /* @__PURE__ */ import_react.default.createElement("blockquote", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Quote.Children, { block: props.block }) }));
299
341
  }
300
342
  Quote.Children = function(props) {
301
- const source = props.block?.properties?.source;
302
- const citation = props.block?.properties?.citation;
343
+ var _a, _b, _c, _d;
344
+ const source = (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.source;
345
+ const citation = (_d = (_c = props.block) == null ? void 0 : _c.properties) == null ? void 0 : _d.citation;
303
346
  const hasChildren = !!source || !!citation;
304
347
  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 });
305
348
  };
306
349
  function Table(props) {
307
350
  const attributes = getAttributes(props);
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 }) }));
351
+ return /* @__PURE__ */ import_react.default.createElement("table", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Table.Children, { block: props.block }) }));
309
352
  }
310
353
  Table.Children = RenderBlockChildrenFactory();
311
354
  function TableBody(props) {
312
355
  const attributes = getAttributes(props);
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 }) }));
356
+ return /* @__PURE__ */ import_react.default.createElement("tbody", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableBody.Children, { block: props.block }) }));
314
357
  }
315
358
  TableBody.Children = RenderBlockChildrenFactory();
316
359
  function TableCaption(props) {
317
360
  const attributes = getAttributes(props);
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 }) }));
361
+ return /* @__PURE__ */ import_react.default.createElement("caption", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableCaption.Children, { block: props.block }) }));
319
362
  }
320
363
  TableCaption.Children = RenderBlockChildrenFactory();
321
364
  function TableCell(props) {
322
365
  const attributes = getAttributes(props);
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 }) }));
366
+ return /* @__PURE__ */ import_react.default.createElement("td", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableCell.Children, { block: props.block }) }));
324
367
  }
325
368
  TableCell.Children = RenderBlockChildrenFactory();
326
369
  function TableFooter(props) {
327
370
  const attributes = getAttributes(props);
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 }) }));
371
+ return /* @__PURE__ */ import_react.default.createElement("tfoot", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableFooter.Children, { block: props.block }) }));
329
372
  }
330
373
  TableFooter.Children = RenderBlockChildrenFactory();
331
374
  function TableHeader(props) {
332
375
  const attributes = getAttributes(props);
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 }) }));
376
+ return /* @__PURE__ */ import_react.default.createElement("thead", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableHeader.Children, { block: props.block }) }));
334
377
  }
335
378
  TableHeader.Children = RenderBlockChildrenFactory();
336
379
  function TableHeaderCell(props) {
337
380
  const attributes = getAttributes(props);
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 }) }));
381
+ return /* @__PURE__ */ import_react.default.createElement("th", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableHeaderCell.Children, { block: props.block }) }));
339
382
  }
340
383
  TableHeaderCell.Children = RenderBlockChildrenFactory();
341
384
  function TableRow(props) {
342
385
  const attributes = getAttributes(props);
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 }) }));
386
+ return /* @__PURE__ */ import_react.default.createElement("tr", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableRow.Children, { block: props.block }) }));
344
387
  }
345
388
  TableRow.Children = RenderBlockChildrenFactory();
346
389
  function Decorators(props) {
@@ -364,69 +407,69 @@ function DecoratorChildren(props) {
364
407
  }
365
408
  function InlineCode(props) {
366
409
  const attributes = getAttributes(props);
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 }) }));
410
+ return /* @__PURE__ */ import_react.default.createElement("code", __spreadValues({}, 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 }) }));
368
411
  }
369
412
  InlineCode.Children = DecoratorChildren;
370
413
  function Delete(props) {
371
414
  const attributes = getAttributes(props);
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 }) }));
415
+ return /* @__PURE__ */ import_react.default.createElement("del", __spreadValues({}, 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 }) }));
373
416
  }
374
417
  Delete.Children = DecoratorChildren;
375
418
  function Emphasis(props) {
376
419
  const attributes = getAttributes(props);
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 }) }));
420
+ return /* @__PURE__ */ import_react.default.createElement("em", __spreadValues({}, 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 }) }));
378
421
  }
379
422
  Emphasis.Children = DecoratorChildren;
380
423
  function Insert(props) {
381
424
  const attributes = getAttributes(props);
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 }) }));
425
+ return /* @__PURE__ */ import_react.default.createElement("ins", __spreadValues({}, 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 }) }));
383
426
  }
384
427
  Insert.Children = DecoratorChildren;
385
428
  function Keyboard(props) {
386
429
  const attributes = getAttributes(props);
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 }) }));
430
+ return /* @__PURE__ */ import_react.default.createElement("kbd", __spreadValues({}, 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 }) }));
388
431
  }
389
432
  Keyboard.Children = DecoratorChildren;
390
433
  function LineBreak(props) {
391
434
  const attributes = getAttributes(props);
392
- return /* @__PURE__ */ import_react.default.createElement("br", { ...attributes });
435
+ return /* @__PURE__ */ import_react.default.createElement("br", __spreadValues({}, attributes));
393
436
  }
394
437
  LineBreak.Children = function(props) {
395
438
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
396
439
  };
397
440
  function Mark(props) {
398
441
  const attributes = getAttributes(props);
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 }) }));
442
+ return /* @__PURE__ */ import_react.default.createElement("mark", __spreadValues({}, 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 }) }));
400
443
  }
401
444
  Mark.Children = DecoratorChildren;
402
445
  function Strong(props) {
403
446
  const attributes = getAttributes(props);
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 }) }));
447
+ return /* @__PURE__ */ import_react.default.createElement("strong", __spreadValues({}, 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 }) }));
405
448
  }
406
449
  Strong.Children = DecoratorChildren;
407
450
  function Strikethrough(props) {
408
451
  const attributes = getAttributes(props);
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 }) }));
452
+ return /* @__PURE__ */ import_react.default.createElement("s", __spreadValues({}, 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 }) }));
410
453
  }
411
454
  Strikethrough.Children = DecoratorChildren;
412
455
  function Subscript(props) {
413
456
  const attributes = getAttributes(props);
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 }) }));
457
+ return /* @__PURE__ */ import_react.default.createElement("sub", __spreadValues({}, 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 }) }));
415
458
  }
416
459
  Subscript.Children = DecoratorChildren;
417
460
  function Superscript(props) {
418
461
  const attributes = getAttributes(props);
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 }) }));
462
+ return /* @__PURE__ */ import_react.default.createElement("sup", __spreadValues({}, 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 }) }));
420
463
  }
421
464
  Superscript.Children = DecoratorChildren;
422
465
  function Underline(props) {
423
466
  const attributes = getAttributes(props);
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 }) }));
467
+ return /* @__PURE__ */ import_react.default.createElement("u", __spreadValues({}, 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 }) }));
425
468
  }
426
469
  Underline.Children = DecoratorChildren;
427
470
  function Variable(props) {
428
471
  const attributes = getAttributes(props);
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 }) }));
472
+ return /* @__PURE__ */ import_react.default.createElement("var", __spreadValues({}, 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 }) }));
430
473
  }
431
474
  Variable.Children = DecoratorChildren;
432
475
  var BLOCK_RENDERERS = {