@gravity-ui/page-constructor 4.27.0-alpha.0 → 4.27.2-alpha.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/ContentLayout/ContentLayout.css +3 -0
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +1 -1
- package/build/cjs/blocks/Header/Header.css +15 -0
- package/build/cjs/blocks/Header/Header.js +6 -2
- package/build/cjs/blocks/Header/schema.d.ts +8 -0
- package/build/cjs/blocks/Header/schema.js +4 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +4 -0
- package/build/cjs/blocks/Icons/Icons.css +10 -0
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +15 -0
- package/build/cjs/blocks/Slider/Arrow/Arrow.css +7 -0
- package/build/cjs/blocks/Slider/Slider.js +12 -6
- package/build/cjs/components/Button/Button.css +6 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.css +3 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.js +1 -1
- package/build/cjs/components/CardBase/CardBase.d.ts +1 -2
- package/build/cjs/components/CardBase/CardBase.js +7 -3
- package/build/cjs/components/Control/Control.css +8 -0
- package/build/cjs/components/FileLink/FileLink.css +8 -0
- package/build/cjs/components/FullscreenImage/FullscreenImage.css +20 -1
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +3 -6
- package/build/cjs/components/FullscreenMedia/FullscreenMedia.css +4 -0
- package/build/cjs/components/FullscreenMedia/FullscreenMedia.js +2 -2
- package/build/cjs/components/Link/Link.css +8 -0
- package/build/cjs/components/Media/Image/Image.js +1 -1
- package/build/cjs/components/Media/Video/Video.js +1 -1
- package/build/cjs/components/OverflowScroller/OverflowScroller.css +19 -0
- package/build/cjs/components/OverflowScroller/OverflowScroller.js +2 -1
- package/build/cjs/components/OverflowScroller/i18n/en.json +4 -0
- package/build/cjs/components/OverflowScroller/i18n/index.d.ts +2 -0
- package/build/cjs/components/OverflowScroller/i18n/index.js +8 -0
- package/build/cjs/components/OverflowScroller/i18n/ru.json +4 -0
- package/build/cjs/components/ReactPlayer/CustomBarControls.css +6 -4
- package/build/cjs/components/ReactPlayer/ReactPlayer.css +7 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.d.ts +2 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +16 -8
- package/build/cjs/components/Table/Table.css +1 -1
- package/build/cjs/components/Title/TitleItem.css +8 -0
- package/build/cjs/components/VideoBlock/VideoBlock.css +7 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.css +12 -1
- package/build/cjs/models/components.d.ts +1 -2
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -0
- package/build/cjs/sub-blocks/BannerCard/BannerCard.css +3 -0
- package/build/cjs/sub-blocks/Content/Content.css +3 -0
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +42 -4
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +20 -2
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.js +1 -1
- package/build/esm/blocks/ContentLayout/ContentLayout.css +3 -0
- package/build/esm/blocks/ContentLayout/ContentLayout.js +1 -1
- package/build/esm/blocks/Header/Header.css +15 -0
- package/build/esm/blocks/Header/Header.js +6 -2
- package/build/esm/blocks/Header/schema.d.ts +8 -0
- package/build/esm/blocks/Header/schema.js +4 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +4 -0
- package/build/esm/blocks/Icons/Icons.css +10 -0
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +15 -0
- package/build/esm/blocks/Slider/Arrow/Arrow.css +7 -0
- package/build/esm/blocks/Slider/Slider.js +12 -6
- package/build/esm/components/Button/Button.css +6 -0
- package/build/esm/components/ButtonTabs/ButtonTabs.css +3 -0
- package/build/esm/components/ButtonTabs/ButtonTabs.js +1 -1
- package/build/esm/components/CardBase/CardBase.d.ts +1 -2
- package/build/esm/components/CardBase/CardBase.js +6 -2
- package/build/esm/components/Control/Control.css +8 -0
- package/build/esm/components/FileLink/FileLink.css +8 -0
- package/build/esm/components/FullscreenImage/FullscreenImage.css +20 -1
- package/build/esm/components/FullscreenImage/FullscreenImage.js +3 -6
- package/build/esm/components/FullscreenMedia/FullscreenMedia.css +4 -0
- package/build/esm/components/FullscreenMedia/FullscreenMedia.js +3 -3
- package/build/esm/components/Link/Link.css +8 -0
- package/build/esm/components/Media/Image/Image.js +2 -2
- package/build/esm/components/Media/Video/Video.js +1 -1
- package/build/esm/components/OverflowScroller/OverflowScroller.css +19 -0
- package/build/esm/components/OverflowScroller/OverflowScroller.js +2 -1
- package/build/esm/components/OverflowScroller/i18n/en.json +4 -0
- package/build/esm/components/OverflowScroller/i18n/index.d.ts +2 -0
- package/build/esm/components/OverflowScroller/i18n/index.js +5 -0
- package/build/esm/components/OverflowScroller/i18n/ru.json +4 -0
- package/build/esm/components/ReactPlayer/CustomBarControls.css +6 -4
- package/build/esm/components/ReactPlayer/ReactPlayer.css +7 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.d.ts +2 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js +16 -8
- package/build/esm/components/Table/Table.css +1 -1
- package/build/esm/components/Title/TitleItem.css +8 -0
- package/build/esm/components/VideoBlock/VideoBlock.css +7 -0
- package/build/esm/containers/PageConstructor/PageConstructor.css +12 -1
- package/build/esm/models/components.d.ts +1 -2
- package/build/esm/models/constructor-items/blocks.d.ts +1 -0
- package/build/esm/sub-blocks/BannerCard/BannerCard.css +3 -0
- package/build/esm/sub-blocks/Content/Content.css +3 -0
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +42 -4
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +1 -1
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +20 -2
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.js +1 -1
- package/package.json +3 -3
- package/server/models/components.d.ts +1 -2
- package/server/models/constructor-items/blocks.d.ts +1 -0
- package/styles/mixins.scss +20 -0
- package/styles/root.scss +6 -0
- package/styles/styles.css +8 -1
- package/styles/yfm.scss +3 -1
- package/widget/index.js +1 -1
|
@@ -49,6 +49,9 @@ unpredictable css rules order in build */
|
|
|
49
49
|
.pc-content-layout-block_background {
|
|
50
50
|
padding: 64px;
|
|
51
51
|
}
|
|
52
|
+
.pc-content-layout-block_theme_dark {
|
|
53
|
+
--g-color-line-focus: var(--pc-color-line-focus-dark);
|
|
54
|
+
}
|
|
52
55
|
@media (max-width: 577px) {
|
|
53
56
|
.pc-content-layout-block_background {
|
|
54
57
|
padding: 32px;
|
|
@@ -33,7 +33,7 @@ const ContentLayoutBlock = (props) => {
|
|
|
33
33
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
34
34
|
const { textContent, fileContent, size = 'l', background, centered, theme = 'default', textWidth = 'm', } = props;
|
|
35
35
|
const colSizes = (0, react_1.useMemo)(() => getTextWidth(textWidth), [textWidth]);
|
|
36
|
-
return (react_1.default.createElement("div", { className: b({ size, background: Boolean(background) }) },
|
|
36
|
+
return (react_1.default.createElement("div", { className: b({ size, theme, background: Boolean(background) }) },
|
|
37
37
|
react_1.default.createElement(sub_blocks_1.Content, Object.assign({ className: b('content') }, textContent, { size: size, centered: centered, colSizes: colSizes, theme: theme })),
|
|
38
38
|
fileContent && (react_1.default.createElement(grid_1.Col, { className: b('files', { size, centered }), reset: true, sizes: colSizes }, fileContent.map((file) => (react_1.default.createElement(components_1.FileLink, Object.assign({ className: b('file') }, file, { key: file.href, type: "horizontal", textSize: getFileTextSize(size), theme: theme })))))),
|
|
39
39
|
background && (react_1.default.createElement("div", { className: b('background') },
|
|
@@ -20,6 +20,9 @@ unpredictable css rules order in build */
|
|
|
20
20
|
position: relative;
|
|
21
21
|
height: 100%;
|
|
22
22
|
}
|
|
23
|
+
.pc-header-block__content_theme_dark {
|
|
24
|
+
--g-color-line-focus: var(--pc-color-line-focus-dark);
|
|
25
|
+
}
|
|
23
26
|
.pc-header-block__content_theme_dark .pc-header-block__title,
|
|
24
27
|
.pc-header-block__content_theme_dark .pc-header-block__overtitle {
|
|
25
28
|
color: var(--g-color-text-light-primary);
|
|
@@ -180,6 +183,18 @@ unpredictable css rules order in build */
|
|
|
180
183
|
--pc-text-header-color: var(--g-color-text-link-hover);
|
|
181
184
|
color: var(--g-color-text-link-hover);
|
|
182
185
|
}
|
|
186
|
+
.pc-header-block_media-view_fit .pc-header-block__video > video,
|
|
187
|
+
.pc-header-block_media-view_fit .pc-header-block__image {
|
|
188
|
+
object-fit: contain;
|
|
189
|
+
height: auto;
|
|
190
|
+
width: auto;
|
|
191
|
+
max-height: 100%;
|
|
192
|
+
max-width: 100%;
|
|
193
|
+
position: relative;
|
|
194
|
+
top: 50%;
|
|
195
|
+
left: 50%;
|
|
196
|
+
transform: translate(-50%, -50%);
|
|
197
|
+
}
|
|
183
198
|
@media (max-width: 1440px) {
|
|
184
199
|
.pc-header-block__background, .pc-header-block__background.pc-header-block__background_media {
|
|
185
200
|
left: 0;
|
|
@@ -21,7 +21,7 @@ const Background = ({ background, isMobile }) => {
|
|
|
21
21
|
};
|
|
22
22
|
const FullWidthBackground = ({ background }) => (react_1.default.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
|
|
23
23
|
const HeaderBlock = (props) => {
|
|
24
|
-
const { title, overtitle, description, buttons, image, video, width = 'm', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, children, } = props;
|
|
24
|
+
const { title, overtitle, description, buttons, image, video, width = 'm', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, children, mediaView = 'full', } = props;
|
|
25
25
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
26
26
|
const theme = (0, theme_1.useTheme)();
|
|
27
27
|
const hasRightSideImage = Boolean(image || video);
|
|
@@ -35,7 +35,11 @@ const HeaderBlock = (props) => {
|
|
|
35
35
|
const imageThemed = image && (0, utils_2.getThemedValue)(image, theme);
|
|
36
36
|
const videoThemed = video && (0, utils_2.getThemedValue)(video, theme);
|
|
37
37
|
const fullWidth = (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidth) || (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidthMedia);
|
|
38
|
-
return (react_1.default.createElement("header", { className: b({
|
|
38
|
+
return (react_1.default.createElement("header", { className: b({
|
|
39
|
+
['has-media']: hasRightSideImage,
|
|
40
|
+
['full-width']: fullWidth,
|
|
41
|
+
['media-view']: mediaView,
|
|
42
|
+
}, className) },
|
|
39
43
|
backgroundThemed && fullWidth && react_1.default.createElement(FullWidthBackground, { background: backgroundThemed }),
|
|
40
44
|
backgroundThemed && react_1.default.createElement(Background, { background: backgroundThemed, isMobile: isMobile }),
|
|
41
45
|
react_1.default.createElement(grid_1.Grid, { containerClass: b('container-fluid') },
|
|
@@ -407,6 +407,10 @@ export declare const HeaderProperties: {
|
|
|
407
407
|
optionName: string;
|
|
408
408
|
})[];
|
|
409
409
|
};
|
|
410
|
+
mediaView: {
|
|
411
|
+
type: string;
|
|
412
|
+
enum: string[];
|
|
413
|
+
};
|
|
410
414
|
backLink: {
|
|
411
415
|
type: string;
|
|
412
416
|
required: string[];
|
|
@@ -887,6 +891,10 @@ export declare const HeaderBlock: {
|
|
|
887
891
|
optionName: string;
|
|
888
892
|
})[];
|
|
889
893
|
};
|
|
894
|
+
mediaView: {
|
|
895
|
+
type: string;
|
|
896
|
+
enum: string[];
|
|
897
|
+
};
|
|
890
898
|
backLink: {
|
|
891
899
|
type: string;
|
|
892
900
|
required: string[];
|
|
@@ -35,6 +35,10 @@ exports.HeaderProperties = {
|
|
|
35
35
|
},
|
|
36
36
|
image: (0, common_1.withTheme)(schema_1.ImageProps),
|
|
37
37
|
video: (0, common_1.withTheme)(common_1.VideoProps),
|
|
38
|
+
mediaView: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
enum: ['fit', 'full'],
|
|
41
|
+
},
|
|
38
42
|
backLink: {
|
|
39
43
|
type: 'object',
|
|
40
44
|
required: ['url', 'title'],
|
|
@@ -30,6 +30,16 @@ unpredictable css rules order in build */
|
|
|
30
30
|
text-decoration: none;
|
|
31
31
|
margin: 0 8px 24px;
|
|
32
32
|
}
|
|
33
|
+
.pc-icons-block a.pc-icons-block__item {
|
|
34
|
+
border-radius: var(--g-focus-border-radius);
|
|
35
|
+
}
|
|
36
|
+
.pc-icons-block a.pc-icons-block__item:focus {
|
|
37
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
38
|
+
outline-offset: 0;
|
|
39
|
+
}
|
|
40
|
+
.pc-icons-block a.pc-icons-block__item:focus:not(:focus-visible) {
|
|
41
|
+
outline: 0;
|
|
42
|
+
}
|
|
33
43
|
.pc-icons-block__image {
|
|
34
44
|
max-width: 100%;
|
|
35
45
|
margin: 0 auto;
|
|
@@ -19,6 +19,14 @@ unpredictable css rules order in build */
|
|
|
19
19
|
position: relative;
|
|
20
20
|
padding-right: 24px;
|
|
21
21
|
cursor: pointer;
|
|
22
|
+
border-radius: var(--g-focus-border-radius);
|
|
23
|
+
}
|
|
24
|
+
.pc-QuestionsBlockItem__title:focus {
|
|
25
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
26
|
+
outline-offset: 0;
|
|
27
|
+
}
|
|
28
|
+
.pc-QuestionsBlockItem__title:focus:not(:focus-visible) {
|
|
29
|
+
outline: 0;
|
|
22
30
|
}
|
|
23
31
|
.pc-QuestionsBlockItem__title a {
|
|
24
32
|
outline: none;
|
|
@@ -37,12 +45,19 @@ unpredictable css rules order in build */
|
|
|
37
45
|
position: absolute;
|
|
38
46
|
right: 0;
|
|
39
47
|
top: 0;
|
|
48
|
+
bottom: 0;
|
|
49
|
+
margin: auto;
|
|
40
50
|
color: var(--g-color-text-primary);
|
|
41
51
|
}
|
|
42
52
|
.pc-QuestionsBlockItem__link {
|
|
43
53
|
font-size: var(--g-text-body-2-font-size);
|
|
44
54
|
line-height: var(--g-text-body-2-line-height);
|
|
45
55
|
}
|
|
56
|
+
.pc-QuestionsBlockItem__link.pc-QuestionsBlockItem__link a {
|
|
57
|
+
outline-offset: -2px;
|
|
58
|
+
border-radius: calc(var(--g-focus-border-radius) + 2px);
|
|
59
|
+
}
|
|
60
|
+
|
|
46
61
|
.pc-QuestionsBlockItem__text {
|
|
47
62
|
font-size: var(--g-text-body-2-font-size);
|
|
48
63
|
line-height: var(--g-text-body-2-line-height);
|
|
@@ -49,6 +49,13 @@ unpredictable css rules order in build */
|
|
|
49
49
|
box-shadow: 0 4px 24px var(--pc-color-sfx-shadow), 0 2px 8px var(--pc-color-sfx-shadow);
|
|
50
50
|
transition: box-shadow 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
|
|
51
51
|
}
|
|
52
|
+
.pc-slider-block-arrow__button:focus {
|
|
53
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
54
|
+
outline-offset: 0;
|
|
55
|
+
}
|
|
56
|
+
.pc-slider-block-arrow__button:focus:not(:focus-visible) {
|
|
57
|
+
outline: 0;
|
|
58
|
+
}
|
|
52
59
|
.pc-slider-block-arrow:hover .pc-slider-block-arrow__button {
|
|
53
60
|
color: var(--g-color-text-primary);
|
|
54
61
|
box-shadow: 0 2px 12px var(--pc-color-sfx-shadow), 0 4px 24px var(--pc-color-sfx-shadow);
|
|
@@ -136,12 +136,12 @@ const SliderBlock = (props) => {
|
|
|
136
136
|
const renderAccessibleBar = (index) => {
|
|
137
137
|
return (
|
|
138
138
|
// To have this key differ from keys used in renderDot function, added `-accessible-bar` part
|
|
139
|
-
react_1.default.createElement(react_1.Fragment, { key: `${index}-accessible-bar` }, slidesCountByBreakpoint >
|
|
139
|
+
react_1.default.createElement(react_1.Fragment, { key: `${index}-accessible-bar` }, slidesCountByBreakpoint > 0 && (react_1.default.createElement("li", { className: b('accessible-bar'), "aria-current": true, "aria-label": `Slide ${currentIndex + 1} of ${barSlidesCount}`, style: {
|
|
140
140
|
left: barPosition,
|
|
141
141
|
width: barWidth,
|
|
142
142
|
} }))));
|
|
143
143
|
};
|
|
144
|
-
const
|
|
144
|
+
const getCurrentSlideNumber = (index) => {
|
|
145
145
|
const currentIndexDiff = index - currentIndex;
|
|
146
146
|
let currentSlideNumber;
|
|
147
147
|
if (0 <= currentIndexDiff && currentIndexDiff < slidesToShowCount) {
|
|
@@ -153,10 +153,16 @@ const SliderBlock = (props) => {
|
|
|
153
153
|
else {
|
|
154
154
|
currentSlideNumber = index + 1;
|
|
155
155
|
}
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
return currentSlideNumber;
|
|
157
|
+
};
|
|
158
|
+
const isVisibleSlide = (index) => {
|
|
159
|
+
const currentIndexDiff = index - currentIndex;
|
|
160
|
+
return (slidesCountByBreakpoint > 0 &&
|
|
161
|
+
0 <= currentIndexDiff &&
|
|
162
|
+
currentIndexDiff < slidesToShowCount);
|
|
163
|
+
};
|
|
164
|
+
const renderDot = (index) => {
|
|
165
|
+
return (react_1.default.createElement("li", { key: index, className: b('dot', { active: index === currentIndex }), onClick: () => handleDotClick(index), "aria-hidden": isVisibleSlide(index) ? true : undefined, "aria-label": `Slide ${getCurrentSlideNumber(index)} of ${barSlidesCount}` }));
|
|
160
166
|
};
|
|
161
167
|
const renderNavigation = () => {
|
|
162
168
|
if (childrenCount <= slidesCountByBreakpoint || !dots || childrenCount === 1) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
+
.pc-button-block {
|
|
4
|
+
--yc-button-outline-color: var(--g-color-line-focus);
|
|
5
|
+
}
|
|
3
6
|
.pc-button-block__content {
|
|
4
7
|
display: flex;
|
|
5
8
|
align-items: center;
|
|
@@ -40,6 +43,9 @@ unpredictable css rules order in build */
|
|
|
40
43
|
color: var(--pc-monochrome-button-color);
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
.pc-button-block_theme_normal-contrast:focus::before, .pc-button-block_theme_raised:focus::before {
|
|
47
|
+
outline-offset: 1px;
|
|
48
|
+
}
|
|
43
49
|
.pc-button-block_size_s {
|
|
44
50
|
--btn-image-margin: 10px;
|
|
45
51
|
}
|
|
@@ -20,7 +20,7 @@ const ButtonTabs = ({ className, items, activeTab, onSelectTab, tabSize = 'l', q
|
|
|
20
20
|
return (react_1.default.createElement("div", { className: b(null, className), "data-qa": qa }, items.map(({ id, title }) => {
|
|
21
21
|
const isActive = id === activeTabId;
|
|
22
22
|
return (react_1.default.createElement(index_1.Button, { text: title, className: b('item', { active: isActive }), key: title, size: tabSize, onClick: handleClick(id), extraProps: {
|
|
23
|
-
'aria-current': isActive,
|
|
23
|
+
'aria-current': isActive || undefined,
|
|
24
24
|
} }));
|
|
25
25
|
})));
|
|
26
26
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributeAnchorTarget, ReactElement } from 'react';
|
|
2
|
-
import { ButtonPixel, CardBaseProps as CardBaseParams, ImageProps, MetrikaGoal, WithChildren } from '../../models';
|
|
3
|
-
import { AnalyticsEventsBase } from '../../models/common';
|
|
2
|
+
import { AnalyticsEventsBase, ButtonPixel, CardBaseProps as CardBaseParams, ImageProps, MetrikaGoal, WithChildren } from '../../models';
|
|
4
3
|
export interface CardBaseProps extends AnalyticsEventsBase, CardBaseParams {
|
|
5
4
|
className?: string;
|
|
6
5
|
bodyClassName?: string;
|
|
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Layout = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
7
|
const hooks_1 = require("../../hooks");
|
|
7
8
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
8
|
-
const
|
|
9
|
+
const models_1 = require("../../models");
|
|
9
10
|
const utils_1 = require("../../utils");
|
|
10
11
|
const BackgroundImage_1 = tslib_1.__importDefault(require("../BackgroundImage/BackgroundImage"));
|
|
11
12
|
const RouterLink_1 = tslib_1.__importDefault(require("../RouterLink/RouterLink"));
|
|
@@ -16,7 +17,7 @@ const Footer = () => null;
|
|
|
16
17
|
const Layout = (props) => {
|
|
17
18
|
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', urlTitle, qa, } = props;
|
|
18
19
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
19
|
-
const handleAnalytics = (0, hooks_1.useAnalytics)(
|
|
20
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.CardBase, url);
|
|
20
21
|
let header, content, footer, image, headerClass, footerClass;
|
|
21
22
|
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'header', 'footer', 'body', 'content');
|
|
22
23
|
function handleChild(child) {
|
|
@@ -53,7 +54,10 @@ const Layout = (props) => {
|
|
|
53
54
|
handleAnalytics(analyticsEvents);
|
|
54
55
|
};
|
|
55
56
|
return url ? (react_1.default.createElement(RouterLink_1.default, { href: url },
|
|
56
|
-
react_1.default.createElement(
|
|
57
|
+
react_1.default.createElement(uikit_1.Link, { href: url, target: target, rel: target === '_blank' ? 'noopener noreferrer' : undefined, className: fullClassName, onClick: onClick, title: urlTitle, extraProps: {
|
|
58
|
+
draggable: false,
|
|
59
|
+
onDragStart: (e) => e.preventDefault(),
|
|
60
|
+
}, qa: qa }, cardContent))) : (react_1.default.createElement("div", { className: fullClassName, "data-qa": qa }, cardContent));
|
|
57
61
|
};
|
|
58
62
|
exports.Layout = Layout;
|
|
59
63
|
exports.Layout.Header = Header;
|
|
@@ -4,6 +4,7 @@ unpredictable css rules order in build */
|
|
|
4
4
|
display: flex;
|
|
5
5
|
justify-content: center;
|
|
6
6
|
align-items: center;
|
|
7
|
+
border-radius: var(--g-focus-border-radius);
|
|
7
8
|
transition: color 0.2s;
|
|
8
9
|
display: inline-block;
|
|
9
10
|
margin: 0;
|
|
@@ -25,6 +26,13 @@ unpredictable css rules order in build */
|
|
|
25
26
|
.utilityfocus .pc-control:focus {
|
|
26
27
|
outline: 2px solid #ffdb4d;
|
|
27
28
|
}
|
|
29
|
+
.pc-control:focus {
|
|
30
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
31
|
+
outline-offset: 0;
|
|
32
|
+
}
|
|
33
|
+
.pc-control:focus:not(:focus-visible) {
|
|
34
|
+
outline: 0;
|
|
35
|
+
}
|
|
28
36
|
.pc-control_size_xs {
|
|
29
37
|
width: 24px;
|
|
30
38
|
height: 24px;
|
|
@@ -19,6 +19,14 @@ unpredictable css rules order in build */
|
|
|
19
19
|
}
|
|
20
20
|
.pc-file-link__link > a {
|
|
21
21
|
color: var(--g-color-text-primary);
|
|
22
|
+
border-radius: var(--g-focus-border-radius);
|
|
23
|
+
}
|
|
24
|
+
.pc-file-link__link > a:focus {
|
|
25
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
26
|
+
outline-offset: 0;
|
|
27
|
+
}
|
|
28
|
+
.pc-file-link__link > a:focus:not(:focus-visible) {
|
|
29
|
+
outline: 0;
|
|
22
30
|
}
|
|
23
31
|
.pc-file-link__link > a:hover {
|
|
24
32
|
color: var(--g-color-text-secondary);
|
|
@@ -6,6 +6,9 @@ unpredictable css rules order in build */
|
|
|
6
6
|
.pc-fullscreen-image__image-wrapper {
|
|
7
7
|
position: relative;
|
|
8
8
|
}
|
|
9
|
+
.pc-fullscreen-image__image-wrapper:hover .pc-fullscreen-image__icon-wrapper {
|
|
10
|
+
opacity: 1;
|
|
11
|
+
}
|
|
9
12
|
.pc-fullscreen-image__modal-content {
|
|
10
13
|
position: relative;
|
|
11
14
|
}
|
|
@@ -19,6 +22,15 @@ unpredictable css rules order in build */
|
|
|
19
22
|
border-radius: var(--pc-border-radius);
|
|
20
23
|
}
|
|
21
24
|
.pc-fullscreen-image__icon-wrapper {
|
|
25
|
+
display: inline-block;
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0;
|
|
28
|
+
font: inherit;
|
|
29
|
+
border: none;
|
|
30
|
+
outline: none;
|
|
31
|
+
color: inherit;
|
|
32
|
+
background: none;
|
|
33
|
+
cursor: pointer;
|
|
22
34
|
display: flex;
|
|
23
35
|
align-items: center;
|
|
24
36
|
justify-content: center;
|
|
@@ -33,7 +45,14 @@ unpredictable css rules order in build */
|
|
|
33
45
|
opacity: 0;
|
|
34
46
|
transition: 0.3s;
|
|
35
47
|
}
|
|
36
|
-
.pc-fullscreen-image__icon-
|
|
48
|
+
.pc-fullscreen-image__icon-wrapper:focus {
|
|
49
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
50
|
+
outline-offset: 0;
|
|
51
|
+
}
|
|
52
|
+
.pc-fullscreen-image__icon-wrapper:focus:not(:focus-visible) {
|
|
53
|
+
outline: 0;
|
|
54
|
+
}
|
|
55
|
+
.pc-fullscreen-image__icon-wrapper:focus {
|
|
37
56
|
opacity: 1;
|
|
38
57
|
}
|
|
39
58
|
.pc-fullscreen-image__icon {
|
|
@@ -13,19 +13,16 @@ const CLOSE_ICON_SIZE = 30;
|
|
|
13
13
|
const FullscreenImage = (props) => {
|
|
14
14
|
const { imageClassName, modalImageClass, imageStyle, alt = (0, i18n_1.default)('img-alt') } = props;
|
|
15
15
|
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
16
|
-
const [isMouseEnter, setIsMouseEnter] = (0, react_1.useState)(false);
|
|
17
16
|
const openModal = () => setIsOpened(true);
|
|
18
17
|
const closeModal = () => setIsOpened(false);
|
|
19
|
-
const showFullscreenIcon = () => setIsMouseEnter(true);
|
|
20
|
-
const hideFullscreenIcon = () => setIsMouseEnter(false);
|
|
21
18
|
return (react_1.default.createElement("div", { className: b() },
|
|
22
|
-
react_1.default.createElement("div", { className: b('image-wrapper')
|
|
19
|
+
react_1.default.createElement("div", { className: b('image-wrapper') },
|
|
23
20
|
react_1.default.createElement(Image_1.default, Object.assign({}, props, { alt: alt, className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
|
|
24
|
-
react_1.default.createElement("
|
|
21
|
+
react_1.default.createElement("button", { className: b('icon-wrapper'), onClick: openModal },
|
|
25
22
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.Fullscreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') }))),
|
|
26
23
|
isOpened && (react_1.default.createElement(uikit_1.Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
|
|
27
24
|
react_1.default.createElement("div", { className: b('modal-content') },
|
|
28
|
-
react_1.default.createElement("
|
|
25
|
+
react_1.default.createElement("button", { className: b('icon-wrapper', { visible: true }), onClick: closeModal, "aria-label": (0, i18n_1.default)('close') },
|
|
29
26
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.PreviewClose, width: CLOSE_ICON_SIZE, height: CLOSE_ICON_SIZE, className: b('icon', { hover: true }) })),
|
|
30
27
|
react_1.default.createElement(Image_1.default, Object.assign({}, props, { className: b('modal-image', modalImageClass) })))))));
|
|
31
28
|
};
|
|
@@ -50,6 +50,10 @@ unpredictable css rules order in build */
|
|
|
50
50
|
transition: opacity 0.3s;
|
|
51
51
|
pointer-events: none;
|
|
52
52
|
}
|
|
53
|
+
.pc-full-screen-media__modal-content .pc-full-screen-media__icon-wrapper_visible, .pc-full-screen-media__modal-content .pc-full-screen-media__icon-wrapper:focus, .pc-full-screen-media__media-wrapper .pc-full-screen-media__icon-wrapper_visible, .pc-full-screen-media__media-wrapper .pc-full-screen-media__icon-wrapper:focus {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
pointer-events: inherit;
|
|
56
|
+
}
|
|
53
57
|
.pc-full-screen-media__modal-content:hover .pc-full-screen-media__icon-wrapper, .pc-full-screen-media__media-wrapper:hover .pc-full-screen-media__icon-wrapper {
|
|
54
58
|
opacity: 1;
|
|
55
59
|
pointer-events: inherit;
|
|
@@ -24,11 +24,11 @@ const FullscreenMedia = ({ children, showFullscreenIcon = true }) => {
|
|
|
24
24
|
return (react_1.default.createElement("div", { className: b() },
|
|
25
25
|
react_1.default.createElement("div", { className: b('media-wrapper'), onClickCapture: openModal },
|
|
26
26
|
children({ className: b('inline-media') }),
|
|
27
|
-
showFullscreenIcon && (react_1.default.createElement(
|
|
27
|
+
showFullscreenIcon && (react_1.default.createElement(uikit_1.Button, { className: b('icon-wrapper'), extraProps: { onClickCapture: openModal }, size: 'l' },
|
|
28
28
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.Fullscreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') })))),
|
|
29
29
|
isOpened && (react_1.default.createElement(uikit_1.Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
|
|
30
30
|
react_1.default.createElement("div", { className: b('modal-content') },
|
|
31
|
-
react_1.default.createElement(
|
|
31
|
+
react_1.default.createElement(uikit_1.Button, { className: b('icon-wrapper', { visible: true }), onClick: closeModal, size: 'l' },
|
|
32
32
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.PreviewClose, width: CLOSE_ICON_SIZE, height: CLOSE_ICON_SIZE, className: b('icon', { hover: true }) })),
|
|
33
33
|
children({
|
|
34
34
|
imageClassName: getMediaClass('image'),
|
|
@@ -10,6 +10,7 @@ unpredictable css rules order in build */
|
|
|
10
10
|
cursor: pointer;
|
|
11
11
|
display: flex;
|
|
12
12
|
align-items: center;
|
|
13
|
+
border-radius: var(--g-focus-border-radius);
|
|
13
14
|
}
|
|
14
15
|
.utilityfocus .pc-link-block__link:focus {
|
|
15
16
|
outline: 2px solid #ffdb4d;
|
|
@@ -18,6 +19,13 @@ unpredictable css rules order in build */
|
|
|
18
19
|
--pc-text-header-color: var(--g-color-text-link-hover);
|
|
19
20
|
color: var(--g-color-text-link-hover);
|
|
20
21
|
}
|
|
22
|
+
.pc-link-block__link:focus {
|
|
23
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
24
|
+
outline-offset: 0;
|
|
25
|
+
}
|
|
26
|
+
.pc-link-block__link:focus:not(:focus-visible) {
|
|
27
|
+
outline: 0;
|
|
28
|
+
}
|
|
21
29
|
.pc-link-block__link_theme_dark {
|
|
22
30
|
color: var(--g-color-text-light-primary);
|
|
23
31
|
}
|
|
@@ -53,7 +53,7 @@ const Image = (props) => {
|
|
|
53
53
|
};
|
|
54
54
|
const imageSlider = (imageArray) => {
|
|
55
55
|
const fullscreenItem = fullscreen === undefined || fullscreen;
|
|
56
|
-
return (react_1.default.createElement(Slider_1.default, { slidesToShow: 1, type: models_1.SliderType.MediaCard }, imageArray.map((item) => fullscreenItem ? renderFullscreenImage(item) : imageOnly(item))));
|
|
56
|
+
return (react_1.default.createElement(Slider_1.default, { slidesToShow: 1, type: models_1.SliderType.MediaCard }, imageArray.map((item, index) => (react_1.default.createElement(react_1.Fragment, { key: index }, fullscreenItem ? renderFullscreenImage(item) : imageOnly(item))))));
|
|
57
57
|
};
|
|
58
58
|
if (Array.isArray(image)) {
|
|
59
59
|
return imageSlider(image);
|
|
@@ -32,7 +32,7 @@ const Video = (props) => {
|
|
|
32
32
|
}, [playVideo, video, setHasVideoFallback]);
|
|
33
33
|
const reactPlayerBlock = (0, react_1.useMemo)(() => {
|
|
34
34
|
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton, ariaLabel, customControlsOptions, } = video;
|
|
35
|
-
return (react_1.default.createElement(ReactPlayer_1.default, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio }));
|
|
35
|
+
return (react_1.default.createElement(ReactPlayer_1.default, { ref: ref, className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio }));
|
|
36
36
|
}, [
|
|
37
37
|
video,
|
|
38
38
|
height,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
1
3
|
.pc-overflow-scroller {
|
|
2
4
|
display: flex;
|
|
3
5
|
align-items: center;
|
|
@@ -19,6 +21,15 @@
|
|
|
19
21
|
transition: left 0.6s;
|
|
20
22
|
}
|
|
21
23
|
.pc-overflow-scroller__arrow {
|
|
24
|
+
display: inline-block;
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
font: inherit;
|
|
28
|
+
border: none;
|
|
29
|
+
outline: none;
|
|
30
|
+
color: inherit;
|
|
31
|
+
background: none;
|
|
32
|
+
cursor: pointer;
|
|
22
33
|
position: absolute;
|
|
23
34
|
z-index: 10;
|
|
24
35
|
top: 0;
|
|
@@ -29,6 +40,14 @@
|
|
|
29
40
|
height: calc(100% - 1px);
|
|
30
41
|
cursor: pointer;
|
|
31
42
|
color: var(--g-color-text-secondary);
|
|
43
|
+
border-radius: var(--g-focus-border-radius);
|
|
44
|
+
}
|
|
45
|
+
.pc-overflow-scroller__arrow:focus {
|
|
46
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
47
|
+
outline-offset: 0;
|
|
48
|
+
}
|
|
49
|
+
.pc-overflow-scroller__arrow:focus:not(:focus-visible) {
|
|
50
|
+
outline: 0;
|
|
32
51
|
}
|
|
33
52
|
.pc-overflow-scroller__arrow_type_left {
|
|
34
53
|
left: 0;
|
|
@@ -5,6 +5,7 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
6
6
|
const __1 = require("..");
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
|
+
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
8
9
|
const b = (0, utils_1.block)('overflow-scroller');
|
|
9
10
|
const TRANSITION_TIME = 300;
|
|
10
11
|
const PADDING_SIZE = 24;
|
|
@@ -84,7 +85,7 @@ class OverflowScroller extends react_1.default.Component {
|
|
|
84
85
|
}) },
|
|
85
86
|
react_1.default.createElement("div", { className: b(null, className), ref: this.containerRef },
|
|
86
87
|
react_1.default.createElement("div", { className: b('wrapper'), style: wrapperStyle, ref: this.wrapperRef }, children)),
|
|
87
|
-
arrows.map((direction) => (react_1.default.createElement("
|
|
88
|
+
arrows.map((direction) => (react_1.default.createElement("button", { key: direction, className: b('arrow', { type: direction }, arrowClassName), onClick: (e) => this.handleScrollClick(e, direction), "aria-label": (0, i18n_1.default)(direction) },
|
|
88
89
|
react_1.default.createElement(__1.ToggleArrow, { size: arrowSize, type: 'horizontal', iconType: "navigation" }))))));
|
|
89
90
|
}
|
|
90
91
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const registerKeyset_1 = require("../../../utils/registerKeyset");
|
|
5
|
+
const en_json_1 = tslib_1.__importDefault(require("./en.json"));
|
|
6
|
+
const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
|
|
7
|
+
const COMPONENT = 'OverflowScroller';
|
|
8
|
+
exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
|
|
@@ -56,10 +56,11 @@ unpredictable css rules order in build */
|
|
|
56
56
|
background: #eff2f8;
|
|
57
57
|
}
|
|
58
58
|
.pc-CustomBarControls__button_type_with-mute-button:focus {
|
|
59
|
-
outline: 2px solid var(--g-color-line-
|
|
59
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
60
|
+
outline-offset: 0;
|
|
60
61
|
}
|
|
61
62
|
.pc-CustomBarControls__button_type_with-mute-button:focus:not(:focus-visible) {
|
|
62
|
-
outline:
|
|
63
|
+
outline: 0;
|
|
63
64
|
}
|
|
64
65
|
.pc-CustomBarControls__button_type_with-play-pause-button {
|
|
65
66
|
width: 42px;
|
|
@@ -68,10 +69,11 @@ unpredictable css rules order in build */
|
|
|
68
69
|
background: var(--g-color-base-background);
|
|
69
70
|
}
|
|
70
71
|
.pc-CustomBarControls__button_type_with-play-pause-button:focus {
|
|
71
|
-
outline: 2px solid var(--g-color-line-
|
|
72
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
73
|
+
outline-offset: 0;
|
|
72
74
|
}
|
|
73
75
|
.pc-CustomBarControls__button_type_with-play-pause-button:focus:not(:focus-visible) {
|
|
74
|
-
outline:
|
|
76
|
+
outline: 0;
|
|
75
77
|
}
|
|
76
78
|
.pc-CustomBarControls__play-icon_type_with-play-pause-button {
|
|
77
79
|
height: 16px;
|
|
@@ -27,6 +27,13 @@ unpredictable css rules order in build */
|
|
|
27
27
|
height: 64px;
|
|
28
28
|
border-radius: 166px;
|
|
29
29
|
}
|
|
30
|
+
.pc-ReactPlayer__button:focus {
|
|
31
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
32
|
+
outline-offset: 0;
|
|
33
|
+
}
|
|
34
|
+
.pc-ReactPlayer__button:focus:not(:focus-visible) {
|
|
35
|
+
outline: 0;
|
|
36
|
+
}
|
|
30
37
|
.pc-ReactPlayer__button_theme_blue {
|
|
31
38
|
color: var(--g-color-base-background);
|
|
32
39
|
background-color: var(--g-color-base-brand);
|
|
@@ -11,5 +11,6 @@ export interface ReactPlayerBlockProps extends Omit<MediaVideoProps, 'loop' | 's
|
|
|
11
11
|
ratio?: number;
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
type ReactPlayerBlockRefType = ReactPlayerBlockHandler | undefined;
|
|
15
|
+
export declare const ReactPlayerBlock: React.ForwardRefExoticComponent<ReactPlayerBlockProps & React.RefAttributes<ReactPlayerBlockRefType>>;
|
|
15
16
|
export default ReactPlayerBlock;
|