Minor Changes
-
#3061
2d8aae2Thanks
@github-actions! - Add shared resize/move engine to@zag-js/rect-utils.
Both floating panel and image cropper now delegate all constrained rect manipulation to this engine.New
@zag-js/rect-utilsexports:applyMove,applyResize— pointer-driven move and resize with boundary, size limits, aspect ratio, grid snap, and
center-origin supportclampPointInRange,centerInRect,centerOnPoint— point/rect positioning helpersgetDirectionDelta,getArrowKeyDelta,getKeyboardResizeDelta— keyboard interaction helpersgetCenterPoint,getMidpoint,isVisibleSize,scaleRect,scaleSize,roundRect,ZERO_POINT— general
rect/point utilitiesisLeftHandle,isRightHandle,isTopHandle,isBottomHandle,isCornerHandle,isHorizontalHandle,
isVerticalHandle— handle direction helpersHandlePositiontype
Breaking: Removed from
@zag-js/rect-utils:resizeRect,AffineTransform,compassDirectionMap,oppositeDirectionMap,ScalingOptions
Breaking: Unified handle naming across floating panel and image cropper:
- Floating panel:
ResizeTriggerProps.axis→.placement,data-axis→data-placement,ResizeTriggerAxis
removed (useHandlePosition),resizeTriggerAxes→resizeTriggerPlacements - Image cropper:
HandleProps.position→.placement,data-position→data-placement,handles→placements