@gravity-ui/page-constructor 1.7.0-alpha.8 → 1.7.0-alpha.9

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.
Files changed (40) hide show
  1. package/build/cjs/components/navigation/components/Header/Header.css +17 -17
  2. package/build/cjs/components/navigation/components/Header/Header.js +2 -2
  3. package/build/cjs/components/navigation/components/Logo/Logo.css +4 -4
  4. package/build/cjs/components/navigation/components/Logo/Logo.js +4 -4
  5. package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.css +9 -9
  6. package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.js +2 -2
  7. package/build/cjs/components/navigation/components/Navigation/Navigation.css +8 -8
  8. package/build/cjs/components/navigation/components/Navigation/Navigation.js +3 -5
  9. package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.css +8 -8
  10. package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.d.ts +1 -3
  11. package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.js +2 -3
  12. package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.css +4 -4
  13. package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.js +2 -2
  14. package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.css +3 -3
  15. package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.d.ts +1 -1
  16. package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.js +4 -4
  17. package/build/cjs/components/navigation/containers/Layout/Layout.d.ts +1 -0
  18. package/build/cjs/components/navigation/containers/Layout/Layout.js +2 -2
  19. package/build/cjs/models/navigation.d.ts +2 -0
  20. package/build/esm/components/navigation/components/Header/Header.css +17 -17
  21. package/build/esm/components/navigation/components/Header/Header.js +1 -1
  22. package/build/esm/components/navigation/components/Logo/Logo.css +4 -4
  23. package/build/esm/components/navigation/components/Logo/Logo.js +1 -1
  24. package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.css +9 -9
  25. package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.js +1 -1
  26. package/build/esm/components/navigation/components/Navigation/Navigation.css +8 -8
  27. package/build/esm/components/navigation/components/Navigation/Navigation.js +2 -4
  28. package/build/esm/components/navigation/components/NavigationItem/NavigationItem.css +8 -8
  29. package/build/esm/components/navigation/components/NavigationItem/NavigationItem.d.ts +1 -3
  30. package/build/esm/components/navigation/components/NavigationItem/NavigationItem.js +1 -2
  31. package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.css +4 -4
  32. package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.js +1 -1
  33. package/build/esm/components/navigation/components/SocialIcon/SocialIcon.css +3 -3
  34. package/build/esm/components/navigation/components/SocialIcon/SocialIcon.d.ts +1 -1
  35. package/build/esm/components/navigation/components/SocialIcon/SocialIcon.js +1 -1
  36. package/build/esm/components/navigation/containers/Layout/Layout.d.ts +1 -0
  37. package/build/esm/components/navigation/containers/Layout/Layout.js +1 -1
  38. package/build/esm/models/navigation.d.ts +2 -0
  39. package/package.json +1 -1
  40. package/server/models/navigation.d.ts +2 -0
