edges change

This commit is contained in:
StyleZhang
2024-03-04 19:01:38 +08:00
parent c4ca3bd34d
commit ccd3e519ea
6 changed files with 45 additions and 19 deletions

View File

@ -69,7 +69,7 @@ export const NodeTargetHandle = ({
triggerClassName={open => `
hidden absolute left-0 top-0 pointer-events-none
${nodeSelectorClassName}
${data.hovering && '!flex'}
${data._hovering && '!flex'}
${open && '!flex'}
`}
/>
@ -128,7 +128,7 @@ export const NodeSourceHandle = ({
triggerClassName={open => `
hidden absolute top-0 left-0 pointer-events-none
${nodeSelectorClassName}
${data.hovering && '!flex'}
${data._hovering && '!flex'}
${open && '!flex'}
`}
/>

View File

@ -7,7 +7,8 @@ import {
memo,
useCallback,
} from 'react'
import type { Node } from '../../types'
import { type Node } from '../../types'
import { BlockEnum } from '../../types'
import BlockIcon from '../../block-icon'
import { useWorkflow } from '../../hooks'
import { canRunBySingle } from '../../utils'
@ -86,19 +87,23 @@ const BasePanel: FC<BasePanelProps> = ({
/>
</div>
</div>
<div className='py-2 border-b-[0.5px] border-black/5'>
<div className='py-2'>
{cloneElement(children, { id, data })}
</div>
<div className='p-4'>
<div className='flex items-center mb-1 text-gray-700 text-[13px] font-semibold'>
<GitBranch01 className='mr-1 w-4 h-4' />
NEXT STEP
</div>
<div className='mb-2 text-xs text-gray-400'>
Add the next block in this workflow
</div>
<NextStep selectedNode={{ id, data } as Node} />
</div>
{
data.type !== BlockEnum.End && (
<div className='p-4 border-t-[0.5px] border-t-black/5'>
<div className='flex items-center mb-1 text-gray-700 text-[13px] font-semibold'>
<GitBranch01 className='mr-1 w-4 h-4' />
NEXT STEP
</div>
<div className='mb-2 text-xs text-gray-400'>
Add the next block in this workflow
</div>
<NextStep selectedNode={{ id, data } as Node} />
</div>
)
}
</div>
)
}