@gravity-ui/blog-constructor 3.1.0 → 3.2.0-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.1](https://github.com/gravity-ui/blog-constructor/compare/v3.1.0...v3.1.1) (2023-05-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add specificity to headings ([#43](https://github.com/gravity-ui/blog-constructor/issues/43)) ([de53d0b](https://github.com/gravity-ui/blog-constructor/commit/de53d0bb9a697f520626e8c0b1d8c48c8e4d8a64))
9
+ * change href 'prev' to 'blog' and 'next' to page+1 ([#42](https://github.com/gravity-ui/blog-constructor/issues/42)) ([cb8b810](https://github.com/gravity-ui/blog-constructor/commit/cb8b8102d59368cfa0d285d63604a8e9f1ab6619))
10
+
3
11
  ## [3.1.0](https://github.com/gravity-ui/blog-constructor/compare/v3.0.2...v3.1.0) (2023-04-25)
4
12
 
5
13
 
@@ -11,46 +11,66 @@
11
11
  }
12
12
  .bc-cta__button {
13
13
  display: flex;
14
- padding-bottom: 16px;
14
+ padding-bottom: 0px;
15
+ }
16
+ .bc-cta__button_layout {
17
+ width: 100%;
18
+ max-width: 100%;
19
+ margin-right: 0px;
20
+ }
21
+ .bc-cta__button_layout_2 {
22
+ width: calc(50% - (16px / 2));
23
+ max-width: 50%;
24
+ margin-right: 16px;
25
+ }
26
+ .bc-cta__button_layout_2:nth-child(2n) {
27
+ margin-right: 0px;
28
+ }
29
+ .bc-cta__button_layout_3 {
30
+ width: calc(33.3333333333% - (32px / 3));
31
+ margin-right: 16px;
32
+ }
33
+ .bc-cta__button_layout_3:nth-child(3n) {
34
+ margin-right: 0px;
35
+ }
36
+ .bc-cta__button_layout_4 {
37
+ width: calc(25% - (48px / 4));
38
+ max-width: 50%;
39
+ margin-right: 16px;
40
+ }
41
+ .bc-cta__button_layout_4:nth-child(4n) {
42
+ margin-right: 0px;
15
43
  }
16
44
  .bc-cta__content {
17
45
  display: flex;
18
- flex-direction: column;
46
+ flex-direction: row;
19
47
  }
20
- @media (min-width: 577px) {
48
+ @media (max-width: 769px) {
21
49
  .bc-cta__content {
22
- display: flex;
23
- flex-direction: row;
50
+ flex-wrap: wrap;
24
51
  }
25
52
  .bc-cta__button {
26
- padding-bottom: 0px;
27
- }
28
- .bc-cta__button_layout {
29
- width: 100%;
30
- max-width: 100%;
31
- margin-right: 0px;
53
+ padding-bottom: 16px;
32
54
  }
33
- .bc-cta__button_layout_2 {
55
+ .bc-cta__button_layout_1, .bc-cta__button_layout_2, .bc-cta__button_layout_3, .bc-cta__button_layout_4 {
34
56
  width: calc(50% - (16px / 2));
35
- max-width: 50%;
57
+ max-width: 100%;
36
58
  margin-right: 16px;
59
+ flex-grow: 1;
37
60
  }
38
- .bc-cta__button_layout_2:nth-child(2n) {
39
- margin-right: 0px;
61
+ .bc-cta__button_layout_1:nth-child(2n), .bc-cta__button_layout_2:nth-child(2n), .bc-cta__button_layout_3:nth-child(2n), .bc-cta__button_layout_4:nth-child(2n) {
62
+ margin-right: 0;
40
63
  }
41
- .bc-cta__button_layout_3 {
42
- width: calc(33.3333333333% - (32px / 3));
43
- margin-right: 16px;
44
- }
45
- .bc-cta__button_layout_3:nth-child(3n) {
46
- margin-right: 0px;
64
+ }
65
+ @media (max-width: 577px) {
66
+ .bc-cta__content {
67
+ flex-direction: column;
47
68
  }
48
- .bc-cta__button_layout_4 {
49
- width: calc(25% - (48px / 4));
50
- max-width: 50%;
51
- margin-right: 16px;
69
+ .bc-cta__button {
70
+ padding-bottom: 16px;
52
71
  }
53
- .bc-cta__button_layout_4:nth-child(4n) {
54
- margin-right: 0px;
72
+ .bc-cta__button_layout_1, .bc-cta__button_layout_2, .bc-cta__button_layout_3, .bc-cta__button_layout_4 {
73
+ width: 100%;
74
+ max-width: 100%;
55
75
  }
56
76
  }
@@ -107,6 +107,7 @@ const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className, loadin
107
107
  dataKey: types_1.ArrowType.Prev,
108
108
  mods: { type: types_1.ArrowType.Prev },
109
109
  onClick: handleArrowClick,
110
+ index: 0,
110
111
  content: react_1.default.createElement(NavigationButton_1.NavigationButton, { arrowType: types_1.ArrowType.Prev }),
111
112
  });
112
113
  }
@@ -115,6 +116,7 @@ const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className, loadin
115
116
  key: types_1.ArrowType.Next,
116
117
  dataKey: types_1.ArrowType.Next,
117
118
  mods: { type: types_1.ArrowType.Next },
119
+ index: page + 1,
118
120
  onClick: handleArrowClick,
119
121
  content: react_1.default.createElement(NavigationButton_1.NavigationButton, { arrowType: types_1.ArrowType.Next }),
120
122
  });
@@ -1,2 +1,2 @@
1
1
  import { PaginatorItemProps } from '../types';
2
- export declare const PaginatorItem: ({ dataKey, mods, content, onClick, loading, }: PaginatorItemProps) => JSX.Element;
2
+ export declare const PaginatorItem: ({ dataKey, mods, content, onClick, loading, index, }: PaginatorItemProps) => JSX.Element;
@@ -30,12 +30,12 @@ const LocaleContext_1 = require("../../../contexts/LocaleContext");
30
30
  const cn_1 = require("../../../utils/cn");
31
31
  const common_1 = require("../../../utils/common");
32
32
  const b = (0, cn_1.block)('paginator');
33
- const PaginatorItem = ({ dataKey, mods, content, onClick, loading = false, }) => {
33
+ const PaginatorItem = ({ dataKey, mods, content, onClick, loading = false, index, }) => {
34
34
  const { locale } = (0, react_1.useContext)(LocaleContext_1.LocaleContext);
35
35
  const urlPath = (0, common_1.getBlogPath)((locale === null || locale === void 0 ? void 0 : locale.pathPrefix) || '');
36
36
  const itemKey = Number(dataKey) > 0 ? Number(dataKey) : dataKey;
37
- const navTag = itemKey > 0 ? `${mods.type || 'page'}=${itemKey}` : itemKey;
38
- const navigationLink = `${urlPath || ''}?${navTag}`;
37
+ const navTag = index > 1 ? `?page=${index}` : '';
38
+ const navigationLink = `${urlPath || ''}${navTag}`;
39
39
  return (react_1.default.createElement(uikit_1.Button, { view: "flat", size: "xl", className: b('item', mods), onClick: () => onClick === null || onClick === void 0 ? void 0 : onClick(itemKey), loading: loading && Boolean(mods.active) },
40
40
  react_1.default.createElement("a", { href: navigationLink, className: b('link'), onClick: (event) => event.preventDefault() }, content)));
41
41
  };
@@ -8,6 +8,7 @@ export interface PaginatorItemProps {
8
8
  content: ReactNode;
9
9
  onClick?: (key: number | ArrowType) => void;
10
10
  loading?: boolean;
11
+ index: number;
11
12
  }
12
13
  export type PaginatorProps = {
13
14
  page: number;
@@ -17,6 +17,7 @@ const getPageConfigs = ({ page, pagesCount, handlePageClick }) => {
17
17
  paginatorItems.push({
18
18
  key: String(i),
19
19
  dataKey: String(i),
20
+ index: i,
20
21
  mods: { type: 'page', active: page === i },
21
22
  onClick: handlePageClick,
22
23
  content: i,
@@ -49,17 +49,18 @@ unpredictable css rules order in build */
49
49
  font-size: var(--yc-text-header-1-font-size);
50
50
  line-height: var(--yc-text-header-1-line-height);
51
51
  }
52
- .yfm_blog h1,
53
- .yfm_blog h2,
54
- .yfm_blog h3,
55
- .yfm_blog h4,
56
- .yfm_blog h5,
57
- .yfm_blog h6 {
52
+ .yfm_blog.yfm_blog h1,
53
+ .yfm_blog.yfm_blog h2,
54
+ .yfm_blog.yfm_blog h3,
55
+ .yfm_blog.yfm_blog h4,
56
+ .yfm_blog.yfm_blog h5,
57
+ .yfm_blog.yfm_blog h6 {
58
58
  margin-bottom: 16px;
59
59
  margin-top: 32px;
60
60
  padding-top: 0;
61
61
  font-weight: var(--yc-text-header-font-weight);
62
62
  }
63
+
63
64
  .yfm_blog blockquote,
64
65
  .yfm_blog dl,
65
66
  .yfm_blog ol,
@@ -11,46 +11,66 @@
11
11
  }
12
12
  .bc-cta__button {
13
13
  display: flex;
14
- padding-bottom: 16px;
14
+ padding-bottom: 0px;
15
+ }
16
+ .bc-cta__button_layout {
17
+ width: 100%;
18
+ max-width: 100%;
19
+ margin-right: 0px;
20
+ }
21
+ .bc-cta__button_layout_2 {
22
+ width: calc(50% - (16px / 2));
23
+ max-width: 50%;
24
+ margin-right: 16px;
25
+ }
26
+ .bc-cta__button_layout_2:nth-child(2n) {
27
+ margin-right: 0px;
28
+ }
29
+ .bc-cta__button_layout_3 {
30
+ width: calc(33.3333333333% - (32px / 3));
31
+ margin-right: 16px;
32
+ }
33
+ .bc-cta__button_layout_3:nth-child(3n) {
34
+ margin-right: 0px;
35
+ }
36
+ .bc-cta__button_layout_4 {
37
+ width: calc(25% - (48px / 4));
38
+ max-width: 50%;
39
+ margin-right: 16px;
40
+ }
41
+ .bc-cta__button_layout_4:nth-child(4n) {
42
+ margin-right: 0px;
15
43
  }
16
44
  .bc-cta__content {
17
45
  display: flex;
18
- flex-direction: column;
46
+ flex-direction: row;
19
47
  }
20
- @media (min-width: 577px) {
48
+ @media (max-width: 769px) {
21
49
  .bc-cta__content {
22
- display: flex;
23
- flex-direction: row;
50
+ flex-wrap: wrap;
24
51
  }
25
52
  .bc-cta__button {
26
- padding-bottom: 0px;
27
- }
28
- .bc-cta__button_layout {
29
- width: 100%;
30
- max-width: 100%;
31
- margin-right: 0px;
53
+ padding-bottom: 16px;
32
54
  }
33
- .bc-cta__button_layout_2 {
55
+ .bc-cta__button_layout_1, .bc-cta__button_layout_2, .bc-cta__button_layout_3, .bc-cta__button_layout_4 {
34
56
  width: calc(50% - (16px / 2));
35
- max-width: 50%;
57
+ max-width: 100%;
36
58
  margin-right: 16px;
59
+ flex-grow: 1;
37
60
  }
38
- .bc-cta__button_layout_2:nth-child(2n) {
39
- margin-right: 0px;
61
+ .bc-cta__button_layout_1:nth-child(2n), .bc-cta__button_layout_2:nth-child(2n), .bc-cta__button_layout_3:nth-child(2n), .bc-cta__button_layout_4:nth-child(2n) {
62
+ margin-right: 0;
40
63
  }
41
- .bc-cta__button_layout_3 {
42
- width: calc(33.3333333333% - (32px / 3));
43
- margin-right: 16px;
44
- }
45
- .bc-cta__button_layout_3:nth-child(3n) {
46
- margin-right: 0px;
64
+ }
65
+ @media (max-width: 577px) {
66
+ .bc-cta__content {
67
+ flex-direction: column;
47
68
  }
48
- .bc-cta__button_layout_4 {
49
- width: calc(25% - (48px / 4));
50
- max-width: 50%;
51
- margin-right: 16px;
69
+ .bc-cta__button {
70
+ padding-bottom: 16px;
52
71
  }
53
- .bc-cta__button_layout_4:nth-child(4n) {
54
- margin-right: 0px;
72
+ .bc-cta__button_layout_1, .bc-cta__button_layout_2, .bc-cta__button_layout_3, .bc-cta__button_layout_4 {
73
+ width: 100%;
74
+ max-width: 100%;
55
75
  }
56
76
  }
@@ -79,6 +79,7 @@ export const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className,
79
79
  dataKey: ArrowType.Prev,
80
80
  mods: { type: ArrowType.Prev },
81
81
  onClick: handleArrowClick,
82
+ index: 0,
82
83
  content: React.createElement(NavigationButton, { arrowType: ArrowType.Prev }),
83
84
  });
84
85
  }
@@ -87,6 +88,7 @@ export const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className,
87
88
  key: ArrowType.Next,
88
89
  dataKey: ArrowType.Next,
89
90
  mods: { type: ArrowType.Next },
91
+ index: page + 1,
90
92
  onClick: handleArrowClick,
91
93
  content: React.createElement(NavigationButton, { arrowType: ArrowType.Next }),
92
94
  });
@@ -1,3 +1,3 @@
1
1
  import { PaginatorItemProps } from '../types';
2
2
  import '../Paginator.css';
3
- export declare const PaginatorItem: ({ dataKey, mods, content, onClick, loading, }: PaginatorItemProps) => JSX.Element;
3
+ export declare const PaginatorItem: ({ dataKey, mods, content, onClick, loading, index, }: PaginatorItemProps) => JSX.Element;
@@ -5,12 +5,12 @@ import { block } from '../../../utils/cn';
5
5
  import { getBlogPath } from '../../../utils/common';
6
6
  import '../Paginator.css';
7
7
  const b = block('paginator');
8
- export const PaginatorItem = ({ dataKey, mods, content, onClick, loading = false, }) => {
8
+ export const PaginatorItem = ({ dataKey, mods, content, onClick, loading = false, index, }) => {
9
9
  const { locale } = useContext(LocaleContext);
10
10
  const urlPath = getBlogPath((locale === null || locale === void 0 ? void 0 : locale.pathPrefix) || '');
11
11
  const itemKey = Number(dataKey) > 0 ? Number(dataKey) : dataKey;
12
- const navTag = itemKey > 0 ? `${mods.type || 'page'}=${itemKey}` : itemKey;
13
- const navigationLink = `${urlPath || ''}?${navTag}`;
12
+ const navTag = index > 1 ? `?page=${index}` : '';
13
+ const navigationLink = `${urlPath || ''}${navTag}`;
14
14
  return (React.createElement(Button, { view: "flat", size: "xl", className: b('item', mods), onClick: () => onClick === null || onClick === void 0 ? void 0 : onClick(itemKey), loading: loading && Boolean(mods.active) },
15
15
  React.createElement("a", { href: navigationLink, className: b('link'), onClick: (event) => event.preventDefault() }, content)));
16
16
  };
@@ -8,6 +8,7 @@ export interface PaginatorItemProps {
8
8
  content: ReactNode;
9
9
  onClick?: (key: number | ArrowType) => void;
10
10
  loading?: boolean;
11
+ index: number;
11
12
  }
12
13
  export type PaginatorProps = {
13
14
  page: number;
@@ -14,6 +14,7 @@ export const getPageConfigs = ({ page, pagesCount, handlePageClick }) => {
14
14
  paginatorItems.push({
15
15
  key: String(i),
16
16
  dataKey: String(i),
17
+ index: i,
17
18
  mods: { type: 'page', active: page === i },
18
19
  onClick: handlePageClick,
19
20
  content: i,
@@ -49,17 +49,18 @@ unpredictable css rules order in build */
49
49
  font-size: var(--yc-text-header-1-font-size);
50
50
  line-height: var(--yc-text-header-1-line-height);
51
51
  }
52
- .yfm_blog h1,
53
- .yfm_blog h2,
54
- .yfm_blog h3,
55
- .yfm_blog h4,
56
- .yfm_blog h5,
57
- .yfm_blog h6 {
52
+ .yfm_blog.yfm_blog h1,
53
+ .yfm_blog.yfm_blog h2,
54
+ .yfm_blog.yfm_blog h3,
55
+ .yfm_blog.yfm_blog h4,
56
+ .yfm_blog.yfm_blog h5,
57
+ .yfm_blog.yfm_blog h6 {
58
58
  margin-bottom: 16px;
59
59
  margin-top: 32px;
60
60
  padding-top: 0;
61
61
  font-weight: var(--yc-text-header-font-weight);
62
62
  }
63
+
63
64
  .yfm_blog blockquote,
64
65
  .yfm_blog dl,
65
66
  .yfm_blog ol,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/blog-constructor",
3
- "version": "3.1.0",
3
+ "version": "3.2.0-alpha.0",
4
4
  "description": "Gravity UI Blog Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -141,5 +141,8 @@
141
141
  "*.{json,yaml,yml,md}": [
142
142
  "prettier --write"
143
143
  ]
144
+ },
145
+ "publishConfig": {
146
+ "tag": "alpha"
144
147
  }
145
148
  }
package/styles/yfm.css CHANGED
@@ -25,17 +25,18 @@ unpredictable css rules order in build */
25
25
  font-size: var(--yc-text-header-1-font-size);
26
26
  line-height: var(--yc-text-header-1-line-height);
27
27
  }
28
- .yfm_blog h1,
29
- .yfm_blog h2,
30
- .yfm_blog h3,
31
- .yfm_blog h4,
32
- .yfm_blog h5,
33
- .yfm_blog h6 {
28
+ .yfm_blog.yfm_blog h1,
29
+ .yfm_blog.yfm_blog h2,
30
+ .yfm_blog.yfm_blog h3,
31
+ .yfm_blog.yfm_blog h4,
32
+ .yfm_blog.yfm_blog h5,
33
+ .yfm_blog.yfm_blog h6 {
34
34
  margin-bottom: 16px;
35
35
  margin-top: 32px;
36
36
  padding-top: 0;
37
37
  font-weight: var(--yc-text-header-font-weight);
38
38
  }
39
+
39
40
  .yfm_blog blockquote,
40
41
  .yfm_blog dl,
41
42
  .yfm_blog ol,
package/styles/yfm.scss CHANGED
@@ -2,6 +2,8 @@
2
2
  @import './variables.scss';
3
3
 
4
4
  .yfm_blog {
5
+ $root: &;
6
+
5
7
  @include text-size(body-3);
6
8
  color: var(--yc-color-text-primary);
7
9
 
@@ -26,16 +28,18 @@
26
28
  @include text-size(header-1);
27
29
  }
28
30
 
29
- h1,
30
- h2,
31
- h3,
32
- h4,
33
- h5,
34
- h6 {
35
- margin-bottom: $indentXS;
36
- margin-top: $indentM;
37
- padding-top: 0;
38
- font-weight: var(--yc-text-header-font-weight);
31
+ @include add-specificity(&) {
32
+ h1,
33
+ h2,
34
+ h3,
35
+ h4,
36
+ h5,
37
+ h6 {
38
+ margin-bottom: $indentXS;
39
+ margin-top: $indentM;
40
+ padding-top: 0;
41
+ font-weight: var(--yc-text-header-font-weight);
42
+ }
39
43
  }
40
44
 
41
45
  blockquote,