From bc416dcab0e7a4220558e2aa814670370b773f17 Mon Sep 17 00:00:00 2001 From: peterkogo Date: Wed, 11 Jun 2025 17:10:14 +0200 Subject: [PATCH 1/5] export additional types --- packages/svelte/src/lib/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/svelte/src/lib/index.ts b/packages/svelte/src/lib/index.ts index 2fc0befc..bed08663 100644 --- a/packages/svelte/src/lib/index.ts +++ b/packages/svelte/src/lib/index.ts @@ -105,6 +105,9 @@ export { type OnResizeStart, type OnResize, type OnResizeEnd, + type OnReconnect, + type OnReconnectStart, + type OnReconnectEnd, type ControlPosition, type ControlLinePosition, ResizeControlVariant, From f0bcec449c8f7fdab60e5ed287d8086e2584a4cb Mon Sep 17 00:00:00 2001 From: moklick Date: Thu, 12 Jun 2025 10:47:42 +0200 Subject: [PATCH 2/5] chore(types): add exports --- packages/react/src/index.ts | 3 +++ packages/svelte/src/lib/index.ts | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 305acea7..0b67466e 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -109,6 +109,9 @@ export { type NodeConnection, type OnReconnect, type AriaLabelConfig, + type SetCenter, + type SetViewport, + type FitBounds, } from '@xyflow/system'; // we need this workaround to prevent a duplicate identifier error diff --git a/packages/svelte/src/lib/index.ts b/packages/svelte/src/lib/index.ts index bed08663..3c16faca 100644 --- a/packages/svelte/src/lib/index.ts +++ b/packages/svelte/src/lib/index.ts @@ -116,7 +116,10 @@ export { type ResizeDragEvent, type IsValidConnection, type NodeConnection, - type AriaLabelConfig + type AriaLabelConfig, + type SetCenter, + type SetViewport, + type FitBounds } from '@xyflow/system'; // system utils From 3d7e8b6bb10001ee84d79ca4f6a9fd0053c4a276 Mon Sep 17 00:00:00 2001 From: moklick Date: Thu, 12 Jun 2025 10:49:43 +0200 Subject: [PATCH 3/5] chore(changeset): add --- .changeset/proud-stingrays-run.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/proud-stingrays-run.md diff --git a/.changeset/proud-stingrays-run.md b/.changeset/proud-stingrays-run.md new file mode 100644 index 00000000..b3ef8c85 --- /dev/null +++ b/.changeset/proud-stingrays-run.md @@ -0,0 +1,6 @@ +--- +'@xyflow/react': patch +'@xyflow/svelte': patch +--- + +Add missing type exports From 85efdd8876e3f915fa8bfd13f8bc73552975f50b Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 16 Jun 2025 09:55:50 +0200 Subject: [PATCH 4/5] chore(system): add comments for types --- packages/system/src/types/general.ts | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/packages/system/src/types/general.ts b/packages/system/src/types/general.ts index 4e7cf910..367ca1d8 100644 --- a/packages/system/src/types/general.ts +++ b/packages/system/src/types/general.ts @@ -21,8 +21,33 @@ export type ZoomInOut = (options?: ViewportHelperFunctionOptions) => Promise Promise; export type GetZoom = () => number; export type GetViewport = () => Viewport; + +/** + * The `SetViewport` function is used to set the viewport of the flow. + * + * @inline + * @param viewport - The viewport to set. + * @param options - Optional parameters to control the animation and easing of the viewport change. + */ export type SetViewport = (viewport: Viewport, options?: ViewportHelperFunctionOptions) => Promise; + +/** + * The `SetCenter` function is used to set the center of the flow viewport to a specific position + * + * @inline + * @param x - x coordinate + * @param y - y coordinate + * @param options - Optional parameters to control the animation and easing of the viewport change. + */ export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => Promise; + +/** + * The `FitBounds` function is used to fit the flow viewport to the bounds of the nodes. + * + * @inline + * @param bounds - The bounds to fit the viewport to. + * @param options - Optional parameters to control the animation and easing of the viewport change. + */ export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => Promise; /** @@ -179,10 +204,16 @@ export type ViewportHelperFunctionOptions = { interpolate?: 'smooth' | 'linear'; }; +/** + * @inline + */ export type SetCenterOptions = ViewportHelperFunctionOptions & { zoom?: number; }; +/** + * @inline + */ export type FitBoundsOptions = ViewportHelperFunctionOptions & { padding?: number; }; From 1d7550d4dec3c8008ff6e7527d27668917d2d91a Mon Sep 17 00:00:00 2001 From: Moritz Klack Date: Mon, 16 Jun 2025 09:56:44 +0200 Subject: [PATCH 5/5] Update proud-stingrays-run.md --- .changeset/proud-stingrays-run.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.changeset/proud-stingrays-run.md b/.changeset/proud-stingrays-run.md index b3ef8c85..8b835138 100644 --- a/.changeset/proud-stingrays-run.md +++ b/.changeset/proud-stingrays-run.md @@ -1,6 +1,7 @@ --- '@xyflow/react': patch '@xyflow/svelte': patch +'@xyflow/system': patch --- Add missing type exports