@gravity-ui/page-constructor 5.7.2 → 5.9.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 (50) hide show
  1. package/build/cjs/blocks/Form/Form.js +8 -2
  2. package/build/cjs/blocks/Form/schema.d.ts +54 -34
  3. package/build/cjs/blocks/Form/schema.js +2 -2
  4. package/build/cjs/blocks/Header/schema.d.ts +9 -0
  5. package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
  6. package/build/cjs/blocks/Info/Info.js +2 -2
  7. package/build/cjs/blocks/Media/schema.d.ts +6 -0
  8. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  9. package/build/cjs/blocks/Questions/Questions.js +2 -2
  10. package/build/cjs/blocks/Tabs/TabsTextContent/TabsTextContent.d.ts +1 -1
  11. package/build/cjs/blocks/Tabs/TabsTextContent/TabsTextContent.js +6 -9
  12. package/build/cjs/blocks/Tabs/schema.d.ts +3 -0
  13. package/build/cjs/components/InnerForm/InnerForm.js +6 -2
  14. package/build/cjs/components/Media/Image/Image.js +4 -1
  15. package/build/cjs/components/Media/Media.js +3 -2
  16. package/build/cjs/models/constructor-items/blocks.d.ts +4 -3
  17. package/build/cjs/models/constructor-items/common.d.ts +1 -0
  18. package/build/cjs/schema/constants.d.ts +3 -0
  19. package/build/cjs/schema/validators/common.d.ts +3 -0
  20. package/build/cjs/schema/validators/common.js +3 -0
  21. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -2
  22. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +3 -0
  23. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +3 -0
  24. package/build/esm/blocks/Form/Form.js +9 -3
  25. package/build/esm/blocks/Form/schema.d.ts +54 -34
  26. package/build/esm/blocks/Form/schema.js +3 -3
  27. package/build/esm/blocks/Header/schema.d.ts +9 -0
  28. package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
  29. package/build/esm/blocks/Info/Info.js +2 -2
  30. package/build/esm/blocks/Media/schema.d.ts +6 -0
  31. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  32. package/build/esm/blocks/Questions/Questions.js +2 -2
  33. package/build/esm/blocks/Tabs/TabsTextContent/TabsTextContent.d.ts +1 -1
  34. package/build/esm/blocks/Tabs/TabsTextContent/TabsTextContent.js +6 -9
  35. package/build/esm/blocks/Tabs/schema.d.ts +3 -0
  36. package/build/esm/components/InnerForm/InnerForm.js +6 -2
  37. package/build/esm/components/Media/Image/Image.js +4 -1
  38. package/build/esm/components/Media/Media.js +3 -2
  39. package/build/esm/models/constructor-items/blocks.d.ts +4 -3
  40. package/build/esm/models/constructor-items/common.d.ts +1 -0
  41. package/build/esm/schema/constants.d.ts +3 -0
  42. package/build/esm/schema/validators/common.d.ts +3 -0
  43. package/build/esm/schema/validators/common.js +3 -0
  44. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +2 -2
  45. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +3 -0
  46. package/build/esm/sub-blocks/MediaCard/schema.d.ts +3 -0
  47. package/package.json +1 -1
  48. package/server/models/constructor-items/blocks.d.ts +4 -3
  49. package/server/models/constructor-items/common.d.ts +1 -0
  50. package/widget/index.js +1 -1
@@ -5,6 +5,7 @@ const react_1 = tslib_1.__importStar(require("react"));
5
5
  const components_1 = require("../../components");
6
6
  const InnerForm_1 = tslib_1.__importDefault(require("../../components/InnerForm/InnerForm"));
7
7
  const mobileContext_1 = require("../../context/mobileContext");
8
+ const theme_1 = require("../../context/theme");
8
9
  const grid_1 = require("../../grid");
9
10
  const models_1 = require("../../models");
10
11
  const sub_blocks_1 = require("../../sub-blocks");
