Add node id to MiniMapNodeProps and MiniMapNode in Svelte Flow.

This commit is contained in:
Alessandro
2025-10-23 11:04:26 +02:00
parent 127c880e16
commit 6c7de33513
4 changed files with 26 additions and 18 deletions

View File

@@ -121,6 +121,7 @@
{#if node && nodeHasDimensions(node) && !node.hidden}
{@const nodeDimesions = getNodeDimensions(node)}
<MinimapNode
id={node.id}
x={node.internals.positionAbsolute.x}
y={node.internals.positionAbsolute.y}
{...nodeDimesions}

View File

@@ -4,6 +4,7 @@
import type { MiniMapNodeProps } from './types';
let {
id,
x,
y,
width,
@@ -17,6 +18,7 @@
class: className,
nodeComponent
}: {
id: string;
x: number;
y: number;
width: number;
@@ -36,6 +38,7 @@
{@const CustomComponent = nodeComponent}
<CustomComponent
{id}
{x}
{y}
{width}

View File

@@ -11,6 +11,7 @@ export type GetMiniMapNodeAttribute = (node: Node) => string;
* @public
*/
export type MiniMapNodeProps = {
id: string;
x: number;
y: number;
width: number;