@gravity-ui/page-constructor 4.56.0 → 4.57.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/build/cjs/blocks/Header/schema.d.ts +9 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/cjs/blocks/Media/schema.d.ts +6 -0
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +3 -0
- package/build/cjs/components/Media/Image/Image.js +4 -1
- package/build/cjs/components/Media/Media.js +3 -2
- package/build/cjs/models/constructor-items/common.d.ts +1 -0
- package/build/cjs/schema/constants.d.ts +3 -0
- package/build/cjs/schema/validators/common.d.ts +3 -0
- package/build/cjs/schema/validators/common.js +3 -0
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +4 -10
- package/build/cjs/sub-blocks/BasicCard/BasicCard.css +7 -0
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +4 -10
- package/build/cjs/sub-blocks/Content/Content.css +6 -2
- package/build/cjs/sub-blocks/Content/Content.js +3 -10
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +3 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +2 -8
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +3 -0
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +3 -0
- package/build/esm/blocks/Header/schema.d.ts +9 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/esm/blocks/Media/schema.d.ts +6 -0
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/esm/blocks/Tabs/schema.d.ts +3 -0
- package/build/esm/components/Media/Image/Image.js +4 -1
- package/build/esm/components/Media/Media.js +3 -2
- package/build/esm/models/constructor-items/common.d.ts +1 -0
- package/build/esm/schema/constants.d.ts +3 -0
- package/build/esm/schema/validators/common.d.ts +3 -0
- package/build/esm/schema/validators/common.js +3 -0
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +5 -11
- package/build/esm/sub-blocks/BasicCard/BasicCard.css +7 -0
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -11
- package/build/esm/sub-blocks/Content/Content.css +6 -2
- package/build/esm/sub-blocks/Content/Content.js +4 -11
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +3 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +3 -9
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +3 -0
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +3 -0
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +1 -0
- package/widget/index.js +1 -1
- package/build/cjs/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
- package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
- package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -9
- package/build/cjs/utils/renderContentControls/ContentControls.css +0 -6
- package/build/cjs/utils/renderContentControls/renderContentControls.d.ts +0 -11
- package/build/cjs/utils/renderContentControls/renderContentControls.js +0 -16
- package/build/esm/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
- package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
- package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -6
- package/build/esm/utils/renderContentControls/ContentControls.css +0 -6
- package/build/esm/utils/renderContentControls/renderContentControls.d.ts +0 -12
- package/build/esm/utils/renderContentControls/renderContentControls.js +0 -14
|
@@ -48,6 +48,9 @@ export declare const HeaderBackgroundProps: {
|
|
|
48
48
|
optionName: string;
|
|
49
49
|
})[];
|
|
50
50
|
};
|
|
51
|
+
disableImageSliderForArrayInput: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
51
54
|
video: {
|
|
52
55
|
type: string;
|
|
53
56
|
additionalProperties: boolean;
|
|
@@ -508,6 +511,9 @@ export declare const HeaderProperties: {
|
|
|
508
511
|
optionName: string;
|
|
509
512
|
})[];
|
|
510
513
|
};
|
|
514
|
+
disableImageSliderForArrayInput: {
|
|
515
|
+
type: string;
|
|
516
|
+
};
|
|
511
517
|
video: {
|
|
512
518
|
type: string;
|
|
513
519
|
additionalProperties: boolean;
|
|
@@ -1017,6 +1023,9 @@ export declare const HeaderBlock: {
|
|
|
1017
1023
|
optionName: string;
|
|
1018
1024
|
})[];
|
|
1019
1025
|
};
|
|
1026
|
+
disableImageSliderForArrayInput: {
|
|
1027
|
+
type: string;
|
|
1028
|
+
};
|
|
1020
1029
|
video: {
|
|
1021
1030
|
type: string;
|
|
1022
1031
|
additionalProperties: boolean;
|
|
@@ -42,6 +42,9 @@ export declare const Media: {
|
|
|
42
42
|
optionName: string;
|
|
43
43
|
})[];
|
|
44
44
|
};
|
|
45
|
+
disableImageSliderForArrayInput: {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
45
48
|
video: {
|
|
46
49
|
type: string;
|
|
47
50
|
additionalProperties: boolean;
|
|
@@ -720,6 +723,9 @@ export declare const MediaBlock: {
|
|
|
720
723
|
optionName: string;
|
|
721
724
|
})[];
|
|
722
725
|
};
|
|
726
|
+
disableImageSliderForArrayInput: {
|
|
727
|
+
type: string;
|
|
728
|
+
};
|
|
723
729
|
video: {
|
|
724
730
|
type: string;
|
|
725
731
|
additionalProperties: boolean;
|
|
@@ -15,7 +15,10 @@ const utils_2 = require("./utils");
|
|
|
15
15
|
const b = (0, utils_1.block)('media-component-image');
|
|
16
16
|
exports.defaultAnimatedDivQa = 'animated-div';
|
|
17
17
|
const Image = (props) => {
|
|
18
|
-
const { parallax,
|
|
18
|
+
const { parallax, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, disableImageSliderForArrayInput, qa, onLoad, } = props;
|
|
19
|
+
const image = Array.isArray(props.image) && disableImageSliderForArrayInput
|
|
20
|
+
? props.image[0]
|
|
21
|
+
: props.image;
|
|
19
22
|
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'fullscreen-image', 'animate', 'background-image', 'image-view', 'slider-block');
|
|
20
23
|
const [scrollY, setScrollY] = (0, react_1.useState)(0);
|
|
21
24
|
const [{ springScrollY }, springSetScrollY] = (0, web_1.useSpring)(() => ({
|
|
@@ -12,13 +12,13 @@ const Image_1 = tslib_1.__importDefault(require("./Image/Image"));
|
|
|
12
12
|
const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
|
|
13
13
|
const b = (0, utils_1.block)('Media');
|
|
14
14
|
const Media = (props) => {
|
|
15
|
-
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
|
|
15
|
+
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
|
|
16
16
|
const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
|
|
17
17
|
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'video');
|
|
18
18
|
const content = (0, react_1.useMemo)(() => {
|
|
19
19
|
let result = [];
|
|
20
20
|
if (image) {
|
|
21
|
-
result.push(react_1.default.createElement(Image_1.default, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen, qa: qaAttributes.image, onLoad: onImageLoad }));
|
|
21
|
+
result.push(react_1.default.createElement(Image_1.default, { key: "image", parallax: parallax, image: image, disableImageSliderForArrayInput: disableImageSliderForArrayInput, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen, qa: qaAttributes.image, onLoad: onImageLoad }));
|
|
22
22
|
}
|
|
23
23
|
if (video) {
|
|
24
24
|
const videoProps = {
|
|
@@ -60,6 +60,7 @@ const Media = (props) => {
|
|
|
60
60
|
dataLens,
|
|
61
61
|
iframe,
|
|
62
62
|
parallax,
|
|
63
|
+
disableImageSliderForArrayInput,
|
|
63
64
|
height,
|
|
64
65
|
imageClassName,
|
|
65
66
|
isBackground,
|
|
@@ -37,6 +37,12 @@ unpredictable css rules order in build */
|
|
|
37
37
|
object-fit: cover;
|
|
38
38
|
object-position: left;
|
|
39
39
|
}
|
|
40
|
+
.pc-background-card__footer {
|
|
41
|
+
margin-top: 0px;
|
|
42
|
+
}
|
|
43
|
+
.pc-background-card__links, .pc-background-card__buttons {
|
|
44
|
+
margin-top: 16px;
|
|
45
|
+
}
|
|
40
46
|
|
|
41
47
|
a.pc-background-card_theme_light {
|
|
42
48
|
background-color: var(--pc-color-base-silver);
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const components_1 = require("../../components/");
|
|
7
7
|
const theme_1 = require("../../context/theme");
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
|
-
const renderContentControls_1 = tslib_1.__importDefault(require("../../utils/renderContentControls/renderContentControls"));
|
|
10
9
|
const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
|
|
11
|
-
const renderCardFooterControlsContainer_1 = tslib_1.__importDefault(require("../renderCardFooterControlsContainer/renderCardFooterControlsContainer"));
|
|
12
10
|
const b = (0, utils_1.block)('background-card');
|
|
13
11
|
const BackgroundCard = (props) => {
|
|
14
12
|
const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', } = props;
|
|
@@ -17,16 +15,12 @@ const BackgroundCard = (props) => {
|
|
|
17
15
|
const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
|
|
18
16
|
const borderType = hasBackgroundColor ? 'none' : border;
|
|
19
17
|
const areControlsInFooter = !paddingBottom && controlPosition === 'footer';
|
|
20
|
-
const footerControls = (0, react_1.useMemo)(() => (0, renderContentControls_1.default)({
|
|
21
|
-
links: areControlsInFooter ? links : undefined,
|
|
22
|
-
buttons: areControlsInFooter ? buttons : undefined,
|
|
23
|
-
size: 's',
|
|
24
|
-
titleId,
|
|
25
|
-
}, renderCardFooterControlsContainer_1.default), [areControlsInFooter, links, buttons, titleId]);
|
|
26
18
|
return (react_1.default.createElement(components_1.CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle },
|
|
27
19
|
react_1.default.createElement(components_1.CardBase.Content, null,
|
|
28
20
|
react_1.default.createElement(components_1.BackgroundImage, Object.assign({ className: b('image') }, (0, utils_1.getThemedValue)(background, theme), { style: { backgroundColor } })),
|
|
29
21
|
react_1.default.createElement(Content_1.default, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: areControlsInFooter ? undefined : links, buttons: areControlsInFooter ? undefined : buttons, colSizes: { all: 12, md: 12 } })),
|
|
30
|
-
|
|
22
|
+
areControlsInFooter && (links || buttons) && (react_1.default.createElement(components_1.CardBase.Footer, null,
|
|
23
|
+
react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
|
|
24
|
+
react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
|
|
31
25
|
};
|
|
32
26
|
exports.default = BackgroundCard;
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const components_1 = require("../../components");
|
|
7
7
|
const sub_blocks_1 = require("../../models/constructor-items/sub-blocks");
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
|
-
const renderContentControls_1 = tslib_1.__importDefault(require("../../utils/renderContentControls/renderContentControls"));
|
|
10
9
|
const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
|
|
11
|
-
const renderCardFooterControlsContainer_1 = tslib_1.__importDefault(require("../renderCardFooterControlsContainer/renderCardFooterControlsContainer"));
|
|
12
10
|
const b = (0, utils_1.block)('basic-card');
|
|
13
11
|
const BasicCard = (props) => {
|
|
14
12
|
const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = sub_blocks_1.IconPosition.Top, controlPosition = 'content' } = props, cardParams = tslib_1.__rest(props, ["title", "text", "icon", "additionalInfo", "links", "list", "buttons", "iconPosition", "controlPosition"]);
|
|
15
13
|
const titleId = (0, uikit_1.useUniqId)();
|
|
16
14
|
const descriptionId = (0, uikit_1.useUniqId)();
|
|
17
15
|
const areControlsInFooter = controlPosition === 'footer';
|
|
18
|
-
const footerControls = (0, react_1.useMemo)(() => (0, renderContentControls_1.default)({
|
|
19
|
-
links: areControlsInFooter ? links : undefined,
|
|
20
|
-
buttons: areControlsInFooter ? buttons : undefined,
|
|
21
|
-
size: 's',
|
|
22
|
-
titleId,
|
|
23
|
-
}, renderCardFooterControlsContainer_1.default), [areControlsInFooter, links, buttons, titleId]);
|
|
24
16
|
return (react_1.default.createElement(components_1.CardBase, Object.assign({ className: b() }, cardParams, { extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId } }),
|
|
25
17
|
react_1.default.createElement(components_1.CardBase.Content, null,
|
|
26
18
|
react_1.default.createElement(components_1.IconWrapper, { icon: icon ? { value: icon, position: iconPosition } : undefined },
|
|
27
19
|
react_1.default.createElement(Content_1.default, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: areControlsInFooter ? undefined : links, list: list, buttons: areControlsInFooter ? undefined : buttons, size: "s", colSizes: { all: 12, md: 12 } }))),
|
|
28
|
-
|
|
20
|
+
areControlsInFooter && (buttons || links) && (react_1.default.createElement(components_1.CardBase.Footer, { className: b('footer') },
|
|
21
|
+
react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
|
|
22
|
+
react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
|
|
29
23
|
};
|
|
30
24
|
exports.default = BasicCard;
|
|
@@ -57,7 +57,9 @@ unpredictable css rules order in build */
|
|
|
57
57
|
.pc-content_size_s .pc-content__text_without-title {
|
|
58
58
|
margin-top: 0;
|
|
59
59
|
}
|
|
60
|
-
.pc-content_size_s .pc-content__list
|
|
60
|
+
.pc-content_size_s .pc-content__list,
|
|
61
|
+
.pc-content_size_s .pc-content__links,
|
|
62
|
+
.pc-content_size_s .pc-content__buttons {
|
|
61
63
|
margin-top: 16px;
|
|
62
64
|
}
|
|
63
65
|
.pc-content_size_l .pc-content__text,
|
|
@@ -72,7 +74,9 @@ unpredictable css rules order in build */
|
|
|
72
74
|
font-size: var(--g-text-body-3-font-size);
|
|
73
75
|
line-height: var(--g-text-body-3-line-height);
|
|
74
76
|
}
|
|
75
|
-
.pc-content_size_l .pc-content__list
|
|
77
|
+
.pc-content_size_l .pc-content__list,
|
|
78
|
+
.pc-content_size_l .pc-content__links,
|
|
79
|
+
.pc-content_size_l .pc-content__buttons {
|
|
76
80
|
margin-top: 24px;
|
|
77
81
|
}
|
|
78
82
|
.pc-content_theme_dark {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const components_1 = require("../../components");
|
|
7
7
|
const grid_1 = require("../../grid");
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const blocks_1 = require("../../utils/blocks");
|
|
10
|
-
const renderContentControls_1 = tslib_1.__importDefault(require("../../utils/renderContentControls/renderContentControls"));
|
|
11
10
|
const b = (0, utils_1.block)('content');
|
|
12
11
|
function getTextSize(size) {
|
|
13
12
|
switch (size) {
|
|
@@ -27,13 +26,6 @@ const Content = (props) => {
|
|
|
27
26
|
const hasTitle = Boolean(title);
|
|
28
27
|
const defaultTitleId = (0, uikit_1.useUniqId)();
|
|
29
28
|
const titleId = titleIdFromProps || defaultTitleId;
|
|
30
|
-
const controls = (0, react_1.useMemo)(() => (0, renderContentControls_1.default)({
|
|
31
|
-
size,
|
|
32
|
-
links,
|
|
33
|
-
buttons,
|
|
34
|
-
titleId,
|
|
35
|
-
qa: qaAttributes,
|
|
36
|
-
}), [size, links, buttons, titleId, qaAttributes]);
|
|
37
29
|
return (react_1.default.createElement(grid_1.Col, { className: b({ size, centered, theme }, className), reset: true, sizes: colSizes, qa: qaAttributes.container },
|
|
38
30
|
title && (react_1.default.createElement(components_1.Title, { className: b('title'), title: titleProps, colSizes: { all: 12 }, id: titleId })),
|
|
39
31
|
text && (react_1.default.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
|
|
@@ -46,6 +38,7 @@ const Content = (props) => {
|
|
|
46
38
|
'constructor-notice': true,
|
|
47
39
|
[`constructor-size-${size}`]: true,
|
|
48
40
|
} }))),
|
|
49
|
-
|
|
41
|
+
links && (react_1.default.createElement(components_1.Links, { className: b('links', { size }), size: size, links: links, titleId: titleId, qa: qaAttributes.links, linkQa: qaAttributes.link })),
|
|
42
|
+
buttons && (react_1.default.createElement(components_1.Buttons, { className: b('buttons', { size }), size: size, buttons: buttons, titleId: titleId, qa: qaAttributes.buttons, buttonQa: qaAttributes.button }))));
|
|
50
43
|
};
|
|
51
44
|
exports.default = Content;
|
|
@@ -5,7 +5,6 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const components_1 = require("../../components");
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
|
-
const renderContentControls_1 = tslib_1.__importDefault(require("../../utils/renderContentControls/renderContentControls"));
|
|
9
8
|
const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
|
|
10
9
|
const utils_2 = require("./utils");
|
|
11
10
|
const b = (0, utils_1.block)('layout-item');
|
|
@@ -15,12 +14,6 @@ const LayoutItem = (_a) => {
|
|
|
15
14
|
const areControlsInFooter = controlPosition === 'footer';
|
|
16
15
|
const contentProps = Object.assign(Object.assign(Object.assign({}, content), (areControlsInFooter ? {} : { links: normalizedLinks, buttons })), { size: 's', colSizes: { all: 12, md: 12 } });
|
|
17
16
|
const titleId = (0, uikit_1.useUniqId)();
|
|
18
|
-
const footerControls = (0, react_1.useMemo)(() => (0, renderContentControls_1.default)({
|
|
19
|
-
links: areControlsInFooter ? links : undefined,
|
|
20
|
-
buttons: areControlsInFooter ? buttons : undefined,
|
|
21
|
-
size: 's',
|
|
22
|
-
titleId,
|
|
23
|
-
}), [areControlsInFooter, links, buttons, titleId]);
|
|
24
17
|
const renderMedia = () => {
|
|
25
18
|
if (!media) {
|
|
26
19
|
return null;
|
|
@@ -36,6 +29,7 @@ const LayoutItem = (_a) => {
|
|
|
36
29
|
react_1.default.createElement("div", { className: b('content', { 'no-media': !media }) },
|
|
37
30
|
react_1.default.createElement(components_1.IconWrapper, { icon: icon },
|
|
38
31
|
react_1.default.createElement(Content_1.default, Object.assign({}, contentProps, { titleId: titleId })))),
|
|
39
|
-
|
|
32
|
+
areControlsInFooter && links && (react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId })),
|
|
33
|
+
areControlsInFooter && buttons && (react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId }))));
|
|
40
34
|
};
|
|
41
35
|
exports.default = LayoutItem;
|
|
@@ -48,6 +48,9 @@ export declare const HeaderBackgroundProps: {
|
|
|
48
48
|
optionName: string;
|
|
49
49
|
})[];
|
|
50
50
|
};
|
|
51
|
+
disableImageSliderForArrayInput: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
51
54
|
video: {
|
|
52
55
|
type: string;
|
|
53
56
|
additionalProperties: boolean;
|
|
@@ -508,6 +511,9 @@ export declare const HeaderProperties: {
|
|
|
508
511
|
optionName: string;
|
|
509
512
|
})[];
|
|
510
513
|
};
|
|
514
|
+
disableImageSliderForArrayInput: {
|
|
515
|
+
type: string;
|
|
516
|
+
};
|
|
511
517
|
video: {
|
|
512
518
|
type: string;
|
|
513
519
|
additionalProperties: boolean;
|
|
@@ -1017,6 +1023,9 @@ export declare const HeaderBlock: {
|
|
|
1017
1023
|
optionName: string;
|
|
1018
1024
|
})[];
|
|
1019
1025
|
};
|
|
1026
|
+
disableImageSliderForArrayInput: {
|
|
1027
|
+
type: string;
|
|
1028
|
+
};
|
|
1020
1029
|
video: {
|
|
1021
1030
|
type: string;
|
|
1022
1031
|
additionalProperties: boolean;
|
|
@@ -42,6 +42,9 @@ export declare const Media: {
|
|
|
42
42
|
optionName: string;
|
|
43
43
|
})[];
|
|
44
44
|
};
|
|
45
|
+
disableImageSliderForArrayInput: {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
45
48
|
video: {
|
|
46
49
|
type: string;
|
|
47
50
|
additionalProperties: boolean;
|
|
@@ -720,6 +723,9 @@ export declare const MediaBlock: {
|
|
|
720
723
|
optionName: string;
|
|
721
724
|
})[];
|
|
722
725
|
};
|
|
726
|
+
disableImageSliderForArrayInput: {
|
|
727
|
+
type: string;
|
|
728
|
+
};
|
|
723
729
|
video: {
|
|
724
730
|
type: string;
|
|
725
731
|
additionalProperties: boolean;
|
|
@@ -12,7 +12,10 @@ import './Image.css';
|
|
|
12
12
|
const b = block('media-component-image');
|
|
13
13
|
export const defaultAnimatedDivQa = 'animated-div';
|
|
14
14
|
const Image = (props) => {
|
|
15
|
-
const { parallax,
|
|
15
|
+
const { parallax, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, disableImageSliderForArrayInput, qa, onLoad, } = props;
|
|
16
|
+
const image = Array.isArray(props.image) && disableImageSliderForArrayInput
|
|
17
|
+
? props.image[0]
|
|
18
|
+
: props.image;
|
|
16
19
|
const qaAttributes = getQaAttrubutes(qa, 'fullscreen-image', 'animate', 'background-image', 'image-view', 'slider-block');
|
|
17
20
|
const [scrollY, setScrollY] = useState(0);
|
|
18
21
|
const [{ springScrollY }, springSetScrollY] = useSpring(() => ({
|
|
@@ -9,13 +9,13 @@ import Video from './Video/Video';
|
|
|
9
9
|
import './Media.css';
|
|
10
10
|
const b = block('Media');
|
|
11
11
|
export const Media = (props) => {
|
|
12
|
-
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
|
|
12
|
+
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
|
|
13
13
|
const [hasVideoFallback, setHasVideoFallback] = useState(false);
|
|
14
14
|
const qaAttributes = getQaAttrubutes(qa, 'video');
|
|
15
15
|
const content = useMemo(() => {
|
|
16
16
|
let result = [];
|
|
17
17
|
if (image) {
|
|
18
|
-
result.push(React.createElement(Image, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen, qa: qaAttributes.image, onLoad: onImageLoad }));
|
|
18
|
+
result.push(React.createElement(Image, { key: "image", parallax: parallax, image: image, disableImageSliderForArrayInput: disableImageSliderForArrayInput, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen, qa: qaAttributes.image, onLoad: onImageLoad }));
|
|
19
19
|
}
|
|
20
20
|
if (video) {
|
|
21
21
|
const videoProps = {
|
|
@@ -57,6 +57,7 @@ export const Media = (props) => {
|
|
|
57
57
|
dataLens,
|
|
58
58
|
iframe,
|
|
59
59
|
parallax,
|
|
60
|
+
disableImageSliderForArrayInput,
|
|
60
61
|
height,
|
|
61
62
|
imageClassName,
|
|
62
63
|
isBackground,
|
|
@@ -37,6 +37,12 @@ unpredictable css rules order in build */
|
|
|
37
37
|
object-fit: cover;
|
|
38
38
|
object-position: left;
|
|
39
39
|
}
|
|
40
|
+
.pc-background-card__footer {
|
|
41
|
+
margin-top: 0px;
|
|
42
|
+
}
|
|
43
|
+
.pc-background-card__links, .pc-background-card__buttons {
|
|
44
|
+
margin-top: 16px;
|
|
45
|
+
}
|
|
40
46
|
|
|
41
47
|
a.pc-background-card_theme_light {
|
|
42
48
|
background-color: var(--pc-color-base-silver);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useUniqId } from '@gravity-ui/uikit';
|
|
3
|
-
import { BackgroundImage, CardBase } from '../../components/';
|
|
3
|
+
import { BackgroundImage, Buttons, CardBase, Links } from '../../components/';
|
|
4
4
|
import { useTheme } from '../../context/theme';
|
|
5
5
|
import { block, getThemedValue } from '../../utils';
|
|
6
|
-
import renderContentControls from '../../utils/renderContentControls/renderContentControls';
|
|
7
6
|
import Content from '../Content/Content';
|
|
8
|
-
import renderCardFooterControlsContainer from '../renderCardFooterControlsContainer/renderCardFooterControlsContainer';
|
|
9
7
|
import './BackgroundCard.css';
|
|
10
8
|
const b = block('background-card');
|
|
11
9
|
const BackgroundCard = (props) => {
|
|
@@ -15,16 +13,12 @@ const BackgroundCard = (props) => {
|
|
|
15
13
|
const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
|
|
16
14
|
const borderType = hasBackgroundColor ? 'none' : border;
|
|
17
15
|
const areControlsInFooter = !paddingBottom && controlPosition === 'footer';
|
|
18
|
-
const footerControls = useMemo(() => renderContentControls({
|
|
19
|
-
links: areControlsInFooter ? links : undefined,
|
|
20
|
-
buttons: areControlsInFooter ? buttons : undefined,
|
|
21
|
-
size: 's',
|
|
22
|
-
titleId,
|
|
23
|
-
}, renderCardFooterControlsContainer), [areControlsInFooter, links, buttons, titleId]);
|
|
24
16
|
return (React.createElement(CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle },
|
|
25
17
|
React.createElement(CardBase.Content, null,
|
|
26
18
|
React.createElement(BackgroundImage, Object.assign({ className: b('image') }, getThemedValue(background, theme), { style: { backgroundColor } })),
|
|
27
19
|
React.createElement(Content, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: areControlsInFooter ? undefined : links, buttons: areControlsInFooter ? undefined : buttons, colSizes: { all: 12, md: 12 } })),
|
|
28
|
-
|
|
20
|
+
areControlsInFooter && (links || buttons) && (React.createElement(CardBase.Footer, null,
|
|
21
|
+
React.createElement(Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
|
|
22
|
+
React.createElement(Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
|
|
29
23
|
};
|
|
30
24
|
export default BackgroundCard;
|