@@ -16,7 +17,12 @@ const FormBlock = (props) => {
16
17
  const { formData, title, textContent, direction = models_1.FormBlockDirection.Center, background } = props;
17
18
  const [contentLoaded, setContentLoaded] = (0, react_1.useState)(false);
18
19
  const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
19
- const withBackground = Boolean(background && (background.src || background.desktop || ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor)));
20
+ const theme = (0, theme_1.useTheme)();
21
+ const themedBackground = (0, utils_1.getThemedValue)(background, theme) || undefined;
22
+ const withBackground = Boolean(themedBackground &&
23
+ (themedBackground.src ||
24
+ themedBackground.desktop ||
25
+ ((_a = themedBackground.style) === null || _a === void 0 ? void 0 : _a.backgroundColor)));
20
26
  const onContentLoad = (0, react_1.useCallback)(() => {
21
27
  setContentLoaded(true);
22
28
  }, []);
@@ -34,7 +40,7 @@ const FormBlock = (props) => {
34
40
  'with-background': withBackground,
35
41
  'form-type': formType,
36
42
  }) },
37
- background && (react_1.default.createElement(components_1.BackgroundImage, Object.assign({}, background, { className: b('media'), imageClassName: b('image') }))),
43
+ themedBackground && (react_1.default.createElement(components_1.BackgroundImage, Object.assign({}, themedBackground, { className: b('media'), imageClassName: b('image') }))),
38
44
  react_1.default.createElement(grid_1.Grid, null,
39
45
  react_1.default.createElement(grid_1.Row, { alignItems: direction === models_1.FormBlockDirection.Center
40
46
  ? grid_1.GridAlignItems.Center
@@ -12,20 +12,30 @@ export declare const FormBlock: {
12
12
  optionName: string;
13
13
  properties: {
14
14
  yandex: {
15
- type: string;
16
- required: string[];
17
- properties: {
18
- id: {
19
- type: string;
20
- };
21
- containerId: {
22
- type: string;
23
- };
24
- type: {};
25
- when: {
26
- type: string;
27
- };
28
- };
15
+ oneOf: (({
16
+ type: string;
17
+ required: string[];
18
+ properties: {
19
+ id: {
20
+ type: string;
21
+ };
22
+ containerId: {
23
+ type: string;
24
+ };
25
+ type: {};
26
+ when: {
27
+ type: string;
28
+ };
29
+ };
30
+ } & {
31
+ optionName: string;
32
+ }) | {
33
+ type: string;
34
+ additionalProperties: boolean;
35
+ required: import("../..").Theme[];
36
+ properties: {};
37
+ optionName: string;
38
+ })[];
29
39
  };
30
40
  hubspot?: undefined;
31
41
  };
@@ -34,26 +44,36 @@ export declare const FormBlock: {
34
44
  optionName: string;
35
45
  properties: {
36
46
  hubspot: {
37
- type: string;
38
- required: string[];
39
- properties: {
40
- region: {
41
- type: string;
42
- };
43
- portalId: {
44
- type: string;
45
- };
46
- formId: {
47
- type: string;
48
- };
49
- formInstanceId: {
50
- type: string;
51
- };
52
- type: {};
53
- when: {
54
- type: string;
55
- };
56
- };
47
+ oneOf: (({
48
+ type: string;
49
+ required: string[];
50
+ properties: {
51
+ region: {
52
+ type: string;
53
+ };
54
+ portalId: {
55
+ type: string;
56
+ };
57
+ formId: {
58
+ type: string;
59
+ };
60
+ formInstanceId: {
61
+ type: string;
62
+ };
63
+ type: {};
64
+ when: {
65
+ type: string;
66
+ };
67
+ };
68
+ } & {
69
+ optionName: string;
70
+ }) | {
71
+ type: string;
72
+ additionalProperties: boolean;
73
+ required: import("../..").Theme[];
74
+ properties: {};
75
+ optionName: string;
76
+ })[];
57
77
  };
58
78
  yandex?: undefined;
59
79
  };
@@ -21,14 +21,14 @@ exports.FormBlock = {
21
21
  type: 'object',
22
22
  optionName: 'yandex',
23
23
  properties: {
24
- yandex: schema_2.YandexFormProps,
24
+ yandex: (0, common_1.withTheme)(schema_2.YandexFormProps),
25
25
  },
26
26
  },
27
27
  {
28
28
  type: 'object',
29
29
  optionName: 'hubspot',
30
30
  properties: {
31
- hubspot: schema_4.HubspotFormProps,
31
+ hubspot: (0, common_1.withTheme)(schema_4.HubspotFormProps),
32
32
  },
33
33
  },
34
34
  ],
@@ -48,6 +48,9 @@ export declare const HeaderBackgroundProps: {
48
48
  optionName: string;
49
49
  })[];
50
50
  };
51
+ disableImageSliderForArrayInput: {
52
+ type: string;
53
+ };
51
54
  video: {
52
55
  type: string;
53
56
  additionalProperties: boolean;
@@ -508,6 +511,9 @@ export declare const HeaderProperties: {
508
511
  optionName: string;
509
512
  })[];
510
513
  };
514
+ disableImageSliderForArrayInput: {
515
+ type: string;
516
+ };
511
517
  video: {
512
518
  type: string;
513
519
  additionalProperties: boolean;
@@ -1017,6 +1023,9 @@ export declare const HeaderBlock: {
1017
1023
  optionName: string;
1018
1024
  })[];
1019
1025
  };
