fix edgeToolbar and remove minimum Svelte version bump

This commit is contained in:
peterkogo
2025-12-03 11:19:34 +01:00
parent a83b4bd85d
commit 202f48e379
6 changed files with 384 additions and 357 deletions
@@ -5,6 +5,7 @@
import { EdgeLabel } from '$lib/components/EdgeLabel';
import type { EdgeToolbarProps } from './types';
import { getContext } from 'svelte';
import { getEdgeIdContext } from '$lib/store/context';
let {
x,
@@ -19,11 +20,8 @@
}: EdgeToolbarProps = $props();
const store = useStore();
const edgeId = getContext<string>('svelteflow__edge_id');
if (!edgeId) {
throw new Error('EdgeToolbar must be used within an edge');
}
const edgeId = getEdgeIdContext('EdgeToolbar must be used within an edge');
const isActive = $derived(
typeof isVisible === 'boolean' ? isVisible : store.edgeLookup.get(edgeId)?.selected