@gravity-ui/page-constructor 1.9.1 → 1.9.3-alpha.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 +15 -0
- 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 +0 -2
- package/build/cjs/components/index.js +39 -40
- package/build/cjs/containers/PageConstructor/PageConstructor.js +1 -1
- package/build/cjs/models/navigation.d.ts +7 -7
- package/build/cjs/{components/navigation → navigation}/components/Header/Header.css +0 -0
- package/build/cjs/{components/navigation → navigation}/components/Header/Header.d.ts +2 -2
- package/build/cjs/{components/navigation → navigation}/components/Header/Header.js +5 -5
- package/build/cjs/{components/navigation → navigation}/components/Logo/Logo.css +0 -0
- package/build/cjs/{components/navigation → navigation}/components/Logo/Logo.d.ts +2 -2
- package/build/cjs/{components/navigation → navigation}/components/Logo/Logo.js +5 -5
- package/build/cjs/{components/navigation → navigation}/components/MobileNavigation/MobileNavigation.css +0 -0
- package/build/cjs/{components/navigation → navigation}/components/MobileNavigation/MobileNavigation.d.ts +1 -1
- package/build/cjs/{components/navigation → navigation}/components/MobileNavigation/MobileNavigation.js +4 -4
- package/build/cjs/{components/navigation → navigation}/components/Navigation/Navigation.css +0 -0
- package/build/cjs/{components/navigation → navigation}/components/Navigation/Navigation.d.ts +1 -1
- package/build/cjs/{components/navigation → navigation}/components/Navigation/Navigation.js +4 -4
- package/build/cjs/{components/navigation → navigation}/components/NavigationItem/NavigationItem.css +0 -0
- package/build/cjs/{components/navigation → navigation}/components/NavigationItem/NavigationItem.d.ts +1 -1
- package/build/cjs/{components/navigation → navigation}/components/NavigationItem/NavigationItem.js +11 -11
- package/build/cjs/{components/navigation → navigation}/components/NavigationPopup/NavigationPopup.css +0 -0
- package/build/cjs/{components/navigation → navigation}/components/NavigationPopup/NavigationPopup.d.ts +1 -1
- package/build/cjs/{components/navigation → navigation}/components/NavigationPopup/NavigationPopup.js +3 -3
- package/build/cjs/{components/navigation → navigation}/components/SocialIcon/SocialIcon.css +0 -0
- package/build/cjs/navigation/components/SocialIcon/SocialIcon.d.ts +7 -0
- package/build/cjs/{components/navigation → navigation}/components/SocialIcon/SocialIcon.js +4 -4
- package/build/cjs/{components/navigation → navigation}/containers/Layout/Layout.css +0 -0
- package/build/cjs/{components/navigation → navigation}/containers/Layout/Layout.d.ts +1 -1
- package/build/cjs/{components/navigation → navigation}/containers/Layout/Layout.js +1 -1
- package/build/cjs/schema/index.js +47 -44
- 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 +0 -2
- package/build/esm/components/index.js +0 -2
- package/build/esm/containers/PageConstructor/PageConstructor.js +1 -1
- package/build/esm/models/navigation.d.ts +7 -7
- package/build/esm/{components/navigation → navigation}/components/Header/Header.css +0 -0
- package/build/esm/{components/navigation → navigation}/components/Header/Header.d.ts +2 -2
- package/build/esm/{components/navigation → navigation}/components/Header/Header.js +5 -5
- package/build/esm/{components/navigation → navigation}/components/Logo/Logo.css +0 -0
- package/build/esm/{components/navigation → navigation}/components/Logo/Logo.d.ts +2 -2
- package/build/esm/{components/navigation → navigation}/components/Logo/Logo.js +4 -4
- package/build/esm/{components/navigation → navigation}/components/MobileNavigation/MobileNavigation.css +0 -0
- package/build/esm/{components/navigation → navigation}/components/MobileNavigation/MobileNavigation.d.ts +1 -1
- package/build/esm/{components/navigation → navigation}/components/MobileNavigation/MobileNavigation.js +3 -3
- package/build/esm/{components/navigation → navigation}/components/Navigation/Navigation.css +0 -0
- package/build/esm/{components/navigation → navigation}/components/Navigation/Navigation.d.ts +1 -1
- package/build/esm/{components/navigation → navigation}/components/Navigation/Navigation.js +4 -4
- package/build/esm/{components/navigation → navigation}/components/NavigationItem/NavigationItem.css +0 -0
- package/build/esm/{components/navigation → navigation}/components/NavigationItem/NavigationItem.d.ts +1 -1
- package/build/esm/{components/navigation → navigation}/components/NavigationItem/NavigationItem.js +6 -6
- package/build/esm/{components/navigation → navigation}/components/NavigationPopup/NavigationPopup.css +0 -0
- package/build/esm/{components/navigation → navigation}/components/NavigationPopup/NavigationPopup.d.ts +1 -1
- package/build/esm/{components/navigation → navigation}/components/NavigationPopup/NavigationPopup.js +2 -2
- package/build/esm/{components/navigation → navigation}/components/SocialIcon/SocialIcon.css +0 -0
- package/build/esm/navigation/components/SocialIcon/SocialIcon.d.ts +8 -0
- package/build/esm/{components/navigation → navigation}/components/SocialIcon/SocialIcon.js +3 -3
- package/build/esm/{components/navigation → navigation}/containers/Layout/Layout.css +0 -0
- package/build/esm/{components/navigation → navigation}/containers/Layout/Layout.d.ts +1 -1
- package/build/esm/{components/navigation → navigation}/containers/Layout/Layout.js +1 -1
- package/build/esm/schema/index.js +48 -45
- package/package.json +4 -1
- package/server/models/navigation.d.ts +7 -7
- package/build/cjs/components/Image/Image.css +0 -4
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.d.ts +0 -7
- package/build/cjs/components/navigation/components/index.d.ts +0 -7
- package/build/cjs/components/navigation/components/index.js +0 -20
- package/build/esm/components/Image/Image.css +0 -4
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.d.ts +0 -8
- package/build/esm/components/navigation/components/index.d.ts +0 -7
- package/build/esm/components/navigation/components/index.js +0 -7
|
@@ -13,6 +13,49 @@ const getBlocksCases = (blocks) => {
|
|
|
13
13
|
exports.getBlocksCases = getBlocksCases;
|
|
14
14
|
function generateDefaultSchema(config) {
|
|
15
15
|
const { cards = {}, blocks = {}, extensions = {} } = config !== null && config !== void 0 ? config : {};
|
|
16
|
+
const blocksValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.InfoBlock), blocks_1.SecurityBlock), blocks_1.TableBlock), blocks_1.TabsBlock), blocks_1.SimpleBlock), blocks_1.LinkTableBlock), blocks_1.PreviewBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock);
|
|
17
|
+
const cardsValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.PartnerBlock), sub_blocks_1.MediaCardBlock), blocks_1.BannerCard), sub_blocks_1.PriceDetailedBlock), sub_blocks_1.TutorialCard), sub_blocks_1.BackgroundCard), sub_blocks_1.NewsCard), sub_blocks_1.CardWithImage), sub_blocks_1.Quote), sub_blocks_1.BasicCard);
|
|
18
|
+
const constructorBlockSchemaNames = [
|
|
19
|
+
'divider',
|
|
20
|
+
'quote',
|
|
21
|
+
'event',
|
|
22
|
+
'post',
|
|
23
|
+
'extended-features-block',
|
|
24
|
+
'promo-features-block',
|
|
25
|
+
'slider-block',
|
|
26
|
+
'questions-block',
|
|
27
|
+
'header-block',
|
|
28
|
+
'banner-block',
|
|
29
|
+
'companies-block',
|
|
30
|
+
'media-block',
|
|
31
|
+
'info-block',
|
|
32
|
+
'security-block',
|
|
33
|
+
'table-block',
|
|
34
|
+
'tabs-block',
|
|
35
|
+
'simple-block',
|
|
36
|
+
'link-table-block',
|
|
37
|
+
'preview-block',
|
|
38
|
+
'price-detailed',
|
|
39
|
+
'header-slider-block',
|
|
40
|
+
'cards-with-image-block',
|
|
41
|
+
'icons-block',
|
|
42
|
+
'card-layout-block',
|
|
43
|
+
'content-layout-block',
|
|
44
|
+
];
|
|
45
|
+
const constructorCardsSchemaNames = [
|
|
46
|
+
'partner',
|
|
47
|
+
'media-card',
|
|
48
|
+
'banner-card',
|
|
49
|
+
'price-detailed',
|
|
50
|
+
'tutoral-card',
|
|
51
|
+
'background-card',
|
|
52
|
+
'news-card',
|
|
53
|
+
'card-with-image',
|
|
54
|
+
'quote',
|
|
55
|
+
'basic-card',
|
|
56
|
+
];
|
|
57
|
+
const configBlockSchemaNames = Object.keys(blocks).filter((item) => !constructorBlockSchemaNames.includes(item));
|
|
58
|
+
const configCardSchemaNames = Object.keys(blocks).filter((item) => !constructorBlockSchemaNames.includes(item));
|
|
16
59
|
return {
|
|
17
60
|
$id: 'self',
|
|
18
61
|
definitions: {
|
|
@@ -22,38 +65,11 @@ function generateDefaultSchema(config) {
|
|
|
22
65
|
properties: {
|
|
23
66
|
type: {
|
|
24
67
|
type: 'string',
|
|
25
|
-
enum: [
|
|
26
|
-
'divider',
|
|
27
|
-
'quote',
|
|
28
|
-
'event',
|
|
29
|
-
'post',
|
|
30
|
-
'extended-features-block',
|
|
31
|
-
'promo-features-block',
|
|
32
|
-
'slider-block',
|
|
33
|
-
'questions-block',
|
|
34
|
-
'header-block',
|
|
35
|
-
'banner-block',
|
|
36
|
-
'companies-block',
|
|
37
|
-
'media-block',
|
|
38
|
-
'info-block',
|
|
39
|
-
'security-block',
|
|
40
|
-
'table-block',
|
|
41
|
-
'tabs-block',
|
|
42
|
-
'simple-block',
|
|
43
|
-
'link-table-block',
|
|
44
|
-
'preview-block',
|
|
45
|
-
'price-detailed',
|
|
46
|
-
'header-slider-block',
|
|
47
|
-
'cards-with-image-block',
|
|
48
|
-
'icons-block',
|
|
49
|
-
'card-layout-block',
|
|
50
|
-
'content-layout-block',
|
|
51
|
-
...Object.keys(blocks),
|
|
52
|
-
],
|
|
68
|
+
enum: [...constructorBlockSchemaNames, ...configBlockSchemaNames],
|
|
53
69
|
},
|
|
54
70
|
},
|
|
55
71
|
select: { $data: '0/type' },
|
|
56
|
-
selectCases: Object.assign(Object.assign(
|
|
72
|
+
selectCases: Object.assign(Object.assign({}, blocksValidators), (0, exports.getBlocksCases)(blocks)),
|
|
57
73
|
}),
|
|
58
74
|
cards: (0, utils_1.filteredItem)({
|
|
59
75
|
type: 'object',
|
|
@@ -61,24 +77,11 @@ function generateDefaultSchema(config) {
|
|
|
61
77
|
properties: {
|
|
62
78
|
type: {
|
|
63
79
|
type: 'string',
|
|
64
|
-
enum: [
|
|
65
|
-
'partner',
|
|
66
|
-
'post',
|
|
67
|
-
'media-card',
|
|
68
|
-
'banner-card',
|
|
69
|
-
'price-detailed',
|
|
70
|
-
'tutoral-card',
|
|
71
|
-
'background-card',
|
|
72
|
-
'news-card',
|
|
73
|
-
'card-with-image',
|
|
74
|
-
'quote',
|
|
75
|
-
'basic-card',
|
|
76
|
-
...Object.keys(cards),
|
|
77
|
-
],
|
|
80
|
+
enum: [...constructorCardsSchemaNames, ...configCardSchemaNames],
|
|
78
81
|
},
|
|
79
82
|
},
|
|
80
83
|
select: { $data: '0/type' },
|
|
81
|
-
selectCases: Object.assign(Object.assign(
|
|
84
|
+
selectCases: Object.assign(Object.assign({}, cardsValidators), (0, exports.getBlocksCases)(cards)),
|
|
82
85
|
}),
|
|
83
86
|
},
|
|
84
87
|
type: 'object',
|
|
@@ -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,6 +33,4 @@ 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';
|
|
38
36
|
export type { RouterLinkProps } from './RouterLink/RouterLink';
|
|
@@ -33,5 +33,3 @@ 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';
|
|
@@ -13,7 +13,7 @@ import { ConstructorRow } from './components/ConstructorRow';
|
|
|
13
13
|
import { ConstructorFootnotes } from './components/ConstructorFootnotes';
|
|
14
14
|
import { ConstructorHeader } from './components/ConstructorItem';
|
|
15
15
|
import { ConstructorBlocks } from './components/ConstructorBlocks';
|
|
16
|
-
import Layout from '../../
|
|
16
|
+
import Layout from '../../navigation/containers/Layout/Layout';
|
|
17
17
|
import './PageConstructor.css';
|
|
18
18
|
const b = cnBlock('page-constructor');
|
|
19
19
|
export const Constructor = (props) => {
|
|
@@ -30,24 +30,24 @@ export interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {
|
|
|
30
30
|
icon: ImageProps;
|
|
31
31
|
url: string;
|
|
32
32
|
}
|
|
33
|
-
export declare type
|
|
33
|
+
export declare type NavigationItemModel = NavigationLinkItem | NavigationButtonItem | NavigationDropdownItem;
|
|
34
34
|
export declare type NavigationItemData = NavigationLinkItem | NavigationButtonItem | NavigationSocialItem | DropdownItemData;
|
|
35
35
|
export declare type DropdownItemData = Omit<NavigationDropdownItem, 'items'>;
|
|
36
|
-
export interface
|
|
36
|
+
export interface NavigationLogoData {
|
|
37
37
|
icon: ImageProps;
|
|
38
38
|
text?: string;
|
|
39
39
|
url?: string;
|
|
40
40
|
}
|
|
41
41
|
export interface HeaderData {
|
|
42
|
-
leftItems:
|
|
43
|
-
rightItems?:
|
|
42
|
+
leftItems: NavigationItemModel[];
|
|
43
|
+
rightItems?: NavigationItemModel[];
|
|
44
44
|
}
|
|
45
45
|
export interface FooterColumn {
|
|
46
46
|
title: string;
|
|
47
|
-
links:
|
|
47
|
+
links: NavigationItemModel[];
|
|
48
48
|
}
|
|
49
49
|
export interface FooterUnderline {
|
|
50
|
-
links?:
|
|
50
|
+
links?: NavigationItemModel[];
|
|
51
51
|
copyright?: string;
|
|
52
52
|
}
|
|
53
53
|
export interface FooterData {
|
|
@@ -56,7 +56,7 @@ export interface FooterData {
|
|
|
56
56
|
underline?: FooterUnderline;
|
|
57
57
|
}
|
|
58
58
|
export interface NavigationData {
|
|
59
|
-
logo:
|
|
59
|
+
logo: NavigationLogoData;
|
|
60
60
|
header: HeaderData;
|
|
61
61
|
footer?: FooterData;
|
|
62
62
|
}
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { HeaderData,
|
|
2
|
+
import { HeaderData, NavigationLogoData } from '../../../models';
|
|
3
3
|
import './Header.css';
|
|
4
4
|
export interface HeaderProps {
|
|
5
|
-
logo:
|
|
5
|
+
logo: NavigationLogoData;
|
|
6
6
|
data: HeaderData;
|
|
7
7
|
}
|
|
8
8
|
export declare const Header: React.FC<HeaderProps>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react';
|
|
2
|
-
import { block } from '
|
|
3
|
-
import { Col, Grid, Row } from '
|
|
4
|
-
import OutsideClick from '../../../OutsideClick/OutsideClick';
|
|
5
|
-
import Control from '../../../Control/Control';
|
|
2
|
+
import { block } from '../../../utils';
|
|
3
|
+
import { Col, Grid, Row } from '../../../grid';
|
|
4
|
+
import OutsideClick from '../../../components/OutsideClick/OutsideClick';
|
|
5
|
+
import Control from '../../../components/Control/Control';
|
|
6
6
|
import Navigation from '../Navigation/Navigation';
|
|
7
7
|
import MobileNavigation from '../MobileNavigation/MobileNavigation';
|
|
8
8
|
import NavigationItem from '../NavigationItem/NavigationItem';
|
|
9
9
|
import Logo from '../Logo/Logo';
|
|
10
|
-
import { NavigationClose, NavigationOpen } from '
|
|
10
|
+
import { NavigationClose, NavigationOpen } from '../../../icons';
|
|
11
11
|
import './Header.css';
|
|
12
12
|
const b = block('header');
|
|
13
13
|
const ICON_SIZE = 36;
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationLogoData } from '../../../models';
|
|
3
3
|
import './Logo.css';
|
|
4
|
-
export interface LogoProps extends
|
|
4
|
+
export interface LogoProps extends NavigationLogoData {
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
7
|
declare const Logo: React.FC<LogoProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { block } from '
|
|
3
|
-
import RouterLink from '../../../RouterLink/RouterLink';
|
|
4
|
-
import { getMediaImage } from '../../../Media/Image/utils';
|
|
5
|
-
import { Image } from '../../../
|
|
2
|
+
import { block } from '../../../utils';
|
|
3
|
+
import RouterLink from '../../../components/RouterLink/RouterLink';
|
|
4
|
+
import { getMediaImage } from '../../../components/Media/Image/utils';
|
|
5
|
+
import { Image } from '../../../components';
|
|
6
6
|
import './Logo.css';
|
|
7
7
|
const b = block('logo');
|
|
8
8
|
const Logo = ({ icon, text, className }) => {
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationItemModel } from '../../../models';
|
|
3
3
|
import './MobileNavigation.css';
|
|
4
4
|
export interface MobileNavigationProps {
|
|
5
5
|
className?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useRef, useCallback } from 'react';
|
|
2
2
|
import { Popup, Portal } from '@gravity-ui/uikit';
|
|
3
|
-
import { block } from '
|
|
4
|
-
import Foldable from '../../../Foldable/Foldable';
|
|
5
|
-
import { NavigationItemType
|
|
3
|
+
import { block } from '../../../utils';
|
|
4
|
+
import Foldable from '../../../components/Foldable/Foldable';
|
|
5
|
+
import { NavigationItemType } from '../../../models';
|
|
6
6
|
import NavigationItem from '../NavigationItem/NavigationItem';
|
|
7
7
|
import './MobileNavigation.css';
|
|
8
8
|
const b = block('mobile-navigation');
|
|
File without changes
|
package/build/esm/{components/navigation → navigation}/components/Navigation/Navigation.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { MouseEventHandler } from 'react';
|
|
2
|
-
import { NavigationDropdownItem,
|
|
2
|
+
import { NavigationDropdownItem, NavigationItemModel } from '../../../models/navigation';
|
|
3
3
|
import './Navigation.css';
|
|
4
4
|
export interface NavigationProps {
|
|
5
5
|
links: NavigationItemModel[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import React, { Fragment, useState, useEffect, useCallback, useContext, useRef, } from 'react';
|
|
4
|
-
import { block } from '
|
|
5
|
-
import OverflowScroller from '../../../OverflowScroller/OverflowScroller';
|
|
6
|
-
import { NavigationItemType, } from '
|
|
4
|
+
import { block } from '../../../utils';
|
|
5
|
+
import OverflowScroller from '../../../components/OverflowScroller/OverflowScroller';
|
|
6
|
+
import { NavigationItemType, } from '../../../models/navigation';
|
|
7
7
|
import NavigationPopup from '../NavigationPopup/NavigationPopup';
|
|
8
8
|
import NavigationItem from '../NavigationItem/NavigationItem';
|
|
9
|
-
import { LocationContext } from '
|
|
9
|
+
import { LocationContext } from '../../../context/locationContext';
|
|
10
10
|
import './Navigation.css';
|
|
11
11
|
const b = block('navigation');
|
|
12
12
|
const NavigationDropdown = ({ data, isActive, position, hidePopup, onClick, }) => {
|
package/build/esm/{components/navigation → navigation}/components/NavigationItem/NavigationItem.css
RENAMED
|
File without changes
|
package/build/esm/{components/navigation → navigation}/components/NavigationItem/NavigationItem.js
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { Fragment, useContext, useMemo } from 'react';
|
|
3
|
-
import { block, getLinkProps } from '
|
|
4
|
-
import { RouterLink, ToggleArrow, Button, Image } from '../../../
|
|
5
|
-
import { LocationContext } from '
|
|
6
|
-
import { NavigationItemType, } from '
|
|
7
|
-
import { NavigationArrow } from '
|
|
3
|
+
import { block, getLinkProps } from '../../../utils';
|
|
4
|
+
import { RouterLink, ToggleArrow, Button, Image } from '../../../components';
|
|
5
|
+
import { LocationContext } from '../../../context/locationContext';
|
|
6
|
+
import { NavigationItemType, } from '../../../models';
|
|
7
|
+
import { NavigationArrow } from '../../../icons';
|
|
8
8
|
import SocialIcon from '../SocialIcon/SocialIcon';
|
|
9
|
-
import { getMediaImage } from '../../../Media/Image/utils';
|
|
9
|
+
import { getMediaImage } from '../../../components/Media/Image/utils';
|
|
10
10
|
import './NavigationItem.css';
|
|
11
11
|
const b = block('navigation-item');
|
|
12
12
|
const Content = ({ text, icon }) => (React.createElement(Fragment, null,
|
|
File without changes
|
package/build/esm/{components/navigation → navigation}/components/NavigationPopup/NavigationPopup.js
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import React, { useRef, useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import { Portal } from '@gravity-ui/uikit';
|
|
4
|
-
import { block } from '
|
|
5
|
-
import { OutsideClick } from '../../../
|
|
4
|
+
import { block } from '../../../utils';
|
|
5
|
+
import { OutsideClick } from '../../../components';
|
|
6
6
|
import NavigationItem from '../NavigationItem/NavigationItem';
|
|
7
7
|
import './NavigationPopup.css';
|
|
8
8
|
const b = block('navigation-popup');
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationSocialItem } from '../../../models';
|
|
3
|
+
import './SocialIcon.css';
|
|
4
|
+
export interface NavigationSocialItemOwnProps extends NavigationSocialItem {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const SocialIcon: React.FC<NavigationSocialItemOwnProps>;
|
|
8
|
+
export default SocialIcon;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { block } from '
|
|
3
|
-
import { Image } from '../../../
|
|
4
|
-
import { getMediaImage } from '../../../Media/Image/utils';
|
|
2
|
+
import { block } from '../../../utils';
|
|
3
|
+
import { Image } from '../../../components';
|
|
4
|
+
import { getMediaImage } from '../../../components/Media/Image/utils';
|
|
5
5
|
import './SocialIcon.css';
|
|
6
6
|
const b = block('social-icon');
|
|
7
7
|
const SocialIcon = ({ icon, url, className }) => {
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { validators } from './validators';
|
|
2
2
|
import { TabsBlock, BannerCard, SliderBlock, ExtendedFeaturesBlock, HeaderBlock, BannerBlock, CompaniesBlock, MediaBlock, InfoBlock, QuestionsBlock, SecurityBlock, TableBlock, SimpleBlock, LinkTableBlock, PromoFeaturesBlock, PreviewBlock, ContentLayoutBlock, HeaderSliderBlock, IconsBlock, CardLayoutBlock, } from './validators/blocks';
|
|
3
|
-
import { PartnerBlock, MediaCardBlock, TutorialCard, BackgroundCard, NewsCard, CardWithImage, PriceDetailedBlock, Quote, Divider, } from './validators/sub-blocks';
|
|
3
|
+
import { PartnerBlock, MediaCardBlock, TutorialCard, BackgroundCard, NewsCard, CardWithImage, PriceDetailedBlock, Quote, Divider, BasicCard, } from './validators/sub-blocks';
|
|
4
4
|
import { AnimatableProps, BackgroundProps, MenuProps, withTheme } from './validators/common';
|
|
5
5
|
import { filteredItem } from './validators/utils';
|
|
6
6
|
export const getBlocksCases = (blocks) => {
|
|
@@ -8,6 +8,49 @@ export const getBlocksCases = (blocks) => {
|
|
|
8
8
|
};
|
|
9
9
|
export function generateDefaultSchema(config) {
|
|
10
10
|
const { cards = {}, blocks = {}, extensions = {} } = config !== null && config !== void 0 ? config : {};
|
|
11
|
+
const blocksValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), InfoBlock), SecurityBlock), TableBlock), TabsBlock), SimpleBlock), LinkTableBlock), PreviewBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock);
|
|
12
|
+
const cardsValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, PartnerBlock), MediaCardBlock), BannerCard), PriceDetailedBlock), TutorialCard), BackgroundCard), NewsCard), CardWithImage), Quote), BasicCard);
|
|
13
|
+
const constructorBlockSchemaNames = [
|
|
14
|
+
'divider',
|
|
15
|
+
'quote',
|
|
16
|
+
'event',
|
|
17
|
+
'post',
|
|
18
|
+
'extended-features-block',
|
|
19
|
+
'promo-features-block',
|
|
20
|
+
'slider-block',
|
|
21
|
+
'questions-block',
|
|
22
|
+
'header-block',
|
|
23
|
+
'banner-block',
|
|
24
|
+
'companies-block',
|
|
25
|
+
'media-block',
|
|
26
|
+
'info-block',
|
|
27
|
+
'security-block',
|
|
28
|
+
'table-block',
|
|
29
|
+
'tabs-block',
|
|
30
|
+
'simple-block',
|
|
31
|
+
'link-table-block',
|
|
32
|
+
'preview-block',
|
|
33
|
+
'price-detailed',
|
|
34
|
+
'header-slider-block',
|
|
35
|
+
'cards-with-image-block',
|
|
36
|
+
'icons-block',
|
|
37
|
+
'card-layout-block',
|
|
38
|
+
'content-layout-block',
|
|
39
|
+
];
|
|
40
|
+
const constructorCardsSchemaNames = [
|
|
41
|
+
'partner',
|
|
42
|
+
'media-card',
|
|
43
|
+
'banner-card',
|
|
44
|
+
'price-detailed',
|
|
45
|
+
'tutoral-card',
|
|
46
|
+
'background-card',
|
|
47
|
+
'news-card',
|
|
48
|
+
'card-with-image',
|
|
49
|
+
'quote',
|
|
50
|
+
'basic-card',
|
|
51
|
+
];
|
|
52
|
+
const configBlockSchemaNames = Object.keys(blocks).filter((item) => !constructorBlockSchemaNames.includes(item));
|
|
53
|
+
const configCardSchemaNames = Object.keys(blocks).filter((item) => !constructorBlockSchemaNames.includes(item));
|
|
11
54
|
return {
|
|
12
55
|
$id: 'self',
|
|
13
56
|
definitions: {
|
|
@@ -17,38 +60,11 @@ export function generateDefaultSchema(config) {
|
|
|
17
60
|
properties: {
|
|
18
61
|
type: {
|
|
19
62
|
type: 'string',
|
|
20
|
-
enum: [
|
|
21
|
-
'divider',
|
|
22
|
-
'quote',
|
|
23
|
-
'event',
|
|
24
|
-
'post',
|
|
25
|
-
'extended-features-block',
|
|
26
|
-
'promo-features-block',
|
|
27
|
-
'slider-block',
|
|
28
|
-
'questions-block',
|
|
29
|
-
'header-block',
|
|
30
|
-
'banner-block',
|
|
31
|
-
'companies-block',
|
|
32
|
-
'media-block',
|
|
33
|
-
'info-block',
|
|
34
|
-
'security-block',
|
|
35
|
-
'table-block',
|
|
36
|
-
'tabs-block',
|
|
37
|
-
'simple-block',
|
|
38
|
-
'link-table-block',
|
|
39
|
-
'preview-block',
|
|
40
|
-
'price-detailed',
|
|
41
|
-
'header-slider-block',
|
|
42
|
-
'cards-with-image-block',
|
|
43
|
-
'icons-block',
|
|
44
|
-
'card-layout-block',
|
|
45
|
-
'content-layout-block',
|
|
46
|
-
...Object.keys(blocks),
|
|
47
|
-
],
|
|
63
|
+
enum: [...constructorBlockSchemaNames, ...configBlockSchemaNames],
|
|
48
64
|
},
|
|
49
65
|
},
|
|
50
66
|
select: { $data: '0/type' },
|
|
51
|
-
selectCases: Object.assign(Object.assign(
|
|
67
|
+
selectCases: Object.assign(Object.assign({}, blocksValidators), getBlocksCases(blocks)),
|
|
52
68
|
}),
|
|
53
69
|
cards: filteredItem({
|
|
54
70
|
type: 'object',
|
|
@@ -56,24 +72,11 @@ export function generateDefaultSchema(config) {
|
|
|
56
72
|
properties: {
|
|
57
73
|
type: {
|
|
58
74
|
type: 'string',
|
|
59
|
-
enum: [
|
|
60
|
-
'partner',
|
|
61
|
-
'post',
|
|
62
|
-
'media-card',
|
|
63
|
-
'banner-card',
|
|
64
|
-
'price-detailed',
|
|
65
|
-
'tutoral-card',
|
|
66
|
-
'background-card',
|
|
67
|
-
'news-card',
|
|
68
|
-
'card-with-image',
|
|
69
|
-
'quote',
|
|
70
|
-
'basic-card',
|
|
71
|
-
...Object.keys(cards),
|
|
72
|
-
],
|
|
75
|
+
enum: [...constructorCardsSchemaNames, ...configCardSchemaNames],
|
|
73
76
|
},
|
|
74
77
|
},
|
|
75
78
|
select: { $data: '0/type' },
|
|
76
|
-
selectCases: Object.assign(Object.assign(
|
|
79
|
+
selectCases: Object.assign(Object.assign({}, cardsValidators), getBlocksCases(cards)),
|
|
77
80
|
}),
|
|
78
81
|
},
|
|
79
82
|
type: 'object',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3-alpha.0",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -121,5 +121,8 @@
|
|
|
121
121
|
"*.{json,yaml,yml,md}": [
|
|
122
122
|
"prettier --write"
|
|
123
123
|
]
|
|
124
|
+
},
|
|
125
|
+
"publishConfig": {
|
|
126
|
+
"tag": "alpha"
|
|
124
127
|
}
|
|
125
128
|
}
|