1026
+ disableImageSliderForArrayInput: {
1027
+ type: string;
1028
+ };
1020
1029
  video: {
1021
1030
  type: string;
1022
1031
  additionalProperties: boolean;
@@ -239,6 +239,9 @@ export declare const HeaderSliderBlock: {
239
239
  optionName: string;
240
240
  })[];
241
241
  };
242
+ disableImageSliderForArrayInput: {
243
+ type: string;
244
+ };
242
245
  video: {
243
246
  type: string;
244
247
  additionalProperties: boolean;
@@ -28,9 +28,9 @@ const InfoBlock = (props) => {
28
28
  react_1.default.createElement(grid_1.Grid, null,
29
29
  react_1.default.createElement(grid_1.Row, null,
30
30
  react_1.default.createElement(grid_1.Col, { sizes: sizes, className: b('left') },
31
- react_1.default.createElement(Content_1.default, Object.assign({ title: title || (leftContent === null || leftContent === void 0 ? void 0 : leftContent.title), text: leftContent === null || leftContent === void 0 ? void 0 : leftContent.text, links: leftContent === null || leftContent === void 0 ? void 0 : leftContent.links, buttons: leftButtons, additionalInfo: leftContent === null || leftContent === void 0 ? void 0 : leftContent.additionalInfo }, commonProps))),
31
+ react_1.default.createElement(Content_1.default, Object.assign({ title: title || (leftContent === null || leftContent === void 0 ? void 0 : leftContent.title), text: leftContent === null || leftContent === void 0 ? void 0 : leftContent.text, links: leftContent === null || leftContent === void 0 ? void 0 : leftContent.links, list: leftContent === null || leftContent === void 0 ? void 0 : leftContent.list, buttons: leftButtons, additionalInfo: leftContent === null || leftContent === void 0 ? void 0 : leftContent.additionalInfo }, commonProps))),
32
32
  react_1.default.createElement(grid_1.Col, { sizes: sizes, className: b('right') },
33
- react_1.default.createElement(Content_1.default, Object.assign({ title: sectionsTitle || (rightContent === null || rightContent === void 0 ? void 0 : rightContent.title), text: rightContent === null || rightContent === void 0 ? void 0 : rightContent.text, links: rightLinks, buttons: rightContent === null || rightContent === void 0 ? void 0 : rightContent.buttons, additionalInfo: rightContent === null || rightContent === void 0 ? void 0 : rightContent.additionalInfo }, commonProps))))))));
33
+ react_1.default.createElement(Content_1.default, Object.assign({ title: sectionsTitle || (rightContent === null || rightContent === void 0 ? void 0 : rightContent.title), text: rightContent === null || rightContent === void 0 ? void 0 : rightContent.text, links: rightLinks, list: rightContent === null || rightContent === void 0 ? void 0 : rightContent.list, buttons: rightContent === null || rightContent === void 0 ? void 0 : rightContent.buttons, additionalInfo: rightContent === null || rightContent === void 0 ? void 0 : rightContent.additionalInfo }, commonProps))))))));
34
34
  };
