@gravity-ui/page-constructor 4.37.2 → 4.37.4

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 (33) hide show
  1. package/build/cjs/blocks/Tabs/Tabs.css +3 -37
  2. package/build/cjs/blocks/Tabs/Tabs.js +21 -18
  3. package/build/cjs/blocks/Tabs/TabsTextContent/TabsTextContent.css +27 -0
  4. package/build/cjs/blocks/Tabs/TabsTextContent/TabsTextContent.d.ts +10 -0
  5. package/build/cjs/blocks/Tabs/TabsTextContent/TabsTextContent.js +20 -0
  6. package/build/cjs/components/Image/Image.d.ts +2 -1
  7. package/build/cjs/components/Image/Image.js +2 -2
  8. package/build/cjs/components/ImageBase/ImageBase.d.ts +2 -1
  9. package/build/cjs/components/Media/Image/Image.d.ts +1 -0
  10. package/build/cjs/components/Media/Image/Image.js +2 -2
  11. package/build/cjs/components/Media/Media.d.ts +1 -0
  12. package/build/cjs/components/Media/Media.js +4 -3
  13. package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -0
  14. package/build/cjs/components/VideoBlock/VideoBlock.js +2 -2
  15. package/build/cjs/text-transform/config.js +1 -0
  16. package/build/esm/blocks/Tabs/Tabs.css +3 -37
  17. package/build/esm/blocks/Tabs/Tabs.js +22 -19
  18. package/build/esm/blocks/Tabs/TabsTextContent/TabsTextContent.css +27 -0
  19. package/build/esm/blocks/Tabs/TabsTextContent/TabsTextContent.d.ts +11 -0
  20. package/build/esm/blocks/Tabs/TabsTextContent/TabsTextContent.js +16 -0
  21. package/build/esm/components/Image/Image.d.ts +2 -1
  22. package/build/esm/components/Image/Image.js +3 -3
  23. package/build/esm/components/ImageBase/ImageBase.d.ts +2 -1
  24. package/build/esm/components/Media/Image/Image.d.ts +1 -0
  25. package/build/esm/components/Media/Image/Image.js +2 -2
  26. package/build/esm/components/Media/Media.d.ts +1 -0
  27. package/build/esm/components/Media/Media.js +4 -3
  28. package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -0
  29. package/build/esm/components/VideoBlock/VideoBlock.js +2 -2
  30. package/build/esm/text-transform/config.js +1 -0
  31. package/package.json +1 -1
  32. package/server/text-transform/config.js +1 -0
  33. package/widget/index.js +1 -1
@@ -12,7 +12,7 @@ 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, } = props;
15
+ const { parallax, image, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, qa, onLoad, } = props;
16
16
  const qaAttributes = getQaAttrubutes(qa, 'fullscreen-image', 'animate', 'background-image', 'image-view', 'slider-block');
17
17
  const [scrollY, setScrollY] = useState(0);
