@gravity-ui/blog-constructor 5.14.0 → 5.15.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @gravity-ui/blog-constructor · [![npm package](https://img.shields.io/npm/v/@gravity-ui/blog-constructor)](https://www.npmjs.com/package/@gravity-ui/blog-constructor) [![CI](https://img.shields.io/github/actions/workflow/status/gravity-ui/blog-constructor/ci.yml?branch=main&label=CI)](https://github.com/gravity-ui/blog-constructor/actions/workflows/ci.yml?query=branch:main) [![CI](https://img.shields.io/github/actions/workflow/status/gravity-ui/blog-constructor/release.yml?branch=main&label=Release)](https://github.com/gravity-ui/blog-constructor/actions/workflows/release.yml?query=branch:main) [![storybook](https://img.shields.io/badge/Storybook-deployed-ff4685)](https://preview.yandexcloud.dev/blog-constructor/)
1
+ # @gravity-ui/blog-constructor · [![npm package](https://img.shields.io/npm/v/@gravity-ui/blog-constructor)](https://www.npmjs.com/package/@gravity-ui/blog-constructor) [![CI](https://img.shields.io/github/actions/workflow/status/gravity-ui/blog-constructor/ci.yml?branch=main&label=CI)](https://github.com/gravity-ui/blog-constructor/actions/workflows/ci.yml?query=branch:main) [![CI](https://img.shields.io/github/actions/workflow/status/gravity-ui/blog-constructor/release.yml?branch=main&label=Release)](https://github.com/gravity-ui/blog-constructor/actions/workflows/release.yml?query=branch:main) [![storybook](https://img.shields.io/badge/Storybook-deployed-ff4685)](https://preview.gravity-ui.com/blog-constructor/)
2
2
 
3
3
  ## Install
4
4
 
@@ -10,7 +10,7 @@ npm install @gravity-ui/blog-constructor
10
10
 
11
11
  `Blog-constructor` is a library based on the [Page-constructor](https://github.com/gravity-ui/page-constructor) library for creating blog format web pages. Blog-constructor uses the [`custom`](https://github.com/gravity-ui/page-constructor#custom-blocks) prop from page-constructor to add the components needed for the blog.
12
12
 
13
- ### Documentation - [storybook](https://preview.yandexcloud.dev/blog-constructor/)
13
+ ### Documentation - [storybook](https://preview.gravity-ui.com/blog-constructor/)
14
14
 
15
15
  ### Getting started
16
16
 
@@ -44,6 +44,10 @@ unpredictable css rules order in build */
44
44
  border-radius: 8px;
45
45
  }
46
46
 
47
+ .bc-feed-controls__popup_isMobile.bc-feed-controls__popup_isMobile {
48
+ max-height: inherit;
49
+ }
50
+
47
51
  .bc-feed-controls__popup-filter {
48
52
  font-size: var(--g-text-body-2-font-size);
49
53
  line-height: var(--g-text-body-2-line-height);
@@ -10,6 +10,7 @@ const uikit_1 = require("@gravity-ui/uikit");
10
10
  */
11
11
  const constants_1 = require("../../../../constants");
12
12
  const LikesContext_1 = require("../../../../contexts/LikesContext");
13
+ const MobileContext_1 = require("../../../../contexts/MobileContext");
13
14
  const metrika_1 = tslib_1.__importDefault(require("../../../../counters/metrika"));
14
15
  const utils_1 = require("../../../../counters/utils");
15
16
  const i18n_1 = require("../../../../i18n");
@@ -30,6 +31,7 @@ const Controls = ({ handleLoadData, tags = [], services = [], queryParams, }) =>
30
31
  const { savedOnly: savedOnlyInitial, search: searchInitial, tags: tagInitial, services: servicesInitial, } = queryParams || {};
31
32
  const [savedOnly, setSavedOnly] = (0, react_1.useState)(savedOnlyInitial === 'true');
32
33
  const [search, setSearch] = (0, react_1.useState)(searchInitial);
34
+ const isMobile = (0, react_1.useContext)(MobileContext_1.MobileContext);
33
35
  const handleSavedOnly = () => {
34
36
  handleAnalyticsSaveOnly();
35
37
  setSavedOnly(!savedOnly);
@@ -98,13 +100,13 @@ const Controls = ({ handleLoadData, tags = [], services = [], queryParams, }) =>
98
100
  react_1.default.createElement("div", { className: b('filter-item') },
99
101
  react_1.default.createElement(Search_1.Search, { className: b('search'), placeholder: (0, i18n_1.i18)(i18n_1.Keyset.Search), initialValue: search && typeof search === 'string' ? search : '', onSubmit: handleSearch })),
100
102
  react_1.default.createElement("div", { className: b('filter-item') },
101
- react_1.default.createElement(uikit_1.Select, { className: b('select'), size: "xl", options: tagsItems, defaultValue: [tagInitial], onUpdate: handleTagSelect, placeholder: (0, i18n_1.i18)(i18n_1.Keyset.AllTags), popupClassName: b('popup'), renderControl: (0, customRenders_1.renderSwitcher)({
103
+ react_1.default.createElement(uikit_1.Select, { className: b('select'), size: "xl", options: tagsItems, defaultValue: [tagInitial], onUpdate: handleTagSelect, placeholder: (0, i18n_1.i18)(i18n_1.Keyset.AllTags), popupClassName: b('popup', { isMobile }), renderControl: (0, customRenders_1.renderSwitcher)({
102
104
  initial: [tagInitial],
103
105
  list: tagsItems,
104
106
  defaultLabel: (0, i18n_1.i18)(i18n_1.Keyset.AllTags),
105
107
  }), disablePortal: true, virtualizationThreshold: VIRTUALIZATION_THRESHOLD, renderOption: customRenders_1.renderOption })),
106
108
  services.length > 0 ? (react_1.default.createElement("div", { className: b('filter-item') },
107
- react_1.default.createElement(uikit_1.Select, { className: b('select'), size: "xl", multiple: true, filterable: true, hasClear: true, disablePortal: true, options: services, defaultValue: servicesItems, popupClassName: b('popup'), onUpdate: handleServicesSelect, placeholder: (0, i18n_1.i18)(i18n_1.Keyset.AllServices), renderControl: (0, customRenders_1.renderSwitcher)({
109
+ react_1.default.createElement(uikit_1.Select, { className: b('select'), size: "xl", multiple: true, filterable: true, hasClear: true, disablePortal: true, options: services, defaultValue: servicesItems, popupClassName: b('popup', { isMobile }), onUpdate: handleServicesSelect, placeholder: (0, i18n_1.i18)(i18n_1.Keyset.AllServices), renderControl: (0, customRenders_1.renderSwitcher)({
108
110
  initial: servicesItems,
109
111
  list: services,
110
112
  defaultLabel: (0, i18n_1.i18)(i18n_1.Keyset.AllServices),
@@ -44,6 +44,10 @@ unpredictable css rules order in build */
44
44
  border-radius: 8px;
45
45
  }
46
46
 
47
+ .bc-feed-controls__popup_isMobile.bc-feed-controls__popup_isMobile {
48
+ max-height: inherit;
49
+ }
50
+
47
51
  .bc-feed-controls__popup-filter {
48
52
  font-size: var(--g-text-body-2-font-size);
49
53
  line-height: var(--g-text-body-2-line-height);
@@ -6,6 +6,7 @@ import { Button, Icon, Select } from '@gravity-ui/uikit';
6
6
  */
7
7
  import { BlogMetrikaGoalIds } from '../../../../constants';
8
8
  import { LikesContext } from '../../../../contexts/LikesContext';
9
+ import { MobileContext } from '../../../../contexts/MobileContext';
9
10
  import metrika from '../../../../counters/metrika';
10
11
  import { MetrikaCounter } from '../../../../counters/utils';
11
12
  import { Keyset, i18 } from '../../../../i18n';
@@ -27,6 +28,7 @@ export const Controls = ({ handleLoadData, tags = [], services = [], queryParams
27
28
  const { savedOnly: savedOnlyInitial, search: searchInitial, tags: tagInitial, services: servicesInitial, } = queryParams || {};
28
29
  const [savedOnly, setSavedOnly] = useState(savedOnlyInitial === 'true');
29
30
  const [search, setSearch] = useState(searchInitial);
31
+ const isMobile = useContext(MobileContext);
30
32
  const handleSavedOnly = () => {
31
33
  handleAnalyticsSaveOnly();
32
34
  setSavedOnly(!savedOnly);
@@ -95,13 +97,13 @@ export const Controls = ({ handleLoadData, tags = [], services = [], queryParams
95
97
  React.createElement("div", { className: b('filter-item') },
96
98
  React.createElement(Search, { className: b('search'), placeholder: i18(Keyset.Search), initialValue: search && typeof search === 'string' ? search : '', onSubmit: handleSearch })),
97
99
  React.createElement("div", { className: b('filter-item') },
98
- React.createElement(Select, { className: b('select'), size: "xl", options: tagsItems, defaultValue: [tagInitial], onUpdate: handleTagSelect, placeholder: i18(Keyset.AllTags), popupClassName: b('popup'), renderControl: renderSwitcher({
100
+ React.createElement(Select, { className: b('select'), size: "xl", options: tagsItems, defaultValue: [tagInitial], onUpdate: handleTagSelect, placeholder: i18(Keyset.AllTags), popupClassName: b('popup', { isMobile }), renderControl: renderSwitcher({
99
101
  initial: [tagInitial],
100
102
  list: tagsItems,
101
103
  defaultLabel: i18(Keyset.AllTags),
102
104
  }), disablePortal: true, virtualizationThreshold: VIRTUALIZATION_THRESHOLD, renderOption: renderOption })),
103
105
  services.length > 0 ? (React.createElement("div", { className: b('filter-item') },
104
- React.createElement(Select, { className: b('select'), size: "xl", multiple: true, filterable: true, hasClear: true, disablePortal: true, options: services, defaultValue: servicesItems, popupClassName: b('popup'), onUpdate: handleServicesSelect, placeholder: i18(Keyset.AllServices), renderControl: renderSwitcher({
106
+ React.createElement(Select, { className: b('select'), size: "xl", multiple: true, filterable: true, hasClear: true, disablePortal: true, options: services, defaultValue: servicesItems, popupClassName: b('popup', { isMobile }), onUpdate: handleServicesSelect, placeholder: i18(Keyset.AllServices), renderControl: renderSwitcher({
105
107
  initial: servicesItems,
106
108
  list: services,
107
109
  defaultLabel: i18(Keyset.AllServices),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/blog-constructor",
3
- "version": "5.14.0",
3
+ "version": "5.15.0",
4
4
  "description": "Gravity UI Blog Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -86,7 +86,7 @@
86
86
  "@gravity-ui/prettier-config": "^1.1.0",
87
87
  "@gravity-ui/stylelint-config": "^4.0.1",
88
88
  "@gravity-ui/tsconfig": "^1.0.0",
89
- "@gravity-ui/uikit": "^5.20.0",
89
+ "@gravity-ui/uikit": "^5.25.0",
90
90
  "@jest/environment": "^29.7.0",
91
91
  "@storybook/addon-essentials": "^7.0.27",
92
92
  "@storybook/cli": "^7.0.27",