@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
|
@@ -8,9 +8,11 @@ const PreviewContentItem = {
|
|
|
8
8
|
properties: {
|
|
9
9
|
title: {
|
|
10
10
|
type: 'string',
|
|
11
|
+
contentType: 'text',
|
|
11
12
|
},
|
|
12
13
|
description: {
|
|
13
14
|
type: 'string',
|
|
15
|
+
contentType: 'yfm',
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
18
|
};
|
|
@@ -33,8 +35,10 @@ export const PreviewBlock = {
|
|
|
33
35
|
required: ['title', 'items'],
|
|
34
36
|
properties: Object.assign(Object.assign(Object.assign({}, BaseProps), AnimatableProps), { title: {
|
|
35
37
|
type: 'string',
|
|
38
|
+
contentType: 'text',
|
|
36
39
|
}, description: {
|
|
37
40
|
type: 'string',
|
|
41
|
+
contentType: 'yfm',
|
|
38
42
|
}, direction: {
|
|
39
43
|
type: 'string',
|
|
40
44
|
enum: mediaDirection,
|
|
@@ -4,9 +4,11 @@ export declare const PromoFeaturesItem: {
|
|
|
4
4
|
properties: {
|
|
5
5
|
title: {
|
|
6
6
|
type: string;
|
|
7
|
+
contentType: string;
|
|
7
8
|
};
|
|
8
9
|
text: {
|
|
9
10
|
type: string;
|
|
11
|
+
contentType: string;
|
|
10
12
|
};
|
|
11
13
|
theme: {
|
|
12
14
|
enum: string[];
|
|
@@ -104,6 +106,7 @@ export declare const PromoFeaturesItem: {
|
|
|
104
106
|
};
|
|
105
107
|
text: {
|
|
106
108
|
type: string;
|
|
109
|
+
contentType: string;
|
|
107
110
|
};
|
|
108
111
|
};
|
|
109
112
|
};
|
|
@@ -152,6 +155,20 @@ export declare const PromoFeaturesBlock: {
|
|
|
152
155
|
additionalProperties: boolean;
|
|
153
156
|
required: string[];
|
|
154
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
|
+
};
|
|
155
172
|
title: {
|
|
156
173
|
oneOf: ({
|
|
157
174
|
type: string;
|
|
@@ -160,6 +177,7 @@ export declare const PromoFeaturesBlock: {
|
|
|
160
177
|
properties: {
|
|
161
178
|
text: {
|
|
162
179
|
type: string;
|
|
180
|
+
contentType: string;
|
|
163
181
|
};
|
|
164
182
|
textSize: {
|
|
165
183
|
type: string;
|
|
@@ -178,20 +196,7 @@ export declare const PromoFeaturesBlock: {
|
|
|
178
196
|
};
|
|
179
197
|
description: {
|
|
180
198
|
type: string;
|
|
181
|
-
|
|
182
|
-
theme: {
|
|
183
|
-
enum: string[];
|
|
184
|
-
};
|
|
185
|
-
items: {
|
|
186
|
-
type: string;
|
|
187
|
-
items: {
|
|
188
|
-
type: string;
|
|
189
|
-
properties: {
|
|
190
|
-
when: {
|
|
191
|
-
type: string;
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
};
|
|
199
|
+
contentType: string;
|
|
195
200
|
};
|
|
196
201
|
animated: {
|
|
197
202
|
type: string;
|
|
@@ -203,6 +208,7 @@ export declare const PromoFeaturesBlock: {
|
|
|
203
208
|
properties: {
|
|
204
209
|
text: {
|
|
205
210
|
type: string;
|
|
211
|
+
contentType: string;
|
|
206
212
|
};
|
|
207
213
|
url: {
|
|
208
214
|
type: string;
|
|
@@ -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 = {
|
|
@@ -7,9 +7,11 @@ export const PromoFeaturesItem = {
|
|
|
7
7
|
properties: {
|
|
8
8
|
title: {
|
|
9
9
|
type: 'string',
|
|
10
|
+
contentType: 'text',
|
|
10
11
|
},
|
|
11
12
|
text: {
|
|
12
13
|
type: 'string',
|
|
14
|
+
contentType: 'yfm',
|
|
13
15
|
},
|
|
14
16
|
theme: {
|
|
15
17
|
enum: ['accent', 'accent-light', 'primary'],
|
|
@@ -21,11 +23,7 @@ export const PromoFeaturesBlock = {
|
|
|
21
23
|
'promo-features-block': {
|
|
22
24
|
additionalProperties: false,
|
|
23
25
|
required: ['items'],
|
|
24
|
-
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), {
|
|
25
|
-
oneOf: [{ type: 'string' }, TitleProps],
|
|
26
|
-
}, description: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
}, theme: {
|
|
26
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), BlockHeaderProps), { theme: {
|
|
29
27
|
enum: ['grey', 'default'],
|
|
30
28
|
}, items: filteredArray(PromoFeaturesItem) }),
|
|
31
29
|
},
|
|
@@ -22,6 +22,7 @@ export declare const QuestionsBlock: {
|
|
|
22
22
|
properties: {
|
|
23
23
|
text: {
|
|
24
24
|
type: string;
|
|
25
|
+
contentType: string;
|
|
25
26
|
};
|
|
26
27
|
textSize: {
|
|
27
28
|
type: string;
|
|
@@ -36,13 +37,16 @@ export declare const QuestionsBlock: {
|
|
|
36
37
|
};
|
|
37
38
|
} | {
|
|
38
39
|
type: string;
|
|
40
|
+
contentType: string;
|
|
39
41
|
})[];
|
|
40
42
|
};
|
|
41
43
|
text: {
|
|
42
44
|
type: string;
|
|
45
|
+
contentType: string;
|
|
43
46
|
};
|
|
44
47
|
additionalInfo: {
|
|
45
48
|
type: string;
|
|
49
|
+
contentType: string;
|
|
46
50
|
};
|
|
47
51
|
links: {
|
|
48
52
|
type: string;
|
|
@@ -73,6 +77,7 @@ export declare const QuestionsBlock: {
|
|
|
73
77
|
properties: {
|
|
74
78
|
text: {
|
|
75
79
|
type: string;
|
|
80
|
+
contentType: string;
|
|
76
81
|
};
|
|
77
82
|
url: {
|
|
78
83
|
type: string;
|
|
@@ -12,6 +12,7 @@ export declare const SecurityBlock: {
|
|
|
12
12
|
};
|
|
13
13
|
title: {
|
|
14
14
|
type: string;
|
|
15
|
+
contentType: string;
|
|
15
16
|
};
|
|
16
17
|
media: {
|
|
17
18
|
type: string;
|
|
@@ -106,6 +107,7 @@ export declare const SecurityBlock: {
|
|
|
106
107
|
};
|
|
107
108
|
text: {
|
|
108
109
|
type: string;
|
|
110
|
+
contentType: string;
|
|
109
111
|
};
|
|
110
112
|
};
|
|
111
113
|
};
|
|
@@ -10,6 +10,7 @@ export const SecurityBlock = {
|
|
|
10
10
|
type: 'string',
|
|
11
11
|
}, title: {
|
|
12
12
|
type: 'string',
|
|
13
|
+
contentType: 'text',
|
|
13
14
|
}, media: Media, points: filteredArray({
|
|
14
15
|
type: 'object',
|
|
15
16
|
properties: {
|
|
@@ -18,6 +19,7 @@ export const SecurityBlock = {
|
|
|
18
19
|
},
|
|
19
20
|
text: {
|
|
20
21
|
type: 'string',
|
|
22
|
+
contentType: 'text',
|
|
21
23
|
},
|
|
22
24
|
link: _.pick(LinkProps, ['text', 'url']),
|
|
23
25
|
},
|
|
@@ -19,6 +19,7 @@ export declare const SimpleBlock: {
|
|
|
19
19
|
properties: {
|
|
20
20
|
text: {
|
|
21
21
|
type: string;
|
|
22
|
+
contentType: string;
|
|
22
23
|
};
|
|
23
24
|
url: {
|
|
24
25
|
type: string;
|
|
@@ -41,6 +42,7 @@ export declare const SimpleBlock: {
|
|
|
41
42
|
properties: {
|
|
42
43
|
text: {
|
|
43
44
|
type: string;
|
|
45
|
+
contentType: string;
|
|
44
46
|
};
|
|
45
47
|
textSize: {
|
|
46
48
|
type: string;
|
|
@@ -56,6 +58,7 @@ export declare const SimpleBlock: {
|
|
|
56
58
|
};
|
|
57
59
|
description: {
|
|
58
60
|
type: string;
|
|
61
|
+
contentType: string;
|
|
59
62
|
};
|
|
60
63
|
};
|
|
61
64
|
};
|
|
@@ -5,6 +5,7 @@ export const SimpleBlock = {
|
|
|
5
5
|
required: ['title', 'description'],
|
|
6
6
|
properties: Object.assign(Object.assign(Object.assign({ title: TitleProps, description: {
|
|
7
7
|
type: 'string',
|
|
8
|
+
contentType: 'yfm',
|
|
8
9
|
} }, BlockBaseProps), AnimatableProps), { children: ChildrenProps }),
|
|
9
10
|
},
|
|
10
11
|
};
|
|
@@ -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,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;
|
|
@@ -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'],
|
|
@@ -33,6 +33,7 @@ const DisclaimerProps = {
|
|
|
33
33
|
properties: {
|
|
34
34
|
text: {
|
|
35
35
|
type: 'string',
|
|
36
|
+
contentType: 'text',
|
|
36
37
|
},
|
|
37
38
|
size: {
|
|
38
39
|
type: 'string',
|
|
@@ -47,10 +48,6 @@ export const SliderProps = {
|
|
|
47
48
|
arrows: {
|
|
48
49
|
type: 'boolean',
|
|
49
50
|
},
|
|
50
|
-
description: {
|
|
51
|
-
type: 'string',
|
|
52
|
-
},
|
|
53
|
-
title: TitleProps,
|
|
54
51
|
randomOrder: {
|
|
55
52
|
type: 'boolean',
|
|
56
53
|
},
|
|
@@ -67,6 +64,6 @@ export const SliderBlock = {
|
|
|
67
64
|
'slider-block': {
|
|
68
65
|
additionalProperties: false,
|
|
69
66
|
required: [],
|
|
70
|
-
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), SliderProps),
|
|
67
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), SliderProps), BlockHeaderProps),
|
|
71
68
|
},
|
|
72
69
|
};
|
|
@@ -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;
|
|
@@ -5,6 +5,7 @@ export const TableBlock = {
|
|
|
5
5
|
required: ['title', 'table'],
|
|
6
6
|
properties: Object.assign(Object.assign({}, BlockBaseProps), { title: {
|
|
7
7
|
type: 'string',
|
|
8
|
+
contentType: 'text',
|
|
8
9
|
}, table: {
|
|
9
10
|
additionalProperties: false,
|
|
10
11
|
required: ['content'],
|
|
@@ -14,12 +15,14 @@ export const TableBlock = {
|
|
|
14
15
|
type: 'array',
|
|
15
16
|
items: {
|
|
16
17
|
type: ['string', 'number'],
|
|
18
|
+
contentType: 'text',
|
|
17
19
|
},
|
|
18
20
|
},
|
|
19
21
|
}, legend: {
|
|
20
22
|
type: 'array',
|
|
21
23
|
items: {
|
|
22
24
|
type: 'string',
|
|
25
|
+
contentType: 'yfm',
|
|
23
26
|
},
|
|
24
27
|
}, justify: {
|
|
25
28
|
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;
|
|
@@ -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';
|
|
@@ -12,6 +12,7 @@ export const tabsItem = {
|
|
|
12
12
|
type: 'string',
|
|
13
13
|
}, caption: {
|
|
14
14
|
type: 'string',
|
|
15
|
+
contentType: 'text',
|
|
15
16
|
}, media: withTheme({
|
|
16
17
|
type: 'object',
|
|
17
18
|
properties: MediaProps,
|
|
@@ -23,9 +24,7 @@ export const TabsBlock = {
|
|
|
23
24
|
'tabs-block': {
|
|
24
25
|
additionalProperties: false,
|
|
25
26
|
required: ['title', 'items'],
|
|
26
|
-
properties: Object.assign(Object.assign({}, BlockBaseProps), {
|
|
27
|
-
type: 'string',
|
|
28
|
-
}, 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: {
|
|
29
28
|
type: 'string',
|
|
30
29
|
enum: mediaDirection,
|
|
31
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
|
+
});
|