yet-another-react-lightbox-lite 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -261,7 +261,7 @@ function useSensors() {
|
|
|
261
261
|
const wheelCooldownMomentum = useRef(null);
|
|
262
262
|
const activePointers = useRef([]);
|
|
263
263
|
const pinchZoomDistance = useRef();
|
|
264
|
-
const { zoom, changeZoom, changeOffsets } = useZoom();
|
|
264
|
+
const { zoom, maxZoom, changeZoom, changeOffsets } = useZoom();
|
|
265
265
|
const { carouselRef } = useZoomInternal();
|
|
266
266
|
const { prev, next, close } = useController();
|
|
267
267
|
const { closeOnPullUp, closeOnPullDown, closeOnBackdropClick } = {
|
|
@@ -423,6 +423,9 @@ function useSensors() {
|
|
|
423
423
|
wheelCooldownMomentum.current = event.deltaX;
|
|
424
424
|
}
|
|
425
425
|
};
|
|
426
|
+
const onDoubleClick = (event) => {
|
|
427
|
+
changeZoom(zoom < maxZoom ? scaleZoom(zoom, 2, 1) : 1, event);
|
|
428
|
+
};
|
|
426
429
|
return {
|
|
427
430
|
onKeyDown,
|
|
428
431
|
onPointerDown,
|
|
@@ -430,6 +433,7 @@ function useSensors() {
|
|
|
430
433
|
onPointerUp,
|
|
431
434
|
onPointerLeave: onPointerUp,
|
|
432
435
|
onPointerCancel: onPointerUp,
|
|
436
|
+
onDoubleClick,
|
|
433
437
|
onWheel,
|
|
434
438
|
};
|
|
435
439
|
}, [
|
|
@@ -437,6 +441,7 @@ function useSensors() {
|
|
|
437
441
|
next,
|
|
438
442
|
close,
|
|
439
443
|
zoom,
|
|
444
|
+
maxZoom,
|
|
440
445
|
changeZoom,
|
|
441
446
|
changeOffsets,
|
|
442
447
|
carouselRef,
|