@contensis/canvas-react 1.0.6 → 1.2.0
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 +33 -2
- package/dist/canvas-react.d.ts +33 -2
- package/dist/canvas-react.js +20 -1
- package/dist/canvas-react.js.map +1 -1
- package/dist/{esm/canvas-react.js → canvas-react.mjs} +19 -2
- package/dist/canvas-react.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/esm/canvas-react.js.map +0 -1
package/dist/canvas-react.d.mts
CHANGED
|
@@ -98,7 +98,7 @@ type LinkSys = EntrySys & {
|
|
|
98
98
|
node?: Node;
|
|
99
99
|
};
|
|
100
100
|
type Link$1 = BaseEntry<LinkSys>;
|
|
101
|
-
type Block = AnchorBlock | CodeBlock | ComponentBlock | DividerBlock | FragmentBlock | HeadingBlock | ImageBlock | InlineEntryBlock | LinkBlock | ListBlock | ListItemBlock | PanelBlock | ParagraphBlock | QuoteBlock | TableBlock | TableBodyBlock | TableCaptionBlock | TableCellBlock | TableFooterBlock | TableHeaderBlock | TableHeaderCellBlock | TableRowBlock;
|
|
101
|
+
type Block = AnchorBlock | CodeBlock | ComponentBlock | DividerBlock | FormContentTypeBlock | FragmentBlock | HeadingBlock | ImageBlock | InlineEntryBlock | LinkBlock | LiquidBlock | ListBlock | ListItemBlock | PanelBlock | ParagraphBlock | QuoteBlock | TableBlock | TableBodyBlock | TableCaptionBlock | TableCellBlock | TableFooterBlock | TableHeaderBlock | TableHeaderCellBlock | TableRowBlock;
|
|
102
102
|
type AnchorBlock = {
|
|
103
103
|
type: '_anchor';
|
|
104
104
|
id: string;
|
|
@@ -136,6 +136,19 @@ type DividerBlock = {
|
|
|
136
136
|
id?: string;
|
|
137
137
|
};
|
|
138
138
|
};
|
|
139
|
+
type FormContentType$1 = {
|
|
140
|
+
id: string;
|
|
141
|
+
};
|
|
142
|
+
type FormContentTypeBlock = {
|
|
143
|
+
type: '_formContentType';
|
|
144
|
+
id: string;
|
|
145
|
+
properties?: {
|
|
146
|
+
id?: string;
|
|
147
|
+
};
|
|
148
|
+
value?: {
|
|
149
|
+
contentType?: FormContentType$1;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
139
152
|
type FragmentBlock = {
|
|
140
153
|
type: '_fragment';
|
|
141
154
|
id: string;
|
|
@@ -180,6 +193,16 @@ type LinkBlock = {
|
|
|
180
193
|
newTab?: boolean;
|
|
181
194
|
};
|
|
182
195
|
};
|
|
196
|
+
type LiquidType = 'tag' | 'variable';
|
|
197
|
+
type LiquidBlock = {
|
|
198
|
+
type: '_liquid';
|
|
199
|
+
id: string;
|
|
200
|
+
value?: string;
|
|
201
|
+
properties?: {
|
|
202
|
+
id?: string;
|
|
203
|
+
type?: LiquidType;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
183
206
|
type ListType = 'ordered' | 'unordered';
|
|
184
207
|
type ListBlock = {
|
|
185
208
|
type: '_list';
|
|
@@ -379,6 +402,10 @@ declare function Divider(props: RenderBlockPropsWithChildren<DividerBlock>): Rea
|
|
|
379
402
|
declare namespace Divider {
|
|
380
403
|
var Children: (props: RenderBlockProps<DividerBlock>) => React.JSX.Element;
|
|
381
404
|
}
|
|
405
|
+
declare function FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>): null;
|
|
406
|
+
declare namespace FormContentType {
|
|
407
|
+
var Children: (_props: RenderBlockProps<FormContentTypeBlock>) => null;
|
|
408
|
+
}
|
|
382
409
|
declare function Fragment(props: RenderBlockPropsWithChildren<FragmentBlock>): React.JSX.Element;
|
|
383
410
|
declare namespace Fragment {
|
|
384
411
|
var Children: (props: RenderBlockProps<FragmentBlock>) => React.JSX.Element;
|
|
@@ -399,6 +426,10 @@ declare function Link(props: RenderBlockPropsWithChildren<LinkBlock>): React.JSX
|
|
|
399
426
|
declare namespace Link {
|
|
400
427
|
var Children: (props: RenderBlockProps<LinkBlock>) => React.JSX.Element;
|
|
401
428
|
}
|
|
429
|
+
declare function Liquid(props: RenderBlockPropsWithChildren<LiquidBlock>): React.JSX.Element;
|
|
430
|
+
declare namespace Liquid {
|
|
431
|
+
var Children: (props: RenderBlockProps<LiquidBlock>) => React.JSX.Element;
|
|
432
|
+
}
|
|
402
433
|
declare function List(props: RenderBlockPropsWithChildren<ListBlock>): React.JSX.Element;
|
|
403
434
|
declare namespace List {
|
|
404
435
|
var Children: (props: RenderBlockProps<ListBlock>) => React.JSX.Element;
|
|
@@ -505,4 +536,4 @@ declare namespace Variable {
|
|
|
505
536
|
var Children: typeof DecoratorChildren;
|
|
506
537
|
}
|
|
507
538
|
|
|
508
|
-
export { Anchor, type AnchorBlock, type Block, type BlockRenderer, Code, type CodeBlock, Component, type ComponentBlock, type DecoratorType, Delete, Divider, type DividerBlock, Emphasis, Fragment, type FragmentBlock, Heading, type HeadingBlock, Image, type ImageBlock, InlineCode, InlineEntry, type InlineEntryBlock, Insert, Keyboard, LineBreak, Link, type LinkBlock, List, type ListBlock, ListItem, type ListItemBlock, Mark, Panel, type PanelBlock, Paragraph, type ParagraphBlock, Quote, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, RenderChildren, RenderContextProvider, type RenderDecoratorProps, type RenderDecoratorPropsWithChildren, Renderer, RendererContext, Strikethrough, Strong, Subscript, Superscript, Table, type TableBlock, TableBody, type TableBodyBlock, TableCaption, type TableCaptionBlock, TableCell, type TableCellBlock, TableFooter, type TableFooterBlock, TableHeader, type TableHeaderBlock, TableHeaderCell, type TableHeaderCellBlock, TableRow, type TableRowBlock, Underline, Variable };
|
|
539
|
+
export { Anchor, type AnchorBlock, type Block, type BlockRenderer, Code, type CodeBlock, Component, type ComponentBlock, type DecoratorType, Delete, Divider, type DividerBlock, Emphasis, FormContentType, type FormContentTypeBlock, Fragment, type FragmentBlock, Heading, type HeadingBlock, Image, type ImageBlock, InlineCode, InlineEntry, type InlineEntryBlock, Insert, Keyboard, LineBreak, Link, type LinkBlock, Liquid, type LiquidBlock, List, type ListBlock, ListItem, type ListItemBlock, Mark, Panel, type PanelBlock, Paragraph, type ParagraphBlock, Quote, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, RenderChildren, RenderContextProvider, type RenderDecoratorProps, type RenderDecoratorPropsWithChildren, Renderer, RendererContext, Strikethrough, Strong, Subscript, Superscript, Table, type TableBlock, TableBody, type TableBodyBlock, TableCaption, type TableCaptionBlock, TableCell, type TableCellBlock, TableFooter, type TableFooterBlock, TableHeader, type TableHeaderBlock, TableHeaderCell, type TableHeaderCellBlock, TableRow, type TableRowBlock, Underline, Variable };
|
package/dist/canvas-react.d.ts
CHANGED
|
@@ -98,7 +98,7 @@ type LinkSys = EntrySys & {
|
|
|
98
98
|
node?: Node;
|
|
99
99
|
};
|
|
100
100
|
type Link$1 = BaseEntry<LinkSys>;
|
|
101
|
-
type Block = AnchorBlock | CodeBlock | ComponentBlock | DividerBlock | FragmentBlock | HeadingBlock | ImageBlock | InlineEntryBlock | LinkBlock | ListBlock | ListItemBlock | PanelBlock | ParagraphBlock | QuoteBlock | TableBlock | TableBodyBlock | TableCaptionBlock | TableCellBlock | TableFooterBlock | TableHeaderBlock | TableHeaderCellBlock | TableRowBlock;
|
|
101
|
+
type Block = AnchorBlock | CodeBlock | ComponentBlock | DividerBlock | FormContentTypeBlock | FragmentBlock | HeadingBlock | ImageBlock | InlineEntryBlock | LinkBlock | LiquidBlock | ListBlock | ListItemBlock | PanelBlock | ParagraphBlock | QuoteBlock | TableBlock | TableBodyBlock | TableCaptionBlock | TableCellBlock | TableFooterBlock | TableHeaderBlock | TableHeaderCellBlock | TableRowBlock;
|
|
102
102
|
type AnchorBlock = {
|
|
103
103
|
type: '_anchor';
|
|
104
104
|
id: string;
|
|
@@ -136,6 +136,19 @@ type DividerBlock = {
|
|
|
136
136
|
id?: string;
|
|
137
137
|
};
|
|
138
138
|
};
|
|
139
|
+
type FormContentType$1 = {
|
|
140
|
+
id: string;
|
|
141
|
+
};
|
|
142
|
+
type FormContentTypeBlock = {
|
|
143
|
+
type: '_formContentType';
|
|
144
|
+
id: string;
|
|
145
|
+
properties?: {
|
|
146
|
+
id?: string;
|
|
147
|
+
};
|
|
148
|
+
value?: {
|
|
149
|
+
contentType?: FormContentType$1;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
139
152
|
type FragmentBlock = {
|
|
140
153
|
type: '_fragment';
|
|
141
154
|
id: string;
|
|
@@ -180,6 +193,16 @@ type LinkBlock = {
|
|
|
180
193
|
newTab?: boolean;
|
|
181
194
|
};
|
|
182
195
|
};
|
|
196
|
+
type LiquidType = 'tag' | 'variable';
|
|
197
|
+
type LiquidBlock = {
|
|
198
|
+
type: '_liquid';
|
|
199
|
+
id: string;
|
|
200
|
+
value?: string;
|
|
201
|
+
properties?: {
|
|
202
|
+
id?: string;
|
|
203
|
+
type?: LiquidType;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
183
206
|
type ListType = 'ordered' | 'unordered';
|
|
184
207
|
type ListBlock = {
|
|
185
208
|
type: '_list';
|
|
@@ -379,6 +402,10 @@ declare function Divider(props: RenderBlockPropsWithChildren<DividerBlock>): Rea
|
|
|
379
402
|
declare namespace Divider {
|
|
380
403
|
var Children: (props: RenderBlockProps<DividerBlock>) => React.JSX.Element;
|
|
381
404
|
}
|
|
405
|
+
declare function FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>): null;
|
|
406
|
+
declare namespace FormContentType {
|
|
407
|
+
var Children: (_props: RenderBlockProps<FormContentTypeBlock>) => null;
|
|
408
|
+
}
|
|
382
409
|
declare function Fragment(props: RenderBlockPropsWithChildren<FragmentBlock>): React.JSX.Element;
|
|
383
410
|
declare namespace Fragment {
|
|
384
411
|
var Children: (props: RenderBlockProps<FragmentBlock>) => React.JSX.Element;
|
|
@@ -399,6 +426,10 @@ declare function Link(props: RenderBlockPropsWithChildren<LinkBlock>): React.JSX
|
|
|
399
426
|
declare namespace Link {
|
|
400
427
|
var Children: (props: RenderBlockProps<LinkBlock>) => React.JSX.Element;
|
|
401
428
|
}
|
|
429
|
+
declare function Liquid(props: RenderBlockPropsWithChildren<LiquidBlock>): React.JSX.Element;
|
|
430
|
+
declare namespace Liquid {
|
|
431
|
+
var Children: (props: RenderBlockProps<LiquidBlock>) => React.JSX.Element;
|
|
432
|
+
}
|
|
402
433
|
declare function List(props: RenderBlockPropsWithChildren<ListBlock>): React.JSX.Element;
|
|
403
434
|
declare namespace List {
|
|
404
435
|
var Children: (props: RenderBlockProps<ListBlock>) => React.JSX.Element;
|
|
@@ -505,4 +536,4 @@ declare namespace Variable {
|
|
|
505
536
|
var Children: typeof DecoratorChildren;
|
|
506
537
|
}
|
|
507
538
|
|
|
508
|
-
export { Anchor, type AnchorBlock, type Block, type BlockRenderer, Code, type CodeBlock, Component, type ComponentBlock, type DecoratorType, Delete, Divider, type DividerBlock, Emphasis, Fragment, type FragmentBlock, Heading, type HeadingBlock, Image, type ImageBlock, InlineCode, InlineEntry, type InlineEntryBlock, Insert, Keyboard, LineBreak, Link, type LinkBlock, List, type ListBlock, ListItem, type ListItemBlock, Mark, Panel, type PanelBlock, Paragraph, type ParagraphBlock, Quote, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, RenderChildren, RenderContextProvider, type RenderDecoratorProps, type RenderDecoratorPropsWithChildren, Renderer, RendererContext, Strikethrough, Strong, Subscript, Superscript, Table, type TableBlock, TableBody, type TableBodyBlock, TableCaption, type TableCaptionBlock, TableCell, type TableCellBlock, TableFooter, type TableFooterBlock, TableHeader, type TableHeaderBlock, TableHeaderCell, type TableHeaderCellBlock, TableRow, type TableRowBlock, Underline, Variable };
|
|
539
|
+
export { Anchor, type AnchorBlock, type Block, type BlockRenderer, Code, type CodeBlock, Component, type ComponentBlock, type DecoratorType, Delete, Divider, type DividerBlock, Emphasis, FormContentType, type FormContentTypeBlock, Fragment, type FragmentBlock, Heading, type HeadingBlock, Image, type ImageBlock, InlineCode, InlineEntry, type InlineEntryBlock, Insert, Keyboard, LineBreak, Link, type LinkBlock, Liquid, type LiquidBlock, List, type ListBlock, ListItem, type ListItemBlock, Mark, Panel, type PanelBlock, Paragraph, type ParagraphBlock, Quote, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, RenderChildren, RenderContextProvider, type RenderDecoratorProps, type RenderDecoratorPropsWithChildren, Renderer, RendererContext, Strikethrough, Strong, Subscript, Superscript, Table, type TableBlock, TableBody, type TableBodyBlock, TableCaption, type TableCaptionBlock, TableCell, type TableCellBlock, TableFooter, type TableFooterBlock, TableHeader, type TableHeaderBlock, TableHeaderCell, type TableHeaderCellBlock, TableRow, type TableRowBlock, Underline, Variable };
|
package/dist/canvas-react.js
CHANGED
|
@@ -62,6 +62,7 @@ __export(src_exports, {
|
|
|
62
62
|
Delete: () => Delete,
|
|
63
63
|
Divider: () => Divider,
|
|
64
64
|
Emphasis: () => Emphasis,
|
|
65
|
+
FormContentType: () => FormContentType,
|
|
65
66
|
Fragment: () => Fragment,
|
|
66
67
|
Heading: () => Heading,
|
|
67
68
|
Image: () => Image,
|
|
@@ -71,6 +72,7 @@ __export(src_exports, {
|
|
|
71
72
|
Keyboard: () => Keyboard,
|
|
72
73
|
LineBreak: () => LineBreak,
|
|
73
74
|
Link: () => Link,
|
|
75
|
+
Liquid: () => Liquid,
|
|
74
76
|
List: () => List,
|
|
75
77
|
ListItem: () => ListItem,
|
|
76
78
|
Mark: () => Mark,
|
|
@@ -133,7 +135,7 @@ function useComponents() {
|
|
|
133
135
|
function RenderBlock(props) {
|
|
134
136
|
const blocks = useBlocks();
|
|
135
137
|
const Component2 = blocks[props.block.type];
|
|
136
|
-
return /* @__PURE__ */ import_react.default.createElement(Component2, { block: props.block });
|
|
138
|
+
return !!Component2 ? /* @__PURE__ */ import_react.default.createElement(Component2, { block: props.block }) : null;
|
|
137
139
|
}
|
|
138
140
|
function RenderBlocks(props) {
|
|
139
141
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.blocks.map((block) => /* @__PURE__ */ import_react.default.createElement(RenderBlock, { block, key: block.id })));
|
|
@@ -229,6 +231,12 @@ function Divider(props) {
|
|
|
229
231
|
return /* @__PURE__ */ import_react.default.createElement("hr", __spreadValues({}, attributes));
|
|
230
232
|
}
|
|
231
233
|
Divider.Children = EmptyChildrenFactory();
|
|
234
|
+
function FormContentType(_props) {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
FormContentType.Children = function(_props) {
|
|
238
|
+
return null;
|
|
239
|
+
};
|
|
232
240
|
function Fragment(props) {
|
|
233
241
|
var _a, _b, _c, _d, _e;
|
|
234
242
|
const hasDecorators = !!((_c = (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.decorators) == null ? void 0 : _c.length);
|
|
@@ -303,6 +311,13 @@ function Link(props) {
|
|
|
303
311
|
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 }) });
|
|
304
312
|
}
|
|
305
313
|
Link.Children = RenderBlockChildrenFactory();
|
|
314
|
+
function Liquid(props) {
|
|
315
|
+
return /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Liquid.Children, { block: props.block }) });
|
|
316
|
+
}
|
|
317
|
+
Liquid.Children = function(props) {
|
|
318
|
+
var _a;
|
|
319
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, (_a = props.block) == null ? void 0 : _a.value);
|
|
320
|
+
};
|
|
306
321
|
function List(props) {
|
|
307
322
|
var _a, _b, _c, _d;
|
|
308
323
|
const isOrdered = ((_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.listType) === "ordered";
|
|
@@ -478,11 +493,13 @@ var BLOCK_RENDERERS = {
|
|
|
478
493
|
"_code": CodeWithCaption,
|
|
479
494
|
"_component": Component,
|
|
480
495
|
"_divider": Divider,
|
|
496
|
+
"_formContentType": FormContentType,
|
|
481
497
|
"_fragment": Fragment,
|
|
482
498
|
"_heading": Heading,
|
|
483
499
|
"_image": ImageWithCaption,
|
|
484
500
|
"_inlineEntry": InlineEntry,
|
|
485
501
|
"_link": Link,
|
|
502
|
+
"_liquid": Liquid,
|
|
486
503
|
"_list": List,
|
|
487
504
|
"_listItem": ListItem,
|
|
488
505
|
"_panel": Panel,
|
|
@@ -520,6 +537,7 @@ var DECORATOR_RENDERERS = {
|
|
|
520
537
|
Delete,
|
|
521
538
|
Divider,
|
|
522
539
|
Emphasis,
|
|
540
|
+
FormContentType,
|
|
523
541
|
Fragment,
|
|
524
542
|
Heading,
|
|
525
543
|
Image,
|
|
@@ -529,6 +547,7 @@ var DECORATOR_RENDERERS = {
|
|
|
529
547
|
Keyboard,
|
|
530
548
|
LineBreak,
|
|
531
549
|
Link,
|
|
550
|
+
Liquid,
|
|
532
551
|
List,
|
|
533
552
|
ListItem,
|
|
534
553
|
Mark,
|
package/dist/canvas-react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/renderer.tsx"],"sourcesContent":["export * from '@contensis/canvas-types';\nexport * from './renderer';\n","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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA4H;AA4ErH,IAAM,sBAAkB,4BAAoC,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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ACZ,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAChB;","names":["React","Component","React","React","React"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/renderer.tsx"],"sourcesContent":["export * from '@contensis/canvas-types';\nexport * from './renderer';\n","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 FormContentTypeBlock,\n FragmentBlock,\n HeadingBlock,\n ImageBlock,\n InlineEntryBlock,\n LinkBlock,\n LiquidBlock,\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 ? (<Component block={props.block} />) : null;\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 FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>) {\n return null;\n}\n\nFormContentType.Children = function (_props: RenderBlockProps<FormContentTypeBlock>) {\n return null;\n};\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 Liquid(props: RenderBlockPropsWithChildren<LiquidBlock>) { \n return (\n <RenderContents contents={props.children} fallback={<Liquid.Children block={props.block} />} /> \n );\n}\n\nLiquid.Children = function (props: RenderBlockProps<LiquidBlock>) {\n return (<>{props.block?.value}</>);\n};\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};\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\nconst BLOCK_RENDERERS: BlockRenderers = {\n '_anchor': Anchor,\n '_code': CodeWithCaption,\n '_component': Component,\n '_divider': Divider,\n '_formContentType': FormContentType,\n '_fragment': Fragment,\n '_heading': Heading,\n '_image': ImageWithCaption,\n '_inlineEntry': InlineEntry,\n '_link': Link,\n '_liquid': Liquid,\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA4H;AA8ErH,IAAM,sBAAkB,4BAAoC,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,6BAAAA,QAAA,cAAC,gBAAgB,UAAhB,EAAyB,SACrB,MAAM,QACX;AAER;AAEA,SAAS,YAAY;AACjB,Q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Z,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":["React","Component","React","React","React"]}
|
|
@@ -62,7 +62,7 @@ function useComponents() {
|
|
|
62
62
|
function RenderBlock(props) {
|
|
63
63
|
const blocks = useBlocks();
|
|
64
64
|
const Component2 = blocks[props.block.type];
|
|
65
|
-
return /* @__PURE__ */ React.createElement(Component2, { block: props.block });
|
|
65
|
+
return !!Component2 ? /* @__PURE__ */ React.createElement(Component2, { block: props.block }) : null;
|
|
66
66
|
}
|
|
67
67
|
function RenderBlocks(props) {
|
|
68
68
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.blocks.map((block) => /* @__PURE__ */ React.createElement(RenderBlock, { block, key: block.id })));
|
|
@@ -158,6 +158,12 @@ function Divider(props) {
|
|
|
158
158
|
return /* @__PURE__ */ React.createElement("hr", __spreadValues({}, attributes));
|
|
159
159
|
}
|
|
160
160
|
Divider.Children = EmptyChildrenFactory();
|
|
161
|
+
function FormContentType(_props) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
FormContentType.Children = function(_props) {
|
|
165
|
+
return null;
|
|
166
|
+
};
|
|
161
167
|
function Fragment(props) {
|
|
162
168
|
var _a, _b, _c, _d, _e;
|
|
163
169
|
const hasDecorators = !!((_c = (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.decorators) == null ? void 0 : _c.length);
|
|
@@ -232,6 +238,13 @@ function Link(props) {
|
|
|
232
238
|
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
239
|
}
|
|
234
240
|
Link.Children = RenderBlockChildrenFactory();
|
|
241
|
+
function Liquid(props) {
|
|
242
|
+
return /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Liquid.Children, { block: props.block }) });
|
|
243
|
+
}
|
|
244
|
+
Liquid.Children = function(props) {
|
|
245
|
+
var _a;
|
|
246
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, (_a = props.block) == null ? void 0 : _a.value);
|
|
247
|
+
};
|
|
235
248
|
function List(props) {
|
|
236
249
|
var _a, _b, _c, _d;
|
|
237
250
|
const isOrdered = ((_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.listType) === "ordered";
|
|
@@ -407,11 +420,13 @@ var BLOCK_RENDERERS = {
|
|
|
407
420
|
"_code": CodeWithCaption,
|
|
408
421
|
"_component": Component,
|
|
409
422
|
"_divider": Divider,
|
|
423
|
+
"_formContentType": FormContentType,
|
|
410
424
|
"_fragment": Fragment,
|
|
411
425
|
"_heading": Heading,
|
|
412
426
|
"_image": ImageWithCaption,
|
|
413
427
|
"_inlineEntry": InlineEntry,
|
|
414
428
|
"_link": Link,
|
|
429
|
+
"_liquid": Liquid,
|
|
415
430
|
"_list": List,
|
|
416
431
|
"_listItem": ListItem,
|
|
417
432
|
"_panel": Panel,
|
|
@@ -448,6 +463,7 @@ export {
|
|
|
448
463
|
Delete,
|
|
449
464
|
Divider,
|
|
450
465
|
Emphasis,
|
|
466
|
+
FormContentType,
|
|
451
467
|
Fragment,
|
|
452
468
|
Heading,
|
|
453
469
|
Image,
|
|
@@ -457,6 +473,7 @@ export {
|
|
|
457
473
|
Keyboard,
|
|
458
474
|
LineBreak,
|
|
459
475
|
Link,
|
|
476
|
+
Liquid,
|
|
460
477
|
List,
|
|
461
478
|
ListItem,
|
|
462
479
|
Mark,
|
|
@@ -482,4 +499,4 @@ export {
|
|
|
482
499
|
Underline,
|
|
483
500
|
Variable
|
|
484
501
|
};
|
|
485
|
-
//# sourceMappingURL=canvas-react.
|
|
502
|
+
//# sourceMappingURL=canvas-react.mjs.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 FormContentTypeBlock,\n FragmentBlock,\n HeadingBlock,\n ImageBlock,\n InlineEntryBlock,\n LinkBlock,\n LiquidBlock,\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 ? (<Component block={props.block} />) : null;\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 FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>) {\n return null;\n}\n\nFormContentType.Children = function (_props: RenderBlockProps<FormContentTypeBlock>) {\n return null;\n};\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 Liquid(props: RenderBlockPropsWithChildren<LiquidBlock>) { \n return (\n <RenderContents contents={props.children} fallback={<Liquid.Children block={props.block} />} /> \n );\n}\n\nLiquid.Children = function (props: RenderBlockProps<LiquidBlock>) {\n return (<>{props.block?.value}</>);\n};\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};\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\nconst BLOCK_RENDERERS: BlockRenderers = {\n '_anchor': Anchor,\n '_code': CodeWithCaption,\n '_component': Component,\n '_divider': Divider,\n '_formContentType': FormContentType,\n '_fragment': Fragment,\n '_heading': Heading,\n '_image': ImageWithCaption,\n '_inlineEntry': InlineEntry,\n '_link': Link,\n '_liquid': Liquid,\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;AA8ErH,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,aAAY,OAAO,MAAM,MAAM,IAAI;AACzC,SAAO,CAAC,CAACA,aAAa,oCAACA,YAAA,EAAU,OAAO,MAAM,OAAO,IA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,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.2.0",
|
|
4
4
|
"description": "Render canvas content with React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contensis",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"exports": {
|
|
44
44
|
".": {
|
|
45
45
|
"require": "./dist/canvas-react.js",
|
|
46
|
-
"import": "./dist/
|
|
46
|
+
"import": "./dist/canvas-react.mjs",
|
|
47
47
|
"types": "./dist/canvas-react.d.ts"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -1 +0,0 @@
|
|
|
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,S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