@gravity-ui/page-constructor 4.42.5 → 4.43.1

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.
@@ -58,7 +58,7 @@ exports.HeaderProperties = {
58
58
  },
59
59
  verticalOffset: {
60
60
  type: 'string',
61
- enum: ['s', 'm', 'l', 'xl'],
61
+ enum: ['0', 's', 'm', 'l', 'xl'],
62
62
  },
63
63
  background: (0, common_1.withTheme)(exports.HeaderBackgroundProps),
64
64
  theme: {
@@ -11,6 +11,43 @@ unpredictable css rules order in build */
11
11
  margin-top: var(--pc-first-block-indent, 96px);
12
12
  }
13
13
 
14
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_0 {
15
+ margin-top: 0;
16
+ }
17
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_xs {
18
+ margin-top: 16px;
19
+ }
20
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_s {
21
+ margin-top: 24px;
22
+ }
23
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_m {
24
+ margin-top: 32px;
25
+ }
26
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_l {
27
+ margin-top: 48px;
28
+ }
29
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_xl {
30
+ margin-top: 64px;
31
+ }
32
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_0 {
33
+ padding-bottom: 0;
34
+ }
35
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_xs {
36
+ padding-bottom: 16px;
37
+ }
38
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_s {
39
+ padding-bottom: 24px;
40
+ }
41
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_m {
42
+ padding-bottom: 32px;
43
+ }
44
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_l {
45
+ padding-bottom: 48px;
46
+ }
47
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_xl {
48
+ padding-bottom: 64px;
49
+ }
50
+
14
51
  @media only screen and (max-width: 577px) {
15
52
  .pc-block-base.pc-block-base {
16
53
  margin-top: 32px;
@@ -7,8 +7,9 @@ const utils_1 = require("../../utils");
7
7
  const Anchor_1 = tslib_1.__importDefault(require("../Anchor/Anchor"));
8
8
  const b = (0, utils_1.block)('block-base');
9
9
  const BlockBase = (props) => {
10
- const { anchor, visible, children, className, resetPaddings, qa } = props;
11
- return (react_1.default.createElement(grid_1.Col, { className: b({ ['reset-paddings']: resetPaddings }, className), visible: visible, reset: true, qa: qa },
10
+ const { anchor, indent, visible, children, className, resetPaddings, qa } = props;
11
+ const { top, bottom } = indent || (resetPaddings ? { top: '0', bottom: '0' } : { top: 'l', bottom: 'l' });
12
+ return (react_1.default.createElement(grid_1.Col, { className: b({ ['reset-paddings']: resetPaddings, indentTop: top, indentBottom: bottom }, className), visible: visible, reset: true, qa: qa },
12
13
  anchor && react_1.default.createElement(Anchor_1.default, { id: anchor.url, className: b('anchor') }),
13
14
  children));
14
15
  };
@@ -9,10 +9,9 @@ const BlockDecoration_1 = require("../../../../customization/BlockDecoration");
9
9
  const utils_1 = require("../../../../utils");
10
10
  const b = (0, utils_1.block)('constructor-block');
11
11
  const ConstructorBlock = ({ index = 0, data, children, }) => {
12
- const { type, indent } = data;
13
- const blockBaseProps = (0, react_1.useMemo)(() => (0, pick_1.default)(data, ['anchor', 'visible', 'resetPaddings']), [data]);
14
- const { top, bottom } = indent || { top: 'l', bottom: 'l' };
12
+ const { type } = data;
13
+ const blockBaseProps = (0, react_1.useMemo)(() => (0, pick_1.default)(data, ['anchor', 'visible', 'resetPaddings', 'indent']), [data]);
15
14
  return (react_1.default.createElement(BlockDecoration_1.BlockDecoration, Object.assign({ type: type, index: index }, blockBaseProps),
16
- react_1.default.createElement(BlockBase_1.default, Object.assign({ className: b({ type, indentTop: top, indentBottom: bottom }) }, blockBaseProps), children)));
15
+ react_1.default.createElement(BlockBase_1.default, Object.assign({ className: b({ type }) }, blockBaseProps), children)));
17
16
  };
18
17
  exports.ConstructorBlock = ConstructorBlock;
@@ -48,3 +48,4 @@ export interface GridColumnClassParams {
48
48
  justifyContent?: GridJustifyContent;
49
49
  reset?: boolean;
50
50
  }
51
+ export type IndentValue = '0' | 'xs' | 's' | 'm' | 'l' | 'xl';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ButtonSize } from '@gravity-ui/uikit';
3
- import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
3
+ import { GridColumnSize, GridColumnSizesType, IndentValue } from '../../grid/types';
4
4
  import { ThemeSupporting } from '../../utils';
5
5
  import { AnalyticsEventsBase } from '../common';
6
6
  import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, ImageProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, YandexFormProps } from './common';
