yet-another-react-lightbox
Advanced tools
Comparing version 3.12.0 to 3.12.1
@@ -197,3 +197,3 @@ import * as React from 'react'; | ||
declare function Carousel({ carousel: { finite, preload, padding, spacing } }: ComponentProps): React.JSX.Element; | ||
declare function Carousel({ carousel }: ComponentProps): React.JSX.Element; | ||
declare const CarouselModule: Module; | ||
@@ -200,0 +200,0 @@ |
@@ -124,3 +124,3 @@ import { useLightboxProps, composePrefix, createIcon, cssClass, isImageSlide, clsx, ImageSlide, makeComposePrefix, cssVar, useLightboxState, useEvents, useRTL, useAnimation, useEventCallback, cleanup, hasSlides, getSlide, makeUseContext, LightboxPropsProvider, createIconDisabled, IconButton, addToolbarButton, createModule } from '../../index.js'; | ||
const { finite } = carousel; | ||
const preload = Math.max(Math.min(carousel.preload, slides.length - 1), 0); | ||
const preload = Math.min(carousel.preload, Math.floor(slides.length / 2)); | ||
const items = []; | ||
@@ -133,3 +133,3 @@ if (hasSlides(slides)) { | ||
} | ||
for (let i = index - preload - (offset > 0 ? offset : 0); i < index; i += 1) { | ||
for (let i = index - preload - Math.max(offset, 0); i < index; i += 1) { | ||
if (!(finite && i < 0)) { | ||
@@ -143,3 +143,3 @@ items.push({ slide: getSlide(slides, i), index: i }); | ||
items.push({ slide: getSlide(slides, index), index }); | ||
for (let i = index + 1; i <= index + preload - (offset < 0 ? offset : 0); i += 1) { | ||
for (let i = index + 1; i <= index + preload - Math.min(offset, 0); i += 1) { | ||
if (!finite || i <= slides.length - 1) { | ||
@@ -146,0 +146,0 @@ items.push({ slide: getSlide(slides, i), index: i }); |
{ | ||
"name": "yet-another-react-lightbox", | ||
"version": "3.12.0", | ||
"version": "3.12.1", | ||
"description": "Modern React lightbox component", | ||
@@ -5,0 +5,0 @@ "author": "Igor Danchenko", |
Sorry, the diff of this file is too big to display
4009
216060