@gravity-ui/page-constructor 5.0.0 → 5.1.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 (30) hide show
  1. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
  2. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +4 -10
  3. package/build/cjs/sub-blocks/BasicCard/BasicCard.css +7 -0
  4. package/build/cjs/sub-blocks/BasicCard/BasicCard.js +4 -10
  5. package/build/cjs/sub-blocks/Content/Content.css +6 -2
  6. package/build/cjs/sub-blocks/Content/Content.js +3 -10
  7. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +3 -0
  8. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +2 -8
  9. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
  10. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +5 -11
  11. package/build/esm/sub-blocks/BasicCard/BasicCard.css +7 -0
  12. package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -11
  13. package/build/esm/sub-blocks/Content/Content.css +6 -2
  14. package/build/esm/sub-blocks/Content/Content.js +4 -11
  15. package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +3 -0
  16. package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +3 -9
  17. package/package.json +4 -4
  18. package/widget/index.js +1 -1
  19. package/build/cjs/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
  20. package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
  21. package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -9
  22. package/build/cjs/utils/renderContentControls/ContentControls.css +0 -6
  23. package/build/cjs/utils/renderContentControls/renderContentControls.d.ts +0 -11
  24. package/build/cjs/utils/renderContentControls/renderContentControls.js +0 -16
  25. package/build/esm/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
  26. package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
  27. package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -6
  28. package/build/esm/utils/renderContentControls/ContentControls.css +0 -6
  29. package/build/esm/utils/renderContentControls/renderContentControls.d.ts +0 -12
  30. package/build/esm/utils/renderContentControls/renderContentControls.js +0 -14
@@ -37,6 +37,12 @@ unpredictable css rules order in build */
37
37
  object-fit: cover;
38
38
  object-position: left;
39
39
  }
40
+ .pc-background-card__footer {
41
+ margin-top: 0px;
42
+ }
43
+ .pc-background-card__links, .pc-background-card__buttons {
44
+ margin-top: 16px;
45
+ }
40
46
 
