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 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;