Commit 067fecc
committed
refactor(image-cropper-web): resolve zoom updater in store
Move the SetStateAction resolution out of the container and into
ImageCropperStore.setZoom, which now accepts a value or updater and
resolves the functional form against its own zoom. The container drops
to setZoom={next => store.setZoom(next)}, making the store the single
owner of current zoom. The functional-updater contract stays on the
CropArea/ZoomContainer props (the wheel-zoom hook drives setZoom(prev
=> …) and the editor preview passes a no-op). Behavior unchanged.
Also sync the image-cropper openspec: the "No image available"
scenario now reflects the editable noImageCaption empty-state text.1 parent bba65e7 commit 067fecc
3 files changed
Lines changed: 9 additions & 4 deletions
File tree
- packages/pluggableWidgets/image-cropper-web
- openspec/specs/image-cropper
- src
- components
- stores
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
261 | 262 | | |
262 | 263 | | |
263 | 264 | | |
264 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
265 | 270 | | |
266 | 271 | | |
267 | 272 | | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
271 | | - | |
| 276 | + | |
272 | 277 | | |
273 | 278 | | |
274 | 279 | | |
| |||
0 commit comments