From c453ee3f74512bf92f33a7afa3f7104aa82172f6 Mon Sep 17 00:00:00 2001 From: Shlomo Galle Date: Tue, 29 Jul 2025 00:19:24 +0300 Subject: [PATCH 1/3] chore(changeset): add --- .changeset/chilly-donkeys-relax.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/chilly-donkeys-relax.md diff --git a/.changeset/chilly-donkeys-relax.md b/.changeset/chilly-donkeys-relax.md new file mode 100644 index 00000000..74174172 --- /dev/null +++ b/.changeset/chilly-donkeys-relax.md @@ -0,0 +1,5 @@ +--- +'@xyflow/react': patch +--- + +Omit `defaultValue` from `Node`'s `domAttributes` to fix type incompatibility with `WritableDraft` From 0c6f66ae678625fe745124e1202de498911d0d24 Mon Sep 17 00:00:00 2001 From: Shlomo Galle Date: Tue, 29 Jul 2025 00:19:31 +0300 Subject: [PATCH 2/3] chores(types): omit defaultValue from Node domAttributes #5418 --- packages/react/src/types/nodes.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react/src/types/nodes.ts b/packages/react/src/types/nodes.ts index 1e6eb80f..fce71470 100644 --- a/packages/react/src/types/nodes.ts +++ b/packages/react/src/types/nodes.ts @@ -29,7 +29,14 @@ export type Node< */ domAttributes?: Omit< HTMLAttributes, - 'id' | 'style' | 'className' | 'draggable' | 'role' | 'aria-label' | keyof DOMAttributes + | 'id' + | 'style' + | 'className' + | 'draggable' + | 'role' + | 'aria-label' + | 'defaultValue' + | keyof DOMAttributes >; }; From 340fc9279ea4d04744f529b199e8123d31f0872c Mon Sep 17 00:00:00 2001 From: moklick Date: Tue, 29 Jul 2025 13:42:52 +0200 Subject: [PATCH 3/3] chore(types): omit defaultValue from Node and Edge type for Svelte Flow --- .changeset/chilly-donkeys-relax.md | 3 ++- packages/react/src/types/edges.ts | 5 ++++- packages/svelte/src/lib/types/edges.ts | 2 +- packages/svelte/src/lib/types/nodes.ts | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.changeset/chilly-donkeys-relax.md b/.changeset/chilly-donkeys-relax.md index 74174172..bde60469 100644 --- a/.changeset/chilly-donkeys-relax.md +++ b/.changeset/chilly-donkeys-relax.md @@ -1,5 +1,6 @@ --- '@xyflow/react': patch +'@xyflow/svelte': patch --- -Omit `defaultValue` from `Node`'s `domAttributes` to fix type incompatibility with `WritableDraft` +Omit `defaultValue` from `Node`'s and `Edge`'s `domAttributes` to fix type incompatibility when using `WritableDraft` diff --git a/packages/react/src/types/edges.ts b/packages/react/src/types/edges.ts index 2489fb12..175357f9 100644 --- a/packages/react/src/types/edges.ts +++ b/packages/react/src/types/edges.ts @@ -72,7 +72,10 @@ export type Edge< /** * General escape hatch for adding custom attributes to the edge's DOM element. */ - domAttributes?: Omit, 'id' | 'style' | 'className' | 'role' | 'aria-label'>; + domAttributes?: Omit< + SVGAttributes, + 'id' | 'style' | 'className' | 'role' | 'aria-label' | 'defaultValue' + >; }; type SmoothStepEdge = Record> = Edge< diff --git a/packages/svelte/src/lib/types/edges.ts b/packages/svelte/src/lib/types/edges.ts index 8b38797e..4e151d05 100644 --- a/packages/svelte/src/lib/types/edges.ts +++ b/packages/svelte/src/lib/types/edges.ts @@ -35,7 +35,7 @@ export type Edge< */ domAttributes?: Omit< SVGAttributes, - 'id' | 'style' | 'class' | 'role' | 'aria-label' + 'id' | 'style' | 'class' | 'role' | 'aria-label' | 'defaultValue' >; }; diff --git a/packages/svelte/src/lib/types/nodes.ts b/packages/svelte/src/lib/types/nodes.ts index 69f2063f..f751153f 100644 --- a/packages/svelte/src/lib/types/nodes.ts +++ b/packages/svelte/src/lib/types/nodes.ts @@ -38,6 +38,7 @@ export type Node< | 'draggable' | 'role' | 'aria-label' + | 'defaultValue' | keyof DOMAttributes >; };