1 import {HeadingNode, QuoteNode} from '@lexical/rich-text';
2 import {CalloutNode} from './callout';
3 import {ElementNode, KlassConstructor, LexicalNode, LexicalNodeReplacement, ParagraphNode} from "lexical";
4 import {CustomParagraphNode} from "./custom-paragraph";
5 import {LinkNode} from "@lexical/link";
6 import {ImageNode} from "./image";
7 import {DetailsNode, SummaryNode} from "./details";
8 import {ListItemNode, ListNode} from "@lexical/list";
9 import {TableCellNode, TableNode, TableRowNode} from "@lexical/table";
10 import {CustomTableNode} from "./custom-table";
11 import {HorizontalRuleNode} from "./horizontal-rule";
14 * Load the nodes for lexical.
16 export function getNodesForPageEditor(): (KlassConstructor<typeof LexicalNode> | LexicalNodeReplacement)[] {
18 CalloutNode, // Todo - Create custom
19 HeadingNode, // Todo - Create custom
20 QuoteNode, // Todo - Create custom
21 ListNode, // Todo - Create custom
28 DetailsNode, SummaryNode,
32 replace: ParagraphNode,
33 with: (node: ParagraphNode) => {
34 return new CustomParagraphNode();
39 with(node: TableNode) {
40 return new CustomTableNode();
46 export type LexicalNodeMatcher = (node: LexicalNode|null|undefined) => boolean;
47 export type LexicalElementNodeCreator = () => ElementNode;