From 8ff900c0cffa2f84bef0fb9b1e950b9ee34ace90 Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 17 Mar 2025 14:50:32 +0100 Subject: [PATCH 1/2] feat(panel): add center-left and center-right positions #5082 --- packages/system/src/styles/init.css | 17 ++++++++++++++--- packages/system/src/types/general.ts | 10 +++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/packages/system/src/styles/init.css b/packages/system/src/styles/init.css index e167c53f..b0651116 100644 --- a/packages/system/src/styles/init.css +++ b/packages/system/src/styles/init.css @@ -278,6 +278,14 @@ svg.xy-flow__connectionline { bottom: 0; } + &.top, + &.bottom { + &.center { + left: 50%; + transform: translateX(-50%); + } + } + &.left { left: 0; } @@ -286,9 +294,12 @@ svg.xy-flow__connectionline { right: 0; } - &.center { - left: 50%; - transform: translateX(-50%); + &.left, + &.right { + &.center { + top: 50%; + transform: translateY(-50%); + } } } diff --git a/packages/system/src/types/general.ts b/packages/system/src/types/general.ts index 8ac3f9e9..fc92bc7e 100644 --- a/packages/system/src/types/general.ts +++ b/packages/system/src/types/general.ts @@ -169,7 +169,15 @@ export type UpdateNodeInternals = (nodeId: string | string[]) => void; * * @public */ -export type PanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; +export type PanelPosition = + | 'top-left' + | 'top-center' + | 'top-right' + | 'bottom-left' + | 'bottom-center' + | 'bottom-right' + | 'center-left' + | 'center-right'; export type ProOptions = { account?: string; From a79f30b3dd7c8ff6400c8d22214b2c2282e5bac1 Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 17 Mar 2025 14:52:09 +0100 Subject: [PATCH 2/2] chore(changeset): add --- .changeset/witty-toys-wash.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/witty-toys-wash.md diff --git a/.changeset/witty-toys-wash.md b/.changeset/witty-toys-wash.md new file mode 100644 index 00000000..4f2972f6 --- /dev/null +++ b/.changeset/witty-toys-wash.md @@ -0,0 +1,5 @@ +--- +'@xyflow/system': patch +--- + +Add center-left and center-right as a panel position