41
47
  a.pc-background-card_theme_light {
42
48
  background-color: var(--pc-color-base-silver);
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importStar(require("react"));
4
+ const react_1 = tslib_1.__importDefault(require("react"));
5
5
  const uikit_1 = require("@gravity-ui/uikit");
6
6
  const components_1 = require("../../components/");
7
7
  const theme_1 = require("../../context/theme");
8
8
  const utils_1 = require("../../utils");
9
- const renderContentControls_1 = tslib_1.__importDefault(require("../../utils/renderContentControls/renderContentControls"));
10
9
  const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
11
- const renderCardFooterControlsContainer_1 = tslib_1.__importDefault(require("../renderCardFooterControlsContainer/renderCardFooterControlsContainer"));
12
10
  const b = (0, utils_1.block)('background-card');
13
11
  const BackgroundCard = (props) => {
14
12
  const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', } = props;
@@ -17,16 +15,12 @@ const BackgroundCard = (props) => {
17
15
  const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
18
16
  const borderType = hasBackgroundColor ? 'none' : border;
19
17
  const areControlsInFooter = !paddingBottom && controlPosition === 'footer';
20
- const footerControls = (0, react_1.useMemo)(() => (0, renderContentControls_1.default)({
21
- links: areControlsInFooter ? links : undefined,
22
- buttons: areControlsInFooter ? buttons : undefined,
23
- size: 's',
24
- titleId,
25
- }, renderCardFooterControlsContainer_1.default), [areControlsInFooter, links, buttons, titleId]);
26
18
  return (react_1.default.createElement(components_1.CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle },
27
19
  react_1.default.createElement(components_1.CardBase.Content, null,
28
20
  react_1.default.createElement(components_1.BackgroundImage, Object.assign({ className: b('image') }, (0, utils_1.getThemedValue)(background, theme), { style: { backgroundColor } })),
29
21
  react_1.default.createElement(Content_1.default, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: areControlsInFooter ? undefined : links, buttons: areControlsInFooter ? undefined : buttons, colSizes: { all: 12, md: 12 } })),
30
- footerControls));
22
+ areControlsInFooter && (links || buttons) && (react_1.default.createElement(components_1.CardBase.Footer, null,
23
+ react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
24
+ react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
31
25
  };
32
26
  exports.default = BackgroundCard;
@@ -2,4 +2,11 @@
2
2
  unpredictable css rules order in build */
3
3
  .pc-basic-card.pc-basic-card {
4
4
  min-height: auto;
5
+ }
6
+
7
+ .pc-basic-card__footer {
8
+ margin-top: 0px;
9
+ }
10
+ .pc-basic-card__links, .pc-basic-card__buttons {
11
+ margin-top: 16px;
5
12
  }
@@ -1,30 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importStar(require("react"));
4
+ const react_1 = tslib_1.__importDefault(require("react"));
5
5
  const uikit_1 = require("@gravity-ui/uikit");
6
6
  const components_1 = require("../../components");
7
7
  const sub_blocks_1 = require("../../models/constructor-items/sub-blocks");
8
8
  const utils_1 = require("../../utils");
9
- const renderContentControls_1 = tslib_1.__importDefault(require("../../utils/renderContentControls/renderContentControls"));
10
9
  const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
11
- const renderCardFooterControlsContainer_1 = tslib_1.__importDefault(require("../renderCardFooterControlsContainer/renderCardFooterControlsContainer"));
12
10
  const b = (0, utils_1.block)('basic-card');
13
11
  const BasicCard = (props) => {
14
12
  const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = sub_blocks_1.IconPosition.Top, controlPosition = 'content' } = props, cardParams = tslib_1.__rest(props, ["title", "text", "icon", "additionalInfo", "links", "list", "buttons", "iconPosition", "controlPosition"]);
15
13
  const titleId = (0, uikit_1.useUniqId)();
16
14
  const descriptionId = (0, uikit_1.useUniqId)();
17
15
  const areControlsInFooter = controlPosition === 'footer';
18
- const footerControls = (0, react_1.useMemo)(() => (0, renderContentControls_1.default)({
19
- links: areControlsInFooter ? links : undefined,
20
- buttons: areControlsInFooter ? buttons : undefined,
21
- size: 's',
22
- titleId,
23
- }, renderCardFooterControlsContainer_1.default), [areControlsInFooter, links, buttons, titleId]);
24
16
  return (react_1.default.createElement(components_1.CardBase, Object.assign({ className: b() }, cardParams, { extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId } }),
25
17
  react_1.default.createElement(components_1.CardBase.Content, null,
26
18
  react_1.default.createElement(components_1.IconWrapper, { icon: icon ? { value: icon, position: iconPosition } : undefined },
27
19
  react_1.default.createElement(Content_1.default, { 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 } }))),
28
- footerControls));
20
+ areControlsInFooter && (buttons || links) && (react_1.default.createElement(components_1.CardBase.Footer, { className: b('footer') },
21
+ react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
22
+ react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
29
23
  };
30
24
  exports.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,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importStar(require("react"));
4
+ const react_1 = tslib_1.__importDefault(require("react"));
5
5
  const uikit_1 = require("@gravity-ui/uikit");
6
6
  const components_1 = require("../../components");
7
7
  const grid_1 = require("../../grid");
8
8
  const utils_1 = require("../../utils");
9
9
  const blocks_1 = require("../../utils/blocks");
10
- const renderContentControls_1 = tslib_1.__importDefault(require("../../utils/renderContentControls/renderContentControls"));
11
10
  const b = (0, utils_1.block)('content');
12
11
  function getTextSize(size) {
13
12
  switch (size) {
@@ -27,13 +26,6 @@ const Content = (props) => {
27
26
  const hasTitle = Boolean(title);
28
27
  const defaultTitleId = (0, uikit_1.useUniqId)();
29
28
  const titleId = titleIdFromProps || defaultTitleId;
30
- const controls = (0, react_1.useMemo)(() => (0, renderContentControls_1.default)({
31
- size,
32
- links,
33
- buttons,
34
- titleId,
35
- qa: qaAttributes,
36
- }), [size, links, buttons, titleId, qaAttributes]);
37
29
  return (react_1.default.createElement(grid_1.Col, { className: b({ size, centered, theme }, className), reset: true, sizes: colSizes, qa: qaAttributes.container },
38
30
  title && (react_1.default.createElement(components_1.Title, { className: b('title'), title: titleProps, colSizes: { all: 12 }, id: titleId })),
39
31
  text && (react_1.default.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
@@ -46,6 +38,7 @@ const Content = (props) => {
46
38
  'constructor-notice': true,
47
39
  [`constructor-size-${size}`]: true,
48
40
  } }))),
49
- controls));
41
+ links && (react_1.default.createElement(components_1.Links, { className: b('links', { size }), size: size, links: links, titleId: titleId, qa: qaAttributes.links, linkQa: qaAttributes.link })),
42
+ buttons && (react_1.default.createElement(components_1.Buttons, { className: b('buttons', { size }), size: size, buttons: buttons, titleId: titleId, qa: qaAttributes.buttons, buttonQa: qaAttributes.button }))));
50
43
  };