@@ -36,6 +36,10 @@ export interface BlockBaseProps {
36
36
  visible?: GridColumnSize;
37
37
  /** @deprecated */
38
38
  resetPaddings?: boolean;
39
+ indent?: {
40
+ top?: IndentValue;
41
+ bottom?: IndentValue;
42
+ };
39
43
  qa?: string;
40
44
  }
41
45
  export interface LoadableProps {
@@ -107,7 +111,7 @@ export interface HeaderBlockProps {
107
111
  mediaView?: 'fit' | 'full';
108
112
  background?: ThemedHeaderBlockBackground;
109
113
  theme?: 'light' | 'dark';
110
- verticalOffset?: 's' | 'm' | 'l' | 'xl';
114
+ verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';
111
115
  breadcrumbs?: HeaderBreadCrumbsProps;
112
116
  status?: JSX.Element;
113
117
  renderTitle?: (title: string) => React.ReactNode;
@@ -6,12 +6,7 @@ export interface PageData {
6
6
  export interface Menu {
7
7
  title: string;
8
8
  }
9
- export type ConstructorBlock = (ConstructorItem | CustomBlock) & {
10
- indent?: {
11
- top?: string;
12
- bottom?: string;
13
- };
14
- };
9
+ export type ConstructorBlock = ConstructorItem | CustomBlock;
15
10
  export interface PageContent extends Animatable {
16
11
  blocks: ConstructorBlock[];
17
12
  menu?: Menu;
@@ -55,7 +55,7 @@ export const HeaderProperties = {
55
55
  },
56
56
  verticalOffset: {
57
57
  type: 'string',
58
- enum: ['s', 'm', 'l', 'xl'],
58
+ enum: ['0', 's', 'm', 'l', 'xl'],
59
59
  },
60
60
  background: withTheme(HeaderBackgroundProps),
61
61
  theme: {
@@ -11,6 +11,43 @@ unpredictable css rules order in build */
11
11
  margin-top: var(--pc-first-block-indent, 96px);
12
12
  }
13
13
 
14
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_0 {
15
+ margin-top: 0;
16
+ }
17
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_xs {
18
+ margin-top: 16px;
19
+ }
20
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_s {
21
+ margin-top: 24px;
22
+ }
23
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_m {
24
+ margin-top: 32px;
25
+ }
26
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_l {
27
+ margin-top: 48px;
28
+ }
29
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentTop_xl {
30
+ margin-top: 64px;
31
+ }
32
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_0 {
33
+ padding-bottom: 0;
34
+ }
35
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_xs {
36
+ padding-bottom: 16px;
37
+ }
38
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_s {
39
+ padding-bottom: 24px;
40
+ }
41
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_m {
42
+ padding-bottom: 32px;
43
+ }
44
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_l {
45
+ padding-bottom: 48px;
46
+ }
47
+ .pc-block-base.pc-block-base.pc-block-base.pc-block-base_indentBottom_xl {
48
+ padding-bottom: 64px;
49
+ }
50
+
14
51
  @media only screen and (max-width: 577px) {
15
52
  .pc-block-base.pc-block-base {
16
53
  margin-top: 32px;
@@ -5,8 +5,9 @@ import Anchor from '../Anchor/Anchor';
5
5
  import './BlockBase.css';
6
6
  const b = block('block-base');
7
7
  const BlockBase = (props) => {
8
- const { anchor, visible, children, className, resetPaddings, qa } = props;
9
- return (React.createElement(Col, { className: b({ ['reset-paddings']: resetPaddings }, className), visible: visible, reset: true, qa: qa },
8
+ const { anchor, indent, visible, children, className, resetPaddings, qa } = props;
9
+ const { top, bottom } = indent || (resetPaddings ? { top: '0', bottom: '0' } : { top: 'l', bottom: 'l' });
10
+ return (React.createElement(Col, { className: b({ ['reset-paddings']: resetPaddings, indentTop: top, indentBottom: bottom }, className), visible: visible, reset: true, qa: qa },
10
11
  anchor && React.createElement(Anchor, { id: anchor.url, className: b('anchor') }),
11
12
  children));
12
13
  };
@@ -6,9 +6,8 @@ import { block } from '../../../../utils';
6
6
  import './ConstructorBlock.css';
7
7
  const b = block('constructor-block');
8
8
  export const ConstructorBlock = ({ index = 0, data, children, }) => {
9
- const { type, indent } = data;
10
- const blockBaseProps = useMemo(() => pick(data, ['anchor', 'visible', 'resetPaddings']), [data]);
11
- const { top, bottom } = indent || { top: 'l', bottom: 'l' };
9
+ const { type } = data;
10
+ const blockBaseProps = useMemo(() => pick(data, ['anchor', 'visible', 'resetPaddings', 'indent']), [data]);
12
11
  return (React.createElement(BlockDecoration, Object.assign({ type: type, index: index }, blockBaseProps),
13
- React.createElement(BlockBase, Object.assign({ className: b({ type, indentTop: top, indentBottom: bottom }) }, blockBaseProps), children)));
12
+ React.createElement(BlockBase, Object.assign({ className: b({ type }) }, blockBaseProps), children)));
14
13
  };
@@ -48,3 +48,4 @@ export interface GridColumnClassParams {
48
48
  justifyContent?: GridJustifyContent;
49
49
  reset?: boolean;
50
50
  }
51
+ export type IndentValue = '0' | 'xs' | 's' | 'm' | 'l' | 'xl';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ButtonSize } from '@gravity-ui/uikit';
3
- import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
3
+ import { GridColumnSize, GridColumnSizesType, IndentValue } from '../../grid/types';
4
4
  import { ThemeSupporting } from '../../utils';
5
5
  import { AnalyticsEventsBase } from '../common';
6
6
  import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, ImageProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, YandexFormProps } from './common';
@@ -36,6 +36,10 @@ export interface BlockBaseProps {
36
36
  visible?: GridColumnSize;
37
37
  /** @deprecated */
38
38
  resetPaddings?: boolean;
39
+ indent?: {
40
+ top?: IndentValue;
41
+ bottom?: IndentValue;
42
+ };
39
43
  qa?: string;
40
44
  }
41
45
  export interface LoadableProps {
@@ -107,7 +111,7 @@ export interface HeaderBlockProps {
107
111
  mediaView?: 'fit' | 'full';
108
112
  background?: ThemedHeaderBlockBackground;
109
113
  theme?: 'light' | 'dark';
110
- verticalOffset?: 's' | 'm' | 'l' | 'xl';
114
+ verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';
111
115
  breadcrumbs?: HeaderBreadCrumbsProps;
112
116
  status?: JSX.Element;
113
117
  renderTitle?: (title: string) => React.ReactNode;
@@ -6,12 +6,7 @@ export interface PageData {
6
6
  export interface Menu {
7
7
  title: string;
8
8
  }
9
- export type ConstructorBlock = (ConstructorItem | CustomBlock) & {
10
- indent?: {
11
- top?: string;
12
- bottom?: string;
13
- };
14
- };
9
+ export type ConstructorBlock = ConstructorItem | CustomBlock;
15
10
  export interface PageContent extends Animatable {
16
11
  blocks: ConstructorBlock[];
17
12
  menu?: Menu;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "4.42.5",
3
+ "version": "4.43.1",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -48,3 +48,4 @@ export interface GridColumnClassParams {
48
48
  justifyContent?: GridJustifyContent;
49
49
  reset?: boolean;
50
50
  }
51
+ export type IndentValue = '0' | 'xs' | 's' | 'm' | 'l' | 'xl';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ButtonSize } from '@gravity-ui/uikit';
3
- import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
3
+ import { GridColumnSize, GridColumnSizesType, IndentValue } from '../../grid/types';
4
4
  import { ThemeSupporting } from '../../utils';
5
5
  import { AnalyticsEventsBase } from '../common';
6
6
  import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, ImageProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, YandexFormProps } from './common';
@@ -36,6 +36,10 @@ export interface BlockBaseProps {
36
36
  visible?: GridColumnSize;
37
37
  /** @deprecated */
38
38
  resetPaddings?: boolean;
39
+ indent?: {
40
+ top?: IndentValue;
41
+ bottom?: IndentValue;
42
+ };
39
43
  qa?: string;
40
44
  }
41
45
  export interface LoadableProps {
@@ -107,7 +111,7 @@ export interface HeaderBlockProps {
107
111
  mediaView?: 'fit' | 'full';
108
112
  background?: ThemedHeaderBlockBackground;
109
113
  theme?: 'light' | 'dark';
110
- verticalOffset?: 's' | 'm' | 'l' | 'xl';
114
+ verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';
111
115
  breadcrumbs?: HeaderBreadCrumbsProps;
112
116
  status?: JSX.Element;
113
117
  renderTitle?: (title: string) => React.ReactNode;
@@ -6,12 +6,7 @@ export interface PageData {
6
6
  export interface Menu {
7
7
  title: string;
8
8
  }
9
- export type ConstructorBlock = (ConstructorItem | CustomBlock) & {
10
- indent?: {
11
- top?: string;
12
- bottom?: string;
13
- };
14
- };
9
+ export type ConstructorBlock = ConstructorItem | CustomBlock;
15
10
  export interface PageContent extends Animatable {
16
11
  blocks: ConstructorBlock[];
17
12
  menu?: Menu;