@gravity-ui/page-constructor 1.8.0-alfa.1 → 1.8.0
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 +16 -0
- package/README.md +58 -36
- package/build/cjs/blocks/Banner/schema.d.ts +0 -12
- package/build/cjs/blocks/Banner/schema.js +0 -2
- package/build/cjs/blocks/CardLayout/schema.d.ts +0 -8
- package/build/cjs/blocks/CardLayout/schema.js +1 -2
- package/build/cjs/blocks/Companies/schema.d.ts +0 -2
- package/build/cjs/blocks/Companies/schema.js +0 -2
- package/build/cjs/blocks/ContentLayout/schema.d.ts +0 -6
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +0 -7
- package/build/cjs/blocks/ExtendedFeatures/schema.js +1 -4
- package/build/cjs/blocks/Header/schema.d.ts +0 -16
- package/build/cjs/blocks/Header/schema.js +0 -5
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -11
- package/build/cjs/blocks/Icons/schema.d.ts +0 -6
- package/build/cjs/blocks/Icons/schema.js +0 -2
- package/build/cjs/blocks/Info/schema.d.ts +0 -10
- package/build/cjs/blocks/Info/schema.js +0 -2
- package/build/cjs/blocks/LinkTable/schema.d.ts +0 -2
- package/build/cjs/blocks/Media/schema.d.ts +0 -9
- package/build/cjs/blocks/Media/schema.js +1 -3
- package/build/cjs/blocks/Preview/schema.d.ts +0 -2
- package/build/cjs/blocks/Preview/schema.js +0 -4
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +0 -7
- package/build/cjs/blocks/PromoFeaturesBlock/schema.js +1 -4
- package/build/cjs/blocks/Questions/schema.d.ts +0 -5
- package/build/cjs/blocks/Questions/schema.js +0 -2
- package/build/cjs/blocks/Security/schema.d.ts +0 -2
- package/build/cjs/blocks/Security/schema.js +0 -2
- package/build/cjs/blocks/Simple/schema.d.ts +0 -3
- package/build/cjs/blocks/Simple/schema.js +0 -1
- package/build/cjs/blocks/Slider/schema.d.ts +0 -7
- package/build/cjs/blocks/Slider/schema.js +0 -2
- package/build/cjs/blocks/Table/schema.d.ts +0 -4
- package/build/cjs/blocks/Table/schema.js +0 -3
- package/build/cjs/blocks/Tabs/schema.d.ts +0 -8
- package/build/cjs/blocks/Tabs/schema.js +0 -4
- package/build/cjs/components/Author/schema.d.ts +0 -3
- package/build/cjs/components/Image/schema.d.ts +0 -2
- package/build/cjs/components/Image/schema.js +0 -2
- package/build/cjs/components/OverflowScroller/OverflowScroller.css +2 -0
- package/build/cjs/components/RouterLink/RouterLink.d.ts +1 -0
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +40 -39
- package/build/cjs/components/navigation/components/Header/Header.css +85 -0
- package/build/cjs/components/navigation/components/Header/Header.d.ts +8 -0
- package/build/cjs/components/navigation/components/Header/Header.js +55 -0
- package/build/cjs/components/navigation/components/Logo/Logo.css +23 -0
- package/build/cjs/components/navigation/components/Logo/Logo.d.ts +7 -0
- package/build/cjs/components/navigation/components/Logo/Logo.js +17 -0
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.css +64 -0
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +13 -0
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.js +45 -0
- package/build/cjs/components/navigation/components/Navigation/Navigation.css +43 -0
- package/build/cjs/components/navigation/components/Navigation/Navigation.d.ts +18 -0
- package/build/cjs/components/navigation/components/Navigation/Navigation.js +69 -0
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.css +40 -0
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.d.ts +10 -0
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.js +59 -0
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.css +33 -0
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +10 -0
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.js +45 -0
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.css +20 -0
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.d.ts +7 -0
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.js +14 -0
- package/build/cjs/components/navigation/components/index.d.ts +7 -0
- package/build/cjs/components/navigation/components/index.js +20 -0
- package/build/cjs/components/navigation/containers/Layout/Layout.css +10 -0
- package/build/cjs/components/navigation/containers/Layout/Layout.d.ts +8 -0
- package/build/cjs/components/navigation/containers/Layout/Layout.js +11 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +3 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.js +12 -10
- package/build/cjs/context/locationContext/locationContext.d.ts +1 -0
- package/build/cjs/icons/NavigationArrow.d.ts +2 -0
- package/build/cjs/icons/NavigationArrow.js +9 -0
- package/build/cjs/icons/NavigationClose.d.ts +2 -0
- package/build/cjs/icons/NavigationClose.js +9 -0
- package/build/cjs/icons/NavigationOpen.d.ts +2 -0
- package/build/cjs/icons/NavigationOpen.js +11 -0
- package/build/cjs/icons/index.d.ts +3 -0
- package/build/cjs/icons/index.js +3 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +2 -4
- package/build/cjs/models/index.d.ts +1 -0
- package/build/cjs/models/index.js +1 -0
- package/build/cjs/models/navigation.d.ts +62 -0
- package/build/cjs/models/navigation.js +10 -0
- package/build/cjs/schema/index.d.ts +0 -2
- package/build/cjs/schema/validators/common.d.ts +0 -17
- package/build/cjs/schema/validators/common.js +0 -11
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +0 -5
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +0 -4
- package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +0 -8
- package/build/cjs/sub-blocks/CardWithImage/schema.js +1 -4
- package/build/cjs/sub-blocks/Content/schema.d.ts +0 -8
- package/build/cjs/sub-blocks/Content/schema.js +1 -3
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +0 -1
- package/build/cjs/sub-blocks/NewsCard/schema.d.ts +0 -1
- package/build/cjs/sub-blocks/NewsCard/schema.js +0 -1
- package/build/cjs/sub-blocks/Partner/schema.d.ts +0 -1
- package/build/cjs/sub-blocks/Partner/schema.js +0 -1
- package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +0 -1
- package/build/cjs/sub-blocks/PriceDetailed/schema.js +0 -8
- package/build/cjs/sub-blocks/Quote/schema.d.ts +0 -4
- package/build/cjs/sub-blocks/Quote/schema.js +0 -1
- package/build/cjs/sub-blocks/TutorialCard/schema.d.ts +0 -2
- package/build/cjs/sub-blocks/TutorialCard/schema.js +0 -2
- package/build/cjs/text-transform/blocks.js +0 -1
- package/build/esm/blocks/Banner/schema.d.ts +0 -12
- package/build/esm/blocks/Banner/schema.js +0 -2
- package/build/esm/blocks/CardLayout/schema.d.ts +0 -8
- package/build/esm/blocks/CardLayout/schema.js +1 -2
- package/build/esm/blocks/Companies/schema.d.ts +0 -2
- package/build/esm/blocks/Companies/schema.js +0 -2
- package/build/esm/blocks/ContentLayout/schema.d.ts +0 -6
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +0 -7
- package/build/esm/blocks/ExtendedFeatures/schema.js +1 -4
- package/build/esm/blocks/Header/schema.d.ts +0 -16
- package/build/esm/blocks/Header/schema.js +0 -5
- package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -11
- package/build/esm/blocks/Icons/schema.d.ts +0 -6
- package/build/esm/blocks/Icons/schema.js +0 -2
- package/build/esm/blocks/Info/schema.d.ts +0 -10
- package/build/esm/blocks/Info/schema.js +0 -2
- package/build/esm/blocks/LinkTable/schema.d.ts +0 -2
- package/build/esm/blocks/Media/schema.d.ts +0 -9
- package/build/esm/blocks/Media/schema.js +1 -3
- package/build/esm/blocks/Preview/schema.d.ts +0 -2
- package/build/esm/blocks/Preview/schema.js +0 -4
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +0 -7
- package/build/esm/blocks/PromoFeaturesBlock/schema.js +1 -4
- package/build/esm/blocks/Questions/schema.d.ts +0 -5
- package/build/esm/blocks/Questions/schema.js +0 -2
- package/build/esm/blocks/Security/schema.d.ts +0 -2
- package/build/esm/blocks/Security/schema.js +0 -2
- package/build/esm/blocks/Simple/schema.d.ts +0 -3
- package/build/esm/blocks/Simple/schema.js +0 -1
- package/build/esm/blocks/Slider/schema.d.ts +0 -7
- package/build/esm/blocks/Slider/schema.js +0 -2
- package/build/esm/blocks/Table/schema.d.ts +0 -4
- package/build/esm/blocks/Table/schema.js +0 -3
- package/build/esm/blocks/Tabs/schema.d.ts +0 -8
- package/build/esm/blocks/Tabs/schema.js +0 -4
- package/build/esm/components/Author/schema.d.ts +0 -3
- package/build/esm/components/Image/schema.d.ts +0 -2
- package/build/esm/components/Image/schema.js +0 -2
- package/build/esm/components/OverflowScroller/OverflowScroller.css +2 -0
- package/build/esm/components/RouterLink/RouterLink.d.ts +1 -0
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +2 -0
- package/build/esm/components/navigation/components/Header/Header.css +85 -0
- package/build/esm/components/navigation/components/Header/Header.d.ts +9 -0
- package/build/esm/components/navigation/components/Header/Header.js +51 -0
- package/build/esm/components/navigation/components/Logo/Logo.css +23 -0
- package/build/esm/components/navigation/components/Logo/Logo.d.ts +8 -0
- package/build/esm/components/navigation/components/Logo/Logo.js +15 -0
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.css +64 -0
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +14 -0
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.js +43 -0
- package/build/esm/components/navigation/components/Navigation/Navigation.css +43 -0
- package/build/esm/components/navigation/components/Navigation/Navigation.d.ts +19 -0
- package/build/esm/components/navigation/components/Navigation/Navigation.js +68 -0
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.css +40 -0
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.d.ts +11 -0
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.js +58 -0
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.css +33 -0
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +11 -0
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.js +41 -0
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.css +20 -0
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.d.ts +8 -0
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.js +12 -0
- package/build/esm/components/navigation/components/index.d.ts +7 -0
- package/build/esm/components/navigation/components/index.js +7 -0
- package/build/esm/components/navigation/containers/Layout/Layout.css +10 -0
- package/build/esm/components/navigation/containers/Layout/Layout.d.ts +9 -0
- package/build/esm/components/navigation/containers/Layout/Layout.js +9 -0
- package/build/esm/containers/PageConstructor/PageConstructor.d.ts +3 -2
- package/build/esm/containers/PageConstructor/PageConstructor.js +12 -10
- package/build/esm/context/locationContext/locationContext.d.ts +1 -0
- package/build/esm/icons/NavigationArrow.d.ts +2 -0
- package/build/esm/icons/NavigationArrow.js +4 -0
- package/build/esm/icons/NavigationClose.d.ts +2 -0
- package/build/esm/icons/NavigationClose.js +4 -0
- package/build/esm/icons/NavigationOpen.d.ts +2 -0
- package/build/esm/icons/NavigationOpen.js +6 -0
- package/build/esm/icons/index.d.ts +3 -0
- package/build/esm/icons/index.js +3 -0
- package/build/esm/models/constructor-items/blocks.d.ts +2 -4
- package/build/esm/models/index.d.ts +1 -0
- package/build/esm/models/index.js +1 -0
- package/build/esm/models/navigation.d.ts +62 -0
- package/build/esm/models/navigation.js +7 -0
- package/build/esm/schema/index.d.ts +0 -2
- package/build/esm/schema/validators/common.d.ts +0 -17
- package/build/esm/schema/validators/common.js +0 -11
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +0 -5
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +0 -4
- package/build/esm/sub-blocks/CardWithImage/schema.d.ts +0 -8
- package/build/esm/sub-blocks/CardWithImage/schema.js +1 -4
- package/build/esm/sub-blocks/Content/schema.d.ts +0 -8
- package/build/esm/sub-blocks/Content/schema.js +1 -3
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +0 -1
- package/build/esm/sub-blocks/NewsCard/schema.d.ts +0 -1
- package/build/esm/sub-blocks/NewsCard/schema.js +0 -1
- package/build/esm/sub-blocks/Partner/schema.d.ts +0 -1
- package/build/esm/sub-blocks/Partner/schema.js +0 -1
- package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +0 -1
- package/build/esm/sub-blocks/PriceDetailed/schema.js +0 -8
- package/build/esm/sub-blocks/Quote/schema.d.ts +0 -4
- package/build/esm/sub-blocks/Quote/schema.js +0 -1
- package/build/esm/sub-blocks/TutorialCard/schema.d.ts +0 -2
- package/build/esm/sub-blocks/TutorialCard/schema.js +0 -2
- package/build/esm/text-transform/blocks.js +0 -1
- package/package.json +2 -5
- package/server/models/constructor-items/blocks.d.ts +2 -4
- package/server/models/index.d.ts +1 -0
- package/server/models/index.js +1 -0
- package/server/models/navigation.d.ts +62 -0
- package/server/models/navigation.js +10 -0
- package/server/text-transform/blocks.js +0 -1
- package/styles/mixins.scss +38 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-navigation {
|
|
4
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
5
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
6
|
+
}
|
|
7
|
+
.pc-navigation__links {
|
|
8
|
+
position: relative;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
list-style: none;
|
|
14
|
+
}
|
|
15
|
+
.pc-navigation__links-item {
|
|
16
|
+
position: relative;
|
|
17
|
+
height: var(--header-height);
|
|
18
|
+
line-height: var(--header-height);
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
outline: none;
|
|
21
|
+
color: inherit;
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
}
|
|
24
|
+
.utilityfocus .pc-navigation__links-item:focus {
|
|
25
|
+
outline: 2px solid #ffdb4d;
|
|
26
|
+
}
|
|
27
|
+
.pc-navigation__links-item:hover, .pc-navigation__links-item:active {
|
|
28
|
+
color: var(--yc-color-text-link);
|
|
29
|
+
}
|
|
30
|
+
.pc-navigation__links-item:not(:last-child) {
|
|
31
|
+
margin-right: 20px;
|
|
32
|
+
}
|
|
33
|
+
.pc-navigation__slider-container {
|
|
34
|
+
position: absolute;
|
|
35
|
+
right: 0;
|
|
36
|
+
bottom: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
}
|
|
39
|
+
.pc-navigation__slider {
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 2px;
|
|
42
|
+
background-color: var(--yc-color-text-link);
|
|
43
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { MouseEventHandler } from 'react';
|
|
2
|
+
import { NavigationDropdownItem, NavigationItem as NavigationItemModel } from '../../../../models/navigation';
|
|
3
|
+
export interface NavigationProps {
|
|
4
|
+
links: NavigationItemModel[];
|
|
5
|
+
activeItemIndex: number;
|
|
6
|
+
onActiveItemChange: (index: number) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
highlightActiveItem?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface NavigationDropdownProps {
|
|
11
|
+
data: NavigationDropdownItem;
|
|
12
|
+
onClick: MouseEventHandler;
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
position: number;
|
|
15
|
+
hidePopup: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Navigation: React.FC<NavigationProps>;
|
|
18
|
+
export default Navigation;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
|
|
5
|
+
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
6
|
+
const utils_1 = require("../../../../utils");
|
|
7
|
+
const OverflowScroller_1 = (0, tslib_1.__importDefault)(require("../../../OverflowScroller/OverflowScroller"));
|
|
8
|
+
const navigation_1 = require("../../../../models/navigation");
|
|
9
|
+
const NavigationPopup_1 = (0, tslib_1.__importDefault)(require("../NavigationPopup/NavigationPopup"));
|
|
10
|
+
const NavigationItem_1 = (0, tslib_1.__importDefault)(require("../NavigationItem/NavigationItem"));
|
|
11
|
+
const locationContext_1 = require("../../../../context/locationContext");
|
|
12
|
+
const b = (0, utils_1.block)('navigation');
|
|
13
|
+
const NavigationDropdown = ({ data, isActive, position, hidePopup, onClick, }) => {
|
|
14
|
+
const { text, items } = data, popupProps = (0, tslib_1.__rest)(data, ["text", "items"]);
|
|
15
|
+
return (react_1.default.createElement(react_1.Fragment, null,
|
|
16
|
+
react_1.default.createElement(NavigationItem_1.default, { className: b('link'), onClick: onClick, isOpened: isActive, data: { text, type: navigation_1.NavigationItemType.Dropdown } }),
|
|
17
|
+
isActive && (react_1.default.createElement(NavigationPopup_1.default, Object.assign({ left: position, onClose: hidePopup, items: items }, popupProps)))));
|
|
18
|
+
};
|
|
19
|
+
const Navigation = ({ className, onActiveItemChange, links, activeItemIndex, highlightActiveItem, }) => {
|
|
20
|
+
const { asPath, pathname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
21
|
+
const itemRefs = (0, react_1.useRef)([]);
|
|
22
|
+
const [itemPositions, setItemPosition] = (0, react_1.useState)([]);
|
|
23
|
+
const [lastLeftScroll, setLastLeftScroll] = (0, react_1.useState)(0);
|
|
24
|
+
const hidePopup = (0, react_1.useCallback)(() => {
|
|
25
|
+
onActiveItemChange(-1);
|
|
26
|
+
}, [onActiveItemChange]);
|
|
27
|
+
const getItemClickHandler = (0, react_1.useCallback)((index) => (e) => {
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
onActiveItemChange(index === activeItemIndex ? -1 : index);
|
|
30
|
+
}, [activeItemIndex, onActiveItemChange]);
|
|
31
|
+
const calculateItemPositions = (0, react_1.useCallback)(() => {
|
|
32
|
+
if (itemRefs.current.length) {
|
|
33
|
+
const currentItemPositions = itemRefs.current.map((itemRef) => (itemRef && itemRef.getBoundingClientRect().left) || 0);
|
|
34
|
+
setItemPosition(currentItemPositions);
|
|
35
|
+
}
|
|
36
|
+
}, []);
|
|
37
|
+
(0, react_1.useEffect)(() => {
|
|
38
|
+
const debouncedCalculateItemPositions = lodash_1.default.debounce(calculateItemPositions, 100);
|
|
39
|
+
const calculateOnScroll = lodash_1.default.debounce(() => {
|
|
40
|
+
const curLeftScroll = window.pageXOffset;
|
|
41
|
+
if (curLeftScroll !== lastLeftScroll) {
|
|
42
|
+
setLastLeftScroll(window.pageXOffset);
|
|
43
|
+
calculateItemPositions();
|
|
44
|
+
}
|
|
45
|
+
}, 100);
|
|
46
|
+
calculateItemPositions();
|
|
47
|
+
setLastLeftScroll(window.pageXOffset);
|
|
48
|
+
window.addEventListener('resize', debouncedCalculateItemPositions);
|
|
49
|
+
window.addEventListener('scroll', calculateOnScroll);
|
|
50
|
+
return () => {
|
|
51
|
+
window.removeEventListener(`resize`, calculateItemPositions);
|
|
52
|
+
window.removeEventListener('scroll', calculateOnScroll);
|
|
53
|
+
};
|
|
54
|
+
}, [calculateItemPositions, itemRefs, lastLeftScroll]);
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
|
+
hidePopup();
|
|
57
|
+
}, [hidePopup, asPath, pathname]);
|
|
58
|
+
return (react_1.default.createElement(OverflowScroller_1.default, { className: b(null, className), onScrollStart: hidePopup, onScrollEnd: calculateItemPositions },
|
|
59
|
+
react_1.default.createElement("nav", null,
|
|
60
|
+
react_1.default.createElement("ul", { className: b('links') }, links.map((link, index) => {
|
|
61
|
+
const isActive = index === activeItemIndex;
|
|
62
|
+
const onClick = getItemClickHandler(index);
|
|
63
|
+
return (react_1.default.createElement("li", { ref: (el) => itemRefs.current.push(el), key: index, className: b('links-item') },
|
|
64
|
+
link.type === navigation_1.NavigationItemType.Dropdown ? (react_1.default.createElement(NavigationDropdown, { data: link, onClick: onClick, isActive: isActive, position: itemPositions[index], hidePopup: hidePopup })) : (react_1.default.createElement(NavigationItem_1.default, { data: link, onClick: onClick })),
|
|
65
|
+
highlightActiveItem && isActive && (react_1.default.createElement("div", { className: b('slider-container') },
|
|
66
|
+
react_1.default.createElement("div", { className: b('slider') })))));
|
|
67
|
+
})))));
|
|
68
|
+
};
|
|
69
|
+
exports.default = Navigation;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-navigation-item {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
}
|
|
8
|
+
.pc-navigation-item_type_link {
|
|
9
|
+
color: var(--yc-color-text-primary);
|
|
10
|
+
color: inherit;
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
outline: none;
|
|
13
|
+
}
|
|
14
|
+
.utilityfocus .pc-navigation-item_type_link:focus {
|
|
15
|
+
outline: 2px solid #ffdb4d;
|
|
16
|
+
}
|
|
17
|
+
.pc-navigation-item_type_link:hover, .pc-navigation-item_type_link_active {
|
|
18
|
+
color: var(--yc-color-text-link);
|
|
19
|
+
}
|
|
20
|
+
.pc-navigation-item_type_button {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
}
|
|
23
|
+
.pc-navigation-item__arrow {
|
|
24
|
+
position: relative;
|
|
25
|
+
top: -2px;
|
|
26
|
+
width: 9px;
|
|
27
|
+
height: 9px;
|
|
28
|
+
margin-left: 5px;
|
|
29
|
+
}
|
|
30
|
+
.pc-navigation-item__icon {
|
|
31
|
+
display: flex;
|
|
32
|
+
width: 20px;
|
|
33
|
+
height: 20px;
|
|
34
|
+
margin-right: 8px;
|
|
35
|
+
object-fit: cover;
|
|
36
|
+
}
|
|
37
|
+
.pc-navigation-item__dropdown {
|
|
38
|
+
margin-left: 7px;
|
|
39
|
+
color: var(--yc-color-text-secondary);
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { MouseEventHandler } from 'react';
|
|
2
|
+
import { NavigationItemData } from '../../../../models';
|
|
3
|
+
export interface NavigationItemProps {
|
|
4
|
+
data: NavigationItemData;
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: MouseEventHandler;
|
|
7
|
+
isOpened?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const NavigationItem: React.FC<NavigationItemProps>;
|
|
10
|
+
export default NavigationItem;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
5
|
+
const utils_1 = require("../../../../utils");
|
|
6
|
+
const index_1 = require("../../../index");
|
|
7
|
+
const locationContext_1 = require("../../../../context/locationContext");
|
|
8
|
+
const models_1 = require("../../../../models");
|
|
9
|
+
const icons_1 = require("../../../../icons");
|
|
10
|
+
const SocialIcon_1 = (0, tslib_1.__importDefault)(require("../SocialIcon/SocialIcon"));
|
|
11
|
+
const utils_2 = require("../../../Media/Image/utils");
|
|
12
|
+
const b = (0, utils_1.block)('navigation-item');
|
|
13
|
+
const Content = ({ text, icon }) => (react_1.default.createElement(react_1.Fragment, null,
|
|
14
|
+
icon && react_1.default.createElement(index_1.Image, Object.assign({ className: b('icon') }, icon)),
|
|
15
|
+
react_1.default.createElement("span", { className: b('text') }, text)));
|
|
16
|
+
const NavigationDropdown = (_a) => {
|
|
17
|
+
var { text, icon, isOpened } = _a, props = (0, tslib_1.__rest)(_a, ["text", "icon", "isOpened"]);
|
|
18
|
+
const iconData = icon && (0, utils_2.getMediaImage)(icon);
|
|
19
|
+
return (react_1.default.createElement("span", Object.assign({}, props),
|
|
20
|
+
react_1.default.createElement(Content, { text: text, icon: iconData }),
|
|
21
|
+
react_1.default.createElement(index_1.ToggleArrow, { className: b('dropdown'), size: 12, type: 'vertical', iconType: "navigation", open: isOpened })));
|
|
22
|
+
};
|
|
23
|
+
const NavigationLink = (props) => {
|
|
24
|
+
const { hostname, Link } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
25
|
+
const { url, text, icon, arrow, target } = props, rest = (0, tslib_1.__rest)(props, ["url", "text", "icon", "arrow", "target"]);
|
|
26
|
+
const linkExtraProps = (0, utils_1.getLinkProps)(url, hostname, target);
|
|
27
|
+
const iconData = icon && (0, utils_2.getMediaImage)(icon);
|
|
28
|
+
const content = (react_1.default.createElement(react_1.Fragment, null,
|
|
29
|
+
react_1.default.createElement(Content, { text: text, icon: iconData }),
|
|
30
|
+
arrow && react_1.default.createElement(icons_1.NavigationArrow, { className: b('arrow') })));
|
|
31
|
+
if ((linkExtraProps === null || linkExtraProps === void 0 ? void 0 : linkExtraProps.target) || !Link) {
|
|
32
|
+
return (react_1.default.createElement("a", Object.assign({ href: url, title: text }, rest, linkExtraProps), content));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return (react_1.default.createElement(index_1.RouterLink, { href: url, passHref: true },
|
|
36
|
+
react_1.default.createElement("a", Object.assign({}, rest), content)));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const NavigationButton = (props) => {
|
|
40
|
+
const { url, target } = props;
|
|
41
|
+
return target ? (react_1.default.createElement(index_1.Button, Object.assign({}, props, { url: url }))) : (react_1.default.createElement(index_1.RouterLink, { href: url },
|
|
42
|
+
react_1.default.createElement(index_1.Button, Object.assign({}, props, { url: url }))));
|
|
43
|
+
};
|
|
44
|
+
//todo: add types support form component in map
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
const NavigationItemsMap = {
|
|
47
|
+
[models_1.NavigationItemType.Button]: NavigationButton,
|
|
48
|
+
[models_1.NavigationItemType.Social]: SocialIcon_1.default,
|
|
49
|
+
[models_1.NavigationItemType.Dropdown]: NavigationDropdown,
|
|
50
|
+
[models_1.NavigationItemType.Link]: NavigationLink,
|
|
51
|
+
};
|
|
52
|
+
const NavigationItem = (_a) => {
|
|
53
|
+
var { data, className } = _a, props = (0, tslib_1.__rest)(_a, ["data", "className"]);
|
|
54
|
+
const { type = models_1.NavigationItemType.Link } = data;
|
|
55
|
+
const Component = NavigationItemsMap[type];
|
|
56
|
+
const componentProps = (0, react_1.useMemo)(() => (Object.assign(Object.assign({ className: b({ type }, className) }, data), props)), [className, data, props, type]);
|
|
57
|
+
return react_1.default.createElement(Component, Object.assign({}, componentProps));
|
|
58
|
+
};
|
|
59
|
+
exports.default = NavigationItem;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-navigation-popup {
|
|
4
|
+
position: fixed;
|
|
5
|
+
top: calc(var(--header-height) - 16px);
|
|
6
|
+
padding-right: 4px;
|
|
7
|
+
padding-left: 4px;
|
|
8
|
+
transform: translateX(calc(calc(8px * 2) * -1));
|
|
9
|
+
z-index: 101;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
min-width: 220px;
|
|
13
|
+
padding: 16px;
|
|
14
|
+
border: 1px solid var(--yc-color-line-generic);
|
|
15
|
+
border-top-width: 0;
|
|
16
|
+
border-radius: calc(var(--pc-border-radius) / 2);
|
|
17
|
+
background: var(--yc-color-base-float);
|
|
18
|
+
box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
|
|
19
|
+
}
|
|
20
|
+
@media (max-width: 768px) {
|
|
21
|
+
.pc-navigation-popup {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.pc-navigation-popup__link {
|
|
26
|
+
height: 36px;
|
|
27
|
+
padding: 8px 12px;
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
}
|
|
30
|
+
.pc-navigation-popup__link:hover {
|
|
31
|
+
color: var(--yc-color-text-primary);
|
|
32
|
+
background-color: var(--yc-color-base-simple-hover);
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationLinkItem } from '../../../../models';
|
|
3
|
+
export interface NavigationPopupProps {
|
|
4
|
+
items: NavigationLinkItem[];
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
left?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const NavigationPopup: React.FC<NavigationPopupProps>;
|
|
10
|
+
export default NavigationPopup;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationPopup = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
|
|
6
|
+
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
7
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
|
+
const utils_1 = require("../../../../utils");
|
|
9
|
+
const index_1 = require("../../../index");
|
|
10
|
+
const NavigationItem_1 = (0, tslib_1.__importDefault)(require("../NavigationItem/NavigationItem"));
|
|
11
|
+
const b = (0, utils_1.block)('navigation-popup');
|
|
12
|
+
const NavigationPopup = ({ items, left, onClose }) => {
|
|
13
|
+
const [calculatedLeft, setCalculatedLeft] = (0, react_1.useState)(left);
|
|
14
|
+
const popupRef = (0, react_1.useRef)(null);
|
|
15
|
+
const calculateLeft = (0, react_1.useCallback)(() => {
|
|
16
|
+
if (popupRef && popupRef.current && left) {
|
|
17
|
+
const right = left + popupRef.current.offsetWidth;
|
|
18
|
+
const docWidth = document.body.clientWidth;
|
|
19
|
+
const currentLeft = right > docWidth ? left - (right - docWidth) : left;
|
|
20
|
+
setCalculatedLeft(currentLeft);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
setCalculatedLeft(left);
|
|
24
|
+
}
|
|
25
|
+
}, [left]);
|
|
26
|
+
(0, react_1.useEffect)(() => {
|
|
27
|
+
const debounceCalculateLeft = lodash_1.default.debounce(calculateLeft, 100);
|
|
28
|
+
calculateLeft();
|
|
29
|
+
window.addEventListener('resize', debounceCalculateLeft);
|
|
30
|
+
return () => {
|
|
31
|
+
window.removeEventListener('resize', debounceCalculateLeft);
|
|
32
|
+
};
|
|
33
|
+
}, [calculateLeft]);
|
|
34
|
+
(0, react_1.useEffect)(() => {
|
|
35
|
+
calculateLeft();
|
|
36
|
+
}, [calculateLeft, left]);
|
|
37
|
+
if (!document || !document.body) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return (react_1.default.createElement(uikit_1.Portal, null,
|
|
41
|
+
react_1.default.createElement("div", { ref: popupRef, className: b(), style: { left: calculatedLeft } },
|
|
42
|
+
react_1.default.createElement(index_1.OutsideClick, { onOutsideClick: onClose }, items.map((item) => (react_1.default.createElement(NavigationItem_1.default, { key: item.text, className: b('link'), data: item })))))));
|
|
43
|
+
};
|
|
44
|
+
exports.NavigationPopup = NavigationPopup;
|
|
45
|
+
exports.default = exports.NavigationPopup;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-social-icon {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: 40px;
|
|
8
|
+
height: 40px;
|
|
9
|
+
margin-right: 8px;
|
|
10
|
+
color: var(--yc-color-base-background);
|
|
11
|
+
border-radius: 50%;
|
|
12
|
+
background-color: var(--yc-color-base-generic);
|
|
13
|
+
}
|
|
14
|
+
.pc-social-icon:hover {
|
|
15
|
+
background-color: var(--yc-color-base-generic-hover);
|
|
16
|
+
}
|
|
17
|
+
.pc-social-icon__icon {
|
|
18
|
+
width: 16px;
|
|
19
|
+
height: 16px;
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationSocialItem } from '../../../../models';
|
|
3
|
+
export interface NavigationSocialItemProps extends NavigationSocialItem {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const SocialIcon: React.FC<NavigationSocialItemProps>;
|
|
7
|
+
export default SocialIcon;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
5
|
+
const utils_1 = require("../../../../utils");
|
|
6
|
+
const index_1 = require("../../../index");
|
|
7
|
+
const utils_2 = require("../../../Media/Image/utils");
|
|
8
|
+
const b = (0, utils_1.block)('social-icon');
|
|
9
|
+
const SocialIcon = ({ icon, url, className }) => {
|
|
10
|
+
const iconData = (0, utils_2.getMediaImage)(icon);
|
|
11
|
+
return (react_1.default.createElement("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: b(null, className) },
|
|
12
|
+
react_1.default.createElement(index_1.Image, Object.assign({ className: b('icon') }, iconData))));
|
|
13
|
+
};
|
|
14
|
+
exports.default = SocialIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Header } from './Header/Header';
|
|
2
|
+
export { default as NavigationItem } from './NavigationItem/NavigationItem';
|
|
3
|
+
export { default as Logo } from './Logo/Logo';
|
|
4
|
+
export { default as MobileNavigation } from './MobileNavigation/MobileNavigation';
|
|
5
|
+
export { default as Navigation } from './Navigation/Navigation';
|
|
6
|
+
export { default as NavigationPopup } from './NavigationPopup/NavigationPopup';
|
|
7
|
+
export { default as SocialIcon } from './SocialIcon/SocialIcon';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SocialIcon = exports.NavigationPopup = exports.Navigation = exports.MobileNavigation = exports.Logo = exports.NavigationItem = exports.Header = void 0;
|
|
7
|
+
var Header_1 = require("./Header/Header");
|
|
8
|
+
Object.defineProperty(exports, "Header", { enumerable: true, get: function () { return __importDefault(Header_1).default; } });
|
|
9
|
+
var NavigationItem_1 = require("./NavigationItem/NavigationItem");
|
|
10
|
+
Object.defineProperty(exports, "NavigationItem", { enumerable: true, get: function () { return __importDefault(NavigationItem_1).default; } });
|
|
11
|
+
var Logo_1 = require("./Logo/Logo");
|
|
12
|
+
Object.defineProperty(exports, "Logo", { enumerable: true, get: function () { return __importDefault(Logo_1).default; } });
|
|
13
|
+
var MobileNavigation_1 = require("./MobileNavigation/MobileNavigation");
|
|
14
|
+
Object.defineProperty(exports, "MobileNavigation", { enumerable: true, get: function () { return __importDefault(MobileNavigation_1).default; } });
|
|
15
|
+
var Navigation_1 = require("./Navigation/Navigation");
|
|
16
|
+
Object.defineProperty(exports, "Navigation", { enumerable: true, get: function () { return __importDefault(Navigation_1).default; } });
|
|
17
|
+
var NavigationPopup_1 = require("./NavigationPopup/NavigationPopup");
|
|
18
|
+
Object.defineProperty(exports, "NavigationPopup", { enumerable: true, get: function () { return __importDefault(NavigationPopup_1).default; } });
|
|
19
|
+
var SocialIcon_1 = require("./SocialIcon/SocialIcon");
|
|
20
|
+
Object.defineProperty(exports, "SocialIcon", { enumerable: true, get: function () { return __importDefault(SocialIcon_1).default; } });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
5
|
+
const utils_1 = require("../../../../utils");
|
|
6
|
+
const Header_1 = (0, tslib_1.__importDefault)(require("../../components/Header/Header"));
|
|
7
|
+
const b = (0, utils_1.block)('layout');
|
|
8
|
+
const Layout = ({ children, navigation }) => (react_1.default.createElement("div", { className: b() },
|
|
9
|
+
navigation && react_1.default.createElement(Header_1.default, { data: navigation.header, logo: navigation.logo }),
|
|
10
|
+
react_1.default.createElement("main", { className: b('content') }, children)));
|
|
11
|
+
exports.default = Layout;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems } from '../../models';
|
|
3
|
-
import { blockMap, subBlockMap } from '../../constructor-items';
|
|
4
2
|
import '@doc-tools/transform/dist/js/yfm';
|
|
3
|
+
import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems, NavigationData } from '../../models';
|
|
4
|
+
import { blockMap, subBlockMap } from '../../constructor-items';
|
|
5
5
|
export declare type ItemMap = typeof blockMap & typeof subBlockMap & CustomItems;
|
|
6
6
|
export interface PageConstructorProps {
|
|
7
7
|
content?: PageContent;
|
|
8
8
|
shouldRenderBlock?: ShouldRenderBlock;
|
|
9
9
|
custom?: CustomConfig;
|
|
10
10
|
renderMenu?: () => React.ReactNode;
|
|
11
|
+
navigation?: NavigationData;
|
|
11
12
|
}
|
|
12
13
|
export declare const Constructor: (props: PageConstructorProps) => JSX.Element;
|
|
13
14
|
export declare const PageConstructor: (props: PageConstructorProps) => JSX.Element;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PageConstructor = exports.Constructor = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
6
|
+
require("@doc-tools/transform/dist/js/yfm");
|
|
6
7
|
const models_1 = require("../../models");
|
|
7
8
|
const constructor_items_1 = require("../../constructor-items");
|
|
8
9
|
const grid_1 = require("../../grid");
|
|
@@ -15,7 +16,7 @@ const ConstructorRow_1 = require("./components/ConstructorRow");
|
|
|
15
16
|
const ConstructorFootnotes_1 = require("./components/ConstructorFootnotes");
|
|
16
17
|
const ConstructorItem_1 = require("./components/ConstructorItem");
|
|
17
18
|
const ConstructorBlocks_1 = require("./components/ConstructorBlocks");
|
|
18
|
-
require("
|
|
19
|
+
const Layout_1 = (0, tslib_1.__importDefault)(require("../../components/navigation/containers/Layout/Layout"));
|
|
19
20
|
const b = (0, utils_1.block)('page-constructor');
|
|
20
21
|
const Constructor = (props) => {
|
|
21
22
|
const { context, headerBlockTypes } = (0, react_1.useMemo)(() => {
|
|
@@ -30,7 +31,7 @@ const Constructor = (props) => {
|
|
|
30
31
|
});
|
|
31
32
|
}, [props.custom]);
|
|
32
33
|
const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
|
|
33
|
-
const { content: { blocks = [], background = {}, footnotes = [] } = {}, renderMenu, shouldRenderBlock, } = props;
|
|
34
|
+
const { content: { blocks = [], background = {}, footnotes = [] } = {}, renderMenu, shouldRenderBlock, navigation, } = props;
|
|
34
35
|
const hasFootnotes = footnotes.length > 0;
|
|
35
36
|
const isHeaderBlock = (block) => headerBlockTypes.includes(block.type);
|
|
36
37
|
const header = blocks === null || blocks === void 0 ? void 0 : blocks.find(isHeaderBlock);
|
|
@@ -39,14 +40,15 @@ const Constructor = (props) => {
|
|
|
39
40
|
return (react_1.default.createElement(innerContext_1.InnerContext.Provider, { value: context },
|
|
40
41
|
react_1.default.createElement("div", { className: b() },
|
|
41
42
|
react_1.default.createElement("div", { className: b('wrapper') },
|
|
42
|
-
react_1.default.createElement(BackgroundMedia_1.default, Object.assign({}, themedBackground, { className: b('background') })),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
react_1.default.createElement(
|
|
48
|
-
|
|
49
|
-
react_1.default.createElement(
|
|
43
|
+
themedBackground && (react_1.default.createElement(BackgroundMedia_1.default, Object.assign({}, themedBackground, { className: b('background') }))),
|
|
44
|
+
react_1.default.createElement(Layout_1.default, { navigation: navigation },
|
|
45
|
+
renderMenu && renderMenu(),
|
|
46
|
+
header && react_1.default.createElement(ConstructorItem_1.ConstructorHeader, { data: header }),
|
|
47
|
+
react_1.default.createElement(grid_1.Grid, null,
|
|
48
|
+
restBlocks && (react_1.default.createElement(ConstructorRow_1.ConstructorRow, null,
|
|
49
|
+
react_1.default.createElement(ConstructorBlocks_1.ConstructorBlocks, { items: restBlocks, shouldRenderBlock: shouldRenderBlock }))),
|
|
50
|
+
hasFootnotes && (react_1.default.createElement(ConstructorRow_1.ConstructorRow, null,
|
|
51
|
+
react_1.default.createElement(ConstructorFootnotes_1.ConstructorFootnotes, { items: footnotes })))))))));
|
|
50
52
|
};
|
|
51
53
|
exports.Constructor = Constructor;
|
|
52
54
|
const PageConstructor = (props) => {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationArrow = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
|
+
const svg_1 = require("../utils/svg");
|
|
7
|
+
const NavigationArrow = (props) => (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "9", height: "9", fill: "none", viewBox: "0 0 9 9" }, svg_1.a11yHiddenSvgProps, props),
|
|
8
|
+
react_1.default.createElement("path", { d: "M3 1H8M8 1V6M8 1L1 8", stroke: "currentColor", strokeOpacity: "0.7", strokeWidth: "1.2", strokeLinecap: "square" })));
|
|
9
|
+
exports.NavigationArrow = NavigationArrow;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationClose = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
|
+
const svg_1 = require("../utils/svg");
|
|
7
|
+
const NavigationClose = (props) => (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "36", height: "36", fill: "none" }, svg_1.a11yHiddenSvgProps, props),
|
|
8
|
+
react_1.default.createElement("path", { d: "M26 10 10 26m16 0L10 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })));
|
|
9
|
+
exports.NavigationClose = NavigationClose;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationOpen = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
|
+
const svg_1 = require("../utils/svg");
|
|
7
|
+
const NavigationOpen = (props) => (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "36", height: "36", fill: "none" }, svg_1.a11yHiddenSvgProps, props),
|
|
8
|
+
react_1.default.createElement("rect", { x: "8", y: "10", width: "20", height: "2", rx: "1", fill: "currentColor" }),
|
|
9
|
+
react_1.default.createElement("rect", { x: "8", y: "17", width: "20", height: "2", rx: "1", fill: "currentColor" }),
|
|
10
|
+
react_1.default.createElement("rect", { x: "8", y: "24", width: "20", height: "2", rx: "1", fill: "currentColor" })));
|
|
11
|
+
exports.NavigationOpen = NavigationOpen;
|
package/build/cjs/icons/index.js
CHANGED
|
@@ -9,3 +9,6 @@ const tslib_1 = require("tslib");
|
|
|
9
9
|
(0, tslib_1.__exportStar)(require("./NavigationChevron"), exports);
|
|
10
10
|
(0, tslib_1.__exportStar)(require("./PlayVideo"), exports);
|
|
11
11
|
(0, tslib_1.__exportStar)(require("./PreviewClose"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./NavigationClose"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./NavigationOpen"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./NavigationArrow"), exports);
|
|
@@ -114,14 +114,12 @@ export interface SimpleBlockProps extends Animatable, Childable {
|
|
|
114
114
|
title: TitleBaseProps;
|
|
115
115
|
description: string;
|
|
116
116
|
}
|
|
117
|
-
export interface ExtendedFeaturesItem {
|
|
118
|
-
title
|
|
119
|
-
text?: string;
|
|
117
|
+
export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
|
|
118
|
+
title: string;
|
|
120
119
|
label?: string;
|
|
121
120
|
icon?: ThemedImage;
|
|
122
121
|
/** @deprecated **/
|
|
123
122
|
link?: LinkProps;
|
|
124
|
-
links?: LinkProps[];
|
|
125
123
|
}
|
|
126
124
|
export interface ExtendedFeaturesProps extends Animatable {
|
|
127
125
|
items: ExtendedFeaturesItem[];
|
|
@@ -7,3 +7,4 @@ const tslib_1 = require("tslib");
|
|
|
7
7
|
(0, tslib_1.__exportStar)(require("./components"), exports);
|
|
8
8
|
(0, tslib_1.__exportStar)(require("./guards"), exports);
|
|
9
9
|
(0, tslib_1.__exportStar)(require("./react"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./navigation"), exports);
|