@@ -1,6 +1,6 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .header {
3
+ .pc-header {
4
4
  position: sticky;
5
5
  z-index: 98;
6
6
  top: 0;
@@ -11,37 +11,37 @@ unpredictable css rules order in build */
11
11
  background-color: var(--yc-color-base-background);
12
12
  box-shadow: inset 0 -1px 0 var(--yc-color-line-generic);
13
13
  }
14
- .header__wrapper {
14
+ .pc-header__wrapper {
15
15
  display: flex;
16
16
  justify-content: space-between;
17
17
  align-items: center;
18
18
  height: var(--header-height);
19
19
  }
20
20
  @media (min-width: 769px) {
21
- .header__mobile-menu-button {
21
+ .pc-header__mobile-menu-button {
22
22
  display: none;
23
23
  }
24
24
  }
25
- .header__navigation, .header__left, .header__right {
25
+ .pc-header__navigation, .pc-header__left, .pc-header__right {
26
26
  display: flex;
27
27
  align-items: center;
28
28
  }
29
- .header__navigation {
29
+ .pc-header__navigation {
30
30
  position: relative;
31
31
  margin-right: 20px;
32
32
  flex: 1 0 0;
33
33
  justify-content: flex-start;
34
34
  }
35
35
  @media (max-width: 768px) {
36
- .header__navigation {
36
+ .pc-header__navigation {
37
37
  display: none;
38
38
  }
39
39
  }
40
- .header__right {
40
+ .pc-header__right {
41
41
  flex: 0;
42
42
  justify-content: flex-end;
43
43
  }
44
- .header__navigation-container {
44
+ .pc-header__navigation-container {
45
45
  display: flex;
46
46
  overflow-x: hidden;
47
47
  flex: 1 0 0;
@@ -49,37 +49,37 @@ unpredictable css rules order in build */
49
49
  align-items: center;
50
50
  margin-right: 20px;
51
51
  }
52
- .header__buttons {
52
+ .pc-header__buttons {
53
53
  display: flex;
54
54
  }
55
55
  @media (max-width: 768px) {
56
- .header__buttons {
56
+ .pc-header__buttons {
57
57
  display: none;
58
58
  }
59
59
  }
60
- .header__buttons > *:not(:last-child) {
60
+ .pc-header__buttons > *:not(:last-child) {
61
61
  margin-right: 16px;
62
62
  }
63
- .header__button {
63
+ .pc-header__button {
64
64
  margin-top: 0;
65
65
  }
66
- .header__logo {
66
+ .pc-header__logo {
67
67
  margin: 0 32px 0 0;
68
68
  cursor: pointer;
69
69
  }
70
70
  @media (max-width: 768px) {
71
- .header__navigation-container {
71
+ .pc-header__navigation-container {
72
72
  justify-content: flex-end;
73
73
  }
74
- .header__left {
74
+ .pc-header__left {
75
75
  flex: 1 0 0;
76
76
  }
77
77
  }
78
78
  @media (max-width: 576px) {
79
- .header__navigation-container {
79
+ .pc-header__navigation-container {
80
80
  margin-right: 12px;
81
81
  }
82
- .header__logo {
82
+ .pc-header__logo {
83
83
  margin-right: 0;
84
84
  }
85
85
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Header = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = (0, tslib_1.__importStar)(require("react"));
6
- const bem_cn_lite_1 = (0, tslib_1.__importDefault)(require("bem-cn-lite"));
6
+ const utils_1 = require("../../../../utils");
7
7
  const grid_1 = require("../../../../grid");
8
8
  const OutsideClick_1 = (0, tslib_1.__importDefault)(require("../../../OutsideClick/OutsideClick"));
9
9
  const Control_1 = (0, tslib_1.__importDefault)(require("../../../Control/Control"));
@@ -12,7 +12,7 @@ const MobileNavigation_1 = (0, tslib_1.__importDefault)(require("../MobileNaviga
12
12
  const NavigationItem_1 = (0, tslib_1.__importDefault)(require("../NavigationItem/NavigationItem"));
13
13
  const Logo_1 = (0, tslib_1.__importDefault)(require("../Logo/Logo"));
14
14
  const icons_1 = require("../../../../icons");
15
- const b = (0, bem_cn_lite_1.default)('header');
15
+ const b = (0, utils_1.block)('header');
16
16
  const MobileMenuButton = ({ isSidebarOpened, onSidebarOpenedChange, }) => {
17
17
  const iconProps = { icon: isSidebarOpened ? icons_1.NavigationClose : icons_1.NavigationOpen, iconSize: 36 };
18
18
  return (react_1.default.createElement(Control_1.default, Object.assign({ className: b('mobile-menu-button'), onClick: (e) => {
@@ -1,10 +1,10 @@
1
- .logo {
1
+ .pc-logo {
2
2
  margin: 0;
3
3
  }
4
4
 
5
5
  /* use this for style redefinitions to awoid problems with
6
6
  unpredictable css rules order in build */
7
- .logo {
7
+ .pc-logo {
8
8
  display: flex;
9
9
  align-items: center;
10
10
  font-weight: var(--yc-text-accent-font-weight);
@@ -13,11 +13,11 @@ unpredictable css rules order in build */
13
13
  color: var(--pc-text-header-color);
14
14
  font-weight: var(--yc-text-accent-font-weight);
15
15
  }
16
- .logo__icon {
16
+ .pc-logo__icon {
17
17
  display: flex;
18
18
  margin-right: 8px;
19
19
  object-fit: contain;
20
20
  }
21
- .logo__text {
21
+ .pc-logo__text {
22
22
  white-space: nowrap;
23
23
  }
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = (0, tslib_1.__importDefault)(require("react"));
5
- const bem_cn_lite_1 = (0, tslib_1.__importDefault)(require("bem-cn-lite"));
5
+ const utils_1 = require("../../../../utils");
6
6
  const RouterLink_1 = (0, tslib_1.__importDefault)(require("../../../RouterLink/RouterLink"));
7
- const utils_1 = require("../../../Media/Image/utils");
7
+ const utils_2 = require("../../../Media/Image/utils");
8
8
  const index_1 = require("../../../index");
9
- const b = (0, bem_cn_lite_1.default)('logo');
9
+ const b = (0, utils_1.block)('logo');
10
10
  const Logo = ({ icon, text, className }) => {
11
- const imageData = (0, utils_1.getMediaImage)(icon);
11
+ const imageData = (0, utils_2.getMediaImage)(icon);
12
12
  return (react_1.default.createElement(RouterLink_1.default, { href: "/", passHref: true },
13
13
  react_1.default.createElement("div", { className: b(null, className) },
14
14
  imageData && react_1.default.createElement(index_1.Image, Object.assign({ className: b('icon') }, imageData)),
@@ -1,6 +1,6 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .mobile-navigation {
3
+ .pc-mobile-navigation {
4
4
  position: fixed;
5
5
  z-index: 100;
6
6
  top: var(--header-height);
@@ -14,17 +14,17 @@ unpredictable css rules order in build */
14
14
  line-height: var(--yc-text-body-2-line-height);
15
15
  }
16
16
  @media (min-width: 769px) {
17
- .mobile-navigation {
17
+ .pc-mobile-navigation {
18
18
  display: none;
19
19
  }
20
20
  }
21
- .mobile-navigation__wrapper {
21
+ .pc-mobile-navigation__wrapper {
22
22
  padding: 32px 20px;
23
23
  }
24
- .mobile-navigation__button {
24
+ .pc-mobile-navigation__button {
25
25
  margin-top: 24px;
26
26
  }
27
- .mobile-navigation__links {
27
+ .pc-mobile-navigation__links {
28
28
  position: relative;
29
29
  display: flex;
30
30
  flex-direction: column;
@@ -33,13 +33,13 @@ unpredictable css rules order in build */
33
33
  padding: 0;
34
34
  list-style: none;
35
35
  }
36
- .mobile-navigation__links-item:not(:last-child) {
36
+ .pc-mobile-navigation__links-item:not(:last-child) {
37
37
  margin-bottom: 24px;
38
38
  }
39
- .mobile-navigation__dropdown-item:not(:last-child) {
39
+ .pc-mobile-navigation__dropdown-item:not(:last-child) {
40
40
  margin-bottom: 16px;
41
41
  }
42
- .mobile-navigation__popup {
42
+ .pc-mobile-navigation__popup {
43
43
  z-index: 101;
44
44
  display: flex;
45
45
  flex-direction: column;
@@ -52,7 +52,7 @@ unpredictable css rules order in build */
52
52
  box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
53
53
  }
54
54
  @media (min-width: 769px) {
55
- .mobile-navigation__popup {
55
+ .pc-mobile-navigation__popup {
56
56
  display: none;
57
57
  }
58
58
  }
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const bem_cn_lite_1 = (0, tslib_1.__importDefault)(require("bem-cn-lite"));
5
4
  const react_1 = (0, tslib_1.__importStar)(require("react"));
6
5
  const uikit_1 = require("@gravity-ui/uikit");
6
+ const utils_1 = require("../../../../utils");
7
7
  const Foldable_1 = (0, tslib_1.__importDefault)(require("../../../Foldable/Foldable"));
8
8
  const navigation_1 = require("../../../../models/navigation");
9
9
  const NavigationItem_1 = (0, tslib_1.__importDefault)(require("../NavigationItem/NavigationItem"));
10
- const b = (0, bem_cn_lite_1.default)('mobile-navigation');
10
+ const b = (0, utils_1.block)('mobile-navigation');
11
11
  const MobileNavigationDropdown = ({ data, onItemClick, onToggle, isOpened = false, }) => {
12
12
  const ref = (0, react_1.useRef)(null);
13
13
  return (react_1.default.createElement("div", { ref: ref, className: b('dropdown') },
@@ -1,10 +1,10 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .navigation {
3
+ .pc-navigation {
4
4
  font-size: var(--yc-text-body-2-font-size);
5
5
  line-height: var(--yc-text-body-2-line-height);
6
6
  }
7
- .navigation__links {
7
+ .pc-navigation__links {
8
8
  position: relative;
9
9
  display: flex;
10
10
  align-items: center;
@@ -12,7 +12,7 @@ unpredictable css rules order in build */
12
12
  padding: 0;
13
13
  list-style: none;
14
14
  }
15
- .navigation__links-item {
15
+ .pc-navigation__links-item {
16
16
  position: relative;
17
17
  height: var(--header-height);
18
18
  line-height: var(--header-height);
@@ -21,22 +21,22 @@ unpredictable css rules order in build */
21
21
  color: inherit;
22
22
  text-decoration: none;
23
23
  }
24
- .utilityfocus .navigation__links-item:focus {
24
+ .utilityfocus .pc-navigation__links-item:focus {
25
25
  outline: 2px solid #ffdb4d;
26
26
  }
27
- .navigation__links-item:hover, .navigation__links-item:active {
27
+ .pc-navigation__links-item:hover, .pc-navigation__links-item:active {
28
28
  color: var(--yc-color-text-link);
29
29
  }
30
- .navigation__links-item:not(:last-child) {
30
+ .pc-navigation__links-item:not(:last-child) {
31
31
  margin-right: 20px;
32
32
  }
33
- .navigation__slider-container {
33
+ .pc-navigation__slider-container {
34
34
  position: absolute;
35
35
  right: 0;
36
36
  bottom: 0;
37
37
  left: 0;
38
38
  }
39
- .navigation__slider {
39
+ .pc-navigation__slider {
40
40
  width: 100%;
41
41
  height: 2px;
42
42
  background-color: var(--yc-color-text-link);
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
5
- const bem_cn_lite_1 = (0, tslib_1.__importDefault)(require("bem-cn-lite"));
6
5
  const react_1 = (0, tslib_1.__importStar)(require("react"));
6
+ const utils_1 = require("../../../../utils");
7
7
  const OverflowScroller_1 = (0, tslib_1.__importDefault)(require("../../../OverflowScroller/OverflowScroller"));
8
8
  const navigation_1 = require("../../../../models/navigation");
9
9
  const NavigationPopup_1 = (0, tslib_1.__importDefault)(require("../NavigationPopup/NavigationPopup"));
10
10
  const NavigationItem_1 = (0, tslib_1.__importDefault)(require("../NavigationItem/NavigationItem"));
11
11
  const locationContext_1 = require("../../../../context/locationContext");
12
- const breakpointContext_1 = require("../../../../context/breakpointContext");
13
- const b = (0, bem_cn_lite_1.default)('navigation');
12
+ const b = (0, utils_1.block)('navigation');
14
13
  const NavigationDropdown = ({ data, isActive, position, hidePopup, onClick, }) => {
15
14
  const { text, items } = data, popupProps = (0, tslib_1.__rest)(data, ["text", "items"]);
16
15
  return (react_1.default.createElement(react_1.Fragment, null,
@@ -19,7 +18,6 @@ const NavigationDropdown = ({ data, isActive, position, hidePopup, onClick, }) =
19
18
  };
20
19
  const Navigation = ({ className, onActiveItemChange, links, activeItemIndex, highlightActiveItem, }) => {
21
20
  const { asPath, pathname } = (0, react_1.useContext)(locationContext_1.LocationContext);
22
- const breakpoint = (0, react_1.useContext)(breakpointContext_1.BreakpointContext);
23
21
  const itemRefs = (0, react_1.useRef)([]);
24
22
  const [itemPositions, setItemPosition] = (0, react_1.useState)([]);
25
23
  const [lastLeftScroll, setLastLeftScroll] = (0, react_1.useState)(0);
@@ -56,7 +54,7 @@ const Navigation = ({ className, onActiveItemChange, links, activeItemIndex, hig
56
54
  }, [calculateItemPositions, itemRefs, lastLeftScroll]);
57
55
  (0, react_1.useEffect)(() => {
58
56
  hidePopup();
59
- }, [hidePopup, asPath, pathname, breakpoint]);
57
+ }, [hidePopup, asPath, pathname]);
60
58
  return (react_1.default.createElement(OverflowScroller_1.default, { className: b(null, className), onScrollStart: hidePopup, onScrollEnd: calculateItemPositions },
61
59
  react_1.default.createElement("nav", null,
62
60
  react_1.default.createElement("ul", { className: b('links') }, links.map((link, index) => {
@@ -1,33 +1,33 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .navigation-item {
3
+ .pc-navigation-item {
4
4
  position: relative;
5
5
  display: flex;
6
6
  align-items: center;
7
7
  }
8
- .navigation-item_type_link {
8
+ .pc-navigation-item_type_link {
9
9
  color: var(--yc-color-text-primary);
10
10
  color: inherit;
11
11
  text-decoration: none;
12
12
  outline: none;
13
13
  }
14
- .utilityfocus .navigation-item_type_link:focus {
14
+ .utilityfocus .pc-navigation-item_type_link:focus {
15
15
  outline: 2px solid #ffdb4d;
16
16
  }
17
- .navigation-item_type_link:hover, .navigation-item_type_link_active {
17
+ .pc-navigation-item_type_link:hover, .pc-navigation-item_type_link_active {
18
18
  color: var(--yc-color-text-link);
19
19
  }
20
- .navigation-item_type_button {
20
+ .pc-navigation-item_type_button {
21
21
  display: inline-block;
22
22
  }
23
- .navigation-item__arrow {
23
+ .pc-navigation-item__arrow {
24
24
  position: relative;
25
25
  top: -2px;
26
26
  width: 9px;
27
27
  height: 9px;
28
28
  margin-left: 5px;
29
29
  }
30
- .navigation-item__icon {
30
+ .pc-navigation-item__icon {
31
31
  display: flex;
32
32
  width: 20px;
33
33
  height: 20px;
@@ -35,7 +35,7 @@ unpredictable css rules order in build */
35
35
  border-radius: 50%;
36
36
  object-fit: cover;
37
37
  }
38
- .navigation-item__dropdown {
38
+ .pc-navigation-item__dropdown {
39
39
  margin-left: 7px;
40
40
  color: var(--yc-color-text-secondary);
41
41
  }
@@ -1,7 +1,5 @@
1
1
  import React, { MouseEventHandler } from 'react';
2
- import { NavigationButtonItem, NavigationDropdownItem, NavigationSocialItem, NavigationLinkItem } from '../../../../models';
3
- declare type DropdownItemData = Omit<NavigationDropdownItem, 'items'>;
4
- export declare type NavigationItemData = NavigationLinkItem | NavigationButtonItem | NavigationSocialItem | DropdownItemData;
2
+ import { NavigationItemData } from '../../../../models';
5
3
  export interface NavigationItemProps {
6
4
  data: NavigationItemData;
7
5
  className?: string;
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = (0, tslib_1.__importStar)(require("react"));
5
- const bem_cn_lite_1 = (0, tslib_1.__importDefault)(require("bem-cn-lite"));
6
- const index_1 = require("../../../index");
7
5
  const utils_1 = require("../../../../utils");
6
+ const index_1 = require("../../../index");
8
7
  const locationContext_1 = require("../../../../context/locationContext");
9
8
  const models_1 = require("../../../../models");
10
9
  const icons_1 = require("../../../../icons");
11
10
  const SocialIcon_1 = (0, tslib_1.__importDefault)(require("../SocialIcon/SocialIcon"));
12
11
  const utils_2 = require("../../../Media/Image/utils");
13
- const b = (0, bem_cn_lite_1.default)('navigation-item');
12
+ const b = (0, utils_1.block)('navigation-item');
14
13
  const Content = ({ text, icon }) => (react_1.default.createElement(react_1.Fragment, null,
15
14
  icon && react_1.default.createElement(index_1.Image, Object.assign({ className: b('icon') }, icon)),
16
15
  react_1.default.createElement("span", { className: b('text') }, text)));
@@ -1,6 +1,6 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .navigation-popup {
3
+ .pc-navigation-popup {
4
4
  position: fixed;
5
5
  top: calc(var(--header-height) - 16px);
6
6
  padding-right: 4px;
@@ -18,16 +18,16 @@ unpredictable css rules order in build */
18
18
  box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
19
19
  }
20
20
  @media (max-width: 768px) {
21
- .navigation-popup {
21
+ .pc-navigation-popup {
22
22
  display: none;
23
23
  }
24
24
  }
25
- .navigation-popup__link {
25
+ .pc-navigation-popup__link {
26
26
  height: 36px;
27
27
  padding: 8px 12px;
28
28
  border-radius: 8px;
29
29
  }
30
- .navigation-popup__link:hover {
30
+ .pc-navigation-popup__link:hover {
31
31
  color: var(--yc-color-text-primary);
32
32
  background-color: var(--yc-color-base-simple-hover);
33
33
  }
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NavigationPopup = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
6
- const bem_cn_lite_1 = (0, tslib_1.__importDefault)(require("bem-cn-lite"));
7
6
  const react_1 = (0, tslib_1.__importStar)(require("react"));
8
7
  const uikit_1 = require("@gravity-ui/uikit");
8
+ const utils_1 = require("../../../../utils");
9
9
  const index_1 = require("../../../index");
10
10
  const NavigationItem_1 = (0, tslib_1.__importDefault)(require("../NavigationItem/NavigationItem"));
11
- const b = (0, bem_cn_lite_1.default)('navigation-popup');
11
+ const b = (0, utils_1.block)('navigation-popup');
12
12
  const NavigationPopup = ({ items, left, onClose }) => {
13
13
  const [calculatedLeft, setCalculatedLeft] = (0, react_1.useState)(left);
14
14
  const popupRef = (0, react_1.useRef)(null);
@@ -1,6 +1,6 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .social-icon {
3
+ .pc-social-icon {
4
4
  display: flex;
5
5
  justify-content: center;
6
6
  align-items: center;
@@ -11,10 +11,10 @@ unpredictable css rules order in build */
11
11
  border-radius: 50%;
12
12
  background-color: var(--yc-color-base-generic);
13
13
  }
14
- .social-icon:hover {
14
+ .pc-social-icon:hover {
15
15
  background-color: var(--yc-color-base-generic-hover);
16
16
  }
17
- .social-icon__icon {
17
+ .pc-social-icon__icon {
18
18
  width: 16px;
19
19
  height: 16px;
20
20
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { NavigationSocialItem } from '../../../../models/navigation';
2
+ import { NavigationSocialItem } from '../../../../models';
3
3
  export interface NavigationSocialItemProps extends NavigationSocialItem {
4
4
  className?: string;
5
5
  }
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = (0, tslib_1.__importDefault)(require("react"));
5
- const bem_cn_lite_1 = (0, tslib_1.__importDefault)(require("bem-cn-lite"));
5
+ const utils_1 = require("../../../../utils");
6
6
  const index_1 = require("../../../index");
7
- const utils_1 = require("../../../Media/Image/utils");
8
- const b = (0, bem_cn_lite_1.default)('social-icon');
7
+ const utils_2 = require("../../../Media/Image/utils");
8
+ const b = (0, utils_1.block)('social-icon');
9
9
  const SocialIcon = ({ icon, url, className }) => {
10
- const iconData = (0, utils_1.getMediaImage)(icon);
10
+ const iconData = (0, utils_2.getMediaImage)(icon);
11
11
  return (react_1.default.createElement("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: b(null, className) },
12
12
  react_1.default.createElement(index_1.Image, Object.assign({ className: b('icon') }, iconData))));
13
13
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { NavigationData } from '../../../../models';
3
3
  export interface LayoutProps {
4
4
  navigation?: NavigationData;
5
+ children?: React.ReactNode;
5
6
  }
6
7
  declare const Layout: React.FC<LayoutProps>;
7
8
  export default Layout;
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = (0, tslib_1.__importDefault)(require("react"));
5
- const bem_cn_lite_1 = (0, tslib_1.__importDefault)(require("bem-cn-lite"));
5
+ const utils_1 = require("../../../../utils");
6
6
  const Header_1 = (0, tslib_1.__importDefault)(require("../../components/Header/Header"));
7
- const b = (0, bem_cn_lite_1.default)('layout');
7
+ const b = (0, utils_1.block)('layout');
8
8
  const Layout = ({ children, navigation }) => (react_1.default.createElement("div", { className: b() },
9
9
  navigation && react_1.default.createElement(Header_1.default, { data: navigation.header, logo: navigation.logo }),
10
10
  react_1.default.createElement("main", { className: b('content') }, children)));
@@ -31,6 +31,8 @@ export interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {
31
31
  url: string;
32
32
  }
33
33
  export declare type NavigationItem = NavigationLinkItem | NavigationButtonItem | NavigationDropdownItem;
34
+ export declare type NavigationItemData = NavigationLinkItem | NavigationButtonItem | NavigationSocialItem | DropdownItemData;
35
+ export declare type DropdownItemData = Omit<NavigationDropdownItem, 'items'>;
34
36
  export interface NavigationLogo {
35
37
  icon: ImageProps;
36
38
  text?: string;
@@ -1,6 +1,6 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .header {
3
+ .pc-header {
4
4
  position: sticky;
5
5
  z-index: 98;
6
6
  top: 0;
@@ -11,37 +11,37 @@ unpredictable css rules order in build */
11
11
  background-color: var(--yc-color-base-background);
12
12
  box-shadow: inset 0 -1px 0 var(--yc-color-line-generic);
13
13
  }
14
- .header__wrapper {
14
+ .pc-header__wrapper {
15
15
  display: flex;
16
16
  justify-content: space-between;
17
17
  align-items: center;
18
18
  height: var(--header-height);
19
19
  }
20
20
  @media (min-width: 769px) {
21
- .header__mobile-menu-button {
21
+ .pc-header__mobile-menu-button {
22
22
  display: none;
23
23
  }
24
24
  }
25
- .header__navigation, .header__left, .header__right {
25
+ .pc-header__navigation, .pc-header__left, .pc-header__right {
26
26
  display: flex;
27
27
  align-items: center;
28
28
  }
29
- .header__navigation {
29
+ .pc-header__navigation {
30
30
  position: relative;
31
31
  margin-right: 20px;
32
32
  flex: 1 0 0;
33
33
  justify-content: flex-start;
34
34
  }
35
35
  @media (max-width: 768px) {
36
- .header__navigation {
36
+ .pc-header__navigation {
37
37
  display: none;
38
38
  }
39
39
  }
40
- .header__right {
40
+ .pc-header__right {
41
41
  flex: 0;
42
42
  justify-content: flex-end;
43
43
  }
44
- .header__navigation-container {
44
+ .pc-header__navigation-container {
45
45
  display: flex;
46
46
  overflow-x: hidden;
47
47
  flex: 1 0 0;
@@ -49,37 +49,37 @@ unpredictable css rules order in build */
49
49
  align-items: center;
50
50
  margin-right: 20px;
51
51
  }
52
- .header__buttons {
52
+ .pc-header__buttons {
53
53
  display: flex;
54
54
  }
55
55
  @media (max-width: 768px) {
56
- .header__buttons {
56
+ .pc-header__buttons {
57
57
  display: none;
58
58
  }
59
59
  }
60
- .header__buttons > *:not(:last-child) {
60
+ .pc-header__buttons > *:not(:last-child) {
61
61
  margin-right: 16px;
62
62
  }
63
- .header__button {
63
+ .pc-header__button {
64
64
  margin-top: 0;
65
65
  }
66
- .header__logo {
66
+ .pc-header__logo {
67
67
  margin: 0 32px 0 0;
68
68
  cursor: pointer;
69
69
  }
70
70
  @media (max-width: 768px) {
71
- .header__navigation-container {
71
+ .pc-header__navigation-container {
72
72
  justify-content: flex-end;
73
73
  }
74
- .header__left {
74
+ .pc-header__left {
75
75
  flex: 1 0 0;
76
76
  }
77
77
  }
78
78
  @media (max-width: 576px) {
79
- .header__navigation-container {
79
+ .pc-header__navigation-container {
80
80
  margin-right: 12px;
81
81
  }
82
- .header__logo {
82
+ .pc-header__logo {
83
83
  margin-right: 0;
84
84
  }
85
85
  }
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useState } from 'react';
2
- import block from 'bem-cn-lite';
2
+ import { block } from '../../../../utils';
3
3
  import { Col, Grid, Row } from '../../../../grid';
4
4
  import OutsideClick from '../../../OutsideClick/OutsideClick';
5
5
  import Control from '../../../Control/Control';
@@ -1,10 +1,10 @@
1
- .logo {
1
+ .pc-logo {
2
2
  margin: 0;
3
3
  }
4
4
 
5
5
  /* use this for style redefinitions to awoid problems with
6
6
  unpredictable css rules order in build */
7
- .logo {
7
+ .pc-logo {
8
8
  display: flex;
9
9
  align-items: center;
10
10
  font-weight: var(--yc-text-accent-font-weight);
@@ -13,11 +13,11 @@ unpredictable css rules order in build */
13
13
  color: var(--pc-text-header-color);
14
14
  font-weight: var(--yc-text-accent-font-weight);
15
15
  }
16
- .logo__icon {
16
+ .pc-logo__icon {
17
17
  display: flex;
18
18
  margin-right: 8px;
19
19
  object-fit: contain;
20
20
  }
21
- .logo__text {
21
+ .pc-logo__text {
22
22
  white-space: nowrap;
23
23
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import block from 'bem-cn-lite';
2
+ import { block } from '../../../../utils';
3
3
  import RouterLink from '../../../RouterLink/RouterLink';
4
4
  import { getMediaImage } from '../../../Media/Image/utils';
5
5
  import { Image } from '../../../index';
@@ -1,6 +1,6 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .mobile-navigation {
3
+ .pc-mobile-navigation {
4
4
  position: fixed;
5
5
  z-index: 100;
6
6
  top: var(--header-height);
@@ -14,17 +14,17 @@ unpredictable css rules order in build */
14
14
  line-height: var(--yc-text-body-2-line-height);
15
15
  }
16
16
  @media (min-width: 769px) {
17
- .mobile-navigation {
17
+ .pc-mobile-navigation {
18
18
  display: none;
19
19
  }
20
20
  }
21
- .mobile-navigation__wrapper {
21
+ .pc-mobile-navigation__wrapper {
22
22
  padding: 32px 20px;
23
23
  }
24
- .mobile-navigation__button {
24
+ .pc-mobile-navigation__button {
25
25
  margin-top: 24px;
26
26
  }
27
- .mobile-navigation__links {
27
+ .pc-mobile-navigation__links {
28
28
  position: relative;
29
29
  display: flex;
30
30
  flex-direction: column;
@@ -33,13 +33,13 @@ unpredictable css rules order in build */
33
33
  padding: 0;
34
34
  list-style: none;
35
35
  }
36
- .mobile-navigation__links-item:not(:last-child) {
36
+ .pc-mobile-navigation__links-item:not(:last-child) {
37
37
  margin-bottom: 24px;
38
38
  }
39
- .mobile-navigation__dropdown-item:not(:last-child) {
39
+ .pc-mobile-navigation__dropdown-item:not(:last-child) {
40
40
  margin-bottom: 16px;
41
41
  }
42
- .mobile-navigation__popup {
42
+ .pc-mobile-navigation__popup {
43
43
  z-index: 101;
44
44
  display: flex;
45
45
  flex-direction: column;
@@ -52,7 +52,7 @@ unpredictable css rules order in build */
52
52
  box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
53
53
  }
54
54
  @media (min-width: 769px) {
55
- .mobile-navigation__popup {
55
+ .pc-mobile-navigation__popup {
56
56
  display: none;
57
57
  }
58
58
  }
@@ -1,6 +1,6 @@
1
- import block from 'bem-cn-lite';
2
1
  import React, { useRef, useCallback } from 'react';
3
2
  import { Popup, Portal } from '@gravity-ui/uikit';
3
+ import { block } from '../../../../utils';
4
4
  import Foldable from '../../../Foldable/Foldable';
5
5
  import { NavigationItemType, } from '../../../../models/navigation';
6
6
  import NavigationItem from '../NavigationItem/NavigationItem';
@@ -1,10 +1,10 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .navigation {
3
+ .pc-navigation {
4
4
  font-size: var(--yc-text-body-2-font-size);
5
5
  line-height: var(--yc-text-body-2-line-height);
6
6
  }
7
- .navigation__links {
7
+ .pc-navigation__links {
8
8
  position: relative;
9
9
  display: flex;
10
10
  align-items: center;
@@ -12,7 +12,7 @@ unpredictable css rules order in build */
12
12
  padding: 0;
13
13
  list-style: none;
14
14
  }
15
- .navigation__links-item {
15
+ .pc-navigation__links-item {
16
16
  position: relative;
17
17
  height: var(--header-height);
18
18
  line-height: var(--header-height);
@@ -21,22 +21,22 @@ unpredictable css rules order in build */
21
21
  color: inherit;
22
22
  text-decoration: none;
23
23
  }
24
- .utilityfocus .navigation__links-item:focus {
24
+ .utilityfocus .pc-navigation__links-item:focus {
25
25
  outline: 2px solid #ffdb4d;
26
26
  }
27
- .navigation__links-item:hover, .navigation__links-item:active {
27
+ .pc-navigation__links-item:hover, .pc-navigation__links-item:active {
28
28
  color: var(--yc-color-text-link);
29
29
  }
30
- .navigation__links-item:not(:last-child) {
30
+ .pc-navigation__links-item:not(:last-child) {
31
31
  margin-right: 20px;
32
32
  }
33
- .navigation__slider-container {
33
+ .pc-navigation__slider-container {
34
34
  position: absolute;
35
35
  right: 0;
36
36
  bottom: 0;
37
37
  left: 0;
38
38
  }
39
- .navigation__slider {
39
+ .pc-navigation__slider {
40
40
  width: 100%;
41
41
  height: 2px;
42
42
  background-color: var(--yc-color-text-link);
@@ -1,13 +1,12 @@
1
1
  import { __rest } from "tslib";
2
2
  import _ from 'lodash';
3
- import block from 'bem-cn-lite';
4
3
  import React, { Fragment, useState, useEffect, useCallback, useContext, useRef, } from 'react';
4
+ import { block } from '../../../../utils';
5
5
  import OverflowScroller from '../../../OverflowScroller/OverflowScroller';
6
6
  import { NavigationItemType, } from '../../../../models/navigation';
7
7
  import NavigationPopup from '../NavigationPopup/NavigationPopup';
8
8
  import NavigationItem from '../NavigationItem/NavigationItem';
9
9
  import { LocationContext } from '../../../../context/locationContext';
10
- import { BreakpointContext } from '../../../../context/breakpointContext';
11
10
  import './Navigation.css';
12
11
  const b = block('navigation');
13
12
  const NavigationDropdown = ({ data, isActive, position, hidePopup, onClick, }) => {
@@ -18,7 +17,6 @@ const NavigationDropdown = ({ data, isActive, position, hidePopup, onClick, }) =
18
17
  };
19
18
  const Navigation = ({ className, onActiveItemChange, links, activeItemIndex, highlightActiveItem, }) => {
20
19
  const { asPath, pathname } = useContext(LocationContext);
21
- const breakpoint = useContext(BreakpointContext);
22
20
  const itemRefs = useRef([]);
23
21
  const [itemPositions, setItemPosition] = useState([]);
24
22
  const [lastLeftScroll, setLastLeftScroll] = useState(0);
@@ -55,7 +53,7 @@ const Navigation = ({ className, onActiveItemChange, links, activeItemIndex, hig
55
53
  }, [calculateItemPositions, itemRefs, lastLeftScroll]);
56
54
  useEffect(() => {
57
55
  hidePopup();
58
- }, [hidePopup, asPath, pathname, breakpoint]);
56
+ }, [hidePopup, asPath, pathname]);
59
57
  return (React.createElement(OverflowScroller, { className: b(null, className), onScrollStart: hidePopup, onScrollEnd: calculateItemPositions },
60
58
  React.createElement("nav", null,
61
59
  React.createElement("ul", { className: b('links') }, links.map((link, index) => {
@@ -1,33 +1,33 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .navigation-item {
3
+ .pc-navigation-item {
4
4
  position: relative;
5
5
  display: flex;
6
6
  align-items: center;
7
7
  }
8
- .navigation-item_type_link {
8
+ .pc-navigation-item_type_link {
9
9
  color: var(--yc-color-text-primary);
10
10
  color: inherit;
11
11
  text-decoration: none;
12
12
  outline: none;
13
13
  }
14
- .utilityfocus .navigation-item_type_link:focus {
14
+ .utilityfocus .pc-navigation-item_type_link:focus {
15
15
  outline: 2px solid #ffdb4d;
16
16
  }
17
- .navigation-item_type_link:hover, .navigation-item_type_link_active {
17
+ .pc-navigation-item_type_link:hover, .pc-navigation-item_type_link_active {
18
18
  color: var(--yc-color-text-link);
19
19
  }
20
- .navigation-item_type_button {
20
+ .pc-navigation-item_type_button {
21
21
  display: inline-block;
22
22
  }
23
- .navigation-item__arrow {
23
+ .pc-navigation-item__arrow {
24
24
  position: relative;
25
25
  top: -2px;
26
26
  width: 9px;
27
27
  height: 9px;
28
28
  margin-left: 5px;
29
29
  }
30
- .navigation-item__icon {
30
+ .pc-navigation-item__icon {
31
31
  display: flex;
32
32
  width: 20px;
33
33
  height: 20px;
@@ -35,7 +35,7 @@ unpredictable css rules order in build */
35
35
  border-radius: 50%;
36
36
  object-fit: cover;
37
37
  }
38
- .navigation-item__dropdown {
38
+ .pc-navigation-item__dropdown {
39
39
  margin-left: 7px;
40
40
  color: var(--yc-color-text-secondary);
41
41
  }
@@ -1,8 +1,6 @@
1
1
  import React, { MouseEventHandler } from 'react';
2
- import { NavigationButtonItem, NavigationDropdownItem, NavigationSocialItem, NavigationLinkItem } from '../../../../models';
2
+ import { NavigationItemData } from '../../../../models';
3
3
  import './NavigationItem.css';
4
- declare type DropdownItemData = Omit<NavigationDropdownItem, 'items'>;
5
- export declare type NavigationItemData = NavigationLinkItem | NavigationButtonItem | NavigationSocialItem | DropdownItemData;
6
4
  export interface NavigationItemProps {
7
5
  data: NavigationItemData;
8
6
  className?: string;
@@ -1,8 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import React, { Fragment, useContext, useMemo } from 'react';
3
- import block from 'bem-cn-lite';
3
+ import { block, getLinkProps } from '../../../../utils';
4
4
  import { RouterLink, ToggleArrow, Button, Image } from '../../../index';
5
- import { getLinkProps } from '../../../../utils';
6
5
  import { LocationContext } from '../../../../context/locationContext';
7
6
  import { NavigationItemType, } from '../../../../models';
8
7
  import { NavigationArrow } from '../../../../icons';
@@ -1,6 +1,6 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .navigation-popup {
3
+ .pc-navigation-popup {
4
4
  position: fixed;
5
5
  top: calc(var(--header-height) - 16px);
6
6
  padding-right: 4px;
@@ -18,16 +18,16 @@ unpredictable css rules order in build */
18
18
  box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
19
19
  }
20
20
  @media (max-width: 768px) {
21
- .navigation-popup {
21
+ .pc-navigation-popup {
22
22
  display: none;
23
23
  }
24
24
  }
25
- .navigation-popup__link {
25
+ .pc-navigation-popup__link {
26
26
  height: 36px;
27
27
  padding: 8px 12px;
28
28
  border-radius: 8px;
29
29
  }
30
- .navigation-popup__link:hover {
30
+ .pc-navigation-popup__link:hover {
31
31
  color: var(--yc-color-text-primary);
32
32
  background-color: var(--yc-color-base-simple-hover);
33
33
  }
@@ -1,7 +1,7 @@
1
1
  import _ from 'lodash';
2
- import block from 'bem-cn-lite';
3
2
  import React, { useRef, useState, useEffect, useCallback } from 'react';
4
3
  import { Portal } from '@gravity-ui/uikit';
4
+ import { block } from '../../../../utils';
5
5
  import { OutsideClick } from '../../../index';
6
6
  import NavigationItem from '../NavigationItem/NavigationItem';
7
7
  import './NavigationPopup.css';
@@ -1,6 +1,6 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
- .social-icon {
3
+ .pc-social-icon {
4
4
  display: flex;
5
5
  justify-content: center;
6
6
  align-items: center;
@@ -11,10 +11,10 @@ unpredictable css rules order in build */
11
11
  border-radius: 50%;
12
12
  background-color: var(--yc-color-base-generic);
13
13
  }
14
- .social-icon:hover {
14
+ .pc-social-icon:hover {
15
15
  background-color: var(--yc-color-base-generic-hover);
16
16
  }
17
- .social-icon__icon {
17
+ .pc-social-icon__icon {
18
18
  width: 16px;
19
19
  height: 16px;
20
20
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { NavigationSocialItem } from '../../../../models/navigation';
2
+ import { NavigationSocialItem } from '../../../../models';
3
3
  import './SocialIcon.css';
4
4
  export interface NavigationSocialItemProps extends NavigationSocialItem {
5
5
  className?: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import block from 'bem-cn-lite';
2
+ import { block } from '../../../../utils';
3
3
  import { Image } from '../../../index';
4
4
  import { getMediaImage } from '../../../Media/Image/utils';
5
5
  import './SocialIcon.css';
@@ -3,6 +3,7 @@ import { NavigationData } from '../../../../models';
3
3
  import './Layout.css';
4
4
  export interface LayoutProps {
5
5
  navigation?: NavigationData;
6
+ children?: React.ReactNode;
6
7
  }
7
8
  declare const Layout: React.FC<LayoutProps>;
8
9
  export default Layout;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import block from 'bem-cn-lite';
2
+ import { block } from '../../../../utils';
3
3
  import Header from '../../components/Header/Header';
4
4
  import './Layout.css';
5
5
  const b = block('layout');
@@ -31,6 +31,8 @@ export interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {
31
31
  url: string;
32
32
  }
33
33
  export declare type NavigationItem = NavigationLinkItem | NavigationButtonItem | NavigationDropdownItem;
34
+ export declare type NavigationItemData = NavigationLinkItem | NavigationButtonItem | NavigationSocialItem | DropdownItemData;
35
+ export declare type DropdownItemData = Omit<NavigationDropdownItem, 'items'>;
34
36
  export interface NavigationLogo {
35
37
  icon: ImageProps;
36
38
  text?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "1.7.0-alpha.8",
3
+ "version": "1.7.0-alpha.9",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,6 +31,8 @@ export interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {
31
31
  url: string;
32
32
  }
33
33
  export declare type NavigationItem = NavigationLinkItem | NavigationButtonItem | NavigationDropdownItem;
34
+ export declare type NavigationItemData = NavigationLinkItem | NavigationButtonItem | NavigationSocialItem | DropdownItemData;
35
+ export declare type DropdownItemData = Omit<NavigationDropdownItem, 'items'>;
34
36
  export interface NavigationLogo {
35
37
  icon: ImageProps;
36
38
  text?: string;