@gravity-ui/blog-constructor 5.16.1-alpha.1 → 5.16.1
Sign up to get free protection for your applications and to get access to all the features.
- package/build/cjs/blocks/Feed/Feed.js +1 -2
- package/build/cjs/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.css +3 -0
- package/build/cjs/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.js +2 -2
- package/build/cjs/components/PostInfo/PostInfo.css +8 -0
- package/build/cjs/components/PostInfo/components/Save.js +1 -1
- package/build/cjs/components/Search/Search.css +3 -0
- package/build/cjs/components/Search/Search.js +1 -1
- package/build/esm/blocks/Feed/Feed.js +1 -2
- package/build/esm/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.css +3 -0
- package/build/esm/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.js +2 -2
- package/build/esm/components/PostInfo/PostInfo.css +8 -0
- package/build/esm/components/PostInfo/components/Save.js +1 -1
- package/build/esm/components/Search/Search.css +3 -0
- package/build/esm/components/Search/Search.js +1 -1
- package/package.json +1 -1
@@ -56,12 +56,11 @@ const Feed = ({ image }) => {
|
|
56
56
|
dispatch({ type: reducer_1.ActionTypes.SetErrorLoad, payload: value });
|
57
57
|
};
|
58
58
|
const handleChangeQueryParams = (0, react_1.useCallback)((value) => {
|
59
|
-
var _a;
|
60
59
|
dispatch({ type: reducer_1.ActionTypes.QueryParamsChange, payload: value });
|
61
60
|
const hasFirstPageQuery = Object.keys(value).some((queryKey) => queryKey === PAGE_QUERY && value[queryKey] === FIRST_PAGE);
|
62
61
|
const result = hasFirstPageQuery
|
63
62
|
? Object.assign(Object.assign({}, value), { [PAGE_QUERY]: null }) : Object.assign({}, value);
|
64
|
-
|
63
|
+
router.updateQueryCallback(result);
|
65
64
|
}, [router]);
|
66
65
|
const fetchData = (0, react_1.useCallback)(async ({ page, query }) => {
|
67
66
|
if (query && getPosts) {
|
@@ -18,8 +18,8 @@ const CustomSwitcher = ({ initial, defaultLabel, list, onClick, controlRef, onKe
|
|
18
18
|
return items.length ? items : [defaultLabel];
|
19
19
|
}, [defaultLabel, initial, list]);
|
20
20
|
const hasCounter = itemsNames.length > 1;
|
21
|
-
return (react_1.default.createElement("
|
22
|
-
react_1.default.createElement("
|
21
|
+
return (react_1.default.createElement("div", { className: b('custom-switcher'), ref: controlRef },
|
22
|
+
react_1.default.createElement("button", { onClick: onClick, className: b('custom-switcher-element', { overlay: true }), onKeyDown: onKeyDown, "aria-expanded": open }),
|
23
23
|
react_1.default.createElement("div", { className: b('custom-switcher-element', { content: true }) }, itemsNames === null || itemsNames === void 0 ? void 0 : itemsNames.join(', ')),
|
24
24
|
renderClear &&
|
25
25
|
renderClear({
|
@@ -17,6 +17,14 @@ unpredictable css rules order in build */
|
|
17
17
|
font-size: var(--g-text-body-3-font-size);
|
18
18
|
line-height: var(--g-text-body-3-line-height);
|
19
19
|
}
|
20
|
+
.bc-post-info__item_save {
|
21
|
+
background: none;
|
22
|
+
color: inherit;
|
23
|
+
border: none;
|
24
|
+
padding: 0;
|
25
|
+
font: inherit;
|
26
|
+
cursor: pointer;
|
27
|
+
}
|
20
28
|
.bc-post-info__item:last-child {
|
21
29
|
font-size: var(--g-text-body-2-font-size);
|
22
30
|
line-height: var(--g-text-body-2-line-height);
|
@@ -31,7 +31,7 @@ const Save = ({ title, postId, hasUserLike, handleUserLike, metrikaGoal, size, t
|
|
31
31
|
const { toggleLike, isSignedInUser, requireSignIn } = (0, react_1.useContext)(LikesContext_1.LikesContext);
|
32
32
|
const handleAnalytics = (0, page_constructor_1.useAnalytics)(common_1.DefaultEventNames.SaveButton);
|
33
33
|
const isLikeable = Boolean(toggleLike);
|
34
|
-
return (react_1.default.createElement("
|
34
|
+
return (react_1.default.createElement("button", { className: b('item', { size, save: true }), onClick: (event) => {
|
35
35
|
// both preventDefault and stopImmediatePropagation required to work properly
|
36
36
|
// https://stackoverflow.com/questions/24415631/reactjs-syntheticevent-stoppropagation-only-works-with-react-events
|
37
37
|
event.preventDefault();
|
@@ -45,7 +45,7 @@ const Search = ({ className, initialValue, onSubmit, debounce = 300, placeholder
|
|
45
45
|
onSubmit('');
|
46
46
|
}
|
47
47
|
};
|
48
|
-
return (react_1.default.createElement("
|
48
|
+
return (react_1.default.createElement("button", { className: b('input-icon'), onClick: handleClick },
|
49
49
|
react_1.default.createElement(uikit_1.Icon, { size: iconSize, data: iconData })));
|
50
50
|
}, [handleChange, onSubmit, value]);
|
51
51
|
return (react_1.default.createElement("div", { className: b({ size }, className) },
|
@@ -52,12 +52,11 @@ export const Feed = ({ image }) => {
|
|
52
52
|
dispatch({ type: ActionTypes.SetErrorLoad, payload: value });
|
53
53
|
};
|
54
54
|
const handleChangeQueryParams = useCallback((value) => {
|
55
|
-
var _a;
|
56
55
|
dispatch({ type: ActionTypes.QueryParamsChange, payload: value });
|
57
56
|
const hasFirstPageQuery = Object.keys(value).some((queryKey) => queryKey === PAGE_QUERY && value[queryKey] === FIRST_PAGE);
|
58
57
|
const result = hasFirstPageQuery
|
59
58
|
? Object.assign(Object.assign({}, value), { [PAGE_QUERY]: null }) : Object.assign({}, value);
|
60
|
-
|
59
|
+
router.updateQueryCallback(result);
|
61
60
|
}, [router]);
|
62
61
|
const fetchData = useCallback(async ({ page, query }) => {
|
63
62
|
if (query && getPosts) {
|
@@ -15,8 +15,8 @@ export const CustomSwitcher = ({ initial, defaultLabel, list, onClick, controlRe
|
|
15
15
|
return items.length ? items : [defaultLabel];
|
16
16
|
}, [defaultLabel, initial, list]);
|
17
17
|
const hasCounter = itemsNames.length > 1;
|
18
|
-
return (React.createElement("
|
19
|
-
React.createElement("
|
18
|
+
return (React.createElement("div", { className: b('custom-switcher'), ref: controlRef },
|
19
|
+
React.createElement("button", { onClick: onClick, className: b('custom-switcher-element', { overlay: true }), onKeyDown: onKeyDown, "aria-expanded": open }),
|
20
20
|
React.createElement("div", { className: b('custom-switcher-element', { content: true }) }, itemsNames === null || itemsNames === void 0 ? void 0 : itemsNames.join(', ')),
|
21
21
|
renderClear &&
|
22
22
|
renderClear({
|
@@ -17,6 +17,14 @@ unpredictable css rules order in build */
|
|
17
17
|
font-size: var(--g-text-body-3-font-size);
|
18
18
|
line-height: var(--g-text-body-3-line-height);
|
19
19
|
}
|
20
|
+
.bc-post-info__item_save {
|
21
|
+
background: none;
|
22
|
+
color: inherit;
|
23
|
+
border: none;
|
24
|
+
padding: 0;
|
25
|
+
font: inherit;
|
26
|
+
cursor: pointer;
|
27
|
+
}
|
20
28
|
.bc-post-info__item:last-child {
|
21
29
|
font-size: var(--g-text-body-2-font-size);
|
22
30
|
line-height: var(--g-text-body-2-line-height);
|
@@ -28,7 +28,7 @@ export const Save = ({ title, postId, hasUserLike, handleUserLike, metrikaGoal,
|
|
28
28
|
const { toggleLike, isSignedInUser, requireSignIn } = useContext(LikesContext);
|
29
29
|
const handleAnalytics = useAnalytics(DefaultEventNames.SaveButton);
|
30
30
|
const isLikeable = Boolean(toggleLike);
|
31
|
-
return (React.createElement("
|
31
|
+
return (React.createElement("button", { className: b('item', { size, save: true }), onClick: (event) => {
|
32
32
|
// both preventDefault and stopImmediatePropagation required to work properly
|
33
33
|
// https://stackoverflow.com/questions/24415631/reactjs-syntheticevent-stoppropagation-only-works-with-react-events
|
34
34
|
event.preventDefault();
|
@@ -42,7 +42,7 @@ export const Search = ({ className, initialValue, onSubmit, debounce = 300, plac
|
|
42
42
|
onSubmit('');
|
43
43
|
}
|
44
44
|
};
|
45
|
-
return (React.createElement("
|
45
|
+
return (React.createElement("button", { className: b('input-icon'), onClick: handleClick },
|
46
46
|
React.createElement(Icon, { size: iconSize, data: iconData })));
|
47
47
|
}, [handleChange, onSubmit, value]);
|
48
48
|
return (React.createElement("div", { className: b({ size }, className) },
|