@gravity-ui/page-constructor 1.9.1-alpha.2 → 1.9.1-alpha.3
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/build/cjs/blocks/Tabs/Tabs.css +3 -5
- package/build/cjs/components/Image/Image.d.ts +1 -0
- package/build/cjs/components/Image/Image.js +2 -4
- package/build/cjs/components/VideoBlock/VideoBlock.css +4 -0
- package/build/cjs/components/VideoBlock/VideoBlock.js +1 -1
- package/build/cjs/components/index.d.ts +2 -1
- package/build/cjs/components/index.js +4 -2
- package/build/cjs/components/navigation/components/Header/Header.d.ts +3 -3
- package/build/cjs/components/navigation/components/Logo/Logo.d.ts +2 -2
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +1 -1
- package/build/cjs/components/navigation/components/Navigation/Navigation.d.ts +2 -2
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.d.ts +2 -2
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +2 -2
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.d.ts +3 -3
- package/build/cjs/components/navigation/containers/Layout/Layout.d.ts +2 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +2 -2
- package/build/cjs/models/navigation.d.ts +25 -25
- package/build/esm/blocks/Tabs/Tabs.css +3 -5
- package/build/esm/components/Image/Image.d.ts +1 -1
- package/build/esm/components/Image/Image.js +2 -5
- package/build/esm/components/VideoBlock/VideoBlock.css +4 -0
- package/build/esm/components/VideoBlock/VideoBlock.js +1 -1
- package/build/esm/components/index.d.ts +2 -1
- package/build/esm/components/index.js +2 -1
- package/build/esm/components/navigation/components/Header/Header.d.ts +3 -3
- package/build/esm/components/navigation/components/Logo/Logo.d.ts +2 -2
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +1 -1
- package/build/esm/components/navigation/components/Navigation/Navigation.d.ts +2 -2
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.d.ts +2 -2
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +2 -2
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.d.ts +3 -3
- package/build/esm/components/navigation/containers/Layout/Layout.d.ts +2 -2
- package/build/esm/containers/PageConstructor/PageConstructor.d.ts +2 -2
- package/build/esm/models/navigation.d.ts +25 -25
- package/package.json +1 -1
- package/server/models/navigation.d.ts +25 -25
- package/build/cjs/components/Image/Image.css +0 -4
- package/build/esm/components/Image/Image.css +0 -4
|
@@ -8,13 +8,11 @@ unpredictable css rules order in build */
|
|
|
8
8
|
margin-bottom: 24px;
|
|
9
9
|
}
|
|
10
10
|
.pc-tabs-block__block-title_centered {
|
|
11
|
-
display: flex;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
flex-wrap: wrap;
|
|
14
|
-
margin-left: auto;
|
|
15
|
-
margin-right: auto;
|
|
16
11
|
text-align: center;
|
|
17
12
|
}
|
|
13
|
+
.pc-tabs-block__block-title_centered > * {
|
|
14
|
+
margin: 0 auto;
|
|
15
|
+
}
|
|
18
16
|
.pc-tabs-block__tabs_centered {
|
|
19
17
|
display: flex;
|
|
20
18
|
justify-content: center;
|
|
@@ -4,6 +4,7 @@ export interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDevi
|
|
|
4
4
|
style?: CSSProperties;
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: MouseEventHandler;
|
|
7
|
+
containerClassName?: string;
|
|
7
8
|
}
|
|
8
9
|
declare const Image: (props: ImageProps) => JSX.Element | null;
|
|
9
10
|
export default Image;
|
|
@@ -4,14 +4,12 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
5
5
|
const projectSettingsContext_1 = require("../../context/projectSettingsContext");
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
7
|
-
const utils_1 = require("../../utils");
|
|
8
|
-
const b = (0, utils_1.block)('image');
|
|
9
7
|
const checkWebP = (src) => {
|
|
10
8
|
return src.endsWith('.webp') ? src : src + '.webp';
|
|
11
9
|
};
|
|
12
10
|
const Image = (props) => {
|
|
13
11
|
const projectSettings = (0, react_1.useContext)(projectSettingsContext_1.ProjectSettingsContext);
|
|
14
|
-
const { src, alt, disableCompress, tablet, desktop, mobile, style, className, onClick } = props;
|
|
12
|
+
const { src, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, } = props;
|
|
15
13
|
const [imgLoadingError, setImgLoadingError] = (0, react_1.useState)(false);
|
|
16
14
|
const imageSrc = src || desktop;
|
|
17
15
|
if (!imageSrc) {
|
|
@@ -22,7 +20,7 @@ const Image = (props) => {
|
|
|
22
20
|
disableCompress ||
|
|
23
21
|
imageSrc.endsWith('.svg') ||
|
|
24
22
|
imgLoadingError;
|
|
25
|
-
return (react_1.default.createElement("picture", { className:
|
|
23
|
+
return (react_1.default.createElement("picture", { className: containerClassName },
|
|
26
24
|
mobile && (react_1.default.createElement(react_1.Fragment, null,
|
|
27
25
|
!disableWebp && (react_1.default.createElement("source", { srcSet: checkWebP(mobile), type: "image/webp", media: `(max-width: ${constants_1.BREAKPOINTS.sm}px)` })),
|
|
28
26
|
react_1.default.createElement("source", { srcSet: mobile, media: `(max-width: ${constants_1.BREAKPOINTS.sm}px)` }))),
|
|
@@ -91,7 +91,7 @@ const VideoBlock = (props) => {
|
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
93
|
return (react_1.default.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && (react_1.default.createElement("div", { className: b('preview'), onClick: onPreviewClick },
|
|
94
|
-
react_1.default.createElement(Image_1.default, { src: previewImg, className: b('image') }),
|
|
94
|
+
react_1.default.createElement(Image_1.default, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper') }),
|
|
95
95
|
playButton || (react_1.default.createElement("button", { className: b('button') },
|
|
96
96
|
react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayVideo, size: 24 })))))));
|
|
97
97
|
};
|
|
@@ -33,5 +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
|
|
36
|
+
export { default as Header } from './navigation/components/Header/Header';
|
|
37
|
+
export * as Navigation from './navigation/components/index';
|
|
37
38
|
export type { RouterLinkProps } from './RouterLink/RouterLink';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HTML = exports.RouterLink = exports.Author = exports.OverflowScroller = exports.Control = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.ReactPlayer = exports.OutsideClick = exports.Media = exports.Links = exports.Link = exports.Image = exports.HeightCalculator = exports.HeaderBreadcrumbs = exports.FullWidthBackground = exports.FullscreenImage = exports.Foldable = exports.FileLink = exports.ErrorWrapper = exports.CardBase = exports.Button = exports.BlockHeader = exports.BlockBase = exports.BalancedMasonry = exports.BackLink = exports.BackgroundMedia = exports.BackgroundImage = exports.AnimateBlock = exports.Anchor = void 0;
|
|
3
|
+
exports.Navigation = exports.Header = exports.HTML = exports.RouterLink = exports.Author = exports.OverflowScroller = exports.Control = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.ReactPlayer = exports.OutsideClick = exports.Media = exports.Links = exports.Link = exports.Image = exports.HeightCalculator = exports.HeaderBreadcrumbs = exports.FullWidthBackground = exports.FullscreenImage = exports.Foldable = exports.FileLink = exports.ErrorWrapper = exports.CardBase = exports.Button = exports.BlockHeader = exports.BlockBase = exports.BalancedMasonry = exports.BackLink = exports.BackgroundMedia = exports.BackgroundImage = exports.AnimateBlock = exports.Anchor = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var Anchor_1 = require("./Anchor/Anchor");
|
|
6
6
|
Object.defineProperty(exports, "Anchor", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Anchor_1).default; } });
|
|
@@ -72,4 +72,6 @@ var RouterLink_1 = require("./RouterLink/RouterLink");
|
|
|
72
72
|
Object.defineProperty(exports, "RouterLink", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(RouterLink_1).default; } });
|
|
73
73
|
var HTML_1 = require("./HTML/HTML");
|
|
74
74
|
Object.defineProperty(exports, "HTML", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(HTML_1).default; } });
|
|
75
|
-
|
|
75
|
+
var Header_1 = require("./navigation/components/Header/Header");
|
|
76
|
+
Object.defineProperty(exports, "Header", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Header_1).default; } });
|
|
77
|
+
exports.Navigation = (0, tslib_1.__importStar)(require("./navigation/components/index"));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { HeaderData, NavigationLogo } from '../../../../models';
|
|
3
3
|
export interface HeaderProps {
|
|
4
|
-
logo:
|
|
5
|
-
data:
|
|
4
|
+
logo: NavigationLogo;
|
|
5
|
+
data: HeaderData;
|
|
6
6
|
}
|
|
7
7
|
export declare const Header: React.FC<HeaderProps>;
|
|
8
8
|
export default Header;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface LogoProps extends
|
|
2
|
+
import { NavigationLogo } from '../../../../models';
|
|
3
|
+
export interface LogoProps extends NavigationLogo {
|
|
4
4
|
className?: string;
|
|
5
5
|
}
|
|
6
6
|
declare const Logo: React.FC<LogoProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationItem as NavigationItemModel } from '../../../../models/navigation';
|
|
3
3
|
export interface MobileNavigationProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
isOpened?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { MouseEventHandler } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationDropdownItem, NavigationItem as NavigationItemModel } from '../../../../models/navigation';
|
|
3
3
|
export interface NavigationProps {
|
|
4
4
|
links: NavigationItemModel[];
|
|
5
5
|
activeItemIndex: number;
|
|
@@ -8,7 +8,7 @@ export interface NavigationProps {
|
|
|
8
8
|
highlightActiveItem?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export interface NavigationDropdownProps {
|
|
11
|
-
data:
|
|
11
|
+
data: NavigationDropdownItem;
|
|
12
12
|
onClick: MouseEventHandler;
|
|
13
13
|
isActive: boolean;
|
|
14
14
|
position: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { MouseEventHandler } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationItemData } from '../../../../models';
|
|
3
3
|
export interface NavigationItemProps {
|
|
4
|
-
data:
|
|
4
|
+
data: NavigationItemData;
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: MouseEventHandler;
|
|
7
7
|
isOpened?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationLinkItem } from '../../../../models';
|
|
3
3
|
export interface NavigationPopupProps {
|
|
4
|
-
items:
|
|
4
|
+
items: NavigationLinkItem[];
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
left?: number;
|
|
7
7
|
className?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
2
|
+
import { NavigationSocialItem } from '../../../../models';
|
|
3
|
+
export interface NavigationSocialItemProps extends NavigationSocialItem {
|
|
4
4
|
className?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const SocialIcon: React.FC<
|
|
6
|
+
declare const SocialIcon: React.FC<NavigationSocialItemProps>;
|
|
7
7
|
export default SocialIcon;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationData } from '../../../../models';
|
|
3
3
|
export interface LayoutProps {
|
|
4
|
-
navigation?:
|
|
4
|
+
navigation?: NavigationData;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
declare const Layout: React.FC<LayoutProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '@doc-tools/transform/dist/js/yfm';
|
|
3
|
-
import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems,
|
|
3
|
+
import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems, NavigationData } from '../../models';
|
|
4
4
|
import { blockMap, subBlockMap } from '../../constructor-items';
|
|
5
5
|
export declare type ItemMap = typeof blockMap & typeof subBlockMap & CustomItems;
|
|
6
6
|
export interface PageConstructorProps {
|
|
@@ -8,7 +8,7 @@ export interface PageConstructorProps {
|
|
|
8
8
|
shouldRenderBlock?: ShouldRenderBlock;
|
|
9
9
|
custom?: CustomConfig;
|
|
10
10
|
renderMenu?: () => React.ReactNode;
|
|
11
|
-
navigation?:
|
|
11
|
+
navigation?: NavigationData;
|
|
12
12
|
}
|
|
13
13
|
export declare const Constructor: (props: PageConstructorProps) => JSX.Element;
|
|
14
14
|
export declare const PageConstructor: (props: PageConstructorProps) => JSX.Element;
|
|
@@ -5,58 +5,58 @@ export declare enum NavigationItemType {
|
|
|
5
5
|
Button = "button",
|
|
6
6
|
Social = "social"
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface NavigationItemBase {
|
|
9
9
|
text: string;
|
|
10
10
|
icon?: ImageProps;
|
|
11
11
|
url?: string;
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface NavigationLinkItem extends NavigationItemBase {
|
|
14
14
|
type: NavigationItemType.Link;
|
|
15
15
|
url: string;
|
|
16
16
|
arrow?: boolean;
|
|
17
17
|
target?: string;
|
|
18
18
|
}
|
|
19
|
-
export interface
|
|
19
|
+
export interface NavigationButtonItem extends ButtonProps {
|
|
20
20
|
type: NavigationItemType.Button;
|
|
21
21
|
url: string;
|
|
22
22
|
target?: string;
|
|
23
23
|
}
|
|
24
|
-
export interface
|
|
24
|
+
export interface NavigationDropdownItem extends NavigationItemBase {
|
|
25
25
|
type: NavigationItemType.Dropdown;
|
|
26
|
-
items:
|
|
26
|
+
items: NavigationLinkItem[];
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
28
|
+
export interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {
|
|
29
29
|
type: NavigationItemType.Social;
|
|
30
30
|
icon: ImageProps;
|
|
31
31
|
url: string;
|
|
32
32
|
}
|
|
33
|
-
export declare type
|
|
34
|
-
export declare type
|
|
35
|
-
export declare type
|
|
36
|
-
export interface
|
|
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
37
|
icon: ImageProps;
|
|
38
38
|
text?: string;
|
|
39
39
|
url?: string;
|
|
40
40
|
}
|
|
41
|
-
export interface
|
|
42
|
-
leftItems:
|
|
43
|
-
rightItems?:
|
|
41
|
+
export interface HeaderData {
|
|
42
|
+
leftItems: NavigationItem[];
|
|
43
|
+
rightItems?: NavigationItem[];
|
|
44
44
|
}
|
|
45
|
-
export interface
|
|
45
|
+
export interface FooterColumn {
|
|
46
46
|
title: string;
|
|
47
|
-
links:
|
|
47
|
+
links: NavigationItem[];
|
|
48
48
|
}
|
|
49
|
-
export interface
|
|
50
|
-
links?:
|
|
49
|
+
export interface FooterUnderline {
|
|
50
|
+
links?: NavigationItem[];
|
|
51
51
|
copyright?: string;
|
|
52
52
|
}
|
|
53
|
-
export interface
|
|
54
|
-
columns:
|
|
55
|
-
social?:
|
|
56
|
-
underline?:
|
|
53
|
+
export interface FooterData {
|
|
54
|
+
columns: FooterColumn[];
|
|
55
|
+
social?: NavigationSocialItem[];
|
|
56
|
+
underline?: FooterUnderline;
|
|
57
57
|
}
|
|
58
|
-
export interface
|
|
59
|
-
logo:
|
|
60
|
-
header:
|
|
61
|
-
footer?:
|
|
58
|
+
export interface NavigationData {
|
|
59
|
+
logo: NavigationLogo;
|
|
60
|
+
header: HeaderData;
|
|
61
|
+
footer?: FooterData;
|
|
62
62
|
}
|
|
@@ -8,13 +8,11 @@ unpredictable css rules order in build */
|
|
|
8
8
|
margin-bottom: 24px;
|
|
9
9
|
}
|
|
10
10
|
.pc-tabs-block__block-title_centered {
|
|
11
|
-
display: flex;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
flex-wrap: wrap;
|
|
14
|
-
margin-left: auto;
|
|
15
|
-
margin-right: auto;
|
|
16
11
|
text-align: center;
|
|
17
12
|
}
|
|
13
|
+
.pc-tabs-block__block-title_centered > * {
|
|
14
|
+
margin: 0 auto;
|
|
15
|
+
}
|
|
18
16
|
.pc-tabs-block__tabs_centered {
|
|
19
17
|
display: flex;
|
|
20
18
|
justify-content: center;
|
|
@@ -1,10 +1,10 @@
|
|
|
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;
|
|
7
6
|
onClick?: MouseEventHandler;
|
|
7
|
+
containerClassName?: string;
|
|
8
8
|
}
|
|
9
9
|
declare const Image: (props: ImageProps) => JSX.Element | null;
|
|
10
10
|
export default Image;
|
|
@@ -1,15 +1,12 @@
|
|
|
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
|
};
|
|
10
7
|
const Image = (props) => {
|
|
11
8
|
const projectSettings = useContext(ProjectSettingsContext);
|
|
12
|
-
const { src, alt, disableCompress, tablet, desktop, mobile, style, className, onClick } = props;
|
|
9
|
+
const { src, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, } = props;
|
|
13
10
|
const [imgLoadingError, setImgLoadingError] = useState(false);
|
|
14
11
|
const imageSrc = src || desktop;
|
|
15
12
|
if (!imageSrc) {
|
|
@@ -20,7 +17,7 @@ const Image = (props) => {
|
|
|
20
17
|
disableCompress ||
|
|
21
18
|
imageSrc.endsWith('.svg') ||
|
|
22
19
|
imgLoadingError;
|
|
23
|
-
return (React.createElement("picture", { className:
|
|
20
|
+
return (React.createElement("picture", { className: containerClassName },
|
|
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)` }))),
|
|
@@ -87,7 +87,7 @@ const VideoBlock = (props) => {
|
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
89
89
|
return (React.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && (React.createElement("div", { className: b('preview'), onClick: onPreviewClick },
|
|
90
|
-
React.createElement(Image, { src: previewImg, className: b('image') }),
|
|
90
|
+
React.createElement(Image, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper') }),
|
|
91
91
|
playButton || (React.createElement("button", { className: b('button') },
|
|
92
92
|
React.createElement(Icon, { className: b('icon'), data: PlayVideo, size: 24 })))))));
|
|
93
93
|
};
|
|
@@ -33,5 +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
|
|
36
|
+
export { default as Header } from './navigation/components/Header/Header';
|
|
37
|
+
export * as Navigation from './navigation/components/index';
|
|
37
38
|
export type { RouterLinkProps } from './RouterLink/RouterLink';
|
|
@@ -33,4 +33,5 @@ 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
|
|
36
|
+
export { default as Header } from './navigation/components/Header/Header';
|
|
37
|
+
export * as Navigation from './navigation/components/index';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { HeaderData, NavigationLogo } from '../../../../models';
|
|
3
3
|
import './Header.css';
|
|
4
4
|
export interface HeaderProps {
|
|
5
|
-
logo:
|
|
6
|
-
data:
|
|
5
|
+
logo: NavigationLogo;
|
|
6
|
+
data: HeaderData;
|
|
7
7
|
}
|
|
8
8
|
export declare const Header: React.FC<HeaderProps>;
|
|
9
9
|
export default Header;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationLogo } from '../../../../models';
|
|
3
3
|
import './Logo.css';
|
|
4
|
-
export interface LogoProps extends
|
|
4
|
+
export interface LogoProps extends NavigationLogo {
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
7
|
declare const Logo: React.FC<LogoProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationItem as NavigationItemModel } from '../../../../models/navigation';
|
|
3
3
|
import './MobileNavigation.css';
|
|
4
4
|
export interface MobileNavigationProps {
|
|
5
5
|
className?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { MouseEventHandler } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationDropdownItem, NavigationItem as NavigationItemModel } from '../../../../models/navigation';
|
|
3
3
|
import './Navigation.css';
|
|
4
4
|
export interface NavigationProps {
|
|
5
5
|
links: NavigationItemModel[];
|
|
@@ -9,7 +9,7 @@ export interface NavigationProps {
|
|
|
9
9
|
highlightActiveItem?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface NavigationDropdownProps {
|
|
12
|
-
data:
|
|
12
|
+
data: NavigationDropdownItem;
|
|
13
13
|
onClick: MouseEventHandler;
|
|
14
14
|
isActive: boolean;
|
|
15
15
|
position: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { MouseEventHandler } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationItemData } from '../../../../models';
|
|
3
3
|
import './NavigationItem.css';
|
|
4
4
|
export interface NavigationItemProps {
|
|
5
|
-
data:
|
|
5
|
+
data: NavigationItemData;
|
|
6
6
|
className?: string;
|
|
7
7
|
onClick?: MouseEventHandler;
|
|
8
8
|
isOpened?: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationLinkItem } from '../../../../models';
|
|
3
3
|
import './NavigationPopup.css';
|
|
4
4
|
export interface NavigationPopupProps {
|
|
5
|
-
items:
|
|
5
|
+
items: NavigationLinkItem[];
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
left?: number;
|
|
8
8
|
className?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationSocialItem } from '../../../../models';
|
|
3
3
|
import './SocialIcon.css';
|
|
4
|
-
export interface
|
|
4
|
+
export interface NavigationSocialItemProps extends NavigationSocialItem {
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const SocialIcon: React.FC<
|
|
7
|
+
declare const SocialIcon: React.FC<NavigationSocialItemProps>;
|
|
8
8
|
export default SocialIcon;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationData } from '../../../../models';
|
|
3
3
|
import './Layout.css';
|
|
4
4
|
export interface LayoutProps {
|
|
5
|
-
navigation?:
|
|
5
|
+
navigation?: NavigationData;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
declare const Layout: React.FC<LayoutProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '@doc-tools/transform/dist/js/yfm';
|
|
3
|
-
import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems,
|
|
3
|
+
import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems, NavigationData } from '../../models';
|
|
4
4
|
import { blockMap, subBlockMap } from '../../constructor-items';
|
|
5
5
|
import './PageConstructor.css';
|
|
6
6
|
export declare type ItemMap = typeof blockMap & typeof subBlockMap & CustomItems;
|
|
@@ -9,7 +9,7 @@ export interface PageConstructorProps {
|
|
|
9
9
|
shouldRenderBlock?: ShouldRenderBlock;
|
|
10
10
|
custom?: CustomConfig;
|
|
11
11
|
renderMenu?: () => React.ReactNode;
|
|
12
|
-
navigation?:
|
|
12
|
+
navigation?: NavigationData;
|
|
13
13
|
}
|
|
14
14
|
export declare const Constructor: (props: PageConstructorProps) => JSX.Element;
|
|
15
15
|
export declare const PageConstructor: (props: PageConstructorProps) => JSX.Element;
|
|
@@ -5,58 +5,58 @@ export declare enum NavigationItemType {
|
|
|
5
5
|
Button = "button",
|
|
6
6
|
Social = "social"
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface NavigationItemBase {
|
|
9
9
|
text: string;
|
|
10
10
|
icon?: ImageProps;
|
|
11
11
|
url?: string;
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface NavigationLinkItem extends NavigationItemBase {
|
|
14
14
|
type: NavigationItemType.Link;
|
|
15
15
|
url: string;
|
|
16
16
|
arrow?: boolean;
|
|
17
17
|
target?: string;
|
|
18
18
|
}
|
|
19
|
-
export interface
|
|
19
|
+
export interface NavigationButtonItem extends ButtonProps {
|
|
20
20
|
type: NavigationItemType.Button;
|
|
21
21
|
url: string;
|
|
22
22
|
target?: string;
|
|
23
23
|
}
|
|
24
|
-
export interface
|
|
24
|
+
export interface NavigationDropdownItem extends NavigationItemBase {
|
|
25
25
|
type: NavigationItemType.Dropdown;
|
|
26
|
-
items:
|
|
26
|
+
items: NavigationLinkItem[];
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
28
|
+
export interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {
|
|
29
29
|
type: NavigationItemType.Social;
|
|
30
30
|
icon: ImageProps;
|
|
31
31
|
url: string;
|
|
32
32
|
}
|
|
33
|
-
export declare type
|
|
34
|
-
export declare type
|
|
35
|
-
export declare type
|
|
36
|
-
export interface
|
|
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
37
|
icon: ImageProps;
|
|
38
38
|
text?: string;
|
|
39
39
|
url?: string;
|
|
40
40
|
}
|
|
41
|
-
export interface
|
|
42
|
-
leftItems:
|
|
43
|
-
rightItems?:
|
|
41
|
+
export interface HeaderData {
|
|
42
|
+
leftItems: NavigationItem[];
|
|
43
|
+
rightItems?: NavigationItem[];
|
|
44
44
|
}
|
|
45
|
-
export interface
|
|
45
|
+
export interface FooterColumn {
|
|
46
46
|
title: string;
|
|
47
|
-
links:
|
|
47
|
+
links: NavigationItem[];
|
|
48
48
|
}
|
|
49
|
-
export interface
|
|
50
|
-
links?:
|
|
49
|
+
export interface FooterUnderline {
|
|
50
|
+
links?: NavigationItem[];
|
|
51
51
|
copyright?: string;
|
|
52
52
|
}
|
|
53
|
-
export interface
|
|
54
|
-
columns:
|
|
55
|
-
social?:
|
|
56
|
-
underline?:
|
|
53
|
+
export interface FooterData {
|
|
54
|
+
columns: FooterColumn[];
|
|
55
|
+
social?: NavigationSocialItem[];
|
|
56
|
+
underline?: FooterUnderline;
|
|
57
57
|
}
|
|
58
|
-
export interface
|
|
59
|
-
logo:
|
|
60
|
-
header:
|
|
61
|
-
footer?:
|
|
58
|
+
export interface NavigationData {
|
|
59
|
+
logo: NavigationLogo;
|
|
60
|
+
header: HeaderData;
|
|
61
|
+
footer?: FooterData;
|
|
62
62
|
}
|
package/package.json
CHANGED
|
@@ -5,58 +5,58 @@ export declare enum NavigationItemType {
|
|
|
5
5
|
Button = "button",
|
|
6
6
|
Social = "social"
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface NavigationItemBase {
|
|
9
9
|
text: string;
|
|
10
10
|
icon?: ImageProps;
|
|
11
11
|
url?: string;
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface NavigationLinkItem extends NavigationItemBase {
|
|
14
14
|
type: NavigationItemType.Link;
|
|
15
15
|
url: string;
|
|
16
16
|
arrow?: boolean;
|
|
17
17
|
target?: string;
|
|
18
18
|
}
|
|
19
|
-
export interface
|
|
19
|
+
export interface NavigationButtonItem extends ButtonProps {
|
|
20
20
|
type: NavigationItemType.Button;
|
|
21
21
|
url: string;
|
|
22
22
|
target?: string;
|
|
23
23
|
}
|
|
24
|
-
export interface
|
|
24
|
+
export interface NavigationDropdownItem extends NavigationItemBase {
|
|
25
25
|
type: NavigationItemType.Dropdown;
|
|
26
|
-
items:
|
|
26
|
+
items: NavigationLinkItem[];
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
28
|
+
export interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {
|
|
29
29
|
type: NavigationItemType.Social;
|
|
30
30
|
icon: ImageProps;
|
|
31
31
|
url: string;
|
|
32
32
|
}
|
|
33
|
-
export declare type
|
|
34
|
-
export declare type
|
|
35
|
-
export declare type
|
|
36
|
-
export interface
|
|
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
37
|
icon: ImageProps;
|
|
38
38
|
text?: string;
|
|
39
39
|
url?: string;
|
|
40
40
|
}
|
|
41
|
-
export interface
|
|
42
|
-
leftItems:
|
|
43
|
-
rightItems?:
|
|
41
|
+
export interface HeaderData {
|
|
42
|
+
leftItems: NavigationItem[];
|
|
43
|
+
rightItems?: NavigationItem[];
|
|
44
44
|
}
|
|
45
|
-
export interface
|
|
45
|
+
export interface FooterColumn {
|
|
46
46
|
title: string;
|
|
47
|
-
links:
|
|
47
|
+
links: NavigationItem[];
|
|
48
48
|
}
|
|
49
|
-
export interface
|
|
50
|
-
links?:
|
|
49
|
+
export interface FooterUnderline {
|
|
50
|
+
links?: NavigationItem[];
|
|
51
51
|
copyright?: string;
|
|
52
52
|
}
|
|
53
|
-
export interface
|
|
54
|
-
columns:
|
|
55
|
-
social?:
|
|
56
|
-
underline?:
|
|
53
|
+
export interface FooterData {
|
|
54
|
+
columns: FooterColumn[];
|
|
55
|
+
social?: NavigationSocialItem[];
|
|
56
|
+
underline?: FooterUnderline;
|
|
57
57
|
}
|
|
58
|
-
export interface
|
|
59
|
-
logo:
|
|
60
|
-
header:
|
|
61
|
-
footer?:
|
|
58
|
+
export interface NavigationData {
|
|
59
|
+
logo: NavigationLogo;
|
|
60
|
+
header: HeaderData;
|
|
61
|
+
footer?: FooterData;
|
|
62
62
|
}
|