@gravity-ui/page-constructor 3.0.0-alpha.0 → 3.0.0-alpha.2
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/CHANGELOG.md +19 -0
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -2
- package/build/cjs/blocks/Slider/Slider.js +2 -2
- package/build/cjs/blocks/Tabs/Tabs.js +2 -2
- package/build/cjs/components/Anchor/Anchor.d.ts +2 -2
- package/build/cjs/components/Anchor/Anchor.js +1 -1
- package/build/cjs/components/MediaBase/MediaBase.js +2 -2
- package/build/cjs/components/Title/Title.css +8 -103
- package/build/cjs/components/Title/Title.d.ts +5 -8
- package/build/cjs/components/Title/Title.js +15 -50
- package/build/cjs/components/Title/TitleItem.css +111 -0
- package/build/cjs/components/Title/TitleItem.d.ts +10 -0
- package/build/cjs/components/Title/TitleItem.js +57 -0
- package/build/cjs/components/index.d.ts +1 -1
- package/build/cjs/components/index.js +4 -4
- package/build/cjs/grid/Col/Col.d.ts +1 -1
- package/build/cjs/internal-typings/global.d.ts +18 -16
- package/build/cjs/models/constructor-items/blocks.d.ts +8 -8
- package/build/cjs/models/constructor-items/common.d.ts +4 -4
- package/build/cjs/sub-blocks/Content/Content.js +3 -3
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +2 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.js +5 -2
- package/build/cjs/sub-blocks/HubspotForm/index.d.ts +1 -1
- package/build/cjs/sub-blocks/HubspotForm/index.js +6 -5
- package/build/cjs/text-transform/config.d.ts +2 -2
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -2
- package/build/esm/blocks/Slider/Slider.js +2 -2
- package/build/esm/blocks/Tabs/Tabs.js +2 -2
- package/build/esm/components/Anchor/Anchor.d.ts +2 -2
- package/build/esm/components/Anchor/Anchor.js +1 -1
- package/build/esm/components/MediaBase/MediaBase.js +2 -2
- package/build/esm/components/Title/Title.css +8 -103
- package/build/esm/components/Title/Title.d.ts +5 -8
- package/build/esm/components/Title/Title.js +17 -49
- package/build/esm/components/Title/TitleItem.css +111 -0
- package/build/esm/components/Title/TitleItem.d.ts +11 -0
- package/build/esm/components/Title/TitleItem.js +53 -0
- package/build/esm/components/index.d.ts +1 -1
- package/build/esm/components/index.js +1 -1
- package/build/esm/grid/Col/Col.d.ts +1 -1
- package/build/esm/internal-typings/global.d.ts +18 -16
- package/build/esm/models/constructor-items/blocks.d.ts +8 -8
- package/build/esm/models/constructor-items/common.d.ts +4 -4
- package/build/esm/sub-blocks/Content/Content.js +3 -3
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +2 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.js +6 -3
- package/build/esm/sub-blocks/HubspotForm/index.d.ts +1 -1
- package/build/esm/sub-blocks/HubspotForm/index.js +7 -6
- package/build/esm/text-transform/config.d.ts +2 -2
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +8 -8
- package/server/models/constructor-items/common.d.ts +4 -4
- package/server/text-transform/config.d.ts +2 -2
- package/build/cjs/components/Anchor/__tests__/Anchor.test.d.ts +0 -1
- package/build/cjs/components/Anchor/__tests__/Anchor.test.js +0 -21
- package/build/cjs/components/AnimateBlock/__tests__/AnimateBlock.test.d.ts +0 -1
- package/build/cjs/components/AnimateBlock/__tests__/AnimateBlock.test.js +0 -36
- package/build/cjs/components/Author/__tests__/Author.test.d.ts +0 -1
- package/build/cjs/components/Author/__tests__/Author.test.js +0 -49
- package/build/cjs/components/BackLink/__tests__/BackLink.test.d.ts +0 -1
- package/build/cjs/components/BackLink/__tests__/BackLink.test.js +0 -63
- package/build/cjs/components/BlockBase/__tests__/BlockBase.test.d.ts +0 -1
- package/build/cjs/components/BlockBase/__tests__/BlockBase.test.js +0 -44
- package/build/cjs/components/BlockHeader/BlockHeader.css +0 -16
- package/build/cjs/components/BlockHeader/BlockHeader.d.ts +0 -7
- package/build/cjs/components/BlockHeader/BlockHeader.js +0 -22
- package/build/cjs/components/Button/__tests__/Button.test.d.ts +0 -1
- package/build/cjs/components/Button/__tests__/Button.test.js +0 -91
- package/build/cjs/components/ButtonTabs/__tests__/ButtonTabs.test.d.ts +0 -1
- package/build/cjs/components/ButtonTabs/__tests__/ButtonTabs.test.js +0 -58
- package/build/esm/components/Anchor/__tests__/Anchor.test.d.ts +0 -1
- package/build/esm/components/Anchor/__tests__/Anchor.test.js +0 -18
- package/build/esm/components/AnimateBlock/__tests__/AnimateBlock.test.d.ts +0 -1
- package/build/esm/components/AnimateBlock/__tests__/AnimateBlock.test.js +0 -33
- package/build/esm/components/Author/__tests__/Author.test.d.ts +0 -1
- package/build/esm/components/Author/__tests__/Author.test.js +0 -46
- package/build/esm/components/BackLink/__tests__/BackLink.test.d.ts +0 -1
- package/build/esm/components/BackLink/__tests__/BackLink.test.js +0 -60
- package/build/esm/components/BlockBase/__tests__/BlockBase.test.d.ts +0 -1
- package/build/esm/components/BlockBase/__tests__/BlockBase.test.js +0 -41
- package/build/esm/components/BlockHeader/BlockHeader.css +0 -16
- package/build/esm/components/BlockHeader/BlockHeader.d.ts +0 -8
- package/build/esm/components/BlockHeader/BlockHeader.js +0 -21
- package/build/esm/components/Button/__tests__/Button.test.d.ts +0 -1
- package/build/esm/components/Button/__tests__/Button.test.js +0 -88
- package/build/esm/components/ButtonTabs/__tests__/ButtonTabs.test.d.ts +0 -1
- package/build/esm/components/ButtonTabs/__tests__/ButtonTabs.test.js +0 -55
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ButtonSize } from '@gravity-ui/uikit';
|
|
3
3
|
import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
|
|
4
4
|
import { ThemeSupporting } from '../../utils';
|
|
5
|
-
import { AnchorProps, Animatable, BackgroundImageProps,
|
|
5
|
+
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, TitleProps } from './common';
|
|
6
6
|
import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
7
7
|
export declare enum BlockType {
|
|
8
8
|
PromoFeaturesBlock = "promo-features-block",
|
|
@@ -69,7 +69,7 @@ export interface SliderProps extends Childable, Animatable, LoadableChildren {
|
|
|
69
69
|
text: string;
|
|
70
70
|
size?: TextSize;
|
|
71
71
|
};
|
|
72
|
-
title?:
|
|
72
|
+
title?: TitleItemBaseProps;
|
|
73
73
|
description?: string;
|
|
74
74
|
autoplay?: number;
|
|
75
75
|
randomOrder?: boolean;
|
|
@@ -120,7 +120,7 @@ export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' |
|
|
|
120
120
|
}
|
|
121
121
|
export interface ExtendedFeaturesProps extends Animatable {
|
|
122
122
|
items: ExtendedFeaturesItem[];
|
|
123
|
-
title?:
|
|
123
|
+
title?: TitleItemProps | string;
|
|
124
124
|
description?: string;
|
|
125
125
|
colSizes?: GridColumnSizesType;
|
|
126
126
|
}
|
|
@@ -132,7 +132,7 @@ export interface PromoFeaturesItem {
|
|
|
132
132
|
}
|
|
133
133
|
export interface PromoFeaturesProps extends Animatable {
|
|
134
134
|
items: PromoFeaturesItem[];
|
|
135
|
-
title?:
|
|
135
|
+
title?: TitleItemProps | string;
|
|
136
136
|
description?: string;
|
|
137
137
|
theme?: 'grey' | 'default';
|
|
138
138
|
}
|
|
@@ -207,14 +207,14 @@ export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSize
|
|
|
207
207
|
caption?: string;
|
|
208
208
|
media?: ThemedMediaProps;
|
|
209
209
|
}
|
|
210
|
-
export interface TabsBlockProps extends
|
|
210
|
+
export interface TabsBlockProps extends TitleProps, Animatable {
|
|
211
211
|
tabsColSizes?: GridColumnSizesType;
|
|
212
212
|
centered?: boolean;
|
|
213
213
|
direction?: MediaDirection;
|
|
214
214
|
items: TabsBlockItem[];
|
|
215
215
|
}
|
|
216
216
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
217
|
-
title:
|
|
217
|
+
title: TitleItemProps | string;
|
|
218
218
|
description?: string;
|
|
219
219
|
colSizes?: GridColumnSizesType;
|
|
220
220
|
}
|
|
@@ -227,7 +227,7 @@ export type FilterItem = {
|
|
|
227
227
|
card: SubBlockModels;
|
|
228
228
|
};
|
|
229
229
|
export interface FilterBlockProps extends Animatable, LoadableChildren {
|
|
230
|
-
title?:
|
|
230
|
+
title?: TitleItemProps | string;
|
|
231
231
|
description?: string;
|
|
232
232
|
tags: FilterTag[];
|
|
233
233
|
items: FilterItem[];
|
|
@@ -257,7 +257,7 @@ export interface ContentLayoutBlockProps {
|
|
|
257
257
|
fileContent?: FileLinkProps[];
|
|
258
258
|
}
|
|
259
259
|
export interface ContentBlockProps {
|
|
260
|
-
title?:
|
|
260
|
+
title?: TitleItemBaseProps | string;
|
|
261
261
|
text?: string;
|
|
262
262
|
additionalInfo?: string;
|
|
263
263
|
links?: LinkProps[];
|
|
@@ -249,11 +249,11 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
249
249
|
metrikaGoals?: MetrikaGoal;
|
|
250
250
|
pixelEvents?: ButtonPixel;
|
|
251
251
|
}
|
|
252
|
-
export interface
|
|
252
|
+
export interface TitleItemProps extends Justifyable, TitleItemBaseProps {
|
|
253
253
|
navTitle?: string;
|
|
254
254
|
anchor?: string;
|
|
255
255
|
}
|
|
256
|
-
export interface
|
|
256
|
+
export interface TitleItemBaseProps {
|
|
257
257
|
text: string;
|
|
258
258
|
textSize?: TextSize;
|
|
259
259
|
url?: string;
|
|
@@ -334,8 +334,8 @@ export interface AuthorProps {
|
|
|
334
334
|
type?: AuthorType;
|
|
335
335
|
dataQa?: string;
|
|
336
336
|
}
|
|
337
|
-
export interface
|
|
338
|
-
title?:
|
|
337
|
+
export interface TitleProps {
|
|
338
|
+
title?: TitleItemProps | string;
|
|
339
339
|
description?: string;
|
|
340
340
|
}
|
|
341
341
|
export {};
|
|
@@ -37,11 +37,11 @@ function getButtonSize(size) {
|
|
|
37
37
|
const Content = (props) => {
|
|
38
38
|
const { title, text, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, } = props;
|
|
39
39
|
const titleProps = tslib_1.__rest(!title || typeof title === 'string'
|
|
40
|
-
? { text: title, textSize: getTextSize(size) }
|
|
41
|
-
: title, []);
|
|
40
|
+
? { text: title, textSize: getTextSize(size), resetMargin: true }
|
|
41
|
+
: Object.assign(Object.assign({}, title), { resetMargin: true }), []);
|
|
42
42
|
const hasTitle = Boolean(title);
|
|
43
43
|
return (react_1.default.createElement(grid_1.Col, { className: b({ size, centered, theme }, className), reset: true, sizes: colSizes },
|
|
44
|
-
title && react_1.default.createElement(components_1.Title,
|
|
44
|
+
title && react_1.default.createElement(components_1.Title, { title: titleProps }),
|
|
45
45
|
text && (react_1.default.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
|
|
46
46
|
react_1.default.createElement(components_1.YFMWrapper, { content: text, modifiers: { constructor: true, [`constructor-size-${size}`]: true } }))),
|
|
47
47
|
additionalInfo && (react_1.default.createElement("div", { className: b('notice') },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { HubspotFormProps } from '../../models';
|
|
2
3
|
type HubspotFormContainerPropsKeys = 'className' | 'formId' | 'formInstanceId' | 'portalId' | 'region' | 'formClassName' | 'createDOMElement';
|
|
3
4
|
type HubspotFormContainerProps = Pick<HubspotFormProps, HubspotFormContainerPropsKeys>;
|
|
4
|
-
declare const HubspotFormContainer:
|
|
5
|
+
declare const HubspotFormContainer: React.ForwardRefExoticComponent<HubspotFormContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
6
|
export default HubspotFormContainer;
|
|
@@ -4,10 +4,12 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const hooks_1 = require("../../hooks");
|
|
6
6
|
const loadHubspotScript_1 = tslib_1.__importDefault(require("./loadHubspotScript"));
|
|
7
|
-
const HubspotFormContainer = (props) => {
|
|
7
|
+
const HubspotFormContainer = (0, react_1.forwardRef)((props, ref) => {
|
|
8
8
|
const { className, formId, formInstanceId, portalId, region, formClassName, createDOMElement, } = props;
|
|
9
9
|
const containerRef = (0, react_1.useRef)(null);
|
|
10
10
|
const hsContainerRef = (0, react_1.useRef)();
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
12
|
+
(0, react_1.useImperativeHandle)(ref, () => containerRef.current);
|
|
11
13
|
const containerId = formInstanceId
|
|
12
14
|
? `hubspot-form-${formId}-${formInstanceId}`
|
|
13
15
|
: `hubspot-form-${formId}`;
|
|
@@ -45,5 +47,6 @@ const HubspotFormContainer = (props) => {
|
|
|
45
47
|
};
|
|
46
48
|
});
|
|
47
49
|
return react_1.default.createElement("div", { className: className, id: containerId, ref: containerRef });
|
|
48
|
-
};
|
|
50
|
+
});
|
|
51
|
+
HubspotFormContainer.displayName = 'HubspotFormContainer';
|
|
49
52
|
exports.default = HubspotFormContainer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HubspotFormProps } from '../../models';
|
|
3
|
-
declare const HubspotForm: React.
|
|
3
|
+
declare const HubspotForm: React.ForwardRefExoticComponent<HubspotFormProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export default HubspotForm;
|
|
@@ -10,7 +10,7 @@ const models_1 = require("../../models");
|
|
|
10
10
|
const utils_1 = require("../../utils");
|
|
11
11
|
const HubspotFormContainer_1 = tslib_1.__importDefault(require("./HubspotFormContainer"));
|
|
12
12
|
const b = (0, utils_1.block)('hubspot-form');
|
|
13
|
-
const HubspotForm = (props) => {
|
|
13
|
+
const HubspotForm = (0, react_1.forwardRef)((props, ref) => {
|
|
14
14
|
const { className, theme: themeProp, isMobile: isMobileProp, formId, formInstanceId, portalId, region, formClassName, pixelEvents,
|
|
15
15
|
// hubspotEvents, // TODO: decide how to handle them
|
|
16
16
|
analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, createDOMElement, onSubmitError, } = props;
|
|
@@ -25,10 +25,10 @@ const HubspotForm = (props) => {
|
|
|
25
25
|
onBeforeSubmit,
|
|
26
26
|
onLoad,
|
|
27
27
|
onSubmitError,
|
|
28
|
-
onSubmit: (
|
|
28
|
+
onSubmit: (event) => {
|
|
29
29
|
handleMetrika === null || handleMetrika === void 0 ? void 0 : handleMetrika({ pixelEvents });
|
|
30
30
|
handleAnalytics(analyticsEvents);
|
|
31
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
31
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(event);
|
|
32
32
|
},
|
|
33
33
|
}), [
|
|
34
34
|
onBeforeLoad,
|
|
@@ -42,6 +42,7 @@ const HubspotForm = (props) => {
|
|
|
42
42
|
onSubmitError,
|
|
43
43
|
]);
|
|
44
44
|
(0, hooks_1.useHandleHubspotEvents)(handlers, formId);
|
|
45
|
-
return (react_1.default.createElement(HubspotFormContainer_1.default, { createDOMElement: createDOMElement, key: [formClassName, formId, formInstanceId, portalId, region].join(), className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region }));
|
|
46
|
-
};
|
|
45
|
+
return (react_1.default.createElement(HubspotFormContainer_1.default, { createDOMElement: createDOMElement, key: [formClassName, formId, formInstanceId, portalId, region].join(), className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region, ref: ref }));
|
|
46
|
+
});
|
|
47
|
+
HubspotForm.displayName = 'HubspotForm';
|
|
47
48
|
exports.default = HubspotForm;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TitleItemProps } from '../models';
|
|
2
2
|
import { Parser, Transformer, TransformerRaw, typografTransformer, yfmTransformer } from './common';
|
|
3
3
|
export declare const blockHeaderTransformer: ({
|
|
4
4
|
fields: string[];
|
|
5
5
|
transformer: typeof typografTransformer;
|
|
6
|
-
parser: (transformer: Transformer, title:
|
|
6
|
+
parser: (transformer: Transformer, title: TitleItemProps | string) => string | {
|
|
7
7
|
text: string;
|
|
8
8
|
navTitle?: string | undefined;
|
|
9
9
|
anchor?: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { AnimateBlock,
|
|
2
|
+
import { AnimateBlock, HTML, Title } from '../../components/';
|
|
3
3
|
import Image from '../../components/Image/Image';
|
|
4
4
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
5
5
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
@@ -16,7 +16,7 @@ const DEFAULT_SIZES = {
|
|
|
16
16
|
export const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DEFAULT_SIZES, animated, }) => {
|
|
17
17
|
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
18
18
|
return (React.createElement(AnimateBlock, { className: b(), animate: animated },
|
|
19
|
-
React.createElement(
|
|
19
|
+
React.createElement(Title, { title: title, description: description, className: b('header') }),
|
|
20
20
|
React.createElement("div", { className: b('items') },
|
|
21
21
|
React.createElement(Row, null, items.map(({ title: itemTitle, text, link, links, label, icon, buttons, additionalInfo, }) => {
|
|
22
22
|
const itemLinks = links || [];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
3
3
|
import BalancedMasonry from '../../components/BalancedMasonry/BalancedMasonry';
|
|
4
|
-
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
5
4
|
import FullWidthBackground from '../../components/FullWidthBackground/FullWidthBackground';
|
|
6
5
|
import Media from '../../components/Media/Media';
|
|
6
|
+
import Title from '../../components/Title/Title';
|
|
7
7
|
import YFMWrapper from '../../components/YFMWrapper/YFMWrapper';
|
|
8
8
|
import { BREAKPOINTS } from '../../constants';
|
|
9
9
|
import { block } from '../../utils';
|
|
@@ -19,7 +19,7 @@ const PromoFeaturesBlock = (props) => {
|
|
|
19
19
|
const backgroundTheme = theme || 'default';
|
|
20
20
|
return (React.createElement(AnimateBlock, { className: b({ [backgroundTheme]: true }), animate: animated },
|
|
21
21
|
React.createElement(FullWidthBackground, { className: b('background', { [backgroundTheme]: true }) }),
|
|
22
|
-
React.createElement(
|
|
22
|
+
React.createElement(Title, { title: title, description: description, className: b('header') }),
|
|
23
23
|
React.createElement(BalancedMasonry, { breakpointCols: breakpointColumns, className: b('card-container'), columnClassName: b('card-container-column') }, items.map(({ title: cardTitle, text, media, theme: cardTheme }, index) => {
|
|
24
24
|
const blockModifier = backgroundTheme === 'default' ? 'default' : 'light';
|
|
25
25
|
const themeMod = cardTheme || blockModifier || '';
|
|
@@ -3,8 +3,8 @@ import _ from 'lodash';
|
|
|
3
3
|
import SlickSlider from 'react-slick';
|
|
4
4
|
import Anchor from '../../components/Anchor/Anchor';
|
|
5
5
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
6
|
-
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
7
6
|
import OutsideClick from '../../components/OutsideClick/OutsideClick';
|
|
7
|
+
import Title from '../../components/Title/Title';
|
|
8
8
|
import { BREAKPOINTS } from '../../constants';
|
|
9
9
|
import { MobileContext } from '../../context/mobileContext';
|
|
10
10
|
import { SSRContext } from '../../context/ssrContext';
|
|
@@ -182,7 +182,7 @@ export const SliderBlock = (props) => {
|
|
|
182
182
|
type,
|
|
183
183
|
}, blockClassName) },
|
|
184
184
|
anchorId && React.createElement(Anchor, { id: anchorId }),
|
|
185
|
-
React.createElement(
|
|
185
|
+
React.createElement(Title, { title: title, description: description, className: b('header', { 'no-description': !description }) }),
|
|
186
186
|
React.createElement(AnimateBlock, { className: b('animate-slides'), animate: animated }, renderSlider()))));
|
|
187
187
|
};
|
|
188
188
|
// TODO remove this and rework PriceDetailed CLOUDFRONT-12230
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { Fragment, useContext, useRef, useState } from 'react';
|
|
2
2
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
3
|
-
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
4
3
|
import ButtonTabs from '../../components/ButtonTabs/ButtonTabs';
|
|
5
4
|
import FullScreenImage from '../../components/FullscreenImage/FullscreenImage';
|
|
6
5
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
7
6
|
import Media from '../../components/Media/Media';
|
|
7
|
+
import Title from '../../components/Title/Title';
|
|
8
8
|
import { getHeight } from '../../components/VideoBlock/VideoBlock';
|
|
9
9
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
10
10
|
import { Col, GridColumnOrderClasses, Row } from '../../grid';
|
|
@@ -51,7 +51,7 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
|
|
|
51
51
|
e.currentTarget.scrollIntoView({ inline: 'center', behavior: 'smooth', block: 'nearest' });
|
|
52
52
|
};
|
|
53
53
|
return (React.createElement(AnimateBlock, { className: b(), onScroll: () => setPlay(true), animate: animated },
|
|
54
|
-
React.createElement(
|
|
54
|
+
React.createElement(Title, { title: title, description: description, className: b('block-title', { centered: centered }) }),
|
|
55
55
|
React.createElement(Row, null,
|
|
56
56
|
React.createElement(Col, { sizes: tabsColSizes },
|
|
57
57
|
React.createElement(ButtonTabs, { items: tabs, onSelectTab: onSelectTab, activeTab: activeTab, className: b('tabs', { centered: centered }) }))),
|
|
@@ -3,7 +3,7 @@ import './Anchor.css';
|
|
|
3
3
|
export declare const qaIdByDefault = "qa-anchor";
|
|
4
4
|
export interface AnchorProps extends ClassNameProps {
|
|
5
5
|
id: string;
|
|
6
|
-
|
|
6
|
+
qa?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const Anchor: ({ id, className,
|
|
8
|
+
declare const Anchor: ({ id, className, qa }: AnchorProps) => JSX.Element;
|
|
9
9
|
export default Anchor;
|
|
@@ -4,5 +4,5 @@ import { block } from '../../utils';
|
|
|
4
4
|
import './Anchor.css';
|
|
5
5
|
const b = block('Anchor');
|
|
6
6
|
export const qaIdByDefault = 'qa-anchor';
|
|
7
|
-
const Anchor = ({ id, className,
|
|
7
|
+
const Anchor = ({ id, className, qa }) => (React.createElement("div", { id: id, className: b(null, className), "data-qa": qa || qaIdByDefault }));
|
|
8
8
|
export default Anchor;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
4
|
-
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
5
4
|
import { Col, Grid, GridColumnSize, Row } from '../../grid';
|
|
6
5
|
import { block } from '../../utils';
|
|
6
|
+
import Title from '../Title/Title';
|
|
7
7
|
import MediaContent from './MediaBaseContent';
|
|
8
8
|
import './MediaBase.css';
|
|
9
9
|
const b = block('media-base');
|
|
@@ -22,7 +22,7 @@ export const MediaBase = (props) => {
|
|
|
22
22
|
const mediaContent = !mediaOnly && React.createElement(MediaContent, Object.assign({}, mediaContentProps));
|
|
23
23
|
const card = children.type === Card ? children === null || children === void 0 ? void 0 : children.props.children : null;
|
|
24
24
|
return (React.createElement(AnimateBlock, { className: b(), onScroll: onScroll, animate: animated },
|
|
25
|
-
mediaOnly &&
|
|
25
|
+
mediaOnly && React.createElement(Title, { className: b('header'), title: title, description: description }),
|
|
26
26
|
React.createElement(Grid, null,
|
|
27
27
|
React.createElement(Row, { className: b('row', {
|
|
28
28
|
reverse: direction === 'media-content',
|
|
@@ -1,111 +1,16 @@
|
|
|
1
|
-
.pc-title-block_size_l, .pc-title-block_size_m, .pc-title-block_size_s, .pc-title-block_size_xs {
|
|
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
|
-
.pc-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
.pc-title-block_justify_end {
|
|
11
|
-
text-align: right;
|
|
3
|
+
.pc-title__description {
|
|
4
|
+
margin-top: 12px;
|
|
12
5
|
}
|
|
13
|
-
.pc-
|
|
6
|
+
.pc-title__description .yfm {
|
|
14
7
|
font-size: var(--yc-text-body-3-font-size);
|
|
15
8
|
line-height: var(--yc-text-body-3-line-height);
|
|
16
|
-
color: var(--pc-text-header-color);
|
|
17
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
18
|
-
}
|
|
19
|
-
.pc-title-block_size_s {
|
|
20
|
-
font-size: var(--yc-text-header-1-font-size);
|
|
21
|
-
line-height: var(--yc-text-header-1-line-height);
|
|
22
|
-
color: var(--pc-text-header-color);
|
|
23
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
24
|
-
margin-top: 32px;
|
|
25
|
-
}
|
|
26
|
-
.pc-title-block_size_m {
|
|
27
|
-
font-size: var(--yc-text-display-2-font-size);
|
|
28
|
-
line-height: var(--yc-text-display-2-line-height);
|
|
29
|
-
color: var(--pc-text-header-color);
|
|
30
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
31
|
-
margin-top: 48px;
|
|
32
|
-
}
|
|
33
|
-
@media (max-width: 576px) {
|
|
34
|
-
.pc-title-block_size_m {
|
|
35
|
-
font-size: var(--yc-text-display-1-font-size);
|
|
36
|
-
line-height: var(--yc-text-display-1-line-height);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
.pc-title-block_size_l {
|
|
40
|
-
font-size: var(--yc-text-display-4-font-size);
|
|
41
|
-
line-height: var(--yc-text-display-4-line-height);
|
|
42
|
-
color: var(--pc-text-header-color);
|
|
43
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
44
|
-
margin-top: 96px;
|
|
45
|
-
}
|
|
46
|
-
@media (max-width: 577px) {
|
|
47
|
-
.pc-title-block_size_l {
|
|
48
|
-
font-size: var(--yc-text-display-2-font-size);
|
|
49
|
-
line-height: var(--yc-text-display-2-line-height);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
.pc-title-block__arrow {
|
|
53
|
-
margin-top: 10px;
|
|
54
|
-
}
|
|
55
|
-
.pc-title-block__arrow_size_xs {
|
|
56
|
-
margin-top: 7px;
|
|
57
|
-
}
|
|
58
|
-
.pc-title-block__arrow_size_s {
|
|
59
|
-
margin-top: 5px;
|
|
60
|
-
}
|
|
61
|
-
.pc-title-block__link {
|
|
62
|
-
color: inherit;
|
|
63
|
-
text-decoration: none;
|
|
64
|
-
padding-right: 8px;
|
|
65
|
-
}
|
|
66
|
-
.pc-title-block__link:hover, .pc-title-block__link:active {
|
|
67
|
-
--pc-text-header-color: inherit;
|
|
68
|
-
color: inherit;
|
|
69
|
-
}
|
|
70
|
-
.pc-title-block__link:hover {
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
}
|
|
73
|
-
.pc-title-block__link:hover .pc-title-block__arrow {
|
|
74
|
-
margin-left: 10px;
|
|
75
|
-
}
|
|
76
|
-
.pc-title-block__link:hover .pc-title-block__arrow_size_xs {
|
|
77
|
-
margin-left: 6px;
|
|
78
|
-
}
|
|
79
|
-
.pc-title-block__link:hover .pc-title-block__arrow_size_s {
|
|
80
|
-
margin-left: 8px;
|
|
81
|
-
}
|
|
82
|
-
.pc-title-block__text {
|
|
83
|
-
white-space: normal;
|
|
84
|
-
}
|
|
85
|
-
.pc-title-block__text a {
|
|
86
|
-
outline: none;
|
|
87
|
-
color: var(--yc-color-text-link);
|
|
88
|
-
text-decoration: none;
|
|
89
|
-
cursor: pointer;
|
|
90
|
-
}
|
|
91
|
-
.utilityfocus .pc-title-block__text a:focus {
|
|
92
|
-
outline: 2px solid #ffdb4d;
|
|
93
|
-
}
|
|
94
|
-
.pc-title-block__text a:hover, .pc-title-block__text a:active {
|
|
95
|
-
--pc-text-header-color: var(--yc-color-text-link-hover);
|
|
96
|
-
color: var(--yc-color-text-link-hover);
|
|
97
|
-
}
|
|
98
|
-
.pc-title-block__wrapper {
|
|
99
|
-
white-space: nowrap;
|
|
100
9
|
}
|
|
101
|
-
.pc-
|
|
102
|
-
margin-top:
|
|
10
|
+
.pc-title__description_titleSize_s, .pc-title__description_titleSize_xs {
|
|
11
|
+
margin-top: 8px;
|
|
103
12
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
.pc-title-block__arrow_size_m, .pc-title-block__arrow_size_l {
|
|
109
|
-
margin-top: 9px;
|
|
110
|
-
}
|
|
13
|
+
.pc-title__description_titleSize_s .yfm, .pc-title__description_titleSize_xs .yfm {
|
|
14
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
15
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
111
16
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GridColumnSizesType } from '../../grid';
|
|
2
|
+
import { ClassNameProps, TitleProps as TitleParams } from '../../models';
|
|
2
3
|
import './Title.css';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
className?: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
dataQa?: string;
|
|
8
|
-
resetMargin?: boolean;
|
|
4
|
+
export interface TitleProps extends TitleParams {
|
|
5
|
+
colSizes?: GridColumnSizesType;
|
|
9
6
|
}
|
|
10
|
-
declare const Title: (
|
|
7
|
+
declare const Title: ({ title, description, className, colSizes, }: TitleProps & ClassNameProps) => JSX.Element | null;
|
|
11
8
|
export default Title;
|
|
@@ -1,53 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Col } from '../../grid';
|
|
4
|
+
import { block } from '../../utils';
|
|
5
|
+
import YFMWrapper from '../YFMWrapper/YFMWrapper';
|
|
6
|
+
import TitleItem from './TitleItem';
|
|
7
7
|
import './Title.css';
|
|
8
|
-
const b = block('title
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return 13;
|
|
13
|
-
case 's':
|
|
14
|
-
return 16;
|
|
15
|
-
case 'm':
|
|
16
|
-
return isMobile ? 22 : 24;
|
|
17
|
-
case 'l':
|
|
18
|
-
return isMobile ? 26 : 38;
|
|
19
|
-
default:
|
|
20
|
-
return 20;
|
|
8
|
+
const b = block('title');
|
|
9
|
+
const Title = ({ title, description, className, colSizes = { all: 12, sm: 8 }, }) => {
|
|
10
|
+
if (!title && !description) {
|
|
11
|
+
return null;
|
|
21
12
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
custom && (React.createElement(React.Fragment, null,
|
|
30
|
-
"\u00A0",
|
|
31
|
-
React.createElement("span", { className: b('custom') }, custom)))));
|
|
32
|
-
let content;
|
|
33
|
-
const insideClickableContent = (React.createElement("span", { className: b('wrapper') },
|
|
34
|
-
textMarkup,
|
|
35
|
-
"\u00A0",
|
|
36
|
-
React.createElement(ToggleArrow, { className: b('arrow', { size: textSize }), size: getArrowSize(textSize, isMobile), type: 'horizontal', iconType: "navigation", open: false })));
|
|
37
|
-
if (!url && !onClick) {
|
|
38
|
-
content = textMarkup;
|
|
39
|
-
}
|
|
40
|
-
else if (url) {
|
|
41
|
-
content = (React.createElement("a", Object.assign({ className: b('link'), href: url }, getLinkProps(url, hostname), { onClick: onClick }), insideClickableContent));
|
|
42
|
-
}
|
|
43
|
-
else if (onClick) {
|
|
44
|
-
content = (React.createElement("span", { className: b('link'), onClick: onClick }, insideClickableContent));
|
|
45
|
-
}
|
|
46
|
-
return (React.createElement(Fragment, null,
|
|
47
|
-
anchor && React.createElement(Anchor, { id: anchor, className: b('anchor') }),
|
|
48
|
-
React.createElement(getHeaderTag(textSize), {
|
|
49
|
-
className: b({ size: textSize, justify, 'reset-margin': resetMargin }, className),
|
|
50
|
-
'data-qa': `${dataQa}-header`,
|
|
51
|
-
}, content)));
|
|
13
|
+
const _a = !title || typeof title === 'string' ? { text: title } : title, { text } = _a, titleProps = __rest(_a, ["text"]);
|
|
14
|
+
return (React.createElement("div", { className: b(null, className) },
|
|
15
|
+
text && (React.createElement(Col, { reset: true, sizes: colSizes },
|
|
16
|
+
React.createElement(TitleItem, Object.assign({ text: text }, titleProps)))),
|
|
17
|
+
description && (React.createElement(Col, { reset: true, sizes: colSizes },
|
|
18
|
+
React.createElement("div", { className: b('description', { titleSize: titleProps === null || titleProps === void 0 ? void 0 : titleProps.textSize }) },
|
|
19
|
+
React.createElement(YFMWrapper, { content: description, modifiers: { constructor: true } }))))));
|
|
52
20
|
};
|
|
53
21
|
export default Title;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.pc-title-item_size_l, .pc-title-item_size_m, .pc-title-item_size_s, .pc-title-item_size_xs {
|
|
2
|
+
margin: 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* use this for style redefinitions to awoid problems with
|
|
6
|
+
unpredictable css rules order in build */
|
|
7
|
+
.pc-title-item_justify_center {
|
|
8
|
+
text-align: center;
|
|
9
|
+
}
|
|
10
|
+
.pc-title-item_justify_end {
|
|
11
|
+
text-align: right;
|
|
12
|
+
}
|
|
13
|
+
.pc-title-item_size_xs {
|
|
14
|
+
font-size: var(--yc-text-body-3-font-size);
|
|
15
|
+
line-height: var(--yc-text-body-3-line-height);
|
|
16
|
+
color: var(--pc-text-header-color);
|
|
17
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
18
|
+
}
|
|
19
|
+
.pc-title-item_size_s {
|
|
20
|
+
font-size: var(--yc-text-header-1-font-size);
|
|
21
|
+
line-height: var(--yc-text-header-1-line-height);
|
|
22
|
+
color: var(--pc-text-header-color);
|
|
23
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
24
|
+
margin-top: 32px;
|
|
25
|
+
}
|
|
26
|
+
.pc-title-item_size_m {
|
|
27
|
+
font-size: var(--yc-text-display-2-font-size);
|
|
28
|
+
line-height: var(--yc-text-display-2-line-height);
|
|
29
|
+
color: var(--pc-text-header-color);
|
|
30
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
31
|
+
margin-top: 48px;
|
|
32
|
+
}
|
|
33
|
+
@media (max-width: 576px) {
|
|
34
|
+
.pc-title-item_size_m {
|
|
35
|
+
font-size: var(--yc-text-display-1-font-size);
|
|
36
|
+
line-height: var(--yc-text-display-1-line-height);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
.pc-title-item_size_l {
|
|
40
|
+
font-size: var(--yc-text-display-4-font-size);
|
|
41
|
+
line-height: var(--yc-text-display-4-line-height);
|
|
42
|
+
color: var(--pc-text-header-color);
|
|
43
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
44
|
+
margin-top: 96px;
|
|
45
|
+
}
|
|
46
|
+
@media (max-width: 577px) {
|
|
47
|
+
.pc-title-item_size_l {
|
|
48
|
+
font-size: var(--yc-text-display-2-font-size);
|
|
49
|
+
line-height: var(--yc-text-display-2-line-height);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
.pc-title-item__arrow {
|
|
53
|
+
margin-top: 10px;
|
|
54
|
+
}
|
|
55
|
+
.pc-title-item__arrow_size_xs {
|
|
56
|
+
margin-top: 7px;
|
|
57
|
+
}
|
|
58
|
+
.pc-title-item__arrow_size_s {
|
|
59
|
+
margin-top: 5px;
|
|
60
|
+
}
|
|
61
|
+
.pc-title-item__link {
|
|
62
|
+
color: inherit;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
padding-right: 8px;
|
|
65
|
+
}
|
|
66
|
+
.pc-title-item__link:hover, .pc-title-item__link:active {
|
|
67
|
+
--pc-text-header-color: inherit;
|
|
68
|
+
color: inherit;
|
|
69
|
+
}
|
|
70
|
+
.pc-title-item__link:hover {
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
.pc-title-item__link:hover .pc-title-item__arrow {
|
|
74
|
+
margin-left: 10px;
|
|
75
|
+
}
|
|
76
|
+
.pc-title-item__link:hover .pc-title-item__arrow_size_xs {
|
|
77
|
+
margin-left: 6px;
|
|
78
|
+
}
|
|
79
|
+
.pc-title-item__link:hover .pc-title-item__arrow_size_s {
|
|
80
|
+
margin-left: 8px;
|
|
81
|
+
}
|
|
82
|
+
.pc-title-item__text {
|
|
83
|
+
white-space: normal;
|
|
84
|
+
}
|
|
85
|
+
.pc-title-item__text a {
|
|
86
|
+
outline: none;
|
|
87
|
+
color: var(--yc-color-text-link);
|
|
88
|
+
text-decoration: none;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
}
|
|
91
|
+
.utilityfocus .pc-title-item__text a:focus {
|
|
92
|
+
outline: 2px solid #ffdb4d;
|
|
93
|
+
}
|
|
94
|
+
.pc-title-item__text a:hover, .pc-title-item__text a:active {
|
|
95
|
+
--pc-text-header-color: var(--yc-color-text-link-hover);
|
|
96
|
+
color: var(--yc-color-text-link-hover);
|
|
97
|
+
}
|
|
98
|
+
.pc-title-item__wrapper {
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
}
|
|
101
|
+
.pc-title-item_reset-margin {
|
|
102
|
+
margin-top: 0;
|
|
103
|
+
}
|
|
104
|
+
@media (max-width: 577px) {
|
|
105
|
+
.pc-title-item_size_l:not(.pc-title-item_reset-margin) {
|
|
106
|
+
margin-top: 48px;
|
|
107
|
+
}
|
|
108
|
+
.pc-title-item__arrow_size_m, .pc-title-item__arrow_size_l {
|
|
109
|
+
margin-top: 9px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TextSize, TitleItemProps } from '../../models';
|
|
2
|
+
import './TitleItem.css';
|
|
3
|
+
export declare function getArrowSize(size: TextSize, isMobile: boolean): 16 | 24 | 13 | 22 | 26 | 38 | 20;
|
|
4
|
+
export interface TitleItemFullProps extends TitleItemProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
dataQa?: string;
|
|
8
|
+
resetMargin?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Title: (props: TitleItemFullProps) => JSX.Element;
|
|
11
|
+
export default Title;
|