@gravity-ui/page-constructor 3.14.0 → 3.16.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/build/cjs/blocks/ContentLayout/ContentLayout.css +0 -3
- package/build/cjs/blocks/ContentLayout/schema.d.ts +16 -7
- package/build/cjs/blocks/Info/schema.d.ts +22 -0
- package/build/cjs/blocks/Map/schema.d.ts +11 -0
- package/build/cjs/blocks/Media/schema.d.ts +22 -0
- package/build/cjs/blocks/Questions/schema.d.ts +11 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +11 -0
- package/build/cjs/components/MediaBase/MediaBaseContent.js +2 -2
- package/build/cjs/models/constructor-items/blocks.d.ts +8 -5
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.js +4 -1
- package/build/cjs/schema/constants.d.ts +22 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +11 -0
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +11 -0
- package/build/cjs/sub-blocks/Content/Content.js +3 -1
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.css +48 -0
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.d.ts +7 -0
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.js +25 -0
- package/build/cjs/sub-blocks/Content/schema.d.ts +60 -0
- package/build/cjs/sub-blocks/Content/schema.js +18 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +11 -0
- package/build/cjs/text-transform/config.js +19 -1
- package/build/esm/blocks/ContentLayout/ContentLayout.css +0 -3
- package/build/esm/blocks/ContentLayout/schema.d.ts +16 -7
- package/build/esm/blocks/Info/schema.d.ts +22 -0
- package/build/esm/blocks/Map/schema.d.ts +11 -0
- package/build/esm/blocks/Media/schema.d.ts +22 -0
- package/build/esm/blocks/Questions/schema.d.ts +11 -0
- package/build/esm/blocks/Tabs/schema.d.ts +11 -0
- package/build/esm/components/MediaBase/MediaBaseContent.js +2 -2
- package/build/esm/models/constructor-items/blocks.d.ts +8 -5
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.js +4 -1
- package/build/esm/schema/constants.d.ts +22 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +11 -0
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +11 -0
- package/build/esm/sub-blocks/Content/Content.js +3 -1
- package/build/esm/sub-blocks/Content/ContentList/ContentList.css +48 -0
- package/build/esm/sub-blocks/Content/ContentList/ContentList.d.ts +8 -0
- package/build/esm/sub-blocks/Content/ContentList/ContentList.js +23 -0
- package/build/esm/sub-blocks/Content/schema.d.ts +60 -0
- package/build/esm/sub-blocks/Content/schema.js +18 -1
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +11 -0
- package/build/esm/text-transform/config.js +19 -1
- package/package.json +2 -2
- package/server/models/constructor-items/blocks.d.ts +8 -5
- package/server/text-transform/config.js +19 -1
- package/widget/index.js +1 -1
|
@@ -70,7 +70,9 @@ export declare const ContentLayoutBlock: {
|
|
|
70
70
|
};
|
|
71
71
|
contentType?: undefined;
|
|
72
72
|
})[];
|
|
73
|
-
};
|
|
73
|
+
}; /**
|
|
74
|
+
* @deprecated Use params on top level instead
|
|
75
|
+
*/
|
|
74
76
|
text: {
|
|
75
77
|
type: string;
|
|
76
78
|
contentType: string;
|
|
@@ -108,12 +110,19 @@ export declare const ContentLayoutBlock: {
|
|
|
108
110
|
};
|
|
109
111
|
theme: {
|
|
110
112
|
type: string;
|
|
111
|
-
enum: string[];
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
enum: string[];
|
|
114
|
+
};
|
|
115
|
+
list: {
|
|
116
|
+
type: string;
|
|
117
|
+
items: {
|
|
118
|
+
type: string;
|
|
119
|
+
properties: {
|
|
120
|
+
when: {
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
117
126
|
};
|
|
118
127
|
};
|
|
119
128
|
fileContent: {
|
|
@@ -121,6 +121,17 @@ export declare const InfoBlock: {
|
|
|
121
121
|
type: string;
|
|
122
122
|
enum: string[];
|
|
123
123
|
};
|
|
124
|
+
list: {
|
|
125
|
+
type: string;
|
|
126
|
+
items: {
|
|
127
|
+
type: string;
|
|
128
|
+
properties: {
|
|
129
|
+
when: {
|
|
130
|
+
type: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
};
|
|
124
135
|
}>;
|
|
125
136
|
};
|
|
126
137
|
rightContent: {
|
|
@@ -194,6 +205,17 @@ export declare const InfoBlock: {
|
|
|
194
205
|
type: string;
|
|
195
206
|
enum: string[];
|
|
196
207
|
};
|
|
208
|
+
list: {
|
|
209
|
+
type: string;
|
|
210
|
+
items: {
|
|
211
|
+
type: string;
|
|
212
|
+
properties: {
|
|
213
|
+
when: {
|
|
214
|
+
type: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
197
219
|
}>;
|
|
198
220
|
};
|
|
199
221
|
type: {};
|
|
@@ -542,6 +542,17 @@ export declare const MediaBlockBaseProps: {
|
|
|
542
542
|
};
|
|
543
543
|
};
|
|
544
544
|
};
|
|
545
|
+
list: {
|
|
546
|
+
type: string;
|
|
547
|
+
items: {
|
|
548
|
+
type: string;
|
|
549
|
+
properties: {
|
|
550
|
+
when: {
|
|
551
|
+
type: string;
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
};
|
|
545
556
|
animated: {
|
|
546
557
|
type: string;
|
|
547
558
|
};
|
|
@@ -1132,6 +1143,17 @@ export declare const MediaBlock: {
|
|
|
1132
1143
|
};
|
|
1133
1144
|
};
|
|
1134
1145
|
};
|
|
1146
|
+
list: {
|
|
1147
|
+
type: string;
|
|
1148
|
+
items: {
|
|
1149
|
+
type: string;
|
|
1150
|
+
properties: {
|
|
1151
|
+
when: {
|
|
1152
|
+
type: string;
|
|
1153
|
+
};
|
|
1154
|
+
};
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
1135
1157
|
animated: {
|
|
1136
1158
|
type: string;
|
|
1137
1159
|
};
|
|
@@ -74,6 +74,17 @@ export declare const QuestionsBlock: {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
+
list: {
|
|
78
|
+
type: string;
|
|
79
|
+
items: {
|
|
80
|
+
type: string;
|
|
81
|
+
properties: {
|
|
82
|
+
when: {
|
|
83
|
+
type: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
77
88
|
anchor: {
|
|
78
89
|
type: string;
|
|
79
90
|
additionalProperties: boolean;
|
|
@@ -450,6 +450,17 @@ export declare const tabsItem: {
|
|
|
450
450
|
type: string;
|
|
451
451
|
enum: string[];
|
|
452
452
|
} | undefined;
|
|
453
|
+
list?: {
|
|
454
|
+
type: string;
|
|
455
|
+
items: {
|
|
456
|
+
type: string;
|
|
457
|
+
properties: {
|
|
458
|
+
when: {
|
|
459
|
+
type: string;
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
} | undefined;
|
|
453
464
|
};
|
|
454
465
|
};
|
|
455
466
|
export declare const TabsBlock: {
|
|
@@ -6,9 +6,9 @@ const sub_blocks_1 = require("../../sub-blocks");
|
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const b = (0, utils_1.block)('media-base-content');
|
|
8
8
|
const MediaContent = (props) => {
|
|
9
|
-
const { title, description, button, links, buttons = [], additionalInfo, size = 'l' } = props;
|
|
9
|
+
const { title, description, button, links, buttons = [], additionalInfo, size = 'l', list, } = props;
|
|
10
10
|
const allButtons = button ? [Object.assign(Object.assign({}, button), { size: 'xl' }), ...buttons] : buttons;
|
|
11
11
|
return (react_1.default.createElement("div", { className: b() },
|
|
12
|
-
react_1.default.createElement(sub_blocks_1.Content, { title: title, text: description, links: links, theme: "default", buttons: allButtons, additionalInfo: additionalInfo, size: size, colSizes: { all: 12, md: 12 } })));
|
|
12
|
+
react_1.default.createElement(sub_blocks_1.Content, { title: title, text: description, links: links, theme: "default", buttons: allButtons, list: list, additionalInfo: additionalInfo, size: size, colSizes: { all: 12, md: 12 } })));
|
|
13
13
|
};
|
|
14
14
|
exports.default = MediaContent;
|
|
@@ -154,14 +154,11 @@ export interface MediaBaseBlockProps extends Animatable, MediaContentProps {
|
|
|
154
154
|
mediaOnly?: boolean;
|
|
155
155
|
disableShadow?: boolean;
|
|
156
156
|
}
|
|
157
|
-
export interface MediaContentProps {
|
|
157
|
+
export interface MediaContentProps extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'title' | 'theme' | 'centered'> {
|
|
158
158
|
title: string;
|
|
159
159
|
description?: string;
|
|
160
|
-
|
|
160
|
+
/** @deprecated Use array of buttons from ContentBlockProps instead**/
|
|
161
161
|
button?: ButtonProps;
|
|
162
|
-
links?: LinkProps[];
|
|
163
|
-
buttons?: ButtonProps[];
|
|
164
|
-
size?: ContentSize;
|
|
165
162
|
}
|
|
166
163
|
export interface MediaBlockProps extends MediaBaseBlockProps {
|
|
167
164
|
media: ThemeSupporting<MediaProps>;
|
|
@@ -259,6 +256,11 @@ export interface ContentLayoutBlockProps extends ContentLayoutBlockParams {
|
|
|
259
256
|
textContent: ContentBlockProps;
|
|
260
257
|
fileContent?: FileLinkProps[];
|
|
261
258
|
}
|
|
259
|
+
export interface ContentItemProps {
|
|
260
|
+
title?: string;
|
|
261
|
+
text?: string;
|
|
262
|
+
icon: ThemedImage;
|
|
263
|
+
}
|
|
262
264
|
export interface ContentBlockProps {
|
|
263
265
|
title?: TitleItemBaseProps | string;
|
|
264
266
|
text?: string;
|
|
@@ -269,6 +271,7 @@ export interface ContentBlockProps {
|
|
|
269
271
|
colSizes?: GridColumnSizesType;
|
|
270
272
|
centered?: boolean;
|
|
271
273
|
theme?: ContentTheme;
|
|
274
|
+
list?: ContentItemProps[];
|
|
272
275
|
}
|
|
273
276
|
export declare enum PCShareSocialNetwork {
|
|
274
277
|
Vk = "vk",
|
|
@@ -4,13 +4,16 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const Foldable_1 = tslib_1.__importDefault(require("../../../components/Foldable/Foldable"));
|
|
7
|
+
const hooks_1 = require("../../../hooks");
|
|
7
8
|
const utils_1 = require("../../../utils");
|
|
8
9
|
const models_1 = require("../../models");
|
|
9
10
|
const NavigationList_1 = require("../NavigationList/NavigationList");
|
|
10
11
|
const b = (0, utils_1.block)('mobile-navigation');
|
|
11
12
|
const MobileNavigation = (_a) => {
|
|
12
13
|
var { isOpened, topItems, bottomItems } = _a, props = tslib_1.__rest(_a, ["isOpened", "topItems", "bottomItems"]);
|
|
13
|
-
|
|
14
|
+
const [isMounted, setIsMounted] = react_1.default.useState(false);
|
|
15
|
+
(0, hooks_1.useMount)(() => setIsMounted(true));
|
|
16
|
+
if (!isMounted) {
|
|
14
17
|
return null;
|
|
15
18
|
}
|
|
16
19
|
return (react_1.default.createElement(uikit_1.Portal, null,
|
|
@@ -86,6 +86,17 @@ export declare const cardSchemas: {
|
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
+
list: {
|
|
90
|
+
type: string;
|
|
91
|
+
items: {
|
|
92
|
+
type: string;
|
|
93
|
+
properties: {
|
|
94
|
+
when: {
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
89
100
|
border: {
|
|
90
101
|
type: string;
|
|
91
102
|
enum: string[];
|
|
@@ -279,6 +290,17 @@ export declare const cardSchemas: {
|
|
|
279
290
|
};
|
|
280
291
|
};
|
|
281
292
|
};
|
|
293
|
+
list: {
|
|
294
|
+
type: string;
|
|
295
|
+
items: {
|
|
296
|
+
type: string;
|
|
297
|
+
properties: {
|
|
298
|
+
when: {
|
|
299
|
+
type: string;
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
};
|
|
282
304
|
border: {
|
|
283
305
|
type: string;
|
|
284
306
|
enum: string[];
|
|
@@ -105,6 +105,17 @@ export declare const BackgroundCard: {
|
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
+
list: {
|
|
109
|
+
type: string;
|
|
110
|
+
items: {
|
|
111
|
+
type: string;
|
|
112
|
+
properties: {
|
|
113
|
+
when: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
108
119
|
border: {
|
|
109
120
|
type: string;
|
|
110
121
|
enum: string[];
|
|
@@ -6,6 +6,7 @@ const components_1 = require("../../components");
|
|
|
6
6
|
const Link_1 = tslib_1.__importDefault(require("../../components/Link/Link"));
|
|
7
7
|
const grid_1 = require("../../grid");
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
|
+
const ContentList_1 = tslib_1.__importDefault(require("./ContentList/ContentList"));
|
|
9
10
|
const b = (0, utils_1.block)('content');
|
|
10
11
|
function getTextSize(size) {
|
|
11
12
|
switch (size) {
|
|
@@ -35,7 +36,7 @@ function getButtonSize(size) {
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
const Content = (props) => {
|
|
38
|
-
const { title, text, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, } = props;
|
|
39
|
+
const { title, text, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, list, } = props;
|
|
39
40
|
const titleProps = !title || typeof title === 'string'
|
|
40
41
|
? { text: title, textSize: getTextSize(size) }
|
|
41
42
|
: title;
|
|
@@ -44,6 +45,7 @@ const Content = (props) => {
|
|
|
44
45
|
title && react_1.default.createElement(components_1.Title, { className: b('title'), title: titleProps, colSizes: { all: 12 } }),
|
|
45
46
|
text && (react_1.default.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
|
|
46
47
|
react_1.default.createElement(components_1.YFMWrapper, { content: text, modifiers: { constructor: true, [`constructor-size-${size}`]: true } }))),
|
|
48
|
+
(list === null || list === void 0 ? void 0 : list.length) ? react_1.default.createElement(ContentList_1.default, { list: list, size: size }) : null,
|
|
47
49
|
additionalInfo && (react_1.default.createElement("div", { className: b('notice') },
|
|
48
50
|
react_1.default.createElement(components_1.YFMWrapper, { content: additionalInfo, modifiers: {
|
|
49
51
|
constructor: true,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-content-list_size_l {
|
|
4
|
+
margin-top: 24px;
|
|
5
|
+
}
|
|
6
|
+
.pc-content-list_size_l .pc-content-list__title {
|
|
7
|
+
font-size: var(--yc-text-header-1-font-size);
|
|
8
|
+
line-height: var(--yc-text-header-1-line-height);
|
|
9
|
+
margin: 0 0 8px;
|
|
10
|
+
}
|
|
11
|
+
.pc-content-list_size_l .pc-content-list__icon {
|
|
12
|
+
width: 22px;
|
|
13
|
+
height: 22px;
|
|
14
|
+
margin-top: 1px;
|
|
15
|
+
margin-bottom: 1px;
|
|
16
|
+
margin-right: 12px;
|
|
17
|
+
}
|
|
18
|
+
.pc-content-list_size_l .pc-content-list__item:not(:last-child) {
|
|
19
|
+
margin-bottom: 16px;
|
|
20
|
+
}
|
|
21
|
+
.pc-content-list_size_s {
|
|
22
|
+
margin-top: 16px;
|
|
23
|
+
}
|
|
24
|
+
.pc-content-list_size_s .pc-content-list__title {
|
|
25
|
+
font-size: var(--yc-text-subheader-3-font-size);
|
|
26
|
+
line-height: var(--yc-text-subheader-3-line-height);
|
|
27
|
+
margin: 0 0 calc(8px / 2);
|
|
28
|
+
}
|
|
29
|
+
.pc-content-list_size_s .pc-content-list__icon {
|
|
30
|
+
width: 20px;
|
|
31
|
+
height: 20px;
|
|
32
|
+
margin-top: 2px;
|
|
33
|
+
margin-bottom: 2px;
|
|
34
|
+
margin-right: 8px;
|
|
35
|
+
}
|
|
36
|
+
.pc-content-list_size_s .pc-content-list__text {
|
|
37
|
+
font-size: var(--yc-text-body-1-font-size);
|
|
38
|
+
line-height: var(--yc-text-body-1-line-height);
|
|
39
|
+
}
|
|
40
|
+
.pc-content-list_size_s .pc-content-list__item:not(:last-child) {
|
|
41
|
+
margin-bottom: 12px;
|
|
42
|
+
}
|
|
43
|
+
.pc-content-list__icon {
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
.pc-content-list__item {
|
|
47
|
+
display: flex;
|
|
48
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
6
|
+
const components_1 = require("../../../components");
|
|
7
|
+
const Image_1 = tslib_1.__importDefault(require("../../../components/Image/Image"));
|
|
8
|
+
const utils_1 = require("../../../components/Media/Image/utils");
|
|
9
|
+
const ThemeValueContext_1 = require("../../../context/theme/ThemeValueContext");
|
|
10
|
+
const utils_2 = require("../../../utils");
|
|
11
|
+
const b = (0, utils_2.block)('content-list');
|
|
12
|
+
const ContentList = ({ list, size }) => {
|
|
13
|
+
const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
|
|
14
|
+
return (react_1.default.createElement("div", { className: b({ size }) }, list === null || list === void 0 ? void 0 : list.map((item) => {
|
|
15
|
+
const { icon, title, text } = item;
|
|
16
|
+
const iconThemed = (0, utils_2.getThemedValue)(icon, theme);
|
|
17
|
+
const iconData = (0, utils_1.getMediaImage)(iconThemed);
|
|
18
|
+
return (react_1.default.createElement("div", { className: b('item'), key: (0, uuid_1.v4)() },
|
|
19
|
+
react_1.default.createElement(Image_1.default, Object.assign({}, iconData, { className: b('icon') })),
|
|
20
|
+
react_1.default.createElement("div", null,
|
|
21
|
+
title && react_1.default.createElement("h4", { className: b('title') }, title),
|
|
22
|
+
text && (react_1.default.createElement(components_1.YFMWrapper, { className: b('text'), content: text, modifiers: { constructor: true } })))));
|
|
23
|
+
})));
|
|
24
|
+
};
|
|
25
|
+
exports.default = ContentList;
|
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
export declare const ContentItem: {
|
|
2
|
+
additionalProperties: boolean;
|
|
3
|
+
required: string[];
|
|
4
|
+
properties: {
|
|
5
|
+
title: {
|
|
6
|
+
type: string;
|
|
7
|
+
contentType: string;
|
|
8
|
+
};
|
|
9
|
+
text: {
|
|
10
|
+
type: string;
|
|
11
|
+
contentType: string;
|
|
12
|
+
};
|
|
13
|
+
icon: {
|
|
14
|
+
oneOf: (({
|
|
15
|
+
oneOf: ({
|
|
16
|
+
type: string;
|
|
17
|
+
properties: {
|
|
18
|
+
when: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
23
|
+
type: string;
|
|
24
|
+
pattern: string;
|
|
25
|
+
optionName: string;
|
|
26
|
+
})[];
|
|
27
|
+
} & {
|
|
28
|
+
optionName: string;
|
|
29
|
+
}) | {
|
|
30
|
+
type: string;
|
|
31
|
+
additionalProperties: boolean;
|
|
32
|
+
required: import("../..").Theme[];
|
|
33
|
+
properties: {};
|
|
34
|
+
optionName: string;
|
|
35
|
+
})[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
1
39
|
export declare const ContentBase: {
|
|
2
40
|
title: {
|
|
3
41
|
oneOf: ({
|
|
@@ -67,6 +105,17 @@ export declare const ContentBase: {
|
|
|
67
105
|
type: string;
|
|
68
106
|
enum: string[];
|
|
69
107
|
};
|
|
108
|
+
list: {
|
|
109
|
+
type: string;
|
|
110
|
+
items: {
|
|
111
|
+
type: string;
|
|
112
|
+
properties: {
|
|
113
|
+
when: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
70
119
|
};
|
|
71
120
|
export declare const ContentBlock: {
|
|
72
121
|
content: {
|
|
@@ -144,6 +193,17 @@ export declare const ContentBlock: {
|
|
|
144
193
|
type: string;
|
|
145
194
|
enum: string[];
|
|
146
195
|
};
|
|
196
|
+
list: {
|
|
197
|
+
type: string;
|
|
198
|
+
items: {
|
|
199
|
+
type: string;
|
|
200
|
+
properties: {
|
|
201
|
+
when: {
|
|
202
|
+
type: string;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
};
|
|
147
207
|
};
|
|
148
208
|
};
|
|
149
209
|
};
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContentBlock = exports.ContentBase = void 0;
|
|
3
|
+
exports.ContentBlock = exports.ContentBase = exports.ContentItem = void 0;
|
|
4
|
+
const schema_1 = require("../../components/Image/schema");
|
|
4
5
|
const common_1 = require("../../schema/validators/common");
|
|
5
6
|
const utils_1 = require("../../schema/validators/utils");
|
|
7
|
+
exports.ContentItem = {
|
|
8
|
+
additionalProperties: false,
|
|
9
|
+
required: ['icon'],
|
|
10
|
+
properties: {
|
|
11
|
+
title: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
contentType: 'text',
|
|
14
|
+
},
|
|
15
|
+
text: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
contentType: 'yfm',
|
|
18
|
+
},
|
|
19
|
+
icon: (0, common_1.withTheme)(schema_1.ImageProps),
|
|
20
|
+
},
|
|
21
|
+
};
|
|
6
22
|
exports.ContentBase = {
|
|
7
23
|
title: {
|
|
8
24
|
oneOf: [
|
|
@@ -33,6 +49,7 @@ exports.ContentBase = {
|
|
|
33
49
|
type: 'string',
|
|
34
50
|
enum: common_1.contentThemes,
|
|
35
51
|
},
|
|
52
|
+
list: (0, utils_1.filteredArray)(exports.ContentItem),
|
|
36
53
|
};
|
|
37
54
|
exports.ContentBlock = {
|
|
38
55
|
content: {
|
|
@@ -293,6 +293,17 @@ export declare const LayoutItem: {
|
|
|
293
293
|
type: string;
|
|
294
294
|
enum: string[];
|
|
295
295
|
};
|
|
296
|
+
list: {
|
|
297
|
+
type: string;
|
|
298
|
+
items: {
|
|
299
|
+
type: string;
|
|
300
|
+
properties: {
|
|
301
|
+
when: {
|
|
302
|
+
type: string;
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
};
|
|
296
307
|
}>;
|
|
297
308
|
metaInfo: {
|
|
298
309
|
type: string;
|
|
@@ -51,7 +51,7 @@ function parsePriceDetailedBlock(transformer, block) {
|
|
|
51
51
|
}
|
|
52
52
|
const parseContentLayout = (transformer, content) => {
|
|
53
53
|
if (content) {
|
|
54
|
-
const { text, additionalInfo } = content;
|
|
54
|
+
const { text, additionalInfo, list } = content;
|
|
55
55
|
/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
|
|
56
56
|
if (text) {
|
|
57
57
|
content.text = transformer(text);
|
|
@@ -59,6 +59,14 @@ const parseContentLayout = (transformer, content) => {
|
|
|
59
59
|
if (additionalInfo) {
|
|
60
60
|
content.additionalInfo = transformer(additionalInfo);
|
|
61
61
|
}
|
|
62
|
+
if (list) {
|
|
63
|
+
content.list = list.map((item) => {
|
|
64
|
+
if (item === null || item === void 0 ? void 0 : item.text) {
|
|
65
|
+
return Object.assign(Object.assign({}, item), { text: transformer(item.text) });
|
|
66
|
+
}
|
|
67
|
+
return item;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
62
70
|
/* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
|
|
63
71
|
}
|
|
64
72
|
return content;
|
|
@@ -187,6 +195,11 @@ exports.config = {
|
|
|
187
195
|
fields: ['title', 'additionalInfo'],
|
|
188
196
|
transformer: common_1.yfmTransformer,
|
|
189
197
|
},
|
|
198
|
+
{
|
|
199
|
+
fields: ['list'],
|
|
200
|
+
transformer: common_1.yfmTransformer,
|
|
201
|
+
parser: (0, common_1.createItemsParser)(['text']),
|
|
202
|
+
},
|
|
190
203
|
],
|
|
191
204
|
[models_1.BlockType.MapBlock]: [
|
|
192
205
|
...exports.blockHeaderTransformer,
|
|
@@ -261,6 +274,11 @@ exports.config = {
|
|
|
261
274
|
transformer: common_1.typografTransformer,
|
|
262
275
|
parser: parseTitle,
|
|
263
276
|
},
|
|
277
|
+
{
|
|
278
|
+
fields: ['list'],
|
|
279
|
+
transformer: common_1.yfmTransformer,
|
|
280
|
+
parser: (0, common_1.createItemsParser)(['text']),
|
|
281
|
+
},
|
|
264
282
|
],
|
|
265
283
|
[models_1.BlockType.InfoBlock]: [
|
|
266
284
|
{
|
|
@@ -70,7 +70,9 @@ export declare const ContentLayoutBlock: {
|
|
|
70
70
|
};
|
|
71
71
|
contentType?: undefined;
|
|
72
72
|
})[];
|
|
73
|
-
};
|
|
73
|
+
}; /**
|
|
74
|
+
* @deprecated Use params on top level instead
|
|
75
|
+
*/
|
|
74
76
|
text: {
|
|
75
77
|
type: string;
|
|
76
78
|
contentType: string;
|
|
@@ -108,12 +110,19 @@ export declare const ContentLayoutBlock: {
|
|
|
108
110
|
};
|
|
109
111
|
theme: {
|
|
110
112
|
type: string;
|
|
111
|
-
enum: string[];
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
enum: string[];
|
|
114
|
+
};
|
|
115
|
+
list: {
|
|
116
|
+
type: string;
|
|
117
|
+
items: {
|
|
118
|
+
type: string;
|
|
119
|
+
properties: {
|
|
120
|
+
when: {
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
117
126
|
};
|
|
118
127
|
};
|
|
119
128
|
fileContent: {
|