@gravity-ui/page-constructor 4.56.0 → 4.57.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/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/Media/Image/Image.js +4 -1
- package/build/cjs/components/Media/Media.js +3 -2
- package/build/cjs/models/constructor-items/common.d.ts +1 -0
- package/build/cjs/schema/constants.d.ts +3 -0
- package/build/cjs/schema/validators/common.d.ts +3 -0
- package/build/cjs/schema/validators/common.js +3 -0
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +4 -10
- package/build/cjs/sub-blocks/BasicCard/BasicCard.css +7 -0
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +4 -10
- package/build/cjs/sub-blocks/Content/Content.css +6 -2
- package/build/cjs/sub-blocks/Content/Content.js +3 -10
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +3 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +2 -8
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +3 -0
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +3 -0
- 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/schema.d.ts +3 -0
- package/build/esm/components/Media/Image/Image.js +4 -1
- package/build/esm/components/Media/Media.js +3 -2
- package/build/esm/models/constructor-items/common.d.ts +1 -0
- package/build/esm/schema/constants.d.ts +3 -0
- package/build/esm/schema/validators/common.d.ts +3 -0
- package/build/esm/schema/validators/common.js +3 -0
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +5 -11
- package/build/esm/sub-blocks/BasicCard/BasicCard.css +7 -0
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -11
- package/build/esm/sub-blocks/Content/Content.css +6 -2
- package/build/esm/sub-blocks/Content/Content.js +4 -11
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +3 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +3 -9
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +3 -0
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +3 -0
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +1 -0
- package/widget/index.js +1 -1
- package/build/cjs/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
- package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
- package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -9
- package/build/cjs/utils/renderContentControls/ContentControls.css +0 -6
- package/build/cjs/utils/renderContentControls/renderContentControls.d.ts +0 -11
- package/build/cjs/utils/renderContentControls/renderContentControls.js +0 -16
- package/build/esm/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
- package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
- package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -6
- package/build/esm/utils/renderContentControls/ContentControls.css +0 -6
- package/build/esm/utils/renderContentControls/renderContentControls.d.ts +0 -12
- package/build/esm/utils/renderContentControls/renderContentControls.js +0 -14
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { useUniqId } from '@gravity-ui/uikit';
|
|
4
|
-
import { CardBase, IconWrapper } from '../../components';
|
|
4
|
+
import { Buttons, CardBase, IconWrapper, Links } from '../../components';
|
|
5
5
|
import { IconPosition } from '../../models/constructor-items/sub-blocks';
|
|
6
6
|
import { block } from '../../utils';
|
|
7
|
-
import renderContentControls from '../../utils/renderContentControls/renderContentControls';
|
|
8
7
|
import Content from '../Content/Content';
|
|
9
|
-
import renderCardFooterControlsContainer from '../renderCardFooterControlsContainer/renderCardFooterControlsContainer';
|
|
10
8
|
import './BasicCard.css';
|
|
11
9
|
const b = block('basic-card');
|
|
12
10
|
const BasicCard = (props) => {
|
|
@@ -14,16 +12,12 @@ const BasicCard = (props) => {
|
|
|
14
12
|
const titleId = useUniqId();
|
|
15
13
|
const descriptionId = useUniqId();
|
|
16
14
|
const areControlsInFooter = controlPosition === 'footer';
|
|
17
|
-
const footerControls = useMemo(() => renderContentControls({
|
|
18
|
-
links: areControlsInFooter ? links : undefined,
|
|
19
|
-
buttons: areControlsInFooter ? buttons : undefined,
|
|
20
|
-
size: 's',
|
|
21
|
-
titleId,
|
|
22
|
-
}, renderCardFooterControlsContainer), [areControlsInFooter, links, buttons, titleId]);
|
|
23
15
|
return (React.createElement(CardBase, Object.assign({ className: b() }, cardParams, { extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId } }),
|
|
24
16
|
React.createElement(CardBase.Content, null,
|
|
25
17
|
React.createElement(IconWrapper, { icon: icon ? { value: icon, position: iconPosition } : undefined },
|
|
26
18
|
React.createElement(Content, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: areControlsInFooter ? undefined : links, list: list, buttons: areControlsInFooter ? undefined : buttons, size: "s", colSizes: { all: 12, md: 12 } }))),
|
|
27
|
-
|
|
19
|
+
areControlsInFooter && (buttons || links) && (React.createElement(CardBase.Footer, { className: b('footer') },
|
|
20
|
+
React.createElement(Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
|
|
21
|
+
React.createElement(Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
|
|
28
22
|
};
|
|
29
23
|
export default BasicCard;
|
|
@@ -57,7 +57,9 @@ unpredictable css rules order in build */
|
|
|
57
57
|
.pc-content_size_s .pc-content__text_without-title {
|
|
58
58
|
margin-top: 0;
|
|
59
59
|
}
|
|
60
|
-
.pc-content_size_s .pc-content__list
|
|
60
|
+
.pc-content_size_s .pc-content__list,
|
|
61
|
+
.pc-content_size_s .pc-content__links,
|
|
62
|
+
.pc-content_size_s .pc-content__buttons {
|
|
61
63
|
margin-top: 16px;
|
|
62
64
|
}
|
|
63
65
|
.pc-content_size_l .pc-content__text,
|
|
@@ -72,7 +74,9 @@ unpredictable css rules order in build */
|
|
|
72
74
|
font-size: var(--g-text-body-3-font-size);
|
|
73
75
|
line-height: var(--g-text-body-3-line-height);
|
|
74
76
|
}
|
|
75
|
-
.pc-content_size_l .pc-content__list
|
|
77
|
+
.pc-content_size_l .pc-content__list,
|
|
78
|
+
.pc-content_size_l .pc-content__links,
|
|
79
|
+
.pc-content_size_l .pc-content__buttons {
|
|
76
80
|
margin-top: 24px;
|
|
77
81
|
}
|
|
78
82
|
.pc-content_theme_dark {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useUniqId } from '@gravity-ui/uikit';
|
|
3
|
-
import { ContentList, Title, YFMWrapper } from '../../components';
|
|
3
|
+
import { Buttons, ContentList, Links, Title, YFMWrapper } from '../../components';
|
|
4
4
|
import { Col } from '../../grid';
|
|
5
5
|
import { block } from '../../utils';
|
|
6
6
|
import { getQaAttrubutes } from '../../utils/blocks';
|
|
7
|
-
import renderContentControls from '../../utils/renderContentControls/renderContentControls';
|
|
8
7
|
import './Content.css';
|
|
9
8
|
const b = block('content');
|
|
10
9
|
function getTextSize(size) {
|
|
@@ -25,13 +24,6 @@ const Content = (props) => {
|
|
|
25
24
|
const hasTitle = Boolean(title);
|
|
26
25
|
const defaultTitleId = useUniqId();
|
|
27
26
|
const titleId = titleIdFromProps || defaultTitleId;
|
|
28
|
-
const controls = useMemo(() => renderContentControls({
|
|
29
|
-
size,
|
|
30
|
-
links,
|
|
31
|
-
buttons,
|
|
32
|
-
titleId,
|
|
33
|
-
qa: qaAttributes,
|
|
34
|
-
}), [size, links, buttons, titleId, qaAttributes]);
|
|
35
27
|
return (React.createElement(Col, { className: b({ size, centered, theme }, className), reset: true, sizes: colSizes, qa: qaAttributes.container },
|
|
36
28
|
title && (React.createElement(Title, { className: b('title'), title: titleProps, colSizes: { all: 12 }, id: titleId })),
|
|
37
29
|
text && (React.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
|
|
@@ -44,6 +36,7 @@ const Content = (props) => {
|
|
|
44
36
|
'constructor-notice': true,
|
|
45
37
|
[`constructor-size-${size}`]: true,
|
|
46
38
|
} }))),
|
|
47
|
-
|
|
39
|
+
links && (React.createElement(Links, { className: b('links', { size }), size: size, links: links, titleId: titleId, qa: qaAttributes.links, linkQa: qaAttributes.link })),
|
|
40
|
+
buttons && (React.createElement(Buttons, { className: b('buttons', { size }), size: size, buttons: buttons, titleId: titleId, qa: qaAttributes.buttons, buttonQa: qaAttributes.button }))));
|
|
48
41
|
};
|
|
49
42
|
export default Content;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { useUniqId } from '@gravity-ui/uikit';
|
|
4
|
-
import { FullscreenMedia, IconWrapper, Media, MetaInfo } from '../../components';
|
|
4
|
+
import { Buttons, FullscreenMedia, IconWrapper, Links, Media, MetaInfo } from '../../components';
|
|
5
5
|
import { block } from '../../utils';
|
|
6
|
-
import renderContentControls from '../../utils/renderContentControls/renderContentControls';
|
|
7
6
|
import Content from '../Content/Content';
|
|
8
7
|
import { getLayoutItemLinks, hasFullscreen, showFullscreenIcon } from './utils';
|
|
9
8
|
import './LayoutItem.css';
|
|
@@ -14,12 +13,6 @@ const LayoutItem = (_a) => {
|
|
|
14
13
|
const areControlsInFooter = controlPosition === 'footer';
|
|
15
14
|
const contentProps = Object.assign(Object.assign(Object.assign({}, content), (areControlsInFooter ? {} : { links: normalizedLinks, buttons })), { size: 's', colSizes: { all: 12, md: 12 } });
|
|
16
15
|
const titleId = useUniqId();
|
|
17
|
-
const footerControls = useMemo(() => renderContentControls({
|
|
18
|
-
links: areControlsInFooter ? links : undefined,
|
|
19
|
-
buttons: areControlsInFooter ? buttons : undefined,
|
|
20
|
-
size: 's',
|
|
21
|
-
titleId,
|
|
22
|
-
}), [areControlsInFooter, links, buttons, titleId]);
|
|
23
16
|
const renderMedia = () => {
|
|
24
17
|
if (!media) {
|
|
25
18
|
return null;
|
|
@@ -35,6 +28,7 @@ const LayoutItem = (_a) => {
|
|
|
35
28
|
React.createElement("div", { className: b('content', { 'no-media': !media }) },
|
|
36
29
|
React.createElement(IconWrapper, { icon: icon },
|
|
37
30
|
React.createElement(Content, Object.assign({}, contentProps, { titleId: titleId })))),
|
|
38
|
-
|
|
31
|
+
areControlsInFooter && links && (React.createElement(Links, { className: b('links'), size: "s", links: links, titleId: titleId })),
|
|
32
|
+
areControlsInFooter && buttons && (React.createElement(Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId }))));
|
|
39
33
|
};
|
|
40
34
|
export default LayoutItem;
|
package/package.json
CHANGED