]> BookStack Code Mirror - bookstack/blob - resources/js/wysiwyg/nodes/index.ts
7dda306479b175fc6d7d9e38bdd664cfc522d8c3
[bookstack] / resources / js / wysiwyg / nodes / index.ts
1 import {HeadingNode, QuoteNode} from '@lexical/rich-text';
2 import {CalloutNode} from './callout';
3 import {KlassConstructor, LexicalNode, LexicalNodeReplacement, ParagraphNode} from "lexical";
4 import {CustomParagraphNode} from "./custom-paragraph";
5
6 /**
7  * Load the nodes for lexical.
8  */
9 export function getNodesForPageEditor(): (KlassConstructor<typeof LexicalNode> | LexicalNodeReplacement)[] {
10     return [
11         CalloutNode, // Todo - Create custom
12         HeadingNode, // Todo - Create custom
13         QuoteNode, // Todo - Create custom
14         CustomParagraphNode,
15         {
16             replace: ParagraphNode,
17             with: (node: ParagraphNode) => {
18                 return new CustomParagraphNode();
19             }
20         }
21     ];
22 }