51
44
  exports.default = Content;
@@ -22,4 +22,7 @@ unpredictable css rules order in build */
22
22
  }
23
23
  .pc-layout-item__content_no-media {
24
24
  margin: 0;
25
+ }
26
+ .pc-layout-item__links, .pc-layout-item__buttons {
27
+ margin-top: 16px;
25
28
  }
@@ -5,7 +5,6 @@ const react_1 = tslib_1.__importStar(require("react"));
5
5
  const uikit_1 = require("@gravity-ui/uikit");
6
6
  const components_1 = require("../../components");
7
7
  const utils_1 = require("../../utils");
8
- const renderContentControls_1 = tslib_1.__importDefault(require("../../utils/renderContentControls/renderContentControls"));
9
8
  const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
10
9
  const utils_2 = require("./utils");
11
10
  const b = (0, utils_1.block)('layout-item');
@@ -15,12 +14,6 @@ const LayoutItem = (_a) => {
15
14
  const areControlsInFooter = controlPosition === 'footer';
16
15
  const contentProps = Object.assign(Object.assign(Object.assign({}, content), (areControlsInFooter ? {} : { links: normalizedLinks, buttons })), { size: 's', colSizes: { all: 12, md: 12 } });
17
16
  const titleId = (0, uikit_1.useUniqId)();
18
- const footerControls = (0, react_1.useMemo)(() => (0, renderContentControls_1.default)({
19
- links: areControlsInFooter ? links : undefined,
20
- buttons: areControlsInFooter ? buttons : undefined,
21
- size: 's',
22
- titleId,
23
- }), [areControlsInFooter, links, buttons, titleId]);
24
17
  const renderMedia = () => {
25
18
  if (!media) {
26
19
  return null;
@@ -36,6 +29,7 @@ const LayoutItem = (_a) => {
36
29
  react_1.default.createElement("div", { className: b('content', { 'no-media': !media }) },
37
30
  react_1.default.createElement(components_1.IconWrapper, { icon: icon },
38
31
  react_1.default.createElement(Content_1.default, Object.assign({}, contentProps, { titleId: titleId })))),
39
- footerControls));
32
+ areControlsInFooter && links && (react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId })),
33
+ areControlsInFooter && buttons && (react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId }))));
40
34
  };
41
35
  exports.default = LayoutItem;
@@ -37,6 +37,12 @@ unpredictable css rules order in build */
37
37
  object-fit: cover;
38
38
  object-position: left;
39
39
  }
40
+ .pc-background-card__footer {
41
+ margin-top: 0px;
42
+ }
43
+ .pc-background-card__links, .pc-background-card__buttons {
44
+ margin-top: 16px;
45
+ }
40
46
 
