|
|
|
|
@ -48,7 +48,6 @@ const handleStyles = {
|
|
|
|
|
const renderSpecialNodeHandles = (isStartNode: boolean, isEndNode: boolean, dataIns: any[], dataOuts: any[], apiIns: any[], apiOuts: any[]) => {
|
|
|
|
|
const renderStartNodeHandles = () => {
|
|
|
|
|
if (!isStartNode) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{apiOuts.map((_, index) => (
|
|
|
|
|
@ -68,7 +67,7 @@ const renderSpecialNodeHandles = (isStartNode: boolean, isEndNode: boolean, data
|
|
|
|
|
key={`output-handle-${index}`}
|
|
|
|
|
type="source"
|
|
|
|
|
position={Position.Right}
|
|
|
|
|
id={dataOuts[index].name || `output-${index}`}
|
|
|
|
|
id={dataOuts[index].name || dataOuts[index].id || `output-${index}`}
|
|
|
|
|
style={{
|
|
|
|
|
...handleStyles.data,
|
|
|
|
|
top: `${70 + apiIns.length * 20 + index * 20}px`
|
|
|
|
|
@ -81,7 +80,6 @@ const renderSpecialNodeHandles = (isStartNode: boolean, isEndNode: boolean, data
|
|
|
|
|
|
|
|
|
|
const renderEndNodeHandles = () => {
|
|
|
|
|
if (!isEndNode) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{apiIns.map((_, index) => (
|
|
|
|
|
@ -101,7 +99,7 @@ const renderSpecialNodeHandles = (isStartNode: boolean, isEndNode: boolean, data
|
|
|
|
|
key={`input-handle-${index}`}
|
|
|
|
|
type="target"
|
|
|
|
|
position={Position.Left}
|
|
|
|
|
id={dataIns[index].name || `input-${index}`}
|
|
|
|
|
id={dataIns[index].name || dataIns[index].id || `input-${index}`}
|
|
|
|
|
style={{
|
|
|
|
|
...handleStyles.data,
|
|
|
|
|
top: `${70 + apiIns.length * 20 + index * 20}px`
|
|
|
|
|
@ -298,8 +296,6 @@ const NodeContent = ({ data }: { data: NodeContentData }) => {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
console.log('connectedIns, connectedOuts:', connectedIns, connectedOuts);
|
|
|
|
|
|
|
|
|
|
return { connectedIns, connectedOuts };
|
|
|
|
|
}, [edges, nodeId, apiIns, apiOuts, dataIns, dataOuts]);
|
|
|
|
|
|
|
|
|
|
|