@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 CHANGED
@@ -3804,6 +3804,7 @@ declare type VideoProps = {
3804
3804
  height?: string;
3805
3805
  hasAudioControl?: boolean;
3806
3806
  withProgressBar?: boolean;
3807
+ isSlideActive?: boolean;
3807
3808
  } & DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
3808
3809
  declare const Video: React.FC<VideoProps>;
3809
3810
 
@@ -12103,7 +12103,10 @@ var ImageSmallPreview = function (_a) {
12103
12103
 
12104
12104
  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"])));
12105
12105
  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"])));
12106
- var Container$T = newStyled.div(templateObject_3$K || (templateObject_3$K = __makeTemplateObject(["\n display: grid;\n max-height: 45rem;\n height: min-content;\n align-items: flex-start;\n ", "\n\n ", "\n"], ["\n display: grid;\n max-height: 45rem;\n height: min-content;\n align-items: flex-start;\n ", "\n\n ", "\n"])), function (_a) {
12106
+ 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) {
12107
+ var isRatioSquare = _a.isRatioSquare, theme = _a.theme;
12108
+ return isRatioSquare ? '530px' : "calc(530px / (".concat(theme.component.gallery.aspectRatio, "))");
12109
+ }, function (_a) {
12107
12110
  var position = _a.position;
12108
12111
  return (position == 'horizontal' ? horizontalStyles : verticalStyles);
12109
12112
  }, function (_a) {
@@ -12144,7 +12147,7 @@ var ImagePreviewList = function (_a) {
12144
12147
  var element = document.querySelector(".imageListContainer");
12145
12148
  element.scrollBy(0, 200);
12146
12149
  };
12147
- return (jsxs$1(Fragment$2, { children: [jsx$1(Container$T, __assign$1({ role: "list", "data-testid": dataTestId, position: position, className: hasOverflowArrows ? 'imageListContainer' : position, hasOverflowArrows: hasOverflowArrows }, { children: position == 'horizontal' ? (jsx$1("div", __assign$1({ style: { maxWidth: '360px' } }, { children: jsx$1(SliderNavigation, __assign$1({ speed: 200, infinite: false, arrows: {
12150
+ return (jsxs$1(Fragment$2, { children: [jsx$1(Container$T, __assign$1({ role: "list", "data-testid": dataTestId, position: position, className: hasOverflowArrows ? 'imageListContainer' : position, hasOverflowArrows: hasOverflowArrows, isRatioSquare: isRatioSquare }, { children: position == 'horizontal' ? (jsx$1("div", __assign$1({ style: { maxWidth: '360px' } }, { children: jsx$1(SliderNavigation, __assign$1({ speed: 200, infinite: false, arrows: {
12148
12151
  arrowWidth: 0.75,
12149
12152
  arrowHeight: 1.25,
12150
12153
  arrowPadding: 1.625,
@@ -12172,7 +12175,7 @@ var templateObject_1$1a, templateObject_2$T, templateObject_3$J, templateObject_
12172
12175
 
12173
12176
  var Video$1 = function (_a) {
12174
12177
  var _b, _c, _d, _e;
12175
- 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"]);
12178
+ 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"]);
12176
12179
  var videoRef = useRef(null);
12177
12180
  var _g = useState(true), isLoading = _g[0], setIsLoading = _g[1];
12178
12181
  var _h = useState(false), isPlaying = _h[0], setIsPlaying = _h[1];
@@ -12182,11 +12185,11 @@ var Video$1 = function (_a) {
12182
12185
  var isStarted = videoProgress > 0;
12183
12186
  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);
12184
12187
  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;
12185
- useEffect(function () {
12186
- if (videoRef.current) {
12187
- videoRef.current.muted = Boolean(muted);
12188
+ if (isSlideActive !== undefined) {
12189
+ if (!isMuted && !isSlideActive && videoRef.current) {
12190
+ setIsMuted(true);
12188
12191
  }
12189
- }, [muted]);
12192
+ }
12190
12193
  var handlePlayClick = function () {
12191
12194
  if (videoRef.current && !debouncePlay) {
12192
12195
  setDebouncePlay(true);
@@ -12210,7 +12213,6 @@ var Video$1 = function (_a) {
12210
12213
  };
12211
12214
  var handleMuteToggle = function () {
12212
12215
  if (videoRef.current) {
12213
- videoRef.current.muted = !videoRef.current.muted;
12214
12216
  setIsMuted(function (prevState) { return !prevState; });
12215
12217
  }
12216
12218
  };
@@ -12219,7 +12221,7 @@ var Video$1 = function (_a) {
12219
12221
  setVideoProgress(videoRef.current.currentTime);
12220
12222
  }
12221
12223
  };
12222
- return (jsxs$1(Container$S, __assign$1({ className: className }, { children: [!isLoading && withProgressBar && jsx$1(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsx$1(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsx$1(PlayIcon, {}, void 0) }), void 0)) : (jsx$1(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), hasAudioControl && (jsxs$1(MuteButton, __assign$1({ onClick: handleMuteToggle }, { children: [isMuted && jsx$1(Icon$1, { name: "custom/sound_off" }, void 0), !isMuted && jsx$1(Icon$1, { name: "custom/sound_on" }, void 0)] }), void 0)), jsxs$1(HTMLVideo, __assign$1({}, rest, { muted: true, "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: [jsx$1("track", { kind: "captions" }, void 0), jsx$1("source", { src: source }, void 0)] }), void 0)] }), void 0));
12224
+ return (jsxs$1(Container$S, __assign$1({ className: className }, { children: [!isLoading && withProgressBar && jsx$1(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsx$1(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsx$1(PlayIcon, {}, void 0) }), void 0)) : (jsx$1(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), hasAudioControl && (jsxs$1(MuteButton, __assign$1({ onClick: handleMuteToggle }, { children: [isMuted && jsx$1(Icon$1, { name: "custom/sound_off" }, void 0), !isMuted && jsx$1(Icon$1, { name: "custom/sound_on" }, void 0)] }), void 0)), jsxs$1(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: [jsx$1("track", { kind: "captions" }, void 0), jsx$1("source", { src: source }, void 0)] }), void 0)] }), void 0));
12223
12225
  };
12224
12226
 
12225
12227
  var propTypes = {exports: {}};