@gravity-ui/page-constructor 5.8.0 → 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 (29) hide show
  1. package/build/cjs/blocks/Header/schema.d.ts +9 -0
  2. package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
  3. package/build/cjs/blocks/Media/schema.d.ts +6 -0
  4. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  5. package/build/cjs/blocks/Tabs/schema.d.ts +3 -0
  6. package/build/cjs/components/Media/Image/Image.js +4 -1
  7. package/build/cjs/components/Media/Media.js +3 -2
  8. package/build/cjs/models/constructor-items/common.d.ts +1 -0
  9. package/build/cjs/schema/constants.d.ts +3 -0
  10. package/build/cjs/schema/validators/common.d.ts +3 -0
  11. package/build/cjs/schema/validators/common.js +3 -0
  12. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +3 -0
  13. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +3 -0
  14. package/build/esm/blocks/Header/schema.d.ts +9 -0
  15. package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
  16. package/build/esm/blocks/Media/schema.d.ts +6 -0
  17. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  18. package/build/esm/blocks/Tabs/schema.d.ts +3 -0
  19. package/build/esm/components/Media/Image/Image.js +4 -1
  20. package/build/esm/components/Media/Media.js +3 -2
  21. package/build/esm/models/constructor-items/common.d.ts +1 -0
  22. package/build/esm/schema/constants.d.ts +3 -0
  23. package/build/esm/schema/validators/common.d.ts +3 -0
  24. package/build/esm/schema/validators/common.js +3 -0
  25. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +3 -0
  26. package/build/esm/sub-blocks/MediaCard/schema.d.ts +3 -0
  27. package/package.json +1 -1
  28. package/server/models/constructor-items/common.d.ts +1 -0
  29. package/widget/index.js +1 -1
@@ -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;
@@ -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;
@@ -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;
@@ -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,
@@ -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',
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -12,7 +12,10 @@ import './Image.css';
12
12
  const b = block('media-component-image');
13
13
  export const defaultAnimatedDivQa = 'animated-div';
14
14
  const Image = (props) => {
15
- const { parallax, image, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, qa, onLoad, } = props;
15
+ const { parallax, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, disableImageSliderForArrayInput, qa, onLoad, } = props;
16
+ const image = Array.isArray(props.image) && disableImageSliderForArrayInput
17
+ ? props.image[0]
18
+ : props.image;
16
19
  const qaAttributes = getQaAttrubutes(qa, 'fullscreen-image', 'animate', 'background-image', 'image-view', 'slider-block');
17
20
  const [scrollY, setScrollY] = useState(0);
18
21
  const [{ springScrollY }, springSetScrollY] = useSpring(() => ({
@@ -9,13 +9,13 @@ import Video from './Video/Video';
9
9
  import './Media.css';
10
10
  const b = block('Media');
11
11
  export const Media = (props) => {
12
- 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;
12
+ 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;
13
13
  const [hasVideoFallback, setHasVideoFallback] = useState(false);
14
14
  const qaAttributes = getQaAttrubutes(qa, 'video');
15
15
  const content = useMemo(() => {
16
16
  let result = [];
17
17
  if (image) {
18
- result.push(React.createElement(Image, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen, qa: qaAttributes.image, onLoad: onImageLoad }));
18
+ result.push(React.createElement(Image, { 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 }));
19
19
  }
20
20
  if (video) {
21
21
  const videoProps = {
@@ -56,6 +56,7 @@ export const Media = (props) => {
56
56
  dataLens,
57
57
  iframe,
58
58
  parallax,
59
+ disableImageSliderForArrayInput,
59
60
  height,
60
61
  imageClassName,
61
62
  isBackground,
@@ -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;
@@ -509,6 +509,9 @@ export const MediaProps = {
509
509
  { type: 'array', items: ImageProps, optionName: 'list' },
510
510
  ],
511
511
  },
512
+ disableImageSliderForArrayInput: {
513
+ type: 'boolean',
514
+ },
512
515
  video: VideoProps,
513
516
  youtube: {
514
517
  type: 'string',
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "5.8.0",
3
+ "version": "5.9.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -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;