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";
12 import {CodeBlockNode} from "./code-block";
15 * Load the nodes for lexical.
17 export function getNodesForPageEditor(): (KlassConstructor<typeof LexicalNode> | LexicalNodeReplacement)[] {
19 CalloutNode, // Todo - Create custom
20 HeadingNode, // Todo - Create custom
21 QuoteNode, // Todo - Create custom
22 ListNode, // Todo - Create custom
29 DetailsNode, SummaryNode,
34 replace: ParagraphNode,
35 with: (node: ParagraphNode) => {
36 return new CustomParagraphNode();
41 with(node: TableNode) {
42 return new CustomTableNode();
48 export type LexicalNodeMatcher = (node: LexicalNode|null|undefined) => boolean;
49 export type LexicalElementNodeCreator = () => ElementNode;