chore(svelte): formatted and lint errors fixed

This commit is contained in:
peterkogo
2024-04-03 10:51:22 +02:00
parent d775012e1b
commit 3a4ddc2aee
16 changed files with 60 additions and 76 deletions
@@ -6,7 +6,8 @@ import {
ConnectionLineType,
ConnectionMode,
Position,
internalsSymbol
internalsSymbol,
type HandleElement
} from '@xyflow/system';
import type { SvelteFlowStoreState } from './types';
@@ -68,16 +69,16 @@ export function getDerivedConnectionProps(
const fromHandleBounds = fromNode?.[internalsSymbol]?.handleBounds;
const handleBoundsStrict =
fromHandleBounds?.[connection.connectionStartHandle.type || 'source'] || [];
const handleBoundsLoose = handleBoundsStrict
const handleBoundsLoose: HandleElement[] | undefined | null = handleBoundsStrict
? handleBoundsStrict
: fromHandleBounds?.[
connection?.connectionStartHandle?.type === 'source' ? 'target' : 'source'
]!;
];
const handleBounds =
connectionMode === ConnectionMode.Strict ? handleBoundsStrict : handleBoundsLoose;
const fromHandle = connection.connectionStartHandle?.handleId
? handleBounds.find((d) => d.id === connection.connectionStartHandle?.handleId)
: handleBounds[0];
? handleBounds?.find((d) => d.id === connection.connectionStartHandle?.handleId)
: handleBounds?.[0];
const fromHandleX = fromHandle
? fromHandle.x + fromHandle.width / 2
: (fromNode?.computed?.width ?? 0) / 2;