@gravity-ui/page-constructor 5.14.3 → 5.15.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.js +3 -1
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +4 -1
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +13 -0
- package/build/cjs/blocks/Form/schema.d.ts +13 -0
- package/build/cjs/blocks/Header/schema.d.ts +104 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +39 -0
- package/build/cjs/blocks/Icons/Icons.js +4 -1
- package/build/cjs/blocks/Media/schema.d.ts +52 -0
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +4 -1
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +26 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +39 -0
- package/build/cjs/components/Author/schema.d.ts +13 -0
- package/build/cjs/components/Image/schema.d.ts +13 -0
- package/build/cjs/components/Image/schema.js +10 -0
- package/build/cjs/editor/containers/Editor/hooks/useEditorState.js +1 -1
- package/build/cjs/editor/types/index.d.ts +2 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +5 -5
- package/build/cjs/models/constructor-items/common.d.ts +1 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +5 -5
- package/build/cjs/navigation/schema.d.ts +13 -0
- package/build/cjs/schema/constants.d.ts +91 -0
- package/build/cjs/schema/validators/common.d.ts +52 -0
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +4 -1
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +13 -0
- package/build/cjs/sub-blocks/Content/schema.d.ts +13 -0
- package/build/cjs/sub-blocks/ImageCard/ImageCard.js +4 -1
- package/build/cjs/sub-blocks/ImageCard/schema.d.ts +13 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +2 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +26 -0
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +26 -0
- package/build/cjs/sub-blocks/Quote/Quote.js +6 -2
- package/build/cjs/sub-blocks/Quote/schema.d.ts +39 -0
- package/build/esm/blocks/CardLayout/CardLayout.js +4 -2
- package/build/esm/blocks/ContentLayout/ContentLayout.js +5 -2
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +13 -0
- package/build/esm/blocks/Form/schema.d.ts +13 -0
- package/build/esm/blocks/Header/schema.d.ts +104 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +39 -0
- package/build/esm/blocks/Icons/Icons.js +5 -2
- package/build/esm/blocks/Media/schema.d.ts +52 -0
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +5 -2
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +26 -0
- package/build/esm/blocks/Tabs/schema.d.ts +39 -0
- package/build/esm/components/Author/schema.d.ts +13 -0
- package/build/esm/components/Image/schema.d.ts +13 -0
- package/build/esm/components/Image/schema.js +10 -0
- package/build/esm/editor/containers/Editor/hooks/useEditorState.js +1 -1
- package/build/esm/editor/types/index.d.ts +2 -1
- package/build/esm/models/constructor-items/blocks.d.ts +5 -5
- package/build/esm/models/constructor-items/common.d.ts +1 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +5 -5
- package/build/esm/navigation/schema.d.ts +13 -0
- package/build/esm/schema/constants.d.ts +91 -0
- package/build/esm/schema/validators/common.d.ts +52 -0
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -2
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +13 -0
- package/build/esm/sub-blocks/Content/schema.d.ts +13 -0
- package/build/esm/sub-blocks/ImageCard/ImageCard.js +5 -2
- package/build/esm/sub-blocks/ImageCard/schema.d.ts +13 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +2 -1
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +26 -0
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +26 -0
- package/build/esm/sub-blocks/Quote/Quote.js +6 -2
- package/build/esm/sub-blocks/Quote/schema.d.ts +39 -0
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +5 -5
- package/server/models/constructor-items/common.d.ts +1 -1
- package/server/models/constructor-items/sub-blocks.d.ts +5 -5
- package/widget/index.js +1 -1
|
@@ -17,6 +17,19 @@ export declare const cardSchemas: {
|
|
|
17
17
|
type: string;
|
|
18
18
|
pattern: string;
|
|
19
19
|
optionName: string;
|
|
20
|
+
items?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
type: string;
|
|
23
|
+
items: {
|
|
24
|
+
type: string;
|
|
25
|
+
properties: {
|
|
26
|
+
when: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
optionName: string;
|
|
32
|
+
pattern?: undefined;
|
|
20
33
|
})[];
|
|
21
34
|
};
|
|
22
35
|
direction: {
|
|
@@ -479,6 +492,19 @@ export declare const cardSchemas: {
|
|
|
479
492
|
type: string;
|
|
480
493
|
pattern: string;
|
|
481
494
|
optionName: string;
|
|
495
|
+
items?: undefined;
|
|
496
|
+
} | {
|
|
497
|
+
type: string;
|
|
498
|
+
items: {
|
|
499
|
+
type: string;
|
|
500
|
+
properties: {
|
|
501
|
+
when: {
|
|
502
|
+
type: string;
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
};
|
|
506
|
+
optionName: string;
|
|
507
|
+
pattern?: undefined;
|
|
482
508
|
})[];
|
|
483
509
|
};
|
|
484
510
|
target: {
|
|
@@ -602,6 +628,19 @@ export declare const cardSchemas: {
|
|
|
602
628
|
type: string;
|
|
603
629
|
pattern: string;
|
|
604
630
|
optionName: string;
|
|
631
|
+
items?: undefined;
|
|
632
|
+
} | {
|
|
633
|
+
type: string;
|
|
634
|
+
items: {
|
|
635
|
+
type: string;
|
|
636
|
+
properties: {
|
|
637
|
+
when: {
|
|
638
|
+
type: string;
|
|
639
|
+
};
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
optionName: string;
|
|
643
|
+
pattern?: undefined;
|
|
605
644
|
})[];
|
|
606
645
|
} & {
|
|
607
646
|
optionName: string;
|
|
@@ -625,6 +664,19 @@ export declare const cardSchemas: {
|
|
|
625
664
|
type: string;
|
|
626
665
|
pattern: string;
|
|
627
666
|
optionName: string;
|
|
667
|
+
items?: undefined;
|
|
668
|
+
} | {
|
|
669
|
+
type: string;
|
|
670
|
+
items: {
|
|
671
|
+
type: string;
|
|
672
|
+
properties: {
|
|
673
|
+
when: {
|
|
674
|
+
type: string;
|
|
675
|
+
};
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
optionName: string;
|
|
679
|
+
pattern?: undefined;
|
|
628
680
|
})[];
|
|
629
681
|
};
|
|
630
682
|
color: {
|
|
@@ -667,6 +719,19 @@ export declare const cardSchemas: {
|
|
|
667
719
|
type: string;
|
|
668
720
|
pattern: string;
|
|
669
721
|
optionName: string;
|
|
722
|
+
items?: undefined;
|
|
723
|
+
} | {
|
|
724
|
+
type: string;
|
|
725
|
+
items: {
|
|
726
|
+
type: string;
|
|
727
|
+
properties: {
|
|
728
|
+
when: {
|
|
729
|
+
type: string;
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
optionName: string;
|
|
734
|
+
pattern?: undefined;
|
|
670
735
|
})[];
|
|
671
736
|
};
|
|
672
737
|
description: {
|
|
@@ -1339,6 +1404,19 @@ export declare const cardSchemas: {
|
|
|
1339
1404
|
type: string;
|
|
1340
1405
|
pattern: string;
|
|
1341
1406
|
optionName: string;
|
|
1407
|
+
items?: undefined;
|
|
1408
|
+
} | {
|
|
1409
|
+
type: string;
|
|
1410
|
+
items: {
|
|
1411
|
+
type: string;
|
|
1412
|
+
properties: {
|
|
1413
|
+
when: {
|
|
1414
|
+
type: string;
|
|
1415
|
+
};
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
optionName: string;
|
|
1419
|
+
pattern?: undefined;
|
|
1342
1420
|
})[];
|
|
1343
1421
|
type?: undefined;
|
|
1344
1422
|
items?: undefined;
|
|
@@ -1356,6 +1434,19 @@ export declare const cardSchemas: {
|
|
|
1356
1434
|
type: string;
|
|
1357
1435
|
pattern: string;
|
|
1358
1436
|
optionName: string;
|
|
1437
|
+
items?: undefined;
|
|
1438
|
+
} | {
|
|
1439
|
+
type: string;
|
|
1440
|
+
items: {
|
|
1441
|
+
type: string;
|
|
1442
|
+
properties: {
|
|
1443
|
+
when: {
|
|
1444
|
+
type: string;
|
|
1445
|
+
};
|
|
1446
|
+
};
|
|
1447
|
+
};
|
|
1448
|
+
optionName: string;
|
|
1449
|
+
pattern?: undefined;
|
|
1359
1450
|
})[];
|
|
1360
1451
|
};
|
|
1361
1452
|
optionName: string;
|
|
@@ -262,6 +262,19 @@ export declare const BackgroundProps: {
|
|
|
262
262
|
type: string;
|
|
263
263
|
pattern: string;
|
|
264
264
|
optionName: string;
|
|
265
|
+
items?: undefined;
|
|
266
|
+
} | {
|
|
267
|
+
type: string;
|
|
268
|
+
items: {
|
|
269
|
+
type: string;
|
|
270
|
+
properties: {
|
|
271
|
+
when: {
|
|
272
|
+
type: string;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
optionName: string;
|
|
277
|
+
pattern?: undefined;
|
|
265
278
|
})[];
|
|
266
279
|
};
|
|
267
280
|
color: {
|
|
@@ -539,6 +552,19 @@ export declare const authorItem: {
|
|
|
539
552
|
type: string;
|
|
540
553
|
pattern: string;
|
|
541
554
|
optionName: string;
|
|
555
|
+
items?: undefined;
|
|
556
|
+
} | {
|
|
557
|
+
type: string;
|
|
558
|
+
items: {
|
|
559
|
+
type: string;
|
|
560
|
+
properties: {
|
|
561
|
+
when: {
|
|
562
|
+
type: string;
|
|
563
|
+
};
|
|
564
|
+
};
|
|
565
|
+
};
|
|
566
|
+
optionName: string;
|
|
567
|
+
pattern?: undefined;
|
|
542
568
|
})[];
|
|
543
569
|
};
|
|
544
570
|
description: {
|
|
@@ -967,6 +993,19 @@ export declare const MediaProps: {
|
|
|
967
993
|
type: string;
|
|
968
994
|
pattern: string;
|
|
969
995
|
optionName: string;
|
|
996
|
+
items?: undefined;
|
|
997
|
+
} | {
|
|
998
|
+
type: string;
|
|
999
|
+
items: {
|
|
1000
|
+
type: string;
|
|
1001
|
+
properties: {
|
|
1002
|
+
when: {
|
|
1003
|
+
type: string;
|
|
1004
|
+
};
|
|
1005
|
+
};
|
|
1006
|
+
};
|
|
1007
|
+
optionName: string;
|
|
1008
|
+
pattern?: undefined;
|
|
970
1009
|
})[];
|
|
971
1010
|
type?: undefined;
|
|
972
1011
|
items?: undefined;
|
|
@@ -984,6 +1023,19 @@ export declare const MediaProps: {
|
|
|
984
1023
|
type: string;
|
|
985
1024
|
pattern: string;
|
|
986
1025
|
optionName: string;
|
|
1026
|
+
items?: undefined;
|
|
1027
|
+
} | {
|
|
1028
|
+
type: string;
|
|
1029
|
+
items: {
|
|
1030
|
+
type: string;
|
|
1031
|
+
properties: {
|
|
1032
|
+
when: {
|
|
1033
|
+
type: string;
|
|
1034
|
+
};
|
|
1035
|
+
};
|
|
1036
|
+
};
|
|
1037
|
+
optionName: string;
|
|
1038
|
+
pattern?: undefined;
|
|
987
1039
|
})[];
|
|
988
1040
|
};
|
|
989
1041
|
optionName: string;
|
|
@@ -2,8 +2,9 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useUniqId } from '@gravity-ui/uikit';
|
|
4
4
|
import { CardBase, IconWrapper } from '../../components';
|
|
5
|
+
import { useTheme } from '../../context/theme';
|
|
5
6
|
import { IconPosition } from '../../models/constructor-items/sub-blocks';
|
|
6
|
-
import { block } from '../../utils';
|
|
7
|
+
import { block, getThemedValue } from '../../utils';
|
|
7
8
|
import Content from '../Content/Content';
|
|
8
9
|
import './BasicCard.css';
|
|
9
10
|
const b = block('basic-card');
|
|
@@ -12,9 +13,11 @@ const BasicCard = (props) => {
|
|
|
12
13
|
const titleId = useUniqId();
|
|
13
14
|
const descriptionId = useUniqId();
|
|
14
15
|
const areControlsInFooter = controlPosition === 'footer';
|
|
16
|
+
const theme = useTheme();
|
|
17
|
+
const themedIcon = getThemedValue(icon, theme);
|
|
15
18
|
return (React.createElement(CardBase, Object.assign({ className: b(), contentClassName: b('content') }, cardParams, { extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId } }),
|
|
16
19
|
React.createElement(CardBase.Content, null,
|
|
17
|
-
React.createElement(IconWrapper, { icon:
|
|
20
|
+
React.createElement(IconWrapper, { icon: themedIcon ? { value: themedIcon, position: iconPosition } : undefined, className: b('wrapper') },
|
|
18
21
|
React.createElement(Content, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, size: "s", colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' })))));
|
|
19
22
|
};
|
|
20
23
|
export default BasicCard;
|
|
@@ -21,6 +21,19 @@ export declare const BasicCard: {
|
|
|
21
21
|
type: string;
|
|
22
22
|
pattern: string;
|
|
23
23
|
optionName: string;
|
|
24
|
+
items?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
type: string;
|
|
27
|
+
items: {
|
|
28
|
+
type: string;
|
|
29
|
+
properties: {
|
|
30
|
+
when: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
optionName: string;
|
|
36
|
+
pattern?: undefined;
|
|
24
37
|
})[];
|
|
25
38
|
};
|
|
26
39
|
target: {
|
|
@@ -23,6 +23,19 @@ export declare const ContentItem: {
|
|
|
23
23
|
type: string;
|
|
24
24
|
pattern: string;
|
|
25
25
|
optionName: string;
|
|
26
|
+
items?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
type: string;
|
|
29
|
+
items: {
|
|
30
|
+
type: string;
|
|
31
|
+
properties: {
|
|
32
|
+
when: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
optionName: string;
|
|
38
|
+
pattern?: undefined;
|
|
26
39
|
})[];
|
|
27
40
|
} & {
|
|
28
41
|
optionName: string;
|
|
@@ -2,17 +2,20 @@ import React from 'react';
|
|
|
2
2
|
import { Link, useUniqId } from '@gravity-ui/uikit';
|
|
3
3
|
import { Image } from '../../components';
|
|
4
4
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
5
|
+
import { useTheme } from '../../context/theme';
|
|
5
6
|
import { ImageCardDirection } from '../../models';
|
|
6
|
-
import { block } from '../../utils';
|
|
7
|
+
import { block, getThemedValue } from '../../utils';
|
|
7
8
|
import Content from '../Content/Content';
|
|
8
9
|
import './ImageCard.css';
|
|
9
10
|
const b = block('image-card');
|
|
10
11
|
const CONTENT_COL_SIZES = { all: 12, md: 12 };
|
|
11
12
|
const ImageCard = (props) => {
|
|
12
13
|
const { border = 'shadow', title, text, image, enableImageBorderRadius = false, direction = ImageCardDirection.Direct, margins, backgroundColor, url, target, urlTitle, additionalInfo, links, buttons, list, theme: cardTheme = 'default', size = 's', controlPosition = 'content', } = props;
|
|
14
|
+
const globalTheme = useTheme();
|
|
13
15
|
const areControlsInFooter = controlPosition === 'footer';
|
|
14
16
|
const hasContent = Boolean(text || title || buttons || links || list);
|
|
15
|
-
const
|
|
17
|
+
const themedImage = getThemedValue(image, globalTheme);
|
|
18
|
+
const imageProps = getMediaImage(themedImage);
|
|
16
19
|
const titleId = useUniqId();
|
|
17
20
|
const cardContent = (React.createElement(React.Fragment, null,
|
|
18
21
|
React.createElement("div", { className: b('image', { margins }) },
|
|
@@ -15,6 +15,19 @@ export declare const ImageCard: {
|
|
|
15
15
|
type: string;
|
|
16
16
|
pattern: string;
|
|
17
17
|
optionName: string;
|
|
18
|
+
items?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
type: string;
|
|
21
|
+
items: {
|
|
22
|
+
type: string;
|
|
23
|
+
properties: {
|
|
24
|
+
when: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
optionName: string;
|
|
30
|
+
pattern?: undefined;
|
|
18
31
|
})[];
|
|
19
32
|
};
|
|
20
33
|
direction: {
|
|
@@ -13,6 +13,7 @@ const LayoutItem = (_a) => {
|
|
|
13
13
|
const normalizedLinks = useMemo(() => getLayoutItemLinks(links), [links]);
|
|
14
14
|
const areControlsInFooter = controlPosition === 'footer';
|
|
15
15
|
const theme = useTheme();
|
|
16
|
+
const themedIcon = getThemedValue(icon, theme);
|
|
16
17
|
const contentProps = Object.assign(Object.assign({ controlPosition: areControlsInFooter ? 'bottom' : 'default' }, content), { links: normalizedLinks, size: 's', colSizes: { all: 12, md: 12 } });
|
|
17
18
|
const titleId = useUniqId();
|
|
18
19
|
const renderMedia = () => {
|
|
@@ -29,7 +30,7 @@ const LayoutItem = (_a) => {
|
|
|
29
30
|
renderMedia(),
|
|
30
31
|
metaInfo && React.createElement(MetaInfo, { items: metaInfo, className: b('meta-info') }),
|
|
31
32
|
React.createElement("div", { className: b('content', { 'no-media': !media }) },
|
|
32
|
-
React.createElement(IconWrapper, { icon:
|
|
33
|
+
React.createElement(IconWrapper, { icon: themedIcon, className: b('wrapper') },
|
|
33
34
|
React.createElement(Content, Object.assign({}, contentProps, { titleId: titleId }))))));
|
|
34
35
|
};
|
|
35
36
|
export default LayoutItem;
|
|
@@ -21,6 +21,19 @@ export declare const LayoutItem: {
|
|
|
21
21
|
type: string;
|
|
22
22
|
pattern: string;
|
|
23
23
|
optionName: string;
|
|
24
|
+
items?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
type: string;
|
|
27
|
+
items: {
|
|
28
|
+
type: string;
|
|
29
|
+
properties: {
|
|
30
|
+
when: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
optionName: string;
|
|
36
|
+
pattern?: undefined;
|
|
24
37
|
})[];
|
|
25
38
|
type?: undefined;
|
|
26
39
|
items?: undefined;
|
|
@@ -38,6 +51,19 @@ export declare const LayoutItem: {
|
|
|
38
51
|
type: string;
|
|
39
52
|
pattern: string;
|
|
40
53
|
optionName: string;
|
|
54
|
+
items?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
type: string;
|
|
57
|
+
items: {
|
|
58
|
+
type: string;
|
|
59
|
+
properties: {
|
|
60
|
+
when: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
optionName: string;
|
|
66
|
+
pattern?: undefined;
|
|
41
67
|
})[];
|
|
42
68
|
};
|
|
43
69
|
optionName: string;
|
|
@@ -104,6 +104,19 @@ export declare const MediaCardBlock: {
|
|
|
104
104
|
type: string;
|
|
105
105
|
pattern: string;
|
|
106
106
|
optionName: string;
|
|
107
|
+
items?: undefined;
|
|
108
|
+
} | {
|
|
109
|
+
type: string;
|
|
110
|
+
items: {
|
|
111
|
+
type: string;
|
|
112
|
+
properties: {
|
|
113
|
+
when: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
optionName: string;
|
|
119
|
+
pattern?: undefined;
|
|
107
120
|
})[];
|
|
108
121
|
type?: undefined;
|
|
109
122
|
items?: undefined;
|
|
@@ -121,6 +134,19 @@ export declare const MediaCardBlock: {
|
|
|
121
134
|
type: string;
|
|
122
135
|
pattern: string;
|
|
123
136
|
optionName: string;
|
|
137
|
+
items?: undefined;
|
|
138
|
+
} | {
|
|
139
|
+
type: string;
|
|
140
|
+
items: {
|
|
141
|
+
type: string;
|
|
142
|
+
properties: {
|
|
143
|
+
when: {
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
optionName: string;
|
|
149
|
+
pattern?: undefined;
|
|
124
150
|
})[];
|
|
125
151
|
};
|
|
126
152
|
optionName: string;
|
|
@@ -14,11 +14,15 @@ const Quote = (props) => {
|
|
|
14
14
|
const imageData = getMediaImage(imageThemed);
|
|
15
15
|
const handleAnalytics = useAnalytics(DefaultEventNames.QuoteButton, url);
|
|
16
16
|
const handleButtonClick = useCallback(() => handleAnalytics(), [handleAnalytics]);
|
|
17
|
+
const themedAuthor = author
|
|
18
|
+
? Object.assign(Object.assign({}, author), { avatar: getThemedValue(author.avatar, theme) })
|
|
19
|
+
: author;
|
|
17
20
|
const renderFooter = Boolean(author || url) && (React.createElement("div", { className: b('author-wrapper') },
|
|
18
|
-
|
|
21
|
+
themedAuthor && (React.createElement(Author, { className: b('author', { theme: textTheme }), author: themedAuthor, type: AuthorType.Line, theme: textTheme })),
|
|
19
22
|
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
23
|
button && React.createElement(Button, Object.assign({ size: "xl" }, button))));
|
|
21
|
-
const
|
|
24
|
+
const themedLogoProps = getThemedValue(logo, theme);
|
|
25
|
+
const logoProps = getMediaImage(themedLogoProps);
|
|
22
26
|
return (React.createElement("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {} },
|
|
23
27
|
React.createElement("div", { key: text, className: b('content-wrapper') },
|
|
24
28
|
React.createElement("div", null,
|
|
@@ -24,6 +24,19 @@ export declare const Quote: {
|
|
|
24
24
|
type: string;
|
|
25
25
|
pattern: string;
|
|
26
26
|
optionName: string;
|
|
27
|
+
items?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
type: string;
|
|
30
|
+
items: {
|
|
31
|
+
type: string;
|
|
32
|
+
properties: {
|
|
33
|
+
when: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
optionName: string;
|
|
39
|
+
pattern?: undefined;
|
|
27
40
|
})[];
|
|
28
41
|
} & {
|
|
29
42
|
optionName: string;
|
|
@@ -47,6 +60,19 @@ export declare const Quote: {
|
|
|
47
60
|
type: string;
|
|
48
61
|
pattern: string;
|
|
49
62
|
optionName: string;
|
|
63
|
+
items?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
type: string;
|
|
66
|
+
items: {
|
|
67
|
+
type: string;
|
|
68
|
+
properties: {
|
|
69
|
+
when: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
optionName: string;
|
|
75
|
+
pattern?: undefined;
|
|
50
76
|
})[];
|
|
51
77
|
};
|
|
52
78
|
color: {
|
|
@@ -89,6 +115,19 @@ export declare const Quote: {
|
|
|
89
115
|
type: string;
|
|
90
116
|
pattern: string;
|
|
91
117
|
optionName: string;
|
|
118
|
+
items?: undefined;
|
|
119
|
+
} | {
|
|
120
|
+
type: string;
|
|
121
|
+
items: {
|
|
122
|
+
type: string;
|
|
123
|
+
properties: {
|
|
124
|
+
when: {
|
|
125
|
+
type: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
optionName: string;
|
|
130
|
+
pattern?: undefined;
|
|
92
131
|
})[];
|
|
93
132
|
};
|
|
94
133
|
description: {
|
package/package.json
CHANGED
|
@@ -133,7 +133,7 @@ export interface PromoFeaturesItem {
|
|
|
133
133
|
title: string;
|
|
134
134
|
text: string;
|
|
135
135
|
theme?: 'accent' | 'accent-light' | 'primary';
|
|
136
|
-
media?: MediaProps
|
|
136
|
+
media?: ThemeSupporting<MediaProps>;
|
|
137
137
|
}
|
|
138
138
|
export interface PromoFeaturesProps extends Animatable {
|
|
139
139
|
items: PromoFeaturesItem[];
|
|
@@ -233,9 +233,9 @@ export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChi
|
|
|
233
233
|
titleClassName?: string;
|
|
234
234
|
description?: string;
|
|
235
235
|
colSizes?: GridColumnSizesType;
|
|
236
|
-
background?: BackgroundImageProps & {
|
|
236
|
+
background?: ThemeSupporting<BackgroundImageProps & {
|
|
237
237
|
border?: CardBorder;
|
|
238
|
-
}
|
|
238
|
+
}>;
|
|
239
239
|
}
|
|
240
240
|
export type FilterTag = {
|
|
241
241
|
id: string;
|
|
@@ -258,7 +258,7 @@ export interface FilterBlockProps extends Animatable, LoadableChildren {
|
|
|
258
258
|
export interface IconsBlockItemProps extends AnalyticsEventsBase {
|
|
259
259
|
url: string;
|
|
260
260
|
text: string;
|
|
261
|
-
src: string
|
|
261
|
+
src: ThemeSupporting<string>;
|
|
262
262
|
}
|
|
263
263
|
export interface IconsBlockProps {
|
|
264
264
|
title?: string;
|
|
@@ -269,7 +269,7 @@ export interface IconsBlockProps {
|
|
|
269
269
|
}
|
|
270
270
|
interface ContentLayoutBlockParams {
|
|
271
271
|
size?: ContentSize;
|
|
272
|
-
background?: BackgroundImageProps
|
|
272
|
+
background?: ThemeSupporting<BackgroundImageProps>;
|
|
273
273
|
centered?: boolean;
|
|
274
274
|
theme?: ContentTheme;
|
|
275
275
|
textWidth?: ContentTextSize;
|
|
@@ -249,7 +249,7 @@ export interface AuthorItem {
|
|
|
249
249
|
firstName: string;
|
|
250
250
|
secondName: string;
|
|
251
251
|
description?: string;
|
|
252
|
-
avatar?: ImageProps | JSX.Element;
|
|
252
|
+
avatar?: ThemeSupporting<ImageProps> | JSX.Element;
|
|
253
253
|
}
|
|
254
254
|
export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
255
255
|
items: {
|
|
@@ -77,7 +77,7 @@ export interface QuoteProps extends Themable, CardBaseProps {
|
|
|
77
77
|
text?: string;
|
|
78
78
|
yfmText?: string;
|
|
79
79
|
image: ThemedImage;
|
|
80
|
-
logo: ImageProps
|
|
80
|
+
logo: ThemeSupporting<ImageProps>;
|
|
81
81
|
color?: string;
|
|
82
82
|
/**
|
|
83
83
|
* @deprecated use property button instead
|
|
@@ -106,7 +106,7 @@ export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase,
|
|
|
106
106
|
export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'controlPosition'> {
|
|
107
107
|
url: string;
|
|
108
108
|
urlTitle?: string;
|
|
109
|
-
icon?: ImageProps
|
|
109
|
+
icon?: ThemeSupporting<ImageProps>;
|
|
110
110
|
target?: string;
|
|
111
111
|
iconPosition?: IconPosition;
|
|
112
112
|
}
|
|
@@ -135,14 +135,14 @@ export interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, '
|
|
|
135
135
|
}
|
|
136
136
|
export interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {
|
|
137
137
|
content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;
|
|
138
|
-
media?: MediaProps
|
|
138
|
+
media?: ThemeSupporting<MediaProps>;
|
|
139
139
|
metaInfo?: string[];
|
|
140
140
|
border?: boolean;
|
|
141
141
|
fullscreen?: boolean;
|
|
142
|
-
icon?: PositionedIcon
|
|
142
|
+
icon?: ThemeSupporting<PositionedIcon>;
|
|
143
143
|
}
|
|
144
144
|
export interface ImageCardProps extends CardBaseProps, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {
|
|
145
|
-
image: ImageProps
|
|
145
|
+
image: ThemeSupporting<ImageProps>;
|
|
146
146
|
enableImageBorderRadius?: boolean;
|
|
147
147
|
margins?: ImageCardMargins;
|
|
148
148
|
direction?: ImageCardDirection;
|