-
-
Notifications
You must be signed in to change notification settings - Fork 725
Expand file tree
/
Copy pathshared-schema.tsx
More file actions
27 lines (25 loc) · 688 Bytes
/
shared-schema.tsx
File metadata and controls
27 lines (25 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import {
BlockNoteSchema,
defaultBlockSpecs,
defaultProps,
} from "@blocknote/core";
import { createReactBlockSpec } from "@blocknote/react";
// Custom React block shared between API route and editor page
export const SimpleReactCustomParagraph = createReactBlockSpec(
{
type: "simpleReactCustomParagraph" as const,
propSchema: defaultProps,
content: "inline" as const,
},
() => ({
render: (props) => (
<p ref={props.contentRef} className={"simple-react-custom-paragraph"} />
),
}),
);
export const schema = BlockNoteSchema.create({
blockSpecs: {
...defaultBlockSpecs,
simpleReactCustomParagraph: SimpleReactCustomParagraph(),
},
});