@contensis/canvas-react 1.0.4 → 1.0.6
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 +2 -1
- package/dist/canvas-react.d.ts +2 -1
- package/dist/canvas-react.js +123 -78
- package/dist/canvas-react.js.map +1 -1
- package/dist/esm/canvas-react.js +485 -0
- package/dist/esm/canvas-react.js.map +1 -0
- package/package.json +3 -3
- package/dist/canvas-react.mjs +0 -438
- package/dist/canvas-react.mjs.map +0 -1
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// src/renderer.tsx
|
|
31
|
+
import React, { createContext, useContext } from "react";
|
|
32
|
+
var RendererContext = createContext({});
|
|
33
|
+
function RenderContextProvider(props) {
|
|
34
|
+
const overrideBlocks = props.blocks;
|
|
35
|
+
const blocks = Object.keys(BLOCK_RENDERERS).reduce((prev, type) => {
|
|
36
|
+
const blockType = type;
|
|
37
|
+
const renderer = (overrideBlocks == null ? void 0 : overrideBlocks[blockType]) || BLOCK_RENDERERS[blockType];
|
|
38
|
+
prev[blockType] = renderer;
|
|
39
|
+
return prev;
|
|
40
|
+
}, {});
|
|
41
|
+
const overrideDecorators = props.decorators;
|
|
42
|
+
const decorators = Object.keys(DECORATOR_RENDERERS).reduce((prev, type) => {
|
|
43
|
+
const decoratorType = type;
|
|
44
|
+
prev[decoratorType] = (overrideDecorators == null ? void 0 : overrideDecorators[decoratorType]) || DECORATOR_RENDERERS[decoratorType];
|
|
45
|
+
return prev;
|
|
46
|
+
}, {});
|
|
47
|
+
const value = { blocks, decorators, components: props.components };
|
|
48
|
+
return /* @__PURE__ */ React.createElement(RendererContext.Provider, { value }, props.children);
|
|
49
|
+
}
|
|
50
|
+
function useBlocks() {
|
|
51
|
+
const value = useContext(RendererContext);
|
|
52
|
+
return value.blocks || BLOCK_RENDERERS;
|
|
53
|
+
}
|
|
54
|
+
function useDecorators() {
|
|
55
|
+
const value = useContext(RendererContext);
|
|
56
|
+
return value.decorators || DECORATOR_RENDERERS;
|
|
57
|
+
}
|
|
58
|
+
function useComponents() {
|
|
59
|
+
const value = useContext(RendererContext);
|
|
60
|
+
return value.components || {};
|
|
61
|
+
}
|
|
62
|
+
function RenderBlock(props) {
|
|
63
|
+
const blocks = useBlocks();
|
|
64
|
+
const Component2 = blocks[props.block.type];
|
|
65
|
+
return /* @__PURE__ */ React.createElement(Component2, { block: props.block });
|
|
66
|
+
}
|
|
67
|
+
function RenderBlocks(props) {
|
|
68
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.blocks.map((block) => /* @__PURE__ */ React.createElement(RenderBlock, { block, key: block.id })));
|
|
69
|
+
}
|
|
70
|
+
function RenderContents(props) {
|
|
71
|
+
return props.contents ? props.contents : props.fallback;
|
|
72
|
+
}
|
|
73
|
+
function RenderChildren(props) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
const isArray = Array.isArray((_a = props.block) == null ? void 0 : _a.value);
|
|
76
|
+
const isString = typeof ((_b = props.block) == null ? void 0 : _b.value) === "string";
|
|
77
|
+
const render = () => {
|
|
78
|
+
if (isArray) {
|
|
79
|
+
return /* @__PURE__ */ React.createElement(RenderBlocks, { blocks: props.block.value });
|
|
80
|
+
} else if (isString) {
|
|
81
|
+
return /* @__PURE__ */ React.createElement(RenderText, { text: props.block.value });
|
|
82
|
+
} else {
|
|
83
|
+
return /* @__PURE__ */ React.createElement(RenderText, { text: "" });
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
return render();
|
|
87
|
+
}
|
|
88
|
+
function RenderText(props) {
|
|
89
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.text);
|
|
90
|
+
}
|
|
91
|
+
function Renderer(props) {
|
|
92
|
+
return /* @__PURE__ */ React.createElement(RenderBlocks, { blocks: props.data });
|
|
93
|
+
}
|
|
94
|
+
function getAttributes(props, extra = {}) {
|
|
95
|
+
var _c;
|
|
96
|
+
const _a = props, { block } = _a, rest = __objRest(_a, ["block"]);
|
|
97
|
+
let _b = rest, { children, decorator, otherDecorators } = _b, attributes = __objRest(_b, ["children", "decorator", "otherDecorators"]);
|
|
98
|
+
attributes = __spreadValues(__spreadValues({
|
|
99
|
+
id: (_c = block == null ? void 0 : block.properties) == null ? void 0 : _c.id
|
|
100
|
+
}, extra), attributes);
|
|
101
|
+
return attributes;
|
|
102
|
+
}
|
|
103
|
+
function WithCaption(props) {
|
|
104
|
+
return !!props.caption ? /* @__PURE__ */ React.createElement("figure", null, props.children, /* @__PURE__ */ React.createElement("figcaption", null, props.caption)) : props.children || null;
|
|
105
|
+
}
|
|
106
|
+
function RenderBlockChildrenFactory() {
|
|
107
|
+
return function(props) {
|
|
108
|
+
return /* @__PURE__ */ React.createElement(RenderChildren, { block: props.block });
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function EmptyChildrenFactory() {
|
|
112
|
+
return function(props) {
|
|
113
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function Anchor(props) {
|
|
117
|
+
const attributes = getAttributes(props);
|
|
118
|
+
return /* @__PURE__ */ React.createElement("a", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Anchor.Children, { block: props.block }) }));
|
|
119
|
+
}
|
|
120
|
+
Anchor.Children = RenderBlockChildrenFactory();
|
|
121
|
+
function Code(props) {
|
|
122
|
+
var _a, _b, _c, _d;
|
|
123
|
+
const attributes = getAttributes(props, {
|
|
124
|
+
"data-language": (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.language
|
|
125
|
+
});
|
|
126
|
+
const codeAttributes = getAttributes(props, {
|
|
127
|
+
className: `language-${(_d = (_c = props.block) == null ? void 0 : _c.value) == null ? void 0 : _d.language}`
|
|
128
|
+
});
|
|
129
|
+
return /* @__PURE__ */ React.createElement("pre", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement("code", __spreadValues({}, codeAttributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Code.Children, { block: props.block }) })));
|
|
130
|
+
}
|
|
131
|
+
Code.Children = function(props) {
|
|
132
|
+
var _a, _b;
|
|
133
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.code);
|
|
134
|
+
};
|
|
135
|
+
function CodeWithCaption(props) {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
return /* @__PURE__ */ React.createElement(WithCaption, { caption: (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.caption }, /* @__PURE__ */ React.createElement(Code, __spreadValues({}, props)));
|
|
138
|
+
}
|
|
139
|
+
function Component(props) {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
const component = (_a = props == null ? void 0 : props.block.properties) == null ? void 0 : _a.component;
|
|
142
|
+
const components = useComponents();
|
|
143
|
+
const ComponentElement = !!component ? components == null ? void 0 : components[component] : void 0;
|
|
144
|
+
const value = props.block.value ? JSON.stringify(props.block.value) : "";
|
|
145
|
+
const attributes = getAttributes(props, {
|
|
146
|
+
className: "component",
|
|
147
|
+
"data-component": (_b = props.block.properties) == null ? void 0 : _b.component,
|
|
148
|
+
"data-component-value": value
|
|
149
|
+
});
|
|
150
|
+
return !!ComponentElement ? /* @__PURE__ */ React.createElement(ComponentElement, __spreadValues({}, props)) : /* @__PURE__ */ React.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Component.Children, { block: props.block }) }));
|
|
151
|
+
}
|
|
152
|
+
Component.Children = function(props) {
|
|
153
|
+
var _a, _b;
|
|
154
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, "Component: ", (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.component);
|
|
155
|
+
};
|
|
156
|
+
function Divider(props) {
|
|
157
|
+
const attributes = getAttributes(props);
|
|
158
|
+
return /* @__PURE__ */ React.createElement("hr", __spreadValues({}, attributes));
|
|
159
|
+
}
|
|
160
|
+
Divider.Children = EmptyChildrenFactory();
|
|
161
|
+
function Fragment(props) {
|
|
162
|
+
var _a, _b, _c, _d, _e;
|
|
163
|
+
const hasDecorators = !!((_c = (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.decorators) == null ? void 0 : _c.length);
|
|
164
|
+
const decorators = (_e = (_d = props.block) == null ? void 0 : _d.properties) == null ? void 0 : _e.decorators;
|
|
165
|
+
return hasDecorators ? /* @__PURE__ */ React.createElement(Decorators, { block: props.block, decorators }) : /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Fragment.Children, { block: props.block }) });
|
|
166
|
+
}
|
|
167
|
+
Fragment.Children = RenderBlockChildrenFactory();
|
|
168
|
+
function Heading(props) {
|
|
169
|
+
const attributes = getAttributes(props);
|
|
170
|
+
const render = () => {
|
|
171
|
+
var _a, _b;
|
|
172
|
+
switch ((_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.level) {
|
|
173
|
+
case 2: {
|
|
174
|
+
return /* @__PURE__ */ React.createElement("h2", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
175
|
+
}
|
|
176
|
+
case 3: {
|
|
177
|
+
return /* @__PURE__ */ React.createElement("h3", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
178
|
+
}
|
|
179
|
+
case 4: {
|
|
180
|
+
return /* @__PURE__ */ React.createElement("h4", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
181
|
+
}
|
|
182
|
+
case 5: {
|
|
183
|
+
return /* @__PURE__ */ React.createElement("h5", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
184
|
+
}
|
|
185
|
+
case 6: {
|
|
186
|
+
return /* @__PURE__ */ React.createElement("h6", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
187
|
+
}
|
|
188
|
+
default: {
|
|
189
|
+
return /* @__PURE__ */ React.createElement("h1", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Heading.Children, { block: props.block }) }));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
return render();
|
|
194
|
+
}
|
|
195
|
+
Heading.Children = RenderBlockChildrenFactory();
|
|
196
|
+
function Image(props) {
|
|
197
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
198
|
+
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;
|
|
199
|
+
const attributes = getAttributes(props, {
|
|
200
|
+
src,
|
|
201
|
+
alt: (_f = (_e = props.block) == null ? void 0 : _e.value) == null ? void 0 : _f.altText,
|
|
202
|
+
title: (_h = (_g = props == null ? void 0 : props.block) == null ? void 0 : _g.value) == null ? void 0 : _h.caption
|
|
203
|
+
});
|
|
204
|
+
return /* @__PURE__ */ React.createElement("img", __spreadValues({}, attributes));
|
|
205
|
+
}
|
|
206
|
+
Image.Children = EmptyChildrenFactory();
|
|
207
|
+
function ImageWithCaption(props) {
|
|
208
|
+
var _a, _b;
|
|
209
|
+
return /* @__PURE__ */ React.createElement(WithCaption, { caption: (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.caption }, /* @__PURE__ */ React.createElement(Image, __spreadValues({}, props)));
|
|
210
|
+
}
|
|
211
|
+
function InlineEntry(props) {
|
|
212
|
+
var _a, _b, _c;
|
|
213
|
+
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;
|
|
214
|
+
const attributes = getAttributes(props, {
|
|
215
|
+
href
|
|
216
|
+
});
|
|
217
|
+
return !!attributes.href ? /* @__PURE__ */ React.createElement("a", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(InlineEntry.Children, { block: props.block }) })) : /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(InlineEntry.Children, { block: props.block }) });
|
|
218
|
+
}
|
|
219
|
+
InlineEntry.Children = function(props) {
|
|
220
|
+
var _a, _b;
|
|
221
|
+
const entryTitle = ((_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.entryTitle) || "";
|
|
222
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, entryTitle);
|
|
223
|
+
};
|
|
224
|
+
function Link(props) {
|
|
225
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
226
|
+
const linkValue = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.link;
|
|
227
|
+
const attributes = getAttributes(props, {
|
|
228
|
+
href: (_c = linkValue == null ? void 0 : linkValue.sys) == null ? void 0 : _c.uri,
|
|
229
|
+
target: ((_e = (_d = props == null ? void 0 : props.block) == null ? void 0 : _d.properties) == null ? void 0 : _e.newTab) ? "_blank" : null,
|
|
230
|
+
rel: ((_g = (_f = props == null ? void 0 : props.block) == null ? void 0 : _f.properties) == null ? void 0 : _g.newTab) ? "noopener noreferrer" : null
|
|
231
|
+
});
|
|
232
|
+
return !!attributes.href ? /* @__PURE__ */ React.createElement("a", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Link.Children, { block: props.block }) })) : /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Link.Children, { block: props.block }) });
|
|
233
|
+
}
|
|
234
|
+
Link.Children = RenderBlockChildrenFactory();
|
|
235
|
+
function List(props) {
|
|
236
|
+
var _a, _b, _c, _d;
|
|
237
|
+
const isOrdered = ((_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.listType) === "ordered";
|
|
238
|
+
const attributes = getAttributes(props, {
|
|
239
|
+
start: isOrdered ? (_d = (_c = props.block) == null ? void 0 : _c.properties) == null ? void 0 : _d.start : null
|
|
240
|
+
});
|
|
241
|
+
return isOrdered ? /* @__PURE__ */ React.createElement("ol", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(List.Children, { block: props.block }) })) : /* @__PURE__ */ React.createElement("ul", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(List.Children, { block: props.block }) }));
|
|
242
|
+
}
|
|
243
|
+
List.Children = RenderBlockChildrenFactory();
|
|
244
|
+
function ListItem(props) {
|
|
245
|
+
const attributes = getAttributes(props);
|
|
246
|
+
return /* @__PURE__ */ React.createElement("li", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(ListItem.Children, { block: props.block }) }));
|
|
247
|
+
}
|
|
248
|
+
ListItem.Children = RenderBlockChildrenFactory();
|
|
249
|
+
function Panel(props) {
|
|
250
|
+
var _a, _b;
|
|
251
|
+
const attributes = getAttributes(props, {
|
|
252
|
+
className: ["panel", ((_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.panelType) || "info"].join(" ")
|
|
253
|
+
});
|
|
254
|
+
return /* @__PURE__ */ React.createElement("aside", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Panel.Children, { block: props.block }) }));
|
|
255
|
+
}
|
|
256
|
+
Panel.Children = RenderBlockChildrenFactory();
|
|
257
|
+
function Paragraph(props) {
|
|
258
|
+
var _a, _b;
|
|
259
|
+
const attributes = getAttributes(props, {
|
|
260
|
+
className: (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.paragraphType
|
|
261
|
+
});
|
|
262
|
+
return /* @__PURE__ */ React.createElement("p", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Paragraph.Children, { block: props.block }) }));
|
|
263
|
+
}
|
|
264
|
+
Paragraph.Children = RenderBlockChildrenFactory();
|
|
265
|
+
function Quote(props) {
|
|
266
|
+
var _a, _b;
|
|
267
|
+
const attributes = getAttributes(props, {
|
|
268
|
+
"cite": (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.url
|
|
269
|
+
});
|
|
270
|
+
return /* @__PURE__ */ React.createElement("blockquote", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Quote.Children, { block: props.block }) }));
|
|
271
|
+
}
|
|
272
|
+
Quote.Children = function(props) {
|
|
273
|
+
var _a, _b, _c, _d;
|
|
274
|
+
const source = (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.source;
|
|
275
|
+
const citation = (_d = (_c = props.block) == null ? void 0 : _c.properties) == null ? void 0 : _d.citation;
|
|
276
|
+
const hasChildren = !!source || !!citation;
|
|
277
|
+
return hasChildren ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement(RenderChildren, { block: props.block })), /* @__PURE__ */ React.createElement("footer", null, source, " ", !!citation ? /* @__PURE__ */ React.createElement("cite", null, citation) : /* @__PURE__ */ React.createElement(React.Fragment, null))) : /* @__PURE__ */ React.createElement(RenderChildren, { block: props.block });
|
|
278
|
+
};
|
|
279
|
+
function Table(props) {
|
|
280
|
+
const attributes = getAttributes(props);
|
|
281
|
+
return /* @__PURE__ */ React.createElement("table", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Table.Children, { block: props.block }) }));
|
|
282
|
+
}
|
|
283
|
+
Table.Children = RenderBlockChildrenFactory();
|
|
284
|
+
function TableBody(props) {
|
|
285
|
+
const attributes = getAttributes(props);
|
|
286
|
+
return /* @__PURE__ */ React.createElement("tbody", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableBody.Children, { block: props.block }) }));
|
|
287
|
+
}
|
|
288
|
+
TableBody.Children = RenderBlockChildrenFactory();
|
|
289
|
+
function TableCaption(props) {
|
|
290
|
+
const attributes = getAttributes(props);
|
|
291
|
+
return /* @__PURE__ */ React.createElement("caption", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableCaption.Children, { block: props.block }) }));
|
|
292
|
+
}
|
|
293
|
+
TableCaption.Children = RenderBlockChildrenFactory();
|
|
294
|
+
function TableCell(props) {
|
|
295
|
+
const attributes = getAttributes(props);
|
|
296
|
+
return /* @__PURE__ */ React.createElement("td", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableCell.Children, { block: props.block }) }));
|
|
297
|
+
}
|
|
298
|
+
TableCell.Children = RenderBlockChildrenFactory();
|
|
299
|
+
function TableFooter(props) {
|
|
300
|
+
const attributes = getAttributes(props);
|
|
301
|
+
return /* @__PURE__ */ React.createElement("tfoot", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableFooter.Children, { block: props.block }) }));
|
|
302
|
+
}
|
|
303
|
+
TableFooter.Children = RenderBlockChildrenFactory();
|
|
304
|
+
function TableHeader(props) {
|
|
305
|
+
const attributes = getAttributes(props);
|
|
306
|
+
return /* @__PURE__ */ React.createElement("thead", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableHeader.Children, { block: props.block }) }));
|
|
307
|
+
}
|
|
308
|
+
TableHeader.Children = RenderBlockChildrenFactory();
|
|
309
|
+
function TableHeaderCell(props) {
|
|
310
|
+
const attributes = getAttributes(props);
|
|
311
|
+
return /* @__PURE__ */ React.createElement("th", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableHeaderCell.Children, { block: props.block }) }));
|
|
312
|
+
}
|
|
313
|
+
TableHeaderCell.Children = RenderBlockChildrenFactory();
|
|
314
|
+
function TableRow(props) {
|
|
315
|
+
const attributes = getAttributes(props);
|
|
316
|
+
return /* @__PURE__ */ React.createElement("tr", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableRow.Children, { block: props.block }) }));
|
|
317
|
+
}
|
|
318
|
+
TableRow.Children = RenderBlockChildrenFactory();
|
|
319
|
+
function Decorators(props) {
|
|
320
|
+
const decorators = useDecorators();
|
|
321
|
+
const remainingDecorators = !!props.decorators ? [...props.decorators] : void 0;
|
|
322
|
+
const firstDecorator = !!remainingDecorators ? remainingDecorators.shift() : void 0;
|
|
323
|
+
const DecoratorComponent = !!firstDecorator ? decorators[firstDecorator] : void 0;
|
|
324
|
+
const render = () => {
|
|
325
|
+
if (!!DecoratorComponent) {
|
|
326
|
+
return /* @__PURE__ */ React.createElement(DecoratorComponent, { block: props.block, decorator: firstDecorator, otherDecorators: remainingDecorators });
|
|
327
|
+
} else if (firstDecorator) {
|
|
328
|
+
return /* @__PURE__ */ React.createElement(Decorators, { block: props.block, decorators: remainingDecorators });
|
|
329
|
+
} else {
|
|
330
|
+
return /* @__PURE__ */ React.createElement(Fragment.Children, { block: props.block });
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
return render();
|
|
334
|
+
}
|
|
335
|
+
function DecoratorChildren(props) {
|
|
336
|
+
return /* @__PURE__ */ React.createElement(Decorators, { block: props.block, decorators: props.otherDecorators });
|
|
337
|
+
}
|
|
338
|
+
function InlineCode(props) {
|
|
339
|
+
const attributes = getAttributes(props);
|
|
340
|
+
return /* @__PURE__ */ React.createElement("code", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(InlineCode.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
341
|
+
}
|
|
342
|
+
InlineCode.Children = DecoratorChildren;
|
|
343
|
+
function Delete(props) {
|
|
344
|
+
const attributes = getAttributes(props);
|
|
345
|
+
return /* @__PURE__ */ React.createElement("del", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Delete.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
346
|
+
}
|
|
347
|
+
Delete.Children = DecoratorChildren;
|
|
348
|
+
function Emphasis(props) {
|
|
349
|
+
const attributes = getAttributes(props);
|
|
350
|
+
return /* @__PURE__ */ React.createElement("em", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Emphasis.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
351
|
+
}
|
|
352
|
+
Emphasis.Children = DecoratorChildren;
|
|
353
|
+
function Insert(props) {
|
|
354
|
+
const attributes = getAttributes(props);
|
|
355
|
+
return /* @__PURE__ */ React.createElement("ins", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Insert.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
356
|
+
}
|
|
357
|
+
Insert.Children = DecoratorChildren;
|
|
358
|
+
function Keyboard(props) {
|
|
359
|
+
const attributes = getAttributes(props);
|
|
360
|
+
return /* @__PURE__ */ React.createElement("kbd", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Keyboard.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
361
|
+
}
|
|
362
|
+
Keyboard.Children = DecoratorChildren;
|
|
363
|
+
function LineBreak(props) {
|
|
364
|
+
const attributes = getAttributes(props);
|
|
365
|
+
return /* @__PURE__ */ React.createElement("br", __spreadValues({}, attributes));
|
|
366
|
+
}
|
|
367
|
+
LineBreak.Children = function(props) {
|
|
368
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
369
|
+
};
|
|
370
|
+
function Mark(props) {
|
|
371
|
+
const attributes = getAttributes(props);
|
|
372
|
+
return /* @__PURE__ */ React.createElement("mark", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Mark.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
373
|
+
}
|
|
374
|
+
Mark.Children = DecoratorChildren;
|
|
375
|
+
function Strong(props) {
|
|
376
|
+
const attributes = getAttributes(props);
|
|
377
|
+
return /* @__PURE__ */ React.createElement("strong", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Strong.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
378
|
+
}
|
|
379
|
+
Strong.Children = DecoratorChildren;
|
|
380
|
+
function Strikethrough(props) {
|
|
381
|
+
const attributes = getAttributes(props);
|
|
382
|
+
return /* @__PURE__ */ React.createElement("s", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Strikethrough.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
383
|
+
}
|
|
384
|
+
Strikethrough.Children = DecoratorChildren;
|
|
385
|
+
function Subscript(props) {
|
|
386
|
+
const attributes = getAttributes(props);
|
|
387
|
+
return /* @__PURE__ */ React.createElement("sub", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Subscript.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
388
|
+
}
|
|
389
|
+
Subscript.Children = DecoratorChildren;
|
|
390
|
+
function Superscript(props) {
|
|
391
|
+
const attributes = getAttributes(props);
|
|
392
|
+
return /* @__PURE__ */ React.createElement("sup", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Superscript.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
393
|
+
}
|
|
394
|
+
Superscript.Children = DecoratorChildren;
|
|
395
|
+
function Underline(props) {
|
|
396
|
+
const attributes = getAttributes(props);
|
|
397
|
+
return /* @__PURE__ */ React.createElement("u", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Underline.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
398
|
+
}
|
|
399
|
+
Underline.Children = DecoratorChildren;
|
|
400
|
+
function Variable(props) {
|
|
401
|
+
const attributes = getAttributes(props);
|
|
402
|
+
return /* @__PURE__ */ React.createElement("var", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Variable.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
403
|
+
}
|
|
404
|
+
Variable.Children = DecoratorChildren;
|
|
405
|
+
var BLOCK_RENDERERS = {
|
|
406
|
+
"_anchor": Anchor,
|
|
407
|
+
"_code": CodeWithCaption,
|
|
408
|
+
"_component": Component,
|
|
409
|
+
"_divider": Divider,
|
|
410
|
+
"_fragment": Fragment,
|
|
411
|
+
"_heading": Heading,
|
|
412
|
+
"_image": ImageWithCaption,
|
|
413
|
+
"_inlineEntry": InlineEntry,
|
|
414
|
+
"_link": Link,
|
|
415
|
+
"_list": List,
|
|
416
|
+
"_listItem": ListItem,
|
|
417
|
+
"_panel": Panel,
|
|
418
|
+
"_paragraph": Paragraph,
|
|
419
|
+
"_quote": Quote,
|
|
420
|
+
"_table": Table,
|
|
421
|
+
"_tableBody": TableBody,
|
|
422
|
+
"_tableCaption": TableCaption,
|
|
423
|
+
"_tableCell": TableCell,
|
|
424
|
+
"_tableFooter": TableFooter,
|
|
425
|
+
"_tableHeader": TableHeader,
|
|
426
|
+
"_tableHeaderCell": TableHeaderCell,
|
|
427
|
+
"_tableRow": TableRow
|
|
428
|
+
};
|
|
429
|
+
var DECORATOR_RENDERERS = {
|
|
430
|
+
"code": InlineCode,
|
|
431
|
+
"delete": Delete,
|
|
432
|
+
"emphasis": Emphasis,
|
|
433
|
+
"insert": Insert,
|
|
434
|
+
"keyboard": Keyboard,
|
|
435
|
+
"linebreak": LineBreak,
|
|
436
|
+
"mark": Mark,
|
|
437
|
+
"strikethrough": Strikethrough,
|
|
438
|
+
"strong": Strong,
|
|
439
|
+
"subscript": Subscript,
|
|
440
|
+
"superscript": Superscript,
|
|
441
|
+
"underline": Underline,
|
|
442
|
+
"variable": Variable
|
|
443
|
+
};
|
|
444
|
+
export {
|
|
445
|
+
Anchor,
|
|
446
|
+
Code,
|
|
447
|
+
Component,
|
|
448
|
+
Delete,
|
|
449
|
+
Divider,
|
|
450
|
+
Emphasis,
|
|
451
|
+
Fragment,
|
|
452
|
+
Heading,
|
|
453
|
+
Image,
|
|
454
|
+
InlineCode,
|
|
455
|
+
InlineEntry,
|
|
456
|
+
Insert,
|
|
457
|
+
Keyboard,
|
|
458
|
+
LineBreak,
|
|
459
|
+
Link,
|
|
460
|
+
List,
|
|
461
|
+
ListItem,
|
|
462
|
+
Mark,
|
|
463
|
+
Panel,
|
|
464
|
+
Paragraph,
|
|
465
|
+
Quote,
|
|
466
|
+
RenderChildren,
|
|
467
|
+
RenderContextProvider,
|
|
468
|
+
Renderer,
|
|
469
|
+
RendererContext,
|
|
470
|
+
Strikethrough,
|
|
471
|
+
Strong,
|
|
472
|
+
Subscript,
|
|
473
|
+
Superscript,
|
|
474
|
+
Table,
|
|
475
|
+
TableBody,
|
|
476
|
+
TableCaption,
|
|
477
|
+
TableCell,
|
|
478
|
+
TableFooter,
|
|
479
|
+
TableHeader,
|
|
480
|
+
TableHeaderCell,
|
|
481
|
+
TableRow,
|
|
482
|
+
Underline,
|
|
483
|
+
Variable
|
|
484
|
+
};
|
|
485
|
+
//# sourceMappingURL=canvas-react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/renderer.tsx"],"sourcesContent":["import React, { ClassType, ComponentClass, FunctionComponent, Component as ReactComponent, createContext, useContext } from 'react';\nimport {\n AnchorBlock,\n Block,\n CodeBlock,\n ComponentBlock,\n DecoratorType,\n DividerBlock,\n FragmentBlock,\n HeadingBlock,\n ImageBlock,\n InlineEntryBlock,\n LinkBlock,\n ListBlock,\n ListItemBlock,\n PanelBlock,\n ParagraphBlock,\n QuoteBlock,\n TableBlock,\n TableBodyBlock,\n TableCaptionBlock, TableCellBlock,\n TableFooterBlock,\n TableHeaderBlock,\n TableHeaderCellBlock,\n TableRowBlock\n} from '@contensis/canvas-types';\n\ntype Attributes = Record<string, any>;\ntype WithChildren = { children?: JSX.Element | undefined };\n\ntype RendererProps = { data: Block[] };\ntype RenderBlocksProps = { blocks: Block[] };\ntype RenderBlockProps<T extends Block> = { block: T };\ntype RenderBlockPropsWithChildren<T extends Block>\n = RenderBlockProps<T> & WithChildren & Attributes;\n\ntype RenderContentsProps = { contents: undefined | JSX.Element, fallback: JSX.Element };\ntype RenderTextProps = { text: string };\n\ntype DecoratorProps = { block: FragmentBlock, decorators: undefined | DecoratorType[] };\n\ntype TypedBlock<TType extends Block['type']> = Extract<Block, { type: TType }>;\n\ntype Renderer<TProps> = FunctionComponent<TProps> | ClassType<TProps, ReactComponent<TProps>, ComponentClass<TProps>>;\n\ntype BlockRenderer<T extends Block> = Renderer<RenderBlockPropsWithChildren<T>>;\ntype BlockRenderers = {\n [TType in Block['type']]: BlockRenderer<TypedBlock<TType>>\n};\n\n\ntype RenderDecoratorProps = { block: FragmentBlock, decorator: undefined | DecoratorType, otherDecorators: undefined | DecoratorType[] };\ntype RenderDecoratorPropsWithChildren = RenderDecoratorProps & WithChildren & Attributes;\n\ntype DecoratorRenderer = Renderer<RenderDecoratorPropsWithChildren>;\ntype DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;\n\ntype ComponentRenderer = Renderer<RenderBlockPropsWithChildren<ComponentBlock>>;\ntype ComponentRenderers = Record<string, ComponentRenderer>;\n\ntype RendererContextValue = {\n blocks?: BlockRenderers,\n decorators?: DecoratorRenderers,\n components?: ComponentRenderers\n};\n\ntype RendererOverridesContextValue = {\n blocks?: Partial<BlockRenderers>,\n decorators?: Partial<DecoratorRenderers>,\n components?: ComponentRenderers\n};\n\ntype RendererContextProviderProps = WithChildren & RendererOverridesContextValue;\n\nexport type { BlockRenderer, RenderBlockProps, RenderBlockPropsWithChildren, RenderDecoratorProps, RenderDecoratorPropsWithChildren };\n\nexport const RendererContext = createContext<RendererContextValue>({});\n\n/** \n * Provides context to the <Renderer> component to return Canvas data as React components\n *\n * @link https://www.npmjs.com/package/@contensis/canvas-react#usage\n *\n * @param blocks - Override the default rendering of Canvas content blocks\n * @param components - Render method for Contensis Components within the Canvas field\n * @param decorators - Override the rendering of HTML elements within a text field\n * \n * @example \n * <RenderContextProvider blocks={{ _table: Table }} components={{ banner: Banner }} decorators={{ strong: Strong }}>\n * <Renderer data={data} />\n * </RenderContextProvider>\n * \n */\nexport function RenderContextProvider(props: RendererContextProviderProps) {\n\n const overrideBlocks = props.blocks;\n const blocks = Object.keys(BLOCK_RENDERERS)\n .reduce((prev, type) => {\n const blockType = type as Block['type'];\n const renderer: any = overrideBlocks?.[blockType] || BLOCK_RENDERERS[blockType];\n (prev as any)[blockType] = renderer;\n return prev;\n }, {} as BlockRenderers);\n\n const overrideDecorators = props.decorators;\n const decorators = Object.keys(DECORATOR_RENDERERS)\n .reduce((prev, type) => {\n const decoratorType = type as DecoratorType;\n prev[decoratorType] = overrideDecorators?.[decoratorType] || DECORATOR_RENDERERS[decoratorType];\n return prev;\n }, {} as DecoratorRenderers);\n\n const value = { blocks, decorators, components: props.components };\n\n return (\n <RendererContext.Provider value={value}>\n {props.children}\n </RendererContext.Provider>\n );\n}\n\nfunction useBlocks() {\n const value = useContext(RendererContext);\n return value.blocks || BLOCK_RENDERERS;\n}\n\nfunction useDecorators() {\n const value = useContext(RendererContext);\n return value.decorators || DECORATOR_RENDERERS;\n}\n\nfunction useComponents() {\n const value = useContext(RendererContext);\n return value.components || {};\n}\n\nfunction RenderBlock<TBlock extends Block>(props: RenderBlockProps<TBlock>) {\n const blocks = useBlocks();\n const Component = blocks[props.block.type] as BlockRenderer<TBlock>;\n return (<Component block={props.block} />);\n}\n\nfunction RenderBlocks(props: RenderBlocksProps) {\n return (<>{props.blocks.map(block => <RenderBlock block={block} key={block.id} />)}</>);\n}\n\nfunction RenderContents(props: RenderContentsProps) {\n return (props.contents ? props.contents : props.fallback);\n}\n\nexport function RenderChildren(props: RenderBlockProps<Block>) {\n const isArray = Array.isArray(props.block?.value);\n const isString = typeof props.block?.value === 'string';\n\n const render = () => {\n if (isArray) {\n return (<RenderBlocks blocks={props.block.value as any} />);\n } else if (isString) {\n return (<RenderText text={props.block.value as any} />);\n } else {\n return (<RenderText text={''} />);\n }\n };\n\n return render();\n};\n\nfunction RenderText(props: RenderTextProps) {\n return (<>{props.text}</>);\n};\n\n/** \n * The default render method for processing Canvas data \n * \n * @link https://www.npmjs.com/package/@contensis/canvas-react#usage\n * \n * @param data - Accepts Canvas data\n * \n * */\nexport function Renderer(props: RendererProps) {\n return (<RenderBlocks blocks={props.data} />);\n}\n\ntype AttributeProps = RenderBlockProps<Block>\n | RenderBlockPropsWithChildren<Block>\n | RenderDecoratorProps\n | RenderDecoratorPropsWithChildren;\n\nfunction getAttributes(props: AttributeProps, extra: Record<string, any> = {}) {\n const { block, ...rest } = props;\n let { children, decorator, otherDecorators, ...attributes } = rest as Record<string, any>;\n attributes = {\n id: block?.properties?.id,\n ...extra,\n ...attributes\n };\n return attributes;\n}\n\nfunction WithCaption(props: WithChildren & { caption: undefined | string }) {\n return (\n !!props.caption\n ? (\n <figure>\n {props.children}\n <figcaption>{props.caption}</figcaption>\n </figure>\n )\n : (props.children || null)\n );\n};\n\nfunction RenderBlockChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<RenderChildren block={props.block} />);\n };\n}\n\nfunction EmptyChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<></>);\n };\n}\n\nexport function Anchor(props: RenderBlockPropsWithChildren<AnchorBlock>) {\n const attributes = getAttributes(props);\n return (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Anchor.Children block={props.block} />} />\n </a>\n );\n}\n\nAnchor.Children = RenderBlockChildrenFactory<AnchorBlock>();\n\nexport function Code(props: RenderBlockPropsWithChildren<CodeBlock>) {\n const attributes = getAttributes(props, {\n 'data-language': props.block?.value?.language\n });\n const codeAttributes = getAttributes(props, {\n className: `language-${props.block?.value?.language}`\n });\n return (\n <pre {...attributes}>\n <code {...codeAttributes}>\n <RenderContents contents={props.children} fallback={<Code.Children block={props.block} />} />\n </code>\n </pre>\n );\n}\n\nCode.Children = function (props: RenderBlockProps<CodeBlock>) {\n return (<>{props.block?.value?.code}</>);\n};\n\nfunction CodeWithCaption(props: RenderBlockPropsWithChildren<CodeBlock>) {\n return (\n <WithCaption caption={props.block?.value?.caption}>\n <Code {...props} />\n </WithCaption>\n );\n}\n\nexport function Component(props: RenderBlockPropsWithChildren<ComponentBlock>) {\n const component = props?.block.properties?.component;\n const components = useComponents();\n const ComponentElement = !!component ? components?.[component] : undefined;\n\n const value = props.block.value ? JSON.stringify(props.block.value) : '';\n const attributes = getAttributes(props, {\n className: 'component',\n 'data-component': props.block.properties?.component,\n 'data-component-value': value,\n });\n\n return (!!ComponentElement)\n ? (<ComponentElement {...props} />)\n : (\n <div {...attributes}>\n <RenderContents contents={props.children} fallback={<Component.Children block={props.block} />} />\n </div>\n );\n}\n\nComponent.Children = function (props: RenderBlockProps<ComponentBlock>) {\n return (<>Component: {props.block?.properties?.component}</>);\n};\n\nexport function Divider(props: RenderBlockPropsWithChildren<DividerBlock>) {\n const attributes = getAttributes(props);\n return (<hr {...attributes} />);\n}\n\nDivider.Children = EmptyChildrenFactory<DividerBlock>();\n\nexport function Fragment(props: RenderBlockPropsWithChildren<FragmentBlock>) {\n const hasDecorators = !!props.block?.properties?.decorators?.length;\n const decorators = props.block?.properties?.decorators;\n return (\n hasDecorators\n ? (<Decorators block={props.block} decorators={decorators}></Decorators>)\n : (<RenderContents contents={props.children} fallback={<Fragment.Children block={props.block} />} />)\n );\n}\n\nFragment.Children = RenderBlockChildrenFactory<FragmentBlock>();\n\nexport function Heading(props: RenderBlockPropsWithChildren<HeadingBlock>) {\n const attributes = getAttributes(props);\n const render = () => {\n switch (props?.block?.properties?.level) {\n case 2: {\n return (\n <h2 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h2>\n );\n }\n case 3: {\n return (\n <h3 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h3>\n );\n }\n case 4: {\n return (\n <h4 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h4>\n );\n }\n case 5: {\n return (\n <h5 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h5>\n );\n }\n case 6: {\n return (\n <h6 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h6>\n );\n }\n default: {\n return (\n <h1 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h1>\n );\n }\n }\n };\n return render();\n}\n\nHeading.Children = RenderBlockChildrenFactory<HeadingBlock>();\n\nexport function Image(props: RenderBlockPropsWithChildren<ImageBlock>) {\n const src = props.block?.value?.asset?.sys?.uri;\n const attributes = getAttributes(props, {\n src,\n alt: props.block?.value?.altText,\n title: props?.block?.value?.caption,\n });\n return (<img {...attributes} />);\n}\n\nImage.Children = EmptyChildrenFactory<ImageBlock>();\n\nfunction ImageWithCaption(props: RenderBlockPropsWithChildren<ImageBlock>) {\n return (\n <WithCaption caption={props.block?.value?.caption}>\n <Image {...props} />\n </WithCaption>\n );\n}\n\nexport function InlineEntry(props: RenderBlockPropsWithChildren<InlineEntryBlock>) {\n const href = props?.block?.value?.sys?.uri;\n const attributes = getAttributes(props, {\n href\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />)\n );\n}\n\nInlineEntry.Children = function (props: RenderBlockProps<InlineEntryBlock>) {\n const entryTitle = props?.block?.value?.entryTitle || '';\n return (<>{entryTitle}</>);\n};\n\nexport function Link(props: RenderBlockPropsWithChildren<LinkBlock>) {\n const linkValue = props?.block?.properties?.link;\n const attributes = getAttributes(props, {\n href: linkValue?.sys?.uri,\n target: props?.block?.properties?.newTab ? '_blank' : null,\n rel: props?.block?.properties?.newTab ? 'noopener noreferrer' : null\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />)\n );\n}\n\nLink.Children = RenderBlockChildrenFactory<LinkBlock>();\n\nexport function List(props: RenderBlockPropsWithChildren<ListBlock>) {\n const isOrdered = (props.block?.properties?.listType === 'ordered');\n const attributes = getAttributes(props, {\n start: isOrdered ? props.block?.properties?.start : null,\n });\n return (isOrdered\n ? (\n <ol {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ol>\n )\n : (\n <ul {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ul>\n )\n );\n}\n\nList.Children = RenderBlockChildrenFactory<ListBlock>();\n\nexport function ListItem(props: RenderBlockPropsWithChildren<ListItemBlock>) {\n const attributes = getAttributes(props);\n return (\n <li {...attributes}>\n <RenderContents contents={props.children} fallback={<ListItem.Children block={props.block} />} />\n </li>\n );\n}\n\nListItem.Children = RenderBlockChildrenFactory<ListItemBlock>();\n\nexport function Panel(props: RenderBlockPropsWithChildren<PanelBlock>) {\n const attributes = getAttributes(props, {\n className: ['panel', props.block?.properties?.panelType || 'info'].join(' ')\n });\n return (\n <aside {...attributes}>\n <RenderContents contents={props.children} fallback={<Panel.Children block={props.block} />} />\n </aside>\n );\n}\n\nPanel.Children = RenderBlockChildrenFactory<PanelBlock>();\n\nexport function Paragraph(props: RenderBlockPropsWithChildren<ParagraphBlock>) {\n const attributes = getAttributes(props, {\n className: props.block?.properties?.paragraphType\n });\n return (\n <p {...attributes}>\n <RenderContents contents={props.children} fallback={<Paragraph.Children block={props.block} />} />\n </p>\n );\n}\n\nParagraph.Children = RenderBlockChildrenFactory<ParagraphBlock>();\n\n\nexport function Quote(props: RenderBlockPropsWithChildren<QuoteBlock>) {\n const attributes = getAttributes(props, {\n 'cite': props.block?.properties?.url\n });\n return (\n <blockquote {...attributes}>\n <RenderContents contents={props.children} fallback={<Quote.Children block={props.block} />} />\n </blockquote>\n );\n}\n\nQuote.Children = function (props: RenderBlockProps<QuoteBlock>) {\n const source = props.block?.properties?.source;\n const citation = props.block?.properties?.citation;\n const hasChildren = !!source || !!citation;\n return (\n hasChildren\n ? (\n <>\n <p>\n <RenderChildren block={props.block} />\n </p>\n <footer>{source} {!!citation ? (<cite>{citation}</cite>) : (<></>)}</footer>\n </>\n )\n : (<RenderChildren block={props.block} />)\n );\n // return (<RenderChildren block={props.block} />);\n // return (\n // <Show when={hasChildren()} fallback={<RenderChildren block={props.block} />}>\n // <p>\n // <RenderChildren block={props.block} />\n // </p>\n // <Show when={citation()} fallback={<footer>{source()}</footer>}>\n // <footer>{source()} <cite>{citation()}</cite></footer>\n // </Show>\n // </Show>\n // );\n};\n\n\nexport function Table(props: RenderBlockPropsWithChildren<TableBlock>) {\n const attributes = getAttributes(props);\n return (\n <table {...attributes}>\n <RenderContents contents={props.children} fallback={<Table.Children block={props.block} />} />\n </table>\n );\n}\n\nTable.Children = RenderBlockChildrenFactory<TableBlock>();\n\nexport function TableBody(props: RenderBlockPropsWithChildren<TableBodyBlock>) {\n const attributes = getAttributes(props);\n return (\n <tbody {...attributes}>\n <RenderContents contents={props.children} fallback={<TableBody.Children block={props.block} />} />\n </tbody>\n );\n}\n\nTableBody.Children = RenderBlockChildrenFactory<TableBodyBlock>();\n\nexport function TableCaption(props: RenderBlockPropsWithChildren<TableCaptionBlock>) {\n const attributes = getAttributes(props);\n return (\n <caption {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCaption.Children block={props.block} />} />\n </caption>\n );\n}\n\nTableCaption.Children = RenderBlockChildrenFactory<TableCaptionBlock>();\n\nexport function TableCell(props: RenderBlockPropsWithChildren<TableCellBlock>) {\n const attributes = getAttributes(props);\n return (\n <td {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCell.Children block={props.block} />} />\n </td>\n );\n}\n\nTableCell.Children = RenderBlockChildrenFactory<TableCellBlock>();\n\nexport function TableFooter(props: RenderBlockPropsWithChildren<TableFooterBlock>) {\n const attributes = getAttributes(props);\n return (\n <tfoot {...attributes}>\n <RenderContents contents={props.children} fallback={<TableFooter.Children block={props.block} />} />\n </tfoot>\n );\n}\n\nTableFooter.Children = RenderBlockChildrenFactory<TableFooterBlock>();\n\nexport function TableHeader(props: RenderBlockPropsWithChildren<TableHeaderBlock>) {\n const attributes = getAttributes(props);\n return (\n <thead {...attributes}>\n <RenderContents contents={props.children} fallback={<TableHeader.Children block={props.block} />} />\n </thead>\n );\n}\n\nTableHeader.Children = RenderBlockChildrenFactory<TableHeaderBlock>();\n\nexport function TableHeaderCell(props: RenderBlockPropsWithChildren<TableHeaderCellBlock>) {\n const attributes = getAttributes(props);\n return (\n <th {...attributes}>\n <RenderContents contents={props.children} fallback={<TableHeaderCell.Children block={props.block} />} />\n </th>\n );\n}\n\nTableHeaderCell.Children = RenderBlockChildrenFactory<TableHeaderCellBlock>();\n\nexport function TableRow(props: RenderBlockPropsWithChildren<TableRowBlock>) {\n const attributes = getAttributes(props);\n return (\n <tr {...attributes}>\n <RenderContents contents={props.children} fallback={<TableRow.Children block={props.block} />} />\n </tr>\n );\n}\n\nTableRow.Children = RenderBlockChildrenFactory<TableRowBlock>();\n\n\nfunction Decorators(props: DecoratorProps) {\n const decorators = useDecorators();\n const remainingDecorators = !!props.decorators ? [...props.decorators] : undefined;\n const firstDecorator = !!remainingDecorators ? remainingDecorators.shift() : undefined;\n const DecoratorComponent = !!firstDecorator ? decorators[firstDecorator] : undefined;\n\n const render = () => {\n if (!!DecoratorComponent) {\n return (<DecoratorComponent block={props.block} decorator={firstDecorator} otherDecorators={remainingDecorators} />);\n } else if (firstDecorator) {\n return (<Decorators block={props.block} decorators={remainingDecorators} />);\n } else {\n return (<Fragment.Children block={props.block} />);\n }\n };\n\n return render();\n}\n\nfunction DecoratorChildren(props: RenderDecoratorPropsWithChildren) {\n return (<Decorators block={props.block} decorators={props.otherDecorators} />)\n}\n\nexport function InlineCode(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <code {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineCode.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </code>\n );\n}\n\nInlineCode.Children = DecoratorChildren;\n\nexport function Delete(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <del {...attributes}>\n <RenderContents contents={props.children} fallback={<Delete.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </del>\n );\n}\n\nDelete.Children = DecoratorChildren;\n\nexport function Emphasis(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <em {...attributes}>\n <RenderContents contents={props.children} fallback={<Emphasis.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </em>\n );\n}\n\nEmphasis.Children = DecoratorChildren;\n\nexport function Insert(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <ins {...attributes}>\n <RenderContents contents={props.children} fallback={<Insert.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </ins>\n );\n}\n\nInsert.Children = DecoratorChildren;\n\nexport function Keyboard(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <kbd {...attributes}>\n <RenderContents contents={props.children} fallback={<Keyboard.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </kbd>\n );\n}\n\nKeyboard.Children = DecoratorChildren;\n\nexport function LineBreak(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (<br {...attributes} />);\n}\n\nLineBreak.Children = function (props: RenderDecoratorPropsWithChildren) {\n return (<></>)\n}\n\nexport function Mark(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <mark {...attributes}>\n <RenderContents contents={props.children} fallback={<Mark.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </mark>\n );\n}\n\nMark.Children = DecoratorChildren;\n\nexport function Strong(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <strong {...attributes}>\n <RenderContents contents={props.children} fallback={<Strong.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </strong>\n );\n}\n\nStrong.Children = DecoratorChildren;\n\nexport function Strikethrough(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <s {...attributes}>\n <RenderContents contents={props.children} fallback={<Strikethrough.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </s>\n );\n}\n\nStrikethrough.Children = DecoratorChildren;\n\nexport function Subscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sub {...attributes}>\n <RenderContents contents={props.children} fallback={<Subscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sub>\n );\n}\n\nSubscript.Children = DecoratorChildren;\n\nexport function Superscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sup {...attributes}>\n <RenderContents contents={props.children} fallback={<Superscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sup>\n );\n}\n\nSuperscript.Children = DecoratorChildren;\n\nexport function Underline(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <u {...attributes}>\n <RenderContents contents={props.children} fallback={<Underline.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </u>\n );\n}\n\nUnderline.Children = DecoratorChildren;\n\nexport function Variable(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <var {...attributes}>\n <RenderContents contents={props.children} fallback={<Variable.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </var>\n );\n}\n\nVariable.Children = DecoratorChildren;\n\n\nconst BLOCK_RENDERERS: BlockRenderers = {\n '_anchor': Anchor,\n '_code': CodeWithCaption,\n '_component': Component,\n '_divider': Divider,\n '_fragment': Fragment,\n '_heading': Heading,\n '_image': ImageWithCaption,\n '_inlineEntry': InlineEntry,\n '_link': Link,\n '_list': List,\n '_listItem': ListItem,\n '_panel': Panel,\n '_paragraph': Paragraph,\n '_quote': Quote,\n '_table': Table,\n '_tableBody': TableBody,\n '_tableCaption': TableCaption,\n '_tableCell': TableCell,\n '_tableFooter': TableFooter,\n '_tableHeader': TableHeader,\n '_tableHeaderCell': TableHeaderCell,\n '_tableRow': TableRow,\n};\n\nconst DECORATOR_RENDERERS: DecoratorRenderers = {\n 'code': InlineCode,\n 'delete': Delete,\n 'emphasis': Emphasis,\n 'insert': Insert,\n 'keyboard': Keyboard,\n 'linebreak': LineBreak,\n 'mark': Mark,\n 'strikethrough': Strikethrough,\n 'strong': Strong,\n 'subscript': Subscript,\n 'superscript': Superscript,\n 'underline': Underline,\n 'variable': Variable\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,SAAoF,eAAe,kBAAkB;AA4ErH,IAAM,kBAAkB,cAAoC,CAAC,CAAC;AAiB9D,SAAS,sBAAsB,OAAqC;AAEvE,QAAM,iBAAiB,MAAM;AAC7B,QAAM,SAAS,OAAO,KAAK,eAAe,EACrC,OAAO,CAAC,MAAM,SAAS;AACpB,UAAM,YAAY;AAClB,UAAM,YAAgB,iDAAiB,eAAc,gBAAgB,SAAS;AAC9E,IAAC,KAAa,SAAS,IAAI;AAC3B,WAAO;AAAA,EACX,GAAG,CAAC,CAAmB;AAE3B,QAAM,qBAAqB,MAAM;AACjC,QAAM,aAAa,OAAO,KAAK,mBAAmB,EAC7C,OAAO,CAAC,MAAM,SAAS;AACpB,UAAM,gBAAgB;AACtB,SAAK,aAAa,KAAI,yDAAqB,mBAAkB,oBAAoB,aAAa;AAC9F,WAAO;AAAA,EACX,GAAG,CAAC,CAAuB;AAE/B,QAAM,QAAQ,EAAE,QAAQ,YAAY,YAAY,MAAM,WAAW;AAEjE,SACI,oCAAC,gBAAgB,UAAhB,EAAyB,SACrB,MAAM,QACX;AAER;AAEA,SAAS,YAAY;AACjB,QAAM,QAAQ,WAAW,eAAe;AACxC,SAAO,MAAM,UAAU;AAC3B;AAEA,SAAS,gBAAgB;AACrB,QAAM,QAAQ,WAAW,eAAe;AACxC,SAAO,MAAM,cAAc;AAC/B;AAEA,SAAS,gBAAgB;AACrB,QAAM,QAAQ,WAAW,eAAe;AACxC,SAAO,MAAM,cAAc,CAAC;AAChC;AAEA,SAAS,YAAkC,OAAiC;AACxE,QAAM,SAAS,UAAU;AACzB,QAAMA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B,GAAI,CACxK;AAER;AAEA,UAAU,WAAW;AAEd,SAAS,SAAS,OAAyC;AAC9D,QAAM,aAAa,cAAc,KAAK;AACtC,SACI,oCAAC,0BAAQ,aACL,oCAAC,kBAAe,UAAU,MAAM,UAAU,UAAU,oCAAC,SAAS,UAAT,EAAkB,OAAO,MAAM,OAAO,WAAW,MAAM,WAAW,iBAAiB,MAAM,iBAAiB,GAAI,CACvK;AAER;AAEA,SAAS,WAAW;AAGpB,IAAM,kBAAkC;AAAA,EACpC,WAAW;AAAA,EACX,SAAS;AAAA,EACT,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,EACV,cAAc;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,aAAa;AACjB;AAEA,IAAM,sBAA0C;AAAA,EAC5C,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAChB;","names":["Component"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contensis/canvas-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Render canvas content with React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contensis",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "ISC",
|
|
22
22
|
"main": "dist/canvas-react.js",
|
|
23
|
-
"module": "dist/canvas-react.
|
|
23
|
+
"module": "dist/esm/canvas-react.js",
|
|
24
24
|
"types": "dist/canvas-react.d.ts",
|
|
25
25
|
"files": [
|
|
26
26
|
"dist"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"exports": {
|
|
44
44
|
".": {
|
|
45
45
|
"require": "./dist/canvas-react.js",
|
|
46
|
-
"import": "./dist/canvas-react.
|
|
46
|
+
"import": "./dist/esm/canvas-react.js",
|
|
47
47
|
"types": "./dist/canvas-react.d.ts"
|
|
48
48
|
}
|
|
49
49
|
}
|