@gravity-ui/page-constructor 4.36.0-alpha.0 → 4.36.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/Companies/Companies.css +0 -16
- package/build/cjs/blocks/Companies/Companies.d.ts +1 -1
- package/build/cjs/blocks/Companies/Companies.js +2 -2
- package/build/cjs/blocks/Form/Form.css +1 -6
- package/build/cjs/blocks/Form/Form.js +2 -4
- package/build/cjs/blocks/Tabs/Tabs.css +33 -3
- package/build/cjs/blocks/Tabs/Tabs.js +18 -21
- package/build/cjs/components/Image/Image.d.ts +1 -2
- package/build/cjs/components/Image/Image.js +2 -2
- package/build/cjs/components/ImageBase/ImageBase.d.ts +1 -2
- package/build/cjs/components/Media/Image/Image.d.ts +0 -1
- package/build/cjs/components/Media/Image/Image.js +2 -2
- package/build/cjs/components/Media/Media.js +3 -4
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +0 -1
- package/build/cjs/components/VideoBlock/VideoBlock.js +2 -2
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -0
- package/build/cjs/text-transform/config.js +1 -0
- package/build/esm/blocks/Companies/Companies.css +0 -16
- package/build/esm/blocks/Companies/Companies.d.ts +1 -1
- package/build/esm/blocks/Companies/Companies.js +3 -3
- package/build/esm/blocks/Form/Form.css +1 -6
- package/build/esm/blocks/Form/Form.js +2 -4
- package/build/esm/blocks/Tabs/Tabs.css +33 -3
- package/build/esm/blocks/Tabs/Tabs.js +19 -22
- package/build/esm/components/Image/Image.d.ts +1 -2
- package/build/esm/components/Image/Image.js +3 -3
- package/build/esm/components/ImageBase/ImageBase.d.ts +1 -2
- package/build/esm/components/Media/Image/Image.d.ts +0 -1
- package/build/esm/components/Media/Image/Image.js +2 -2
- package/build/esm/components/Media/Media.js +3 -4
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +0 -1
- package/build/esm/components/VideoBlock/VideoBlock.js +2 -2
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +1 -0
- package/build/esm/text-transform/config.js +1 -0
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +1 -0
- package/server/text-transform/config.js +1 -0
- package/widget/index.js +1 -1
- package/build/cjs/blocks/Tabs/TabsTextContent/TabsTextContent.css +0 -20
- package/build/cjs/blocks/Tabs/TabsTextContent/TabsTextContent.d.ts +0 -10
- package/build/cjs/blocks/Tabs/TabsTextContent/TabsTextContent.js +0 -17
- package/build/esm/blocks/Tabs/TabsTextContent/TabsTextContent.css +0 -20
- package/build/esm/blocks/Tabs/TabsTextContent/TabsTextContent.d.ts +0 -11
- package/build/esm/blocks/Tabs/TabsTextContent/TabsTextContent.js +0 -13
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
.pc-companies-block__title {
|
|
2
|
-
margin: 0;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
/* use this for style redefinitions to awoid problems with
|
|
6
2
|
unpredictable css rules order in build */
|
|
7
3
|
.pc-companies-block {
|
|
8
4
|
text-align: center;
|
|
9
5
|
}
|
|
10
|
-
.pc-companies-block__title {
|
|
11
|
-
font-size: var(--g-text-display-2-font-size);
|
|
12
|
-
line-height: var(--g-text-display-2-line-height);
|
|
13
|
-
color: var(--pc-text-header-color);
|
|
14
|
-
font-weight: var(--g-text-accent-font-weight);
|
|
15
|
-
}
|
|
16
|
-
@media (max-width: 576px) {
|
|
17
|
-
.pc-companies-block__title {
|
|
18
|
-
font-size: var(--g-text-display-1-font-size);
|
|
19
|
-
line-height: var(--g-text-display-1-line-height);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
6
|
.pc-companies-block__images {
|
|
23
7
|
margin-top: 32px;
|
|
24
8
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CompaniesBlockProps } from '../../models';
|
|
2
|
-
export declare const CompaniesBlock: ({ title, images, animated }: CompaniesBlockProps) => JSX.Element;
|
|
2
|
+
export declare const CompaniesBlock: ({ title, description, images, animated }: CompaniesBlockProps) => JSX.Element;
|
|
3
3
|
export default CompaniesBlock;
|
|
@@ -8,12 +8,12 @@ const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/Animate
|
|
|
8
8
|
const theme_1 = require("../../context/theme");
|
|
9
9
|
const utils_1 = require("../../utils");
|
|
10
10
|
const b = (0, utils_1.block)('companies-block');
|
|
11
|
-
const CompaniesBlock = ({ title, images, animated }) => {
|
|
11
|
+
const CompaniesBlock = ({ title, description, images, animated }) => {
|
|
12
12
|
const theme = (0, theme_1.useTheme)();
|
|
13
13
|
const themedImages = (0, utils_1.getThemedValue)(images, theme) || {};
|
|
14
14
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), offset: 150, animate: animated },
|
|
15
15
|
react_1.default.createElement("div", { className: b('content') },
|
|
16
|
-
react_1.default.createElement(
|
|
16
|
+
react_1.default.createElement(components_1.Title, { title: title, subtitle: description, colSizes: { all: 12, sm: 12 } }),
|
|
17
17
|
react_1.default.createElement("div", { className: b('images') },
|
|
18
18
|
react_1.default.createElement(components_1.Image, Object.assign({}, themedImages, { className: b('image') }))))));
|
|
19
19
|
};
|
|
@@ -118,14 +118,9 @@ unpredictable css rules order in build */
|
|
|
118
118
|
padding: 0 8px;
|
|
119
119
|
}
|
|
120
120
|
.pc-form-block_with-background .pc-form-block__row {
|
|
121
|
-
padding-top:
|
|
122
|
-
}
|
|
123
|
-
.pc-form-block_with-background .pc-form-block__row_padding-bottom_m {
|
|
121
|
+
padding-top: 32px;
|
|
124
122
|
padding-bottom: 32px;
|
|
125
123
|
}
|
|
126
|
-
.pc-form-block_with-background .pc-form-block__row_padding-bottom_l {
|
|
127
|
-
padding-bottom: 48px;
|
|
128
|
-
}
|
|
129
124
|
.pc-form-block_with-background .pc-form-block__row_direction_form-content .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_content-form .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_center .pc-form-block__content-wrapper {
|
|
130
125
|
padding-right: 16px;
|
|
131
126
|
padding-left: 16px;
|
|
@@ -16,8 +16,7 @@ const FormBlock = (props) => {
|
|
|
16
16
|
const { formData, title, textContent, direction = models_1.FormBlockDirection.Center, background } = props;
|
|
17
17
|
const [contentLoaded, setContentLoaded] = (0, react_1.useState)(false);
|
|
18
18
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
19
|
-
const
|
|
20
|
-
const paddingBottom = background && ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) && !hasImage ? 'l' : 'm'; // bigger padding for case with background color and no image
|
|
19
|
+
const withBackground = Boolean(background && (background.src || background.desktop || ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor)));
|
|
21
20
|
const onContentLoad = (0, react_1.useCallback)(() => {
|
|
22
21
|
setContentLoaded(true);
|
|
23
22
|
}, []);
|
|
@@ -32,7 +31,7 @@ const FormBlock = (props) => {
|
|
|
32
31
|
formType = models_1.FormBlockDataTypes.HUBSPOT;
|
|
33
32
|
}
|
|
34
33
|
return (react_1.default.createElement("div", { className: b({
|
|
35
|
-
'with-background':
|
|
34
|
+
'with-background': withBackground,
|
|
36
35
|
'form-type': formType,
|
|
37
36
|
}) },
|
|
38
37
|
background && (react_1.default.createElement(components_1.BackgroundImage, Object.assign({}, background, { className: b('media'), imageClassName: b('image') }))),
|
|
@@ -41,7 +40,6 @@ const FormBlock = (props) => {
|
|
|
41
40
|
? grid_1.GridAlignItems.Center
|
|
42
41
|
: grid_1.GridAlignItems.Start, className: b('row', {
|
|
43
42
|
direction,
|
|
44
|
-
'padding-bottom': paddingBottom,
|
|
45
43
|
}) },
|
|
46
44
|
react_1.default.createElement(grid_1.Col, { sizes: colSizes, className: b('content-col') }, textContent && (react_1.default.createElement("div", { className: b('content-wrapper') },
|
|
47
45
|
react_1.default.createElement(sub_blocks_1.Content, Object.assign({ theme: "default" }, textContent, { centered: direction === models_1.FormBlockDirection.Center, colSizes: { all: 12 }, className: b('content') }))))),
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
.pc-tabs-block__content-title.pc-tabs-block__content-title > * {
|
|
2
|
+
margin: 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
/* use this for style redefinitions to awoid problems with
|
|
2
6
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-tabs-
|
|
7
|
+
.pc-tabs-block__block-title {
|
|
4
8
|
margin-bottom: 24px;
|
|
5
9
|
}
|
|
6
|
-
.pc-tabs-
|
|
10
|
+
.pc-tabs-block__block-title_centered {
|
|
7
11
|
text-align: center;
|
|
8
12
|
}
|
|
9
|
-
.pc-tabs-
|
|
13
|
+
.pc-tabs-block__block-title_centered > * {
|
|
10
14
|
margin: 0 auto;
|
|
11
15
|
}
|
|
12
16
|
.pc-tabs-block__tabs {
|
|
@@ -40,6 +44,9 @@ unpredictable css rules order in build */
|
|
|
40
44
|
.pc-tabs-block__row_reverse {
|
|
41
45
|
flex-direction: row-reverse;
|
|
42
46
|
}
|
|
47
|
+
.pc-tabs-block__row_reverse .pc-tabs-block__content-wrapper {
|
|
48
|
+
margin: 24px 32px 0 0;
|
|
49
|
+
}
|
|
43
50
|
.pc-tabs-block__image {
|
|
44
51
|
width: 100%;
|
|
45
52
|
height: auto;
|
|
@@ -57,10 +64,33 @@ unpredictable css rules order in build */
|
|
|
57
64
|
margin: 12px 0 0;
|
|
58
65
|
color: var(--g-color-text-secondary);
|
|
59
66
|
}
|
|
67
|
+
.pc-tabs-block__content {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
}
|
|
71
|
+
.pc-tabs-block__content_centered {
|
|
72
|
+
margin: 0 auto;
|
|
73
|
+
}
|
|
60
74
|
.pc-tabs-block__col_centered {
|
|
61
75
|
margin: 0 auto;
|
|
62
76
|
}
|
|
77
|
+
.pc-tabs-block__content-wrapper_margin {
|
|
78
|
+
margin: 24px 0 0 32px;
|
|
79
|
+
}
|
|
80
|
+
.pc-tabs-block__content-title {
|
|
81
|
+
margin: 0 auto 12px;
|
|
82
|
+
}
|
|
83
|
+
.pc-tabs-block__content-title.pc-tabs-block__content-title > * {
|
|
84
|
+
font-size: var(--g-text-header-1-font-size);
|
|
85
|
+
line-height: var(--g-text-header-1-line-height);
|
|
86
|
+
color: var(--pc-text-header-color);
|
|
87
|
+
font-weight: var(--g-text-accent-font-weight);
|
|
88
|
+
}
|
|
89
|
+
|
|
63
90
|
@media (max-width: 769px) {
|
|
91
|
+
.pc-tabs-block__content-wrapper_margin {
|
|
92
|
+
margin: 0 0 32px 0;
|
|
93
|
+
}
|
|
64
94
|
.pc-tabs-block__row_reverse {
|
|
65
95
|
flex-direction: column-reverse;
|
|
66
96
|
}
|
|
@@ -13,11 +13,11 @@ const Title_1 = tslib_1.__importDefault(require("../../components/Title/Title"))
|
|
|
13
13
|
const VideoBlock_1 = require("../../components/VideoBlock/VideoBlock");
|
|
14
14
|
const theme_1 = require("../../context/theme");
|
|
15
15
|
const grid_1 = require("../../grid");
|
|
16
|
+
const sub_blocks_1 = require("../../sub-blocks");
|
|
16
17
|
const utils_2 = require("../../utils");
|
|
17
|
-
const TabsTextContent_1 = tslib_1.__importDefault(require("./TabsTextContent/TabsTextContent"));
|
|
18
18
|
const b = (0, utils_2.block)('tabs-block');
|
|
19
19
|
const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', contentSize = 's', }) => {
|
|
20
|
-
var _a
|
|
20
|
+
var _a;
|
|
21
21
|
const [activeTab, setActiveTab] = (0, react_1.useState)(items[0].tabName);
|
|
22
22
|
const [play, setPlay] = (0, react_1.useState)(false);
|
|
23
23
|
const theme = (0, theme_1.useTheme)();
|
|
@@ -26,24 +26,11 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
26
26
|
const isReverse = direction === 'content-media';
|
|
27
27
|
const ref = (0, react_1.useRef)(null);
|
|
28
28
|
const mediaWidth = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
|
|
29
|
+
const mediaHeight = mediaWidth && (0, VideoBlock_1.getHeight)(mediaWidth);
|
|
29
30
|
const captionId = (0, uikit_1.useUniqId)();
|
|
30
|
-
const themedMedia = (0, utils_2.getThemedValue)(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media, theme);
|
|
31
|
-
const mediaVideoHeight = mediaWidth && (0, VideoBlock_1.getHeight)(mediaWidth);
|
|
32
|
-
const setVideoHeight = !(themedMedia === null || themedMedia === void 0 ? void 0 : themedMedia.image) && !(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.image);
|
|
33
|
-
const [minImageHeight, setMinImageHeight] = (0, react_1.useState)((_b = ref === null || ref === void 0 ? void 0 : ref.current) === null || _b === void 0 ? void 0 : _b.offsetHeight);
|
|
34
|
-
// TODO remove property support activeTabData?.image. Use only activeTabData?.media?.image
|
|
35
31
|
let imageProps;
|
|
36
|
-
const handleImageHeight = (0, react_1.useCallback)(() => {
|
|
37
|
-
var _a;
|
|
38
|
-
setMinImageHeight((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.offsetHeight);
|
|
39
|
-
}, []);
|
|
40
|
-
const onSelectTab = (id, e) => {
|
|
41
|
-
setActiveTab(id);
|
|
42
|
-
handleImageHeight();
|
|
43
|
-
e.currentTarget.scrollIntoView({ inline: 'center', behavior: 'smooth', block: 'nearest' });
|
|
44
|
-
};
|
|
45
32
|
if (activeTabData) {
|
|
46
|
-
const themedImage = (0, utils_2.getThemedValue)(activeTabData
|
|
33
|
+
const themedImage = (0, utils_2.getThemedValue)(activeTabData.image, theme);
|
|
47
34
|
imageProps = themedImage && (0, utils_1.getMediaImage)(themedImage);
|
|
48
35
|
if (activeTabData.caption && imageProps) {
|
|
49
36
|
Object.assign(imageProps, {
|
|
@@ -53,18 +40,28 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
53
40
|
}
|
|
54
41
|
const showMedia = Boolean((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps);
|
|
55
42
|
const showText = Boolean(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.text);
|
|
56
|
-
const textContent = activeTabData && showText && (react_1.default.createElement(
|
|
43
|
+
const textContent = activeTabData && showText && (react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: showMedia ? 4 : 8 }, className: b('content', { centered: centered }) },
|
|
44
|
+
react_1.default.createElement("div", { className: b('content-wrapper', {
|
|
45
|
+
margin: Boolean(((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps) && !isReverse),
|
|
46
|
+
}) },
|
|
47
|
+
react_1.default.createElement(sub_blocks_1.Content, { title: activeTabData.title, text: activeTabData.text, additionalInfo: activeTabData.additionalInfo, size: contentSize, links: [
|
|
48
|
+
...(activeTabData.link ? [activeTabData.link] : []),
|
|
49
|
+
...(activeTabData.links || []),
|
|
50
|
+
], buttons: activeTabData.buttons, colSizes: { all: 12 } }))));
|
|
57
51
|
const mediaContent = showMedia && (react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 8 }, orders: {
|
|
58
52
|
all: grid_1.GridColumnOrderClasses.Last,
|
|
59
53
|
md: grid_1.GridColumnOrderClasses.First,
|
|
60
54
|
}, className: b('col', { centered: centered }) },
|
|
61
|
-
react_1.default.createElement("div", {
|
|
62
|
-
react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_2.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: setVideoHeight ? mediaVideoHeight : undefined, handleImageLoad: handleImageHeight }))))),
|
|
55
|
+
react_1.default.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_2.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight })))),
|
|
63
56
|
imageProps && (react_1.default.createElement(react_1.Fragment, null,
|
|
64
57
|
react_1.default.createElement(FullscreenImage_1.default, Object.assign({}, imageProps, { imageClassName: b('image') })))),
|
|
65
58
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (react_1.default.createElement("p", { className: b('caption'), id: captionId }, activeTabData.caption))));
|
|
59
|
+
const onSelectTab = (id, e) => {
|
|
60
|
+
setActiveTab(id);
|
|
61
|
+
e.currentTarget.scrollIntoView({ inline: 'center', behavior: 'smooth', block: 'nearest' });
|
|
62
|
+
};
|
|
66
63
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), onScroll: () => setPlay(true), animate: animated },
|
|
67
|
-
react_1.default.createElement(Title_1.default, { title: title, subtitle: description, className: b('title', { centered: centered }) }),
|
|
64
|
+
react_1.default.createElement(Title_1.default, { title: title, subtitle: description, className: b('block-title', { centered: centered }) }),
|
|
68
65
|
react_1.default.createElement(grid_1.Row, null,
|
|
69
66
|
react_1.default.createElement(grid_1.Col, { sizes: tabsColSizes },
|
|
70
67
|
react_1.default.createElement(ButtonTabs_1.default, { items: tabs, onSelectTab: onSelectTab, activeTab: activeTab, className: b('tabs', { centered: centered }) }))),
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { CSSProperties, MouseEventHandler
|
|
1
|
+
import { CSSProperties, MouseEventHandler } from 'react';
|
|
2
2
|
import { ImageDeviceProps, ImageObjectProps, QAProps } from '../../models';
|
|
3
3
|
export interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDeviceProps>, QAProps {
|
|
4
4
|
style?: CSSProperties;
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: MouseEventHandler;
|
|
7
|
-
onLoad?: ReactEventHandler<HTMLDivElement>;
|
|
8
7
|
containerClassName?: string;
|
|
9
8
|
}
|
|
10
9
|
export interface DeviceSpecificFragmentProps extends QAProps {
|
|
@@ -15,7 +15,7 @@ const DeviceSpecificFragment = ({ disableWebp, src, breakpoint, qa, }) => (react
|
|
|
15
15
|
react_1.default.createElement("source", { srcSet: src, media: `(max-width: ${breakpoint}px)`, "data-qa": qa })));
|
|
16
16
|
const Image = (props) => {
|
|
17
17
|
const projectSettings = (0, react_1.useContext)(projectSettingsContext_1.ProjectSettingsContext);
|
|
18
|
-
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick,
|
|
18
|
+
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, qa, } = props;
|
|
19
19
|
const [imgLoadingError, setImgLoadingError] = (0, react_1.useState)(false);
|
|
20
20
|
const src = imageSrc || desktop;
|
|
21
21
|
if (!src) {
|
|
@@ -30,6 +30,6 @@ const Image = (props) => {
|
|
|
30
30
|
mobile && (react_1.default.createElement(DeviceSpecificFragment, { src: mobile, disableWebp: disableWebp, breakpoint: constants_1.BREAKPOINTS.sm, qa: qaAttributes.mobileSource })),
|
|
31
31
|
tablet && (react_1.default.createElement(DeviceSpecificFragment, { src: tablet, disableWebp: disableWebp, breakpoint: constants_1.BREAKPOINTS.md, qa: qaAttributes.tabletSource })),
|
|
32
32
|
src && !disableWebp && (react_1.default.createElement("source", { srcSet: checkWebP(src), type: "image/webp", "data-qa": qaAttributes.desktopSourceCompressed })),
|
|
33
|
-
react_1.default.createElement(ImageBase_1.default, { className: className, alt: alt, src: src, style: style, onClick: onClick, onError: () => setImgLoadingError(true)
|
|
33
|
+
react_1.default.createElement(ImageBase_1.default, { className: className, alt: alt, src: src, style: style, onClick: onClick, onError: () => setImgLoadingError(true) })));
|
|
34
34
|
};
|
|
35
35
|
exports.default = Image;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { CSSProperties, MouseEventHandler
|
|
1
|
+
import { CSSProperties, MouseEventHandler } from 'react';
|
|
2
2
|
import { ImageObjectProps } from '../../models';
|
|
3
3
|
export interface ImageBaseProps extends Partial<ImageObjectProps> {
|
|
4
4
|
style?: CSSProperties;
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: MouseEventHandler;
|
|
7
|
-
onLoad?: ReactEventHandler<HTMLDivElement>;
|
|
8
7
|
onError?: () => void;
|
|
9
8
|
}
|
|
10
9
|
export declare const ImageBase: (props: ImageBaseProps) => JSX.Element;
|
|
@@ -15,7 +15,7 @@ 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, image, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, qa,
|
|
18
|
+
const { parallax, image, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, qa, } = props;
|
|
19
19
|
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'fullscreen-image', 'animate', 'background-image', 'image-view', 'slider-block');
|
|
20
20
|
const [scrollY, setScrollY] = (0, react_1.useState)(0);
|
|
21
21
|
const [{ springScrollY }, springSetScrollY] = (0, web_1.useSpring)(() => ({
|
|
@@ -49,7 +49,7 @@ const Image = (props) => {
|
|
|
49
49
|
};
|
|
50
50
|
const imageOnly = (oneImage) => {
|
|
51
51
|
const imageData = (0, utils_2.getMediaImage)(oneImage);
|
|
52
|
-
return (react_1.default.createElement(Image_1.default, Object.assign({}, imageData, { className: imageClass, style: { height }, qa: qaAttributes.imageView
|
|
52
|
+
return (react_1.default.createElement(Image_1.default, Object.assign({}, imageData, { className: imageClass, style: { height }, qa: qaAttributes.imageView })));
|
|
53
53
|
};
|
|
54
54
|
const imageSlider = (imageArray) => {
|
|
55
55
|
const fullscreenItem = fullscreen === undefined || fullscreen;
|
|
@@ -11,13 +11,13 @@ const Image_1 = tslib_1.__importDefault(require("./Image/Image"));
|
|
|
11
11
|
const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
|
|
12
12
|
const b = (0, utils_1.block)('Media');
|
|
13
13
|
const Media = (props) => {
|
|
14
|
-
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,
|
|
14
|
+
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, } = props;
|
|
15
15
|
const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
|
|
16
16
|
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'video');
|
|
17
17
|
const content = (0, react_1.useMemo)(() => {
|
|
18
18
|
let result = [];
|
|
19
19
|
if (image) {
|
|
20
|
-
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
|
|
20
|
+
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 }));
|
|
21
21
|
}
|
|
22
22
|
if (video) {
|
|
23
23
|
const videoProps = {
|
|
@@ -43,7 +43,7 @@ const Media = (props) => {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
if (youtube) {
|
|
46
|
-
result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay
|
|
46
|
+
result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay }));
|
|
47
47
|
}
|
|
48
48
|
if (dataLens) {
|
|
49
49
|
result = react_1.default.createElement(DataLens_1.default, { dataLens: dataLens });
|
|
@@ -72,7 +72,6 @@ const Media = (props) => {
|
|
|
72
72
|
ratio,
|
|
73
73
|
youtubeClassName,
|
|
74
74
|
autoplay,
|
|
75
|
-
handleImageLoad,
|
|
76
75
|
]);
|
|
77
76
|
return (react_1.default.createElement("div", { className: b(null, className), style: { backgroundColor: color }, "data-qa": qa }, content));
|
|
78
77
|
};
|
|
@@ -16,7 +16,6 @@ export interface VideoBlockProps extends AnalyticsEventsBase {
|
|
|
16
16
|
height?: number;
|
|
17
17
|
fullscreen?: boolean;
|
|
18
18
|
autoplay?: boolean;
|
|
19
|
-
handleImageLoad?: () => void;
|
|
20
19
|
}
|
|
21
20
|
declare const VideoBlock: (props: VideoBlockProps) => JSX.Element | null;
|
|
22
21
|
export default VideoBlock;
|
|
@@ -41,7 +41,7 @@ function getHeight(width) {
|
|
|
41
41
|
}
|
|
42
42
|
exports.getHeight = getHeight;
|
|
43
43
|
const VideoBlock = (props) => {
|
|
44
|
-
const { stream, record, attributes, className, id, previewImg, playButton, height, fullscreen, analyticsEvents, autoplay,
|
|
44
|
+
const { stream, record, attributes, className, id, previewImg, playButton, height, fullscreen, analyticsEvents, autoplay, } = props;
|
|
45
45
|
const handleAnalytics = (0, useAnalytics_1.useAnalytics)(common_1.DefaultEventNames.VideoPreview);
|
|
46
46
|
const src = getVideoSrc(stream, record);
|
|
47
47
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -95,7 +95,7 @@ const VideoBlock = (props) => {
|
|
|
95
95
|
return null;
|
|
96
96
|
}
|
|
97
97
|
return (react_1.default.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && !fullscreen && (react_1.default.createElement("div", { className: b('preview'), onClick: onPreviewClick },
|
|
98
|
-
react_1.default.createElement(Image_1.default, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper')
|
|
98
|
+
react_1.default.createElement(Image_1.default, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper') }),
|
|
99
99
|
playButton || (react_1.default.createElement("button", { title: "Play", className: b('button') },
|
|
100
100
|
react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayVideo, size: 24 })))))));
|
|
101
101
|
};
|
|
@@ -4,7 +4,7 @@ export declare const blockMap: {
|
|
|
4
4
|
"promo-features-block": (props: import("./models").PromoFeaturesProps) => JSX.Element;
|
|
5
5
|
"questions-block": (props: import("./models").QuestionsProps) => JSX.Element;
|
|
6
6
|
"banner-block": (props: import("./models").BannerBlockProps) => JSX.Element;
|
|
7
|
-
"companies-block": ({ title, images, animated }: import("./models").CompaniesBlockProps) => JSX.Element;
|
|
7
|
+
"companies-block": ({ title, description, images, animated }: import("./models").CompaniesBlockProps) => JSX.Element;
|
|
8
8
|
"media-block": (props: import("./models").MediaBlockProps) => JSX.Element;
|
|
9
9
|
"info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
|
|
10
10
|
"table-block": (props: import("./models").TableBlockProps) => JSX.Element;
|
|
@@ -154,6 +154,7 @@ export interface BannerBlockProps extends BannerCardProps, Animatable {
|
|
|
154
154
|
}
|
|
155
155
|
export interface CompaniesBlockProps extends Animatable {
|
|
156
156
|
title: string;
|
|
157
|
+
description?: string;
|
|
157
158
|
images: ThemeSupporting<ImageDeviceProps>;
|
|
158
159
|
}
|
|
159
160
|
export interface MediaBaseBlockProps extends Animatable, MediaContentProps {
|
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
.pc-companies-block__title {
|
|
2
|
-
margin: 0;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
/* use this for style redefinitions to awoid problems with
|
|
6
2
|
unpredictable css rules order in build */
|
|
7
3
|
.pc-companies-block {
|
|
8
4
|
text-align: center;
|
|
9
5
|
}
|
|
10
|
-
.pc-companies-block__title {
|
|
11
|
-
font-size: var(--g-text-display-2-font-size);
|
|
12
|
-
line-height: var(--g-text-display-2-line-height);
|
|
13
|
-
color: var(--pc-text-header-color);
|
|
14
|
-
font-weight: var(--g-text-accent-font-weight);
|
|
15
|
-
}
|
|
16
|
-
@media (max-width: 576px) {
|
|
17
|
-
.pc-companies-block__title {
|
|
18
|
-
font-size: var(--g-text-display-1-font-size);
|
|
19
|
-
line-height: var(--g-text-display-1-line-height);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
6
|
.pc-companies-block__images {
|
|
23
7
|
margin-top: 32px;
|
|
24
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CompaniesBlockProps } from '../../models';
|
|
2
2
|
import './Companies.css';
|
|
3
|
-
export declare const CompaniesBlock: ({ title, images, animated }: CompaniesBlockProps) => JSX.Element;
|
|
3
|
+
export declare const CompaniesBlock: ({ title, description, images, animated }: CompaniesBlockProps) => JSX.Element;
|
|
4
4
|
export default CompaniesBlock;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Image } from '../../components';
|
|
2
|
+
import { Image, Title } from '../../components';
|
|
3
3
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
4
4
|
import { useTheme } from '../../context/theme';
|
|
5
5
|
import { block, getThemedValue } from '../../utils';
|
|
6
6
|
import './Companies.css';
|
|
7
7
|
const b = block('companies-block');
|
|
8
|
-
export const CompaniesBlock = ({ title, images, animated }) => {
|
|
8
|
+
export const CompaniesBlock = ({ title, description, images, animated }) => {
|
|
9
9
|
const theme = useTheme();
|
|
10
10
|
const themedImages = getThemedValue(images, theme) || {};
|
|
11
11
|
return (React.createElement(AnimateBlock, { className: b(), offset: 150, animate: animated },
|
|
12
12
|
React.createElement("div", { className: b('content') },
|
|
13
|
-
React.createElement(
|
|
13
|
+
React.createElement(Title, { title: title, subtitle: description, colSizes: { all: 12, sm: 12 } }),
|
|
14
14
|
React.createElement("div", { className: b('images') },
|
|
15
15
|
React.createElement(Image, Object.assign({}, themedImages, { className: b('image') }))))));
|
|
16
16
|
};
|
|
@@ -118,14 +118,9 @@ unpredictable css rules order in build */
|
|
|
118
118
|
padding: 0 8px;
|
|
119
119
|
}
|
|
120
120
|
.pc-form-block_with-background .pc-form-block__row {
|
|
121
|
-
padding-top:
|
|
122
|
-
}
|
|
123
|
-
.pc-form-block_with-background .pc-form-block__row_padding-bottom_m {
|
|
121
|
+
padding-top: 32px;
|
|
124
122
|
padding-bottom: 32px;
|
|
125
123
|
}
|
|
126
|
-
.pc-form-block_with-background .pc-form-block__row_padding-bottom_l {
|
|
127
|
-
padding-bottom: 48px;
|
|
128
|
-
}
|
|
129
124
|
.pc-form-block_with-background .pc-form-block__row_direction_form-content .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_content-form .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_center .pc-form-block__content-wrapper {
|
|
130
125
|
padding-right: 16px;
|
|
131
126
|
padding-left: 16px;
|
|
@@ -14,8 +14,7 @@ const FormBlock = (props) => {
|
|
|
14
14
|
const { formData, title, textContent, direction = FormBlockDirection.Center, background } = props;
|
|
15
15
|
const [contentLoaded, setContentLoaded] = useState(false);
|
|
16
16
|
const isMobile = useContext(MobileContext);
|
|
17
|
-
const
|
|
18
|
-
const paddingBottom = background && ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) && !hasImage ? 'l' : 'm'; // bigger padding for case with background color and no image
|
|
17
|
+
const withBackground = Boolean(background && (background.src || background.desktop || ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor)));
|
|
19
18
|
const onContentLoad = useCallback(() => {
|
|
20
19
|
setContentLoaded(true);
|
|
21
20
|
}, []);
|
|
@@ -30,7 +29,7 @@ const FormBlock = (props) => {
|
|
|
30
29
|
formType = FormBlockDataTypes.HUBSPOT;
|
|
31
30
|
}
|
|
32
31
|
return (React.createElement("div", { className: b({
|
|
33
|
-
'with-background':
|
|
32
|
+
'with-background': withBackground,
|
|
34
33
|
'form-type': formType,
|
|
35
34
|
}) },
|
|
36
35
|
background && (React.createElement(BackgroundImage, Object.assign({}, background, { className: b('media'), imageClassName: b('image') }))),
|
|
@@ -39,7 +38,6 @@ const FormBlock = (props) => {
|
|
|
39
38
|
? GridAlignItems.Center
|
|
40
39
|
: GridAlignItems.Start, className: b('row', {
|
|
41
40
|
direction,
|
|
42
|
-
'padding-bottom': paddingBottom,
|
|
43
41
|
}) },
|
|
44
42
|
React.createElement(Col, { sizes: colSizes, className: b('content-col') }, textContent && (React.createElement("div", { className: b('content-wrapper') },
|
|
45
43
|
React.createElement(Content, Object.assign({ theme: "default" }, textContent, { centered: direction === FormBlockDirection.Center, colSizes: { all: 12 }, className: b('content') }))))),
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
.pc-tabs-block__content-title.pc-tabs-block__content-title > * {
|
|
2
|
+
margin: 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
/* use this for style redefinitions to awoid problems with
|
|
2
6
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-tabs-
|
|
7
|
+
.pc-tabs-block__block-title {
|
|
4
8
|
margin-bottom: 24px;
|
|
5
9
|
}
|
|
6
|
-
.pc-tabs-
|
|
10
|
+
.pc-tabs-block__block-title_centered {
|
|
7
11
|
text-align: center;
|
|
8
12
|
}
|
|
9
|
-
.pc-tabs-
|
|
13
|
+
.pc-tabs-block__block-title_centered > * {
|
|
10
14
|
margin: 0 auto;
|
|
11
15
|
}
|
|
12
16
|
.pc-tabs-block__tabs {
|
|
@@ -40,6 +44,9 @@ unpredictable css rules order in build */
|
|
|
40
44
|
.pc-tabs-block__row_reverse {
|
|
41
45
|
flex-direction: row-reverse;
|
|
42
46
|
}
|
|
47
|
+
.pc-tabs-block__row_reverse .pc-tabs-block__content-wrapper {
|
|
48
|
+
margin: 24px 32px 0 0;
|
|
49
|
+
}
|
|
43
50
|
.pc-tabs-block__image {
|
|
44
51
|
width: 100%;
|
|
45
52
|
height: auto;
|
|
@@ -57,10 +64,33 @@ unpredictable css rules order in build */
|
|
|
57
64
|
margin: 12px 0 0;
|
|
58
65
|
color: var(--g-color-text-secondary);
|
|
59
66
|
}
|
|
67
|
+
.pc-tabs-block__content {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
}
|
|
71
|
+
.pc-tabs-block__content_centered {
|
|
72
|
+
margin: 0 auto;
|
|
73
|
+
}
|
|
60
74
|
.pc-tabs-block__col_centered {
|
|
61
75
|
margin: 0 auto;
|
|
62
76
|
}
|
|
77
|
+
.pc-tabs-block__content-wrapper_margin {
|
|
78
|
+
margin: 24px 0 0 32px;
|
|
79
|
+
}
|
|
80
|
+
.pc-tabs-block__content-title {
|
|
81
|
+
margin: 0 auto 12px;
|
|
82
|
+
}
|
|
83
|
+
.pc-tabs-block__content-title.pc-tabs-block__content-title > * {
|
|
84
|
+
font-size: var(--g-text-header-1-font-size);
|
|
85
|
+
line-height: var(--g-text-header-1-line-height);
|
|
86
|
+
color: var(--pc-text-header-color);
|
|
87
|
+
font-weight: var(--g-text-accent-font-weight);
|
|
88
|
+
}
|
|
89
|
+
|
|
63
90
|
@media (max-width: 769px) {
|
|
91
|
+
.pc-tabs-block__content-wrapper_margin {
|
|
92
|
+
margin: 0 0 32px 0;
|
|
93
|
+
}
|
|
64
94
|
.pc-tabs-block__row_reverse {
|
|
65
95
|
flex-direction: column-reverse;
|
|
66
96
|
}
|