|
|
|
@ -12,7 +12,7 @@ import type { WorkflowVariableBlockType } from '../../types'
|
|
|
|
import { CustomTextNode } from '../custom-text/node'
|
|
|
|
import { CustomTextNode } from '../custom-text/node'
|
|
|
|
import { $createWorkflowVariableBlockNode } from './node'
|
|
|
|
import { $createWorkflowVariableBlockNode } from './node'
|
|
|
|
import { WorkflowVariableBlockNode } from './index'
|
|
|
|
import { WorkflowVariableBlockNode } from './index'
|
|
|
|
import { VAR_REGEX as REGEX } from '@/config'
|
|
|
|
import { VAR_REGEX as REGEX, resetReg } from '@/config'
|
|
|
|
|
|
|
|
|
|
|
|
const WorkflowVariableBlockReplacementBlock = ({
|
|
|
|
const WorkflowVariableBlockReplacementBlock = ({
|
|
|
|
workflowNodesMap,
|
|
|
|
workflowNodesMap,
|
|
|
|
@ -48,11 +48,12 @@ const WorkflowVariableBlockReplacementBlock = ({
|
|
|
|
}, [])
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
|
|
const transformListener = useCallback((textNode: any) => {
|
|
|
|
const transformListener = useCallback((textNode: any) => {
|
|
|
|
|
|
|
|
resetReg()
|
|
|
|
return decoratorTransform(textNode, getMatch, createWorkflowVariableBlockNode)
|
|
|
|
return decoratorTransform(textNode, getMatch, createWorkflowVariableBlockNode)
|
|
|
|
}, [createWorkflowVariableBlockNode, getMatch])
|
|
|
|
}, [createWorkflowVariableBlockNode, getMatch])
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
REGEX.lastIndex = 0
|
|
|
|
resetReg()
|
|
|
|
return mergeRegister(
|
|
|
|
return mergeRegister(
|
|
|
|
editor.registerNodeTransform(CustomTextNode, transformListener),
|
|
|
|
editor.registerNodeTransform(CustomTextNode, transformListener),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|