@gravity-ui/page-constructor 3.0.0-alpha.6 → 4.0.0-beta.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/CHANGELOG.md +21 -0
- package/README.md +1 -1
- package/build/cjs/blocks/CardLayout/CardLayout.js +1 -1
- package/build/cjs/blocks/CardLayout/schema.d.ts +2 -2
- package/build/cjs/blocks/CardLayout/schema.js +1 -1
- package/build/cjs/blocks/FilterBlock/FilterBlock.js +9 -13
- package/build/cjs/blocks/Header/schema.d.ts +9 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/cjs/blocks/Media/schema.d.ts +6 -0
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +3 -0
- package/build/cjs/components/FullscreenImage/{FullScreenImage.css → FullscreenImage.css} +13 -13
- package/build/cjs/components/FullscreenImage/FullscreenImage.d.ts +3 -3
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +7 -7
- package/build/cjs/components/FullscreenImage/i18n/index.js +1 -1
- package/build/cjs/components/FullscreenMedia/FullscreenMedia.d.ts +9 -0
- package/build/cjs/components/FullscreenMedia/{FullScreenMedia.js → FullscreenMedia.js} +5 -5
- package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.d.ts +4 -0
- package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.js +10 -0
- package/build/cjs/components/Media/Image/Image.d.ts +1 -0
- package/build/cjs/components/Media/Image/Image.js +10 -3
- package/build/cjs/components/Media/Media.js +25 -5
- package/build/cjs/components/Media/Video/Video.d.ts +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.js +3 -3
- package/build/cjs/components/index.d.ts +1 -1
- package/build/cjs/components/index.js +3 -3
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/grid/Col/Col.d.ts +1 -1
- package/build/cjs/icons/Fullscreen.d.ts +2 -0
- package/build/cjs/icons/{FullScreen.js → Fullscreen.js} +3 -3
- package/build/cjs/icons/index.d.ts +1 -1
- package/build/cjs/icons/index.js +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -1
- package/build/cjs/models/constructor-items/common.d.ts +1 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +1 -1
- package/build/cjs/schema/validators/common.d.ts +3 -0
- package/build/cjs/schema/validators/common.js +3 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +4 -4
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +4 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +2 -2
- package/build/cjs/sub-blocks/LayoutItem/utils.js +6 -6
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +3 -0
- package/build/esm/blocks/CardLayout/CardLayout.js +1 -1
- package/build/esm/blocks/CardLayout/schema.d.ts +2 -2
- package/build/esm/blocks/CardLayout/schema.js +1 -1
- package/build/esm/blocks/FilterBlock/FilterBlock.js +10 -14
- package/build/esm/blocks/Header/schema.d.ts +9 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/esm/blocks/Media/schema.d.ts +6 -0
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/esm/blocks/Tabs/Tabs.js +2 -2
- package/build/esm/blocks/Tabs/schema.d.ts +3 -0
- package/build/esm/components/FullscreenImage/{FullScreenImage.css → FullscreenImage.css} +13 -13
- package/build/esm/components/FullscreenImage/FullscreenImage.d.ts +4 -4
- package/build/esm/components/FullscreenImage/FullscreenImage.js +9 -9
- package/build/esm/components/FullscreenImage/i18n/index.js +1 -1
- package/build/esm/components/FullscreenMedia/FullscreenMedia.d.ts +10 -0
- package/build/esm/components/FullscreenMedia/{FullScreenMedia.js → FullscreenMedia.js} +7 -7
- package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.d.ts +4 -0
- package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.js +7 -0
- package/build/esm/components/Media/Image/Image.d.ts +1 -0
- package/build/esm/components/Media/Image/Image.js +12 -5
- package/build/esm/components/Media/Media.js +25 -5
- package/build/esm/components/Media/Video/Video.d.ts +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.js +3 -3
- package/build/esm/components/index.d.ts +1 -1
- package/build/esm/components/index.js +1 -1
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/grid/Col/Col.d.ts +1 -1
- package/build/esm/icons/Fullscreen.d.ts +2 -0
- package/build/esm/icons/{FullScreen.js → Fullscreen.js} +1 -1
- package/build/esm/icons/index.d.ts +1 -1
- package/build/esm/icons/index.js +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +1 -1
- package/build/esm/models/constructor-items/common.d.ts +1 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +1 -1
- package/build/esm/schema/validators/common.d.ts +3 -0
- package/build/esm/schema/validators/common.js +3 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +6 -6
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +4 -1
- package/build/esm/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +2 -2
- package/build/esm/sub-blocks/LayoutItem/utils.js +3 -3
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +3 -0
- package/package.json +1 -4
- package/server/models/constructor-items/blocks.d.ts +1 -1
- package/server/models/constructor-items/common.d.ts +1 -1
- package/server/models/constructor-items/sub-blocks.d.ts +1 -1
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.d.ts +0 -9
- package/build/cjs/icons/FullScreen.d.ts +0 -2
- package/build/esm/components/FullscreenMedia/FullScreenMedia.d.ts +0 -10
- package/build/esm/icons/FullScreen.d.ts +0 -2
- /package/build/cjs/components/FullscreenMedia/{FullScreenMedia.css → FullscreenMedia.css} +0 -0
- /package/build/esm/components/FullscreenMedia/{FullScreenMedia.css → FullscreenMedia.css} +0 -0
|
@@ -2,24 +2,44 @@ import React, { useMemo, useState } from 'react';
|
|
|
2
2
|
import { block } from '../../utils';
|
|
3
3
|
import YoutubeBlock from '../VideoBlock/VideoBlock';
|
|
4
4
|
import DataLens from './DataLens/DataLens';
|
|
5
|
+
import FullscreenVideo from './FullscreenVideo/FullscreenVideo';
|
|
5
6
|
import Image from './Image/Image';
|
|
6
7
|
import Video from './Video/Video';
|
|
7
8
|
import './Media.css';
|
|
8
9
|
const b = block('Media');
|
|
9
10
|
export const Media = (props) => {
|
|
10
|
-
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika,
|
|
11
|
+
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, } = props;
|
|
11
12
|
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, } = props;
|
|
12
13
|
const [hasVideoFallback, setHasVideoFallback] = useState(false);
|
|
13
14
|
const content = useMemo(() => {
|
|
14
15
|
let result = [];
|
|
15
16
|
if (image) {
|
|
16
|
-
result.push(React.createElement(Image, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback }));
|
|
17
|
+
result.push(React.createElement(Image, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen }));
|
|
17
18
|
}
|
|
18
19
|
if (video) {
|
|
19
|
-
|
|
20
|
+
const videoProps = {
|
|
21
|
+
key: 'video',
|
|
22
|
+
video,
|
|
23
|
+
videoClassName,
|
|
24
|
+
height,
|
|
25
|
+
metrika,
|
|
26
|
+
analyticsEvents,
|
|
27
|
+
playVideo,
|
|
28
|
+
previewImg,
|
|
29
|
+
playButton,
|
|
30
|
+
customBarControlsClassName,
|
|
31
|
+
hasVideoFallback,
|
|
32
|
+
setHasVideoFallback,
|
|
33
|
+
};
|
|
34
|
+
if (fullscreen) {
|
|
35
|
+
result.push(React.createElement(FullscreenVideo, Object.assign({}, videoProps)));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
result.push(React.createElement(Video, Object.assign({}, videoProps)));
|
|
39
|
+
}
|
|
20
40
|
}
|
|
21
41
|
if (youtube) {
|
|
22
|
-
result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height,
|
|
42
|
+
result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen }));
|
|
23
43
|
}
|
|
24
44
|
if (dataLens) {
|
|
25
45
|
result = React.createElement(DataLens, { dataLens: dataLens });
|
|
@@ -43,7 +63,7 @@ export const Media = (props) => {
|
|
|
43
63
|
playButton,
|
|
44
64
|
customBarControlsClassName,
|
|
45
65
|
youtubeClassName,
|
|
46
|
-
|
|
66
|
+
fullscreen,
|
|
47
67
|
]);
|
|
48
68
|
return (React.createElement("div", { className: b(null, className), style: { backgroundColor: color } }, content));
|
|
49
69
|
};
|
|
@@ -11,6 +11,6 @@ interface InnerVideoProps {
|
|
|
11
11
|
setHasVideoFallback: React.Dispatch<boolean>;
|
|
12
12
|
hasVideoFallback: boolean;
|
|
13
13
|
}
|
|
14
|
-
type VideoAllProps = VideoAdditionProps & MediaComponentVideoProps & InnerVideoProps;
|
|
14
|
+
export type VideoAllProps = VideoAdditionProps & MediaComponentVideoProps & InnerVideoProps;
|
|
15
15
|
declare const Video: (props: VideoAllProps) => JSX.Element | null;
|
|
16
16
|
export default Video;
|
|
@@ -14,7 +14,7 @@ export interface VideoBlockProps {
|
|
|
14
14
|
previewImg?: string;
|
|
15
15
|
playButton?: React.ReactNode;
|
|
16
16
|
height?: number;
|
|
17
|
-
|
|
17
|
+
fullscreen?: boolean;
|
|
18
18
|
}
|
|
19
19
|
declare const VideoBlock: (props: VideoBlockProps) => JSX.Element | null;
|
|
20
20
|
export default VideoBlock;
|
|
@@ -35,7 +35,7 @@ export function getHeight(width) {
|
|
|
35
35
|
return (width / 16) * 9;
|
|
36
36
|
}
|
|
37
37
|
const VideoBlock = (props) => {
|
|
38
|
-
const { stream, record, attributes, className, id, previewImg, playButton, height,
|
|
38
|
+
const { stream, record, attributes, className, id, previewImg, playButton, height, fullscreen } = props;
|
|
39
39
|
const src = getVideoSrc(stream, record);
|
|
40
40
|
const ref = useRef(null);
|
|
41
41
|
const iframeRef = useRef();
|
|
@@ -78,14 +78,14 @@ const VideoBlock = (props) => {
|
|
|
78
78
|
ref.current.appendChild(iframe);
|
|
79
79
|
iframeRef.current = iframe;
|
|
80
80
|
}
|
|
81
|
-
}, [stream, record, norender, src, fullId, attributes, iframeRef,
|
|
81
|
+
}, [stream, record, norender, src, fullId, attributes, iframeRef, fullscreen]);
|
|
82
82
|
useEffect(() => {
|
|
83
83
|
setHidePreview(false);
|
|
84
84
|
}, [src, setHidePreview]);
|
|
85
85
|
if (norender) {
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
88
|
-
return (React.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && !
|
|
88
|
+
return (React.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && !fullscreen && (React.createElement("div", { className: b('preview'), onClick: onPreviewClick },
|
|
89
89
|
React.createElement(Image, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper') }),
|
|
90
90
|
playButton || (React.createElement("button", { className: b('button') },
|
|
91
91
|
React.createElement(Icon, { className: b('icon'), data: PlayVideo, size: 24 })))))));
|
|
@@ -33,6 +33,6 @@ export { default as Author } from './Author/Author';
|
|
|
33
33
|
export { default as RouterLink } from './RouterLink/RouterLink';
|
|
34
34
|
export { default as HTML } from './HTML/HTML';
|
|
35
35
|
export { default as MetaInfo } from './MetaInfo/MetaInfo';
|
|
36
|
-
export { default as
|
|
36
|
+
export { default as FullscreenMedia } from './FullscreenMedia/FullscreenMedia';
|
|
37
37
|
export type { RouterLinkProps } from './RouterLink/RouterLink';
|
|
38
38
|
export type { ImageBaseProps } from './ImageBase/ImageBase';
|
|
@@ -33,4 +33,4 @@ export { default as Author } from './Author/Author';
|
|
|
33
33
|
export { default as RouterLink } from './RouterLink/RouterLink';
|
|
34
34
|
export { default as HTML } from './HTML/HTML';
|
|
35
35
|
export { default as MetaInfo } from './MetaInfo/MetaInfo';
|
|
36
|
-
export { default as
|
|
36
|
+
export { default as FullscreenMedia } from './FullscreenMedia/FullscreenMedia';
|
|
@@ -23,7 +23,7 @@ export declare const subBlockMap: {
|
|
|
23
23
|
"price-detailed": (props: import("./models").PriceDetailedProps) => JSX.Element;
|
|
24
24
|
"media-card": ({ border, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
|
|
25
25
|
"banner-card": (props: import("./models").BannerCardProps) => JSX.Element;
|
|
26
|
-
"layout-item": ({ content: { links, ...content }, metaInfo, media, border,
|
|
26
|
+
"layout-item": ({ content: { links, ...content }, metaInfo, media, border, fullscreen, className, }: import("./models").LayoutItemProps) => JSX.Element;
|
|
27
27
|
"background-card": (props: import("./models").BackgroundCardProps) => JSX.Element;
|
|
28
28
|
"basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
|
|
29
29
|
content: (props: import("./models").ContentBlockProps & import("./models").ClassNameProps) => JSX.Element;
|
|
@@ -7,4 +7,4 @@ export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivE
|
|
|
7
7
|
dataQa?: string;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "className" | "reset" | "
|
|
10
|
+
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "className" | "reset" | "visible" | "sizes" | "offsets" | "orders" | "hidden" | "alignSelf" | "justifyContent" | "dataQa"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { a11yHiddenSvgProps } from '../utils/svg';
|
|
3
|
-
export const
|
|
3
|
+
export const Fullscreen = (props) => (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor" }, a11yHiddenSvgProps, props),
|
|
4
4
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18 4.654v.291a10 10 0 0 0-1.763 1.404l-2.944 2.944a1 1 0 0 0 1.414 1.414l2.933-2.932A9.996 9.996 0 0 0 19.05 6h.296l-.09.39A9.993 9.993 0 0 0 19 8.64v.857a1 1 0 0 0 2 0V4.503a1.5 1.5 0 0 0-1.5-1.5L14.5 3a1 1 0 1 0 0 2h.861a10 10 0 0 0 2.249-.256l.39-.09zM4.95 18a10 10 0 0 1 1.41-1.775l2.933-2.932a1 1 0 0 1 1.414 1.414l-2.944 2.944A9.998 9.998 0 0 1 6 19.055v.291l.39-.09A9.993 9.993 0 0 1 8.64 19h.86a1 1 0 0 1 0 2l-5-.003a1.5 1.5 0 0 1-1.5-1.5V14.5a1 1 0 1 1 2 0v.861a10 10 0 0 1-.256 2.249l-.09.39h.296z" })));
|
package/build/esm/icons/index.js
CHANGED
|
@@ -212,7 +212,7 @@ export interface TabsBlockProps extends Animatable {
|
|
|
212
212
|
items: TabsBlockItem[];
|
|
213
213
|
}
|
|
214
214
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
215
|
-
title
|
|
215
|
+
title?: TitleItemProps | string;
|
|
216
216
|
description?: string;
|
|
217
217
|
colSizes?: GridColumnSizesType;
|
|
218
218
|
}
|
|
@@ -169,7 +169,7 @@ export interface MediaComponentVideoProps extends AnalyticsEventsBase {
|
|
|
169
169
|
export interface MediaComponentYoutubeProps {
|
|
170
170
|
youtube: string;
|
|
171
171
|
previewImg?: string;
|
|
172
|
-
|
|
172
|
+
fullscreen?: boolean;
|
|
173
173
|
}
|
|
174
174
|
export interface MediaComponentImageProps {
|
|
175
175
|
image: ImageProps | ImageProps[] | ImageDeviceProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LayoutItemProps } from '../../models';
|
|
2
2
|
import './LayoutItem.css';
|
|
3
|
-
declare const LayoutItem: ({ content: { links, ...content }, metaInfo, media, border,
|
|
3
|
+
declare const LayoutItem: ({ content: { links, ...content }, metaInfo, media, border, fullscreen, className, }: LayoutItemProps) => JSX.Element;
|
|
4
4
|
export default LayoutItem;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Content } from '..';
|
|
4
|
-
import {
|
|
4
|
+
import { FullscreenMedia, Media, MetaInfo } from '../../components';
|
|
5
5
|
import { block } from '../../utils';
|
|
6
|
-
import { getLayoutItemLinks,
|
|
6
|
+
import { getLayoutItemLinks, hasFullscreen, showFullscreenIcon } from './utils';
|
|
7
7
|
import './LayoutItem.css';
|
|
8
8
|
const b = block('layout-item');
|
|
9
9
|
const LayoutItem = (_a) => {
|
|
10
|
-
var _b = _a.content, { links } = _b, content = __rest(_b, ["links"]), { metaInfo, media, border,
|
|
10
|
+
var _b = _a.content, { links } = _b, content = __rest(_b, ["links"]), { metaInfo, media, border, fullscreen, className } = _a;
|
|
11
11
|
return (React.createElement("div", { className: b(null, className) },
|
|
12
|
-
|
|
13
|
-
var { className: mediaClassName } = _a,
|
|
14
|
-
return (React.createElement(Media, Object.assign({}, media,
|
|
12
|
+
fullscreen && hasFullscreen(media) ? (React.createElement(FullscreenMedia, { showFullscreenIcon: showFullscreenIcon(media) }, (_a = {}) => {
|
|
13
|
+
var { className: mediaClassName, fullscreen: _fullscreen } = _a, fullscreenMediaProps = __rest(_a, ["className", "fullscreen"]);
|
|
14
|
+
return (React.createElement(Media, Object.assign({}, media, fullscreenMediaProps, { className: b('media', { border }, mediaClassName) })));
|
|
15
15
|
})) : (React.createElement(Media, Object.assign({}, media, { className: b('media', { border }) }))),
|
|
16
16
|
metaInfo && React.createElement(MetaInfo, { items: metaInfo, className: b('meta-info') }),
|
|
17
17
|
React.createElement("div", { className: b('content') },
|
|
@@ -132,6 +132,9 @@ export declare const LayoutItem: {
|
|
|
132
132
|
type: string;
|
|
133
133
|
})[];
|
|
134
134
|
};
|
|
135
|
+
fullscreen: {
|
|
136
|
+
type: string;
|
|
137
|
+
};
|
|
135
138
|
};
|
|
136
139
|
content: Partial<{
|
|
137
140
|
title: {
|
|
@@ -209,7 +212,7 @@ export declare const LayoutItem: {
|
|
|
209
212
|
border: {
|
|
210
213
|
type: string;
|
|
211
214
|
};
|
|
212
|
-
|
|
215
|
+
fullscreen: {
|
|
213
216
|
type: string;
|
|
214
217
|
};
|
|
215
218
|
type: {};
|
|
@@ -8,7 +8,7 @@ export const LayoutItem = {
|
|
|
8
8
|
required: ['content', 'media'],
|
|
9
9
|
properties: Object.assign(Object.assign({}, BaseProps), { media: MediaProps, content: omit(ContentBase, ['colSize', 'size', 'centered']), metaInfo: metaInfo, border: {
|
|
10
10
|
type: 'boolean',
|
|
11
|
-
},
|
|
11
|
+
}, fullscreen: {
|
|
12
12
|
type: 'boolean',
|
|
13
13
|
} }),
|
|
14
14
|
};
|
|
@@ -24,5 +24,5 @@ export declare const getLayoutItemLinks: (links: LayoutItemProps['content']['lin
|
|
|
24
24
|
}[] | undefined;
|
|
25
25
|
className?: string | undefined;
|
|
26
26
|
}[] | undefined;
|
|
27
|
-
export declare const
|
|
28
|
-
export declare const
|
|
27
|
+
export declare const hasFullscreen: ({ dataLens, image }: MediaProps) => boolean;
|
|
28
|
+
export declare const showFullscreenIcon: ({ youtube }: MediaProps) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const getLayoutItemLinks = (links) => links === null || links === void 0 ? void 0 : links.map((link) => (Object.assign({ theme: 'normal' }, link)));
|
|
2
|
-
export const
|
|
3
|
-
// datalens and slider media card don't support
|
|
2
|
+
export const hasFullscreen = ({ dataLens, image }) => {
|
|
3
|
+
// datalens and slider media card don't support fullscreen mode
|
|
4
4
|
return !(dataLens || Array.isArray(image));
|
|
5
5
|
};
|
|
6
|
-
export const
|
|
6
|
+
export const showFullscreenIcon = ({ youtube }) => !youtube;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -139,8 +139,5 @@
|
|
|
139
139
|
"*.{json,yaml,yml,md}": [
|
|
140
140
|
"prettier --write"
|
|
141
141
|
]
|
|
142
|
-
},
|
|
143
|
-
"publishConfig": {
|
|
144
|
-
"tag": "alpha"
|
|
145
142
|
}
|
|
146
143
|
}
|
|
@@ -212,7 +212,7 @@ export interface TabsBlockProps extends Animatable {
|
|
|
212
212
|
items: TabsBlockItem[];
|
|
213
213
|
}
|
|
214
214
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
215
|
-
title
|
|
215
|
+
title?: TitleItemProps | string;
|
|
216
216
|
description?: string;
|
|
217
217
|
colSizes?: GridColumnSizesType;
|
|
218
218
|
}
|
|
@@ -169,7 +169,7 @@ export interface MediaComponentVideoProps extends AnalyticsEventsBase {
|
|
|
169
169
|
export interface MediaComponentYoutubeProps {
|
|
170
170
|
youtube: string;
|
|
171
171
|
previewImg?: string;
|
|
172
|
-
|
|
172
|
+
fullscreen?: boolean;
|
|
173
173
|
}
|
|
174
174
|
export interface MediaComponentImageProps {
|
|
175
175
|
image: ImageProps | ImageProps[] | ImageDeviceProps;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MediaAllProps } from '../Media/Media';
|
|
3
|
-
export type ChildMediaRenderProps = Pick<MediaAllProps, 'fullScreen' | 'imageClassName' | 'videoClassName' | 'youtubeClassName' | 'className'>;
|
|
4
|
-
export interface FullScreenMediaProps {
|
|
5
|
-
showFullScreenIcon?: boolean;
|
|
6
|
-
children: (props?: ChildMediaRenderProps) => JSX.Element;
|
|
7
|
-
}
|
|
8
|
-
declare const FullScreenMedia: ({ children, showFullScreenIcon }: FullScreenMediaProps) => JSX.Element;
|
|
9
|
-
export default FullScreenMedia;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MediaAllProps } from '../Media/Media';
|
|
3
|
-
import './FullScreenMedia.css';
|
|
4
|
-
export type ChildMediaRenderProps = Pick<MediaAllProps, 'fullScreen' | 'imageClassName' | 'videoClassName' | 'youtubeClassName' | 'className'>;
|
|
5
|
-
export interface FullScreenMediaProps {
|
|
6
|
-
showFullScreenIcon?: boolean;
|
|
7
|
-
children: (props?: ChildMediaRenderProps) => JSX.Element;
|
|
8
|
-
}
|
|
9
|
-
declare const FullScreenMedia: ({ children, showFullScreenIcon }: FullScreenMediaProps) => JSX.Element;
|
|
10
|
-
export default FullScreenMedia;
|
|
File without changes
|
|
File without changes
|