@gravity-ui/blog-constructor 6.3.0 → 6.3.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.
@@ -7,10 +7,6 @@ unpredictable css rules order in build */
7
7
  display: flex;
8
8
  align-items: center;
9
9
  }
10
- .bc-paginator__link {
11
- text-decoration: none;
12
- color: var(--g-color-text-primary);
13
- }
14
10
  .bc-paginator__item {
15
11
  display: inline-flex;
16
12
  align-items: center;
@@ -20,7 +20,12 @@ const PaginatorItem = ({ dataKey, mods, content, queryParams, onClick, loading =
20
20
  .join('&');
21
21
  return queryString ? `${urlPath}?${queryString}` : urlPath;
22
22
  }, [queryParams, index, urlPath]);
23
- const renderButton = (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) }, content));
24
- return (react_1.default.createElement(react_1.Fragment, null, addNavigationLinkForPages ? (react_1.default.createElement("a", { href: navigationLink, className: b('link'), onClick: (event) => event.preventDefault() }, renderButton)) : (react_1.default.createElement(react_1.Fragment, null, renderButton))));
23
+ const handleClick = (0, react_1.useCallback)((event) => {
24
+ if (addNavigationLinkForPages && (event.metaKey || event.ctrlKey)) {
25
+ return;
26
+ }
27
+ onClick === null || onClick === void 0 ? void 0 : onClick(itemKey);
28
+ }, [addNavigationLinkForPages, itemKey, onClick]);
29
+ return (react_1.default.createElement(uikit_1.Button, { view: "flat", size: "xl", className: b('item', mods), onClick: handleClick, href: addNavigationLinkForPages ? navigationLink : undefined, loading: loading && Boolean(mods.active) }, content));
25
30
  };
26
31
  exports.PaginatorItem = PaginatorItem;
@@ -7,10 +7,6 @@ unpredictable css rules order in build */
7
7
  display: flex;
8
8
  align-items: center;
9
9
  }
10
- .bc-paginator__link {
11
- text-decoration: none;
12
- color: var(--g-color-text-primary);
13
- }
14
10
  .bc-paginator__item {
15
11
  display: inline-flex;
16
12
  align-items: center;
@@ -1,4 +1,4 @@
1
- import React, { Fragment, useContext, useMemo } from 'react';
1
+ import React, { useCallback, useContext, useMemo } from 'react';
2
2
  import { Button } from '@gravity-ui/uikit';
3
3
  import { LocaleContext } from '../../../contexts/LocaleContext';
4
4
  import { SettingsContext } from '../../../contexts/SettingsContext';
@@ -17,6 +17,11 @@ export const PaginatorItem = ({ dataKey, mods, content, queryParams, onClick, lo
17
17
  .join('&');
18
18
  return queryString ? `${urlPath}?${queryString}` : urlPath;
19
19
  }, [queryParams, index, urlPath]);
20
- const renderButton = (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) }, content));
21
- return (React.createElement(Fragment, null, addNavigationLinkForPages ? (React.createElement("a", { href: navigationLink, className: b('link'), onClick: (event) => event.preventDefault() }, renderButton)) : (React.createElement(Fragment, null, renderButton))));
20
+ const handleClick = useCallback((event) => {
21
+ if (addNavigationLinkForPages && (event.metaKey || event.ctrlKey)) {
22
+ return;
23
+ }
24
+ onClick === null || onClick === void 0 ? void 0 : onClick(itemKey);
25
+ }, [addNavigationLinkForPages, itemKey, onClick]);
26
+ return (React.createElement(Button, { view: "flat", size: "xl", className: b('item', mods), onClick: handleClick, href: addNavigationLinkForPages ? navigationLink : undefined, loading: loading && Boolean(mods.active) }, content));
22
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/blog-constructor",
3
- "version": "6.3.0",
3
+ "version": "6.3.1",
4
4
  "description": "Gravity UI Blog Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {