refactor(svelte): add slot to controls, cleanup ControlButton types closes #3788

This commit is contained in:
moklick
2024-01-15 17:00:16 +01:00
parent 0fe2f2ae53
commit 4d8fc79d21
4 changed files with 31 additions and 8 deletions
@@ -13,7 +13,8 @@
type Node,
type Edge,
ConnectionMode,
useSvelteFlow
useSvelteFlow,
ControlButton
} from '@xyflow/svelte';
import CustomNode from './CustomNode.svelte';
@@ -187,7 +188,12 @@
connectionMode={ConnectionMode.Strict}
attributionPosition={'top-center'}
>
<Controls />
<Controls>
<ControlButton slot="before">xy</ControlButton>
<ControlButton aria-label="log" on:click={() => console.log('control button')}
>log</ControlButton
>
</Controls>
<Background variant={BackgroundVariant.Dots} />
<MiniMap />
<Panel position="top-right">