fix edgeToolbar and remove minimum Svelte version bump
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user