@gravity-ui/blog-constructor 3.1.0 → 3.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 +8 -0
- package/build/cjs/components/Paginator/Paginator.js +2 -0
- package/build/cjs/components/Paginator/components/PaginatorItem.d.ts +1 -1
- package/build/cjs/components/Paginator/components/PaginatorItem.js +3 -3
- package/build/cjs/components/Paginator/types.d.ts +1 -0
- package/build/cjs/components/Paginator/utils.js +1 -0
- package/build/cjs/containers/BlogPostPage/BlogPostPage.css +7 -6
- package/build/esm/components/Paginator/Paginator.js +2 -0
- package/build/esm/components/Paginator/components/PaginatorItem.d.ts +1 -1
- package/build/esm/components/Paginator/components/PaginatorItem.js +3 -3
- package/build/esm/components/Paginator/types.d.ts +1 -0
- package/build/esm/components/Paginator/utils.js +1 -0
- package/build/esm/containers/BlogPostPage/BlogPostPage.css +7 -6
- package/package.json +1 -1
- package/styles/yfm.css +7 -6
- package/styles/yfm.scss +14 -10
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
|
|
@@ -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 =
|
38
|
-
const navigationLink = `${urlPath || ''}
|
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
|
};
|
@@ -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,
|
@@ -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 =
|
13
|
-
const navigationLink = `${urlPath || ''}
|
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
|
};
|
@@ -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
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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,
|