diff --git a/examples/svelte/src/routes/examples/overview/Flow.svelte b/examples/svelte/src/routes/examples/overview/Flow.svelte index a811fb80..46ef2cf9 100644 --- a/examples/svelte/src/routes/examples/overview/Flow.svelte +++ b/examples/svelte/src/routes/examples/overview/Flow.svelte @@ -222,7 +222,7 @@ > - + diff --git a/packages/svelte/src/lib/components/ConnectionLine/ConnectionLine.svelte b/packages/svelte/src/lib/components/ConnectionLine/ConnectionLine.svelte index b51862e0..55cbe898 100644 --- a/packages/svelte/src/lib/components/ConnectionLine/ConnectionLine.svelte +++ b/packages/svelte/src/lib/components/ConnectionLine/ConnectionLine.svelte @@ -13,14 +13,14 @@ let { store = $bindable(), type, - containerStyle = '', - style = '', + containerStyle, + style, LineComponent }: { store: SvelteFlowStore; type: ConnectionLineType; - containerStyle: string; - style: string; + containerStyle?: string; + style?: string; LineComponent?: Component; } = $props(); diff --git a/packages/svelte/src/lib/components/EdgeLabel/EdgeLabel.svelte b/packages/svelte/src/lib/components/EdgeLabel/EdgeLabel.svelte index 3ed73653..474a6e04 100644 --- a/packages/svelte/src/lib/components/EdgeLabel/EdgeLabel.svelte +++ b/packages/svelte/src/lib/components/EdgeLabel/EdgeLabel.svelte @@ -4,10 +4,13 @@ import { useStore } from '$lib/store'; import type { EdgeLabelProps } from './types'; + import { toPxString } from '$lib/utils'; let { - x, - y, + x = 0, + y = 0, + width, + height, selectEdgeOnClick = false, transparent = false, style, @@ -27,7 +30,8 @@ style:cursor={selectEdgeOnClick ? 'pointer' : undefined} style:transform="translate(-50%, -50%) translate({x}px,{y}px)" style:pointer-events="all" - {style} + style:width={toPxString(width)} + style:height={toPxString(height)} role="button" tabindex="-1" onclick={() => { diff --git a/packages/svelte/src/lib/components/EdgeLabel/types.ts b/packages/svelte/src/lib/components/EdgeLabel/types.ts index a7473d9a..28902436 100644 --- a/packages/svelte/src/lib/components/EdgeLabel/types.ts +++ b/packages/svelte/src/lib/components/EdgeLabel/types.ts @@ -1,12 +1,13 @@ +import type { Dimensions, XYPosition } from '@xyflow/system'; import type { Snippet } from 'svelte'; import type { ClassValue, HTMLAttributes } from 'svelte/elements'; export type EdgeLabelProps = { x?: number; y?: number; + width?: number; + height?: number; selectEdgeOnClick?: boolean; transparent?: boolean; - style?: string; - class?: ClassValue; children?: Snippet; } & HTMLAttributes; diff --git a/packages/svelte/src/lib/components/EdgeReconnectAnchor/EdgeReconnectAnchor.svelte b/packages/svelte/src/lib/components/EdgeReconnectAnchor/EdgeReconnectAnchor.svelte index 7fc410d6..96ea290a 100644 --- a/packages/svelte/src/lib/components/EdgeReconnectAnchor/EdgeReconnectAnchor.svelte +++ b/packages/svelte/src/lib/components/EdgeReconnectAnchor/EdgeReconnectAnchor.svelte @@ -107,8 +107,9 @@