117117 </div >
118118 </template >
119119
120- <!-- Resize handles -->
121- <template v-if =" ! isCollapsed " >
122- <div
123- v-for =" handle in cornerResizeHandles"
124- :key =" handle.id"
125- role =" button"
126- :aria-label =" handle.ariaLabel"
127- :class =" cn(baseResizeHandleClasses, handle.classes)"
128- @pointerdown.stop =" handleResizePointerDown(handle.direction)($event)"
129- />
130- </template >
120+ <!-- Resize handle (bottom-right only) -->
121+ <div
122+ v-if =" !isCollapsed"
123+ role =" button"
124+ :aria-label =" t('g.resizeFromBottomRight')"
125+ :class =" cn(baseResizeHandleClasses, 'right-0 bottom-0 cursor-se-resize')"
126+ @pointerdown.stop =" handleResizePointerDown"
127+ />
131128 </div >
132129</template >
133130
@@ -150,7 +147,6 @@ import { useTelemetry } from '@/platform/telemetry'
150147import { useCanvasStore } from ' @/renderer/core/canvas/canvasStore'
151148import { useCanvasInteractions } from ' @/renderer/core/canvas/useCanvasInteractions'
152149import { layoutStore } from ' @/renderer/core/layout/store/layoutStore'
153- import { useTransformState } from ' @/renderer/core/layout/transform/useTransformState'
154150import SlotConnectionDot from ' @/renderer/extensions/vueNodes/components/SlotConnectionDot.vue'
155151import { useNodeEventHandlers } from ' @/renderer/extensions/vueNodes/composables/useNodeEventHandlers'
156152import { useNodePointerInteractions } from ' @/renderer/extensions/vueNodes/composables/useNodePointerInteractions'
@@ -172,7 +168,6 @@ import {
172168} from ' @/utils/graphTraversalUtil'
173169import { cn } from ' @/utils/tailwindUtil'
174170
175- import type { ResizeHandleDirection } from ' ../interactions/resize/resizeMath'
176171import { useNodeResize } from ' ../interactions/resize/useNodeResize'
177172import LivePreview from ' ./LivePreview.vue'
178173import NodeContent from ' ./NodeContent.vue'
@@ -197,13 +192,6 @@ const { bringNodeToFront } = useNodeZIndex()
197192
198193useVueElementTracking (() => nodeData .id , ' node' )
199194
200- const transformState = useTransformState ()
201- if (! transformState ) {
202- throw new Error (
203- ' TransformState must be provided for node resize functionality'
204- )
205- }
206-
207195const { selectedNodeIds } = storeToRefs (useCanvasStore ())
208196const isSelected = computed (() => {
209197 return selectedNodeIds .value .has (nodeData .id )
@@ -271,7 +259,7 @@ onErrorCaptured((error) => {
271259 return false // Prevent error propagation
272260})
273261
274- const { position, size, zIndex, moveNodeTo } = useNodeLayout (() => nodeData .id )
262+ const { position, size, zIndex } = useNodeLayout (() => nodeData .id )
275263const { pointerHandlers } = useNodePointerInteractions (() => nodeData .id )
276264const { onPointerdown, ... remainingPointerHandlers } = pointerHandlers
277265const { startDrag } = useNodeDrag ()
@@ -322,74 +310,23 @@ onMounted(() => {
322310
323311const baseResizeHandleClasses =
324312 ' absolute h-3 w-3 opacity-0 pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-white/40'
325- const POSITION_EPSILON = 0.01
326-
327- type CornerResizeHandle = {
328- id: string
329- direction: ResizeHandleDirection
330- classes: string
331- ariaLabel: string
332- }
333-
334- const cornerResizeHandles: CornerResizeHandle [] = [
335- {
336- id: ' se' ,
337- direction: { horizontal: ' right' , vertical: ' bottom' },
338- classes: ' right-0 bottom-0 cursor-se-resize' ,
339- ariaLabel: t (' g.resizeFromBottomRight' )
340- },
341- {
342- id: ' ne' ,
343- direction: { horizontal: ' right' , vertical: ' top' },
344- classes: ' right-0 top-0 cursor-ne-resize' ,
345- ariaLabel: t (' g.resizeFromTopRight' )
346- },
347- {
348- id: ' sw' ,
349- direction: { horizontal: ' left' , vertical: ' bottom' },
350- classes: ' left-0 bottom-0 cursor-sw-resize' ,
351- ariaLabel: t (' g.resizeFromBottomLeft' )
352- },
353- {
354- id: ' nw' ,
355- direction: { horizontal: ' left' , vertical: ' top' },
356- classes: ' left-0 top-0 cursor-nw-resize' ,
357- ariaLabel: t (' g.resizeFromTopLeft' )
358- }
359- ]
360313
361314const MIN_NODE_WIDTH = 225
362315
363- const { startResize } = useNodeResize (
364- (result , element ) => {
365- if (isCollapsed .value ) return
316+ const { startResize } = useNodeResize ((result , element ) => {
317+ if (isCollapsed .value ) return
366318
367- // Clamp width to minimum to avoid conflicts with CSS min-width
368- const clampedWidth = Math .max (result .size .width , MIN_NODE_WIDTH )
319+ // Clamp width to minimum to avoid conflicts with CSS min-width
320+ const clampedWidth = Math .max (result .size .width , MIN_NODE_WIDTH )
369321
370- // Apply size directly to DOM element - ResizeObserver will pick this up
371- element .style .setProperty (' --node-width' , ` ${clampedWidth }px ` )
372- element .style .setProperty (' --node-height' , ` ${result .size .height }px ` )
373-
374- const currentPosition = position .value
375- const deltaX = Math .abs (result .position .x - currentPosition .x )
376- const deltaY = Math .abs (result .position .y - currentPosition .y )
377-
378- if (deltaX > POSITION_EPSILON || deltaY > POSITION_EPSILON ) {
379- moveNodeTo (result .position )
380- }
381- },
382- {
383- transformState
384- }
385- )
386-
387- const handleResizePointerDown = (direction : ResizeHandleDirection ) => {
388- return (event : PointerEvent ) => {
389- if (nodeData .flags ?.pinned ) return
322+ // Apply size directly to DOM element - ResizeObserver will pick this up
323+ element .style .setProperty (' --node-width' , ` ${clampedWidth }px ` )
324+ element .style .setProperty (' --node-height' , ` ${result .size .height }px ` )
325+ })
390326
391- startResize (event , direction , { ... position .value })
392- }
327+ const handleResizePointerDown = (event : PointerEvent ) => {
328+ if (nodeData .flags ?.pinned ) return
329+ startResize (event )
393330}
394331
395332watch (isCollapsed , (collapsed ) => {
0 commit comments