@alfalab/core-components-gallery 5.7.4 → 5.8.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 (258) hide show
  1. package/Component.js +47 -12
  2. package/components/buttons/index.css +35 -0
  3. package/{buttons-ec113bb4.d.ts → components/buttons/index.d.ts} +6 -1
  4. package/components/buttons/index.js +72 -0
  5. package/components/header/Component.js +33 -12
  6. package/components/header/index.css +5 -19
  7. package/components/header-info-block/Component.js +1 -1
  8. package/components/header-info-block/index.css +5 -5
  9. package/components/header-mobile/Component.d.ts +4 -0
  10. package/components/header-mobile/Component.js +39 -0
  11. package/components/header-mobile/index.css +50 -0
  12. package/components/header-mobile/index.d.ts +1 -0
  13. package/components/header-mobile/index.js +9 -0
  14. package/components/image-preview/Component.js +67 -24
  15. package/components/image-preview/index.css +35 -28
  16. package/components/image-preview/paths.d.ts +2 -0
  17. package/components/image-preview/paths.js +2 -0
  18. package/components/image-viewer/component.js +30 -10
  19. package/components/image-viewer/index.css +37 -25
  20. package/components/image-viewer/slide.js +3 -1
  21. package/components/image-viewer/video/index.css +48 -0
  22. package/components/image-viewer/video/index.d.ts +10 -0
  23. package/components/image-viewer/video/index.js +130 -0
  24. package/components/index.d.ts +2 -0
  25. package/components/index.js +4 -0
  26. package/components/info-bar/Component.d.ts +4 -0
  27. package/components/info-bar/Component.js +47 -0
  28. package/components/info-bar/index.css +37 -0
  29. package/components/info-bar/index.d.ts +1 -0
  30. package/components/info-bar/index.js +9 -0
  31. package/components/navigation-bar/Component.js +3 -2
  32. package/components/navigation-bar/index.css +8 -6
  33. package/context.d.ts +7 -0
  34. package/context.js +7 -0
  35. package/cssm/Component.js +46 -11
  36. package/cssm/components/{header/buttons.d.ts → buttons/index.d.ts} +6 -1
  37. package/cssm/components/buttons/index.js +71 -0
  38. package/cssm/components/buttons/index.module.css +34 -0
  39. package/cssm/components/header/Component.js +28 -10
  40. package/cssm/components/header/index.module.css +3 -17
  41. package/cssm/components/header-mobile/Component.d.ts +4 -0
  42. package/cssm/components/header-mobile/Component.js +38 -0
  43. package/cssm/components/header-mobile/index.d.ts +1 -0
  44. package/cssm/components/header-mobile/index.js +9 -0
  45. package/cssm/components/header-mobile/index.module.css +49 -0
  46. package/cssm/components/image-preview/Component.js +66 -27
  47. package/cssm/components/image-preview/index.module.css +25 -18
  48. package/cssm/components/image-preview/paths.d.ts +2 -0
  49. package/cssm/components/image-preview/paths.js +2 -0
  50. package/cssm/components/image-viewer/component.js +29 -9
  51. package/cssm/components/image-viewer/index.module.css +21 -9
  52. package/cssm/components/image-viewer/slide.js +12 -2
  53. package/cssm/components/image-viewer/video/index.d.ts +10 -0
  54. package/cssm/components/image-viewer/video/index.js +129 -0
  55. package/cssm/components/image-viewer/video/index.module.css +47 -0
  56. package/cssm/components/index.d.ts +2 -0
  57. package/cssm/components/index.js +4 -0
  58. package/cssm/components/info-bar/Component.d.ts +4 -0
  59. package/cssm/components/info-bar/Component.js +46 -0
  60. package/cssm/components/info-bar/index.d.ts +1 -0
  61. package/cssm/components/info-bar/index.js +9 -0
  62. package/cssm/components/info-bar/index.module.css +36 -0
  63. package/cssm/components/navigation-bar/Component.js +2 -1
  64. package/cssm/components/navigation-bar/index.module.css +3 -1
  65. package/cssm/context.d.ts +7 -0
  66. package/cssm/context.js +7 -0
  67. package/cssm/index.d.ts +1 -1
  68. package/cssm/index.js +1 -8
  69. package/cssm/index.module.css +14 -2
  70. package/cssm/types.d.ts +7 -0
  71. package/cssm/utils/constants.d.ts +14 -1
  72. package/cssm/utils/constants.js +19 -0
  73. package/cssm/utils/index.js +7 -0
  74. package/cssm/utils/utils.d.ts +2 -1
  75. package/cssm/utils/utils.js +5 -3
  76. package/esm/Component.js +46 -12
  77. package/esm/components/buttons/index.css +35 -0
  78. package/esm/{buttons-791da71e.d.ts → components/buttons/index.d.ts} +6 -1
  79. package/esm/components/buttons/index.js +55 -0
  80. package/esm/components/header/Component.js +30 -9
  81. package/esm/components/header/index.css +5 -19
  82. package/esm/components/header-info-block/Component.js +1 -1
  83. package/esm/components/header-info-block/index.css +5 -5
  84. package/esm/components/header-mobile/Component.d.ts +4 -0
  85. package/esm/components/header-mobile/Component.js +30 -0
  86. package/esm/components/header-mobile/index.css +50 -0
  87. package/esm/components/header-mobile/index.d.ts +1 -0
  88. package/esm/components/header-mobile/index.js +1 -0
  89. package/esm/components/image-preview/Component.js +69 -26
  90. package/esm/components/image-preview/index.css +35 -28
  91. package/esm/components/image-preview/paths.d.ts +2 -0
  92. package/esm/components/image-preview/paths.js +2 -0
  93. package/esm/components/image-viewer/component.js +31 -11
  94. package/esm/components/image-viewer/index.css +37 -25
  95. package/esm/components/image-viewer/slide.js +3 -1
  96. package/esm/components/image-viewer/video/index.css +48 -0
  97. package/esm/components/image-viewer/video/index.d.ts +10 -0
  98. package/esm/components/image-viewer/video/index.js +119 -0
  99. package/esm/components/index.d.ts +2 -0
  100. package/esm/components/index.js +2 -0
  101. package/esm/components/info-bar/Component.d.ts +4 -0
  102. package/esm/components/info-bar/Component.js +39 -0
  103. package/esm/components/info-bar/index.css +37 -0
  104. package/esm/components/info-bar/index.d.ts +1 -0
  105. package/esm/components/info-bar/index.js +1 -0
  106. package/esm/components/navigation-bar/Component.js +3 -2
  107. package/esm/components/navigation-bar/index.css +8 -6
  108. package/esm/context.d.ts +7 -0
  109. package/esm/context.js +7 -0
  110. package/esm/index.css +17 -5
  111. package/esm/index.d.ts +1 -1
  112. package/esm/index.js +1 -3
  113. package/esm/{slide-7d5a41d1.js → slide-c469a906.js} +15 -5
  114. package/esm/types.d.ts +7 -0
  115. package/esm/utils/constants.d.ts +14 -1
  116. package/esm/utils/constants.js +14 -1
  117. package/esm/utils/index.js +2 -2
  118. package/esm/utils/utils.d.ts +2 -1
  119. package/esm/utils/utils.js +5 -4
  120. package/index.css +17 -5
  121. package/index.d.ts +1 -1
  122. package/index.js +1 -8
  123. package/modern/Component.js +39 -7
  124. package/modern/components/buttons/index.css +35 -0
  125. package/modern/{buttons-1859cb8e.d.ts → components/buttons/index.d.ts} +6 -1
  126. package/modern/components/buttons/index.js +33 -0
  127. package/modern/components/header/Component.js +27 -9
  128. package/modern/components/header/index.css +5 -19
  129. package/modern/components/header-info-block/Component.js +1 -1
  130. package/modern/components/header-info-block/index.css +5 -5
  131. package/modern/components/header-mobile/Component.d.ts +4 -0
  132. package/modern/components/header-mobile/Component.js +28 -0
  133. package/modern/components/header-mobile/index.css +50 -0
  134. package/modern/components/header-mobile/index.d.ts +1 -0
  135. package/modern/components/header-mobile/index.js +1 -0
  136. package/modern/components/image-preview/Component.js +65 -23
  137. package/modern/components/image-preview/index.css +35 -28
  138. package/modern/components/image-preview/paths.d.ts +2 -0
  139. package/modern/components/image-preview/paths.js +2 -0
  140. package/modern/components/image-viewer/component.js +31 -11
  141. package/modern/components/image-viewer/index.css +37 -25
  142. package/modern/components/image-viewer/slide.js +3 -1
  143. package/modern/components/image-viewer/video/index.css +48 -0
  144. package/modern/components/image-viewer/video/index.d.ts +10 -0
  145. package/modern/components/image-viewer/video/index.js +117 -0
  146. package/modern/components/index.d.ts +2 -0
  147. package/modern/components/index.js +2 -0
  148. package/modern/components/info-bar/Component.d.ts +4 -0
  149. package/modern/components/info-bar/Component.js +38 -0
  150. package/modern/components/info-bar/index.css +37 -0
  151. package/modern/components/info-bar/index.d.ts +1 -0
  152. package/modern/components/info-bar/index.js +1 -0
  153. package/modern/components/navigation-bar/Component.js +3 -2
  154. package/modern/components/navigation-bar/index.css +8 -6
  155. package/modern/context.d.ts +7 -0
  156. package/modern/context.js +7 -0
  157. package/modern/index.css +17 -5
  158. package/modern/index.d.ts +1 -1
  159. package/modern/index.js +1 -3
  160. package/modern/{slide-c47386c3.js → slide-83826e9d.js} +15 -5
  161. package/modern/types.d.ts +7 -0
  162. package/modern/utils/constants.d.ts +14 -1
  163. package/modern/utils/constants.js +14 -1
  164. package/modern/utils/index.js +2 -2
  165. package/modern/utils/utils.d.ts +2 -1
  166. package/modern/utils/utils.js +5 -4
  167. package/moderncssm/Component.js +38 -6
  168. package/moderncssm/components/buttons/index.d.ts +16 -0
  169. package/moderncssm/components/buttons/index.js +31 -0
  170. package/moderncssm/components/buttons/index.module.css +20 -0
  171. package/moderncssm/components/header/Component.js +24 -9
  172. package/moderncssm/components/header/index.module.css +0 -19
  173. package/moderncssm/components/header-mobile/Component.d.ts +4 -0
  174. package/moderncssm/components/header-mobile/Component.js +26 -0
  175. package/moderncssm/components/header-mobile/index.d.ts +1 -0
  176. package/moderncssm/components/header-mobile/index.js +1 -0
  177. package/moderncssm/components/header-mobile/index.module.css +35 -0
  178. package/moderncssm/components/image-preview/Component.js +64 -26
  179. package/moderncssm/components/image-preview/index.module.css +30 -13
  180. package/moderncssm/components/image-preview/paths.d.ts +2 -0
  181. package/moderncssm/components/image-preview/paths.js +2 -0
  182. package/moderncssm/components/image-viewer/component.js +30 -10
  183. package/moderncssm/components/image-viewer/index.module.css +29 -6
  184. package/moderncssm/components/image-viewer/slide.js +14 -4
  185. package/moderncssm/components/image-viewer/video/index.d.ts +10 -0
  186. package/moderncssm/components/image-viewer/video/index.js +115 -0
  187. package/moderncssm/components/image-viewer/video/index.module.css +36 -0
  188. package/moderncssm/components/index.d.ts +2 -0
  189. package/moderncssm/components/index.js +2 -0
  190. package/moderncssm/components/info-bar/Component.d.ts +4 -0
  191. package/moderncssm/components/info-bar/Component.js +36 -0
  192. package/moderncssm/components/info-bar/index.d.ts +1 -0
  193. package/moderncssm/components/info-bar/index.js +1 -0
  194. package/moderncssm/components/info-bar/index.module.css +23 -0
  195. package/moderncssm/components/navigation-bar/Component.js +2 -1
  196. package/moderncssm/components/navigation-bar/index.module.css +4 -0
  197. package/moderncssm/context.d.ts +7 -0
  198. package/moderncssm/context.js +7 -0
  199. package/moderncssm/index.d.ts +1 -1
  200. package/moderncssm/index.js +1 -3
  201. package/moderncssm/index.module.css +18 -2
  202. package/moderncssm/types.d.ts +7 -0
  203. package/moderncssm/utils/constants.d.ts +14 -1
  204. package/moderncssm/utils/constants.js +14 -1
  205. package/moderncssm/utils/index.js +2 -2
  206. package/moderncssm/utils/utils.d.ts +2 -1
  207. package/moderncssm/utils/utils.js +5 -4
  208. package/package.json +2 -1
  209. package/{slide-12155967.js → slide-07755478.js} +13 -3
  210. package/src/Component.tsx +48 -6
  211. package/src/components/buttons/index.module.css +21 -0
  212. package/src/components/{header/buttons.tsx → buttons/index.tsx} +77 -0
  213. package/src/components/header/Component.tsx +33 -10
  214. package/src/components/header/index.module.css +0 -20
  215. package/src/components/header-mobile/Component.tsx +57 -0
  216. package/src/components/header-mobile/index.module.css +35 -0
  217. package/src/components/header-mobile/index.ts +1 -0
  218. package/src/components/image-preview/Component.tsx +131 -28
  219. package/src/components/image-preview/index.module.css +28 -9
  220. package/src/components/image-preview/paths.ts +3 -0
  221. package/src/components/image-viewer/component.tsx +32 -11
  222. package/src/components/image-viewer/index.module.css +26 -3
  223. package/src/components/image-viewer/slide.tsx +30 -4
  224. package/src/components/image-viewer/video/index.module.css +36 -0
  225. package/src/components/image-viewer/video/index.tsx +159 -0
  226. package/src/components/index.ts +2 -0
  227. package/src/components/info-bar/Component.tsx +68 -0
  228. package/src/components/info-bar/index.module.css +23 -0
  229. package/src/components/info-bar/index.ts +1 -0
  230. package/src/components/navigation-bar/Component.tsx +2 -1
  231. package/src/components/navigation-bar/index.module.css +4 -0
  232. package/src/context.ts +14 -0
  233. package/src/index.module.css +18 -2
  234. package/src/index.ts +1 -1
  235. package/src/types.ts +15 -5
  236. package/src/utils/constants.ts +17 -0
  237. package/src/utils/utils.ts +5 -3
  238. package/types.d.ts +7 -0
  239. package/utils/constants.d.ts +14 -1
  240. package/utils/constants.js +19 -0
  241. package/utils/index.js +7 -0
  242. package/utils/utils.d.ts +2 -1
  243. package/utils/utils.js +5 -3
  244. package/buttons-ec113bb4.js +0 -37
  245. package/components/header/buttons.d.ts +0 -0
  246. package/components/header/buttons.js +0 -20
  247. package/cssm/components/header/buttons.js +0 -37
  248. package/esm/buttons-791da71e.js +0 -27
  249. package/esm/components/header/buttons.d.ts +0 -0
  250. package/esm/components/header/buttons.js +0 -9
  251. package/modern/buttons-1859cb8e.js +0 -20
  252. package/modern/components/header/buttons.d.ts +0 -0
  253. package/modern/components/header/buttons.js +0 -8
  254. package/moderncssm/components/header/buttons.d.ts +0 -11
  255. package/moderncssm/components/header/buttons.js +0 -18
  256. /package/esm/{slide-7d5a41d1.d.ts → slide-c469a906.d.ts} +0 -0
  257. /package/modern/{slide-c47386c3.d.ts → slide-83826e9d.d.ts} +0 -0
  258. /package/{slide-12155967.d.ts → slide-07755478.d.ts} +0 -0
