@gravity-ui/page-constructor 1.11.1 → 1.12.1-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/CHANGELOG.md +16 -1
- package/build/cjs/blocks/Banner/schema.d.ts +12 -0
- package/build/cjs/blocks/Banner/schema.js +2 -0
- package/build/cjs/blocks/CardLayout/schema.d.ts +28 -22
- package/build/cjs/blocks/CardLayout/schema.js +1 -5
- package/build/cjs/blocks/Companies/schema.d.ts +2 -0
- package/build/cjs/blocks/Companies/schema.js +2 -0
- package/build/cjs/blocks/ContentLayout/schema.d.ts +6 -0
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +22 -16
- package/build/cjs/blocks/ExtendedFeatures/schema.js +3 -5
- package/build/cjs/blocks/Header/schema.d.ts +16 -0
- package/build/cjs/blocks/Header/schema.js +5 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +9 -23
- package/build/cjs/blocks/Icons/schema.d.ts +6 -0
- package/build/cjs/blocks/Icons/schema.js +2 -0
- package/build/cjs/blocks/Info/schema.d.ts +10 -0
- package/build/cjs/blocks/Info/schema.js +2 -0
- package/build/cjs/blocks/LinkTable/schema.d.ts +30 -20
- package/build/cjs/blocks/LinkTable/schema.js +1 -1
- package/build/cjs/blocks/Media/schema.d.ts +62 -53
- package/build/cjs/blocks/Media/schema.js +6 -10
- package/build/cjs/blocks/Preview/schema.d.ts +2 -0
- package/build/cjs/blocks/Preview/schema.js +4 -0
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +20 -14
- package/build/cjs/blocks/PromoFeaturesBlock/schema.js +3 -5
- package/build/cjs/blocks/Questions/schema.d.ts +5 -0
- package/build/cjs/blocks/Questions/schema.js +2 -0
- package/build/cjs/blocks/Security/schema.d.ts +2 -0
- package/build/cjs/blocks/Security/schema.js +2 -0
- package/build/cjs/blocks/Simple/schema.d.ts +3 -0
- package/build/cjs/blocks/Simple/schema.js +1 -0
- package/build/cjs/blocks/Slider/Slider.d.ts +1 -6
- package/build/cjs/blocks/Slider/schema.d.ts +31 -45
- package/build/cjs/blocks/Slider/schema.js +2 -5
- package/build/cjs/blocks/Table/schema.d.ts +4 -0
- package/build/cjs/blocks/Table/schema.js +3 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +37 -23
- package/build/cjs/blocks/Tabs/schema.js +2 -3
- 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/Author/schema.d.ts +3 -0
- package/build/cjs/components/BlockHeader/BlockHeader.css +8 -19
- package/build/cjs/components/BlockHeader/BlockHeader.js +4 -3
- package/build/cjs/components/Image/schema.d.ts +2 -0
- package/build/cjs/components/Image/schema.js +14 -23
- 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 +2 -1
- package/build/cjs/navigation/components/Logo/Logo.css +5 -6
- package/build/cjs/schema/index.d.ts +2 -0
- package/build/cjs/schema/validators/common.d.ts +48 -0
- package/build/cjs/schema/validators/common.js +21 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +5 -0
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +4 -0
- package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +54 -46
- package/build/cjs/sub-blocks/CardWithImage/schema.js +7 -6
- package/build/cjs/sub-blocks/Content/schema.d.ts +8 -0
- package/build/cjs/sub-blocks/Content/schema.js +3 -1
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +1 -0
- package/build/cjs/sub-blocks/NewsCard/schema.d.ts +1 -0
- package/build/cjs/sub-blocks/NewsCard/schema.js +1 -0
- package/build/cjs/sub-blocks/Partner/schema.d.ts +1 -0
- package/build/cjs/sub-blocks/Partner/schema.js +1 -0
- package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +1 -0
- package/build/cjs/sub-blocks/PriceDetailed/schema.js +8 -0
- package/build/cjs/sub-blocks/Quote/schema.d.ts +4 -0
- package/build/cjs/sub-blocks/Quote/schema.js +1 -0
- package/build/cjs/sub-blocks/TutorialCard/schema.d.ts +2 -0
- package/build/cjs/sub-blocks/TutorialCard/schema.js +2 -0
- package/build/cjs/text-transform/blocks.js +49 -32
- package/build/esm/blocks/Banner/schema.d.ts +12 -0
- package/build/esm/blocks/Banner/schema.js +2 -0
- package/build/esm/blocks/CardLayout/schema.d.ts +28 -22
- package/build/esm/blocks/CardLayout/schema.js +2 -6
- package/build/esm/blocks/Companies/schema.d.ts +2 -0
- package/build/esm/blocks/Companies/schema.js +2 -0
- package/build/esm/blocks/ContentLayout/schema.d.ts +6 -0
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +22 -16
- package/build/esm/blocks/ExtendedFeatures/schema.js +4 -6
- package/build/esm/blocks/Header/schema.d.ts +16 -0
- package/build/esm/blocks/Header/schema.js +5 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +9 -23
- package/build/esm/blocks/Icons/schema.d.ts +6 -0
- package/build/esm/blocks/Icons/schema.js +2 -0
- package/build/esm/blocks/Info/schema.d.ts +10 -0
- package/build/esm/blocks/Info/schema.js +2 -0
- package/build/esm/blocks/LinkTable/schema.d.ts +30 -20
- package/build/esm/blocks/LinkTable/schema.js +2 -2
- package/build/esm/blocks/Media/schema.d.ts +62 -53
- package/build/esm/blocks/Media/schema.js +7 -11
- package/build/esm/blocks/Preview/schema.d.ts +2 -0
- package/build/esm/blocks/Preview/schema.js +4 -0
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +20 -14
- package/build/esm/blocks/PromoFeaturesBlock/schema.js +4 -6
- package/build/esm/blocks/Questions/schema.d.ts +5 -0
- package/build/esm/blocks/Questions/schema.js +2 -0
- package/build/esm/blocks/Security/schema.d.ts +2 -0
- package/build/esm/blocks/Security/schema.js +2 -0
- package/build/esm/blocks/Simple/schema.d.ts +3 -0
- package/build/esm/blocks/Simple/schema.js +1 -0
- package/build/esm/blocks/Slider/Slider.d.ts +1 -6
- package/build/esm/blocks/Slider/schema.d.ts +31 -45
- package/build/esm/blocks/Slider/schema.js +3 -6
- package/build/esm/blocks/Table/schema.d.ts +4 -0
- package/build/esm/blocks/Table/schema.js +3 -0
- package/build/esm/blocks/Tabs/schema.d.ts +37 -23
- package/build/esm/blocks/Tabs/schema.js +3 -4
- 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/Author/schema.d.ts +3 -0
- package/build/esm/components/BlockHeader/BlockHeader.css +8 -19
- package/build/esm/components/BlockHeader/BlockHeader.js +5 -4
- package/build/esm/components/Image/schema.d.ts +2 -0
- package/build/esm/components/Image/schema.js +14 -23
- 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 +2 -1
- package/build/esm/navigation/components/Logo/Logo.css +5 -6
- package/build/esm/schema/index.d.ts +2 -0
- package/build/esm/schema/validators/common.d.ts +48 -0
- package/build/esm/schema/validators/common.js +20 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +5 -0
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +4 -0
- package/build/esm/sub-blocks/CardWithImage/schema.d.ts +54 -46
- package/build/esm/sub-blocks/CardWithImage/schema.js +8 -7
- package/build/esm/sub-blocks/Content/schema.d.ts +8 -0
- package/build/esm/sub-blocks/Content/schema.js +3 -1
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +1 -0
- package/build/esm/sub-blocks/NewsCard/schema.d.ts +1 -0
- package/build/esm/sub-blocks/NewsCard/schema.js +1 -0
- package/build/esm/sub-blocks/Partner/schema.d.ts +1 -0
- package/build/esm/sub-blocks/Partner/schema.js +1 -0
- package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +1 -0
- package/build/esm/sub-blocks/PriceDetailed/schema.js +8 -0
- package/build/esm/sub-blocks/Quote/schema.d.ts +4 -0
- package/build/esm/sub-blocks/Quote/schema.js +1 -0
- package/build/esm/sub-blocks/TutorialCard/schema.d.ts +2 -0
- package/build/esm/sub-blocks/TutorialCard/schema.js +2 -0
- package/build/esm/text-transform/blocks.js +49 -32
- package/package.json +2 -3
- package/server/models/constructor-items/common.d.ts +1 -0
- package/server/text-transform/blocks.js +49 -32
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Settings } from 'react-slick';
|
|
2
2
|
import { Refable, SliderProps as SliderParams, ClassNameProps, WithChildren } from '../../models';
|
|
3
|
-
export interface SlickSliderFull extends SlickSlider {
|
|
4
|
-
innerSlider?: {
|
|
5
|
-
list: HTMLElement;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
3
|
export interface SliderProps extends Omit<SliderParams, 'children'>, Refable<HTMLDivElement>, ClassNameProps, Pick<Settings, 'lazyLoad'> {
|
|
9
4
|
type?: string;
|
|
10
5
|
anchorId?: string;
|
|
@@ -5,29 +5,6 @@ export declare const SliderProps: {
|
|
|
5
5
|
arrows: {
|
|
6
6
|
type: string;
|
|
7
7
|
};
|
|
8
|
-
description: {
|
|
9
|
-
type: string;
|
|
10
|
-
};
|
|
11
|
-
title: {
|
|
12
|
-
type: string;
|
|
13
|
-
additionalProperties: boolean;
|
|
14
|
-
required: string[];
|
|
15
|
-
properties: {
|
|
16
|
-
text: {
|
|
17
|
-
type: string;
|
|
18
|
-
};
|
|
19
|
-
textSize: {
|
|
20
|
-
type: string;
|
|
21
|
-
enum: string[];
|
|
22
|
-
};
|
|
23
|
-
url: {
|
|
24
|
-
type: string;
|
|
25
|
-
};
|
|
26
|
-
resetMargin: {
|
|
27
|
-
type: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
8
|
randomOrder: {
|
|
32
9
|
type: string;
|
|
33
10
|
};
|
|
@@ -56,6 +33,7 @@ export declare const SliderProps: {
|
|
|
56
33
|
properties: {
|
|
57
34
|
text: {
|
|
58
35
|
type: string;
|
|
36
|
+
contentType: string;
|
|
59
37
|
};
|
|
60
38
|
size: {
|
|
61
39
|
type: string;
|
|
@@ -105,34 +83,40 @@ export declare const SliderBlock: {
|
|
|
105
83
|
additionalProperties: boolean;
|
|
106
84
|
required: never[];
|
|
107
85
|
properties: {
|
|
108
|
-
|
|
109
|
-
|
|
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
|
+
})[];
|
|
110
110
|
};
|
|
111
|
-
|
|
111
|
+
description: {
|
|
112
112
|
type: string;
|
|
113
|
+
contentType: string;
|
|
113
114
|
};
|
|
114
|
-
|
|
115
|
+
dots: {
|
|
115
116
|
type: string;
|
|
116
117
|
};
|
|
117
|
-
|
|
118
|
+
arrows: {
|
|
118
119
|
type: string;
|
|
119
|
-
additionalProperties: boolean;
|
|
120
|
-
required: string[];
|
|
121
|
-
properties: {
|
|
122
|
-
text: {
|
|
123
|
-
type: string;
|
|
124
|
-
};
|
|
125
|
-
textSize: {
|
|
126
|
-
type: string;
|
|
127
|
-
enum: string[];
|
|
128
|
-
};
|
|
129
|
-
url: {
|
|
130
|
-
type: string;
|
|
131
|
-
};
|
|
132
|
-
resetMargin: {
|
|
133
|
-
type: string;
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
120
|
};
|
|
137
121
|
randomOrder: {
|
|
138
122
|
type: string;
|
|
@@ -162,6 +146,7 @@ export declare const SliderBlock: {
|
|
|
162
146
|
properties: {
|
|
163
147
|
text: {
|
|
164
148
|
type: string;
|
|
149
|
+
contentType: string;
|
|
165
150
|
};
|
|
166
151
|
size: {
|
|
167
152
|
type: string;
|
|
@@ -212,6 +197,7 @@ export declare const SliderBlock: {
|
|
|
212
197
|
properties: {
|
|
213
198
|
text: {
|
|
214
199
|
type: string;
|
|
200
|
+
contentType: string;
|
|
215
201
|
};
|
|
216
202
|
url: {
|
|
217
203
|
type: string;
|
|
@@ -36,6 +36,7 @@ const DisclaimerProps = {
|
|
|
36
36
|
properties: {
|
|
37
37
|
text: {
|
|
38
38
|
type: 'string',
|
|
39
|
+
contentType: 'text',
|
|
39
40
|
},
|
|
40
41
|
size: {
|
|
41
42
|
type: 'string',
|
|
@@ -50,10 +51,6 @@ exports.SliderProps = {
|
|
|
50
51
|
arrows: {
|
|
51
52
|
type: 'boolean',
|
|
52
53
|
},
|
|
53
|
-
description: {
|
|
54
|
-
type: 'string',
|
|
55
|
-
},
|
|
56
|
-
title: common_1.TitleProps,
|
|
57
54
|
randomOrder: {
|
|
58
55
|
type: 'boolean',
|
|
59
56
|
},
|
|
@@ -70,6 +67,6 @@ exports.SliderBlock = {
|
|
|
70
67
|
'slider-block': {
|
|
71
68
|
additionalProperties: false,
|
|
72
69
|
required: [],
|
|
73
|
-
properties: Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.AnimatableProps), exports.SliderProps),
|
|
70
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.AnimatableProps), exports.SliderProps), common_1.BlockHeaderProps),
|
|
74
71
|
},
|
|
75
72
|
};
|
|
@@ -5,6 +5,7 @@ export declare const TableBlock: {
|
|
|
5
5
|
properties: {
|
|
6
6
|
title: {
|
|
7
7
|
type: string;
|
|
8
|
+
contentType: string;
|
|
8
9
|
};
|
|
9
10
|
table: {
|
|
10
11
|
additionalProperties: boolean;
|
|
@@ -16,6 +17,7 @@ export declare const TableBlock: {
|
|
|
16
17
|
type: string;
|
|
17
18
|
items: {
|
|
18
19
|
type: string[];
|
|
20
|
+
contentType: string;
|
|
19
21
|
};
|
|
20
22
|
};
|
|
21
23
|
};
|
|
@@ -23,6 +25,7 @@ export declare const TableBlock: {
|
|
|
23
25
|
type: string;
|
|
24
26
|
items: {
|
|
25
27
|
type: string;
|
|
28
|
+
contentType: string;
|
|
26
29
|
};
|
|
27
30
|
};
|
|
28
31
|
justify: {
|
|
@@ -47,6 +50,7 @@ export declare const TableBlock: {
|
|
|
47
50
|
properties: {
|
|
48
51
|
text: {
|
|
49
52
|
type: string;
|
|
53
|
+
contentType: string;
|
|
50
54
|
};
|
|
51
55
|
url: {
|
|
52
56
|
type: string;
|
|
@@ -8,6 +8,7 @@ exports.TableBlock = {
|
|
|
8
8
|
required: ['title', 'table'],
|
|
9
9
|
properties: Object.assign(Object.assign({}, common_1.BlockBaseProps), { title: {
|
|
10
10
|
type: 'string',
|
|
11
|
+
contentType: 'text',
|
|
11
12
|
}, table: {
|
|
12
13
|
additionalProperties: false,
|
|
13
14
|
required: ['content'],
|
|
@@ -17,12 +18,14 @@ exports.TableBlock = {
|
|
|
17
18
|
type: 'array',
|
|
18
19
|
items: {
|
|
19
20
|
type: ['string', 'number'],
|
|
21
|
+
contentType: 'text',
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
}, legend: {
|
|
23
25
|
type: 'array',
|
|
24
26
|
items: {
|
|
25
27
|
type: 'string',
|
|
28
|
+
contentType: 'yfm',
|
|
26
29
|
},
|
|
27
30
|
}, justify: {
|
|
28
31
|
type: 'array',
|
|
@@ -8,6 +8,7 @@ export declare const tabsItem: {
|
|
|
8
8
|
};
|
|
9
9
|
caption: {
|
|
10
10
|
type: string;
|
|
11
|
+
contentType: string;
|
|
11
12
|
};
|
|
12
13
|
media: {
|
|
13
14
|
oneOf: ({
|
|
@@ -101,6 +102,7 @@ export declare const tabsItem: {
|
|
|
101
102
|
};
|
|
102
103
|
text: {
|
|
103
104
|
type: string;
|
|
105
|
+
contentType: string;
|
|
104
106
|
};
|
|
105
107
|
};
|
|
106
108
|
};
|
|
@@ -155,6 +157,7 @@ export declare const tabsItem: {
|
|
|
155
157
|
properties: {
|
|
156
158
|
text: {
|
|
157
159
|
type: string;
|
|
160
|
+
contentType: string;
|
|
158
161
|
};
|
|
159
162
|
url: {
|
|
160
163
|
type: string;
|
|
@@ -206,6 +209,7 @@ export declare const tabsItem: {
|
|
|
206
209
|
properties: {
|
|
207
210
|
text: {
|
|
208
211
|
type: string;
|
|
212
|
+
contentType: string;
|
|
209
213
|
};
|
|
210
214
|
textSize: {
|
|
211
215
|
type: string;
|
|
@@ -220,13 +224,16 @@ export declare const tabsItem: {
|
|
|
220
224
|
};
|
|
221
225
|
} | {
|
|
222
226
|
type: string;
|
|
227
|
+
contentType: string;
|
|
223
228
|
})[];
|
|
224
229
|
} | undefined;
|
|
225
230
|
text?: {
|
|
226
231
|
type: string;
|
|
232
|
+
contentType: string;
|
|
227
233
|
} | undefined;
|
|
228
234
|
additionalInfo?: {
|
|
229
235
|
type: string;
|
|
236
|
+
contentType: string;
|
|
230
237
|
} | undefined;
|
|
231
238
|
size?: {
|
|
232
239
|
type: string;
|
|
@@ -265,29 +272,6 @@ export declare const TabsBlock: {
|
|
|
265
272
|
additionalProperties: boolean;
|
|
266
273
|
required: string[];
|
|
267
274
|
properties: {
|
|
268
|
-
title: {
|
|
269
|
-
type: string;
|
|
270
|
-
additionalProperties: boolean;
|
|
271
|
-
required: string[];
|
|
272
|
-
properties: {
|
|
273
|
-
text: {
|
|
274
|
-
type: string;
|
|
275
|
-
};
|
|
276
|
-
textSize: {
|
|
277
|
-
type: string;
|
|
278
|
-
enum: string[];
|
|
279
|
-
};
|
|
280
|
-
url: {
|
|
281
|
-
type: string;
|
|
282
|
-
};
|
|
283
|
-
resetMargin: {
|
|
284
|
-
type: string;
|
|
285
|
-
};
|
|
286
|
-
};
|
|
287
|
-
};
|
|
288
|
-
description: {
|
|
289
|
-
type: string;
|
|
290
|
-
};
|
|
291
275
|
tabsColSizes: {};
|
|
292
276
|
direction: {
|
|
293
277
|
type: string;
|
|
@@ -307,6 +291,35 @@ export declare const TabsBlock: {
|
|
|
307
291
|
};
|
|
308
292
|
};
|
|
309
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
|
+
};
|
|
310
323
|
anchor: {
|
|
311
324
|
type: string;
|
|
312
325
|
additionalProperties: boolean;
|
|
@@ -314,6 +327,7 @@ export declare const TabsBlock: {
|
|
|
314
327
|
properties: {
|
|
315
328
|
text: {
|
|
316
329
|
type: string;
|
|
330
|
+
contentType: string;
|
|
317
331
|
};
|
|
318
332
|
url: {
|
|
319
333
|
type: string;
|
|
@@ -16,6 +16,7 @@ exports.tabsItem = {
|
|
|
16
16
|
type: 'string',
|
|
17
17
|
}, caption: {
|
|
18
18
|
type: 'string',
|
|
19
|
+
contentType: 'text',
|
|
19
20
|
}, media: (0, common_1.withTheme)({
|
|
20
21
|
type: 'object',
|
|
21
22
|
properties: common_1.MediaProps,
|
|
@@ -27,9 +28,7 @@ exports.TabsBlock = {
|
|
|
27
28
|
'tabs-block': {
|
|
28
29
|
additionalProperties: false,
|
|
29
30
|
required: ['title', 'items'],
|
|
30
|
-
properties: Object.assign(Object.assign({}, common_1.BlockBaseProps), {
|
|
31
|
-
type: 'string',
|
|
32
|
-
}, tabsColSizes: common_1.containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: common_1.sizeNumber })), {}), direction: {
|
|
31
|
+
properties: Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.BlockHeaderProps), { tabsColSizes: common_1.containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: common_1.sizeNumber })), {}), direction: {
|
|
33
32
|
type: 'string',
|
|
34
33
|
enum: common_1.mediaDirection,
|
|
35
34
|
}, centered: { type: 'boolean' }, items: (0, utils_1.filteredArray)(exports.tabsItem) }),
|
|
@@ -7,10 +7,10 @@ const models_1 = require("../../models");
|
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
8
|
const b = (0, utils_1.block)('author');
|
|
9
9
|
const Author = (props) => {
|
|
10
|
-
const { author, className, authorContainerClassName, type = models_1.AuthorType.Column } = props;
|
|
10
|
+
const { author, className, authorContainerClassName, type = models_1.AuthorType.Column, dataQa } = props;
|
|
11
11
|
const { firstName, secondName, description, avatar } = author;
|
|
12
12
|
const name = secondName ? `${firstName} ${secondName}` : firstName;
|
|
13
|
-
return (react_1.default.createElement("div", { className: b({ type }, className) },
|
|
13
|
+
return (react_1.default.createElement("div", { className: b({ type }, className), "data-qa": dataQa },
|
|
14
14
|
avatar && (react_1.default.createElement("div", { className: b('avatar', authorContainerClassName) }, typeof avatar === 'string' ? react_1.default.createElement(index_1.Image, { src: avatar }) : avatar)),
|
|
15
15
|
react_1.default.createElement("div", { className: b('label') },
|
|
16
16
|
react_1.default.createElement("div", { className: b('name') }, name),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const react_2 = require("@testing-library/react");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
const Author_1 = tslib_1.__importDefault(require("../Author"));
|
|
8
|
+
const testId = 'author';
|
|
9
|
+
const author = {
|
|
10
|
+
firstName: 'John',
|
|
11
|
+
secondName: 'Doe',
|
|
12
|
+
description: 'Web designer',
|
|
13
|
+
avatar: 'https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-gray.png',
|
|
14
|
+
};
|
|
15
|
+
describe('Author', () => {
|
|
16
|
+
test('Render author by default', async () => {
|
|
17
|
+
(0, react_2.render)(react_1.default.createElement(Author_1.default, { author: author, dataQa: testId }));
|
|
18
|
+
const object = react_2.screen.getByTestId(testId);
|
|
19
|
+
expect(object).toBeInTheDocument();
|
|
20
|
+
});
|
|
21
|
+
test('Has full name', async () => {
|
|
22
|
+
const name = `${author.firstName} ${author.secondName}`;
|
|
23
|
+
(0, react_2.render)(react_1.default.createElement(Author_1.default, { author: author, dataQa: testId }));
|
|
24
|
+
const object = react_2.screen.getByText(name);
|
|
25
|
+
expect(object).toBeInTheDocument();
|
|
26
|
+
});
|
|
27
|
+
test('Has first name only', async () => {
|
|
28
|
+
const name = author.firstName;
|
|
29
|
+
(0, react_2.render)(react_1.default.createElement(Author_1.default, { author: Object.assign(Object.assign({}, author), { secondName: '' }), dataQa: testId }));
|
|
30
|
+
const object = react_2.screen.getByText(name);
|
|
31
|
+
expect(object).toBeInTheDocument();
|
|
32
|
+
});
|
|
33
|
+
test('Has avatar', async () => {
|
|
34
|
+
(0, react_2.render)(react_1.default.createElement(Author_1.default, { author: author, dataQa: testId }));
|
|
35
|
+
const avatar = react_2.screen.getByRole('img');
|
|
36
|
+
expect(avatar).toBeInTheDocument();
|
|
37
|
+
expect(avatar).toHaveAttribute('src', author.avatar);
|
|
38
|
+
});
|
|
39
|
+
test('Has description', async () => {
|
|
40
|
+
(0, react_2.render)(react_1.default.createElement(Author_1.default, { author: author, dataQa: testId }));
|
|
41
|
+
const object = react_2.screen.getByText(author.description);
|
|
42
|
+
expect(object).toBeInTheDocument();
|
|
43
|
+
});
|
|
44
|
+
test.each(new Array(models_1.AuthorType.Column, models_1.AuthorType.Line))('Render with given "%s" type', (type) => {
|
|
45
|
+
(0, react_2.render)(react_1.default.createElement(Author_1.default, { author: author, dataQa: testId, type: type }));
|
|
46
|
+
const object = react_2.screen.getByTestId(testId);
|
|
47
|
+
expect(object).toHaveClass(`pc-author_type_${type}`);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -10,9 +10,11 @@ export declare const author: {
|
|
|
10
10
|
properties: {
|
|
11
11
|
firstName: {
|
|
12
12
|
type: string;
|
|
13
|
+
contentType: string;
|
|
13
14
|
};
|
|
14
15
|
secondName: {
|
|
15
16
|
type: string;
|
|
17
|
+
contentType: string;
|
|
16
18
|
};
|
|
17
19
|
avatar: {
|
|
18
20
|
type: string;
|
|
@@ -20,6 +22,7 @@ export declare const author: {
|
|
|
20
22
|
};
|
|
21
23
|
description: {
|
|
22
24
|
type: string;
|
|
25
|
+
contentType: string;
|
|
23
26
|
};
|
|
24
27
|
};
|
|
25
28
|
};
|
|
@@ -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
|
}
|
|
@@ -5,7 +5,8 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const grid_1 = require("../../grid");
|
|
7
7
|
const __1 = require("../");
|
|
8
|
-
const
|
|
8
|
+
const YFMWrapper_1 = tslib_1.__importDefault(require("../YFMWrapper/YFMWrapper"));
|
|
9
|
+
const b = (0, utils_1.block)('block-header');
|
|
9
10
|
const BlockHeader = ({ title, description, className, colSizes = { all: 12, sm: 8 }, }) => {
|
|
10
11
|
if (!title && !description) {
|
|
11
12
|
return null;
|
|
@@ -14,8 +15,8 @@ const BlockHeader = ({ title, description, className, colSizes = { all: 12, sm:
|
|
|
14
15
|
return (react_1.default.createElement("div", { className: b(null, className) },
|
|
15
16
|
text && (react_1.default.createElement(grid_1.Col, { reset: true, sizes: colSizes },
|
|
16
17
|
react_1.default.createElement(__1.Title, Object.assign({ text: text }, titleProps)))),
|
|
17
|
-
description && (react_1.default.createElement(grid_1.Col, { reset: true, sizes:
|
|
18
|
+
description && (react_1.default.createElement(grid_1.Col, { reset: true, sizes: colSizes },
|
|
18
19
|
react_1.default.createElement("div", { className: b('description', { titleSize: titleProps === null || titleProps === void 0 ? void 0 : titleProps.textSize }) },
|
|
19
|
-
react_1.default.createElement(
|
|
20
|
+
react_1.default.createElement(YFMWrapper_1.default, { content: description, modifiers: { constructor: true } }))))));
|
|
20
21
|
};
|
|
21
22
|
exports.default = BlockHeader;
|
|
@@ -18,6 +18,7 @@ export declare const ImageDeviceProps: {
|
|
|
18
18
|
};
|
|
19
19
|
alt: {
|
|
20
20
|
type: string;
|
|
21
|
+
contentType: string;
|
|
21
22
|
};
|
|
22
23
|
disableCompress: {
|
|
23
24
|
type: string;
|
|
@@ -35,6 +36,7 @@ export declare const ImageObjectProps: {
|
|
|
35
36
|
};
|
|
36
37
|
alt: {
|
|
37
38
|
type: string;
|
|
39
|
+
contentType: string;
|
|
38
40
|
};
|
|
39
41
|
disableCompress: {
|
|
40
42
|
type: string;
|
|
@@ -3,44 +3,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ImageProps = exports.ImageObjectProps = exports.ImageDeviceProps = exports.urlPattern = void 0;
|
|
4
4
|
const utils_1 = require("../../schema/validators/utils");
|
|
5
5
|
exports.urlPattern = '^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$';
|
|
6
|
+
const ImageBase = {
|
|
7
|
+
alt: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
contentType: 'text',
|
|
10
|
+
},
|
|
11
|
+
disableCompress: {
|
|
12
|
+
type: 'boolean',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
6
15
|
exports.ImageDeviceProps = {
|
|
7
16
|
type: 'object',
|
|
8
17
|
additionalProperties: false,
|
|
9
18
|
required: ['desktop', 'mobile'],
|
|
10
|
-
properties: {
|
|
11
|
-
desktop: { type: 'string', pattern: exports.urlPattern },
|
|
12
|
-
tablet: {
|
|
19
|
+
properties: Object.assign(Object.assign({}, ImageBase), { desktop: { type: 'string', pattern: exports.urlPattern }, tablet: {
|
|
13
20
|
type: 'string',
|
|
14
21
|
pattern: exports.urlPattern,
|
|
15
|
-
},
|
|
16
|
-
mobile: {
|
|
22
|
+
}, mobile: {
|
|
17
23
|
type: 'string',
|
|
18
24
|
pattern: exports.urlPattern,
|
|
19
|
-
},
|
|
20
|
-
alt: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
},
|
|
23
|
-
disableCompress: {
|
|
24
|
-
type: 'boolean',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
25
|
+
} }),
|
|
27
26
|
};
|
|
28
27
|
exports.ImageObjectProps = {
|
|
29
28
|
type: 'object',
|
|
30
29
|
additionalProperties: false,
|
|
31
30
|
required: ['src'],
|
|
32
|
-
properties: {
|
|
33
|
-
src: {
|
|
31
|
+
properties: Object.assign(Object.assign({}, ImageBase), { src: {
|
|
34
32
|
type: 'string',
|
|
35
33
|
pattern: exports.urlPattern,
|
|
36
|
-
},
|
|
37
|
-
alt: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
},
|
|
40
|
-
disableCompress: {
|
|
41
|
-
type: 'boolean',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
34
|
+
} }),
|
|
44
35
|
};
|
|
45
36
|
exports.ImageProps = {
|
|
46
37
|
oneOf: [
|
|
@@ -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,10 +18,11 @@ 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;
|