@gravity-ui/page-constructor 1.7.0-alpha.9 → 1.7.1-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 +8 -0
- package/README.md +36 -58
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/cjs/blocks/Tabs/Tabs.css +57 -24
- package/build/cjs/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/cjs/blocks/Tabs/Tabs.js +29 -27
- package/build/cjs/components/ButtonTabs/ButtonTabs.css +12 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +13 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.js +26 -0
- package/build/cjs/components/Image/Image.css +4 -0
- package/build/cjs/components/Image/Image.js +3 -1
- package/build/cjs/components/OverflowScroller/OverflowScroller.css +0 -2
- package/build/cjs/components/RouterLink/RouterLink.d.ts +0 -1
- 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/constructor-items.d.ts +1 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +2 -3
- package/build/cjs/containers/PageConstructor/PageConstructor.js +10 -12
- package/build/cjs/context/locationContext/locationContext.d.ts +0 -1
- package/build/cjs/icons/index.d.ts +0 -3
- package/build/cjs/icons/index.js +0 -3
- package/build/cjs/models/constructor-items/blocks.d.ts +9 -8
- package/build/cjs/models/index.d.ts +0 -1
- package/build/cjs/models/index.js +0 -1
- package/build/cjs/text-transform/blocks.js +11 -4
- package/build/cjs/text-transform/utils.js +1 -1
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/esm/blocks/Tabs/Tabs.css +57 -24
- package/build/esm/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/esm/blocks/Tabs/Tabs.js +29 -27
- package/build/esm/components/ButtonTabs/ButtonTabs.css +12 -0
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +14 -0
- package/build/esm/components/ButtonTabs/ButtonTabs.js +24 -0
- package/build/esm/components/Image/Image.css +4 -0
- package/build/esm/components/Image/Image.d.ts +1 -0
- package/build/esm/components/Image/Image.js +4 -1
- package/build/esm/components/OverflowScroller/OverflowScroller.css +0 -2
- package/build/esm/components/RouterLink/RouterLink.d.ts +0 -1
- 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/constructor-items.d.ts +1 -1
- package/build/esm/containers/PageConstructor/PageConstructor.d.ts +2 -3
- package/build/esm/containers/PageConstructor/PageConstructor.js +10 -12
- package/build/esm/context/locationContext/locationContext.d.ts +0 -1
- package/build/esm/icons/index.d.ts +0 -3
- package/build/esm/icons/index.js +0 -3
- package/build/esm/models/constructor-items/blocks.d.ts +9 -8
- package/build/esm/models/index.d.ts +0 -1
- package/build/esm/models/index.js +0 -1
- package/build/esm/text-transform/blocks.js +11 -4
- package/build/esm/text-transform/utils.js +1 -1
- package/package.json +5 -2
- package/server/models/constructor-items/blocks.d.ts +9 -8
- package/server/models/index.d.ts +0 -1
- package/server/models/index.js +0 -1
- package/server/text-transform/blocks.js +11 -4
- package/server/text-transform/utils.js +1 -1
- package/styles/mixins.scss +0 -38
- package/build/cjs/components/navigation/components/Header/Header.css +0 -85
- package/build/cjs/components/navigation/components/Header/Header.d.ts +0 -8
- package/build/cjs/components/navigation/components/Header/Header.js +0 -51
- package/build/cjs/components/navigation/components/Logo/Logo.css +0 -23
- package/build/cjs/components/navigation/components/Logo/Logo.d.ts +0 -7
- package/build/cjs/components/navigation/components/Logo/Logo.js +0 -17
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.css +0 -58
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +0 -13
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.js +0 -45
- package/build/cjs/components/navigation/components/Navigation/Navigation.css +0 -43
- package/build/cjs/components/navigation/components/Navigation/Navigation.d.ts +0 -18
- package/build/cjs/components/navigation/components/Navigation/Navigation.js +0 -69
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.css +0 -41
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.d.ts +0 -10
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.js +0 -59
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.css +0 -33
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +0 -10
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.js +0 -45
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.css +0 -20
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.d.ts +0 -7
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.js +0 -14
- package/build/cjs/components/navigation/components/index.d.ts +0 -7
- package/build/cjs/components/navigation/components/index.js +0 -20
- package/build/cjs/components/navigation/containers/Layout/Layout.css +0 -10
- package/build/cjs/components/navigation/containers/Layout/Layout.d.ts +0 -8
- package/build/cjs/components/navigation/containers/Layout/Layout.js +0 -11
- package/build/cjs/icons/NavigationArrow.d.ts +0 -2
- package/build/cjs/icons/NavigationArrow.js +0 -9
- package/build/cjs/icons/NavigationClose.d.ts +0 -2
- package/build/cjs/icons/NavigationClose.js +0 -9
- package/build/cjs/icons/NavigationOpen.d.ts +0 -2
- package/build/cjs/icons/NavigationOpen.js +0 -11
- package/build/cjs/models/navigation.d.ts +0 -62
- package/build/cjs/models/navigation.js +0 -10
- package/build/esm/components/navigation/components/Header/Header.css +0 -85
- package/build/esm/components/navigation/components/Header/Header.d.ts +0 -9
- package/build/esm/components/navigation/components/Header/Header.js +0 -47
- package/build/esm/components/navigation/components/Logo/Logo.css +0 -23
- package/build/esm/components/navigation/components/Logo/Logo.d.ts +0 -8
- package/build/esm/components/navigation/components/Logo/Logo.js +0 -15
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.css +0 -58
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +0 -14
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.js +0 -43
- package/build/esm/components/navigation/components/Navigation/Navigation.css +0 -43
- package/build/esm/components/navigation/components/Navigation/Navigation.d.ts +0 -19
- package/build/esm/components/navigation/components/Navigation/Navigation.js +0 -68
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.css +0 -41
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.d.ts +0 -11
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.js +0 -58
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.css +0 -33
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +0 -11
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.js +0 -41
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.css +0 -20
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.d.ts +0 -8
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.js +0 -12
- package/build/esm/components/navigation/components/index.d.ts +0 -7
- package/build/esm/components/navigation/components/index.js +0 -7
- package/build/esm/components/navigation/containers/Layout/Layout.css +0 -10
- package/build/esm/components/navigation/containers/Layout/Layout.d.ts +0 -9
- package/build/esm/components/navigation/containers/Layout/Layout.js +0 -9
- package/build/esm/icons/NavigationArrow.d.ts +0 -2
- package/build/esm/icons/NavigationArrow.js +0 -4
- package/build/esm/icons/NavigationClose.d.ts +0 -2
- package/build/esm/icons/NavigationClose.js +0 -4
- package/build/esm/icons/NavigationOpen.d.ts +0 -2
- package/build/esm/icons/NavigationOpen.js +0 -6
- package/build/esm/models/navigation.d.ts +0 -62
- package/build/esm/models/navigation.js +0 -7
- package/server/models/navigation.d.ts +0 -62
- package/server/models/navigation.js +0 -10
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useContext, useMemo } from 'react';
|
|
3
|
-
import '@doc-tools/transform/dist/js/yfm';
|
|
4
3
|
import { HeaderBlockTypes, BlockTypes, } from '../../models';
|
|
5
4
|
import { blockMap, subBlockMap } from '../../constructor-items';
|
|
6
5
|
import { Grid } from '../../grid';
|
|
@@ -13,7 +12,7 @@ import { ConstructorRow } from './components/ConstructorRow';
|
|
|
13
12
|
import { ConstructorFootnotes } from './components/ConstructorFootnotes';
|
|
14
13
|
import { ConstructorHeader } from './components/ConstructorItem';
|
|
15
14
|
import { ConstructorBlocks } from './components/ConstructorBlocks';
|
|
16
|
-
import
|
|
15
|
+
import '@doc-tools/transform/dist/js/yfm';
|
|
17
16
|
import './PageConstructor.css';
|
|
18
17
|
const b = cnBlock('page-constructor');
|
|
19
18
|
export const Constructor = (props) => {
|
|
@@ -29,7 +28,7 @@ export const Constructor = (props) => {
|
|
|
29
28
|
});
|
|
30
29
|
}, [props.custom]);
|
|
31
30
|
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
32
|
-
const { content: { blocks = [], background = {}, footnotes = [] } = {}, renderMenu, shouldRenderBlock,
|
|
31
|
+
const { content: { blocks = [], background = {}, footnotes = [] } = {}, renderMenu, shouldRenderBlock, } = props;
|
|
33
32
|
const hasFootnotes = footnotes.length > 0;
|
|
34
33
|
const isHeaderBlock = (block) => headerBlockTypes.includes(block.type);
|
|
35
34
|
const header = blocks === null || blocks === void 0 ? void 0 : blocks.find(isHeaderBlock);
|
|
@@ -38,15 +37,14 @@ export const Constructor = (props) => {
|
|
|
38
37
|
return (React.createElement(InnerContext.Provider, { value: context },
|
|
39
38
|
React.createElement("div", { className: b() },
|
|
40
39
|
React.createElement("div", { className: b('wrapper') },
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
React.createElement(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
React.createElement(ConstructorFootnotes, { items: footnotes })))))))));
|
|
40
|
+
React.createElement(BackgroundMedia, Object.assign({}, themedBackground, { className: b('background') })),
|
|
41
|
+
renderMenu && renderMenu(),
|
|
42
|
+
header && React.createElement(ConstructorHeader, { data: header }),
|
|
43
|
+
React.createElement(Grid, null,
|
|
44
|
+
restBlocks && (React.createElement(ConstructorRow, null,
|
|
45
|
+
React.createElement(ConstructorBlocks, { items: restBlocks, shouldRenderBlock: shouldRenderBlock }))),
|
|
46
|
+
hasFootnotes && (React.createElement(ConstructorRow, null,
|
|
47
|
+
React.createElement(ConstructorFootnotes, { items: footnotes }))))))));
|
|
50
48
|
};
|
|
51
49
|
export const PageConstructor = (props) => {
|
|
52
50
|
const { content: { animated = true } = {} } = props, rest = __rest(props, ["content"]);
|
package/build/esm/icons/index.js
CHANGED
|
@@ -114,14 +114,12 @@ export interface SimpleBlockProps extends Animatable, Childable {
|
|
|
114
114
|
title: TitleBaseProps;
|
|
115
115
|
description: string;
|
|
116
116
|
}
|
|
117
|
-
export interface ExtendedFeaturesItem {
|
|
118
|
-
title
|
|
119
|
-
text?: string;
|
|
117
|
+
export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
|
|
118
|
+
title: string;
|
|
120
119
|
label?: string;
|
|
121
120
|
icon?: ThemedImage;
|
|
122
121
|
/** @deprecated **/
|
|
123
122
|
link?: LinkProps;
|
|
124
|
-
links?: LinkProps[];
|
|
125
123
|
}
|
|
126
124
|
export interface ExtendedFeaturesProps extends Animatable {
|
|
127
125
|
items: ExtendedFeaturesItem[];
|
|
@@ -221,18 +219,21 @@ export interface TableBlockProps {
|
|
|
221
219
|
title: string;
|
|
222
220
|
table: TableProps;
|
|
223
221
|
}
|
|
224
|
-
export interface TabsBlockItem {
|
|
222
|
+
export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'> {
|
|
225
223
|
tabName: string;
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
/**
|
|
225
|
+
* @deprecated Use array links from ContentBlockProps instead
|
|
226
|
+
*/
|
|
228
227
|
link?: LinkProps;
|
|
229
228
|
image?: ThemedImage;
|
|
230
229
|
disableCompress?: boolean;
|
|
231
230
|
caption?: string;
|
|
232
231
|
media?: ThemedMediaProps;
|
|
233
|
-
links?: LinkProps[];
|
|
234
232
|
}
|
|
235
233
|
export interface TabsBlockProps extends BlockHeaderProps, Animatable {
|
|
234
|
+
tabsColSizes?: GridColumnSizesType;
|
|
235
|
+
centered?: boolean;
|
|
236
|
+
direction?: MediaDirection;
|
|
236
237
|
items: TabsBlockItem[];
|
|
237
238
|
}
|
|
238
239
|
export interface LinkTableBlockProps extends BlockHeaderProps {
|
|
@@ -19,7 +19,6 @@ export const createItemsParser = (fields) => (transformer, items) => items.map((
|
|
|
19
19
|
}, {}));
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
const parseItems = createItemsParser(['title', 'text']);
|
|
23
22
|
function parseTableBlock(transformer, content) {
|
|
24
23
|
const legend = content === null || content === void 0 ? void 0 : content.legend;
|
|
25
24
|
return Object.assign(Object.assign({}, (content || {})), { legend: legend && legend.map((string) => transformer(string)) });
|
|
@@ -45,9 +44,13 @@ function parseSlider(transformer, block) {
|
|
|
45
44
|
}
|
|
46
45
|
const parseTitle = (transformer, title) => typeof title === 'object' && 'text' in title
|
|
47
46
|
? Object.assign(Object.assign({}, title), { text: transformer(title.text) }) : title && transformer(title);
|
|
47
|
+
const parseItemsTitle = (transformer, items) => items.map((_a) => {
|
|
48
|
+
var { title } = _a, rest = __rest(_a, ["title"]);
|
|
49
|
+
return (Object.assign({ title: title && parseTitle(transformer, title) }, rest));
|
|
50
|
+
});
|
|
48
51
|
function parsePriceDetailedBlock(transformer, block) {
|
|
49
52
|
const { priceType } = block;
|
|
50
|
-
|
|
53
|
+
block.items = block.items.map((item) => {
|
|
51
54
|
const { description, items: details = [] } = item;
|
|
52
55
|
if (priceType === 'marked-list') {
|
|
53
56
|
item.items = details.map((detail) => {
|
|
@@ -64,7 +67,6 @@ function parsePriceDetailedBlock(transformer, block) {
|
|
|
64
67
|
item.description = transformer(description);
|
|
65
68
|
return item;
|
|
66
69
|
});
|
|
67
|
-
block.items = transformedBlockItems;
|
|
68
70
|
return block;
|
|
69
71
|
}
|
|
70
72
|
const parseContentLayout = (transformer, content) => {
|
|
@@ -220,7 +222,12 @@ const config = {
|
|
|
220
222
|
{
|
|
221
223
|
fields: ['items'],
|
|
222
224
|
transformer: yfmTransformer,
|
|
223
|
-
parser:
|
|
225
|
+
parser: createItemsParser(['text', 'additionalInfo']),
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
fields: ['items'],
|
|
229
|
+
transformer: typografTransformer,
|
|
230
|
+
parser: parseItemsTitle,
|
|
224
231
|
},
|
|
225
232
|
],
|
|
226
233
|
[BlockType.TableBlock]: [
|
|
@@ -23,7 +23,7 @@ export const DEFAULT_ALLOWED_TAGS = [
|
|
|
23
23
|
];
|
|
24
24
|
export const typografConfig = {
|
|
25
25
|
enabled: ['common/nbsp/afterNumber', 'common/nbsp/afterParagraphMark'],
|
|
26
|
-
disabled: ['common/symbols/cf'],
|
|
26
|
+
disabled: ['common/symbols/cf', 'ru/other/phone-number'],
|
|
27
27
|
};
|
|
28
28
|
export const sanitizeStripOptions = {
|
|
29
29
|
allowedTags: [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1-alpha.0",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"typograf": "^6.14.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"react": "^16.0.0",
|
|
60
|
+
"react": "^16.0.0 || ^17.0.0",
|
|
61
61
|
"@gravity-ui/uikit": "^3.0.1",
|
|
62
62
|
"@doc-tools/transform": "^2.6.1"
|
|
63
63
|
},
|
|
@@ -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
|
}
|
|
@@ -114,14 +114,12 @@ export interface SimpleBlockProps extends Animatable, Childable {
|
|
|
114
114
|
title: TitleBaseProps;
|
|
115
115
|
description: string;
|
|
116
116
|
}
|
|
117
|
-
export interface ExtendedFeaturesItem {
|
|
118
|
-
title
|
|
119
|
-
text?: string;
|
|
117
|
+
export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
|
|
118
|
+
title: string;
|
|
120
119
|
label?: string;
|
|
121
120
|
icon?: ThemedImage;
|
|
122
121
|
/** @deprecated **/
|
|
123
122
|
link?: LinkProps;
|
|
124
|
-
links?: LinkProps[];
|
|
125
123
|
}
|
|
126
124
|
export interface ExtendedFeaturesProps extends Animatable {
|
|
127
125
|
items: ExtendedFeaturesItem[];
|
|
@@ -221,18 +219,21 @@ export interface TableBlockProps {
|
|
|
221
219
|
title: string;
|
|
222
220
|
table: TableProps;
|
|
223
221
|
}
|
|
224
|
-
export interface TabsBlockItem {
|
|
222
|
+
export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'> {
|
|
225
223
|
tabName: string;
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
/**
|
|
225
|
+
* @deprecated Use array links from ContentBlockProps instead
|
|
226
|
+
*/
|
|
228
227
|
link?: LinkProps;
|
|
229
228
|
image?: ThemedImage;
|
|
230
229
|
disableCompress?: boolean;
|
|
231
230
|
caption?: string;
|
|
232
231
|
media?: ThemedMediaProps;
|
|
233
|
-
links?: LinkProps[];
|
|
234
232
|
}
|
|
235
233
|
export interface TabsBlockProps extends BlockHeaderProps, Animatable {
|
|
234
|
+
tabsColSizes?: GridColumnSizesType;
|
|
235
|
+
centered?: boolean;
|
|
236
|
+
direction?: MediaDirection;
|
|
236
237
|
items: TabsBlockItem[];
|
|
237
238
|
}
|
|
238
239
|
export interface LinkTableBlockProps extends BlockHeaderProps {
|
package/server/models/index.d.ts
CHANGED
package/server/models/index.js
CHANGED
|
@@ -36,7 +36,6 @@ const createItemsParser = (fields) => (transformer, items) => items.map((item) =
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
exports.createItemsParser = createItemsParser;
|
|
39
|
-
const parseItems = (0, exports.createItemsParser)(['title', 'text']);
|
|
40
39
|
function parseTableBlock(transformer, content) {
|
|
41
40
|
const legend = content === null || content === void 0 ? void 0 : content.legend;
|
|
42
41
|
return Object.assign(Object.assign({}, (content || {})), { legend: legend && legend.map((string) => transformer(string)) });
|
|
@@ -62,9 +61,13 @@ function parseSlider(transformer, block) {
|
|
|
62
61
|
}
|
|
63
62
|
const parseTitle = (transformer, title) => typeof title === 'object' && 'text' in title
|
|
64
63
|
? Object.assign(Object.assign({}, title), { text: transformer(title.text) }) : title && transformer(title);
|
|
64
|
+
const parseItemsTitle = (transformer, items) => items.map((_a) => {
|
|
65
|
+
var { title } = _a, rest = __rest(_a, ["title"]);
|
|
66
|
+
return (Object.assign({ title: title && parseTitle(transformer, title) }, rest));
|
|
67
|
+
});
|
|
65
68
|
function parsePriceDetailedBlock(transformer, block) {
|
|
66
69
|
const { priceType } = block;
|
|
67
|
-
|
|
70
|
+
block.items = block.items.map((item) => {
|
|
68
71
|
const { description, items: details = [] } = item;
|
|
69
72
|
if (priceType === 'marked-list') {
|
|
70
73
|
item.items = details.map((detail) => {
|
|
@@ -81,7 +84,6 @@ function parsePriceDetailedBlock(transformer, block) {
|
|
|
81
84
|
item.description = transformer(description);
|
|
82
85
|
return item;
|
|
83
86
|
});
|
|
84
|
-
block.items = transformedBlockItems;
|
|
85
87
|
return block;
|
|
86
88
|
}
|
|
87
89
|
const parseContentLayout = (transformer, content) => {
|
|
@@ -239,7 +241,12 @@ const config = {
|
|
|
239
241
|
{
|
|
240
242
|
fields: ['items'],
|
|
241
243
|
transformer: yfmTransformer,
|
|
242
|
-
parser:
|
|
244
|
+
parser: (0, exports.createItemsParser)(['text', 'additionalInfo']),
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
fields: ['items'],
|
|
248
|
+
transformer: typografTransformer,
|
|
249
|
+
parser: parseItemsTitle,
|
|
243
250
|
},
|
|
244
251
|
],
|
|
245
252
|
[models_1.BlockType.TableBlock]: [
|
|
@@ -39,7 +39,7 @@ exports.DEFAULT_ALLOWED_TAGS = [
|
|
|
39
39
|
];
|
|
40
40
|
exports.typografConfig = {
|
|
41
41
|
enabled: ['common/nbsp/afterNumber', 'common/nbsp/afterParagraphMark'],
|
|
42
|
-
disabled: ['common/symbols/cf'],
|
|
42
|
+
disabled: ['common/symbols/cf', 'ru/other/phone-number'],
|
|
43
43
|
};
|
|
44
44
|
exports.sanitizeStripOptions = {
|
|
45
45
|
allowedTags: [],
|
package/styles/mixins.scss
CHANGED
|
@@ -442,41 +442,3 @@ unpredictable css rules order in build */
|
|
|
442
442
|
@mixin font-feature-settings {
|
|
443
443
|
font-feature-settings: 'liga', 'kern', 'pnum' on, 'lnum' on, 'ss03' on;
|
|
444
444
|
}
|
|
445
|
-
|
|
446
|
-
@mixin navigation-popup {
|
|
447
|
-
z-index: 101;
|
|
448
|
-
|
|
449
|
-
display: flex;
|
|
450
|
-
flex-direction: column;
|
|
451
|
-
|
|
452
|
-
min-width: 220px;
|
|
453
|
-
padding: $indentXS;
|
|
454
|
-
|
|
455
|
-
border: 1px solid var(--yc-color-line-generic);
|
|
456
|
-
border-top-width: 0;
|
|
457
|
-
border-radius: calc(#{$borderRadius} / 2);
|
|
458
|
-
background: var(--yc-color-base-float);
|
|
459
|
-
box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
@mixin navigation-item {
|
|
463
|
-
color: var(--yc-color-text-primary);
|
|
464
|
-
@include reset-link-style();
|
|
465
|
-
@include islands-focus();
|
|
466
|
-
|
|
467
|
-
&:hover,
|
|
468
|
-
&_active {
|
|
469
|
-
color: var(--yc-color-text-link);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
@mixin navigation-link() {
|
|
474
|
-
cursor: pointer;
|
|
475
|
-
@include islands-focus();
|
|
476
|
-
@include reset-link-style();
|
|
477
|
-
|
|
478
|
-
&:hover,
|
|
479
|
-
&:active {
|
|
480
|
-
color: var(--yc-color-text-link);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/* use this for style redefinitions to awoid problems with
|
|
2
|
-
unpredictable css rules order in build */
|
|
3
|
-
.pc-header {
|
|
4
|
-
position: sticky;
|
|
5
|
-
z-index: 98;
|
|
6
|
-
top: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
align-items: center;
|
|
10
|
-
height: var(--header-height);
|
|
11
|
-
background-color: var(--yc-color-base-background);
|
|
12
|
-
box-shadow: inset 0 -1px 0 var(--yc-color-line-generic);
|
|
13
|
-
}
|
|
14
|
-
.pc-header__wrapper {
|
|
15
|
-
display: flex;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
align-items: center;
|
|
18
|
-
height: var(--header-height);
|
|
19
|
-
}
|
|
20
|
-
@media (min-width: 769px) {
|
|
21
|
-
.pc-header__mobile-menu-button {
|
|
22
|
-
display: none;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
.pc-header__navigation, .pc-header__left, .pc-header__right {
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
}
|
|
29
|
-
.pc-header__navigation {
|
|
30
|
-
position: relative;
|
|
31
|
-
margin-right: 20px;
|
|
32
|
-
flex: 1 0 0;
|
|
33
|
-
justify-content: flex-start;
|
|
34
|
-
}
|
|
35
|
-
@media (max-width: 768px) {
|
|
36
|
-
.pc-header__navigation {
|
|
37
|
-
display: none;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
.pc-header__right {
|
|
41
|
-
flex: 0;
|
|
42
|
-
justify-content: flex-end;
|
|
43
|
-
}
|
|
44
|
-
.pc-header__navigation-container {
|
|
45
|
-
display: flex;
|
|
46
|
-
overflow-x: hidden;
|
|
47
|
-
flex: 1 0 0;
|
|
48
|
-
justify-content: space-between;
|
|
49
|
-
align-items: center;
|
|
50
|
-
margin-right: 20px;
|
|
51
|
-
}
|
|
52
|
-
.pc-header__buttons {
|
|
53
|
-
display: flex;
|
|
54
|
-
}
|
|
55
|
-
@media (max-width: 768px) {
|
|
56
|
-
.pc-header__buttons {
|
|
57
|
-
display: none;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
.pc-header__buttons > *:not(:last-child) {
|
|
61
|
-
margin-right: 16px;
|
|
62
|
-
}
|
|
63
|
-
.pc-header__button {
|
|
64
|
-
margin-top: 0;
|
|
65
|
-
}
|
|
66
|
-
.pc-header__logo {
|
|
67
|
-
margin: 0 32px 0 0;
|
|
68
|
-
cursor: pointer;
|
|
69
|
-
}
|
|
70
|
-
@media (max-width: 768px) {
|
|
71
|
-
.pc-header__navigation-container {
|
|
72
|
-
justify-content: flex-end;
|
|
73
|
-
}
|
|
74
|
-
.pc-header__left {
|
|
75
|
-
flex: 1 0 0;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
@media (max-width: 576px) {
|
|
79
|
-
.pc-header__navigation-container {
|
|
80
|
-
margin-right: 12px;
|
|
81
|
-
}
|
|
82
|
-
.pc-header__logo {
|
|
83
|
-
margin-right: 0;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Header = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
6
|
-
const utils_1 = require("../../../../utils");
|
|
7
|
-
const grid_1 = require("../../../../grid");
|
|
8
|
-
const OutsideClick_1 = (0, tslib_1.__importDefault)(require("../../../OutsideClick/OutsideClick"));
|
|
9
|
-
const Control_1 = (0, tslib_1.__importDefault)(require("../../../Control/Control"));
|
|
10
|
-
const Navigation_1 = (0, tslib_1.__importDefault)(require("../Navigation/Navigation"));
|
|
11
|
-
const MobileNavigation_1 = (0, tslib_1.__importDefault)(require("../MobileNavigation/MobileNavigation"));
|
|
12
|
-
const NavigationItem_1 = (0, tslib_1.__importDefault)(require("../NavigationItem/NavigationItem"));
|
|
13
|
-
const Logo_1 = (0, tslib_1.__importDefault)(require("../Logo/Logo"));
|
|
14
|
-
const icons_1 = require("../../../../icons");
|
|
15
|
-
const b = (0, utils_1.block)('header');
|
|
16
|
-
const MobileMenuButton = ({ isSidebarOpened, onSidebarOpenedChange, }) => {
|
|
17
|
-
const iconProps = { icon: isSidebarOpened ? icons_1.NavigationClose : icons_1.NavigationOpen, iconSize: 36 };
|
|
18
|
-
return (react_1.default.createElement(Control_1.default, Object.assign({ className: b('mobile-menu-button'), onClick: (e) => {
|
|
19
|
-
e.stopPropagation();
|
|
20
|
-
onSidebarOpenedChange(!isSidebarOpened);
|
|
21
|
-
}, size: "l" }, iconProps)));
|
|
22
|
-
};
|
|
23
|
-
const Header = ({ data, logo }) => {
|
|
24
|
-
const { leftItems, rightItems } = data;
|
|
25
|
-
const [isSidebarOpened, setIsSidebarOpened] = (0, react_1.useState)(false);
|
|
26
|
-
const [activeItemIndex, setActiveItemIndex] = (0, react_1.useState)(-1);
|
|
27
|
-
const onActiveItemChange = (0, react_1.useCallback)((index) => {
|
|
28
|
-
setActiveItemIndex(index);
|
|
29
|
-
}, []);
|
|
30
|
-
const onSidebarOpenedChange = (0, react_1.useCallback)((isOpen) => {
|
|
31
|
-
setIsSidebarOpened(isOpen);
|
|
32
|
-
}, []);
|
|
33
|
-
const hideSidebar = (0, react_1.useCallback)(() => {
|
|
34
|
-
setIsSidebarOpened(false);
|
|
35
|
-
}, []);
|
|
36
|
-
return (react_1.default.createElement(grid_1.Grid, { className: b() },
|
|
37
|
-
react_1.default.createElement(grid_1.Row, null,
|
|
38
|
-
react_1.default.createElement(grid_1.Col, null,
|
|
39
|
-
react_1.default.createElement("header", { className: b('wrapper') },
|
|
40
|
-
logo && (react_1.default.createElement("div", { className: b('left') },
|
|
41
|
-
react_1.default.createElement(Logo_1.default, Object.assign({}, logo, { className: b('logo') })))),
|
|
42
|
-
react_1.default.createElement("div", { className: b('navigation-container') },
|
|
43
|
-
react_1.default.createElement(Navigation_1.default, { className: b('navigation'), links: leftItems, activeItemIndex: activeItemIndex, onActiveItemChange: onActiveItemChange })),
|
|
44
|
-
react_1.default.createElement("div", { className: b('right') },
|
|
45
|
-
react_1.default.createElement(MobileMenuButton, { isSidebarOpened: isSidebarOpened, onSidebarOpenedChange: onSidebarOpenedChange }),
|
|
46
|
-
rightItems && (react_1.default.createElement("div", { className: b('buttons') }, rightItems.map((button) => (react_1.default.createElement(NavigationItem_1.default, { key: button.text, data: button, className: b('button') })))))),
|
|
47
|
-
react_1.default.createElement(OutsideClick_1.default, { onOutsideClick: () => onSidebarOpenedChange(false) },
|
|
48
|
-
react_1.default.createElement(MobileNavigation_1.default, { topItems: leftItems, bottomItems: rightItems, isOpened: isSidebarOpened, activeItemIndex: activeItemIndex, onActiveItemChange: onActiveItemChange, onClose: hideSidebar })))))));
|
|
49
|
-
};
|
|
50
|
-
exports.Header = Header;
|
|
51
|
-
exports.default = exports.Header;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.pc-logo {
|
|
2
|
-
margin: 0;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
/* use this for style redefinitions to awoid problems with
|
|
6
|
-
unpredictable css rules order in build */
|
|
7
|
-
.pc-logo {
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
11
|
-
font-size: var(--yc-text-header-1-font-size);
|
|
12
|
-
line-height: var(--yc-text-header-1-line-height);
|
|
13
|
-
color: var(--pc-text-header-color);
|
|
14
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
15
|
-
}
|
|
16
|
-
.pc-logo__icon {
|
|
17
|
-
display: flex;
|
|
18
|
-
margin-right: 8px;
|
|
19
|
-
object-fit: contain;
|
|
20
|
-
}
|
|
21
|
-
.pc-logo__text {
|
|
22
|
-
white-space: nowrap;
|
|
23
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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 RouterLink_1 = (0, tslib_1.__importDefault)(require("../../../RouterLink/RouterLink"));
|
|
7
|
-
const utils_2 = require("../../../Media/Image/utils");
|
|
8
|
-
const index_1 = require("../../../index");
|
|
9
|
-
const b = (0, utils_1.block)('logo');
|
|
10
|
-
const Logo = ({ icon, text, className }) => {
|
|
11
|
-
const imageData = (0, utils_2.getMediaImage)(icon);
|
|
12
|
-
return (react_1.default.createElement(RouterLink_1.default, { href: "/", passHref: true },
|
|
13
|
-
react_1.default.createElement("div", { className: b(null, className) },
|
|
14
|
-
imageData && react_1.default.createElement(index_1.Image, Object.assign({ className: b('icon') }, imageData)),
|
|
15
|
-
react_1.default.createElement("span", { className: b('text') }, text))));
|
|
16
|
-
};
|
|
17
|
-
exports.default = Logo;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/* use this for style redefinitions to awoid problems with
|
|
2
|
-
unpredictable css rules order in build */
|
|
3
|
-
.pc-mobile-navigation {
|
|
4
|
-
position: fixed;
|
|
5
|
-
z-index: 100;
|
|
6
|
-
top: var(--header-height);
|
|
7
|
-
left: 0;
|
|
8
|
-
width: 100%;
|
|
9
|
-
border-bottom-right-radius: var(--pc-border-radius);
|
|
10
|
-
border-bottom-left-radius: var(--pc-border-radius);
|
|
11
|
-
background-color: var(--yc-color-base-background);
|
|
12
|
-
box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
|
|
13
|
-
font-size: var(--yc-text-body-2-font-size);
|
|
14
|
-
line-height: var(--yc-text-body-2-line-height);
|
|
15
|
-
}
|
|
16
|
-
@media (min-width: 769px) {
|
|
17
|
-
.pc-mobile-navigation {
|
|
18
|
-
display: none;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
.pc-mobile-navigation__wrapper {
|
|
22
|
-
padding: 32px 20px;
|
|
23
|
-
}
|
|
24
|
-
.pc-mobile-navigation__button {
|
|
25
|
-
margin-top: 24px;
|
|
26
|
-
}
|
|
27
|
-
.pc-mobile-navigation__links {
|
|
28
|
-
position: relative;
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
padding-bottom: 24px;
|
|
32
|
-
margin: 0;
|
|
33
|
-
padding: 0;
|
|
34
|
-
list-style: none;
|
|
35
|
-
}
|
|
36
|
-
.pc-mobile-navigation__links-item:not(:last-child) {
|
|
37
|
-
margin-bottom: 24px;
|
|
38
|
-
}
|
|
39
|
-
.pc-mobile-navigation__dropdown-item:not(:last-child) {
|
|
40
|
-
margin-bottom: 16px;
|
|
41
|
-
}
|
|
42
|
-
.pc-mobile-navigation__popup {
|
|
43
|
-
z-index: 101;
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
min-width: 220px;
|
|
47
|
-
padding: 16px;
|
|
48
|
-
border: 1px solid var(--yc-color-line-generic);
|
|
49
|
-
border-top-width: 0;
|
|
50
|
-
border-radius: calc(var(--pc-border-radius) / 2);
|
|
51
|
-
background: var(--yc-color-base-float);
|
|
52
|
-
box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
|
|
53
|
-
}
|
|
54
|
-
@media (min-width: 769px) {
|
|
55
|
-
.pc-mobile-navigation__popup {
|
|
56
|
-
display: none;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { NavigationItem as NavigationItemModel } from '../../../../models/navigation';
|
|
3
|
-
export interface MobileNavigationProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
isOpened?: boolean;
|
|
6
|
-
topItems?: NavigationItemModel[];
|
|
7
|
-
bottomItems?: NavigationItemModel[];
|
|
8
|
-
activeItemIndex: number;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
onActiveItemChange: (index: number) => void;
|
|
11
|
-
}
|
|
12
|
-
declare const MobileNavigation: React.FC<MobileNavigationProps>;
|
|
13
|
-
export default MobileNavigation;
|