refactor(svelte/edges): cleanup types and components
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { memo } from 'react';
|
||||
import { type Optional, getStraightPath } from '@xyflow/system';
|
||||
import { getStraightPath } from '@xyflow/system';
|
||||
|
||||
import BaseEdge from './BaseEdge';
|
||||
import type { EdgeProps } from '../../types';
|
||||
import type { StraightEdgeProps } from '../../types';
|
||||
|
||||
function createStraightEdge(params: { isInternal: boolean }) {
|
||||
// eslint-disable-next-line react/display-name
|
||||
@@ -23,7 +23,7 @@ function createStraightEdge(params: { isInternal: boolean }) {
|
||||
markerEnd,
|
||||
markerStart,
|
||||
interactionWidth,
|
||||
}: Optional<EdgeProps, 'id' | 'source' | 'target'>) => {
|
||||
}: StraightEdgeProps) => {
|
||||
const [path, labelX, labelY] = getStraightPath({ sourceX, sourceY, targetX, targetY });
|
||||
|
||||
const _id = params.isInternal ? undefined : id;
|
||||
|
||||
@@ -109,7 +109,7 @@ export type BaseEdgeProps = Pick<EdgeProps, 'style' | 'markerStart' | 'markerEnd
|
||||
|
||||
export type EdgeComponentProps<T = any> = Optional<Omit<EdgeProps<T>, 'source' | 'target'>, 'id'>;
|
||||
|
||||
export type StraightEdgeProps<T = any> = EdgeComponentProps<T>;
|
||||
export type StraightEdgeProps<T = any> = Omit<EdgeComponentProps<T>, 'sourcePosition' | 'targetPosition'>;
|
||||
|
||||
export type SmoothStepEdgeProps<T = any> = EdgeComponentProps<T> & {
|
||||
pathOptions?: SmoothStepPathOptions;
|
||||
|
||||
Reference in New Issue
Block a user