@@ -2,3 +2,5 @@ export * from "./navigation-bar/index";
2
2
  export * from "./header/index";
3
3
  export * from "./image-preview/index";
4
4
  export * from "./image-viewer/index";
5
+ export * from "./info-bar/index";
6
+ export * from "./header-mobile/index";
@@ -2,3 +2,5 @@ export { NavigationBar } from './navigation-bar/Component.js';
2
2
  export { Header } from './header/Component.js';
3
3
  export { ImagePreview } from './image-preview/Component.js';
4
4
  export { ImageViewer } from './image-viewer/component.js';
5
+ export { InfoBar } from './info-bar/Component.js';
6
+ export { HeaderMobile } from './header-mobile/Component.js';
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ declare const InfoBar: () => React.JSX.Element;
4
+ export { InfoBar };
@@ -0,0 +1,38 @@
1
+ import React, { useContext, useCallback } from 'react';
2
+ import { Typography } from '@alfalab/core-components-typography/modern';
3
+ import { GalleryContext } from '../../context.js';
4
+ import { isVideo } from '../../utils/utils.js';
5
+ import { GALLERY_EVENTS } from '../../utils/constants.js';
6
+ import { Pause, Play, UnmuteVideo, MuteVideo } from '../buttons/index.js';
7
+
8
+ const styles = {"description":"gallery__description_1ne2b","videoButtons":"gallery__videoButtons_1ne2b","center":"gallery__center_1ne2b","right":"gallery__right_1ne2b"};
9
+ require('./index.css')
10
+
11
+ const InfoBar = () => {
12
+ const { getCurrentImage, mutedVideo, setMutedVideo, playingVideo, setPlayingVideo, getCurrentImageMeta, } = useContext(GalleryContext);
13
+ const image = getCurrentImage();
14
+ const meta = getCurrentImageMeta();
15
+ const handleMuteVideo = useCallback(() => {
16
+ if (mutedVideo) {
17
+ const customEvent = new CustomEvent(GALLERY_EVENTS.ON_UNMUTE, {
18
+ detail: { player: meta?.player?.current },
19
+ });
20
+ dispatchEvent(customEvent);
21
+ }
22
+ else {
23
+ const customEvent = new CustomEvent(GALLERY_EVENTS.ON_MUTE, {
24
+ detail: { player: meta?.player?.current },
25
+ });
26
+ dispatchEvent(customEvent);
27
+ }
28
+ setMutedVideo(!mutedVideo);
29
+ }, [meta?.player, mutedVideo, setMutedVideo]);
30
+ const handlePlayVideo = useCallback(() => {
31
+ setPlayingVideo(!playingVideo);
32
+ }, [playingVideo, setPlayingVideo]);
33
+ return isVideo(image?.src) ? (React.createElement("section", { className: styles.videoButtons },
34
+ playingVideo ? (React.createElement(Pause, { onClick: handlePlayVideo, className: styles.center })) : (React.createElement(Play, { onClick: handlePlayVideo, className: styles.center })),
35
+ mutedVideo ? (React.createElement(UnmuteVideo, { onClick: handleMuteVideo, className: styles.right })) : (React.createElement(MuteVideo, { onClick: handleMuteVideo, className: styles.right })))) : (React.createElement(Typography.Text, { className: styles.description, tag: 'div', view: 'component', color: 'primary-inverted' }, image?.name));
36
+ };
37
+
38
+ export { InfoBar };
@@ -0,0 +1,37 @@
1
+ /* hash: 1l3m4 */
2
+ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
+ } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
5
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
6
+ } :root {
7
+
8
+ /* Hard */
9
+
10
+ /* Up */
11
+
12
+ /* Hard up */
13
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
14
+
15
+ /* новые значения, используйте их */
16
+ } :root { /* deprecated */ /* deprecated */
17
+ --gap-xs: 8px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
18
+
19
+ /* новые значения, используйте их */
20
+ --gap-8: var(--gap-xs);
21
+ } :root {
22
+ } :root {
23
+ } /* сбрасывает синюю подсветку при нажатии */ .gallery__description_1ne2b {
24
+ text-align: center;
25
+ margin-bottom: var(--gap-8);
26
+ } .gallery__videoButtons_1ne2b {
27
+ padding: 0 var(--gap-8);
28
+ position: relative;
29
+ height: 48px;
30
+ } .gallery__center_1ne2b {
31
+ position: absolute;
32
+ left: 50%;
33
+ transform: translateX(-50%);
34
+ } .gallery__right_1ne2b {
35
+ position: absolute;
36
+ right: 0;
37
+ }
@@ -0,0 +1 @@
1
+ export { InfoBar } from "./Component";
@@ -0,0 +1 @@
1
+ export { InfoBar } from './Component.js';
@@ -4,17 +4,18 @@ import { getImageKey } from '../../utils/utils.js';
4
4
  import { TestIds } from '../../utils/constants.js';
