@gravity-ui/page-constructor 5.28.6 → 5.28.7-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/PromoFeaturesBlock/PromoFeaturesBlock.js +6 -1
- package/build/cjs/blocks/Questions/Questions.js +1 -1
- package/build/cjs/blocks/Questions/models.d.ts +1 -0
- package/build/cjs/blocks/Questions/models.js +1 -0
- package/build/cjs/blocks/Tabs/Tabs.js +5 -1
- package/build/cjs/components/ContentList/ContentList.css +24 -0
- package/build/cjs/components/ContentList/ContentList.d.ts +1 -1
- package/build/cjs/components/ContentList/ContentList.js +2 -2
- package/build/cjs/components/Media/Media.js +11 -2
- package/build/cjs/components/Title/TitleItem.d.ts +1 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +3 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.js +3 -2
- package/build/cjs/context/innerContext/InnerContext.d.ts +3 -0
- package/build/cjs/context/innerContext/InnerContext.js +1 -0
- package/build/cjs/grid/Col/Col.d.ts +1 -1
- package/build/cjs/models/constructor-items/common.d.ts +8 -0
- package/build/cjs/sub-blocks/Content/Content.css +4 -14
- package/build/cjs/sub-blocks/Content/Content.js +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +8 -1
- package/build/cjs/utils/microdata.d.ts +2 -0
- package/build/cjs/utils/microdata.js +5 -0
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +6 -1
- package/build/esm/blocks/Questions/Questions.js +1 -1
- package/build/esm/blocks/Questions/models.d.ts +1 -0
- package/build/esm/blocks/Questions/models.js +1 -0
- package/build/esm/blocks/Tabs/Tabs.js +5 -1
- package/build/esm/components/ContentList/ContentList.css +24 -0
- package/build/esm/components/ContentList/ContentList.d.ts +1 -1
- package/build/esm/components/ContentList/ContentList.js +2 -2
- package/build/esm/components/Media/Media.js +12 -3
- package/build/esm/components/Title/TitleItem.d.ts +1 -1
- package/build/esm/containers/PageConstructor/PageConstructor.d.ts +3 -0
- package/build/esm/containers/PageConstructor/PageConstructor.js +3 -2
- package/build/esm/context/innerContext/InnerContext.d.ts +3 -0
- package/build/esm/context/innerContext/InnerContext.js +1 -0
- package/build/esm/grid/Col/Col.d.ts +1 -1
- package/build/esm/models/constructor-items/common.d.ts +8 -0
- package/build/esm/sub-blocks/Content/Content.css +4 -14
- package/build/esm/sub-blocks/Content/Content.js +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +8 -1
- package/build/esm/utils/microdata.d.ts +2 -0
- package/build/esm/utils/microdata.js +1 -0
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +8 -0
- package/widget/index.js +1 -1
|
@@ -11,6 +11,7 @@ const YFMWrapper_1 = tslib_1.__importDefault(require("../../components/YFMWrappe
|
|
|
11
11
|
const constants_1 = require("../../constants");
|
|
12
12
|
const theme_1 = require("../../context/theme");
|
|
13
13
|
const utils_1 = require("../../utils");
|
|
14
|
+
const microdata_1 = require("../../utils/microdata");
|
|
14
15
|
const b = (0, utils_1.block)('PromoFeaturesBlock');
|
|
15
16
|
const breakpointColumns = {
|
|
16
17
|
[constants_1.BREAKPOINTS.lg]: 3,
|
|
@@ -28,6 +29,10 @@ const PromoFeaturesBlock = (props) => {
|
|
|
28
29
|
const blockModifier = backgroundTheme === 'default' ? 'default' : 'light';
|
|
29
30
|
const themeMod = cardTheme || blockModifier || '';
|
|
30
31
|
const themedMedia = (0, utils_1.getThemedValue)(media, globalTheme);
|
|
32
|
+
const allProps = (0, microdata_1.mergeVideoMicrodata)(themedMedia, {
|
|
33
|
+
name: cardTitle,
|
|
34
|
+
description: text,
|
|
35
|
+
});
|
|
31
36
|
return (react_1.default.createElement("div", { key: index, className: b('card', {
|
|
32
37
|
'no-media': !media,
|
|
33
38
|
[themeMod]: Boolean(themeMod),
|
|
@@ -36,7 +41,7 @@ const PromoFeaturesBlock = (props) => {
|
|
|
36
41
|
react_1.default.createElement("h3", { className: b('card-title') }, cardTitle),
|
|
37
42
|
react_1.default.createElement("div", { className: b('card-text') },
|
|
38
43
|
react_1.default.createElement(YFMWrapper_1.default, { content: text, modifiers: { constructor: true } }))),
|
|
39
|
-
media && react_1.default.createElement(Media_1.default, Object.assign({ className: b('card-media') },
|
|
44
|
+
media && react_1.default.createElement(Media_1.default, Object.assign({ className: b('card-media') }, allProps))));
|
|
40
45
|
}))));
|
|
41
46
|
};
|
|
42
47
|
exports.default = PromoFeaturesBlock;
|
|
@@ -21,7 +21,7 @@ const QuestionsBlock = (props) => {
|
|
|
21
21
|
}
|
|
22
22
|
setOpened(newState);
|
|
23
23
|
};
|
|
24
|
-
return (react_1.default.createElement("div", { className: b(), itemScope: true, itemType: models_1.FaqMicrodataValues.PageType },
|
|
24
|
+
return (react_1.default.createElement("div", { className: b(), itemScope: true, itemType: models_1.FaqMicrodataValues.PageType, itemID: models_1.FaqMicrodataValues.PageId },
|
|
25
25
|
react_1.default.createElement(grid_1.Row, null,
|
|
26
26
|
react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 4 } },
|
|
27
27
|
react_1.default.createElement("div", { className: b('title') },
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FaqMicrodataValues = void 0;
|
|
4
4
|
exports.FaqMicrodataValues = {
|
|
5
5
|
PageType: 'https://schema.org/FAQPage',
|
|
6
|
+
PageId: '/faq',
|
|
6
7
|
QuestionType: 'https://schema.org/Question',
|
|
7
8
|
QuestionProp: 'mainEntity',
|
|
8
9
|
QuestionNameProp: 'name',
|
|
@@ -15,6 +15,7 @@ const YFMWrapper_1 = tslib_1.__importDefault(require("../../components/YFMWrappe
|
|
|
15
15
|
const theme_1 = require("../../context/theme");
|
|
16
16
|
const grid_1 = require("../../grid");
|
|
17
17
|
const utils_2 = require("../../utils");
|
|
18
|
+
const microdata_1 = require("../../utils/microdata");
|
|
18
19
|
const TabsTextContent_1 = tslib_1.__importDefault(require("./TabsTextContent/TabsTextContent"));
|
|
19
20
|
const b = (0, utils_2.block)('tabs-block');
|
|
20
21
|
const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', contentSize = 's', }) => {
|
|
@@ -70,7 +71,10 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
70
71
|
}, className: b('col', { centered: centered }) },
|
|
71
72
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (react_1.default.createElement("div", { style: { minHeight: mediaVideoHeight || minImageHeight } },
|
|
72
73
|
react_1.default.createElement("div", { ref: ref },
|
|
73
|
-
react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_2.getThemedValue)(activeTabData.media, theme), {
|
|
74
|
+
react_1.default.createElement(Media_1.default, Object.assign({}, (0, microdata_1.mergeVideoMicrodata)((0, utils_2.getThemedValue)(activeTabData.media, theme), {
|
|
75
|
+
name: activeTabData.tabName,
|
|
76
|
+
description: activeTabData.caption,
|
|
77
|
+
}), { key: activeTab, className: b('media', { border }), playVideo: play, height: mediaVideoHeight || undefined, onImageLoad: handleImageHeight }))))),
|
|
74
78
|
imageProps && (react_1.default.createElement(react_1.Fragment, null,
|
|
75
79
|
react_1.default.createElement(FullscreenImage_1.default, Object.assign({}, imageProps, { imageClassName: b('image', { border }) })))),
|
|
76
80
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (react_1.default.createElement("p", { className: b('caption'), id: captionId },
|
|
@@ -53,6 +53,30 @@ unpredictable css rules order in build */
|
|
|
53
53
|
margin-top: 0;
|
|
54
54
|
margin-bottom: 0;
|
|
55
55
|
}
|
|
56
|
+
.pc-content-list_theme_light .pc-content-list__item *,
|
|
57
|
+
.pc-content-list_theme_light .pc-content-list__item .yfm,
|
|
58
|
+
.pc-content-list_theme_light .pc-content-list__item .yfm * {
|
|
59
|
+
color: var(--g-color-text-dark-primary);
|
|
60
|
+
}
|
|
61
|
+
.pc-content-list_theme_light .pc-content-list__item .yfm a {
|
|
62
|
+
color: var(--g-color-text-dark-primary);
|
|
63
|
+
text-decoration: underline;
|
|
64
|
+
}
|
|
65
|
+
.pc-content-list_theme_light .pc-content-list__item .yfm a:hover {
|
|
66
|
+
color: var(--g-color-text-dark-secondary);
|
|
67
|
+
}
|
|
68
|
+
.pc-content-list_theme_dark .pc-content-list__item *,
|
|
69
|
+
.pc-content-list_theme_dark .pc-content-list__item .yfm,
|
|
70
|
+
.pc-content-list_theme_dark .pc-content-list__item .yfm * {
|
|
71
|
+
color: var(--g-color-text-light-primary);
|
|
72
|
+
}
|
|
73
|
+
.pc-content-list_theme_dark .pc-content-list__item .yfm a {
|
|
74
|
+
color: var(--g-color-text-light-primary);
|
|
75
|
+
text-decoration: underline;
|
|
76
|
+
}
|
|
77
|
+
.pc-content-list_theme_dark .pc-content-list__item .yfm a:hover {
|
|
78
|
+
color: var(--g-color-text-light-secondary);
|
|
79
|
+
}
|
|
56
80
|
.pc-content-list__icon {
|
|
57
81
|
display: block;
|
|
58
82
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ContentListProps } from '../../models';
|
|
2
2
|
import { QAProps } from '../../models/common';
|
|
3
|
-
declare const ContentList: ({ list, size, qa }: ContentListProps & QAProps) => JSX.Element;
|
|
3
|
+
declare const ContentList: ({ list, size, qa, theme }: ContentListProps & QAProps) => JSX.Element;
|
|
4
4
|
export default ContentList;
|
|
@@ -17,9 +17,9 @@ function getHeadingLevel(size) {
|
|
|
17
17
|
return 'h3';
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
const ContentList = ({ list, size = 'l', qa }) => {
|
|
20
|
+
const ContentList = ({ list, size = 'l', qa, theme }) => {
|
|
21
21
|
const qaAttributes = (0, blocks_1.getQaAttrubutes)(qa, ['image', 'title', 'text']);
|
|
22
|
-
return (react_1.default.createElement("div", { className: b({ size }), "data-qa": qa }, list === null || list === void 0 ? void 0 : list.map((item) => {
|
|
22
|
+
return (react_1.default.createElement("div", { className: b({ size, theme }), "data-qa": qa }, list === null || list === void 0 ? void 0 : list.map((item) => {
|
|
23
23
|
const { icon, title, text } = item;
|
|
24
24
|
return (react_1.default.createElement("div", { className: b('item', { 'without-title': !title }), key: (0, uuid_1.v4)() },
|
|
25
25
|
react_1.default.createElement(ContentListItemIcon_1.default, { icon: icon, className: b('icon'), qa: qaAttributes.image }),
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Media = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const innerContext_1 = require("../../context/innerContext");
|
|
6
7
|
const utils_1 = require("../../utils");
|
|
7
8
|
const VideoBlock_1 = tslib_1.__importDefault(require("../VideoBlock/VideoBlock"));
|
|
8
9
|
const DataLens_1 = tslib_1.__importDefault(require("./DataLens/DataLens"));
|
|
@@ -12,8 +13,9 @@ const Image_1 = tslib_1.__importDefault(require("./Image/Image"));
|
|
|
12
13
|
const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
|
|
13
14
|
const b = (0, utils_1.block)('Media');
|
|
14
15
|
const Media = (props) => {
|
|
15
|
-
const { image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
|
|
16
|
+
const { image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, videoMicrodata, } = props;
|
|
16
17
|
const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
|
|
18
|
+
const { microdata } = (0, react_1.useContext)(innerContext_1.InnerContext);
|
|
17
19
|
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'video');
|
|
18
20
|
const content = (0, react_1.useMemo)(() => {
|
|
19
21
|
let result = [];
|
|
@@ -80,7 +82,14 @@ const Media = (props) => {
|
|
|
80
82
|
autoplay,
|
|
81
83
|
margins,
|
|
82
84
|
]);
|
|
83
|
-
|
|
85
|
+
const videoMicrodataScript = (0, react_1.useMemo)(() => {
|
|
86
|
+
var _a;
|
|
87
|
+
const json = JSON.stringify(Object.assign({ '@context': 'http://schema.org/', '@type': 'VideoObject', uploadDate: microdata === null || microdata === void 0 ? void 0 : microdata.contentUpdatedDate, contentUrl: ((_a = video === null || video === void 0 ? void 0 : video.src) === null || _a === void 0 ? void 0 : _a[0]) || videoIframe || youtube, thumbnailUrl: previewImg }, videoMicrodata));
|
|
88
|
+
return video || youtube || videoIframe ? (react_1.default.createElement("script", { type: "application/ld+json" }, json)) : null;
|
|
89
|
+
}, [microdata === null || microdata === void 0 ? void 0 : microdata.contentUpdatedDate, previewImg, video, videoIframe, videoMicrodata, youtube]);
|
|
90
|
+
return (react_1.default.createElement("div", { className: b(null, className), style: { backgroundColor: color }, "data-qa": qa },
|
|
91
|
+
videoMicrodataScript,
|
|
92
|
+
content));
|
|
84
93
|
};
|
|
85
94
|
exports.Media = Media;
|
|
86
95
|
exports.default = exports.Media;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QAProps, TextSize, TitleItemProps } from '../../models';
|
|
2
|
-
export declare function getArrowSize(size: TextSize, isMobile: boolean):
|
|
2
|
+
export declare function getArrowSize(size: TextSize, isMobile: boolean): 20 | 24 | 16 | 13 | 22 | 26 | 38;
|
|
3
3
|
export interface TitleItemFullProps extends TitleItemProps, QAProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
onClick?: () => void;
|
|
@@ -10,6 +10,9 @@ export interface PageConstructorProps {
|
|
|
10
10
|
custom?: CustomConfig;
|
|
11
11
|
renderMenu?: () => React.ReactNode;
|
|
12
12
|
navigation?: NavigationData;
|
|
13
|
+
microdata?: {
|
|
14
|
+
contentUpdatedDate: string;
|
|
15
|
+
};
|
|
13
16
|
}
|
|
14
17
|
export declare const Constructor: (props: PageConstructorProps) => JSX.Element;
|
|
15
18
|
export declare const PageConstructor: (props: PageConstructorProps) => JSX.Element;
|
|
@@ -20,7 +20,7 @@ const ConstructorItem_1 = require("./components/ConstructorItem");
|
|
|
20
20
|
const ConstructorRow_1 = require("./components/ConstructorRow");
|
|
21
21
|
const b = (0, utils_1.block)('page-constructor');
|
|
22
22
|
const Constructor = (props) => {
|
|
23
|
-
const { content: { blocks = [], background } = {}, renderMenu, shouldRenderBlock, navigation, custom, } = props;
|
|
23
|
+
const { content: { blocks = [], background } = {}, renderMenu, shouldRenderBlock, navigation, custom, microdata, } = props;
|
|
24
24
|
const { context } = (0, react_1.useMemo)(() => ({
|
|
25
25
|
context: {
|
|
26
26
|
blockTypes: [...models_1.BlockTypes, ...(0, utils_1.getCustomTypes)(['blocks', 'headers'], custom)],
|
|
@@ -37,8 +37,9 @@ const Constructor = (props) => {
|
|
|
37
37
|
customization: {
|
|
38
38
|
decorators: custom === null || custom === void 0 ? void 0 : custom.decorators,
|
|
39
39
|
},
|
|
40
|
+
microdata,
|
|
40
41
|
},
|
|
41
|
-
}), [custom, shouldRenderBlock]);
|
|
42
|
+
}), [custom, shouldRenderBlock, microdata]);
|
|
42
43
|
const theme = (0, theme_1.useTheme)();
|
|
43
44
|
const header = (0, utils_1.getHeaderBlock)(blocks, context.headerBlockTypes);
|
|
44
45
|
const restBlocks = (0, utils_1.getOrderedBlocks)(blocks, context.headerBlockTypes);
|
|
@@ -11,5 +11,8 @@ export interface InnerContextType {
|
|
|
11
11
|
loadables?: LoadableConfig;
|
|
12
12
|
shouldRenderBlock?: ShouldRenderBlock;
|
|
13
13
|
customization?: Pick<CustomConfig, 'decorators'>;
|
|
14
|
+
microdata?: {
|
|
15
|
+
contentUpdatedDate?: string;
|
|
16
|
+
};
|
|
14
17
|
}
|
|
15
18
|
export declare const InnerContext: React.Context<InnerContextType>;
|
|
@@ -5,4 +5,4 @@ export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivE
|
|
|
5
5
|
style?: CSSProperties;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const Col: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<GridColumnProps>, "style" | "children" | "sizes" | "className" | "hidden" | "role" | "qa" | "
|
|
8
|
+
export declare const Col: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<GridColumnProps>, "style" | "children" | "sizes" | "className" | "hidden" | "role" | "qa" | "offsets" | "orders" | "visible" | "alignSelf" | "justifyContent" | "reset"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -207,6 +207,14 @@ export interface MediaComponentIframeProps {
|
|
|
207
207
|
}
|
|
208
208
|
export interface MediaProps extends Animatable, Partial<MediaComponentDataLensProps>, Partial<MediaComponentYoutubeProps>, Partial<MediaComponentVideoIframeProps>, Partial<MediaComponentImageProps>, Partial<MediaComponentIframeProps>, Partial<MediaComponentVideoProps> {
|
|
209
209
|
color?: string;
|
|
210
|
+
videoMicrodata?: {
|
|
211
|
+
name?: string;
|
|
212
|
+
description?: string;
|
|
213
|
+
duration?: string;
|
|
214
|
+
uploadDate?: string;
|
|
215
|
+
contentUrl?: string;
|
|
216
|
+
thumbnailUrl?: string;
|
|
217
|
+
};
|
|
210
218
|
}
|
|
211
219
|
export interface BackgroundMediaProps extends MediaProps, Animatable, QAProps {
|
|
212
220
|
fullWidthMedia?: boolean;
|
|
@@ -87,9 +87,6 @@ unpredictable css rules order in build */
|
|
|
87
87
|
.pc-content_theme_dark .pc-content__title *,
|
|
88
88
|
.pc-content_theme_dark .pc-content__text .yfm,
|
|
89
89
|
.pc-content_theme_dark .pc-content__text .yfm *,
|
|
90
|
-
.pc-content_theme_dark .pc-content__list *,
|
|
91
|
-
.pc-content_theme_dark .pc-content__list .yfm,
|
|
92
|
-
.pc-content_theme_dark .pc-content__list .yfm *,
|
|
93
90
|
.pc-content_theme_dark .pc-content__links a {
|
|
94
91
|
color: var(--g-color-text-light-primary);
|
|
95
92
|
}
|
|
@@ -104,13 +101,11 @@ unpredictable css rules order in build */
|
|
|
104
101
|
.pc-content_theme_dark .pc-content__notice .yfm a:hover {
|
|
105
102
|
color: var(--g-color-text-light-primary);
|
|
106
103
|
}
|
|
107
|
-
.pc-content_theme_dark .pc-content__text .yfm a
|
|
108
|
-
.pc-content_theme_dark .pc-content__list .yfm a {
|
|
104
|
+
.pc-content_theme_dark .pc-content__text .yfm a {
|
|
109
105
|
color: var(--g-color-text-light-primary);
|
|
110
106
|
text-decoration: underline;
|
|
111
107
|
}
|
|
112
|
-
.pc-content_theme_dark .pc-content__text .yfm a:hover
|
|
113
|
-
.pc-content_theme_dark .pc-content__list .yfm a:hover {
|
|
108
|
+
.pc-content_theme_dark .pc-content__text .yfm a:hover {
|
|
114
109
|
color: var(--g-color-text-light-secondary);
|
|
115
110
|
}
|
|
116
111
|
.pc-content_theme_dark .pc-content__title a {
|
|
@@ -124,9 +119,6 @@ unpredictable css rules order in build */
|
|
|
124
119
|
.pc-content_theme_light .pc-content__title *,
|
|
125
120
|
.pc-content_theme_light .pc-content__text .yfm,
|
|
126
121
|
.pc-content_theme_light .pc-content__text .yfm *,
|
|
127
|
-
.pc-content_theme_light .pc-content__list *,
|
|
128
|
-
.pc-content_theme_light .pc-content__list .yfm,
|
|
129
|
-
.pc-content_theme_light .pc-content__list .yfm *,
|
|
130
122
|
.pc-content_theme_light .pc-content__links a {
|
|
131
123
|
color: var(--g-color-text-dark-primary);
|
|
132
124
|
}
|
|
@@ -141,13 +133,11 @@ unpredictable css rules order in build */
|
|
|
141
133
|
.pc-content_theme_light .pc-content__notice .yfm a:hover {
|
|
142
134
|
color: var(--g-color-text-dark-primary);
|
|
143
135
|
}
|
|
144
|
-
.pc-content_theme_light .pc-content__text .yfm a
|
|
145
|
-
.pc-content_theme_light .pc-content__list .yfm a {
|
|
136
|
+
.pc-content_theme_light .pc-content__text .yfm a {
|
|
146
137
|
color: var(--g-color-text-dark-primary);
|
|
147
138
|
text-decoration: underline;
|
|
148
139
|
}
|
|
149
|
-
.pc-content_theme_light .pc-content__text .yfm a:hover
|
|
150
|
-
.pc-content_theme_light .pc-content__list .yfm a:hover {
|
|
140
|
+
.pc-content_theme_light .pc-content__text .yfm a:hover {
|
|
151
141
|
color: var(--g-color-text-dark-secondary);
|
|
152
142
|
}
|
|
153
143
|
.pc-content_theme_light .pc-content__title a {
|
|
@@ -31,7 +31,7 @@ const Content = (props) => {
|
|
|
31
31
|
text && (react_1.default.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
|
|
32
32
|
react_1.default.createElement(components_1.YFMWrapper, { content: text, modifiers: { constructor: true, [`constructor-size-${size}`]: true }, id: textId }))),
|
|
33
33
|
(list === null || list === void 0 ? void 0 : list.length) ? (react_1.default.createElement("div", { className: b('list') },
|
|
34
|
-
react_1.default.createElement(components_1.ContentList, { list: list, size: size, qa: qaAttributes.list }))) : null,
|
|
34
|
+
react_1.default.createElement(components_1.ContentList, { list: list, size: size, qa: qaAttributes.list, theme: theme }))) : null,
|
|
35
35
|
additionalInfo && (react_1.default.createElement("div", { className: b('notice') },
|
|
36
36
|
react_1.default.createElement(components_1.YFMWrapper, { content: additionalInfo, modifiers: {
|
|
37
37
|
constructor: true,
|
|
@@ -6,6 +6,7 @@ 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 microdata_1 = require("../../utils/microdata");
|
|
9
10
|
const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
|
|
10
11
|
const utils_2 = require("./utils");
|
|
11
12
|
const b = (0, utils_1.block)('layout-item');
|
|
@@ -23,8 +24,14 @@ const LayoutItem = (_a) => {
|
|
|
23
24
|
}
|
|
24
25
|
const themedMedia = (0, utils_1.getThemedValue)(media, theme);
|
|
25
26
|
return fullscreen && (0, utils_2.hasFullscreen)(themedMedia) ? (react_1.default.createElement(components_1.FullscreenMedia, { showFullscreenIcon: (0, utils_2.showFullscreenIcon)(themedMedia) }, (_a = {}) => {
|
|
27
|
+
var _b;
|
|
26
28
|
var { className: mediaClassName, fullscreen: _fullscreen } = _a, fullscreenMediaProps = tslib_1.__rest(_a, ["className", "fullscreen"]);
|
|
27
|
-
return (react_1.default.createElement(components_1.Media, Object.assign({},
|
|
29
|
+
return (react_1.default.createElement(components_1.Media, Object.assign({}, (0, microdata_1.mergeVideoMicrodata)(themedMedia, {
|
|
30
|
+
name: typeof content.title === 'string'
|
|
31
|
+
? content.title
|
|
32
|
+
: (_b = content.title) === null || _b === void 0 ? void 0 : _b.text,
|
|
33
|
+
description: content.text,
|
|
34
|
+
}), fullscreenMediaProps, { className: b('media', { border }, mediaClassName), analyticsEvents: analyticsEvents })));
|
|
28
35
|
})) : (react_1.default.createElement(components_1.Media, Object.assign({}, themedMedia, { className: b('media', { border }), analyticsEvents: analyticsEvents })));
|
|
29
36
|
};
|
|
30
37
|
return (react_1.default.createElement("div", { className: b(null, className) },
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeVideoMicrodata = void 0;
|
|
4
|
+
const mergeVideoMicrodata = (values = {}, newValues = {}) => (Object.assign(Object.assign({}, values), { videoMicrodata: Object.assign(Object.assign({}, newValues), (values.videoMicrodata || {})) }));
|
|
5
|
+
exports.mergeVideoMicrodata = mergeVideoMicrodata;
|
|
@@ -8,6 +8,7 @@ import YFMWrapper from '../../components/YFMWrapper/YFMWrapper';
|
|
|
8
8
|
import { BREAKPOINTS } from '../../constants';
|
|
9
9
|
import { useTheme } from '../../context/theme';
|
|
10
10
|
import { block, getThemedValue } from '../../utils';
|
|
11
|
+
import { mergeVideoMicrodata } from '../../utils/microdata';
|
|
11
12
|
import './PromoFeaturesBlock.css';
|
|
12
13
|
const b = block('PromoFeaturesBlock');
|
|
13
14
|
const breakpointColumns = {
|
|
@@ -26,6 +27,10 @@ const PromoFeaturesBlock = (props) => {
|
|
|
26
27
|
const blockModifier = backgroundTheme === 'default' ? 'default' : 'light';
|
|
27
28
|
const themeMod = cardTheme || blockModifier || '';
|
|
28
29
|
const themedMedia = getThemedValue(media, globalTheme);
|
|
30
|
+
const allProps = mergeVideoMicrodata(themedMedia, {
|
|
31
|
+
name: cardTitle,
|
|
32
|
+
description: text,
|
|
33
|
+
});
|
|
29
34
|
return (React.createElement("div", { key: index, className: b('card', {
|
|
30
35
|
'no-media': !media,
|
|
31
36
|
[themeMod]: Boolean(themeMod),
|
|
@@ -34,7 +39,7 @@ const PromoFeaturesBlock = (props) => {
|
|
|
34
39
|
React.createElement("h3", { className: b('card-title') }, cardTitle),
|
|
35
40
|
React.createElement("div", { className: b('card-text') },
|
|
36
41
|
React.createElement(YFMWrapper, { content: text, modifiers: { constructor: true } }))),
|
|
37
|
-
media && React.createElement(Media, Object.assign({ className: b('card-media') },
|
|
42
|
+
media && React.createElement(Media, Object.assign({ className: b('card-media') }, allProps))));
|
|
38
43
|
}))));
|
|
39
44
|
};
|
|
40
45
|
export default PromoFeaturesBlock;
|
|
@@ -19,7 +19,7 @@ const QuestionsBlock = (props) => {
|
|
|
19
19
|
}
|
|
20
20
|
setOpened(newState);
|
|
21
21
|
};
|
|
22
|
-
return (React.createElement("div", { className: b(), itemScope: true, itemType: FaqMicrodataValues.PageType },
|
|
22
|
+
return (React.createElement("div", { className: b(), itemScope: true, itemType: FaqMicrodataValues.PageType, itemID: FaqMicrodataValues.PageId },
|
|
23
23
|
React.createElement(Row, null,
|
|
24
24
|
React.createElement(Col, { sizes: { all: 12, md: 4 } },
|
|
25
25
|
React.createElement("div", { className: b('title') },
|
|
@@ -11,6 +11,7 @@ import YFMWrapper from '../../components/YFMWrapper/YFMWrapper';
|
|
|
11
11
|
import { useTheme } from '../../context/theme';
|
|
12
12
|
import { Col, GridColumnOrderClasses, Row } from '../../grid';
|
|
13
13
|
import { block, getThemedValue } from '../../utils';
|
|
14
|
+
import { mergeVideoMicrodata } from '../../utils/microdata';
|
|
14
15
|
import TabsTextContent from './TabsTextContent/TabsTextContent';
|
|
15
16
|
import './Tabs.css';
|
|
16
17
|
const b = block('tabs-block');
|
|
@@ -67,7 +68,10 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
|
|
|
67
68
|
}, className: b('col', { centered: centered }) },
|
|
68
69
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement("div", { style: { minHeight: mediaVideoHeight || minImageHeight } },
|
|
69
70
|
React.createElement("div", { ref: ref },
|
|
70
|
-
React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), {
|
|
71
|
+
React.createElement(Media, Object.assign({}, mergeVideoMicrodata(getThemedValue(activeTabData.media, theme), {
|
|
72
|
+
name: activeTabData.tabName,
|
|
73
|
+
description: activeTabData.caption,
|
|
74
|
+
}), { key: activeTab, className: b('media', { border }), playVideo: play, height: mediaVideoHeight || undefined, onImageLoad: handleImageHeight }))))),
|
|
71
75
|
imageProps && (React.createElement(Fragment, null,
|
|
72
76
|
React.createElement(FullscreenImage, Object.assign({}, imageProps, { imageClassName: b('image', { border }) })))),
|
|
73
77
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (React.createElement("p", { className: b('caption'), id: captionId },
|
|
@@ -53,6 +53,30 @@ unpredictable css rules order in build */
|
|
|
53
53
|
margin-top: 0;
|
|
54
54
|
margin-bottom: 0;
|
|
55
55
|
}
|
|
56
|
+
.pc-content-list_theme_light .pc-content-list__item *,
|
|
57
|
+
.pc-content-list_theme_light .pc-content-list__item .yfm,
|
|
58
|
+
.pc-content-list_theme_light .pc-content-list__item .yfm * {
|
|
59
|
+
color: var(--g-color-text-dark-primary);
|
|
60
|
+
}
|
|
61
|
+
.pc-content-list_theme_light .pc-content-list__item .yfm a {
|
|
62
|
+
color: var(--g-color-text-dark-primary);
|
|
63
|
+
text-decoration: underline;
|
|
64
|
+
}
|
|
65
|
+
.pc-content-list_theme_light .pc-content-list__item .yfm a:hover {
|
|
66
|
+
color: var(--g-color-text-dark-secondary);
|
|
67
|
+
}
|
|
68
|
+
.pc-content-list_theme_dark .pc-content-list__item *,
|
|
69
|
+
.pc-content-list_theme_dark .pc-content-list__item .yfm,
|
|
70
|
+
.pc-content-list_theme_dark .pc-content-list__item .yfm * {
|
|
71
|
+
color: var(--g-color-text-light-primary);
|
|
72
|
+
}
|
|
73
|
+
.pc-content-list_theme_dark .pc-content-list__item .yfm a {
|
|
74
|
+
color: var(--g-color-text-light-primary);
|
|
75
|
+
text-decoration: underline;
|
|
76
|
+
}
|
|
77
|
+
.pc-content-list_theme_dark .pc-content-list__item .yfm a:hover {
|
|
78
|
+
color: var(--g-color-text-light-secondary);
|
|
79
|
+
}
|
|
56
80
|
.pc-content-list__icon {
|
|
57
81
|
display: block;
|
|
58
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContentListProps } from '../../models';
|
|
2
2
|
import { QAProps } from '../../models/common';
|
|
3
3
|
import './ContentList.css';
|
|
4
|
-
declare const ContentList: ({ list, size, qa }: ContentListProps & QAProps) => JSX.Element;
|
|
4
|
+
declare const ContentList: ({ list, size, qa, theme }: ContentListProps & QAProps) => JSX.Element;
|
|
5
5
|
export default ContentList;
|
|
@@ -15,9 +15,9 @@ function getHeadingLevel(size) {
|
|
|
15
15
|
return 'h3';
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
const ContentList = ({ list, size = 'l', qa }) => {
|
|
18
|
+
const ContentList = ({ list, size = 'l', qa, theme }) => {
|
|
19
19
|
const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);
|
|
20
|
-
return (React.createElement("div", { className: b({ size }), "data-qa": qa }, list === null || list === void 0 ? void 0 : list.map((item) => {
|
|
20
|
+
return (React.createElement("div", { className: b({ size, theme }), "data-qa": qa }, list === null || list === void 0 ? void 0 : list.map((item) => {
|
|
21
21
|
const { icon, title, text } = item;
|
|
22
22
|
return (React.createElement("div", { className: b('item', { 'without-title': !title }), key: uuidv4() },
|
|
23
23
|
React.createElement(ItemIcon, { icon: icon, className: b('icon'), qa: qaAttributes.image }),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useMemo, useState } from 'react';
|
|
1
|
+
import React, { useContext, useMemo, useState } from 'react';
|
|
2
|
+
import { InnerContext } from '../../context/innerContext';
|
|
2
3
|
import { block, getQaAttrubutes } from '../../utils';
|
|
3
4
|
import IframeVideoBlock from '../VideoBlock/VideoBlock';
|
|
4
5
|
import DataLens from './DataLens/DataLens';
|
|
@@ -9,8 +10,9 @@ import Video from './Video/Video';
|
|
|
9
10
|
import './Media.css';
|
|
10
11
|
const b = block('Media');
|
|
11
12
|
export const Media = (props) => {
|
|
12
|
-
const { image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
|
|
13
|
+
const { image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, videoMicrodata, } = props;
|
|
13
14
|
const [hasVideoFallback, setHasVideoFallback] = useState(false);
|
|
15
|
+
const { microdata } = useContext(InnerContext);
|
|
14
16
|
const qaAttributes = getQaAttrubutes(qa, 'video');
|
|
15
17
|
const content = useMemo(() => {
|
|
16
18
|
let result = [];
|
|
@@ -77,6 +79,13 @@ export const Media = (props) => {
|
|
|
77
79
|
autoplay,
|
|
78
80
|
margins,
|
|
79
81
|
]);
|
|
80
|
-
|
|
82
|
+
const videoMicrodataScript = useMemo(() => {
|
|
83
|
+
var _a;
|
|
84
|
+
const json = JSON.stringify(Object.assign({ '@context': 'http://schema.org/', '@type': 'VideoObject', uploadDate: microdata === null || microdata === void 0 ? void 0 : microdata.contentUpdatedDate, contentUrl: ((_a = video === null || video === void 0 ? void 0 : video.src) === null || _a === void 0 ? void 0 : _a[0]) || videoIframe || youtube, thumbnailUrl: previewImg }, videoMicrodata));
|
|
85
|
+
return video || youtube || videoIframe ? (React.createElement("script", { type: "application/ld+json" }, json)) : null;
|
|
86
|
+
}, [microdata === null || microdata === void 0 ? void 0 : microdata.contentUpdatedDate, previewImg, video, videoIframe, videoMicrodata, youtube]);
|
|
87
|
+
return (React.createElement("div", { className: b(null, className), style: { backgroundColor: color }, "data-qa": qa },
|
|
88
|
+
videoMicrodataScript,
|
|
89
|
+
content));
|
|
81
90
|
};
|
|
82
91
|
export default Media;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QAProps, TextSize, TitleItemProps } from '../../models';
|
|
2
2
|
import './TitleItem.css';
|
|
3
|
-
export declare function getArrowSize(size: TextSize, isMobile: boolean):
|
|
3
|
+
export declare function getArrowSize(size: TextSize, isMobile: boolean): 20 | 24 | 16 | 13 | 22 | 26 | 38;
|
|
4
4
|
export interface TitleItemFullProps extends TitleItemProps, QAProps {
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: () => void;
|
|
@@ -11,6 +11,9 @@ export interface PageConstructorProps {
|
|
|
11
11
|
custom?: CustomConfig;
|
|
12
12
|
renderMenu?: () => React.ReactNode;
|
|
13
13
|
navigation?: NavigationData;
|
|
14
|
+
microdata?: {
|
|
15
|
+
contentUpdatedDate: string;
|
|
16
|
+
};
|
|
14
17
|
}
|
|
15
18
|
export declare const Constructor: (props: PageConstructorProps) => JSX.Element;
|
|
16
19
|
export declare const PageConstructor: (props: PageConstructorProps) => JSX.Element;
|
|
@@ -18,7 +18,7 @@ import { ConstructorRow } from './components/ConstructorRow';
|
|
|
18
18
|
import './PageConstructor.css';
|
|
19
19
|
const b = cnBlock('page-constructor');
|
|
20
20
|
export const Constructor = (props) => {
|
|
21
|
-
const { content: { blocks = [], background } = {}, renderMenu, shouldRenderBlock, navigation, custom, } = props;
|
|
21
|
+
const { content: { blocks = [], background } = {}, renderMenu, shouldRenderBlock, navigation, custom, microdata, } = props;
|
|
22
22
|
const { context } = useMemo(() => ({
|
|
23
23
|
context: {
|
|
24
24
|
blockTypes: [...BlockTypes, ...getCustomTypes(['blocks', 'headers'], custom)],
|
|
@@ -35,8 +35,9 @@ export const Constructor = (props) => {
|
|
|
35
35
|
customization: {
|
|
36
36
|
decorators: custom === null || custom === void 0 ? void 0 : custom.decorators,
|
|
37
37
|
},
|
|
38
|
+
microdata,
|
|
38
39
|
},
|
|
39
|
-
}), [custom, shouldRenderBlock]);
|
|
40
|
+
}), [custom, shouldRenderBlock, microdata]);
|
|
40
41
|
const theme = useTheme();
|
|
41
42
|
const header = getHeaderBlock(blocks, context.headerBlockTypes);
|
|
42
43
|
const restBlocks = getOrderedBlocks(blocks, context.headerBlockTypes);
|
|
@@ -11,5 +11,8 @@ export interface InnerContextType {
|
|
|
11
11
|
loadables?: LoadableConfig;
|
|
12
12
|
shouldRenderBlock?: ShouldRenderBlock;
|
|
13
13
|
customization?: Pick<CustomConfig, 'decorators'>;
|
|
14
|
+
microdata?: {
|
|
15
|
+
contentUpdatedDate?: string;
|
|
16
|
+
};
|
|
14
17
|
}
|
|
15
18
|
export declare const InnerContext: React.Context<InnerContextType>;
|
|
@@ -5,4 +5,4 @@ export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivE
|
|
|
5
5
|
style?: CSSProperties;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const Col: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<GridColumnProps>, "style" | "children" | "sizes" | "className" | "hidden" | "role" | "qa" | "
|
|
8
|
+
export declare const Col: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<GridColumnProps>, "style" | "children" | "sizes" | "className" | "hidden" | "role" | "qa" | "offsets" | "orders" | "visible" | "alignSelf" | "justifyContent" | "reset"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -207,6 +207,14 @@ export interface MediaComponentIframeProps {
|
|
|
207
207
|
}
|
|
208
208
|
export interface MediaProps extends Animatable, Partial<MediaComponentDataLensProps>, Partial<MediaComponentYoutubeProps>, Partial<MediaComponentVideoIframeProps>, Partial<MediaComponentImageProps>, Partial<MediaComponentIframeProps>, Partial<MediaComponentVideoProps> {
|
|
209
209
|
color?: string;
|
|
210
|
+
videoMicrodata?: {
|
|
211
|
+
name?: string;
|
|
212
|
+
description?: string;
|
|
213
|
+
duration?: string;
|
|
214
|
+
uploadDate?: string;
|
|
215
|
+
contentUrl?: string;
|
|
216
|
+
thumbnailUrl?: string;
|
|
217
|
+
};
|
|
210
218
|
}
|
|
211
219
|
export interface BackgroundMediaProps extends MediaProps, Animatable, QAProps {
|
|
212
220
|
fullWidthMedia?: boolean;
|