chore(react): cleanup base edge

This commit is contained in:
moklick
2024-12-04 12:17:35 +01:00
parent cc6b1d9717
commit 7a8e53463e
2 changed files with 2 additions and 22 deletions
@@ -2,10 +2,9 @@ import { isNumeric } from '@xyflow/system';
import cc from 'classcat'; import cc from 'classcat';
import { EdgeText } from './EdgeText'; import { EdgeText } from './EdgeText';
import type { BaseEdgeProps, EdgeComponentWithPathOptions, EdgeProps } from '../../types'; import type { BaseEdgeProps } from '../../types';
export function BaseEdge({ export function BaseEdge({
id,
path, path,
labelX, labelX,
labelY, labelY,
@@ -15,23 +14,12 @@ export function BaseEdge({
labelBgStyle, labelBgStyle,
labelBgPadding, labelBgPadding,
labelBgBorderRadius, labelBgBorderRadius,
markerEnd,
markerStart,
className,
interactionWidth = 20, interactionWidth = 20,
...props ...props
}: BaseEdgeProps) { }: BaseEdgeProps) {
return ( return (
<> <>
<path <path {...props} d={path} fill="none" className={cc(['react-flow__edge-path', props.className])} />
{...props}
id={id}
d={path}
fill="none"
className={cc(['react-flow__edge-path', className])}
markerEnd={markerEnd}
markerStart={markerStart}
/>
{interactionWidth && ( {interactionWidth && (
<path <path
d={path} d={path}
-8
View File
@@ -130,14 +130,6 @@ export type BaseEdgeProps = Omit<SVGAttributes<SVGPathElement>, 'd'> &
labelX?: number; labelX?: number;
/** The y position of edge label */ /** The y position of edge label */
labelY?: number; labelY?: number;
/** Marker at start of edge
* @example 'url(#arrow)'
*/
markerStart?: string;
/** Marker at end of edge
* @example 'url(#arrow)'
*/
markerEnd?: string;
/** SVG path of the edge */ /** SVG path of the edge */
path: string; path: string;
}; };