5
5
  import { ImagePreview } from '../image-preview/Component.js';
6
6
 
7
- const styles = {"component":"gallery__component_1kepd","preview":"gallery__preview_1kepd"};
7
+ const styles = {"component":"gallery__component_d3a7v","previews":"gallery__previews_d3a7v","preview":"gallery__preview_d3a7v"};
8
8
  require('./index.css')
9
9
 
10
10
  const MIN_SCROLL_STEP = 24;
11
11
  const NavigationBar = () => {
12
12
  const containerRef = useRef(null);
13
- const { images, currentSlideIndex, setCurrentSlideIndex, getSwiper } = useContext(GalleryContext);
13
+ const { images, currentSlideIndex, setCurrentSlideIndex, getSwiper, setPlayingVideo } = useContext(GalleryContext);
14
14
  const swiper = getSwiper();
15
15
  const handlePreviewSelect = (index) => {
16
16
  setCurrentSlideIndex?.(index);
17
17
  if (swiper) {
18
+ setPlayingVideo(true);
18
19
  swiper.slideTo(index);
19
20
  }
20
21
  };
@@ -1,4 +1,4 @@
1
- /* hash: v7e7w */
1
+ /* hash: 16cqr */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -23,7 +23,7 @@
23
23
  --gap-24: var(--gap-xl);
24
24
  } :root {
25
25
  } :root {
26
- } /* сбрасывает синюю подсветку при нажатии */ .gallery__component_1kepd {
26
+ } /* сбрасывает синюю подсветку при нажатии */ .gallery__component_d3a7v {
27
27
  display: flex;
28
28
  flex-wrap: nowrap;
29
29
  align-content: center;
@@ -33,13 +33,15 @@
33
33
  box-sizing: border-box;
34
34
  padding: 10px var(--gap-24);
35
35
  scrollbar-width: none
36
- } .gallery__component_1kepd::-webkit-scrollbar {
36
+ } .gallery__component_d3a7v::-webkit-scrollbar {
37
37
  display: none;
38
- } .gallery__preview_1kepd {
38
+ } .gallery__previews_d3a7v {
39
+ display: flex;
40
+ } .gallery__preview_d3a7v {
39
41
  flex-shrink: 0;
40
42
  margin: var(--gap-0) var(--gap-2)
41
- } .gallery__preview_1kepd:first-child {
43
+ } .gallery__preview_d3a7v:first-child {
42
44
  margin-left: auto;
43
- } .gallery__preview_1kepd:last-child {
45
+ } .gallery__preview_d3a7v:last-child {
44
46
  margin-right: auto;
45
47
  }
