yet-another-react-lightbox 2.5.1 → 2.6.1
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 +4 -8
- package/dist/Lightbox.d.ts +2 -2
- package/dist/Lightbox.js +11 -9
- package/dist/core/components/Icons.d.ts +1 -1
- package/dist/core/components/Icons.js +2 -2
- package/dist/core/components/ImageSlide.d.ts +1 -1
- package/dist/core/components/ImageSlide.js +2 -2
- package/dist/core/contexts/Events.d.ts +1 -1
- package/dist/core/contexts/Events.js +2 -2
- package/dist/core/contexts/LightboxState.d.ts +3 -3
- package/dist/core/contexts/LightboxState.js +2 -2
- package/dist/core/contexts/Timeouts.d.ts +1 -1
- package/dist/core/contexts/Timeouts.js +2 -2
- package/dist/core/hooks/useAnimation.d.ts +4 -2
- package/dist/core/hooks/useAnimation.js +6 -6
- package/dist/core/hooks/useContainerRect.d.ts +1 -1
- package/dist/core/hooks/useContainerRect.js +2 -2
- package/dist/core/hooks/useDelay.d.ts +1 -1
- package/dist/core/hooks/useDelay.js +2 -2
- package/dist/core/hooks/useEventCallback.d.ts +1 -1
- package/dist/core/hooks/useEventCallback.js +2 -2
- package/dist/core/hooks/useForkRef.d.ts +2 -2
- package/dist/core/hooks/useForkRef.js +10 -8
- package/dist/core/hooks/useLoseFocus.d.ts +1 -1
- package/dist/core/hooks/useLoseFocus.js +2 -2
- package/dist/core/hooks/useMotionPreference.d.ts +1 -1
- package/dist/core/hooks/useMotionPreference.js +2 -2
- package/dist/core/hooks/useRTL.d.ts +1 -1
- package/dist/core/hooks/useRTL.js +2 -2
- package/dist/core/hooks/useSensors.d.ts +1 -1
- package/dist/core/hooks/useSensors.js +2 -2
- package/dist/core/hooks/useThrottle.d.ts +1 -1
- package/dist/core/hooks/useThrottle.js +2 -2
- package/dist/core/modules/Carousel.d.ts +3 -2
- package/dist/core/modules/Carousel.js +25 -15
- package/dist/core/modules/Controller.d.ts +2 -2
- package/dist/core/modules/Controller.js +13 -11
- package/dist/core/modules/Core.d.ts +3 -2
- package/dist/core/modules/Core.js +5 -3
- package/dist/core/modules/Navigation.d.ts +3 -3
- package/dist/core/modules/Navigation.js +7 -5
- package/dist/core/modules/NoScroll.d.ts +3 -2
- package/dist/core/modules/NoScroll.js +7 -5
- package/dist/core/modules/Portal.d.ts +3 -2
- package/dist/core/modules/Portal.js +15 -12
- package/dist/core/modules/Toolbar.d.ts +3 -2
- package/dist/core/modules/Toolbar.js +5 -3
- package/dist/core/modules/controller/usePointerSwipe.d.ts +1 -1
- package/dist/core/modules/controller/usePointerSwipe.js +2 -2
- package/dist/core/modules/controller/usePreventSwipeNavigation.d.ts +1 -1
- package/dist/core/modules/controller/usePreventSwipeNavigation.js +4 -4
- package/dist/core/modules/controller/useWheelSwipe.d.ts +1 -1
- package/dist/core/modules/controller/useWheelSwipe.js +2 -2
- package/dist/core/utils.d.ts +6 -1
- package/dist/core/utils.js +7 -3
- package/dist/plugins/captions/CaptionsContext.d.ts +2 -3
- package/dist/plugins/captions/CaptionsContext.js +2 -2
- package/dist/plugins/captions/Description.d.ts +3 -4
- package/dist/plugins/captions/Description.js +17 -13
- package/dist/plugins/captions/Title.d.ts +3 -4
- package/dist/plugins/captions/Title.js +2 -2
- package/dist/plugins/captions/utils.d.ts +1 -1
- package/dist/plugins/captions/utils.js +3 -1
- package/dist/plugins/fullscreen/FullscreenButton.d.ts +2 -2
- package/dist/plugins/fullscreen/FullscreenButton.js +2 -2
- package/dist/plugins/fullscreen/FullscreenContext.d.ts +4 -4
- package/dist/plugins/fullscreen/FullscreenContext.js +2 -2
- package/dist/plugins/fullscreen/index.d.ts +9 -8
- package/dist/plugins/inline/Inline.js +3 -1
- package/dist/plugins/slideshow/SlideshowButton.d.ts +2 -2
- package/dist/plugins/slideshow/SlideshowButton.js +2 -2
- package/dist/plugins/slideshow/SlideshowContext.d.ts +4 -4
- package/dist/plugins/slideshow/SlideshowContext.js +2 -2
- package/dist/plugins/slideshow/index.d.ts +12 -11
- package/dist/plugins/thumbnails/Thumbnail.d.ts +3 -4
- package/dist/plugins/thumbnails/Thumbnail.js +19 -17
- package/dist/plugins/thumbnails/ThumbnailsContainer.d.ts +3 -2
- package/dist/plugins/thumbnails/ThumbnailsContainer.js +2 -2
- package/dist/plugins/thumbnails/ThumbnailsTrack.d.ts +3 -4
- package/dist/plugins/thumbnails/ThumbnailsTrack.js +9 -4
- package/dist/plugins/thumbnails/index.d.ts +9 -7
- package/dist/plugins/video/VideoSlide.d.ts +3 -4
- package/dist/plugins/video/VideoSlide.js +2 -2
- package/dist/plugins/zoom/ResponsiveImage.d.ts +5 -6
- package/dist/plugins/zoom/ResponsiveImage.js +6 -3
- package/dist/plugins/zoom/ZoomButtonsGroup.d.ts +2 -2
- package/dist/plugins/zoom/ZoomButtonsGroup.js +2 -2
- package/dist/plugins/zoom/ZoomContainer.d.ts +5 -4
- package/dist/plugins/zoom/ZoomContainer.js +10 -10
- package/dist/plugins/zoom/ZoomContext.d.ts +4 -4
- package/dist/plugins/zoom/ZoomContext.js +2 -2
- package/dist/plugins/zoom/index.d.ts +12 -13
- package/dist/props.d.ts +4 -0
- package/dist/props.js +5 -4
- package/dist/styles.css +1 -0
- package/dist/types.d.ts +46 -26
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -78,13 +78,22 @@ export interface CarouselSettings {
|
|
|
78
78
|
}
|
|
79
79
|
/** Animation settings */
|
|
80
80
|
export interface AnimationSettings {
|
|
81
|
-
/** fade-in / fade-out animation
|
|
82
|
-
fade:
|
|
83
|
-
/** swipe animation
|
|
84
|
-
swipe:
|
|
85
|
-
/** override for `swipe` animation
|
|
86
|
-
navigation?:
|
|
81
|
+
/** fade-in / fade-out animation settings */
|
|
82
|
+
fade: AnimationSpec;
|
|
83
|
+
/** swipe animation settings */
|
|
84
|
+
swipe: AnimationSpec;
|
|
85
|
+
/** override for `swipe` animation settings when using keyboard navigation or navigation buttons */
|
|
86
|
+
navigation?: AnimationSpec;
|
|
87
87
|
}
|
|
88
|
+
/** Animation duration or animation settings */
|
|
89
|
+
export type AnimationSpec = {
|
|
90
|
+
/** animation duration */
|
|
91
|
+
duration?: number;
|
|
92
|
+
/** animation easing function */
|
|
93
|
+
easing?: string;
|
|
94
|
+
}
|
|
95
|
+
/** animation duration */
|
|
96
|
+
| number;
|
|
88
97
|
/** Controller settings */
|
|
89
98
|
export interface ControllerSettings {
|
|
90
99
|
/** if true, the lightbox captures focus when it opens */
|
|
@@ -96,38 +105,49 @@ export interface ControllerSettings {
|
|
|
96
105
|
/** if `true`, close the lightbox when the backdrop is clicked */
|
|
97
106
|
closeOnBackdropClick: boolean;
|
|
98
107
|
}
|
|
99
|
-
/**
|
|
100
|
-
export
|
|
101
|
-
|
|
102
|
-
|
|
108
|
+
/** Render function */
|
|
109
|
+
export type RenderFunction<T = void> = (props: T) => React.ReactNode;
|
|
110
|
+
/** `render.slide` render function props */
|
|
111
|
+
export type RenderSlideProps = [
|
|
103
112
|
/** slide */
|
|
104
|
-
slide: Slide,
|
|
113
|
+
slide: Slide,
|
|
105
114
|
/** slide offset (`0` - current slide, `1` - next slide, `-1` - previous slide, etc.) */
|
|
106
|
-
offset: number,
|
|
115
|
+
offset: number,
|
|
107
116
|
/** container rect */
|
|
108
|
-
rect: ContainerRect
|
|
117
|
+
rect: ContainerRect
|
|
118
|
+
];
|
|
119
|
+
/** `render.slideHeader` render function props */
|
|
120
|
+
export type RenderSlideHeaderProps = [slide: Slide];
|
|
121
|
+
/** `render.slideFooter` render function props */
|
|
122
|
+
export type RenderSlideFooterProps = [slide: Slide];
|
|
123
|
+
/** `render.slideContainer` render function props */
|
|
124
|
+
export type RenderSlideContainerProps = [slide: Slide, children: React.ReactNode];
|
|
125
|
+
/** Custom render functions. */
|
|
126
|
+
export interface Render {
|
|
127
|
+
/** render custom slide type, or override the default image slide */
|
|
128
|
+
slide?: (...props: RenderSlideProps) => React.ReactNode;
|
|
109
129
|
/** render custom slide header */
|
|
110
|
-
slideHeader?: (
|
|
130
|
+
slideHeader?: (...props: RenderSlideHeaderProps) => React.ReactNode;
|
|
111
131
|
/** render custom slide footer */
|
|
112
|
-
slideFooter?: (
|
|
132
|
+
slideFooter?: (...props: RenderSlideFooterProps) => React.ReactNode;
|
|
113
133
|
/** render custom slide container */
|
|
114
|
-
slideContainer?: (
|
|
134
|
+
slideContainer?: (...props: RenderSlideContainerProps) => React.ReactNode;
|
|
115
135
|
/** render custom Prev icon */
|
|
116
|
-
iconPrev?:
|
|
136
|
+
iconPrev?: RenderFunction;
|
|
117
137
|
/** render custom Next icon */
|
|
118
|
-
iconNext?:
|
|
138
|
+
iconNext?: RenderFunction;
|
|
119
139
|
/** render custom Close icon */
|
|
120
|
-
iconClose?:
|
|
140
|
+
iconClose?: RenderFunction;
|
|
121
141
|
/** render custom Loading icon */
|
|
122
|
-
iconLoading?:
|
|
142
|
+
iconLoading?: RenderFunction;
|
|
123
143
|
/** render custom Error icon */
|
|
124
|
-
iconError?:
|
|
144
|
+
iconError?: RenderFunction;
|
|
125
145
|
/** render custom Prev button */
|
|
126
|
-
buttonPrev?:
|
|
146
|
+
buttonPrev?: RenderFunction;
|
|
127
147
|
/** render custom Next button */
|
|
128
|
-
buttonNext?:
|
|
148
|
+
buttonNext?: RenderFunction;
|
|
129
149
|
/** render custom Close button */
|
|
130
|
-
buttonClose?:
|
|
150
|
+
buttonClose?: RenderFunction;
|
|
131
151
|
}
|
|
132
152
|
/** Lifecycle callbacks */
|
|
133
153
|
export interface Callbacks {
|
|
@@ -188,9 +208,9 @@ export interface ToolbarSettings {
|
|
|
188
208
|
buttons: ("close" | React.ReactNode)[];
|
|
189
209
|
}
|
|
190
210
|
/** Lightbox component properties */
|
|
191
|
-
export type ComponentProps = Omit<LightboxProps, "plugins"
|
|
211
|
+
export type ComponentProps = React.PropsWithChildren<Omit<LightboxProps, "plugins">>;
|
|
192
212
|
/** Lightbox component */
|
|
193
|
-
export type Component = React.ComponentType<
|
|
213
|
+
export type Component = React.ComponentType<ComponentProps>;
|
|
194
214
|
/** Lightbox module */
|
|
195
215
|
export type Module = {
|
|
196
216
|
/** module name */
|