@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.
Files changed (57) hide show
  1. package/build/cjs/blocks/Header/schema.d.ts +9 -0
  2. package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
  3. package/build/cjs/blocks/Media/schema.d.ts +6 -0
  4. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  5. package/build/cjs/blocks/Tabs/schema.d.ts +3 -0
  6. package/build/cjs/components/Media/Image/Image.js +4 -1
  7. package/build/cjs/components/Media/Media.js +3 -2
  8. package/build/cjs/models/constructor-items/common.d.ts +1 -0
  9. package/build/cjs/schema/constants.d.ts +3 -0
  10. package/build/cjs/schema/validators/common.d.ts +3 -0
  11. package/build/cjs/schema/validators/common.js +3 -0
  12. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
  13. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +4 -10
  14. package/build/cjs/sub-blocks/BasicCard/BasicCard.css +7 -0
  15. package/build/cjs/sub-blocks/BasicCard/BasicCard.js +4 -10
  16. package/build/cjs/sub-blocks/Content/Content.css +6 -2
  17. package/build/cjs/sub-blocks/Content/Content.js +3 -10
  18. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +3 -0
  19. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +2 -8
  20. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +3 -0
  21. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +3 -0
  22. package/build/esm/blocks/Header/schema.d.ts +9 -0
  23. package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
  24. package/build/esm/blocks/Media/schema.d.ts +6 -0
  25. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  26. package/build/esm/blocks/Tabs/schema.d.ts +3 -0
  27. package/build/esm/components/Media/Image/Image.js +4 -1
  28. package/build/esm/components/Media/Media.js +3 -2
  29. package/build/esm/models/constructor-items/common.d.ts +1 -0
  30. package/build/esm/schema/constants.d.ts +3 -0
  31. package/build/esm/schema/validators/common.d.ts +3 -0
  32. package/build/esm/schema/validators/common.js +3 -0
  33. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
  34. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +5 -11
  35. package/build/esm/sub-blocks/BasicCard/BasicCard.css +7 -0
  36. package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -11
  37. package/build/esm/sub-blocks/Content/Content.css +6 -2
  38. package/build/esm/sub-blocks/Content/Content.js +4 -11
  39. package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +3 -0
  40. package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +3 -9
  41. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +3 -0
  42. package/build/esm/sub-blocks/MediaCard/schema.d.ts +3 -0
  43. package/package.json +1 -1
  44. package/server/models/constructor-items/common.d.ts +1 -0
  45. package/widget/index.js +1 -1
  46. package/build/cjs/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
  47. package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
  48. package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -9
  49. package/build/cjs/utils/renderContentControls/ContentControls.css +0 -6
  50. package/build/cjs/utils/renderContentControls/renderContentControls.d.ts +0 -11
  51. package/build/cjs/utils/renderContentControls/renderContentControls.js +0 -16
  52. package/build/esm/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
  53. package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
  54. package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -6
  55. package/build/esm/utils/renderContentControls/ContentControls.css +0 -6
  56. package/build/esm/utils/renderContentControls/renderContentControls.d.ts +0 -12
  57. package/build/esm/utils/renderContentControls/renderContentControls.js +0 -14
@@ -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;
@@ -43,6 +43,9 @@ export declare const LayoutItem: {
43
43
  optionName: string;
44
44
  })[];
45
45
  };
46
+ disableImageSliderForArrayInput: {
47
+ type: string;
48
+ };
46
49
  video: {
47
50
  type: string;
48
51
  additionalProperties: boolean;
@@ -126,6 +126,9 @@ export declare const MediaCardBlock: {
126
126
  optionName: string;
127
127
  })[];
128
128
  };
129
+ disableImageSliderForArrayInput: {
130
+ type: string;
131
+ };
129
132
  video: {
130
133
  type: string;
131
134
  additionalProperties: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "4.56.0",
3
+ "version": "4.57.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -197,6 +197,7 @@ export interface MediaComponentImageProps {
197
197
  video?: MediaVideoProps;
198
198
  parallax?: boolean;
199
199
  height?: number;
200
+ disableImageSliderForArrayInput?: boolean;
200
201
  }
201
202
  export interface MediaComponentDataLensProps {
202
203
  dataLens: DataLensProps;