diff options
Diffstat (limited to 'frontend/src/components/document/DocumentEditor.tsx')
| -rw-r--r-- | frontend/src/components/document/DocumentEditor.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/frontend/src/components/document/DocumentEditor.tsx b/frontend/src/components/document/DocumentEditor.tsx index d50c093..2ef37fe 100644 --- a/frontend/src/components/document/DocumentEditor.tsx +++ b/frontend/src/components/document/DocumentEditor.tsx @@ -18,11 +18,13 @@ import { import { $createHeadingNode } from '@lexical/rich-text'; import { StepsDiagramNode, $isStepsDiagramNode, $createStepsDiagramNode } from './nodes/StepsDiagramNode'; +import { ContractBlockNode, $isContractBlockNode } from './nodes/ContractBlockNode'; import editorTheme from './EditorTheme'; import AutoSavePlugin from './AutoSavePlugin'; import ContextMenu, { type ContextMenuAction } from './ContextMenu'; import './DocumentEditor.css'; import './nodes/StepsDiagram.css'; +import './nodes/ContractBlock.css'; interface DocumentEditorProps { directiveId: string; @@ -97,7 +99,7 @@ export default function DocumentEditor({ namespace: `DocumentEditor-${directiveId}`, theme: editorTheme, editorState: buildInitialEditorState(directiveId, title, goal), - nodes: [HeadingNode, ListNode, ListItemNode, LinkNode, StepsDiagramNode], + nodes: [HeadingNode, ListNode, ListItemNode, LinkNode, StepsDiagramNode, ContractBlockNode], onError, editable: !readOnly, }; @@ -115,8 +117,9 @@ export default function DocumentEditor({ for (let i = 0; i < children.length; i++) { const child = children[i]; - // Skip the steps diagram node when extracting text + // Skip decorator nodes (steps diagram, contract blocks) when extracting text if ($isStepsDiagramNode(child)) continue; + if ($isContractBlockNode(child)) continue; const text = child.getTextContent(); |
