@@ -18,7 +18,7 @@ import { useKeyboardShortcuts } from '../hooks/useKeyboardShortcuts';
1818import type { SchemaNode } from '@object-ui/core' ;
1919import type { CanvasDesignerConfig } from '../types/designer-modes' ;
2020import { SchemaRenderer } from '@object-ui/react' ;
21- import { ResizeHandles } from './ResizeHandle' ;
21+ import { ResizeHandles , type ResizeDirection } from './ResizeHandle' ;
2222import { ComponentRegistry } from '@object-ui/core' ;
2323import { cn } from '@object-ui/components' ;
2424
@@ -158,7 +158,22 @@ const FreeFormCanvas: React.FC<{ showGrid?: boolean; gridSize?: number }> = ({
158158
159159 return nodes . map ( ( node ) => {
160160 const isSelected = node . id === selectedNodeId ;
161- const isResizable = ComponentRegistry . getConfig ( node . type ) ?. resizable || false ;
161+ const config = ComponentRegistry . getConfig ( node . type ) ;
162+ const isResizable = config ?. resizable || false ;
163+
164+ // Determine which directions to show based on constraints
165+ const constraints = config ?. resizeConstraints || { } ;
166+ const directions : ResizeDirection [ ] = [ ] ;
167+
168+ if ( constraints . width !== false ) {
169+ directions . push ( 'e' , 'w' ) ;
170+ }
171+ if ( constraints . height !== false ) {
172+ directions . push ( 'n' , 's' ) ;
173+ }
174+ if ( constraints . width !== false && constraints . height !== false ) {
175+ directions . push ( 'ne' , 'nw' , 'se' , 'sw' ) ;
176+ }
162177
163178 return (
164179 < div
@@ -186,8 +201,8 @@ const FreeFormCanvas: React.FC<{ showGrid?: boolean; gridSize?: number }> = ({
186201 { /* Resize handles for selected node */ }
187202 { isSelected && isResizable && (
188203 < ResizeHandles
189- nodeId = { node . id || '' }
190- onResizeStart = { ( direction ) => {
204+ directions = { directions }
205+ onResizeStart = { ( direction , e ) => {
191206 const element = document . querySelector ( `[data-obj-id="${ node . id } "]` ) as HTMLElement ;
192207 if ( element ) {
193208 setResizingNode ( {
0 commit comments