35
35
  exports.InfoBlock = InfoBlock;
36
36
  exports.default = exports.InfoBlock;
@@ -42,6 +42,9 @@ export declare const Media: {
42
42
  optionName: string;
43
43
  })[];
44
44
  };
45
+ disableImageSliderForArrayInput: {
46
+ type: string;
47
+ };
45
48
  video: {
46
49
  type: string;
47
50
  additionalProperties: boolean;
@@ -632,6 +635,9 @@ export declare const MediaBlock: {
632
635
  optionName: string;
633
636
  })[];
634
637
  };
638
+ disableImageSliderForArrayInput: {
639
+ type: string;
640
+ };
635
641
  video: {
636
642
  type: string;
637
643
  additionalProperties: boolean;
@@ -58,6 +58,9 @@ export declare const PromoFeaturesItem: {
58
58
  optionName: string;
59
59
  })[];
60
60
  };
61
+ disableImageSliderForArrayInput: {
62
+ type: string;
63
+ };
61
64
  video: {
62
65
  type: string;
63
66
  additionalProperties: boolean;
@@ -9,7 +9,7 @@ const QuestionBlockItem_1 = require("./QuestionBlockItem/QuestionBlockItem");
9
9
  const models_1 = require("./models");
10
10
  const b = (0, utils_1.block)('QuestionsBlock');
11
11
  const QuestionsBlock = (props) => {
12
- const { title, text, additionalInfo, links, buttons, items } = props;
12
+ const { title, text, additionalInfo, links, buttons, items, list } = props;
13
13
  const [opened, setOpened] = (0, react_1.useState)([0]);
14
14
  const toggleItem = (index) => {
15
15
  let newState;
@@ -25,7 +25,7 @@ const QuestionsBlock = (props) => {
25
25
  react_1.default.createElement(grid_1.Row, null,
26
26
  react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 4 } },
27
27
  react_1.default.createElement("div", { className: b('title') },
28
- react_1.default.createElement(sub_blocks_1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 } }))),
28
+ react_1.default.createElement(sub_blocks_1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, colSizes: { all: 12, md: 12 } }))),
29
29
  react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 8 }, role: 'list' }, items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash' }, index) => {
30
30
  const isOpened = opened.includes(index);
31
31
  const onClick = () => toggleItem(index);
@@ -6,5 +6,5 @@ interface TextContentProps extends Pick<TabsBlockProps, 'centered' | 'contentSiz
6
6
  centered?: boolean;
7
7
  imageProps?: ImageObjectProps | ImageDeviceProps;
8
8
  }
9
- export declare const TabsTextContent: ({ centered, contentSize, showMedia, data, imageProps, isReverse, }: TextContentProps) => JSX.Element;
9
+ export declare const TabsTextContent: ({ centered, contentSize, showMedia, data: { media, title, text, additionalInfo, link, links, buttons, list }, imageProps, isReverse, }: TextContentProps) => JSX.Element;
10
10
  export default TabsTextContent;
@@ -7,14 +7,11 @@ const grid_1 = require("../../../grid");
7
7
  const sub_blocks_1 = require("../../../sub-blocks");
8
8
  const utils_1 = require("../../../utils");
9
9
  const b = (0, utils_1.block)('tabs-block-text-content');
