@@ -5,16 +5,16 @@ import classNames from 'classnames';
5
5
import produce from 'immer' ;
6
6
import { useShallow } from 'zustand/react/shallow' ;
7
7
import { Handle , Position , useReactFlow } from '@xyflow/react' ;
8
- import useStore from '../../models/store' ;
9
8
import { capitalize , uuid } from '../../utils' ;
9
+ import useStore from '../../models/store' ;
10
10
import { ConfigContext } from '../../models/context' ;
11
11
import NodeSelectPopover from '../NodesPopover' ;
12
12
import './index.less' ;
13
13
14
14
export default memo ( ( props : any ) => {
15
15
const { id, type, data, layout, isConnectable, selected, onClick } = props ;
16
- const configCtx : any = useContext ( ConfigContext ) ;
17
- const NodeWidget = configCtx ?. widgets [ `${ capitalize ( type ) } Node` ] ;
16
+ const { widgets , settingMap } = useContext ( ConfigContext ) ;
17
+ const NodeWidget = widgets [ `${ capitalize ( type ) } Node` ] ;
18
18
19
19
const [ isHovered , setIsHovered ] = useState ( false ) ;
20
20
const reactflow = useReactFlow ( ) ;
@@ -60,14 +60,16 @@ export default memo((props: any) => {
60
60
setEdges ( newEdges ) ;
61
61
} ;
62
62
63
-
64
63
let targetPosition = Position . Left ;
65
64
let sourcePosition = Position . Right ;
66
65
if ( layout === 'TB' ) {
67
66
targetPosition = Position . Top ;
68
67
sourcePosition = Position . Bottom ;
69
68
}
70
69
70
+ console . log ( settingMap , 'settingMap=====' )
71
+
72
+
71
73
return (
72
74
< div
73
75
className = { classNames ( 'xflow-node-container' , {
@@ -77,7 +79,7 @@ export default memo((props: any) => {
77
79
onMouseEnter = { ( ) => setIsHovered ( true ) }
78
80
onMouseLeave = { ( ) => setIsHovered ( false ) }
79
81
>
80
- { (
82
+ { ! settingMap ?. [ type ] ?. targetHandleHidden && (
81
83
< Handle
82
84
type = 'target'
83
85
position = { targetPosition }
@@ -90,7 +92,7 @@ export default memo((props: any) => {
90
92
data = { data }
91
93
onClick = { ( ) => onClick ( data ) }
92
94
/>
93
- { (
95
+ { ! settingMap ?. [ type ] ?. sourceHandleHidden && (
94
96
< Handle
95
97
type = 'source'
96
98
position = { sourcePosition }
0 commit comments