yet-another-react-lightbox 3.5.3 → 3.6.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.d.ts +240 -4
- package/dist/index.js +1317 -4
- package/dist/plugins/captions/captions.css +1 -33
- package/dist/plugins/captions/captions.css.d.ts +2 -0
- package/dist/plugins/captions/index.d.ts +8 -4
- package/dist/plugins/captions/index.js +104 -3
- package/dist/plugins/counter/counter.css +1 -16
- package/dist/plugins/counter/counter.css.d.ts +2 -0
- package/dist/plugins/counter/index.d.ts +8 -3
- package/dist/plugins/counter/index.js +18 -2
- package/dist/plugins/download/index.d.ts +6 -3
- package/dist/plugins/download/index.js +90 -3
- package/dist/plugins/fullscreen/index.d.ts +8 -4
- package/dist/plugins/fullscreen/index.js +128 -3
- package/dist/plugins/index.d.ts +9 -9
- package/dist/plugins/index.js +9 -9
- package/dist/plugins/inline/index.d.ts +8 -3
- package/dist/plugins/inline/index.js +26 -2
- package/dist/plugins/slideshow/index.d.ts +8 -4
- package/dist/plugins/slideshow/index.js +113 -3
- package/dist/plugins/thumbnails/index.d.ts +7 -4
- package/dist/plugins/thumbnails/index.js +262 -3
- package/dist/plugins/thumbnails/thumbnails.css +1 -139
- package/dist/plugins/thumbnails/thumbnails.css.d.ts +2 -0
- package/dist/plugins/video/index.d.ts +7 -2
- package/dist/plugins/video/index.js +109 -2
- package/dist/plugins/zoom/index.d.ts +7 -4
- package/dist/plugins/zoom/index.js +499 -3
- package/dist/styles.css +1 -281
- package/dist/styles.css.d.ts +2 -0
- package/dist/types.d.ts +123 -47
- package/dist/types.js +51 -1
- package/package.json +34 -10
- package/dist/Lightbox.d.ts +0 -4
- package/dist/Lightbox.js +0 -46
- package/dist/core/components/IconButton.d.ts +0 -7
- package/dist/core/components/IconButton.js +0 -8
- package/dist/core/components/Icons.d.ts +0 -29
- package/dist/core/components/Icons.js +0 -27
- package/dist/core/components/ImageSlide.d.ts +0 -13
- package/dist/core/components/ImageSlide.js +0 -68
- package/dist/core/components/index.d.ts +0 -3
- package/dist/core/components/index.js +0 -3
- package/dist/core/config.d.ts +0 -7
- package/dist/core/config.js +0 -93
- package/dist/core/consts.d.ts +0 -50
- package/dist/core/consts.js +0 -49
- package/dist/core/contexts/Events.d.ts +0 -17
- package/dist/core/contexts/Events.js +0 -29
- package/dist/core/contexts/LightboxProps.d.ts +0 -6
- package/dist/core/contexts/LightboxProps.js +0 -7
- package/dist/core/contexts/LightboxState.d.ts +0 -27
- package/dist/core/contexts/LightboxState.js +0 -49
- package/dist/core/contexts/Timeouts.d.ts +0 -8
- package/dist/core/contexts/Timeouts.js +0 -32
- package/dist/core/contexts/index.d.ts +0 -4
- package/dist/core/contexts/index.js +0 -4
- package/dist/core/hooks/index.d.ts +0 -11
- package/dist/core/hooks/index.js +0 -11
- package/dist/core/hooks/useAnimation.d.ts +0 -15
- package/dist/core/hooks/useAnimation.js +0 -57
- package/dist/core/hooks/useContainerRect.d.ts +0 -7
- package/dist/core/hooks/useContainerRect.js +0 -36
- package/dist/core/hooks/useDelay.d.ts +0 -1
- package/dist/core/hooks/useDelay.js +0 -10
- package/dist/core/hooks/useEventCallback.d.ts +0 -1
- package/dist/core/hooks/useEventCallback.js +0 -9
- package/dist/core/hooks/useForkRef.d.ts +0 -3
- package/dist/core/hooks/useForkRef.js +0 -17
- package/dist/core/hooks/useLayoutEffect.d.ts +0 -2
- package/dist/core/hooks/useLayoutEffect.js +0 -3
- package/dist/core/hooks/useLoseFocus.d.ts +0 -4
- package/dist/core/hooks/useLoseFocus.js +0 -19
- package/dist/core/hooks/useMotionPreference.d.ts +0 -1
- package/dist/core/hooks/useMotionPreference.js +0 -13
- package/dist/core/hooks/useRTL.d.ts +0 -1
- package/dist/core/hooks/useRTL.js +0 -9
- package/dist/core/hooks/useSensors.d.ts +0 -14
- package/dist/core/hooks/useSensors.js +0 -38
- package/dist/core/hooks/useThrottle.d.ts +0 -1
- package/dist/core/hooks/useThrottle.js +0 -16
- package/dist/core/index.d.ts +0 -7
- package/dist/core/index.js +0 -7
- package/dist/core/modules/Carousel.d.ts +0 -4
- package/dist/core/modules/Carousel.js +0 -72
- package/dist/core/modules/Controller.d.ts +0 -31
- package/dist/core/modules/Controller.js +0 -215
- package/dist/core/modules/Navigation.d.ts +0 -13
- package/dist/core/modules/Navigation.js +0 -35
- package/dist/core/modules/NoScroll.d.ts +0 -4
- package/dist/core/modules/NoScroll.js +0 -52
- package/dist/core/modules/Portal.d.ts +0 -4
- package/dist/core/modules/Portal.js +0 -92
- package/dist/core/modules/Root.d.ts +0 -4
- package/dist/core/modules/Root.js +0 -7
- package/dist/core/modules/Toolbar.d.ts +0 -4
- package/dist/core/modules/Toolbar.js +0 -25
- package/dist/core/modules/controller/index.d.ts +0 -8
- package/dist/core/modules/controller/index.js +0 -9
- package/dist/core/modules/controller/usePointerSwipe.d.ts +0 -2
- package/dist/core/modules/controller/usePointerSwipe.js +0 -72
- package/dist/core/modules/controller/usePreventSwipeNavigation.d.ts +0 -3
- package/dist/core/modules/controller/usePreventSwipeNavigation.js +0 -20
- package/dist/core/modules/controller/useWheelSwipe.d.ts +0 -3
- package/dist/core/modules/controller/useWheelSwipe.js +0 -92
- package/dist/core/modules/index.d.ts +0 -7
- package/dist/core/modules/index.js +0 -7
- package/dist/core/utils.d.ts +0 -31
- package/dist/core/utils.js +0 -64
- package/dist/plugins/captions/Captions.d.ts +0 -3
- package/dist/plugins/captions/Captions.js +0 -25
- package/dist/plugins/captions/CaptionsButton.d.ts +0 -2
- package/dist/plugins/captions/CaptionsButton.js +0 -16
- package/dist/plugins/captions/CaptionsContext.d.ts +0 -5
- package/dist/plugins/captions/CaptionsContext.js +0 -16
- package/dist/plugins/captions/Description.d.ts +0 -4
- package/dist/plugins/captions/Description.js +0 -27
- package/dist/plugins/captions/Title.d.ts +0 -4
- package/dist/plugins/captions/Title.js +0 -16
- package/dist/plugins/captions/props.d.ts +0 -19
- package/dist/plugins/captions/props.js +0 -14
- package/dist/plugins/captions/utils.d.ts +0 -1
- package/dist/plugins/captions/utils.js +0 -2
- package/dist/plugins/counter/Counter.d.ts +0 -5
- package/dist/plugins/counter/Counter.js +0 -14
- package/dist/plugins/download/Download.d.ts +0 -2
- package/dist/plugins/download/Download.js +0 -9
- package/dist/plugins/download/DownloadButton.d.ts +0 -2
- package/dist/plugins/download/DownloadButton.js +0 -19
- package/dist/plugins/download/FileSaver.d.ts +0 -1
- package/dist/plugins/download/FileSaver.js +0 -60
- package/dist/plugins/fullscreen/Fullscreen.d.ts +0 -3
- package/dist/plugins/fullscreen/Fullscreen.js +0 -13
- package/dist/plugins/fullscreen/FullscreenButton.d.ts +0 -3
- package/dist/plugins/fullscreen/FullscreenButton.js +0 -16
- package/dist/plugins/fullscreen/FullscreenContext.d.ts +0 -5
- package/dist/plugins/fullscreen/FullscreenContext.js +0 -93
- package/dist/plugins/fullscreen/props.d.ts +0 -10
- package/dist/plugins/fullscreen/props.js +0 -8
- package/dist/plugins/inline/Inline.d.ts +0 -3
- package/dist/plugins/inline/Inline.js +0 -18
- package/dist/plugins/inline/InlineContainer.d.ts +0 -4
- package/dist/plugins/inline/InlineContainer.js +0 -5
- package/dist/plugins/slideshow/Slideshow.d.ts +0 -3
- package/dist/plugins/slideshow/Slideshow.js +0 -13
- package/dist/plugins/slideshow/SlideshowButton.d.ts +0 -2
- package/dist/plugins/slideshow/SlideshowButton.js +0 -14
- package/dist/plugins/slideshow/SlideshowContext.d.ts +0 -5
- package/dist/plugins/slideshow/SlideshowContext.js +0 -79
- package/dist/plugins/slideshow/props.d.ts +0 -12
- package/dist/plugins/slideshow/props.js +0 -9
- package/dist/plugins/thumbnails/Thumbnail.d.ts +0 -15
- package/dist/plugins/thumbnails/Thumbnail.js +0 -51
- package/dist/plugins/thumbnails/Thumbnails.d.ts +0 -3
- package/dist/plugins/thumbnails/Thumbnails.js +0 -22
- package/dist/plugins/thumbnails/ThumbnailsButton.d.ts +0 -2
- package/dist/plugins/thumbnails/ThumbnailsButton.js +0 -16
- package/dist/plugins/thumbnails/ThumbnailsContext.d.ts +0 -6
- package/dist/plugins/thumbnails/ThumbnailsContext.js +0 -24
- package/dist/plugins/thumbnails/ThumbnailsTrack.d.ts +0 -5
- package/dist/plugins/thumbnails/ThumbnailsTrack.js +0 -141
- package/dist/plugins/thumbnails/props.d.ts +0 -40
- package/dist/plugins/thumbnails/props.js +0 -21
- package/dist/plugins/thumbnails/utils.d.ts +0 -2
- package/dist/plugins/thumbnails/utils.js +0 -4
- package/dist/plugins/video/Video.d.ts +0 -3
- package/dist/plugins/video/Video.js +0 -21
- package/dist/plugins/video/VideoSlide.d.ts +0 -8
- package/dist/plugins/video/VideoSlide.js +0 -74
- package/dist/plugins/video/props.d.ts +0 -29
- package/dist/plugins/video/props.js +0 -13
- package/dist/plugins/zoom/ResponsiveImage.d.ts +0 -11
- package/dist/plugins/zoom/ResponsiveImage.js +0 -58
- package/dist/plugins/zoom/Zoom.d.ts +0 -3
- package/dist/plugins/zoom/Zoom.js +0 -18
- package/dist/plugins/zoom/ZoomButton.d.ts +0 -8
- package/dist/plugins/zoom/ZoomButton.js +0 -27
- package/dist/plugins/zoom/ZoomButtonsGroup.d.ts +0 -2
- package/dist/plugins/zoom/ZoomButtonsGroup.js +0 -22
- package/dist/plugins/zoom/ZoomController.d.ts +0 -12
- package/dist/plugins/zoom/ZoomController.js +0 -17
- package/dist/plugins/zoom/ZoomToolbarControl.d.ts +0 -2
- package/dist/plugins/zoom/ZoomToolbarControl.js +0 -12
- package/dist/plugins/zoom/ZoomWrapper.d.ts +0 -5
- package/dist/plugins/zoom/ZoomWrapper.js +0 -36
- package/dist/plugins/zoom/hooks/index.d.ts +0 -6
- package/dist/plugins/zoom/hooks/index.js +0 -6
- package/dist/plugins/zoom/hooks/useZoomAnimation.d.ts +0 -2
- package/dist/plugins/zoom/hooks/useZoomAnimation.js +0 -39
- package/dist/plugins/zoom/hooks/useZoomCallback.d.ts +0 -1
- package/dist/plugins/zoom/hooks/useZoomCallback.js +0 -12
- package/dist/plugins/zoom/hooks/useZoomImageRect.d.ts +0 -5
- package/dist/plugins/zoom/hooks/useZoomImageRect.js +0 -41
- package/dist/plugins/zoom/hooks/useZoomProps.d.ts +0 -13
- package/dist/plugins/zoom/hooks/useZoomProps.js +0 -6
- package/dist/plugins/zoom/hooks/useZoomSensors.d.ts +0 -3
- package/dist/plugins/zoom/hooks/useZoomSensors.js +0 -154
- package/dist/plugins/zoom/hooks/useZoomState.d.ts +0 -12
- package/dist/plugins/zoom/hooks/useZoomState.js +0 -63
- package/dist/plugins/zoom/props.d.ts +0 -25
- package/dist/plugins/zoom/props.js +0 -15
- package/dist/props.d.ts +0 -2
- package/dist/props.js +0 -38
|
@@ -1,3 +1,113 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { makeUseContext, useLightboxState, useTimeouts, useEvents, useController, useEventCallback, cleanup, createIcon, useLightboxProps, useLoseFocus, IconButton, addToolbarButton, createModule } from '../../index.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { SLIDE_STATUS_LOADING, SLIDE_STATUS_PLAYING, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, ACTIVE_SLIDE_ERROR, SLIDE_STATUS_ERROR, ACTIVE_SLIDE_COMPLETE, SLIDE_STATUS_COMPLETE, PLUGIN_SLIDESHOW } from '../../types.js';
|
|
4
|
+
|
|
5
|
+
const defaultSlideshowProps = {
|
|
6
|
+
autoplay: false,
|
|
7
|
+
delay: 3000,
|
|
8
|
+
ref: null,
|
|
9
|
+
};
|
|
10
|
+
const resolveSlideshowProps = (slideshow) => ({
|
|
11
|
+
...defaultSlideshowProps,
|
|
12
|
+
...slideshow,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const SlideshowContext = React.createContext(null);
|
|
16
|
+
const useSlideshow = makeUseContext("useSlideshow", "SlideshowContext", SlideshowContext);
|
|
17
|
+
function SlideshowContextProvider({ slideshow, carousel: { finite }, on, children }) {
|
|
18
|
+
const { autoplay, delay, ref } = resolveSlideshowProps(slideshow);
|
|
19
|
+
const wasPlaying = React.useRef(autoplay);
|
|
20
|
+
const [playing, setPlaying] = React.useState(autoplay);
|
|
21
|
+
const scheduler = React.useRef();
|
|
22
|
+
const slideStatus = React.useRef();
|
|
23
|
+
const { slides, currentIndex } = useLightboxState();
|
|
24
|
+
const { setTimeout, clearTimeout } = useTimeouts();
|
|
25
|
+
const { subscribe } = useEvents();
|
|
26
|
+
const { next } = useController();
|
|
27
|
+
const disabled = slides.length === 0 || (finite && currentIndex === slides.length - 1);
|
|
28
|
+
const play = React.useCallback(() => {
|
|
29
|
+
if (!playing && !disabled) {
|
|
30
|
+
setPlaying(true);
|
|
31
|
+
}
|
|
32
|
+
}, [playing, disabled]);
|
|
33
|
+
const pause = React.useCallback(() => {
|
|
34
|
+
if (playing) {
|
|
35
|
+
setPlaying(false);
|
|
36
|
+
}
|
|
37
|
+
}, [playing]);
|
|
38
|
+
const cancelScheduler = React.useCallback(() => {
|
|
39
|
+
clearTimeout(scheduler.current);
|
|
40
|
+
scheduler.current = undefined;
|
|
41
|
+
}, [clearTimeout]);
|
|
42
|
+
const scheduleNextSlide = useEventCallback(() => {
|
|
43
|
+
cancelScheduler();
|
|
44
|
+
if (!playing ||
|
|
45
|
+
disabled ||
|
|
46
|
+
slideStatus.current === SLIDE_STATUS_LOADING ||
|
|
47
|
+
slideStatus.current === SLIDE_STATUS_PLAYING) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
scheduler.current = setTimeout(() => {
|
|
51
|
+
if (playing) {
|
|
52
|
+
slideStatus.current = undefined;
|
|
53
|
+
next();
|
|
54
|
+
}
|
|
55
|
+
}, delay);
|
|
56
|
+
});
|
|
57
|
+
React.useEffect(scheduleNextSlide, [currentIndex, playing, scheduleNextSlide]);
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
if (playing && disabled) {
|
|
60
|
+
setPlaying(false);
|
|
61
|
+
}
|
|
62
|
+
}, [currentIndex, playing, disabled]);
|
|
63
|
+
const onSlideshowStart = useEventCallback(() => { var _a; return (_a = on.slideshowStart) === null || _a === void 0 ? void 0 : _a.call(on); });
|
|
64
|
+
const onSlideshowStop = useEventCallback(() => { var _a; return (_a = on.slideshowStop) === null || _a === void 0 ? void 0 : _a.call(on); });
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
if (playing) {
|
|
67
|
+
onSlideshowStart();
|
|
68
|
+
}
|
|
69
|
+
else if (wasPlaying.current) {
|
|
70
|
+
onSlideshowStop();
|
|
71
|
+
}
|
|
72
|
+
wasPlaying.current = playing;
|
|
73
|
+
}, [playing, onSlideshowStart, onSlideshowStop]);
|
|
74
|
+
React.useEffect(() => cleanup(cancelScheduler, subscribe(ACTIVE_SLIDE_LOADING, () => {
|
|
75
|
+
slideStatus.current = SLIDE_STATUS_LOADING;
|
|
76
|
+
cancelScheduler();
|
|
77
|
+
}), subscribe(ACTIVE_SLIDE_PLAYING, () => {
|
|
78
|
+
slideStatus.current = SLIDE_STATUS_PLAYING;
|
|
79
|
+
cancelScheduler();
|
|
80
|
+
}), subscribe(ACTIVE_SLIDE_ERROR, () => {
|
|
81
|
+
slideStatus.current = SLIDE_STATUS_ERROR;
|
|
82
|
+
scheduleNextSlide();
|
|
83
|
+
}), subscribe(ACTIVE_SLIDE_COMPLETE, () => {
|
|
84
|
+
slideStatus.current = SLIDE_STATUS_COMPLETE;
|
|
85
|
+
scheduleNextSlide();
|
|
86
|
+
})), [subscribe, cancelScheduler, scheduleNextSlide]);
|
|
87
|
+
const context = React.useMemo(() => ({ playing, disabled, play, pause }), [playing, disabled, play, pause]);
|
|
88
|
+
React.useImperativeHandle(ref, () => context, [context]);
|
|
89
|
+
return React.createElement(SlideshowContext.Provider, { value: context }, children);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const PlayIcon = createIcon("Play", React.createElement("path", { d: "M8 5v14l11-7z" }));
|
|
93
|
+
const PauseIcon = createIcon("Pause", React.createElement("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }));
|
|
94
|
+
function SlideshowButton() {
|
|
95
|
+
const { playing, disabled, play, pause } = useSlideshow();
|
|
96
|
+
const { render } = useLightboxProps();
|
|
97
|
+
const focusListeners = useLoseFocus(disabled);
|
|
98
|
+
if (render.buttonSlideshow) {
|
|
99
|
+
return React.createElement(React.Fragment, null, render.buttonSlideshow({ playing, disabled, play, pause }));
|
|
100
|
+
}
|
|
101
|
+
return (React.createElement(IconButton, { label: playing ? "Pause" : "Play", icon: playing ? PauseIcon : PlayIcon, renderIcon: playing ? render.iconSlideshowPause : render.iconSlideshowPlay, onClick: playing ? pause : play, disabled: disabled, ...focusListeners }));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function Slideshow({ augment, addModule }) {
|
|
105
|
+
augment(({ slideshow, toolbar, ...restProps }) => ({
|
|
106
|
+
toolbar: addToolbarButton(toolbar, PLUGIN_SLIDESHOW, React.createElement(SlideshowButton, null)),
|
|
107
|
+
slideshow: resolveSlideshowProps(slideshow),
|
|
108
|
+
...restProps,
|
|
109
|
+
}));
|
|
110
|
+
addModule(createModule(PLUGIN_SLIDESHOW, SlideshowContextProvider));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { Slideshow as default };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PluginProps, PLUGIN_THUMBNAILS } from '../../types.js';
|
|
2
|
+
|
|
3
|
+
/** Thumbnails plugin */
|
|
4
|
+
declare function Thumbnails({ augment, contains, append, addParent }: PluginProps): void;
|
|
5
|
+
|
|
4
6
|
type Position = "top" | "bottom" | "start" | "end";
|
|
5
7
|
declare module "../../types.js" {
|
|
6
8
|
interface LightboxProps {
|
|
@@ -68,4 +70,5 @@ declare module "../../types.js" {
|
|
|
68
70
|
hide: Callback;
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
|
-
|
|
73
|
+
|
|
74
|
+
export { Thumbnails as default };
|
|
@@ -1,3 +1,262 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
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';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { PLUGIN_THUMBNAILS, ELEMENT_ICON, CLASS_FULLSIZE, CLASS_FLEX_CENTER, ACTION_SWIPE, ACTION_NEXT, ACTION_PREV, PLUGIN_FULLSCREEN, MODULE_CONTROLLER } from '../../types.js';
|
|
4
|
+
|
|
5
|
+
const defaultThumbnailsProps = {
|
|
6
|
+
ref: null,
|
|
7
|
+
position: "bottom",
|
|
8
|
+
width: 120,
|
|
9
|
+
height: 80,
|
|
10
|
+
border: 1,
|
|
11
|
+
borderRadius: 4,
|
|
12
|
+
padding: 4,
|
|
13
|
+
gap: 16,
|
|
14
|
+
imageFit: "contain",
|
|
15
|
+
vignette: true,
|
|
16
|
+
};
|
|
17
|
+
const resolveThumbnailsProps = (thumbnails) => ({
|
|
18
|
+
...defaultThumbnailsProps,
|
|
19
|
+
...thumbnails,
|
|
20
|
+
});
|
|
21
|
+
function useThumbnailsProps() {
|
|
22
|
+
const { thumbnails } = useLightboxProps();
|
|
23
|
+
return resolveThumbnailsProps(thumbnails);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const cssPrefix = (value) => composePrefix(PLUGIN_THUMBNAILS, value);
|
|
27
|
+
const cssThumbnailPrefix = (value) => cssPrefix(composePrefix("thumbnail", value));
|
|
28
|
+
|
|
29
|
+
const VideoThumbnailIcon = createIcon("VideoThumbnail", React.createElement("path", { d: "M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" }));
|
|
30
|
+
const UnknownThumbnailIcon = createIcon("UnknownThumbnail", React.createElement("path", { d: "M23 18V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zM8.5 12.5l2.5 3.01L14.5 11l4.5 6H5l3.5-4.5z" }));
|
|
31
|
+
function renderThumbnail({ slide, render, rect, imageFit }) {
|
|
32
|
+
var _a;
|
|
33
|
+
const customThumbnail = (_a = render.thumbnail) === null || _a === void 0 ? void 0 : _a.call(render, { slide, render, rect, imageFit });
|
|
34
|
+
if (customThumbnail) {
|
|
35
|
+
return customThumbnail;
|
|
36
|
+
}
|
|
37
|
+
const thumbnailIconClass = cssClass(cssThumbnailPrefix(ELEMENT_ICON));
|
|
38
|
+
if (!isImageSlide(slide)) {
|
|
39
|
+
if (slide.type === "video") {
|
|
40
|
+
return (React.createElement(React.Fragment, null,
|
|
41
|
+
"poster" in slide && (React.createElement("img", { alt: "", src: slide.poster, className: clsx(cssClass(CLASS_FULLSIZE), cssClass(cssPrefix("contain_image"))) })),
|
|
42
|
+
React.createElement(VideoThumbnailIcon, { className: thumbnailIconClass })));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return React.createElement(ImageSlide, { slide: slide, render: render, rect: rect, imageFit: imageFit });
|
|
47
|
+
}
|
|
48
|
+
return React.createElement(UnknownThumbnailIcon, { className: thumbnailIconClass });
|
|
49
|
+
}
|
|
50
|
+
const activePrefix = makeComposePrefix("active");
|
|
51
|
+
const fadeInPrefix = makeComposePrefix("fadein");
|
|
52
|
+
const fadeOutPrefix = makeComposePrefix("fadeout");
|
|
53
|
+
const placeholderPrefix = makeComposePrefix("placeholder");
|
|
54
|
+
const DELAY = "delay";
|
|
55
|
+
const DURATION = "duration";
|
|
56
|
+
function Thumbnail({ slide, onClick, active, fadeIn, fadeOut, placeholder }) {
|
|
57
|
+
const { render, styles } = useLightboxProps();
|
|
58
|
+
const { width, height, imageFit } = useThumbnailsProps();
|
|
59
|
+
const rect = { width, height };
|
|
60
|
+
return (React.createElement("button", { type: "button", className: clsx(cssClass(CLASS_FLEX_CENTER), cssClass(cssThumbnailPrefix()), active && cssClass(cssThumbnailPrefix(activePrefix())), fadeIn && cssClass(cssThumbnailPrefix(fadeInPrefix())), fadeOut && cssClass(cssThumbnailPrefix(fadeOutPrefix())), placeholder && cssClass(cssThumbnailPrefix(placeholderPrefix()))), style: {
|
|
61
|
+
...(fadeIn
|
|
62
|
+
? {
|
|
63
|
+
[cssVar(cssThumbnailPrefix(fadeInPrefix(DURATION)))]: `${fadeIn.duration}ms`,
|
|
64
|
+
[cssVar(cssThumbnailPrefix(fadeInPrefix(DELAY)))]: `${fadeIn.delay}ms`,
|
|
65
|
+
}
|
|
66
|
+
: null),
|
|
67
|
+
...(fadeOut
|
|
68
|
+
? {
|
|
69
|
+
[cssVar(cssThumbnailPrefix(fadeOutPrefix(DURATION)))]: `${fadeOut.duration}ms`,
|
|
70
|
+
[cssVar(cssThumbnailPrefix(fadeOutPrefix(DELAY)))]: `${fadeOut.delay}ms`,
|
|
71
|
+
}
|
|
72
|
+
: null),
|
|
73
|
+
...styles.thumbnail,
|
|
74
|
+
}, onClick: onClick }, slide && renderThumbnail({ slide, render, rect, imageFit })));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function isHorizontal(position) {
|
|
78
|
+
return ["top", "bottom"].includes(position);
|
|
79
|
+
}
|
|
80
|
+
function boxSize(thumbnails, dimension, includeGap) {
|
|
81
|
+
return dimension + 2 * (thumbnails.border + thumbnails.padding) + (includeGap ? thumbnails.gap : 0);
|
|
82
|
+
}
|
|
83
|
+
function ThumbnailsTrack({ containerRef }) {
|
|
84
|
+
const track = React.useRef(null);
|
|
85
|
+
const { visible } = useThumbnails();
|
|
86
|
+
const { carousel, styles } = useLightboxProps();
|
|
87
|
+
const { slides, globalIndex, animation } = useLightboxState();
|
|
88
|
+
const { publish, subscribe } = useEvents();
|
|
89
|
+
const isRTL = useRTL();
|
|
90
|
+
const thumbnails = useThumbnailsProps();
|
|
91
|
+
const { position, width, height, border, borderRadius, padding, gap, vignette } = thumbnails;
|
|
92
|
+
const index = globalIndex;
|
|
93
|
+
const animationDuration = (animation === null || animation === void 0 ? void 0 : animation.duration) || 0;
|
|
94
|
+
const offset = (animationDuration > 0 && (animation === null || animation === void 0 ? void 0 : animation.increment)) || 0;
|
|
95
|
+
const { prepareAnimation } = useAnimation(track, (snapshot) => ({
|
|
96
|
+
keyframes: isHorizontal(position)
|
|
97
|
+
? [
|
|
98
|
+
{
|
|
99
|
+
transform: `translateX(${(isRTL ? -1 : 1) * boxSize(thumbnails, width, true) * offset + snapshot}px)`,
|
|
100
|
+
},
|
|
101
|
+
{ transform: "translateX(0)" },
|
|
102
|
+
]
|
|
103
|
+
: [
|
|
104
|
+
{
|
|
105
|
+
transform: `translateY(${boxSize(thumbnails, height, true) * offset + snapshot}px)`,
|
|
106
|
+
},
|
|
107
|
+
{ transform: "translateY(0)" },
|
|
108
|
+
],
|
|
109
|
+
duration: animationDuration,
|
|
110
|
+
easing: animation === null || animation === void 0 ? void 0 : animation.easing,
|
|
111
|
+
}));
|
|
112
|
+
const handleControllerSwipe = useEventCallback(() => {
|
|
113
|
+
let animationOffset = 0;
|
|
114
|
+
if (containerRef.current && track.current) {
|
|
115
|
+
const containerRect = containerRef.current.getBoundingClientRect();
|
|
116
|
+
const trackRect = track.current.getBoundingClientRect();
|
|
117
|
+
animationOffset = isHorizontal(position)
|
|
118
|
+
? trackRect.left - containerRect.left - (containerRect.width - trackRect.width) / 2
|
|
119
|
+
: trackRect.top - containerRect.top - (containerRect.height - trackRect.height) / 2;
|
|
120
|
+
}
|
|
121
|
+
prepareAnimation(animationOffset);
|
|
122
|
+
});
|
|
123
|
+
React.useEffect(() => cleanup(subscribe(ACTION_SWIPE, handleControllerSwipe)), [subscribe, handleControllerSwipe]);
|
|
124
|
+
const { finite } = carousel;
|
|
125
|
+
const preload = Math.max(Math.min(carousel.preload, slides.length - 1), 0);
|
|
126
|
+
const items = [];
|
|
127
|
+
if (hasSlides(slides)) {
|
|
128
|
+
if (offset < 0) {
|
|
129
|
+
for (let i = index - preload + offset; i < index - preload; i += 1) {
|
|
130
|
+
items.push({ slide: null, index: i, placeholder: true });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
for (let i = index - preload - (offset > 0 ? offset : 0); i < index; i += 1) {
|
|
134
|
+
if (!(finite && i < 0)) {
|
|
135
|
+
items.push({ slide: getSlide(slides, i), index: i });
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
items.push({ slide: null, index: i, placeholder: true });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
items.push({ slide: getSlide(slides, index), index });
|
|
142
|
+
for (let i = index + 1; i <= index + preload - (offset < 0 ? offset : 0); i += 1) {
|
|
143
|
+
if (!finite || i <= slides.length - 1) {
|
|
144
|
+
items.push({ slide: getSlide(slides, i), index: i });
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
items.push({ slide: null, index: i, placeholder: true });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (offset > 0) {
|
|
151
|
+
for (let i = index + preload + 1; i <= index + preload + offset; i += 1) {
|
|
152
|
+
items.push({ slide: null, index: i, placeholder: true });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const handleClick = (slideIndex) => () => {
|
|
157
|
+
if (slideIndex > index) {
|
|
158
|
+
publish(ACTION_NEXT, { count: slideIndex - index });
|
|
159
|
+
}
|
|
160
|
+
else if (slideIndex < index) {
|
|
161
|
+
publish(ACTION_PREV, { count: index - slideIndex });
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
return (React.createElement("div", { className: clsx(cssClass(cssPrefix("container")), cssClass(CLASS_FLEX_CENTER)), style: {
|
|
165
|
+
...(!visible ? { display: "none" } : null),
|
|
166
|
+
...(width !== defaultThumbnailsProps.width
|
|
167
|
+
? { [cssVar(cssThumbnailPrefix("width"))]: `${boxSize(thumbnails, width)}px` }
|
|
168
|
+
: null),
|
|
169
|
+
...(height !== defaultThumbnailsProps.height
|
|
170
|
+
? { [cssVar(cssThumbnailPrefix("height"))]: `${boxSize(thumbnails, height)}px` }
|
|
171
|
+
: null),
|
|
172
|
+
...(border !== defaultThumbnailsProps.border
|
|
173
|
+
? { [cssVar(cssThumbnailPrefix("border"))]: `${border}px` }
|
|
174
|
+
: null),
|
|
175
|
+
...(borderRadius !== defaultThumbnailsProps.borderRadius
|
|
176
|
+
? { [cssVar(cssThumbnailPrefix("border_radius"))]: `${borderRadius}px` }
|
|
177
|
+
: null),
|
|
178
|
+
...(padding !== defaultThumbnailsProps.padding
|
|
179
|
+
? { [cssVar(cssThumbnailPrefix("padding"))]: `${padding}px` }
|
|
180
|
+
: null),
|
|
181
|
+
...(gap !== defaultThumbnailsProps.gap ? { [cssVar(cssThumbnailPrefix("gap"))]: `${gap}px` } : null),
|
|
182
|
+
...styles.thumbnailsContainer,
|
|
183
|
+
} },
|
|
184
|
+
React.createElement("nav", { ref: track, style: styles.thumbnailsTrack, className: clsx(cssClass(cssPrefix("track")), cssClass(CLASS_FLEX_CENTER)) }, items.map(({ slide, index: slideIndex, placeholder }) => {
|
|
185
|
+
const fadeAnimationDuration = animationDuration / Math.abs(offset || 1);
|
|
186
|
+
const fadeIn = (offset > 0 && slideIndex > index + preload - offset && slideIndex <= index + preload) ||
|
|
187
|
+
(offset < 0 && slideIndex < index - preload - offset && slideIndex >= index - preload)
|
|
188
|
+
? {
|
|
189
|
+
duration: fadeAnimationDuration,
|
|
190
|
+
delay: ((offset > 0
|
|
191
|
+
? slideIndex - (index + preload - offset)
|
|
192
|
+
: index - preload - offset - slideIndex) -
|
|
193
|
+
1) *
|
|
194
|
+
fadeAnimationDuration,
|
|
195
|
+
}
|
|
196
|
+
: undefined;
|
|
197
|
+
const fadeOut = (offset > 0 && slideIndex < index - preload) || (offset < 0 && slideIndex > index + preload)
|
|
198
|
+
? {
|
|
199
|
+
duration: fadeAnimationDuration,
|
|
200
|
+
delay: (offset > 0
|
|
201
|
+
? offset - (index - preload - slideIndex)
|
|
202
|
+
: -offset - (slideIndex - (index + preload))) * fadeAnimationDuration,
|
|
203
|
+
}
|
|
204
|
+
: undefined;
|
|
205
|
+
return (React.createElement(Thumbnail, { key: slideIndex, slide: slide, active: slideIndex === index, fadeIn: fadeIn, fadeOut: fadeOut, placeholder: Boolean(placeholder), onClick: handleClick(slideIndex) }));
|
|
206
|
+
})),
|
|
207
|
+
vignette && React.createElement("div", { className: cssClass(cssPrefix("vignette")) })));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const ThumbnailsContext = React.createContext(null);
|
|
211
|
+
const useThumbnails = makeUseContext("useThumbnails", "ThumbnailsContext", ThumbnailsContext);
|
|
212
|
+
function ThumbnailsContextProvider({ children, ...props }) {
|
|
213
|
+
const [visible, setVisible] = React.useState(true);
|
|
214
|
+
const containerRef = React.useRef(null);
|
|
215
|
+
const { ref, position } = resolveThumbnailsProps(props.thumbnails);
|
|
216
|
+
const context = React.useMemo(() => ({
|
|
217
|
+
visible,
|
|
218
|
+
show: () => setVisible(true),
|
|
219
|
+
hide: () => setVisible(false),
|
|
220
|
+
}), [visible]);
|
|
221
|
+
React.useImperativeHandle(ref, () => context, [context]);
|
|
222
|
+
return (React.createElement(LightboxPropsProvider, { ...props },
|
|
223
|
+
React.createElement(ThumbnailsContext.Provider, { value: context },
|
|
224
|
+
React.createElement("div", { ref: containerRef, className: clsx(cssClass(cssPrefix()), cssClass(cssPrefix(`${position}`))) },
|
|
225
|
+
["start", "top"].includes(position) && React.createElement(ThumbnailsTrack, { containerRef: containerRef }),
|
|
226
|
+
React.createElement("div", { className: cssClass(cssPrefix("wrapper")) }, children),
|
|
227
|
+
["end", "bottom"].includes(position) && React.createElement(ThumbnailsTrack, { containerRef: containerRef })))));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const thumbnailsIcon = () => (React.createElement(React.Fragment, null,
|
|
231
|
+
React.createElement("path", { strokeWidth: 2, stroke: "currentColor", strokeLinejoin: "round", fill: "none", d: "M3 5l18 0l0 14l-18 0l0-14z" }),
|
|
232
|
+
React.createElement("path", { d: "M5 14h4v3h-4zM10 14h4v3h-4zM15 14h4v3h-4z" })));
|
|
233
|
+
const ThumbnailsVisible = createIcon("ThumbnailsVisible", thumbnailsIcon());
|
|
234
|
+
const ThumbnailsHidden = createIconDisabled("ThumbnailsHidden", thumbnailsIcon());
|
|
235
|
+
function ThumbnailsButton() {
|
|
236
|
+
const { visible, show, hide } = useThumbnails();
|
|
237
|
+
const { render } = useLightboxProps();
|
|
238
|
+
if (render.buttonThumbnails) {
|
|
239
|
+
return React.createElement(React.Fragment, null, render.buttonThumbnails({ visible, show, hide }));
|
|
240
|
+
}
|
|
241
|
+
return (React.createElement(IconButton, { label: visible ? "Hide thumbnails" : "Show thumbnails", icon: visible ? ThumbnailsVisible : ThumbnailsHidden, renderIcon: visible ? render.iconThumbnailsVisible : render.iconThumbnailsHidden, onClick: visible ? hide : show }));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function Thumbnails({ augment, contains, append, addParent }) {
|
|
245
|
+
augment(({ thumbnails: thumbnailsProps, toolbar, ...restProps }) => {
|
|
246
|
+
const thumbnails = resolveThumbnailsProps(thumbnailsProps);
|
|
247
|
+
return {
|
|
248
|
+
toolbar: addToolbarButton(toolbar, PLUGIN_THUMBNAILS, thumbnails.showToggle ? React.createElement(ThumbnailsButton, null) : null),
|
|
249
|
+
thumbnails,
|
|
250
|
+
...restProps,
|
|
251
|
+
};
|
|
252
|
+
});
|
|
253
|
+
const module = createModule(PLUGIN_THUMBNAILS, ThumbnailsContextProvider);
|
|
254
|
+
if (contains(PLUGIN_FULLSCREEN)) {
|
|
255
|
+
append(PLUGIN_FULLSCREEN, module);
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
addParent(MODULE_CONTROLLER, module);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export { Thumbnails as default };
|
|
@@ -1,139 +1 @@
|
|
|
1
|
-
.yarl__thumbnails {
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100%;
|
|
4
|
-
}
|
|
5
|
-
.yarl__thumbnails_top, .yarl__thumbnails_bottom {
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
}
|
|
8
|
-
.yarl__thumbnails_start .yarl__thumbnails_track, .yarl__thumbnails_end .yarl__thumbnails_track {
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
}
|
|
11
|
-
.yarl__thumbnails_wrapper {
|
|
12
|
-
flex: 1;
|
|
13
|
-
position: relative;
|
|
14
|
-
}
|
|
15
|
-
.yarl__thumbnails_container {
|
|
16
|
-
flex: 0 0 auto;
|
|
17
|
-
background-color: var(--yarl__thumbnails_container_background_color, var(--yarl__color_backdrop, #000));
|
|
18
|
-
padding: var(--yarl__thumbnails_container_padding, 16px);
|
|
19
|
-
position: relative;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
-webkit-user-select: none;
|
|
22
|
-
-moz-user-select: none;
|
|
23
|
-
user-select: none;
|
|
24
|
-
-webkit-touch-callout: none;
|
|
25
|
-
}
|
|
26
|
-
.yarl__thumbnails_vignette {
|
|
27
|
-
position: absolute;
|
|
28
|
-
pointer-events: none;
|
|
29
|
-
--yarl__thumbnails_vignette_size: 12%;
|
|
30
|
-
}
|
|
31
|
-
@media (min-width: 1200px) {
|
|
32
|
-
.yarl__thumbnails_vignette {
|
|
33
|
-
--yarl__thumbnails_vignette_size: 8%;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
@media (min-width: 2000px) {
|
|
37
|
-
.yarl__thumbnails_vignette {
|
|
38
|
-
--yarl__thumbnails_vignette_size: 5%;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
.yarl__thumbnails_top .yarl__thumbnails_vignette, .yarl__thumbnails_bottom .yarl__thumbnails_vignette {
|
|
42
|
-
height: 100%;
|
|
43
|
-
left: 0;
|
|
44
|
-
right: 0;
|
|
45
|
-
background: linear-gradient(to right, var(--yarl__color_backdrop, #000) 0px, transparent var(--yarl__thumbnails_vignette_size, 12%) calc(100% - var(--yarl__thumbnails_vignette_size, 12%)), var(--yarl__color_backdrop, #000) 100%);
|
|
46
|
-
}
|
|
47
|
-
.yarl__thumbnails_start .yarl__thumbnails_vignette, .yarl__thumbnails_end .yarl__thumbnails_vignette {
|
|
48
|
-
width: 100%;
|
|
49
|
-
top: 0;
|
|
50
|
-
bottom: 0;
|
|
51
|
-
background: linear-gradient(to bottom, var(--yarl__color_backdrop, #000) 0px, transparent var(--yarl__thumbnails_vignette_size, 12%) calc(100% - var(--yarl__thumbnails_vignette_size, 12%)), var(--yarl__color_backdrop, #000) 100%);
|
|
52
|
-
}
|
|
53
|
-
.yarl__thumbnails_track {
|
|
54
|
-
gap: var(--yarl__thumbnails_thumbnail_gap, 16px);
|
|
55
|
-
}
|
|
56
|
-
.yarl__thumbnails_thumbnail {
|
|
57
|
-
flex: 0 0 auto;
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
-webkit-appearance: none;
|
|
60
|
-
-moz-appearance: none;
|
|
61
|
-
appearance: none;
|
|
62
|
-
background: var(--yarl__thumbnails_thumbnail_background, #000);
|
|
63
|
-
border: var(--yarl__thumbnails_thumbnail_border, 1px solid var(--yarl__color_button, rgba(255, 255, 255, 0.8)));
|
|
64
|
-
border-radius: var(--yarl__thumbnails_thumbnail_border_radius, 4px);
|
|
65
|
-
-webkit-tap-highlight-color: transparent;
|
|
66
|
-
position: relative;
|
|
67
|
-
overflow: hidden;
|
|
68
|
-
padding: var(--yarl__thumbnails_thumbnail_padding, 4px);
|
|
69
|
-
width: var(--yarl__thumbnails_thumbnail_width, 120px);
|
|
70
|
-
height: var(--yarl__thumbnails_thumbnail_height, 80px);
|
|
71
|
-
box-sizing: content-box;
|
|
72
|
-
}
|
|
73
|
-
.yarl__thumbnails_thumbnail_active {
|
|
74
|
-
border-color: var(--yarl__thumbnails_thumbnail_active_border_color, var(--yarl__color_button_active, #fff));
|
|
75
|
-
}
|
|
76
|
-
.yarl__thumbnails_thumbnail_fadein {
|
|
77
|
-
opacity: 0;
|
|
78
|
-
-webkit-animation: yarl__thumbnails_thumbnail_fadein var(--yarl__thumbnails_thumbnail_fadein_duration, 0.5s) ease-in-out var(--yarl__thumbnails_thumbnail_fadein_delay, 0s) forwards;
|
|
79
|
-
animation: yarl__thumbnails_thumbnail_fadein var(--yarl__thumbnails_thumbnail_fadein_duration, 0.5s) ease-in-out var(--yarl__thumbnails_thumbnail_fadein_delay, 0s) forwards;
|
|
80
|
-
}
|
|
81
|
-
.yarl__thumbnails_thumbnail_fadeout {
|
|
82
|
-
-webkit-animation: yarl__thumbnails_thumbnail_fadeout var(--yarl__thumbnails_thumbnail_fadeout_duration, 0.5s) ease-in-out var(--yarl__thumbnails_thumbnail_fadeout_delay, 0s) forwards;
|
|
83
|
-
animation: yarl__thumbnails_thumbnail_fadeout var(--yarl__thumbnails_thumbnail_fadeout_duration, 0.5s) ease-in-out var(--yarl__thumbnails_thumbnail_fadeout_delay, 0s) forwards;
|
|
84
|
-
cursor: unset;
|
|
85
|
-
}
|
|
86
|
-
.yarl__thumbnails_thumbnail_placeholder {
|
|
87
|
-
visibility: hidden;
|
|
88
|
-
cursor: unset;
|
|
89
|
-
}
|
|
90
|
-
.yarl__thumbnails_thumbnail_icon {
|
|
91
|
-
color: var(--yarl__thumbnails_thumbnail_icon_color, var(--yarl__color_button, rgba(255, 255, 255, 0.8)));
|
|
92
|
-
-webkit-filter: var(--yarl__thumbnails_thumbnail_icon_filter, drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.8)));
|
|
93
|
-
filter: var(--yarl__thumbnails_thumbnail_icon_filter, drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.8)));
|
|
94
|
-
position: absolute;
|
|
95
|
-
top: 50%;
|
|
96
|
-
left: 50%;
|
|
97
|
-
-webkit-transform: translateX(-50%) translateY(-50%);
|
|
98
|
-
transform: translateX(-50%) translateY(-50%);
|
|
99
|
-
width: var(--yarl__thumbnails_thumbnail_icon_size, 32px);
|
|
100
|
-
height: var(--yarl__thumbnails_thumbnail_icon_size, 32px);
|
|
101
|
-
}
|
|
102
|
-
.yarl__thumbnails_contain_image {
|
|
103
|
-
-o-object-fit: contain;
|
|
104
|
-
object-fit: contain;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
@-webkit-keyframes yarl__thumbnails_thumbnail_fadein {
|
|
108
|
-
from {
|
|
109
|
-
opacity: 0;
|
|
110
|
-
}
|
|
111
|
-
to {
|
|
112
|
-
opacity: 1;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@keyframes yarl__thumbnails_thumbnail_fadein {
|
|
117
|
-
from {
|
|
118
|
-
opacity: 0;
|
|
119
|
-
}
|
|
120
|
-
to {
|
|
121
|
-
opacity: 1;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
@-webkit-keyframes yarl__thumbnails_thumbnail_fadeout {
|
|
125
|
-
from {
|
|
126
|
-
opacity: 1;
|
|
127
|
-
}
|
|
128
|
-
to {
|
|
129
|
-
opacity: 0;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
@keyframes yarl__thumbnails_thumbnail_fadeout {
|
|
133
|
-
from {
|
|
134
|
-
opacity: 1;
|
|
135
|
-
}
|
|
136
|
-
to {
|
|
137
|
-
opacity: 0;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
1
|
+
.yarl__thumbnails{display:flex;height:100%}.yarl__thumbnails_bottom,.yarl__thumbnails_end .yarl__thumbnails_track,.yarl__thumbnails_start .yarl__thumbnails_track,.yarl__thumbnails_top{flex-direction:column}.yarl__thumbnails_wrapper{flex:1;position:relative}.yarl__thumbnails_container{-webkit-touch-callout:none;background-color:var(--yarl__thumbnails_container_background_color,var(--yarl__color_backdrop,#000));flex:0 0 auto;overflow:hidden;padding:var(--yarl__thumbnails_container_padding,16px);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.yarl__thumbnails_vignette{--yarl__thumbnails_vignette_size:12%;pointer-events:none;position:absolute}@media (min-width:1200px){.yarl__thumbnails_vignette{--yarl__thumbnails_vignette_size:8%}}@media (min-width:2000px){.yarl__thumbnails_vignette{--yarl__thumbnails_vignette_size:5%}}.yarl__thumbnails_bottom .yarl__thumbnails_vignette,.yarl__thumbnails_top .yarl__thumbnails_vignette{background:linear-gradient(to right,var(--yarl__color_backdrop,#000) 0,transparent var(--yarl__thumbnails_vignette_size,12%) calc(100% - var(--yarl__thumbnails_vignette_size, 12%)),var(--yarl__color_backdrop,#000) 100%);height:100%;left:0;right:0}.yarl__thumbnails_end .yarl__thumbnails_vignette,.yarl__thumbnails_start .yarl__thumbnails_vignette{background:linear-gradient(to bottom,var(--yarl__color_backdrop,#000) 0,transparent var(--yarl__thumbnails_vignette_size,12%) calc(100% - var(--yarl__thumbnails_vignette_size, 12%)),var(--yarl__color_backdrop,#000) 100%);bottom:0;top:0;width:100%}.yarl__thumbnails_track{gap:var(--yarl__thumbnails_thumbnail_gap,16px)}.yarl__thumbnails_thumbnail{-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--yarl__thumbnails_thumbnail_background,#000);border:var(--yarl__thumbnails_thumbnail_border,1px solid var(--yarl__color_button,hsla(0,0%,100%,.8)));border-radius:var(--yarl__thumbnails_thumbnail_border_radius,4px);box-sizing:content-box;cursor:pointer;flex:0 0 auto;height:var(--yarl__thumbnails_thumbnail_height,80px);overflow:hidden;padding:var(--yarl__thumbnails_thumbnail_padding,4px);position:relative;width:var(--yarl__thumbnails_thumbnail_width,120px)}.yarl__thumbnails_thumbnail_active{border-color:var(--yarl__thumbnails_thumbnail_active_border_color,var(--yarl__color_button_active,#fff))}.yarl__thumbnails_thumbnail_fadein{-webkit-animation:yarl__thumbnails_thumbnail_fadein var(--yarl__thumbnails_thumbnail_fadein_duration,.5s) ease-in-out var(--yarl__thumbnails_thumbnail_fadein_delay,0s) forwards;animation:yarl__thumbnails_thumbnail_fadein var(--yarl__thumbnails_thumbnail_fadein_duration,.5s) ease-in-out var(--yarl__thumbnails_thumbnail_fadein_delay,0s) forwards;opacity:0}.yarl__thumbnails_thumbnail_fadeout{-webkit-animation:yarl__thumbnails_thumbnail_fadeout var(--yarl__thumbnails_thumbnail_fadeout_duration,.5s) ease-in-out var(--yarl__thumbnails_thumbnail_fadeout_delay,0s) forwards;animation:yarl__thumbnails_thumbnail_fadeout var(--yarl__thumbnails_thumbnail_fadeout_duration,.5s) ease-in-out var(--yarl__thumbnails_thumbnail_fadeout_delay,0s) forwards;cursor:unset}.yarl__thumbnails_thumbnail_placeholder{cursor:unset;visibility:hidden}.yarl__thumbnails_thumbnail_icon{color:var(--yarl__thumbnails_thumbnail_icon_color,var(--yarl__color_button,hsla(0,0%,100%,.8)));-webkit-filter:var(--yarl__thumbnails_thumbnail_icon_filter,drop-shadow(2px 2px 2px rgba(0,0,0,.8)));filter:var(--yarl__thumbnails_thumbnail_icon_filter,drop-shadow(2px 2px 2px rgba(0,0,0,.8)));height:var(--yarl__thumbnails_thumbnail_icon_size,32px);left:50%;position:absolute;top:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);width:var(--yarl__thumbnails_thumbnail_icon_size,32px)}.yarl__thumbnails_contain_image{-o-object-fit:contain;object-fit:contain}@-webkit-keyframes yarl__thumbnails_thumbnail_fadein{0%{opacity:0}to{opacity:1}}@keyframes yarl__thumbnails_thumbnail_fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes yarl__thumbnails_thumbnail_fadeout{0%{opacity:1}to{opacity:0}}@keyframes yarl__thumbnails_thumbnail_fadeout{0%{opacity:1}to{opacity:0}}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginProps } from '../../types.js';
|
|
2
|
+
|
|
3
|
+
/** Video plugin */
|
|
4
|
+
declare function Video({ augment }: PluginProps): void;
|
|
5
|
+
|
|
2
6
|
declare module "../../types.js" {
|
|
3
7
|
interface SlideTypes {
|
|
4
8
|
/** video slide type */
|
|
@@ -45,4 +49,5 @@ declare module "../../types.js" {
|
|
|
45
49
|
video?: Pick<SlideVideo, "autoPlay" | "controls" | "controlsList" | "crossOrigin" | "preload" | "loop" | "muted" | "playsInline" | "disablePictureInPicture" | "disableRemotePlayback">;
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
|
-
|
|
52
|
+
|
|
53
|
+
export { Video as default };
|