fix(react) added internal edge components, to make id, source, handle optional on exported edges

This commit is contained in:
Peter
2023-11-28 14:30:26 +01:00
parent 43c78d6c11
commit 2e15fd72ee
13 changed files with 331 additions and 11 deletions
@@ -1,11 +1,12 @@
import { memo } from 'react';
import { Position, getBezierPath } from '@xyflow/system';
import { type Optional, Position, getBezierPath } from '@xyflow/system';
import BaseEdge from './BaseEdge';
import type { BezierEdgeProps } from '../../types';
const BezierEdge = memo(
({
id,
sourceX,
sourceY,
targetX,
@@ -23,7 +24,7 @@ const BezierEdge = memo(
markerStart,
pathOptions,
interactionWidth,
}: BezierEdgeProps) => {
}: Optional<BezierEdgeProps, 'id' | 'source' | 'target'>) => {
const [path, labelX, labelY] = getBezierPath({
sourceX,
sourceY,
@@ -36,6 +37,7 @@ const BezierEdge = memo(
return (
<BaseEdge
id={id}
path={path}
labelX={labelX}
labelY={labelY}