yet-another-react-lightbox 3.5.4 → 3.7.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.
Files changed (204) hide show
  1. package/README.md +3 -3
  2. package/dist/index.d.ts +240 -4
  3. package/dist/index.js +1368 -4
  4. package/dist/plugins/captions/captions.css +1 -33
  5. package/dist/plugins/captions/captions.css.d.ts +2 -0
  6. package/dist/plugins/captions/index.d.ts +8 -4
  7. package/dist/plugins/captions/index.js +104 -3
  8. package/dist/plugins/counter/counter.css +1 -16
  9. package/dist/plugins/counter/counter.css.d.ts +2 -0
  10. package/dist/plugins/counter/index.d.ts +8 -3
  11. package/dist/plugins/counter/index.js +18 -2
  12. package/dist/plugins/download/index.d.ts +6 -3
  13. package/dist/plugins/download/index.js +90 -3
  14. package/dist/plugins/fullscreen/index.d.ts +8 -4
  15. package/dist/plugins/fullscreen/index.js +128 -3
  16. package/dist/plugins/index.d.ts +9 -9
  17. package/dist/plugins/index.js +9 -9
  18. package/dist/plugins/inline/index.d.ts +8 -3
  19. package/dist/plugins/inline/index.js +26 -2
  20. package/dist/plugins/slideshow/index.d.ts +8 -4
  21. package/dist/plugins/slideshow/index.js +113 -3
  22. package/dist/plugins/thumbnails/index.d.ts +7 -4
  23. package/dist/plugins/thumbnails/index.js +261 -3
  24. package/dist/plugins/thumbnails/thumbnails.css +1 -139
  25. package/dist/plugins/thumbnails/thumbnails.css.d.ts +2 -0
  26. package/dist/plugins/video/index.d.ts +7 -2
  27. package/dist/plugins/video/index.js +109 -2
  28. package/dist/plugins/zoom/index.d.ts +7 -4
  29. package/dist/plugins/zoom/index.js +500 -3
  30. package/dist/styles.css +1 -281
  31. package/dist/styles.css.d.ts +2 -0
  32. package/dist/types.d.ts +125 -47
  33. package/dist/types.js +51 -1
  34. package/package.json +34 -10
  35. package/dist/Lightbox.d.ts +0 -4
  36. package/dist/Lightbox.js +0 -46
  37. package/dist/core/components/IconButton.d.ts +0 -7
  38. package/dist/core/components/IconButton.js +0 -8
  39. package/dist/core/components/Icons.d.ts +0 -29
  40. package/dist/core/components/Icons.js +0 -27
  41. package/dist/core/components/ImageSlide.d.ts +0 -13
  42. package/dist/core/components/ImageSlide.js +0 -68
  43. package/dist/core/components/index.d.ts +0 -3
  44. package/dist/core/components/index.js +0 -3
  45. package/dist/core/config.d.ts +0 -7
  46. package/dist/core/config.js +0 -93
  47. package/dist/core/consts.d.ts +0 -50
  48. package/dist/core/consts.js +0 -49
  49. package/dist/core/contexts/Events.d.ts +0 -17
  50. package/dist/core/contexts/Events.js +0 -29
  51. package/dist/core/contexts/LightboxProps.d.ts +0 -6
  52. package/dist/core/contexts/LightboxProps.js +0 -7
  53. package/dist/core/contexts/LightboxState.d.ts +0 -27
  54. package/dist/core/contexts/LightboxState.js +0 -49
  55. package/dist/core/contexts/Timeouts.d.ts +0 -8
  56. package/dist/core/contexts/Timeouts.js +0 -32
  57. package/dist/core/contexts/index.d.ts +0 -4
  58. package/dist/core/contexts/index.js +0 -4
  59. package/dist/core/hooks/index.d.ts +0 -11
  60. package/dist/core/hooks/index.js +0 -11
  61. package/dist/core/hooks/useAnimation.d.ts +0 -15
  62. package/dist/core/hooks/useAnimation.js +0 -57
  63. package/dist/core/hooks/useContainerRect.d.ts +0 -7
  64. package/dist/core/hooks/useContainerRect.js +0 -36
  65. package/dist/core/hooks/useDelay.d.ts +0 -1
  66. package/dist/core/hooks/useDelay.js +0 -10
  67. package/dist/core/hooks/useEventCallback.d.ts +0 -1
  68. package/dist/core/hooks/useEventCallback.js +0 -9
  69. package/dist/core/hooks/useForkRef.d.ts +0 -3
  70. package/dist/core/hooks/useForkRef.js +0 -17
  71. package/dist/core/hooks/useLayoutEffect.d.ts +0 -2
  72. package/dist/core/hooks/useLayoutEffect.js +0 -3
  73. package/dist/core/hooks/useLoseFocus.d.ts +0 -4
  74. package/dist/core/hooks/useLoseFocus.js +0 -19
  75. package/dist/core/hooks/useMotionPreference.d.ts +0 -1
  76. package/dist/core/hooks/useMotionPreference.js +0 -13
  77. package/dist/core/hooks/useRTL.d.ts +0 -1
  78. package/dist/core/hooks/useRTL.js +0 -9
  79. package/dist/core/hooks/useSensors.d.ts +0 -14
  80. package/dist/core/hooks/useSensors.js +0 -38
  81. package/dist/core/hooks/useThrottle.d.ts +0 -1
  82. package/dist/core/hooks/useThrottle.js +0 -16
  83. package/dist/core/index.d.ts +0 -7
  84. package/dist/core/index.js +0 -7
  85. package/dist/core/modules/Carousel.d.ts +0 -4
  86. package/dist/core/modules/Carousel.js +0 -72
  87. package/dist/core/modules/Controller.d.ts +0 -31
  88. package/dist/core/modules/Controller.js +0 -215
  89. package/dist/core/modules/Navigation.d.ts +0 -13
  90. package/dist/core/modules/Navigation.js +0 -35
  91. package/dist/core/modules/NoScroll.d.ts +0 -4
  92. package/dist/core/modules/NoScroll.js +0 -52
  93. package/dist/core/modules/Portal.d.ts +0 -4
  94. package/dist/core/modules/Portal.js +0 -92
  95. package/dist/core/modules/Root.d.ts +0 -4
  96. package/dist/core/modules/Root.js +0 -7
  97. package/dist/core/modules/Toolbar.d.ts +0 -4
  98. package/dist/core/modules/Toolbar.js +0 -25
  99. package/dist/core/modules/controller/index.d.ts +0 -8
  100. package/dist/core/modules/controller/index.js +0 -9
  101. package/dist/core/modules/controller/usePointerSwipe.d.ts +0 -2
  102. package/dist/core/modules/controller/usePointerSwipe.js +0 -72
  103. package/dist/core/modules/controller/usePreventSwipeNavigation.d.ts +0 -3
  104. package/dist/core/modules/controller/usePreventSwipeNavigation.js +0 -20
  105. package/dist/core/modules/controller/useWheelSwipe.d.ts +0 -3
  106. package/dist/core/modules/controller/useWheelSwipe.js +0 -92
  107. package/dist/core/modules/index.d.ts +0 -7
  108. package/dist/core/modules/index.js +0 -7
  109. package/dist/core/utils.d.ts +0 -36
  110. package/dist/core/utils.js +0 -70
  111. package/dist/plugins/captions/Captions.d.ts +0 -3
  112. package/dist/plugins/captions/Captions.js +0 -25
  113. package/dist/plugins/captions/CaptionsButton.d.ts +0 -2
  114. package/dist/plugins/captions/CaptionsButton.js +0 -16
  115. package/dist/plugins/captions/CaptionsContext.d.ts +0 -5
  116. package/dist/plugins/captions/CaptionsContext.js +0 -16
  117. package/dist/plugins/captions/Description.d.ts +0 -4
  118. package/dist/plugins/captions/Description.js +0 -27
  119. package/dist/plugins/captions/Title.d.ts +0 -4
  120. package/dist/plugins/captions/Title.js +0 -16
  121. package/dist/plugins/captions/props.d.ts +0 -19
  122. package/dist/plugins/captions/props.js +0 -14
  123. package/dist/plugins/captions/utils.d.ts +0 -1
  124. package/dist/plugins/captions/utils.js +0 -2
  125. package/dist/plugins/counter/Counter.d.ts +0 -5
  126. package/dist/plugins/counter/Counter.js +0 -14
  127. package/dist/plugins/download/Download.d.ts +0 -2
  128. package/dist/plugins/download/Download.js +0 -9
  129. package/dist/plugins/download/DownloadButton.d.ts +0 -2
  130. package/dist/plugins/download/DownloadButton.js +0 -19
  131. package/dist/plugins/download/FileSaver.d.ts +0 -1
  132. package/dist/plugins/download/FileSaver.js +0 -60
  133. package/dist/plugins/fullscreen/Fullscreen.d.ts +0 -3
  134. package/dist/plugins/fullscreen/Fullscreen.js +0 -13
  135. package/dist/plugins/fullscreen/FullscreenButton.d.ts +0 -3
  136. package/dist/plugins/fullscreen/FullscreenButton.js +0 -16
  137. package/dist/plugins/fullscreen/FullscreenContext.d.ts +0 -5
  138. package/dist/plugins/fullscreen/FullscreenContext.js +0 -93
  139. package/dist/plugins/fullscreen/props.d.ts +0 -10
  140. package/dist/plugins/fullscreen/props.js +0 -8
  141. package/dist/plugins/inline/Inline.d.ts +0 -3
  142. package/dist/plugins/inline/Inline.js +0 -18
  143. package/dist/plugins/inline/InlineContainer.d.ts +0 -4
  144. package/dist/plugins/inline/InlineContainer.js +0 -5
  145. package/dist/plugins/slideshow/Slideshow.d.ts +0 -3
  146. package/dist/plugins/slideshow/Slideshow.js +0 -13
  147. package/dist/plugins/slideshow/SlideshowButton.d.ts +0 -2
  148. package/dist/plugins/slideshow/SlideshowButton.js +0 -14
  149. package/dist/plugins/slideshow/SlideshowContext.d.ts +0 -5
  150. package/dist/plugins/slideshow/SlideshowContext.js +0 -79
  151. package/dist/plugins/slideshow/props.d.ts +0 -12
  152. package/dist/plugins/slideshow/props.js +0 -9
  153. package/dist/plugins/thumbnails/Thumbnail.d.ts +0 -15
  154. package/dist/plugins/thumbnails/Thumbnail.js +0 -51
  155. package/dist/plugins/thumbnails/Thumbnails.d.ts +0 -3
  156. package/dist/plugins/thumbnails/Thumbnails.js +0 -22
  157. package/dist/plugins/thumbnails/ThumbnailsButton.d.ts +0 -2
  158. package/dist/plugins/thumbnails/ThumbnailsButton.js +0 -16
  159. package/dist/plugins/thumbnails/ThumbnailsContext.d.ts +0 -6
  160. package/dist/plugins/thumbnails/ThumbnailsContext.js +0 -24
  161. package/dist/plugins/thumbnails/ThumbnailsTrack.d.ts +0 -5
  162. package/dist/plugins/thumbnails/ThumbnailsTrack.js +0 -141
  163. package/dist/plugins/thumbnails/props.d.ts +0 -40
  164. package/dist/plugins/thumbnails/props.js +0 -21
  165. package/dist/plugins/thumbnails/utils.d.ts +0 -2
  166. package/dist/plugins/thumbnails/utils.js +0 -4
  167. package/dist/plugins/video/Video.d.ts +0 -3
  168. package/dist/plugins/video/Video.js +0 -21
  169. package/dist/plugins/video/VideoSlide.d.ts +0 -8
  170. package/dist/plugins/video/VideoSlide.js +0 -74
  171. package/dist/plugins/video/props.d.ts +0 -29
  172. package/dist/plugins/video/props.js +0 -13
  173. package/dist/plugins/zoom/ResponsiveImage.d.ts +0 -11
  174. package/dist/plugins/zoom/ResponsiveImage.js +0 -58
  175. package/dist/plugins/zoom/Zoom.d.ts +0 -3
  176. package/dist/plugins/zoom/Zoom.js +0 -18
  177. package/dist/plugins/zoom/ZoomButton.d.ts +0 -8
  178. package/dist/plugins/zoom/ZoomButton.js +0 -27
  179. package/dist/plugins/zoom/ZoomButtonsGroup.d.ts +0 -2
  180. package/dist/plugins/zoom/ZoomButtonsGroup.js +0 -22
  181. package/dist/plugins/zoom/ZoomController.d.ts +0 -12
  182. package/dist/plugins/zoom/ZoomController.js +0 -17
  183. package/dist/plugins/zoom/ZoomToolbarControl.d.ts +0 -2
  184. package/dist/plugins/zoom/ZoomToolbarControl.js +0 -12
  185. package/dist/plugins/zoom/ZoomWrapper.d.ts +0 -5
  186. package/dist/plugins/zoom/ZoomWrapper.js +0 -36
  187. package/dist/plugins/zoom/hooks/index.d.ts +0 -6
  188. package/dist/plugins/zoom/hooks/index.js +0 -6
  189. package/dist/plugins/zoom/hooks/useZoomAnimation.d.ts +0 -2
  190. package/dist/plugins/zoom/hooks/useZoomAnimation.js +0 -39
  191. package/dist/plugins/zoom/hooks/useZoomCallback.d.ts +0 -1
  192. package/dist/plugins/zoom/hooks/useZoomCallback.js +0 -12
  193. package/dist/plugins/zoom/hooks/useZoomImageRect.d.ts +0 -5
  194. package/dist/plugins/zoom/hooks/useZoomImageRect.js +0 -41
  195. package/dist/plugins/zoom/hooks/useZoomProps.d.ts +0 -13
  196. package/dist/plugins/zoom/hooks/useZoomProps.js +0 -6
  197. package/dist/plugins/zoom/hooks/useZoomSensors.d.ts +0 -3
  198. package/dist/plugins/zoom/hooks/useZoomSensors.js +0 -154
  199. package/dist/plugins/zoom/hooks/useZoomState.d.ts +0 -12
  200. package/dist/plugins/zoom/hooks/useZoomState.js +0 -63
  201. package/dist/plugins/zoom/props.d.ts +0 -25
  202. package/dist/plugins/zoom/props.js +0 -15
  203. package/dist/props.d.ts +0 -2
  204. package/dist/props.js +0 -38
