@gravity-ui/page-constructor 1.12.0 → 1.12.1-alpha.1
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 +9 -1
- package/build/cjs/blocks/CardLayout/schema.d.ts +22 -24
- package/build/cjs/blocks/CardLayout/schema.js +1 -6
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +16 -17
- package/build/cjs/blocks/ExtendedFeatures/schema.js +1 -6
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -25
- package/build/cjs/blocks/LinkTable/schema.d.ts +29 -21
- package/build/cjs/blocks/LinkTable/schema.js +1 -1
- package/build/cjs/blocks/Media/schema.js +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +14 -15
- package/build/cjs/blocks/PromoFeaturesBlock/schema.js +1 -6
- package/build/cjs/blocks/Slider/Slider.d.ts +1 -6
- package/build/cjs/blocks/Slider/schema.d.ts +28 -49
- package/build/cjs/blocks/Slider/schema.js +1 -6
- package/build/cjs/blocks/Tabs/schema.d.ts +29 -25
- package/build/cjs/blocks/Tabs/schema.js +1 -4
- package/build/cjs/components/Author/Author.js +2 -2
- package/build/cjs/components/Author/__tests__/Author.test.d.ts +1 -0
- package/build/cjs/components/Author/__tests__/Author.test.js +49 -0
- package/build/cjs/components/BlockHeader/BlockHeader.css +8 -19
- package/build/cjs/components/BlockHeader/BlockHeader.js +4 -3
- package/build/cjs/grid/Grid/Grid.css +16 -16
- package/build/cjs/models/constructor-items/common.d.ts +1 -0
- package/build/cjs/navigation/components/Header/Header.css +5 -3
- package/build/cjs/navigation/components/Logo/Logo.css +5 -6
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +1 -0
- package/build/cjs/schema/validators/common.d.ts +31 -0
- package/build/cjs/schema/validators/common.js +10 -1
- package/build/cjs/sub-blocks/CardWithImage/schema.js +1 -1
- package/build/cjs/text-transform/blocks.js +44 -54
- package/build/esm/blocks/CardLayout/schema.d.ts +22 -24
- package/build/esm/blocks/CardLayout/schema.js +2 -7
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +16 -17
- package/build/esm/blocks/ExtendedFeatures/schema.js +2 -7
- package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -25
- package/build/esm/blocks/LinkTable/schema.d.ts +29 -21
- package/build/esm/blocks/LinkTable/schema.js +2 -2
- package/build/esm/blocks/Media/schema.js +1 -1
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +14 -15
- package/build/esm/blocks/PromoFeaturesBlock/schema.js +2 -7
- package/build/esm/blocks/Slider/Slider.d.ts +1 -6
- package/build/esm/blocks/Slider/schema.d.ts +28 -49
- package/build/esm/blocks/Slider/schema.js +2 -7
- package/build/esm/blocks/Tabs/schema.d.ts +29 -25
- package/build/esm/blocks/Tabs/schema.js +2 -5
- package/build/esm/components/Author/Author.js +2 -2
- package/build/esm/components/Author/__tests__/Author.test.d.ts +1 -0
- package/build/esm/components/Author/__tests__/Author.test.js +46 -0
- package/build/esm/components/BlockHeader/BlockHeader.css +8 -19
- package/build/esm/components/BlockHeader/BlockHeader.js +5 -4
- package/build/esm/grid/Grid/Grid.css +16 -16
- package/build/esm/models/constructor-items/common.d.ts +1 -0
- package/build/esm/navigation/components/Header/Header.css +5 -3
- package/build/esm/navigation/components/Logo/Logo.css +5 -6
- package/build/esm/navigation/components/NavigationItem/NavigationItem.css +1 -0
- package/build/esm/schema/validators/common.d.ts +31 -0
- package/build/esm/schema/validators/common.js +9 -0
- package/build/esm/sub-blocks/CardWithImage/schema.js +1 -1
- package/build/esm/text-transform/blocks.js +44 -54
- package/package.json +2 -3
- package/server/models/constructor-items/common.d.ts +1 -0
- package/server/text-transform/blocks.js +44 -54
|
@@ -3,27 +3,6 @@ export declare const LinkTableBlock: {
|
|
|
3
3
|
additionalProperties: boolean;
|
|
4
4
|
required: string[];
|
|
5
5
|
properties: {
|
|
6
|
-
title: {
|
|
7
|
-
type: string;
|
|
8
|
-
additionalProperties: boolean;
|
|
9
|
-
required: string[];
|
|
10
|
-
properties: {
|
|
11
|
-
text: {
|
|
12
|
-
type: string;
|
|
13
|
-
contentType: string;
|
|
14
|
-
};
|
|
15
|
-
textSize: {
|
|
16
|
-
type: string;
|
|
17
|
-
enum: string[];
|
|
18
|
-
};
|
|
19
|
-
url: {
|
|
20
|
-
type: string;
|
|
21
|
-
};
|
|
22
|
-
resetMargin: {
|
|
23
|
-
type: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
6
|
items: {
|
|
28
7
|
type: string;
|
|
29
8
|
items: {
|
|
@@ -38,6 +17,35 @@ export declare const LinkTableBlock: {
|
|
|
38
17
|
};
|
|
39
18
|
};
|
|
40
19
|
};
|
|
20
|
+
title: {
|
|
21
|
+
oneOf: ({
|
|
22
|
+
type: string;
|
|
23
|
+
additionalProperties: boolean;
|
|
24
|
+
required: string[];
|
|
25
|
+
properties: {
|
|
26
|
+
text: {
|
|
27
|
+
type: string;
|
|
28
|
+
contentType: string;
|
|
29
|
+
};
|
|
30
|
+
textSize: {
|
|
31
|
+
type: string;
|
|
32
|
+
enum: string[];
|
|
33
|
+
};
|
|
34
|
+
url: {
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
resetMargin: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
42
|
+
type: string;
|
|
43
|
+
})[];
|
|
44
|
+
};
|
|
45
|
+
description: {
|
|
46
|
+
type: string;
|
|
47
|
+
contentType: string;
|
|
48
|
+
};
|
|
41
49
|
anchor: {
|
|
42
50
|
type: string;
|
|
43
51
|
additionalProperties: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { filteredArray } from '../../schema/validators/utils';
|
|
2
|
-
import { LinkProps, BlockBaseProps,
|
|
2
|
+
import { LinkProps, BlockBaseProps, BlockHeaderProps } from '../../schema/validators/common';
|
|
3
3
|
export const LinkTableBlock = {
|
|
4
4
|
'link-table-block': {
|
|
5
5
|
additionalProperties: false,
|
|
6
6
|
required: ['items'],
|
|
7
|
-
properties: Object.assign(Object.assign({}, BlockBaseProps), {
|
|
7
|
+
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlockHeaderProps), { items: {
|
|
8
8
|
type: 'array',
|
|
9
9
|
items: filteredArray(LinkProps),
|
|
10
10
|
} }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { omit } from 'lodash';
|
|
2
2
|
import { BlockBaseProps, ButtonBlock, MediaProps, AnimatableProps, mediaDirection, } from '../../schema/validators/common';
|
|
3
|
-
import { ContentBase } from '
|
|
3
|
+
import { ContentBase } from '../../sub-blocks/Content/schema';
|
|
4
4
|
export const Media = {
|
|
5
5
|
type: 'object',
|
|
6
6
|
additionalProperties: false,
|
|
@@ -155,6 +155,20 @@ export declare const PromoFeaturesBlock: {
|
|
|
155
155
|
additionalProperties: boolean;
|
|
156
156
|
required: string[];
|
|
157
157
|
properties: {
|
|
158
|
+
theme: {
|
|
159
|
+
enum: string[];
|
|
160
|
+
};
|
|
161
|
+
items: {
|
|
162
|
+
type: string;
|
|
163
|
+
items: {
|
|
164
|
+
type: string;
|
|
165
|
+
properties: {
|
|
166
|
+
when: {
|
|
167
|
+
type: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
158
172
|
title: {
|
|
159
173
|
oneOf: ({
|
|
160
174
|
type: string;
|
|
@@ -178,27 +192,12 @@ export declare const PromoFeaturesBlock: {
|
|
|
178
192
|
};
|
|
179
193
|
} | {
|
|
180
194
|
type: string;
|
|
181
|
-
contentType: string;
|
|
182
195
|
})[];
|
|
183
196
|
};
|
|
184
197
|
description: {
|
|
185
198
|
type: string;
|
|
186
199
|
contentType: string;
|
|
187
200
|
};
|
|
188
|
-
theme: {
|
|
189
|
-
enum: string[];
|
|
190
|
-
};
|
|
191
|
-
items: {
|
|
192
|
-
type: string;
|
|
193
|
-
items: {
|
|
194
|
-
type: string;
|
|
195
|
-
properties: {
|
|
196
|
-
when: {
|
|
197
|
-
type: string;
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
201
|
animated: {
|
|
203
202
|
type: string;
|
|
204
203
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimatableProps, BlockBaseProps,
|
|
1
|
+
import { AnimatableProps, BlockBaseProps, BlockHeaderProps } from '../../schema/validators/common';
|
|
2
2
|
import { filteredArray } from '../../schema/validators/utils';
|
|
3
3
|
import { Media } from '../Media/schema';
|
|
4
4
|
export const PromoFeaturesItem = {
|
|
@@ -23,12 +23,7 @@ export const PromoFeaturesBlock = {
|
|
|
23
23
|
'promo-features-block': {
|
|
24
24
|
additionalProperties: false,
|
|
25
25
|
required: ['items'],
|
|
26
|
-
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), {
|
|
27
|
-
oneOf: [{ type: 'string', contentType: 'text' }, TitleProps],
|
|
28
|
-
}, description: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
contentType: 'text',
|
|
31
|
-
}, theme: {
|
|
26
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), BlockHeaderProps), { theme: {
|
|
32
27
|
enum: ['grey', 'default'],
|
|
33
28
|
}, items: filteredArray(PromoFeaturesItem) }),
|
|
34
29
|
},
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Settings } from 'react-slick';
|
|
2
2
|
import { Refable, SliderProps as SliderParams, ClassNameProps, WithChildren } from '../../models';
|
|
3
3
|
import './slick.css';
|
|
4
4
|
import './Slider.css';
|
|
5
|
-
export interface SlickSliderFull extends SlickSlider {
|
|
6
|
-
innerSlider?: {
|
|
7
|
-
list: HTMLElement;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
5
|
export interface SliderProps extends Omit<SliderParams, 'children'>, Refable<HTMLDivElement>, ClassNameProps, Pick<Settings, 'lazyLoad'> {
|
|
11
6
|
type?: string;
|
|
12
7
|
anchorId?: string;
|
|
@@ -5,31 +5,6 @@ export declare const SliderProps: {
|
|
|
5
5
|
arrows: {
|
|
6
6
|
type: string;
|
|
7
7
|
};
|
|
8
|
-
description: {
|
|
9
|
-
type: string;
|
|
10
|
-
contentType: string;
|
|
11
|
-
};
|
|
12
|
-
title: {
|
|
13
|
-
type: string;
|
|
14
|
-
additionalProperties: boolean;
|
|
15
|
-
required: string[];
|
|
16
|
-
properties: {
|
|
17
|
-
text: {
|
|
18
|
-
type: string;
|
|
19
|
-
contentType: string;
|
|
20
|
-
};
|
|
21
|
-
textSize: {
|
|
22
|
-
type: string;
|
|
23
|
-
enum: string[];
|
|
24
|
-
};
|
|
25
|
-
url: {
|
|
26
|
-
type: string;
|
|
27
|
-
};
|
|
28
|
-
resetMargin: {
|
|
29
|
-
type: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
8
|
randomOrder: {
|
|
34
9
|
type: string;
|
|
35
10
|
};
|
|
@@ -108,36 +83,40 @@ export declare const SliderBlock: {
|
|
|
108
83
|
additionalProperties: boolean;
|
|
109
84
|
required: never[];
|
|
110
85
|
properties: {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
86
|
+
title: {
|
|
87
|
+
oneOf: ({
|
|
88
|
+
type: string;
|
|
89
|
+
additionalProperties: boolean;
|
|
90
|
+
required: string[];
|
|
91
|
+
properties: {
|
|
92
|
+
text: {
|
|
93
|
+
type: string;
|
|
94
|
+
contentType: string;
|
|
95
|
+
};
|
|
96
|
+
textSize: {
|
|
97
|
+
type: string;
|
|
98
|
+
enum: string[];
|
|
99
|
+
};
|
|
100
|
+
url: {
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
resetMargin: {
|
|
104
|
+
type: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
} | {
|
|
108
|
+
type: string;
|
|
109
|
+
})[];
|
|
116
110
|
};
|
|
117
111
|
description: {
|
|
118
112
|
type: string;
|
|
119
113
|
contentType: string;
|
|
120
114
|
};
|
|
121
|
-
|
|
115
|
+
dots: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
arrows: {
|
|
122
119
|
type: string;
|
|
123
|
-
additionalProperties: boolean;
|
|
124
|
-
required: string[];
|
|
125
|
-
properties: {
|
|
126
|
-
text: {
|
|
127
|
-
type: string;
|
|
128
|
-
contentType: string;
|
|
129
|
-
};
|
|
130
|
-
textSize: {
|
|
131
|
-
type: string;
|
|
132
|
-
enum: string[];
|
|
133
|
-
};
|
|
134
|
-
url: {
|
|
135
|
-
type: string;
|
|
136
|
-
};
|
|
137
|
-
resetMargin: {
|
|
138
|
-
type: string;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
120
|
};
|
|
142
121
|
randomOrder: {
|
|
143
122
|
type: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockBaseProps,
|
|
1
|
+
import { BlockBaseProps, AnimatableProps, ChildrenCardsProps, sliderSizesObject, textSize, BlockHeaderProps, } from '../../schema/validators/common';
|
|
2
2
|
const LoadableProps = {
|
|
3
3
|
additionalProperties: false,
|
|
4
4
|
required: ['source'],
|
|
@@ -48,11 +48,6 @@ export const SliderProps = {
|
|
|
48
48
|
arrows: {
|
|
49
49
|
type: 'boolean',
|
|
50
50
|
},
|
|
51
|
-
description: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
contentType: 'text',
|
|
54
|
-
},
|
|
55
|
-
title: TitleProps,
|
|
56
51
|
randomOrder: {
|
|
57
52
|
type: 'boolean',
|
|
58
53
|
},
|
|
@@ -69,6 +64,6 @@ export const SliderBlock = {
|
|
|
69
64
|
'slider-block': {
|
|
70
65
|
additionalProperties: false,
|
|
71
66
|
required: [],
|
|
72
|
-
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), SliderProps),
|
|
67
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), SliderProps), BlockHeaderProps),
|
|
73
68
|
},
|
|
74
69
|
};
|
|
@@ -272,31 +272,6 @@ export declare const TabsBlock: {
|
|
|
272
272
|
additionalProperties: boolean;
|
|
273
273
|
required: string[];
|
|
274
274
|
properties: {
|
|
275
|
-
title: {
|
|
276
|
-
type: string;
|
|
277
|
-
additionalProperties: boolean;
|
|
278
|
-
required: string[];
|
|
279
|
-
properties: {
|
|
280
|
-
text: {
|
|
281
|
-
type: string;
|
|
282
|
-
contentType: string;
|
|
283
|
-
};
|
|
284
|
-
textSize: {
|
|
285
|
-
type: string;
|
|
286
|
-
enum: string[];
|
|
287
|
-
};
|
|
288
|
-
url: {
|
|
289
|
-
type: string;
|
|
290
|
-
};
|
|
291
|
-
resetMargin: {
|
|
292
|
-
type: string;
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
description: {
|
|
297
|
-
type: string;
|
|
298
|
-
contentType: string;
|
|
299
|
-
};
|
|
300
275
|
tabsColSizes: {};
|
|
301
276
|
direction: {
|
|
302
277
|
type: string;
|
|
@@ -316,6 +291,35 @@ export declare const TabsBlock: {
|
|
|
316
291
|
};
|
|
317
292
|
};
|
|
318
293
|
};
|
|
294
|
+
title: {
|
|
295
|
+
oneOf: ({
|
|
296
|
+
type: string;
|
|
297
|
+
additionalProperties: boolean;
|
|
298
|
+
required: string[];
|
|
299
|
+
properties: {
|
|
300
|
+
text: {
|
|
301
|
+
type: string;
|
|
302
|
+
contentType: string;
|
|
303
|
+
};
|
|
304
|
+
textSize: {
|
|
305
|
+
type: string;
|
|
306
|
+
enum: string[];
|
|
307
|
+
};
|
|
308
|
+
url: {
|
|
309
|
+
type: string;
|
|
310
|
+
};
|
|
311
|
+
resetMargin: {
|
|
312
|
+
type: string;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
} | {
|
|
316
|
+
type: string;
|
|
317
|
+
})[];
|
|
318
|
+
};
|
|
319
|
+
description: {
|
|
320
|
+
type: string;
|
|
321
|
+
contentType: string;
|
|
322
|
+
};
|
|
319
323
|
anchor: {
|
|
320
324
|
type: string;
|
|
321
325
|
additionalProperties: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { filteredArray } from '../../schema/validators/utils';
|
|
2
|
-
import { LinkProps, withTheme, BlockBaseProps,
|
|
2
|
+
import { LinkProps, withTheme, BlockBaseProps, BlockHeaderProps, MediaProps, containerSizesArray, sizeNumber, mediaDirection, } from '../../schema/validators/common';
|
|
3
3
|
import { ImageProps } from '../../components/Image/schema';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import { ContentBase } from '../../sub-blocks/Content/schema';
|
|
@@ -24,10 +24,7 @@ export const TabsBlock = {
|
|
|
24
24
|
'tabs-block': {
|
|
25
25
|
additionalProperties: false,
|
|
26
26
|
required: ['title', 'items'],
|
|
27
|
-
properties: Object.assign(Object.assign({}, BlockBaseProps), {
|
|
28
|
-
type: 'string',
|
|
29
|
-
contentType: 'text',
|
|
30
|
-
}, tabsColSizes: containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: sizeNumber })), {}), direction: {
|
|
27
|
+
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlockHeaderProps), { tabsColSizes: containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: sizeNumber })), {}), direction: {
|
|
31
28
|
type: 'string',
|
|
32
29
|
enum: mediaDirection,
|
|
33
30
|
}, centered: { type: 'boolean' }, items: filteredArray(tabsItem) }),
|
|
@@ -5,10 +5,10 @@ import { block } from '../../utils';
|
|
|
5
5
|
import './Author.css';
|
|
6
6
|
const b = block('author');
|
|
7
7
|
const Author = (props) => {
|
|
8
|
-
const { author, className, authorContainerClassName, type = AuthorType.Column } = props;
|
|
8
|
+
const { author, className, authorContainerClassName, type = AuthorType.Column, dataQa } = props;
|
|
9
9
|
const { firstName, secondName, description, avatar } = author;
|
|
10
10
|
const name = secondName ? `${firstName} ${secondName}` : firstName;
|
|
11
|
-
return (React.createElement("div", { className: b({ type }, className) },
|
|
11
|
+
return (React.createElement("div", { className: b({ type }, className), "data-qa": dataQa },
|
|
12
12
|
avatar && (React.createElement("div", { className: b('avatar', authorContainerClassName) }, typeof avatar === 'string' ? React.createElement(Image, { src: avatar }) : avatar)),
|
|
13
13
|
React.createElement("div", { className: b('label') },
|
|
14
14
|
React.createElement("div", { className: b('name') }, name),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { AuthorType } from '../../../models';
|
|
4
|
+
import Author from '../Author';
|
|
5
|
+
const testId = 'author';
|
|
6
|
+
const author = {
|
|
7
|
+
firstName: 'John',
|
|
8
|
+
secondName: 'Doe',
|
|
9
|
+
description: 'Web designer',
|
|
10
|
+
avatar: 'https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-gray.png',
|
|
11
|
+
};
|
|
12
|
+
describe('Author', () => {
|
|
13
|
+
test('Render author by default', async () => {
|
|
14
|
+
render(React.createElement(Author, { author: author, dataQa: testId }));
|
|
15
|
+
const object = screen.getByTestId(testId);
|
|
16
|
+
expect(object).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
test('Has full name', async () => {
|
|
19
|
+
const name = `${author.firstName} ${author.secondName}`;
|
|
20
|
+
render(React.createElement(Author, { author: author, dataQa: testId }));
|
|
21
|
+
const object = screen.getByText(name);
|
|
22
|
+
expect(object).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
test('Has first name only', async () => {
|
|
25
|
+
const name = author.firstName;
|
|
26
|
+
render(React.createElement(Author, { author: Object.assign(Object.assign({}, author), { secondName: '' }), dataQa: testId }));
|
|
27
|
+
const object = screen.getByText(name);
|
|
28
|
+
expect(object).toBeInTheDocument();
|
|
29
|
+
});
|
|
30
|
+
test('Has avatar', async () => {
|
|
31
|
+
render(React.createElement(Author, { author: author, dataQa: testId }));
|
|
32
|
+
const avatar = screen.getByRole('img');
|
|
33
|
+
expect(avatar).toBeInTheDocument();
|
|
34
|
+
expect(avatar).toHaveAttribute('src', author.avatar);
|
|
35
|
+
});
|
|
36
|
+
test('Has description', async () => {
|
|
37
|
+
render(React.createElement(Author, { author: author, dataQa: testId }));
|
|
38
|
+
const object = screen.getByText(author.description);
|
|
39
|
+
expect(object).toBeInTheDocument();
|
|
40
|
+
});
|
|
41
|
+
test.each(new Array(AuthorType.Column, AuthorType.Line))('Render with given "%s" type', (type) => {
|
|
42
|
+
render(React.createElement(Author, { author: author, dataQa: testId, type: type }));
|
|
43
|
+
const object = screen.getByTestId(testId);
|
|
44
|
+
expect(object).toHaveClass(`pc-author_type_${type}`);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-
|
|
4
|
-
|
|
5
|
-
line-height: var(--yc-text-body-2-line-height);
|
|
6
|
-
margin-top: 16px;
|
|
7
|
-
}
|
|
8
|
-
.pc-BlockHeader__description_titleSize_s {
|
|
9
|
-
margin-top: 8px;
|
|
3
|
+
.pc-block-header__description {
|
|
4
|
+
margin-top: 12px;
|
|
10
5
|
}
|
|
11
|
-
.pc-
|
|
6
|
+
.pc-block-header__description .yfm {
|
|
12
7
|
font-size: var(--yc-text-body-3-font-size);
|
|
13
8
|
line-height: var(--yc-text-body-3-line-height);
|
|
14
9
|
}
|
|
15
|
-
.pc-
|
|
16
|
-
|
|
17
|
-
color: var(--yc-color-text-link);
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
}
|
|
21
|
-
.utilityfocus .pc-BlockHeader__description a:focus {
|
|
22
|
-
outline: 2px solid #ffdb4d;
|
|
10
|
+
.pc-block-header__description_titleSize_s {
|
|
11
|
+
margin-top: 8px;
|
|
23
12
|
}
|
|
24
|
-
.pc-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
.pc-block-header__description_titleSize_s .yfm {
|
|
14
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
15
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
27
16
|
}
|
|
@@ -2,9 +2,10 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { block } from '../../utils';
|
|
4
4
|
import { Col } from '../../grid';
|
|
5
|
-
import { Title
|
|
5
|
+
import { Title } from '../';
|
|
6
|
+
import YFMWrapper from '../YFMWrapper/YFMWrapper';
|
|
6
7
|
import './BlockHeader.css';
|
|
7
|
-
const b = block('
|
|
8
|
+
const b = block('block-header');
|
|
8
9
|
const BlockHeader = ({ title, description, className, colSizes = { all: 12, sm: 8 }, }) => {
|
|
9
10
|
if (!title && !description) {
|
|
10
11
|
return null;
|
|
@@ -13,8 +14,8 @@ const BlockHeader = ({ title, description, className, colSizes = { all: 12, sm:
|
|
|
13
14
|
return (React.createElement("div", { className: b(null, className) },
|
|
14
15
|
text && (React.createElement(Col, { reset: true, sizes: colSizes },
|
|
15
16
|
React.createElement(Title, Object.assign({ text: text }, titleProps)))),
|
|
16
|
-
description && (React.createElement(Col, { reset: true, sizes:
|
|
17
|
+
description && (React.createElement(Col, { reset: true, sizes: colSizes },
|
|
17
18
|
React.createElement("div", { className: b('description', { titleSize: titleProps === null || titleProps === void 0 ? void 0 : titleProps.textSize }) },
|
|
18
|
-
React.createElement(
|
|
19
|
+
React.createElement(YFMWrapper, { content: description, modifiers: { constructor: true } }))))));
|
|
19
20
|
};
|
|
20
21
|
export default BlockHeader;
|
|
@@ -21,64 +21,64 @@
|
|
|
21
21
|
}
|
|
22
22
|
@media only screen and (max-width: 577px) {
|
|
23
23
|
.pc-Grid .container,
|
|
24
|
-
.pc-Grid .container-fluid {
|
|
24
|
+
.pc-Grid .container-fluid {
|
|
25
25
|
padding: 0 16px;
|
|
26
26
|
}
|
|
27
27
|
.pc-Grid .col,
|
|
28
|
-
.pc-Grid .col-sm-auto,
|
|
29
|
-
.pc-Grid .col-auto {
|
|
28
|
+
.pc-Grid .col-sm-auto,
|
|
29
|
+
.pc-Grid .col-auto {
|
|
30
30
|
padding: 0 8px;
|
|
31
31
|
}
|
|
32
32
|
.pc-Grid .col-sm-0,
|
|
33
|
-
.pc-Grid .col-0 {
|
|
33
|
+
.pc-Grid .col-0 {
|
|
34
34
|
padding: 0 8px;
|
|
35
35
|
}
|
|
36
36
|
.pc-Grid .col-sm-1,
|
|
37
|
-
.pc-Grid .col-1 {
|
|
37
|
+
.pc-Grid .col-1 {
|
|
38
38
|
padding: 0 8px;
|
|
39
39
|
}
|
|
40
40
|
.pc-Grid .col-sm-2,
|
|
41
|
-
.pc-Grid .col-2 {
|
|
41
|
+
.pc-Grid .col-2 {
|
|
42
42
|
padding: 0 8px;
|
|
43
43
|
}
|
|
44
44
|
.pc-Grid .col-sm-3,
|
|
45
|
-
.pc-Grid .col-3 {
|
|
45
|
+
.pc-Grid .col-3 {
|
|
46
46
|
padding: 0 8px;
|
|
47
47
|
}
|
|
48
48
|
.pc-Grid .col-sm-4,
|
|
49
|
-
.pc-Grid .col-4 {
|
|
49
|
+
.pc-Grid .col-4 {
|
|
50
50
|
padding: 0 8px;
|
|
51
51
|
}
|
|
52
52
|
.pc-Grid .col-sm-5,
|
|
53
|
-
.pc-Grid .col-5 {
|
|
53
|
+
.pc-Grid .col-5 {
|
|
54
54
|
padding: 0 8px;
|
|
55
55
|
}
|
|
56
56
|
.pc-Grid .col-sm-6,
|
|
57
|
-
.pc-Grid .col-6 {
|
|
57
|
+
.pc-Grid .col-6 {
|
|
58
58
|
padding: 0 8px;
|
|
59
59
|
}
|
|
60
60
|
.pc-Grid .col-sm-7,
|
|
61
|
-
.pc-Grid .col-7 {
|
|
61
|
+
.pc-Grid .col-7 {
|
|
62
62
|
padding: 0 8px;
|
|
63
63
|
}
|
|
64
64
|
.pc-Grid .col-sm-8,
|
|
65
|
-
.pc-Grid .col-8 {
|
|
65
|
+
.pc-Grid .col-8 {
|
|
66
66
|
padding: 0 8px;
|
|
67
67
|
}
|
|
68
68
|
.pc-Grid .col-sm-9,
|
|
69
|
-
.pc-Grid .col-9 {
|
|
69
|
+
.pc-Grid .col-9 {
|
|
70
70
|
padding: 0 8px;
|
|
71
71
|
}
|
|
72
72
|
.pc-Grid .col-sm-10,
|
|
73
|
-
.pc-Grid .col-10 {
|
|
73
|
+
.pc-Grid .col-10 {
|
|
74
74
|
padding: 0 8px;
|
|
75
75
|
}
|
|
76
76
|
.pc-Grid .col-sm-11,
|
|
77
|
-
.pc-Grid .col-11 {
|
|
77
|
+
.pc-Grid .col-11 {
|
|
78
78
|
padding: 0 8px;
|
|
79
79
|
}
|
|
80
80
|
.pc-Grid .col-sm-12,
|
|
81
|
-
.pc-Grid .col-12 {
|
|
81
|
+
.pc-Grid .col-12 {
|
|
82
82
|
padding: 0 8px;
|
|
83
83
|
}
|
|
84
84
|
.pc-Grid .row .row {
|
|
@@ -18,25 +18,27 @@ unpredictable css rules order in build */
|
|
|
18
18
|
height: var(--header-height);
|
|
19
19
|
}
|
|
20
20
|
@media (min-width: 769px) {
|
|
21
|
-
.pc-header__mobile-menu-button {
|
|
21
|
+
.pc-header__mobile-menu-button.pc-header__mobile-menu-button {
|
|
22
22
|
display: none;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
|
|
25
26
|
.pc-header__navigation, .pc-header__left, .pc-header__right {
|
|
26
27
|
display: flex;
|
|
27
28
|
align-items: center;
|
|
28
29
|
}
|
|
29
|
-
.pc-header__navigation {
|
|
30
|
+
.pc-header__navigation.pc-header__navigation {
|
|
30
31
|
position: relative;
|
|
31
32
|
margin-right: 20px;
|
|
32
33
|
flex: 1 0 0;
|
|
33
34
|
justify-content: flex-start;
|
|
34
35
|
}
|
|
35
36
|
@media (max-width: 768px) {
|
|
36
|
-
.pc-header__navigation {
|
|
37
|
+
.pc-header__navigation.pc-header__navigation {
|
|
37
38
|
display: none;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
41
|
+
|
|
40
42
|
.pc-header__right {
|
|
41
43
|
flex: 0;
|
|
42
44
|
justify-content: flex-end;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.pc-
|
|
1
|
+
.pc-logo__text {
|
|
2
2
|
margin: 0;
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -7,11 +7,6 @@ unpredictable css rules order in build */
|
|
|
7
7
|
.pc-logo {
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
11
|
-
font-size: var(--yc-text-header-1-font-size);
|
|
12
|
-
line-height: var(--yc-text-header-1-line-height);
|
|
13
|
-
color: var(--pc-text-header-color);
|
|
14
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
15
10
|
}
|
|
16
11
|
.pc-logo__icon {
|
|
17
12
|
display: flex;
|
|
@@ -19,5 +14,9 @@ unpredictable css rules order in build */
|
|
|
19
14
|
object-fit: contain;
|
|
20
15
|
}
|
|
21
16
|
.pc-logo__text {
|
|
17
|
+
font-size: var(--yc-text-header-1-font-size);
|
|
18
|
+
line-height: var(--yc-text-header-1-line-height);
|
|
19
|
+
color: var(--pc-text-header-color);
|
|
20
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
22
21
|
white-space: nowrap;
|
|
23
22
|
}
|