@@ -2,13 +2,20 @@
2
2
  import SwiperCore from 'swiper';
3
3
  import { GalleryImage, ImageMeta } from "./types";
4
4
  type GalleryContext = {
5
+ view: 'desktop' | 'mobile';
5
6
  singleSlide: boolean;
6
7
  currentSlideIndex: number;
7
8
  images: GalleryImage[];
8
9
  imagesMeta: ImageMeta[];
9
10
  fullScreen: boolean;
11
+ mutedVideo: boolean;
12
+ playingVideo: boolean;
13
+ hideNavigation: boolean;
14
+ setHideNavigation: (hideNavigation: boolean) => void;
10
15
  initialSlide: number;
11
16
  setFullScreen: (fullScreen: boolean) => void;
17
+ setMutedVideo: (muteVideo: boolean) => void;
18
+ setPlayingVideo: (playingVideo: boolean) => void;
12
19
  setImageMeta: (meta: ImageMeta, index: number) => void;
13
20
  slideTo: (index: number) => void;
14
21
  slideNext: () => void;
package/modern/context.js CHANGED
@@ -3,11 +3,18 @@ import { createContext } from 'react';
3
3
  const mockFn = () => undefined;
4
4
  // eslint-disable-next-line @typescript-eslint/no-redeclare
5
5
  const GalleryContext = createContext({
6
+ view: 'desktop',
6
7
  singleSlide: false,
7
8
  currentSlideIndex: 0,
8
9
  images: [],
9
10
  imagesMeta: [],
10
11
  fullScreen: false,
12
+ mutedVideo: false,
13
+ playingVideo: false,
14
+ hideNavigation: false,
15
+ setHideNavigation: mockFn,
16
+ setMutedVideo: mockFn,
17
+ setPlayingVideo: mockFn,
11
18
  initialSlide: 0,
12
19
  setFullScreen: mockFn,
13
20
  setImageMeta: mockFn,
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: avtqd */
1
+ /* hash: 105bj */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-static-neutral-0-inverted: #262629; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -19,16 +19,28 @@
19
19
  /* новые значения, используйте их */
20
20
  } :root {
21
21
  } :root {
22
- } /* сбрасывает синюю подсветку при нажатии */ .gallery__container_1s8yu {
22
+ } /* сбрасывает синюю подсветку при нажатии */ .gallery__container_1gntr {
23
+ position: relative;
24
+ overflow: hidden;
23
25
  display: flex;
24
26
  flex-direction: column;
25
27
  justify-content: space-between;
26
28
  height: 100%;
27
29
  width: 100%;
28
30
  background-color: var(--color-static-neutral-0-inverted);
29
- } .gallery__modal_1s8yu {
31
+ } .gallery__modal_1gntr {
30
32
  flex-grow: 1;
31
- width: 100%;
32
- height: 100%;
33
+ width: 100vw;
34
+ height: 100vh;
33
35
  background: transparent;
36
+ } .gallery__navigationVideo_1gntr {
37
+ background-color: var(--color-static-neutral-0-inverted);
38
+ z-index: 3;
39
+ width: 100%;
40
+ position: absolute;
41
+ bottom: 0;
42
+ left: 0;
43
+ transition: transform 0.3s ease-in-out;
44
+ } .gallery__hideNavigation_1gntr {
45
+ transform: translateY(106px);
34
46
  }
package/modern/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from "./Component";
2
- export * from "./utils/index";
2
+ export { GALLERY_EVENTS, TestIds } from "./utils/index";
package/modern/index.js CHANGED
@@ -1,4 +1,2 @@
1
1
  export { Gallery } from './Component.js';
2
- export { splitFilename } from './utils/split-filename.js';
3
- export { PLACEHOLDER_HEIGHT, PLACEHOLDER_WIDTH, getImageAlt, getImageKey, isSmallImage } from './utils/utils.js';
4
- export { TestIds } from './utils/constants.js';
2
+ export { GALLERY_EVENTS, TestIds } from './utils/constants.js';
@@ -1,32 +1,42 @@
1
- import React from 'react';
1
+ import React, { useContext } from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Typography } from '@alfalab/core-components-typography/modern';
4
- import { isSmallImage, getImageAlt } from './utils/utils.js';
4
+ import { GalleryContext } from './context.js';
5
+ import { isSmallImage, isVideo, getImageAlt } from './utils/utils.js';
5
6
  import { TestIds } from './utils/constants.js';
6
7
  import { NoImagePaths } from './components/image-viewer/paths.js';
8
+ import { Video } from './components/image-viewer/video/index.js';
7
9
 
8
- const styles = {"component":"gallery__component_i28al","swiper":"gallery__swiper_i28al","singleSlide":"gallery__singleSlide_i28al","hidden":"gallery__hidden_i28al","slide":"gallery__slide_i28al","slideLoading":"gallery__slideLoading_i28al","image":"gallery__image_i28al","smallImage":"gallery__smallImage_i28al","verticalImageFit":"gallery__verticalImageFit_i28al","horizontalImageFit":"gallery__horizontalImageFit_i28al","arrow":"gallery__arrow_i28al","focused":"gallery__focused_i28al","placeholder":"gallery__placeholder_i28al","brokenImgWrapper":"gallery__brokenImgWrapper_i28al","brokenImgIcon":"gallery__brokenImgIcon_i28al","fullScreenImage":"gallery__fullScreenImage_i28al"};
10
+ const styles = {"component":"gallery__component_3twvn","swiper":"gallery__swiper_3twvn","mobile":"gallery__mobile_3twvn","mobileVideo":"gallery__mobileVideo_3twvn","singleSlide":"gallery__singleSlide_3twvn","hidden":"gallery__hidden_3twvn","slide":"gallery__slide_3twvn","slideLoading":"gallery__slideLoading_3twvn","image":"gallery__image_3twvn","smallImage":"gallery__smallImage_3twvn","verticalImageFit":"gallery__verticalImageFit_3twvn","horizontalImageFit":"gallery__horizontalImageFit_3twvn","arrow":"gallery__arrow_3twvn","focused":"gallery__focused_3twvn","placeholder":"gallery__placeholder_3twvn","brokenImgWrapper":"gallery__brokenImgWrapper_3twvn","brokenImgIcon":"gallery__brokenImgIcon_3twvn","fullScreenImage":"gallery__fullScreenImage_3twvn","fullScreenVideo":"gallery__fullScreenVideo_3twvn"};
9
11
  require('./components/image-viewer/index.css')
10
12
 
11
- const SlideInner = ({ children, broken, loading, withPlaceholder }) => {
13
+ const SlideInner = ({ children, broken, loading, withPlaceholder, isVideoView, }) => {
12
14
  const content = broken ? (React.createElement("div", { className: styles.brokenImgWrapper },
13
15
  React.createElement("div", { className: styles.brokenImgIcon },
14
16
  React.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', width: '80', height: '80', viewBox: '0 0 80 80', fill: 'none' },
15
17
  React.createElement("rect", { width: '80', height: '80', fill: 'none' }),
16
18
  React.createElement("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: NoImagePaths.baseImage, fill: '#89898A' }),
17
19
  React.createElement("path", { d: NoImagePaths.triangleImage, fill: '#89898A' }))),
18
- React.createElement(Typography.Text, { view: 'primary-small', color: 'static-secondary-light' }, "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435"))) : (children);
20
+ React.createElement(Typography.Text, { view: 'primary-small', color: 'static-secondary-light' },
21
+ "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C ",
22
+ isVideoView ? 'видео' : 'изображение'))) : (children);
19
23
  return (React.createElement("div", { className: cn(styles.slide, { [styles.slideLoading]: loading }) }, withPlaceholder ? React.createElement("div", { className: styles.placeholder }, content) : content));
20
24
  };
