@gravity-ui/page-constructor 4.41.0 → 4.41.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/build/cjs/components/Author/Author.css +4 -2
- package/build/cjs/components/Author/Author.js +2 -2
- package/build/cjs/models/constructor-items/common.d.ts +1 -0
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +12 -1
- package/build/cjs/schema/constants.d.ts +4 -0
- package/build/cjs/sub-blocks/Quote/Quote.css +11 -18
- package/build/cjs/sub-blocks/Quote/Quote.js +7 -6
- package/build/cjs/sub-blocks/Quote/schema.d.ts +4 -0
- package/build/cjs/sub-blocks/Quote/schema.js +4 -1
- package/build/cjs/text-transform/config.js +10 -4
- package/build/esm/components/Author/Author.css +4 -2
- package/build/esm/components/Author/Author.js +2 -2
- package/build/esm/models/constructor-items/common.d.ts +1 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +12 -1
- package/build/esm/schema/constants.d.ts +4 -0
- package/build/esm/sub-blocks/Quote/Quote.css +11 -18
- package/build/esm/sub-blocks/Quote/Quote.js +8 -7
- package/build/esm/sub-blocks/Quote/schema.d.ts +4 -0
- package/build/esm/sub-blocks/Quote/schema.js +4 -1
- package/build/esm/text-transform/config.js +10 -4
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +1 -0
- package/server/models/constructor-items/sub-blocks.d.ts +12 -1
- package/server/text-transform/config.js +10 -4
- package/styles/variables.scss +2 -0
- package/widget/index.js +1 -1
|
@@ -5,7 +5,6 @@ unpredictable css rules order in build */
|
|
|
5
5
|
line-height: var(--g-text-body-3-line-height);
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
|
-
color: var(--g-color-text-secondary);
|
|
9
8
|
}
|
|
10
9
|
.pc-author__avatar {
|
|
11
10
|
width: 80px;
|
|
@@ -25,11 +24,11 @@ unpredictable css rules order in build */
|
|
|
25
24
|
.pc-author__name {
|
|
26
25
|
font-size: var(--g-text-body-3-font-size);
|
|
27
26
|
line-height: var(--g-text-body-3-line-height);
|
|
28
|
-
color: var(--g-color-text-primary);
|
|
29
27
|
}
|
|
30
28
|
.pc-author__description {
|
|
31
29
|
font-size: var(--g-text-body-2-font-size);
|
|
32
30
|
line-height: var(--g-text-body-2-line-height);
|
|
31
|
+
color: var(--g-color-text-secondary);
|
|
33
32
|
padding-top: 4px;
|
|
34
33
|
}
|
|
35
34
|
.pc-author__label:not(:first-child) {
|
|
@@ -53,4 +52,7 @@ unpredictable css rules order in build */
|
|
|
53
52
|
}
|
|
54
53
|
.pc-author_type_line .pc-author__label:not(:first-child) {
|
|
55
54
|
margin-left: 16px;
|
|
55
|
+
}
|
|
56
|
+
.pc-author_theme_dark .pc-author__description {
|
|
57
|
+
color: var(--g-color-text-light-secondary);
|
|
56
58
|
}
|
|
@@ -8,7 +8,7 @@ const utils_2 = require("../Media/Image/utils");
|
|
|
8
8
|
const index_1 = require("../index");
|
|
9
9
|
const b = (0, utils_1.block)('author');
|
|
10
10
|
const Author = (props) => {
|
|
11
|
-
const { author, className, authorContainerClassName, type = models_1.AuthorType.Column, qa } = props;
|
|
11
|
+
const { author, className, authorContainerClassName, type = models_1.AuthorType.Column, qa, theme, } = props;
|
|
12
12
|
const { firstName, secondName, description, avatar } = author;
|
|
13
13
|
const name = secondName ? `${firstName} ${secondName}` : firstName;
|
|
14
14
|
const isAvatarJSX = react_1.default.isValidElement(avatar);
|
|
@@ -16,7 +16,7 @@ const Author = (props) => {
|
|
|
16
16
|
if (!isAvatarJSX && avatar) {
|
|
17
17
|
avatarProps = (0, utils_2.getMediaImage)(avatar);
|
|
18
18
|
}
|
|
19
|
-
return (react_1.default.createElement("div", { className: b({ type }, className), "data-qa": qa },
|
|
19
|
+
return (react_1.default.createElement("div", { className: b({ type, theme }, className), "data-qa": qa },
|
|
20
20
|
avatar && (react_1.default.createElement("div", { className: b('avatar', authorContainerClassName) }, isAvatarJSX ? avatar : react_1.default.createElement(index_1.Image, Object.assign({}, avatarProps)))),
|
|
21
21
|
react_1.default.createElement("div", { className: b('label') },
|
|
22
22
|
react_1.default.createElement("div", { className: b('name') }, name),
|
|
@@ -63,16 +63,27 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
|
|
|
63
63
|
createDOMElement?: boolean;
|
|
64
64
|
}
|
|
65
65
|
export interface QuoteProps extends Themable, CardBaseProps {
|
|
66
|
-
text
|
|
66
|
+
text?: string;
|
|
67
|
+
yfmText?: string;
|
|
67
68
|
image: ThemedImage;
|
|
68
69
|
logo: ImageProps;
|
|
69
70
|
color?: string;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated use property button instead
|
|
73
|
+
*/
|
|
70
74
|
url?: string;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated use property button instead
|
|
77
|
+
*/
|
|
71
78
|
urlTitle?: string;
|
|
72
79
|
author?: AuthorItem;
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated use property button instead
|
|
82
|
+
*/
|
|
73
83
|
buttonText?: string;
|
|
74
84
|
theme?: TextTheme;
|
|
75
85
|
quoteType?: QuoteType;
|
|
86
|
+
button?: ButtonProps;
|
|
76
87
|
}
|
|
77
88
|
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
78
89
|
url?: string;
|
|
@@ -76,6 +76,17 @@ 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
|
+
}
|
|
79
90
|
.pc-quote__image {
|
|
80
91
|
width: 100%;
|
|
81
92
|
height: 100%;
|
|
@@ -87,24 +98,6 @@ unpredictable css rules order in build */
|
|
|
87
98
|
align-items: flex-end;
|
|
88
99
|
margin-top: 20px;
|
|
89
100
|
}
|
|
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
|
-
}
|
|
108
101
|
.pc-quote__author {
|
|
109
102
|
max-width: calc(60% - 20px);
|
|
110
103
|
margin-right: 20px;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
-
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
5
|
const components_1 = require("../../components");
|
|
7
6
|
const utils_1 = require("../../components/Media/Image/utils");
|
|
8
7
|
const theme_1 = require("../../context/theme");
|
|
@@ -11,23 +10,25 @@ const models_1 = require("../../models");
|
|
|
11
10
|
const utils_2 = require("../../utils");
|
|
12
11
|
const b = (0, utils_2.block)('quote');
|
|
13
12
|
const Quote = (props) => {
|
|
14
|
-
const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, urlTitle, buttonText, quoteType = models_1.QuoteType.Chevron, } = props;
|
|
13
|
+
const { theme: textTheme = 'light', color, image, border = 'shadow', text, yfmText, logo, author, url, urlTitle, buttonText, quoteType = models_1.QuoteType.Chevron, button, } = props;
|
|
15
14
|
const theme = (0, theme_1.useTheme)();
|
|
16
15
|
const imageThemed = (0, utils_2.getThemedValue)(image, theme);
|
|
17
16
|
const imageData = (0, utils_1.getMediaImage)(imageThemed);
|
|
18
17
|
const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.QuoteButton, url);
|
|
19
18
|
const handleButtonClick = (0, react_1.useCallback)(() => handleAnalytics(), [handleAnalytics]);
|
|
20
19
|
const renderFooter = Boolean(author || url) && (react_1.default.createElement("div", { className: b('author-wrapper') },
|
|
21
|
-
author && (react_1.default.createElement(components_1.Author, { className: b('author', { theme: textTheme }), author: author, type: models_1.AuthorType.Line })),
|
|
22
|
-
url && buttonText && (react_1.default.createElement(
|
|
20
|
+
author && (react_1.default.createElement(components_1.Author, { className: b('author', { theme: textTheme }), author: author, type: models_1.AuthorType.Line, theme: textTheme })),
|
|
21
|
+
url && buttonText && !button && (react_1.default.createElement(components_1.Button, { theme: "outlined", size: "xl", url: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick, urlTitle: urlTitle, text: buttonText })),
|
|
22
|
+
button && react_1.default.createElement(components_1.Button, Object.assign({ size: "xl" }, button))));
|
|
23
23
|
const logoProps = (0, utils_1.getMediaImage)(logo);
|
|
24
24
|
return (react_1.default.createElement("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {} },
|
|
25
25
|
react_1.default.createElement("div", { key: text, className: b('content-wrapper') },
|
|
26
26
|
react_1.default.createElement("div", null,
|
|
27
27
|
react_1.default.createElement(components_1.Image, Object.assign({ className: b('logo') }, logoProps)),
|
|
28
28
|
react_1.default.createElement("div", { className: b('content', { 'quote-type': quoteType }) },
|
|
29
|
-
react_1.default.createElement("span", { className: b('text') },
|
|
30
|
-
react_1.default.createElement(components_1.HTML, null, text)))
|
|
29
|
+
text && (react_1.default.createElement("span", { className: b('text') },
|
|
30
|
+
react_1.default.createElement(components_1.HTML, null, text))),
|
|
31
|
+
yfmText && (react_1.default.createElement(components_1.YFMWrapper, { className: b('text'), content: yfmText, modifiers: { constructor: true } })))),
|
|
31
32
|
renderFooter),
|
|
32
33
|
react_1.default.createElement("div", { className: b('image-wrapper') },
|
|
33
34
|
react_1.default.createElement(components_1.Image, Object.assign({}, imageData, { className: b('image') })))));
|
|
@@ -6,10 +6,13 @@ const common_1 = require("../../schema/validators/common");
|
|
|
6
6
|
exports.Quote = {
|
|
7
7
|
quote: {
|
|
8
8
|
additionalProperties: false,
|
|
9
|
-
required: ['
|
|
9
|
+
required: ['image', 'logo'],
|
|
10
10
|
properties: Object.assign(Object.assign({}, common_1.BaseProps), { text: {
|
|
11
11
|
type: 'string',
|
|
12
12
|
contentType: 'text',
|
|
13
|
+
}, yfmText: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
contentType: 'text',
|
|
13
16
|
}, image: (0, common_1.withTheme)(schema_1.ImageProps), logo: schema_1.ImageProps, color: {
|
|
14
17
|
type: 'string',
|
|
15
18
|
}, url: {
|
|
@@ -130,10 +130,16 @@ exports.config = {
|
|
|
130
130
|
transformer: common_1.yfmTransformer,
|
|
131
131
|
},
|
|
132
132
|
],
|
|
133
|
-
[models_1.SubBlockType.Quote]:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
[models_1.SubBlockType.Quote]: [
|
|
134
|
+
{
|
|
135
|
+
fields: ['text'],
|
|
136
|
+
transformer: common_1.typografTransformer,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
fields: ['yfmText'],
|
|
140
|
+
transformer: common_1.yfmTransformer,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
137
143
|
[models_1.BlockType.ExtendedFeaturesBlock]: [
|
|
138
144
|
...exports.blockHeaderTransformer,
|
|
139
145
|
{
|
|
@@ -5,7 +5,6 @@ unpredictable css rules order in build */
|
|
|
5
5
|
line-height: var(--g-text-body-3-line-height);
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
|
-
color: var(--g-color-text-secondary);
|
|
9
8
|
}
|
|
10
9
|
.pc-author__avatar {
|
|
11
10
|
width: 80px;
|
|
@@ -25,11 +24,11 @@ unpredictable css rules order in build */
|
|
|
25
24
|
.pc-author__name {
|
|
26
25
|
font-size: var(--g-text-body-3-font-size);
|
|
27
26
|
line-height: var(--g-text-body-3-line-height);
|
|
28
|
-
color: var(--g-color-text-primary);
|
|
29
27
|
}
|
|
30
28
|
.pc-author__description {
|
|
31
29
|
font-size: var(--g-text-body-2-font-size);
|
|
32
30
|
line-height: var(--g-text-body-2-line-height);
|
|
31
|
+
color: var(--g-color-text-secondary);
|
|
33
32
|
padding-top: 4px;
|
|
34
33
|
}
|
|
35
34
|
.pc-author__label:not(:first-child) {
|
|
@@ -53,4 +52,7 @@ unpredictable css rules order in build */
|
|
|
53
52
|
}
|
|
54
53
|
.pc-author_type_line .pc-author__label:not(:first-child) {
|
|
55
54
|
margin-left: 16px;
|
|
55
|
+
}
|
|
56
|
+
.pc-author_theme_dark .pc-author__description {
|
|
57
|
+
color: var(--g-color-text-light-secondary);
|
|
56
58
|
}
|
|
@@ -6,7 +6,7 @@ import { Image } from '../index';
|
|
|
6
6
|
import './Author.css';
|
|
7
7
|
const b = block('author');
|
|
8
8
|
const Author = (props) => {
|
|
9
|
-
const { author, className, authorContainerClassName, type = AuthorType.Column, qa } = props;
|
|
9
|
+
const { author, className, authorContainerClassName, type = AuthorType.Column, qa, theme, } = props;
|
|
10
10
|
const { firstName, secondName, description, avatar } = author;
|
|
11
11
|
const name = secondName ? `${firstName} ${secondName}` : firstName;
|
|
12
12
|
const isAvatarJSX = React.isValidElement(avatar);
|
|
@@ -14,7 +14,7 @@ const Author = (props) => {
|
|
|
14
14
|
if (!isAvatarJSX && avatar) {
|
|
15
15
|
avatarProps = getMediaImage(avatar);
|
|
16
16
|
}
|
|
17
|
-
return (React.createElement("div", { className: b({ type }, className), "data-qa": qa },
|
|
17
|
+
return (React.createElement("div", { className: b({ type, theme }, className), "data-qa": qa },
|
|
18
18
|
avatar && (React.createElement("div", { className: b('avatar', authorContainerClassName) }, isAvatarJSX ? avatar : React.createElement(Image, Object.assign({}, avatarProps)))),
|
|
19
19
|
React.createElement("div", { className: b('label') },
|
|
20
20
|
React.createElement("div", { className: b('name') }, name),
|
|
@@ -63,16 +63,27 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
|
|
|
63
63
|
createDOMElement?: boolean;
|
|
64
64
|
}
|
|
65
65
|
export interface QuoteProps extends Themable, CardBaseProps {
|
|
66
|
-
text
|
|
66
|
+
text?: string;
|
|
67
|
+
yfmText?: string;
|
|
67
68
|
image: ThemedImage;
|
|
68
69
|
logo: ImageProps;
|
|
69
70
|
color?: string;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated use property button instead
|
|
73
|
+
*/
|
|
70
74
|
url?: string;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated use property button instead
|
|
77
|
+
*/
|
|
71
78
|
urlTitle?: string;
|
|
72
79
|
author?: AuthorItem;
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated use property button instead
|
|
82
|
+
*/
|
|
73
83
|
buttonText?: string;
|
|
74
84
|
theme?: TextTheme;
|
|
75
85
|
quoteType?: QuoteType;
|
|
86
|
+
button?: ButtonProps;
|
|
76
87
|
}
|
|
77
88
|
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
78
89
|
url?: string;
|
|
@@ -76,6 +76,17 @@ 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
|
+
}
|
|
79
90
|
.pc-quote__image {
|
|
80
91
|
width: 100%;
|
|
81
92
|
height: 100%;
|
|
@@ -87,24 +98,6 @@ unpredictable css rules order in build */
|
|
|
87
98
|
align-items: flex-end;
|
|
88
99
|
margin-top: 20px;
|
|
89
100
|
}
|
|
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
|
-
}
|
|
108
101
|
.pc-quote__author {
|
|
109
102
|
max-width: calc(60% - 20px);
|
|
110
103
|
margin-right: 20px;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Author, HTML, Image } from '../../components';
|
|
2
|
+
import { Author, Button, HTML, Image, YFMWrapper } from '../../components';
|
|
4
3
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
5
4
|
import { useTheme } from '../../context/theme';
|
|
6
5
|
import { useAnalytics } from '../../hooks';
|
|
@@ -9,23 +8,25 @@ import { block, getThemedValue } from '../../utils';
|
|
|
9
8
|
import './Quote.css';
|
|
10
9
|
const b = block('quote');
|
|
11
10
|
const Quote = (props) => {
|
|
12
|
-
const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, urlTitle, buttonText, quoteType = QuoteType.Chevron, } = props;
|
|
11
|
+
const { theme: textTheme = 'light', color, image, border = 'shadow', text, yfmText, logo, author, url, urlTitle, buttonText, quoteType = QuoteType.Chevron, button, } = props;
|
|
13
12
|
const theme = useTheme();
|
|
14
13
|
const imageThemed = getThemedValue(image, theme);
|
|
15
14
|
const imageData = getMediaImage(imageThemed);
|
|
16
15
|
const handleAnalytics = useAnalytics(DefaultEventNames.QuoteButton, url);
|
|
17
16
|
const handleButtonClick = useCallback(() => handleAnalytics(), [handleAnalytics]);
|
|
18
17
|
const renderFooter = Boolean(author || url) && (React.createElement("div", { className: b('author-wrapper') },
|
|
19
|
-
author && (React.createElement(Author, { className: b('author', { theme: textTheme }), author: author, type: AuthorType.Line })),
|
|
20
|
-
url && buttonText && (React.createElement(Button, {
|
|
18
|
+
author && (React.createElement(Author, { className: b('author', { theme: textTheme }), author: author, type: AuthorType.Line, theme: textTheme })),
|
|
19
|
+
url && buttonText && !button && (React.createElement(Button, { theme: "outlined", size: "xl", url: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick, urlTitle: urlTitle, text: buttonText })),
|
|
20
|
+
button && React.createElement(Button, Object.assign({ size: "xl" }, button))));
|
|
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
|
-
React.createElement("span", { className: b('text') },
|
|
28
|
-
React.createElement(HTML, null, text)))
|
|
27
|
+
text && (React.createElement("span", { className: b('text') },
|
|
28
|
+
React.createElement(HTML, null, text))),
|
|
29
|
+
yfmText && (React.createElement(YFMWrapper, { className: b('text'), content: yfmText, modifiers: { constructor: true } })))),
|
|
29
30
|
renderFooter),
|
|
30
31
|
React.createElement("div", { className: b('image-wrapper') },
|
|
31
32
|
React.createElement(Image, Object.assign({}, imageData, { className: b('image') })))));
|
|
@@ -3,10 +3,13 @@ import { BaseProps, ThemeProps, authorItem, quoteTypes, withTheme, } from '../..
|
|
|
3
3
|
export const Quote = {
|
|
4
4
|
quote: {
|
|
5
5
|
additionalProperties: false,
|
|
6
|
-
required: ['
|
|
6
|
+
required: ['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',
|
|
10
13
|
}, image: withTheme(ImageProps), logo: ImageProps, color: {
|
|
11
14
|
type: 'string',
|
|
12
15
|
}, url: {
|
|
@@ -127,10 +127,16 @@ export const config = {
|
|
|
127
127
|
transformer: yfmTransformer,
|
|
128
128
|
},
|
|
129
129
|
],
|
|
130
|
-
[SubBlockType.Quote]:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
[SubBlockType.Quote]: [
|
|
131
|
+
{
|
|
132
|
+
fields: ['text'],
|
|
133
|
+
transformer: typografTransformer,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
fields: ['yfmText'],
|
|
137
|
+
transformer: yfmTransformer,
|
|
138
|
+
},
|
|
139
|
+
],
|
|
134
140
|
[BlockType.ExtendedFeaturesBlock]: [
|
|
135
141
|
...blockHeaderTransformer,
|
|
136
142
|
{
|
package/package.json
CHANGED
|
@@ -63,16 +63,27 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
|
|
|
63
63
|
createDOMElement?: boolean;
|
|
64
64
|
}
|
|
65
65
|
export interface QuoteProps extends Themable, CardBaseProps {
|
|
66
|
-
text
|
|
66
|
+
text?: string;
|
|
67
|
+
yfmText?: string;
|
|
67
68
|
image: ThemedImage;
|
|
68
69
|
logo: ImageProps;
|
|
69
70
|
color?: string;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated use property button instead
|
|
73
|
+
*/
|
|
70
74
|
url?: string;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated use property button instead
|
|
77
|
+
*/
|
|
71
78
|
urlTitle?: string;
|
|
72
79
|
author?: AuthorItem;
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated use property button instead
|
|
82
|
+
*/
|
|
73
83
|
buttonText?: string;
|
|
74
84
|
theme?: TextTheme;
|
|
75
85
|
quoteType?: QuoteType;
|
|
86
|
+
button?: ButtonProps;
|
|
76
87
|
}
|
|
77
88
|
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
78
89
|
url?: string;
|
|
@@ -140,10 +140,16 @@ exports.config = {
|
|
|
140
140
|
transformer: common_1.yfmTransformer,
|
|
141
141
|
},
|
|
142
142
|
],
|
|
143
|
-
[models_1.SubBlockType.Quote]:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
[models_1.SubBlockType.Quote]: [
|
|
144
|
+
{
|
|
145
|
+
fields: ['text'],
|
|
146
|
+
transformer: common_1.typografTransformer,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
fields: ['yfmText'],
|
|
150
|
+
transformer: common_1.yfmTransformer,
|
|
151
|
+
},
|
|
152
|
+
],
|
|
147
153
|
[models_1.BlockType.ExtendedFeaturesBlock]: [
|
|
148
154
|
...exports.blockHeaderTransformer,
|
|
149
155
|
{
|