Merge pull request #4510 from bcakmakoglu/fix/handle-connectable
fix(svelte): rename `isConnectable` to `handleConnectable`
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@xyflow/svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Rename `isConnectable` prop locally to `isConnectableProp` to avoid naming collision with derived value of `isConnectable` in `<Handle>` component.
|
||||||
@@ -21,7 +21,6 @@
|
|||||||
export let type: $$Props['type'] = 'source';
|
export let type: $$Props['type'] = 'source';
|
||||||
export let position: $$Props['position'] = Position.Top;
|
export let position: $$Props['position'] = Position.Top;
|
||||||
export let style: $$Props['style'] = undefined;
|
export let style: $$Props['style'] = undefined;
|
||||||
export let isConnectable: $$Props['isConnectable'] = undefined;
|
|
||||||
export let isValidConnection: $$Props['isValidConnection'] = undefined;
|
export let isValidConnection: $$Props['isValidConnection'] = undefined;
|
||||||
export let onconnect: $$Props['onconnect'] = undefined;
|
export let onconnect: $$Props['onconnect'] = undefined;
|
||||||
export let ondisconnect: $$Props['ondisconnect'] = undefined;
|
export let ondisconnect: $$Props['ondisconnect'] = undefined;
|
||||||
@@ -29,13 +28,16 @@
|
|||||||
// export let isConnectableStart: $$Props['isConnectableStart'] = undefined;
|
// export let isConnectableStart: $$Props['isConnectableStart'] = undefined;
|
||||||
// export let isConnectableEnd: $$Props['isConnectableEnd'] = undefined;
|
// export let isConnectableEnd: $$Props['isConnectableEnd'] = undefined;
|
||||||
|
|
||||||
|
let isConnectableProp: $$Props['isConnectable'] = undefined;
|
||||||
|
export { isConnectableProp as isConnectable }
|
||||||
|
|
||||||
let className: $$Props['class'] = undefined;
|
let className: $$Props['class'] = undefined;
|
||||||
export { className as class };
|
export { className as class };
|
||||||
|
|
||||||
$: isTarget = type === 'target';
|
$: isTarget = type === 'target';
|
||||||
const nodeId = getContext<string>('svelteflow__node_id');
|
const nodeId = getContext<string>('svelteflow__node_id');
|
||||||
const connectable = getContext<Writable<boolean>>('svelteflow__node_connectable');
|
const connectable = getContext<Writable<boolean>>('svelteflow__node_connectable');
|
||||||
$: isConnectable = isConnectable !== undefined ? isConnectable : $connectable;
|
$: isConnectable = isConnectableProp !== undefined ? isConnectableProp : $connectable;
|
||||||
|
|
||||||
$: handleId = id || null;
|
$: handleId = id || null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user