@doyourjob/gravity-ui-page-constructor 5.31.222 → 5.31.223
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/cjs/components/Media/Media.js +3 -2
- package/build/cjs/components/Title/TitleItem.d.ts +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.css +6 -0
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/cjs/components/VideoBlock/VideoBlock.js +3 -3
- package/build/cjs/models/constructor-items/common.d.ts +1 -0
- package/build/esm/components/Media/Media.js +3 -2
- package/build/esm/components/Title/TitleItem.d.ts +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.css +6 -0
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/esm/components/VideoBlock/VideoBlock.js +3 -3
- package/build/esm/models/constructor-items/common.d.ts +1 -0
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +1 -0
- package/widget/index.js +1 -1
|
@@ -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, playButtonСorner, 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, "playButton\u0421orner": playButtonСorner, 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
|
+
playButtonСorner,
|
|
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 |
|
|
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
|
}
|
|
@@ -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, playButtonСorner, 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: playButtonСorner }) },
|
|
101
|
+
react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayFill, size: playButtonСorner ? 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
|
+
playButtonСorner?: 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, playButtonСorner, 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, "playButton\u0421orner": playButtonСorner, 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
|
+
playButtonСorner,
|
|
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 |
|
|
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
|
}
|
|
@@ -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, playButtonСorner, 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: playButtonСorner }) },
|
|
97
|
+
React.createElement(Icon, { className: b('icon'), data: PlayFill, size: playButtonСorner ? 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
|
+
playButtonСorner?: boolean;
|
|
195
196
|
fullscreen?: boolean;
|
|
196
197
|
}
|
|
197
198
|
export interface MediaComponentImageProps {
|
package/package.json
CHANGED
|
@@ -192,6 +192,7 @@ export interface MediaComponentVideoIframeProps {
|
|
|
192
192
|
export interface MediaComponentYoutubeProps {
|
|
193
193
|
youtube: string;
|
|
194
194
|
previewImg?: string;
|
|
195
|
+
playButtonСorner?: boolean;
|
|
195
196
|
fullscreen?: boolean;
|
|
196
197
|
}
|
|
197
198
|
export interface MediaComponentImageProps {
|