@gravity-ui/page-constructor 4.51.0 → 4.52.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/Banner/schema.d.ts +12 -0
- package/build/cjs/blocks/Banner/schema.js +4 -1
- package/build/cjs/blocks/Header/schema.js +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +9 -1
- package/build/cjs/components/ReactPlayer/utils/youtube.d.ts +2 -0
- package/build/cjs/components/ReactPlayer/utils/youtube.js +7 -0
- 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 +1 -0
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +18 -3
- package/build/cjs/models/constructor-items/sub-blocks.js +7 -1
- package/build/cjs/schema/constants.d.ts +80 -0
- package/build/cjs/schema/constants.js +2 -1
- package/build/cjs/schema/validators/common.d.ts +1 -0
- package/build/cjs/schema/validators/common.js +2 -1
- package/build/cjs/schema/validators/sub-blocks.d.ts +1 -0
- package/build/cjs/schema/validators/sub-blocks.js +1 -0
- package/build/cjs/sub-blocks/ImageCard/ImageCard.css +59 -0
- package/build/cjs/sub-blocks/ImageCard/ImageCard.d.ts +3 -0
- package/build/cjs/sub-blocks/ImageCard/ImageCard.js +21 -0
- package/build/cjs/sub-blocks/ImageCard/schema.d.ts +78 -0
- package/build/cjs/sub-blocks/ImageCard/schema.js +24 -0
- package/build/cjs/sub-blocks/index.d.ts +1 -0
- package/build/cjs/sub-blocks/index.js +3 -1
- package/build/esm/blocks/Banner/schema.d.ts +12 -0
- package/build/esm/blocks/Banner/schema.js +5 -2
- package/build/esm/blocks/Header/schema.js +2 -2
- package/build/esm/components/ReactPlayer/ReactPlayer.js +9 -1
- package/build/esm/components/ReactPlayer/utils/youtube.d.ts +2 -0
- package/build/esm/components/ReactPlayer/utils/youtube.js +3 -0
- 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 +1 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +18 -3
- package/build/esm/models/constructor-items/sub-blocks.js +6 -0
- package/build/esm/schema/constants.d.ts +80 -0
- package/build/esm/schema/constants.js +3 -2
- package/build/esm/schema/validators/common.d.ts +1 -0
- package/build/esm/schema/validators/common.js +1 -0
- package/build/esm/schema/validators/sub-blocks.d.ts +1 -0
- package/build/esm/schema/validators/sub-blocks.js +1 -0
- package/build/esm/sub-blocks/ImageCard/ImageCard.css +59 -0
- package/build/esm/sub-blocks/ImageCard/ImageCard.d.ts +4 -0
- package/build/esm/sub-blocks/ImageCard/ImageCard.js +19 -0
- package/build/esm/sub-blocks/ImageCard/schema.d.ts +78 -0
- package/build/esm/sub-blocks/ImageCard/schema.js +20 -0
- package/build/esm/sub-blocks/index.d.ts +1 -0
- package/build/esm/sub-blocks/index.js +1 -0
- package/package.json +2 -1
- package/server/models/constructor-items/common.d.ts +1 -0
- package/server/models/constructor-items/sub-blocks.d.ts +18 -3
- package/server/models/constructor-items/sub-blocks.js +7 -1
- package/widget/index.js +1 -1
|
@@ -23,6 +23,10 @@ export declare const BannerCardProps: {
|
|
|
23
23
|
optionName: string;
|
|
24
24
|
})[];
|
|
25
25
|
};
|
|
26
|
+
mediaView: {
|
|
27
|
+
type: string;
|
|
28
|
+
enum: string[];
|
|
29
|
+
};
|
|
26
30
|
disableCompress: {
|
|
27
31
|
type: string;
|
|
28
32
|
};
|
|
@@ -326,6 +330,10 @@ export declare const BannerBlock: {
|
|
|
326
330
|
optionName: string;
|
|
327
331
|
})[];
|
|
328
332
|
};
|
|
333
|
+
mediaView: {
|
|
334
|
+
type: string;
|
|
335
|
+
enum: string[];
|
|
336
|
+
};
|
|
329
337
|
disableCompress: {
|
|
330
338
|
type: string;
|
|
331
339
|
};
|
|
@@ -630,6 +638,10 @@ export declare const BannerCard: {
|
|
|
630
638
|
optionName: string;
|
|
631
639
|
})[];
|
|
632
640
|
};
|
|
641
|
+
mediaView: {
|
|
642
|
+
type: string;
|
|
643
|
+
enum: string[];
|
|
644
|
+
};
|
|
633
645
|
disableCompress: {
|
|
634
646
|
type: string;
|
|
635
647
|
};
|
|
@@ -13,7 +13,10 @@ exports.BannerCardProps = {
|
|
|
13
13
|
contentType: 'yfm',
|
|
14
14
|
}, image: (0, common_1.withTheme)({
|
|
15
15
|
type: 'string',
|
|
16
|
-
}),
|
|
16
|
+
}), mediaView: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
enum: common_1.mediaView,
|
|
19
|
+
}, disableCompress: {
|
|
17
20
|
type: 'boolean',
|
|
18
21
|
}, color: (0, common_1.withTheme)({
|
|
19
22
|
type: 'string',
|
|
@@ -16,6 +16,7 @@ const utils_1 = require("../../utils");
|
|
|
16
16
|
const CustomBarControls_1 = tslib_1.__importDefault(require("./CustomBarControls"));
|
|
17
17
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
18
18
|
const utils_2 = require("./utils");
|
|
19
|
+
const youtube_1 = require("./utils/youtube");
|
|
19
20
|
const b = (0, utils_1.block)('ReactPlayer');
|
|
20
21
|
const FPS = 60;
|
|
21
22
|
// eslint-disable-next-line react/display-name
|
|
@@ -52,8 +53,15 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
52
53
|
if (!playerRef) {
|
|
53
54
|
return;
|
|
54
55
|
}
|
|
56
|
+
let play, pause, addEventListener;
|
|
55
57
|
const videoInstance = playerRef.getInternalPlayer();
|
|
56
|
-
|
|
58
|
+
if ((0, youtube_1.isYoutubePlayerInstance)(videoInstance)) {
|
|
59
|
+
({ pauseVideo: pause, playVideo: play, addEventListener } = videoInstance);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// it is assumed that `videoInstance` is HTMLVideoElement by default
|
|
63
|
+
({ play, pause, addEventListener } = videoInstance);
|
|
64
|
+
}
|
|
57
65
|
// eslint-disable-next-line consistent-return
|
|
58
66
|
return {
|
|
59
67
|
play: play.bind(videoInstance),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isYoutubePlayerInstance = void 0;
|
|
4
|
+
const isYoutubePlayerInstance = (playerInstance) => {
|
|
5
|
+
return Boolean(playerInstance['pauseVideo'] && playerInstance['playVideo']);
|
|
6
|
+
};
|
|
7
|
+
exports.isYoutubePlayerInstance = isYoutubePlayerInstance;
|
|
@@ -30,6 +30,7 @@ export declare const subBlockMap: {
|
|
|
30
30
|
content: (props: import("./sub-blocks/Content/Content").ContentProps) => JSX.Element;
|
|
31
31
|
quote: (props: import("./models").QuoteProps) => JSX.Element;
|
|
32
32
|
"price-card": (props: import("./models").PriceCardProps) => JSX.Element;
|
|
33
|
+
"image-card": (props: import("./models").ImageCardProps) => JSX.Element;
|
|
33
34
|
};
|
|
34
35
|
export declare const navItemMap: {
|
|
35
36
|
button: import("react").FC<Pick<import("./navigation/models").NavigationItemProps, "className"> & import("./models").ButtonProps>;
|
|
@@ -39,6 +39,7 @@ exports.subBlockMap = {
|
|
|
39
39
|
[models_1.SubBlockType.Content]: sub_blocks_1.Content,
|
|
40
40
|
[models_1.SubBlockType.Quote]: sub_blocks_1.Quote,
|
|
41
41
|
[models_1.SubBlockType.PriceCard]: sub_blocks_1.PriceCard,
|
|
42
|
+
[models_1.SubBlockType.ImageCard]: sub_blocks_1.ImageCard,
|
|
42
43
|
};
|
|
43
44
|
exports.navItemMap = {
|
|
44
45
|
[models_1.NavigationItemType.Button]: NavigationItem_1.NavigationButton,
|
|
@@ -62,6 +62,7 @@ export type ContentSize = 's' | 'l';
|
|
|
62
62
|
export type ContentTextSize = 's' | 'm' | 'l';
|
|
63
63
|
export type ContentTheme = 'default' | 'dark' | 'light';
|
|
64
64
|
export type FileLinkType = 'vertical' | 'horizontal';
|
|
65
|
+
export type ImageCardMargins = 's' | 'm';
|
|
65
66
|
export interface Themable {
|
|
66
67
|
theme?: TextTheme;
|
|
67
68
|
}
|
|
@@ -3,7 +3,7 @@ import { ThemeSupporting } from '../../utils';
|
|
|
3
3
|
import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
|
|
4
4
|
import { AnalyticsEventsBase, PixelEvent } from '../common';
|
|
5
5
|
import { ContentBlockProps } from './blocks';
|
|
6
|
-
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, MediaView, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
|
|
6
|
+
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageCardMargins, ImageObjectProps, ImageProps, LinkProps, MediaProps, MediaView, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
|
|
7
7
|
export declare enum SubBlockType {
|
|
8
8
|
Divider = "divider",
|
|
9
9
|
Quote = "quote",
|
|
@@ -22,7 +22,8 @@ export declare enum SubBlockType {
|
|
|
22
22
|
* @deprecated Will be removed, use BasicCard instead
|
|
23
23
|
*/
|
|
24
24
|
Card = "card",
|
|
25
|
-
PriceCard = "price-card"
|
|
25
|
+
PriceCard = "price-card",
|
|
26
|
+
ImageCard = "image-card"
|
|
26
27
|
}
|
|
27
28
|
export declare enum IconPosition {
|
|
28
29
|
Top = "top",
|
|
@@ -35,6 +36,10 @@ export interface PositionedIcon {
|
|
|
35
36
|
export interface IconWrapperProps {
|
|
36
37
|
icon?: PositionedIcon;
|
|
37
38
|
}
|
|
39
|
+
export declare enum ImageCardDirection {
|
|
40
|
+
Direct = "direct",
|
|
41
|
+
Reverse = "reverse"
|
|
42
|
+
}
|
|
38
43
|
export declare const SubBlockTypes: SubBlockType[];
|
|
39
44
|
export interface DividerProps {
|
|
40
45
|
size?: DividerSize;
|
|
@@ -137,6 +142,13 @@ export interface LayoutItemProps extends ClassNameProps, AnalyticsEventsBase {
|
|
|
137
142
|
fullscreen?: boolean;
|
|
138
143
|
icon?: PositionedIcon;
|
|
139
144
|
}
|
|
145
|
+
export interface ImageCardProps extends CardBaseProps, Pick<ContentBlockProps, 'title' | 'text'> {
|
|
146
|
+
image: ImageProps;
|
|
147
|
+
enableImageBorderRadius?: boolean;
|
|
148
|
+
margins?: ImageCardMargins;
|
|
149
|
+
direction?: ImageCardDirection;
|
|
150
|
+
backgroundColor?: string;
|
|
151
|
+
}
|
|
140
152
|
export type DividerModel = {
|
|
141
153
|
type: SubBlockType.Divider;
|
|
142
154
|
} & DividerProps;
|
|
@@ -167,5 +179,8 @@ export type BasicCardModel = {
|
|
|
167
179
|
export type PriceCardModel = {
|
|
168
180
|
type: SubBlockType.PriceCard;
|
|
169
181
|
} & PriceCardProps;
|
|
170
|
-
export type
|
|
182
|
+
export type ImageCardModel = {
|
|
183
|
+
type: SubBlockType.ImageCard;
|
|
184
|
+
} & ImageCardProps;
|
|
185
|
+
export type SubBlockModels = DividerModel | QuoteModel | PriceDetailedModel | MediaCardModel | BackgroundCardModel | HubspotFormModel | BannerCardModel | BasicCardModel | PriceCardModel | LayoutItemModel | ImageCardModel;
|
|
171
186
|
export type SubBlock = SubBlockModels;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubBlockTypes = exports.IconPosition = exports.SubBlockType = void 0;
|
|
3
|
+
exports.SubBlockTypes = exports.ImageCardDirection = exports.IconPosition = exports.SubBlockType = void 0;
|
|
4
4
|
var SubBlockType;
|
|
5
5
|
(function (SubBlockType) {
|
|
6
6
|
SubBlockType["Divider"] = "divider";
|
|
@@ -21,10 +21,16 @@ var SubBlockType;
|
|
|
21
21
|
*/
|
|
22
22
|
SubBlockType["Card"] = "card";
|
|
23
23
|
SubBlockType["PriceCard"] = "price-card";
|
|
24
|
+
SubBlockType["ImageCard"] = "image-card";
|
|
24
25
|
})(SubBlockType = exports.SubBlockType || (exports.SubBlockType = {}));
|
|
25
26
|
var IconPosition;
|
|
26
27
|
(function (IconPosition) {
|
|
27
28
|
IconPosition["Top"] = "top";
|
|
28
29
|
IconPosition["Left"] = "left";
|
|
29
30
|
})(IconPosition = exports.IconPosition || (exports.IconPosition = {}));
|
|
31
|
+
var ImageCardDirection;
|
|
32
|
+
(function (ImageCardDirection) {
|
|
33
|
+
ImageCardDirection["Direct"] = "direct";
|
|
34
|
+
ImageCardDirection["Reverse"] = "reverse";
|
|
35
|
+
})(ImageCardDirection = exports.ImageCardDirection || (exports.ImageCardDirection = {}));
|
|
30
36
|
exports.SubBlockTypes = Object.values(SubBlockType);
|
|
@@ -1,6 +1,82 @@
|
|
|
1
1
|
import { BlockType } from '../models';
|
|
2
2
|
export declare const blockSchemas: Record<BlockType, object>;
|
|
3
3
|
export declare const cardSchemas: {
|
|
4
|
+
'image-card': {
|
|
5
|
+
additionalProperties: boolean;
|
|
6
|
+
required: string[];
|
|
7
|
+
properties: {
|
|
8
|
+
image: {
|
|
9
|
+
oneOf: ({
|
|
10
|
+
type: string;
|
|
11
|
+
properties: {
|
|
12
|
+
when: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
17
|
+
type: string;
|
|
18
|
+
pattern: string;
|
|
19
|
+
optionName: string;
|
|
20
|
+
})[];
|
|
21
|
+
};
|
|
22
|
+
direction: {
|
|
23
|
+
type: string;
|
|
24
|
+
enum: string[];
|
|
25
|
+
};
|
|
26
|
+
margins: {
|
|
27
|
+
type: string;
|
|
28
|
+
enum: string[];
|
|
29
|
+
};
|
|
30
|
+
backgroundColor: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
title: {
|
|
34
|
+
oneOf: ({
|
|
35
|
+
type: string;
|
|
36
|
+
contentType: string;
|
|
37
|
+
optionName: string;
|
|
38
|
+
} | {
|
|
39
|
+
optionName: string;
|
|
40
|
+
type: string;
|
|
41
|
+
additionalProperties: boolean;
|
|
42
|
+
required: string[];
|
|
43
|
+
properties: {
|
|
44
|
+
text: {
|
|
45
|
+
type: string;
|
|
46
|
+
contentType: string;
|
|
47
|
+
};
|
|
48
|
+
textSize: {
|
|
49
|
+
type: string;
|
|
50
|
+
enum: string[];
|
|
51
|
+
};
|
|
52
|
+
url: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
urlTitle: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
resetMargin: {
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
contentType?: undefined;
|
|
63
|
+
})[];
|
|
64
|
+
};
|
|
65
|
+
text: {
|
|
66
|
+
type: string;
|
|
67
|
+
contentType: string;
|
|
68
|
+
inputType: string;
|
|
69
|
+
};
|
|
70
|
+
border: {
|
|
71
|
+
type: string;
|
|
72
|
+
enum: string[];
|
|
73
|
+
};
|
|
74
|
+
type: {};
|
|
75
|
+
when: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
4
80
|
'price-card': {
|
|
5
81
|
additionalProperties: boolean;
|
|
6
82
|
required: string[];
|
|
@@ -986,6 +1062,10 @@ export declare const cardSchemas: {
|
|
|
986
1062
|
optionName: string;
|
|
987
1063
|
})[];
|
|
988
1064
|
};
|
|
1065
|
+
mediaView: {
|
|
1066
|
+
type: string;
|
|
1067
|
+
enum: string[];
|
|
1068
|
+
};
|
|
989
1069
|
disableCompress: {
|
|
990
1070
|
type: string;
|
|
991
1071
|
};
|
|
@@ -4,7 +4,7 @@ exports.constructorCardSchemaNames = exports.constructorBlockSchemaNames = expor
|
|
|
4
4
|
const blocks_1 = require("./validators/blocks");
|
|
5
5
|
const sub_blocks_1 = require("./validators/sub-blocks");
|
|
6
6
|
exports.blockSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.TableBlock), blocks_1.TabsBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock), blocks_1.FilterBlock), blocks_1.FormBlock);
|
|
7
|
-
exports.cardSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.MediaCardBlock), blocks_1.BannerCard), sub_blocks_1.PriceDetailedBlock), sub_blocks_1.BackgroundCard), sub_blocks_1.Quote), sub_blocks_1.BasicCard), sub_blocks_1.PriceCardBlock);
|
|
7
|
+
exports.cardSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.MediaCardBlock), blocks_1.BannerCard), sub_blocks_1.PriceDetailedBlock), sub_blocks_1.BackgroundCard), sub_blocks_1.Quote), sub_blocks_1.BasicCard), sub_blocks_1.PriceCardBlock), sub_blocks_1.ImageCard);
|
|
8
8
|
exports.constructorBlockSchemaNames = [
|
|
9
9
|
'divider',
|
|
10
10
|
'quote',
|
|
@@ -41,4 +41,5 @@ exports.constructorCardSchemaNames = [
|
|
|
41
41
|
'basic-card',
|
|
42
42
|
'layout-item',
|
|
43
43
|
'price-card',
|
|
44
|
+
'image-card',
|
|
44
45
|
];
|
|
@@ -20,6 +20,7 @@ export declare const sizeNumber: {
|
|
|
20
20
|
};
|
|
21
21
|
export declare const contentThemes: string[];
|
|
22
22
|
export declare const quoteTypes: QuoteType[];
|
|
23
|
+
export declare const mediaView: string[];
|
|
23
24
|
export declare const customControlsType: CustomControlsType[];
|
|
24
25
|
export declare const customControlsButtonPositioning: CustomControlsButtonPositioning[];
|
|
25
26
|
export declare const BaseProps: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BlockHeaderProps = exports.CardBase = exports.BorderProps = exports.MapProps = exports.YMapMarker = exports.YMapMarkerLabel = exports.MediaProps = exports.ButtonBlock = exports.TitleProps = exports.BlockBaseProps = exports.AnchorProps = exports.withTheme = exports.MenuProps = exports.ButtonProps = exports.authorItem = exports.FileLinkProps = exports.LinkProps = exports.BackgroundProps = exports.DataLensProps = exports.DataLensObjectProps = exports.JustifyProps = exports.ThemeProps = exports.VideoProps = exports.CustomControlsOptionsProps = exports.PlayButtonProps = exports.LoopProps = exports.ChildrenCardsProps = exports.ChildrenProps = exports.AnimatableProps = exports.sliderSizesObject = exports.containerSizesObject = exports.BaseProps = exports.customControlsButtonPositioning = exports.customControlsType = exports.quoteTypes = exports.contentThemes = exports.sizeNumber = exports.dividerEnum = exports.fileLinkTypes = exports.videoControlsTypes = exports.playIconThemes = exports.playIconTypes = exports.videoTypes = exports.contentTextWidth = exports.contentSizes = exports.sliderSizesArray = exports.containerSizesArray = exports.textSize = exports.mediaDirection = void 0;
|
|
3
|
+
exports.BlockHeaderProps = exports.CardBase = exports.BorderProps = exports.MapProps = exports.YMapMarker = exports.YMapMarkerLabel = exports.MediaProps = exports.ButtonBlock = exports.TitleProps = exports.BlockBaseProps = exports.AnchorProps = exports.withTheme = exports.MenuProps = exports.ButtonProps = exports.authorItem = exports.FileLinkProps = exports.LinkProps = exports.BackgroundProps = exports.DataLensProps = exports.DataLensObjectProps = exports.JustifyProps = exports.ThemeProps = exports.VideoProps = exports.CustomControlsOptionsProps = exports.PlayButtonProps = exports.LoopProps = exports.ChildrenCardsProps = exports.ChildrenProps = exports.AnimatableProps = exports.sliderSizesObject = exports.containerSizesObject = exports.BaseProps = exports.customControlsButtonPositioning = exports.customControlsType = exports.mediaView = exports.quoteTypes = exports.contentThemes = exports.sizeNumber = exports.dividerEnum = exports.fileLinkTypes = exports.videoControlsTypes = exports.playIconThemes = exports.playIconTypes = exports.videoTypes = exports.contentTextWidth = exports.contentSizes = exports.sliderSizesArray = exports.containerSizesArray = exports.textSize = exports.mediaDirection = void 0;
|
|
4
4
|
const schema_1 = require("../../components/Image/schema");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
6
|
const event_1 = require("./event");
|
|
@@ -20,6 +20,7 @@ exports.dividerEnum = { enum: ['0', 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xx
|
|
|
20
20
|
exports.sizeNumber = { type: 'number', maximum: 12, minimum: 1 };
|
|
21
21
|
exports.contentThemes = ['default', 'dark', 'light'];
|
|
22
22
|
exports.quoteTypes = Object.values(models_1.QuoteType);
|
|
23
|
+
exports.mediaView = ['fit', 'full'];
|
|
23
24
|
exports.customControlsType = [
|
|
24
25
|
models_1.CustomControlsType.WithMuteButton,
|
|
25
26
|
models_1.CustomControlsType.WithPlayPauseButton,
|
|
@@ -11,3 +11,4 @@ tslib_1.__exportStar(require("../../sub-blocks/Divider/schema"), exports);
|
|
|
11
11
|
tslib_1.__exportStar(require("../../sub-blocks/BasicCard/schema"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("../../sub-blocks/PriceCard/schema"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("../../sub-blocks/HubspotForm/schema"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("../../sub-blocks/ImageCard/schema"), exports);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
.pc-image-card_border_shadow {
|
|
2
|
+
box-shadow: 0px 4px 24px var(--pc-color-sfx-shadow), 0px 2px 8px var(--pc-color-sfx-shadow);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* use this for style redefinitions to awoid problems with
|
|
6
|
+
unpredictable css rules order in build */
|
|
7
|
+
.pc-image-card {
|
|
8
|
+
min-height: 248px;
|
|
9
|
+
height: 100%;
|
|
10
|
+
overflow-x: hidden;
|
|
11
|
+
border-radius: var(--pc-border-radius);
|
|
12
|
+
background-color: var(--g-color-base-float);
|
|
13
|
+
transition: box-shadow 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
|
|
14
|
+
min-height: 1px;
|
|
15
|
+
}
|
|
16
|
+
.pc-image-card_border_line {
|
|
17
|
+
border: 1px solid var(--g-color-line-generic);
|
|
18
|
+
}
|
|
19
|
+
.pc-image-card .pc-image-card__content {
|
|
20
|
+
padding: 32px;
|
|
21
|
+
}
|
|
22
|
+
.pc-image-card .pc-image-card__image_inner {
|
|
23
|
+
width: 100%;
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
.pc-image-card .pc-image-card__image_inner_radius {
|
|
27
|
+
border-radius: var(--pc-border-radius);
|
|
28
|
+
}
|
|
29
|
+
.pc-image-card .pc-image-card__image_margins_s {
|
|
30
|
+
padding: 4px;
|
|
31
|
+
}
|
|
32
|
+
.pc-image-card .pc-image-card__image_margins_s .pc-image-card__image_inner {
|
|
33
|
+
border-radius: calc(var(--pc-border-radius) - var(--pc-image-padding));
|
|
34
|
+
}
|
|
35
|
+
.pc-image-card .pc-image-card__image_margins_m {
|
|
36
|
+
padding: 32px;
|
|
37
|
+
}
|
|
38
|
+
.pc-image-card .pc-image-card__image_margins_m .pc-image-card__image_inner {
|
|
39
|
+
border-radius: initial;
|
|
40
|
+
}
|
|
41
|
+
.pc-image-card_with-content {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
}
|
|
45
|
+
.pc-image-card_with-content.pc-image-card_direction_direct .pc-image-card__image {
|
|
46
|
+
padding-bottom: 0;
|
|
47
|
+
}
|
|
48
|
+
.pc-image-card_with-content.pc-image-card_direction_direct .pc-image-card__content {
|
|
49
|
+
padding-top: 24px;
|
|
50
|
+
}
|
|
51
|
+
.pc-image-card_with-content.pc-image-card_direction_reverse {
|
|
52
|
+
flex-direction: column-reverse;
|
|
53
|
+
}
|
|
54
|
+
.pc-image-card_with-content.pc-image-card_direction_reverse .pc-image-card__image {
|
|
55
|
+
padding-top: 0;
|
|
56
|
+
}
|
|
57
|
+
.pc-image-card_with-content.pc-image-card_direction_reverse .pc-image-card__content {
|
|
58
|
+
padding-bottom: 24px;
|
|
59
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const components_1 = require("../../components");
|
|
6
|
+
const utils_1 = require("../../components/Media/Image/utils");
|
|
7
|
+
const models_1 = require("../../models");
|
|
8
|
+
const utils_2 = require("../../utils");
|
|
9
|
+
const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
|
|
10
|
+
const b = (0, utils_2.block)('image-card');
|
|
11
|
+
const ImageCard = (props) => {
|
|
12
|
+
const { border = 'shadow', title, text, image, enableImageBorderRadius = false, direction = models_1.ImageCardDirection.Direct, margins, backgroundColor, } = props;
|
|
13
|
+
const hasContent = Boolean(text || title);
|
|
14
|
+
const imageProps = (0, utils_1.getMediaImage)(image);
|
|
15
|
+
return (react_1.default.createElement("div", { className: b({ border, 'with-content': hasContent, direction }), style: { backgroundColor } },
|
|
16
|
+
react_1.default.createElement("div", { className: b('image', { margins }) },
|
|
17
|
+
react_1.default.createElement(components_1.Image, Object.assign({ className: b('image_inner', { radius: enableImageBorderRadius }) }, imageProps))),
|
|
18
|
+
hasContent && (react_1.default.createElement("div", { className: b('content') },
|
|
19
|
+
react_1.default.createElement(Content_1.default, { title: title, text: text, colSizes: { all: 12, md: 12 }, size: "s" })))));
|
|
20
|
+
};
|
|
21
|
+
exports.default = ImageCard;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const ImageCard: {
|
|
2
|
+
'image-card': {
|
|
3
|
+
additionalProperties: boolean;
|
|
4
|
+
required: string[];
|
|
5
|
+
properties: {
|
|
6
|
+
image: {
|
|
7
|
+
oneOf: ({
|
|
8
|
+
type: string;
|
|
9
|
+
properties: {
|
|
10
|
+
when: {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
} | {
|
|
15
|
+
type: string;
|
|
16
|
+
pattern: string;
|
|
17
|
+
optionName: string;
|
|
18
|
+
})[];
|
|
19
|
+
};
|
|
20
|
+
direction: {
|
|
21
|
+
type: string;
|
|
22
|
+
enum: string[];
|
|
23
|
+
};
|
|
24
|
+
margins: {
|
|
25
|
+
type: string;
|
|
26
|
+
enum: string[];
|
|
27
|
+
};
|
|
28
|
+
backgroundColor: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
title: {
|
|
32
|
+
oneOf: ({
|
|
33
|
+
type: string;
|
|
34
|
+
contentType: string;
|
|
35
|
+
optionName: string;
|
|
36
|
+
} | {
|
|
37
|
+
optionName: string;
|
|
38
|
+
type: string;
|
|
39
|
+
additionalProperties: boolean;
|
|
40
|
+
required: string[];
|
|
41
|
+
properties: {
|
|
42
|
+
text: {
|
|
43
|
+
type: string;
|
|
44
|
+
contentType: string;
|
|
45
|
+
};
|
|
46
|
+
textSize: {
|
|
47
|
+
type: string;
|
|
48
|
+
enum: string[];
|
|
49
|
+
};
|
|
50
|
+
url: {
|
|
51
|
+
type: string;
|
|
52
|
+
};
|
|
53
|
+
urlTitle: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
resetMargin: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
contentType?: undefined;
|
|
61
|
+
})[];
|
|
62
|
+
};
|
|
63
|
+
text: {
|
|
64
|
+
type: string;
|
|
65
|
+
contentType: string;
|
|
66
|
+
inputType: string;
|
|
67
|
+
};
|
|
68
|
+
border: {
|
|
69
|
+
type: string;
|
|
70
|
+
enum: string[];
|
|
71
|
+
};
|
|
72
|
+
type: {};
|
|
73
|
+
when: {
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageCard = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pick_1 = tslib_1.__importDefault(require("lodash/pick"));
|
|
6
|
+
const common_1 = require("../../schema/validators/common");
|
|
7
|
+
const components_1 = require("../../schema/validators/components");
|
|
8
|
+
const schema_1 = require("../Content/schema");
|
|
9
|
+
const ImageCardBlockContentProps = (0, pick_1.default)(schema_1.ContentBase, ['title', 'text']);
|
|
10
|
+
exports.ImageCard = {
|
|
11
|
+
'image-card': {
|
|
12
|
+
additionalProperties: false,
|
|
13
|
+
required: ['image'],
|
|
14
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.BaseProps), common_1.CardBase), ImageCardBlockContentProps), { image: components_1.ImageProps, direction: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
enum: ['direct', 'reverse'],
|
|
17
|
+
}, margins: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
enum: ['s', 'm'],
|
|
20
|
+
}, backgroundColor: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
} }),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -9,3 +9,4 @@ export { default as BasicCard } from './BasicCard/BasicCard';
|
|
|
9
9
|
export { default as Content } from './Content/Content';
|
|
10
10
|
export { default as HubspotForm } from './HubspotForm';
|
|
11
11
|
export { default as PriceCard } from './PriceCard/PriceCard';
|
|
12
|
+
export { default as ImageCard } from './ImageCard/ImageCard';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PriceCard = exports.HubspotForm = exports.Content = exports.BasicCard = exports.BackgroundCard = exports.LayoutItem = exports.BannerCard = exports.MediaCard = exports.PriceDetailed = exports.Quote = exports.Divider = void 0;
|
|
6
|
+
exports.ImageCard = exports.PriceCard = exports.HubspotForm = exports.Content = exports.BasicCard = exports.BackgroundCard = exports.LayoutItem = exports.BannerCard = exports.MediaCard = exports.PriceDetailed = exports.Quote = exports.Divider = void 0;
|
|
7
7
|
var Divider_1 = require("./Divider/Divider");
|
|
8
8
|
Object.defineProperty(exports, "Divider", { enumerable: true, get: function () { return __importDefault(Divider_1).default; } });
|
|
9
9
|
var Quote_1 = require("./Quote/Quote");
|
|
@@ -26,3 +26,5 @@ var HubspotForm_1 = require("./HubspotForm");
|
|
|
26
26
|
Object.defineProperty(exports, "HubspotForm", { enumerable: true, get: function () { return __importDefault(HubspotForm_1).default; } });
|
|
27
27
|
var PriceCard_1 = require("./PriceCard/PriceCard");
|
|
28
28
|
Object.defineProperty(exports, "PriceCard", { enumerable: true, get: function () { return __importDefault(PriceCard_1).default; } });
|
|
29
|
+
var ImageCard_1 = require("./ImageCard/ImageCard");
|
|
30
|
+
Object.defineProperty(exports, "ImageCard", { enumerable: true, get: function () { return __importDefault(ImageCard_1).default; } });
|
|
@@ -23,6 +23,10 @@ export declare const BannerCardProps: {
|
|
|
23
23
|
optionName: string;
|
|
24
24
|
})[];
|
|
25
25
|
};
|
|
26
|
+
mediaView: {
|
|
27
|
+
type: string;
|
|
28
|
+
enum: string[];
|
|
29
|
+
};
|
|
26
30
|
disableCompress: {
|
|
27
31
|
type: string;
|
|
28
32
|
};
|
|
@@ -326,6 +330,10 @@ export declare const BannerBlock: {
|
|
|
326
330
|
optionName: string;
|
|
327
331
|
})[];
|
|
328
332
|
};
|
|
333
|
+
mediaView: {
|
|
334
|
+
type: string;
|
|
335
|
+
enum: string[];
|
|
336
|
+
};
|
|
329
337
|
disableCompress: {
|
|
330
338
|
type: string;
|
|
331
339
|
};
|
|
@@ -630,6 +638,10 @@ export declare const BannerCard: {
|
|
|
630
638
|
optionName: string;
|
|
631
639
|
})[];
|
|
632
640
|
};
|
|
641
|
+
mediaView: {
|
|
642
|
+
type: string;
|
|
643
|
+
enum: string[];
|
|
644
|
+
};
|
|
633
645
|
disableCompress: {
|
|
634
646
|
type: string;
|
|
635
647
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimatableProps, BaseProps, ButtonBlock, ThemeProps, withTheme, } from '../../schema/validators/common';
|
|
1
|
+
import { AnimatableProps, BaseProps, ButtonBlock, ThemeProps, mediaView, withTheme, } from '../../schema/validators/common';
|
|
2
2
|
export const BannerCardProps = {
|
|
3
3
|
additionalProperties: false,
|
|
4
4
|
required: ['title', 'button'],
|
|
@@ -10,7 +10,10 @@ export const BannerCardProps = {
|
|
|
10
10
|
contentType: 'yfm',
|
|
11
11
|
}, image: withTheme({
|
|
12
12
|
type: 'string',
|
|
13
|
-
}),
|
|
13
|
+
}), mediaView: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
enum: mediaView,
|
|
16
|
+
}, disableCompress: {
|
|
14
17
|
type: 'boolean',
|
|
15
18
|
}, color: withTheme({
|
|
16
19
|
type: 'string',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageProps } from '../../components/Image/schema';
|
|
2
|
-
import { BlockBaseProps, ButtonBlock, MediaProps, VideoProps, withTheme, } from '../../schema/validators/common';
|
|
2
|
+
import { BlockBaseProps, ButtonBlock, MediaProps, VideoProps, mediaView, withTheme, } from '../../schema/validators/common';
|
|
3
3
|
import { filteredArray } from '../../schema/validators/utils';
|
|
4
4
|
export const HeaderBackgroundProps = {
|
|
5
5
|
type: 'object',
|
|
@@ -34,7 +34,7 @@ export const HeaderProperties = {
|
|
|
34
34
|
video: withTheme(VideoProps),
|
|
35
35
|
mediaView: {
|
|
36
36
|
type: 'string',
|
|
37
|
-
enum:
|
|
37
|
+
enum: mediaView,
|
|
38
38
|
},
|
|
39
39
|
backLink: {
|
|
40
40
|
type: 'object',
|