@contensis/canvas-react 1.2.0 → 1.3.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/dist/canvas-react.d.mts +46 -6
- package/dist/canvas-react.d.ts +46 -6
- package/dist/canvas-react.js +65 -3
- package/dist/canvas-react.js.map +1 -1
- package/dist/canvas-react.mjs +62 -3
- package/dist/canvas-react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/canvas-react.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ import React, { FunctionComponent, ClassType, Component as Component$1, Componen
|
|
|
3
3
|
type InlineBlock = FragmentBlock | AnchorBlock | LinkBlock | InlineEntryBlock;
|
|
4
4
|
type InlineChildren = string | InlineBlock[];
|
|
5
5
|
type DecoratorTypeMap<T> = {
|
|
6
|
+
abbreviation: T;
|
|
6
7
|
code: T;
|
|
7
8
|
delete: T;
|
|
8
9
|
emphasis: T;
|
|
@@ -40,9 +41,9 @@ type EntrySys = {
|
|
|
40
41
|
projectId?: string;
|
|
41
42
|
dataFormat?: 'entry';
|
|
42
43
|
};
|
|
43
|
-
type Entry = BaseEntry<EntrySys>;
|
|
44
|
+
type Entry$1 = BaseEntry<EntrySys>;
|
|
44
45
|
type Image$1 = {
|
|
45
|
-
asset?: Asset;
|
|
46
|
+
asset?: Asset$1;
|
|
46
47
|
caption?: string;
|
|
47
48
|
transformations?: Transformations;
|
|
48
49
|
altText?: string;
|
|
@@ -59,7 +60,7 @@ type AssetSys = {
|
|
|
59
60
|
height?: number;
|
|
60
61
|
};
|
|
61
62
|
};
|
|
62
|
-
type Asset = BaseEntry<AssetSys> & {
|
|
63
|
+
type Asset$1 = BaseEntry<AssetSys> & {
|
|
63
64
|
altText?: string;
|
|
64
65
|
};
|
|
65
66
|
type Transformations = {
|
|
@@ -98,7 +99,7 @@ type LinkSys = EntrySys & {
|
|
|
98
99
|
node?: Node;
|
|
99
100
|
};
|
|
100
101
|
type Link$1 = BaseEntry<LinkSys>;
|
|
101
|
-
type Block = AnchorBlock | CodeBlock | ComponentBlock | DividerBlock | FormContentTypeBlock | FragmentBlock | HeadingBlock | ImageBlock | InlineEntryBlock | LinkBlock | LiquidBlock | ListBlock | ListItemBlock | PanelBlock | ParagraphBlock | QuoteBlock | TableBlock | TableBodyBlock | TableCaptionBlock | TableCellBlock | TableFooterBlock | TableHeaderBlock | TableHeaderCellBlock | TableRowBlock;
|
|
102
|
+
type Block = AnchorBlock | AssetBlock | CodeBlock | ComponentBlock | DividerBlock | EntryBlock | FormContentTypeBlock | FragmentBlock | HeadingBlock | ImageBlock | InlineEntryBlock | LinkBlock | LiquidBlock | ListBlock | ListItemBlock | PanelBlock | ParagraphBlock | QuoteBlock | TableBlock | TableBodyBlock | TableCaptionBlock | TableCellBlock | TableFooterBlock | TableHeaderBlock | TableHeaderCellBlock | TableRowBlock;
|
|
102
103
|
type AnchorBlock = {
|
|
103
104
|
type: '_anchor';
|
|
104
105
|
id: string;
|
|
@@ -107,6 +108,14 @@ type AnchorBlock = {
|
|
|
107
108
|
id?: string;
|
|
108
109
|
};
|
|
109
110
|
};
|
|
111
|
+
type AssetBlock = {
|
|
112
|
+
type: '_asset';
|
|
113
|
+
id: string;
|
|
114
|
+
value?: Asset$1;
|
|
115
|
+
properties?: {
|
|
116
|
+
id?: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
110
119
|
type CodeBlock = {
|
|
111
120
|
type: '_code';
|
|
112
121
|
id: string;
|
|
@@ -136,6 +145,14 @@ type DividerBlock = {
|
|
|
136
145
|
id?: string;
|
|
137
146
|
};
|
|
138
147
|
};
|
|
148
|
+
type EntryBlock = {
|
|
149
|
+
type: '_entry';
|
|
150
|
+
id: string;
|
|
151
|
+
value?: Entry$1;
|
|
152
|
+
properties?: {
|
|
153
|
+
id?: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
139
156
|
type FormContentType$1 = {
|
|
140
157
|
id: string;
|
|
141
158
|
};
|
|
@@ -156,6 +173,9 @@ type FragmentBlock = {
|
|
|
156
173
|
properties?: {
|
|
157
174
|
id?: string;
|
|
158
175
|
decorators?: DecoratorType[];
|
|
176
|
+
abbreviation?: {
|
|
177
|
+
title?: string;
|
|
178
|
+
};
|
|
159
179
|
};
|
|
160
180
|
};
|
|
161
181
|
type HeadingBlock = {
|
|
@@ -178,7 +198,7 @@ type ImageBlock = {
|
|
|
178
198
|
type InlineEntryBlock = {
|
|
179
199
|
type: '_inlineEntry';
|
|
180
200
|
id: string;
|
|
181
|
-
value?: Entry;
|
|
201
|
+
value?: Entry$1;
|
|
182
202
|
properties?: {
|
|
183
203
|
id?: string;
|
|
184
204
|
};
|
|
@@ -346,15 +366,23 @@ type DecoratorRenderer = Renderer<RenderDecoratorPropsWithChildren>;
|
|
|
346
366
|
type DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;
|
|
347
367
|
type ComponentRenderer = Renderer<RenderBlockPropsWithChildren<ComponentBlock>>;
|
|
348
368
|
type ComponentRenderers = Record<string, ComponentRenderer>;
|
|
369
|
+
type EntryRenderer = Renderer<RenderBlockPropsWithChildren<EntryBlock>>;
|
|
370
|
+
type EntryRenderers = Record<string, EntryRenderer>;
|
|
371
|
+
type AssetRenderer = Renderer<RenderBlockPropsWithChildren<AssetBlock>>;
|
|
372
|
+
type AssetRenderers = Record<string, AssetRenderer>;
|
|
349
373
|
type RendererContextValue = {
|
|
350
374
|
blocks?: BlockRenderers;
|
|
351
375
|
decorators?: DecoratorRenderers;
|
|
352
376
|
components?: ComponentRenderers;
|
|
377
|
+
entries?: EntryRenderers;
|
|
378
|
+
assets?: AssetRenderers;
|
|
353
379
|
};
|
|
354
380
|
type RendererOverridesContextValue = {
|
|
355
381
|
blocks?: Partial<BlockRenderers>;
|
|
356
382
|
decorators?: Partial<DecoratorRenderers>;
|
|
357
383
|
components?: ComponentRenderers;
|
|
384
|
+
entries?: EntryRenderers;
|
|
385
|
+
assets?: AssetRenderers;
|
|
358
386
|
};
|
|
359
387
|
type RendererContextProviderProps = WithChildren & RendererOverridesContextValue;
|
|
360
388
|
|
|
@@ -390,6 +418,10 @@ declare function Anchor(props: RenderBlockPropsWithChildren<AnchorBlock>): React
|
|
|
390
418
|
declare namespace Anchor {
|
|
391
419
|
var Children: (props: RenderBlockProps<AnchorBlock>) => React.JSX.Element;
|
|
392
420
|
}
|
|
421
|
+
declare function Asset(props: RenderBlockPropsWithChildren<AssetBlock>): React.JSX.Element;
|
|
422
|
+
declare namespace Asset {
|
|
423
|
+
var Children: (props: RenderBlockProps<AssetBlock>) => React.JSX.Element;
|
|
424
|
+
}
|
|
393
425
|
declare function Code(props: RenderBlockPropsWithChildren<CodeBlock>): React.JSX.Element;
|
|
394
426
|
declare namespace Code {
|
|
395
427
|
var Children: (props: RenderBlockProps<CodeBlock>) => React.JSX.Element;
|
|
@@ -402,6 +434,10 @@ declare function Divider(props: RenderBlockPropsWithChildren<DividerBlock>): Rea
|
|
|
402
434
|
declare namespace Divider {
|
|
403
435
|
var Children: (props: RenderBlockProps<DividerBlock>) => React.JSX.Element;
|
|
404
436
|
}
|
|
437
|
+
declare function Entry(props: RenderBlockPropsWithChildren<EntryBlock>): React.JSX.Element;
|
|
438
|
+
declare namespace Entry {
|
|
439
|
+
var Children: (props: RenderBlockProps<EntryBlock>) => React.JSX.Element;
|
|
440
|
+
}
|
|
405
441
|
declare function FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>): null;
|
|
406
442
|
declare namespace FormContentType {
|
|
407
443
|
var Children: (_props: RenderBlockProps<FormContentTypeBlock>) => null;
|
|
@@ -483,6 +519,10 @@ declare namespace TableRow {
|
|
|
483
519
|
var Children: (props: RenderBlockProps<TableRowBlock>) => React.JSX.Element;
|
|
484
520
|
}
|
|
485
521
|
declare function DecoratorChildren(props: RenderDecoratorPropsWithChildren): React.JSX.Element;
|
|
522
|
+
declare function Abbreviation(props: RenderDecoratorPropsWithChildren): React.JSX.Element;
|
|
523
|
+
declare namespace Abbreviation {
|
|
524
|
+
var Children: typeof DecoratorChildren;
|
|
525
|
+
}
|
|
486
526
|
declare function InlineCode(props: RenderDecoratorPropsWithChildren): React.JSX.Element;
|
|
487
527
|
declare namespace InlineCode {
|
|
488
528
|
var Children: typeof DecoratorChildren;
|
|
@@ -536,4 +576,4 @@ declare namespace Variable {
|
|
|
536
576
|
var Children: typeof DecoratorChildren;
|
|
537
577
|
}
|
|
538
578
|
|
|
539
|
-
export { Anchor, type AnchorBlock, type Block, type BlockRenderer, Code, type CodeBlock, Component, type ComponentBlock, type DecoratorType, Delete, Divider, type DividerBlock, Emphasis, FormContentType, type FormContentTypeBlock, Fragment, type FragmentBlock, Heading, type HeadingBlock, Image, type ImageBlock, InlineCode, InlineEntry, type InlineEntryBlock, Insert, Keyboard, LineBreak, Link, type LinkBlock, Liquid, type LiquidBlock, List, type ListBlock, ListItem, type ListItemBlock, Mark, Panel, type PanelBlock, Paragraph, type ParagraphBlock, Quote, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, RenderChildren, RenderContextProvider, type RenderDecoratorProps, type RenderDecoratorPropsWithChildren, Renderer, RendererContext, Strikethrough, Strong, Subscript, Superscript, Table, type TableBlock, TableBody, type TableBodyBlock, TableCaption, type TableCaptionBlock, TableCell, type TableCellBlock, TableFooter, type TableFooterBlock, TableHeader, type TableHeaderBlock, TableHeaderCell, type TableHeaderCellBlock, TableRow, type TableRowBlock, Underline, Variable };
|
|
579
|
+
export { Abbreviation, Anchor, type AnchorBlock, Asset, type AssetBlock, type Block, type BlockRenderer, Code, type CodeBlock, Component, type ComponentBlock, type DecoratorType, Delete, Divider, type DividerBlock, Emphasis, Entry, type EntryBlock, FormContentType, type FormContentTypeBlock, Fragment, type FragmentBlock, Heading, type HeadingBlock, Image, type ImageBlock, InlineCode, InlineEntry, type InlineEntryBlock, Insert, Keyboard, LineBreak, Link, type LinkBlock, Liquid, type LiquidBlock, List, type ListBlock, ListItem, type ListItemBlock, Mark, Panel, type PanelBlock, Paragraph, type ParagraphBlock, Quote, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, RenderChildren, RenderContextProvider, type RenderDecoratorProps, type RenderDecoratorPropsWithChildren, Renderer, RendererContext, Strikethrough, Strong, Subscript, Superscript, Table, type TableBlock, TableBody, type TableBodyBlock, TableCaption, type TableCaptionBlock, TableCell, type TableCellBlock, TableFooter, type TableFooterBlock, TableHeader, type TableHeaderBlock, TableHeaderCell, type TableHeaderCellBlock, TableRow, type TableRowBlock, Underline, Variable };
|
package/dist/canvas-react.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import React, { FunctionComponent, ClassType, Component as Component$1, Componen
|
|
|
3
3
|
type InlineBlock = FragmentBlock | AnchorBlock | LinkBlock | InlineEntryBlock;
|
|
4
4
|
type InlineChildren = string | InlineBlock[];
|
|
5
5
|
type DecoratorTypeMap<T> = {
|
|
6
|
+
abbreviation: T;
|
|
6
7
|
code: T;
|
|
7
8
|
delete: T;
|
|
8
9
|
emphasis: T;
|
|
@@ -40,9 +41,9 @@ type EntrySys = {
|
|
|
40
41
|
projectId?: string;
|
|
41
42
|
dataFormat?: 'entry';
|
|
42
43
|
};
|
|
43
|
-
type Entry = BaseEntry<EntrySys>;
|
|
44
|
+
type Entry$1 = BaseEntry<EntrySys>;
|
|
44
45
|
type Image$1 = {
|
|
45
|
-
asset?: Asset;
|
|
46
|
+
asset?: Asset$1;
|
|
46
47
|
caption?: string;
|
|
47
48
|
transformations?: Transformations;
|
|
48
49
|
altText?: string;
|
|
@@ -59,7 +60,7 @@ type AssetSys = {
|
|
|
59
60
|
height?: number;
|
|
60
61
|
};
|
|
61
62
|
};
|
|
62
|
-
type Asset = BaseEntry<AssetSys> & {
|
|
63
|
+
type Asset$1 = BaseEntry<AssetSys> & {
|
|
63
64
|
altText?: string;
|
|
64
65
|
};
|
|
65
66
|
type Transformations = {
|
|
@@ -98,7 +99,7 @@ type LinkSys = EntrySys & {
|
|
|
98
99
|
node?: Node;
|
|
99
100
|
};
|
|
100
101
|
type Link$1 = BaseEntry<LinkSys>;
|
|
101
|
-
type Block = AnchorBlock | CodeBlock | ComponentBlock | DividerBlock | FormContentTypeBlock | FragmentBlock | HeadingBlock | ImageBlock | InlineEntryBlock | LinkBlock | LiquidBlock | ListBlock | ListItemBlock | PanelBlock | ParagraphBlock | QuoteBlock | TableBlock | TableBodyBlock | TableCaptionBlock | TableCellBlock | TableFooterBlock | TableHeaderBlock | TableHeaderCellBlock | TableRowBlock;
|
|
102
|
+
type Block = AnchorBlock | AssetBlock | CodeBlock | ComponentBlock | DividerBlock | EntryBlock | FormContentTypeBlock | FragmentBlock | HeadingBlock | ImageBlock | InlineEntryBlock | LinkBlock | LiquidBlock | ListBlock | ListItemBlock | PanelBlock | ParagraphBlock | QuoteBlock | TableBlock | TableBodyBlock | TableCaptionBlock | TableCellBlock | TableFooterBlock | TableHeaderBlock | TableHeaderCellBlock | TableRowBlock;
|
|
102
103
|
type AnchorBlock = {
|
|
103
104
|
type: '_anchor';
|
|
104
105
|
id: string;
|
|
@@ -107,6 +108,14 @@ type AnchorBlock = {
|
|
|
107
108
|
id?: string;
|
|
108
109
|
};
|
|
109
110
|
};
|
|
111
|
+
type AssetBlock = {
|
|
112
|
+
type: '_asset';
|
|
113
|
+
id: string;
|
|
114
|
+
value?: Asset$1;
|
|
115
|
+
properties?: {
|
|
116
|
+
id?: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
110
119
|
type CodeBlock = {
|
|
111
120
|
type: '_code';
|
|
112
121
|
id: string;
|
|
@@ -136,6 +145,14 @@ type DividerBlock = {
|
|
|
136
145
|
id?: string;
|
|
137
146
|
};
|
|
138
147
|
};
|
|
148
|
+
type EntryBlock = {
|
|
149
|
+
type: '_entry';
|
|
150
|
+
id: string;
|
|
151
|
+
value?: Entry$1;
|
|
152
|
+
properties?: {
|
|
153
|
+
id?: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
139
156
|
type FormContentType$1 = {
|
|
140
157
|
id: string;
|
|
141
158
|
};
|
|
@@ -156,6 +173,9 @@ type FragmentBlock = {
|
|
|
156
173
|
properties?: {
|
|
157
174
|
id?: string;
|
|
158
175
|
decorators?: DecoratorType[];
|
|
176
|
+
abbreviation?: {
|
|
177
|
+
title?: string;
|
|
178
|
+
};
|
|
159
179
|
};
|
|
160
180
|
};
|
|
161
181
|
type HeadingBlock = {
|
|
@@ -178,7 +198,7 @@ type ImageBlock = {
|
|
|
178
198
|
type InlineEntryBlock = {
|
|
179
199
|
type: '_inlineEntry';
|
|
180
200
|
id: string;
|
|
181
|
-
value?: Entry;
|
|
201
|
+
value?: Entry$1;
|
|
182
202
|
properties?: {
|
|
183
203
|
id?: string;
|
|
184
204
|
};
|
|
@@ -346,15 +366,23 @@ type DecoratorRenderer = Renderer<RenderDecoratorPropsWithChildren>;
|
|
|
346
366
|
type DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;
|
|
347
367
|
type ComponentRenderer = Renderer<RenderBlockPropsWithChildren<ComponentBlock>>;
|
|
348
368
|
type ComponentRenderers = Record<string, ComponentRenderer>;
|
|
369
|
+
type EntryRenderer = Renderer<RenderBlockPropsWithChildren<EntryBlock>>;
|
|
370
|
+
type EntryRenderers = Record<string, EntryRenderer>;
|
|
371
|
+
type AssetRenderer = Renderer<RenderBlockPropsWithChildren<AssetBlock>>;
|
|
372
|
+
type AssetRenderers = Record<string, AssetRenderer>;
|
|
349
373
|
type RendererContextValue = {
|
|
350
374
|
blocks?: BlockRenderers;
|
|
351
375
|
decorators?: DecoratorRenderers;
|
|
352
376
|
components?: ComponentRenderers;
|
|
377
|
+
entries?: EntryRenderers;
|
|
378
|
+
assets?: AssetRenderers;
|
|
353
379
|
};
|
|
354
380
|
type RendererOverridesContextValue = {
|
|
355
381
|
blocks?: Partial<BlockRenderers>;
|
|
356
382
|
decorators?: Partial<DecoratorRenderers>;
|
|
357
383
|
components?: ComponentRenderers;
|
|
384
|
+
entries?: EntryRenderers;
|
|
385
|
+
assets?: AssetRenderers;
|
|
358
386
|
};
|
|
359
387
|
type RendererContextProviderProps = WithChildren & RendererOverridesContextValue;
|
|
360
388
|
|
|
@@ -390,6 +418,10 @@ declare function Anchor(props: RenderBlockPropsWithChildren<AnchorBlock>): React
|
|
|
390
418
|
declare namespace Anchor {
|
|
391
419
|
var Children: (props: RenderBlockProps<AnchorBlock>) => React.JSX.Element;
|
|
392
420
|
}
|
|
421
|
+
declare function Asset(props: RenderBlockPropsWithChildren<AssetBlock>): React.JSX.Element;
|
|
422
|
+
declare namespace Asset {
|
|
423
|
+
var Children: (props: RenderBlockProps<AssetBlock>) => React.JSX.Element;
|
|
424
|
+
}
|
|
393
425
|
declare function Code(props: RenderBlockPropsWithChildren<CodeBlock>): React.JSX.Element;
|
|
394
426
|
declare namespace Code {
|
|
395
427
|
var Children: (props: RenderBlockProps<CodeBlock>) => React.JSX.Element;
|
|
@@ -402,6 +434,10 @@ declare function Divider(props: RenderBlockPropsWithChildren<DividerBlock>): Rea
|
|
|
402
434
|
declare namespace Divider {
|
|
403
435
|
var Children: (props: RenderBlockProps<DividerBlock>) => React.JSX.Element;
|
|
404
436
|
}
|
|
437
|
+
declare function Entry(props: RenderBlockPropsWithChildren<EntryBlock>): React.JSX.Element;
|
|
438
|
+
declare namespace Entry {
|
|
439
|
+
var Children: (props: RenderBlockProps<EntryBlock>) => React.JSX.Element;
|
|
440
|
+
}
|
|
405
441
|
declare function FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>): null;
|
|
406
442
|
declare namespace FormContentType {
|
|
407
443
|
var Children: (_props: RenderBlockProps<FormContentTypeBlock>) => null;
|
|
@@ -483,6 +519,10 @@ declare namespace TableRow {
|
|
|
483
519
|
var Children: (props: RenderBlockProps<TableRowBlock>) => React.JSX.Element;
|
|
484
520
|
}
|
|
485
521
|
declare function DecoratorChildren(props: RenderDecoratorPropsWithChildren): React.JSX.Element;
|
|
522
|
+
declare function Abbreviation(props: RenderDecoratorPropsWithChildren): React.JSX.Element;
|
|
523
|
+
declare namespace Abbreviation {
|
|
524
|
+
var Children: typeof DecoratorChildren;
|
|
525
|
+
}
|
|
486
526
|
declare function InlineCode(props: RenderDecoratorPropsWithChildren): React.JSX.Element;
|
|
487
527
|
declare namespace InlineCode {
|
|
488
528
|
var Children: typeof DecoratorChildren;
|
|
@@ -536,4 +576,4 @@ declare namespace Variable {
|
|
|
536
576
|
var Children: typeof DecoratorChildren;
|
|
537
577
|
}
|
|
538
578
|
|
|
539
|
-
export { Anchor, type AnchorBlock, type Block, type BlockRenderer, Code, type CodeBlock, Component, type ComponentBlock, type DecoratorType, Delete, Divider, type DividerBlock, Emphasis, FormContentType, type FormContentTypeBlock, Fragment, type FragmentBlock, Heading, type HeadingBlock, Image, type ImageBlock, InlineCode, InlineEntry, type InlineEntryBlock, Insert, Keyboard, LineBreak, Link, type LinkBlock, Liquid, type LiquidBlock, List, type ListBlock, ListItem, type ListItemBlock, Mark, Panel, type PanelBlock, Paragraph, type ParagraphBlock, Quote, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, RenderChildren, RenderContextProvider, type RenderDecoratorProps, type RenderDecoratorPropsWithChildren, Renderer, RendererContext, Strikethrough, Strong, Subscript, Superscript, Table, type TableBlock, TableBody, type TableBodyBlock, TableCaption, type TableCaptionBlock, TableCell, type TableCellBlock, TableFooter, type TableFooterBlock, TableHeader, type TableHeaderBlock, TableHeaderCell, type TableHeaderCellBlock, TableRow, type TableRowBlock, Underline, Variable };
|
|
579
|
+
export { Abbreviation, Anchor, type AnchorBlock, Asset, type AssetBlock, type Block, type BlockRenderer, Code, type CodeBlock, Component, type ComponentBlock, type DecoratorType, Delete, Divider, type DividerBlock, Emphasis, Entry, type EntryBlock, FormContentType, type FormContentTypeBlock, Fragment, type FragmentBlock, Heading, type HeadingBlock, Image, type ImageBlock, InlineCode, InlineEntry, type InlineEntryBlock, Insert, Keyboard, LineBreak, Link, type LinkBlock, Liquid, type LiquidBlock, List, type ListBlock, ListItem, type ListItemBlock, Mark, Panel, type PanelBlock, Paragraph, type ParagraphBlock, Quote, type QuoteBlock, type RenderBlockProps, type RenderBlockPropsWithChildren, RenderChildren, RenderContextProvider, type RenderDecoratorProps, type RenderDecoratorPropsWithChildren, Renderer, RendererContext, Strikethrough, Strong, Subscript, Superscript, Table, type TableBlock, TableBody, type TableBodyBlock, TableCaption, type TableCaptionBlock, TableCell, type TableCellBlock, TableFooter, type TableFooterBlock, TableHeader, type TableHeaderBlock, TableHeaderCell, type TableHeaderCellBlock, TableRow, type TableRowBlock, Underline, Variable };
|
package/dist/canvas-react.js
CHANGED
|
@@ -56,12 +56,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
56
56
|
// src/index.ts
|
|
57
57
|
var src_exports = {};
|
|
58
58
|
__export(src_exports, {
|
|
59
|
+
Abbreviation: () => Abbreviation,
|
|
59
60
|
Anchor: () => Anchor,
|
|
61
|
+
Asset: () => Asset,
|
|
60
62
|
Code: () => Code,
|
|
61
63
|
Component: () => Component,
|
|
62
64
|
Delete: () => Delete,
|
|
63
65
|
Divider: () => Divider,
|
|
64
66
|
Emphasis: () => Emphasis,
|
|
67
|
+
Entry: () => Entry,
|
|
65
68
|
FormContentType: () => FormContentType,
|
|
66
69
|
Fragment: () => Fragment,
|
|
67
70
|
Heading: () => Heading,
|
|
@@ -103,6 +106,10 @@ module.exports = __toCommonJS(src_exports);
|
|
|
103
106
|
// src/renderer.tsx
|
|
104
107
|
var import_react = __toESM(require("react"));
|
|
105
108
|
var RendererContext = (0, import_react.createContext)({});
|
|
109
|
+
var BlockRenderContext = (0, import_react.createContext)({ ancestors: [] });
|
|
110
|
+
function findAncestorOfType(ancestors, types) {
|
|
111
|
+
return ancestors == null ? void 0 : ancestors.slice().reverse().find((ancestor) => types.includes(ancestor.type));
|
|
112
|
+
}
|
|
106
113
|
function RenderContextProvider(props) {
|
|
107
114
|
const overrideBlocks = props.blocks;
|
|
108
115
|
const blocks = Object.keys(BLOCK_RENDERERS).reduce((prev, type) => {
|
|
@@ -117,7 +124,7 @@ function RenderContextProvider(props) {
|
|
|
117
124
|
prev[decoratorType] = (overrideDecorators == null ? void 0 : overrideDecorators[decoratorType]) || DECORATOR_RENDERERS[decoratorType];
|
|
118
125
|
return prev;
|
|
119
126
|
}, {});
|
|
120
|
-
const value = { blocks, decorators, components: props.components };
|
|
127
|
+
const value = { blocks, decorators, components: props.components, entries: props.entries, assets: props == null ? void 0 : props.assets };
|
|
121
128
|
return /* @__PURE__ */ import_react.default.createElement(RendererContext.Provider, { value }, props.children);
|
|
122
129
|
}
|
|
123
130
|
function useBlocks() {
|
|
@@ -132,10 +139,20 @@ function useComponents() {
|
|
|
132
139
|
const value = (0, import_react.useContext)(RendererContext);
|
|
133
140
|
return value.components || {};
|
|
134
141
|
}
|
|
142
|
+
function useEntries() {
|
|
143
|
+
const value = (0, import_react.useContext)(RendererContext);
|
|
144
|
+
return value.entries || {};
|
|
145
|
+
}
|
|
146
|
+
function useAssets() {
|
|
147
|
+
const value = (0, import_react.useContext)(RendererContext);
|
|
148
|
+
return value.assets || {};
|
|
149
|
+
}
|
|
135
150
|
function RenderBlock(props) {
|
|
136
151
|
const blocks = useBlocks();
|
|
137
152
|
const Component2 = blocks[props.block.type];
|
|
138
|
-
|
|
153
|
+
const renderContext = (0, import_react.useContext)(BlockRenderContext);
|
|
154
|
+
const ancestors = [...renderContext.ancestors, props.block];
|
|
155
|
+
return !!Component2 ? /* @__PURE__ */ import_react.default.createElement(BlockRenderContext.Provider, { value: { ancestors } }, /* @__PURE__ */ import_react.default.createElement(Component2, { block: props.block })) : null;
|
|
139
156
|
}
|
|
140
157
|
function RenderBlocks(props) {
|
|
141
158
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.blocks.map((block) => /* @__PURE__ */ import_react.default.createElement(RenderBlock, { block, key: block.id })));
|
|
@@ -191,6 +208,21 @@ function Anchor(props) {
|
|
|
191
208
|
return /* @__PURE__ */ import_react.default.createElement("a", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Anchor.Children, { block: props.block }) }));
|
|
192
209
|
}
|
|
193
210
|
Anchor.Children = RenderBlockChildrenFactory();
|
|
211
|
+
function Asset(props) {
|
|
212
|
+
var _a, _b, _c;
|
|
213
|
+
const contentTypeId = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.contentTypeId;
|
|
214
|
+
const components = useAssets();
|
|
215
|
+
const AssetElement = !!contentTypeId ? components == null ? void 0 : components[contentTypeId] : void 0;
|
|
216
|
+
const attributes = getAttributes(props);
|
|
217
|
+
return !!AssetElement ? /* @__PURE__ */ import_react.default.createElement(AssetElement, __spreadValues({}, props)) : /* @__PURE__ */ import_react.default.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Asset.Children, { block: props.block }) }));
|
|
218
|
+
}
|
|
219
|
+
Asset.Children = function(props) {
|
|
220
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
221
|
+
const href = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.uri;
|
|
222
|
+
const entryTitle = ((_e = (_d = props == null ? void 0 : props.block) == null ? void 0 : _d.value) == null ? void 0 : _e.entryTitle) || "";
|
|
223
|
+
const entryDescription = ((_g = (_f = props == null ? void 0 : props.block) == null ? void 0 : _f.value) == null ? void 0 : _g.entryDescription) || "";
|
|
224
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", null, !!href ? /* @__PURE__ */ import_react.default.createElement("a", { href }, entryTitle) : entryTitle), !!entryDescription ? /* @__PURE__ */ import_react.default.createElement("div", null, entryDescription) : null);
|
|
225
|
+
};
|
|
194
226
|
function Code(props) {
|
|
195
227
|
var _a, _b, _c, _d;
|
|
196
228
|
const attributes = getAttributes(props, {
|
|
@@ -231,6 +263,21 @@ function Divider(props) {
|
|
|
231
263
|
return /* @__PURE__ */ import_react.default.createElement("hr", __spreadValues({}, attributes));
|
|
232
264
|
}
|
|
233
265
|
Divider.Children = EmptyChildrenFactory();
|
|
266
|
+
function Entry(props) {
|
|
267
|
+
var _a, _b, _c;
|
|
268
|
+
const contentTypeId = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.contentTypeId;
|
|
269
|
+
const components = useEntries();
|
|
270
|
+
const EntryElement = !!contentTypeId ? components == null ? void 0 : components[contentTypeId] : void 0;
|
|
271
|
+
const attributes = getAttributes(props);
|
|
272
|
+
return !!EntryElement ? /* @__PURE__ */ import_react.default.createElement(EntryElement, __spreadValues({}, props)) : /* @__PURE__ */ import_react.default.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(Entry.Children, { block: props.block }) }));
|
|
273
|
+
}
|
|
274
|
+
Entry.Children = function(props) {
|
|
275
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
276
|
+
const href = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.uri;
|
|
277
|
+
const entryTitle = ((_e = (_d = props == null ? void 0 : props.block) == null ? void 0 : _d.value) == null ? void 0 : _e.entryTitle) || "";
|
|
278
|
+
const entryDescription = ((_g = (_f = props == null ? void 0 : props.block) == null ? void 0 : _f.value) == null ? void 0 : _g.entryDescription) || "";
|
|
279
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", null, !!href ? /* @__PURE__ */ import_react.default.createElement("a", { href }, entryTitle) : entryTitle), !!entryDescription ? /* @__PURE__ */ import_react.default.createElement("div", null, entryDescription) : null);
|
|
280
|
+
};
|
|
234
281
|
function FormContentType(_props) {
|
|
235
282
|
return null;
|
|
236
283
|
}
|
|
@@ -393,7 +440,9 @@ function TableHeader(props) {
|
|
|
393
440
|
}
|
|
394
441
|
TableHeader.Children = RenderBlockChildrenFactory();
|
|
395
442
|
function TableHeaderCell(props) {
|
|
396
|
-
const
|
|
443
|
+
const renderContext = (0, import_react.useContext)(BlockRenderContext);
|
|
444
|
+
const sectionAncestor = findAncestorOfType(renderContext.ancestors, ["_tableHeader", "_tableBody", "_tableFooter"]);
|
|
445
|
+
const attributes = getAttributes(props, { scope: (sectionAncestor == null ? void 0 : sectionAncestor.type) === "_tableHeader" ? "col" : "row" });
|
|
397
446
|
return /* @__PURE__ */ import_react.default.createElement("th", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(TableHeaderCell.Children, { block: props.block }) }));
|
|
398
447
|
}
|
|
399
448
|
TableHeaderCell.Children = RenderBlockChildrenFactory();
|
|
@@ -421,6 +470,13 @@ function Decorators(props) {
|
|
|
421
470
|
function DecoratorChildren(props) {
|
|
422
471
|
return /* @__PURE__ */ import_react.default.createElement(Decorators, { block: props.block, decorators: props.otherDecorators });
|
|
423
472
|
}
|
|
473
|
+
function Abbreviation(props) {
|
|
474
|
+
var _a, _b, _c;
|
|
475
|
+
const title = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.abbreviation) == null ? void 0 : _c.title;
|
|
476
|
+
const attributes = getAttributes(props, { title });
|
|
477
|
+
return /* @__PURE__ */ import_react.default.createElement("abbr", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(InlineCode.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
478
|
+
}
|
|
479
|
+
Abbreviation.Children = DecoratorChildren;
|
|
424
480
|
function InlineCode(props) {
|
|
425
481
|
const attributes = getAttributes(props);
|
|
426
482
|
return /* @__PURE__ */ import_react.default.createElement("code", __spreadValues({}, attributes), /* @__PURE__ */ import_react.default.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ import_react.default.createElement(InlineCode.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
@@ -490,9 +546,11 @@ function Variable(props) {
|
|
|
490
546
|
Variable.Children = DecoratorChildren;
|
|
491
547
|
var BLOCK_RENDERERS = {
|
|
492
548
|
"_anchor": Anchor,
|
|
549
|
+
"_asset": Asset,
|
|
493
550
|
"_code": CodeWithCaption,
|
|
494
551
|
"_component": Component,
|
|
495
552
|
"_divider": Divider,
|
|
553
|
+
"_entry": Entry,
|
|
496
554
|
"_formContentType": FormContentType,
|
|
497
555
|
"_fragment": Fragment,
|
|
498
556
|
"_heading": Heading,
|
|
@@ -515,6 +573,7 @@ var BLOCK_RENDERERS = {
|
|
|
515
573
|
"_tableRow": TableRow
|
|
516
574
|
};
|
|
517
575
|
var DECORATOR_RENDERERS = {
|
|
576
|
+
"abbreviation": Abbreviation,
|
|
518
577
|
"code": InlineCode,
|
|
519
578
|
"delete": Delete,
|
|
520
579
|
"emphasis": Emphasis,
|
|
@@ -531,12 +590,15 @@ var DECORATOR_RENDERERS = {
|
|
|
531
590
|
};
|
|
532
591
|
// Annotate the CommonJS export names for ESM import in node:
|
|
533
592
|
0 && (module.exports = {
|
|
593
|
+
Abbreviation,
|
|
534
594
|
Anchor,
|
|
595
|
+
Asset,
|
|
535
596
|
Code,
|
|
536
597
|
Component,
|
|
537
598
|
Delete,
|
|
538
599
|
Divider,
|
|
539
600
|
Emphasis,
|
|
601
|
+
Entry,
|
|
540
602
|
FormContentType,
|
|
541
603
|
Fragment,
|
|
542
604
|
Heading,
|
package/dist/canvas-react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/renderer.tsx"],"sourcesContent":["export * from '@contensis/canvas-types';\nexport * from './renderer';\n","import React, { ClassType, ComponentClass, FunctionComponent, Component as ReactComponent, createContext, useContext } from 'react';\nimport {\n AnchorBlock,\n Block,\n CodeBlock,\n ComponentBlock,\n DecoratorType,\n DividerBlock,\n FormContentTypeBlock,\n FragmentBlock,\n HeadingBlock,\n ImageBlock,\n InlineEntryBlock,\n LinkBlock,\n LiquidBlock,\n ListBlock,\n ListItemBlock,\n PanelBlock,\n ParagraphBlock,\n QuoteBlock,\n TableBlock,\n TableBodyBlock,\n TableCaptionBlock, TableCellBlock,\n TableFooterBlock,\n TableHeaderBlock,\n TableHeaderCellBlock,\n TableRowBlock\n} from '@contensis/canvas-types';\n\ntype Attributes = Record<string, any>;\ntype WithChildren = { children?: JSX.Element | undefined };\n\ntype RendererProps = { data: Block[] };\ntype RenderBlocksProps = { blocks: Block[] };\ntype RenderBlockProps<T extends Block> = { block: T };\ntype RenderBlockPropsWithChildren<T extends Block>\n = RenderBlockProps<T> & WithChildren & Attributes;\n\ntype RenderContentsProps = { contents: undefined | JSX.Element, fallback: JSX.Element };\ntype RenderTextProps = { text: string };\n\ntype DecoratorProps = { block: FragmentBlock, decorators: undefined | DecoratorType[] };\n\ntype TypedBlock<TType extends Block['type']> = Extract<Block, { type: TType }>;\n\ntype Renderer<TProps> = FunctionComponent<TProps> | ClassType<TProps, ReactComponent<TProps>, ComponentClass<TProps>>;\n\ntype BlockRenderer<T extends Block> = Renderer<RenderBlockPropsWithChildren<T>>;\ntype BlockRenderers = {\n [TType in Block['type']]: BlockRenderer<TypedBlock<TType>>\n};\n\n\ntype RenderDecoratorProps = { block: FragmentBlock, decorator: undefined | DecoratorType, otherDecorators: undefined | DecoratorType[] };\ntype RenderDecoratorPropsWithChildren = RenderDecoratorProps & WithChildren & Attributes;\n\ntype DecoratorRenderer = Renderer<RenderDecoratorPropsWithChildren>;\ntype DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;\n\ntype ComponentRenderer = Renderer<RenderBlockPropsWithChildren<ComponentBlock>>;\ntype ComponentRenderers = Record<string, ComponentRenderer>;\n\ntype RendererContextValue = {\n blocks?: BlockRenderers,\n decorators?: DecoratorRenderers,\n components?: ComponentRenderers\n};\n\ntype RendererOverridesContextValue = {\n blocks?: Partial<BlockRenderers>,\n decorators?: Partial<DecoratorRenderers>,\n components?: ComponentRenderers\n};\n\ntype RendererContextProviderProps = WithChildren & RendererOverridesContextValue;\n\nexport type { BlockRenderer, RenderBlockProps, RenderBlockPropsWithChildren, RenderDecoratorProps, RenderDecoratorPropsWithChildren };\n\nexport const RendererContext = createContext<RendererContextValue>({});\n\n/** \n * Provides context to the <Renderer> component to return Canvas data as React components\n *\n * @link https://www.npmjs.com/package/@contensis/canvas-react#usage\n *\n * @param blocks - Override the default rendering of Canvas content blocks\n * @param components - Render method for Contensis Components within the Canvas field\n * @param decorators - Override the rendering of HTML elements within a text field\n * \n * @example \n * <RenderContextProvider blocks={{ _table: Table }} components={{ banner: Banner }} decorators={{ strong: Strong }}>\n * <Renderer data={data} />\n * </RenderContextProvider>\n * \n */\nexport function RenderContextProvider(props: RendererContextProviderProps) {\n\n const overrideBlocks = props.blocks;\n const blocks = Object.keys(BLOCK_RENDERERS)\n .reduce((prev, type) => {\n const blockType = type as Block['type'];\n const renderer: any = overrideBlocks?.[blockType] || BLOCK_RENDERERS[blockType];\n (prev as any)[blockType] = renderer;\n return prev;\n }, {} as BlockRenderers);\n\n const overrideDecorators = props.decorators;\n const decorators = Object.keys(DECORATOR_RENDERERS)\n .reduce((prev, type) => {\n const decoratorType = type as DecoratorType;\n prev[decoratorType] = overrideDecorators?.[decoratorType] || DECORATOR_RENDERERS[decoratorType];\n return prev;\n }, {} as DecoratorRenderers);\n\n const value = { blocks, decorators, components: props.components };\n\n return (\n <RendererContext.Provider value={value}>\n {props.children}\n </RendererContext.Provider>\n );\n}\n\nfunction useBlocks() {\n const value = useContext(RendererContext);\n return value.blocks || BLOCK_RENDERERS;\n}\n\nfunction useDecorators() {\n const value = useContext(RendererContext);\n return value.decorators || DECORATOR_RENDERERS;\n}\n\nfunction useComponents() {\n const value = useContext(RendererContext);\n return value.components || {};\n}\n\nfunction RenderBlock<TBlock extends Block>(props: RenderBlockProps<TBlock>) {\n const blocks = useBlocks();\n const Component = blocks[props.block.type] as BlockRenderer<TBlock>;\n return !!Component ? (<Component block={props.block} />) : null;\n}\n\nfunction RenderBlocks(props: RenderBlocksProps) {\n return (<>{props.blocks.map(block => <RenderBlock block={block} key={block.id} />)}</>);\n}\n\nfunction RenderContents(props: RenderContentsProps) {\n return (props.contents ? props.contents : props.fallback);\n}\n\nexport function RenderChildren(props: RenderBlockProps<Block>) {\n const isArray = Array.isArray(props.block?.value);\n const isString = typeof props.block?.value === 'string';\n\n const render = () => {\n if (isArray) {\n return (<RenderBlocks blocks={props.block.value as any} />);\n } else if (isString) {\n return (<RenderText text={props.block.value as any} />);\n } else {\n return (<RenderText text={''} />);\n }\n };\n\n return render();\n};\n\nfunction RenderText(props: RenderTextProps) {\n return (<>{props.text}</>);\n};\n\n/** \n * The default render method for processing Canvas data \n * \n * @link https://www.npmjs.com/package/@contensis/canvas-react#usage\n * \n * @param data - Accepts Canvas data\n * \n * */\nexport function Renderer(props: RendererProps) {\n return (<RenderBlocks blocks={props.data} />);\n}\n\ntype AttributeProps = RenderBlockProps<Block>\n | RenderBlockPropsWithChildren<Block>\n | RenderDecoratorProps\n | RenderDecoratorPropsWithChildren;\n\nfunction getAttributes(props: AttributeProps, extra: Record<string, any> = {}) {\n const { block, ...rest } = props;\n let { children, decorator, otherDecorators, ...attributes } = rest as Record<string, any>;\n attributes = {\n id: block?.properties?.id,\n ...extra,\n ...attributes\n };\n return attributes;\n}\n\nfunction WithCaption(props: WithChildren & { caption: undefined | string }) {\n return (\n !!props.caption\n ? (\n <figure>\n {props.children}\n <figcaption>{props.caption}</figcaption>\n </figure>\n )\n : (props.children || null)\n );\n};\n\nfunction RenderBlockChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<RenderChildren block={props.block} />);\n };\n}\n\nfunction EmptyChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<></>);\n };\n}\n\nexport function Anchor(props: RenderBlockPropsWithChildren<AnchorBlock>) {\n const attributes = getAttributes(props);\n return (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Anchor.Children block={props.block} />} />\n </a>\n );\n}\n\nAnchor.Children = RenderBlockChildrenFactory<AnchorBlock>();\n\nexport function Code(props: RenderBlockPropsWithChildren<CodeBlock>) {\n const attributes = getAttributes(props, {\n 'data-language': props.block?.value?.language\n });\n const codeAttributes = getAttributes(props, {\n className: `language-${props.block?.value?.language}`\n });\n return (\n <pre {...attributes}>\n <code {...codeAttributes}>\n <RenderContents contents={props.children} fallback={<Code.Children block={props.block} />} />\n </code>\n </pre>\n );\n}\n\nCode.Children = function (props: RenderBlockProps<CodeBlock>) {\n return (<>{props.block?.value?.code}</>);\n};\n\nfunction CodeWithCaption(props: RenderBlockPropsWithChildren<CodeBlock>) {\n return (\n <WithCaption caption={props.block?.value?.caption}>\n <Code {...props} />\n </WithCaption>\n );\n}\n\nexport function Component(props: RenderBlockPropsWithChildren<ComponentBlock>) {\n const component = props?.block.properties?.component;\n const components = useComponents();\n const ComponentElement = !!component ? components?.[component] : undefined;\n\n const value = props.block.value ? JSON.stringify(props.block.value) : '';\n const attributes = getAttributes(props, {\n className: 'component',\n 'data-component': props.block.properties?.component,\n 'data-component-value': value,\n });\n\n return (!!ComponentElement)\n ? (<ComponentElement {...props} />)\n : (\n <div {...attributes}>\n <RenderContents contents={props.children} fallback={<Component.Children block={props.block} />} />\n </div>\n );\n}\n\nComponent.Children = function (props: RenderBlockProps<ComponentBlock>) {\n return (<>Component: {props.block?.properties?.component}</>);\n};\n\nexport function Divider(props: RenderBlockPropsWithChildren<DividerBlock>) {\n const attributes = getAttributes(props);\n return (<hr {...attributes} />);\n}\n\nDivider.Children = EmptyChildrenFactory<DividerBlock>();\n\nexport function FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>) {\n return null;\n}\n\nFormContentType.Children = function (_props: RenderBlockProps<FormContentTypeBlock>) {\n return null;\n};\n\nexport function Fragment(props: RenderBlockPropsWithChildren<FragmentBlock>) {\n const hasDecorators = !!props.block?.properties?.decorators?.length;\n const decorators = props.block?.properties?.decorators;\n return (\n hasDecorators\n ? (<Decorators block={props.block} decorators={decorators}></Decorators>)\n : (<RenderContents contents={props.children} fallback={<Fragment.Children block={props.block} />} />)\n );\n}\n\nFragment.Children = RenderBlockChildrenFactory<FragmentBlock>();\n\nexport function Heading(props: RenderBlockPropsWithChildren<HeadingBlock>) {\n const attributes = getAttributes(props);\n const render = () => {\n switch (props?.block?.properties?.level) {\n case 2: {\n return (\n <h2 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h2>\n );\n }\n case 3: {\n return (\n <h3 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h3>\n );\n }\n case 4: {\n return (\n <h4 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h4>\n );\n }\n case 5: {\n return (\n <h5 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h5>\n );\n }\n case 6: {\n return (\n <h6 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h6>\n );\n }\n default: {\n return (\n <h1 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h1>\n );\n }\n }\n };\n return render();\n}\n\nHeading.Children = RenderBlockChildrenFactory<HeadingBlock>();\n\nexport function Image(props: RenderBlockPropsWithChildren<ImageBlock>) {\n const src = props.block?.value?.asset?.sys?.uri;\n const attributes = getAttributes(props, {\n src,\n alt: props.block?.value?.altText,\n title: props?.block?.value?.caption,\n });\n return (<img {...attributes} />);\n}\n\nImage.Children = EmptyChildrenFactory<ImageBlock>();\n\nfunction ImageWithCaption(props: RenderBlockPropsWithChildren<ImageBlock>) {\n return (\n <WithCaption caption={props.block?.value?.caption}>\n <Image {...props} />\n </WithCaption>\n );\n}\n\nexport function InlineEntry(props: RenderBlockPropsWithChildren<InlineEntryBlock>) {\n const href = props?.block?.value?.sys?.uri;\n const attributes = getAttributes(props, {\n href\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />)\n );\n}\n\nInlineEntry.Children = function (props: RenderBlockProps<InlineEntryBlock>) {\n const entryTitle = props?.block?.value?.entryTitle || '';\n return (<>{entryTitle}</>);\n};\n\nexport function Link(props: RenderBlockPropsWithChildren<LinkBlock>) {\n const linkValue = props?.block?.properties?.link;\n const attributes = getAttributes(props, {\n href: linkValue?.sys?.uri,\n target: props?.block?.properties?.newTab ? '_blank' : null,\n rel: props?.block?.properties?.newTab ? 'noopener noreferrer' : null\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />)\n );\n}\n\nLink.Children = RenderBlockChildrenFactory<LinkBlock>();\n\nexport function Liquid(props: RenderBlockPropsWithChildren<LiquidBlock>) { \n return (\n <RenderContents contents={props.children} fallback={<Liquid.Children block={props.block} />} /> \n );\n}\n\nLiquid.Children = function (props: RenderBlockProps<LiquidBlock>) {\n return (<>{props.block?.value}</>);\n};\n\nexport function List(props: RenderBlockPropsWithChildren<ListBlock>) {\n const isOrdered = (props.block?.properties?.listType === 'ordered');\n const attributes = getAttributes(props, {\n start: isOrdered ? props.block?.properties?.start : null,\n });\n return (isOrdered\n ? (\n <ol {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ol>\n )\n : (\n <ul {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ul>\n )\n );\n}\n\nList.Children = RenderBlockChildrenFactory<ListBlock>();\n\nexport function ListItem(props: RenderBlockPropsWithChildren<ListItemBlock>) {\n const attributes = getAttributes(props);\n return (\n <li {...attributes}>\n <RenderContents contents={props.children} fallback={<ListItem.Children block={props.block} />} />\n </li>\n );\n}\n\nListItem.Children = RenderBlockChildrenFactory<ListItemBlock>();\n\nexport function Panel(props: RenderBlockPropsWithChildren<PanelBlock>) {\n const attributes = getAttributes(props, {\n className: ['panel', props.block?.properties?.panelType || 'info'].join(' ')\n });\n return (\n <aside {...attributes}>\n <RenderContents contents={props.children} fallback={<Panel.Children block={props.block} />} />\n </aside>\n );\n}\n\nPanel.Children = RenderBlockChildrenFactory<PanelBlock>();\n\nexport function Paragraph(props: RenderBlockPropsWithChildren<ParagraphBlock>) {\n const attributes = getAttributes(props, {\n className: props.block?.properties?.paragraphType\n });\n return (\n <p {...attributes}>\n <RenderContents contents={props.children} fallback={<Paragraph.Children block={props.block} />} />\n </p>\n );\n}\n\nParagraph.Children = RenderBlockChildrenFactory<ParagraphBlock>();\n\n\nexport function Quote(props: RenderBlockPropsWithChildren<QuoteBlock>) {\n const attributes = getAttributes(props, {\n 'cite': props.block?.properties?.url\n });\n return (\n <blockquote {...attributes}>\n <RenderContents contents={props.children} fallback={<Quote.Children block={props.block} />} />\n </blockquote>\n );\n}\n\nQuote.Children = function (props: RenderBlockProps<QuoteBlock>) {\n const source = props.block?.properties?.source;\n const citation = props.block?.properties?.citation;\n const hasChildren = !!source || !!citation;\n return (\n hasChildren\n ? (\n <>\n <p>\n <RenderChildren block={props.block} />\n </p>\n <footer>{source} {!!citation ? (<cite>{citation}</cite>) : (<></>)}</footer>\n </>\n )\n : (<RenderChildren block={props.block} />)\n );\n};\n\n\nexport function Table(props: RenderBlockPropsWithChildren<TableBlock>) {\n const attributes = getAttributes(props);\n return (\n <table {...attributes}>\n <RenderContents contents={props.children} fallback={<Table.Children block={props.block} />} />\n </table>\n );\n}\n\nTable.Children = RenderBlockChildrenFactory<TableBlock>();\n\nexport function TableBody(props: RenderBlockPropsWithChildren<TableBodyBlock>) {\n const attributes = getAttributes(props);\n return (\n <tbody {...attributes}>\n <RenderContents contents={props.children} fallback={<TableBody.Children block={props.block} />} />\n </tbody>\n );\n}\n\nTableBody.Children = RenderBlockChildrenFactory<TableBodyBlock>();\n\nexport function TableCaption(props: RenderBlockPropsWithChildren<TableCaptionBlock>) {\n const attributes = getAttributes(props);\n return (\n <caption {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCaption.Children block={props.block} />} />\n </caption>\n );\n}\n\nTableCaption.Children = RenderBlockChildrenFactory<TableCaptionBlock>();\n\nexport function TableCell(props: RenderBlockPropsWithChildren<TableCellBlock>) {\n const attributes = getAttributes(props);\n return (\n <td {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCell.Children block={props.block} />} />\n </td>\n );\n}\n\nTableCell.Children = RenderBlockChildrenFactory<TableCellBlock>();\n\nexport function TableFooter(props: RenderBlockPropsWithChildren<TableFooterBlock>) {\n const attributes = getAttributes(props);\n return (\n <tfoot {...attributes}>\n <RenderContents contents={props.children} fallback={<TableFooter.Children block={props.block} />} />\n </tfoot>\n );\n}\n\nTableFooter.Children = RenderBlockChildrenFactory<TableFooterBlock>();\n\nexport function TableHeader(props: RenderBlockPropsWithChildren<TableHeaderBlock>) {\n const attributes = getAttributes(props);\n return (\n <thead {...attributes}>\n <RenderContents contents={props.children} fallback={<TableHeader.Children block={props.block} />} />\n </thead>\n );\n}\n\nTableHeader.Children = RenderBlockChildrenFactory<TableHeaderBlock>();\n\nexport function TableHeaderCell(props: RenderBlockPropsWithChildren<TableHeaderCellBlock>) {\n const attributes = getAttributes(props);\n return (\n <th {...attributes}>\n <RenderContents contents={props.children} fallback={<TableHeaderCell.Children block={props.block} />} />\n </th>\n );\n}\n\nTableHeaderCell.Children = RenderBlockChildrenFactory<TableHeaderCellBlock>();\n\nexport function TableRow(props: RenderBlockPropsWithChildren<TableRowBlock>) {\n const attributes = getAttributes(props);\n return (\n <tr {...attributes}>\n <RenderContents contents={props.children} fallback={<TableRow.Children block={props.block} />} />\n </tr>\n );\n}\n\nTableRow.Children = RenderBlockChildrenFactory<TableRowBlock>();\n\n\nfunction Decorators(props: DecoratorProps) {\n const decorators = useDecorators();\n const remainingDecorators = !!props.decorators ? [...props.decorators] : undefined;\n const firstDecorator = !!remainingDecorators ? remainingDecorators.shift() : undefined;\n const DecoratorComponent = !!firstDecorator ? decorators[firstDecorator] : undefined;\n\n const render = () => {\n if (!!DecoratorComponent) {\n return (<DecoratorComponent block={props.block} decorator={firstDecorator} otherDecorators={remainingDecorators} />);\n } else if (firstDecorator) {\n return (<Decorators block={props.block} decorators={remainingDecorators} />);\n } else {\n return (<Fragment.Children block={props.block} />);\n }\n };\n\n return render();\n}\n\nfunction DecoratorChildren(props: RenderDecoratorPropsWithChildren) {\n return (<Decorators block={props.block} decorators={props.otherDecorators} />)\n}\n\nexport function InlineCode(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <code {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineCode.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </code>\n );\n}\n\nInlineCode.Children = DecoratorChildren;\n\nexport function Delete(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <del {...attributes}>\n <RenderContents contents={props.children} fallback={<Delete.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </del>\n );\n}\n\nDelete.Children = DecoratorChildren;\n\nexport function Emphasis(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <em {...attributes}>\n <RenderContents contents={props.children} fallback={<Emphasis.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </em>\n );\n}\n\nEmphasis.Children = DecoratorChildren;\n\nexport function Insert(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <ins {...attributes}>\n <RenderContents contents={props.children} fallback={<Insert.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </ins>\n );\n}\n\nInsert.Children = DecoratorChildren;\n\nexport function Keyboard(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <kbd {...attributes}>\n <RenderContents contents={props.children} fallback={<Keyboard.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </kbd>\n );\n}\n\nKeyboard.Children = DecoratorChildren;\n\nexport function LineBreak(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (<br {...attributes} />);\n}\n\nLineBreak.Children = function (props: RenderDecoratorPropsWithChildren) {\n return (<></>)\n}\n\nexport function Mark(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <mark {...attributes}>\n <RenderContents contents={props.children} fallback={<Mark.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </mark>\n );\n}\n\nMark.Children = DecoratorChildren;\n\nexport function Strong(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <strong {...attributes}>\n <RenderContents contents={props.children} fallback={<Strong.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </strong>\n );\n}\n\nStrong.Children = DecoratorChildren;\n\nexport function Strikethrough(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <s {...attributes}>\n <RenderContents contents={props.children} fallback={<Strikethrough.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </s>\n );\n}\n\nStrikethrough.Children = DecoratorChildren;\n\nexport function Subscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sub {...attributes}>\n <RenderContents contents={props.children} fallback={<Subscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sub>\n );\n}\n\nSubscript.Children = DecoratorChildren;\n\nexport function Superscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sup {...attributes}>\n <RenderContents contents={props.children} fallback={<Superscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sup>\n );\n}\n\nSuperscript.Children = DecoratorChildren;\n\nexport function Underline(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <u {...attributes}>\n <RenderContents contents={props.children} fallback={<Underline.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </u>\n );\n}\n\nUnderline.Children = DecoratorChildren;\n\nexport function Variable(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <var {...attributes}>\n <RenderContents contents={props.children} fallback={<Variable.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </var>\n );\n}\n\nVariable.Children = DecoratorChildren;\n\nconst BLOCK_RENDERERS: BlockRenderers = {\n '_anchor': Anchor,\n '_code': CodeWithCaption,\n '_component': Component,\n '_divider': Divider,\n '_formContentType': FormContentType,\n '_fragment': Fragment,\n '_heading': Heading,\n '_image': ImageWithCaption,\n '_inlineEntry': InlineEntry,\n '_link': Link,\n '_liquid': Liquid,\n '_list': List,\n '_listItem': ListItem,\n '_panel': Panel,\n '_paragraph': Paragraph,\n '_quote': Quote,\n '_table': Table,\n '_tableBody': TableBody,\n '_tableCaption': TableCaption,\n '_tableCell': TableCell,\n '_tableFooter': TableFooter,\n '_tableHeader': TableHeader,\n '_tableHeaderCell': TableHeaderCell,\n '_tableRow': TableRow,\n};\n\nconst DECORATOR_RENDERERS: DecoratorRenderers = {\n 'code': InlineCode,\n 'delete': Delete,\n 'emphasis': Emphasis,\n 'insert': Insert,\n 'keyboard': Keyboard,\n 'linebreak': LineBreak,\n 'mark': Mark,\n 'strikethrough': Strikethrough,\n 'strong': Strong,\n 'subscript': Subscript,\n 'superscript': Superscript,\n 'underline': Underline,\n 'variable': Variable\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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","../src/renderer.tsx"],"sourcesContent":["export * from '@contensis/canvas-types';\nexport * from './renderer';\n","import React, { ClassType, ComponentClass, FunctionComponent, Component as ReactComponent, createContext, useContext } from 'react';\nimport {\n AnchorBlock,\n AssetBlock,\n Block,\n CodeBlock,\n ComponentBlock,\n DecoratorType,\n DividerBlock,\n EntryBlock,\n FormContentTypeBlock,\n FragmentBlock,\n HeadingBlock,\n ImageBlock,\n InlineEntryBlock,\n LinkBlock,\n LiquidBlock,\n ListBlock,\n ListItemBlock,\n PanelBlock,\n ParagraphBlock,\n QuoteBlock,\n TableBlock,\n TableBodyBlock,\n TableCaptionBlock, TableCellBlock,\n TableFooterBlock,\n TableHeaderBlock,\n TableHeaderCellBlock,\n TableRowBlock\n} from '@contensis/canvas-types';\n\ntype Attributes = Record<string, any>;\ntype WithChildren = { children?: JSX.Element | undefined };\n\ntype RendererProps = { data: Block[] };\ntype RenderBlocksProps = { blocks: Block[] };\ntype RenderBlockProps<T extends Block> = { block: T };\ntype RenderBlockPropsWithChildren<T extends Block>\n = RenderBlockProps<T> & WithChildren & Attributes;\n\ntype RenderContentsProps = { contents: undefined | JSX.Element, fallback: JSX.Element };\ntype RenderTextProps = { text: string };\n\ntype DecoratorProps = { block: FragmentBlock, decorators: undefined | DecoratorType[] };\n\ntype TypedBlock<TType extends Block['type']> = Extract<Block, { type: TType }>;\n\ntype Renderer<TProps> = FunctionComponent<TProps> | ClassType<TProps, ReactComponent<TProps>, ComponentClass<TProps>>;\n\ntype BlockRenderer<T extends Block> = Renderer<RenderBlockPropsWithChildren<T>>;\ntype BlockRenderers = {\n [TType in Block['type']]: BlockRenderer<TypedBlock<TType>>\n};\n\n\ntype RenderDecoratorProps = { block: FragmentBlock, decorator: undefined | DecoratorType, otherDecorators: undefined | DecoratorType[] };\ntype RenderDecoratorPropsWithChildren = RenderDecoratorProps & WithChildren & Attributes;\n\ntype DecoratorRenderer = Renderer<RenderDecoratorPropsWithChildren>;\ntype DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;\n\ntype ComponentRenderer = Renderer<RenderBlockPropsWithChildren<ComponentBlock>>;\ntype ComponentRenderers = Record<string, ComponentRenderer>;\ntype EntryRenderer = Renderer<RenderBlockPropsWithChildren<EntryBlock>>;\ntype EntryRenderers = Record<string, EntryRenderer>;\ntype AssetRenderer = Renderer<RenderBlockPropsWithChildren<AssetBlock>>;\ntype AssetRenderers = Record<string, AssetRenderer>;\n\ntype RendererContextValue = {\n blocks?: BlockRenderers,\n decorators?: DecoratorRenderers,\n components?: ComponentRenderers,\n entries?: EntryRenderers,\n assets?: AssetRenderers,\n};\n\ntype RendererOverridesContextValue = {\n blocks?: Partial<BlockRenderers>,\n decorators?: Partial<DecoratorRenderers>,\n components?: ComponentRenderers,\n entries?: EntryRenderers,\n assets?: AssetRenderers,\n};\n\ntype RendererContextProviderProps = WithChildren & RendererOverridesContextValue;\n\nexport type { BlockRenderer, RenderBlockProps, RenderBlockPropsWithChildren, RenderDecoratorProps, RenderDecoratorPropsWithChildren };\n\nexport const RendererContext = createContext<RendererContextValue>({});\n\nconst BlockRenderContext = createContext<{ ancestors: Block[] }>({ ancestors: [] });\n\nfunction findAncestorOfType<T extends Block>(ancestors: Block[], types: T['type'][]): T | undefined {\n return ancestors?.slice().reverse().find(ancestor => types.includes(ancestor.type as T['type'])) as T | undefined;\n}\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, entries: props.entries, assets: props?.assets };\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 useEntries() {\n const value = useContext(RendererContext);\n return value.entries || {};\n}\n\nfunction useAssets() {\n const value = useContext(RendererContext);\n return value.assets || {};\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 const renderContext = useContext(BlockRenderContext);\n const ancestors = [...renderContext.ancestors, props.block];\n return !!Component ? (\n <BlockRenderContext.Provider value={{ ancestors }}>\n <Component block={props.block} />\n </BlockRenderContext.Provider>\n ) : null;\n}\n\nfunction RenderBlocks(props: RenderBlocksProps) {\n return (<>{props.blocks.map(block => <RenderBlock block={block} key={block.id} />)}</>);\n}\n\nfunction RenderContents(props: RenderContentsProps) {\n return (props.contents ? props.contents : props.fallback);\n}\n\nexport function RenderChildren(props: RenderBlockProps<Block>) {\n const isArray = Array.isArray(props.block?.value);\n const isString = typeof props.block?.value === 'string';\n\n const render = () => {\n if (isArray) {\n return (<RenderBlocks blocks={props.block.value as any} />);\n } else if (isString) {\n return (<RenderText text={props.block.value as any} />);\n } else {\n return (<RenderText text={''} />);\n }\n };\n\n return render();\n};\n\nfunction RenderText(props: RenderTextProps) {\n return (<>{props.text}</>);\n};\n\n/** \n * The default render method for processing Canvas data \n * \n * @link https://www.npmjs.com/package/@contensis/canvas-react#usage\n * \n * @param data - Accepts Canvas data\n * \n * */\nexport function Renderer(props: RendererProps) {\n return (<RenderBlocks blocks={props.data} />);\n}\n\ntype AttributeProps = RenderBlockProps<Block>\n | RenderBlockPropsWithChildren<Block>\n | RenderDecoratorProps\n | RenderDecoratorPropsWithChildren;\n\nfunction getAttributes(props: AttributeProps, extra: Record<string, any> = {}) {\n const { block, ...rest } = props;\n let { children, decorator, otherDecorators, ...attributes } = rest as Record<string, any>;\n attributes = {\n id: block?.properties?.id,\n ...extra,\n ...attributes\n };\n return attributes;\n}\n\nfunction WithCaption(props: WithChildren & { caption: undefined | string }) {\n return (\n !!props.caption\n ? (\n <figure>\n {props.children}\n <figcaption>{props.caption}</figcaption>\n </figure>\n )\n : (props.children || null)\n );\n};\n\nfunction RenderBlockChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<RenderChildren block={props.block} />);\n };\n}\n\nfunction EmptyChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<></>);\n };\n}\n\nexport function Anchor(props: RenderBlockPropsWithChildren<AnchorBlock>) {\n const attributes = getAttributes(props);\n return (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Anchor.Children block={props.block} />} />\n </a>\n );\n}\n\nAnchor.Children = RenderBlockChildrenFactory<AnchorBlock>();\n\nexport function Asset(props: RenderBlockPropsWithChildren<AssetBlock>) {\n const contentTypeId = props?.block?.value?.sys?.contentTypeId;\n const components = useAssets();\n const AssetElement = !!contentTypeId ? components?.[contentTypeId] : undefined;\n const attributes = getAttributes(props);\n return (!!AssetElement)\n ? <AssetElement {...props} />\n : (\n <div {...attributes}>\n <RenderContents contents={props.children} fallback={<Asset.Children block={props.block} />} />\n </div>\n );\n}\n\nAsset.Children = function (props: RenderBlockProps<AssetBlock>) {\n const href = props?.block?.value?.sys?.uri;\n const entryTitle = props?.block?.value?.entryTitle || '';\n const entryDescription = props?.block?.value?.entryDescription || '';\n return (<>\n <div>\n {!!href ? <a href={href}>{entryTitle}</a> : entryTitle}\n </div>\n {!!entryDescription ? <div>{entryDescription}</div> : null}\n </>);\n};\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 Entry(props: RenderBlockPropsWithChildren<EntryBlock>) {\n const contentTypeId = props?.block?.value?.sys?.contentTypeId;\n const components = useEntries();\n const EntryElement = !!contentTypeId ? components?.[contentTypeId] : undefined;\n const attributes = getAttributes(props);\n return (!!EntryElement)\n ? <EntryElement {...props} />\n : (\n <div {...attributes}>\n <RenderContents contents={props.children} fallback={<Entry.Children block={props.block} />} />\n </div>\n );\n}\n\nEntry.Children = function (props: RenderBlockProps<EntryBlock>) {\n const href = props?.block?.value?.sys?.uri;\n const entryTitle = props?.block?.value?.entryTitle || '';\n const entryDescription = props?.block?.value?.entryDescription || '';\n return (<>\n <div>\n {!!href ? <a href={href}>{entryTitle}</a> : entryTitle}\n </div>\n {!!entryDescription ? <div>{entryDescription}</div> : null}\n </>);\n};\n\nexport function FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>) {\n return null;\n}\n\nFormContentType.Children = function (_props: RenderBlockProps<FormContentTypeBlock>) {\n return null;\n};\n\nexport function Fragment(props: RenderBlockPropsWithChildren<FragmentBlock>) {\n const hasDecorators = !!props.block?.properties?.decorators?.length;\n const decorators = props.block?.properties?.decorators;\n return (\n hasDecorators\n ? (<Decorators block={props.block} decorators={decorators}></Decorators>)\n : (<RenderContents contents={props.children} fallback={<Fragment.Children block={props.block} />} />)\n );\n}\n\nFragment.Children = RenderBlockChildrenFactory<FragmentBlock>();\n\nexport function Heading(props: RenderBlockPropsWithChildren<HeadingBlock>) {\n const attributes = getAttributes(props);\n const render = () => {\n switch (props?.block?.properties?.level) {\n case 2: {\n return (\n <h2 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h2>\n );\n }\n case 3: {\n return (\n <h3 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h3>\n );\n }\n case 4: {\n return (\n <h4 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h4>\n );\n }\n case 5: {\n return (\n <h5 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h5>\n );\n }\n case 6: {\n return (\n <h6 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h6>\n );\n }\n default: {\n return (\n <h1 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h1>\n );\n }\n }\n };\n return render();\n}\n\nHeading.Children = RenderBlockChildrenFactory<HeadingBlock>();\n\nexport function Image(props: RenderBlockPropsWithChildren<ImageBlock>) {\n const src = props.block?.value?.asset?.sys?.uri;\n const attributes = getAttributes(props, {\n src,\n alt: props.block?.value?.altText,\n title: props?.block?.value?.caption,\n });\n return (<img {...attributes} />);\n}\n\nImage.Children = EmptyChildrenFactory<ImageBlock>();\n\nfunction ImageWithCaption(props: RenderBlockPropsWithChildren<ImageBlock>) {\n return (\n <WithCaption caption={props.block?.value?.caption}>\n <Image {...props} />\n </WithCaption>\n );\n}\n\nexport function InlineEntry(props: RenderBlockPropsWithChildren<InlineEntryBlock>) {\n const href = props?.block?.value?.sys?.uri;\n const attributes = getAttributes(props, {\n href\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />)\n );\n}\n\nInlineEntry.Children = function (props: RenderBlockProps<InlineEntryBlock>) {\n const entryTitle = props?.block?.value?.entryTitle || '';\n return (<>{entryTitle}</>);\n};\n\nexport function Link(props: RenderBlockPropsWithChildren<LinkBlock>) {\n const linkValue = props?.block?.properties?.link;\n const attributes = getAttributes(props, {\n href: linkValue?.sys?.uri,\n target: props?.block?.properties?.newTab ? '_blank' : null,\n rel: props?.block?.properties?.newTab ? 'noopener noreferrer' : null\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />)\n );\n}\n\nLink.Children = RenderBlockChildrenFactory<LinkBlock>();\n\nexport function Liquid(props: RenderBlockPropsWithChildren<LiquidBlock>) {\n return (\n <RenderContents contents={props.children} fallback={<Liquid.Children block={props.block} />} />\n );\n}\n\nLiquid.Children = function (props: RenderBlockProps<LiquidBlock>) {\n return (<>{props.block?.value}</>);\n};\n\nexport function List(props: RenderBlockPropsWithChildren<ListBlock>) {\n const isOrdered = (props.block?.properties?.listType === 'ordered');\n const attributes = getAttributes(props, {\n start: isOrdered ? props.block?.properties?.start : null,\n });\n return (isOrdered\n ? (\n <ol {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ol>\n )\n : (\n <ul {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ul>\n )\n );\n}\n\nList.Children = RenderBlockChildrenFactory<ListBlock>();\n\nexport function ListItem(props: RenderBlockPropsWithChildren<ListItemBlock>) {\n const attributes = getAttributes(props);\n return (\n <li {...attributes}>\n <RenderContents contents={props.children} fallback={<ListItem.Children block={props.block} />} />\n </li>\n );\n}\n\nListItem.Children = RenderBlockChildrenFactory<ListItemBlock>();\n\nexport function Panel(props: RenderBlockPropsWithChildren<PanelBlock>) {\n const attributes = getAttributes(props, {\n className: ['panel', props.block?.properties?.panelType || 'info'].join(' ')\n });\n return (\n <aside {...attributes}>\n <RenderContents contents={props.children} fallback={<Panel.Children block={props.block} />} />\n </aside>\n );\n}\n\nPanel.Children = RenderBlockChildrenFactory<PanelBlock>();\n\nexport function Paragraph(props: RenderBlockPropsWithChildren<ParagraphBlock>) {\n const attributes = getAttributes(props, {\n className: props.block?.properties?.paragraphType\n });\n return (\n <p {...attributes}>\n <RenderContents contents={props.children} fallback={<Paragraph.Children block={props.block} />} />\n </p>\n );\n}\n\nParagraph.Children = RenderBlockChildrenFactory<ParagraphBlock>();\n\n\nexport function Quote(props: RenderBlockPropsWithChildren<QuoteBlock>) {\n const attributes = getAttributes(props, {\n 'cite': props.block?.properties?.url\n });\n return (\n <blockquote {...attributes}>\n <RenderContents contents={props.children} fallback={<Quote.Children block={props.block} />} />\n </blockquote>\n );\n}\n\nQuote.Children = function (props: RenderBlockProps<QuoteBlock>) {\n const source = props.block?.properties?.source;\n const citation = props.block?.properties?.citation;\n const hasChildren = !!source || !!citation;\n return (\n hasChildren\n ? (\n <>\n <p>\n <RenderChildren block={props.block} />\n </p>\n <footer>{source} {!!citation ? (<cite>{citation}</cite>) : (<></>)}</footer>\n </>\n )\n : (<RenderChildren block={props.block} />)\n );\n};\n\n\nexport function Table(props: RenderBlockPropsWithChildren<TableBlock>) {\n const attributes = getAttributes(props);\n return (\n <table {...attributes}>\n <RenderContents contents={props.children} fallback={<Table.Children block={props.block} />} />\n </table>\n );\n}\n\nTable.Children = RenderBlockChildrenFactory<TableBlock>();\n\nexport function TableBody(props: RenderBlockPropsWithChildren<TableBodyBlock>) {\n const attributes = getAttributes(props);\n return (\n <tbody {...attributes}>\n <RenderContents contents={props.children} fallback={<TableBody.Children block={props.block} />} />\n </tbody>\n );\n}\n\nTableBody.Children = RenderBlockChildrenFactory<TableBodyBlock>();\n\nexport function TableCaption(props: RenderBlockPropsWithChildren<TableCaptionBlock>) {\n const attributes = getAttributes(props);\n return (\n <caption {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCaption.Children block={props.block} />} />\n </caption>\n );\n}\n\nTableCaption.Children = RenderBlockChildrenFactory<TableCaptionBlock>();\n\nexport function TableCell(props: RenderBlockPropsWithChildren<TableCellBlock>) {\n const attributes = getAttributes(props);\n return (\n <td {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCell.Children block={props.block} />} />\n </td>\n );\n}\n\nTableCell.Children = RenderBlockChildrenFactory<TableCellBlock>();\n\nexport function TableFooter(props: RenderBlockPropsWithChildren<TableFooterBlock>) {\n const attributes = getAttributes(props);\n return (\n <tfoot {...attributes}>\n <RenderContents contents={props.children} fallback={<TableFooter.Children block={props.block} />} />\n </tfoot>\n );\n}\n\nTableFooter.Children = RenderBlockChildrenFactory<TableFooterBlock>();\n\nexport function TableHeader(props: RenderBlockPropsWithChildren<TableHeaderBlock>) {\n const attributes = getAttributes(props);\n return (\n <thead {...attributes}>\n <RenderContents contents={props.children} fallback={<TableHeader.Children block={props.block} />} />\n </thead>\n );\n}\n\nTableHeader.Children = RenderBlockChildrenFactory<TableHeaderBlock>();\n\nexport function TableHeaderCell(props: RenderBlockPropsWithChildren<TableHeaderCellBlock>) {\n const renderContext = useContext(BlockRenderContext);\n const sectionAncestor = findAncestorOfType(renderContext.ancestors, ['_tableHeader', '_tableBody', '_tableFooter']);\n const attributes = getAttributes(props, { scope: sectionAncestor?.type === '_tableHeader' ? 'col' : 'row' });\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 Abbreviation(props: RenderDecoratorPropsWithChildren) {\n const title = props?.block?.properties?.abbreviation?.title;\n const attributes = getAttributes(props, { title });\n return (\n <abbr {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineCode.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </abbr>\n );\n}\n\nAbbreviation.Children = DecoratorChildren;\n\nexport function InlineCode(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <code {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineCode.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </code>\n );\n}\n\nInlineCode.Children = DecoratorChildren;\n\nexport function Delete(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <del {...attributes}>\n <RenderContents contents={props.children} fallback={<Delete.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </del>\n );\n}\n\nDelete.Children = DecoratorChildren;\n\nexport function Emphasis(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <em {...attributes}>\n <RenderContents contents={props.children} fallback={<Emphasis.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </em>\n );\n}\n\nEmphasis.Children = DecoratorChildren;\n\nexport function Insert(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <ins {...attributes}>\n <RenderContents contents={props.children} fallback={<Insert.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </ins>\n );\n}\n\nInsert.Children = DecoratorChildren;\n\nexport function Keyboard(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <kbd {...attributes}>\n <RenderContents contents={props.children} fallback={<Keyboard.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </kbd>\n );\n}\n\nKeyboard.Children = DecoratorChildren;\n\nexport function LineBreak(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (<br {...attributes} />);\n}\n\nLineBreak.Children = function (props: RenderDecoratorPropsWithChildren) {\n return (<></>)\n}\n\nexport function Mark(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <mark {...attributes}>\n <RenderContents contents={props.children} fallback={<Mark.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </mark>\n );\n}\n\nMark.Children = DecoratorChildren;\n\nexport function Strong(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <strong {...attributes}>\n <RenderContents contents={props.children} fallback={<Strong.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </strong>\n );\n}\n\nStrong.Children = DecoratorChildren;\n\nexport function Strikethrough(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <s {...attributes}>\n <RenderContents contents={props.children} fallback={<Strikethrough.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </s>\n );\n}\n\nStrikethrough.Children = DecoratorChildren;\n\nexport function Subscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sub {...attributes}>\n <RenderContents contents={props.children} fallback={<Subscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sub>\n );\n}\n\nSubscript.Children = DecoratorChildren;\n\nexport function Superscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sup {...attributes}>\n <RenderContents contents={props.children} fallback={<Superscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sup>\n );\n}\n\nSuperscript.Children = DecoratorChildren;\n\nexport function Underline(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <u {...attributes}>\n <RenderContents contents={props.children} fallback={<Underline.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </u>\n );\n}\n\nUnderline.Children = DecoratorChildren;\n\nexport function Variable(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <var {...attributes}>\n <RenderContents contents={props.children} fallback={<Variable.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </var>\n );\n}\n\nVariable.Children = DecoratorChildren;\n\nconst BLOCK_RENDERERS: BlockRenderers = {\n '_anchor': Anchor,\n '_asset': Asset,\n '_code': CodeWithCaption,\n '_component': Component,\n '_divider': Divider,\n '_entry': Entry,\n '_formContentType': FormContentType,\n '_fragment': Fragment,\n '_heading': Heading,\n '_image': ImageWithCaption,\n '_inlineEntry': InlineEntry,\n '_link': Link,\n '_liquid': Liquid,\n '_list': List,\n '_listItem': ListItem,\n '_panel': Panel,\n '_paragraph': Paragraph,\n '_quote': Quote,\n '_table': Table,\n '_tableBody': TableBody,\n '_tableCaption': TableCaption,\n '_tableCell': TableCell,\n '_tableFooter': TableFooter,\n '_tableHeader': TableHeader,\n '_tableHeaderCell': TableHeaderCell,\n '_tableRow': TableRow,\n};\n\nconst DECORATOR_RENDERERS: DecoratorRenderers = {\n 'abbreviation': Abbreviation,\n 'code': InlineCode,\n 'delete': Delete,\n 'emphasis': Emphasis,\n 'insert': Insert,\n 'keyboard': Keyboard,\n 'linebreak': LineBreak,\n 'mark': Mark,\n 'strikethrough': Strikethrough,\n 'strong': Strong,\n 'subscript': Subscript,\n 'superscript': Superscript,\n 'underline': Underline,\n 'variable': Variable\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA4H;AAwFrH,IAAM,sBAAkB,4BAAoC,CAAC,CAAC;AAErE,IAAM,yBA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Aa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAChB;","names":["React","Component","React","React","React"]}
|
package/dist/canvas-react.mjs
CHANGED
|
@@ -30,6 +30,10 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
// src/renderer.tsx
|
|
31
31
|
import React, { createContext, useContext } from "react";
|
|
32
32
|
var RendererContext = createContext({});
|
|
33
|
+
var BlockRenderContext = createContext({ ancestors: [] });
|
|
34
|
+
function findAncestorOfType(ancestors, types) {
|
|
35
|
+
return ancestors == null ? void 0 : ancestors.slice().reverse().find((ancestor) => types.includes(ancestor.type));
|
|
36
|
+
}
|
|
33
37
|
function RenderContextProvider(props) {
|
|
34
38
|
const overrideBlocks = props.blocks;
|
|
35
39
|
const blocks = Object.keys(BLOCK_RENDERERS).reduce((prev, type) => {
|
|
@@ -44,7 +48,7 @@ function RenderContextProvider(props) {
|
|
|
44
48
|
prev[decoratorType] = (overrideDecorators == null ? void 0 : overrideDecorators[decoratorType]) || DECORATOR_RENDERERS[decoratorType];
|
|
45
49
|
return prev;
|
|
46
50
|
}, {});
|
|
47
|
-
const value = { blocks, decorators, components: props.components };
|
|
51
|
+
const value = { blocks, decorators, components: props.components, entries: props.entries, assets: props == null ? void 0 : props.assets };
|
|
48
52
|
return /* @__PURE__ */ React.createElement(RendererContext.Provider, { value }, props.children);
|
|
49
53
|
}
|
|
50
54
|
function useBlocks() {
|
|
@@ -59,10 +63,20 @@ function useComponents() {
|
|
|
59
63
|
const value = useContext(RendererContext);
|
|
60
64
|
return value.components || {};
|
|
61
65
|
}
|
|
66
|
+
function useEntries() {
|
|
67
|
+
const value = useContext(RendererContext);
|
|
68
|
+
return value.entries || {};
|
|
69
|
+
}
|
|
70
|
+
function useAssets() {
|
|
71
|
+
const value = useContext(RendererContext);
|
|
72
|
+
return value.assets || {};
|
|
73
|
+
}
|
|
62
74
|
function RenderBlock(props) {
|
|
63
75
|
const blocks = useBlocks();
|
|
64
76
|
const Component2 = blocks[props.block.type];
|
|
65
|
-
|
|
77
|
+
const renderContext = useContext(BlockRenderContext);
|
|
78
|
+
const ancestors = [...renderContext.ancestors, props.block];
|
|
79
|
+
return !!Component2 ? /* @__PURE__ */ React.createElement(BlockRenderContext.Provider, { value: { ancestors } }, /* @__PURE__ */ React.createElement(Component2, { block: props.block })) : null;
|
|
66
80
|
}
|
|
67
81
|
function RenderBlocks(props) {
|
|
68
82
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.blocks.map((block) => /* @__PURE__ */ React.createElement(RenderBlock, { block, key: block.id })));
|
|
@@ -118,6 +132,21 @@ function Anchor(props) {
|
|
|
118
132
|
return /* @__PURE__ */ React.createElement("a", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Anchor.Children, { block: props.block }) }));
|
|
119
133
|
}
|
|
120
134
|
Anchor.Children = RenderBlockChildrenFactory();
|
|
135
|
+
function Asset(props) {
|
|
136
|
+
var _a, _b, _c;
|
|
137
|
+
const contentTypeId = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.contentTypeId;
|
|
138
|
+
const components = useAssets();
|
|
139
|
+
const AssetElement = !!contentTypeId ? components == null ? void 0 : components[contentTypeId] : void 0;
|
|
140
|
+
const attributes = getAttributes(props);
|
|
141
|
+
return !!AssetElement ? /* @__PURE__ */ React.createElement(AssetElement, __spreadValues({}, props)) : /* @__PURE__ */ React.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Asset.Children, { block: props.block }) }));
|
|
142
|
+
}
|
|
143
|
+
Asset.Children = function(props) {
|
|
144
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
145
|
+
const href = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.uri;
|
|
146
|
+
const entryTitle = ((_e = (_d = props == null ? void 0 : props.block) == null ? void 0 : _d.value) == null ? void 0 : _e.entryTitle) || "";
|
|
147
|
+
const entryDescription = ((_g = (_f = props == null ? void 0 : props.block) == null ? void 0 : _f.value) == null ? void 0 : _g.entryDescription) || "";
|
|
148
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", null, !!href ? /* @__PURE__ */ React.createElement("a", { href }, entryTitle) : entryTitle), !!entryDescription ? /* @__PURE__ */ React.createElement("div", null, entryDescription) : null);
|
|
149
|
+
};
|
|
121
150
|
function Code(props) {
|
|
122
151
|
var _a, _b, _c, _d;
|
|
123
152
|
const attributes = getAttributes(props, {
|
|
@@ -158,6 +187,21 @@ function Divider(props) {
|
|
|
158
187
|
return /* @__PURE__ */ React.createElement("hr", __spreadValues({}, attributes));
|
|
159
188
|
}
|
|
160
189
|
Divider.Children = EmptyChildrenFactory();
|
|
190
|
+
function Entry(props) {
|
|
191
|
+
var _a, _b, _c;
|
|
192
|
+
const contentTypeId = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.contentTypeId;
|
|
193
|
+
const components = useEntries();
|
|
194
|
+
const EntryElement = !!contentTypeId ? components == null ? void 0 : components[contentTypeId] : void 0;
|
|
195
|
+
const attributes = getAttributes(props);
|
|
196
|
+
return !!EntryElement ? /* @__PURE__ */ React.createElement(EntryElement, __spreadValues({}, props)) : /* @__PURE__ */ React.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(Entry.Children, { block: props.block }) }));
|
|
197
|
+
}
|
|
198
|
+
Entry.Children = function(props) {
|
|
199
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
200
|
+
const href = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.uri;
|
|
201
|
+
const entryTitle = ((_e = (_d = props == null ? void 0 : props.block) == null ? void 0 : _d.value) == null ? void 0 : _e.entryTitle) || "";
|
|
202
|
+
const entryDescription = ((_g = (_f = props == null ? void 0 : props.block) == null ? void 0 : _f.value) == null ? void 0 : _g.entryDescription) || "";
|
|
203
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", null, !!href ? /* @__PURE__ */ React.createElement("a", { href }, entryTitle) : entryTitle), !!entryDescription ? /* @__PURE__ */ React.createElement("div", null, entryDescription) : null);
|
|
204
|
+
};
|
|
161
205
|
function FormContentType(_props) {
|
|
162
206
|
return null;
|
|
163
207
|
}
|
|
@@ -320,7 +364,9 @@ function TableHeader(props) {
|
|
|
320
364
|
}
|
|
321
365
|
TableHeader.Children = RenderBlockChildrenFactory();
|
|
322
366
|
function TableHeaderCell(props) {
|
|
323
|
-
const
|
|
367
|
+
const renderContext = useContext(BlockRenderContext);
|
|
368
|
+
const sectionAncestor = findAncestorOfType(renderContext.ancestors, ["_tableHeader", "_tableBody", "_tableFooter"]);
|
|
369
|
+
const attributes = getAttributes(props, { scope: (sectionAncestor == null ? void 0 : sectionAncestor.type) === "_tableHeader" ? "col" : "row" });
|
|
324
370
|
return /* @__PURE__ */ React.createElement("th", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(TableHeaderCell.Children, { block: props.block }) }));
|
|
325
371
|
}
|
|
326
372
|
TableHeaderCell.Children = RenderBlockChildrenFactory();
|
|
@@ -348,6 +394,13 @@ function Decorators(props) {
|
|
|
348
394
|
function DecoratorChildren(props) {
|
|
349
395
|
return /* @__PURE__ */ React.createElement(Decorators, { block: props.block, decorators: props.otherDecorators });
|
|
350
396
|
}
|
|
397
|
+
function Abbreviation(props) {
|
|
398
|
+
var _a, _b, _c;
|
|
399
|
+
const title = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.abbreviation) == null ? void 0 : _c.title;
|
|
400
|
+
const attributes = getAttributes(props, { title });
|
|
401
|
+
return /* @__PURE__ */ React.createElement("abbr", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(InlineCode.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
402
|
+
}
|
|
403
|
+
Abbreviation.Children = DecoratorChildren;
|
|
351
404
|
function InlineCode(props) {
|
|
352
405
|
const attributes = getAttributes(props);
|
|
353
406
|
return /* @__PURE__ */ React.createElement("code", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ React.createElement(InlineCode.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) }));
|
|
@@ -417,9 +470,11 @@ function Variable(props) {
|
|
|
417
470
|
Variable.Children = DecoratorChildren;
|
|
418
471
|
var BLOCK_RENDERERS = {
|
|
419
472
|
"_anchor": Anchor,
|
|
473
|
+
"_asset": Asset,
|
|
420
474
|
"_code": CodeWithCaption,
|
|
421
475
|
"_component": Component,
|
|
422
476
|
"_divider": Divider,
|
|
477
|
+
"_entry": Entry,
|
|
423
478
|
"_formContentType": FormContentType,
|
|
424
479
|
"_fragment": Fragment,
|
|
425
480
|
"_heading": Heading,
|
|
@@ -442,6 +497,7 @@ var BLOCK_RENDERERS = {
|
|
|
442
497
|
"_tableRow": TableRow
|
|
443
498
|
};
|
|
444
499
|
var DECORATOR_RENDERERS = {
|
|
500
|
+
"abbreviation": Abbreviation,
|
|
445
501
|
"code": InlineCode,
|
|
446
502
|
"delete": Delete,
|
|
447
503
|
"emphasis": Emphasis,
|
|
@@ -457,12 +513,15 @@ var DECORATOR_RENDERERS = {
|
|
|
457
513
|
"variable": Variable
|
|
458
514
|
};
|
|
459
515
|
export {
|
|
516
|
+
Abbreviation,
|
|
460
517
|
Anchor,
|
|
518
|
+
Asset,
|
|
461
519
|
Code,
|
|
462
520
|
Component,
|
|
463
521
|
Delete,
|
|
464
522
|
Divider,
|
|
465
523
|
Emphasis,
|
|
524
|
+
Entry,
|
|
466
525
|
FormContentType,
|
|
467
526
|
Fragment,
|
|
468
527
|
Heading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/renderer.tsx"],"sourcesContent":["import React, { ClassType, ComponentClass, FunctionComponent, Component as ReactComponent, createContext, useContext } from 'react';\nimport {\n AnchorBlock,\n Block,\n CodeBlock,\n ComponentBlock,\n DecoratorType,\n DividerBlock,\n FormContentTypeBlock,\n FragmentBlock,\n HeadingBlock,\n ImageBlock,\n InlineEntryBlock,\n LinkBlock,\n LiquidBlock,\n ListBlock,\n ListItemBlock,\n PanelBlock,\n ParagraphBlock,\n QuoteBlock,\n TableBlock,\n TableBodyBlock,\n TableCaptionBlock, TableCellBlock,\n TableFooterBlock,\n TableHeaderBlock,\n TableHeaderCellBlock,\n TableRowBlock\n} from '@contensis/canvas-types';\n\ntype Attributes = Record<string, any>;\ntype WithChildren = { children?: JSX.Element | undefined };\n\ntype RendererProps = { data: Block[] };\ntype RenderBlocksProps = { blocks: Block[] };\ntype RenderBlockProps<T extends Block> = { block: T };\ntype RenderBlockPropsWithChildren<T extends Block>\n = RenderBlockProps<T> & WithChildren & Attributes;\n\ntype RenderContentsProps = { contents: undefined | JSX.Element, fallback: JSX.Element };\ntype RenderTextProps = { text: string };\n\ntype DecoratorProps = { block: FragmentBlock, decorators: undefined | DecoratorType[] };\n\ntype TypedBlock<TType extends Block['type']> = Extract<Block, { type: TType }>;\n\ntype Renderer<TProps> = FunctionComponent<TProps> | ClassType<TProps, ReactComponent<TProps>, ComponentClass<TProps>>;\n\ntype BlockRenderer<T extends Block> = Renderer<RenderBlockPropsWithChildren<T>>;\ntype BlockRenderers = {\n [TType in Block['type']]: BlockRenderer<TypedBlock<TType>>\n};\n\n\ntype RenderDecoratorProps = { block: FragmentBlock, decorator: undefined | DecoratorType, otherDecorators: undefined | DecoratorType[] };\ntype RenderDecoratorPropsWithChildren = RenderDecoratorProps & WithChildren & Attributes;\n\ntype DecoratorRenderer = Renderer<RenderDecoratorPropsWithChildren>;\ntype DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;\n\ntype ComponentRenderer = Renderer<RenderBlockPropsWithChildren<ComponentBlock>>;\ntype ComponentRenderers = Record<string, ComponentRenderer>;\n\ntype RendererContextValue = {\n blocks?: BlockRenderers,\n decorators?: DecoratorRenderers,\n components?: ComponentRenderers\n};\n\ntype RendererOverridesContextValue = {\n blocks?: Partial<BlockRenderers>,\n decorators?: Partial<DecoratorRenderers>,\n components?: ComponentRenderers\n};\n\ntype RendererContextProviderProps = WithChildren & RendererOverridesContextValue;\n\nexport type { BlockRenderer, RenderBlockProps, RenderBlockPropsWithChildren, RenderDecoratorProps, RenderDecoratorPropsWithChildren };\n\nexport const RendererContext = createContext<RendererContextValue>({});\n\n/** \n * Provides context to the <Renderer> component to return Canvas data as React components\n *\n * @link https://www.npmjs.com/package/@contensis/canvas-react#usage\n *\n * @param blocks - Override the default rendering of Canvas content blocks\n * @param components - Render method for Contensis Components within the Canvas field\n * @param decorators - Override the rendering of HTML elements within a text field\n * \n * @example \n * <RenderContextProvider blocks={{ _table: Table }} components={{ banner: Banner }} decorators={{ strong: Strong }}>\n * <Renderer data={data} />\n * </RenderContextProvider>\n * \n */\nexport function RenderContextProvider(props: RendererContextProviderProps) {\n\n const overrideBlocks = props.blocks;\n const blocks = Object.keys(BLOCK_RENDERERS)\n .reduce((prev, type) => {\n const blockType = type as Block['type'];\n const renderer: any = overrideBlocks?.[blockType] || BLOCK_RENDERERS[blockType];\n (prev as any)[blockType] = renderer;\n return prev;\n }, {} as BlockRenderers);\n\n const overrideDecorators = props.decorators;\n const decorators = Object.keys(DECORATOR_RENDERERS)\n .reduce((prev, type) => {\n const decoratorType = type as DecoratorType;\n prev[decoratorType] = overrideDecorators?.[decoratorType] || DECORATOR_RENDERERS[decoratorType];\n return prev;\n }, {} as DecoratorRenderers);\n\n const value = { blocks, decorators, components: props.components };\n\n return (\n <RendererContext.Provider value={value}>\n {props.children}\n </RendererContext.Provider>\n );\n}\n\nfunction useBlocks() {\n const value = useContext(RendererContext);\n return value.blocks || BLOCK_RENDERERS;\n}\n\nfunction useDecorators() {\n const value = useContext(RendererContext);\n return value.decorators || DECORATOR_RENDERERS;\n}\n\nfunction useComponents() {\n const value = useContext(RendererContext);\n return value.components || {};\n}\n\nfunction RenderBlock<TBlock extends Block>(props: RenderBlockProps<TBlock>) {\n const blocks = useBlocks();\n const Component = blocks[props.block.type] as BlockRenderer<TBlock>;\n return !!Component ? (<Component block={props.block} />) : null;\n}\n\nfunction RenderBlocks(props: RenderBlocksProps) {\n return (<>{props.blocks.map(block => <RenderBlock block={block} key={block.id} />)}</>);\n}\n\nfunction RenderContents(props: RenderContentsProps) {\n return (props.contents ? props.contents : props.fallback);\n}\n\nexport function RenderChildren(props: RenderBlockProps<Block>) {\n const isArray = Array.isArray(props.block?.value);\n const isString = typeof props.block?.value === 'string';\n\n const render = () => {\n if (isArray) {\n return (<RenderBlocks blocks={props.block.value as any} />);\n } else if (isString) {\n return (<RenderText text={props.block.value as any} />);\n } else {\n return (<RenderText text={''} />);\n }\n };\n\n return render();\n};\n\nfunction RenderText(props: RenderTextProps) {\n return (<>{props.text}</>);\n};\n\n/** \n * The default render method for processing Canvas data \n * \n * @link https://www.npmjs.com/package/@contensis/canvas-react#usage\n * \n * @param data - Accepts Canvas data\n * \n * */\nexport function Renderer(props: RendererProps) {\n return (<RenderBlocks blocks={props.data} />);\n}\n\ntype AttributeProps = RenderBlockProps<Block>\n | RenderBlockPropsWithChildren<Block>\n | RenderDecoratorProps\n | RenderDecoratorPropsWithChildren;\n\nfunction getAttributes(props: AttributeProps, extra: Record<string, any> = {}) {\n const { block, ...rest } = props;\n let { children, decorator, otherDecorators, ...attributes } = rest as Record<string, any>;\n attributes = {\n id: block?.properties?.id,\n ...extra,\n ...attributes\n };\n return attributes;\n}\n\nfunction WithCaption(props: WithChildren & { caption: undefined | string }) {\n return (\n !!props.caption\n ? (\n <figure>\n {props.children}\n <figcaption>{props.caption}</figcaption>\n </figure>\n )\n : (props.children || null)\n );\n};\n\nfunction RenderBlockChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<RenderChildren block={props.block} />);\n };\n}\n\nfunction EmptyChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<></>);\n };\n}\n\nexport function Anchor(props: RenderBlockPropsWithChildren<AnchorBlock>) {\n const attributes = getAttributes(props);\n return (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Anchor.Children block={props.block} />} />\n </a>\n );\n}\n\nAnchor.Children = RenderBlockChildrenFactory<AnchorBlock>();\n\nexport function Code(props: RenderBlockPropsWithChildren<CodeBlock>) {\n const attributes = getAttributes(props, {\n 'data-language': props.block?.value?.language\n });\n const codeAttributes = getAttributes(props, {\n className: `language-${props.block?.value?.language}`\n });\n return (\n <pre {...attributes}>\n <code {...codeAttributes}>\n <RenderContents contents={props.children} fallback={<Code.Children block={props.block} />} />\n </code>\n </pre>\n );\n}\n\nCode.Children = function (props: RenderBlockProps<CodeBlock>) {\n return (<>{props.block?.value?.code}</>);\n};\n\nfunction CodeWithCaption(props: RenderBlockPropsWithChildren<CodeBlock>) {\n return (\n <WithCaption caption={props.block?.value?.caption}>\n <Code {...props} />\n </WithCaption>\n );\n}\n\nexport function Component(props: RenderBlockPropsWithChildren<ComponentBlock>) {\n const component = props?.block.properties?.component;\n const components = useComponents();\n const ComponentElement = !!component ? components?.[component] : undefined;\n\n const value = props.block.value ? JSON.stringify(props.block.value) : '';\n const attributes = getAttributes(props, {\n className: 'component',\n 'data-component': props.block.properties?.component,\n 'data-component-value': value,\n });\n\n return (!!ComponentElement)\n ? (<ComponentElement {...props} />)\n : (\n <div {...attributes}>\n <RenderContents contents={props.children} fallback={<Component.Children block={props.block} />} />\n </div>\n );\n}\n\nComponent.Children = function (props: RenderBlockProps<ComponentBlock>) {\n return (<>Component: {props.block?.properties?.component}</>);\n};\n\nexport function Divider(props: RenderBlockPropsWithChildren<DividerBlock>) {\n const attributes = getAttributes(props);\n return (<hr {...attributes} />);\n}\n\nDivider.Children = EmptyChildrenFactory<DividerBlock>();\n\nexport function FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>) {\n return null;\n}\n\nFormContentType.Children = function (_props: RenderBlockProps<FormContentTypeBlock>) {\n return null;\n};\n\nexport function Fragment(props: RenderBlockPropsWithChildren<FragmentBlock>) {\n const hasDecorators = !!props.block?.properties?.decorators?.length;\n const decorators = props.block?.properties?.decorators;\n return (\n hasDecorators\n ? (<Decorators block={props.block} decorators={decorators}></Decorators>)\n : (<RenderContents contents={props.children} fallback={<Fragment.Children block={props.block} />} />)\n );\n}\n\nFragment.Children = RenderBlockChildrenFactory<FragmentBlock>();\n\nexport function Heading(props: RenderBlockPropsWithChildren<HeadingBlock>) {\n const attributes = getAttributes(props);\n const render = () => {\n switch (props?.block?.properties?.level) {\n case 2: {\n return (\n <h2 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h2>\n );\n }\n case 3: {\n return (\n <h3 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h3>\n );\n }\n case 4: {\n return (\n <h4 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h4>\n );\n }\n case 5: {\n return (\n <h5 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h5>\n );\n }\n case 6: {\n return (\n <h6 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h6>\n );\n }\n default: {\n return (\n <h1 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h1>\n );\n }\n }\n };\n return render();\n}\n\nHeading.Children = RenderBlockChildrenFactory<HeadingBlock>();\n\nexport function Image(props: RenderBlockPropsWithChildren<ImageBlock>) {\n const src = props.block?.value?.asset?.sys?.uri;\n const attributes = getAttributes(props, {\n src,\n alt: props.block?.value?.altText,\n title: props?.block?.value?.caption,\n });\n return (<img {...attributes} />);\n}\n\nImage.Children = EmptyChildrenFactory<ImageBlock>();\n\nfunction ImageWithCaption(props: RenderBlockPropsWithChildren<ImageBlock>) {\n return (\n <WithCaption caption={props.block?.value?.caption}>\n <Image {...props} />\n </WithCaption>\n );\n}\n\nexport function InlineEntry(props: RenderBlockPropsWithChildren<InlineEntryBlock>) {\n const href = props?.block?.value?.sys?.uri;\n const attributes = getAttributes(props, {\n href\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />)\n );\n}\n\nInlineEntry.Children = function (props: RenderBlockProps<InlineEntryBlock>) {\n const entryTitle = props?.block?.value?.entryTitle || '';\n return (<>{entryTitle}</>);\n};\n\nexport function Link(props: RenderBlockPropsWithChildren<LinkBlock>) {\n const linkValue = props?.block?.properties?.link;\n const attributes = getAttributes(props, {\n href: linkValue?.sys?.uri,\n target: props?.block?.properties?.newTab ? '_blank' : null,\n rel: props?.block?.properties?.newTab ? 'noopener noreferrer' : null\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />)\n );\n}\n\nLink.Children = RenderBlockChildrenFactory<LinkBlock>();\n\nexport function Liquid(props: RenderBlockPropsWithChildren<LiquidBlock>) { \n return (\n <RenderContents contents={props.children} fallback={<Liquid.Children block={props.block} />} /> \n );\n}\n\nLiquid.Children = function (props: RenderBlockProps<LiquidBlock>) {\n return (<>{props.block?.value}</>);\n};\n\nexport function List(props: RenderBlockPropsWithChildren<ListBlock>) {\n const isOrdered = (props.block?.properties?.listType === 'ordered');\n const attributes = getAttributes(props, {\n start: isOrdered ? props.block?.properties?.start : null,\n });\n return (isOrdered\n ? (\n <ol {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ol>\n )\n : (\n <ul {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ul>\n )\n );\n}\n\nList.Children = RenderBlockChildrenFactory<ListBlock>();\n\nexport function ListItem(props: RenderBlockPropsWithChildren<ListItemBlock>) {\n const attributes = getAttributes(props);\n return (\n <li {...attributes}>\n <RenderContents contents={props.children} fallback={<ListItem.Children block={props.block} />} />\n </li>\n );\n}\n\nListItem.Children = RenderBlockChildrenFactory<ListItemBlock>();\n\nexport function Panel(props: RenderBlockPropsWithChildren<PanelBlock>) {\n const attributes = getAttributes(props, {\n className: ['panel', props.block?.properties?.panelType || 'info'].join(' ')\n });\n return (\n <aside {...attributes}>\n <RenderContents contents={props.children} fallback={<Panel.Children block={props.block} />} />\n </aside>\n );\n}\n\nPanel.Children = RenderBlockChildrenFactory<PanelBlock>();\n\nexport function Paragraph(props: RenderBlockPropsWithChildren<ParagraphBlock>) {\n const attributes = getAttributes(props, {\n className: props.block?.properties?.paragraphType\n });\n return (\n <p {...attributes}>\n <RenderContents contents={props.children} fallback={<Paragraph.Children block={props.block} />} />\n </p>\n );\n}\n\nParagraph.Children = RenderBlockChildrenFactory<ParagraphBlock>();\n\n\nexport function Quote(props: RenderBlockPropsWithChildren<QuoteBlock>) {\n const attributes = getAttributes(props, {\n 'cite': props.block?.properties?.url\n });\n return (\n <blockquote {...attributes}>\n <RenderContents contents={props.children} fallback={<Quote.Children block={props.block} />} />\n </blockquote>\n );\n}\n\nQuote.Children = function (props: RenderBlockProps<QuoteBlock>) {\n const source = props.block?.properties?.source;\n const citation = props.block?.properties?.citation;\n const hasChildren = !!source || !!citation;\n return (\n hasChildren\n ? (\n <>\n <p>\n <RenderChildren block={props.block} />\n </p>\n <footer>{source} {!!citation ? (<cite>{citation}</cite>) : (<></>)}</footer>\n </>\n )\n : (<RenderChildren block={props.block} />)\n );\n};\n\n\nexport function Table(props: RenderBlockPropsWithChildren<TableBlock>) {\n const attributes = getAttributes(props);\n return (\n <table {...attributes}>\n <RenderContents contents={props.children} fallback={<Table.Children block={props.block} />} />\n </table>\n );\n}\n\nTable.Children = RenderBlockChildrenFactory<TableBlock>();\n\nexport function TableBody(props: RenderBlockPropsWithChildren<TableBodyBlock>) {\n const attributes = getAttributes(props);\n return (\n <tbody {...attributes}>\n <RenderContents contents={props.children} fallback={<TableBody.Children block={props.block} />} />\n </tbody>\n );\n}\n\nTableBody.Children = RenderBlockChildrenFactory<TableBodyBlock>();\n\nexport function TableCaption(props: RenderBlockPropsWithChildren<TableCaptionBlock>) {\n const attributes = getAttributes(props);\n return (\n <caption {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCaption.Children block={props.block} />} />\n </caption>\n );\n}\n\nTableCaption.Children = RenderBlockChildrenFactory<TableCaptionBlock>();\n\nexport function TableCell(props: RenderBlockPropsWithChildren<TableCellBlock>) {\n const attributes = getAttributes(props);\n return (\n <td {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCell.Children block={props.block} />} />\n </td>\n );\n}\n\nTableCell.Children = RenderBlockChildrenFactory<TableCellBlock>();\n\nexport function TableFooter(props: RenderBlockPropsWithChildren<TableFooterBlock>) {\n const attributes = getAttributes(props);\n return (\n <tfoot {...attributes}>\n <RenderContents contents={props.children} fallback={<TableFooter.Children block={props.block} />} />\n </tfoot>\n );\n}\n\nTableFooter.Children = RenderBlockChildrenFactory<TableFooterBlock>();\n\nexport function TableHeader(props: RenderBlockPropsWithChildren<TableHeaderBlock>) {\n const attributes = getAttributes(props);\n return (\n <thead {...attributes}>\n <RenderContents contents={props.children} fallback={<TableHeader.Children block={props.block} />} />\n </thead>\n );\n}\n\nTableHeader.Children = RenderBlockChildrenFactory<TableHeaderBlock>();\n\nexport function TableHeaderCell(props: RenderBlockPropsWithChildren<TableHeaderCellBlock>) {\n const attributes = getAttributes(props);\n return (\n <th {...attributes}>\n <RenderContents contents={props.children} fallback={<TableHeaderCell.Children block={props.block} />} />\n </th>\n );\n}\n\nTableHeaderCell.Children = RenderBlockChildrenFactory<TableHeaderCellBlock>();\n\nexport function TableRow(props: RenderBlockPropsWithChildren<TableRowBlock>) {\n const attributes = getAttributes(props);\n return (\n <tr {...attributes}>\n <RenderContents contents={props.children} fallback={<TableRow.Children block={props.block} />} />\n </tr>\n );\n}\n\nTableRow.Children = RenderBlockChildrenFactory<TableRowBlock>();\n\n\nfunction Decorators(props: DecoratorProps) {\n const decorators = useDecorators();\n const remainingDecorators = !!props.decorators ? [...props.decorators] : undefined;\n const firstDecorator = !!remainingDecorators ? remainingDecorators.shift() : undefined;\n const DecoratorComponent = !!firstDecorator ? decorators[firstDecorator] : undefined;\n\n const render = () => {\n if (!!DecoratorComponent) {\n return (<DecoratorComponent block={props.block} decorator={firstDecorator} otherDecorators={remainingDecorators} />);\n } else if (firstDecorator) {\n return (<Decorators block={props.block} decorators={remainingDecorators} />);\n } else {\n return (<Fragment.Children block={props.block} />);\n }\n };\n\n return render();\n}\n\nfunction DecoratorChildren(props: RenderDecoratorPropsWithChildren) {\n return (<Decorators block={props.block} decorators={props.otherDecorators} />)\n}\n\nexport function InlineCode(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <code {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineCode.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </code>\n );\n}\n\nInlineCode.Children = DecoratorChildren;\n\nexport function Delete(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <del {...attributes}>\n <RenderContents contents={props.children} fallback={<Delete.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </del>\n );\n}\n\nDelete.Children = DecoratorChildren;\n\nexport function Emphasis(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <em {...attributes}>\n <RenderContents contents={props.children} fallback={<Emphasis.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </em>\n );\n}\n\nEmphasis.Children = DecoratorChildren;\n\nexport function Insert(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <ins {...attributes}>\n <RenderContents contents={props.children} fallback={<Insert.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </ins>\n );\n}\n\nInsert.Children = DecoratorChildren;\n\nexport function Keyboard(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <kbd {...attributes}>\n <RenderContents contents={props.children} fallback={<Keyboard.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </kbd>\n );\n}\n\nKeyboard.Children = DecoratorChildren;\n\nexport function LineBreak(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (<br {...attributes} />);\n}\n\nLineBreak.Children = function (props: RenderDecoratorPropsWithChildren) {\n return (<></>)\n}\n\nexport function Mark(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <mark {...attributes}>\n <RenderContents contents={props.children} fallback={<Mark.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </mark>\n );\n}\n\nMark.Children = DecoratorChildren;\n\nexport function Strong(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <strong {...attributes}>\n <RenderContents contents={props.children} fallback={<Strong.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </strong>\n );\n}\n\nStrong.Children = DecoratorChildren;\n\nexport function Strikethrough(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <s {...attributes}>\n <RenderContents contents={props.children} fallback={<Strikethrough.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </s>\n );\n}\n\nStrikethrough.Children = DecoratorChildren;\n\nexport function Subscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sub {...attributes}>\n <RenderContents contents={props.children} fallback={<Subscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sub>\n );\n}\n\nSubscript.Children = DecoratorChildren;\n\nexport function Superscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sup {...attributes}>\n <RenderContents contents={props.children} fallback={<Superscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sup>\n );\n}\n\nSuperscript.Children = DecoratorChildren;\n\nexport function Underline(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <u {...attributes}>\n <RenderContents contents={props.children} fallback={<Underline.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </u>\n );\n}\n\nUnderline.Children = DecoratorChildren;\n\nexport function Variable(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <var {...attributes}>\n <RenderContents contents={props.children} fallback={<Variable.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </var>\n );\n}\n\nVariable.Children = DecoratorChildren;\n\nconst BLOCK_RENDERERS: BlockRenderers = {\n '_anchor': Anchor,\n '_code': CodeWithCaption,\n '_component': Component,\n '_divider': Divider,\n '_formContentType': FormContentType,\n '_fragment': Fragment,\n '_heading': Heading,\n '_image': ImageWithCaption,\n '_inlineEntry': InlineEntry,\n '_link': Link,\n '_liquid': Liquid,\n '_list': List,\n '_listItem': ListItem,\n '_panel': Panel,\n '_paragraph': Paragraph,\n '_quote': Quote,\n '_table': Table,\n '_tableBody': TableBody,\n '_tableCaption': TableCaption,\n '_tableCell': TableCell,\n '_tableFooter': TableFooter,\n '_tableHeader': TableHeader,\n '_tableHeaderCell': TableHeaderCell,\n '_tableRow': TableRow,\n};\n\nconst DECORATOR_RENDERERS: DecoratorRenderers = {\n 'code': InlineCode,\n 'delete': Delete,\n 'emphasis': Emphasis,\n 'insert': Insert,\n 'keyboard': Keyboard,\n 'linebreak': LineBreak,\n 'mark': Mark,\n 'strikethrough': Strikethrough,\n 'strong': Strong,\n 'subscript': Subscript,\n 'superscript': Superscript,\n 'underline': Underline,\n 'variable': Variable\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,SAAoF,eAAe,kBAAkB;AA8ErH,IAAM,kBAAkB,cAAoC,CAAC,CAAC;AAiB9D,SAAS,sBAAsB,OAAqC;AAEvE,QAAM,iBAAiB,MAAM;AAC7B,QAAM,SAAS,OAAO,KAAK,eAAe,EACrC,OAAO,CAAC,MAAM,SAAS;AACpB,UAAM,YAAY;AAClB,UAAM,YAAgB,iDAAiB,eAAc,gBAAgB,SAAS;AAC9E,IAAC,KAAa,SAAS,IAAI;AAC3B,WAAO;AAAA,EACX,GAAG,CAAC,CAAmB;AAE3B,QAAM,qBAAqB,MAAM;AACjC,QAAM,aAAa,OAAO,KAAK,mBAAmB,EAC7C,OAAO,CAAC,MAAM,SAAS;AACpB,UAAM,gBAAgB;AACtB,SAAK,aAAa,KAAI,yDAAqB,mBAAkB,oBAAoB,aAAa;AAC9F,WAAO;AAAA,EACX,GAAG,CAAC,CAAuB;AAE/B,QAAM,QAAQ,EAAE,QAAQ,YAAY,YAAY,MAAM,WAAW;AAEjE,SACI,oCAAC,gBAAgB,UAAhB,EAAyB,SACrB,MAAM,QACX;AAER;AAEA,SAAS,YAAY;AACjB,QAAM,QAAQ,WAAW,eAAe;AACxC,SAAO,MAAM,UAAU;AAC3B;AAEA,SAAS,gBAAgB;AACrB,QAAM,QAAQ,WAAW,eAAe;AACxC,SAAO,MAAM,cAAc;AAC/B;AAEA,SAAS,gBAAgB;AACrB,QAAM,QAAQ,WAAW,eAAe;AACxC,SAAO,MAAM,cAAc,CAAC;AAChC;AAEA,SAAS,YAAkC,OAAiC;AACxE,QAAM,SAAS,UAAU;AACzB,QAAMA,aAAY,OAAO,MAAM,MAAM,IAAI;AACzC,SA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;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAChB;","names":["Component"]}
|
|
1
|
+
{"version":3,"sources":["../src/renderer.tsx"],"sourcesContent":["import React, { ClassType, ComponentClass, FunctionComponent, Component as ReactComponent, createContext, useContext } from 'react';\nimport {\n AnchorBlock,\n AssetBlock,\n Block,\n CodeBlock,\n ComponentBlock,\n DecoratorType,\n DividerBlock,\n EntryBlock,\n FormContentTypeBlock,\n FragmentBlock,\n HeadingBlock,\n ImageBlock,\n InlineEntryBlock,\n LinkBlock,\n LiquidBlock,\n ListBlock,\n ListItemBlock,\n PanelBlock,\n ParagraphBlock,\n QuoteBlock,\n TableBlock,\n TableBodyBlock,\n TableCaptionBlock, TableCellBlock,\n TableFooterBlock,\n TableHeaderBlock,\n TableHeaderCellBlock,\n TableRowBlock\n} from '@contensis/canvas-types';\n\ntype Attributes = Record<string, any>;\ntype WithChildren = { children?: JSX.Element | undefined };\n\ntype RendererProps = { data: Block[] };\ntype RenderBlocksProps = { blocks: Block[] };\ntype RenderBlockProps<T extends Block> = { block: T };\ntype RenderBlockPropsWithChildren<T extends Block>\n = RenderBlockProps<T> & WithChildren & Attributes;\n\ntype RenderContentsProps = { contents: undefined | JSX.Element, fallback: JSX.Element };\ntype RenderTextProps = { text: string };\n\ntype DecoratorProps = { block: FragmentBlock, decorators: undefined | DecoratorType[] };\n\ntype TypedBlock<TType extends Block['type']> = Extract<Block, { type: TType }>;\n\ntype Renderer<TProps> = FunctionComponent<TProps> | ClassType<TProps, ReactComponent<TProps>, ComponentClass<TProps>>;\n\ntype BlockRenderer<T extends Block> = Renderer<RenderBlockPropsWithChildren<T>>;\ntype BlockRenderers = {\n [TType in Block['type']]: BlockRenderer<TypedBlock<TType>>\n};\n\n\ntype RenderDecoratorProps = { block: FragmentBlock, decorator: undefined | DecoratorType, otherDecorators: undefined | DecoratorType[] };\ntype RenderDecoratorPropsWithChildren = RenderDecoratorProps & WithChildren & Attributes;\n\ntype DecoratorRenderer = Renderer<RenderDecoratorPropsWithChildren>;\ntype DecoratorRenderers = Record<DecoratorType, DecoratorRenderer>;\n\ntype ComponentRenderer = Renderer<RenderBlockPropsWithChildren<ComponentBlock>>;\ntype ComponentRenderers = Record<string, ComponentRenderer>;\ntype EntryRenderer = Renderer<RenderBlockPropsWithChildren<EntryBlock>>;\ntype EntryRenderers = Record<string, EntryRenderer>;\ntype AssetRenderer = Renderer<RenderBlockPropsWithChildren<AssetBlock>>;\ntype AssetRenderers = Record<string, AssetRenderer>;\n\ntype RendererContextValue = {\n blocks?: BlockRenderers,\n decorators?: DecoratorRenderers,\n components?: ComponentRenderers,\n entries?: EntryRenderers,\n assets?: AssetRenderers,\n};\n\ntype RendererOverridesContextValue = {\n blocks?: Partial<BlockRenderers>,\n decorators?: Partial<DecoratorRenderers>,\n components?: ComponentRenderers,\n entries?: EntryRenderers,\n assets?: AssetRenderers,\n};\n\ntype RendererContextProviderProps = WithChildren & RendererOverridesContextValue;\n\nexport type { BlockRenderer, RenderBlockProps, RenderBlockPropsWithChildren, RenderDecoratorProps, RenderDecoratorPropsWithChildren };\n\nexport const RendererContext = createContext<RendererContextValue>({});\n\nconst BlockRenderContext = createContext<{ ancestors: Block[] }>({ ancestors: [] });\n\nfunction findAncestorOfType<T extends Block>(ancestors: Block[], types: T['type'][]): T | undefined {\n return ancestors?.slice().reverse().find(ancestor => types.includes(ancestor.type as T['type'])) as T | undefined;\n}\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, entries: props.entries, assets: props?.assets };\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 useEntries() {\n const value = useContext(RendererContext);\n return value.entries || {};\n}\n\nfunction useAssets() {\n const value = useContext(RendererContext);\n return value.assets || {};\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 const renderContext = useContext(BlockRenderContext);\n const ancestors = [...renderContext.ancestors, props.block];\n return !!Component ? (\n <BlockRenderContext.Provider value={{ ancestors }}>\n <Component block={props.block} />\n </BlockRenderContext.Provider>\n ) : null;\n}\n\nfunction RenderBlocks(props: RenderBlocksProps) {\n return (<>{props.blocks.map(block => <RenderBlock block={block} key={block.id} />)}</>);\n}\n\nfunction RenderContents(props: RenderContentsProps) {\n return (props.contents ? props.contents : props.fallback);\n}\n\nexport function RenderChildren(props: RenderBlockProps<Block>) {\n const isArray = Array.isArray(props.block?.value);\n const isString = typeof props.block?.value === 'string';\n\n const render = () => {\n if (isArray) {\n return (<RenderBlocks blocks={props.block.value as any} />);\n } else if (isString) {\n return (<RenderText text={props.block.value as any} />);\n } else {\n return (<RenderText text={''} />);\n }\n };\n\n return render();\n};\n\nfunction RenderText(props: RenderTextProps) {\n return (<>{props.text}</>);\n};\n\n/** \n * The default render method for processing Canvas data \n * \n * @link https://www.npmjs.com/package/@contensis/canvas-react#usage\n * \n * @param data - Accepts Canvas data\n * \n * */\nexport function Renderer(props: RendererProps) {\n return (<RenderBlocks blocks={props.data} />);\n}\n\ntype AttributeProps = RenderBlockProps<Block>\n | RenderBlockPropsWithChildren<Block>\n | RenderDecoratorProps\n | RenderDecoratorPropsWithChildren;\n\nfunction getAttributes(props: AttributeProps, extra: Record<string, any> = {}) {\n const { block, ...rest } = props;\n let { children, decorator, otherDecorators, ...attributes } = rest as Record<string, any>;\n attributes = {\n id: block?.properties?.id,\n ...extra,\n ...attributes\n };\n return attributes;\n}\n\nfunction WithCaption(props: WithChildren & { caption: undefined | string }) {\n return (\n !!props.caption\n ? (\n <figure>\n {props.children}\n <figcaption>{props.caption}</figcaption>\n </figure>\n )\n : (props.children || null)\n );\n};\n\nfunction RenderBlockChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<RenderChildren block={props.block} />);\n };\n}\n\nfunction EmptyChildrenFactory<T extends Block>() {\n return function (props: RenderBlockProps<T>) {\n return (<></>);\n };\n}\n\nexport function Anchor(props: RenderBlockPropsWithChildren<AnchorBlock>) {\n const attributes = getAttributes(props);\n return (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Anchor.Children block={props.block} />} />\n </a>\n );\n}\n\nAnchor.Children = RenderBlockChildrenFactory<AnchorBlock>();\n\nexport function Asset(props: RenderBlockPropsWithChildren<AssetBlock>) {\n const contentTypeId = props?.block?.value?.sys?.contentTypeId;\n const components = useAssets();\n const AssetElement = !!contentTypeId ? components?.[contentTypeId] : undefined;\n const attributes = getAttributes(props);\n return (!!AssetElement)\n ? <AssetElement {...props} />\n : (\n <div {...attributes}>\n <RenderContents contents={props.children} fallback={<Asset.Children block={props.block} />} />\n </div>\n );\n}\n\nAsset.Children = function (props: RenderBlockProps<AssetBlock>) {\n const href = props?.block?.value?.sys?.uri;\n const entryTitle = props?.block?.value?.entryTitle || '';\n const entryDescription = props?.block?.value?.entryDescription || '';\n return (<>\n <div>\n {!!href ? <a href={href}>{entryTitle}</a> : entryTitle}\n </div>\n {!!entryDescription ? <div>{entryDescription}</div> : null}\n </>);\n};\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 Entry(props: RenderBlockPropsWithChildren<EntryBlock>) {\n const contentTypeId = props?.block?.value?.sys?.contentTypeId;\n const components = useEntries();\n const EntryElement = !!contentTypeId ? components?.[contentTypeId] : undefined;\n const attributes = getAttributes(props);\n return (!!EntryElement)\n ? <EntryElement {...props} />\n : (\n <div {...attributes}>\n <RenderContents contents={props.children} fallback={<Entry.Children block={props.block} />} />\n </div>\n );\n}\n\nEntry.Children = function (props: RenderBlockProps<EntryBlock>) {\n const href = props?.block?.value?.sys?.uri;\n const entryTitle = props?.block?.value?.entryTitle || '';\n const entryDescription = props?.block?.value?.entryDescription || '';\n return (<>\n <div>\n {!!href ? <a href={href}>{entryTitle}</a> : entryTitle}\n </div>\n {!!entryDescription ? <div>{entryDescription}</div> : null}\n </>);\n};\n\nexport function FormContentType(_props: RenderBlockPropsWithChildren<FormContentTypeBlock>) {\n return null;\n}\n\nFormContentType.Children = function (_props: RenderBlockProps<FormContentTypeBlock>) {\n return null;\n};\n\nexport function Fragment(props: RenderBlockPropsWithChildren<FragmentBlock>) {\n const hasDecorators = !!props.block?.properties?.decorators?.length;\n const decorators = props.block?.properties?.decorators;\n return (\n hasDecorators\n ? (<Decorators block={props.block} decorators={decorators}></Decorators>)\n : (<RenderContents contents={props.children} fallback={<Fragment.Children block={props.block} />} />)\n );\n}\n\nFragment.Children = RenderBlockChildrenFactory<FragmentBlock>();\n\nexport function Heading(props: RenderBlockPropsWithChildren<HeadingBlock>) {\n const attributes = getAttributes(props);\n const render = () => {\n switch (props?.block?.properties?.level) {\n case 2: {\n return (\n <h2 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h2>\n );\n }\n case 3: {\n return (\n <h3 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h3>\n );\n }\n case 4: {\n return (\n <h4 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h4>\n );\n }\n case 5: {\n return (\n <h5 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h5>\n );\n }\n case 6: {\n return (\n <h6 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h6>\n );\n }\n default: {\n return (\n <h1 {...attributes}>\n <RenderContents contents={props.children} fallback={<Heading.Children block={props.block} />} />\n </h1>\n );\n }\n }\n };\n return render();\n}\n\nHeading.Children = RenderBlockChildrenFactory<HeadingBlock>();\n\nexport function Image(props: RenderBlockPropsWithChildren<ImageBlock>) {\n const src = props.block?.value?.asset?.sys?.uri;\n const attributes = getAttributes(props, {\n src,\n alt: props.block?.value?.altText,\n title: props?.block?.value?.caption,\n });\n return (<img {...attributes} />);\n}\n\nImage.Children = EmptyChildrenFactory<ImageBlock>();\n\nfunction ImageWithCaption(props: RenderBlockPropsWithChildren<ImageBlock>) {\n return (\n <WithCaption caption={props.block?.value?.caption}>\n <Image {...props} />\n </WithCaption>\n );\n}\n\nexport function InlineEntry(props: RenderBlockPropsWithChildren<InlineEntryBlock>) {\n const href = props?.block?.value?.sys?.uri;\n const attributes = getAttributes(props, {\n href\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<InlineEntry.Children block={props.block} />} />)\n );\n}\n\nInlineEntry.Children = function (props: RenderBlockProps<InlineEntryBlock>) {\n const entryTitle = props?.block?.value?.entryTitle || '';\n return (<>{entryTitle}</>);\n};\n\nexport function Link(props: RenderBlockPropsWithChildren<LinkBlock>) {\n const linkValue = props?.block?.properties?.link;\n const attributes = getAttributes(props, {\n href: linkValue?.sys?.uri,\n target: props?.block?.properties?.newTab ? '_blank' : null,\n rel: props?.block?.properties?.newTab ? 'noopener noreferrer' : null\n });\n return (!!attributes.href\n ? (\n <a {...attributes}>\n <RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />\n </a>\n )\n : (<RenderContents contents={props.children} fallback={<Link.Children block={props.block} />} />)\n );\n}\n\nLink.Children = RenderBlockChildrenFactory<LinkBlock>();\n\nexport function Liquid(props: RenderBlockPropsWithChildren<LiquidBlock>) {\n return (\n <RenderContents contents={props.children} fallback={<Liquid.Children block={props.block} />} />\n );\n}\n\nLiquid.Children = function (props: RenderBlockProps<LiquidBlock>) {\n return (<>{props.block?.value}</>);\n};\n\nexport function List(props: RenderBlockPropsWithChildren<ListBlock>) {\n const isOrdered = (props.block?.properties?.listType === 'ordered');\n const attributes = getAttributes(props, {\n start: isOrdered ? props.block?.properties?.start : null,\n });\n return (isOrdered\n ? (\n <ol {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ol>\n )\n : (\n <ul {...attributes}>\n <RenderContents contents={props.children} fallback={<List.Children block={props.block} />} />\n </ul>\n )\n );\n}\n\nList.Children = RenderBlockChildrenFactory<ListBlock>();\n\nexport function ListItem(props: RenderBlockPropsWithChildren<ListItemBlock>) {\n const attributes = getAttributes(props);\n return (\n <li {...attributes}>\n <RenderContents contents={props.children} fallback={<ListItem.Children block={props.block} />} />\n </li>\n );\n}\n\nListItem.Children = RenderBlockChildrenFactory<ListItemBlock>();\n\nexport function Panel(props: RenderBlockPropsWithChildren<PanelBlock>) {\n const attributes = getAttributes(props, {\n className: ['panel', props.block?.properties?.panelType || 'info'].join(' ')\n });\n return (\n <aside {...attributes}>\n <RenderContents contents={props.children} fallback={<Panel.Children block={props.block} />} />\n </aside>\n );\n}\n\nPanel.Children = RenderBlockChildrenFactory<PanelBlock>();\n\nexport function Paragraph(props: RenderBlockPropsWithChildren<ParagraphBlock>) {\n const attributes = getAttributes(props, {\n className: props.block?.properties?.paragraphType\n });\n return (\n <p {...attributes}>\n <RenderContents contents={props.children} fallback={<Paragraph.Children block={props.block} />} />\n </p>\n );\n}\n\nParagraph.Children = RenderBlockChildrenFactory<ParagraphBlock>();\n\n\nexport function Quote(props: RenderBlockPropsWithChildren<QuoteBlock>) {\n const attributes = getAttributes(props, {\n 'cite': props.block?.properties?.url\n });\n return (\n <blockquote {...attributes}>\n <RenderContents contents={props.children} fallback={<Quote.Children block={props.block} />} />\n </blockquote>\n );\n}\n\nQuote.Children = function (props: RenderBlockProps<QuoteBlock>) {\n const source = props.block?.properties?.source;\n const citation = props.block?.properties?.citation;\n const hasChildren = !!source || !!citation;\n return (\n hasChildren\n ? (\n <>\n <p>\n <RenderChildren block={props.block} />\n </p>\n <footer>{source} {!!citation ? (<cite>{citation}</cite>) : (<></>)}</footer>\n </>\n )\n : (<RenderChildren block={props.block} />)\n );\n};\n\n\nexport function Table(props: RenderBlockPropsWithChildren<TableBlock>) {\n const attributes = getAttributes(props);\n return (\n <table {...attributes}>\n <RenderContents contents={props.children} fallback={<Table.Children block={props.block} />} />\n </table>\n );\n}\n\nTable.Children = RenderBlockChildrenFactory<TableBlock>();\n\nexport function TableBody(props: RenderBlockPropsWithChildren<TableBodyBlock>) {\n const attributes = getAttributes(props);\n return (\n <tbody {...attributes}>\n <RenderContents contents={props.children} fallback={<TableBody.Children block={props.block} />} />\n </tbody>\n );\n}\n\nTableBody.Children = RenderBlockChildrenFactory<TableBodyBlock>();\n\nexport function TableCaption(props: RenderBlockPropsWithChildren<TableCaptionBlock>) {\n const attributes = getAttributes(props);\n return (\n <caption {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCaption.Children block={props.block} />} />\n </caption>\n );\n}\n\nTableCaption.Children = RenderBlockChildrenFactory<TableCaptionBlock>();\n\nexport function TableCell(props: RenderBlockPropsWithChildren<TableCellBlock>) {\n const attributes = getAttributes(props);\n return (\n <td {...attributes}>\n <RenderContents contents={props.children} fallback={<TableCell.Children block={props.block} />} />\n </td>\n );\n}\n\nTableCell.Children = RenderBlockChildrenFactory<TableCellBlock>();\n\nexport function TableFooter(props: RenderBlockPropsWithChildren<TableFooterBlock>) {\n const attributes = getAttributes(props);\n return (\n <tfoot {...attributes}>\n <RenderContents contents={props.children} fallback={<TableFooter.Children block={props.block} />} />\n </tfoot>\n );\n}\n\nTableFooter.Children = RenderBlockChildrenFactory<TableFooterBlock>();\n\nexport function TableHeader(props: RenderBlockPropsWithChildren<TableHeaderBlock>) {\n const attributes = getAttributes(props);\n return (\n <thead {...attributes}>\n <RenderContents contents={props.children} fallback={<TableHeader.Children block={props.block} />} />\n </thead>\n );\n}\n\nTableHeader.Children = RenderBlockChildrenFactory<TableHeaderBlock>();\n\nexport function TableHeaderCell(props: RenderBlockPropsWithChildren<TableHeaderCellBlock>) {\n const renderContext = useContext(BlockRenderContext);\n const sectionAncestor = findAncestorOfType(renderContext.ancestors, ['_tableHeader', '_tableBody', '_tableFooter']);\n const attributes = getAttributes(props, { scope: sectionAncestor?.type === '_tableHeader' ? 'col' : 'row' });\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 Abbreviation(props: RenderDecoratorPropsWithChildren) {\n const title = props?.block?.properties?.abbreviation?.title;\n const attributes = getAttributes(props, { title });\n return (\n <abbr {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineCode.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </abbr>\n );\n}\n\nAbbreviation.Children = DecoratorChildren;\n\nexport function InlineCode(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <code {...attributes}>\n <RenderContents contents={props.children} fallback={<InlineCode.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </code>\n );\n}\n\nInlineCode.Children = DecoratorChildren;\n\nexport function Delete(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <del {...attributes}>\n <RenderContents contents={props.children} fallback={<Delete.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </del>\n );\n}\n\nDelete.Children = DecoratorChildren;\n\nexport function Emphasis(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <em {...attributes}>\n <RenderContents contents={props.children} fallback={<Emphasis.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </em>\n );\n}\n\nEmphasis.Children = DecoratorChildren;\n\nexport function Insert(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <ins {...attributes}>\n <RenderContents contents={props.children} fallback={<Insert.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </ins>\n );\n}\n\nInsert.Children = DecoratorChildren;\n\nexport function Keyboard(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <kbd {...attributes}>\n <RenderContents contents={props.children} fallback={<Keyboard.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </kbd>\n );\n}\n\nKeyboard.Children = DecoratorChildren;\n\nexport function LineBreak(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (<br {...attributes} />);\n}\n\nLineBreak.Children = function (props: RenderDecoratorPropsWithChildren) {\n return (<></>)\n}\n\nexport function Mark(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <mark {...attributes}>\n <RenderContents contents={props.children} fallback={<Mark.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </mark>\n );\n}\n\nMark.Children = DecoratorChildren;\n\nexport function Strong(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <strong {...attributes}>\n <RenderContents contents={props.children} fallback={<Strong.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </strong>\n );\n}\n\nStrong.Children = DecoratorChildren;\n\nexport function Strikethrough(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <s {...attributes}>\n <RenderContents contents={props.children} fallback={<Strikethrough.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </s>\n );\n}\n\nStrikethrough.Children = DecoratorChildren;\n\nexport function Subscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sub {...attributes}>\n <RenderContents contents={props.children} fallback={<Subscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sub>\n );\n}\n\nSubscript.Children = DecoratorChildren;\n\nexport function Superscript(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <sup {...attributes}>\n <RenderContents contents={props.children} fallback={<Superscript.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </sup>\n );\n}\n\nSuperscript.Children = DecoratorChildren;\n\nexport function Underline(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <u {...attributes}>\n <RenderContents contents={props.children} fallback={<Underline.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </u>\n );\n}\n\nUnderline.Children = DecoratorChildren;\n\nexport function Variable(props: RenderDecoratorPropsWithChildren) {\n const attributes = getAttributes(props);\n return (\n <var {...attributes}>\n <RenderContents contents={props.children} fallback={<Variable.Children block={props.block} decorator={props.decorator} otherDecorators={props.otherDecorators} />} />\n </var>\n );\n}\n\nVariable.Children = DecoratorChildren;\n\nconst BLOCK_RENDERERS: BlockRenderers = {\n '_anchor': Anchor,\n '_asset': Asset,\n '_code': CodeWithCaption,\n '_component': Component,\n '_divider': Divider,\n '_entry': Entry,\n '_formContentType': FormContentType,\n '_fragment': Fragment,\n '_heading': Heading,\n '_image': ImageWithCaption,\n '_inlineEntry': InlineEntry,\n '_link': Link,\n '_liquid': Liquid,\n '_list': List,\n '_listItem': ListItem,\n '_panel': Panel,\n '_paragraph': Paragraph,\n '_quote': Quote,\n '_table': Table,\n '_tableBody': TableBody,\n '_tableCaption': TableCaption,\n '_tableCell': TableCell,\n '_tableFooter': TableFooter,\n '_tableHeader': TableHeader,\n '_tableHeaderCell': TableHeaderCell,\n '_tableRow': TableRow,\n};\n\nconst DECORATOR_RENDERERS: DecoratorRenderers = {\n 'abbreviation': Abbreviation,\n 'code': InlineCode,\n 'delete': Delete,\n 'emphasis': Emphasis,\n 'insert': Insert,\n 'keyboard': Keyboard,\n 'linebreak': LineBreak,\n 'mark': Mark,\n 'strikethrough': Strikethrough,\n 'strong': Strong,\n 'subscript': Subscript,\n 'superscript': Superscript,\n 'underline': Underline,\n 'variable': Variable\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,SAAoF,eAAe,kBAAkB;AAwFrH,IAAM,kBAAkB,cAAoC,CAAC,CAAC;AAErE,IAAM,qBAAqB,cAAsC,EAAE,WAAW,CAAC,EAAE,CAAC;AAElF,SAAS,mBAAoC,WAAoB,OAAmC;AAChG,SAAO,uCAAW,QAAQ,UAAU,KAAK,cAAY,MAAM,SAAS,SAAS,IAAiB;AAClG;AAiBO,SAAS,sBAAsB,OAAqC;AAEvE,QAAM,iBAAiB,MAAM;AAC7B,QAAM,SAAS,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