28 lines
811 B
TypeScript
28 lines
811 B
TypeScript
"use client"
|
||
import { NodeResizeControl } from "@xyflow/react"
|
||
|
||
/** 节点右边缘 resize 把手:高度跟随节点,宽度可拖(240–1200px)。平时透明,hover 显紫色细条。 */
|
||
export function ResizeRight({ minWidth = 240, maxWidth = 1200 }: { minWidth?: number; maxWidth?: number }) {
|
||
return (
|
||
<NodeResizeControl
|
||
position="right"
|
||
minWidth={minWidth}
|
||
maxWidth={maxWidth}
|
||
style={{
|
||
background: "transparent",
|
||
border: "none",
|
||
width: 8,
|
||
height: "100%",
|
||
right: 0,
|
||
top: 0,
|
||
transform: "translateX(50%)",
|
||
}}
|
||
>
|
||
<div
|
||
className="w-full h-full hover:bg-violet-400/50 active:bg-violet-400/80 transition rounded-r"
|
||
style={{ cursor: "ew-resize" }}
|
||
/>
|
||
</NodeResizeControl>
|
||
)
|
||
}
|