@doyourjob/gravity-ui-page-constructor 5.31.222 → 5.31.224

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.
@@ -14,7 +14,7 @@ const Image_1 = tslib_1.__importDefault(require("./Image/Image"));
14
14
  const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
15
15
  const b = (0, utils_1.block)('Media');
16
16
  const Media = (props) => {
17
- const { animated, image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, videoMicrodata, } = props;
17
+ const { animated, image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, playButtonCorner, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, videoMicrodata, } = props;
18
18
  const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
19
19
  const { microdata } = (0, react_1.useContext)(innerContext_1.InnerContext);
20
20
  const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'video');
@@ -46,7 +46,7 @@ const Media = (props) => {
46
46
  }
47
47
  }
48
48
  if (youtube || videoIframe) {
49
- result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, videoIframe: videoIframe, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay, onImageLoad: onImageLoad }));
49
+ result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, videoIframe: videoIframe, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, playButtonCorner: playButtonCorner, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay, onImageLoad: onImageLoad }));
50
50
  }
51
51
  if (dataLens) {
52
52
  result = react_1.default.createElement(DataLens_1.default, { dataLens: dataLens });
@@ -81,6 +81,7 @@ const Media = (props) => {
81
81
  customBarControlsClassName,
82
82
  ratio,
83
83
  youtubeClassName,
84
+ playButtonCorner,
84
85
  autoplay,
85
86
  margins,
86
87
  ]);
@@ -1,5 +1,5 @@
1
1
  import { QAProps, TitleItemProps, TitleTextSize } from '../../models';
2
- export declare function getArrowSize(size: TitleTextSize, isMobile: boolean): 16 | 13 | 22 | 24 | 26 | 38 | 20;
2
+ export declare function getArrowSize(size: TitleTextSize, isMobile: boolean): 16 | 20 | 24 | 13 | 22 | 26 | 38;
3
3
  export interface TitleItemFullProps extends TitleItemProps, QAProps {
4
4
  className?: string;
5
5
  onClick?: () => void;
@@ -51,6 +51,12 @@ unpredictable css rules order in build */
51
51
  .pc-VideoBlock__button:focus:not(:focus-visible) {
52
52
  outline: 0;
53
53
  }
54
+ .pc-VideoBlock__button_corner {
55
+ right: 16px;
56
+ bottom: 16px;
57
+ width: 44px;
58
+ height: 44px;
59
+ }
54
60
  .pc-VideoBlock__icon {
55
61
  margin-left: 1px;
56
62
  }
@@ -14,6 +14,7 @@ export interface VideoBlockProps extends AnalyticsEventsBase {
14
14
  className?: string;
15
15
  previewImg?: string;
16
16
  playButton?: React.ReactNode;
17
+ playButtonCorner?: boolean;
17
18
  playButtonId?: string;
18
19
  height?: number;
19
20
  fullscreen?: boolean;
@@ -43,7 +43,7 @@ function getHeight(width) {
43
43
  }
44
44
  exports.getHeight = getHeight;
45
45
  const VideoBlock = (props) => {
46
- const { stream, record, videoIframe, attributes, className, id, previewImg, playButton, playButtonId, height, fullscreen, analyticsEvents, autoplay, onImageLoad, } = props;
46
+ const { stream, record, videoIframe, attributes, className, id, previewImg, playButton, playButtonCorner, playButtonId, height, fullscreen, analyticsEvents, autoplay, onImageLoad, } = props;
47
47
  const handleAnalytics = (0, useAnalytics_1.useAnalytics)(common_1.DefaultEventNames.VideoPreview);
48
48
  const src = videoIframe ? videoIframe : getYoutubeVideoSrc(stream, record);
49
49
  const ref = (0, react_1.useRef)(null);
@@ -97,7 +97,7 @@ const VideoBlock = (props) => {
97
97
  iframeContent,
98
98
  previewImg && !hidePreview && !fullscreen && (react_1.default.createElement("div", { className: b('preview'), onClick: onPreviewClick, onKeyDown: onPreviewKeyDown, role: "button", tabIndex: 0, "aria-labelledby": playButton ? playButtonId : buttonId },
99
99
  react_1.default.createElement(Image_1.default, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper'), onLoad: onImageLoad }),
100
- playButton || (react_1.default.createElement("button", { title: "Play", id: buttonId, className: b('button') },
101
- react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayFill, size: 24 })))))));
100
+ playButton || (react_1.default.createElement("button", { title: "Play", id: buttonId, className: b('button', { corner: playButtonCorner }) },
101
+ react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayFill, size: playButtonCorner ? 16 : 24 })))))));
102
102
  };
103
103
  exports.default = VideoBlock;
