From 468699bfdd0c1890926c75775e6f5e64132ac74e Mon Sep 17 00:00:00 2001 From: CRIMX Date: Mon, 9 Dec 2024 19:08:49 +0800 Subject: [PATCH 1/9] fix(system): safely handles non-html-element object `event.composedPath` and `event.target` do not always return `HTMLElement` object(as their types suggested). --- packages/system/src/utils/dom.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/system/src/utils/dom.ts b/packages/system/src/utils/dom.ts index 88654772..b3648ede 100644 --- a/packages/system/src/utils/dom.ts +++ b/packages/system/src/utils/dom.ts @@ -40,7 +40,7 @@ const inputTags = ['INPUT', 'SELECT', 'TEXTAREA']; export function isInputDOMNode(event: KeyboardEvent): boolean { // using composed path for handling shadow dom const target = (event.composedPath?.()?.[0] || event.target) as HTMLElement; - const isInput = inputTags.includes(target?.nodeName) || target?.hasAttribute('contenteditable'); + const isInput = inputTags.includes(target?.nodeName) || target?.hasAttribute?.('contenteditable'); // when an input field is focused we don't want to trigger deletion or movement of nodes return isInput || !!target?.closest('.nokey'); From 738510b7095c9368a4c4c8c8a75fdfc802b70cc9 Mon Sep 17 00:00:00 2001 From: peterkogo Date: Mon, 9 Dec 2024 12:16:05 +0100 Subject: [PATCH 2/9] Prevent rerendering of EdgeRenderer by removing width & height from selector --- packages/react/src/container/EdgeRenderer/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/react/src/container/EdgeRenderer/index.tsx b/packages/react/src/container/EdgeRenderer/index.tsx index 6e898cbb..01f64f80 100644 --- a/packages/react/src/container/EdgeRenderer/index.tsx +++ b/packages/react/src/container/EdgeRenderer/index.tsx @@ -31,8 +31,6 @@ type EdgeRendererProps = Pick< }; const selector = (s: ReactFlowState) => ({ - width: s.width, - height: s.height, edgesFocusable: s.edgesFocusable, edgesReconnectable: s.edgesReconnectable, elementsSelectable: s.elementsSelectable, From 41d4743a690f054f6dc2b9084b5fad8e54ade921 Mon Sep 17 00:00:00 2001 From: peterkogo Date: Mon, 9 Dec 2024 12:17:47 +0100 Subject: [PATCH 3/9] chore(changeset) add --- .changeset/tall-kids-lick.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tall-kids-lick.md diff --git a/.changeset/tall-kids-lick.md b/.changeset/tall-kids-lick.md new file mode 100644 index 00000000..e9995292 --- /dev/null +++ b/.changeset/tall-kids-lick.md @@ -0,0 +1,5 @@ +--- +'@xyflow/react': patch +--- + +Prevent unnecessary rerenders of edges when resizing the flow. From 7de640685a2c39b60bc550858d2a6e6951184a95 Mon Sep 17 00:00:00 2001 From: peterkogo Date: Mon, 9 Dec 2024 12:30:05 +0100 Subject: [PATCH 4/9] Fix origin not being respected, when calulating rect --- packages/react/src/hooks/useReactFlow.ts | 3 +-- packages/svelte/src/lib/hooks/useSvelteFlow.ts | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/react/src/hooks/useReactFlow.ts b/packages/react/src/hooks/useReactFlow.ts index c4d81e2d..2045761d 100644 --- a/packages/react/src/hooks/useReactFlow.ts +++ b/packages/react/src/hooks/useReactFlow.ts @@ -55,11 +55,10 @@ export function useReactFlow Date: Mon, 9 Dec 2024 12:31:10 +0100 Subject: [PATCH 5/9] chore(changeset) add --- .changeset/many-emus-begin.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/many-emus-begin.md diff --git a/.changeset/many-emus-begin.md b/.changeset/many-emus-begin.md new file mode 100644 index 00000000..ea5fd7fa --- /dev/null +++ b/.changeset/many-emus-begin.md @@ -0,0 +1,6 @@ +--- +'@xyflow/react': patch +'@xyflow/svelte': patch +--- + +Fix intersections for nodes with origins other than [0,0]. From 35c8b6f403d8404250970b65f20a16a512b9f217 Mon Sep 17 00:00:00 2001 From: peterkogo Date: Mon, 9 Dec 2024 12:35:24 +0100 Subject: [PATCH 6/9] adjust changelog --- .changeset/many-emus-begin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/many-emus-begin.md b/.changeset/many-emus-begin.md index ea5fd7fa..3388e71a 100644 --- a/.changeset/many-emus-begin.md +++ b/.changeset/many-emus-begin.md @@ -3,4 +3,4 @@ '@xyflow/svelte': patch --- -Fix intersections for nodes with origins other than [0,0]. +Fix intersections for nodes with origins other than [0,0]. Thanks [@gmvrpw](https://github.com/gmvrpw)! From 21b7e9542b818ac3d7a9d9dfd9c80bfba6b08d37 Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 9 Dec 2024 17:29:45 +0100 Subject: [PATCH 7/9] chore(changeset): update --- .changeset/cuddly-mails-kneel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/cuddly-mails-kneel.md b/.changeset/cuddly-mails-kneel.md index 2235a163..11d636b6 100644 --- a/.changeset/cuddly-mails-kneel.md +++ b/.changeset/cuddly-mails-kneel.md @@ -3,4 +3,4 @@ '@xyflow/svelte': patch --- -Add group node to BuiltInNode type +Add group node to BuiltInNode type. Thanks [@sjdemartini](https://github.com/sjdemartini)! From d60331e6baa7931c46af219e35c1bedbd156187c Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 9 Dec 2024 17:36:18 +0100 Subject: [PATCH 8/9] chore(changeseg): add --- .changeset/brown-pugs-pump.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/brown-pugs-pump.md diff --git a/.changeset/brown-pugs-pump.md b/.changeset/brown-pugs-pump.md new file mode 100644 index 00000000..4c62f551 --- /dev/null +++ b/.changeset/brown-pugs-pump.md @@ -0,0 +1,5 @@ +--- +'@xyflow/system': patch +--- + +Refactor isInputDOMNode so that it handles non-html objects From ba75c01da4c681f3490fd7f90b109127c84301ab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 9 Dec 2024 16:38:04 +0000 Subject: [PATCH 9/9] chore(packages): bump --- .changeset/blue-teachers-sell.md | 5 ----- .changeset/brown-pugs-pump.md | 5 ----- .changeset/cuddly-mails-kneel.md | 6 ------ .changeset/many-emus-begin.md | 6 ------ .changeset/old-lobsters-cover.md | 5 ----- .changeset/quick-carrots-allow.md | 5 ----- .changeset/selfish-tables-tie.md | 5 ----- .changeset/silly-beans-remain.md | 5 ----- .changeset/tall-kids-lick.md | 5 ----- .changeset/thick-fans-cheer.md | 5 ----- packages/react/CHANGELOG.md | 25 +++++++++++++++++++++++++ packages/react/package.json | 2 +- packages/svelte/CHANGELOG.md | 11 +++++++++++ packages/svelte/package.json | 2 +- packages/system/CHANGELOG.md | 6 ++++++ packages/system/package.json | 2 +- 16 files changed, 45 insertions(+), 55 deletions(-) delete mode 100644 .changeset/blue-teachers-sell.md delete mode 100644 .changeset/brown-pugs-pump.md delete mode 100644 .changeset/cuddly-mails-kneel.md delete mode 100644 .changeset/many-emus-begin.md delete mode 100644 .changeset/old-lobsters-cover.md delete mode 100644 .changeset/quick-carrots-allow.md delete mode 100644 .changeset/selfish-tables-tie.md delete mode 100644 .changeset/silly-beans-remain.md delete mode 100644 .changeset/tall-kids-lick.md delete mode 100644 .changeset/thick-fans-cheer.md diff --git a/.changeset/blue-teachers-sell.md b/.changeset/blue-teachers-sell.md deleted file mode 100644 index f0d944aa..00000000 --- a/.changeset/blue-teachers-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xyflow/react': patch ---- - -Make it possible to use expandParent with immer and other immutable helpers diff --git a/.changeset/brown-pugs-pump.md b/.changeset/brown-pugs-pump.md deleted file mode 100644 index 4c62f551..00000000 --- a/.changeset/brown-pugs-pump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xyflow/system': patch ---- - -Refactor isInputDOMNode so that it handles non-html objects diff --git a/.changeset/cuddly-mails-kneel.md b/.changeset/cuddly-mails-kneel.md deleted file mode 100644 index 11d636b6..00000000 --- a/.changeset/cuddly-mails-kneel.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xyflow/react': patch -'@xyflow/svelte': patch ---- - -Add group node to BuiltInNode type. Thanks [@sjdemartini](https://github.com/sjdemartini)! diff --git a/.changeset/many-emus-begin.md b/.changeset/many-emus-begin.md deleted file mode 100644 index 3388e71a..00000000 --- a/.changeset/many-emus-begin.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xyflow/react': patch -'@xyflow/svelte': patch ---- - -Fix intersections for nodes with origins other than [0,0]. Thanks [@gmvrpw](https://github.com/gmvrpw)! diff --git a/.changeset/old-lobsters-cover.md b/.changeset/old-lobsters-cover.md deleted file mode 100644 index 82795889..00000000 --- a/.changeset/old-lobsters-cover.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xyflow/react': patch ---- - -Allow custom data-testid for ReactFlow component diff --git a/.changeset/quick-carrots-allow.md b/.changeset/quick-carrots-allow.md deleted file mode 100644 index 960c3815..00000000 --- a/.changeset/quick-carrots-allow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xyflow/react': patch ---- - -Type isValidConnection prop correctly by passing EdgeType diff --git a/.changeset/selfish-tables-tie.md b/.changeset/selfish-tables-tie.md deleted file mode 100644 index 8ac759cf..00000000 --- a/.changeset/selfish-tables-tie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xyflow/react': patch ---- - -Support passing `path` element attributes to `BaseEdge` component. diff --git a/.changeset/silly-beans-remain.md b/.changeset/silly-beans-remain.md deleted file mode 100644 index 42c8b49e..00000000 --- a/.changeset/silly-beans-remain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xyflow/react': patch ---- - -Prevent default scrolling behavior when nodes or a selection is moved with an arrow key press. diff --git a/.changeset/tall-kids-lick.md b/.changeset/tall-kids-lick.md deleted file mode 100644 index e9995292..00000000 --- a/.changeset/tall-kids-lick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xyflow/react': patch ---- - -Prevent unnecessary rerenders of edges when resizing the flow. diff --git a/.changeset/thick-fans-cheer.md b/.changeset/thick-fans-cheer.md deleted file mode 100644 index af987d35..00000000 --- a/.changeset/thick-fans-cheer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xyflow/react': patch ---- - -Forward ref of the div inside Panel components. diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index c111c9bc..259c08b7 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,30 @@ # @xyflow/react +## 12.3.6 + +### Patch Changes + +- [#4846](https://github.com/xyflow/xyflow/pull/4846) [`75017939`](https://github.com/xyflow/xyflow/commit/7501793900fdb125fe906fa3d9d83f1bd11c6e20) Thanks [@moklick](https://github.com/moklick)! - Make it possible to use expandParent with immer and other immutable helpers + +- [#4865](https://github.com/xyflow/xyflow/pull/4865) [`2c4acc2b`](https://github.com/xyflow/xyflow/commit/2c4acc2bd9ec271468bd4c904e19d7fca627d9e1) Thanks [@moklick](https://github.com/moklick)! - Add group node to BuiltInNode type. Thanks [@sjdemartini](https://github.com/sjdemartini)! + +- [#4877](https://github.com/xyflow/xyflow/pull/4877) [`9a8309da`](https://github.com/xyflow/xyflow/commit/9a8309dab892f047fce10d3c763466cf84f726b0) Thanks [@peterkogo](https://github.com/peterkogo)! - Fix intersections for nodes with origins other than [0,0]. Thanks [@gmvrpw](https://github.com/gmvrpw)! + +- [#4844](https://github.com/xyflow/xyflow/pull/4844) [`6f11e552`](https://github.com/xyflow/xyflow/commit/6f11e552c3f51b5931b98d5ff798156cdb8cc2d9) Thanks [@moklick](https://github.com/moklick)! - Allow custom data-testid for ReactFlow component + +- [#4816](https://github.com/xyflow/xyflow/pull/4816) [`43aa52a8`](https://github.com/xyflow/xyflow/commit/43aa52a8cd93e6a01c01afa314c7036eb5b77131) Thanks [@moklick](https://github.com/moklick)! - Type isValidConnection prop correctly by passing EdgeType + +- [#4855](https://github.com/xyflow/xyflow/pull/4855) [`106c2cf8`](https://github.com/xyflow/xyflow/commit/106c2cf8e5e9a944ea7ea9a2558e26cb75f9ac93) Thanks [@mhuggins](https://github.com/mhuggins)! - Support passing `path` element attributes to `BaseEdge` component. + +- [#4862](https://github.com/xyflow/xyflow/pull/4862) [`adf4fb4e`](https://github.com/xyflow/xyflow/commit/adf4fb4e7bb136cce47ef540e9bcc0f82cf17ff4) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Prevent default scrolling behavior when nodes or a selection is moved with an arrow key press. + +- [#4875](https://github.com/xyflow/xyflow/pull/4875) [`41d4743a`](https://github.com/xyflow/xyflow/commit/41d4743a690f054f6dc2b9084b5fad8e54ade921) Thanks [@peterkogo](https://github.com/peterkogo)! - Prevent unnecessary rerenders of edges when resizing the flow. + +- [#4826](https://github.com/xyflow/xyflow/pull/4826) [`5f90acda`](https://github.com/xyflow/xyflow/commit/5f90acdab1f4748bb04f8b1ec67d569983684058) Thanks [@chrtze](https://github.com/chrtze)! - Forward ref of the div inside Panel components. + +- Updated dependencies [[`d60331e6`](https://github.com/xyflow/xyflow/commit/d60331e6baa7931c46af219e35c1bedbd156187c)]: + - @xyflow/system@0.0.47 + ## 12.3.5 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index cef5c444..42d5c134 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@xyflow/react", - "version": "12.3.5", + "version": "12.3.6", "description": "React Flow - A highly customizable React library for building node-based editors and interactive flow charts.", "keywords": [ "react", diff --git a/packages/svelte/CHANGELOG.md b/packages/svelte/CHANGELOG.md index 53a2fab0..f25bc805 100644 --- a/packages/svelte/CHANGELOG.md +++ b/packages/svelte/CHANGELOG.md @@ -1,5 +1,16 @@ # @xyflow/svelte +## 0.1.25 + +### Patch Changes + +- [#4865](https://github.com/xyflow/xyflow/pull/4865) [`2c4acc2b`](https://github.com/xyflow/xyflow/commit/2c4acc2bd9ec271468bd4c904e19d7fca627d9e1) Thanks [@moklick](https://github.com/moklick)! - Add group node to BuiltInNode type. Thanks [@sjdemartini](https://github.com/sjdemartini)! + +- [#4877](https://github.com/xyflow/xyflow/pull/4877) [`9a8309da`](https://github.com/xyflow/xyflow/commit/9a8309dab892f047fce10d3c763466cf84f726b0) Thanks [@peterkogo](https://github.com/peterkogo)! - Fix intersections for nodes with origins other than [0,0]. Thanks [@gmvrpw](https://github.com/gmvrpw)! + +- Updated dependencies [[`d60331e6`](https://github.com/xyflow/xyflow/commit/d60331e6baa7931c46af219e35c1bedbd156187c)]: + - @xyflow/system@0.0.47 + ## 0.1.24 ### Patch Changes diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 9e41fc3d..e1981159 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@xyflow/svelte", - "version": "0.1.24", + "version": "0.1.25", "description": "Svelte Flow - A highly customizable Svelte library for building node-based editors, workflow systems, diagrams and more.", "keywords": [ "svelte", diff --git a/packages/system/CHANGELOG.md b/packages/system/CHANGELOG.md index b9627294..6fbc98f9 100644 --- a/packages/system/CHANGELOG.md +++ b/packages/system/CHANGELOG.md @@ -1,5 +1,11 @@ # @xyflow/system +## 0.0.47 + +### Patch Changes + +- [#4874](https://github.com/xyflow/xyflow/pull/4874) [`d60331e6`](https://github.com/xyflow/xyflow/commit/d60331e6baa7931c46af219e35c1bedbd156187c) Thanks [@crimx](https://github.com/crimx)! - Refactor isInputDOMNode so that it handles non-html objects + ## 0.0.46 ### Patch Changes diff --git a/packages/system/package.json b/packages/system/package.json index f0c4c898..67a433b0 100644 --- a/packages/system/package.json +++ b/packages/system/package.json @@ -1,6 +1,6 @@ { "name": "@xyflow/system", - "version": "0.0.46", + "version": "0.0.47", "description": "xyflow core system that powers React Flow and Svelte Flow.", "keywords": [ "node-based UI",