@gravity-ui/page-constructor 1.7.0-alpha.7 → 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.
- package/README.md +58 -36
- package/build/cjs/blocks/Tabs/Tabs.css +23 -49
- package/build/cjs/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/cjs/blocks/Tabs/Tabs.js +27 -29
- package/build/cjs/components/Image/Image.js +1 -3
- package/build/cjs/components/OverflowScroller/OverflowScroller.css +2 -0
- package/build/cjs/components/RouterLink/RouterLink.d.ts +1 -0
- package/build/cjs/components/VideoBlock/VideoBlock.js +1 -1
- 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 +51 -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 +58 -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 +41 -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/constructor-items.d.ts +1 -1
- 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 +4 -7
- 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/text-transform/blocks.js +4 -11
- package/build/cjs/text-transform/utils.js +1 -1
- package/build/esm/blocks/Tabs/Tabs.css +23 -49
- package/build/esm/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/esm/blocks/Tabs/Tabs.js +27 -29
- package/build/esm/components/Image/Image.d.ts +0 -1
- package/build/esm/components/Image/Image.js +1 -4
- package/build/esm/components/OverflowScroller/OverflowScroller.css +2 -0
- package/build/esm/components/RouterLink/RouterLink.d.ts +1 -0
- package/build/esm/components/VideoBlock/VideoBlock.js +1 -1
- 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 +47 -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 +58 -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 +41 -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/constructor-items.d.ts +1 -1
- 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 +4 -7
- 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/text-transform/blocks.js +4 -11
- package/build/esm/text-transform/utils.js +1 -1
- package/package.json +1 -4
- package/server/models/constructor-items/blocks.d.ts +4 -7
- 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 +4 -11
- package/server/text-transform/utils.js +1 -1
- package/styles/mixins.scss +38 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.css +0 -12
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +0 -13
- package/build/cjs/components/ButtonTabs/ButtonTabs.js +0 -27
- package/build/cjs/components/Image/Image.css +0 -3
- package/build/esm/components/ButtonTabs/ButtonTabs.css +0 -12
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +0 -14
- package/build/esm/components/ButtonTabs/ButtonTabs.js +0 -25
- package/build/esm/components/Image/Image.css +0 -3
|
@@ -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;
|
|
@@ -11,7 +11,7 @@ export declare const blockMap: {
|
|
|
11
11
|
"info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
|
|
12
12
|
"security-block": (props: import("./models").SecurityBlockProps) => JSX.Element;
|
|
13
13
|
"table-block": (props: import("./models").TableBlockProps) => JSX.Element;
|
|
14
|
-
"tabs-block": ({ items, title, description, animated
|
|
14
|
+
"tabs-block": ({ items, title, description, animated }: import("./models").TabsBlockProps) => JSX.Element;
|
|
15
15
|
"link-table-block": ({ items, title, description, linkTheme }: import("./models").LinkTableBlockProps) => JSX.Element;
|
|
16
16
|
"header-block": (props: import("./models").WithChildren<import("./models").HeaderBlockProps & import("./models").ClassNameProps>) => JSX.Element;
|
|
17
17
|
"icons-block": ({ title, size, items }: import("./models").IconsBlockProps) => JSX.Element;
|
|
@@ -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);
|
|
@@ -221,21 +221,18 @@ export interface TableBlockProps {
|
|
|
221
221
|
title: string;
|
|
222
222
|
table: TableProps;
|
|
223
223
|
}
|
|
224
|
-
export interface TabsBlockItem
|
|
224
|
+
export interface TabsBlockItem {
|
|
225
225
|
tabName: string;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
*/
|
|
226
|
+
title: string;
|
|
227
|
+
text: string;
|
|
229
228
|
link?: LinkProps;
|
|
230
229
|
image?: ThemedImage;
|
|
231
230
|
disableCompress?: boolean;
|
|
232
231
|
caption?: string;
|
|
233
232
|
media?: ThemedMediaProps;
|
|
233
|
+
links?: LinkProps[];
|
|
234
234
|
}
|
|
235
235
|
export interface TabsBlockProps extends BlockHeaderProps, Animatable {
|
|
236
|
-
tabsColSizes?: GridColumnSizesType;
|
|
237
|
-
centered?: boolean;
|
|
238
|
-
direction?: MediaDirection;
|
|
239
236
|
items: TabsBlockItem[];
|
|
240
237
|
}
|
|
241
238
|
export interface LinkTableBlockProps extends BlockHeaderProps {
|
|
@@ -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);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ImageProps, ButtonProps } from './constructor-items';
|
|
2
|
+
export declare enum NavigationItemType {
|
|
3
|
+
Link = "link",
|
|
4
|
+
Dropdown = "dropdown",
|
|
5
|
+
Button = "button",
|
|
6
|
+
Social = "social"
|
|
7
|
+
}
|
|
8
|
+
export interface NavigationItemBase {
|
|
9
|
+
text: string;
|
|
10
|
+
icon?: ImageProps;
|
|
11
|
+
url?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface NavigationLinkItem extends NavigationItemBase {
|
|
14
|
+
type: NavigationItemType.Link;
|
|
15
|
+
url: string;
|
|
16
|
+
arrow?: boolean;
|
|
17
|
+
target?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface NavigationButtonItem extends ButtonProps {
|
|
20
|
+
type: NavigationItemType.Button;
|
|
21
|
+
url: string;
|
|
22
|
+
target?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface NavigationDropdownItem extends NavigationItemBase {
|
|
25
|
+
type: NavigationItemType.Dropdown;
|
|
26
|
+
items: NavigationLinkItem[];
|
|
27
|
+
}
|
|
28
|
+
export interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {
|
|
29
|
+
type: NavigationItemType.Social;
|
|
30
|
+
icon: ImageProps;
|
|
31
|
+
url: string;
|
|
32
|
+
}
|
|
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'>;
|
|
36
|
+
export interface NavigationLogo {
|
|
37
|
+
icon: ImageProps;
|
|
38
|
+
text?: string;
|
|
39
|
+
url?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface HeaderData {
|
|
42
|
+
leftItems: NavigationItem[];
|
|
43
|
+
rightItems?: NavigationItem[];
|
|
44
|
+
}
|
|
45
|
+
export interface FooterColumn {
|
|
46
|
+
title: string;
|
|
47
|
+
links: NavigationItem[];
|
|
48
|
+
}
|
|
49
|
+
export interface FooterUnderline {
|
|
50
|
+
links?: NavigationItem[];
|
|
51
|
+
copyright?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface FooterData {
|
|
54
|
+
columns: FooterColumn[];
|
|
55
|
+
social?: NavigationSocialItem[];
|
|
56
|
+
underline?: FooterUnderline;
|
|
57
|
+
}
|
|
58
|
+
export interface NavigationData {
|
|
59
|
+
logo: NavigationLogo;
|
|
60
|
+
header: HeaderData;
|
|
61
|
+
footer?: FooterData;
|
|
62
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationItemType = void 0;
|
|
4
|
+
var NavigationItemType;
|
|
5
|
+
(function (NavigationItemType) {
|
|
6
|
+
NavigationItemType["Link"] = "link";
|
|
7
|
+
NavigationItemType["Dropdown"] = "dropdown";
|
|
8
|
+
NavigationItemType["Button"] = "button";
|
|
9
|
+
NavigationItemType["Social"] = "social";
|
|
10
|
+
})(NavigationItemType = exports.NavigationItemType || (exports.NavigationItemType = {}));
|
|
@@ -23,6 +23,7 @@ const createItemsParser = (fields) => (transformer, items) => items.map((item) =
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
exports.createItemsParser = createItemsParser;
|
|
26
|
+
const parseItems = (0, exports.createItemsParser)(['title', 'text']);
|
|
26
27
|
function parseTableBlock(transformer, content) {
|
|
27
28
|
const legend = content === null || content === void 0 ? void 0 : content.legend;
|
|
28
29
|
return Object.assign(Object.assign({}, (content || {})), { legend: legend && legend.map((string) => transformer(string)) });
|
|
@@ -48,13 +49,9 @@ function parseSlider(transformer, block) {
|
|
|
48
49
|
}
|
|
49
50
|
const parseTitle = (transformer, title) => typeof title === 'object' && 'text' in title
|
|
50
51
|
? Object.assign(Object.assign({}, title), { text: transformer(title.text) }) : title && transformer(title);
|
|
51
|
-
const parseItemsTitle = (transformer, items) => items.map((_a) => {
|
|
52
|
-
var { title } = _a, rest = (0, tslib_1.__rest)(_a, ["title"]);
|
|
53
|
-
return (Object.assign({ title: title && parseTitle(transformer, title) }, rest));
|
|
54
|
-
});
|
|
55
52
|
function parsePriceDetailedBlock(transformer, block) {
|
|
56
53
|
const { priceType } = block;
|
|
57
|
-
|
|
54
|
+
const transformedBlockItems = block.items.map((item) => {
|
|
58
55
|
const { description, items: details = [] } = item;
|
|
59
56
|
if (priceType === 'marked-list') {
|
|
60
57
|
item.items = details.map((detail) => {
|
|
@@ -71,6 +68,7 @@ function parsePriceDetailedBlock(transformer, block) {
|
|
|
71
68
|
item.description = transformer(description);
|
|
72
69
|
return item;
|
|
73
70
|
});
|
|
71
|
+
block.items = transformedBlockItems;
|
|
74
72
|
return block;
|
|
75
73
|
}
|
|
76
74
|
const parseContentLayout = (transformer, content) => {
|
|
@@ -228,12 +226,7 @@ const config = {
|
|
|
228
226
|
{
|
|
229
227
|
fields: ['items'],
|
|
230
228
|
transformer: yfmTransformer,
|
|
231
|
-
parser:
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
fields: ['items'],
|
|
235
|
-
transformer: typografTransformer,
|
|
236
|
-
parser: parseItemsTitle,
|
|
229
|
+
parser: parseItems,
|
|
237
230
|
},
|
|
238
231
|
],
|
|
239
232
|
[models_1.BlockType.TableBlock]: [
|
|
@@ -26,7 +26,7 @@ exports.DEFAULT_ALLOWED_TAGS = [
|
|
|
26
26
|
];
|
|
27
27
|
exports.typografConfig = {
|
|
28
28
|
enabled: ['common/nbsp/afterNumber', 'common/nbsp/afterParagraphMark'],
|
|
29
|
-
disabled: ['common/symbols/cf'
|
|
29
|
+
disabled: ['common/symbols/cf'],
|
|
30
30
|
};
|
|
31
31
|
exports.sanitizeStripOptions = {
|
|
32
32
|
allowedTags: [],
|
|
@@ -1,94 +1,68 @@
|
|
|
1
|
-
.pc-
|
|
1
|
+
.pc-TabsBlock__content-title.pc-TabsBlock__content-title > * {
|
|
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
|
-
.pc-
|
|
7
|
+
.pc-TabsBlock__block-title {
|
|
8
8
|
margin-bottom: 12px;
|
|
9
9
|
}
|
|
10
|
-
.pc-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.pc-tabs-block__tabs_centered {
|
|
15
|
-
display: flex;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
}
|
|
18
|
-
.pc-tabs-block__row_reverse {
|
|
19
|
-
flex-direction: row-reverse;
|
|
10
|
+
.pc-TabsBlock__tabs.pc-TabsBlock__tabs {
|
|
11
|
+
flex-wrap: nowrap;
|
|
12
|
+
overflow-x: auto;
|
|
13
|
+
margin-bottom: 32px;
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
margin-left: 0;
|
|
24
|
-
}
|
|
25
|
-
.pc-tabs-block__image {
|
|
15
|
+
|
|
16
|
+
.pc-TabsBlock__image {
|
|
26
17
|
width: 100%;
|
|
27
18
|
height: auto;
|
|
28
19
|
object-fit: cover;
|
|
29
20
|
display: block;
|
|
30
21
|
}
|
|
31
|
-
.pc-
|
|
22
|
+
.pc-TabsBlock__image, .pc-TabsBlock__media {
|
|
32
23
|
box-shadow: 0 2px 8px var(--pc-color-sfx-shadow), 0 4px 24px var(--pc-color-sfx-shadow);
|
|
33
24
|
overflow-x: hidden;
|
|
34
25
|
border-radius: var(--pc-border-radius);
|
|
35
26
|
}
|
|
36
|
-
.pc-
|
|
27
|
+
.pc-TabsBlock__caption {
|
|
37
28
|
font-size: var(--yc-text-body-2-font-size);
|
|
38
29
|
line-height: var(--yc-text-body-2-line-height);
|
|
39
30
|
margin: 12px 0 0;
|
|
40
31
|
color: var(--yc-color-text-secondary);
|
|
41
32
|
}
|
|
42
|
-
.pc-
|
|
33
|
+
.pc-TabsBlock__content {
|
|
43
34
|
display: flex;
|
|
44
35
|
flex-direction: column;
|
|
45
36
|
}
|
|
46
|
-
.pc-
|
|
47
|
-
margin: 0 auto;
|
|
48
|
-
}
|
|
49
|
-
.pc-tabs-block__col_centered {
|
|
50
|
-
margin: 0 auto;
|
|
51
|
-
}
|
|
52
|
-
.pc-tabs-block__content-wrapper_margin {
|
|
37
|
+
.pc-TabsBlock__content-wrapper_margin {
|
|
53
38
|
margin: 24px 0 0 32px;
|
|
54
39
|
}
|
|
55
|
-
.pc-
|
|
40
|
+
.pc-TabsBlock__content-title {
|
|
56
41
|
margin: 0 auto 12px;
|
|
57
42
|
}
|
|
58
|
-
.pc-
|
|
43
|
+
.pc-TabsBlock__content-title.pc-TabsBlock__content-title > * {
|
|
59
44
|
font-size: var(--yc-text-header-1-font-size);
|
|
60
45
|
line-height: var(--yc-text-header-1-line-height);
|
|
61
46
|
color: var(--pc-text-header-color);
|
|
62
47
|
font-weight: var(--yc-text-accent-font-weight);
|
|
63
48
|
}
|
|
64
49
|
|
|
50
|
+
.pc-TabsBlock__tabs, .pc-TabsBlock__link {
|
|
51
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
52
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
53
|
+
}
|
|
65
54
|
@media (max-width: 769px) {
|
|
66
|
-
.pc-
|
|
67
|
-
display: flex;
|
|
68
|
-
overflow: auto;
|
|
69
|
-
margin-left: -24px;
|
|
70
|
-
margin-right: -24px;
|
|
71
|
-
padding-left: 24px;
|
|
72
|
-
padding-right: 16px;
|
|
73
|
-
}
|
|
74
|
-
.pc-tabs-block__content-wrapper_margin {
|
|
55
|
+
.pc-TabsBlock__content-wrapper_margin {
|
|
75
56
|
margin: 0 0 32px 0;
|
|
76
57
|
}
|
|
77
|
-
.pc-tabs-block__row_reverse {
|
|
78
|
-
flex-direction: column-reverse;
|
|
79
|
-
}
|
|
80
|
-
.pc-tabs-block__row_reverse .pc-tabs-block__content > * {
|
|
81
|
-
margin-top: 32px;
|
|
82
|
-
padding-bottom: 0;
|
|
83
|
-
}
|
|
84
58
|
}
|
|
85
59
|
@media (min-width: 769px) {
|
|
86
|
-
.pc-
|
|
60
|
+
.pc-TabsBlock.pc-AnimateBlock .pc-TabsBlock__media, .pc-AnimateBlock .pc-TabsBlock .pc-TabsBlock__media {
|
|
87
61
|
position: relative;
|
|
88
62
|
top: 100px;
|
|
89
63
|
opacity: 0;
|
|
90
64
|
}
|
|
91
|
-
.pc-
|
|
65
|
+
.pc-TabsBlock.pc-AnimateBlock.animate .pc-TabsBlock__media, .pc-AnimateBlock .pc-TabsBlock.animate .pc-TabsBlock__media {
|
|
92
66
|
top: 0;
|
|
93
67
|
opacity: 1;
|
|
94
68
|
transition: top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
@@ -96,12 +70,12 @@ unpredictable css rules order in build */
|
|
|
96
70
|
}
|
|
97
71
|
}
|
|
98
72
|
@media (min-width: 769px) {
|
|
99
|
-
.pc-
|
|
73
|
+
.pc-TabsBlock.pc-AnimateBlock .pc-TabsBlock__image, .pc-AnimateBlock .pc-TabsBlock .pc-TabsBlock__image {
|
|
100
74
|
position: relative;
|
|
101
75
|
top: 100px;
|
|
102
76
|
opacity: 0;
|
|
103
77
|
}
|
|
104
|
-
.pc-
|
|
78
|
+
.pc-TabsBlock.pc-AnimateBlock.animate .pc-TabsBlock__image, .pc-AnimateBlock .pc-TabsBlock.animate .pc-TabsBlock__image {
|
|
105
79
|
top: 0;
|
|
106
80
|
opacity: 1;
|
|
107
81
|
transition: top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TabsBlockProps } from '../../models';
|
|
2
2
|
import './Tabs.css';
|
|
3
|
-
export declare const TabsBlock: ({ items, title, description, animated
|
|
3
|
+
export declare const TabsBlock: ({ items, title, description, animated }: TabsBlockProps) => JSX.Element;
|
|
4
4
|
export default TabsBlock;
|
|
@@ -1,53 +1,51 @@
|
|
|
1
1
|
import React, { Fragment, useContext, useState } from 'react';
|
|
2
|
+
import { Tabs } from '@gravity-ui/uikit';
|
|
2
3
|
import { block, getThemedValue } from '../../utils';
|
|
3
4
|
import { Row, Col, GridColumnOrderClasses } from '../../grid';
|
|
5
|
+
import YFMWrapper from '../../components/YFMWrapper/YFMWrapper';
|
|
4
6
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
5
7
|
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
6
8
|
import FullScreenImage from '../../components/FullscreenImage/FullscreenImage';
|
|
7
9
|
import Media from '../../components/Media/Media';
|
|
10
|
+
import Links from '../../components/Link/Links';
|
|
8
11
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
9
12
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
10
|
-
import ButtonTabs from '../../components/ButtonTabs/ButtonTabs';
|
|
11
|
-
import { Content } from '../../sub-blocks';
|
|
12
13
|
import './Tabs.css';
|
|
13
|
-
const b = block('
|
|
14
|
-
export const TabsBlock = ({ items, title, description, animated
|
|
14
|
+
const b = block('TabsBlock');
|
|
15
|
+
export const TabsBlock = ({ items, title, description, animated }) => {
|
|
15
16
|
const [activeTab, setActiveTab] = useState(items[0].tabName);
|
|
16
17
|
const [play, setPlay] = useState(false);
|
|
17
18
|
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
18
19
|
const tabs = items.map(({ tabName }) => ({ title: tabName, id: tabName }));
|
|
19
20
|
const activeTabData = items.find(({ tabName }) => tabName === activeTab);
|
|
20
|
-
const isReverse = direction === 'content-media';
|
|
21
21
|
let imageProps;
|
|
22
22
|
if (activeTabData) {
|
|
23
23
|
const themedImage = getThemedValue(activeTabData.image, theme);
|
|
24
24
|
imageProps = themedImage && getMediaImage(themedImage);
|
|
25
25
|
}
|
|
26
26
|
const showMedia = Boolean((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps);
|
|
27
|
-
const showText = Boolean(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.text);
|
|
28
|
-
const textContent = activeTabData && showText && (React.createElement(Col, { sizes: { all: 12, md: showMedia ? 4 : 8 }, className: b('content', { centered: centered }) },
|
|
29
|
-
React.createElement("div", { className: b('content-wrapper', {
|
|
30
|
-
margin: Boolean(((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps) && !isReverse),
|
|
31
|
-
}) },
|
|
32
|
-
React.createElement(Content, { title: activeTabData.title, text: activeTabData.text, additionalInfo: activeTabData.additionalInfo, size: "s", links: [
|
|
33
|
-
...(activeTabData.link ? [activeTabData.link] : []),
|
|
34
|
-
...(activeTabData.links || []),
|
|
35
|
-
], buttons: activeTabData.buttons, colSizes: { all: 12 } }))));
|
|
36
|
-
const mediaContent = showMedia && (React.createElement(Col, { sizes: { all: 12, md: 8 }, orders: {
|
|
37
|
-
all: GridColumnOrderClasses.Last,
|
|
38
|
-
md: GridColumnOrderClasses.First,
|
|
39
|
-
}, className: b('col', { centered: centered }) },
|
|
40
|
-
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play }))),
|
|
41
|
-
imageProps && (React.createElement(Fragment, null,
|
|
42
|
-
React.createElement(FullScreenImage, Object.assign({}, imageProps, { imageClassName: b('image') })),
|
|
43
|
-
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (React.createElement("p", { className: b('caption') }, activeTabData.caption))))));
|
|
44
27
|
return (React.createElement(AnimateBlock, { className: b(), onScroll: () => setPlay(true), animate: animated },
|
|
45
|
-
React.createElement(BlockHeader, { title: title, description: description, className: b('block-title'
|
|
46
|
-
React.createElement(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
28
|
+
React.createElement(BlockHeader, { title: title, description: description, className: b('block-title') }),
|
|
29
|
+
React.createElement(Tabs, { className: b('tabs'), items: tabs, activeTab: activeTab, onSelectTab: setActiveTab, size: "l" }),
|
|
30
|
+
activeTabData && (React.createElement(Row, null,
|
|
31
|
+
showMedia && (React.createElement(Col, { sizes: { all: 12, md: 8 }, orders: {
|
|
32
|
+
all: GridColumnOrderClasses.Last,
|
|
33
|
+
md: GridColumnOrderClasses.First,
|
|
34
|
+
} },
|
|
35
|
+
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play }))),
|
|
36
|
+
imageProps && (React.createElement(Fragment, null,
|
|
37
|
+
React.createElement(FullScreenImage, Object.assign({}, imageProps, { imageClassName: b('image') })),
|
|
38
|
+
activeTabData && (React.createElement("p", { className: b('caption') }, activeTabData.caption)))))),
|
|
39
|
+
React.createElement(Col, { sizes: { all: 12, md: showMedia ? 4 : 8 }, className: b('content') },
|
|
40
|
+
React.createElement("div", { className: b('content-wrapper', {
|
|
41
|
+
margin: Boolean((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps),
|
|
42
|
+
}) },
|
|
43
|
+
React.createElement("h4", { className: b('content-title') },
|
|
44
|
+
React.createElement(YFMWrapper, { content: activeTabData.title, modifiers: { constructor: true } })),
|
|
45
|
+
React.createElement(YFMWrapper, { content: activeTabData.text, modifiers: { constructor: true } }),
|
|
46
|
+
React.createElement(Links, { links: [
|
|
47
|
+
...(activeTabData.link ? [activeTabData.link] : []),
|
|
48
|
+
...(activeTabData.links || []),
|
|
49
|
+
], className: b('link') })))))));
|
|
52
50
|
};
|
|
53
51
|
export default TabsBlock;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, MouseEventHandler } from 'react';
|
|
2
2
|
import { ImageDeviceProps, ImageObjectProps } from '../../models';
|
|
3
|
-
import './Image.css';
|
|
4
3
|
export interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDeviceProps> {
|
|
5
4
|
style?: CSSProperties;
|
|
6
5
|
className?: string;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useState, Fragment } from 'react';
|
|
2
2
|
import { ProjectSettingsContext } from '../../context/projectSettingsContext';
|
|
3
3
|
import { BREAKPOINTS } from '../../constants';
|
|
4
|
-
import { block } from '../../utils';
|
|
5
|
-
import './Image.css';
|
|
6
|
-
const b = block('Image');
|
|
7
4
|
const checkWebP = (src) => {
|
|
8
5
|
return src.endsWith('.webp') ? src : src + '.webp';
|
|
9
6
|
};
|
|
@@ -20,7 +17,7 @@ const Image = (props) => {
|
|
|
20
17
|
disableCompress ||
|
|
21
18
|
imageSrc.endsWith('.svg') ||
|
|
22
19
|
imgLoadingError;
|
|
23
|
-
return (React.createElement("picture",
|
|
20
|
+
return (React.createElement("picture", null,
|
|
24
21
|
mobile && (React.createElement(Fragment, null,
|
|
25
22
|
!disableWebp && (React.createElement("source", { srcSet: checkWebP(mobile), type: "image/webp", media: `(max-width: ${BREAKPOINTS.sm}px)` })),
|
|
26
23
|
React.createElement("source", { srcSet: mobile, media: `(max-width: ${BREAKPOINTS.sm}px)` }))),
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
.pc-overflow-scroller__scroller {
|
|
10
10
|
position: absolute;
|
|
11
11
|
z-index: 10;
|
|
12
|
+
top: 0;
|
|
12
13
|
display: flex;
|
|
13
14
|
justify-content: flex-end;
|
|
14
15
|
align-items: center;
|
|
15
16
|
width: 32px;
|
|
17
|
+
height: calc(100% - 1px);
|
|
16
18
|
cursor: pointer;
|
|
17
19
|
color: var(--yc-color-text-secondary);
|
|
18
20
|
background: linear-gradient(to left, var(--yc-color-base-background) 70%, var(--pc-transparent) 100%) no-repeat;
|
|
@@ -50,7 +50,7 @@ const VideoBlock = (props) => {
|
|
|
50
50
|
}, [src, attributes]);
|
|
51
51
|
useEffect(() => {
|
|
52
52
|
const updateSize = _.debounce(() => {
|
|
53
|
-
setHeight(ref.current ? Math.
|
|
53
|
+
setHeight(ref.current ? Math.round(getHeight(ref.current.offsetWidth)) : undefined);
|
|
54
54
|
}, 100);
|
|
55
55
|
updateSize();
|
|
56
56
|
window.addEventListener('resize', updateSize);
|
|
@@ -33,4 +33,6 @@ export { default as OverflowScroller } from './OverflowScroller/OverflowScroller
|
|
|
33
33
|
export { default as Author } from './Author/Author';
|
|
34
34
|
export { default as RouterLink } from './RouterLink/RouterLink';
|
|
35
35
|
export { default as HTML } from './HTML/HTML';
|
|
36
|
+
export { default as Header } from './navigation/components/Header/Header';
|
|
37
|
+
export * as Navigation from './navigation/components/index';
|
|
36
38
|
export type { RouterLinkProps } from './RouterLink/RouterLink';
|