Skip to content

Commit

Permalink
support for new text editor
Browse files Browse the repository at this point in the history
  • Loading branch information
dhairyadwivedi authored and Plopix committed Mar 14, 2023
1 parent 3041157 commit 4ad0915
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@crystallize/reactjs-components",
"license": "MIT",
"version": "1.3.2",
"version": "1.3.3",
"author": "Crystallize <hello@crystallize.com> (https://crystallize.com)",
"contributors": [
"Håkon Krogh <hakon@crystallize.com>",
Expand Down
31 changes: 31 additions & 0 deletions src/content-transformer/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,37 @@ export const Renderers: Record<keyof Overrides, (props: NodeProps) => JSX.Elemen
),
span: (props) => <NodeContent {...props} />,
'line-break': () => <br />,
heading1: (props) => (
<h1>
<NodeContent {...props} />
</h1>
),
heading2: (props) => (
<h2>
<NodeContent {...props} />
</h2>
),
heading3: (props) => (
<h3>
<NodeContent {...props} />
</h3>
),
deleted: (props) => (
<del>
<NodeContent {...props} />
</del>
),
subscripted: (props) => (
<sub>
<NodeContent {...props} />
</sub>
),
superscripted: (props) => (
<sup>
<NodeContent {...props} />
</sup>
),
'horizontal-line': (props) => <hr />,
};

export interface Props {
Expand Down
7 changes: 7 additions & 0 deletions src/content-transformer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ export interface Overrides {
div?: Override;
span?: Override;
'line-break'?: Override;
heading1?: Override;
heading2?: Override;
heading3?: Override;
deleted?: Override;
subscripted?: Override;
superscripted?: Override;
'horizontal-line'?: Override;
}

0 comments on commit 4ad0915

Please sign in to comment.