@alfalab/core-components-gallery 7.2.3 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Component.js +51 -7
- package/Component.js.map +1 -1
- package/components/bottom-button/index.css +5 -5
- package/components/bottom-button/index.module.css.js +1 -1
- package/components/buttons/index.css +5 -5
- package/components/buttons/index.d.ts +3 -1
- package/components/buttons/index.js +49 -12
- package/components/buttons/index.js.map +1 -1
- package/components/buttons/index.module.css.js +1 -1
- package/components/header/Component.js +1 -0
- package/components/header/Component.js.map +1 -1
- package/components/header/index.css +3 -2
- package/components/header/index.module.css.js +1 -1
- package/components/header/index.module.css.js.map +1 -1
- package/components/header-info-block/Component.js +2 -1
- package/components/header-info-block/Component.js.map +1 -1
- package/components/header-info-block/index.css +4 -4
- package/components/header-info-block/index.module.css.js +1 -1
- package/components/header-mobile/index.css +6 -6
- package/components/header-mobile/index.module.css.js +1 -1
- package/components/image-preview/Component.js +2 -1
- package/components/image-preview/Component.js.map +1 -1
- package/components/image-preview/index.css +20 -20
- package/components/image-preview/index.module.css.js +1 -1
- package/components/image-preview/index.module.css.js.map +1 -1
- package/components/image-viewer/hooks.js +3 -2
- package/components/image-viewer/hooks.js.map +1 -1
- package/components/image-viewer/index.css +30 -31
- package/components/image-viewer/index.module.css.js +1 -1
- package/components/image-viewer/index.module.css.js.map +1 -1
- package/components/image-viewer/single.js +1 -0
- package/components/image-viewer/single.js.map +1 -1
- package/components/image-viewer/slide.js +3 -2
- package/components/image-viewer/slide.js.map +1 -1
- package/components/image-viewer/video/index.css +22 -10
- package/components/image-viewer/video/index.js +50 -15
- package/components/image-viewer/video/index.js.map +1 -1
- package/components/image-viewer/video/index.module.css.js +1 -1
- package/components/image-viewer/video/index.module.css.js.map +1 -1
- package/components/info-bar/Component.js +1 -0
- package/components/info-bar/Component.js.map +1 -1
- package/components/info-bar/index.css +3 -3
- package/components/info-bar/index.module.css.js +1 -1
- package/components/navigation-bar/Component.js +56 -26
- package/components/navigation-bar/Component.js.map +1 -1
- package/components/navigation-bar/index.css +21 -11
- package/components/navigation-bar/index.module.css.js +1 -1
- package/components/navigation-bar/index.module.css.js.map +1 -1
- package/components/subtitles/index.css +3 -3
- package/components/subtitles/index.module.css.js +1 -1
- package/constants.d.ts +1 -1
- package/constants.js +1 -1
- package/constants.js.map +1 -1
- package/cssm/Component.js +51 -7
- package/cssm/Component.js.map +1 -1
- package/cssm/components/buttons/index.d.ts +3 -1
- package/cssm/components/buttons/index.js +54 -17
- package/cssm/components/buttons/index.js.map +1 -1
- package/cssm/components/header/Component.js +1 -0
- package/cssm/components/header/Component.js.map +1 -1
- package/cssm/components/header/index.module.css +2 -1
- package/cssm/components/header-info-block/Component.js +2 -1
- package/cssm/components/header-info-block/Component.js.map +1 -1
- package/cssm/components/image-preview/Component.js +2 -1
- package/cssm/components/image-preview/Component.js.map +1 -1
- package/cssm/components/image-preview/index.module.css +3 -3
- package/cssm/components/image-viewer/hooks.js +3 -2
- package/cssm/components/image-viewer/hooks.js.map +1 -1
- package/cssm/components/image-viewer/index.module.css +2 -3
- package/cssm/components/image-viewer/single.js +1 -0
- package/cssm/components/image-viewer/single.js.map +1 -1
- package/cssm/components/image-viewer/slide.js +3 -2
- package/cssm/components/image-viewer/slide.js.map +1 -1
- package/cssm/components/image-viewer/video/index.js +50 -15
- package/cssm/components/image-viewer/video/index.js.map +1 -1
- package/cssm/components/image-viewer/video/index.module.css +15 -3
- package/cssm/components/info-bar/Component.js +1 -0
- package/cssm/components/info-bar/Component.js.map +1 -1
- package/cssm/components/navigation-bar/Component.js +56 -26
- package/cssm/components/navigation-bar/Component.js.map +1 -1
- package/cssm/components/navigation-bar/index.module.css +13 -3
- package/cssm/constants.d.ts +1 -1
- package/cssm/constants.js +1 -1
- package/cssm/constants.js.map +1 -1
- package/cssm/hooks/use-custom-subtitles.js +57 -11
- package/cssm/hooks/use-custom-subtitles.js.map +1 -1
- package/cssm/index.js +1 -0
- package/cssm/index.js.map +1 -1
- package/cssm/types.d.ts +4 -2
- package/cssm/utils/index.d.ts +1 -0
- package/cssm/utils/index.js +2 -0
- package/cssm/utils/index.js.map +1 -1
- package/cssm/utils/modern-download.d.ts +6 -0
- package/cssm/utils/modern-download.js +113 -0
- package/cssm/utils/modern-download.js.map +1 -0
- package/esm/Component.js +51 -7
- package/esm/Component.js.map +1 -1
- package/esm/components/bottom-button/index.css +5 -5
- package/esm/components/bottom-button/index.module.css.js +1 -1
- package/esm/components/buttons/index.css +5 -5
- package/esm/components/buttons/index.d.ts +3 -1
- package/esm/components/buttons/index.js +50 -13
- package/esm/components/buttons/index.js.map +1 -1
- package/esm/components/buttons/index.module.css.js +1 -1
- package/esm/components/header/Component.js +1 -0
- package/esm/components/header/Component.js.map +1 -1
- package/esm/components/header/index.css +3 -2
- package/esm/components/header/index.module.css.js +1 -1
- package/esm/components/header/index.module.css.js.map +1 -1
- package/esm/components/header-info-block/Component.js +2 -1
- package/esm/components/header-info-block/Component.js.map +1 -1
- package/esm/components/header-info-block/index.css +4 -4
- package/esm/components/header-info-block/index.module.css.js +1 -1
- package/esm/components/header-mobile/index.css +6 -6
- package/esm/components/header-mobile/index.module.css.js +1 -1
- package/esm/components/image-preview/Component.js +2 -1
- package/esm/components/image-preview/Component.js.map +1 -1
- package/esm/components/image-preview/index.css +20 -20
- package/esm/components/image-preview/index.module.css.js +1 -1
- package/esm/components/image-preview/index.module.css.js.map +1 -1
- package/esm/components/image-viewer/hooks.js +3 -2
- package/esm/components/image-viewer/hooks.js.map +1 -1
- package/esm/components/image-viewer/index.css +30 -31
- package/esm/components/image-viewer/index.module.css.js +1 -1
- package/esm/components/image-viewer/index.module.css.js.map +1 -1
- package/esm/components/image-viewer/single.js +1 -0
- package/esm/components/image-viewer/single.js.map +1 -1
- package/esm/components/image-viewer/slide.js +3 -2
- package/esm/components/image-viewer/slide.js.map +1 -1
- package/esm/components/image-viewer/video/index.css +22 -10
- package/esm/components/image-viewer/video/index.js +51 -16
- package/esm/components/image-viewer/video/index.js.map +1 -1
- package/esm/components/image-viewer/video/index.module.css.js +1 -1
- package/esm/components/image-viewer/video/index.module.css.js.map +1 -1
- package/esm/components/info-bar/Component.js +1 -0
- package/esm/components/info-bar/Component.js.map +1 -1
- package/esm/components/info-bar/index.css +3 -3
- package/esm/components/info-bar/index.module.css.js +1 -1
- package/esm/components/navigation-bar/Component.js +56 -25
- package/esm/components/navigation-bar/Component.js.map +1 -1
- package/esm/components/navigation-bar/index.css +21 -11
- package/esm/components/navigation-bar/index.module.css.js +1 -1
- package/esm/components/navigation-bar/index.module.css.js.map +1 -1
- package/esm/components/subtitles/index.css +3 -3
- package/esm/components/subtitles/index.module.css.js +1 -1
- package/esm/constants.d.ts +1 -1
- package/esm/constants.js +1 -1
- package/esm/constants.js.map +1 -1
- package/esm/hooks/use-custom-subtitles.js +57 -11
- package/esm/hooks/use-custom-subtitles.js.map +1 -1
- package/esm/index.css +9 -9
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/index.module.css.js +1 -1
- package/esm/types.d.ts +4 -2
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/index.js +1 -0
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/modern-download.d.ts +6 -0
- package/esm/utils/modern-download.js +109 -0
- package/esm/utils/modern-download.js.map +1 -0
- package/hooks/use-custom-subtitles.js +57 -11
- package/hooks/use-custom-subtitles.js.map +1 -1
- package/index.css +9 -9
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.module.css.js +1 -1
- package/modern/Component.js +50 -7
- package/modern/Component.js.map +1 -1
- package/modern/components/bottom-button/index.css +5 -5
- package/modern/components/bottom-button/index.module.css.js +1 -1
- package/modern/components/buttons/index.css +5 -5
- package/modern/components/buttons/index.d.ts +3 -1
- package/modern/components/buttons/index.js +51 -12
- package/modern/components/buttons/index.js.map +1 -1
- package/modern/components/buttons/index.module.css.js +1 -1
- package/modern/components/header/index.css +3 -2
- package/modern/components/header/index.module.css.js +1 -1
- package/modern/components/header/index.module.css.js.map +1 -1
- package/modern/components/header-info-block/Component.js +1 -1
- package/modern/components/header-info-block/Component.js.map +1 -1
- package/modern/components/header-info-block/index.css +4 -4
- package/modern/components/header-info-block/index.module.css.js +1 -1
- package/modern/components/header-mobile/index.css +6 -6
- package/modern/components/header-mobile/index.module.css.js +1 -1
- package/modern/components/image-preview/Component.js +1 -1
- package/modern/components/image-preview/Component.js.map +1 -1
- package/modern/components/image-preview/index.css +20 -20
- package/modern/components/image-preview/index.module.css.js +1 -1
- package/modern/components/image-preview/index.module.css.js.map +1 -1
- package/modern/components/image-viewer/hooks.js +3 -2
- package/modern/components/image-viewer/hooks.js.map +1 -1
- package/modern/components/image-viewer/index.css +30 -31
- package/modern/components/image-viewer/index.module.css.js +1 -1
- package/modern/components/image-viewer/index.module.css.js.map +1 -1
- package/modern/components/image-viewer/slide.js +2 -2
- package/modern/components/image-viewer/slide.js.map +1 -1
- package/modern/components/image-viewer/video/index.css +22 -10
- package/modern/components/image-viewer/video/index.js +47 -12
- package/modern/components/image-viewer/video/index.js.map +1 -1
- package/modern/components/image-viewer/video/index.module.css.js +1 -1
- package/modern/components/image-viewer/video/index.module.css.js.map +1 -1
- package/modern/components/info-bar/index.css +3 -3
- package/modern/components/info-bar/index.module.css.js +1 -1
- package/modern/components/navigation-bar/Component.js +55 -25
- package/modern/components/navigation-bar/Component.js.map +1 -1
- package/modern/components/navigation-bar/index.css +21 -11
- package/modern/components/navigation-bar/index.module.css.js +1 -1
- package/modern/components/navigation-bar/index.module.css.js.map +1 -1
- package/modern/components/subtitles/index.css +3 -3
- package/modern/components/subtitles/index.module.css.js +1 -1
- package/modern/constants.d.ts +1 -1
- package/modern/constants.js +1 -1
- package/modern/constants.js.map +1 -1
- package/modern/hooks/use-custom-subtitles.js +56 -9
- package/modern/hooks/use-custom-subtitles.js.map +1 -1
- package/modern/index.css +9 -9
- package/modern/index.module.css.js +1 -1
- package/modern/types.d.ts +4 -2
- package/modern/utils/index.d.ts +1 -0
- package/modern/utils/index.js +1 -0
- package/modern/utils/index.js.map +1 -1
- package/modern/utils/modern-download.d.ts +6 -0
- package/modern/utils/modern-download.js +76 -0
- package/modern/utils/modern-download.js.map +1 -0
- package/moderncssm/Component.js +50 -7
- package/moderncssm/Component.js.map +1 -1
- package/moderncssm/components/buttons/index.d.ts +3 -1
- package/moderncssm/components/buttons/index.js +51 -12
- package/moderncssm/components/buttons/index.js.map +1 -1
- package/moderncssm/components/header/index.module.css +1 -1
- package/moderncssm/components/header-info-block/Component.js +1 -1
- package/moderncssm/components/header-info-block/Component.js.map +1 -1
- package/moderncssm/components/image-preview/Component.js +1 -1
- package/moderncssm/components/image-preview/Component.js.map +1 -1
- package/moderncssm/components/image-preview/index.module.css +2 -2
- package/moderncssm/components/image-viewer/hooks.js +3 -2
- package/moderncssm/components/image-viewer/hooks.js.map +1 -1
- package/moderncssm/components/image-viewer/index.module.css +2 -2
- package/moderncssm/components/image-viewer/slide.js +2 -2
- package/moderncssm/components/image-viewer/slide.js.map +1 -1
- package/moderncssm/components/image-viewer/video/index.js +47 -12
- package/moderncssm/components/image-viewer/video/index.js.map +1 -1
- package/moderncssm/components/image-viewer/video/index.module.css +16 -3
- package/moderncssm/components/navigation-bar/Component.js +55 -25
- package/moderncssm/components/navigation-bar/Component.js.map +1 -1
- package/moderncssm/components/navigation-bar/index.module.css +14 -2
- package/moderncssm/constants.d.ts +1 -1
- package/moderncssm/constants.js +1 -1
- package/moderncssm/constants.js.map +1 -1
- package/moderncssm/hooks/use-custom-subtitles.js +56 -9
- package/moderncssm/hooks/use-custom-subtitles.js.map +1 -1
- package/moderncssm/types.d.ts +4 -2
- package/moderncssm/utils/index.d.ts +1 -0
- package/moderncssm/utils/index.js +1 -0
- package/moderncssm/utils/index.js.map +1 -1
- package/moderncssm/utils/modern-download.d.ts +6 -0
- package/moderncssm/utils/modern-download.js +76 -0
- package/moderncssm/utils/modern-download.js.map +1 -0
- package/package.json +2 -2
- package/src/Component.tsx +63 -6
- package/src/components/buttons/index.tsx +157 -62
- package/src/components/header/index.module.css +1 -1
- package/src/components/header-info-block/Component.tsx +2 -2
- package/src/components/image-preview/Component.tsx +1 -1
- package/src/components/image-preview/index.module.css +2 -2
- package/src/components/image-viewer/hooks.ts +3 -2
- package/src/components/image-viewer/index.module.css +2 -2
- package/src/components/image-viewer/slide.tsx +2 -1
- package/src/components/image-viewer/video/index.module.css +16 -3
- package/src/components/image-viewer/video/index.tsx +62 -13
- package/src/components/navigation-bar/Component.tsx +68 -27
- package/src/components/navigation-bar/index.module.css +12 -2
- package/src/constants.ts +1 -1
- package/src/hooks/use-custom-subtitles.ts +72 -12
- package/src/types.ts +4 -2
- package/src/utils/index.ts +1 -0
- package/src/utils/modern-download.ts +107 -0
- package/types.d.ts +4 -2
- package/utils/index.d.ts +1 -0
- package/utils/index.js +2 -0
- package/utils/index.js.map +1 -1
- package/utils/modern-download.d.ts +6 -0
- package/utils/modern-download.js +113 -0
- package/utils/modern-download.js.map +1 -0
package/esm/Component.js
CHANGED
|
@@ -10,6 +10,7 @@ import { Header } from './components/header/Component.js';
|
|
|
10
10
|
import '@alfalab/hooks';
|
|
11
11
|
import { SWIPE_THRESHOLD } from './constants.js';
|
|
12
12
|
import { GalleryContext } from './context.js';
|
|
13
|
+
import 'tslib';
|
|
13
14
|
import './components/image-preview/index.css';
|
|
14
15
|
import { ImageViewer } from './components/image-viewer/component.js';
|
|
15
16
|
import { InfoBar } from './components/info-bar/Component.js';
|
|
@@ -36,6 +37,7 @@ var Gallery = function (_a) {
|
|
|
36
37
|
var _o = useState(DEFAULT_MUTED_VIDEO), mutedVideo = _o[0], setMutedVideo = _o[1];
|
|
37
38
|
var _p = useState(DEFAULT_PLAYING_VIDEO), playingVideo = _p[0], setPlayingVideo = _p[1];
|
|
38
39
|
var _q = useState(DEFAULT_HIDE_NAVIGATION), hideNavigation = _q[0], setHideNavigation = _q[1];
|
|
40
|
+
var _r = useState(0), swipeY = _r[0], setSwipeY = _r[1];
|
|
39
41
|
var isDesktop = useIsDesktop();
|
|
40
42
|
var isCurrentVideo = !!((_e = (_d = imagesMeta[currentSlideIndex]) === null || _d === void 0 ? void 0 : _d.player) === null || _e === void 0 ? void 0 : _e.current);
|
|
41
43
|
var bottomButton = (_f = images[currentSlideIndex]) === null || _f === void 0 ? void 0 : _f.bottomButton;
|
|
@@ -114,6 +116,11 @@ var Gallery = function (_a) {
|
|
|
114
116
|
swiper === null || swiper === void 0 ? void 0 : swiper.slideTo(currentSlideIndex);
|
|
115
117
|
}
|
|
116
118
|
}, [uncontrolled, currentSlideIndex, swiper]);
|
|
119
|
+
useEffect(function () {
|
|
120
|
+
if (!open) {
|
|
121
|
+
setSwipeY(0);
|
|
122
|
+
}
|
|
123
|
+
}, [open]);
|
|
117
124
|
useEffect(function () {
|
|
118
125
|
document.addEventListener('keydown', handleKeyDown);
|
|
119
126
|
return function () {
|
|
@@ -121,24 +128,59 @@ var Gallery = function (_a) {
|
|
|
121
128
|
};
|
|
122
129
|
}, [handleKeyDown]);
|
|
123
130
|
useEffect(function () {
|
|
124
|
-
|
|
131
|
+
if (!open) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
var startX = 0;
|
|
135
|
+
var startY = 0;
|
|
136
|
+
var lockedDirection = null;
|
|
137
|
+
var directionLockThreshold = 10;
|
|
125
138
|
var abortController = new AbortController();
|
|
126
139
|
var signal = abortController.signal;
|
|
127
140
|
document.addEventListener('touchstart', function (e) {
|
|
141
|
+
startX = e.touches[0].clientX;
|
|
128
142
|
startY = e.touches[0].clientY;
|
|
143
|
+
lockedDirection = null;
|
|
129
144
|
}, { signal: signal });
|
|
130
145
|
document.addEventListener('touchmove', function (e) {
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
|
|
146
|
+
var currentX = e.touches[0].clientX;
|
|
147
|
+
var currentY = e.touches[0].clientY;
|
|
148
|
+
var deltaX = currentX - startX;
|
|
149
|
+
var deltaY = currentY - startY;
|
|
150
|
+
if (!lockedDirection) {
|
|
151
|
+
var absX = Math.abs(deltaX);
|
|
152
|
+
var absY = Math.abs(deltaY);
|
|
153
|
+
if (absX > absY && absX > directionLockThreshold) {
|
|
154
|
+
lockedDirection = 'horizontal';
|
|
155
|
+
}
|
|
156
|
+
else if (absY > absX && absY > directionLockThreshold) {
|
|
157
|
+
lockedDirection = 'vertical';
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (lockedDirection === 'horizontal') {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (deltaY <= 0) {
|
|
167
|
+
setSwipeY(0);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
setSwipeY(deltaY);
|
|
171
|
+
if (deltaY > SWIPE_THRESHOLD) {
|
|
172
|
+
setSwipeY(0);
|
|
135
173
|
onClose();
|
|
136
174
|
}
|
|
137
175
|
}, { signal: signal });
|
|
176
|
+
document.addEventListener('touchend', function () {
|
|
177
|
+
lockedDirection = null;
|
|
178
|
+
setSwipeY(0);
|
|
179
|
+
}, { signal: signal });
|
|
138
180
|
return function () {
|
|
139
181
|
abortController.abort();
|
|
140
182
|
};
|
|
141
|
-
}, [onClose]);
|
|
183
|
+
}, [onClose, open]);
|
|
142
184
|
var singleSlide = images.length === 1;
|
|
143
185
|
var showNavigationBar = !singleSlide && !fullScreen;
|
|
144
186
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
@@ -170,7 +212,9 @@ var Gallery = function (_a) {
|
|
|
170
212
|
};
|
|
171
213
|
return (React.createElement(GalleryContext.Provider, { value: galleryContext },
|
|
172
214
|
React.createElement(BaseModal, { open: open, className: cn(styles.modal, popupClassName), onEscapeKeyDown: handleEscapeKeyDown, Backdrop: Backdrop, onUnmount: onUnmount },
|
|
173
|
-
React.createElement("div", {
|
|
215
|
+
React.createElement("div", { "data-content-area": true, style: {
|
|
216
|
+
transform: "translateY(".concat(swipeY, "px)"),
|
|
217
|
+
}, className: cn(styles.container, (_b = {},
|
|
174
218
|
_b[styles.mobile] = !isDesktop,
|
|
175
219
|
_b)) },
|
|
176
220
|
isDesktop ? React.createElement(Header, null) : React.createElement(HeaderMobile, null),
|
package/esm/Component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { type FC, type MouseEvent, useCallback, useEffect, useState } from 'react';\nimport cn from 'classnames';\nimport type SwiperCore from 'swiper';\n\nimport { BaseModal } from '@alfalab/core-components-base-modal';\nimport { useIsDesktop } from '@alfalab/core-components-mq';\n\nimport { BottomButton } from './components/bottom-button';\nimport { Single } from './components/image-viewer/single';\nimport { Subtitles } from './components/subtitles';\nimport { Header, HeaderMobile, ImageViewer, InfoBar, NavigationBar } from './components';\nimport { SWIPE_THRESHOLD } from './constants';\nimport { GalleryContext } from './context';\nimport { type GalleryImage, type ImageMeta } from './types';\n\nimport styles from './index.module.css';\n\nexport type GalleryProps = {\n /**\n * Управление видимостью\n */\n open: boolean;\n\n /**\n * Массив изображений\n */\n images: GalleryImage[];\n\n /**\n * Зациклить галерею\n * @default true\n */\n loop?: boolean;\n\n /**\n * Индекс открытого изображение\n * @default 0\n */\n initialSlide?: number;\n\n /**\n * Обработчик закрытия\n */\n onClose: () => void;\n\n /**\n * Индекс текущего изображения\n */\n slideIndex?: number;\n\n /**\n * Обработчик изменения текущего изображения\n */\n onSlideIndexChange?: (index: number) => void;\n\n /**\n * Дополнительный класс для попапа\n */\n popupClassName?: string;\n};\n\nconst DEFAULT_FULL_SCREEN = false;\nconst DEFAULT_MUTED_VIDEO = true;\nconst DEFAULT_PLAYING_VIDEO = true;\nconst DEFAULT_HIDE_NAVIGATION = false;\n\nconst Backdrop = () => null;\n\nexport const Gallery: FC<GalleryProps> = ({\n open,\n images,\n slideIndex,\n initialSlide = 0,\n loop = true,\n onClose,\n onSlideIndexChange,\n popupClassName,\n}) => {\n const currentSlideIndexState = useState(initialSlide);\n const uncontrolled = slideIndex === undefined;\n const [currentSlideIndex, setCurrentSlideIndex] = uncontrolled\n ? currentSlideIndexState\n : [slideIndex, onSlideIndexChange];\n\n const [swiper, setSwiper] = useState<SwiperCore>();\n const [imagesMeta, setImagesMeta] = useState<ImageMeta[]>([]);\n const [fullScreen, setFullScreen] = useState<boolean>(DEFAULT_FULL_SCREEN);\n const [mutedVideo, setMutedVideo] = useState<boolean>(DEFAULT_MUTED_VIDEO);\n const [playingVideo, setPlayingVideo] = useState<boolean>(DEFAULT_PLAYING_VIDEO);\n const [hideNavigation, setHideNavigation] = useState<boolean>(DEFAULT_HIDE_NAVIGATION);\n\n const isDesktop = useIsDesktop();\n\n const isCurrentVideo = !!imagesMeta[currentSlideIndex]?.player?.current;\n\n const bottomButton = images[currentSlideIndex]?.bottomButton;\n\n const slideTo = useCallback(\n (index: number) => {\n if (images[index]) {\n setCurrentSlideIndex?.(index);\n\n if (swiper) {\n setPlayingVideo(true);\n swiper.slideTo(index);\n }\n }\n },\n [images, setCurrentSlideIndex, swiper],\n );\n\n const slideNext = useCallback(() => {\n const lastIndex = images.length - 1;\n\n let nextIndex = currentSlideIndex + 1;\n\n if (nextIndex >= images.length) {\n nextIndex = loop ? 0 : lastIndex;\n }\n\n slideTo(nextIndex);\n }, [images.length, loop, currentSlideIndex, slideTo]);\n\n const slidePrev = useCallback(() => {\n const lastIndex = images.length - 1;\n\n let nextIndex = currentSlideIndex - 1;\n\n if (nextIndex < 0) {\n nextIndex = loop ? lastIndex : 0;\n }\n\n slideTo(nextIndex);\n }, [images.length, loop, currentSlideIndex, slideTo]);\n\n const setImageMeta = useCallback((meta: ImageMeta, index: number) => {\n setImagesMeta((prevImagesMeta) => {\n const nextImagesMeta = prevImagesMeta.slice();\n\n nextImagesMeta[index] = meta;\n\n return nextImagesMeta;\n });\n }, []);\n\n const handleBottomButtonClick = useCallback(\n (e: MouseEvent) => {\n e.stopPropagation();\n if (bottomButton?.onClick) {\n bottomButton.onClick(e);\n }\n },\n [bottomButton],\n );\n\n const handleClose = useCallback(() => {\n onClose();\n\n if (uncontrolled) {\n setCurrentSlideIndex?.(initialSlide);\n }\n\n setFullScreen(false);\n }, [initialSlide, onClose, setCurrentSlideIndex, uncontrolled]);\n\n const handleEscapeKeyDown = () => {\n if (fullScreen) {\n setFullScreen(false);\n } else {\n handleClose();\n }\n };\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (!open || fullScreen) {\n return;\n }\n\n switch (event.key) {\n case 'ArrowLeft':\n slidePrev();\n break;\n case 'ArrowRight':\n slideNext();\n break;\n }\n },\n [fullScreen, open, slideNext, slidePrev],\n );\n\n const onUnmount = useCallback(() => {\n setPlayingVideo(DEFAULT_PLAYING_VIDEO);\n setMutedVideo(DEFAULT_MUTED_VIDEO);\n }, [setPlayingVideo]);\n\n useEffect(() => {\n if (!uncontrolled && !swiper?.destroyed) {\n swiper?.slideTo(currentSlideIndex);\n }\n }, [uncontrolled, currentSlideIndex, swiper]);\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [handleKeyDown]);\n\n useEffect(() => {\n let startY: number;\n const abortController = new AbortController();\n const { signal } = abortController;\n\n document.addEventListener(\n 'touchstart',\n (e) => {\n startY = e.touches[0].clientY;\n },\n { signal },\n );\n\n document.addEventListener(\n 'touchmove',\n (e) => {\n const endY = e.changedTouches[0].clientY;\n const deltaY = startY - endY;\n\n // Если свайп вниз, закрываем галерею\n if (deltaY < SWIPE_THRESHOLD) {\n onClose();\n }\n },\n { signal },\n );\n\n return () => {\n abortController.abort();\n };\n }, [onClose]);\n\n const singleSlide = images.length === 1;\n\n const showNavigationBar = !singleSlide && !fullScreen;\n\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n const galleryContext: GalleryContext = {\n view: isDesktop ? 'desktop' : 'mobile',\n singleSlide,\n currentSlideIndex,\n images,\n imagesMeta,\n fullScreen,\n initialSlide: uncontrolled ? initialSlide : currentSlideIndex,\n setFullScreen,\n playingVideo,\n setPlayingVideo,\n mutedVideo,\n setMutedVideo,\n hideNavigation,\n setHideNavigation,\n setImageMeta,\n slideNext,\n slidePrev,\n slideTo,\n getSwiper: () => swiper,\n setSwiper,\n onClose: handleClose,\n setCurrentSlideIndex,\n getCurrentImage: () => images[currentSlideIndex],\n getCurrentImageMeta: () => imagesMeta[currentSlideIndex],\n };\n\n return (\n <GalleryContext.Provider value={galleryContext}>\n <BaseModal\n open={open}\n className={cn(styles.modal, popupClassName)}\n onEscapeKeyDown={handleEscapeKeyDown}\n Backdrop={Backdrop}\n onUnmount={onUnmount}\n >\n <div\n className={cn(styles.container, {\n [styles.mobile]: !isDesktop,\n })}\n >\n {isDesktop ? <Header /> : <HeaderMobile />}\n {images.length === 1 ? <Single /> : <ImageViewer />}\n <nav\n className={cn({\n [styles.navigationVideo]: isCurrentVideo && !isDesktop,\n [styles.hide]: showNavigationBar && hideNavigation && !isDesktop,\n [styles.hideInfo]: !showNavigationBar && hideNavigation && !isDesktop,\n })}\n >\n {!isDesktop && <Subtitles />}\n {isCurrentVideo && !isDesktop && bottomButton && (\n <BottomButton\n bottomButton={bottomButton}\n onClick={handleBottomButtonClick}\n className={styles.bottomButton}\n />\n )}\n\n {showNavigationBar && <NavigationBar />}\n {!isDesktop && <InfoBar />}\n </nav>\n </div>\n </BaseModal>\n </GalleryContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA6DA,IAAM,mBAAmB,GAAG,KAAK;AACjC,IAAM,mBAAmB,GAAG,IAAI;AAChC,IAAM,qBAAqB,GAAG,IAAI;AAClC,IAAM,uBAAuB,GAAG,KAAK;AAErC,IAAM,QAAQ,GAAG,YAAA,EAAM,OAAA,IAAI,CAAA,EAAA;AAEpB,IAAM,OAAO,GAAqB,UAAC,EASzC,EAAA;;;AARG,IAAA,IAAA,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ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CAAA,aAAA,CAAA,YAAY,EAAG,IAAA,CAAA;AACzC,gBAAA,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,KAAC,CAAA,aAAA,CAAA,MAAM,OAAG,GAAG,KAAA,CAAA,aAAA,CAAC,WAAW,EAAG,IAAA,CAAA;gBACnD,KACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,EAAA,EAAA,GAAA,EAAA;AACT,wBAAA,EAAA,CAAC,MAAM,CAAC,eAAe,IAAG,cAAc,IAAI,CAAC,SAAS;wBACtD,EAAC,CAAA,MAAM,CAAC,IAAI,CAAA,GAAG,iBAAiB,IAAI,cAAc,IAAI,CAAC,SAAS;wBAChE,EAAC,CAAA,MAAM,CAAC,QAAQ,CAAG,GAAA,CAAC,iBAAiB,IAAI,cAAc,IAAI,CAAC,SAAS;AACvE,wBAAA,EAAA,EAAA,EAAA;AAED,oBAAA,CAAC,SAAS,IAAI,KAAC,CAAA,aAAA,CAAA,SAAS,EAAG,IAAA,CAAA;oBAC3B,cAAc,IAAI,CAAC,SAAS,IAAI,YAAY,KACzC,KAAA,CAAA,aAAA,CAAC,YAAY,EAAA,EACT,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,uBAAuB,EAChC,SAAS,EAAE,MAAM,CAAC,YAAY,EAAA,CAChC,CACL;oBAEA,iBAAiB,IAAI,KAAC,CAAA,aAAA,CAAA,aAAa,EAAG,IAAA,CAAA;oBACtC,CAAC,SAAS,IAAI,KAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA,CAAG,CACxB,CACJ,CACE,CACU;AAElC;;;;"}
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { type FC, type MouseEvent, useCallback, useEffect, useState } from 'react';\nimport cn from 'classnames';\nimport type SwiperCore from 'swiper';\n\nimport { BaseModal } from '@alfalab/core-components-base-modal';\nimport { useIsDesktop } from '@alfalab/core-components-mq';\n\nimport { BottomButton } from './components/bottom-button';\nimport { Single } from './components/image-viewer/single';\nimport { Subtitles } from './components/subtitles';\nimport { Header, HeaderMobile, ImageViewer, InfoBar, NavigationBar } from './components';\nimport { SWIPE_THRESHOLD } from './constants';\nimport { GalleryContext } from './context';\nimport { type GalleryImage, type ImageMeta } from './types';\n\nimport styles from './index.module.css';\n\nexport type GalleryProps = {\n /**\n * Управление видимостью\n */\n open: boolean;\n\n /**\n * Массив изображений\n */\n images: GalleryImage[];\n\n /**\n * Зациклить галерею\n * @default true\n */\n loop?: boolean;\n\n /**\n * Индекс открытого изображение\n * @default 0\n */\n initialSlide?: number;\n\n /**\n * Обработчик закрытия\n */\n onClose: () => void;\n\n /**\n * Индекс текущего изображения\n */\n slideIndex?: number;\n\n /**\n * Обработчик изменения текущего изображения\n */\n onSlideIndexChange?: (index: number) => void;\n\n /**\n * Дополнительный класс для попапа\n */\n popupClassName?: string;\n};\n\nconst DEFAULT_FULL_SCREEN = false;\nconst DEFAULT_MUTED_VIDEO = true;\nconst DEFAULT_PLAYING_VIDEO = true;\nconst DEFAULT_HIDE_NAVIGATION = false;\n\nconst Backdrop = () => null;\n\nexport const Gallery: FC<GalleryProps> = ({\n open,\n images,\n slideIndex,\n initialSlide = 0,\n loop = true,\n onClose,\n onSlideIndexChange,\n popupClassName,\n}) => {\n const currentSlideIndexState = useState(initialSlide);\n const uncontrolled = slideIndex === undefined;\n const [currentSlideIndex, setCurrentSlideIndex] = uncontrolled\n ? currentSlideIndexState\n : [slideIndex, onSlideIndexChange];\n\n const [swiper, setSwiper] = useState<SwiperCore>();\n const [imagesMeta, setImagesMeta] = useState<ImageMeta[]>([]);\n const [fullScreen, setFullScreen] = useState<boolean>(DEFAULT_FULL_SCREEN);\n const [mutedVideo, setMutedVideo] = useState<boolean>(DEFAULT_MUTED_VIDEO);\n const [playingVideo, setPlayingVideo] = useState<boolean>(DEFAULT_PLAYING_VIDEO);\n const [hideNavigation, setHideNavigation] = useState<boolean>(DEFAULT_HIDE_NAVIGATION);\n const [swipeY, setSwipeY] = useState<number>(0);\n\n const isDesktop = useIsDesktop();\n\n const isCurrentVideo = !!imagesMeta[currentSlideIndex]?.player?.current;\n\n const bottomButton = images[currentSlideIndex]?.bottomButton;\n\n const slideTo = useCallback(\n (index: number) => {\n if (images[index]) {\n setCurrentSlideIndex?.(index);\n\n if (swiper) {\n setPlayingVideo(true);\n swiper.slideTo(index);\n }\n }\n },\n [images, setCurrentSlideIndex, swiper],\n );\n\n const slideNext = useCallback(() => {\n const lastIndex = images.length - 1;\n\n let nextIndex = currentSlideIndex + 1;\n\n if (nextIndex >= images.length) {\n nextIndex = loop ? 0 : lastIndex;\n }\n\n slideTo(nextIndex);\n }, [images.length, loop, currentSlideIndex, slideTo]);\n\n const slidePrev = useCallback(() => {\n const lastIndex = images.length - 1;\n\n let nextIndex = currentSlideIndex - 1;\n\n if (nextIndex < 0) {\n nextIndex = loop ? lastIndex : 0;\n }\n\n slideTo(nextIndex);\n }, [images.length, loop, currentSlideIndex, slideTo]);\n\n const setImageMeta = useCallback((meta: ImageMeta, index: number) => {\n setImagesMeta((prevImagesMeta) => {\n const nextImagesMeta = prevImagesMeta.slice();\n\n nextImagesMeta[index] = meta;\n\n return nextImagesMeta;\n });\n }, []);\n\n const handleBottomButtonClick = useCallback(\n (e: MouseEvent) => {\n e.stopPropagation();\n if (bottomButton?.onClick) {\n bottomButton.onClick(e);\n }\n },\n [bottomButton],\n );\n\n const handleClose = useCallback(() => {\n onClose();\n\n if (uncontrolled) {\n setCurrentSlideIndex?.(initialSlide);\n }\n\n setFullScreen(false);\n }, [initialSlide, onClose, setCurrentSlideIndex, uncontrolled]);\n\n const handleEscapeKeyDown = () => {\n if (fullScreen) {\n setFullScreen(false);\n } else {\n handleClose();\n }\n };\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (!open || fullScreen) {\n return;\n }\n\n switch (event.key) {\n case 'ArrowLeft':\n slidePrev();\n break;\n case 'ArrowRight':\n slideNext();\n break;\n }\n },\n [fullScreen, open, slideNext, slidePrev],\n );\n\n const onUnmount = useCallback(() => {\n setPlayingVideo(DEFAULT_PLAYING_VIDEO);\n setMutedVideo(DEFAULT_MUTED_VIDEO);\n }, [setPlayingVideo]);\n\n useEffect(() => {\n if (!uncontrolled && !swiper?.destroyed) {\n swiper?.slideTo(currentSlideIndex);\n }\n }, [uncontrolled, currentSlideIndex, swiper]);\n\n useEffect(() => {\n if (!open) {\n setSwipeY(0);\n }\n }, [open]);\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [handleKeyDown]);\n\n useEffect(() => {\n if (!open) {\n return undefined;\n }\n\n let startX = 0;\n let startY = 0;\n let lockedDirection: 'horizontal' | 'vertical' | null = null;\n const directionLockThreshold = 10;\n\n const abortController = new AbortController();\n const { signal } = abortController;\n\n document.addEventListener(\n 'touchstart',\n (e) => {\n startX = e.touches[0].clientX;\n startY = e.touches[0].clientY;\n lockedDirection = null;\n },\n { signal },\n );\n\n document.addEventListener(\n 'touchmove',\n (e) => {\n const currentX = e.touches[0].clientX;\n const currentY = e.touches[0].clientY;\n const deltaX = currentX - startX;\n const deltaY = currentY - startY;\n\n if (!lockedDirection) {\n const absX = Math.abs(deltaX);\n const absY = Math.abs(deltaY);\n\n if (absX > absY && absX > directionLockThreshold) {\n lockedDirection = 'horizontal';\n } else if (absY > absX && absY > directionLockThreshold) {\n lockedDirection = 'vertical';\n } else {\n return;\n }\n }\n\n if (lockedDirection === 'horizontal') {\n return;\n }\n\n if (deltaY <= 0) {\n setSwipeY(0);\n\n return;\n }\n\n setSwipeY(deltaY);\n\n if (deltaY > SWIPE_THRESHOLD) {\n setSwipeY(0);\n onClose();\n }\n },\n { signal },\n );\n\n document.addEventListener(\n 'touchend',\n () => {\n lockedDirection = null;\n setSwipeY(0);\n },\n { signal },\n );\n\n return () => {\n abortController.abort();\n };\n }, [onClose, open]);\n\n const singleSlide = images.length === 1;\n\n const showNavigationBar = !singleSlide && !fullScreen;\n\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n const galleryContext: GalleryContext = {\n view: isDesktop ? 'desktop' : 'mobile',\n singleSlide,\n currentSlideIndex,\n images,\n imagesMeta,\n fullScreen,\n initialSlide: uncontrolled ? initialSlide : currentSlideIndex,\n setFullScreen,\n playingVideo,\n setPlayingVideo,\n mutedVideo,\n setMutedVideo,\n hideNavigation,\n setHideNavigation,\n setImageMeta,\n slideNext,\n slidePrev,\n slideTo,\n getSwiper: () => swiper,\n setSwiper,\n onClose: handleClose,\n setCurrentSlideIndex,\n getCurrentImage: () => images[currentSlideIndex],\n getCurrentImageMeta: () => imagesMeta[currentSlideIndex],\n };\n\n return (\n <GalleryContext.Provider value={galleryContext}>\n <BaseModal\n open={open}\n className={cn(styles.modal, popupClassName)}\n onEscapeKeyDown={handleEscapeKeyDown}\n Backdrop={Backdrop}\n onUnmount={onUnmount}\n >\n <div\n data-content-area={true}\n style={{\n transform: `translateY(${swipeY}px)`,\n }}\n className={cn(styles.container, {\n [styles.mobile]: !isDesktop,\n })}\n >\n {isDesktop ? <Header /> : <HeaderMobile />}\n {images.length === 1 ? <Single /> : <ImageViewer />}\n <nav\n className={cn({\n [styles.navigationVideo]: isCurrentVideo && !isDesktop,\n [styles.hide]: showNavigationBar && hideNavigation && !isDesktop,\n [styles.hideInfo]: !showNavigationBar && hideNavigation && !isDesktop,\n })}\n >\n {!isDesktop && <Subtitles />}\n {isCurrentVideo && !isDesktop && bottomButton && (\n <BottomButton\n bottomButton={bottomButton}\n onClick={handleBottomButtonClick}\n className={styles.bottomButton}\n />\n )}\n\n {showNavigationBar && <NavigationBar />}\n {!isDesktop && <InfoBar />}\n </nav>\n </div>\n </BaseModal>\n </GalleryContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA6DA,IAAM,mBAAmB,GAAG,KAAK;AACjC,IAAM,mBAAmB,GAAG,IAAI;AAChC,IAAM,qBAAqB,GAAG,I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,EAAE,MAAM,CAAC,YAAY,EAAA,CAChC,CACL;oBAEA,iBAAiB,IAAI,KAAC,CAAA,aAAA,CAAA,aAAa,EAAG,IAAA,CAAA;oBACtC,CAAC,SAAS,IAAI,KAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA,CAAG,CACxB,CACJ,CACE,CACU;AAElC;;;;"}
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
--color-static-neutral-translucent-500-inverted-hover: rgba(233, 233, 250, 0.37);
|
|
4
4
|
--color-static-neutral-translucent-500-inverted-press: rgba(238, 238, 254, 0.46);
|
|
5
5
|
}
|
|
6
|
-
.
|
|
6
|
+
.gallery__component_pbhbi {
|
|
7
7
|
background-color: var(--color-static-neutral-translucent-500-inverted);
|
|
8
8
|
}
|
|
9
|
-
.
|
|
9
|
+
.gallery__component_pbhbi:hover {
|
|
10
10
|
background-color: var(--color-static-neutral-translucent-500-inverted-hover);
|
|
11
11
|
}
|
|
12
|
-
.
|
|
12
|
+
.gallery__component_pbhbi:active {
|
|
13
13
|
background-color: var(--color-static-neutral-translucent-500-inverted-press);
|
|
14
14
|
}
|
|
15
|
-
.
|
|
15
|
+
.gallery__component_pbhbi {
|
|
16
16
|
|
|
17
17
|
transition: transform 1s ease-in-out;
|
|
18
18
|
will-change: transform;
|
|
19
19
|
}
|
|
20
|
-
.
|
|
20
|
+
.gallery__notVisible_pbhbi {
|
|
21
21
|
transform: translateY(250%);
|
|
22
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"component":"
|
|
3
|
+
var styles = {"component":"gallery__component_pbhbi","notVisible":"gallery__notVisible_pbhbi"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
:root {
|
|
8
8
|
--gap-32: 32px;
|
|
9
9
|
}
|
|
10
|
-
.
|
|
10
|
+
.gallery__buttons_cha95 {
|
|
11
11
|
display: flex;
|
|
12
12
|
padding-left: var(--gap-32);
|
|
13
13
|
}
|
|
14
|
-
.
|
|
14
|
+
.gallery__buttons_cha95 path {
|
|
15
15
|
color: var(--color-static-neutral-translucent-1300-inverted);
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
.gallery__iconButton_cha95 path {
|
|
18
18
|
color: var(--color-static-neutral-100);
|
|
19
19
|
}
|
|
20
|
-
.
|
|
20
|
+
.gallery__iconButton_cha95:hover path {
|
|
21
21
|
color: var(--color-static-neutral-100-hover);
|
|
22
22
|
}
|
|
23
|
-
.
|
|
23
|
+
.gallery__iconButton_cha95:active path {
|
|
24
24
|
color: var(--color-static-neutral-100-press);
|
|
25
25
|
}
|
|
@@ -11,7 +11,9 @@ export declare const Pause: FC<Props>;
|
|
|
11
11
|
export declare const ExitFullscreen: FC<Props>;
|
|
12
12
|
export declare const MuteVideo: FC<Props>;
|
|
13
13
|
export declare const UnmuteVideo: FC<Props>;
|
|
14
|
-
export declare const Download: FC<Props
|
|
14
|
+
export declare const Download: FC<Props & {
|
|
15
|
+
href?: string;
|
|
16
|
+
}>;
|
|
15
17
|
export declare const Share: FC<Props>;
|
|
16
18
|
export declare const Exit: FC<Props>;
|
|
17
19
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
1
|
+
import { __rest, __assign, __awaiter, __generator } from 'tslib';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { IconButton } from '@alfalab/core-components-icon-button/esm';
|
|
5
|
+
import { useIsDesktop } from '@alfalab/core-components-mq/esm';
|
|
5
6
|
import { TooltipDesktop } from '@alfalab/core-components-tooltip/esm/desktop';
|
|
6
7
|
import { ArrowLeftMIcon } from '@alfalab/icons-glyph/ArrowLeftMIcon';
|
|
7
8
|
import { ArrowsInwardMIcon } from '@alfalab/icons-glyph/ArrowsInwardMIcon';
|
|
@@ -13,12 +14,15 @@ import { PointerDownMIcon } from '@alfalab/icons-glyph/PointerDownMIcon';
|
|
|
13
14
|
import { ShareMIcon } from '@alfalab/icons-glyph/ShareMIcon';
|
|
14
15
|
import { SoundCrossMIcon } from '@alfalab/icons-glyph/SoundCrossMIcon';
|
|
15
16
|
import { SoundMIcon } from '@alfalab/icons-glyph/SoundMIcon';
|
|
17
|
+
import { isVideo } from '../../utils/utils.js';
|
|
18
|
+
import { downloadFile } from '../../utils/modern-download.js';
|
|
16
19
|
import styles from './index.module.css.js';
|
|
17
20
|
|
|
18
21
|
var Fullscreen = function (_a) {
|
|
19
22
|
var buttonRef = _a.buttonRef, restProps = __rest(_a, ["buttonRef"]);
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
var isDesktop = useIsDesktop();
|
|
24
|
+
var iconButton = (React.createElement(IconButton, __assign({}, restProps, { ref: buttonRef, icon: ArrowsOutwardMIcon, "aria-label": '\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 \u043F\u043E\u043B\u043D\u043E\u044D\u043A\u0440\u0430\u043D\u043D\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435', className: styles.iconButton })));
|
|
25
|
+
return isDesktop ? (React.createElement(TooltipDesktop, { view: 'hint', colors: 'inverted', trigger: 'hover', position: 'bottom', content: '\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 \u043F\u043E\u043B\u043D\u043E\u044D\u043A\u0440\u0430\u043D\u043D\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435', fallbackPlacements: ['bottom-end'] }, iconButton)) : (iconButton);
|
|
22
26
|
};
|
|
23
27
|
var BackArrow = function (_a) {
|
|
24
28
|
var buttonRef = _a.buttonRef, restProps = __rest(_a, ["buttonRef"]);
|
|
@@ -34,23 +38,56 @@ var Pause = function (_a) {
|
|
|
34
38
|
};
|
|
35
39
|
var ExitFullscreen = function (_a) {
|
|
36
40
|
var buttonRef = _a.buttonRef, restProps = __rest(_a, ["buttonRef"]);
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
var isDesktop = useIsDesktop();
|
|
42
|
+
var iconButton = (React.createElement(IconButton, __assign({}, restProps, { ref: buttonRef, icon: ArrowsInwardMIcon, "aria-label": '\u0412\u044B\u0439\u0442\u0438 \u0438\u0437 \u043F\u043E\u043B\u043D\u043E\u044D\u043A\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0440\u0435\u0436\u0438\u043C\u0430', className: styles.iconButton })));
|
|
43
|
+
return isDesktop ? (React.createElement(TooltipDesktop, { view: 'hint', colors: 'inverted', trigger: 'hover', position: 'bottom', content: '\u0412\u044B\u0439\u0442\u0438 \u0438\u0437 \u043F\u043E\u043B\u043D\u043E\u044D\u043A\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0440\u0435\u0436\u0438\u043C\u0430', fallbackPlacements: ['bottom-end'] }, iconButton)) : (iconButton);
|
|
39
44
|
};
|
|
40
45
|
var MuteVideo = function (_a) {
|
|
41
46
|
var buttonRef = _a.buttonRef, className = _a.className, restProps = __rest(_a, ["buttonRef", "className"]);
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
var isDesktop = useIsDesktop();
|
|
48
|
+
var iconButton = (React.createElement(IconButton, __assign({}, restProps, { ref: buttonRef, icon: SoundMIcon, "aria-label": '\u0412\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0443\u043A', className: styles.iconButton })));
|
|
49
|
+
return isDesktop ? (React.createElement(TooltipDesktop, { view: 'hint', colors: 'inverted', trigger: 'hover', position: 'bottom', content: '\u0412\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0443\u043A', fallbackPlacements: ['bottom-end'], targetClassName: className }, iconButton)) : (iconButton);
|
|
44
50
|
};
|
|
45
51
|
var UnmuteVideo = function (_a) {
|
|
46
52
|
var buttonRef = _a.buttonRef, className = _a.className, restProps = __rest(_a, ["buttonRef", "className"]);
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
var isDesktop = useIsDesktop();
|
|
54
|
+
var iconButton = (React.createElement(IconButton, __assign({}, restProps, { ref: buttonRef, icon: SoundCrossMIcon, "aria-label": '\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0443\u043A', className: styles.iconButton })));
|
|
55
|
+
return isDesktop ? (React.createElement(TooltipDesktop, { view: 'hint', colors: 'inverted', trigger: 'hover', position: 'bottom', content: '\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0443\u043A', fallbackPlacements: ['bottom-end'], targetClassName: className }, iconButton)) : (iconButton);
|
|
56
|
+
};
|
|
57
|
+
var Download = function (_a) {
|
|
58
|
+
var href = _a.href, props = __rest(_a, ["href"]);
|
|
59
|
+
var isDesktop = useIsDesktop();
|
|
60
|
+
var handleMobileVideoDownload = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
+
var fileName, fileType;
|
|
62
|
+
var _a;
|
|
63
|
+
return __generator(this, function (_b) {
|
|
64
|
+
switch (_b.label) {
|
|
65
|
+
case 0:
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
if (!href)
|
|
68
|
+
return [2 /*return*/];
|
|
69
|
+
fileName = ((_a = props.download) === null || _a === void 0 ? void 0 : _a.toString()) || 'video';
|
|
70
|
+
fileType = isVideo(href) ? 'video/*' : undefined;
|
|
71
|
+
return [4 /*yield*/, downloadFile({
|
|
72
|
+
url: href,
|
|
73
|
+
fileName: fileName,
|
|
74
|
+
fileType: fileType,
|
|
75
|
+
})];
|
|
76
|
+
case 1:
|
|
77
|
+
_b.sent();
|
|
78
|
+
return [2 /*return*/];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}); };
|
|
82
|
+
var iconButtonProps = __assign(__assign({}, props), { icon: PointerDownMIcon, 'aria-label': 'Скачать', className: styles.iconButton });
|
|
83
|
+
var iconButton = !isDesktop && isVideo(href) ? (React.createElement(IconButton, __assign({}, iconButtonProps, { onClick: handleMobileVideoDownload }))) : (React.createElement(IconButton, __assign({}, iconButtonProps, { href: href })));
|
|
84
|
+
return isDesktop ? (React.createElement(TooltipDesktop, { view: 'hint', colors: 'inverted', trigger: 'hover', position: 'bottom', content: '\u0421\u043A\u0430\u0447\u0430\u0442\u044C', fallbackPlacements: ['bottom-end'] }, iconButton)) : (iconButton);
|
|
85
|
+
};
|
|
86
|
+
var Share = function (props) {
|
|
87
|
+
var isDesktop = useIsDesktop();
|
|
88
|
+
var iconButton = (React.createElement(IconButton, __assign({}, props, { icon: ShareMIcon, "aria-label": '\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u044C\u0441\u044F', className: styles.iconButton })));
|
|
89
|
+
return isDesktop ? (React.createElement(TooltipDesktop, { view: 'hint', colors: 'inverted', trigger: 'hover', position: 'bottom', content: '\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u044C\u0441\u044F', fallbackPlacements: ['bottom-end'] }, iconButton)) : (iconButton);
|
|
49
90
|
};
|
|
50
|
-
var Download = function (props) { return (React.createElement(TooltipDesktop, { trigger: 'hover', position: 'bottom', content: '\u0421\u043A\u0430\u0447\u0430\u0442\u044C', fallbackPlacements: ['bottom-end'] },
|
|
51
|
-
React.createElement(IconButton, __assign({}, props, { icon: PointerDownMIcon, "aria-label": '\u0421\u043A\u0430\u0447\u0430\u0442\u044C', className: styles.iconButton })))); };
|
|
52
|
-
var Share = function (props) { return (React.createElement(TooltipDesktop, { trigger: 'hover', position: 'bottom', content: '\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u044C\u0441\u044F', fallbackPlacements: ['bottom-end'] },
|
|
53
|
-
React.createElement(IconButton, __assign({}, props, { icon: ShareMIcon, "aria-label": '\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u044C\u0441\u044F', className: styles.iconButton })))); };
|
|
54
91
|
var Exit = function (props) { return (React.createElement(IconButton, __assign({}, props, { icon: CrossMIcon, "aria-label": '\u0417\u0430\u043A\u0440\u044B\u0442\u044C', className: styles.iconButton }))); };
|
|
55
92
|
|
|
56
93
|
export { BackArrow, Download, Exit, ExitFullscreen, Fullscreen, MuteVideo, Pause, Play, Share, UnmuteVideo };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/buttons/index.tsx"],"sourcesContent":["import React, { type FC, type MutableRefObject } from 'react';\nimport cn from 'classnames';\n\nimport { IconButton, type IconButtonProps } from '@alfalab/core-components-icon-button';\nimport { TooltipDesktop } from '@alfalab/core-components-tooltip/desktop';\nimport { ArrowLeftMIcon } from '@alfalab/icons-glyph/ArrowLeftMIcon';\nimport { ArrowsInwardMIcon } from '@alfalab/icons-glyph/ArrowsInwardMIcon';\nimport { ArrowsOutwardMIcon } from '@alfalab/icons-glyph/ArrowsOutwardMIcon';\nimport { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';\nimport { PauseCompactMIcon } from '@alfalab/icons-glyph/PauseCompactMIcon';\nimport { PlayCompactMIcon } from '@alfalab/icons-glyph/PlayCompactMIcon';\nimport { PointerDownMIcon } from '@alfalab/icons-glyph/PointerDownMIcon';\nimport { ShareMIcon } from '@alfalab/icons-glyph/ShareMIcon';\nimport { SoundCrossMIcon } from '@alfalab/icons-glyph/SoundCrossMIcon';\nimport { SoundMIcon } from '@alfalab/icons-glyph/SoundMIcon';\n\nimport styles from './index.module.css';\n\ntype Props = Omit<IconButtonProps, 'icon' | 'colors'> & {\n buttonRef?: MutableRefObject<HTMLButtonElement | null>;\n download?: string | boolean;\n};\n\nexport const Fullscreen: FC<Props> = ({ buttonRef, ...restProps }) => (\n <TooltipDesktop\n trigger='hover'\n position='bottom'\n content='Открыть в полноэкранном режиме'\n fallbackPlacements={['bottom-end']}\n >\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={ArrowsOutwardMIcon}\n aria-label='Открыть в полноэкранном режиме'\n className={styles.iconButton}\n />\n </TooltipDesktop>\n);\n\nexport const BackArrow: FC<Props> = ({ buttonRef, ...restProps }) => (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={ArrowLeftMIcon}\n aria-label='Вернуться назад'\n className={styles.iconButton}\n />\n);\n\nexport const Play: FC<Props> = ({ buttonRef, className, ...restProps }) => (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={PlayCompactMIcon}\n aria-label='Проиграть видео'\n className={cn(styles.iconButton, className)}\n />\n);\n\nexport const Pause: FC<Props> = ({ buttonRef, className, ...restProps }) => (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={PauseCompactMIcon}\n aria-label='Поставить паузу на видео'\n className={cn(styles.iconButton, className)}\n />\n);\n\nexport const ExitFullscreen: FC<Props> = ({ buttonRef, ...restProps }) => (\n <TooltipDesktop\n trigger='hover'\n position='bottom'\n content='Выйти из полноэкранного режима'\n fallbackPlacements={['bottom-end']}\n >\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={ArrowsInwardMIcon}\n aria-label='Выйти из полноэкранного режима'\n className={styles.iconButton}\n />\n </TooltipDesktop>\n);\n\nexport const MuteVideo: FC<Props> = ({ buttonRef, className, ...restProps }) => (\n <TooltipDesktop\n trigger='hover'\n position='bottom'\n content='Выключить звук'\n fallbackPlacements={['bottom-end']}\n targetClassName={className}\n >\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={SoundMIcon}\n aria-label='Выключить звук'\n className={styles.iconButton}\n />\n </TooltipDesktop>\n);\n\nexport const UnmuteVideo: FC<Props> = ({ buttonRef, className, ...restProps }) => (\n <TooltipDesktop\n trigger='hover'\n position='bottom'\n content='Включить звук'\n fallbackPlacements={['bottom-end']}\n targetClassName={className}\n >\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={SoundCrossMIcon}\n aria-label='Включить звук'\n className={styles.iconButton}\n />\n </TooltipDesktop>\n);\n\nexport const Download: FC<Props> = (props) => (\n <TooltipDesktop\n trigger='hover'\n position='bottom'\n content='Скачать'\n fallbackPlacements={['bottom-end']}\n >\n <IconButton\n {...props}\n icon={PointerDownMIcon}\n aria-label='Скачать'\n className={styles.iconButton}\n />\n </TooltipDesktop>\n);\n\nexport const Share: FC<Props> = (props) => (\n <TooltipDesktop\n trigger='hover'\n position='bottom'\n content='Поделиться'\n fallbackPlacements={['bottom-end']}\n >\n <IconButton\n {...props}\n icon={ShareMIcon}\n aria-label='Поделиться'\n className={styles.iconButton}\n />\n </TooltipDesktop>\n);\n\nexport const Exit: FC<Props> = (props) => (\n <IconButton {...props} icon={CrossMIcon} aria-label='Закрыть' className={styles.iconButton} />\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuBO,IAAM,UAAU,GAAc,UAAC,EAA2B,EAAA;AAAzB,IAAA,IAAA,SAAS,GAAA,EAAA,CAAA,SAAA,EAAK,SAAS,GAAA,MAAA,CAAA,EAAA,EAAzB,aAA2B,CAAF;IAAO,QAClE,oBAAC,cAAc,EAAA,EACX,OAAO,EAAC,OAAO,EACf,QAAQ,EAAC,QAAQ,EACjB,OAAO,EAAC,uKAAgC,EACxC,kBAAkB,EAAE,CAAC,YAAY,CAAC,EAAA;QAElC,KAAC,CAAA,aAAA,CAAA,UAAU,eACH,SAAS,EAAA,EACb,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,kBAAkB,gBACb,uKAAgC,EAC3C,SAAS,EAAE,MAAM,CAAC,UAAU,EAAA,CAAA,CAC9B,CACW;;AAGd,IAAM,SAAS,GAAc,UAAC,EAA2B,EAAA;AAAzB,IAAA,IAAA,SAAS,GAAA,EAAA,CAAA,SAAA,EAAK,SAAS,GAAA,MAAA,CAAA,EAAA,EAAzB,aAA2B,CAAF;IAAO,QACjE,oBAAC,UAAU,EAAA,QAAA,CAAA,EAAA,EACH,SAAS,EACb,EAAA,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,cAAc,EAAA,YAAA,EACT,uFAAiB,EAC5B,SAAS,EAAE,MAAM,CAAC,UAAU,EAC9B,CAAA,CAAA;;AAGC,IAAM,IAAI,GAAc,UAAC,EAAsC,EAAA;IAApC,IAAA,SAAS,eAAA,EAAE,SAAS,eAAA,EAAK,SAA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E,CAAC,YAAY,CAAC,EAAA;IAElC,KAAC,CAAA,aAAA,CAAA,UAAU,eACH,KAAK,EAAA,EACT,IAAI,EAAE,gBAAgB,gBACX,4CAAS,EACpB,SAAS,EAAE,MAAM,CAAC,UAAU,EAAA,CAAA,CAC9B,CACW,EACpB;AAEM,IAAM,KAAK,GAAc,UAAC,KAAK,EAAK,EAAA,QACvC,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACX,OAAO,EAAC,OAAO,EACf,QAAQ,EAAC,QAAQ,EACjB,OAAO,EAAC,8DAAY,EACpB,kBAAkB,EAAE,CAAC,YAAY,CAAC,EAAA;IAElC,KAAC,CAAA,aAAA,CAAA,UAAU,eACH,KAAK,EAAA,EACT,IAAI,EAAE,UAAU,gBACL,8DAAY,EACvB,SAAS,EAAE,MAAM,CAAC,UAAU,EAAA,CAAA,CAC9B,CACW,EACpB;AAEM,IAAM,IAAI,GAAc,UAAC,KAAK,EAAK,EAAA,QACtC,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,QAAA,CAAA,EAAA,EAAK,KAAK,EAAA,EAAE,IAAI,EAAE,UAAU,EAAA,YAAA,EAAa,4CAAS,EAAC,SAAS,EAAE,MAAM,CAAC,UAAU,EAAA,CAAA,CAAI,EACjG;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/buttons/index.tsx"],"sourcesContent":["import React, { type FC, type MutableRefObject } from 'react';\nimport cn from 'classnames';\n\nimport { IconButton, type IconButtonProps } from '@alfalab/core-components-icon-button';\nimport { useIsDesktop } from '@alfalab/core-components-mq';\nimport { TooltipDesktop } from '@alfalab/core-components-tooltip/desktop';\nimport { ArrowLeftMIcon } from '@alfalab/icons-glyph/ArrowLeftMIcon';\nimport { ArrowsInwardMIcon } from '@alfalab/icons-glyph/ArrowsInwardMIcon';\nimport { ArrowsOutwardMIcon } from '@alfalab/icons-glyph/ArrowsOutwardMIcon';\nimport { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';\nimport { PauseCompactMIcon } from '@alfalab/icons-glyph/PauseCompactMIcon';\nimport { PlayCompactMIcon } from '@alfalab/icons-glyph/PlayCompactMIcon';\nimport { PointerDownMIcon } from '@alfalab/icons-glyph/PointerDownMIcon';\nimport { ShareMIcon } from '@alfalab/icons-glyph/ShareMIcon';\nimport { SoundCrossMIcon } from '@alfalab/icons-glyph/SoundCrossMIcon';\nimport { SoundMIcon } from '@alfalab/icons-glyph/SoundMIcon';\n\nimport { downloadFile, isVideo } from '../../utils';\n\nimport styles from './index.module.css';\n\ntype Props = Omit<IconButtonProps, 'icon' | 'colors'> & {\n buttonRef?: MutableRefObject<HTMLButtonElement | null>;\n download?: string | boolean;\n};\n\nexport const Fullscreen: FC<Props> = ({ buttonRef, ...restProps }) => {\n const isDesktop = useIsDesktop();\n\n const iconButton = (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={ArrowsOutwardMIcon}\n aria-label='Открыть в полноэкранном режиме'\n className={styles.iconButton}\n />\n );\n\n return isDesktop ? (\n <TooltipDesktop\n view='hint'\n colors='inverted'\n trigger='hover'\n position='bottom'\n content='Открыть в полноэкранном режиме'\n fallbackPlacements={['bottom-end']}\n >\n {iconButton}\n </TooltipDesktop>\n ) : (\n iconButton\n );\n};\n\nexport const BackArrow: FC<Props> = ({ buttonRef, ...restProps }) => (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={ArrowLeftMIcon}\n aria-label='Вернуться назад'\n className={styles.iconButton}\n />\n);\n\nexport const Play: FC<Props> = ({ buttonRef, className, ...restProps }) => (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={PlayCompactMIcon}\n aria-label='Проиграть видео'\n className={cn(styles.iconButton, className)}\n />\n);\n\nexport const Pause: FC<Props> = ({ buttonRef, className, ...restProps }) => (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={PauseCompactMIcon}\n aria-label='Поставить паузу на видео'\n className={cn(styles.iconButton, className)}\n />\n);\n\nexport const ExitFullscreen: FC<Props> = ({ buttonRef, ...restProps }) => {\n const isDesktop = useIsDesktop();\n\n const iconButton = (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={ArrowsInwardMIcon}\n aria-label='Выйти из полноэкранного режима'\n className={styles.iconButton}\n />\n );\n\n return isDesktop ? (\n <TooltipDesktop\n view='hint'\n colors='inverted'\n trigger='hover'\n position='bottom'\n content='Выйти из полноэкранного режима'\n fallbackPlacements={['bottom-end']}\n >\n {iconButton}\n </TooltipDesktop>\n ) : (\n iconButton\n );\n};\n\nexport const MuteVideo: FC<Props> = ({ buttonRef, className, ...restProps }) => {\n const isDesktop = useIsDesktop();\n\n const iconButton = (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={SoundMIcon}\n aria-label='Выключить звук'\n className={styles.iconButton}\n />\n );\n\n return isDesktop ? (\n <TooltipDesktop\n view='hint'\n colors='inverted'\n trigger='hover'\n position='bottom'\n content='Выключить звук'\n fallbackPlacements={['bottom-end']}\n targetClassName={className}\n >\n {iconButton}\n </TooltipDesktop>\n ) : (\n iconButton\n );\n};\n\nexport const UnmuteVideo: FC<Props> = ({ buttonRef, className, ...restProps }) => {\n const isDesktop = useIsDesktop();\n\n const iconButton = (\n <IconButton\n {...restProps}\n ref={buttonRef}\n icon={SoundCrossMIcon}\n aria-label='Включить звук'\n className={styles.iconButton}\n />\n );\n\n return isDesktop ? (\n <TooltipDesktop\n view='hint'\n colors='inverted'\n trigger='hover'\n position='bottom'\n content='Включить звук'\n fallbackPlacements={['bottom-end']}\n targetClassName={className}\n >\n {iconButton}\n </TooltipDesktop>\n ) : (\n iconButton\n );\n};\n\nexport const Download: FC<Props & { href?: string }> = ({ href, ...props }) => {\n const isDesktop = useIsDesktop();\n\n const handleMobileVideoDownload = async (e: React.MouseEvent) => {\n e.preventDefault();\n\n if (!href) return;\n\n const fileName = props.download?.toString() || 'video';\n const fileType = isVideo(href) ? 'video/*' : undefined;\n\n await downloadFile({\n url: href,\n fileName,\n fileType,\n });\n };\n\n const iconButtonProps = {\n ...props,\n icon: PointerDownMIcon,\n 'aria-label': 'Скачать' as const,\n className: styles.iconButton,\n };\n\n const iconButton =\n !isDesktop && isVideo(href) ? (\n <IconButton {...iconButtonProps} onClick={handleMobileVideoDownload} />\n ) : (\n <IconButton {...iconButtonProps} href={href} />\n );\n\n return isDesktop ? (\n <TooltipDesktop\n view='hint'\n colors='inverted'\n trigger='hover'\n position='bottom'\n content='Скачать'\n fallbackPlacements={['bottom-end']}\n >\n {iconButton}\n </TooltipDesktop>\n ) : (\n iconButton\n );\n};\n\nexport const Share: FC<Props> = (props) => {\n const isDesktop = useIsDesktop();\n\n const iconButton = (\n <IconButton\n {...props}\n icon={ShareMIcon}\n aria-label='Поделиться'\n className={styles.iconButton}\n />\n );\n\n return isDesktop ? (\n <TooltipDesktop\n view='hint'\n colors='inverted'\n trigger='hover'\n position='bottom'\n content='Поделиться'\n fallbackPlacements={['bottom-end']}\n >\n {iconButton}\n </TooltipDesktop>\n ) : (\n iconButton\n );\n};\n\nexport const Exit: FC<Props> = (props) => (\n <IconButton {...props} icon={CrossMIcon} aria-label='Закрыть' className={styles.iconButton} />\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BO,IAAM,UAAU,GAAc,UAAC,EAA2B,EAAA;AAAzB,IAAA,IAAA,SAAS,GAAA,EAAA,CAAA,SAAA,EAAK,SAAS,GAAA,MAAA,CAAA,EAAA,EAAzB,aAA2B,CAAF;AAC3D,IAAA,IAAM,SAAS,GAAG,YAAY,EAAE;IAEhC,IAAM,UAAU,IACZ,KAAC,CAAA,aAAA,CAAA,UAAU,eACH,SAAS,EAAA,EACb,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,kBAAkB,EACb,YAAA,EAAA,uKAAgC,EAC3C,SAAS,EAAE,MAAM,CAAC,UAAU,EAC9B,CAAA,CAAA,CACL;AAED,IAAA,OAAO,SAAS,IACZ,KAAA,CAAA,aAAA,CAAC,cAAc,EACX,EAAA,IAAI,EAAC,MAAM,EACX,M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AAY,CAAC,IAEjC,UAAU,CACE,KAEjB,UAAU,CACb;AACL;AAEO,IAAM,KAAK,GAAc,UAAC,KAAK,EAAA;AAClC,IAAA,IAAM,SAAS,GAAG,YAAY,EAAE;IAEhC,IAAM,UAAU,IACZ,KAAA,CAAA,aAAA,CAAC,UAAU,EACH,QAAA,CAAA,EAAA,EAAA,KAAK,IACT,IAAI,EAAE,UAAU,EACL,YAAA,EAAA,8DAAY,EACvB,SAAS,EAAE,MAAM,CAAC,UAAU,EAC9B,CAAA,CAAA,CACL;AAED,IAAA,OAAO,SAAS,IACZ,KAAA,CAAA,aAAA,CAAC,cAAc,EACX,EAAA,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,UAAU,EACjB,OAAO,EAAC,OAAO,EACf,QAAQ,EAAC,QAAQ,EACjB,OAAO,EAAC,8DAAY,EACpB,kBAAkB,EAAE,CAAC,YAAY,CAAC,IAEjC,UAAU,CACE,KAEjB,UAAU,CACb;AACL;AAEO,IAAM,IAAI,GAAc,UAAC,KAAK,EAAK,EAAA,QACtC,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,QAAA,CAAA,EAAA,EAAK,KAAK,EAAA,EAAE,IAAI,EAAE,UAAU,EAAA,YAAA,EAAa,4CAAS,EAAC,SAAS,EAAE,MAAM,CAAC,UAAU,EAAA,CAAA,CAAI,EACjG;;;;"}
|
|
@@ -2,6 +2,7 @@ import React, { useContext, useRef, useEffect } from 'react';
|
|
|
2
2
|
import { GalleryContext } from '../../context.js';
|
|
3
3
|
import { isSmallImage, isVideo } from '../../utils/utils.js';
|
|
4
4
|
import { TestIds } from '../../utils/constants.js';
|
|
5
|
+
import 'tslib';
|
|
5
6
|
import { Download, Exit, UnmuteVideo, MuteVideo, ExitFullscreen, Fullscreen } from '../buttons/index.js';
|
|
6
7
|
import { HeaderInfoBlock } from '../header-info-block/Component.js';
|
|
7
8
|
import styles from './index.module.css.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/header/Component.tsx"],"sourcesContent":["import React, { type FC, useContext, useEffect, useRef } from 'react';\n\nimport { GalleryContext } from '../../context';\nimport { isSmallImage, isVideo, TestIds } from '../../utils';\nimport * as Buttons from '../buttons';\nimport { HeaderInfoBlock } from '../header-info-block';\n\nimport styles from './index.module.css';\n\nexport const Header: FC = () => {\n const {\n currentSlideIndex,\n singleSlide,\n images,\n fullScreen,\n getCurrentImageMeta,\n getCurrentImage,\n setFullScreen,\n onClose,\n mutedVideo,\n setMutedVideo,\n } = useContext(GalleryContext);\n\n const currentImage = getCurrentImage();\n const meta = getCurrentImageMeta();\n\n const toggleFullScreenButton = useRef<HTMLButtonElement>(null);\n\n const onMuteButtonClick = () => {\n if (currentImage) {\n if (mutedVideo && currentImage.onUnmute) {\n currentImage.onUnmute();\n } else if (currentImage.onMute) {\n currentImage.onMute();\n }\n }\n setMutedVideo(!mutedVideo);\n };\n\n const closeFullScreen = () => {\n setFullScreen(false);\n };\n\n const openFullScreen = () => {\n setFullScreen(true);\n };\n\n useEffect(() => {\n if (toggleFullScreenButton.current) {\n toggleFullScreenButton.current.focus();\n }\n }, [fullScreen]);\n\n const canDownload = currentImage?.canDownload ?? true;\n const filename = currentImage?.name || '';\n const description =\n singleSlide || !images.length ? '' : `${currentSlideIndex + 1} из ${images.length}`;\n\n const showFullScreenButton = !isSmallImage(meta) && !meta?.broken;\n const showDownloadButton = !meta?.broken && canDownload;\n\n const renderToggleFullScreenButton = () =>\n fullScreen ? (\n <Buttons.ExitFullscreen\n onClick={closeFullScreen}\n buttonRef={toggleFullScreenButton}\n dataTestId={TestIds.EXIT_FULLSCREEN_BUTTON}\n />\n ) : (\n <Buttons.Fullscreen\n onClick={openFullScreen}\n buttonRef={toggleFullScreenButton}\n dataTestId={TestIds.FULLSCREEN_BUTTON}\n />\n );\n\n const renderToggleMuteVideo = () =>\n mutedVideo ? (\n <Buttons.UnmuteVideo onClick={onMuteButtonClick} dataTestId={TestIds.UNMUTE_BUTTON} />\n ) : (\n <Buttons.MuteVideo onClick={onMuteButtonClick} dataTestId={TestIds.MUTE_BUTTON} />\n );\n\n return (\n <div className={styles.header}>\n <HeaderInfoBlock filename={filename} description={description} />\n\n <div className={styles.buttons}>\n {isVideo(currentImage?.src) && renderToggleMuteVideo()}\n {showFullScreenButton && renderToggleFullScreenButton()}\n\n {showDownloadButton && (\n <Buttons.Download\n href={currentImage?.src}\n download={currentImage?.name}\n dataTestId={TestIds.DOWNLOAD_BUTTON}\n />\n )}\n\n <Buttons.Exit onClick={onClose} dataTestId={TestIds.CLOSE_BUTTON} />\n </div>\n </div>\n );\n};\n"],"names":["Buttons.ExitFullscreen","Buttons.Fullscreen","Buttons.UnmuteVideo","Buttons.MuteVideo","Buttons.Download","Buttons.Exit"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/header/Component.tsx"],"sourcesContent":["import React, { type FC, useContext, useEffect, useRef } from 'react';\n\nimport { GalleryContext } from '../../context';\nimport { isSmallImage, isVideo, TestIds } from '../../utils';\nimport * as Buttons from '../buttons';\nimport { HeaderInfoBlock } from '../header-info-block';\n\nimport styles from './index.module.css';\n\nexport const Header: FC = () => {\n const {\n currentSlideIndex,\n singleSlide,\n images,\n fullScreen,\n getCurrentImageMeta,\n getCurrentImage,\n setFullScreen,\n onClose,\n mutedVideo,\n setMutedVideo,\n } = useContext(GalleryContext);\n\n const currentImage = getCurrentImage();\n const meta = getCurrentImageMeta();\n\n const toggleFullScreenButton = useRef<HTMLButtonElement>(null);\n\n const onMuteButtonClick = () => {\n if (currentImage) {\n if (mutedVideo && currentImage.onUnmute) {\n currentImage.onUnmute();\n } else if (currentImage.onMute) {\n currentImage.onMute();\n }\n }\n setMutedVideo(!mutedVideo);\n };\n\n const closeFullScreen = () => {\n setFullScreen(false);\n };\n\n const openFullScreen = () => {\n setFullScreen(true);\n };\n\n useEffect(() => {\n if (toggleFullScreenButton.current) {\n toggleFullScreenButton.current.focus();\n }\n }, [fullScreen]);\n\n const canDownload = currentImage?.canDownload ?? true;\n const filename = currentImage?.name || '';\n const description =\n singleSlide || !images.length ? '' : `${currentSlideIndex + 1} из ${images.length}`;\n\n const showFullScreenButton = !isSmallImage(meta) && !meta?.broken;\n const showDownloadButton = !meta?.broken && canDownload;\n\n const renderToggleFullScreenButton = () =>\n fullScreen ? (\n <Buttons.ExitFullscreen\n onClick={closeFullScreen}\n buttonRef={toggleFullScreenButton}\n dataTestId={TestIds.EXIT_FULLSCREEN_BUTTON}\n />\n ) : (\n <Buttons.Fullscreen\n onClick={openFullScreen}\n buttonRef={toggleFullScreenButton}\n dataTestId={TestIds.FULLSCREEN_BUTTON}\n />\n );\n\n const renderToggleMuteVideo = () =>\n mutedVideo ? (\n <Buttons.UnmuteVideo onClick={onMuteButtonClick} dataTestId={TestIds.UNMUTE_BUTTON} />\n ) : (\n <Buttons.MuteVideo onClick={onMuteButtonClick} dataTestId={TestIds.MUTE_BUTTON} />\n );\n\n return (\n <div className={styles.header}>\n <HeaderInfoBlock filename={filename} description={description} />\n\n <div className={styles.buttons}>\n {isVideo(currentImage?.src) && renderToggleMuteVideo()}\n {showFullScreenButton && renderToggleFullScreenButton()}\n\n {showDownloadButton && (\n <Buttons.Download\n href={currentImage?.src}\n download={currentImage?.name}\n dataTestId={TestIds.DOWNLOAD_BUTTON}\n />\n )}\n\n <Buttons.Exit onClick={onClose} dataTestId={TestIds.CLOSE_BUTTON} />\n </div>\n </div>\n );\n};\n"],"names":["Buttons.ExitFullscreen","Buttons.Fullscreen","Buttons.UnmuteVideo","Buttons.MuteVideo","Buttons.Download","Buttons.Exit"],"mappings":";;;;;;;;;AASa,IAAA,MAAM,GAAO,YAAA;;AAChB,IAAA,IAAA,EAWF,GAAA,UAAU,CAAC,cAAc,CAAC,EAV1B,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,UAAU,GAAA,EAAA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KAAC,CAAA,aAAA,CAAA,eAAe,IAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAI,CAAA;AAEjE,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,OAAO,EAAA;YACzB,OAAO,CAAC,YAAY,KAAA,IAAA,IAAZ,YAAY,KAAA,MAAA,GAAA,MAAA,GAAZ,YAAY,CAAE,GAAG,CAAC,IAAI,qBAAqB,EAAE;YACrD,oBAAoB,IAAI,4BAA4B,EAAE;AAEtD,YAAA,kBAAkB,KACf,KAAC,CAAA,aAAA,CAAAC,QAAgB,EAAA,EACb,IAAI,EAAE,YAAY,KAAA,IAAA,IAAZ,YAAY,KAAA,MAAA,GAAA,MAAA,GAAZ,YAAY,CAAE,GAAG,EACvB,QAAQ,EAAE,YAAY,KAAZ,IAAA,IAAA,YAAY,uBAAZ,YAAY,CAAE,IAAI,EAC5B,UAAU,EAAE,OAAO,CAAC,eAAe,GACrC,CACL;AAED,YAAA,KAAA,CAAA,aAAA,CAACC,IAAY,EAAC,EAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,YAAY,GAAI,CAClE,CACJ;AAEd;;;;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--gap-16: 16px;
|
|
3
|
+
--gap-24: 24px;
|
|
3
4
|
--gap-32: 32px;
|
|
4
5
|
}
|
|
5
|
-
.
|
|
6
|
+
.gallery__header_15mdn {
|
|
6
7
|
display: flex;
|
|
7
8
|
justify-content: space-between;
|
|
8
9
|
flex-shrink: 0;
|
|
9
10
|
width: 100%;
|
|
10
|
-
padding: var(--gap-16) var(--gap-32);
|
|
11
|
+
padding: var(--gap-16) var(--gap-24) var(--gap-16) var(--gap-32);
|
|
11
12
|
box-sizing: border-box;
|
|
12
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/header/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.header {\n display: flex;\n justify-content: space-between;\n flex-shrink: 0;\n width: 100%;\n padding: var(--gap-16) var(--gap-32);\n box-sizing: border-box;\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,QAAQ,CAAC,uBAAuB,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/header/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.header {\n display: flex;\n justify-content: space-between;\n flex-shrink: 0;\n width: 100%;\n padding: var(--gap-16) var(--gap-24) var(--gap-16) var(--gap-32);\n box-sizing: border-box;\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,QAAQ,CAAC,uBAAuB,CAAC;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TypographyTitle, TypographyText } from '@alfalab/core-components-typography/esm';
|
|
3
3
|
import { splitFilename } from '../../utils/split-filename.js';
|
|
4
|
+
import 'tslib';
|
|
4
5
|
import styles from './index.module.css.js';
|
|
5
6
|
|
|
6
7
|
var HeaderInfoBlock = function (_a) {
|
|
@@ -8,7 +9,7 @@ var HeaderInfoBlock = function (_a) {
|
|
|
8
9
|
var _b = splitFilename(filename), head = _b[0], tail = _b[1];
|
|
9
10
|
return (React.createElement("div", { className: styles.info },
|
|
10
11
|
React.createElement("div", { className: styles.filenameContainer },
|
|
11
|
-
React.createElement(TypographyTitle, { tag: '
|
|
12
|
+
React.createElement(TypographyTitle, { tag: 'h2', className: styles.filenameHead, view: 'small', font: 'system', color: 'static-primary-light' }, head),
|
|
12
13
|
React.createElement(TypographyTitle, { tag: 'h1', view: 'xsmall', font: 'system', color: 'static-primary-light' }, tail)),
|
|
13
14
|
description ? (React.createElement(TypographyText, { className: styles.description, tag: 'div', view: 'primary-medium', color: 'static-secondary-light' }, description)) : null));
|
|
14
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/header-info-block/Component.tsx"],"sourcesContent":["import React, { type FC } from 'react';\n\nimport { TypographyText, TypographyTitle } from '@alfalab/core-components-typography';\n\nimport { splitFilename } from '../../utils';\n\nimport styles from './index.module.css';\n\nexport type HeaderInfoBlockProps = {\n filename: string;\n description?: string;\n};\n\nexport const HeaderInfoBlock: FC<HeaderInfoBlockProps> = ({ filename, description }) => {\n const [head, tail] = splitFilename(filename);\n\n return (\n <div className={styles.info}>\n <div className={styles.filenameContainer}>\n <TypographyTitle\n tag='
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/header-info-block/Component.tsx"],"sourcesContent":["import React, { type FC } from 'react';\n\nimport { TypographyText, TypographyTitle } from '@alfalab/core-components-typography';\n\nimport { splitFilename } from '../../utils';\n\nimport styles from './index.module.css';\n\nexport type HeaderInfoBlockProps = {\n filename: string;\n description?: string;\n};\n\nexport const HeaderInfoBlock: FC<HeaderInfoBlockProps> = ({ filename, description }) => {\n const [head, tail] = splitFilename(filename);\n\n return (\n <div className={styles.info}>\n <div className={styles.filenameContainer}>\n <TypographyTitle\n tag='h2'\n className={styles.filenameHead}\n view='small'\n font='system'\n color='static-primary-light'\n >\n {head}\n </TypographyTitle>\n\n <TypographyTitle tag='h1' view='xsmall' font='system' color='static-primary-light'>\n {tail}\n </TypographyTitle>\n </div>\n\n {description ? (\n <TypographyText\n className={styles.description}\n tag='div'\n view='primary-medium'\n color='static-secondary-light'\n >\n {description}\n </TypographyText>\n ) : null}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAaO,IAAM,eAAe,GAA6B,UAAC,EAAyB,EAAA;QAAvB,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,WAAW,GAAA,EAAA,CAAA,WAAA;IACvE,IAAA,EAAA,GAAe,aAAa,CAAC,QAAQ,CAAC,EAArC,IAAI,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,IAAI,GAAA,EAAA,CAAA,CAAA,CAA2B;AAE5C,IAAA,QACI,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,IAAI,EAAA;AACvB,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,EAAA;YACpC,KAAC,CAAA,aAAA,CAAA,eAAe,EACZ,EAAA,GAAG,EAAC,IAAI,EACR,SAAS,EAAE,MAAM,CAAC,YAAY,EAC9B,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,sBAAsB,EAE3B,EAAA,IAAI,CACS;YAElB,KAAC,CAAA,aAAA,CAAA,eAAe,IAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,sBAAsB,EAC7E,EAAA,IAAI,CACS,CAChB;AAEL,QAAA,WAAW,IACR,oBAAC,cAAc,EAAA,EACX,SAAS,EAAE,MAAM,CAAC,WAAW,EAC7B,GAAG,EAAC,KAAK,EACT,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,wBAAwB,EAE7B,EAAA,WAAW,CACC,IACjB,IAAI,CACN;AAEd;;;;"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--gap-4: 4px;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.gallery__info_qlcug {
|
|
5
5
|
height: 100%;
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
overflow: hidden;
|
|
10
10
|
}
|
|
11
|
-
.
|
|
11
|
+
.gallery__filenameHead_qlcug {
|
|
12
12
|
display: inline;
|
|
13
13
|
text-overflow: ellipsis;
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
white-space: nowrap;
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
.gallery__filenameContainer_qlcug {
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
display: inline-flex;
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.gallery__description_qlcug {
|
|
22
22
|
display: inline;
|
|
23
23
|
text-overflow: ellipsis;
|
|
24
24
|
overflow: hidden;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"info":"
|
|
3
|
+
var styles = {"info":"gallery__info_qlcug","filenameHead":"gallery__filenameHead_qlcug","filenameContainer":"gallery__filenameContainer_qlcug","description":"gallery__description_qlcug"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|