package/dist/styles.css CHANGED
@@ -1,281 +1 @@
1
- .yarl__fullsize {
2
- width: 100%;
3
- height: 100%;
4
- }
5
- .yarl__relative {
6
- position: relative;
7
- }
8
- .yarl__portal {
9
- position: fixed;
10
- top: 0;
11
- right: 0;
12
- bottom: 0;
13
- left: 0;
14
- opacity: 0;
15
- overflow: hidden;
16
- z-index: var(--yarl__portal_zindex, 9999);
17
- transition: opacity var(--yarl__fade_animation_duration, 250ms) var(--yarl__fade_animation_timing_function, ease);
18
- }
19
- .yarl__portal_open {
20
- opacity: 1;
21
- }
22
- .yarl__container {
23
- position: absolute;
24
- top: 0;
25
- right: 0;
26
- bottom: 0;
27
- left: 0;
28
- overflow: hidden;
29
- background-color: var(--yarl__container_background_color, var(--yarl__color_backdrop, #000));
30
- outline: 0;
31
- -webkit-user-select: none;
32
- -moz-user-select: none;
33
- user-select: none;
34
- touch-action: var(--yarl__controller_touch_action, none);
35
- overscroll-behavior: var(--yarl__controller_overscroll-behavior, contain);
36
- }
37
- .yarl__carousel {
38
- display: flex;
39
- flex: 0 0 auto;
40
- height: 100%;
41
- align-content: center;
42
- justify-content: center;
43
- align-items: stretch;
44
- width: calc(100% + (var(--yarl__carousel_slides_count) - 1) * (100% + var(--yarl__carousel_spacing_px, 0) * 1px + var(--yarl__carousel_spacing_percent, 0) * 1%));
45
- -webkit-transform: translateX(var(--yarl__swipe_offset, 0px));
46
- transform: translateX(var(--yarl__swipe_offset, 0px));
47
- }
48
- .yarl__carousel_with_slides {
49
- -webkit-column-gap: calc(var(--yarl__carousel_spacing_px, 0) * 1px + 100 / (100 * var(--yarl__carousel_slides_count) + (var(--yarl__carousel_slides_count) - 1) * var(--yarl__carousel_spacing_percent, 0)) * var(--yarl__carousel_spacing_percent, 0) * 1%);
50
- -moz-column-gap: calc(var(--yarl__carousel_spacing_px, 0) * 1px + 100 / (100 * var(--yarl__carousel_slides_count) + (var(--yarl__carousel_slides_count) - 1) * var(--yarl__carousel_spacing_percent, 0)) * var(--yarl__carousel_spacing_percent, 0) * 1%);
51
- column-gap: calc(var(--yarl__carousel_spacing_px, 0) * 1px + 100 / (100 * var(--yarl__carousel_slides_count) + (var(--yarl__carousel_slides_count) - 1) * var(--yarl__carousel_spacing_percent, 0)) * var(--yarl__carousel_spacing_percent, 0) * 1%);
52
- }
53
- .yarl__flex_center {
54
- display: flex;
55
- justify-content: center;
56
- align-content: center;
57
- align-items: center;
58
- }
59
- .yarl__slide {
60
- flex: 1;
61
- position: relative;
62
- overflow: hidden;
63
- padding: calc(var(--yarl__carousel_padding_px, 0) * 1px + 100 / (100 * var(--yarl__carousel_slides_count) + (var(--yarl__carousel_slides_count) - 1) * var(--yarl__carousel_spacing_percent, 0)) * var(--yarl__carousel_padding_percent, 0) * 1%);
64
- }
65
- [dir=rtl] .yarl__slide {
66
- --yarl__direction: -1;
67
- }
68
- .yarl__slide_image {
69
- max-width: 100%;
70
- max-height: 100%;
71
- -o-object-fit: contain;
72
- object-fit: contain;
73
- touch-action: var(--yarl__controller_touch_action, none);
74
- -moz-user-select: none;
75
- user-select: none;
76
- -webkit-user-select: none;
77
- -webkit-touch-callout: none;
78
- }
79
- @media screen and (min-width: 800px) {
80
- .yarl__slide_image {
81
- -webkit-transform: translateZ(0);
82
- -webkit-backface-visibility: hidden;
83
- -webkit-transform-style: preserve-3d;
84
- }
85
- }
86
- .yarl__slide_image_cover {
87
- width: 100%;
88
- height: 100%;
89
- -o-object-fit: cover;
90
- object-fit: cover;
91
- }
92
- .yarl__slide_image_loading {
93
- opacity: 0;
94
- }
95
- .yarl__slide_placeholder {
96
- position: absolute;
97
- top: 50%;
98
- left: 50%;
99
- -webkit-transform: translateX(-50%) translateY(-50%);
100
- transform: translateX(-50%) translateY(-50%);
101
- line-height: 0;
102
- }
103
- .yarl__slide_loading {
104
- color: var(--yarl__slide_icon_loading_color, var(--yarl__color_button, rgba(255, 255, 255, 0.8)));
105
- -webkit-animation: yarl__delayed_fadein 1s linear;
106
- animation: yarl__delayed_fadein 1s linear;
107
- }
108
- .yarl__slide_loading line {
109
- -webkit-animation: yarl__stroke_opacity 1s linear infinite;
110
- animation: yarl__stroke_opacity 1s linear infinite;
111
- }
112
- .yarl__slide_loading line:nth-of-type(1) {
113
- -webkit-animation-delay: -1.875s;
114
- animation-delay: -1.875s;
115
- }
116
- .yarl__slide_loading line:nth-of-type(2) {
117
- -webkit-animation-delay: -1.75s;
118
- animation-delay: -1.75s;
119
- }
120
- .yarl__slide_loading line:nth-of-type(3) {
121
- -webkit-animation-delay: -1.625s;
122
- animation-delay: -1.625s;
123
- }
124
- .yarl__slide_loading line:nth-of-type(4) {
125
- -webkit-animation-delay: -1.5s;
126
- animation-delay: -1.5s;
127
- }
128
- .yarl__slide_loading line:nth-of-type(5) {
129
- -webkit-animation-delay: -1.375s;
130
- animation-delay: -1.375s;
131
- }
132
- .yarl__slide_loading line:nth-of-type(6) {
133
- -webkit-animation-delay: -1.25s;
134
- animation-delay: -1.25s;
135
- }
136
- .yarl__slide_loading line:nth-of-type(7) {
137
- -webkit-animation-delay: -1.125s;
138
- animation-delay: -1.125s;
139
- }
140
- .yarl__slide_loading line:nth-of-type(8) {
141
- -webkit-animation-delay: -1s;
142
- animation-delay: -1s;
143
- }
144
- .yarl__slide_error {
145
- width: var(--yarl__slide_icon_error_size, 48px);
146
- height: var(--yarl__slide_icon_error_size, 48px);
147
- color: var(--yarl__slide_icon_error_color, red);
148
- }
149
- @media (prefers-reduced-motion) {
150
- .yarl__portal, .yarl__slide {
151
- transition: unset;
152
- }
153
- .yarl__slide_loading, .yarl__slide_loading line {
154
- -webkit-animation: unset;
155
- animation: unset;
156
- }
157
- }
158
- .yarl__toolbar {
159
- position: absolute;
160
- top: 0;
161
- right: 0;
162
- bottom: auto;
163
- left: auto;
164
- display: flex;
165
- justify-content: flex-end;
166
- padding: var(--yarl__toolbar_padding, 8px);
167
- }
168
- [dir=rtl] .yarl__toolbar {
169
- top: 0;
170
- right: auto;
171
- bottom: auto;
172
- left: 0;
173
- }
174
- .yarl__icon {
175
- width: var(--yarl__icon_size, 32px);
176
- height: var(--yarl__icon_size, 32px);
177
- }
178
- .yarl__button {
179
- cursor: pointer;
180
- -webkit-appearance: none;
181
- -moz-appearance: none;
182
- appearance: none;
183
- background-color: var(--yarl__button_background_color, transparent);
184
- border: var(--yarl__button_border, 0);
185
- margin: var(--yarl__button_margin, 0);
186
- outline: none;
187
- line-height: 0;
188
- padding: var(--yarl__button_padding, 8px);
189
- color: var(--yarl__color_button, rgba(255, 255, 255, 0.8));
190
- -webkit-filter: var(--yarl__button_filter, drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.8)));
191
- filter: var(--yarl__button_filter, drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.8)));
192
- -webkit-tap-highlight-color: transparent;
193
- }
194
- .yarl__button:focus {
195
- color: var(--yarl__color_button_active, #fff);
196
- }
197
- .yarl__button:focus:not(:focus-visible) {
198
- color: var(--yarl__color_button, rgba(255, 255, 255, 0.8));
199
- }
200
- .yarl__button:focus-visible {
201
- color: var(--yarl__color_button_active, #fff);
202
- }
203
- @media (hover: hover) {
204
- .yarl__button:hover, .yarl__button:focus:hover, .yarl__button:focus-visible:hover {
205
- color: var(--yarl__color_button_active, #fff);
206
- }
207
- }
208
- .yarl__button:disabled {
209
- color: var(--yarl__color_button_disabled, rgba(255, 255, 255, 0.4));
210
- cursor: default;
211
- }
212
- .yarl__navigation_prev, .yarl__navigation_next {
213
- position: absolute;
214
- top: 50%;
215
- -webkit-transform: translateY(-50%);
216
- transform: translateY(-50%);
217
- padding: var(--yarl__navigation_button_padding, 24px 16px);
218
- }
219
- .yarl__navigation_prev {
220
- left: 0;
221
- }
222
- [dir=rtl] .yarl__navigation_prev {
223
- left: unset;
224
- right: 0;
225
- -webkit-transform: translateY(-50%) rotate(180deg);
226
- transform: translateY(-50%) rotate(180deg);
227
- }
228
- .yarl__navigation_next {
229
- right: 0;
230
- }
231
- [dir=rtl] .yarl__navigation_next {
232
- left: 0;
233
- right: unset;
234
- -webkit-transform: translateY(-50%) rotate(180deg);
235
- transform: translateY(-50%) rotate(180deg);
236
- }
237
- .yarl__no_scroll {
238
- height: 100%;
239
- overflow: hidden;
240
- overscroll-behavior: none;
241
- }
242
-
243
- @-webkit-keyframes yarl__delayed_fadein {
244
- 0% {
245
- opacity: 0;
246
- }
247
- 80% {
248
- opacity: 0;
249
- }
250
- 100% {
251
- opacity: 1;
252
- }
253
- }
254
-
255
- @keyframes yarl__delayed_fadein {
256
- 0% {
257
- opacity: 0;
258
- }
259
- 80% {
260
- opacity: 0;
261
- }
262
- 100% {
263
- opacity: 1;
264
- }
265
- }
266
- @-webkit-keyframes yarl__stroke_opacity {
267
- from {
268
- stroke-opacity: 1;
269
- }
270
- to {
271
- stroke-opacity: 0.125;
272
- }
273
- }
274
- @keyframes yarl__stroke_opacity {
275
- from {
276
- stroke-opacity: 1;
277
- }
278
- to {
279
- stroke-opacity: 0.125;
280
- }
281
- }
1
+ .yarl__fullsize{height:100%;width:100%}.yarl__relative{position:relative}.yarl__portal{bottom:0;left:0;opacity:0;overflow:hidden;position:fixed;right:0;top:0;transition:opacity var(--yarl__fade_animation_duration,.25s) var(--yarl__fade_animation_timing_function,ease);z-index:var(--yarl__portal_zindex,9999)}.yarl__portal_open{opacity:1}.yarl__container{background-color:var(--yarl__container_background_color,var(--yarl__color_backdrop,#000));bottom:0;left:0;outline:0;overflow:hidden;overscroll-behavior:var(--yarl__controller_overscroll-behavior,contain);position:absolute;right:0;top:0;touch-action:var(--yarl__controller_touch_action,none);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yarl__carousel{align-content:center;align-items:stretch;display:flex;flex:0 0 auto;height:100%;justify-content:center;-webkit-transform:translateX(var(--yarl__swipe_offset,0));transform:translateX(var(--yarl__swipe_offset,0));width:calc(100% + (var(--yarl__carousel_slides_count) - 1)*(100% + var(--yarl__carousel_spacing_px, 0)*1px + var(--yarl__carousel_spacing_percent, 0)*1%))}.yarl__carousel_with_slides{-webkit-column-gap:calc(var(--yarl__carousel_spacing_px, 0)*1px + 100/(var(--yarl__carousel_slides_count)*100 + (var(--yarl__carousel_slides_count) - 1)*var(--yarl__carousel_spacing_percent, 0))*var(--yarl__carousel_spacing_percent, 0)*1%);-moz-column-gap:calc(var(--yarl__carousel_spacing_px, 0)*1px + 100/(var(--yarl__carousel_slides_count)*100 + (var(--yarl__carousel_slides_count) - 1)*var(--yarl__carousel_spacing_percent, 0))*var(--yarl__carousel_spacing_percent, 0)*1%);column-gap:calc(var(--yarl__carousel_spacing_px, 0)*1px + 100/(var(--yarl__carousel_slides_count)*100 + (var(--yarl__carousel_slides_count) - 1)*var(--yarl__carousel_spacing_percent, 0))*var(--yarl__carousel_spacing_percent, 0)*1%)}.yarl__flex_center{align-content:center;align-items:center;display:flex;justify-content:center}.yarl__slide{flex:1;overflow:hidden;padding:calc(var(--yarl__carousel_padding_px, 0)*1px + 100/(var(--yarl__carousel_slides_count)*100 + (var(--yarl__carousel_slides_count) - 1)*var(--yarl__carousel_spacing_percent, 0))*var(--yarl__carousel_padding_percent, 0)*1%);position:relative}[dir=rtl] .yarl__slide{--yarl__direction:-1}.yarl__slide_image{-webkit-touch-callout:none;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;touch-action:var(--yarl__controller_touch_action,none);-moz-user-select:none;user-select:none;-webkit-user-select:none}@media screen and (min-width:800px){.yarl__slide_image{-webkit-backface-visibility:hidden;-webkit-transform:translateZ(0);-webkit-transform-style:preserve-3d}}.yarl__slide_image_cover{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.yarl__slide_image_loading{opacity:0}.yarl__slide_placeholder{left:50%;line-height:0;position:absolute;top:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}.yarl__slide_loading{-webkit-animation:yarl__delayed_fadein 1s linear;animation:yarl__delayed_fadein 1s linear;color:var(--yarl__slide_icon_loading_color,var(--yarl__color_button,hsla(0,0%,100%,.8)))}.yarl__slide_loading line{-webkit-animation:yarl__stroke_opacity 1s linear infinite;animation:yarl__stroke_opacity 1s linear infinite}.yarl__slide_loading line:first-of-type{-webkit-animation-delay:-1.875s;animation-delay:-1.875s}.yarl__slide_loading line:nth-of-type(2){-webkit-animation-delay:-1.75s;animation-delay:-1.75s}.yarl__slide_loading line:nth-of-type(3){-webkit-animation-delay:-1.625s;animation-delay:-1.625s}.yarl__slide_loading line:nth-of-type(4){-webkit-animation-delay:-1.5s;animation-delay:-1.5s}.yarl__slide_loading line:nth-of-type(5){-webkit-animation-delay:-1.375s;animation-delay:-1.375s}.yarl__slide_loading line:nth-of-type(6){-webkit-animation-delay:-1.25s;animation-delay:-1.25s}.yarl__slide_loading line:nth-of-type(7){-webkit-animation-delay:-1.125s;animation-delay:-1.125s}.yarl__slide_loading line:nth-of-type(8){-webkit-animation-delay:-1s;animation-delay:-1s}.yarl__slide_error{color:var(--yarl__slide_icon_error_color,red);height:var(--yarl__slide_icon_error_size,48px);width:var(--yarl__slide_icon_error_size,48px)}@media (prefers-reduced-motion){.yarl__portal,.yarl__slide{transition:unset}.yarl__slide_loading,.yarl__slide_loading line{-webkit-animation:unset;animation:unset}}.yarl__toolbar{bottom:auto;display:flex;justify-content:flex-end;left:auto;padding:var(--yarl__toolbar_padding,8px);position:absolute;right:0;top:0}[dir=rtl] .yarl__toolbar{bottom:auto;left:0;right:auto;top:0}.yarl__icon{height:var(--yarl__icon_size,32px);width:var(--yarl__icon_size,32px)}.yarl__button{-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--yarl__button_background_color,transparent);border:var(--yarl__button_border,0);color:var(--yarl__color_button,hsla(0,0%,100%,.8));cursor:pointer;-webkit-filter:var(--yarl__button_filter,drop-shadow(2px 2px 2px rgba(0,0,0,.8)));filter:var(--yarl__button_filter,drop-shadow(2px 2px 2px rgba(0,0,0,.8)));line-height:0;margin:var(--yarl__button_margin,0);outline:none;padding:var(--yarl__button_padding,8px)}.yarl__button:focus{color:var(--yarl__color_button_active,#fff)}.yarl__button:focus:not(:focus-visible){color:var(--yarl__color_button,hsla(0,0%,100%,.8))}.yarl__button:focus-visible{color:var(--yarl__color_button_active,#fff)}@media (hover:hover){.yarl__button:focus-visible:hover,.yarl__button:focus:hover,.yarl__button:hover{color:var(--yarl__color_button_active,#fff)}}.yarl__button:disabled{color:var(--yarl__color_button_disabled,hsla(0,0%,100%,.4));cursor:default}.yarl__navigation_next,.yarl__navigation_prev{padding:var(--yarl__navigation_button_padding,24px 16px);position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.yarl__navigation_prev{left:0}[dir=rtl] .yarl__navigation_prev{left:unset;right:0;-webkit-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg)}.yarl__navigation_next{right:0}[dir=rtl] .yarl__navigation_next{left:0;right:unset;-webkit-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg)}.yarl__no_scroll{height:100%;overflow:hidden;overscroll-behavior:none}@-webkit-keyframes yarl__delayed_fadein{0%{opacity:0}80%{opacity:0}to{opacity:1}}@keyframes yarl__delayed_fadein{0%{opacity:0}80%{opacity:0}to{opacity:1}}@-webkit-keyframes yarl__stroke_opacity{0%{stroke-opacity:1}to{stroke-opacity:.125}}@keyframes yarl__stroke_opacity{0%{stroke-opacity:1}to{stroke-opacity:.125}}
@@ -0,0 +1,2 @@
1
+ declare const styles: unknown;
2
+ export default styles;
package/dist/types.d.ts CHANGED
@@ -1,8 +1,60 @@
1
- import * as React from "react";
1
+ import * as React from 'react';
2
+
3
+ declare const MODULE_CAROUSEL = "carousel";
4
+ declare const MODULE_CONTROLLER = "controller";
5
+ declare const MODULE_NAVIGATION = "navigation";
6
+ declare const MODULE_NO_SCROLL = "no-scroll";
7
+ declare const MODULE_PORTAL = "portal";
8
+ declare const MODULE_ROOT = "root";
9
+ declare const MODULE_TOOLBAR = "toolbar";
10
+ declare const PLUGIN_CAPTIONS = "captions";
11
+ declare const PLUGIN_COUNTER = "counter";
12
+ declare const PLUGIN_DOWNLOAD = "download";
13
+ declare const PLUGIN_FULLSCREEN = "fullscreen";
14
+ declare const PLUGIN_INLINE = "inline";
15
+ declare const PLUGIN_SLIDESHOW = "slideshow";
16
+ declare const PLUGIN_THUMBNAILS = "thumbnails";
17
+ declare const PLUGIN_ZOOM = "zoom";
18
+ declare const SLIDE_STATUS_LOADING = "loading";
19
+ declare const SLIDE_STATUS_PLAYING = "playing";
20
+ declare const SLIDE_STATUS_ERROR = "error";
21
+ declare const SLIDE_STATUS_COMPLETE = "complete";
22
+ declare const SLIDE_STATUS_PLACEHOLDER = "placeholder";
23
+ type SlideStatus = typeof SLIDE_STATUS_LOADING | typeof SLIDE_STATUS_PLAYING | typeof SLIDE_STATUS_ERROR | typeof SLIDE_STATUS_COMPLETE;
24
+ declare const activeSlideStatus: (status: SlideStatus) => `active-slide-${SlideStatus}`;
25
+ declare const ACTIVE_SLIDE_LOADING: "active-slide-loading";
26
+ declare const ACTIVE_SLIDE_PLAYING: "active-slide-playing";
27
+ declare const ACTIVE_SLIDE_ERROR: "active-slide-error";
28
+ declare const ACTIVE_SLIDE_COMPLETE: "active-slide-complete";
29
+ declare const CLASS_FULLSIZE = "fullsize";
30
+ declare const CLASS_FLEX_CENTER = "flex_center";
31
+ declare const CLASS_NO_SCROLL = "no_scroll";
32
+ declare const CLASS_NO_SCROLL_PADDING = "no_scroll_padding";
33
+ declare const ACTION_PREV = "prev";
34
+ declare const ACTION_NEXT = "next";
35
+ declare const ACTION_SWIPE = "swipe";
36
+ declare const ACTION_CLOSE = "close";
37
+ declare const EVENT_ON_POINTER_DOWN = "onPointerDown";
38
+ declare const EVENT_ON_POINTER_MOVE = "onPointerMove";
39
+ declare const EVENT_ON_POINTER_UP = "onPointerUp";
40
+ declare const EVENT_ON_POINTER_LEAVE = "onPointerLeave";
41
+ declare const EVENT_ON_POINTER_CANCEL = "onPointerCancel";
42
+ declare const EVENT_ON_KEY_DOWN = "onKeyDown";
43
+ declare const EVENT_ON_KEY_UP = "onKeyUp";
44
+ declare const EVENT_ON_WHEEL = "onWheel";
45
+ declare const VK_ESCAPE = "Escape";
46
+ declare const VK_ARROW_LEFT = "ArrowLeft";
47
+ declare const VK_ARROW_RIGHT = "ArrowRight";
48
+ declare const ELEMENT_BUTTON = "button";
49
+ declare const ELEMENT_ICON = "icon";
50
+ declare const IMAGE_FIT_CONTAIN = "contain";
51
+ declare const IMAGE_FIT_COVER = "cover";
52
+ declare const UNKNOWN_ACTION_TYPE = "Unknown action type";
53
+
2
54
  /** Lightbox external props */
3
- export type LightboxExternalProps = DeepPartial<LightboxProps, "carousel" | "animation" | "controller" | "toolbar">;
55
+ type LightboxExternalProps = DeepPartial<LightboxProps, "carousel" | "animation" | "controller" | "toolbar">;
4
56
  /** Lightbox properties */
5
- export interface LightboxProps {
57
+ interface LightboxProps {
6
58
  /** if `true`, the lightbox is open */
7
59
  open: boolean;
8
60
  /** a callback to close the lightbox */
@@ -35,20 +87,20 @@ export interface LightboxProps {
35
87
  className: string;
36
88
  }
37
89
  /** Slide */
38
- export type Slide = SlideTypes[SlideTypeKey];
90
+ type Slide = SlideTypes[SlideTypeKey];
39
91
  /** Supported slide types */
40
- export interface SlideTypes {
92
+ interface SlideTypes {
41
93
  /** image slide type */
42
94
  image: SlideImage;
43
95
  }
44
96
  /** Slide type key */
45
- export type SlideTypeKey = keyof SlideTypes;
97
+ type SlideTypeKey = keyof SlideTypes;
46
98
  /** Generic slide */
47
- export interface GenericSlide {
99
+ interface GenericSlide {
48
100
  type?: SlideTypeKey;
49
101
  }
50
102
  /** Image slide properties */
51
- export interface SlideImage extends GenericSlide {
103
+ interface SlideImage extends GenericSlide {
52
104
  /** image URL */
53
105
  src: string;
54
106
  /** image 'alt' attribute */
@@ -63,7 +115,7 @@ export interface SlideImage extends GenericSlide {
63
115
  srcSet?: ImageSource[];
64
116
  }
65
117
  /** Image source */
66
- export interface ImageSource {
118
+ interface ImageSource {
67
119
  /** image URL */
68
120
  src: string;
69
121
  /** image width in pixels */
@@ -72,36 +124,36 @@ export interface ImageSource {
72
124
  height: number;
73
125
  }
74
126
  /** Image fit setting */
75
- export type ImageFit = "contain" | "cover";
127
+ type ImageFit = "contain" | "cover";
76
128
  /** Lightbox component */
77
- export type Component = React.ComponentType<ComponentProps>;
129
+ type Component = React.ComponentType<ComponentProps>;
78
130
  /** Lightbox component properties */
79
- export type ComponentProps = React.PropsWithChildren<Omit<LightboxProps, "slides" | "index" | "plugins">>;
131
+ type ComponentProps = React.PropsWithChildren<Omit<LightboxProps, "slides" | "index" | "plugins">>;
80
132
  /** Lightbox component tree node */
81
- export type Node = {
133
+ type Node = {
82
134
  /** module */
83
135
  module: Module;
84
136
  /** module child nodes */
85
137
  children?: Node[];
86
138
  };
87
139
  /** Lightbox module */
88
- export type Module = {
140
+ type Module = {
89
141
  /** module name */
90
142
  name: string;
91
143
  /** module component */
92
144
  component: Component;
93
145
  };
94
146
  /** Lightbox props augmentation */
95
- export type Augmentation = (props: ComponentProps) => ComponentProps;
147
+ type Augmentation = (props: ComponentProps) => ComponentProps;
96
148
  /** Container rect */
97
- export type ContainerRect = {
149
+ type ContainerRect = {
98
150
  width: number;
99
151
  height: number;
100
152
  };
101
153
  /** Customization slots */
102
- export type Slot = SlotType[keyof SlotType];
154
+ type Slot = SlotType[keyof SlotType];
103
155
  /** Supported customization slots */
104
- export interface SlotType {
156
+ interface SlotType {
105
157
  /** lightbox root customization slot */
106
158
  root: "root";
107
159
  /** lightbox container customization slot */
@@ -116,11 +168,11 @@ interface SlotCSSProperties extends React.CSSProperties {
116
168
  [key: `--yarl__${string}`]: string | number;
117
169
  }
118
170
  /** Customization slots styles */
119
- export type SlotStyles = {
171
+ type SlotStyles = {
120
172
  [key in Slot]?: SlotCSSProperties;
121
173
  };
122
174
  /** Carousel settings */
123
- export interface CarouselSettings {
175
+ interface CarouselSettings {
124
176
  /** if `true`, the lightbox carousel doesn't wrap around */
125
177
  finite: boolean;
126
178
  /** the lightbox preloads (2 * preload + 1) slides */
@@ -132,9 +184,9 @@ export interface CarouselSettings {
132
184
  /** `object-fit` setting for image slides */
133
185
  imageFit: ImageFit;
134
186
  }
135
- export type LengthOrPercentage = `${number}px` | `${number}%` | number;
187
+ type LengthOrPercentage = `${number}px` | `${number}%` | number;
136
188
  /** Animation settings */
137
- export interface AnimationSettings {
189
+ interface AnimationSettings {
138
190
  /** fade-in / fade-out animation settings */
139
191
  fade: number;
140
192
  /** swipe animation settings */
@@ -152,7 +204,7 @@ export interface AnimationSettings {
152
204
  };
153
205
  }
154
206
  /** Controller settings */
155
- export interface ControllerSettings {
207
+ interface ControllerSettings {
156
208
  /** controller ref */
157
209
  ref: React.ForwardedRef<ControllerRef>;
158
210
  /** if true, the lightbox captures focus when it opens */
@@ -161,11 +213,13 @@ export interface ControllerSettings {
161
213
  touchAction: "none" | "pan-y";
162
214
  /** if `true`, set ARIA attributes on the controller div */
163
215
  aria: boolean;
216
+ /** if `true`, close the lightbox on pull-down gesture */
217
+ closeOnPullDown: boolean;
164
218
  /** if `true`, close the lightbox when the backdrop is clicked */
165
219
  closeOnBackdropClick: boolean;
166
220
  }
167
221
  /** Lightbox controller ref */
168
- export interface ControllerRef {
222
+ interface ControllerRef {
169
223
  /** navigate to the previous slide */
170
224
  prev: Callback<NavigationAction | void>;
171
225
  /** navigate to the next slide */
@@ -180,17 +234,30 @@ export interface ControllerRef {
180
234
  getLightboxState: () => LightboxState;
181
235
  }
182
236
  /** Portal settings */
183
- export interface PortalSettings {
237
+ interface PortalSettings {
184
238
  /** portal mount point */
185
239
  root?: DocumentFragment | Element | null;
186
240
  }
187
241
  /** Lightbox navigation action */
188
- export interface NavigationAction {
242
+ interface NavigationAction {
189
243
  /** navigate through the specified number of slides */
190
244
  count?: number;
191
245
  }
246
+ /** Lightbox state swipe action */
247
+ type LightboxStateSwipeAction = {
248
+ type: "swipe";
249
+ increment: number;
250
+ duration?: number;
251
+ easing?: string;
252
+ };
253
+ /** Lightbox state update action */
254
+ type LightboxStateUpdateAction = {
255
+ type: "update";
256
+ slides: Slide[];
257
+ index: number;
258
+ };
192
259
  /** Lightbox state */
193
- export interface LightboxState {
260
+ interface LightboxState {
194
261
  /** lightbox slides */
195
262
  slides: Slide[];
196
263
  /** current slide index */
@@ -207,9 +274,9 @@ export interface LightboxState {
207
274
  };
208
275
  }
209
276
  /** Render function */
210
- export type RenderFunction<T = void> = [T] extends [void] ? () => React.ReactNode : (props: T) => React.ReactNode;
277
+ type RenderFunction<T = void> = [T] extends [void] ? () => React.ReactNode : (props: T) => React.ReactNode;
211
278
  /** `render.slide` render function props */
212
- export interface RenderSlideProps {
279
+ interface RenderSlideProps {
213
280
  /** slide */
214
281
  slide: Slide;
215
282
  /** slide offset (`0` - current slide, `1` - next slide, `-1` - previous slide, etc.) */
@@ -218,19 +285,19 @@ export interface RenderSlideProps {
218
285
  rect: ContainerRect;
219
286
  }
220
287
  /** `render.slideHeader` render function props */
221
- export interface RenderSlideHeaderProps {
288
+ interface RenderSlideHeaderProps {
222
289
  slide: Slide;
223
290
  }
224
291
  /** `render.slideFooter` render function props */
225
- export interface RenderSlideFooterProps {
292
+ interface RenderSlideFooterProps {
226
293
  slide: Slide;
227
294
  }
228
295
  /** `render.slideContainer` render function props */
229
- export interface RenderSlideContainerProps extends React.PropsWithChildren {
296
+ interface RenderSlideContainerProps extends React.PropsWithChildren {
230
297
  slide: Slide;
231
298
  }
232
299
  /** Custom render functions. */
233
- export interface Render {
300
+ interface Render {
234
301
  /** render custom slide type, or override the default image slide */
235
302
  slide?: RenderFunction<RenderSlideProps>;
236
303
  /** render custom slide header (use absolute positioning) */
@@ -258,15 +325,15 @@ export interface Render {
258
325
  /** render custom Close button */
259
326
  buttonClose?: RenderFunction;
260
327
  }
261
- export type Callback<T = void> = [T] extends [void] ? () => void : (props: T) => void;
262
- export interface ViewCallbackProps {
328
+ type Callback<T = void> = [T] extends [void] ? () => void : (props: T) => void;
329
+ interface ViewCallbackProps {
263
330
  index: number;
264
331
  }
265
- export interface ClickCallbackProps {
332
+ interface ClickCallbackProps {
266
333
  index: number;
267
334
  }
268
335
  /** Lifecycle callbacks */
269
- export interface Callbacks {
336
+ interface Callbacks {
270
337
  /** a callback called when a slide becomes active */
271
338
  view?: Callback<ViewCallbackProps>;
272
339
  /** a callback called when a slide is clicked */
@@ -281,20 +348,30 @@ export interface Callbacks {
281
348
  exited?: Callback;
282
349
  }
283
350
  /** Custom UI labels */
284
- export type Labels = {
351
+ type Labels = {
285
352
  [key: string]: string;
286
353
  };
287
354
  /** Toolbar settings */
288
- export interface ToolbarSettings {
355
+ interface ToolbarSettings {
289
356
  /** buttons to render in the toolbar */
290
357
  buttons: (ToolbarButtonKey | React.ReactNode)[];
291
358
  }
292
- export type ToolbarButtonKey = keyof ToolbarButtonKeys;
293
- export interface ToolbarButtonKeys {
359
+ type ToolbarButtonKey = keyof ToolbarButtonKeys;
360
+ interface ToolbarButtonKeys {
294
361
  close: null;
295
362
  }
363
+ interface EventTypes {
364
+ [ACTION_PREV]: NavigationAction | void;
365
+ [ACTION_NEXT]: NavigationAction | void;
366
+ [ACTION_SWIPE]: LightboxStateSwipeAction;
367
+ [ACTION_CLOSE]: void;
368
+ [ACTIVE_SLIDE_LOADING]: void;
369
+ [ACTIVE_SLIDE_PLAYING]: void;
370
+ [ACTIVE_SLIDE_COMPLETE]: void;
371
+ [ACTIVE_SLIDE_ERROR]: void;
372
+ }
296
373
  /** Plugin methods */
297
- export interface PluginProps {
374
+ interface PluginProps {
298
375
  /** test if a target module is present */
299
376
  contains: (target: string) => boolean;
300
377
  /** add module as a parent */
@@ -315,16 +392,17 @@ export interface PluginProps {
315
392
  augment: (augmentation: Augmentation) => void;
316
393
  }
317
394
  /** Lightbox plugin */
318
- export type Plugin = (props: PluginProps) => void;
395
+ type Plugin = (props: PluginProps) => void;
319
396
  /** Deep partial utility type */
320
- export type DeepPartial<T extends {}, K extends keyof T> = Omit<Partial<T>, K> & {
397
+ type DeepPartial<T extends {}, K extends keyof T> = Omit<Partial<T>, K> & {
321
398
  [P in K]?: DeepPartialValue<T[P]>;
322
399
  };
323
- export type DeepPartialValue<T> = T extends any[] ? T : T extends (...props: any[]) => any ? T : T extends {} ? {
400
+ type DeepPartialValue<T> = T extends any[] ? T : T extends (...props: any[]) => any ? T : T extends {} ? {
324
401
  [P in keyof T]?: P extends "ref" ? T[P] : DeepPartialValue<T[P]>;
325
402
  } : T;
326
403
  /** Deep non-nullable utility type */
327
- export type DeepNonNullable<T> = T extends {} ? {
404
+ type DeepNonNullable<T> = T extends {} ? {
328
405
  [K in keyof T]-?: NonNullable<T[K]>;
329
406
  } : never;
330
- export {};
407
+
408
+ export { ACTION_CLOSE, ACTION_NEXT, ACTION_PREV, ACTION_SWIPE, ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, AnimationSettings, Augmentation, CLASS_FLEX_CENTER, CLASS_FULLSIZE, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, Callback, Callbacks, CarouselSettings, ClickCallbackProps, Component, ComponentProps, ContainerRect, ControllerRef, ControllerSettings, DeepNonNullable, 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, EventTypes, GenericSlide, IMAGE_FIT_CONTAIN, IMAGE_FIT_COVER, ImageFit, ImageSource, Labels, LengthOrPercentage, LightboxExternalProps, LightboxProps, LightboxState, LightboxStateSwipeAction, LightboxStateUpdateAction, MODULE_CAROUSEL, MODULE_CONTROLLER, MODULE_NAVIGATION, MODULE_NO_SCROLL, MODULE_PORTAL, MODULE_ROOT, MODULE_TOOLBAR, Module, NavigationAction, Node, PLUGIN_CAPTIONS, PLUGIN_COUNTER, PLUGIN_DOWNLOAD, PLUGIN_FULLSCREEN, PLUGIN_INLINE, PLUGIN_SLIDESHOW, PLUGIN_THUMBNAILS, PLUGIN_ZOOM, Plugin, PluginProps, PortalSettings, Render, RenderFunction, RenderSlideContainerProps, RenderSlideFooterProps, RenderSlideHeaderProps, RenderSlideProps, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_LOADING, SLIDE_STATUS_PLACEHOLDER, SLIDE_STATUS_PLAYING, Slide, SlideImage, SlideStatus, SlideTypeKey, SlideTypes, Slot, SlotStyles, SlotType, ToolbarButtonKey, ToolbarButtonKeys, ToolbarSettings, UNKNOWN_ACTION_TYPE, VK_ARROW_LEFT, VK_ARROW_RIGHT, VK_ESCAPE, ViewCallbackProps, activeSlideStatus };
package/dist/types.js CHANGED
@@ -1 +1,51 @@
1
- export {};
1
+ const MODULE_CAROUSEL = "carousel";
2
+ const MODULE_CONTROLLER = "controller";
3
+ const MODULE_NAVIGATION = "navigation";
4
+ const MODULE_NO_SCROLL = "no-scroll";
5
+ const MODULE_PORTAL = "portal";
6
+ const MODULE_ROOT = "root";
7
+ const MODULE_TOOLBAR = "toolbar";
8
+ const PLUGIN_CAPTIONS = "captions";
9
+ const PLUGIN_COUNTER = "counter";
10
+ const PLUGIN_DOWNLOAD = "download";
11
+ const PLUGIN_FULLSCREEN = "fullscreen";
12
+ const PLUGIN_INLINE = "inline";
13
+ const PLUGIN_SLIDESHOW = "slideshow";
14
+ const PLUGIN_THUMBNAILS = "thumbnails";
15
+ const PLUGIN_ZOOM = "zoom";
16
+ const SLIDE_STATUS_LOADING = "loading";
17
+ const SLIDE_STATUS_PLAYING = "playing";
18
+ const SLIDE_STATUS_ERROR = "error";
19
+ const SLIDE_STATUS_COMPLETE = "complete";
20
+ const SLIDE_STATUS_PLACEHOLDER = "placeholder";
21
+ const activeSlideStatus = (status) => `active-slide-${status}`;
22
+ const ACTIVE_SLIDE_LOADING = activeSlideStatus(SLIDE_STATUS_LOADING);
23
+ const ACTIVE_SLIDE_PLAYING = activeSlideStatus(SLIDE_STATUS_PLAYING);
24
+ const ACTIVE_SLIDE_ERROR = activeSlideStatus(SLIDE_STATUS_ERROR);
25
+ const ACTIVE_SLIDE_COMPLETE = activeSlideStatus(SLIDE_STATUS_COMPLETE);
26
+ const CLASS_FULLSIZE = "fullsize";
27
+ const CLASS_FLEX_CENTER = "flex_center";
28
+ const CLASS_NO_SCROLL = "no_scroll";
29
+ const CLASS_NO_SCROLL_PADDING = "no_scroll_padding";
30
+ const ACTION_PREV = "prev";
31
+ const ACTION_NEXT = "next";
32
+ const ACTION_SWIPE = "swipe";
33
+ const ACTION_CLOSE = "close";
34
+ const EVENT_ON_POINTER_DOWN = "onPointerDown";
35
+ const EVENT_ON_POINTER_MOVE = "onPointerMove";
36
+ const EVENT_ON_POINTER_UP = "onPointerUp";
37
+ const EVENT_ON_POINTER_LEAVE = "onPointerLeave";
38
+ const EVENT_ON_POINTER_CANCEL = "onPointerCancel";
39
+ const EVENT_ON_KEY_DOWN = "onKeyDown";
40
+ const EVENT_ON_KEY_UP = "onKeyUp";
41
+ const EVENT_ON_WHEEL = "onWheel";
42
+ const VK_ESCAPE = "Escape";
43
+ const VK_ARROW_LEFT = "ArrowLeft";
44
+ const VK_ARROW_RIGHT = "ArrowRight";
45
+ const ELEMENT_BUTTON = "button";
46
+ const ELEMENT_ICON = "icon";
47
+ const IMAGE_FIT_CONTAIN = "contain";
48
+ const IMAGE_FIT_COVER = "cover";
49
+ const UNKNOWN_ACTION_TYPE = "Unknown action type";
50
+
51
+ export { ACTION_CLOSE, ACTION_NEXT, ACTION_PREV, ACTION_SWIPE, ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, CLASS_FLEX_CENTER, CLASS_FULLSIZE, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, 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, IMAGE_FIT_CONTAIN, IMAGE_FIT_COVER, MODULE_CAROUSEL, MODULE_CONTROLLER, MODULE_NAVIGATION, MODULE_NO_SCROLL, MODULE_PORTAL, MODULE_ROOT, MODULE_TOOLBAR, PLUGIN_CAPTIONS, PLUGIN_COUNTER, PLUGIN_DOWNLOAD, PLUGIN_FULLSCREEN, PLUGIN_INLINE, PLUGIN_SLIDESHOW, PLUGIN_THUMBNAILS, PLUGIN_ZOOM, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_LOADING, SLIDE_STATUS_PLACEHOLDER, SLIDE_STATUS_PLAYING, UNKNOWN_ACTION_TYPE, VK_ARROW_LEFT, VK_ARROW_RIGHT, VK_ESCAPE, activeSlideStatus };