@gravity-ui/page-constructor 2.0.3 → 2.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.1](https://github.com/gravity-ui/page-constructor/compare/v2.1.0...v2.1.1) (2023-03-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * quotes validator schema ([#247](https://github.com/gravity-ui/page-constructor/issues/247)) ([87b8587](https://github.com/gravity-ui/page-constructor/commit/87b8587bcd5fe2bb96b5d70aae9eb6ca9e189f33))
9
+
10
+ ## [2.1.0](https://github.com/gravity-ui/page-constructor/compare/v2.0.3...v2.1.0) (2023-03-27)
11
+
12
+
13
+ ### Features
14
+
15
+ * **Title:** add size xs ([#207](https://github.com/gravity-ui/page-constructor/issues/207)) ([1fd8cf7](https://github.com/gravity-ui/page-constructor/commit/1fd8cf7aeaf4a6a993a3ffcce576a41d61c3b66b))
16
+
3
17
  ## [2.0.3](https://github.com/gravity-ui/page-constructor/compare/v2.0.2...v2.0.3) (2023-03-27)
4
18
 
5
19
 
package/README.md CHANGED
@@ -306,6 +306,13 @@ In usual cases we use two types of commits:
306
306
  1. fix: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in Semantic Versioning).
307
307
  2. feat: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in Semantic Versioning).
308
308
  3. BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type.
309
+ 4. To set release package version manually you need to add `Release-As: <version>` to your commit message e.g.
310
+
311
+ ```bash
312
+ git commit -m 'chore: bump release
313
+
314
+ Release-As: 1.2.3'
315
+ ```
309
316
 
310
317
  You can see all information [here](https://www.conventionalcommits.org/en/v1.0.0/).
311
318
 
@@ -7,10 +7,10 @@ unpredictable css rules order in build */
7
7
  font-size: var(--yc-text-body-3-font-size);
8
8
  line-height: var(--yc-text-body-3-line-height);
9
9
  }
10
- .pc-block-header__description_titleSize_s {
10
+ .pc-block-header__description_titleSize_s, .pc-block-header__description_titleSize_xs {
11
11
  margin-top: 8px;
12
12
  }
13
- .pc-block-header__description_titleSize_s .yfm {
13
+ .pc-block-header__description_titleSize_s .yfm, .pc-block-header__description_titleSize_xs .yfm {
14
14
  font-size: var(--yc-text-body-2-font-size);
15
15
  line-height: var(--yc-text-body-2-line-height);
16
16
  }
@@ -1,4 +1,4 @@
1
- .pc-title-block_size_l, .pc-title-block_size_m, .pc-title-block_size_s {
1
+ .pc-title-block_size_l, .pc-title-block_size_m, .pc-title-block_size_s, .pc-title-block_size_xs {
2
2
  margin: 0;
3
3
  }
4
4
 
@@ -10,6 +10,12 @@ unpredictable css rules order in build */
10
10
  .pc-title-block_justify_end {
11
11
  text-align: right;
12
12
  }
13
+ .pc-title-block_size_xs {
14
+ font-size: var(--yc-text-body-3-font-size);
15
+ line-height: var(--yc-text-body-3-line-height);
16
+ color: var(--pc-text-header-color);
17
+ font-weight: var(--yc-text-accent-font-weight);
18
+ }
13
19
  .pc-title-block_size_s {
14
20
  font-size: var(--yc-text-header-1-font-size);
15
21
  line-height: var(--yc-text-header-1-line-height);
@@ -44,10 +50,13 @@ unpredictable css rules order in build */
44
50
  }
45
51
  }
46
52
  .pc-title-block__arrow {
47
- margin: 8px 0 0 4px;
53
+ margin-top: 10px;
54
+ }
55
+ .pc-title-block__arrow_size_xs {
56
+ margin-top: 7px;
48
57
  }
49
58
  .pc-title-block__arrow_size_s {
50
- margin: 4px 0 0 4px;
59
+ margin-top: 5px;
51
60
  }
52
61
  .pc-title-block__link {
53
62
  color: inherit;
@@ -62,7 +71,10 @@ unpredictable css rules order in build */
62
71
  cursor: pointer;
63
72
  }
64
73
  .pc-title-block__link:hover .pc-title-block__arrow {
65
- margin-left: 12px;
74
+ margin-left: 10px;
75
+ }
76
+ .pc-title-block__link:hover .pc-title-block__arrow_size_xs {
77
+ margin-left: 6px;
66
78
  }
67
79
  .pc-title-block__link:hover .pc-title-block__arrow_size_s {
68
80
  margin-left: 8px;
@@ -90,7 +102,10 @@ unpredictable css rules order in build */
90
102
  margin-top: 0;
91
103
  }
92
104
  @media (max-width: 577px) {
93
- .pc-title-block_size_l {
105
+ .pc-title-block_size_l:not(.pc-title-block_reset-margin) {
94
106
  margin-top: 48px;
95
107
  }
108
+ .pc-title-block__arrow_size_m, .pc-title-block__arrow_size_l {
109
+ margin-top: 9px;
110
+ }
96
111
  }
@@ -1,5 +1,5 @@
1
1
  import { TextSize, TitleProps } from '../../models';
2
- export declare function getArrowSize(size: TextSize, isMobile: boolean): 16 | 20 | 24;
2
+ export declare function getArrowSize(size: TextSize, isMobile: boolean): 16 | 13 | 20 | 24 | 22 | 26 | 38;
3
3
  export interface TitleFullProps extends TitleProps {
4
4
  className?: string;
5
5
  onClick?: () => void;
@@ -11,12 +11,14 @@ const mobileContext_1 = require("../../context/mobileContext");
11
11
  const b = (0, utils_1.block)('title-block');
12
12
  function getArrowSize(size, isMobile) {
13
13
  switch (size) {
14
+ case 'xs':
15
+ return 13;
14
16
  case 's':
15
17
  return 16;
16
18
  case 'm':
17
- return isMobile ? 20 : 24;
19
+ return isMobile ? 22 : 24;
18
20
  case 'l':
19
- return isMobile ? 20 : 24;
21
+ return isMobile ? 26 : 38;
20
22
  default:
21
23
  return 20;
22
24
  }
@@ -38,7 +38,7 @@ export declare enum MediaVideoControlsType {
38
38
  Custom = "custom"
39
39
  }
40
40
  export type TextTheme = 'light' | 'dark';
41
- export type TextSize = 's' | 'm' | 'l';
41
+ export type TextSize = 'xs' | 's' | 'm' | 'l';
42
42
  export type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';
43
43
  export type HeaderWidth = 's' | 'm' | 'l';
44
44
  export type HeaderImageSize = 's' | 'm';
@@ -38,6 +38,9 @@ export declare const Quote: {
38
38
  type: string;
39
39
  pattern: string;
40
40
  };
41
+ buttonText: {
42
+ type: string;
43
+ };
41
44
  theme: {
42
45
  type: string;
43
46
  enum: string[];
@@ -18,6 +18,8 @@ exports.Quote = {
18
18
  }, url: {
19
19
  type: 'string',
20
20
  pattern: schema_1.urlPattern,
21
+ }, buttonText: {
22
+ type: 'string',
21
23
  }, theme: common_1.ThemeProps, author: common_1.authorItem }),
22
24
  },
23
25
  };
@@ -1,6 +1,6 @@
1
1
  import { ConstructorBlock } from '../models/constructor';
2
2
  import { TextSize, CustomConfig, PCShareSocialNetwork } from '../models';
3
- export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h4";
3
+ export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h4" | "h5";
4
4
  export declare function getBlockKey(block: ConstructorBlock, index: number): string;
5
5
  export declare const getCustomBlockTypes: ({ blocks, headers }?: CustomConfig) => string[];
6
6
  export declare const getCustomItems: ({ blocks, headers, subBlocks }?: CustomConfig) => {
@@ -8,6 +8,8 @@ function getHeaderTag(size) {
8
8
  return 'h1';
9
9
  case 's':
10
10
  return 'h4';
11
+ case 'xs':
12
+ return 'h5';
11
13
  case 'm':
12
14
  default:
13
15
  return 'h2';
@@ -7,10 +7,10 @@ unpredictable css rules order in build */
7
7
  font-size: var(--yc-text-body-3-font-size);
8
8
  line-height: var(--yc-text-body-3-line-height);
9
9
  }
10
- .pc-block-header__description_titleSize_s {
10
+ .pc-block-header__description_titleSize_s, .pc-block-header__description_titleSize_xs {
11
11
  margin-top: 8px;
12
12
  }
13
- .pc-block-header__description_titleSize_s .yfm {
13
+ .pc-block-header__description_titleSize_s .yfm, .pc-block-header__description_titleSize_xs .yfm {
14
14
  font-size: var(--yc-text-body-2-font-size);
15
15
  line-height: var(--yc-text-body-2-line-height);
16
16
  }
@@ -1,4 +1,4 @@
1
- .pc-title-block_size_l, .pc-title-block_size_m, .pc-title-block_size_s {
1
+ .pc-title-block_size_l, .pc-title-block_size_m, .pc-title-block_size_s, .pc-title-block_size_xs {
2
2
  margin: 0;
3
3
  }
4
4
 
@@ -10,6 +10,12 @@ unpredictable css rules order in build */
10
10
  .pc-title-block_justify_end {
11
11
  text-align: right;
12
12
  }
13
+ .pc-title-block_size_xs {
14
+ font-size: var(--yc-text-body-3-font-size);
15
+ line-height: var(--yc-text-body-3-line-height);
16
+ color: var(--pc-text-header-color);
17
+ font-weight: var(--yc-text-accent-font-weight);
18
+ }
13
19
  .pc-title-block_size_s {
14
20
  font-size: var(--yc-text-header-1-font-size);
15
21
  line-height: var(--yc-text-header-1-line-height);
@@ -44,10 +50,13 @@ unpredictable css rules order in build */
44
50
  }
45
51
  }
46
52
  .pc-title-block__arrow {
47
- margin: 8px 0 0 4px;
53
+ margin-top: 10px;
54
+ }
55
+ .pc-title-block__arrow_size_xs {
56
+ margin-top: 7px;
48
57
  }
49
58
  .pc-title-block__arrow_size_s {
50
- margin: 4px 0 0 4px;
59
+ margin-top: 5px;
51
60
  }
52
61
  .pc-title-block__link {
53
62
  color: inherit;
@@ -62,7 +71,10 @@ unpredictable css rules order in build */
62
71
  cursor: pointer;
63
72
  }
64
73
  .pc-title-block__link:hover .pc-title-block__arrow {
65
- margin-left: 12px;
74
+ margin-left: 10px;
75
+ }
76
+ .pc-title-block__link:hover .pc-title-block__arrow_size_xs {
77
+ margin-left: 6px;
66
78
  }
67
79
  .pc-title-block__link:hover .pc-title-block__arrow_size_s {
68
80
  margin-left: 8px;
@@ -90,7 +102,10 @@ unpredictable css rules order in build */
90
102
  margin-top: 0;
91
103
  }
92
104
  @media (max-width: 577px) {
93
- .pc-title-block_size_l {
105
+ .pc-title-block_size_l:not(.pc-title-block_reset-margin) {
94
106
  margin-top: 48px;
95
107
  }
108
+ .pc-title-block__arrow_size_m, .pc-title-block__arrow_size_l {
109
+ margin-top: 9px;
110
+ }
96
111
  }
@@ -1,6 +1,6 @@
1
1
  import { TextSize, TitleProps } from '../../models';
2
2
  import './Title.css';
3
- export declare function getArrowSize(size: TextSize, isMobile: boolean): 16 | 20 | 24;
3
+ export declare function getArrowSize(size: TextSize, isMobile: boolean): 16 | 13 | 20 | 24 | 22 | 26 | 38;
4
4
  export interface TitleFullProps extends TitleProps {
5
5
  className?: string;
6
6
  onClick?: () => void;
@@ -8,12 +8,14 @@ import './Title.css';
8
8
  const b = block('title-block');
9
9
  export function getArrowSize(size, isMobile) {
10
10
  switch (size) {
11
+ case 'xs':
12
+ return 13;
11
13
  case 's':
12
14
  return 16;
13
15
  case 'm':
14
- return isMobile ? 20 : 24;
16
+ return isMobile ? 22 : 24;
15
17
  case 'l':
16
- return isMobile ? 20 : 24;
18
+ return isMobile ? 26 : 38;
17
19
  default:
18
20
  return 20;
19
21
  }
@@ -38,7 +38,7 @@ export declare enum MediaVideoControlsType {
38
38
  Custom = "custom"
39
39
  }
40
40
  export type TextTheme = 'light' | 'dark';
41
- export type TextSize = 's' | 'm' | 'l';
41
+ export type TextSize = 'xs' | 's' | 'm' | 'l';
42
42
  export type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';
43
43
  export type HeaderWidth = 's' | 'm' | 'l';
44
44
  export type HeaderImageSize = 's' | 'm';
@@ -38,6 +38,9 @@ export declare const Quote: {
38
38
  type: string;
39
39
  pattern: string;
40
40
  };
41
+ buttonText: {
42
+ type: string;
43
+ };
41
44
  theme: {
42
45
  type: string;
43
46
  enum: string[];
@@ -15,6 +15,8 @@ export const Quote = {
15
15
  }, url: {
16
16
  type: 'string',
17
17
  pattern: urlPattern,
18
+ }, buttonText: {
19
+ type: 'string',
18
20
  }, theme: ThemeProps, author: authorItem }),
19
21
  },
20
22
  };
@@ -1,6 +1,6 @@
1
1
  import { ConstructorBlock } from '../models/constructor';
2
2
  import { TextSize, CustomConfig, PCShareSocialNetwork } from '../models';
3
- export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h4";
3
+ export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h4" | "h5";
4
4
  export declare function getBlockKey(block: ConstructorBlock, index: number): string;
5
5
  export declare const getCustomBlockTypes: ({ blocks, headers }?: CustomConfig) => string[];
6
6
  export declare const getCustomItems: ({ blocks, headers, subBlocks }?: CustomConfig) => {
@@ -5,6 +5,8 @@ export function getHeaderTag(size) {
5
5
  return 'h1';
6
6
  case 's':
7
7
  return 'h4';
8
+ case 'xs':
9
+ return 'h5';
8
10
  case 'm':
9
11
  default:
10
12
  return 'h2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "2.0.3",
3
+ "version": "2.1.1",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,7 +38,7 @@ export declare enum MediaVideoControlsType {
38
38
  Custom = "custom"
39
39
  }
40
40
  export type TextTheme = 'light' | 'dark';
41
- export type TextSize = 's' | 'm' | 'l';
41
+ export type TextSize = 'xs' | 's' | 'm' | 'l';
42
42
  export type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';
43
43
  export type HeaderWidth = 's' | 'm' | 'l';
44
44
  export type HeaderImageSize = 's' | 'm';
@@ -1,6 +1,6 @@
1
1
  import { ConstructorBlock } from '../models/constructor';
2
2
  import { TextSize, CustomConfig, PCShareSocialNetwork } from '../models';
3
- export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h4";
3
+ export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h4" | "h5";
4
4
  export declare function getBlockKey(block: ConstructorBlock, index: number): string;
5
5
  export declare const getCustomBlockTypes: ({ blocks, headers }?: CustomConfig) => string[];
6
6
  export declare const getCustomItems: ({ blocks, headers, subBlocks }?: CustomConfig) => {
@@ -8,6 +8,8 @@ function getHeaderTag(size) {
8
8
  return 'h1';
9
9
  case 's':
10
10
  return 'h4';
11
+ case 'xs':
12
+ return 'h5';
11
13
  case 'm':
12
14
  default:
13
15
  return 'h2';
@@ -141,15 +141,17 @@
141
141
  }
142
142
 
143
143
  @mixin label($size: m) {
144
- @include text-size(body-1);
144
+ @if $size == m {
145
+ @include text-size(body-1);
145
146
 
146
- $label-height: 20px;
147
+ $label-height: 20px;
147
148
 
148
- display: inline-block;
149
- padding: 0 8px;
150
- border-radius: 2px;
151
- height: $label-height;
152
- line-height: $label-height;
149
+ display: inline-block;
150
+ padding: 0 8px;
151
+ border-radius: 2px;
152
+ height: $label-height;
153
+ line-height: $label-height;
154
+ }
153
155
 
154
156
  @if $size == s {
155
157
  @include text-size(caption-2);