10
- const TabsTextContent = ({ centered, contentSize = 's', showMedia, data, imageProps, isReverse, }) => {
11
- const isImage = (data === null || data === void 0 ? void 0 : data.media) || imageProps;
12
- return (react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: showMedia ? 4 : 8 }, className: b({ centered: centered }) },
13
- react_1.default.createElement("div", { className: b('wrapper', {
14
- reverse: isReverse,
15
- 'no-image': !isImage,
16
- }) },
17
- react_1.default.createElement(sub_blocks_1.Content, { title: data.title, text: data.text, additionalInfo: data.additionalInfo, size: contentSize, links: [...(data.link ? [data.link] : []), ...(data.links || [])], buttons: data.buttons, colSizes: { all: 12 } }))));
18
- };
10
+ const TabsTextContent = ({ centered, contentSize = 's', showMedia, data: { media, title, text, additionalInfo, link, links, buttons, list }, imageProps, isReverse, }) => (react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: showMedia ? 4 : 8 }, className: b({ centered: centered }) },
11
+ react_1.default.createElement("div", { className: b('wrapper', {
12
+ reverse: isReverse,
13
+ 'no-image': !(media || imageProps),
14
+ }) },
15
+ react_1.default.createElement(sub_blocks_1.Content, { title: title, text: text, additionalInfo: additionalInfo, size: contentSize, list: list, links: [...(link ? [link] : []), ...(links || [])], buttons: buttons, colSizes: { all: 12 } }))));
19
16
  exports.TabsTextContent = TabsTextContent;
20
17
  exports.default = exports.TabsTextContent;
@@ -53,6 +53,9 @@ export declare const tabsItem: {
53
53
  optionName: string;
54
54
  })[];
55
55
  };