18
18
  const [{ springScrollY }, springSetScrollY] = useSpring(() => ({
@@ -46,7 +46,7 @@ const Image = (props) => {
46
46
  };
47
47
  const imageOnly = (oneImage) => {
48
48
  const imageData = getMediaImage(oneImage);
49
- return (React.createElement(ImageView, Object.assign({}, imageData, { className: imageClass, style: { height }, qa: qaAttributes.imageView })));
49
+ return (React.createElement(ImageView, Object.assign({}, imageData, { className: imageClass, style: { height }, qa: qaAttributes.imageView, onLoad: onLoad })));
50
50
  };
51
51
  const imageSlider = (imageArray) => {
52
52
  const fullscreenItem = fullscreen === undefined || fullscreen;
@@ -6,6 +6,7 @@ export interface MediaAllProps extends MediaProps, VideoAdditionProps, ImageAddi
6
6
  className?: string;
7
7
  youtubeClassName?: string;
8
8
  autoplay?: boolean;
9
+ onImageLoad?: () => void;
9
10
  }
10
11
  export declare const Media: (props: MediaAllProps) => JSX.Element;
11
12
  export default Media;
@@ -8,13 +8,13 @@ import Video from './Video/Video';
8
8
  import './Media.css';
9
9
  const b = block('Media');
10
10
  export const Media = (props) => {
11
- const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, } = props;
11
+ const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, } = props;
12
12
  const [hasVideoFallback, setHasVideoFallback] = useState(false);
13
13
  const qaAttributes = getQaAttrubutes(qa, 'video');
14
14
  const content = useMemo(() => {
15
15
  let result = [];
16
16
  if (image) {
17
- 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 }));
17
+ 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
18
  }
19
19
  if (video) {
20
20
  const videoProps = {
@@ -40,7 +40,7 @@ export const Media = (props) => {
40
40
  }
41
41
  }
42
42
  if (youtube) {
43
- result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay }));
43
+ result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay, onImageLoad: onImageLoad }));
44
44
  }
45
45
  if (dataLens) {
46
46
  result = React.createElement(DataLens, { dataLens: dataLens });
@@ -59,6 +59,7 @@ export const Media = (props) => {
59
59
  fullscreen,
60
60
  qaAttributes.image,
61
61
  qaAttributes.video,
62
+ onImageLoad,
62
63
  videoClassName,
63
64
  metrika,
64
65
  analyticsEvents,
@@ -17,6 +17,7 @@ export interface VideoBlockProps extends AnalyticsEventsBase {
17
17
  height?: number;
18
18
  fullscreen?: boolean;
19
19
  autoplay?: boolean;
20
+ onImageLoad?: () => void;
20
21
  }
21
22
  declare const VideoBlock: (props: VideoBlockProps) => JSX.Element | null;
22
23
  export default VideoBlock;
@@ -37,7 +37,7 @@ export function getHeight(width) {
37
37
  return (width / 16) * 9;
38
38
  }
39
39
  const VideoBlock = (props) => {
40
- const { stream, record, attributes, className, id, previewImg, playButton, height, fullscreen, analyticsEvents, autoplay, } = props;
40
+ const { stream, record, attributes, className, id, previewImg, playButton, height, fullscreen, analyticsEvents, autoplay, onImageLoad, } = props;
41
41
  const handleAnalytics = useAnalytics(DefaultEventNames.VideoPreview);
42
42
  const src = getVideoSrc(stream, record);
43
43
  const ref = useRef(null);
@@ -91,7 +91,7 @@ const VideoBlock = (props) => {
91
91
  return null;
92
92
  }
93
93
  return (React.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && !fullscreen && (React.createElement("div", { className: b('preview'), onClick: onPreviewClick },
94
- React.createElement(Image, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper') }),
94
+ React.createElement(Image, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper'), onLoad: onImageLoad }),
95
95
  playButton || (React.createElement("button", { title: "Play", className: b('button') },
96
96
  React.createElement(Icon, { className: b('icon'), data: PlayVideo, size: 24 })))))));
97
97
  };
@@ -299,5 +299,6 @@ export const config = {
299
299
  },
300
300
  ],
301
301
  [BlockType.CardLayoutBlock]: blockHeaderTransformer,
302
+ [BlockType.FilterBlock]: blockHeaderTransformer,
302
303
  [BlockType.IconsBlock]: blockHeaderTransformer,
303
304
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "4.37.2",
3
+ "version": "4.37.4",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -312,5 +312,6 @@ exports.config = {
312
312
  },
313
313
  ],
314
314
  [models_1.BlockType.CardLayoutBlock]: exports.blockHeaderTransformer,
315
+ [models_1.BlockType.FilterBlock]: exports.blockHeaderTransformer,
315
316
  [models_1.BlockType.IconsBlock]: exports.blockHeaderTransformer,
316
317
  };