@gravity-ui/page-constructor 3.15.0 → 3.17.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.
Files changed (56) hide show
  1. package/build/cjs/blocks/ContentLayout/ContentLayout.css +0 -3
  2. package/build/cjs/blocks/ContentLayout/schema.d.ts +16 -7
  3. package/build/cjs/blocks/Info/schema.d.ts +22 -0
  4. package/build/cjs/blocks/Map/schema.d.ts +11 -0
  5. package/build/cjs/blocks/Media/schema.d.ts +22 -0
  6. package/build/cjs/blocks/Questions/schema.d.ts +11 -0
  7. package/build/cjs/blocks/Tabs/schema.d.ts +11 -0
  8. package/build/cjs/components/MediaBase/MediaBaseContent.js +2 -2
  9. package/build/cjs/models/constructor-items/blocks.d.ts +8 -5
  10. package/build/cjs/models/constructor-items/sub-blocks.d.ts +5 -0
  11. package/build/cjs/models/constructor-items/sub-blocks.js +6 -1
  12. package/build/cjs/schema/constants.d.ts +26 -0
  13. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +11 -0
  14. package/build/cjs/sub-blocks/BasicCard/BasicCard.css +15 -0
  15. package/build/cjs/sub-blocks/BasicCard/BasicCard.js +5 -3
  16. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +15 -0
  17. package/build/cjs/sub-blocks/BasicCard/schema.js +3 -0
  18. package/build/cjs/sub-blocks/Content/Content.js +3 -1
  19. package/build/cjs/sub-blocks/Content/ContentList/ContentList.css +48 -0
  20. package/build/cjs/sub-blocks/Content/ContentList/ContentList.d.ts +7 -0
  21. package/build/cjs/sub-blocks/Content/ContentList/ContentList.js +25 -0
  22. package/build/cjs/sub-blocks/Content/schema.d.ts +60 -0
  23. package/build/cjs/sub-blocks/Content/schema.js +18 -1
  24. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +11 -0
  25. package/build/cjs/text-transform/config.js +19 -1
  26. package/build/esm/blocks/ContentLayout/ContentLayout.css +0 -3
  27. package/build/esm/blocks/ContentLayout/schema.d.ts +16 -7
  28. package/build/esm/blocks/Info/schema.d.ts +22 -0
  29. package/build/esm/blocks/Map/schema.d.ts +11 -0
  30. package/build/esm/blocks/Media/schema.d.ts +22 -0
  31. package/build/esm/blocks/Questions/schema.d.ts +11 -0
  32. package/build/esm/blocks/Tabs/schema.d.ts +11 -0
  33. package/build/esm/components/MediaBase/MediaBaseContent.js +2 -2
  34. package/build/esm/models/constructor-items/blocks.d.ts +8 -5
  35. package/build/esm/models/constructor-items/sub-blocks.d.ts +5 -0
  36. package/build/esm/models/constructor-items/sub-blocks.js +5 -0
  37. package/build/esm/schema/constants.d.ts +26 -0
  38. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +11 -0
  39. package/build/esm/sub-blocks/BasicCard/BasicCard.css +15 -0
  40. package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -3
  41. package/build/esm/sub-blocks/BasicCard/schema.d.ts +15 -0
  42. package/build/esm/sub-blocks/BasicCard/schema.js +3 -0
  43. package/build/esm/sub-blocks/Content/Content.js +3 -1
  44. package/build/esm/sub-blocks/Content/ContentList/ContentList.css +48 -0
  45. package/build/esm/sub-blocks/Content/ContentList/ContentList.d.ts +8 -0
  46. package/build/esm/sub-blocks/Content/ContentList/ContentList.js +23 -0
  47. package/build/esm/sub-blocks/Content/schema.d.ts +60 -0
  48. package/build/esm/sub-blocks/Content/schema.js +18 -1
  49. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +11 -0
  50. package/build/esm/text-transform/config.js +19 -1
  51. package/package.json +2 -2
  52. package/server/models/constructor-items/blocks.d.ts +8 -5
  53. package/server/models/constructor-items/sub-blocks.d.ts +5 -0
  54. package/server/models/constructor-items/sub-blocks.js +6 -1
  55. package/server/text-transform/config.js +19 -1
  56. package/widget/index.js +1 -1
@@ -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
  {
@@ -53,7 +53,4 @@ unpredictable css rules order in build */
53
53
  .pc-content-layout-block_background {
54
54
  padding: 32px;
55
55
  }
56
- .pc-content-layout-block_background picture {
57
- display: none;
58
- }
59
56
  }
@@ -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
- * @deprecated Use params on top level instead
113
- */
114
- }; /**
115
- * @deprecated Use params on top level instead
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: {};
@@ -426,6 +426,17 @@ export declare const MapBlock: {
426
426
  };
427
427
  };
428
428
  };
429
+ list: {
430
+ type: string;
431
+ items: {
432
+ type: string;
433
+ properties: {
434
+ when: {
435
+ type: string;
436
+ };
437
+ };
438
+ };
439
+ };
429
440
  animated: {
430
441
  type: string;
431
442
  };
@@ -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
- additionalInfo?: string;
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",
@@ -23,6 +23,10 @@ export declare enum SubBlockType {
23
23
  */
24
24
  Card = "card"
25
25
  }
26
+ export declare enum IconPosition {
27
+ Top = "top",
28
+ Left = "left"
29
+ }
26
30
  export declare const SubBlockTypes: SubBlockType[];
