@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
|
@@ -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: {
|
|
@@ -4,9 +4,9 @@ import { block } from '../../utils';
|
|
|
4
4
|
import './MediaBaseContent.css';
|
|
5
5
|
const b = block('media-base-content');
|
|
6
6
|
const MediaContent = (props) => {
|
|
7
|
-
const { title, description, button, links, buttons = [], additionalInfo, size = 'l' } = props;
|
|
7
|
+
const { title, description, button, links, buttons = [], additionalInfo, size = 'l', list, } = props;
|
|
8
8
|
const allButtons = button ? [Object.assign(Object.assign({}, button), { size: 'xl' }), ...buttons] : buttons;
|
|
9
9
|
return (React.createElement("div", { className: b() },
|
|
10
|
-
React.createElement(Content, { title: title, text: description, links: links, theme: "default", buttons: allButtons, additionalInfo: additionalInfo, size: size, colSizes: { all: 12, md: 12 } })));
|
|
10
|
+
React.createElement(Content, { title: title, text: description, links: links, theme: "default", buttons: allButtons, list: list, additionalInfo: additionalInfo, size: size, colSizes: { all: 12, md: 12 } })));
|
|
11
11
|
};
|
|
12
12
|
export 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",
|
|
@@ -2,6 +2,7 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Portal } from '@gravity-ui/uikit';
|
|
4
4
|
import Foldable from '../../../components/Foldable/Foldable';
|
|
5
|
+
import { useMount } from '../../../hooks';
|
|
5
6
|
import { block } from '../../../utils';
|
|
6
7
|
import { ItemColumnName, NavigationLayout } from '../../models';
|
|
7
8
|
import { NavigationList } from '../NavigationList/NavigationList';
|
|
@@ -9,7 +10,9 @@ import './MobileNavigation.css';
|
|
|
9
10
|
const b = block('mobile-navigation');
|
|
10
11
|
const MobileNavigation = (_a) => {
|
|
11
12
|
var { isOpened, topItems, bottomItems } = _a, props = __rest(_a, ["isOpened", "topItems", "bottomItems"]);
|
|
12
|
-
|
|
13
|
+
const [isMounted, setIsMounted] = React.useState(false);
|
|
14
|
+
useMount(() => setIsMounted(true));
|
|
15
|
+
if (!isMounted) {
|
|
13
16
|
return null;
|
|
14
17
|
}
|
|
15
18
|
return (React.createElement(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[];
|
|
@@ -3,6 +3,7 @@ import { Button, Title, YFMWrapper } from '../../components';
|
|
|
3
3
|
import LinkBlock from '../../components/Link/Link';
|
|
4
4
|
import { Col } from '../../grid';
|
|
5
5
|
import { block } from '../../utils';
|
|
6
|
+
import ContentList from './ContentList/ContentList';
|
|
6
7
|
import './Content.css';
|
|
7
8
|
const b = block('content');
|
|
8
9
|
function getTextSize(size) {
|
|
@@ -33,7 +34,7 @@ function getButtonSize(size) {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
const Content = (props) => {
|
|
36
|
-
const { title, text, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, } = props;
|
|
37
|
+
const { title, text, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, list, } = props;
|
|
37
38
|
const titleProps = !title || typeof title === 'string'
|
|
38
39
|
? { text: title, textSize: getTextSize(size) }
|
|
39
40
|
: title;
|
|
@@ -42,6 +43,7 @@ const Content = (props) => {
|
|
|
42
43
|
title && React.createElement(Title, { className: b('title'), title: titleProps, colSizes: { all: 12 } }),
|
|
43
44
|
text && (React.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
|
|
44
45
|
React.createElement(YFMWrapper, { content: text, modifiers: { constructor: true, [`constructor-size-${size}`]: true } }))),
|
|
46
|
+
(list === null || list === void 0 ? void 0 : list.length) ? React.createElement(ContentList, { list: list, size: size }) : null,
|
|
45
47
|
additionalInfo && (React.createElement("div", { className: b('notice') },
|
|
46
48
|
React.createElement(YFMWrapper, { content: additionalInfo, modifiers: {
|
|
47
49
|
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,8 @@
|
|
|
1
|
+
import { ContentItemProps, ContentSize } from '../../../models';
|
|
2
|
+
import './ContentList.css';
|
|
3
|
+
interface ContentListProps {
|
|
4
|
+
list: ContentItemProps[];
|
|
5
|
+
size: ContentSize;
|
|
6
|
+
}
|
|
7
|
+
declare const ContentList: ({ list, size }: ContentListProps) => JSX.Element;
|
|
8
|
+
export default ContentList;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
+
import { YFMWrapper } from '../../../components';
|
|
4
|
+
import Image from '../../../components/Image/Image';
|
|
5
|
+
import { getMediaImage } from '../../../components/Media/Image/utils';
|
|
6
|
+
import { ThemeValueContext } from '../../../context/theme/ThemeValueContext';
|
|
7
|
+
import { block, getThemedValue } from '../../../utils';
|
|
8
|
+
import './ContentList.css';
|
|
9
|
+
const b = block('content-list');
|
|
10
|
+
const ContentList = ({ list, size }) => {
|
|
11
|
+
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
12
|
+
return (React.createElement("div", { className: b({ size }) }, list === null || list === void 0 ? void 0 : list.map((item) => {
|
|
13
|
+
const { icon, title, text } = item;
|
|
14
|
+
const iconThemed = getThemedValue(icon, theme);
|
|
15
|
+
const iconData = getMediaImage(iconThemed);
|
|
16
|
+
return (React.createElement("div", { className: b('item'), key: uuidv4() },
|
|
17
|
+
React.createElement(Image, Object.assign({}, iconData, { className: b('icon') })),
|
|
18
|
+
React.createElement("div", null,
|
|
19
|
+
title && React.createElement("h4", { className: b('title') }, title),
|
|
20
|
+
text && (React.createElement(YFMWrapper, { className: b('text'), content: text, modifiers: { constructor: true } })))));
|
|
21
|
+
})));
|
|
22
|
+
};
|
|
23
|
+
export 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,5 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImageProps } from '../../components/Image/schema';
|
|
2
|
+
import { ButtonBlock, LinkProps, TitleProps, containerSizesArray, contentSizes, contentThemes, sizeNumber, withTheme, } from '../../schema/validators/common';
|
|
2
3
|
import { filteredArray } from '../../schema/validators/utils';
|
|
4
|
+
export const ContentItem = {
|
|
5
|
+
additionalProperties: false,
|
|
6
|
+
required: ['icon'],
|
|
7
|
+
properties: {
|
|
8
|
+
title: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
contentType: 'text',
|
|
11
|
+
},
|
|
12
|
+
text: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
contentType: 'yfm',
|
|
15
|
+
},
|
|
16
|
+
icon: withTheme(ImageProps),
|
|
17
|
+
},
|
|
18
|
+
};
|
|
3
19
|
export const ContentBase = {
|
|
4
20
|
title: {
|
|
5
21
|
oneOf: [
|
|
@@ -30,6 +46,7 @@ export const ContentBase = {
|
|
|
30
46
|
type: 'string',
|
|
31
47
|
enum: contentThemes,
|
|
32
48
|
},
|
|
49
|
+
list: filteredArray(ContentItem),
|
|
33
50
|
};
|
|
34
51
|
export const ContentBlock = {
|
|
35
52
|
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;
|
|
@@ -48,7 +48,7 @@ function parsePriceDetailedBlock(transformer, block) {
|
|
|
48
48
|
}
|
|
49
49
|
const parseContentLayout = (transformer, content) => {
|
|
50
50
|
if (content) {
|
|
51
|
-
const { text, additionalInfo } = content;
|
|
51
|
+
const { text, additionalInfo, list } = content;
|
|
52
52
|
/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
|
|
53
53
|
if (text) {
|
|
54
54
|
content.text = transformer(text);
|
|
@@ -56,6 +56,14 @@ const parseContentLayout = (transformer, content) => {
|
|
|
56
56
|
if (additionalInfo) {
|
|
57
57
|
content.additionalInfo = transformer(additionalInfo);
|
|
58
58
|
}
|
|
59
|
+
if (list) {
|
|
60
|
+
content.list = list.map((item) => {
|
|
61
|
+
if (item === null || item === void 0 ? void 0 : item.text) {
|
|
62
|
+
return Object.assign(Object.assign({}, item), { text: transformer(item.text) });
|
|
63
|
+
}
|
|
64
|
+
return item;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
59
67
|
/* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
|
|
60
68
|
}
|
|
61
69
|
return content;
|
|
@@ -184,6 +192,11 @@ export const config = {
|
|
|
184
192
|
fields: ['title', 'additionalInfo'],
|
|
185
193
|
transformer: yfmTransformer,
|
|
186
194
|
},
|
|
195
|
+
{
|
|
196
|
+
fields: ['list'],
|
|
197
|
+
transformer: yfmTransformer,
|
|
198
|
+
parser: createItemsParser(['text']),
|
|
199
|
+
},
|
|
187
200
|
],
|
|
188
201
|
[BlockType.MapBlock]: [
|
|
189
202
|
...blockHeaderTransformer,
|
|
@@ -258,6 +271,11 @@ export const config = {
|
|
|
258
271
|
transformer: typografTransformer,
|
|
259
272
|
parser: parseTitle,
|
|
260
273
|
},
|
|
274
|
+
{
|
|
275
|
+
fields: ['list'],
|
|
276
|
+
transformer: yfmTransformer,
|
|
277
|
+
parser: createItemsParser(['text']),
|
|
278
|
+
},
|
|
261
279
|
],
|
|
262
280
|
[BlockType.InfoBlock]: [
|
|
263
281
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"test:watch": "jest --watchAll"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@gravity-ui/dynamic-forms": "^1.
|
|
83
|
+
"@gravity-ui/dynamic-forms": "^1.11.0",
|
|
84
84
|
"@gravity-ui/i18n": "^1.0.0",
|
|
85
85
|
"ajv": "^8.12.0",
|
|
86
86
|
"bem-cn-lite": "^4.0.0",
|
|
@@ -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",
|
|
@@ -61,7 +61,7 @@ function parsePriceDetailedBlock(transformer, block) {
|
|
|
61
61
|
}
|
|
62
62
|
const parseContentLayout = (transformer, content) => {
|
|
63
63
|
if (content) {
|
|
64
|
-
const { text, additionalInfo } = content;
|
|
64
|
+
const { text, additionalInfo, list } = content;
|
|
65
65
|
/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
|
|
66
66
|
if (text) {
|
|
67
67
|
content.text = transformer(text);
|
|
@@ -69,6 +69,14 @@ const parseContentLayout = (transformer, content) => {
|
|
|
69
69
|
if (additionalInfo) {
|
|
70
70
|
content.additionalInfo = transformer(additionalInfo);
|
|
71
71
|
}
|
|
72
|
+
if (list) {
|
|
73
|
+
content.list = list.map((item) => {
|
|
74
|
+
if (item === null || item === void 0 ? void 0 : item.text) {
|
|
75
|
+
return Object.assign(Object.assign({}, item), { text: transformer(item.text) });
|
|
76
|
+
}
|
|
77
|
+
return item;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
72
80
|
/* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
|
|
73
81
|
}
|
|
74
82
|
return content;
|
|
@@ -197,6 +205,11 @@ exports.config = {
|
|
|
197
205
|
fields: ['title', 'additionalInfo'],
|
|
198
206
|
transformer: common_1.yfmTransformer,
|
|
199
207
|
},
|
|
208
|
+
{
|
|
209
|
+
fields: ['list'],
|
|
210
|
+
transformer: common_1.yfmTransformer,
|
|
211
|
+
parser: (0, common_1.createItemsParser)(['text']),
|
|
212
|
+
},
|
|
200
213
|
],
|
|
201
214
|
[models_1.BlockType.MapBlock]: [
|
|
202
215
|
...exports.blockHeaderTransformer,
|
|
@@ -271,6 +284,11 @@ exports.config = {
|
|
|
271
284
|
transformer: common_1.typografTransformer,
|
|
272
285
|
parser: parseTitle,
|
|
273
286
|
},
|
|
287
|
+
{
|
|
288
|
+
fields: ['list'],
|
|
289
|
+
transformer: common_1.yfmTransformer,
|
|
290
|
+
parser: (0, common_1.createItemsParser)(['text']),
|
|
291
|
+
},
|
|
274
292
|
],
|
|
275
293
|
[models_1.BlockType.InfoBlock]: [
|
|
276
294
|
{
|