41
47
  a.pc-background-card_theme_light {
42
48
  background-color: var(--pc-color-base-silver);
@@ -1,11 +1,9 @@
1
- import React, { useMemo } from 'react';
1
+ import React from 'react';
2
2
  import { useUniqId } from '@gravity-ui/uikit';
3
- import { BackgroundImage, CardBase } from '../../components/';
3
+ import { BackgroundImage, Buttons, CardBase, Links } from '../../components/';
4
4
  import { useTheme } from '../../context/theme';
5
5
  import { block, getThemedValue } from '../../utils';
6
- import renderContentControls from '../../utils/renderContentControls/renderContentControls';
7
6
  import Content from '../Content/Content';
8
- import renderCardFooterControlsContainer from '../renderCardFooterControlsContainer/renderCardFooterControlsContainer';
9
7
  import './BackgroundCard.css';
10
8
  const b = block('background-card');
11
9
  const BackgroundCard = (props) => {
@@ -15,16 +13,12 @@ const BackgroundCard = (props) => {
15
13
  const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
16
14
  const borderType = hasBackgroundColor ? 'none' : border;
17
15
  const areControlsInFooter = !paddingBottom && controlPosition === 'footer';
18
- const footerControls = useMemo(() => renderContentControls({
19
- links: areControlsInFooter ? links : undefined,
20
- buttons: areControlsInFooter ? buttons : undefined,
21
- size: 's',
22
- titleId,
23
- }, renderCardFooterControlsContainer), [areControlsInFooter, links, buttons, titleId]);
24
16
  return (React.createElement(CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle },
25
17
  React.createElement(CardBase.Content, null,
26
18
  React.createElement(BackgroundImage, Object.assign({ className: b('image') }, getThemedValue(background, theme), { style: { backgroundColor } })),
27
19
  React.createElement(Content, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: areControlsInFooter ? undefined : links, buttons: areControlsInFooter ? undefined : buttons, colSizes: { all: 12, md: 12 } })),
28
- footerControls));
20
+ areControlsInFooter && (links || buttons) && (React.createElement(CardBase.Footer, null,
21
+ React.createElement(Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
22
+ React.createElement(Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
29
23
  };
30
24
  export default BackgroundCard;
@@ -2,4 +2,11 @@
2
2
  unpredictable css rules order in build */
3
3
  .pc-basic-card.pc-basic-card {
4
4
  min-height: auto;
5
+ }
6
+
7
+ .pc-basic-card__footer {
8
+ margin-top: 0px;
9
+ }
10
+ .pc-basic-card__links, .pc-basic-card__buttons {
11
+ margin-top: 16px;
5
12
  }
@@ -1,12 +1,10 @@
1
1
  import { __rest } from "tslib";
2
- import React, { useMemo } from '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
- footerControls));
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, { useMemo } from '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
- controls));
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;
@@ -22,4 +22,7 @@ unpredictable css rules order in build */
22
22
  }
23
23
  .pc-layout-item__content_no-media {
24
24
  margin: 0;
25
+ }
26
+ .pc-layout-item__links, .pc-layout-item__buttons {
27
+ margin-top: 16px;
25
28
  }
@@ -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
- footerControls));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -83,7 +83,7 @@
83
83
  "@bem-react/classname": "^1.6.0",
84
84
  "@gravity-ui/components": "^3.0.0",
85
85
  "@gravity-ui/dynamic-forms": "^4.0.0",
86
- "@gravity-ui/i18n": "^1.2.0",
86
+ "@gravity-ui/i18n": "^1.3.0",
87
87
  "@react-spring/web": "^9.7.3",
88
88
  "ajv": "^8.12.0",
89
89
  "ajv-keywords": "^5.1.0",
@@ -116,13 +116,13 @@
116
116
  "@babel/preset-typescript": "^7.22.5",
117
117
  "@commitlint/cli": "^17.1.2",
118
118
  "@commitlint/config-conventional": "^17.1.0",
119
- "@diplodoc/transform": "^4.10.4",
119
+ "@diplodoc/transform": "^4.10.8",
120
120
  "@gravity-ui/eslint-config": "^2.0.0",
121
121
  "@gravity-ui/icons": "^2.8.1",
122
122
  "@gravity-ui/prettier-config": "^1.0.1",
123
123
  "@gravity-ui/stylelint-config": "^1.0.0",
124
124
  "@gravity-ui/tsconfig": "^1.0.0",
125
- "@gravity-ui/uikit": "^6.0.0",
125
+ "@gravity-ui/uikit": "^6.2.0",
126
126
  "@storybook/addon-actions": "^7.6.17",
127
127
  "@storybook/addon-essentials": "^7.6.17",
128
128
  "@storybook/addon-knobs": "^7.0.2",