| | |
| | | |
| | | const WorkflowVariableBlockReplacementBlock = ({ |
| | | workflowNodesMap, |
| | | getVarType, |
| | | onInsert, |
| | | }: WorkflowVariableBlockType) => { |
| | | const [editor] = useLexicalComposerContext() |
| | |
| | | onInsert() |
| | | |
| | | const nodePathString = textNode.getTextContent().slice(3, -3) |
| | | return $applyNodeReplacement($createWorkflowVariableBlockNode(nodePathString.split('.'), workflowNodesMap, getVarType)) |
| | | }, [onInsert, workflowNodesMap, getVarType]) |
| | | return $applyNodeReplacement($createWorkflowVariableBlockNode(nodePathString.split('.'), workflowNodesMap)) |
| | | }, [onInsert, workflowNodesMap]) |
| | | |
| | | const getMatch = useCallback((text: string) => { |
| | | const matchArr = REGEX.exec(text) |
| | |
| | | } |
| | | }, []) |
| | | |
| | | const transformListener = useCallback((textNode: CustomTextNode) => { |
| | | const transformListener = useCallback((textNode: any) => { |
| | | resetReg() |
| | | return decoratorTransform(textNode, getMatch, createWorkflowVariableBlockNode) |
| | | }, [createWorkflowVariableBlockNode, getMatch]) |