@gravity-ui/page-constructor 4.28.0 → 4.28.1
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/Header.css +3 -0
- package/build/cjs/components/Media/Video/Video.js +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.d.ts +2 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +13 -3
- package/build/cjs/models/components.d.ts +1 -2
- package/build/esm/blocks/Header/Header.css +3 -0
- package/build/esm/components/Media/Video/Video.js +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.d.ts +2 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js +13 -3
- package/build/esm/models/components.d.ts +1 -2
- package/package.json +1 -1
- package/server/models/components.d.ts +1 -2
- package/widget/index.js +1 -1
|
@@ -20,6 +20,9 @@ unpredictable css rules order in build */
|
|
|
20
20
|
position: relative;
|
|
21
21
|
height: 100%;
|
|
22
22
|
}
|
|
23
|
+
.pc-header-block__content_theme_dark {
|
|
24
|
+
--g-color-line-focus: var(--pc-color-line-focus-dark);
|
|
25
|
+
}
|
|
23
26
|
.pc-header-block__content_theme_dark .pc-header-block__title,
|
|
24
27
|
.pc-header-block__content_theme_dark .pc-header-block__overtitle {
|
|
25
28
|
color: var(--g-color-text-light-primary);
|
|
@@ -32,7 +32,7 @@ const Video = (props) => {
|
|
|
32
32
|
}, [playVideo, video, setHasVideoFallback]);
|
|
33
33
|
const reactPlayerBlock = (0, react_1.useMemo)(() => {
|
|
34
34
|
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton, ariaLabel, customControlsOptions, } = video;
|
|
35
|
-
return (react_1.default.createElement(ReactPlayer_1.default, { 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, metrika: metrika, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio }));
|
|
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, metrika: metrika, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio }));
|
|
36
36
|
}, [
|
|
37
37
|
video,
|
|
38
38
|
height,
|
|
@@ -11,5 +11,6 @@ export interface ReactPlayerBlockProps extends Omit<MediaVideoProps, 'loop' | 's
|
|
|
11
11
|
ratio?: number;
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
type ReactPlayerBlockRefType = ReactPlayerBlockHandler | undefined;
|
|
15
|
+
export declare const ReactPlayerBlock: React.ForwardRefExoticComponent<ReactPlayerBlockProps & React.RefAttributes<ReactPlayerBlockRefType>>;
|
|
15
16
|
export default ReactPlayerBlock;
|
|
@@ -48,9 +48,19 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
48
48
|
return [];
|
|
49
49
|
}, [analyticsEvents]);
|
|
50
50
|
const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.ReactPlayerControls);
|
|
51
|
-
(0, react_1.useImperativeHandle)(originRef, () =>
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
(0, react_1.useImperativeHandle)(originRef, () => {
|
|
52
|
+
if (!playerRef) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const videoInstance = playerRef.getInternalPlayer();
|
|
56
|
+
const { play, pause, addEventListener } = videoInstance;
|
|
57
|
+
// eslint-disable-next-line consistent-return
|
|
58
|
+
return {
|
|
59
|
+
play: play.bind(videoInstance),
|
|
60
|
+
pause: pause.bind(videoInstance),
|
|
61
|
+
addEventListener: addEventListener.bind(videoInstance),
|
|
62
|
+
};
|
|
63
|
+
}, [playerRef]);
|
|
54
64
|
(0, react_1.useEffect)(() => {
|
|
55
65
|
if (ref.current && !(playingVideoRef === null || playingVideoRef === void 0 ? void 0 : playingVideoRef.contains(ref.current))) {
|
|
56
66
|
setMuted(true);
|
|
@@ -20,6 +20,9 @@ unpredictable css rules order in build */
|
|
|
20
20
|
position: relative;
|
|
21
21
|
height: 100%;
|
|
22
22
|
}
|
|
23
|
+
.pc-header-block__content_theme_dark {
|
|
24
|
+
--g-color-line-focus: var(--pc-color-line-focus-dark);
|
|
25
|
+
}
|
|
23
26
|
.pc-header-block__content_theme_dark .pc-header-block__title,
|
|
24
27
|
.pc-header-block__content_theme_dark .pc-header-block__overtitle {
|
|
25
28
|
color: var(--g-color-text-light-primary);
|
|
@@ -30,7 +30,7 @@ const Video = (props) => {
|
|
|
30
30
|
}, [playVideo, video, setHasVideoFallback]);
|
|
31
31
|
const reactPlayerBlock = useMemo(() => {
|
|
32
32
|
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton, ariaLabel, customControlsOptions, } = video;
|
|
33
|
-
return (React.createElement(ReactPlayerBlock, { 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, metrika: metrika, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio }));
|
|
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, metrika: metrika, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions, ratio: ratio }));
|
|
34
34
|
}, [
|
|
35
35
|
video,
|
|
36
36
|
height,
|
|
@@ -12,5 +12,6 @@ export interface ReactPlayerBlockProps extends Omit<MediaVideoProps, 'loop' | 's
|
|
|
12
12
|
ratio?: number;
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
type ReactPlayerBlockRefType = ReactPlayerBlockHandler | undefined;
|
|
16
|
+
export declare const ReactPlayerBlock: React.ForwardRefExoticComponent<ReactPlayerBlockProps & React.RefAttributes<ReactPlayerBlockRefType>>;
|
|
16
17
|
export default ReactPlayerBlock;
|
|
@@ -45,9 +45,19 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
45
45
|
return [];
|
|
46
46
|
}, [analyticsEvents]);
|
|
47
47
|
const handleAnalytics = useAnalytics(DefaultEventNames.ReactPlayerControls);
|
|
48
|
-
useImperativeHandle(originRef, () =>
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
useImperativeHandle(originRef, () => {
|
|
49
|
+
if (!playerRef) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const videoInstance = playerRef.getInternalPlayer();
|
|
53
|
+
const { play, pause, addEventListener } = videoInstance;
|
|
54
|
+
// eslint-disable-next-line consistent-return
|
|
55
|
+
return {
|
|
56
|
+
play: play.bind(videoInstance),
|
|
57
|
+
pause: pause.bind(videoInstance),
|
|
58
|
+
addEventListener: addEventListener.bind(videoInstance),
|
|
59
|
+
};
|
|
60
|
+
}, [playerRef]);
|
|
51
61
|
useEffect(() => {
|
|
52
62
|
if (ref.current && !(playingVideoRef === null || playingVideoRef === void 0 ? void 0 : playingVideoRef.contains(ref.current))) {
|
|
53
63
|
setMuted(true);
|
package/package.json
CHANGED