@@ -192,6 +192,7 @@ export interface MediaComponentVideoIframeProps {
192
192
  export interface MediaComponentYoutubeProps {
193
193
  youtube: string;
194
194
  previewImg?: string;
195
+ playButtonCorner?: boolean;
195
196
  fullscreen?: boolean;
196
197
  }
197
198
  export interface MediaComponentImageProps {
@@ -11,7 +11,7 @@ import Video from './Video/Video';
11
11
  import './Media.css';
12
12
  const b = block('Media');
13
13
  export const Media = (props) => {
14
- const { animated, image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, videoMicrodata, } = props;
14
+ const { animated, image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, playButtonCorner, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, videoMicrodata, } = props;
15
15
  const [hasVideoFallback, setHasVideoFallback] = useState(false);
16
16
  const { microdata } = useContext(InnerContext);
17
17
  const qaAttributes = getQaAttrubutes(qa, 'video');
@@ -43,7 +43,7 @@ export const Media = (props) => {
43
43
  }
44
44
  }
45
45
  if (youtube || videoIframe) {
46
- result = (React.createElement(IframeVideoBlock, { className: b('youtube', youtubeClassName), record: youtube, videoIframe: videoIframe, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay, onImageLoad: onImageLoad }));
46
+ result = (React.createElement(IframeVideoBlock, { className: b('youtube', youtubeClassName), record: youtube, videoIframe: videoIframe, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, playButtonCorner: playButtonCorner, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay, onImageLoad: onImageLoad }));
47
47
  }
48
48
  if (dataLens) {
49
49
  result = React.createElement(DataLens, { dataLens: dataLens });
@@ -78,6 +78,7 @@ export const Media = (props) => {
78
78
  customBarControlsClassName,
79
79
  ratio,
80
80
  youtubeClassName,
81
+ playButtonCorner,
81
82
  autoplay,
82
83
  margins,
83
84
  ]);
@@ -1,6 +1,6 @@
1
1
  import { QAProps, TitleItemProps, TitleTextSize } from '../../models';
2
2
  import './TitleItem.css';
3
- export declare function getArrowSize(size: TitleTextSize, isMobile: boolean): 16 | 13 | 22 | 24 | 26 | 38 | 20;
3
+ export declare function getArrowSize(size: TitleTextSize, isMobile: boolean): 16 | 20 | 24 | 13 | 22 | 26 | 38;
4
4
  export interface TitleItemFullProps extends TitleItemProps, QAProps {
5
5
  className?: string;
6
6
  onClick?: () => void;
@@ -51,6 +51,12 @@ unpredictable css rules order in build */
51
51
  .pc-VideoBlock__button:focus:not(:focus-visible) {
52
52
  outline: 0;
53
53
  }
54
+ .pc-VideoBlock__button_corner {
55
+ right: 16px;
56
+ bottom: 16px;
57
+ width: 44px;
58
+ height: 44px;
59
+ }
54
60
  .pc-VideoBlock__icon {
55
61
  margin-left: 1px;
56
62
  }
@@ -15,6 +15,7 @@ export interface VideoBlockProps extends AnalyticsEventsBase {
15
15
  className?: string;
16
16
  previewImg?: string;
17
17
  playButton?: React.ReactNode;
18
+ playButtonCorner?: boolean;
18
19
  playButtonId?: string;
19
20
  height?: number;
20
21
  fullscreen?: boolean;
@@ -39,7 +39,7 @@ export function getHeight(width) {
39
39
  return (width / 16) * 9;
40
40
  }
41
41
  const VideoBlock = (props) => {
42
- const { stream, record, videoIframe, attributes, className, id, previewImg, playButton, playButtonId, height, fullscreen, analyticsEvents, autoplay, onImageLoad, } = props;
42
+ const { stream, record, videoIframe, attributes, className, id, previewImg, playButton, playButtonCorner, playButtonId, height, fullscreen, analyticsEvents, autoplay, onImageLoad, } = props;
43
43
  const handleAnalytics = useAnalytics(DefaultEventNames.VideoPreview);
44
44
  const src = videoIframe ? videoIframe : getYoutubeVideoSrc(stream, record);
45
45
  const ref = useRef(null);
@@ -93,7 +93,7 @@ const VideoBlock = (props) => {
93
93
  iframeContent,
94
94
  previewImg && !hidePreview && !fullscreen && (React.createElement("div", { className: b('preview'), onClick: onPreviewClick, onKeyDown: onPreviewKeyDown, role: "button", tabIndex: 0, "aria-labelledby": playButton ? playButtonId : buttonId },
95
95
  React.createElement(Image, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper'), onLoad: onImageLoad }),
96
- playButton || (React.createElement("button", { title: "Play", id: buttonId, className: b('button') },
97
- React.createElement(Icon, { className: b('icon'), data: PlayFill, size: 24 })))))));
96
+ playButton || (React.createElement("button", { title: "Play", id: buttonId, className: b('button', { corner: playButtonCorner }) },
97
+ React.createElement(Icon, { className: b('icon'), data: PlayFill, size: playButtonCorner ? 16 : 24 })))))));
98
98
  };
99
99
  export default VideoBlock;
@@ -192,6 +192,7 @@ export interface MediaComponentVideoIframeProps {
192
192
  export interface MediaComponentYoutubeProps {
193
193
  youtube: string;
194
194
  previewImg?: string;
195
+ playButtonCorner?: boolean;
195
196
  fullscreen?: boolean;
196
197
  }
197
198
  export interface MediaComponentImageProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doyourjob/gravity-ui-page-constructor",
3
- "version": "5.31.222",
3
+ "version": "5.31.224",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -192,6 +192,7 @@ export interface MediaComponentVideoIframeProps {
192
192
  export interface MediaComponentYoutubeProps {
193
193
  youtube: string;
194
194
  previewImg?: string;
195
+ playButtonCorner?: boolean;
195
196
  fullscreen?: boolean;
196
197
  }
197
198
  export interface MediaComponentImageProps {