56
+ disableImageSliderForArrayInput: {
57
+ type: string;
58
+ };
56
59
  video: {
57
60
  type: string;
58
61
  additionalProperties: boolean;
@@ -4,18 +4,21 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const __1 = require("..");
6
6
  const FormsContext_1 = require("../../context/formsContext/FormsContext");
7
+ const theme_1 = require("../../context/theme");
7
8
  const models_1 = require("../../models");
8
9
  const sub_blocks_1 = require("../../sub-blocks");
10
+ const utils_1 = require("../../utils");
9
11
  const InnerForm = (props) => {
10
12
  const { formData, onContentLoad, className } = props;
11
13
  const formsConfig = (0, react_1.useContext)(FormsContext_1.FormsContext);
14
+ const theme = (0, theme_1.useTheme)();
12
15
  (0, react_1.useEffect)(() => {
13
16
  if ((0, models_1.isHubspotDataForm)(formData)) {
14
17
  onContentLoad();
15
18
  }
16
19
  }, [onContentLoad, formData]);
17
20
  if ((0, models_1.isYandexDataForm)(formData)) {
18
- const _a = formData.yandex, { onLoad } = _a, rest = tslib_1.__rest(_a, ["onLoad"]);
21
+ const _a = (0, utils_1.getThemedValue)(formData.yandex, theme), { onLoad } = _a, rest = tslib_1.__rest(_a, ["onLoad"]);
19
22
  return (react_1.default.createElement("div", { className: className },
20
23
  react_1.default.createElement(__1.YandexForm, Object.assign({}, formsConfig.yandex, rest, { onLoad: () => {
21
24
  onContentLoad();
@@ -23,7 +26,8 @@ const InnerForm = (props) => {
23
26
  } }))));
24
27
  }
25
28
  if ((0, models_1.isHubspotDataForm)(formData)) {
26
- return (react_1.default.createElement(sub_blocks_1.HubspotForm, Object.assign({ createDOMElement: true }, formsConfig.hubspot, formData.hubspot)));
29
+ const themedFormData = (0, utils_1.getThemedValue)(formData.hubspot, theme);
30
+ return (react_1.default.createElement(sub_blocks_1.HubspotForm, Object.assign({ createDOMElement: true }, formsConfig.hubspot, themedFormData)));
27
31
  }
28
32
  return null;
29
33
  };
@@ -15,7 +15,10 @@ const utils_2 = require("./utils");
15
15
  const b = (0, utils_1.block)('media-component-image');
16
16
  exports.defaultAnimatedDivQa = 'animated-div';
17
17
  const Image = (props) => {
18
- const { parallax, image, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, qa, onLoad, } = props;
18
+ const { parallax, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, disableImageSliderForArrayInput, qa, onLoad, } = props;
19
+ const image = Array.isArray(props.image) && disableImageSliderForArrayInput
20
+ ? props.image[0]
21
+ : props.image;
19
22
  const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'fullscreen-image', 'animate', 'background-image', 'image-view', 'slider-block');
20
23
  const [scrollY, setScrollY] = (0, react_1.useState)(0);
21
24
  const [{ springScrollY }, springSetScrollY] = (0, web_1.useSpring)(() => ({
@@ -12,13 +12,13 @@ const Image_1 = tslib_1.__importDefault(require("./Image/Image"));
12
12
  const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
13
13
  const b = (0, utils_1.block)('Media');
14
14
  const Media = (props) => {
15
- const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
15
+ const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
16
16
  const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
17
17
  const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'video');
18
18
  const content = (0, react_1.useMemo)(() => {
19
19
  let result = [];
20
20
  if (image) {
21
- result.push(react_1.default.createElement(Image_1.default, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen, qa: qaAttributes.image, onLoad: onImageLoad }));
21
+ result.push(react_1.default.createElement(Image_1.default, { key: "image", parallax: parallax, image: image, disableImageSliderForArrayInput: disableImageSliderForArrayInput, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen, qa: qaAttributes.image, onLoad: onImageLoad }));
22
22
  }
23
23
  if (video) {
24
24
  const videoProps = {
@@ -59,6 +59,7 @@ const Media = (props) => {
59
59
  dataLens,
60
60
  iframe,
61
61
  parallax,
62
+ disableImageSliderForArrayInput,
62
63
  height,
63
64
  imageClassName,
64
65
  isBackground,
@@ -287,6 +287,7 @@ export interface ContentItemProps {
287
287
  export interface ContentListProps {
288
288
  list: ContentItemProps[];
289
289
  size: ContentSize;
290
+ theme?: ContentTheme;
290
291
  }
291
292
  export interface ContentBlockProps {
292
293
  title?: TitleItemBaseProps | string;
@@ -323,10 +324,10 @@ export declare enum FormBlockDirection {
323
324
  Center = "center"
324
325
  }
325
326
  export interface FormBlockYandexData {
326
- yandex: YandexFormProps;
327
+ yandex: ThemeSupporting<YandexFormProps>;
327
328
  }
328
329
  export interface FormBlockHubspotData {
329
- hubspot: HubspotFormProps;
330
+ hubspot: ThemeSupporting<HubspotFormProps>;
330
331
  }
331
332
  export type FormBlockData = FormBlockYandexData | FormBlockHubspotData;
332
333
  export interface FormBlockProps {
@@ -334,7 +335,7 @@ export interface FormBlockProps {
334
335
  title?: string;
335
336
  textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;
336
337
  direction?: FormBlockDirection;
337
- background?: BackgroundImageProps;
338
+ background?: ThemeSupporting<BackgroundImageProps>;
338
339
  }
339
340
  export type HeaderBlockModel = {
340
341
  type: BlockType.HeaderBlock;
@@ -191,6 +191,7 @@ export interface MediaComponentImageProps {
191
191
  video?: MediaVideoProps;
192
192
  parallax?: boolean;
193
193
  height?: number;
194
+ disableImageSliderForArrayInput?: boolean;
194
195
  }
195
196
  export interface MediaComponentDataLensProps {
196
197
  dataLens: DataLensProps;
@@ -1306,6 +1306,9 @@ export declare const cardSchemas: {
1306
1306
  optionName: string;
1307
1307
  })[];
1308
1308
  };
1309
+ disableImageSliderForArrayInput: {
1310
+ type: string;
1311
+ };
1309
1312
  video: {
1310
1313
  type: string;
1311
1314
  additionalProperties: boolean;
@@ -983,6 +983,9 @@ export declare const MediaProps: {
983
983
  optionName: string;
984
984
  })[];
985
985
  };
986
+ disableImageSliderForArrayInput: {
987
+ type: string;
988
+ };
986
989
  video: {
987
990
  type: string;
988
991
  additionalProperties: boolean;
@@ -513,6 +513,9 @@ exports.MediaProps = {
513
513
  { type: 'array', items: schema_1.ImageProps, optionName: 'list' },
514
514
  ],
515
515
  },
516
+ disableImageSliderForArrayInput: {
517
+ type: 'boolean',
518
+ },
516
519
  video: exports.VideoProps,
517
520
  youtube: {
518
521
  type: 'string',
@@ -9,7 +9,7 @@ const utils_1 = require("../../utils");
9
9
  const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
10
10
  const b = (0, utils_1.block)('background-card');
11
11
  const BackgroundCard = (props) => {
12
- const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', } = props;
12
+ const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', list, } = props;
13
13
  const titleId = (0, uikit_1.useUniqId)();
14
14
  const theme = (0, theme_1.useTheme)();
15
15
  const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
@@ -18,7 +18,7 @@ const BackgroundCard = (props) => {
18
18
  return (react_1.default.createElement(components_1.CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle },
19
19
  react_1.default.createElement(components_1.CardBase.Content, null,
20
20
  react_1.default.createElement(components_1.BackgroundImage, Object.assign({ className: b('image') }, (0, utils_1.getThemedValue)(background, theme), { style: { backgroundColor } })),
21
- react_1.default.createElement(Content_1.default, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: areControlsInFooter ? undefined : links, buttons: areControlsInFooter ? undefined : buttons, colSizes: { all: 12, md: 12 } })),
21
+ react_1.default.createElement(Content_1.default, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: areControlsInFooter ? undefined : links, buttons: areControlsInFooter ? undefined : buttons, list: list, colSizes: { all: 12, md: 12 } })),
22
22
  areControlsInFooter && (links || buttons) && (react_1.default.createElement(components_1.CardBase.Footer, null,
23
23
  react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
24
24
  react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
@@ -43,6 +43,9 @@ export declare const LayoutItem: {
43
43
  optionName: string;
44
44
  })[];
45
45
  };
46
+ disableImageSliderForArrayInput: {
47
+ type: string;
48
+ };
46
49
  video: {
47
50
  type: string;
48
51
  additionalProperties: boolean;
@@ -126,6 +126,9 @@ export declare const MediaCardBlock: {
126
126
  optionName: string;
127
127
  })[];
128
128
  };
129
+ disableImageSliderForArrayInput: {
130
+ type: string;
131
+ };
129
132
  video: {
130
133
  type: string;
131
134
  additionalProperties: boolean;
@@ -2,10 +2,11 @@ import React, { useCallback, useContext, useState } from 'react';
2
2
  import { BackgroundImage, Title } from '../../components';
3
3
  import InnerForm from '../../components/InnerForm/InnerForm';
4
4
  import { MobileContext } from '../../context/mobileContext';
5
+ import { useTheme } from '../../context/theme';
5
6
  import { Col, Grid, GridAlignItems, GridColumnSize, Row } from '../../grid';
6
7
  import { FormBlockDataTypes, FormBlockDirection, isHubspotDataForm, isYandexDataForm, } from '../../models';
7
8
  import { Content } from '../../sub-blocks';
8
- import { block } from '../../utils';
9
+ import { block, getThemedValue } from '../../utils';
9
10
  import './Form.css';
10
11
  const b = block('form-block');
11
12
  const colSizes = { [GridColumnSize.Lg]: 6, [GridColumnSize.All]: 12 };
@@ -14,7 +15,12 @@ const FormBlock = (props) => {
14
15
  const { formData, title, textContent, direction = FormBlockDirection.Center, background } = props;
15
16
  const [contentLoaded, setContentLoaded] = useState(false);
16
17
  const isMobile = useContext(MobileContext);
17
- const withBackground = Boolean(background && (background.src || background.desktop || ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor)));
18
+ const theme = useTheme();
19
+ const themedBackground = getThemedValue(background, theme) || undefined;
20
+ const withBackground = Boolean(themedBackground &&
21
+ (themedBackground.src ||
22
+ themedBackground.desktop ||
23
+ ((_a = themedBackground.style) === null || _a === void 0 ? void 0 : _a.backgroundColor)));
18
24
  const onContentLoad = useCallback(() => {
19
25
  setContentLoaded(true);
20
26
  }, []);
@@ -32,7 +38,7 @@ const FormBlock = (props) => {
32
38
  'with-background': withBackground,
33
39
  'form-type': formType,
34
40
  }) },
35
- background && (React.createElement(BackgroundImage, Object.assign({}, background, { className: b('media'), imageClassName: b('image') }))),
41
+ themedBackground && (React.createElement(BackgroundImage, Object.assign({}, themedBackground, { className: b('media'), imageClassName: b('image') }))),
36
42
  React.createElement(Grid, null,
37
43
  React.createElement(Row, { alignItems: direction === FormBlockDirection.Center
38
44
  ? GridAlignItems.Center
@@ -12,20 +12,30 @@ export declare const FormBlock: {
12
12
  optionName: string;
13
13
  properties: {
14
14
  yandex: {
15
- type: string;
16
- required: string[];
17
- properties: {
18
- id: {
19
- type: string;
20
- };
21
- containerId: {
22
- type: string;
23
- };
24
- type: {};
25
- when: {
26
- type: string;
27
- };
28
- };
15
+ oneOf: (({
16
+ type: string;
17
+ required: string[];
18
+ properties: {
19
+ id: {
20
+ type: string;
21
+ };
22
+ containerId: {
23
+ type: string;
24
+ };
25
+ type: {};
26
+ when: {
27
+ type: string;
28
+ };
29
+ };
30
+ } & {
31
+ optionName: string;
32
+ }) | {
33
+ type: string;
34
+ additionalProperties: boolean;
35
+ required: import("../..").Theme[];
36
+ properties: {};
37
+ optionName: string;
38
+ })[];
29
39
  };
30
40
  hubspot?: undefined;
31
41
  };
@@ -34,26 +44,36 @@ export declare const FormBlock: {
34
44
  optionName: string;
35
45
  properties: {
36
46
  hubspot: {
37
- type: string;
38
- required: string[];
39
- properties: {
40
- region: {
41
- type: string;
42
- };
43
- portalId: {
44
- type: string;
45
- };
46
- formId: {
47
- type: string;
48
- };
49
- formInstanceId: {
50
- type: string;
51
- };
52
- type: {};
53
- when: {
54
- type: string;
55
- };
56
- };
47
+ oneOf: (({
48
+ type: string;
49
+ required: string[];
50
+ properties: {
51
+ region: {
52
+ type: string;
53
+ };
54
+ portalId: {
55
+ type: string;
56
+ };
57
+ formId: {
58
+ type: string;
59
+ };
60
+ formInstanceId: {
61
+ type: string;
62
+ };
63
+ type: {};
64
+ when: {
65
+ type: string;
66
+ };
67
+ };
68
+ } & {
69
+ optionName: string;
70
+ }) | {
71
+ type: string;
72
+ additionalProperties: boolean;
73
+ required: import("../..").Theme[];
74
+ properties: {};
75
+ optionName: string;
76
+ })[];
57
77
  };
58
78
  yandex?: undefined;
59
79
  };