@contensis/canvas-react 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/canvas-react.d.mts +35 -8
- package/dist/canvas-react.d.ts +35 -8
- package/dist/canvas-react.js +5 -2
- package/dist/canvas-react.js.map +1 -1
- package/dist/canvas-react.mjs +4 -2
- package/dist/canvas-react.mjs.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -120,7 +120,7 @@ type Book = { cover: string; name: string };
|
|
|
120
120
|
// Render a "book" component within the canvas data
|
|
121
121
|
const MyBookComponent = (props: RenderBlockProps<ComponentBlock<Book>) => {
|
|
122
122
|
const book = props.block?.value;
|
|
123
|
-
if (!book) return
|
|
123
|
+
if (!book) return null;
|
|
124
124
|
return (
|
|
125
125
|
<div className="card mb-3">
|
|
126
126
|
<div className="row g-0">
|
package/dist/canvas-react.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { FunctionComponent, ClassType, Component as Component$1, ComponentClass } from 'react';
|
|
2
3
|
|
|
3
4
|
type InlineBlock = FragmentBlock | AnchorBlock | LinkBlock | InlineEntryBlock;
|
|
4
5
|
type InlineChildren = string | InlineBlock[];
|
|
@@ -297,7 +298,7 @@ type TableRowBlock = {
|
|
|
297
298
|
|
|
298
299
|
type Attributes = Record<string, any>;
|
|
299
300
|
type WithChildren = {
|
|
300
|
-
children?: JSX.Element;
|
|
301
|
+
children?: JSX.Element | undefined;
|
|
301
302
|
};
|
|
302
303
|
type RendererProps = {
|
|
303
304
|
data: Block[];
|
|
@@ -309,7 +310,7 @@ type RenderBlockPropsWithChildren<T extends Block> = RenderBlockProps<T> & WithC
|
|
|
309
310
|
type TypedBlock<TType extends Block['type']> = Extract<Block, {
|
|
310
311
|
type: TType;
|
|
311
312
|
}>;
|
|
312
|
-
type BlockRenderer<T extends Block> =
|
|
313
|
+
type BlockRenderer<T extends Block> = Renderer<RenderBlockPropsWithChildren<T>>;
|
|
313
314
|
type BlockRenderers = {
|
|
314
315
|
[TType in Block['type']]: BlockRenderer<TypedBlock<TType>>;
|
|
315
316
|
};
|
|
@@ -319,9 +320,9 @@ type RenderDecoratorProps = {
|
|
|
319
320
|
otherDecorators: undefined | DecoratorType[];
|
|
320
321
|
};
|
|
321
322
|
type RenderDecoratorPropsWithChildren = RenderDecoratorProps & WithChildren & Attributes;
|
|
322
|
-
type DecoratorRenderer =
|
|
323
|
+
type DecoratorRenderer = Renderer<RenderDecoratorPropsWithChildren>;
|
|
323
324
|
type DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;
|
|
324
|
-
type ComponentRenderer =
|
|
325
|
+
type ComponentRenderer = Renderer<RenderBlockPropsWithChildren<ComponentBlock>>;
|
|
325
326
|
type ComponentRenderers = Record<string, ComponentRenderer>;
|
|
326
327
|
type RendererContextValue = {
|
|
327
328
|
blocks?: BlockRenderers;
|
|
@@ -333,12 +334,34 @@ type RendererOverridesContextValue = {
|
|
|
333
334
|
decorators?: Partial<DecoratorRenderers>;
|
|
334
335
|
components?: ComponentRenderers;
|
|
335
336
|
};
|
|
336
|
-
type RendererContextProviderProps =
|
|
337
|
-
children: JSX.Element;
|
|
338
|
-
} & RendererOverridesContextValue;
|
|
337
|
+
type RendererContextProviderProps = WithChildren & RendererOverridesContextValue;
|
|
339
338
|
|
|
340
339
|
declare const RendererContext: react.Context<RendererContextValue>;
|
|
340
|
+
/**
|
|
341
|
+
* Provides context to the <Renderer> component to return Canvas data as React components
|
|
342
|
+
*
|
|
343
|
+
* @link https://www.npmjs.com/package/@contensis/canvas-react#usage
|
|
344
|
+
*
|
|
345
|
+
* @param blocks - Override the default rendering of Canvas content blocks
|
|
346
|
+
* @param components - Render method for Contensis Components within the Canvas field
|
|
347
|
+
* @param decorators - Override the rendering of HTML elements within a text field
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* <RenderContextProvider blocks={{ _table: Table }} components={{ banner: Banner }} decorators={{ strong: Strong }}>
|
|
351
|
+
* <Renderer data={data} />
|
|
352
|
+
* </RenderContextProvider>
|
|
353
|
+
*
|
|
354
|
+
*/
|
|
341
355
|
declare function RenderContextProvider(props: RendererContextProviderProps): JSX.Element;
|
|
356
|
+
type Renderer<TProps> = FunctionComponent<TProps> | ClassType<TProps, Component$1<TProps>, ComponentClass<TProps>>;
|
|
357
|
+
/**
|
|
358
|
+
* The default render method for processing Canvas data
|
|
359
|
+
*
|
|
360
|
+
* @link https://www.npmjs.com/package/@contensis/canvas-react#usage
|
|
361
|
+
*
|
|
362
|
+
* @param data - Accepts Canvas data
|
|
363
|
+
*
|
|
364
|
+
* */
|
|
342
365
|
declare function Renderer(props: RendererProps): JSX.Element;
|
|
343
366
|
declare function Anchor(props: RenderBlockPropsWithChildren<AnchorBlock>): JSX.Element;
|
|
344
367
|
declare namespace Anchor {
|
|
@@ -392,6 +415,10 @@ declare function Paragraph(props: RenderBlockPropsWithChildren<ParagraphBlock>):
|
|
|
392
415
|
declare namespace Paragraph {
|
|
393
416
|
var Children: (props: RenderBlockProps<ParagraphBlock>) => JSX.Element;
|
|
394
417
|
}
|
|
418
|
+
declare function Quote(props: RenderBlockPropsWithChildren<QuoteBlock>): JSX.Element;
|
|
419
|
+
declare namespace Quote {
|
|
420
|
+
var Children: (props: RenderBlockProps<QuoteBlock>) => JSX.Element;
|
|
421
|
+
}
|
|
395
422
|
declare function Table(props: RenderBlockPropsWithChildren<TableBlock>): JSX.Element;
|
|
396
423
|
declare namespace Table {
|
|
397
424
|
var Children: (props: RenderBlockProps<TableBlock>) => JSX.Element;
|
|
@@ -478,4 +505,4 @@ declare namespace Variable {
|
|
|
478
505
|
var Children: typeof DecoratorChildren;
|
|
479
506
|
}
|
|
480
507
|
|
|
481
|
-
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, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, 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 };
|
|
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, 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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { FunctionComponent, ClassType, Component as Component$1, ComponentClass } from 'react';
|
|
2
3
|
|
|
3
4
|
type InlineBlock = FragmentBlock | AnchorBlock | LinkBlock | InlineEntryBlock;
|
|
4
5
|
type InlineChildren = string | InlineBlock[];
|
|
@@ -297,7 +298,7 @@ type TableRowBlock = {
|
|
|
297
298
|
|
|
298
299
|
type Attributes = Record<string, any>;
|
|
299
300
|
type WithChildren = {
|
|
300
|
-
children?: JSX.Element;
|
|
301
|
+
children?: JSX.Element | undefined;
|
|
301
302
|
};
|
|
302
303
|
type RendererProps = {
|
|
303
304
|
data: Block[];
|
|
@@ -309,7 +310,7 @@ type RenderBlockPropsWithChildren<T extends Block> = RenderBlockProps<T> & WithC
|
|
|
309
310
|
type TypedBlock<TType extends Block['type']> = Extract<Block, {
|
|
310
311
|
type: TType;
|
|
311
312
|
}>;
|
|
312
|
-
type BlockRenderer<T extends Block> =
|
|
313
|
+
type BlockRenderer<T extends Block> = Renderer<RenderBlockPropsWithChildren<T>>;
|
|
313
314
|
type BlockRenderers = {
|
|
314
315
|
[TType in Block['type']]: BlockRenderer<TypedBlock<TType>>;
|
|
315
316
|
};
|
|
@@ -319,9 +320,9 @@ type RenderDecoratorProps = {
|
|
|
319
320
|
otherDecorators: undefined | DecoratorType[];
|
|
320
321
|
};
|
|
321
322
|
type RenderDecoratorPropsWithChildren = RenderDecoratorProps & WithChildren & Attributes;
|
|
322
|
-
type DecoratorRenderer =
|
|
323
|
+
type DecoratorRenderer = Renderer<RenderDecoratorPropsWithChildren>;
|
|
323
324
|
type DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;
|
|
324
|
-
type ComponentRenderer =
|
|
325
|
+
type ComponentRenderer = Renderer<RenderBlockPropsWithChildren<ComponentBlock>>;
|
|
325
326
|
type ComponentRenderers = Record<string, ComponentRenderer>;
|
|
326
327
|
type RendererContextValue = {
|
|
327
328
|
blocks?: BlockRenderers;
|
|
@@ -333,12 +334,34 @@ type RendererOverridesContextValue = {
|
|
|
333
334
|
decorators?: Partial<DecoratorRenderers>;
|
|
334
335
|
components?: ComponentRenderers;
|
|
335
336
|
};
|
|
336
|
-
type RendererContextProviderProps =
|
|
337
|
-
children: JSX.Element;
|
|
338
|
-
} & RendererOverridesContextValue;
|
|
337
|
+
type RendererContextProviderProps = WithChildren & RendererOverridesContextValue;
|
|
339
338
|
|
|
340
339
|
declare const RendererContext: react.Context<RendererContextValue>;
|
|
340
|
+
/**
|
|
341
|
+
* Provides context to the <Renderer> component to return Canvas data as React components
|
|
342
|
+
*
|
|
343
|
+
* @link https://www.npmjs.com/package/@contensis/canvas-react#usage
|
|
344
|
+
*
|
|
345
|
+
* @param blocks - Override the default rendering of Canvas content blocks
|
|
346
|
+
* @param components - Render method for Contensis Components within the Canvas field
|
|
347
|
+
* @param decorators - Override the rendering of HTML elements within a text field
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* <RenderContextProvider blocks={{ _table: Table }} components={{ banner: Banner }} decorators={{ strong: Strong }}>
|
|
351
|
+
* <Renderer data={data} />
|
|
352
|
+
* </RenderContextProvider>
|
|
353
|
+
*
|
|
354
|
+
*/
|
|
341
355
|
declare function RenderContextProvider(props: RendererContextProviderProps): JSX.Element;
|
|
356
|
+
type Renderer<TProps> = FunctionComponent<TProps> | ClassType<TProps, Component$1<TProps>, ComponentClass<TProps>>;
|
|
357
|
+
/**
|
|
358
|
+
* The default render method for processing Canvas data
|
|
359
|
+
*
|
|
360
|
+
* @link https://www.npmjs.com/package/@contensis/canvas-react#usage
|
|
361
|
+
*
|
|
362
|
+
* @param data - Accepts Canvas data
|
|
363
|
+
*
|
|
364
|
+
* */
|
|
342
365
|
declare function Renderer(props: RendererProps): JSX.Element;
|
|
343
366
|
declare function Anchor(props: RenderBlockPropsWithChildren<AnchorBlock>): JSX.Element;
|
|
344
367
|
declare namespace Anchor {
|
|
@@ -392,6 +415,10 @@ declare function Paragraph(props: RenderBlockPropsWithChildren<ParagraphBlock>):
|
|
|
392
415
|
declare namespace Paragraph {
|
|
393
416
|
var Children: (props: RenderBlockProps<ParagraphBlock>) => JSX.Element;
|
|
394
417
|
}
|
|
418
|
+
declare function Quote(props: RenderBlockPropsWithChildren<QuoteBlock>): JSX.Element;
|
|
419
|
+
declare namespace Quote {
|
|
420
|
+
var Children: (props: RenderBlockProps<QuoteBlock>) => JSX.Element;
|
|
421
|
+
}
|
|
395
422
|
declare function Table(props: RenderBlockPropsWithChildren<TableBlock>): JSX.Element;
|
|
396
423
|
declare namespace Table {
|
|
397
424
|
var Children: (props: RenderBlockProps<TableBlock>) => JSX.Element;
|
|
@@ -478,4 +505,4 @@ declare namespace Variable {
|
|
|
478
505
|
var Children: typeof DecoratorChildren;
|
|
479
506
|
}
|
|
480
507
|
|
|
481
|
-
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, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, 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 };
|
|
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, 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
|
@@ -40,6 +40,7 @@ __export(src_exports, {
|
|
|
40
40
|
Mark: () => Mark,
|
|
41
41
|
Panel: () => Panel,
|
|
42
42
|
Paragraph: () => Paragraph,
|
|
43
|
+
Quote: () => Quote,
|
|
43
44
|
RenderContextProvider: () => RenderContextProvider,
|
|
44
45
|
Renderer: () => Renderer,
|
|
45
46
|
RendererContext: () => RendererContext,
|
|
@@ -68,7 +69,8 @@ function RenderContextProvider(props) {
|
|
|
68
69
|
const overrideBlocks = props.blocks;
|
|
69
70
|
const blocks = Object.keys(BLOCK_RENDERERS).reduce((prev, type) => {
|
|
70
71
|
const blockType = type;
|
|
71
|
-
|
|
72
|
+
const renderer = overrideBlocks?.[blockType] || BLOCK_RENDERERS[blockType];
|
|
73
|
+
prev[blockType] = renderer;
|
|
72
74
|
return prev;
|
|
73
75
|
}, {});
|
|
74
76
|
const overrideDecorators = props.decorators;
|
|
@@ -137,7 +139,7 @@ function WithCaption(props) {
|
|
|
137
139
|
return !!props.caption ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figure", { children: [
|
|
138
140
|
props.children,
|
|
139
141
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("figcaption", { children: props.caption })
|
|
140
|
-
] }) : props.children;
|
|
142
|
+
] }) : props.children || null;
|
|
141
143
|
}
|
|
142
144
|
function RenderBlockChildrenFactory() {
|
|
143
145
|
return function(props) {
|
|
@@ -492,6 +494,7 @@ var DECORATOR_RENDERERS = {
|
|
|
492
494
|
Mark,
|
|
493
495
|
Panel,
|
|
494
496
|
Paragraph,
|
|
497
|
+
Quote,
|
|
495
498
|
RenderContextProvider,
|
|
496
499
|
Renderer,
|
|
497
500
|
RendererContext,
|
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 type { BlockRenderer, RenderBlockProps, RenderBlockPropsWithChildren, RenderDecoratorProps, RenderDecoratorPropsWithChildren } from './renderer';\nexport {\n Renderer,\n RendererContext,\n RenderContextProvider,\n \n Anchor,\n Code,\n Component,\n Divider,\n Fragment,\n Heading,\n Image,\n InlineEntry,\n Link,\n List,\n ListItem,\n Panel,\n Paragraph,\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHeader,\n TableHeaderCell,\n TableRow,\n InlineCode,\n Delete,\n Emphasis,\n Insert,\n Keyboard,\n LineBreak,\n Mark,\n Strikethrough,\n Strong,\n Subscript,\n Superscript,\n Underline,\n Variable \n} from './renderer';\n","import {\n AnchorBlock, CodeBlock, ComponentBlock, Block, DecoratorType, DividerBlock,\n FragmentBlock, HeadingBlock, ImageBlock, InlineEntryBlock, LinkBlock,\n ListBlock, ListItemBlock, PanelBlock, ParagraphBlock, QuoteBlock, TableBodyBlock,\n TableCaptionBlock, TableCellBlock, TableBlock, TableFooterBlock,\n TableHeaderCellBlock, TableHeaderBlock, TableRowBlock\n} from '@contensis/canvas-types';\nimport { createContext, useContext } from 'react';\n\ntype Attributes = Record<string, any>;\ntype WithChildren = { children?: JSX.Element };\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 BlockRenderer<T extends Block> = (props: RenderBlockPropsWithChildren<T>) => JSX.Element;\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 = (props: RenderDecoratorPropsWithChildren) => JSX.Element;\ntype DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;\n\ntype ComponentRenderer = (props: RenderBlockPropsWithChildren<ComponentBlock>) => JSX.Element;\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 = { children: JSX.Element } & RendererOverridesContextValue;\n\nexport type { BlockRenderer, RenderBlockProps, RenderBlockPropsWithChildren, RenderDecoratorProps, RenderDecoratorPropsWithChildren };\n\nexport const RendererContext = createContext<RendererContextValue>({});\n\nexport function RenderContextProvider(props: RendererContextProviderProps) {\n const overrideBlocks = props.blocks;\n const blocks = Object.keys(BLOCK_RENDERERS)\n .reduce((prev, type) => {\n const blockType = type as Block['type'];\n prev[blockType] = (overrideBlocks?.[blockType] || BLOCK_RENDERERS[blockType]) as BlockRenderer<TypedBlock<typeof blockType>>;\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\nfunction 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\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: { caption: undefined | string, children: JSX.Element }) {\n return (\n !!props.caption\n ? (\n <figure>\n {props.children}\n <figcaption>{props.caption}</figcaption>\n </figure>\n )\n : props.children\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,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AAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,EACV,cAAc;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,aAAa;AACjB;AAEA,IAAM,sBAA0C;AAAA,EAC5C,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAChB;","names":["Fragment","Component","Fragment"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/renderer.tsx"],"sourcesContent":["export * from '@contensis/canvas-types';\nexport * from './renderer';\n","import {\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';\nimport { ClassType, ComponentClass, FunctionComponent, Component as ReactComponent, createContext, useContext } from 'react';\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\nfunction 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,kBAAAA;AAAA,EAAA;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;;;ACyBA,mBAAqH;AA0F7G;AAvCD,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,WAAgB,iBAAiB,SAAS,KAAK,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,IAAI,qBAAqB,aAAa,KAAK,oBAAoB,aAAa;AAC9F,WAAO;AAAA,EACX,GAAG,CAA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,OAAO,WAAW,MAAM,WAAW,iBAAiB,MAAM,iBAAiB,GAAI,GACxK;AAER;AAEA,UAAU,WAAW;AAEd,SAAS,SAAS,OAAyC;AAC9D,QAAM,aAAa,cAAc,KAAK;AACtC,SACI,4CAAC,SAAK,GAAG,YACL,sDAAC,kBAAe,UAAU,MAAM,UAAU,UAAU,4CAAC,SAAS,UAAT,EAAkB,OAAO,MAAM,OAAO,WAAW,MAAM,WAAW,iBAAiB,MAAM,iBAAiB,GAAI,GACvK;AAER;AAEA,SAAS,WAAW;AAGpB,IAAM,kBAAkC;AAAA,EACpC,WAAW;AAAA,EACX,SAAS;AAAA,EACT,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAaA;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,EACV,cAAc;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,aAAa;AACjB;AAEA,IAAM,sBAA0C;AAAA,EAC5C,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAChB;","names":["Fragment","Component","Fragment"]}
|
package/dist/canvas-react.mjs
CHANGED
|
@@ -6,7 +6,8 @@ function RenderContextProvider(props) {
|
|
|
6
6
|
const overrideBlocks = props.blocks;
|
|
7
7
|
const blocks = Object.keys(BLOCK_RENDERERS).reduce((prev, type) => {
|
|
8
8
|
const blockType = type;
|
|
9
|
-
|
|
9
|
+
const renderer = overrideBlocks?.[blockType] || BLOCK_RENDERERS[blockType];
|
|
10
|
+
prev[blockType] = renderer;
|
|
10
11
|
return prev;
|
|
11
12
|
}, {});
|
|
12
13
|
const overrideDecorators = props.decorators;
|
|
@@ -75,7 +76,7 @@ function WithCaption(props) {
|
|
|
75
76
|
return !!props.caption ? /* @__PURE__ */ jsxs("figure", { children: [
|
|
76
77
|
props.children,
|
|
77
78
|
/* @__PURE__ */ jsx("figcaption", { children: props.caption })
|
|
78
|
-
] }) : props.children;
|
|
79
|
+
] }) : props.children || null;
|
|
79
80
|
}
|
|
80
81
|
function RenderBlockChildrenFactory() {
|
|
81
82
|
return function(props) {
|
|
@@ -429,6 +430,7 @@ export {
|
|
|
429
430
|
Mark,
|
|
430
431
|
Panel,
|
|
431
432
|
Paragraph,
|
|
433
|
+
Quote,
|
|
432
434
|
RenderContextProvider,
|
|
433
435
|
Renderer,
|
|
434
436
|
RendererContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/renderer.tsx"],"sourcesContent":["import {\n AnchorBlock, CodeBlock, ComponentBlock, Block, DecoratorType, DividerBlock,\n FragmentBlock, HeadingBlock, ImageBlock, InlineEntryBlock, LinkBlock,\n ListBlock, ListItemBlock, PanelBlock, ParagraphBlock, QuoteBlock, TableBodyBlock,\n TableCaptionBlock, TableCellBlock, TableBlock, TableFooterBlock,\n TableHeaderCellBlock, TableHeaderBlock, TableRowBlock\n} from '@contensis/canvas-types';\nimport { createContext, useContext } from 'react';\n\ntype Attributes = Record<string, any>;\ntype WithChildren = { children?: JSX.Element };\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 BlockRenderer<T extends Block> = (props: RenderBlockPropsWithChildren<T>) => JSX.Element;\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 = (props: RenderDecoratorPropsWithChildren) => JSX.Element;\ntype DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;\n\ntype ComponentRenderer = (props: RenderBlockPropsWithChildren<ComponentBlock>) => JSX.Element;\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 = { children: JSX.Element } & RendererOverridesContextValue;\n\nexport type { BlockRenderer, RenderBlockProps, RenderBlockPropsWithChildren, RenderDecoratorProps, RenderDecoratorPropsWithChildren };\n\nexport const RendererContext = createContext<RendererContextValue>({});\n\nexport function RenderContextProvider(props: RendererContextProviderProps) {\n const overrideBlocks = props.blocks;\n const blocks = Object.keys(BLOCK_RENDERERS)\n .reduce((prev, type) => {\n const blockType = type as Block['type'];\n prev[blockType] = (overrideBlocks?.[blockType] || BLOCK_RENDERERS[blockType]) as BlockRenderer<TypedBlock<typeof blockType>>;\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\nfunction 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\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: { caption: undefined | string, children: JSX.Element }) {\n return (\n !!props.caption\n ? (\n <figure>\n {props.children}\n <figcaption>{props.caption}</figcaption>\n </figure>\n )\n : props.children\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":";AAOA,SAAS,eAAe,kBAAkB;AAuElC,SA4BI,UA5BJ,KAgFQ,YAhFR;AAtBD,IA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AEA,IAAM,sBAA0C;AAAA,EAC5C,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAChB;","names":["Component","Fragment"]}
|
|
1
|
+
{"version":3,"sources":["../src/renderer.tsx"],"sourcesContent":["import {\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';\nimport { ClassType, ComponentClass, FunctionComponent, Component as ReactComponent, createContext, useContext } from 'react';\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\nfunction 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":";AAyBA,SAAoF,eAAe,kBAAkB;AA0F7G,SA4BI,UA5BJ,KAwFQ,YAxFR;AAvCD,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,WAAgB,iBAAiB,SAAS,KAAK,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,IAAI,qBAAqB,aAAa,KAAK,oBAAoB,aAAa;AAC9F,WAAO;AAAA,EACX,GAAG,CAAC,CAAuB;AAE/B,QAAM,QAAQ,EAAE,QAAQ,YAAY,YAAY,MAAM,WAAW;AAEjE,SACI,oBAAC,gBAAgB,UAAhB,EAAyB,OACrB,gBAAM,UACX;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,SAAQ,oBAACA,YAAA,EAAU,OAAO,MAAM,OAAO;AAC3C;AAEA,SAA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AAAA,EACb,UAAU;AAAA,EACV,cAAc;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,aAAa;AACjB;AAEA,IAAM,sBAA0C;AAAA,EAC5C,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAChB;","names":["Component","Fragment"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contensis/canvas-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Render canvas content with React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contensis",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
+
"start": "npm run build",
|
|
29
30
|
"prebuild": "npm run tsc",
|
|
30
31
|
"build": "tsup --dts-resolve",
|
|
31
32
|
"tsc": "tsc --noEmit"
|