2024-05-28 03:23:45 +08:00
|
|
|
import {HeadingNode, QuoteNode} from '@lexical/rich-text';
|
2024-05-28 22:09:50 +08:00
|
|
|
import {CalloutNode} from './callout';
|
|
|
|
import {KlassConstructor, LexicalNode, LexicalNodeReplacement, ParagraphNode} from "lexical";
|
|
|
|
import {CustomParagraphNode} from "./custom-paragraph";
|
2024-05-28 03:23:45 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Load the nodes for lexical.
|
|
|
|
*/
|
2024-05-28 22:09:50 +08:00
|
|
|
export function getNodesForPageEditor(): (KlassConstructor<typeof LexicalNode> | LexicalNodeReplacement)[] {
|
2024-05-28 03:23:45 +08:00
|
|
|
return [
|
2024-05-28 22:09:50 +08:00
|
|
|
CalloutNode, // Todo - Create custom
|
|
|
|
HeadingNode, // Todo - Create custom
|
|
|
|
QuoteNode, // Todo - Create custom
|
|
|
|
CustomParagraphNode,
|
|
|
|
{
|
|
|
|
replace: ParagraphNode,
|
|
|
|
with: (node: ParagraphNode) => {
|
|
|
|
return new CustomParagraphNode();
|
|
|
|
}
|
|
|
|
}
|
2024-05-28 03:23:45 +08:00
|
|
|
];
|
|
|
|
}
|