diff --git a/CHANGELOG.md b/CHANGELOG.md index 24dae17..020eeaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 15.2.0 (2026-09-30) + +### Features + +- **Keyboard accessibility** ([#376](https://github.com/mosch/react-avatar-editor/issues/376), [#438](https://github.com/mosch/react-avatar-editor/issues/438)) — the canvas is now focusable (`tabIndex=0`, `role="application"`, ARIA labels). Arrow keys pan the image (`keyboardStep` px, ×10 with Shift), `+`/`-` zoom (0.1 step, 0.5 with Shift), Escape blurs the canvas. The canvas focuses on mousedown so keys work right after clicking. +- **Pinch-to-zoom** — two-finger pinch on touch devices zooms the image. +- **Wheel zoom** — opt-in mouse wheel / trackpad zoom via the new `enableWheelZoom` prop (default `false`). +- **`onRequestScaleChange` callback** — called with the requested scale for keyboard, pinch and wheel zoom. `scale` stays controlled, so update it in your state to apply the zoom. +- **`keyboardStep` prop** — pixels moved per arrow key press (default `1`). + +### Chores + +- Dependency bumps for security advisories. + ## 15.1.0 (2026-03-21) ### Features diff --git a/README.md b/README.md index a244a5c..afc21e8 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,8 @@ function MyEditor() { | `onMouseUp` | `() => void` | | Called when the user releases the mouse after dragging. | | `onMouseMove` | `(event) => void` | | Called on every mouse/touch move while dragging. | | `onPositionChange` | `(position) => void` | | Called when the crop position changes. Receives `{ x, y }`. | -| `onRequestScaleChange` | `(scale) => void` | | Called when the user presses +/- keys to zoom. Receives the requested new scale value. | +| `onRequestScaleChange` | `(scale) => void` | | Called when the user zooms via +/- keys, pinch, or wheel. Receives the requested new scale. | +| `enableWheelZoom` | `boolean` | `false` | Zoom with the mouse wheel / trackpad. Requires `onRequestScaleChange`. | | `keyboardStep` | `number` | `1` | Pixels to move per arrow key press. Shift multiplies by 10. | ## Contributing diff --git a/packages/lib/package.json b/packages/lib/package.json index 0032234..66550b7 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -1,6 +1,6 @@ { "name": "react-avatar-editor", - "version": "15.1.0", + "version": "15.2.0", "description": "Avatar / profile picture component. Resize and crop your uploaded image using a intuitive user interface.", "main": "./dist/index.cjs", "module": "./dist/index.mjs",