21
25
  const Slide = ({ isActive, meta, swiperAspectRatio, imageAspectRatio, image, index, swiperHeight, slideVisible, handleLoad, handleLoadError, }) => {
26
+ const { view } = useContext(GalleryContext);
22
27
  const broken = Boolean(meta?.broken);
23
28
  const small = isSmallImage(meta);
24
29
  const verticalImageFit = !small && swiperAspectRatio > imageAspectRatio;
25
30
  const horizontalImageFit = !small && swiperAspectRatio <= imageAspectRatio;
31
+ if (isVideo(image.src)) {
32
+ return (React.createElement(SlideInner, { isVideoView: true, active: isActive, broken: broken, withPlaceholder: broken, loading: !meta },
33
+ React.createElement(Video, { url: image.src, index: index, isActive: isActive })));
34
+ }
26
35
  return (React.createElement(SlideInner, { active: isActive, broken: broken, loading: !meta, withPlaceholder: small || broken },
27
36
  React.createElement("img", { src: image.src, alt: getImageAlt(image, index), className: cn({
28
37
  [styles.smallImage]: small,
29
38
  [styles.image]: !small && meta,
39
+ [styles.mobile]: view === 'mobile',
30
40
  [styles.verticalImageFit]: verticalImageFit,
31
41
  [styles.horizontalImageFit]: horizontalImageFit,
32
42
  }), onLoad: (event) => handleLoad(event, index), onError: () => handleLoadError(index), style: {
package/modern/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { RefObject } from 'react';
1
2
  type GalleryImage = {
2
3
  src: string;
3
4
  name?: string;
@@ -9,5 +10,11 @@ type ImageMeta = {
9
10
  width: number;
10
11
  height: number;
11
12
  broken?: boolean;
13
+ player?: never;
14
+ } | {
15
+ width?: never;
16
+ height?: never;
17
+ broken?: boolean;
18
+ player: RefObject<HTMLVideoElement>;
12
19
  };
13
20
  export { GalleryImage, ImageMeta };
@@ -7,5 +7,18 @@ declare const TestIds: {
7
7
  EXIT_FULLSCREEN_BUTTON: string;
8
8
  DOWNLOAD_BUTTON: string;
9
9
  NAVIGATION_BAR: string;
10
+ MUTE_BUTTON: string;
11
+ UNMUTE_BUTTON: string;
10
12
  };
11
- export { TestIds };
13
+ declare const PREVIEW_WIDTH_MOBILE = 36;
14
+ declare const PREVIEW_HEIGHT_MOBILE = 46;
15
+ declare const PREVIEW_WIDTH_DESKTOP = 56;
16
+ declare const PREVIEW_HEIGHT_DESKTOP = 56;
17
+ declare const PREVIEW_VIDEO_MULTIPLIER = 12;
18
+ declare const GALLERY_EVENTS: {
19
+ ON_PLAY: string;
20
+ ON_PAUSE: string;
21
+ ON_MUTE: string;
22
+ ON_UNMUTE: string;
23
+ };
24
+ export { TestIds, PREVIEW_WIDTH_MOBILE, PREVIEW_HEIGHT_MOBILE, PREVIEW_WIDTH_DESKTOP, PREVIEW_HEIGHT_DESKTOP, PREVIEW_VIDEO_MULTIPLIER, GALLERY_EVENTS };
@@ -7,6 +7,19 @@ const TestIds = {
7
7
  EXIT_FULLSCREEN_BUTTON: 'exit-fullscreen-button',
8
8
  DOWNLOAD_BUTTON: 'download-button',
9
9
  NAVIGATION_BAR: 'navigation-bar',
10
+ MUTE_BUTTON: 'mute-button',
11
+ UNMUTE_BUTTON: 'unmute-button',
12
+ };
13
+ const PREVIEW_WIDTH_MOBILE = 36;
14
+ const PREVIEW_HEIGHT_MOBILE = 46;
15
+ const PREVIEW_WIDTH_DESKTOP = 56;
16
+ const PREVIEW_HEIGHT_DESKTOP = 56;
17
+ const PREVIEW_VIDEO_MULTIPLIER = 12;
18
+ const GALLERY_EVENTS = {
19
+ ON_PLAY: 'Gallery:OnPlay',
20
+ ON_PAUSE: 'Gallery:OnPause',
21
+ ON_MUTE: 'Gallery:OnMute',
22
+ ON_UNMUTE: 'Gallery:OnUnmute',
10
23
  };
11
24
 
12
- export { TestIds };
25
+ export { GALLERY_EVENTS, PREVIEW_HEIGHT_DESKTOP, PREVIEW_HEIGHT_MOBILE, PREVIEW_VIDEO_MULTIPLIER, PREVIEW_WIDTH_DESKTOP, PREVIEW_WIDTH_MOBILE, TestIds };
@@ -1,3 +1,3 @@
1
1
  export { splitFilename } from './split-filename.js';
2
- export { PLACEHOLDER_HEIGHT, PLACEHOLDER_WIDTH, getImageAlt, getImageKey, isSmallImage } from './utils.js';
3
- export { TestIds } from './constants.js';
2
+ export { PLACEHOLDER_HEIGHT, PLACEHOLDER_WIDTH, getImageAlt, getImageKey, isSmallImage, isVideo } from './utils.js';
3
+ export { GALLERY_EVENTS, PREVIEW_HEIGHT_DESKTOP, PREVIEW_HEIGHT_MOBILE, PREVIEW_VIDEO_MULTIPLIER, PREVIEW_WIDTH_DESKTOP, PREVIEW_WIDTH_MOBILE, TestIds } from './constants.js';
@@ -4,4 +4,5 @@ declare const PLACEHOLDER_HEIGHT = 300;
4
4
  declare const getImageKey: ({ name, src }: GalleryImage, index: number) => string;
5
5
  declare const getImageAlt: ({ alt, name }: GalleryImage, index: number) => string;
6
6
  declare const isSmallImage: (meta?: ImageMeta) => boolean;
7
- export { PLACEHOLDER_WIDTH, PLACEHOLDER_HEIGHT, getImageKey, getImageAlt, isSmallImage };
7
+ declare const isVideo: (url: string | undefined) => boolean;
8
+ export { PLACEHOLDER_WIDTH, PLACEHOLDER_HEIGHT, getImageKey, getImageAlt, isSmallImage, isVideo };
@@ -3,10 +3,11 @@ const PLACEHOLDER_HEIGHT = 300;
3
3
  const getImageKey = ({ name = '', src }, index) => `${name}-${index}-${src}`;
4
4
  const getImageAlt = ({ alt, name }, index) => alt || name || `Изображение ${index + 1}`;
5
5
  const isSmallImage = (meta) => {
6
- if (!meta) {
7
- return false;
6
+ if (meta && meta.width && meta.height) {
7
+ return meta.width < PLACEHOLDER_WIDTH && meta.height < PLACEHOLDER_HEIGHT;
8
8
  }
9
- return meta.width < PLACEHOLDER_WIDTH && meta.height < PLACEHOLDER_HEIGHT;
9
+ return false;
10
10
  };
11
+ const isVideo = (url) => /(.*?)(\.webm|\.mp4|\.m3u8)$/.test(url ?? '');
11
12
 
12
- export { PLACEHOLDER_HEIGHT, PLACEHOLDER_WIDTH, getImageAlt, getImageKey, isSmallImage };
13
+ export { PLACEHOLDER_HEIGHT, PLACEHOLDER_WIDTH, getImageAlt, getImageKey, isSmallImage, isVideo };
@@ -1,14 +1,20 @@
1
1
  import React, { useState, useCallback, useEffect } from 'react';
2
+ import cn from 'classnames';
2
3
  import { BaseModal } from '@alfalab/core-components-base-modal/moderncssm';
4
+ import { useMedia } from '@alfalab/hooks';
3
5
  import { NavigationBar } from './components/navigation-bar/Component.js';
4
6
  import { Header } from './components/header/Component.js';
5
- import 'classnames';
6
- import '@alfalab/hooks';
7
7
  import { GalleryContext } from './context.js';
8
8
  import './components/image-preview/index.module.css';
9
9
  import { ImageViewer } from './components/image-viewer/component.js';
10
+ import { InfoBar } from './components/info-bar/Component.js';
11
+ import { HeaderMobile } from './components/header-mobile/Component.js';
10
12
  import styles from './index.module.css';
11
13
 
14
+ const DEFAULT_FULL_SCREEN = false;
15
+ const DEFAULT_MUTED_VIDEO = true;
16
+ const DEFAULT_PLAYING_VIDEO = true;
17
+ const DEFAULT_HIDE_NAVIGATION = false;
12
18
  const Backdrop = () => null;
13
19
  const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onClose, onSlideIndexChange, }) => {
14
20
  const currentSlideIndexState = useState(initialSlide);
@@ -18,11 +24,21 @@ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onCl
18
24
  : [slideIndex, onSlideIndexChange];
19
25
  const [swiper, setSwiper] = useState();
20
26
  const [imagesMeta, setImagesMeta] = useState([]);
21
- const [fullScreen, setFullScreen] = useState(false);
27
+ const [fullScreen, setFullScreen] = useState(DEFAULT_FULL_SCREEN);
28
+ const [mutedVideo, setMutedVideo] = useState(DEFAULT_MUTED_VIDEO);
29
+ const [playingVideo, setPlayingVideo] = useState(DEFAULT_PLAYING_VIDEO);
30
+ const [hideNavigation, setHideNavigation] = useState(DEFAULT_HIDE_NAVIGATION);
31
+ const [view] = useMedia([
32
+ ['mobile', '(max-width: 1023px)'],
33
+ ['desktop', '(min-width: 1024px)'],
34
+ ], 'desktop');
35
+ const isMobile = view === 'mobile';
36
+ const isCurrentVideo = !!imagesMeta[currentSlideIndex]?.player?.current;
22
37
  const slideTo = useCallback((index) => {
23
38
  if (images[index]) {
24
39
  setCurrentSlideIndex?.(index);
25
40
  if (swiper) {
41
+ setPlayingVideo(true);
26
42
  swiper.slideTo(index);
27
43
  }
28
44
  }
@@ -75,6 +91,10 @@ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onCl
75
91
  break;
76
92
  }
77
93
  }, [fullScreen, open, slideNext, slidePrev]);
94
+ const onUnmount = useCallback(() => {
95
+ setPlayingVideo(DEFAULT_PLAYING_VIDEO);
96
+ setMutedVideo(DEFAULT_MUTED_VIDEO);
97
+ }, [setPlayingVideo]);
78
98
  useEffect(() => {
79
99
  if (!uncontrolled && !swiper?.destroyed) {
80
100
  swiper?.slideTo(currentSlideIndex);
@@ -90,6 +110,7 @@ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onCl
90
110
  const showNavigationBar = !singleSlide && !fullScreen;
91
111
  // eslint-disable-next-line react/jsx-no-constructed-context-values
92
112
  const galleryContext = {
113
+ view,
93
114
  singleSlide,
94
115
  currentSlideIndex,
95
116
  images,
@@ -97,6 +118,12 @@ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onCl
97
118
  fullScreen,
98
119
  initialSlide: uncontrolled ? initialSlide : currentSlideIndex,
99
120
  setFullScreen,
121
+ playingVideo,
122
+ setPlayingVideo,
123
+ mutedVideo,
124
+ setMutedVideo,
125
+ hideNavigation,
126
+ setHideNavigation,
100
127
  setImageMeta,
101
128
  slideNext,
102
129
  slidePrev,
@@ -109,11 +136,16 @@ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onCl
109
136
  getCurrentImageMeta: () => imagesMeta[currentSlideIndex],
110
137
  };
111
138
  return (React.createElement(GalleryContext.Provider, { value: galleryContext },
112
- React.createElement(BaseModal, { open: open, className: styles.modal, onEscapeKeyDown: handleEscapeKeyDown, Backdrop: Backdrop },
139
+ React.createElement(BaseModal, { open: open, className: styles.modal, onEscapeKeyDown: handleEscapeKeyDown, Backdrop: Backdrop, onUnmount: onUnmount },
113
140
  React.createElement("div", { className: styles.container },
114
- React.createElement(Header, null),
141
+ view === 'desktop' ? React.createElement(Header, null) : React.createElement(HeaderMobile, null),
115
142
  React.createElement(ImageViewer, null),
116
- showNavigationBar && React.createElement(NavigationBar, null)))));
143
+ React.createElement("nav", { className: cn({
144
+ [styles.navigationVideo]: isCurrentVideo && isMobile,
145
+ [styles.hideNavigation]: hideNavigation && isMobile,
146
+ }) },
147
+ showNavigationBar && React.createElement(NavigationBar, null),
148
+ view === 'mobile' && React.createElement(InfoBar, null))))));
117
149
  };
118
150
 
119
151
  export { Gallery };