@gravity-ui/page-constructor 5.24.0 → 5.26.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/Header/schema.d.ts +21 -3
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +8 -1
- package/build/cjs/blocks/Media/schema.d.ts +10 -2
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +5 -1
- package/build/cjs/blocks/Tabs/schema.d.ts +5 -1
- package/build/cjs/components/Media/Video/Video.js +2 -2
- package/build/cjs/components/ReactPlayer/ReactPlayer.css +7 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.d.ts +1 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +15 -4
- package/build/cjs/models/constructor-items/common.d.ts +2 -1
- package/build/cjs/schema/constants.d.ts +5 -1
- package/build/cjs/schema/validators/common.d.ts +11 -1
- package/build/cjs/schema/validators/common.js +5 -1
- package/build/cjs/sub-blocks/ImageCard/ImageCard.js +1 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +5 -1
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +5 -1
- package/build/esm/blocks/Header/schema.d.ts +21 -3
- package/build/esm/blocks/HeaderSlider/schema.d.ts +8 -1
- package/build/esm/blocks/Media/schema.d.ts +10 -2
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +5 -1
- package/build/esm/blocks/Tabs/schema.d.ts +5 -1
- package/build/esm/components/Media/Video/Video.js +2 -2
- package/build/esm/components/ReactPlayer/ReactPlayer.css +7 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.d.ts +1 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.js +15 -4
- package/build/esm/models/constructor-items/common.d.ts +2 -1
- package/build/esm/schema/constants.d.ts +5 -1
- package/build/esm/schema/validators/common.d.ts +11 -1
- package/build/esm/schema/validators/common.js +5 -1
- package/build/esm/sub-blocks/ImageCard/ImageCard.js +1 -1
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +5 -1
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +5 -1
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +2 -1
- package/styles/variables.scss +1 -0
- package/widget/index.js +1 -1
|
@@ -162,6 +162,9 @@ export declare const HeaderBackgroundProps: {
|
|
|
162
162
|
ariaLabel: {
|
|
163
163
|
type: string;
|
|
164
164
|
};
|
|
165
|
+
contain: {
|
|
166
|
+
type: string;
|
|
167
|
+
};
|
|
165
168
|
};
|
|
166
169
|
};
|
|
167
170
|
youtube: {
|
|
@@ -281,7 +284,8 @@ export declare const HeaderBackgroundProps: {
|
|
|
281
284
|
})[];
|
|
282
285
|
};
|
|
283
286
|
ratio: {
|
|
284
|
-
type: string;
|
|
287
|
+
type: string[];
|
|
288
|
+
pattern: string;
|
|
285
289
|
};
|
|
286
290
|
iframe: {
|
|
287
291
|
type: string;
|
|
@@ -466,6 +470,9 @@ export declare const HeaderProperties: {
|
|
|
466
470
|
ariaLabel: {
|
|
467
471
|
type: string;
|
|
468
472
|
};
|
|
473
|
+
contain: {
|
|
474
|
+
type: string;
|
|
475
|
+
};
|
|
469
476
|
};
|
|
470
477
|
} & {
|
|
471
478
|
optionName: string;
|
|
@@ -667,6 +674,9 @@ export declare const HeaderProperties: {
|
|
|
667
674
|
ariaLabel: {
|
|
668
675
|
type: string;
|
|
669
676
|
};
|
|
677
|
+
contain: {
|
|
678
|
+
type: string;
|
|
679
|
+
};
|
|
670
680
|
};
|
|
671
681
|
};
|
|
672
682
|
youtube: {
|
|
@@ -786,7 +796,8 @@ export declare const HeaderProperties: {
|
|
|
786
796
|
})[];
|
|
787
797
|
};
|
|
788
798
|
ratio: {
|
|
789
|
-
type: string;
|
|
799
|
+
type: string[];
|
|
800
|
+
pattern: string;
|
|
790
801
|
};
|
|
791
802
|
iframe: {
|
|
792
803
|
type: string;
|
|
@@ -1020,6 +1031,9 @@ export declare const HeaderBlock: {
|
|
|
1020
1031
|
ariaLabel: {
|
|
1021
1032
|
type: string;
|
|
1022
1033
|
};
|
|
1034
|
+
contain: {
|
|
1035
|
+
type: string;
|
|
1036
|
+
};
|
|
1023
1037
|
};
|
|
1024
1038
|
} & {
|
|
1025
1039
|
optionName: string;
|
|
@@ -1221,6 +1235,9 @@ export declare const HeaderBlock: {
|
|
|
1221
1235
|
ariaLabel: {
|
|
1222
1236
|
type: string;
|
|
1223
1237
|
};
|
|
1238
|
+
contain: {
|
|
1239
|
+
type: string;
|
|
1240
|
+
};
|
|
1224
1241
|
};
|
|
1225
1242
|
};
|
|
1226
1243
|
youtube: {
|
|
@@ -1340,7 +1357,8 @@ export declare const HeaderBlock: {
|
|
|
1340
1357
|
})[];
|
|
1341
1358
|
};
|
|
1342
1359
|
ratio: {
|
|
1343
|
-
type: string;
|
|
1360
|
+
type: string[];
|
|
1361
|
+
pattern: string;
|
|
1344
1362
|
};
|
|
1345
1363
|
iframe: {
|
|
1346
1364
|
type: string;
|
|
@@ -165,6 +165,9 @@ export declare const HeaderSliderBlock: {
|
|
|
165
165
|
ariaLabel: {
|
|
166
166
|
type: string;
|
|
167
167
|
};
|
|
168
|
+
contain: {
|
|
169
|
+
type: string;
|
|
170
|
+
};
|
|
168
171
|
};
|
|
169
172
|
} & {
|
|
170
173
|
optionName: string;
|
|
@@ -366,6 +369,9 @@ export declare const HeaderSliderBlock: {
|
|
|
366
369
|
ariaLabel: {
|
|
367
370
|
type: string;
|
|
368
371
|
};
|
|
372
|
+
contain: {
|
|
373
|
+
type: string;
|
|
374
|
+
};
|
|
369
375
|
};
|
|
370
376
|
};
|
|
371
377
|
youtube: {
|
|
@@ -485,7 +491,8 @@ export declare const HeaderSliderBlock: {
|
|
|
485
491
|
})[];
|
|
486
492
|
};
|
|
487
493
|
ratio: {
|
|
488
|
-
type: string;
|
|
494
|
+
type: string[];
|
|
495
|
+
pattern: string;
|
|
489
496
|
};
|
|
490
497
|
iframe: {
|
|
491
498
|
type: string;
|
|
@@ -156,6 +156,9 @@ export declare const Media: {
|
|
|
156
156
|
ariaLabel: {
|
|
157
157
|
type: string;
|
|
158
158
|
};
|
|
159
|
+
contain: {
|
|
160
|
+
type: string;
|
|
161
|
+
};
|
|
159
162
|
};
|
|
160
163
|
};
|
|
161
164
|
youtube: {
|
|
@@ -275,7 +278,8 @@ export declare const Media: {
|
|
|
275
278
|
})[];
|
|
276
279
|
};
|
|
277
280
|
ratio: {
|
|
278
|
-
type: string;
|
|
281
|
+
type: string[];
|
|
282
|
+
pattern: string;
|
|
279
283
|
};
|
|
280
284
|
iframe: {
|
|
281
285
|
type: string;
|
|
@@ -782,6 +786,9 @@ export declare const MediaBlock: {
|
|
|
782
786
|
ariaLabel: {
|
|
783
787
|
type: string;
|
|
784
788
|
};
|
|
789
|
+
contain: {
|
|
790
|
+
type: string;
|
|
791
|
+
};
|
|
785
792
|
};
|
|
786
793
|
};
|
|
787
794
|
youtube: {
|
|
@@ -901,7 +908,8 @@ export declare const MediaBlock: {
|
|
|
901
908
|
})[];
|
|
902
909
|
};
|
|
903
910
|
ratio: {
|
|
904
|
-
type: string;
|
|
911
|
+
type: string[];
|
|
912
|
+
pattern: string;
|
|
905
913
|
};
|
|
906
914
|
iframe: {
|
|
907
915
|
type: string;
|
|
@@ -172,6 +172,9 @@ export declare const PromoFeaturesItem: {
|
|
|
172
172
|
ariaLabel: {
|
|
173
173
|
type: string;
|
|
174
174
|
};
|
|
175
|
+
contain: {
|
|
176
|
+
type: string;
|
|
177
|
+
};
|
|
175
178
|
};
|
|
176
179
|
};
|
|
177
180
|
youtube: {
|
|
@@ -291,7 +294,8 @@ export declare const PromoFeaturesItem: {
|
|
|
291
294
|
})[];
|
|
292
295
|
};
|
|
293
296
|
ratio: {
|
|
294
|
-
type: string;
|
|
297
|
+
type: string[];
|
|
298
|
+
pattern: string;
|
|
295
299
|
};
|
|
296
300
|
iframe: {
|
|
297
301
|
type: string;
|
|
@@ -167,6 +167,9 @@ export declare const tabsItem: {
|
|
|
167
167
|
ariaLabel: {
|
|
168
168
|
type: string;
|
|
169
169
|
};
|
|
170
|
+
contain: {
|
|
171
|
+
type: string;
|
|
172
|
+
};
|
|
170
173
|
};
|
|
171
174
|
};
|
|
172
175
|
youtube: {
|
|
@@ -286,7 +289,8 @@ export declare const tabsItem: {
|
|
|
286
289
|
})[];
|
|
287
290
|
};
|
|
288
291
|
ratio: {
|
|
289
|
-
type: string;
|
|
292
|
+
type: string[];
|
|
293
|
+
pattern: string;
|
|
290
294
|
};
|
|
291
295
|
iframe: {
|
|
292
296
|
type: string;
|
|
@@ -31,8 +31,8 @@ const Video = (props) => {
|
|
|
31
31
|
}
|
|
32
32
|
}, [playVideo, video, setHasVideoFallback]);
|
|
33
33
|
const reactPlayerBlock = (0, react_1.useMemo)(() => {
|
|
34
|
-
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton, ariaLabel, customControlsOptions, } = video;
|
|
35
|
-
return (react_1.default.createElement(ReactPlayer_1.default, { ref: ref, className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio }));
|
|
34
|
+
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton, ariaLabel, customControlsOptions, contain, } = video;
|
|
35
|
+
return (react_1.default.createElement(ReactPlayer_1.default, { ref: ref, className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio === 'auto' ? undefined : ratio, autoRatio: ratio === 'auto', contain: contain }));
|
|
36
36
|
}, [
|
|
37
37
|
video,
|
|
38
38
|
height,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
+
.pc-ReactPlayer video {
|
|
4
|
+
background-color: var(--pc-color-video-player-bg, #000);
|
|
5
|
+
object-fit: cover;
|
|
6
|
+
}
|
|
3
7
|
.pc-ReactPlayer__wrapper {
|
|
4
8
|
position: relative;
|
|
5
9
|
padding-top: 56.25%;
|
|
@@ -63,6 +67,9 @@ unpredictable css rules order in build */
|
|
|
63
67
|
opacity: 0;
|
|
64
68
|
transition: opacity 300ms;
|
|
65
69
|
}
|
|
70
|
+
.pc-ReactPlayer_contain video {
|
|
71
|
+
object-fit: contain;
|
|
72
|
+
}
|
|
66
73
|
@media only screen and (max-width: 577px) {
|
|
67
74
|
.pc-ReactPlayer__button_text {
|
|
68
75
|
font-size: 20px;
|
|
@@ -9,6 +9,7 @@ export interface ReactPlayerBlockProps extends Omit<MediaVideoProps, 'loop' | 's
|
|
|
9
9
|
onClickPreview?: () => void;
|
|
10
10
|
height?: number;
|
|
11
11
|
ratio?: number;
|
|
12
|
+
autoRatio?: boolean;
|
|
12
13
|
children?: React.ReactNode;
|
|
13
14
|
}
|
|
14
15
|
export declare const ReactPlayerBlock: React.ForwardRefExoticComponent<ReactPlayerBlockProps & React.RefAttributes<ReactPlayerBlockHandler>>;
|
|
@@ -24,7 +24,7 @@ const FPS = 60;
|
|
|
24
24
|
// eslint-disable-next-line react/display-name
|
|
25
25
|
exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
26
26
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
27
|
-
const { src, previewImgUrl, loop = false, controls = models_1.MediaVideoControlsType.Default, customControlsOptions = {}, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, analyticsEvents, height, ariaLabel, ratio, } = props;
|
|
27
|
+
const { src, previewImgUrl, loop = false, controls = models_1.MediaVideoControlsType.Default, customControlsOptions = {}, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, analyticsEvents, height, ariaLabel, ratio, autoRatio, contain, } = props;
|
|
28
28
|
const { type = models_1.PlayButtonType.Default, theme = models_1.PlayButtonThemes.Blue, text, className: buttonClassName, } = playButton || {};
|
|
29
29
|
const { type: customControlsType = models_1.CustomControlsType.WithMuteButton, muteButtonShown, positioning = models_1.CustomControlsButtonPositioning.Center, } = customControlsOptions;
|
|
30
30
|
const autoPlay = Boolean(!isMobile && !previewImgUrl && props.autoplay);
|
|
@@ -36,6 +36,7 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
36
36
|
const [playedPercent, setPlayedPercent] = (0, react_1.useState)(0);
|
|
37
37
|
const [currentHeight, setCurrentHeight] = (0, react_1.useState)(height);
|
|
38
38
|
const [width, setWidth] = (0, react_1.useState)(0);
|
|
39
|
+
const [actualRatio, setActualRatio] = (0, react_1.useState)();
|
|
39
40
|
const [muted, setMuted] = (0, react_1.useState)(mute);
|
|
40
41
|
const [started, setStarted] = (0, react_1.useState)(autoPlay);
|
|
41
42
|
const [ended, setEnded] = (0, react_1.useState)(false);
|
|
@@ -106,7 +107,7 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
106
107
|
parseFloat(paddingLeft) -
|
|
107
108
|
parseFloat(paddingRight);
|
|
108
109
|
setWidth(newWidth);
|
|
109
|
-
setCurrentHeight(Math.floor(getHeight(newWidth, ratio)));
|
|
110
|
+
setCurrentHeight(Math.floor(getHeight(newWidth, ratio !== null && ratio !== void 0 ? ratio : (autoRatio ? actualRatio : undefined))));
|
|
110
111
|
}
|
|
111
112
|
}, 200);
|
|
112
113
|
updateSize();
|
|
@@ -114,7 +115,7 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
114
115
|
return () => {
|
|
115
116
|
window.removeEventListener('resize', updateSize);
|
|
116
117
|
};
|
|
117
|
-
}, [ratio]);
|
|
118
|
+
}, [actualRatio, autoRatio, ratio]);
|
|
118
119
|
const playEvents = (0, react_1.useMemo)(() => eventsArray === null || eventsArray === void 0 ? void 0 : eventsArray.filter((e) => e.type === models_1.PredefinedEventTypes.Play), [eventsArray]);
|
|
119
120
|
const stopEvents = (0, react_1.useMemo)(() => eventsArray === null || eventsArray === void 0 ? void 0 : eventsArray.filter((e) => e.type === models_1.PredefinedEventTypes.Stop), [eventsArray]);
|
|
120
121
|
const playIcon = (0, react_1.useMemo)(() => {
|
|
@@ -184,6 +185,15 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
184
185
|
setEnded(false);
|
|
185
186
|
}
|
|
186
187
|
}, [changeMute, controls, customControlsType, ended, isPlaying, muted]);
|
|
188
|
+
const onReady = (0, react_1.useCallback)((player) => {
|
|
189
|
+
setPlayerRef(player);
|
|
190
|
+
const videoElement = player.getInternalPlayer();
|
|
191
|
+
const videoWidth = videoElement.videoWidth;
|
|
192
|
+
const videoHeight = videoElement.videoHeight;
|
|
193
|
+
if (videoWidth && videoHeight) {
|
|
194
|
+
setActualRatio(videoHeight / videoWidth);
|
|
195
|
+
}
|
|
196
|
+
}, []);
|
|
187
197
|
const onProgress = (0, react_1.useCallback)((progress) => {
|
|
188
198
|
setPlayedPercent(progress.played);
|
|
189
199
|
if (progress.played === 1) {
|
|
@@ -224,8 +234,9 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
224
234
|
return (react_1.default.createElement("div", { className: b({
|
|
225
235
|
wrapper: !currentHeight,
|
|
226
236
|
controls,
|
|
237
|
+
contain,
|
|
227
238
|
}, className), ref: ref, onClick: handleClick, onMouseEnter: onFocusIn, onMouseLeave: onFocusOut, onFocus: onFocusIn, onBlur: onFocusOut }, isMounted ? (react_1.default.createElement(react_1.Fragment, null,
|
|
228
|
-
react_1.default.createElement(react_player_1.default, { className: b('player'), url: videoSrc, muted: muted, controls: controls === models_1.MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady:
|
|
239
|
+
react_1.default.createElement(react_player_1.default, { className: b('player'), url: videoSrc, muted: muted, controls: controls === models_1.MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady: onReady, onPlay: onPlay, onPause: autoPlay && customControlsType !== models_1.CustomControlsType.WithMuteButton
|
|
229
240
|
? undefined
|
|
230
241
|
: onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel, previewTabIndex: -1, config: {
|
|
231
242
|
file: {
|
|
@@ -127,6 +127,7 @@ export interface MediaVideoProps extends AnalyticsEventsBase {
|
|
|
127
127
|
controls?: MediaVideoControlsType;
|
|
128
128
|
customControlsOptions?: CustomControlsOptions;
|
|
129
129
|
ariaLabel?: string;
|
|
130
|
+
contain?: boolean;
|
|
130
131
|
}
|
|
131
132
|
export interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {
|
|
132
133
|
url: string;
|
|
@@ -179,7 +180,7 @@ export type ThemedMediaVideoProps = ThemeSupporting<MediaVideoProps>;
|
|
|
179
180
|
export interface MediaComponentVideoProps extends AnalyticsEventsBase {
|
|
180
181
|
video: MediaVideoProps;
|
|
181
182
|
height?: number;
|
|
182
|
-
ratio?: number;
|
|
183
|
+
ratio?: number | 'auto';
|
|
183
184
|
previewImg?: string;
|
|
184
185
|
}
|
|
185
186
|
export interface MediaComponentVideoIframeProps {
|
|
@@ -1549,6 +1549,9 @@ export declare const cardSchemas: {
|
|
|
1549
1549
|
ariaLabel: {
|
|
1550
1550
|
type: string;
|
|
1551
1551
|
};
|
|
1552
|
+
contain: {
|
|
1553
|
+
type: string;
|
|
1554
|
+
};
|
|
1552
1555
|
};
|
|
1553
1556
|
};
|
|
1554
1557
|
youtube: {
|
|
@@ -1590,7 +1593,8 @@ export declare const cardSchemas: {
|
|
|
1590
1593
|
type: string;
|
|
1591
1594
|
};
|
|
1592
1595
|
ratio: {
|
|
1593
|
-
type: string;
|
|
1596
|
+
type: string[];
|
|
1597
|
+
pattern: string;
|
|
1594
1598
|
};
|
|
1595
1599
|
iframe: {
|
|
1596
1600
|
type: string;
|
|
@@ -203,6 +203,9 @@ export declare const VideoProps: {
|
|
|
203
203
|
ariaLabel: {
|
|
204
204
|
type: string;
|
|
205
205
|
};
|
|
206
|
+
contain: {
|
|
207
|
+
type: string;
|
|
208
|
+
};
|
|
206
209
|
};
|
|
207
210
|
};
|
|
208
211
|
export declare const ThemeProps: {
|
|
@@ -365,6 +368,9 @@ export declare const BackgroundProps: {
|
|
|
365
368
|
ariaLabel: {
|
|
366
369
|
type: string;
|
|
367
370
|
};
|
|
371
|
+
contain: {
|
|
372
|
+
type: string;
|
|
373
|
+
};
|
|
368
374
|
};
|
|
369
375
|
};
|
|
370
376
|
height: {
|
|
@@ -1129,6 +1135,9 @@ export declare const MediaProps: {
|
|
|
1129
1135
|
ariaLabel: {
|
|
1130
1136
|
type: string;
|
|
1131
1137
|
};
|
|
1138
|
+
contain: {
|
|
1139
|
+
type: string;
|
|
1140
|
+
};
|
|
1132
1141
|
};
|
|
1133
1142
|
};
|
|
1134
1143
|
youtube: {
|
|
@@ -1248,7 +1257,8 @@ export declare const MediaProps: {
|
|
|
1248
1257
|
})[];
|
|
1249
1258
|
};
|
|
1250
1259
|
ratio: {
|
|
1251
|
-
type: string;
|
|
1260
|
+
type: string[];
|
|
1261
|
+
pattern: string;
|
|
1252
1262
|
};
|
|
1253
1263
|
iframe: {
|
|
1254
1264
|
type: string;
|
|
@@ -164,6 +164,9 @@ exports.VideoProps = {
|
|
|
164
164
|
ariaLabel: {
|
|
165
165
|
type: 'string',
|
|
166
166
|
},
|
|
167
|
+
contain: {
|
|
168
|
+
type: 'boolean',
|
|
169
|
+
},
|
|
167
170
|
},
|
|
168
171
|
};
|
|
169
172
|
exports.ThemeProps = {
|
|
@@ -547,7 +550,8 @@ exports.MediaProps = {
|
|
|
547
550
|
anyOf: [event_1.AnalyticsEventSchema, { type: 'array', items: event_1.AnalyticsEventSchema }],
|
|
548
551
|
},
|
|
549
552
|
ratio: {
|
|
550
|
-
type: 'number',
|
|
553
|
+
type: ['number', 'string'],
|
|
554
|
+
pattern: '^auto$',
|
|
551
555
|
},
|
|
552
556
|
iframe: Object.assign({}, IframeProps),
|
|
553
557
|
margins: {
|
|
@@ -24,7 +24,7 @@ const ImageCard = (props) => {
|
|
|
24
24
|
react_1.default.createElement(components_1.Image, Object.assign({ className: b('image_inner', { radius: enableImageBorderRadius }) }, imageProps))),
|
|
25
25
|
hasContent && (react_1.default.createElement("div", { className: b('content') },
|
|
26
26
|
react_1.default.createElement(Content_1.default, { titleId: titleId, title: title, text: text, links: links, buttons: buttons, list: list, theme: cardTheme, additionalInfo: additionalInfo, size: size, colSizes: CONTENT_COL_SIZES, controlPosition: areControlsInFooter ? 'bottom' : 'default' })))));
|
|
27
|
-
return url ? (react_1.default.createElement(uikit_1.Link, { href: url, target: target, rel: target === '_blank' ? 'noopener noreferrer' : undefined, className: b({ border, 'with-content': hasContent, direction }), title: urlTitle, extraProps: {
|
|
27
|
+
return url ? (react_1.default.createElement(uikit_1.Link, { href: url, target: target, rel: target === '_blank' ? 'noopener noreferrer' : undefined, className: b({ border, 'with-content': hasContent, direction }), title: urlTitle, style: { backgroundColor }, extraProps: {
|
|
28
28
|
draggable: false,
|
|
29
29
|
onDragStart: (e) => e.preventDefault(),
|
|
30
30
|
} }, cardContent)) : (react_1.default.createElement("div", { className: b({ border, 'with-content': hasContent, direction }), style: { backgroundColor } }, cardContent));
|
|
@@ -157,6 +157,9 @@ export declare const LayoutItem: {
|
|
|
157
157
|
ariaLabel: {
|
|
158
158
|
type: string;
|
|
159
159
|
};
|
|
160
|
+
contain: {
|
|
161
|
+
type: string;
|
|
162
|
+
};
|
|
160
163
|
};
|
|
161
164
|
};
|
|
162
165
|
youtube: {
|
|
@@ -276,7 +279,8 @@ export declare const LayoutItem: {
|
|
|
276
279
|
})[];
|
|
277
280
|
};
|
|
278
281
|
ratio: {
|
|
279
|
-
type: string;
|
|
282
|
+
type: string[];
|
|
283
|
+
pattern: string;
|
|
280
284
|
};
|
|
281
285
|
iframe: {
|
|
282
286
|
type: string;
|
|
@@ -240,6 +240,9 @@ export declare const MediaCardBlock: {
|
|
|
240
240
|
ariaLabel: {
|
|
241
241
|
type: string;
|
|
242
242
|
};
|
|
243
|
+
contain: {
|
|
244
|
+
type: string;
|
|
245
|
+
};
|
|
243
246
|
};
|
|
244
247
|
};
|
|
245
248
|
youtube: {
|
|
@@ -281,7 +284,8 @@ export declare const MediaCardBlock: {
|
|
|
281
284
|
type: string;
|
|
282
285
|
};
|
|
283
286
|
ratio: {
|
|
284
|
-
type: string;
|
|
287
|
+
type: string[];
|
|
288
|
+
pattern: string;
|
|
285
289
|
};
|
|
286
290
|
iframe: {
|
|
287
291
|
type: string;
|
|
@@ -162,6 +162,9 @@ export declare const HeaderBackgroundProps: {
|
|
|
162
162
|
ariaLabel: {
|
|
163
163
|
type: string;
|
|
164
164
|
};
|
|
165
|
+
contain: {
|
|
166
|
+
type: string;
|
|
167
|
+
};
|
|
165
168
|
};
|
|
166
169
|
};
|
|
167
170
|
youtube: {
|
|
@@ -281,7 +284,8 @@ export declare const HeaderBackgroundProps: {
|
|
|
281
284
|
})[];
|
|
282
285
|
};
|
|
283
286
|
ratio: {
|
|
284
|
-
type: string;
|
|
287
|
+
type: string[];
|
|
288
|
+
pattern: string;
|
|
285
289
|
};
|
|
286
290
|
iframe: {
|
|
287
291
|
type: string;
|
|
@@ -466,6 +470,9 @@ export declare const HeaderProperties: {
|
|
|
466
470
|
ariaLabel: {
|
|
467
471
|
type: string;
|
|
468
472
|
};
|
|
473
|
+
contain: {
|
|
474
|
+
type: string;
|
|
475
|
+
};
|
|
469
476
|
};
|
|
470
477
|
} & {
|
|
471
478
|
optionName: string;
|
|
@@ -667,6 +674,9 @@ export declare const HeaderProperties: {
|
|
|
667
674
|
ariaLabel: {
|
|
668
675
|
type: string;
|
|
669
676
|
};
|
|
677
|
+
contain: {
|
|
678
|
+
type: string;
|
|
679
|
+
};
|
|
670
680
|
};
|
|
671
681
|
};
|
|
672
682
|
youtube: {
|
|
@@ -786,7 +796,8 @@ export declare const HeaderProperties: {
|
|
|
786
796
|
})[];
|
|
787
797
|
};
|
|
788
798
|
ratio: {
|
|
789
|
-
type: string;
|
|
799
|
+
type: string[];
|
|
800
|
+
pattern: string;
|
|
790
801
|
};
|
|
791
802
|
iframe: {
|
|
792
803
|
type: string;
|
|
@@ -1020,6 +1031,9 @@ export declare const HeaderBlock: {
|
|
|
1020
1031
|
ariaLabel: {
|
|
1021
1032
|
type: string;
|
|
1022
1033
|
};
|
|
1034
|
+
contain: {
|
|
1035
|
+
type: string;
|
|
1036
|
+
};
|
|
1023
1037
|
};
|
|
1024
1038
|
} & {
|
|
1025
1039
|
optionName: string;
|
|
@@ -1221,6 +1235,9 @@ export declare const HeaderBlock: {
|
|
|
1221
1235
|
ariaLabel: {
|
|
1222
1236
|
type: string;
|
|
1223
1237
|
};
|
|
1238
|
+
contain: {
|
|
1239
|
+
type: string;
|
|
1240
|
+
};
|
|
1224
1241
|
};
|
|
1225
1242
|
};
|
|
1226
1243
|
youtube: {
|
|
@@ -1340,7 +1357,8 @@ export declare const HeaderBlock: {
|
|
|
1340
1357
|
})[];
|
|
1341
1358
|
};
|
|
1342
1359
|
ratio: {
|
|
1343
|
-
type: string;
|
|
1360
|
+
type: string[];
|
|
1361
|
+
pattern: string;
|
|
1344
1362
|
};
|
|
1345
1363
|
iframe: {
|
|
1346
1364
|
type: string;
|
|
@@ -165,6 +165,9 @@ export declare const HeaderSliderBlock: {
|
|
|
165
165
|
ariaLabel: {
|
|
166
166
|
type: string;
|
|
167
167
|
};
|
|
168
|
+
contain: {
|
|
169
|
+
type: string;
|
|
170
|
+
};
|
|
168
171
|
};
|
|
169
172
|
} & {
|
|
170
173
|
optionName: string;
|
|
@@ -366,6 +369,9 @@ export declare const HeaderSliderBlock: {
|
|
|
366
369
|
ariaLabel: {
|
|
367
370
|
type: string;
|
|
368
371
|
};
|
|
372
|
+
contain: {
|
|
373
|
+
type: string;
|
|
374
|
+
};
|
|
369
375
|
};
|
|
370
376
|
};
|
|
371
377
|
youtube: {
|
|
@@ -485,7 +491,8 @@ export declare const HeaderSliderBlock: {
|
|
|
485
491
|
})[];
|
|
486
492
|
};
|
|
487
493
|
ratio: {
|
|
488
|
-
type: string;
|
|
494
|
+
type: string[];
|
|
495
|
+
pattern: string;
|
|
489
496
|
};
|
|
490
497
|
iframe: {
|
|
491
498
|
type: string;
|
|
@@ -156,6 +156,9 @@ export declare const Media: {
|
|
|
156
156
|
ariaLabel: {
|
|
157
157
|
type: string;
|
|
158
158
|
};
|
|
159
|
+
contain: {
|
|
160
|
+
type: string;
|
|
161
|
+
};
|
|
159
162
|
};
|
|
160
163
|
};
|
|
161
164
|
youtube: {
|
|
@@ -275,7 +278,8 @@ export declare const Media: {
|
|
|
275
278
|
})[];
|
|
276
279
|
};
|
|
277
280
|
ratio: {
|
|
278
|
-
type: string;
|
|
281
|
+
type: string[];
|
|
282
|
+
pattern: string;
|
|
279
283
|
};
|
|
280
284
|
iframe: {
|
|
281
285
|
type: string;
|
|
@@ -782,6 +786,9 @@ export declare const MediaBlock: {
|
|
|
782
786
|
ariaLabel: {
|
|
783
787
|
type: string;
|
|
784
788
|
};
|
|
789
|
+
contain: {
|
|
790
|
+
type: string;
|
|
791
|
+
};
|
|
785
792
|
};
|
|
786
793
|
};
|
|
787
794
|
youtube: {
|
|
@@ -901,7 +908,8 @@ export declare const MediaBlock: {
|
|
|
901
908
|
})[];
|
|
902
909
|
};
|
|
903
910
|
ratio: {
|
|
904
|
-
type: string;
|
|
911
|
+
type: string[];
|
|
912
|
+
pattern: string;
|
|
905
913
|
};
|
|
906
914
|
iframe: {
|
|
907
915
|
type: string;
|
|
@@ -172,6 +172,9 @@ export declare const PromoFeaturesItem: {
|
|
|
172
172
|
ariaLabel: {
|
|
173
173
|
type: string;
|
|
174
174
|
};
|
|
175
|
+
contain: {
|
|
176
|
+
type: string;
|
|
177
|
+
};
|
|
175
178
|
};
|
|
176
179
|
};
|
|
177
180
|
youtube: {
|
|
@@ -291,7 +294,8 @@ export declare const PromoFeaturesItem: {
|
|
|
291
294
|
})[];
|
|
292
295
|
};
|
|
293
296
|
ratio: {
|
|
294
|
-
type: string;
|
|
297
|
+
type: string[];
|
|
298
|
+
pattern: string;
|
|
295
299
|
};
|
|
296
300
|
iframe: {
|
|
297
301
|
type: string;
|
|
@@ -167,6 +167,9 @@ export declare const tabsItem: {
|
|
|
167
167
|
ariaLabel: {
|
|
168
168
|
type: string;
|
|
169
169
|
};
|
|
170
|
+
contain: {
|
|
171
|
+
type: string;
|
|
172
|
+
};
|
|
170
173
|
};
|
|
171
174
|
};
|
|
172
175
|
youtube: {
|
|
@@ -286,7 +289,8 @@ export declare const tabsItem: {
|
|
|
286
289
|
})[];
|
|
287
290
|
};
|
|
288
291
|
ratio: {
|
|
289
|
-
type: string;
|
|
292
|
+
type: string[];
|
|
293
|
+
pattern: string;
|
|
290
294
|
};
|
|
291
295
|
iframe: {
|
|
292
296
|
type: string;
|
|
@@ -29,8 +29,8 @@ const Video = (props) => {
|
|
|
29
29
|
}
|
|
30
30
|
}, [playVideo, video, setHasVideoFallback]);
|
|
31
31
|
const reactPlayerBlock = useMemo(() => {
|
|
32
|
-
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton, ariaLabel, customControlsOptions, } = video;
|
|
33
|
-
return (React.createElement(ReactPlayerBlock, { ref: ref, className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio }));
|
|
32
|
+
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton, ariaLabel, customControlsOptions, contain, } = video;
|
|
33
|
+
return (React.createElement(ReactPlayerBlock, { ref: ref, className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio === 'auto' ? undefined : ratio, autoRatio: ratio === 'auto', contain: contain }));
|
|
34
34
|
}, [
|
|
35
35
|
video,
|
|
36
36
|
height,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
+
.pc-ReactPlayer video {
|
|
4
|
+
background-color: var(--pc-color-video-player-bg, #000);
|
|
5
|
+
object-fit: cover;
|
|
6
|
+
}
|
|
3
7
|
.pc-ReactPlayer__wrapper {
|
|
4
8
|
position: relative;
|
|
5
9
|
padding-top: 56.25%;
|
|
@@ -63,6 +67,9 @@ unpredictable css rules order in build */
|
|
|
63
67
|
opacity: 0;
|
|
64
68
|
transition: opacity 300ms;
|
|
65
69
|
}
|
|
70
|
+
.pc-ReactPlayer_contain video {
|
|
71
|
+
object-fit: contain;
|
|
72
|
+
}
|
|
66
73
|
@media only screen and (max-width: 577px) {
|
|
67
74
|
.pc-ReactPlayer__button_text {
|
|
68
75
|
font-size: 20px;
|