yet-another-react-lightbox 3.13.1 → 3.15.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/README.md +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +63 -66
- package/dist/plugins/thumbnails/index.js +3 -5
- package/dist/plugins/video/index.js +1 -3
- package/dist/plugins/zoom/index.js +3 -11
- package/dist/types.d.ts +10 -3
- package/package.json +167 -167
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@ extendable.
|
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
|
-
[](https://www.npmjs.com/package/yet-another-react-lightbox)
|
|
9
|
-
[](https://bundlephobia.com/package/yet-another-react-lightbox)
|
|
10
|
-
[](https://github.com/igordanchenko/yet-another-react-lightbox/blob/main/LICENSE)
|
|
8
|
+
[](https://www.npmjs.com/package/yet-another-react-lightbox)
|
|
9
|
+
[](https://bundlephobia.com/package/yet-another-react-lightbox)
|
|
10
|
+
[](https://github.com/igordanchenko/yet-another-react-lightbox/blob/main/LICENSE)
|
|
11
11
|
|
|
12
12
|
- **Built for React:** works with React 18, 17 and 16.8.0+
|
|
13
13
|
- **UX:** supports keyboard, mouse, touchpad and touchscreen navigation
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LightboxExternalProps, LightboxProps, Labels, Slide, SlideImage, LengthOrPercentage, ContainerRect, ToolbarSettings, CarouselSettings, Component, Module, Node, Plugin, Augmentation, EventTypes, ComponentProps, LightboxStateSwipeAction, LightboxStateUpdateAction, LightboxState, Render, ControllerRef, Callback, RenderFunction } from './types.js';
|
|
3
|
-
export { ACTION_CLOSE, ACTION_NEXT, ACTION_PREV, ACTION_SWIPE, ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, AnimationSettings, CLASS_FLEX_CENTER, CLASS_FULLSIZE, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, Callbacks, ClickCallbackProps, ControllerSettings, DeepPartial, DeepPartialValue, ELEMENT_BUTTON, ELEMENT_ICON, EVENT_ON_KEY_DOWN, EVENT_ON_KEY_UP, EVENT_ON_POINTER_CANCEL, EVENT_ON_POINTER_DOWN, EVENT_ON_POINTER_LEAVE, EVENT_ON_POINTER_MOVE, EVENT_ON_POINTER_UP, EVENT_ON_WHEEL, GenericSlide, IMAGE_FIT_CONTAIN, IMAGE_FIT_COVER, ImageFit, ImageSource, MODULE_CAROUSEL, MODULE_CONTROLLER, MODULE_NAVIGATION, MODULE_NO_SCROLL, MODULE_PORTAL, MODULE_ROOT, MODULE_TOOLBAR, NavigationAction, PLUGIN_CAPTIONS, PLUGIN_COUNTER, PLUGIN_DOWNLOAD, PLUGIN_FULLSCREEN, PLUGIN_INLINE, PLUGIN_SHARE, PLUGIN_SLIDESHOW, PLUGIN_THUMBNAILS, PLUGIN_ZOOM, PluginProps, PortalSettings, RenderSlideContainerProps, RenderSlideFooterProps, RenderSlideHeaderProps, RenderSlideProps, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_LOADING, SLIDE_STATUS_PLACEHOLDER, SLIDE_STATUS_PLAYING, SlideStatus, SlideTypeKey, SlideTypes, Slot, SlotStyles, SlotType, ToolbarButtonKey, ToolbarButtonKeys, UNKNOWN_ACTION_TYPE, VK_ARROW_LEFT, VK_ARROW_RIGHT, VK_ESCAPE, ViewCallbackProps, activeSlideStatus } from './types.js';
|
|
3
|
+
export { ACTION_CLOSE, ACTION_NEXT, ACTION_PREV, ACTION_SWIPE, ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, AnimationSettings, CLASS_FLEX_CENTER, CLASS_FULLSIZE, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, Callbacks, ClickCallbackProps, ControllerSettings, DeepPartial, DeepPartialValue, ELEMENT_BUTTON, ELEMENT_ICON, EVENT_ON_KEY_DOWN, EVENT_ON_KEY_UP, EVENT_ON_POINTER_CANCEL, EVENT_ON_POINTER_DOWN, EVENT_ON_POINTER_LEAVE, EVENT_ON_POINTER_MOVE, EVENT_ON_POINTER_UP, EVENT_ON_WHEEL, GenericSlide, IMAGE_FIT_CONTAIN, IMAGE_FIT_COVER, ImageFit, ImageSource, MODULE_CAROUSEL, MODULE_CONTROLLER, MODULE_NAVIGATION, MODULE_NO_SCROLL, MODULE_PORTAL, MODULE_ROOT, MODULE_TOOLBAR, NavigationAction, NoScrollSettings, PLUGIN_CAPTIONS, PLUGIN_COUNTER, PLUGIN_DOWNLOAD, PLUGIN_FULLSCREEN, PLUGIN_INLINE, PLUGIN_SHARE, PLUGIN_SLIDESHOW, PLUGIN_THUMBNAILS, PLUGIN_ZOOM, PluginProps, PortalSettings, RenderSlideContainerProps, RenderSlideFooterProps, RenderSlideHeaderProps, RenderSlideProps, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_LOADING, SLIDE_STATUS_PLACEHOLDER, SLIDE_STATUS_PLAYING, SlideStatus, SlideTypeKey, SlideTypes, Slot, SlotStyles, SlotType, ToolbarButtonKey, ToolbarButtonKeys, UNKNOWN_ACTION_TYPE, VK_ARROW_LEFT, VK_ARROW_RIGHT, VK_ESCAPE, ViewCallbackProps, activeSlideStatus } from './types.js';
|
|
4
4
|
|
|
5
5
|
/** Lightbox component */
|
|
6
|
-
declare function Lightbox({ carousel, animation, render, toolbar, controller, on, plugins, slides, index, ...restProps }: LightboxExternalProps): React.JSX.Element | null;
|
|
6
|
+
declare function Lightbox({ carousel, animation, render, toolbar, controller, noScroll, on, plugins, slides, index, ...restProps }: LightboxExternalProps): React.JSX.Element | null;
|
|
7
7
|
|
|
8
8
|
declare const LightboxDefaultProps: LightboxProps;
|
|
9
9
|
|
|
@@ -248,7 +248,7 @@ declare function useNavigationState(): {
|
|
|
248
248
|
nextDisabled: boolean;
|
|
249
249
|
};
|
|
250
250
|
|
|
251
|
-
declare function NoScroll({ children }: ComponentProps): React.JSX.Element;
|
|
251
|
+
declare function NoScroll({ noScroll: { disabled }, children }: ComponentProps): React.JSX.Element;
|
|
252
252
|
declare const NoScrollModule: Module;
|
|
253
253
|
|
|
254
254
|
declare function Portal({ children, animation, styles, className, on, portal, close }: ComponentProps): React.ReactPortal | null;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { ACTION_CLOSE, IMAGE_FIT_CONTAIN, MODULE_CONTROLLER, IMAGE_FIT_COVER, UNKNOWN_ACTION_TYPE, ELEMENT_BUTTON, ELEMENT_ICON, EVENT_ON_POINTER_DOWN, EVENT_ON_POINTER_MOVE, EVENT_ON_POINTER_UP, EVENT_ON_POINTER_LEAVE, EVENT_ON_POINTER_CANCEL, EVENT_ON_KEY_DOWN, EVENT_ON_KEY_UP, EVENT_ON_WHEEL, SLIDE_STATUS_LOADING, activeSlideStatus, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_PLACEHOLDER, ACTION_PREV, ACTION_NEXT, ACTION_SWIPE, CLASS_FLEX_CENTER, MODULE_CAROUSEL, CLASS_FULLSIZE, VK_ARROW_RIGHT, VK_ARROW_LEFT, VK_ESCAPE, MODULE_NAVIGATION, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, MODULE_NO_SCROLL,
|
|
3
|
+
import { ACTION_CLOSE, IMAGE_FIT_CONTAIN, MODULE_CONTROLLER, IMAGE_FIT_COVER, UNKNOWN_ACTION_TYPE, ELEMENT_BUTTON, ELEMENT_ICON, EVENT_ON_POINTER_DOWN, EVENT_ON_POINTER_MOVE, EVENT_ON_POINTER_UP, EVENT_ON_POINTER_LEAVE, EVENT_ON_POINTER_CANCEL, EVENT_ON_KEY_DOWN, EVENT_ON_KEY_UP, EVENT_ON_WHEEL, SLIDE_STATUS_LOADING, activeSlideStatus, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_PLACEHOLDER, ACTION_PREV, ACTION_NEXT, ACTION_SWIPE, MODULE_PORTAL, CLASS_FLEX_CENTER, MODULE_CAROUSEL, CLASS_FULLSIZE, VK_ARROW_RIGHT, VK_ARROW_LEFT, VK_ESCAPE, MODULE_NAVIGATION, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, MODULE_NO_SCROLL, MODULE_ROOT, MODULE_TOOLBAR } from './types.js';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
export { ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, PLUGIN_CAPTIONS, PLUGIN_COUNTER, PLUGIN_DOWNLOAD, PLUGIN_FULLSCREEN, PLUGIN_INLINE, PLUGIN_SHARE, PLUGIN_SLIDESHOW, PLUGIN_THUMBNAILS, PLUGIN_ZOOM, SLIDE_STATUS_PLAYING } from './types.js';
|
|
6
6
|
|
|
@@ -39,6 +39,9 @@ const LightboxDefaultProps = {
|
|
|
39
39
|
closeOnBackdropClick: false,
|
|
40
40
|
},
|
|
41
41
|
portal: {},
|
|
42
|
+
noScroll: {
|
|
43
|
+
disabled: false,
|
|
44
|
+
},
|
|
42
45
|
on: {},
|
|
43
46
|
styles: {},
|
|
44
47
|
className: "",
|
|
@@ -424,9 +427,9 @@ function useAnimation(nodeRef, computeAnimation) {
|
|
|
424
427
|
}
|
|
425
428
|
|
|
426
429
|
function useContainerRect() {
|
|
427
|
-
const [containerRect, setContainerRect] = React.useState();
|
|
428
430
|
const containerRef = React.useRef(null);
|
|
429
431
|
const observerRef = React.useRef();
|
|
432
|
+
const [containerRect, setContainerRect] = React.useState();
|
|
430
433
|
const setContainerRef = React.useCallback((node) => {
|
|
431
434
|
containerRef.current = node;
|
|
432
435
|
if (observerRef.current) {
|
|
@@ -452,11 +455,7 @@ function useContainerRect() {
|
|
|
452
455
|
observerRef.current.observe(node);
|
|
453
456
|
}
|
|
454
457
|
}, []);
|
|
455
|
-
return
|
|
456
|
-
setContainerRef,
|
|
457
|
-
containerRef,
|
|
458
|
-
containerRect,
|
|
459
|
-
}), [setContainerRef, containerRef, containerRect]);
|
|
458
|
+
return { setContainerRef, containerRef, containerRect };
|
|
460
459
|
}
|
|
461
460
|
|
|
462
461
|
function useDelay() {
|
|
@@ -520,39 +519,36 @@ function useRTL() {
|
|
|
520
519
|
|
|
521
520
|
function useSensors() {
|
|
522
521
|
const [subscribers] = React.useState({});
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
(
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
listeners.splice(0, listeners.length, ...listeners.filter((el) => el !== callback));
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
},
|
|
522
|
+
const notifySubscribers = React.useCallback((type, event) => {
|
|
523
|
+
var _a;
|
|
524
|
+
(_a = subscribers[type]) === null || _a === void 0 ? void 0 : _a.forEach((listener) => {
|
|
525
|
+
if (!event.isPropagationStopped())
|
|
526
|
+
listener(event);
|
|
527
|
+
});
|
|
528
|
+
}, [subscribers]);
|
|
529
|
+
const registerSensors = React.useMemo(() => ({
|
|
530
|
+
onPointerDown: (event) => notifySubscribers(EVENT_ON_POINTER_DOWN, event),
|
|
531
|
+
onPointerMove: (event) => notifySubscribers(EVENT_ON_POINTER_MOVE, event),
|
|
532
|
+
onPointerUp: (event) => notifySubscribers(EVENT_ON_POINTER_UP, event),
|
|
533
|
+
onPointerLeave: (event) => notifySubscribers(EVENT_ON_POINTER_LEAVE, event),
|
|
534
|
+
onPointerCancel: (event) => notifySubscribers(EVENT_ON_POINTER_CANCEL, event),
|
|
535
|
+
onKeyDown: (event) => notifySubscribers(EVENT_ON_KEY_DOWN, event),
|
|
536
|
+
onKeyUp: (event) => notifySubscribers(EVENT_ON_KEY_UP, event),
|
|
537
|
+
onWheel: (event) => notifySubscribers(EVENT_ON_WHEEL, event),
|
|
538
|
+
}), [notifySubscribers]);
|
|
539
|
+
const subscribeSensors = React.useCallback((type, callback) => {
|
|
540
|
+
if (!subscribers[type]) {
|
|
541
|
+
subscribers[type] = [];
|
|
542
|
+
}
|
|
543
|
+
subscribers[type].unshift(callback);
|
|
544
|
+
return () => {
|
|
545
|
+
const listeners = subscribers[type];
|
|
546
|
+
if (listeners) {
|
|
547
|
+
listeners.splice(0, listeners.length, ...listeners.filter((el) => el !== callback));
|
|
548
|
+
}
|
|
554
549
|
};
|
|
555
550
|
}, [subscribers]);
|
|
551
|
+
return { registerSensors, subscribeSensors };
|
|
556
552
|
}
|
|
557
553
|
|
|
558
554
|
function useThrottle(callback, delay) {
|
|
@@ -642,11 +638,9 @@ var SwipeState;
|
|
|
642
638
|
})(SwipeState || (SwipeState = {}));
|
|
643
639
|
|
|
644
640
|
function usePointerEvents(subscribeSensors, onPointerDown, onPointerMove, onPointerUp, disabled) {
|
|
645
|
-
React.useEffect(() =>
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
return cleanup(subscribeSensors(EVENT_ON_POINTER_DOWN, onPointerDown), subscribeSensors(EVENT_ON_POINTER_MOVE, onPointerMove), subscribeSensors(EVENT_ON_POINTER_UP, onPointerUp), subscribeSensors(EVENT_ON_POINTER_LEAVE, onPointerUp), subscribeSensors(EVENT_ON_POINTER_CANCEL, onPointerUp));
|
|
649
|
-
}, [subscribeSensors, onPointerDown, onPointerMove, onPointerUp, disabled]);
|
|
641
|
+
React.useEffect(() => !disabled
|
|
642
|
+
? cleanup(subscribeSensors(EVENT_ON_POINTER_DOWN, onPointerDown), subscribeSensors(EVENT_ON_POINTER_MOVE, onPointerMove), subscribeSensors(EVENT_ON_POINTER_UP, onPointerUp), subscribeSensors(EVENT_ON_POINTER_LEAVE, onPointerUp), subscribeSensors(EVENT_ON_POINTER_CANCEL, onPointerUp))
|
|
643
|
+
: () => { }, [subscribeSensors, onPointerDown, onPointerMove, onPointerUp, disabled]);
|
|
650
644
|
}
|
|
651
645
|
|
|
652
646
|
var Gesture;
|
|
@@ -679,8 +673,7 @@ function usePointerSwipe(subscribeSensors, isSwipeValid, containerWidth, swipeAn
|
|
|
679
673
|
addPointer(event);
|
|
680
674
|
});
|
|
681
675
|
const onPointerUp = useEventCallback((event) => {
|
|
682
|
-
if (pointers.current.find((x) => x.pointerId === event.pointerId) &&
|
|
683
|
-
activePointer.current === event.pointerId) {
|
|
676
|
+
if (pointers.current.find((x) => x.pointerId === event.pointerId) && activePointer.current === event.pointerId) {
|
|
684
677
|
const duration = Date.now() - startTime.current;
|
|
685
678
|
const currentOffset = offset.current;
|
|
686
679
|
if (gesture.current === Gesture.SWIPE) {
|
|
@@ -951,9 +944,7 @@ function Controller({ children, ...props }) {
|
|
|
951
944
|
var _a;
|
|
952
945
|
if (carouselRef.current && containerRect && ((_a = state.animation) === null || _a === void 0 ? void 0 : _a.duration)) {
|
|
953
946
|
const parsedSpacing = parseLengthPercentage(carousel.spacing);
|
|
954
|
-
const spacingValue = (parsedSpacing.percent
|
|
955
|
-
? (parsedSpacing.percent * containerRect.width) / 100
|
|
956
|
-
: parsedSpacing.pixel) || 0;
|
|
947
|
+
const spacingValue = (parsedSpacing.percent ? (parsedSpacing.percent * containerRect.width) / 100 : parsedSpacing.pixel) || 0;
|
|
957
948
|
return {
|
|
958
949
|
keyframes: [
|
|
959
950
|
{
|
|
@@ -1067,9 +1058,10 @@ function Controller({ children, ...props }) {
|
|
|
1067
1058
|
usePointerSwipe(...swipeParams, closeOnPullDown, ...pullDownParams);
|
|
1068
1059
|
useWheelSwipe(swipeState, ...swipeParams);
|
|
1069
1060
|
const focusOnMount = useEventCallback(() => {
|
|
1070
|
-
var _a;
|
|
1071
1061
|
if (controller.focus) {
|
|
1072
|
-
(
|
|
1062
|
+
if (document.querySelector(`.${cssClass(MODULE_PORTAL)} .${cssClass(cssContainerPrefix())}`)) {
|
|
1063
|
+
focus();
|
|
1064
|
+
}
|
|
1073
1065
|
}
|
|
1074
1066
|
});
|
|
1075
1067
|
React.useEffect(focusOnMount, [focusOnMount]);
|
|
@@ -1122,9 +1114,7 @@ function Controller({ children, ...props }) {
|
|
|
1122
1114
|
[cssVar("pull_down_opacity")]: `${pullDownOpacity.current}`,
|
|
1123
1115
|
}
|
|
1124
1116
|
: null),
|
|
1125
|
-
...(controller.touchAction !== "none"
|
|
1126
|
-
? { [cssVar("controller_touch_action")]: controller.touchAction }
|
|
1127
|
-
: null),
|
|
1117
|
+
...(controller.touchAction !== "none" ? { [cssVar("controller_touch_action")]: controller.touchAction } : null),
|
|
1128
1118
|
...styles.container,
|
|
1129
1119
|
}, ...(controller.aria ? { role: "presentation", "aria-live": "polite" } : null), tabIndex: -1, ...registerSensors }, containerRect && (React.createElement(ControllerContext.Provider, { value: context },
|
|
1130
1120
|
children, (_a = render.controls) === null || _a === void 0 ? void 0 :
|
|
@@ -1269,9 +1259,11 @@ function padScrollbar(element, padding, rtl) {
|
|
|
1269
1259
|
}
|
|
1270
1260
|
};
|
|
1271
1261
|
}
|
|
1272
|
-
function NoScroll({ children }) {
|
|
1262
|
+
function NoScroll({ noScroll: { disabled }, children }) {
|
|
1273
1263
|
const rtl = useRTL();
|
|
1274
1264
|
useLayoutEffect(() => {
|
|
1265
|
+
if (disabled)
|
|
1266
|
+
return () => { };
|
|
1275
1267
|
const cleanup = [];
|
|
1276
1268
|
const { body, documentElement } = document;
|
|
1277
1269
|
const scrollbar = Math.round(window.innerWidth - documentElement.clientWidth);
|
|
@@ -1292,7 +1284,7 @@ function NoScroll({ children }) {
|
|
|
1292
1284
|
body.classList.remove(noScroll);
|
|
1293
1285
|
cleanup.forEach((clean) => clean());
|
|
1294
1286
|
};
|
|
1295
|
-
}, [rtl]);
|
|
1287
|
+
}, [rtl, disabled]);
|
|
1296
1288
|
return React.createElement(React.Fragment, null, children);
|
|
1297
1289
|
}
|
|
1298
1290
|
const NoScrollModule = createModule(MODULE_NO_SCROLL, NoScroll);
|
|
@@ -1316,6 +1308,7 @@ function Portal({ children, animation, styles, className, on, portal, close }) {
|
|
|
1316
1308
|
const [mounted, setMounted] = React.useState(false);
|
|
1317
1309
|
const [visible, setVisible] = React.useState(false);
|
|
1318
1310
|
const cleanup = React.useRef([]);
|
|
1311
|
+
const restoreFocus = React.useRef(null);
|
|
1319
1312
|
const { setTimeout } = useTimeouts();
|
|
1320
1313
|
const { subscribe } = useEvents();
|
|
1321
1314
|
const reduceMotion = useMotionPreference();
|
|
@@ -1330,6 +1323,8 @@ function Portal({ children, animation, styles, className, on, portal, close }) {
|
|
|
1330
1323
|
const handleClose = useEventCallback(() => {
|
|
1331
1324
|
var _a;
|
|
1332
1325
|
setVisible(false);
|
|
1326
|
+
cleanup.current.forEach((clean) => clean());
|
|
1327
|
+
cleanup.current = [];
|
|
1333
1328
|
(_a = on.exiting) === null || _a === void 0 ? void 0 : _a.call(on);
|
|
1334
1329
|
setTimeout(() => {
|
|
1335
1330
|
var _a;
|
|
@@ -1351,23 +1346,20 @@ function Portal({ children, animation, styles, className, on, portal, close }) {
|
|
|
1351
1346
|
cleanup.current.push(setAttribute(element, "aria-hidden", "true"));
|
|
1352
1347
|
}
|
|
1353
1348
|
}
|
|
1349
|
+
cleanup.current.push(() => {
|
|
1350
|
+
var _a, _b;
|
|
1351
|
+
(_b = (_a = restoreFocus.current) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1352
|
+
});
|
|
1354
1353
|
setTimeout(() => {
|
|
1355
1354
|
var _a;
|
|
1356
1355
|
(_a = on.entered) === null || _a === void 0 ? void 0 : _a.call(on);
|
|
1357
1356
|
}, animationDuration);
|
|
1358
1357
|
});
|
|
1359
|
-
const handleExit = useEventCallback(() => {
|
|
1360
|
-
cleanup.current.forEach((clean) => clean());
|
|
1361
|
-
cleanup.current = [];
|
|
1362
|
-
});
|
|
1363
1358
|
const handleRef = React.useCallback((node) => {
|
|
1364
1359
|
if (node) {
|
|
1365
1360
|
handleEnter(node);
|
|
1366
1361
|
}
|
|
1367
|
-
|
|
1368
|
-
handleExit();
|
|
1369
|
-
}
|
|
1370
|
-
}, [handleEnter, handleExit]);
|
|
1362
|
+
}, [handleEnter]);
|
|
1371
1363
|
return mounted
|
|
1372
1364
|
? createPortal(React.createElement("div", { ref: handleRef, className: clsx(className, cssClass("root"), cssClass(cssPrefix$1()), cssClass(CLASS_NO_SCROLL_PADDING), visible && cssClass(cssPrefix$1("open"))), role: "presentation", "aria-live": "polite", style: {
|
|
1373
1365
|
...(animation.fade !== LightboxDefaultProps.animation.fade
|
|
@@ -1377,6 +1369,10 @@ function Portal({ children, animation, styles, className, on, portal, close }) {
|
|
|
1377
1369
|
? { [cssVar("fade_animation_timing_function")]: animation.easing.fade }
|
|
1378
1370
|
: null),
|
|
1379
1371
|
...styles.root,
|
|
1372
|
+
}, onFocus: (event) => {
|
|
1373
|
+
if (!restoreFocus.current) {
|
|
1374
|
+
restoreFocus.current = event.relatedTarget;
|
|
1375
|
+
}
|
|
1380
1376
|
} }, children), portal.root || document.body)
|
|
1381
1377
|
: null;
|
|
1382
1378
|
}
|
|
@@ -1401,7 +1397,7 @@ function Toolbar({ toolbar: { buttons }, render: { buttonClose, iconClose }, sty
|
|
|
1401
1397
|
return buttonClose();
|
|
1402
1398
|
return React.createElement(IconButton, { key: ACTION_CLOSE, label: "Close", icon: CloseIcon, renderIcon: iconClose, onClick: close });
|
|
1403
1399
|
};
|
|
1404
|
-
return (React.createElement("div", { ref: setContainerRef, style: styles.toolbar, className: cssClass(cssPrefix())
|
|
1400
|
+
return (React.createElement("div", { ref: setContainerRef, style: styles.toolbar, className: cssClass(cssPrefix()) }, buttons === null || buttons === void 0 ? void 0 : buttons.map((button) => (button === ACTION_CLOSE ? renderCloseButton() : button))));
|
|
1405
1401
|
}
|
|
1406
1402
|
const ToolbarModule = createModule(MODULE_TOOLBAR, Toolbar);
|
|
1407
1403
|
|
|
@@ -1418,8 +1414,8 @@ function mergeAnimation(defaultAnimation, animation = {}) {
|
|
|
1418
1414
|
...restAnimation,
|
|
1419
1415
|
};
|
|
1420
1416
|
}
|
|
1421
|
-
function Lightbox({ carousel, animation, render, toolbar, controller, on, plugins, slides, index, ...restProps }) {
|
|
1422
|
-
const { animation: defaultAnimation, carousel: defaultCarousel, render: defaultRender, toolbar: defaultToolbar, controller: defaultController, on: defaultOn, slides: defaultSlides, index: defaultIndex, plugins: defaultPlugins, ...restDefaultProps } = LightboxDefaultProps;
|
|
1417
|
+
function Lightbox({ carousel, animation, render, toolbar, controller, noScroll, on, plugins, slides, index, ...restProps }) {
|
|
1418
|
+
const { animation: defaultAnimation, carousel: defaultCarousel, render: defaultRender, toolbar: defaultToolbar, controller: defaultController, noScroll: defaultNoScroll, on: defaultOn, slides: defaultSlides, index: defaultIndex, plugins: defaultPlugins, ...restDefaultProps } = LightboxDefaultProps;
|
|
1423
1419
|
const { config, augmentation } = withPlugins([
|
|
1424
1420
|
createNode(PortalModule, [
|
|
1425
1421
|
createNode(NoScrollModule, [
|
|
@@ -1437,6 +1433,7 @@ function Lightbox({ carousel, animation, render, toolbar, controller, on, plugin
|
|
|
1437
1433
|
render: { ...defaultRender, ...render },
|
|
1438
1434
|
toolbar: { ...defaultToolbar, ...toolbar },
|
|
1439
1435
|
controller: { ...defaultController, ...controller },
|
|
1436
|
+
noScroll: { ...defaultNoScroll, ...noScroll },
|
|
1440
1437
|
on: { ...defaultOn, ...on },
|
|
1441
1438
|
...restDefaultProps,
|
|
1442
1439
|
...restProps,
|
|
@@ -194,9 +194,7 @@ function ThumbnailsTrack({ visible, containerRef }) {
|
|
|
194
194
|
(offset < 0 && slideIndex < index - preload - offset && slideIndex >= index - preload)
|
|
195
195
|
? {
|
|
196
196
|
duration: fadeAnimationDuration,
|
|
197
|
-
delay: ((offset > 0
|
|
198
|
-
? slideIndex - (index + preload - offset)
|
|
199
|
-
: index - preload - offset - slideIndex) -
|
|
197
|
+
delay: ((offset > 0 ? slideIndex - (index + preload - offset) : index - preload - offset - slideIndex) -
|
|
200
198
|
1) *
|
|
201
199
|
fadeAnimationDuration,
|
|
202
200
|
}
|
|
@@ -229,9 +227,9 @@ function ThumbnailsContextProvider({ children, ...props }) {
|
|
|
229
227
|
return (React.createElement(LightboxPropsProvider, { ...props },
|
|
230
228
|
React.createElement(ThumbnailsContext.Provider, { value: context },
|
|
231
229
|
React.createElement("div", { ref: containerRef, className: clsx(cssClass(cssPrefix()), cssClass(cssPrefix(`${position}`))) },
|
|
232
|
-
["start", "top"].includes(position) &&
|
|
230
|
+
["start", "top"].includes(position) && React.createElement(ThumbnailsTrack, { containerRef: containerRef, visible: visible }),
|
|
233
231
|
React.createElement("div", { className: cssClass(cssPrefix("wrapper")) }, children),
|
|
234
|
-
["end", "bottom"].includes(position) &&
|
|
232
|
+
["end", "bottom"].includes(position) && React.createElement(ThumbnailsTrack, { containerRef: containerRef, visible: visible })))));
|
|
235
233
|
}
|
|
236
234
|
|
|
237
235
|
const thumbnailsIcon = () => (React.createElement(React.Fragment, null,
|
|
@@ -49,9 +49,7 @@ function VideoSlide({ slide, offset }) {
|
|
|
49
49
|
if (width && height && containerRect) {
|
|
50
50
|
const widthBound = width / height > containerRect.width / containerRect.height;
|
|
51
51
|
const elementWidth = widthBound ? containerRect.width : Math.round((containerRect.height / height) * width);
|
|
52
|
-
const elementHeight = !widthBound
|
|
53
|
-
? containerRect.height
|
|
54
|
-
: Math.round((containerRect.width / width) * height);
|
|
52
|
+
const elementHeight = !widthBound ? containerRect.height : Math.round((containerRect.width / width) * height);
|
|
55
53
|
scalingProps.width = elementWidth;
|
|
56
54
|
scalingProps.height = elementHeight;
|
|
57
55
|
scalingProps.style.width = elementWidth;
|
|
@@ -315,11 +315,7 @@ function useZoomState(imageRect, maxZoom, zoomWrapperRef) {
|
|
|
315
315
|
changeOffsets();
|
|
316
316
|
}
|
|
317
317
|
});
|
|
318
|
-
useLayoutEffect(handleControllerRectChange, [
|
|
319
|
-
containerRect.width,
|
|
320
|
-
containerRect.height,
|
|
321
|
-
handleControllerRectChange,
|
|
322
|
-
]);
|
|
318
|
+
useLayoutEffect(handleControllerRectChange, [containerRect.width, containerRect.height, handleControllerRectChange]);
|
|
323
319
|
const zoomIn = React.useCallback(() => changeZoom(zoom * zoomInMultiplier), [zoom, zoomInMultiplier, changeZoom]);
|
|
324
320
|
const zoomOut = React.useCallback(() => changeZoom(zoom / zoomInMultiplier), [zoom, zoomInMultiplier, changeZoom]);
|
|
325
321
|
return { zoom, offsetX, offsetY, disabled, changeOffsets, changeZoom, zoomIn, zoomOut };
|
|
@@ -438,9 +434,7 @@ function ResponsiveImage(props) {
|
|
|
438
434
|
WebkitTransform: "translateZ(0)",
|
|
439
435
|
};
|
|
440
436
|
if (!cover) {
|
|
441
|
-
Object.assign(style, rect.width / rect.height < width / height
|
|
442
|
-
? { width: "100%", height: "auto" }
|
|
443
|
-
: { width: "auto", height: "100%" });
|
|
437
|
+
Object.assign(style, rect.width / rect.height < width / height ? { width: "100%", height: "auto" } : { width: "auto", height: "100%" });
|
|
444
438
|
}
|
|
445
439
|
return (React.createElement(React.Fragment, null,
|
|
446
440
|
preload && preload !== current && (React.createElement(ImageSlide, { key: "preload", ...props, slide: { ...image, src: preload, srcSet: undefined }, style: { position: "absolute", visibility: "hidden", ...style }, onLoad: () => handlePreload(preload), render: {
|
|
@@ -480,9 +474,7 @@ function ZoomWrapper({ render, slide, offset, rect }) {
|
|
|
480
474
|
}
|
|
481
475
|
if (!rendered)
|
|
482
476
|
return null;
|
|
483
|
-
return (React.createElement("div", { ref: zoomWrapperRef, className: clsx(cssClass(CLASS_FULLSIZE), cssClass(CLASS_FLEX_CENTER)), style: offset === 0
|
|
484
|
-
? { transform: `scale(${zoom}) translateX(${offsetX}px) translateY(${offsetY}px)` }
|
|
485
|
-
: undefined }, rendered));
|
|
477
|
+
return (React.createElement("div", { ref: zoomWrapperRef, className: clsx(cssClass(CLASS_FULLSIZE), cssClass(CLASS_FLEX_CENTER)), style: offset === 0 ? { transform: `scale(${zoom}) translateX(${offsetX}px) translateY(${offsetY}px)` } : undefined }, rendered));
|
|
486
478
|
}
|
|
487
479
|
|
|
488
480
|
const Zoom = ({ augment, addModule }) => {
|
package/dist/types.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ declare const IMAGE_FIT_COVER = "cover";
|
|
|
53
53
|
declare const UNKNOWN_ACTION_TYPE = "Unknown action type";
|
|
54
54
|
|
|
55
55
|
/** Lightbox external props */
|
|
56
|
-
type LightboxExternalProps = DeepPartial<DeepPartial<DeepPartial<LightboxProps, "animation" | "toolbar">, "carousel", "imageProps">, "controller", "ref">;
|
|
56
|
+
type LightboxExternalProps = DeepPartial<DeepPartial<DeepPartial<LightboxProps, "animation" | "toolbar" | "noScroll">, "carousel", "imageProps">, "controller", "ref">;
|
|
57
57
|
/** Lightbox properties */
|
|
58
58
|
interface LightboxProps {
|
|
59
59
|
/** if `true`, the lightbox is open */
|
|
@@ -80,6 +80,8 @@ interface LightboxProps {
|
|
|
80
80
|
controller: ControllerSettings;
|
|
81
81
|
/** portal settings */
|
|
82
82
|
portal: PortalSettings;
|
|
83
|
+
/** NoScroll module settings */
|
|
84
|
+
noScroll: NoScrollSettings;
|
|
83
85
|
/** lifecycle callbacks */
|
|
84
86
|
on: Callbacks;
|
|
85
87
|
/** customization styles */
|
|
@@ -220,7 +222,7 @@ interface AnimationSettings {
|
|
|
220
222
|
interface ControllerSettings {
|
|
221
223
|
/** controller ref */
|
|
222
224
|
ref: React.ForwardedRef<ControllerRef>;
|
|
223
|
-
/**
|
|
225
|
+
/** @deprecated for internal use only */
|
|
224
226
|
focus: boolean;
|
|
225
227
|
/** controller `touch-action` */
|
|
226
228
|
touchAction: "none" | "pan-y";
|
|
@@ -251,6 +253,11 @@ interface PortalSettings {
|
|
|
251
253
|
/** portal mount point */
|
|
252
254
|
root?: DocumentFragment | Element | null;
|
|
253
255
|
}
|
|
256
|
+
/** NoScroll module settings */
|
|
257
|
+
interface NoScrollSettings {
|
|
258
|
+
/** if `true`, the NoScroll module functionality is disabled */
|
|
259
|
+
disabled: boolean;
|
|
260
|
+
}
|
|
254
261
|
/** Lightbox navigation action */
|
|
255
262
|
interface NavigationAction {
|
|
256
263
|
/** navigate through the specified number of slides */
|
|
@@ -414,4 +421,4 @@ type DeepPartialValue<T, E extends string = never> = T extends any[] ? T : T ext
|
|
|
414
421
|
[P in keyof T]?: P extends E ? T[P] : DeepPartialValue<T[P], E>;
|
|
415
422
|
} : T;
|
|
416
423
|
|
|
417
|
-
export { ACTION_CLOSE, ACTION_NEXT, ACTION_PREV, ACTION_SWIPE, ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, type AnimationSettings, type Augmentation, CLASS_FLEX_CENTER, CLASS_FULLSIZE, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, type Callback, type Callbacks, type CarouselSettings, type ClickCallbackProps, type Component, type ComponentProps, type ContainerRect, type ControllerRef, type ControllerSettings, type DeepPartial, type DeepPartialValue, ELEMENT_BUTTON, ELEMENT_ICON, EVENT_ON_KEY_DOWN, EVENT_ON_KEY_UP, EVENT_ON_POINTER_CANCEL, EVENT_ON_POINTER_DOWN, EVENT_ON_POINTER_LEAVE, EVENT_ON_POINTER_MOVE, EVENT_ON_POINTER_UP, EVENT_ON_WHEEL, type EventTypes, type GenericSlide, IMAGE_FIT_CONTAIN, IMAGE_FIT_COVER, type ImageFit, type ImageSource, type Labels, type LengthOrPercentage, type LightboxExternalProps, type LightboxProps, type LightboxState, type LightboxStateSwipeAction, type LightboxStateUpdateAction, MODULE_CAROUSEL, MODULE_CONTROLLER, MODULE_NAVIGATION, MODULE_NO_SCROLL, MODULE_PORTAL, MODULE_ROOT, MODULE_TOOLBAR, type Module, type NavigationAction, type Node, PLUGIN_CAPTIONS, PLUGIN_COUNTER, PLUGIN_DOWNLOAD, PLUGIN_FULLSCREEN, PLUGIN_INLINE, PLUGIN_SHARE, PLUGIN_SLIDESHOW, PLUGIN_THUMBNAILS, PLUGIN_ZOOM, type Plugin, type PluginProps, type PortalSettings, type Render, type RenderFunction, type RenderSlideContainerProps, type RenderSlideFooterProps, type RenderSlideHeaderProps, type RenderSlideProps, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_LOADING, SLIDE_STATUS_PLACEHOLDER, SLIDE_STATUS_PLAYING, type Slide, type SlideImage, type SlideStatus, type SlideTypeKey, type SlideTypes, type Slot, type SlotStyles, type SlotType, type ToolbarButtonKey, type ToolbarButtonKeys, type ToolbarSettings, UNKNOWN_ACTION_TYPE, VK_ARROW_LEFT, VK_ARROW_RIGHT, VK_ESCAPE, type ViewCallbackProps, activeSlideStatus };
|
|
424
|
+
export { ACTION_CLOSE, ACTION_NEXT, ACTION_PREV, ACTION_SWIPE, ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, type AnimationSettings, type Augmentation, CLASS_FLEX_CENTER, CLASS_FULLSIZE, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, type Callback, type Callbacks, type CarouselSettings, type ClickCallbackProps, type Component, type ComponentProps, type ContainerRect, type ControllerRef, type ControllerSettings, type DeepPartial, type DeepPartialValue, ELEMENT_BUTTON, ELEMENT_ICON, EVENT_ON_KEY_DOWN, EVENT_ON_KEY_UP, EVENT_ON_POINTER_CANCEL, EVENT_ON_POINTER_DOWN, EVENT_ON_POINTER_LEAVE, EVENT_ON_POINTER_MOVE, EVENT_ON_POINTER_UP, EVENT_ON_WHEEL, type EventTypes, type GenericSlide, IMAGE_FIT_CONTAIN, IMAGE_FIT_COVER, type ImageFit, type ImageSource, type Labels, type LengthOrPercentage, type LightboxExternalProps, type LightboxProps, type LightboxState, type LightboxStateSwipeAction, type LightboxStateUpdateAction, MODULE_CAROUSEL, MODULE_CONTROLLER, MODULE_NAVIGATION, MODULE_NO_SCROLL, MODULE_PORTAL, MODULE_ROOT, MODULE_TOOLBAR, type Module, type NavigationAction, type NoScrollSettings, type Node, PLUGIN_CAPTIONS, PLUGIN_COUNTER, PLUGIN_DOWNLOAD, PLUGIN_FULLSCREEN, PLUGIN_INLINE, PLUGIN_SHARE, PLUGIN_SLIDESHOW, PLUGIN_THUMBNAILS, PLUGIN_ZOOM, type Plugin, type PluginProps, type PortalSettings, type Render, type RenderFunction, type RenderSlideContainerProps, type RenderSlideFooterProps, type RenderSlideHeaderProps, type RenderSlideProps, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_LOADING, SLIDE_STATUS_PLACEHOLDER, SLIDE_STATUS_PLAYING, type Slide, type SlideImage, type SlideStatus, type SlideTypeKey, type SlideTypes, type Slot, type SlotStyles, type SlotType, type ToolbarButtonKey, type ToolbarButtonKeys, type ToolbarSettings, UNKNOWN_ACTION_TYPE, VK_ARROW_LEFT, VK_ARROW_RIGHT, VK_ESCAPE, type ViewCallbackProps, activeSlideStatus };
|
package/package.json
CHANGED
|
@@ -1,169 +1,169 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
2
|
+
"name": "yet-another-react-lightbox",
|
|
3
|
+
"version": "3.15.0",
|
|
4
|
+
"description": "Modern React lightbox component",
|
|
5
|
+
"author": "Igor Danchenko",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./core": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./styles.css": {
|
|
20
|
+
"types": "./dist/styles.css.d.ts",
|
|
21
|
+
"default": "./dist/styles.css"
|
|
22
|
+
},
|
|
23
|
+
"./plugins": {
|
|
24
|
+
"types": "./dist/plugins/index.d.ts",
|
|
25
|
+
"default": "./dist/plugins/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./plugins/captions": {
|
|
28
|
+
"types": "./dist/plugins/captions/index.d.ts",
|
|
29
|
+
"default": "./dist/plugins/captions/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./plugins/captions.css": {
|
|
32
|
+
"types": "./dist/plugins/captions/captions.css.d.ts",
|
|
33
|
+
"default": "./dist/plugins/captions/captions.css"
|
|
34
|
+
},
|
|
35
|
+
"./plugins/counter": {
|
|
36
|
+
"types": "./dist/plugins/counter/index.d.ts",
|
|
37
|
+
"default": "./dist/plugins/counter/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./plugins/counter.css": {
|
|
40
|
+
"types": "./dist/plugins/counter/counter.css.d.ts",
|
|
41
|
+
"default": "./dist/plugins/counter/counter.css"
|
|
42
|
+
},
|
|
43
|
+
"./plugins/download": {
|
|
44
|
+
"types": "./dist/plugins/download/index.d.ts",
|
|
45
|
+
"default": "./dist/plugins/download/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./plugins/fullscreen": {
|
|
48
|
+
"types": "./dist/plugins/fullscreen/index.d.ts",
|
|
49
|
+
"default": "./dist/plugins/fullscreen/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./plugins/inline": {
|
|
52
|
+
"types": "./dist/plugins/inline/index.d.ts",
|
|
53
|
+
"default": "./dist/plugins/inline/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./plugins/share": {
|
|
56
|
+
"types": "./dist/plugins/share/index.d.ts",
|
|
57
|
+
"default": "./dist/plugins/share/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./plugins/slideshow": {
|
|
60
|
+
"types": "./dist/plugins/slideshow/index.d.ts",
|
|
61
|
+
"default": "./dist/plugins/slideshow/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./plugins/thumbnails": {
|
|
64
|
+
"types": "./dist/plugins/thumbnails/index.d.ts",
|
|
65
|
+
"default": "./dist/plugins/thumbnails/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./plugins/thumbnails.css": {
|
|
68
|
+
"types": "./dist/plugins/thumbnails/thumbnails.css.d.ts",
|
|
69
|
+
"default": "./dist/plugins/thumbnails/thumbnails.css"
|
|
70
|
+
},
|
|
71
|
+
"./plugins/video": {
|
|
72
|
+
"types": "./dist/plugins/video/index.d.ts",
|
|
73
|
+
"default": "./dist/plugins/video/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./plugins/zoom": {
|
|
76
|
+
"types": "./dist/plugins/zoom/index.d.ts",
|
|
77
|
+
"default": "./dist/plugins/zoom/index.js"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"typesVersions": {
|
|
81
|
+
"*": {
|
|
82
|
+
"*": [
|
|
83
|
+
"dist/index.d.ts"
|
|
84
|
+
],
|
|
85
|
+
"core": [
|
|
86
|
+
"dist/index.d.ts"
|
|
87
|
+
],
|
|
88
|
+
"styles.css": [
|
|
89
|
+
"dist/styles.css.d.ts"
|
|
90
|
+
],
|
|
91
|
+
"plugins": [
|
|
92
|
+
"dist/plugins/index.d.ts"
|
|
93
|
+
],
|
|
94
|
+
"plugins/captions": [
|
|
95
|
+
"dist/plugins/captions/index.d.ts"
|
|
96
|
+
],
|
|
97
|
+
"plugins/captions.css": [
|
|
98
|
+
"dist/plugins/captions/captions.css.d.ts"
|
|
99
|
+
],
|
|
100
|
+
"plugins/counter": [
|
|
101
|
+
"dist/plugins/counter/index.d.ts"
|
|
102
|
+
],
|
|
103
|
+
"plugins/counter.css": [
|
|
104
|
+
"dist/plugins/counter/counter.css.d.ts"
|
|
105
|
+
],
|
|
106
|
+
"plugins/download": [
|
|
107
|
+
"dist/plugins/download/index.d.ts"
|
|
108
|
+
],
|
|
109
|
+
"plugins/fullscreen": [
|
|
110
|
+
"dist/plugins/fullscreen/index.d.ts"
|
|
111
|
+
],
|
|
112
|
+
"plugins/inline": [
|
|
113
|
+
"dist/plugins/inline/index.d.ts"
|
|
114
|
+
],
|
|
115
|
+
"plugins/share": [
|
|
116
|
+
"dist/plugins/share/index.d.ts"
|
|
117
|
+
],
|
|
118
|
+
"plugins/slideshow": [
|
|
119
|
+
"dist/plugins/slideshow/index.d.ts"
|
|
120
|
+
],
|
|
121
|
+
"plugins/thumbnails": [
|
|
122
|
+
"dist/plugins/thumbnails/index.d.ts"
|
|
123
|
+
],
|
|
124
|
+
"plugins/thumbnails.css": [
|
|
125
|
+
"dist/plugins/thumbnails/thumbnails.css.d.ts"
|
|
126
|
+
],
|
|
127
|
+
"plugins/video": [
|
|
128
|
+
"dist/plugins/video/index.d.ts"
|
|
129
|
+
],
|
|
130
|
+
"plugins/zoom": [
|
|
131
|
+
"dist/plugins/zoom/index.d.ts"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"files": [
|
|
136
|
+
"dist"
|
|
137
|
+
],
|
|
138
|
+
"sideEffects": [
|
|
139
|
+
"*.css"
|
|
140
|
+
],
|
|
141
|
+
"homepage": "https://yet-another-react-lightbox.com",
|
|
142
|
+
"repository": {
|
|
143
|
+
"type": "git",
|
|
144
|
+
"url": "https://github.com/igordanchenko/yet-another-react-lightbox.git"
|
|
145
|
+
},
|
|
146
|
+
"bugs": {
|
|
147
|
+
"url": "https://github.com/igordanchenko/yet-another-react-lightbox/issues"
|
|
148
|
+
},
|
|
149
|
+
"engines": {
|
|
150
|
+
"node": ">=14"
|
|
151
|
+
},
|
|
152
|
+
"publishConfig": {
|
|
153
|
+
"access": "public",
|
|
154
|
+
"provenance": true
|
|
155
|
+
},
|
|
156
|
+
"peerDependencies": {
|
|
157
|
+
"react": ">=16.8.0",
|
|
158
|
+
"react-dom": ">=16.8.0"
|
|
159
|
+
},
|
|
160
|
+
"keywords": [
|
|
161
|
+
"react",
|
|
162
|
+
"image",
|
|
163
|
+
"photo",
|
|
164
|
+
"lightbox",
|
|
165
|
+
"react lightbox",
|
|
166
|
+
"react image lightbox",
|
|
167
|
+
"react photo lightbox"
|
|
168
|
+
]
|
|
169
169
|
}
|