@gravity-ui/page-constructor 1.15.0-alpha.21 → 1.15.0-alpha.23
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/CHANGELOG.md +88 -0
- package/README.md +3 -15
- package/build/cjs/blocks/Banner/schema.d.ts +0 -9
- package/build/cjs/blocks/Banner/schema.js +1 -3
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +78 -0
- package/build/cjs/blocks/Header/schema.d.ts +0 -156
- package/build/cjs/blocks/Header/schema.js +0 -4
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -78
- package/build/cjs/blocks/Info/schema.d.ts +0 -3
- package/build/cjs/blocks/Info/schema.js +0 -2
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +1 -2
- package/build/cjs/blocks/Preview/schema.d.ts +0 -3
- package/build/cjs/blocks/Preview/schema.js +1 -3
- package/build/cjs/blocks/Security/schema.d.ts +0 -3
- package/build/cjs/blocks/Security/schema.js +1 -3
- package/build/cjs/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/cjs/blocks/Slider/Slider.css +0 -4
- package/build/cjs/blocks/Tabs/schema.d.ts +78 -0
- package/build/cjs/components/BackLink/BackLink.d.ts +0 -1
- package/build/cjs/components/BackLink/BackLink.js +4 -2
- package/build/cjs/components/Button/Button.js +1 -4
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +0 -1
- package/build/cjs/components/CardBase/CardBase.d.ts +2 -4
- package/build/cjs/components/Foldable/Foldable.css +4 -1
- package/build/cjs/components/Foldable/Foldable.js +7 -10
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +8 -6
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.css +70 -0
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.d.ts +9 -0
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.js +40 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +30 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -2
- package/build/cjs/components/HeightCalculator/HeightCalculator.d.ts +4 -0
- package/build/cjs/components/HeightCalculator/HeightCalculator.js +4 -0
- package/build/cjs/components/Link/Link.js +1 -1
- package/build/cjs/components/Media/Media.js +3 -2
- package/build/cjs/components/MetaInfo/MetaInfo.css +13 -0
- package/build/cjs/components/MetaInfo/MetaInfo.d.ts +6 -0
- package/build/cjs/components/MetaInfo/MetaInfo.js +8 -0
- package/build/cjs/components/MetaInfo/schema.d.ts +8 -0
- package/build/cjs/components/MetaInfo/schema.js +10 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/cjs/components/VideoBlock/VideoBlock.js +6 -10
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -4
- package/build/cjs/components/YandexForm/YandexForm.js +2 -2
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +5 -1
- package/build/cjs/constructor-items.d.ts +4 -0
- package/build/cjs/constructor-items.js +4 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/cjs/hooks/useHeightCalculator.d.ts +6 -0
- package/build/cjs/hooks/useHeightCalculator.js +27 -0
- package/build/cjs/models/common.d.ts +3 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +0 -10
- package/build/cjs/models/constructor-items/common.d.ts +6 -30
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +18 -7
- package/build/cjs/models/constructor-items/sub-blocks.js +4 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +5 -3
- package/build/cjs/schema/index.js +1 -0
- package/build/cjs/schema/validators/common.d.ts +78 -0
- package/build/cjs/schema/validators/common.js +2 -0
- 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/BackgroundCard/schema.d.ts +0 -3
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +0 -2
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +2 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +14 -9
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.js +26 -8
- package/build/cjs/sub-blocks/HubspotForm/index.js +5 -3
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +16 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +3 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +21 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +218 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +18 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +29 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.js +12 -0
- package/build/cjs/sub-blocks/Quote/Quote.js +2 -2
- package/build/cjs/sub-blocks/Quote/schema.d.ts +0 -3
- package/build/cjs/sub-blocks/Quote/schema.js +1 -3
- package/build/cjs/sub-blocks/index.d.ts +1 -0
- package/build/cjs/sub-blocks/index.js +3 -1
- package/build/cjs/text-transform/blocks.js +17 -0
- package/build/cjs/utils/hubspot.d.ts +2 -1
- package/build/cjs/utils/hubspot.js +5 -1
- package/build/esm/blocks/Banner/schema.d.ts +0 -9
- package/build/esm/blocks/Banner/schema.js +1 -3
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +78 -0
- package/build/esm/blocks/Header/schema.d.ts +0 -156
- package/build/esm/blocks/Header/schema.js +0 -4
- package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -78
- package/build/esm/blocks/Info/schema.d.ts +0 -3
- package/build/esm/blocks/Info/schema.js +0 -2
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +1 -2
- package/build/esm/blocks/Preview/schema.d.ts +0 -3
- package/build/esm/blocks/Preview/schema.js +1 -3
- package/build/esm/blocks/Security/schema.d.ts +0 -3
- package/build/esm/blocks/Security/schema.js +1 -3
- package/build/esm/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/esm/blocks/Slider/Slider.css +0 -4
- package/build/esm/blocks/Tabs/schema.d.ts +78 -0
- package/build/esm/components/BackLink/BackLink.d.ts +0 -1
- package/build/esm/components/BackLink/BackLink.js +4 -2
- package/build/esm/components/Button/Button.js +1 -4
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +0 -1
- package/build/esm/components/CardBase/CardBase.d.ts +2 -4
- package/build/esm/components/Foldable/Foldable.css +4 -1
- package/build/esm/components/Foldable/Foldable.js +8 -11
- package/build/esm/components/FullscreenImage/FullscreenImage.js +9 -7
- package/build/esm/components/FullscreenMedia/FullScreenMedia.css +70 -0
- package/build/esm/components/FullscreenMedia/FullScreenMedia.d.ts +10 -0
- package/build/esm/components/FullscreenMedia/FullScreenMedia.js +38 -0
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +30 -0
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -2
- package/build/esm/components/HeightCalculator/HeightCalculator.d.ts +4 -0
- package/build/esm/components/HeightCalculator/HeightCalculator.js +4 -0
- package/build/esm/components/Link/Link.js +1 -1
- package/build/esm/components/Media/Media.js +3 -2
- package/build/esm/components/MetaInfo/MetaInfo.css +13 -0
- package/build/esm/components/MetaInfo/MetaInfo.d.ts +7 -0
- package/build/esm/components/MetaInfo/MetaInfo.js +6 -0
- package/build/esm/components/MetaInfo/schema.d.ts +8 -0
- package/build/esm/components/MetaInfo/schema.js +8 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.js +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/esm/components/VideoBlock/VideoBlock.js +6 -10
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -4
- package/build/esm/components/YandexForm/YandexForm.js +2 -2
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +2 -0
- package/build/esm/constructor-items.d.ts +4 -0
- package/build/esm/constructor-items.js +5 -1
- package/build/esm/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/esm/hooks/useHeightCalculator.d.ts +6 -0
- package/build/esm/hooks/useHeightCalculator.js +24 -0
- package/build/esm/models/common.d.ts +3 -0
- package/build/esm/models/constructor-items/blocks.d.ts +0 -10
- package/build/esm/models/constructor-items/common.d.ts +6 -30
- package/build/esm/models/constructor-items/sub-blocks.d.ts +18 -7
- package/build/esm/models/constructor-items/sub-blocks.js +4 -0
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +5 -3
- package/build/esm/schema/index.js +1 -0
- package/build/esm/schema/validators/common.d.ts +78 -0
- package/build/esm/schema/validators/common.js +2 -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/BackgroundCard/schema.d.ts +0 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.js +0 -2
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +3 -2
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +14 -9
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.js +26 -8
- package/build/esm/sub-blocks/HubspotForm/index.js +5 -3
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +16 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +4 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +20 -0
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +218 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +14 -0
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +29 -0
- package/build/esm/sub-blocks/LayoutItem/utils.js +6 -0
- package/build/esm/sub-blocks/Quote/Quote.js +2 -2
- package/build/esm/sub-blocks/Quote/schema.d.ts +0 -3
- package/build/esm/sub-blocks/Quote/schema.js +1 -3
- package/build/esm/sub-blocks/index.d.ts +1 -0
- package/build/esm/sub-blocks/index.js +1 -0
- package/build/esm/text-transform/blocks.js +17 -0
- package/build/esm/utils/hubspot.d.ts +2 -1
- package/build/esm/utils/hubspot.js +5 -1
- package/package.json +5 -2
- package/server/models/common.d.ts +3 -0
- package/server/models/constructor-items/blocks.d.ts +0 -10
- package/server/models/constructor-items/common.d.ts +6 -30
- package/server/models/constructor-items/sub-blocks.d.ts +18 -7
- package/server/models/constructor-items/sub-blocks.js +4 -0
- package/server/text-transform/blocks.js +17 -0
- package/server/utils/hubspot.d.ts +2 -1
- package/server/utils/hubspot.js +5 -1
- package/styles/root.scss +1 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.css +0 -30
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +0 -12
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +0 -28
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.css +0 -30
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +0 -13
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +0 -25
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import React, { useRef,
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
|
-
import
|
|
3
|
+
import useHeightCalculator from '../../hooks/useHeightCalculator';
|
|
4
4
|
import './Foldable.css';
|
|
5
5
|
const b = block('foldable-block');
|
|
6
6
|
const Foldable = ({ isOpened, children, className }) => {
|
|
7
|
+
const blockRef = useRef(null);
|
|
7
8
|
const contentRef = useRef(null);
|
|
8
|
-
const
|
|
9
|
-
const onHeightCalculation = useCallback((height) => {
|
|
10
|
-
setContentHeight(height);
|
|
11
|
-
}, []);
|
|
9
|
+
const contentHeight = useHeightCalculator(contentRef);
|
|
12
10
|
useEffect(() => {
|
|
13
|
-
if (
|
|
14
|
-
|
|
11
|
+
if (blockRef && blockRef.current) {
|
|
12
|
+
blockRef.current.style.height = isOpened && contentHeight ? `${contentHeight}px` : '0';
|
|
15
13
|
}
|
|
16
14
|
}, [isOpened, contentHeight]);
|
|
17
|
-
return (React.createElement("div", { className: b(
|
|
18
|
-
React.createElement("div", { ref: contentRef, className: b('content-container'
|
|
19
|
-
React.createElement(HeightCalculator, { onCalculate: onHeightCalculation }, children)));
|
|
15
|
+
return (React.createElement("div", { ref: blockRef, className: b({ open: isOpened }, className) },
|
|
16
|
+
React.createElement("div", { ref: contentRef, className: b('content-container') }, children)));
|
|
20
17
|
};
|
|
21
18
|
export default Foldable;
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { Icon, Modal } from '@gravity-ui/uikit';
|
|
3
3
|
import { block } from '../../utils';
|
|
4
4
|
import Image from '../Image/Image';
|
|
5
5
|
import { PreviewClose, FullScreen } from '../../icons';
|
|
6
6
|
import './FullScreenImage.css';
|
|
7
7
|
const b = block('FullScreenImage');
|
|
8
|
+
const FULL_SCREEN_ICON_SIZE = 18;
|
|
9
|
+
const CLOSE_ICON_SIZE = 30;
|
|
8
10
|
const FullScreenImage = (props) => {
|
|
9
11
|
const { imageClassName, modalImageClass, imageStyle } = props;
|
|
10
12
|
const [isOpened, setIsOpened] = useState(false);
|
|
11
13
|
const [isMouseEnter, setIsMouseEnter] = useState(false);
|
|
12
|
-
const openModal =
|
|
13
|
-
const closeModal =
|
|
14
|
-
const showFullScreenIcon =
|
|
15
|
-
const hideFullScreenIcon =
|
|
14
|
+
const openModal = () => setIsOpened(true);
|
|
15
|
+
const closeModal = () => setIsOpened(false);
|
|
16
|
+
const showFullScreenIcon = () => setIsMouseEnter(true);
|
|
17
|
+
const hideFullScreenIcon = () => setIsMouseEnter(false);
|
|
16
18
|
return (React.createElement("div", { className: b() },
|
|
17
19
|
React.createElement("div", { className: b('image-wrapper'), onMouseEnter: showFullScreenIcon, onMouseLeave: hideFullScreenIcon },
|
|
18
20
|
React.createElement(Image, Object.assign({}, props, { className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
|
|
19
21
|
React.createElement("div", { className: b('icon-wrapper', { visible: isMouseEnter }), onClick: openModal },
|
|
20
|
-
React.createElement(Icon, { data: FullScreen, width:
|
|
22
|
+
React.createElement(Icon, { data: FullScreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') }))),
|
|
21
23
|
isOpened && (React.createElement(Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
|
|
22
24
|
React.createElement("div", { className: b('modal-content') },
|
|
23
25
|
React.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal },
|
|
24
|
-
React.createElement(Icon, { data: PreviewClose, width:
|
|
26
|
+
React.createElement(Icon, { data: PreviewClose, width: CLOSE_ICON_SIZE, height: CLOSE_ICON_SIZE, className: b('icon', { hover: true }) })),
|
|
25
27
|
React.createElement(Image, Object.assign({}, props, { className: b('modal-image', modalImageClass) })))))));
|
|
26
28
|
};
|
|
27
29
|
export default FullScreenImage;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-full-screen-media__modal-media_type_youtube, .pc-full-screen-media__modal-media_type_video video, .pc-full-screen-media__modal-media_type_image {
|
|
4
|
+
display: block;
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 100%;
|
|
7
|
+
max-width: 1232px;
|
|
8
|
+
max-height: 70vh;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.pc-full-screen-media__media {
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
.pc-full-screen-media__media-wrapper {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
.pc-full-screen-media__modal-content {
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
.pc-full-screen-media__inline-media {
|
|
22
|
+
transform: translateZ(0);
|
|
23
|
+
}
|
|
24
|
+
.pc-full-screen-media__modal-media {
|
|
25
|
+
border-radius: var(--pc-border-radius);
|
|
26
|
+
}
|
|
27
|
+
.pc-full-screen-media__modal-media_type_youtube {
|
|
28
|
+
width: min(65vw, 1232px);
|
|
29
|
+
height: calc(min(65vw, 1232px) * 9 / 16);
|
|
30
|
+
}
|
|
31
|
+
.pc-full-screen-media__modal .yc-modal__content, .pc-full-screen-media__modal-image {
|
|
32
|
+
border-radius: var(--pc-border-radius);
|
|
33
|
+
}
|
|
34
|
+
.pc-full-screen-media__icon-wrapper {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
position: absolute;
|
|
39
|
+
right: 16px;
|
|
40
|
+
top: 16px;
|
|
41
|
+
width: 36px;
|
|
42
|
+
height: 36px;
|
|
43
|
+
border-radius: 8px;
|
|
44
|
+
background-color: var(--yc-color-base-simple-hover-solid);
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
z-index: 10;
|
|
47
|
+
}
|
|
48
|
+
.pc-full-screen-media__modal-content .pc-full-screen-media__icon-wrapper, .pc-full-screen-media__media-wrapper .pc-full-screen-media__icon-wrapper {
|
|
49
|
+
opacity: 0;
|
|
50
|
+
transition: opacity 0.3s;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
.pc-full-screen-media__modal-content:hover .pc-full-screen-media__icon-wrapper, .pc-full-screen-media__media-wrapper:hover .pc-full-screen-media__icon-wrapper {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
pointer-events: inherit;
|
|
56
|
+
}
|
|
57
|
+
.pc-full-screen-media__icon {
|
|
58
|
+
color: var(--yc-color-text-hint);
|
|
59
|
+
}
|
|
60
|
+
.pc-full-screen-media__icon_hover:hover {
|
|
61
|
+
color: var(--yc-color-text-secondary);
|
|
62
|
+
}
|
|
63
|
+
@media (max-width: 577px) {
|
|
64
|
+
.pc-full-screen-media__icon-wrapper {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
.pc-full-screen-media__modal {
|
|
68
|
+
display: none !important; /* stylelint-disable-line declaration-no-important */
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MediaAllProps } from '../Media/Media';
|
|
3
|
+
import './FullScreenMedia.css';
|
|
4
|
+
export type ChildMediaRenderProps = Pick<MediaAllProps, 'fullScreen' | 'imageClassName' | 'videoClassName' | 'youtubeClassName' | 'className'>;
|
|
5
|
+
export interface FullScreenMediaProps {
|
|
6
|
+
showFullScreenIcon?: boolean;
|
|
7
|
+
children: (props?: ChildMediaRenderProps) => JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
declare const FullScreenMedia: ({ children, showFullScreenIcon }: FullScreenMediaProps) => JSX.Element;
|
|
10
|
+
export default FullScreenMedia;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useContext, useState } from 'react';
|
|
2
|
+
import { Icon, Modal } from '@gravity-ui/uikit';
|
|
3
|
+
import { block } from '../../utils';
|
|
4
|
+
import { PreviewClose, FullScreen } from '../../icons';
|
|
5
|
+
import { MobileContext } from '../../context/mobileContext';
|
|
6
|
+
import './FullScreenMedia.css';
|
|
7
|
+
const b = block('full-screen-media');
|
|
8
|
+
const FULL_SCREEN_ICON_SIZE = 18;
|
|
9
|
+
const CLOSE_ICON_SIZE = 30;
|
|
10
|
+
const getMediaClass = (type) => b('modal-media', { type });
|
|
11
|
+
const FullScreenMedia = ({ children, showFullScreenIcon = true }) => {
|
|
12
|
+
const [isOpened, setIsOpened] = useState(false);
|
|
13
|
+
const isMobile = useContext(MobileContext);
|
|
14
|
+
const openModal = (e) => {
|
|
15
|
+
e.stopPropagation();
|
|
16
|
+
setIsOpened(true);
|
|
17
|
+
};
|
|
18
|
+
const closeModal = () => setIsOpened(false);
|
|
19
|
+
if (isMobile) {
|
|
20
|
+
return children();
|
|
21
|
+
}
|
|
22
|
+
return (React.createElement("div", { className: b() },
|
|
23
|
+
React.createElement("div", { className: b('media-wrapper'), onClickCapture: openModal },
|
|
24
|
+
children({ className: b('inline-media') }),
|
|
25
|
+
showFullScreenIcon && (React.createElement("div", { className: b('icon-wrapper'), onClickCapture: openModal },
|
|
26
|
+
React.createElement(Icon, { data: FullScreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') })))),
|
|
27
|
+
isOpened && (React.createElement(Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
|
|
28
|
+
React.createElement("div", { className: b('modal-content') },
|
|
29
|
+
React.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal },
|
|
30
|
+
React.createElement(Icon, { data: PreviewClose, width: CLOSE_ICON_SIZE, height: CLOSE_ICON_SIZE, className: b('icon', { hover: true }) })),
|
|
31
|
+
children({
|
|
32
|
+
imageClassName: getMediaClass('image'),
|
|
33
|
+
videoClassName: getMediaClass('video'),
|
|
34
|
+
youtubeClassName: getMediaClass('youtube'),
|
|
35
|
+
fullScreen: true,
|
|
36
|
+
}))))));
|
|
37
|
+
};
|
|
38
|
+
export default FullScreenMedia;
|
|
@@ -1,6 +1,36 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/* use this for style redefinitions to awoid problems with
|
|
3
|
+
unpredictable css rules order in build */
|
|
1
4
|
.pc-header-breadcrumbs {
|
|
2
5
|
z-index: 11;
|
|
3
6
|
}
|
|
7
|
+
.pc-header-breadcrumbs__item {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
10
|
+
.pc-header-breadcrumbs__text {
|
|
11
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
12
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
13
|
+
outline: none;
|
|
14
|
+
color: var(--yc-color-text-link);
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
color: var(--yc-color-text-secondary);
|
|
18
|
+
}
|
|
19
|
+
.utilityfocus .pc-header-breadcrumbs__text:focus {
|
|
20
|
+
outline: 2px solid #ffdb4d;
|
|
21
|
+
}
|
|
22
|
+
.pc-header-breadcrumbs__text:hover, .pc-header-breadcrumbs__text:active {
|
|
23
|
+
--pc-text-header-color: var(--yc-color-text-link-hover);
|
|
24
|
+
color: var(--yc-color-text-link-hover);
|
|
25
|
+
}
|
|
26
|
+
.pc-header-breadcrumbs__text:after {
|
|
27
|
+
content: " / ";
|
|
28
|
+
margin: 0 8px 0 6px;
|
|
29
|
+
color: var(--yc-color-text-secondary);
|
|
30
|
+
}
|
|
31
|
+
.pc-header-breadcrumbs__text:hover {
|
|
32
|
+
color: var(--yc-color-text-primary);
|
|
33
|
+
}
|
|
4
34
|
.pc-header-breadcrumbs_theme_dark .pc-header-breadcrumbs__text {
|
|
5
35
|
color: var(--yc-color-text-light-secondary);
|
|
6
36
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
|
-
import
|
|
3
|
+
import { useMetrika } from '../../hooks/useMetrika';
|
|
4
4
|
import './HeaderBreadcrumbs.css';
|
|
5
5
|
const b = block('header-breadcrumbs');
|
|
6
6
|
export default function HeaderBreadcrumbs(props) {
|
|
7
7
|
const { items, metrikaGoals, pixelEvents, theme = 'light', className } = props;
|
|
8
|
-
|
|
8
|
+
const handleMetrika = useMetrika();
|
|
9
|
+
const onClick = () => {
|
|
10
|
+
handleMetrika({ metrikaGoals, pixelEvents });
|
|
11
|
+
};
|
|
12
|
+
return (React.createElement("div", { className: b({ theme }, className) }, items.map((item) => (React.createElement("div", { className: b('item'), key: item.url },
|
|
13
|
+
React.createElement("a", { href: item.url, className: b('text'), onClick: onClick }, item.text))))));
|
|
9
14
|
}
|
|
@@ -3,5 +3,9 @@ import './HeightCalculator.css';
|
|
|
3
3
|
export interface HeightCalculatorProps {
|
|
4
4
|
onCalculate: (height: number) => void;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Will be removed, use the useHeightCalculator hook instead.
|
|
8
|
+
* @returns The HeightCalculator component.
|
|
9
|
+
*/
|
|
6
10
|
declare const HeightCalculator: ({ onCalculate, children }: WithChildren<HeightCalculatorProps>) => JSX.Element | null;
|
|
7
11
|
export default HeightCalculator;
|
|
@@ -3,6 +3,10 @@ import _ from 'lodash';
|
|
|
3
3
|
import { block } from '../../utils';
|
|
4
4
|
import './HeightCalculator.css';
|
|
5
5
|
const b = block('height-calculator');
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Will be removed, use the useHeightCalculator hook instead.
|
|
8
|
+
* @returns The HeightCalculator component.
|
|
9
|
+
*/
|
|
6
10
|
const HeightCalculator = ({ onCalculate, children }) => {
|
|
7
11
|
const [isCalculating, setIsCalculating] = useState(true);
|
|
8
12
|
const container = useRef(null);
|
|
@@ -7,9 +7,9 @@ import FileLink from '../FileLink/FileLink';
|
|
|
7
7
|
import BackLink from '../BackLink/BackLink';
|
|
8
8
|
import { LocaleContext } from '../../context/localeContext/localeContext';
|
|
9
9
|
import { LocationContext } from '../../context/locationContext/locationContext';
|
|
10
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
10
11
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
11
12
|
import { useAnalytics } from '../../hooks';
|
|
12
|
-
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
13
13
|
import './Link.css';
|
|
14
14
|
const b = block('link-block');
|
|
15
15
|
const WORD_JOINER_SYM = '\u200b';
|
|
@@ -7,7 +7,7 @@ import YoutubeBlock from '../VideoBlock/VideoBlock';
|
|
|
7
7
|
import './Media.css';
|
|
8
8
|
const b = block('Media');
|
|
9
9
|
export const Media = (props) => {
|
|
10
|
-
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, analyticsEvents, } = props;
|
|
10
|
+
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullScreen, analyticsEvents, } = props;
|
|
11
11
|
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, } = props;
|
|
12
12
|
const [hasVideoFallback, setHasVideoFallback] = useState(false);
|
|
13
13
|
const content = useMemo(() => {
|
|
@@ -19,7 +19,7 @@ export const Media = (props) => {
|
|
|
19
19
|
result.push(React.createElement(Video, { key: "video", video: video, videoClassName: videoClassName, height: height, metrika: metrika, analyticsEvents: analyticsEvents, playVideo: playVideo, previewImg: previewImg, playButton: playButton, customBarControlsClassName: customBarControlsClassName, hasVideoFallback: hasVideoFallback, setHasVideoFallback: setHasVideoFallback }));
|
|
20
20
|
}
|
|
21
21
|
if (youtube) {
|
|
22
|
-
result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height }));
|
|
22
|
+
result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullScreen: fullScreen }));
|
|
23
23
|
}
|
|
24
24
|
if (dataLens) {
|
|
25
25
|
result = React.createElement(DataLens, { dataLens: dataLens });
|
|
@@ -43,6 +43,7 @@ export const Media = (props) => {
|
|
|
43
43
|
playButton,
|
|
44
44
|
customBarControlsClassName,
|
|
45
45
|
youtubeClassName,
|
|
46
|
+
fullScreen,
|
|
46
47
|
]);
|
|
47
48
|
return (React.createElement("div", { className: b(null, className), style: { backgroundColor: color } }, content));
|
|
48
49
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-meta-info {
|
|
4
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
5
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
color: var(--pc-media-card-meta-info-color);
|
|
10
|
+
}
|
|
11
|
+
.pc-meta-info__item:not(:first-child) {
|
|
12
|
+
margin-left: 16px;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { block } from '../../utils';
|
|
3
|
+
import './MetaInfo.css';
|
|
4
|
+
const b = block('meta-info');
|
|
5
|
+
const MetaInfo = ({ items, className }) => (React.createElement("h4", { className: b(null, className) }, items.map((metaInfoItem) => (React.createElement("div", { key: metaInfoItem, className: b('item') }, metaInfoItem)))));
|
|
6
|
+
export default MetaInfo;
|
|
@@ -43,7 +43,7 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
43
43
|
const defaultEvent = useMemo(() => ({
|
|
44
44
|
name: 'react-player-controls-click',
|
|
45
45
|
type: PredefinedEventTypes.Default,
|
|
46
|
-
context
|
|
46
|
+
context,
|
|
47
47
|
}), [context]);
|
|
48
48
|
const handleAnalytics = useAnalytics(defaultEvent);
|
|
49
49
|
useImperativeHandle(originRef, () => ({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useState, useCallback, useEffect } from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
3
4
|
import { Icon } from '@gravity-ui/uikit';
|
|
4
5
|
import { block, getPageSearchParams } from '../../utils';
|
|
5
6
|
import Image from '../Image/Image';
|
|
@@ -15,7 +16,6 @@ export const AUTOPLAY_ATTRIBUTES = {
|
|
|
15
16
|
mute: 1,
|
|
16
17
|
};
|
|
17
18
|
const b = block('VideoBlock');
|
|
18
|
-
const iframeId = 'video-block';
|
|
19
19
|
function getVideoSrc(stream, record) {
|
|
20
20
|
if (!stream && !record) {
|
|
21
21
|
return null;
|
|
@@ -34,14 +34,14 @@ export function getHeight(width) {
|
|
|
34
34
|
return (width / 16) * 9;
|
|
35
35
|
}
|
|
36
36
|
const VideoBlock = (props) => {
|
|
37
|
-
const { stream, record, attributes, className, id, previewImg, playButton, height } = props;
|
|
37
|
+
const { stream, record, attributes, className, id, previewImg, playButton, height, fullScreen } = props;
|
|
38
38
|
const src = getVideoSrc(stream, record);
|
|
39
39
|
const ref = useRef(null);
|
|
40
40
|
const iframeRef = useRef();
|
|
41
41
|
const [hidePreview, setHidePreview] = useState(false);
|
|
42
42
|
const norender = (!stream && !record) || !src;
|
|
43
43
|
const [currentHeight, setCurrentHeight] = useState(height || undefined);
|
|
44
|
-
const fullId =
|
|
44
|
+
const fullId = id || uuidv4();
|
|
45
45
|
const onPreviewClick = useCallback(() => {
|
|
46
46
|
if (iframeRef.current) {
|
|
47
47
|
iframeRef.current.src = `${src}?${getPageSearchParams(Object.assign(Object.assign({}, AUTOPLAY_ATTRIBUTES), (attributes || {})))}`;
|
|
@@ -62,12 +62,8 @@ const VideoBlock = (props) => {
|
|
|
62
62
|
if (norender) {
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
const prevPageVideo = document.getElementById(fullId);
|
|
66
65
|
const fullSrc = `${src}?${getPageSearchParams(attributes || {})}`;
|
|
67
|
-
if (
|
|
68
|
-
prevPageVideo.src = fullSrc;
|
|
69
|
-
}
|
|
70
|
-
else if (ref.current) {
|
|
66
|
+
if (ref.current && !iframeRef.current) {
|
|
71
67
|
const iframe = document.createElement('iframe');
|
|
72
68
|
iframe.id = fullId;
|
|
73
69
|
iframe.src = fullSrc;
|
|
@@ -79,14 +75,14 @@ const VideoBlock = (props) => {
|
|
|
79
75
|
ref.current.appendChild(iframe);
|
|
80
76
|
iframeRef.current = iframe;
|
|
81
77
|
}
|
|
82
|
-
}, [stream, record, norender, src, fullId, attributes, iframeRef]);
|
|
78
|
+
}, [stream, record, norender, src, fullId, attributes, iframeRef, fullScreen]);
|
|
83
79
|
useEffect(() => {
|
|
84
80
|
setHidePreview(false);
|
|
85
81
|
}, [src, setHidePreview]);
|
|
86
82
|
if (norender) {
|
|
87
83
|
return null;
|
|
88
84
|
}
|
|
89
|
-
return (React.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && (React.createElement("div", { className: b('preview'), onClick: onPreviewClick },
|
|
85
|
+
return (React.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && !fullScreen && (React.createElement("div", { className: b('preview'), onClick: onPreviewClick },
|
|
90
86
|
React.createElement(Image, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper') }),
|
|
91
87
|
playButton || (React.createElement("button", { className: b('button') },
|
|
92
88
|
React.createElement(Icon, { className: b('icon'), data: PlayVideo, size: 24 })))))));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PixelEvent } from '../../models';
|
|
2
|
-
import {
|
|
2
|
+
import { AnalyticsEventsBase } from '../../models/common';
|
|
3
3
|
export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
|
|
4
|
-
export interface YandexFormProps {
|
|
4
|
+
export interface YandexFormProps extends AnalyticsEventsBase {
|
|
5
5
|
id: number | string;
|
|
6
6
|
containerId?: string;
|
|
7
7
|
theme?: string;
|
|
@@ -15,8 +15,6 @@ export interface YandexFormProps {
|
|
|
15
15
|
onLoad?: () => void;
|
|
16
16
|
metrikaGoals?: string | string[];
|
|
17
17
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
18
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
19
|
-
context?: string;
|
|
20
18
|
}
|
|
21
19
|
declare const YandexForm: (props: YandexFormProps) => JSX.Element;
|
|
22
20
|
export default YandexForm;
|
|
@@ -2,11 +2,11 @@ import React, { useCallback, useContext, useEffect, useMemo, useRef } from 'reac
|
|
|
2
2
|
import { HEADER_HEIGHT } from '../constants';
|
|
3
3
|
import { LocaleContext } from '../../context/localeContext';
|
|
4
4
|
import { MobileContext } from '../../context/mobileContext';
|
|
5
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
5
6
|
import { block } from '../../utils';
|
|
6
|
-
import { useMetrika } from '../../hooks/useMetrika';
|
|
7
7
|
import { PredefinedEventTypes } from '../../models/common';
|
|
8
|
+
import { useMetrika } from '../../hooks/useMetrika';
|
|
8
9
|
import { useAnalytics } from '../../hooks';
|
|
9
|
-
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
10
10
|
export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
|
|
11
11
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
12
12
|
const b = block('yandex-form');
|
|
@@ -33,4 +33,6 @@ export { default as OverflowScroller } from './OverflowScroller/OverflowScroller
|
|
|
33
33
|
export { default as Author } from './Author/Author';
|
|
34
34
|
export { default as RouterLink } from './RouterLink/RouterLink';
|
|
35
35
|
export { default as HTML } from './HTML/HTML';
|
|
36
|
+
export { default as MetaInfo } from './MetaInfo/MetaInfo';
|
|
37
|
+
export { default as FullScreenMedia } from './FullscreenMedia/FullScreenMedia';
|
|
36
38
|
export type { RouterLinkProps } from './RouterLink/RouterLink';
|
|
@@ -33,3 +33,5 @@ export { default as OverflowScroller } from './OverflowScroller/OverflowScroller
|
|
|
33
33
|
export { default as Author } from './Author/Author';
|
|
34
34
|
export { default as RouterLink } from './RouterLink/RouterLink';
|
|
35
35
|
export { default as HTML } from './HTML/HTML';
|
|
36
|
+
export { default as MetaInfo } from './MetaInfo/MetaInfo';
|
|
37
|
+
export { default as FullScreenMedia } from './FullscreenMedia/FullScreenMedia';
|
|
@@ -34,6 +34,10 @@ export declare const subBlockMap: {
|
|
|
34
34
|
"media-card": ({ border, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
|
|
35
35
|
"banner-card": (props: import("./models").BannerCardProps) => JSX.Element;
|
|
36
36
|
"news-card": (props: import("./models").NewsCardProps) => JSX.Element;
|
|
37
|
+
"layout-item": ({ content: { links, ...content }, metaInfo, media, border, fullScreen, className, }: import("./models").LayoutItemProps) => JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use LayoutItem
|
|
40
|
+
*/
|
|
37
41
|
"card-with-image": ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }: import("./models").CardWithImageProps) => JSX.Element;
|
|
38
42
|
"background-card": (props: import("./models").BackgroundCardProps) => JSX.Element;
|
|
39
43
|
"basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockType, SubBlockType } from './models';
|
|
2
|
-
import { Partner, PriceDetailed, MediaCard, NewsCard, TutorialCard, CardWithImage, BackgroundCard, Content, Quote, Divider, BannerCard, BasicCard, } from './sub-blocks';
|
|
2
|
+
import { Partner, PriceDetailed, MediaCard, NewsCard, TutorialCard, CardWithImage, LayoutItem, BackgroundCard, Content, Quote, Divider, BannerCard, BasicCard, } from './sub-blocks';
|
|
3
3
|
import { BannerBlock, CompaniesBlock, SimpleBlock, MediaBlock, PreviewBlock, InfoBlock, SecurityBlock, SliderBlock, ExtendedFeaturesBlock, PromoFeaturesBlock, QuestionsBlock, TableBlock, TabsBlock, LinkTableBlock, HeaderBlock, IconsBlock, HeaderSliderBlock, CardLayoutBlock, ContentLayoutBlock, ShareBlock, } from './blocks';
|
|
4
4
|
export const blockMap = {
|
|
5
5
|
[BlockType.SliderBlock]: SliderBlock,
|
|
@@ -37,6 +37,10 @@ export const subBlockMap = {
|
|
|
37
37
|
[SubBlockType.MediaCard]: MediaCard,
|
|
38
38
|
[SubBlockType.BannerCard]: BannerCard,
|
|
39
39
|
[SubBlockType.NewsCard]: NewsCard,
|
|
40
|
+
[SubBlockType.LayoutItem]: LayoutItem,
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Use LayoutItem
|
|
43
|
+
*/
|
|
40
44
|
[SubBlockType.CardWithImage]: CardWithImage,
|
|
41
45
|
[SubBlockType.BackgroundCard]: BackgroundCard,
|
|
42
46
|
[SubBlockType.BasicCard]: BasicCard,
|
|
@@ -18,6 +18,7 @@ unpredictable css rules order in build */
|
|
|
18
18
|
--pc-monochrome-button-background-color-hover: #393939;
|
|
19
19
|
--pc-monochrome-button-color: var(--yc-color-text-light-primary);
|
|
20
20
|
--pc-text-header-color: var(--yc-color-text-primary);
|
|
21
|
+
--pc-media-card-meta-info-color: var(--yc-color-text-secondary);
|
|
21
22
|
}
|
|
22
23
|
.yc-root.yc-root_theme_dark {
|
|
23
24
|
--pc-color-sfx-shadow: var(--yc-color-sfx-shadow);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type HeightCalculatorOptions = {
|
|
3
|
+
recalculateOnResizeDelay: number;
|
|
4
|
+
};
|
|
5
|
+
declare const useHeightCalculator: (containerRef: React.RefObject<HTMLElement>, options?: HeightCalculatorOptions) => number | undefined;
|
|
6
|
+
export default useHeightCalculator;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
const DEFAULT_RECALCULATE_ON_RESIZE_DELAY = 1000;
|
|
4
|
+
const DEFAULT_OPTIONS = {
|
|
5
|
+
recalculateOnResizeDelay: DEFAULT_RECALCULATE_ON_RESIZE_DELAY,
|
|
6
|
+
};
|
|
7
|
+
const useHeightCalculator = (containerRef, options = DEFAULT_OPTIONS) => {
|
|
8
|
+
const recalculateOnResizeDelay = options.recalculateOnResizeDelay;
|
|
9
|
+
const [containerHeight, setContainerHeight] = useState(undefined);
|
|
10
|
+
const calculateContainerHeight = useCallback(() => {
|
|
11
|
+
if (containerRef.current && containerRef.current.offsetHeight !== containerHeight)
|
|
12
|
+
setContainerHeight(containerRef.current.offsetHeight);
|
|
13
|
+
}, [containerRef, containerHeight, setContainerHeight]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const handleResize = _.debounce(calculateContainerHeight, recalculateOnResizeDelay);
|
|
16
|
+
calculateContainerHeight();
|
|
17
|
+
window.addEventListener('resize', handleResize);
|
|
18
|
+
return () => {
|
|
19
|
+
window.removeEventListener('resize', handleResize);
|
|
20
|
+
};
|
|
21
|
+
}, [calculateContainerHeight, recalculateOnResizeDelay]);
|
|
22
|
+
return containerHeight;
|
|
23
|
+
};
|
|
24
|
+
export default useHeightCalculator;
|