@gravity-ui/page-constructor 4.53.0 → 4.55.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/build/cjs/blocks/Media/Media.css +3 -0
- package/build/cjs/blocks/Media/Media.js +1 -1
- package/build/cjs/blocks/Tabs/Tabs.css +8 -1
- package/build/cjs/blocks/Tabs/Tabs.js +3 -2
- package/build/cjs/blocks/Tabs/schema.d.ts +4 -0
- package/build/cjs/blocks/Tabs/schema.js +4 -1
- package/build/cjs/components/Foldable/Foldable.d.ts +3 -3
- package/build/cjs/components/Foldable/Foldable.js +4 -3
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -1
- package/build/cjs/sub-blocks/PriceCard/PriceCard.js +1 -1
- package/build/esm/blocks/Media/Media.css +3 -0
- package/build/esm/blocks/Media/Media.js +1 -1
- package/build/esm/blocks/Tabs/Tabs.css +8 -1
- package/build/esm/blocks/Tabs/Tabs.js +3 -2
- package/build/esm/blocks/Tabs/schema.d.ts +4 -0
- package/build/esm/blocks/Tabs/schema.js +4 -1
- package/build/esm/components/Foldable/Foldable.d.ts +3 -3
- package/build/esm/components/Foldable/Foldable.js +5 -4
- package/build/esm/models/constructor-items/blocks.d.ts +1 -1
- package/build/esm/sub-blocks/PriceCard/PriceCard.js +2 -2
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +1 -1
- package/styles/storybook/common.scss +8 -0
- package/widget/index.js +1 -1
|
@@ -20,7 +20,7 @@ const MediaBlock = (props) => {
|
|
|
20
20
|
const mediaThemed = (0, utils_1.getThemedValue)(media, theme);
|
|
21
21
|
return (react_1.default.createElement(MediaBase_1.default, Object.assign({}, props, { onScroll: () => setPlay(true) }),
|
|
22
22
|
react_1.default.createElement(MediaBase_1.default.Card, null,
|
|
23
|
-
react_1.default.createElement(Media_1.default, Object.assign({}, mediaThemed, { playVideo: play, className: b({ border: borderSelected }) })))));
|
|
23
|
+
react_1.default.createElement(Media_1.default, Object.assign({ imageClassName: b('image') }, mediaThemed, { playVideo: play, className: b({ border: borderSelected }) })))));
|
|
24
24
|
};
|
|
25
25
|
exports.MediaBlock = MediaBlock;
|
|
26
26
|
exports.default = exports.MediaBlock;
|
|
@@ -46,11 +46,18 @@ unpredictable css rules order in build */
|
|
|
46
46
|
object-fit: cover;
|
|
47
47
|
display: block;
|
|
48
48
|
}
|
|
49
|
-
.pc-tabs-
|
|
49
|
+
.pc-tabs-block__image_border_shadow, .pc-tabs-block__media_border_shadow {
|
|
50
50
|
box-shadow: 0 2px 8px var(--pc-color-sfx-shadow), 0 4px 24px var(--pc-color-sfx-shadow);
|
|
51
51
|
overflow-x: hidden;
|
|
52
52
|
border-radius: var(--pc-border-radius);
|
|
53
53
|
}
|
|
54
|
+
.pc-tabs-block__image_border_line, .pc-tabs-block__media_border_line {
|
|
55
|
+
border-radius: var(--pc-border-radius);
|
|
56
|
+
border: 1px solid var(--g-color-line-generic);
|
|
57
|
+
}
|
|
58
|
+
.pc-tabs-block__image_border_none, .pc-tabs-block__media_border_none {
|
|
59
|
+
border-radius: var(--pc-border-radius);
|
|
60
|
+
}
|
|
54
61
|
.pc-tabs-block__caption {
|
|
55
62
|
font-size: var(--g-text-body-2-font-size);
|
|
56
63
|
line-height: var(--g-text-body-2-line-height);
|
|
@@ -60,15 +60,16 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
60
60
|
}
|
|
61
61
|
const showMedia = Boolean((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps);
|
|
62
62
|
const showText = Boolean(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.text);
|
|
63
|
+
const border = (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.border) || 'shadow';
|
|
63
64
|
const textContent = activeTabData && showText && (react_1.default.createElement(TabsTextContent_1.default, { showMedia: showMedia, data: activeTabData, imageProps: imageProps ? imageProps : undefined, isReverse: isReverse, contentSize: contentSize, centered: centered }));
|
|
64
65
|
const mediaContent = showMedia && (react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 8 }, orders: {
|
|
65
66
|
all: grid_1.GridColumnOrderClasses.Last,
|
|
66
67
|
md: grid_1.GridColumnOrderClasses.First,
|
|
67
68
|
}, className: b('col', { centered: centered }) },
|
|
68
69
|
react_1.default.createElement("div", { style: { minHeight: mediaVideoHeight || minImageHeight } }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (react_1.default.createElement("div", { ref: ref },
|
|
69
|
-
react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_2.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaVideoHeight || undefined, onImageLoad: handleImageHeight }))))),
|
|
70
|
+
react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_2.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media', { border }), playVideo: play, height: mediaVideoHeight || undefined, onImageLoad: handleImageHeight }))))),
|
|
70
71
|
imageProps && (react_1.default.createElement(react_1.Fragment, null,
|
|
71
|
-
react_1.default.createElement(FullscreenImage_1.default, Object.assign({}, imageProps, { imageClassName: b('image') })))),
|
|
72
|
+
react_1.default.createElement(FullscreenImage_1.default, Object.assign({}, imageProps, { imageClassName: b('image', { border }) })))),
|
|
72
73
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (react_1.default.createElement("p", { className: b('caption'), id: captionId },
|
|
73
74
|
react_1.default.createElement(YFMWrapper_1.default, { content: activeTabData.caption, modifiers: { constructor: true }, id: captionId })))));
|
|
74
75
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), onScroll: () => setPlay(true), animate: animated },
|
|
@@ -22,7 +22,10 @@ exports.tabsItem = {
|
|
|
22
22
|
properties: common_1.MediaProps,
|
|
23
23
|
}),
|
|
24
24
|
//TODO deprecated
|
|
25
|
-
link: common_1.LinkProps, image: (0, common_1.withTheme)(schema_1.ImageProps)
|
|
25
|
+
link: common_1.LinkProps, image: (0, common_1.withTheme)(schema_1.ImageProps), border: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
enum: ['shadow', 'line', 'none'],
|
|
28
|
+
} }),
|
|
26
29
|
};
|
|
27
30
|
exports.TabsBlock = {
|
|
28
31
|
'tabs-block': {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { WithChildren } from '../../models';
|
|
2
|
-
export interface FoldableProps {
|
|
1
|
+
import { QAProps, WithChildren } from '../../models';
|
|
2
|
+
export interface FoldableProps extends QAProps {
|
|
3
3
|
isOpened: boolean;
|
|
4
4
|
className?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const Foldable: ({ isOpened, children, className }: WithChildren<FoldableProps>) => JSX.Element;
|
|
6
|
+
declare const Foldable: ({ isOpened, children, className, qa }: WithChildren<FoldableProps>) => JSX.Element;
|
|
7
7
|
export default Foldable;
|
|
@@ -5,7 +5,8 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const useHeightCalculator_1 = tslib_1.__importDefault(require("../../hooks/useHeightCalculator"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const b = (0, utils_1.block)('foldable-block');
|
|
8
|
-
const Foldable = ({ isOpened, children, className }) => {
|
|
8
|
+
const Foldable = ({ isOpened, children, className, qa }) => {
|
|
9
|
+
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa);
|
|
9
10
|
const blockRef = (0, react_1.useRef)(null);
|
|
10
11
|
const contentRef = (0, react_1.useRef)(null);
|
|
11
12
|
const contentHeight = (0, useHeightCalculator_1.default)(contentRef);
|
|
@@ -14,7 +15,7 @@ const Foldable = ({ isOpened, children, className }) => {
|
|
|
14
15
|
blockRef.current.style.height = isOpened && contentHeight ? `${contentHeight}px` : '0';
|
|
15
16
|
}
|
|
16
17
|
}, [isOpened, contentHeight]);
|
|
17
|
-
return (react_1.default.createElement("div", { ref: blockRef, className: b({ open: isOpened }, className) },
|
|
18
|
-
react_1.default.createElement("div", { ref: contentRef, className: b('content-container') }, children)));
|
|
18
|
+
return (react_1.default.createElement("div", { ref: blockRef, className: b({ open: isOpened }, className), "data-qa": qaAttributes.default },
|
|
19
|
+
react_1.default.createElement("div", { ref: contentRef, className: b('content-container'), "data-qa": qaAttributes.container }, children)));
|
|
19
20
|
};
|
|
20
21
|
exports.default = Foldable;
|
|
@@ -209,7 +209,7 @@ export interface TableBlockProps {
|
|
|
209
209
|
title: string;
|
|
210
210
|
table: TableProps;
|
|
211
211
|
}
|
|
212
|
-
export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'
|
|
212
|
+
export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>, WithBorder {
|
|
213
213
|
tabName: string;
|
|
214
214
|
/**
|
|
215
215
|
* @deprecated Use array links from ContentBlockProps instead
|
|
@@ -13,7 +13,7 @@ const PriceCard = (props) => {
|
|
|
13
13
|
react_1.default.createElement(components_1.BackgroundImage, { className: b('background'), style: { backgroundColor } }),
|
|
14
14
|
react_1.default.createElement("div", { className: b('content', { theme }) },
|
|
15
15
|
react_1.default.createElement("div", { className: b('info') },
|
|
16
|
-
react_1.default.createElement(
|
|
16
|
+
react_1.default.createElement(components_1.HTML, { className: b('title') }, title),
|
|
17
17
|
react_1.default.createElement("div", { className: b('price') },
|
|
18
18
|
react_1.default.createElement("div", null,
|
|
19
19
|
react_1.default.createElement("span", { className: b('price-value') }, price),
|
|
@@ -17,6 +17,6 @@ export const MediaBlock = (props) => {
|
|
|
17
17
|
const mediaThemed = getThemedValue(media, theme);
|
|
18
18
|
return (React.createElement(MediaBase, Object.assign({}, props, { onScroll: () => setPlay(true) }),
|
|
19
19
|
React.createElement(MediaBase.Card, null,
|
|
20
|
-
React.createElement(Media, Object.assign({}, mediaThemed, { playVideo: play, className: b({ border: borderSelected }) })))));
|
|
20
|
+
React.createElement(Media, Object.assign({ imageClassName: b('image') }, mediaThemed, { playVideo: play, className: b({ border: borderSelected }) })))));
|
|
21
21
|
};
|
|
22
22
|
export default MediaBlock;
|
|
@@ -46,11 +46,18 @@ unpredictable css rules order in build */
|
|
|
46
46
|
object-fit: cover;
|
|
47
47
|
display: block;
|
|
48
48
|
}
|
|
49
|
-
.pc-tabs-
|
|
49
|
+
.pc-tabs-block__image_border_shadow, .pc-tabs-block__media_border_shadow {
|
|
50
50
|
box-shadow: 0 2px 8px var(--pc-color-sfx-shadow), 0 4px 24px var(--pc-color-sfx-shadow);
|
|
51
51
|
overflow-x: hidden;
|
|
52
52
|
border-radius: var(--pc-border-radius);
|
|
53
53
|
}
|
|
54
|
+
.pc-tabs-block__image_border_line, .pc-tabs-block__media_border_line {
|
|
55
|
+
border-radius: var(--pc-border-radius);
|
|
56
|
+
border: 1px solid var(--g-color-line-generic);
|
|
57
|
+
}
|
|
58
|
+
.pc-tabs-block__image_border_none, .pc-tabs-block__media_border_none {
|
|
59
|
+
border-radius: var(--pc-border-radius);
|
|
60
|
+
}
|
|
54
61
|
.pc-tabs-block__caption {
|
|
55
62
|
font-size: var(--g-text-body-2-font-size);
|
|
56
63
|
line-height: var(--g-text-body-2-line-height);
|
|
@@ -57,15 +57,16 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
|
|
|
57
57
|
}
|
|
58
58
|
const showMedia = Boolean((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps);
|
|
59
59
|
const showText = Boolean(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.text);
|
|
60
|
+
const border = (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.border) || 'shadow';
|
|
60
61
|
const textContent = activeTabData && showText && (React.createElement(TabsTextContent, { showMedia: showMedia, data: activeTabData, imageProps: imageProps ? imageProps : undefined, isReverse: isReverse, contentSize: contentSize, centered: centered }));
|
|
61
62
|
const mediaContent = showMedia && (React.createElement(Col, { sizes: { all: 12, md: 8 }, orders: {
|
|
62
63
|
all: GridColumnOrderClasses.Last,
|
|
63
64
|
md: GridColumnOrderClasses.First,
|
|
64
65
|
}, className: b('col', { centered: centered }) },
|
|
65
66
|
React.createElement("div", { style: { minHeight: mediaVideoHeight || minImageHeight } }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement("div", { ref: ref },
|
|
66
|
-
React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaVideoHeight || undefined, onImageLoad: handleImageHeight }))))),
|
|
67
|
+
React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media', { border }), playVideo: play, height: mediaVideoHeight || undefined, onImageLoad: handleImageHeight }))))),
|
|
67
68
|
imageProps && (React.createElement(Fragment, null,
|
|
68
|
-
React.createElement(FullscreenImage, Object.assign({}, imageProps, { imageClassName: b('image') })))),
|
|
69
|
+
React.createElement(FullscreenImage, Object.assign({}, imageProps, { imageClassName: b('image', { border }) })))),
|
|
69
70
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (React.createElement("p", { className: b('caption'), id: captionId },
|
|
70
71
|
React.createElement(YFMWrapper, { content: activeTabData.caption, modifiers: { constructor: true }, id: captionId })))));
|
|
71
72
|
return (React.createElement(AnimateBlock, { className: b(), onScroll: () => setPlay(true), animate: animated },
|
|
@@ -18,7 +18,10 @@ export const tabsItem = {
|
|
|
18
18
|
properties: MediaProps,
|
|
19
19
|
}),
|
|
20
20
|
//TODO deprecated
|
|
21
|
-
link: LinkProps, image: withTheme(ImageProps)
|
|
21
|
+
link: LinkProps, image: withTheme(ImageProps), border: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
enum: ['shadow', 'line', 'none'],
|
|
24
|
+
} }),
|
|
22
25
|
};
|
|
23
26
|
export const TabsBlock = {
|
|
24
27
|
'tabs-block': {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { WithChildren } from '../../models';
|
|
1
|
+
import { QAProps, WithChildren } from '../../models';
|
|
2
2
|
import './Foldable.css';
|
|
3
|
-
export interface FoldableProps {
|
|
3
|
+
export interface FoldableProps extends QAProps {
|
|
4
4
|
isOpened: boolean;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const Foldable: ({ isOpened, children, className }: WithChildren<FoldableProps>) => JSX.Element;
|
|
7
|
+
declare const Foldable: ({ isOpened, children, className, qa }: WithChildren<FoldableProps>) => JSX.Element;
|
|
8
8
|
export default Foldable;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import useHeightCalculator from '../../hooks/useHeightCalculator';
|
|
3
|
-
import { block } from '../../utils';
|
|
3
|
+
import { block, getQaAttrubutes } from '../../utils';
|
|
4
4
|
import './Foldable.css';
|
|
5
5
|
const b = block('foldable-block');
|
|
6
|
-
const Foldable = ({ isOpened, children, className }) => {
|
|
6
|
+
const Foldable = ({ isOpened, children, className, qa }) => {
|
|
7
|
+
const qaAttributes = getQaAttrubutes(qa);
|
|
7
8
|
const blockRef = useRef(null);
|
|
8
9
|
const contentRef = useRef(null);
|
|
9
10
|
const contentHeight = useHeightCalculator(contentRef);
|
|
@@ -12,7 +13,7 @@ const Foldable = ({ isOpened, children, className }) => {
|
|
|
12
13
|
blockRef.current.style.height = isOpened && contentHeight ? `${contentHeight}px` : '0';
|
|
13
14
|
}
|
|
14
15
|
}, [isOpened, contentHeight]);
|
|
15
|
-
return (React.createElement("div", { ref: blockRef, className: b({ open: isOpened }, className) },
|
|
16
|
-
React.createElement("div", { ref: contentRef, className: b('content-container') }, children)));
|
|
16
|
+
return (React.createElement("div", { ref: blockRef, className: b({ open: isOpened }, className), "data-qa": qaAttributes.default },
|
|
17
|
+
React.createElement("div", { ref: contentRef, className: b('content-container'), "data-qa": qaAttributes.container }, children)));
|
|
17
18
|
};
|
|
18
19
|
export default Foldable;
|
|
@@ -209,7 +209,7 @@ export interface TableBlockProps {
|
|
|
209
209
|
title: string;
|
|
210
210
|
table: TableProps;
|
|
211
211
|
}
|
|
212
|
-
export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'
|
|
212
|
+
export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>, WithBorder {
|
|
213
213
|
tabName: string;
|
|
214
214
|
/**
|
|
215
215
|
* @deprecated Use array links from ContentBlockProps instead
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Check from '@gravity-ui/icons/Check';
|
|
3
|
-
import { BackgroundImage, Button, CardBase, ContentList, Link as LinkBlock } from '../../components';
|
|
3
|
+
import { BackgroundImage, Button, CardBase, ContentList, HTML, Link as LinkBlock, } from '../../components';
|
|
4
4
|
import { block } from '../../utils';
|
|
5
5
|
import './PriceCard.css';
|
|
6
6
|
const b = block('price-card');
|
|
@@ -11,7 +11,7 @@ const PriceCard = (props) => {
|
|
|
11
11
|
React.createElement(BackgroundImage, { className: b('background'), style: { backgroundColor } }),
|
|
12
12
|
React.createElement("div", { className: b('content', { theme }) },
|
|
13
13
|
React.createElement("div", { className: b('info') },
|
|
14
|
-
React.createElement(
|
|
14
|
+
React.createElement(HTML, { className: b('title') }, title),
|
|
15
15
|
React.createElement("div", { className: b('price') },
|
|
16
16
|
React.createElement("div", null,
|
|
17
17
|
React.createElement("span", { className: b('price-value') }, price),
|
package/package.json
CHANGED
|
@@ -209,7 +209,7 @@ export interface TableBlockProps {
|
|
|
209
209
|
title: string;
|
|
210
210
|
table: TableProps;
|
|
211
211
|
}
|
|
212
|
-
export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'
|
|
212
|
+
export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>, WithBorder {
|
|
213
213
|
tabName: string;
|
|
214
214
|
/**
|
|
215
215
|
* @deprecated Use array links from ContentBlockProps instead
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '../mixins';
|
|
2
|
+
|
|
1
3
|
.demo-container {
|
|
2
4
|
min-height: calc(100vh - 1px);
|
|
3
5
|
padding: 50px;
|
|
@@ -35,3 +37,9 @@
|
|
|
35
37
|
--pc-first-block-indent: 64px;
|
|
36
38
|
margin-bottom: 120px;
|
|
37
39
|
}
|
|
40
|
+
|
|
41
|
+
.pc-layout {
|
|
42
|
+
@include add-specificity(&) {
|
|
43
|
+
min-height: auto;
|
|
44
|
+
}
|
|
45
|
+
}
|