v4.2.1

juliangarnier/animev4.2.1Oct 5, 2025by juliangarnier

AI Summary

Adds offset parameter to `createMotionPath` and drag threshold to `createDraggable`, with adjustments to drag threshold logic based on input type.

Key Highlights

  • New offset parameter for `createMotionPath`
  • New `dragThreshold` for `createDraggable` (3px mouse, 7px touch)
  • Change to `.reset()` softReset type (int to boolean)

New Features

  • Draggable threshold parameters
  • MotionPath offset functionality
  • Enhanced documentation

Full Release Notes

## New features
- **SVG** 
  - `createMotionPath()`: Add an offset parameter (#1037) (@TheHyrox)
- **Draggable** 
  - `createDraggable()`: Add a `dragThreshold` parameter (#1091) (@craig-jennings)

## Changes
- **Timer**, **Animation**, **Timeline** 
  - `.reset(softReset)`: The `softReset` parameter type is now a `Boolean` instead of an int
- **Draggable** 
  - `createDraggable()`: The drag threshold is now 3px with a mouse and 7px with touch instead of 3px everywhere
    
## Fixes
- **onScroll**
  - Fix wrong target offsets calculation when container is scaled (#1098) (@sxnb)
- **Types**
  - Fix await `animate()` throwing Typescript error (#1043)
  
## Docs
- Every demos can now be edited on CodePen
- Added `.reset()` chapters