@gravity-ui/page-constructor 4.43.2-alpha.0 → 4.44.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/blocks/CardLayout/CardLayout.css +19 -0
- package/build/cjs/blocks/CardLayout/CardLayout.js +10 -3
- package/build/cjs/blocks/CardLayout/schema.d.ts +74 -0
- package/build/cjs/blocks/CardLayout/schema.js +2 -1
- package/build/cjs/blocks/Header/schema.d.ts +3 -33
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +1 -11
- package/build/cjs/blocks/Media/schema.d.ts +2 -22
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +1 -11
- package/build/cjs/blocks/Tabs/schema.d.ts +1 -11
- package/build/cjs/components/Media/Iframe/Iframe.css +4 -0
- package/build/cjs/components/Media/Iframe/Iframe.js +4 -64
- package/build/cjs/grid/Col/Col.d.ts +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -0
- package/build/cjs/models/constructor-items/common.d.ts +2 -4
- package/build/cjs/schema/constants.d.ts +1 -11
- package/build/cjs/schema/validators/common.d.ts +1 -11
- package/build/cjs/schema/validators/common.js +1 -5
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +1 -11
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +1 -11
- package/build/esm/blocks/CardLayout/CardLayout.css +19 -0
- package/build/esm/blocks/CardLayout/CardLayout.js +11 -4
- package/build/esm/blocks/CardLayout/schema.d.ts +74 -0
- package/build/esm/blocks/CardLayout/schema.js +2 -1
- package/build/esm/blocks/Header/schema.d.ts +3 -33
- package/build/esm/blocks/HeaderSlider/schema.d.ts +1 -11
- package/build/esm/blocks/Media/schema.d.ts +2 -22
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +1 -11
- package/build/esm/blocks/Tabs/schema.d.ts +1 -11
- package/build/esm/components/Media/Iframe/Iframe.css +4 -0
- package/build/esm/components/Media/Iframe/Iframe.js +4 -64
- package/build/esm/grid/Col/Col.d.ts +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +1 -0
- package/build/esm/models/constructor-items/common.d.ts +2 -4
- package/build/esm/schema/constants.d.ts +1 -11
- package/build/esm/schema/validators/common.d.ts +1 -11
- package/build/esm/schema/validators/common.js +1 -5
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +1 -11
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +1 -11
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +1 -0
- package/server/models/constructor-items/common.d.ts +2 -4
- package/widget/index.js +1 -1
|
@@ -3,6 +3,25 @@ unpredictable css rules order in build */
|
|
|
3
3
|
.pc-card-layout-block__item {
|
|
4
4
|
margin-top: 24px;
|
|
5
5
|
}
|
|
6
|
+
.pc-card-layout-block__content {
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
.pc-card-layout-block__content_with-background {
|
|
10
|
+
padding: 8px 32px 48px;
|
|
11
|
+
margin-top: 24px;
|
|
12
|
+
}
|
|
13
|
+
.pc-card-layout-block__image {
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
border-radius: 40px;
|
|
20
|
+
}
|
|
21
|
+
.pc-card-layout-block__image img {
|
|
22
|
+
object-fit: cover;
|
|
23
|
+
object-position: left;
|
|
24
|
+
}
|
|
6
25
|
@media (min-width: 769px) {
|
|
7
26
|
.pc-card-layout-block.pc-AnimateBlock .pc-card-layout-block__item, .pc-AnimateBlock .pc-card-layout-block .pc-card-layout-block__item {
|
|
8
27
|
position: relative;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
5
6
|
const components_1 = require("../../components");
|
|
6
7
|
const grid_1 = require("../../grid");
|
|
7
8
|
const utils_1 = require("../../utils");
|
|
@@ -11,7 +12,13 @@ const DEFAULT_SIZES = {
|
|
|
11
12
|
md: 4,
|
|
12
13
|
};
|
|
13
14
|
const b = (0, utils_1.block)('card-layout-block');
|
|
14
|
-
const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, titleClassName, }) =>
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, titleClassName, background, }) => {
|
|
16
|
+
return (react_1.default.createElement(components_1.AnimateBlock, { className: b(null, className), animate: animated },
|
|
17
|
+
(title || description) && (react_1.default.createElement(components_1.Title, { title: title, subtitle: description, className: titleClassName })),
|
|
18
|
+
react_1.default.createElement("div", { className: b('content', {
|
|
19
|
+
'with-background': !(0, isEmpty_1.default)(background),
|
|
20
|
+
}) },
|
|
21
|
+
react_1.default.createElement(components_1.BackgroundImage, Object.assign({ className: b('image') }, background)),
|
|
22
|
+
react_1.default.createElement(grid_1.Row, null, react_1.default.Children.map(children, (child, index) => (react_1.default.createElement(grid_1.Col, { key: index, sizes: colSizes, className: b('item') }, child)))))));
|
|
23
|
+
};
|
|
17
24
|
exports.default = CardLayout;
|
|
@@ -7,6 +7,43 @@ export declare const CardLayoutProps: {
|
|
|
7
7
|
additionalProperties: boolean;
|
|
8
8
|
properties: {};
|
|
9
9
|
};
|
|
10
|
+
background: {
|
|
11
|
+
type: string;
|
|
12
|
+
additionalProperties: boolean;
|
|
13
|
+
required: string[];
|
|
14
|
+
properties: {
|
|
15
|
+
src: {
|
|
16
|
+
type: string;
|
|
17
|
+
pattern: string;
|
|
18
|
+
};
|
|
19
|
+
style: {
|
|
20
|
+
type: string;
|
|
21
|
+
additionalProperties: boolean;
|
|
22
|
+
required: never[];
|
|
23
|
+
properties: {
|
|
24
|
+
backgroundColor: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
height: {
|
|
28
|
+
type: string[];
|
|
29
|
+
};
|
|
30
|
+
width: {
|
|
31
|
+
type: string[];
|
|
32
|
+
};
|
|
33
|
+
color: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
alt: {
|
|
39
|
+
type: string;
|
|
40
|
+
contentType: string;
|
|
41
|
+
};
|
|
42
|
+
disableCompress: {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
10
47
|
children: {
|
|
11
48
|
type: string;
|
|
12
49
|
items: {
|
|
@@ -106,6 +143,43 @@ export declare const CardLayoutBlock: {
|
|
|
106
143
|
additionalProperties: boolean;
|
|
107
144
|
properties: {};
|
|
108
145
|
};
|
|
146
|
+
background: {
|
|
147
|
+
type: string;
|
|
148
|
+
additionalProperties: boolean;
|
|
149
|
+
required: string[];
|
|
150
|
+
properties: {
|
|
151
|
+
src: {
|
|
152
|
+
type: string;
|
|
153
|
+
pattern: string;
|
|
154
|
+
};
|
|
155
|
+
style: {
|
|
156
|
+
type: string;
|
|
157
|
+
additionalProperties: boolean;
|
|
158
|
+
required: never[];
|
|
159
|
+
properties: {
|
|
160
|
+
backgroundColor: {
|
|
161
|
+
type: string;
|
|
162
|
+
};
|
|
163
|
+
height: {
|
|
164
|
+
type: string[];
|
|
165
|
+
};
|
|
166
|
+
width: {
|
|
167
|
+
type: string[];
|
|
168
|
+
};
|
|
169
|
+
color: {
|
|
170
|
+
type: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
alt: {
|
|
175
|
+
type: string;
|
|
176
|
+
contentType: string;
|
|
177
|
+
};
|
|
178
|
+
disableCompress: {
|
|
179
|
+
type: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|
|
109
183
|
children: {
|
|
110
184
|
type: string;
|
|
111
185
|
items: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CardLayoutBlock = exports.CardLayoutProps = void 0;
|
|
4
|
+
const schema_1 = require("../../components/Image/schema");
|
|
4
5
|
const common_1 = require("../../schema/validators/common");
|
|
5
6
|
exports.CardLayoutProps = {
|
|
6
7
|
additionalProperties: false,
|
|
7
8
|
required: [],
|
|
8
|
-
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.AnimatableProps), common_1.BlockHeaderProps), { colSizes: common_1.containerSizesObject, children: common_1.ChildrenCardsProps }),
|
|
9
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.AnimatableProps), common_1.BlockHeaderProps), { colSizes: common_1.containerSizesObject, background: schema_1.ImageObjectProps, children: common_1.ChildrenCardsProps }),
|
|
9
10
|
};
|
|
10
11
|
exports.CardLayoutBlock = {
|
|
11
12
|
'card-layout-block': exports.CardLayoutProps,
|
|
@@ -266,20 +266,10 @@ export declare const HeaderBackgroundProps: {
|
|
|
266
266
|
type: string;
|
|
267
267
|
};
|
|
268
268
|
height: {
|
|
269
|
-
oneOf: ({
|
|
270
|
-
type: string;
|
|
271
|
-
enum?: undefined;
|
|
272
|
-
} | {
|
|
273
|
-
type: string;
|
|
274
|
-
enum: string[];
|
|
275
|
-
})[];
|
|
276
|
-
};
|
|
277
|
-
width: {
|
|
278
269
|
type: string;
|
|
279
270
|
};
|
|
280
|
-
|
|
271
|
+
width: {
|
|
281
272
|
type: string;
|
|
282
|
-
enum: string[];
|
|
283
273
|
};
|
|
284
274
|
};
|
|
285
275
|
};
|
|
@@ -736,20 +726,10 @@ export declare const HeaderProperties: {
|
|
|
736
726
|
type: string;
|
|
737
727
|
};
|
|
738
728
|
height: {
|
|
739
|
-
oneOf: ({
|
|
740
|
-
type: string;
|
|
741
|
-
enum?: undefined;
|
|
742
|
-
} | {
|
|
743
|
-
type: string;
|
|
744
|
-
enum: string[];
|
|
745
|
-
})[];
|
|
746
|
-
};
|
|
747
|
-
width: {
|
|
748
729
|
type: string;
|
|
749
730
|
};
|
|
750
|
-
|
|
731
|
+
width: {
|
|
751
732
|
type: string;
|
|
752
|
-
enum: string[];
|
|
753
733
|
};
|
|
754
734
|
};
|
|
755
735
|
};
|
|
@@ -1255,20 +1235,10 @@ export declare const HeaderBlock: {
|
|
|
1255
1235
|
type: string;
|
|
1256
1236
|
};
|
|
1257
1237
|
height: {
|
|
1258
|
-
oneOf: ({
|
|
1259
|
-
type: string;
|
|
1260
|
-
enum?: undefined;
|
|
1261
|
-
} | {
|
|
1262
|
-
type: string;
|
|
1263
|
-
enum: string[];
|
|
1264
|
-
})[];
|
|
1265
|
-
};
|
|
1266
|
-
width: {
|
|
1267
1238
|
type: string;
|
|
1268
1239
|
};
|
|
1269
|
-
|
|
1240
|
+
width: {
|
|
1270
1241
|
type: string;
|
|
1271
|
-
enum: string[];
|
|
1272
1242
|
};
|
|
1273
1243
|
};
|
|
1274
1244
|
};
|
|
@@ -457,20 +457,10 @@ export declare const HeaderSliderBlock: {
|
|
|
457
457
|
type: string;
|
|
458
458
|
};
|
|
459
459
|
height: {
|
|
460
|
-
oneOf: ({
|
|
461
|
-
type: string;
|
|
462
|
-
enum?: undefined;
|
|
463
|
-
} | {
|
|
464
|
-
type: string;
|
|
465
|
-
enum: string[];
|
|
466
|
-
})[];
|
|
467
|
-
};
|
|
468
|
-
width: {
|
|
469
460
|
type: string;
|
|
470
461
|
};
|
|
471
|
-
|
|
462
|
+
width: {
|
|
472
463
|
type: string;
|
|
473
|
-
enum: string[];
|
|
474
464
|
};
|
|
475
465
|
};
|
|
476
466
|
};
|
|
@@ -260,20 +260,10 @@ export declare const Media: {
|
|
|
260
260
|
type: string;
|
|
261
261
|
};
|
|
262
262
|
height: {
|
|
263
|
-
oneOf: ({
|
|
264
|
-
type: string;
|
|
265
|
-
enum?: undefined;
|
|
266
|
-
} | {
|
|
267
|
-
type: string;
|
|
268
|
-
enum: string[];
|
|
269
|
-
})[];
|
|
270
|
-
};
|
|
271
|
-
width: {
|
|
272
263
|
type: string;
|
|
273
264
|
};
|
|
274
|
-
|
|
265
|
+
width: {
|
|
275
266
|
type: string;
|
|
276
|
-
enum: string[];
|
|
277
267
|
};
|
|
278
268
|
};
|
|
279
269
|
};
|
|
@@ -941,20 +931,10 @@ export declare const MediaBlock: {
|
|
|
941
931
|
type: string;
|
|
942
932
|
};
|
|
943
933
|
height: {
|
|
944
|
-
oneOf: ({
|
|
945
|
-
type: string;
|
|
946
|
-
enum?: undefined;
|
|
947
|
-
} | {
|
|
948
|
-
type: string;
|
|
949
|
-
enum: string[];
|
|
950
|
-
})[];
|
|
951
|
-
};
|
|
952
|
-
width: {
|
|
953
934
|
type: string;
|
|
954
935
|
};
|
|
955
|
-
|
|
936
|
+
width: {
|
|
956
937
|
type: string;
|
|
957
|
-
enum: string[];
|
|
958
938
|
};
|
|
959
939
|
};
|
|
960
940
|
};
|
|
@@ -276,20 +276,10 @@ export declare const PromoFeaturesItem: {
|
|
|
276
276
|
type: string;
|
|
277
277
|
};
|
|
278
278
|
height: {
|
|
279
|
-
oneOf: ({
|
|
280
|
-
type: string;
|
|
281
|
-
enum?: undefined;
|
|
282
|
-
} | {
|
|
283
|
-
type: string;
|
|
284
|
-
enum: string[];
|
|
285
|
-
})[];
|
|
286
|
-
};
|
|
287
|
-
width: {
|
|
288
279
|
type: string;
|
|
289
280
|
};
|
|
290
|
-
|
|
281
|
+
width: {
|
|
291
282
|
type: string;
|
|
292
|
-
enum: string[];
|
|
293
283
|
};
|
|
294
284
|
};
|
|
295
285
|
};
|
|
@@ -271,20 +271,10 @@ export declare const tabsItem: {
|
|
|
271
271
|
type: string;
|
|
272
272
|
};
|
|
273
273
|
height: {
|
|
274
|
-
oneOf: ({
|
|
275
|
-
type: string;
|
|
276
|
-
enum?: undefined;
|
|
277
|
-
} | {
|
|
278
|
-
type: string;
|
|
279
|
-
enum: string[];
|
|
280
|
-
})[];
|
|
281
|
-
};
|
|
282
|
-
width: {
|
|
283
274
|
type: string;
|
|
284
275
|
};
|
|
285
|
-
|
|
276
|
+
width: {
|
|
286
277
|
type: string;
|
|
287
|
-
enum: string[];
|
|
288
278
|
};
|
|
289
279
|
};
|
|
290
280
|
};
|
|
@@ -1,74 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.
|
|
5
|
-
const uuid_1 = require("uuid");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
5
|
const utils_1 = require("../../../utils");
|
|
7
6
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
8
7
|
const b = (0, utils_1.block)('media-component-iframe');
|
|
9
8
|
const Iframe = (props) => {
|
|
10
9
|
const { iframe, margins = true } = props;
|
|
11
|
-
const { height = 400, src, width
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const [iframeId] = (0, react_1.useState)((0, uuid_1.v4)());
|
|
15
|
-
const updateFormIframe = (0, react_1.useCallback)((container) => {
|
|
16
|
-
if (iframeRef.current) {
|
|
17
|
-
iframeRef.current.src = src;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
const iframeWidth = typeof width === 'number' ? `${width}px` : width;
|
|
21
|
-
let iframeHeight = typeof height === 'number' ? `${height}px` : height;
|
|
22
|
-
if (height === 'auto') {
|
|
23
|
-
iframeHeight = undefined;
|
|
24
|
-
}
|
|
25
|
-
iframeRef.current = document.createElement('iframe');
|
|
26
|
-
iframeRef.current.src = src;
|
|
27
|
-
iframeRef.current.id = iframeId;
|
|
28
|
-
iframeRef.current.name = name || iframeId;
|
|
29
|
-
iframeRef.current.setAttribute('loading', 'lazy');
|
|
30
|
-
iframeRef.current.setAttribute('title', title || (0, i18n_1.default)('iframe-title'));
|
|
31
|
-
iframeRef.current.frameBorder = '0';
|
|
32
|
-
iframeRef.current.scrolling = 'no';
|
|
33
|
-
iframeRef.current.width = iframeWidth;
|
|
34
|
-
iframeRef.current.style.width = iframeWidth;
|
|
35
|
-
if (iframeHeight) {
|
|
36
|
-
iframeRef.current.style.height = iframeHeight;
|
|
37
|
-
}
|
|
38
|
-
container.appendChild(iframeRef.current);
|
|
39
|
-
}
|
|
40
|
-
}, [src, width, iframeId, name, title, height]);
|
|
41
|
-
const handleMessage = (0, react_1.useCallback)(({ data }) => {
|
|
42
|
-
if (height !== 'auto' && typeof height === 'number' && iframeRef.current) {
|
|
43
|
-
iframeRef.current.height = `${height}px`;
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
const parsed = JSON.parse(data);
|
|
48
|
-
const iframeHeight = parsed['iframe-height'];
|
|
49
|
-
const { message, name: iframeName } = parsed;
|
|
50
|
-
if (iframeName !== name && iframeName !== iframeId) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (iframeRef.current && iframeHeight && !message) {
|
|
54
|
-
iframeRef.current.height = `${iframeHeight}px`;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
}, [height, iframeId, name]);
|
|
61
|
-
const addIframe = (0, react_1.useCallback)(() => {
|
|
62
|
-
const container = formContainerRef.current;
|
|
63
|
-
if (container) {
|
|
64
|
-
updateFormIframe(container);
|
|
65
|
-
window.addEventListener('message', handleMessage, { passive: true });
|
|
66
|
-
}
|
|
67
|
-
}, [updateFormIframe, handleMessage]);
|
|
68
|
-
(0, react_1.useEffect)(() => {
|
|
69
|
-
addIframe();
|
|
70
|
-
return () => window.removeEventListener('message', handleMessage);
|
|
71
|
-
}, [addIframe, handleMessage]);
|
|
72
|
-
return iframe ? (react_1.default.createElement("div", { className: b({ margins }), ref: formContainerRef, style: { height, textAlign: justifyContent } })) : null;
|
|
10
|
+
const { height = 400, src, width, name, title } = iframe;
|
|
11
|
+
return iframe ? (react_1.default.createElement("div", { className: b({ margins }), style: { height } },
|
|
12
|
+
react_1.default.createElement("iframe", { className: b('item'), loading: "lazy", title: title || (0, i18n_1.default)('iframe-title'), frameBorder: 0, src: src, width: width, height: height, name: name }))) : null;
|
|
73
13
|
};
|
|
74
14
|
exports.default = Iframe;
|
|
@@ -5,4 +5,4 @@ export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivE
|
|
|
5
5
|
style?: CSSProperties;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "sizes" | "className" | "hidden" | "role" | "qa" | "reset" | "visible" | "
|
|
8
|
+
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "sizes" | "className" | "hidden" | "role" | "qa" | "reset" | "visible" | "offsets" | "orders" | "alignSelf" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -234,6 +234,7 @@ export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChi
|
|
|
234
234
|
titleClassName?: string;
|
|
235
235
|
description?: string;
|
|
236
236
|
colSizes?: GridColumnSizesType;
|
|
237
|
+
background?: BackgroundImageProps;
|
|
237
238
|
}
|
|
238
239
|
export type FilterTag = {
|
|
239
240
|
id: string;
|
|
@@ -257,14 +257,12 @@ export interface DataLensObjectProps {
|
|
|
257
257
|
id: string;
|
|
258
258
|
theme: 'dark' | 'light';
|
|
259
259
|
}
|
|
260
|
-
export type JustifyValues = 'left' | 'right' | 'center';
|
|
261
260
|
export interface IframeProps {
|
|
262
261
|
src: string;
|
|
263
|
-
width?: number
|
|
264
|
-
height?: number
|
|
262
|
+
width?: number;
|
|
263
|
+
height?: number;
|
|
265
264
|
title?: string;
|
|
266
265
|
name?: string;
|
|
267
|
-
justifyContent?: JustifyValues;
|
|
268
266
|
}
|
|
269
267
|
export type DataLensProps = string | DataLensObjectProps;
|
|
270
268
|
export interface AuthorItem {
|
|
@@ -1530,20 +1530,10 @@ export declare const cardSchemas: {
|
|
|
1530
1530
|
type: string;
|
|
1531
1531
|
};
|
|
1532
1532
|
height: {
|
|
1533
|
-
oneOf: ({
|
|
1534
|
-
type: string;
|
|
1535
|
-
enum?: undefined;
|
|
1536
|
-
} | {
|
|
1537
|
-
type: string;
|
|
1538
|
-
enum: string[];
|
|
1539
|
-
})[];
|
|
1540
|
-
};
|
|
1541
|
-
width: {
|
|
1542
1533
|
type: string;
|
|
1543
1534
|
};
|
|
1544
|
-
|
|
1535
|
+
width: {
|
|
1545
1536
|
type: string;
|
|
1546
|
-
enum: string[];
|
|
1547
1537
|
};
|
|
1548
1538
|
};
|
|
1549
1539
|
};
|
|
@@ -1388,20 +1388,10 @@ export declare const MediaProps: {
|
|
|
1388
1388
|
type: string;
|
|
1389
1389
|
};
|
|
1390
1390
|
height: {
|
|
1391
|
-
oneOf: ({
|
|
1392
|
-
type: string;
|
|
1393
|
-
enum?: undefined;
|
|
1394
|
-
} | {
|
|
1395
|
-
type: string;
|
|
1396
|
-
enum: string[];
|
|
1397
|
-
})[];
|
|
1398
|
-
};
|
|
1399
|
-
width: {
|
|
1400
1391
|
type: string;
|
|
1401
1392
|
};
|
|
1402
|
-
|
|
1393
|
+
width: {
|
|
1403
1394
|
type: string;
|
|
1404
|
-
enum: string[];
|
|
1405
1395
|
};
|
|
1406
1396
|
};
|
|
1407
1397
|
};
|
|
@@ -526,15 +526,11 @@ const IframeProps = {
|
|
|
526
526
|
type: 'string',
|
|
527
527
|
},
|
|
528
528
|
height: {
|
|
529
|
-
|
|
529
|
+
type: 'number',
|
|
530
530
|
},
|
|
531
531
|
width: {
|
|
532
532
|
type: 'number',
|
|
533
533
|
},
|
|
534
|
-
justifyContent: {
|
|
535
|
-
type: 'string',
|
|
536
|
-
enum: ['left', 'right', 'center'],
|
|
537
|
-
},
|
|
538
534
|
},
|
|
539
535
|
};
|
|
540
536
|
exports.MediaProps = {
|
|
@@ -261,20 +261,10 @@ export declare const LayoutItem: {
|
|
|
261
261
|
type: string;
|
|
262
262
|
};
|
|
263
263
|
height: {
|
|
264
|
-
oneOf: ({
|
|
265
|
-
type: string;
|
|
266
|
-
enum?: undefined;
|
|
267
|
-
} | {
|
|
268
|
-
type: string;
|
|
269
|
-
enum: string[];
|
|
270
|
-
})[];
|
|
271
|
-
};
|
|
272
|
-
width: {
|
|
273
264
|
type: string;
|
|
274
265
|
};
|
|
275
|
-
|
|
266
|
+
width: {
|
|
276
267
|
type: string;
|
|
277
|
-
enum: string[];
|
|
278
268
|
};
|
|
279
269
|
};
|
|
280
270
|
};
|
|
@@ -266,20 +266,10 @@ export declare const MediaCardBlock: {
|
|
|
266
266
|
type: string;
|
|
267
267
|
};
|
|
268
268
|
height: {
|
|
269
|
-
oneOf: ({
|
|
270
|
-
type: string;
|
|
271
|
-
enum?: undefined;
|
|
272
|
-
} | {
|
|
273
|
-
type: string;
|
|
274
|
-
enum: string[];
|
|
275
|
-
})[];
|
|
276
|
-
};
|
|
277
|
-
width: {
|
|
278
269
|
type: string;
|
|
279
270
|
};
|
|
280
|
-
|
|
271
|
+
width: {
|
|
281
272
|
type: string;
|
|
282
|
-
enum: string[];
|
|
283
273
|
};
|
|
284
274
|
};
|
|
285
275
|
};
|
|
@@ -3,6 +3,25 @@ unpredictable css rules order in build */
|
|
|
3
3
|
.pc-card-layout-block__item {
|
|
4
4
|
margin-top: 24px;
|
|
5
5
|
}
|
|
6
|
+
.pc-card-layout-block__content {
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
.pc-card-layout-block__content_with-background {
|
|
10
|
+
padding: 8px 32px 48px;
|
|
11
|
+
margin-top: 24px;
|
|
12
|
+
}
|
|
13
|
+
.pc-card-layout-block__image {
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
border-radius: 40px;
|
|
20
|
+
}
|
|
21
|
+
.pc-card-layout-block__image img {
|
|
22
|
+
object-fit: cover;
|
|
23
|
+
object-position: left;
|
|
24
|
+
}
|
|
6
25
|
@media (min-width: 769px) {
|
|
7
26
|
.pc-card-layout-block.pc-AnimateBlock .pc-card-layout-block__item, .pc-AnimateBlock .pc-card-layout-block .pc-card-layout-block__item {
|
|
8
27
|
position: relative;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import { AnimateBlock, BackgroundImage, Title } from '../../components';
|
|
3
4
|
import { Col, Row } from '../../grid';
|
|
4
5
|
import { block } from '../../utils';
|
|
5
6
|
import './CardLayout.css';
|
|
@@ -9,7 +10,13 @@ const DEFAULT_SIZES = {
|
|
|
9
10
|
md: 4,
|
|
10
11
|
};
|
|
11
12
|
const b = block('card-layout-block');
|
|
12
|
-
const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, titleClassName, }) =>
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, titleClassName, background, }) => {
|
|
14
|
+
return (React.createElement(AnimateBlock, { className: b(null, className), animate: animated },
|
|
15
|
+
(title || description) && (React.createElement(Title, { title: title, subtitle: description, className: titleClassName })),
|
|
16
|
+
React.createElement("div", { className: b('content', {
|
|
17
|
+
'with-background': !isEmpty(background),
|
|
18
|
+
}) },
|
|
19
|
+
React.createElement(BackgroundImage, Object.assign({ className: b('image') }, background)),
|
|
20
|
+
React.createElement(Row, null, React.Children.map(children, (child, index) => (React.createElement(Col, { key: index, sizes: colSizes, className: b('item') }, child)))))));
|
|
21
|
+
};
|
|
15
22
|
export default CardLayout;
|