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
1
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.12.3 to 3.13.0

2

dist/plugins/zoom/index.d.ts

@@ -79,2 +79,4 @@ import * as React from 'react';

zoomOut: Callback;
/** change zoom level */
changeZoom: (targetZoom: number, rapid?: boolean, dx?: number, dy?: number) => void;
}

@@ -81,0 +83,0 @@ }

6

dist/plugins/zoom/index.js

@@ -300,4 +300,4 @@ import { useLightboxProps, useMotionPreference, useEventCallback, useLayoutEffect, useLightboxState, isImageSlide, isImageFitCover, round, useController, usePointerEvents, cleanup, makeUseContext, createIcon, IconButton, devicePixelRatio, ImageSlide, clsx, cssClass, addToolbarButton, createModule } from '../../index.js';

}, [zoom, offsetX, offsetY, slideRect, imageRect.width, imageRect.height]);
const changeZoom = React.useCallback((value, rapid, dx, dy) => {
const newZoom = round(Math.min(Math.max(value + 0.001 < maxZoom ? value : maxZoom, 1), maxZoom), 5);
const changeZoom = React.useCallback((targetZoom, rapid, dx, dy) => {
const newZoom = round(Math.min(Math.max(targetZoom + 0.001 < maxZoom ? targetZoom : maxZoom, 1), maxZoom), 5);
if (newZoom === zoom)

@@ -338,3 +338,3 @@ return;

useZoomSensors(zoom, maxZoom, disabled, changeZoom, changeOffsets, zoomWrapper === null || zoomWrapper === void 0 ? void 0 : zoomWrapper.zoomWrapperRef);
const zoomRef = React.useMemo(() => ({ zoom, maxZoom, offsetX, offsetY, disabled, zoomIn, zoomOut }), [zoom, maxZoom, offsetX, offsetY, disabled, zoomIn, zoomOut]);
const zoomRef = React.useMemo(() => ({ zoom, maxZoom, offsetX, offsetY, disabled, zoomIn, zoomOut, changeZoom }), [zoom, maxZoom, offsetX, offsetY, disabled, zoomIn, zoomOut, changeZoom]);
React.useImperativeHandle(useZoomProps().ref, () => zoomRef, [zoomRef]);

@@ -341,0 +341,0 @@ const context = React.useMemo(() => ({ ...zoomRef, setZoomWrapper }), [zoomRef, setZoomWrapper]);

{
"name": "yet-another-react-lightbox",
"version": "3.12.3",
"version": "3.13.0",
"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