@trafilea/afrodita-components 6.34.9 → 6.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +1 -0
- package/build/index.esm.js +11 -9
- package/build/index.esm.js.map +1 -1
- package/build/index.js +11 -9
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -12129,7 +12129,10 @@ var ImageSmallPreview = function (_a) {
|
|
|
12129
12129
|
|
|
12130
12130
|
var horizontalStyles = css(templateObject_1$1c || (templateObject_1$1c = __makeTemplateObject(["\n grid-row: 2;\n grid-auto-flow: column;\n grid-column-gap: 6px;\n margin-top: 20px;\n max-width: 360px;\n overflow: auto;\n"], ["\n grid-row: 2;\n grid-auto-flow: column;\n grid-column-gap: 6px;\n margin-top: 20px;\n max-width: 360px;\n overflow: auto;\n"])));
|
|
12131
12131
|
var verticalStyles = css(templateObject_2$V || (templateObject_2$V = __makeTemplateObject(["\n grid-row-gap: 20px;\n overflow: auto;\n grid-area: 1/1;\n"], ["\n grid-row-gap: 20px;\n overflow: auto;\n grid-area: 1/1;\n"])));
|
|
12132
|
-
var Container$T = newStyled.div(templateObject_3$K || (templateObject_3$K = __makeTemplateObject(["\n display: grid;\n max-height:
|
|
12132
|
+
var Container$T = newStyled.div(templateObject_3$K || (templateObject_3$K = __makeTemplateObject(["\n display: grid;\n max-height: ", ";\n height: min-content;\n align-items: flex-start;\n ", "\n\n ", "\n"], ["\n display: grid;\n max-height: ", ";\n height: min-content;\n align-items: flex-start;\n ", "\n\n ", "\n"])), function (_a) {
|
|
12133
|
+
var isRatioSquare = _a.isRatioSquare, theme = _a.theme;
|
|
12134
|
+
return isRatioSquare ? '530px' : "calc(530px / (".concat(theme.component.gallery.aspectRatio, "))");
|
|
12135
|
+
}, function (_a) {
|
|
12133
12136
|
var position = _a.position;
|
|
12134
12137
|
return (position == 'horizontal' ? horizontalStyles : verticalStyles);
|
|
12135
12138
|
}, function (_a) {
|
|
@@ -12170,7 +12173,7 @@ var ImagePreviewList = function (_a) {
|
|
|
12170
12173
|
var element = document.querySelector(".imageListContainer");
|
|
12171
12174
|
element.scrollBy(0, 200);
|
|
12172
12175
|
};
|
|
12173
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Container$T, __assign$1({ role: "list", "data-testid": dataTestId, position: position, className: hasOverflowArrows ? 'imageListContainer' : position, hasOverflowArrows: hasOverflowArrows }, { children: position == 'horizontal' ? (jsxRuntime.jsx("div", __assign$1({ style: { maxWidth: '360px' } }, { children: jsxRuntime.jsx(SliderNavigation, __assign$1({ speed: 200, infinite: false, arrows: {
|
|
12176
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Container$T, __assign$1({ role: "list", "data-testid": dataTestId, position: position, className: hasOverflowArrows ? 'imageListContainer' : position, hasOverflowArrows: hasOverflowArrows, isRatioSquare: isRatioSquare }, { children: position == 'horizontal' ? (jsxRuntime.jsx("div", __assign$1({ style: { maxWidth: '360px' } }, { children: jsxRuntime.jsx(SliderNavigation, __assign$1({ speed: 200, infinite: false, arrows: {
|
|
12174
12177
|
arrowWidth: 0.75,
|
|
12175
12178
|
arrowHeight: 1.25,
|
|
12176
12179
|
arrowPadding: 1.625,
|
|
@@ -12198,7 +12201,7 @@ var templateObject_1$1a, templateObject_2$T, templateObject_3$J, templateObject_
|
|
|
12198
12201
|
|
|
12199
12202
|
var Video$1 = function (_a) {
|
|
12200
12203
|
var _b, _c, _d, _e;
|
|
12201
|
-
var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, _f = _a.withProgressBar, withProgressBar = _f === void 0 ? true : _f, hasAudioControl = _a.hasAudioControl, muted = _a.muted, rest = __rest(_a, ["source", "thumbnail", "height", "className", "withProgressBar", "hasAudioControl", "muted"]);
|
|
12204
|
+
var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, _f = _a.withProgressBar, withProgressBar = _f === void 0 ? true : _f, hasAudioControl = _a.hasAudioControl, muted = _a.muted, isSlideActive = _a.isSlideActive, rest = __rest(_a, ["source", "thumbnail", "height", "className", "withProgressBar", "hasAudioControl", "muted", "isSlideActive"]);
|
|
12202
12205
|
var videoRef = React$2.useRef(null);
|
|
12203
12206
|
var _g = React$2.useState(true), isLoading = _g[0], setIsLoading = _g[1];
|
|
12204
12207
|
var _h = React$2.useState(false), isPlaying = _h[0], setIsPlaying = _h[1];
|
|
@@ -12208,11 +12211,11 @@ var Video$1 = function (_a) {
|
|
|
12208
12211
|
var isStarted = videoProgress > 0;
|
|
12209
12212
|
var progress = videoProgress / ((_c = (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.duration) !== null && _c !== void 0 ? _c : 0);
|
|
12210
12213
|
var hideProgressBar = videoProgress === ((_e = (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.duration) !== null && _e !== void 0 ? _e : 0) || videoProgress === 0;
|
|
12211
|
-
|
|
12212
|
-
if (videoRef.current) {
|
|
12213
|
-
|
|
12214
|
+
if (isSlideActive !== undefined) {
|
|
12215
|
+
if (!isMuted && !isSlideActive && videoRef.current) {
|
|
12216
|
+
setIsMuted(true);
|
|
12214
12217
|
}
|
|
12215
|
-
}
|
|
12218
|
+
}
|
|
12216
12219
|
var handlePlayClick = function () {
|
|
12217
12220
|
if (videoRef.current && !debouncePlay) {
|
|
12218
12221
|
setDebouncePlay(true);
|
|
@@ -12236,7 +12239,6 @@ var Video$1 = function (_a) {
|
|
|
12236
12239
|
};
|
|
12237
12240
|
var handleMuteToggle = function () {
|
|
12238
12241
|
if (videoRef.current) {
|
|
12239
|
-
videoRef.current.muted = !videoRef.current.muted;
|
|
12240
12242
|
setIsMuted(function (prevState) { return !prevState; });
|
|
12241
12243
|
}
|
|
12242
12244
|
};
|
|
@@ -12245,7 +12247,7 @@ var Video$1 = function (_a) {
|
|
|
12245
12247
|
setVideoProgress(videoRef.current.currentTime);
|
|
12246
12248
|
}
|
|
12247
12249
|
};
|
|
12248
|
-
return (jsxRuntime.jsxs(Container$S, __assign$1({ className: className }, { children: [!isLoading && withProgressBar && jsxRuntime.jsx(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsxRuntime.jsx(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsxRuntime.jsx(PlayIcon, {}, void 0) }), void 0)) : (jsxRuntime.jsx(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), hasAudioControl && (jsxRuntime.jsxs(MuteButton, __assign$1({ onClick: handleMuteToggle }, { children: [isMuted && jsxRuntime.jsx(Icon$1, { name: "custom/sound_off" }, void 0), !isMuted && jsxRuntime.jsx(Icon$1, { name: "custom/sound_on" }, void 0)] }), void 0)), jsxRuntime.jsxs(HTMLVideo, __assign$1({}, rest, { muted:
|
|
12250
|
+
return (jsxRuntime.jsxs(Container$S, __assign$1({ className: className }, { children: [!isLoading && withProgressBar && jsxRuntime.jsx(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsxRuntime.jsx(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsxRuntime.jsx(PlayIcon, {}, void 0) }), void 0)) : (jsxRuntime.jsx(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), hasAudioControl && (jsxRuntime.jsxs(MuteButton, __assign$1({ onClick: handleMuteToggle }, { children: [isMuted && jsxRuntime.jsx(Icon$1, { name: "custom/sound_off" }, void 0), !isMuted && jsxRuntime.jsx(Icon$1, { name: "custom/sound_on" }, void 0)] }), void 0)), jsxRuntime.jsxs(HTMLVideo, __assign$1({}, rest, { muted: isMuted, "data-testid": "video", poster: thumbnail, playsInline: true, ref: videoRef, onTimeUpdate: onTimeUpdate, onCanPlay: function () { return setIsLoading(false); }, onLoadedData: function () { return setIsLoading(false); }, onPause: function () { return setIsPlaying(false); }, onPlaying: function () { return setIsPlaying(true); }, height: height || 'auto' }, { children: [jsxRuntime.jsx("track", { kind: "captions" }, void 0), jsxRuntime.jsx("source", { src: source }, void 0)] }), void 0)] }), void 0));
|
|
12249
12251
|
};
|
|
12250
12252
|
|
|
12251
12253
|
var propTypes = {exports: {}};
|