Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yet-another-react-lightbox

Package Overview
Dependencies
Maintainers
0
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yet-another-react-lightbox - npm Package Compare versions

Comparing version 3.21.3 to 3.21.4

10

dist/plugins/zoom/index.js

@@ -118,2 +118,5 @@ import * as React from 'react';

}
function scaleZoom(value, delta, factor = 100, clamp = 2) {
return value * Math.min(1 + Math.abs(delta / factor), clamp) ** Math.sign(delta);
}
function useZoomSensors(zoom, maxZoom, disabled, changeZoom, changeOffsets, zoomWrapperRef) {

@@ -178,3 +181,3 @@ const activePointers = React.useRef([]);

event.stopPropagation();
changeZoom(zoom * (1 - event.deltaY / wheelZoomDistanceFactor), true, ...translateCoordinates(event));
changeZoom(scaleZoom(zoom, -event.deltaY, wheelZoomDistanceFactor), true, ...translateCoordinates(event));
return;

@@ -202,3 +205,4 @@ }

const pointers = activePointers.current;
if (!((_a = zoomWrapperRef === null || zoomWrapperRef === void 0 ? void 0 : zoomWrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
if ((event.pointerType === "mouse" && event.buttons > 1) ||
!((_a = zoomWrapperRef === null || zoomWrapperRef === void 0 ? void 0 : zoomWrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
return;

@@ -232,3 +236,3 @@ }

if (Math.abs(delta) > 0) {
changeZoom(zoom * (1 + delta / pinchZoomDistanceFactor), true, ...pointers
changeZoom(scaleZoom(zoom, delta, pinchZoomDistanceFactor), true, ...pointers
.map((x) => translateCoordinates(x))

@@ -235,0 +239,0 @@ .reduce((acc, coordinate) => coordinate.map((x, i) => acc[i] + x / 2)));

{
"name": "yet-another-react-lightbox",
"version": "3.21.3",
"version": "3.21.4",
"description": "Modern React lightbox component",

@@ -5,0 +5,0 @@ "author": "Igor Danchenko",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc