@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
|
@@ -5,6 +5,30 @@ export declare const CardWithImageItem: {
|
|
|
5
5
|
image: {
|
|
6
6
|
type: string;
|
|
7
7
|
};
|
|
8
|
+
description: {
|
|
9
|
+
type: string;
|
|
10
|
+
contentType: string;
|
|
11
|
+
};
|
|
12
|
+
disableCompress: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
border: {
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
fullScreen: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
links: {
|
|
22
|
+
type: string;
|
|
23
|
+
items: {
|
|
24
|
+
type: string;
|
|
25
|
+
properties: {
|
|
26
|
+
when: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
8
32
|
title: {
|
|
9
33
|
oneOf: ({
|
|
10
34
|
type: string;
|
|
@@ -13,6 +37,7 @@ export declare const CardWithImageItem: {
|
|
|
13
37
|
properties: {
|
|
14
38
|
text: {
|
|
15
39
|
type: string;
|
|
40
|
+
contentType: string;
|
|
16
41
|
};
|
|
17
42
|
textSize: {
|
|
18
43
|
type: string;
|
|
@@ -27,33 +52,12 @@ export declare const CardWithImageItem: {
|
|
|
27
52
|
};
|
|
28
53
|
} | {
|
|
29
54
|
type: string;
|
|
55
|
+
contentType: string;
|
|
30
56
|
})[];
|
|
31
57
|
};
|
|
32
|
-
description: {
|
|
33
|
-
type: string;
|
|
34
|
-
};
|
|
35
58
|
additionalInfo: {
|
|
36
59
|
type: string;
|
|
37
|
-
|
|
38
|
-
disableCompress: {
|
|
39
|
-
type: string;
|
|
40
|
-
};
|
|
41
|
-
border: {
|
|
42
|
-
type: string;
|
|
43
|
-
};
|
|
44
|
-
fullScreen: {
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
links: {
|
|
48
|
-
type: string;
|
|
49
|
-
items: {
|
|
50
|
-
type: string;
|
|
51
|
-
properties: {
|
|
52
|
-
when: {
|
|
53
|
-
type: string;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
};
|
|
60
|
+
contentType: string;
|
|
57
61
|
};
|
|
58
62
|
buttons: {
|
|
59
63
|
type: string;
|
|
@@ -78,6 +82,30 @@ export declare const CardWithImage: {
|
|
|
78
82
|
image: {
|
|
79
83
|
type: string;
|
|
80
84
|
};
|
|
85
|
+
description: {
|
|
86
|
+
type: string;
|
|
87
|
+
contentType: string;
|
|
88
|
+
};
|
|
89
|
+
disableCompress: {
|
|
90
|
+
type: string;
|
|
91
|
+
};
|
|
92
|
+
border: {
|
|
93
|
+
type: string;
|
|
94
|
+
};
|
|
95
|
+
fullScreen: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
links: {
|
|
99
|
+
type: string;
|
|
100
|
+
items: {
|
|
101
|
+
type: string;
|
|
102
|
+
properties: {
|
|
103
|
+
when: {
|
|
104
|
+
type: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
81
109
|
title: {
|
|
82
110
|
oneOf: ({
|
|
83
111
|
type: string;
|
|
@@ -86,6 +114,7 @@ export declare const CardWithImage: {
|
|
|
86
114
|
properties: {
|
|
87
115
|
text: {
|
|
88
116
|
type: string;
|
|
117
|
+
contentType: string;
|
|
89
118
|
};
|
|
90
119
|
textSize: {
|
|
91
120
|
type: string;
|
|
@@ -100,33 +129,12 @@ export declare const CardWithImage: {
|
|
|
100
129
|
};
|
|
101
130
|
} | {
|
|
102
131
|
type: string;
|
|
132
|
+
contentType: string;
|
|
103
133
|
})[];
|
|
104
134
|
};
|
|
105
|
-
description: {
|
|
106
|
-
type: string;
|
|
107
|
-
};
|
|
108
135
|
additionalInfo: {
|
|
109
136
|
type: string;
|
|
110
|
-
|
|
111
|
-
disableCompress: {
|
|
112
|
-
type: string;
|
|
113
|
-
};
|
|
114
|
-
border: {
|
|
115
|
-
type: string;
|
|
116
|
-
};
|
|
117
|
-
fullScreen: {
|
|
118
|
-
type: string;
|
|
119
|
-
};
|
|
120
|
-
links: {
|
|
121
|
-
type: string;
|
|
122
|
-
items: {
|
|
123
|
-
type: string;
|
|
124
|
-
properties: {
|
|
125
|
-
when: {
|
|
126
|
-
type: string;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
};
|
|
137
|
+
contentType: string;
|
|
130
138
|
};
|
|
131
139
|
buttons: {
|
|
132
140
|
type: string;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { omit } from 'lodash';
|
|
2
|
+
import { BaseProps, textSize } from '../../schema/validators/common';
|
|
2
3
|
import { filteredArray } from '../../schema/validators/utils';
|
|
4
|
+
import { ContentBase } from '../../sub-blocks/Content/schema';
|
|
5
|
+
const CardWithImageContentProps = omit(ContentBase, ['links', 'size', 'text', 'theme']);
|
|
3
6
|
const CardWithImageLinks = {
|
|
4
7
|
type: 'object',
|
|
5
8
|
additionalProperties: false,
|
|
6
9
|
required: ['title', 'link'],
|
|
7
10
|
properties: Object.assign(Object.assign({}, BaseProps), { title: {
|
|
8
11
|
type: 'string',
|
|
12
|
+
contentType: 'text',
|
|
9
13
|
}, link: {
|
|
10
14
|
type: 'string',
|
|
11
15
|
}, arrow: {
|
|
@@ -21,21 +25,18 @@ const CardWithImageLinks = {
|
|
|
21
25
|
export const CardWithImageItem = {
|
|
22
26
|
additionalProperties: false,
|
|
23
27
|
required: ['image'],
|
|
24
|
-
properties: Object.assign(Object.assign({}, BaseProps), { image: {
|
|
28
|
+
properties: Object.assign(Object.assign(Object.assign({}, BaseProps), CardWithImageContentProps), { image: {
|
|
25
29
|
type: 'string',
|
|
26
|
-
}, title: {
|
|
27
|
-
oneOf: [{ type: 'string' }, TitleProps],
|
|
28
30
|
}, description: {
|
|
29
31
|
type: 'string',
|
|
30
|
-
|
|
31
|
-
type: 'string',
|
|
32
|
+
contentType: 'yfm',
|
|
32
33
|
}, disableCompress: {
|
|
33
34
|
type: 'boolean',
|
|
34
35
|
}, border: {
|
|
35
36
|
type: 'boolean',
|
|
36
37
|
}, fullScreen: {
|
|
37
38
|
type: 'boolean',
|
|
38
|
-
}, links: filteredArray(CardWithImageLinks)
|
|
39
|
+
}, links: filteredArray(CardWithImageLinks) }),
|
|
39
40
|
};
|
|
40
41
|
export const CardWithImage = {
|
|
41
42
|
'card-with-image': CardWithImageItem,
|
|
@@ -7,6 +7,7 @@ export declare const ContentBase: {
|
|
|
7
7
|
properties: {
|
|
8
8
|
text: {
|
|
9
9
|
type: string;
|
|
10
|
+
contentType: string;
|
|
10
11
|
};
|
|
11
12
|
textSize: {
|
|
12
13
|
type: string;
|
|
@@ -21,13 +22,16 @@ export declare const ContentBase: {
|
|
|
21
22
|
};
|
|
22
23
|
} | {
|
|
23
24
|
type: string;
|
|
25
|
+
contentType: string;
|
|
24
26
|
})[];
|
|
25
27
|
};
|
|
26
28
|
text: {
|
|
27
29
|
type: string;
|
|
30
|
+
contentType: string;
|
|
28
31
|
};
|
|
29
32
|
additionalInfo: {
|
|
30
33
|
type: string;
|
|
34
|
+
contentType: string;
|
|
31
35
|
};
|
|
32
36
|
size: {
|
|
33
37
|
type: string;
|
|
@@ -76,6 +80,7 @@ export declare const ContentBlock: {
|
|
|
76
80
|
properties: {
|
|
77
81
|
text: {
|
|
78
82
|
type: string;
|
|
83
|
+
contentType: string;
|
|
79
84
|
};
|
|
80
85
|
textSize: {
|
|
81
86
|
type: string;
|
|
@@ -90,13 +95,16 @@ export declare const ContentBlock: {
|
|
|
90
95
|
};
|
|
91
96
|
} | {
|
|
92
97
|
type: string;
|
|
98
|
+
contentType: string;
|
|
93
99
|
})[];
|
|
94
100
|
};
|
|
95
101
|
text: {
|
|
96
102
|
type: string;
|
|
103
|
+
contentType: string;
|
|
97
104
|
};
|
|
98
105
|
additionalInfo: {
|
|
99
106
|
type: string;
|
|
107
|
+
contentType: string;
|
|
100
108
|
};
|
|
101
109
|
size: {
|
|
102
110
|
type: string;
|
|
@@ -2,13 +2,15 @@ import { containerSizesArray, contentSizes, contentThemes, LinkProps, sizeNumber
|
|
|
2
2
|
import { filteredArray } from '../../schema/validators/utils';
|
|
3
3
|
export const ContentBase = {
|
|
4
4
|
title: {
|
|
5
|
-
oneOf: [{ type: 'string' }, TitleProps],
|
|
5
|
+
oneOf: [{ type: 'string', contentType: 'text' }, TitleProps],
|
|
6
6
|
},
|
|
7
7
|
text: {
|
|
8
8
|
type: 'string',
|
|
9
|
+
contentType: 'yfm',
|
|
9
10
|
},
|
|
10
11
|
additionalInfo: {
|
|
11
12
|
type: 'string',
|
|
13
|
+
contentType: 'yfm',
|
|
12
14
|
},
|
|
13
15
|
size: {
|
|
14
16
|
type: 'string',
|
|
@@ -19,6 +19,7 @@ const PriceDetailedFoldableDetailsProps = {
|
|
|
19
19
|
properties: {
|
|
20
20
|
title: {
|
|
21
21
|
type: 'string',
|
|
22
|
+
contentType: 'text',
|
|
22
23
|
},
|
|
23
24
|
size: {
|
|
24
25
|
type: 'string',
|
|
@@ -72,6 +73,7 @@ const PriceDescriptionLabelProps = {
|
|
|
72
73
|
},
|
|
73
74
|
text: {
|
|
74
75
|
type: 'string',
|
|
76
|
+
contentType: 'text',
|
|
75
77
|
},
|
|
76
78
|
size: {
|
|
77
79
|
type: 'string',
|
|
@@ -82,12 +84,15 @@ const PriceDescriptionLabelProps = {
|
|
|
82
84
|
const PriceDescriptionProps = {
|
|
83
85
|
title: {
|
|
84
86
|
type: 'string',
|
|
87
|
+
contentType: 'text',
|
|
85
88
|
},
|
|
86
89
|
description: {
|
|
87
90
|
type: 'string',
|
|
91
|
+
contentType: 'yfm',
|
|
88
92
|
},
|
|
89
93
|
detailedTitle: {
|
|
90
94
|
type: 'string',
|
|
95
|
+
contentType: 'text',
|
|
91
96
|
},
|
|
92
97
|
label: PriceDescriptionLabelProps,
|
|
93
98
|
};
|
|
@@ -98,9 +103,11 @@ const PriceDetailsSettingsProps = {
|
|
|
98
103
|
properties: {
|
|
99
104
|
title: {
|
|
100
105
|
type: 'string',
|
|
106
|
+
contentType: 'text',
|
|
101
107
|
},
|
|
102
108
|
description: {
|
|
103
109
|
type: 'string',
|
|
110
|
+
contentType: 'yfm',
|
|
104
111
|
},
|
|
105
112
|
},
|
|
106
113
|
};
|
|
@@ -111,6 +118,7 @@ const PriceDetailsListProps = {
|
|
|
111
118
|
properties: {
|
|
112
119
|
text: {
|
|
113
120
|
type: 'string',
|
|
121
|
+
contentType: 'yfm',
|
|
114
122
|
},
|
|
115
123
|
},
|
|
116
124
|
};
|
|
@@ -5,6 +5,7 @@ export declare const Quote: {
|
|
|
5
5
|
properties: {
|
|
6
6
|
text: {
|
|
7
7
|
type: string;
|
|
8
|
+
contentType: string;
|
|
8
9
|
};
|
|
9
10
|
image: {
|
|
10
11
|
oneOf: ({
|
|
@@ -47,9 +48,11 @@ export declare const Quote: {
|
|
|
47
48
|
properties: {
|
|
48
49
|
firstName: {
|
|
49
50
|
type: string;
|
|
51
|
+
contentType: string;
|
|
50
52
|
};
|
|
51
53
|
secondName: {
|
|
52
54
|
type: string;
|
|
55
|
+
contentType: string;
|
|
53
56
|
};
|
|
54
57
|
avatar: {
|
|
55
58
|
type: string;
|
|
@@ -57,6 +60,7 @@ export declare const Quote: {
|
|
|
57
60
|
};
|
|
58
61
|
description: {
|
|
59
62
|
type: string;
|
|
63
|
+
contentType: string;
|
|
60
64
|
};
|
|
61
65
|
};
|
|
62
66
|
};
|
|
@@ -35,13 +35,6 @@ function parsePromoFeatures(transformer, items) {
|
|
|
35
35
|
return (Object.assign({ text: transformer(text) }, rest));
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
function parseSlider(transformer, block) {
|
|
39
|
-
const { title, description } = block;
|
|
40
|
-
block.title = Object.assign(Object.assign({}, title), { text: transformer(title ? title.text : '') });
|
|
41
|
-
if (description) {
|
|
42
|
-
block.description = transformer(description);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
38
|
const parseTitle = (transformer, title) => typeof title === 'object' && 'text' in title
|
|
46
39
|
? Object.assign(Object.assign({}, title), { text: transformer(title.text) }) : title && transformer(title);
|
|
47
40
|
const parseItemsTitle = (transformer, items) => items.map((_a) => {
|
|
@@ -95,6 +88,17 @@ export function yfmTransformer(lang, content) {
|
|
|
95
88
|
export function typografTransformer(lang, content) {
|
|
96
89
|
return typografToHTML(content, lang);
|
|
97
90
|
}
|
|
91
|
+
const blockHeaderTransfomer = [
|
|
92
|
+
{
|
|
93
|
+
fields: ['title'],
|
|
94
|
+
transformer: typografTransformer,
|
|
95
|
+
parser: parseTitle,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
fields: ['description'],
|
|
99
|
+
transformer: yfmTransformer,
|
|
100
|
+
},
|
|
101
|
+
];
|
|
98
102
|
const config = {
|
|
99
103
|
[SubBlockType.Partner]: {
|
|
100
104
|
fields: ['text'],
|
|
@@ -139,35 +143,35 @@ const config = {
|
|
|
139
143
|
transformer: typografTransformer,
|
|
140
144
|
},
|
|
141
145
|
[BlockType.ExtendedFeaturesBlock]: [
|
|
146
|
+
...blockHeaderTransfomer,
|
|
142
147
|
{
|
|
143
|
-
fields: ['
|
|
148
|
+
fields: ['items'],
|
|
144
149
|
transformer: typografTransformer,
|
|
145
|
-
parser:
|
|
150
|
+
parser: createItemsParser(['title']),
|
|
146
151
|
},
|
|
147
152
|
{
|
|
148
|
-
fields: ['
|
|
153
|
+
fields: ['items'],
|
|
149
154
|
transformer: yfmTransformer,
|
|
155
|
+
parser: createItemsParser(['text', 'additionalInfo']),
|
|
150
156
|
},
|
|
157
|
+
],
|
|
158
|
+
[BlockType.PromoFeaturesBlock]: [
|
|
151
159
|
{
|
|
152
|
-
fields: ['
|
|
160
|
+
fields: ['title'],
|
|
153
161
|
transformer: typografTransformer,
|
|
154
|
-
parser:
|
|
162
|
+
parser: parseTitle,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
fields: ['description'],
|
|
166
|
+
transformer: yfmTransformer,
|
|
155
167
|
},
|
|
156
168
|
{
|
|
157
169
|
fields: ['items'],
|
|
158
170
|
transformer: yfmTransformer,
|
|
159
|
-
parser:
|
|
171
|
+
parser: parsePromoFeatures,
|
|
160
172
|
},
|
|
161
173
|
],
|
|
162
|
-
[BlockType.
|
|
163
|
-
fields: ['items'],
|
|
164
|
-
transformer: yfmTransformer,
|
|
165
|
-
parser: parsePromoFeatures,
|
|
166
|
-
},
|
|
167
|
-
[BlockType.SliderBlock]: {
|
|
168
|
-
transformer: typografTransformer,
|
|
169
|
-
parser: parseSlider,
|
|
170
|
-
},
|
|
174
|
+
[BlockType.SliderBlock]: blockHeaderTransfomer,
|
|
171
175
|
[BlockType.QuestionsBlock]: [
|
|
172
176
|
{
|
|
173
177
|
fields: ['title'],
|
|
@@ -204,21 +208,14 @@ const config = {
|
|
|
204
208
|
},
|
|
205
209
|
],
|
|
206
210
|
[BlockType.MediaBlock]: [
|
|
211
|
+
...blockHeaderTransfomer,
|
|
207
212
|
{
|
|
208
|
-
fields: ['title'],
|
|
209
|
-
transformer: typografTransformer,
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
fields: ['description', 'title', 'additionalInfo'],
|
|
213
|
+
fields: ['title', 'additionalInfo'],
|
|
213
214
|
transformer: yfmTransformer,
|
|
214
215
|
},
|
|
215
216
|
],
|
|
216
217
|
[BlockType.TabsBlock]: [
|
|
217
|
-
|
|
218
|
-
fields: ['title'],
|
|
219
|
-
transformer: typografTransformer,
|
|
220
|
-
parser: parseTitle,
|
|
221
|
-
},
|
|
218
|
+
...blockHeaderTransfomer,
|
|
222
219
|
{
|
|
223
220
|
fields: ['items'],
|
|
224
221
|
transformer: yfmTransformer,
|
|
@@ -250,6 +247,11 @@ const config = {
|
|
|
250
247
|
},
|
|
251
248
|
],
|
|
252
249
|
[BlockType.SimpleBlock]: [
|
|
250
|
+
{
|
|
251
|
+
fields: ['title'],
|
|
252
|
+
transformer: typografTransformer,
|
|
253
|
+
parser: parseTitle,
|
|
254
|
+
},
|
|
253
255
|
{
|
|
254
256
|
fields: ['description'],
|
|
255
257
|
transformer: yfmTransformer,
|
|
@@ -295,7 +297,13 @@ const config = {
|
|
|
295
297
|
fields: ['description'],
|
|
296
298
|
transformer: yfmTransformer,
|
|
297
299
|
},
|
|
300
|
+
{
|
|
301
|
+
fields: ['title'],
|
|
302
|
+
transformer: typografTransformer,
|
|
303
|
+
parser: parseTitle,
|
|
304
|
+
},
|
|
298
305
|
],
|
|
306
|
+
[BlockType.PromoFeaturesBlock]: blockHeaderTransfomer,
|
|
299
307
|
[BlockType.InfoBlock]: [
|
|
300
308
|
{
|
|
301
309
|
fields: ['rightContent', 'leftContent'],
|
|
@@ -314,6 +322,15 @@ const config = {
|
|
|
314
322
|
transformer: typografTransformer,
|
|
315
323
|
},
|
|
316
324
|
],
|
|
325
|
+
[BlockType.CardLayoutBlock]: blockHeaderTransfomer,
|
|
326
|
+
[BlockType.IconsBlock]: [
|
|
327
|
+
{
|
|
328
|
+
fields: ['title'],
|
|
329
|
+
transformer: typografTransformer,
|
|
330
|
+
parser: parseTitle,
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
[BlockType.LinkTableBlock]: blockHeaderTransfomer,
|
|
317
334
|
};
|
|
318
335
|
function addRandomOrder(block) {
|
|
319
336
|
if (block) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.1-alpha.0",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@commitlint/cli": "^17.1.2",
|
|
68
68
|
"@commitlint/config-conventional": "^17.1.0",
|
|
69
|
-
"@doc-tools/transform": "
|
|
69
|
+
"@doc-tools/transform": "2.12.0",
|
|
70
70
|
"@gravity-ui/eslint-config": "^1.0.2",
|
|
71
71
|
"@gravity-ui/prettier-config": "^1.0.1",
|
|
72
72
|
"@gravity-ui/stylelint-config": "^1.0.0",
|
|
@@ -103,7 +103,6 @@
|
|
|
103
103
|
"lint-staged": "^11.2.6",
|
|
104
104
|
"markdown-loader": "^6.0.0",
|
|
105
105
|
"move-file-cli": "^3.0.0",
|
|
106
|
-
"mq-polyfill": "^1.1.8",
|
|
107
106
|
"npm-run-all": "^4.1.5",
|
|
108
107
|
"postcss": "^8.4.16",
|
|
109
108
|
"postcss-scss": "^4.0.4",
|