@gravity-ui/page-constructor 4.41.1-alpha.0 → 4.42.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/build/cjs/components/Author/Author.css +2 -4
- package/build/cjs/components/Author/Author.js +2 -2
- package/build/cjs/components/ContentList/ContentList.css +16 -16
- package/build/cjs/components/ContentList/ContentList.js +2 -2
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/models/constructor-items/common.d.ts +0 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +1 -12
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +6 -3
- package/build/cjs/schema/constants.d.ts +0 -4
- package/build/cjs/sub-blocks/Content/Content.css +6 -0
- package/build/cjs/sub-blocks/Content/Content.js +2 -1
- package/build/cjs/sub-blocks/PriceCard/PriceCard.css +23 -2
- package/build/cjs/sub-blocks/PriceCard/PriceCard.js +3 -3
- package/build/cjs/sub-blocks/Quote/Quote.css +18 -11
- package/build/cjs/sub-blocks/Quote/Quote.js +6 -7
- package/build/cjs/sub-blocks/Quote/schema.d.ts +0 -4
- package/build/cjs/sub-blocks/Quote/schema.js +1 -4
- package/build/cjs/text-transform/config.js +4 -10
- package/build/esm/components/Author/Author.css +2 -4
- package/build/esm/components/Author/Author.js +2 -2
- package/build/esm/components/ContentList/ContentList.css +16 -16
- package/build/esm/components/ContentList/ContentList.js +2 -2
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/models/constructor-items/common.d.ts +0 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +1 -12
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +7 -4
- package/build/esm/schema/constants.d.ts +0 -4
- package/build/esm/sub-blocks/Content/Content.css +6 -0
- package/build/esm/sub-blocks/Content/Content.js +2 -1
- package/build/esm/sub-blocks/PriceCard/PriceCard.css +23 -2
- package/build/esm/sub-blocks/PriceCard/PriceCard.js +3 -3
- package/build/esm/sub-blocks/Quote/Quote.css +18 -11
- package/build/esm/sub-blocks/Quote/Quote.js +7 -8
- package/build/esm/sub-blocks/Quote/schema.d.ts +0 -4
- package/build/esm/sub-blocks/Quote/schema.js +1 -4
- package/build/esm/text-transform/config.js +4 -10
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +0 -1
- package/server/models/constructor-items/sub-blocks.d.ts +1 -12
- package/server/text-transform/config.js +4 -10
- package/styles/variables.scss +0 -2
- package/widget/index.js +1 -1
|
@@ -2,12 +2,13 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import omit from 'lodash/omit';
|
|
4
4
|
import { BlockIdContext } from '../../../context/blockIdContext';
|
|
5
|
-
import { NavigationItemType } from '../../../models';
|
|
5
|
+
import { NavigationItemType, NavigationItemTypes } from '../../../models';
|
|
6
6
|
import { block } from '../../../utils';
|
|
7
7
|
import { useNavigationItemMap } from './hooks/useNavigationItemMap';
|
|
8
8
|
import './NavigationItem.css';
|
|
9
9
|
const b = block('navigation-item');
|
|
10
10
|
const ANALYTICS_ID = 'navigation';
|
|
11
|
+
const nonComplexNavigationItemTypes = NavigationItemTypes.filter((type) => type !== NavigationItemType.Dropdown);
|
|
11
12
|
const NavigationItem = (_a) => {
|
|
12
13
|
var { data, className, menuLayout } = _a, props = __rest(_a, ["data", "className", "menuLayout"]);
|
|
13
14
|
const { type = NavigationItemType.Link } = data;
|
|
@@ -15,11 +16,13 @@ const NavigationItem = (_a) => {
|
|
|
15
16
|
const Component = navItemMap[type];
|
|
16
17
|
const componentProps = useMemo(() => {
|
|
17
18
|
const componentProperties = Object.assign(Object.assign({}, data), props);
|
|
18
|
-
if (type
|
|
19
|
+
if (nonComplexNavigationItemTypes.includes(type)) {
|
|
19
20
|
return omit(componentProperties, 'hidePopup', 'isActive');
|
|
20
21
|
}
|
|
21
|
-
return
|
|
22
|
-
|
|
22
|
+
return NavigationItemTypes.includes(type)
|
|
23
|
+
? componentProperties
|
|
24
|
+
: Object.assign(Object.assign({}, componentProperties), { menuLayout });
|
|
25
|
+
}, [data, props, type, menuLayout]);
|
|
23
26
|
return (React.createElement(BlockIdContext.Provider, { value: ANALYTICS_ID },
|
|
24
27
|
React.createElement("li", { className: b({ 'menu-layout': menuLayout }, className) },
|
|
25
28
|
React.createElement(Component, Object.assign({}, componentProps, { className: b('content', { type }) })))));
|
|
@@ -73,6 +73,9 @@ unpredictable css rules order in build */
|
|
|
73
73
|
.pc-content_size_s .pc-content__button {
|
|
74
74
|
margin-top: 8px;
|
|
75
75
|
}
|
|
76
|
+
.pc-content_size_s .pc-content__list {
|
|
77
|
+
margin-top: 16px;
|
|
78
|
+
}
|
|
76
79
|
.pc-content_size_l .pc-content__text,
|
|
77
80
|
.pc-content_size_l .pc-content__notice {
|
|
78
81
|
margin-top: 12px;
|
|
@@ -91,6 +94,9 @@ unpredictable css rules order in build */
|
|
|
91
94
|
.pc-content_size_l .pc-content__button {
|
|
92
95
|
margin-top: 12px;
|
|
93
96
|
}
|
|
97
|
+
.pc-content_size_l .pc-content__list {
|
|
98
|
+
margin-top: 24px;
|
|
99
|
+
}
|
|
94
100
|
.pc-content_theme_dark {
|
|
95
101
|
--g-color-line-focus: var(--pc-color-line-focus-dark);
|
|
96
102
|
}
|
|
@@ -46,7 +46,8 @@ const Content = (props) => {
|
|
|
46
46
|
title && (React.createElement(Title, { className: b('title'), title: titleProps, colSizes: { all: 12 }, id: titleId })),
|
|
47
47
|
text && (React.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
|
|
48
48
|
React.createElement(YFMWrapper, { content: text, modifiers: { constructor: true, [`constructor-size-${size}`]: true }, id: textId }))),
|
|
49
|
-
(list === null || list === void 0 ? void 0 : list.length) ? React.createElement(
|
|
49
|
+
(list === null || list === void 0 ? void 0 : list.length) ? (React.createElement("div", { className: b('list') },
|
|
50
|
+
React.createElement(ContentList, { list: list, size: size, qa: qaAttributes.list }))) : null,
|
|
50
51
|
additionalInfo && (React.createElement("div", { className: b('notice') },
|
|
51
52
|
React.createElement(YFMWrapper, { content: additionalInfo, modifiers: {
|
|
52
53
|
constructor: true,
|
|
@@ -3,6 +3,10 @@ unpredictable css rules order in build */
|
|
|
3
3
|
.pc-price-card {
|
|
4
4
|
position: relative;
|
|
5
5
|
}
|
|
6
|
+
.pc-price-card.pc-price-card {
|
|
7
|
+
min-height: auto;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
.pc-price-card__background {
|
|
7
11
|
position: absolute;
|
|
8
12
|
top: 0;
|
|
@@ -59,7 +63,8 @@ unpredictable css rules order in build */
|
|
|
59
63
|
margin-left: 4px;
|
|
60
64
|
}
|
|
61
65
|
.pc-price-card__price-details {
|
|
62
|
-
|
|
66
|
+
font-size: var(--g-text-body-2-font-size);
|
|
67
|
+
line-height: var(--g-text-body-2-line-height);
|
|
63
68
|
}
|
|
64
69
|
.pc-price-card__main {
|
|
65
70
|
flex: 1;
|
|
@@ -69,12 +74,28 @@ unpredictable css rules order in build */
|
|
|
69
74
|
position: relative;
|
|
70
75
|
}
|
|
71
76
|
.pc-price-card__info {
|
|
72
|
-
margin-bottom: 24px;
|
|
73
77
|
flex: 1;
|
|
74
78
|
min-height: 0;
|
|
75
79
|
display: flex;
|
|
76
80
|
flex-direction: column;
|
|
77
81
|
}
|
|
82
|
+
.pc-price-card__description:not(:last-child) {
|
|
83
|
+
margin-bottom: 12px;
|
|
84
|
+
}
|
|
85
|
+
.pc-price-card__links, .pc-price-card__buttons {
|
|
86
|
+
margin-top: 24px;
|
|
87
|
+
}
|
|
78
88
|
.pc-price-card__links > *:not(:last-child), .pc-price-card__buttons > *:not(:last-child) {
|
|
79
89
|
margin-right: 16px;
|
|
90
|
+
}
|
|
91
|
+
.pc-price-card__link {
|
|
92
|
+
margin-top: 0;
|
|
93
|
+
}
|
|
94
|
+
@media (max-width: 769px) {
|
|
95
|
+
.pc-price-card__title, .pc-price-card__price {
|
|
96
|
+
margin-bottom: 16px;
|
|
97
|
+
}
|
|
98
|
+
.pc-price-card__links, .pc-price-card__buttons {
|
|
99
|
+
margin-top: 16px;
|
|
100
|
+
}
|
|
80
101
|
}
|
|
@@ -19,13 +19,13 @@ const PriceCard = (props) => {
|
|
|
19
19
|
"/ ",
|
|
20
20
|
pricePeriod))),
|
|
21
21
|
priceDetails && (React.createElement("div", { className: b('price-details') }, priceDetails))),
|
|
22
|
-
React.createElement("div",
|
|
22
|
+
description && React.createElement("div", { className: b('description') }, description),
|
|
23
23
|
(list === null || list === void 0 ? void 0 : list.length) ? (React.createElement("div", { className: b('list') },
|
|
24
24
|
React.createElement(ContentList, { list: list.map((item) => ({
|
|
25
25
|
icon: Check,
|
|
26
26
|
text: item,
|
|
27
|
-
})), size: "
|
|
27
|
+
})), size: "l" }))) : null),
|
|
28
28
|
buttons && (React.createElement("div", { className: b('buttons') }, buttons.map((button) => (React.createElement(Button, Object.assign({ key: button.url }, button)))))),
|
|
29
|
-
links && (React.createElement("div", { className: b('links') }, links.map((link) => (React.createElement(LinkBlock, Object.assign({ key: link.url, textSize: "m" }, link))))))))));
|
|
29
|
+
links && (React.createElement("div", { className: b('links') }, links.map((link) => (React.createElement(LinkBlock, Object.assign({ className: b('link'), key: link.url, textSize: "m" }, link))))))))));
|
|
30
30
|
};
|
|
31
31
|
export default PriceCard;
|
|
@@ -76,17 +76,6 @@ unpredictable css rules order in build */
|
|
|
76
76
|
.pc-quote__content_quote-type_english-double .pc-quote__text::after {
|
|
77
77
|
content: "”";
|
|
78
78
|
}
|
|
79
|
-
.pc-quote__content .yfm {
|
|
80
|
-
font-size: var(--g-text-body-3-font-size);
|
|
81
|
-
line-height: var(--g-text-body-3-line-height);
|
|
82
|
-
}
|
|
83
|
-
.pc-quote__content .yfm > * {
|
|
84
|
-
display: inline;
|
|
85
|
-
}
|
|
86
|
-
.pc-quote__content .yfm:after {
|
|
87
|
-
position: relative;
|
|
88
|
-
left: -5px;
|
|
89
|
-
}
|
|
90
79
|
.pc-quote__image {
|
|
91
80
|
width: 100%;
|
|
92
81
|
height: 100%;
|
|
@@ -98,6 +87,24 @@ unpredictable css rules order in build */
|
|
|
98
87
|
align-items: flex-end;
|
|
99
88
|
margin-top: 20px;
|
|
100
89
|
}
|
|
90
|
+
.pc-quote__author_theme_dark, .pc-quote_theme_dark {
|
|
91
|
+
color: var(--g-color-text-light-primary);
|
|
92
|
+
}
|
|
93
|
+
.pc-quote__author_theme_dark h1,
|
|
94
|
+
.pc-quote__author_theme_dark h2,
|
|
95
|
+
.pc-quote__author_theme_dark h3,
|
|
96
|
+
.pc-quote__author_theme_dark h4,
|
|
97
|
+
.pc-quote__author_theme_dark h5,
|
|
98
|
+
.pc-quote__author_theme_dark h6,
|
|
99
|
+
.pc-quote__author_theme_dark .yfm, .pc-quote_theme_dark h1,
|
|
100
|
+
.pc-quote_theme_dark h2,
|
|
101
|
+
.pc-quote_theme_dark h3,
|
|
102
|
+
.pc-quote_theme_dark h4,
|
|
103
|
+
.pc-quote_theme_dark h5,
|
|
104
|
+
.pc-quote_theme_dark h6,
|
|
105
|
+
.pc-quote_theme_dark .yfm {
|
|
106
|
+
color: var(--g-color-text-light-primary);
|
|
107
|
+
}
|
|
101
108
|
.pc-quote__author {
|
|
102
109
|
max-width: calc(60% - 20px);
|
|
103
110
|
margin-right: 20px;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Button } from '@gravity-ui/uikit';
|
|
3
|
+
import { Author, HTML, Image } from '../../components';
|
|
3
4
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
4
5
|
import { useTheme } from '../../context/theme';
|
|
5
6
|
import { useAnalytics } from '../../hooks';
|
|
@@ -8,25 +9,23 @@ import { block, getThemedValue } from '../../utils';
|
|
|
8
9
|
import './Quote.css';
|
|
9
10
|
const b = block('quote');
|
|
10
11
|
const Quote = (props) => {
|
|
11
|
-
const { theme: textTheme = 'light', color, image, border = 'shadow', text,
|
|
12
|
+
const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, urlTitle, buttonText, quoteType = QuoteType.Chevron, } = props;
|
|
12
13
|
const theme = useTheme();
|
|
13
14
|
const imageThemed = getThemedValue(image, theme);
|
|
14
15
|
const imageData = getMediaImage(imageThemed);
|
|
15
16
|
const handleAnalytics = useAnalytics(DefaultEventNames.QuoteButton, url);
|
|
16
17
|
const handleButtonClick = useCallback(() => handleAnalytics(), [handleAnalytics]);
|
|
17
18
|
const renderFooter = Boolean(author || url) && (React.createElement("div", { className: b('author-wrapper') },
|
|
18
|
-
author && (React.createElement(Author, { className: b('author', { theme: textTheme }), author: author, type: AuthorType.Line
|
|
19
|
-
url && buttonText &&
|
|
20
|
-
button && React.createElement(Button, Object.assign({ size: "xl" }, button))));
|
|
19
|
+
author && (React.createElement(Author, { className: b('author', { theme: textTheme }), author: author, type: AuthorType.Line })),
|
|
20
|
+
url && buttonText && (React.createElement(Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick, title: urlTitle }, buttonText))));
|
|
21
21
|
const logoProps = getMediaImage(logo);
|
|
22
22
|
return (React.createElement("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {} },
|
|
23
23
|
React.createElement("div", { key: text, className: b('content-wrapper') },
|
|
24
24
|
React.createElement("div", null,
|
|
25
25
|
React.createElement(Image, Object.assign({ className: b('logo') }, logoProps)),
|
|
26
26
|
React.createElement("div", { className: b('content', { 'quote-type': quoteType }) },
|
|
27
|
-
|
|
28
|
-
React.createElement(HTML, null, text))),
|
|
29
|
-
yfmText && (React.createElement(YFMWrapper, { className: b('text'), content: yfmText, modifiers: { constructor: true } })))),
|
|
27
|
+
React.createElement("span", { className: b('text') },
|
|
28
|
+
React.createElement(HTML, null, text)))),
|
|
30
29
|
renderFooter),
|
|
31
30
|
React.createElement("div", { className: b('image-wrapper') },
|
|
32
31
|
React.createElement(Image, Object.assign({}, imageData, { className: b('image') })))));
|
|
@@ -3,13 +3,10 @@ import { BaseProps, ThemeProps, authorItem, quoteTypes, withTheme, } from '../..
|
|
|
3
3
|
export const Quote = {
|
|
4
4
|
quote: {
|
|
5
5
|
additionalProperties: false,
|
|
6
|
-
required: ['image', 'logo'],
|
|
6
|
+
required: ['text', 'image', 'logo'],
|
|
7
7
|
properties: Object.assign(Object.assign({}, BaseProps), { text: {
|
|
8
8
|
type: 'string',
|
|
9
9
|
contentType: 'text',
|
|
10
|
-
}, yfmText: {
|
|
11
|
-
type: 'string',
|
|
12
|
-
contentType: 'text',
|
|
13
10
|
}, image: withTheme(ImageProps), logo: ImageProps, color: {
|
|
14
11
|
type: 'string',
|
|
15
12
|
}, url: {
|
|
@@ -127,16 +127,10 @@ export const config = {
|
|
|
127
127
|
transformer: yfmTransformer,
|
|
128
128
|
},
|
|
129
129
|
],
|
|
130
|
-
[SubBlockType.Quote]:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
fields: ['yfmText'],
|
|
137
|
-
transformer: yfmTransformer,
|
|
138
|
-
},
|
|
139
|
-
],
|
|
130
|
+
[SubBlockType.Quote]: {
|
|
131
|
+
fields: ['text'],
|
|
132
|
+
transformer: typografTransformer,
|
|
133
|
+
},
|
|
140
134
|
[BlockType.ExtendedFeaturesBlock]: [
|
|
141
135
|
...blockHeaderTransformer,
|
|
142
136
|
{
|
package/package.json
CHANGED
|
@@ -63,27 +63,16 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
|
|
|
63
63
|
createDOMElement?: boolean;
|
|
64
64
|
}
|
|
65
65
|
export interface QuoteProps extends Themable, CardBaseProps {
|
|
66
|
-
text
|
|
67
|
-
yfmText?: string;
|
|
66
|
+
text: string;
|
|
68
67
|
image: ThemedImage;
|
|
69
68
|
logo: ImageProps;
|
|
70
69
|
color?: string;
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated use property button instead
|
|
73
|
-
*/
|
|
74
70
|
url?: string;
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated use property button instead
|
|
77
|
-
*/
|
|
78
71
|
urlTitle?: string;
|
|
79
72
|
author?: AuthorItem;
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated use property button instead
|
|
82
|
-
*/
|
|
83
73
|
buttonText?: string;
|
|
84
74
|
theme?: TextTheme;
|
|
85
75
|
quoteType?: QuoteType;
|
|
86
|
-
button?: ButtonProps;
|
|
87
76
|
}
|
|
88
77
|
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
89
78
|
url?: string;
|
|
@@ -140,16 +140,10 @@ exports.config = {
|
|
|
140
140
|
transformer: common_1.yfmTransformer,
|
|
141
141
|
},
|
|
142
142
|
],
|
|
143
|
-
[models_1.SubBlockType.Quote]:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
fields: ['yfmText'],
|
|
150
|
-
transformer: common_1.yfmTransformer,
|
|
151
|
-
},
|
|
152
|
-
],
|
|
143
|
+
[models_1.SubBlockType.Quote]: {
|
|
144
|
+
fields: ['text'],
|
|
145
|
+
transformer: common_1.typografTransformer,
|
|
146
|
+
},
|
|
153
147
|
[models_1.BlockType.ExtendedFeaturesBlock]: [
|
|
154
148
|
...exports.blockHeaderTransformer,
|
|
155
149
|
{
|