27
31
  export interface DividerProps {
28
32
  size?: DividerSize;
@@ -77,6 +81,7 @@ export interface BasicCardProps extends CardBaseProps, Omit<ContentBlockProps, '
77
81
  url: string;
78
82
  icon?: ImageProps;
79
83
  target?: string;
84
+ iconPosition?: IconPosition;
80
85
  }
81
86
  export interface BannerCardProps {
82
87
  title: string;
@@ -18,4 +18,9 @@ export var SubBlockType;
18
18
  */
19
19
  SubBlockType["Card"] = "card";
20
20
  })(SubBlockType || (SubBlockType = {}));
21
+ export var IconPosition;
22
+ (function (IconPosition) {
23
+ IconPosition["Top"] = "top";
24
+ IconPosition["Left"] = "left";
25
+ })(IconPosition || (IconPosition = {}));
21
26
  export const SubBlockTypes = Object.values(SubBlockType);
@@ -26,6 +26,10 @@ export declare const cardSchemas: {
26
26
  type: string;
27
27
  enum: string[];
28
28
  };
29
+ iconPosition: {
30
+ type: string;
31
+ enum: string[];
32
+ };
29
33
  title: {
30
34
  oneOf: ({
31
35
  type: string;
@@ -86,6 +90,17 @@ export declare const cardSchemas: {
86
90
  };
87
91
  };
88
92
  };
93
+ list: {
94
+ type: string;
95
+ items: {
96
+ type: string;
97
+ properties: {
98
+ when: {
99
+ type: string;
100
+ };
101
+ };
102
+ };
103
+ };
89
104
  border: {
90
105
  type: string;
91
106
  enum: string[];
@@ -279,6 +294,17 @@ export declare const cardSchemas: {
279
294
  };
280
295
  };
281
296
  };
297
+ list: {
298
+ type: string;
299
+ items: {
300
+ type: string;
301
+ properties: {
302
+ when: {
303
+ type: string;
304
+ };
305
+ };
306
+ };
307
+ };
282
308
  border: {
283
309
  type: string;
284
310
  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[];
@@ -10,4 +10,19 @@ unpredictable css rules order in build */
10
10
  height: 32px;
11
11
  object-fit: contain;
12
12
  display: block;
13
+ }
14
+ .pc-basic-card__icon_icon-position_left {
15
+ height: 22px;
16
+ width: 22px;
17
+ margin: 1px 12px 1px 0px;
18
+ }
19
+ .pc-basic-card__content {
20
+ display: flex;
21
+ flex-direction: column;
22
+ }
23
+ .pc-basic-card__content_icon-position_left {
24
+ flex-direction: row;
25
+ }
26
+ .pc-basic-card_content-layout_left.pc-basic-card_content-layout_left {
27
+ flex: 1 0 0;
13
28
  }
@@ -4,15 +4,17 @@ import { Content } from '../';
4
4
  import CardBase from '../../components/CardBase/CardBase';
5
5
  import Image from '../../components/Image/Image';
6
6
  import { getMediaImage } from '../../components/Media/Image/utils';
7
+ import { IconPosition } from '../../models/constructor-items/sub-blocks';
7
8
  import { block } from '../../utils';
8
9
  import './BasicCard.css';
9
10
  const b = block('basic-card');
10
11
  const BasicCard = (props) => {
11
- const { title, text, icon, additionalInfo, links, buttons } = props, cardParams = __rest(props, ["title", "text", "icon", "additionalInfo", "links", "buttons"]);
12
+ const { title, text, icon, additionalInfo, links, buttons, iconPosition = IconPosition.Top } = props, cardParams = __rest(props, ["title", "text", "icon", "additionalInfo", "links", "buttons", "iconPosition"]);
12
13
  const iconProps = icon && getMediaImage(icon);
13
14
  return (React.createElement(CardBase, Object.assign({ className: b() }, cardParams),
14
15
  React.createElement(CardBase.Content, null,
15
- iconProps && React.createElement(Image, Object.assign({}, iconProps, { className: b('icon') })),
16
- React.createElement(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, size: "s" }))));
16
+ React.createElement("div", { className: b('content', { ['icon-position']: iconPosition }) },
17
+ iconProps && (React.createElement(Image, Object.assign({}, iconProps, { className: b('icon', { ['icon-position']: iconPosition }) }))),
18
+ React.createElement(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, size: "s", className: b({ ['content-layout']: iconPosition }) })))));
17
19
  };
18
20
  export default BasicCard;
@@ -24,6 +24,10 @@ export declare const BasicCard: {
24
24
  type: string;
25
25
  enum: string[];
26
26
  };
27
+ iconPosition: {
28
+ type: string;
29
+ enum: string[];
30
+ };
27
31
  title: {
28
32
  oneOf: ({
29
33
  type: string;
@@ -84,6 +88,17 @@ export declare const BasicCard: {
84
88
  };
85
89
  };
86
90
  };
91
+ list: {
92
+ type: string;
93
+ items: {
94
+ type: string;
95
+ properties: {
96
+ when: {
97
+ type: string;
98
+ };
99
+ };
100
+ };
101
+ };
87
102
  border: {
88
103
  type: string;
89
104
  enum: string[];
@@ -12,6 +12,9 @@ export const BasicCard = {
12
12
  }, icon: ImageProps, target: {
13
13
  type: 'string',
14
14
  enum: ['_blank', '_parent', '_top', '_self'],
15
+ }, iconPosition: {
16
+ type: 'string',
17
+ enum: ['top', 'left'],
15
18
  } }),
16
19
  },
17
20
  };
@@ -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 { ButtonBlock, LinkProps, TitleProps, containerSizesArray, contentSizes, contentThemes, sizeNumber, } from '../../schema/validators/common';
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: {