@@ -4,6 +4,7 @@ import { memo, useCallback, useMemo, useRef } from "react";
44import {
55 NodeResizer ,
66 NodeResizerProps ,
7+ NodeResizeControl ,
78 useViewport ,
89 useStore ,
910 useNodeId ,
@@ -249,12 +250,11 @@ const CustomNodeResizer = memo((props: NodeResizerProps) => {
249250 ( event , params ) => {
250251 resizeStateRef . current = null ;
251252 helperLinesCtxRef . current ?. setHelperLines ( [ ] ) ;
252- helperLinesCtxRef . current ?. setActiveResizeSnap ( null ) ;
253253
254254 const node = resizingNodeRef . current ;
255255 const fallbackParams : ResizeParams | undefined =
256- params ??
257256 lastResizeParamsRef . current ??
257+ params ??
258258 ( node
259259 ? {
260260 x : node . position . x ,
@@ -347,6 +347,7 @@ const CustomNodeResizer = memo((props: NodeResizerProps) => {
347347 y : corrected . y ,
348348 width : corrected . width ,
349349 height : corrected . height ,
350+ handle : currentHandle ,
350351 }
351352 : null ,
352353 ) ;
@@ -366,6 +367,42 @@ const CustomNodeResizer = memo((props: NodeResizerProps) => {
366367 return null ;
367368 }
368369
370+ const isCore = resizingNode ?. type === "core" ;
371+
372+ const coreHandleStyle = useMemo (
373+ ( ) =>
374+ ( {
375+ background : "transparent" ,
376+ backgroundColor : "transparent" ,
377+ border : "none" ,
378+ boxShadow : "none" ,
379+ width : `${ hitboxSize } px` ,
380+ height : `${ hitboxSize } px` ,
381+ "--hitbox-size" : `${ hitboxSize } px` ,
382+ pointerEvents : "auto" ,
383+ } ) as React . CSSProperties ,
384+ [ hitboxSize ] ,
385+ ) ;
386+
387+ if ( isCore ) {
388+ return (
389+ < NodeResizeControl
390+ position = "bottom-right"
391+ className = { `${ styles . handle } ${ props . handleClassName || "" } ` }
392+ style = { coreHandleStyle }
393+ minWidth = { props . minWidth }
394+ minHeight = { props . minHeight }
395+ maxWidth = { props . maxWidth }
396+ maxHeight = { props . maxHeight }
397+ keepAspectRatio = { props . keepAspectRatio }
398+ shouldResize = { shouldResize }
399+ onResizeStart = { onResizeStart }
400+ onResize = { onResize }
401+ onResizeEnd = { onResizeEnd }
402+ />
403+ ) ;
404+ }
405+
369406 return (
370407 < NodeResizer
371408 { ...props }
0 commit comments