Skip to content

Commit

Permalink
feat: 增加通用节点渲染能力
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanbo.lh committed Nov 20, 2024
1 parent 054a635 commit 4e27dc8
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions packages/x-flow/src/components/CandidateNode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ const CandidateNode = () => {
}))
);


console.log(candidateNode, 'candidateNode+++')

useEventListener('click', (ev) => {
if (!candidateNode) {
return;
Expand All @@ -56,27 +53,21 @@ const CandidateNode = () => {
setCandidateNode(null);
});

useEventListener('contextmenu', (e) => {
// const { candidateNode } = workflowStore.getState()
// if (candidateNode) {
// e.preventDefault()
// workflowStore.setState({ candidateNode: undefined })
// }
})

if (!candidateNode) {
return null
}

console.log(mousePosition, '=======000000')

return (
<div
className='absolute z-10'
style={{
zIndex: 100,
left: mousePosition?.elementX,
top: mousePosition?.elementY,
transform: `scale(${zoom})`,
transformOrigin: '0 0',
position: 'absolute',
zIndex: 10000
}}
>
<CustomNode {...candidateNode as any} type={candidateNode?.data?._nodeType } />
Expand Down

0 comments on commit 4e27dc8

Please sign in to comment.