@gravity-ui/page-constructor 4.51.2-alpha.0 → 4.53.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/README.md +3 -5
- package/build/cjs/blocks/Banner/schema.d.ts +264 -0
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/cjs/blocks/FilterBlock/FilterBlock.js +2 -2
- package/build/cjs/blocks/FilterBlock/i18n/index.d.ts +2 -1
- package/build/cjs/blocks/FilterBlock/i18n/index.js +3 -4
- package/build/cjs/blocks/Map/schema.d.ts +88 -0
- package/build/cjs/blocks/Media/schema.d.ts +176 -0
- package/build/cjs/blocks/Security/i18n/index.d.ts +2 -1
- package/build/cjs/blocks/Security/i18n/index.js +3 -4
- package/build/cjs/blocks/Share/Share.js +4 -4
- package/build/cjs/blocks/Share/i18n/index.d.ts +2 -1
- package/build/cjs/blocks/Share/i18n/index.js +3 -4
- package/build/cjs/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/cjs/blocks/Slider/i18n/index.d.ts +2 -1
- package/build/cjs/blocks/Slider/i18n/index.js +3 -4
- package/build/cjs/components/Button/Button.js +7 -4
- package/build/cjs/components/Button/i18n/index.d.ts +2 -1
- package/build/cjs/components/Button/i18n/index.js +3 -4
- package/build/cjs/components/CardBase/CardBase.d.ts +3 -1
- package/build/cjs/components/CardBase/CardBase.js +4 -1
- package/build/cjs/components/Control/Control.js +2 -2
- package/build/cjs/components/Control/i18n/index.d.ts +2 -1
- package/build/cjs/components/Control/i18n/index.js +3 -4
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +3 -3
- package/build/cjs/components/FullscreenImage/i18n/index.d.ts +2 -1
- package/build/cjs/components/FullscreenImage/i18n/index.js +3 -4
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +6 -3
- package/build/cjs/components/Link/Link.js +4 -1
- package/build/cjs/components/Map/GoogleMap.js +2 -2
- package/build/cjs/components/Map/YMap/YandexMap.js +2 -2
- package/build/cjs/components/Map/YMap/i18n/index.d.ts +2 -1
- package/build/cjs/components/Map/YMap/i18n/index.js +3 -4
- package/build/cjs/components/Media/DataLens/DataLens.js +2 -2
- package/build/cjs/components/Media/DataLens/i18n/index.d.ts +2 -1
- package/build/cjs/components/Media/DataLens/i18n/index.js +3 -4
- package/build/cjs/components/Media/Iframe/Iframe.js +2 -2
- package/build/cjs/components/Media/Iframe/i18n/index.d.ts +2 -1
- package/build/cjs/components/Media/Iframe/i18n/index.js +3 -4
- package/build/cjs/components/Media/Media.js +3 -1
- package/build/cjs/components/Media/Video/Video.js +3 -2
- package/build/cjs/components/OverflowScroller/OverflowScroller.js +2 -2
- package/build/cjs/components/OverflowScroller/i18n/index.d.ts +2 -1
- package/build/cjs/components/OverflowScroller/i18n/index.js +3 -4
- package/build/cjs/components/ReactPlayer/CustomBarControls.js +3 -3
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +38 -6
- package/build/cjs/components/ReactPlayer/i18n/index.d.ts +2 -1
- package/build/cjs/components/ReactPlayer/i18n/index.js +3 -4
- package/build/cjs/components/ReactPlayer/utils/youtube.d.ts +2 -0
- package/build/cjs/components/ReactPlayer/utils/youtube.js +7 -0
- package/build/cjs/components/UnpublishedLabel/UnpublishedLabel.js +2 -2
- package/build/cjs/components/UnpublishedLabel/i18n/index.d.ts +2 -1
- package/build/cjs/components/UnpublishedLabel/i18n/index.js +3 -4
- package/build/cjs/components/VideoBlock/VideoBlock.js +2 -2
- package/build/cjs/components/VideoBlock/i18n/index.d.ts +2 -1
- package/build/cjs/components/VideoBlock/i18n/index.js +3 -4
- package/build/cjs/components/YandexForm/YandexForm.js +13 -2
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/containers/Loadable/Loadable.js +2 -2
- package/build/cjs/containers/Loadable/i18n/index.d.ts +2 -1
- package/build/cjs/containers/Loadable/i18n/index.js +3 -4
- package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/cjs/containers/PageConstructor/Provider.js +3 -1
- package/build/cjs/context/localeContext/localeContext.d.ts +2 -2
- package/build/cjs/context/localeContext/localeContext.js +2 -2
- package/build/cjs/context/metrikaContext/index.d.ts +1 -0
- package/build/cjs/context/metrikaContext/index.js +4 -0
- package/build/cjs/context/metrikaContext/metrikaContext.d.ts +13 -0
- package/build/cjs/context/metrikaContext/metrikaContext.js +6 -0
- package/build/cjs/editor/components/ControlPanel/ControlPanel.js +3 -3
- package/build/cjs/editor/components/ControlPanel/i18n/en.json +1 -2
- package/build/cjs/editor/components/ControlPanel/i18n/index.d.ts +2 -1
- package/build/cjs/editor/components/ControlPanel/i18n/index.js +3 -4
- package/build/cjs/editor/components/ControlPanel/i18n/ru.json +1 -2
- package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.js +3 -3
- package/build/cjs/editor/components/ErrorBoundary/i18n/index.d.ts +2 -1
- package/build/cjs/editor/components/ErrorBoundary/i18n/index.js +3 -4
- package/build/cjs/editor/components/NotFoundBlock/NotFoundBlock.js +2 -2
- package/build/cjs/editor/components/NotFoundBlock/i18n/index.d.ts +2 -1
- package/build/cjs/editor/components/NotFoundBlock/i18n/index.js +3 -4
- package/build/cjs/hooks/useAnalytics.d.ts +2 -2
- package/build/cjs/hooks/useMetrika.d.ts +13 -1
- package/build/cjs/hooks/useMetrika.js +41 -0
- package/build/cjs/i18n.d.ts +2 -0
- package/build/cjs/i18n.js +12 -0
- package/build/cjs/models/common.d.ts +53 -2
- package/build/cjs/models/common.js +25 -1
- package/build/cjs/models/constructor-items/common.d.ts +29 -2
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +20 -4
- package/build/cjs/models/constructor-items/sub-blocks.js +7 -1
- package/build/cjs/models/guards.d.ts +2 -0
- package/build/cjs/models/guards.js +5 -1
- package/build/cjs/schema/constants.d.ts +252 -0
- package/build/cjs/schema/constants.js +2 -1
- package/build/cjs/schema/validators/common.d.ts +188 -0
- package/build/cjs/schema/validators/common.js +31 -0
- package/build/cjs/schema/validators/index.d.ts +2 -0
- package/build/cjs/schema/validators/index.js +2 -0
- package/build/cjs/schema/validators/pixel.d.ts +57 -0
- package/build/cjs/schema/validators/pixel.js +63 -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/BasicCard/BasicCard.js +2 -2
- package/build/cjs/sub-blocks/HubspotForm/index.js +6 -1
- 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/LayoutItem/utils.d.ts +15 -1
- package/build/cjs/sub-blocks/PriceCard/schema.d.ts +88 -0
- package/build/cjs/sub-blocks/index.d.ts +1 -0
- package/build/cjs/sub-blocks/index.js +3 -1
- package/build/cjs/text-transform/common.d.ts +4 -4
- package/build/cjs/text-transform/transformers.d.ts +2 -2
- package/build/cjs/text-transform/utils.d.ts +6 -6
- package/build/cjs/text-transform/utils.js +5 -5
- package/build/cjs/utils/configure.d.ts +12 -0
- package/build/cjs/utils/configure.js +26 -0
- package/build/cjs/utils/index.d.ts +1 -0
- package/build/cjs/utils/index.js +4 -1
- package/build/cjs/utils/registerKeyset.d.ts +5 -0
- package/build/cjs/utils/registerKeyset.js +9 -0
- package/build/esm/blocks/Banner/schema.d.ts +264 -0
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/esm/blocks/FilterBlock/FilterBlock.js +1 -1
- package/build/esm/blocks/FilterBlock/i18n/index.d.ts +2 -1
- package/build/esm/blocks/FilterBlock/i18n/index.js +3 -3
- package/build/esm/blocks/Map/schema.d.ts +88 -0
- package/build/esm/blocks/Media/schema.d.ts +176 -0
- package/build/esm/blocks/Security/i18n/index.d.ts +2 -1
- package/build/esm/blocks/Security/i18n/index.js +3 -3
- package/build/esm/blocks/Share/Share.js +1 -1
- package/build/esm/blocks/Share/i18n/index.d.ts +2 -1
- package/build/esm/blocks/Share/i18n/index.js +3 -3
- package/build/esm/blocks/Slider/Arrow/Arrow.js +1 -1
- package/build/esm/blocks/Slider/i18n/index.d.ts +2 -1
- package/build/esm/blocks/Slider/i18n/index.js +3 -3
- package/build/esm/components/Button/Button.js +6 -3
- package/build/esm/components/Button/i18n/index.d.ts +2 -1
- package/build/esm/components/Button/i18n/index.js +3 -3
- package/build/esm/components/CardBase/CardBase.d.ts +3 -1
- package/build/esm/components/CardBase/CardBase.js +4 -1
- package/build/esm/components/Control/Control.js +1 -1
- package/build/esm/components/Control/i18n/index.d.ts +2 -1
- package/build/esm/components/Control/i18n/index.js +3 -3
- package/build/esm/components/FullscreenImage/FullscreenImage.js +1 -1
- package/build/esm/components/FullscreenImage/i18n/index.d.ts +2 -1
- package/build/esm/components/FullscreenImage/i18n/index.js +3 -3
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +6 -3
- package/build/esm/components/Link/Link.js +4 -1
- package/build/esm/components/Map/GoogleMap.js +1 -1
- package/build/esm/components/Map/YMap/YandexMap.js +1 -1
- package/build/esm/components/Map/YMap/i18n/index.d.ts +2 -1
- package/build/esm/components/Map/YMap/i18n/index.js +3 -3
- package/build/esm/components/Media/DataLens/DataLens.js +1 -1
- package/build/esm/components/Media/DataLens/i18n/index.d.ts +2 -1
- package/build/esm/components/Media/DataLens/i18n/index.js +3 -3
- package/build/esm/components/Media/Iframe/Iframe.js +1 -1
- package/build/esm/components/Media/Iframe/i18n/index.d.ts +2 -1
- package/build/esm/components/Media/Iframe/i18n/index.js +3 -3
- package/build/esm/components/Media/Media.js +3 -1
- package/build/esm/components/Media/Video/Video.js +3 -2
- package/build/esm/components/OverflowScroller/OverflowScroller.js +1 -1
- package/build/esm/components/OverflowScroller/i18n/index.d.ts +2 -1
- package/build/esm/components/OverflowScroller/i18n/index.js +3 -3
- package/build/esm/components/ReactPlayer/CustomBarControls.js +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js +37 -5
- package/build/esm/components/ReactPlayer/i18n/index.d.ts +2 -1
- package/build/esm/components/ReactPlayer/i18n/index.js +3 -3
- package/build/esm/components/ReactPlayer/utils/youtube.d.ts +2 -0
- package/build/esm/components/ReactPlayer/utils/youtube.js +3 -0
- package/build/esm/components/UnpublishedLabel/UnpublishedLabel.js +1 -1
- package/build/esm/components/UnpublishedLabel/i18n/index.d.ts +2 -1
- package/build/esm/components/UnpublishedLabel/i18n/index.js +3 -3
- package/build/esm/components/VideoBlock/VideoBlock.js +1 -1
- package/build/esm/components/VideoBlock/i18n/index.d.ts +2 -1
- package/build/esm/components/VideoBlock/i18n/index.js +3 -3
- package/build/esm/components/YandexForm/YandexForm.js +13 -2
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/containers/Loadable/Loadable.js +1 -1
- package/build/esm/containers/Loadable/i18n/index.d.ts +2 -1
- package/build/esm/containers/Loadable/i18n/index.js +3 -3
- package/build/esm/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/esm/containers/PageConstructor/Provider.js +3 -1
- package/build/esm/context/localeContext/localeContext.d.ts +2 -2
- package/build/esm/context/localeContext/localeContext.js +1 -1
- package/build/esm/context/metrikaContext/index.d.ts +1 -0
- package/build/esm/context/metrikaContext/index.js +1 -0
- package/build/esm/context/metrikaContext/metrikaContext.d.ts +13 -0
- package/build/esm/context/metrikaContext/metrikaContext.js +2 -0
- package/build/esm/editor/components/ControlPanel/ControlPanel.js +2 -2
- package/build/esm/editor/components/ControlPanel/i18n/en.json +1 -2
- package/build/esm/editor/components/ControlPanel/i18n/index.d.ts +2 -1
- package/build/esm/editor/components/ControlPanel/i18n/index.js +3 -3
- package/build/esm/editor/components/ControlPanel/i18n/ru.json +1 -2
- package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.js +1 -1
- package/build/esm/editor/components/ErrorBoundary/i18n/index.d.ts +2 -1
- package/build/esm/editor/components/ErrorBoundary/i18n/index.js +3 -3
- package/build/esm/editor/components/NotFoundBlock/NotFoundBlock.js +1 -1
- package/build/esm/editor/components/NotFoundBlock/i18n/index.d.ts +2 -1
- package/build/esm/editor/components/NotFoundBlock/i18n/index.js +3 -3
- package/build/esm/hooks/useAnalytics.d.ts +2 -2
- package/build/esm/hooks/useMetrika.d.ts +13 -1
- package/build/esm/hooks/useMetrika.js +38 -1
- package/build/esm/i18n.d.ts +2 -0
- package/build/esm/i18n.js +9 -0
- package/build/esm/models/common.d.ts +53 -2
- package/build/esm/models/common.js +24 -0
- package/build/esm/models/constructor-items/common.d.ts +29 -2
- package/build/esm/models/constructor-items/sub-blocks.d.ts +20 -4
- package/build/esm/models/constructor-items/sub-blocks.js +6 -0
- package/build/esm/models/guards.d.ts +2 -0
- package/build/esm/models/guards.js +3 -0
- package/build/esm/schema/constants.d.ts +252 -0
- package/build/esm/schema/constants.js +3 -2
- package/build/esm/schema/validators/common.d.ts +188 -0
- package/build/esm/schema/validators/common.js +31 -0
- package/build/esm/schema/validators/index.d.ts +2 -0
- package/build/esm/schema/validators/index.js +2 -0
- package/build/esm/schema/validators/pixel.d.ts +57 -0
- package/build/esm/schema/validators/pixel.js +60 -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/BasicCard/BasicCard.js +2 -2
- package/build/esm/sub-blocks/HubspotForm/index.js +6 -1
- 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/LayoutItem/utils.d.ts +15 -1
- package/build/esm/sub-blocks/PriceCard/schema.d.ts +88 -0
- package/build/esm/sub-blocks/index.d.ts +1 -0
- package/build/esm/sub-blocks/index.js +1 -0
- package/build/esm/text-transform/common.d.ts +4 -4
- package/build/esm/text-transform/transformers.d.ts +2 -2
- package/build/esm/text-transform/utils.d.ts +6 -6
- package/build/esm/text-transform/utils.js +1 -1
- package/build/esm/utils/configure.d.ts +12 -0
- package/build/esm/utils/configure.js +20 -0
- package/build/esm/utils/index.d.ts +1 -0
- package/build/esm/utils/index.js +1 -0
- package/build/esm/utils/registerKeyset.d.ts +5 -0
- package/build/esm/utils/registerKeyset.js +5 -0
- package/package.json +2 -1
- package/server/models/common.d.ts +53 -2
- package/server/models/common.js +25 -1
- package/server/models/constructor-items/common.d.ts +29 -2
- package/server/models/constructor-items/sub-blocks.d.ts +20 -4
- package/server/models/constructor-items/sub-blocks.js +7 -1
- package/server/models/guards.d.ts +2 -0
- package/server/models/guards.js +5 -1
- package/server/text-transform/common.d.ts +4 -4
- package/server/text-transform/transformers.d.ts +2 -2
- package/server/text-transform/utils.d.ts +6 -6
- package/server/text-transform/utils.js +5 -5
- package/server/utils/configure.d.ts +12 -0
- package/server/utils/configure.js +26 -0
- package/server/utils/index.d.ts +1 -0
- package/server/utils/index.js +4 -1
- package/widget/index.js +1 -1
|
@@ -9,7 +9,7 @@ import Video from './Video/Video';
|
|
|
9
9
|
import './Media.css';
|
|
10
10
|
const b = block('Media');
|
|
11
11
|
export const Media = (props) => {
|
|
12
|
-
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
|
|
12
|
+
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, } = props;
|
|
13
13
|
const [hasVideoFallback, setHasVideoFallback] = useState(false);
|
|
14
14
|
const qaAttributes = getQaAttrubutes(qa, 'video');
|
|
15
15
|
const content = useMemo(() => {
|
|
@@ -23,6 +23,7 @@ export const Media = (props) => {
|
|
|
23
23
|
video,
|
|
24
24
|
videoClassName,
|
|
25
25
|
height,
|
|
26
|
+
metrika,
|
|
26
27
|
analyticsEvents,
|
|
27
28
|
playVideo,
|
|
28
29
|
previewImg,
|
|
@@ -65,6 +66,7 @@ export const Media = (props) => {
|
|
|
65
66
|
qaAttributes.video,
|
|
66
67
|
onImageLoad,
|
|
67
68
|
videoClassName,
|
|
69
|
+
metrika,
|
|
68
70
|
analyticsEvents,
|
|
69
71
|
playVideo,
|
|
70
72
|
previewImg,
|
|
@@ -6,7 +6,7 @@ import ReactPlayerBlock from '../../ReactPlayer/ReactPlayer';
|
|
|
6
6
|
import './Video.css';
|
|
7
7
|
const b = block('media-component-video');
|
|
8
8
|
const Video = (props) => {
|
|
9
|
-
const { video, height, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, qa, ratio, } = props;
|
|
9
|
+
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, qa, ratio, } = props;
|
|
10
10
|
const qaAttributes = getQaAttrubutes(qa, 'source');
|
|
11
11
|
const ref = useRef(null);
|
|
12
12
|
useEffect(() => {
|
|
@@ -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, { 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 }));
|
|
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,
|
|
@@ -39,6 +39,7 @@ const Video = (props) => {
|
|
|
39
39
|
playVideo,
|
|
40
40
|
commonPlayButton,
|
|
41
41
|
customBarControlsClassName,
|
|
42
|
+
metrika,
|
|
42
43
|
analyticsEvents,
|
|
43
44
|
ratio,
|
|
44
45
|
]);
|
|
@@ -2,7 +2,7 @@ import React, { createRef } from 'react';
|
|
|
2
2
|
import debounce from 'lodash/debounce';
|
|
3
3
|
import { ToggleArrow } from '..';
|
|
4
4
|
import { block } from '../../utils';
|
|
5
|
-
import
|
|
5
|
+
import i18n from './i18n';
|
|
6
6
|
import './OverflowScroller.css';
|
|
7
7
|
const b = block('overflow-scroller');
|
|
8
8
|
const TRANSITION_TIME = 300;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
2
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NAMESPACE } from '../../../utils/cn';
|
|
1
|
+
import { registerKeyset } from '../../../utils/registerKeyset';
|
|
3
2
|
import en from './en.json';
|
|
4
3
|
import ru from './ru.json';
|
|
5
|
-
|
|
4
|
+
const COMPONENT = 'OverflowScroller';
|
|
5
|
+
export default registerKeyset({ en, ru }, COMPONENT);
|
|
@@ -6,7 +6,7 @@ import { Unmute } from '../../icons/Unmute';
|
|
|
6
6
|
import { CustomControlsType } from '../../models';
|
|
7
7
|
import { block } from '../../utils';
|
|
8
8
|
import CircleProgress from './CircleProgress';
|
|
9
|
-
import
|
|
9
|
+
import i18n from './i18n';
|
|
10
10
|
import './CustomBarControls.css';
|
|
11
11
|
const b = block('CustomBarControls');
|
|
12
12
|
const playIconsMap = {
|
|
@@ -2,6 +2,7 @@ import React, { Fragment, useCallback, useContext, useEffect, useImperativeHandl
|
|
|
2
2
|
import { Icon } from '@gravity-ui/uikit';
|
|
3
3
|
import debounce from 'lodash/debounce';
|
|
4
4
|
import ReactPlayer from 'react-player';
|
|
5
|
+
import { MetrikaContext } from '../../context/metrikaContext';
|
|
5
6
|
import { MobileContext } from '../../context/mobileContext';
|
|
6
7
|
import { VideoContext } from '../../context/videoContext';
|
|
7
8
|
import { useAnalytics, useMount } from '../../hooks';
|
|
@@ -9,15 +10,17 @@ import { PlayVideo } from '../../icons';
|
|
|
9
10
|
import { CustomControlsButtonPositioning, CustomControlsType, DefaultEventNames, MediaVideoControlsType, PlayButtonThemes, PlayButtonType, PredefinedEventTypes, } from '../../models';
|
|
10
11
|
import { block } from '../../utils';
|
|
11
12
|
import CustomBarControls from './CustomBarControls';
|
|
12
|
-
import
|
|
13
|
+
import i18n from './i18n';
|
|
13
14
|
import { checkYoutubeVideos } from './utils';
|
|
15
|
+
import { isYoutubePlayerInstance } from './utils/youtube';
|
|
14
16
|
import './ReactPlayer.css';
|
|
15
17
|
const b = block('ReactPlayer');
|
|
16
18
|
const FPS = 60;
|
|
17
19
|
// eslint-disable-next-line react/display-name
|
|
18
20
|
export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
19
21
|
const isMobile = useContext(MobileContext);
|
|
20
|
-
const {
|
|
22
|
+
const { metrika } = useContext(MetrikaContext);
|
|
23
|
+
const { src, previewImgUrl, loop = false, controls = MediaVideoControlsType.Default, customControlsOptions = {}, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, ariaLabel, ratio, } = props;
|
|
21
24
|
const { type = PlayButtonType.Default, theme = PlayButtonThemes.Blue, text, className: buttonClassName, } = playButton || {};
|
|
22
25
|
const { type: customControlsType = CustomControlsType.WithMuteButton, muteButtonShown, positioning = CustomControlsButtonPositioning.Center, } = customControlsOptions;
|
|
23
26
|
const autoPlay = Boolean(!isMobile && !previewImgUrl && props.autoplay);
|
|
@@ -47,8 +50,15 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
47
50
|
if (!playerRef) {
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
53
|
+
let play, pause, addEventListener;
|
|
50
54
|
const videoInstance = playerRef.getInternalPlayer();
|
|
51
|
-
|
|
55
|
+
if (isYoutubePlayerInstance(videoInstance)) {
|
|
56
|
+
({ pauseVideo: pause, playVideo: play, addEventListener } = videoInstance);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// it is assumed that `videoInstance` is HTMLVideoElement by default
|
|
60
|
+
({ play, pause, addEventListener } = videoInstance);
|
|
61
|
+
}
|
|
52
62
|
// eslint-disable-next-line consistent-return
|
|
53
63
|
return {
|
|
54
64
|
play: play.bind(videoInstance),
|
|
@@ -123,6 +133,13 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
123
133
|
playerRef.seekTo(0);
|
|
124
134
|
setPlayedPercent(0);
|
|
125
135
|
}
|
|
136
|
+
if (metrika && videoMetrika) {
|
|
137
|
+
const { play, stop, counterName } = videoMetrika;
|
|
138
|
+
const goal = isMuted ? play : stop;
|
|
139
|
+
if (goal) {
|
|
140
|
+
metrika.reachGoals(goal, counterName);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
126
143
|
const events = isMuted ? playEvents : stopEvents;
|
|
127
144
|
handleAnalytics(events);
|
|
128
145
|
if (isMuted) {
|
|
@@ -130,12 +147,27 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
130
147
|
}
|
|
131
148
|
// In order to the progress bar to update (equals 0) before displaying
|
|
132
149
|
setTimeout(() => setMuted(!isMuted), 0);
|
|
133
|
-
}, [
|
|
150
|
+
}, [
|
|
151
|
+
playerRef,
|
|
152
|
+
customControlsType,
|
|
153
|
+
metrika,
|
|
154
|
+
videoMetrika,
|
|
155
|
+
playEvents,
|
|
156
|
+
stopEvents,
|
|
157
|
+
handleAnalytics,
|
|
158
|
+
setProps,
|
|
159
|
+
]);
|
|
134
160
|
const handleClickPreview = useCallback(() => {
|
|
135
161
|
setIsPlaying(true);
|
|
136
162
|
onClickPreview === null || onClickPreview === void 0 ? void 0 : onClickPreview();
|
|
163
|
+
if (metrika && videoMetrika) {
|
|
164
|
+
const { play, counterName } = videoMetrika;
|
|
165
|
+
if (play) {
|
|
166
|
+
metrika.reachGoals(play, counterName);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
137
169
|
handleAnalytics(playEvents);
|
|
138
|
-
}, [onClickPreview, handleAnalytics, playEvents]);
|
|
170
|
+
}, [onClickPreview, metrika, videoMetrika, handleAnalytics, playEvents]);
|
|
139
171
|
const onPause = useCallback(() => {
|
|
140
172
|
// For support correct state for youtube
|
|
141
173
|
if (controls !== MediaVideoControlsType.Custom ||
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
2
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NAMESPACE } from '../../../utils/cn';
|
|
1
|
+
import { registerKeyset } from '../../../utils/registerKeyset';
|
|
3
2
|
import en from './en.json';
|
|
4
3
|
import ru from './ru.json';
|
|
5
|
-
|
|
4
|
+
const COMPONENT = 'ReactPlayer';
|
|
5
|
+
export default registerKeyset({ en, ru }, COMPONENT);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
|
-
import
|
|
3
|
+
import i18n from './i18n';
|
|
4
4
|
import './UnpublishedLabel.css';
|
|
5
5
|
const b = block('unpublished-label');
|
|
6
6
|
const UnpublishedLabel = ({ className, children, type = 'line', }) => (React.createElement("div", { className: b({ type }, className) }, children || i18n('label_non_published')));
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
2
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NAMESPACE } from '../../../utils/cn';
|
|
1
|
+
import { registerKeyset } from '../../../utils/registerKeyset';
|
|
3
2
|
import en from './en.json';
|
|
4
3
|
import ru from './ru.json';
|
|
5
|
-
|
|
4
|
+
const COMPONENT = 'UnpublishedLabel';
|
|
5
|
+
export default registerKeyset({ en, ru }, COMPONENT);
|
|
@@ -7,7 +7,7 @@ import { PlayVideo } from '../../icons';
|
|
|
7
7
|
import { DefaultEventNames } from '../../models/common';
|
|
8
8
|
import { block, getPageSearchParams } from '../../utils';
|
|
9
9
|
import Image from '../Image/Image';
|
|
10
|
-
import
|
|
10
|
+
import i18n from './i18n';
|
|
11
11
|
import './VideoBlock.css';
|
|
12
12
|
const RECORD_URL = 'https://www.youtube.com/embed/';
|
|
13
13
|
const STREAM_URL = 'https://www.youtube.com/embed/live_stream?channel=';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
2
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NAMESPACE } from '../../../utils/cn';
|
|
1
|
+
import { registerKeyset } from '../../../utils/registerKeyset';
|
|
3
2
|
import en from './en.json';
|
|
4
3
|
import ru from './ru.json';
|
|
5
|
-
|
|
4
|
+
const COMPONENT = 'VideoBlock';
|
|
5
|
+
export default registerKeyset({ en, ru }, COMPONENT);
|
|
@@ -2,6 +2,7 @@ import React, { useCallback, useContext, useEffect, useRef } from 'react';
|
|
|
2
2
|
import { LocaleContext } from '../../context/localeContext';
|
|
3
3
|
import { MobileContext } from '../../context/mobileContext';
|
|
4
4
|
import { useAnalytics } from '../../hooks';
|
|
5
|
+
import { useMetrika } from '../../hooks/useMetrika';
|
|
5
6
|
import { DefaultEventNames } from '../../models/common';
|
|
6
7
|
import { block } from '../../utils';
|
|
7
8
|
import { HEADER_HEIGHT } from '../constants';
|
|
@@ -10,11 +11,12 @@ export const YANDEX_FORM_SECTION = 'surveys';
|
|
|
10
11
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
11
12
|
const b = block('yandex-form');
|
|
12
13
|
const YandexForm = (props) => {
|
|
13
|
-
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, analyticsEvents, customFormOrigin, customFormSection, } = props;
|
|
14
|
+
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, customFormSection, } = props;
|
|
14
15
|
const formContainerRef = useRef(null);
|
|
15
16
|
const iframeRef = useRef();
|
|
16
17
|
const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;
|
|
17
18
|
const yaFormSection = customFormSection || YANDEX_FORM_SECTION;
|
|
19
|
+
const handleMetrika = useMetrika();
|
|
18
20
|
const handleAnalytics = useAnalytics(DefaultEventNames.YandexFormSubmit);
|
|
19
21
|
const isMobile = useContext(MobileContext);
|
|
20
22
|
const locale = useContext(LocaleContext);
|
|
@@ -56,11 +58,20 @@ const YandexForm = (props) => {
|
|
|
56
58
|
const { top } = formContainerRef.current.getBoundingClientRect();
|
|
57
59
|
window.scrollBy(0, top - headerHeight);
|
|
58
60
|
}
|
|
61
|
+
handleMetrika({ metrikaGoals, pixelEvents });
|
|
59
62
|
handleAnalytics(analyticsEvents);
|
|
60
63
|
if (onSubmit) {
|
|
61
64
|
onSubmit();
|
|
62
65
|
}
|
|
63
|
-
}, [
|
|
66
|
+
}, [
|
|
67
|
+
handleMetrika,
|
|
68
|
+
metrikaGoals,
|
|
69
|
+
pixelEvents,
|
|
70
|
+
handleAnalytics,
|
|
71
|
+
analyticsEvents,
|
|
72
|
+
onSubmit,
|
|
73
|
+
headerHeight,
|
|
74
|
+
]);
|
|
64
75
|
const handleMessage = useCallback(({ origin, data }) => {
|
|
65
76
|
if (origin !== yaFormOrigin) {
|
|
66
77
|
return;
|
|
@@ -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>;
|
|
@@ -2,7 +2,7 @@ import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, Exten
|
|
|
2
2
|
import { BlockType, NavigationItemType, SubBlockType } from './models';
|
|
3
3
|
import { GithubButton, NavigationButton, NavigationDropdown, NavigationLink, } from './navigation/components/NavigationItem';
|
|
4
4
|
import SocialIcon from './navigation/components/SocialIcon/SocialIcon';
|
|
5
|
-
import { BackgroundCard, BannerCard, BasicCard, Content, Divider, LayoutItem, MediaCard, PriceCard, PriceDetailed, Quote, } from './sub-blocks';
|
|
5
|
+
import { BackgroundCard, BannerCard, BasicCard, Content, Divider, ImageCard, LayoutItem, MediaCard, PriceCard, PriceDetailed, Quote, } from './sub-blocks';
|
|
6
6
|
export const blockMap = {
|
|
7
7
|
[BlockType.SliderBlock]: SliderBlock,
|
|
8
8
|
[BlockType.ExtendedFeaturesBlock]: ExtendedFeaturesBlock,
|
|
@@ -35,6 +35,7 @@ export const subBlockMap = {
|
|
|
35
35
|
[SubBlockType.Content]: Content,
|
|
36
36
|
[SubBlockType.Quote]: Quote,
|
|
37
37
|
[SubBlockType.PriceCard]: PriceCard,
|
|
38
|
+
[SubBlockType.ImageCard]: ImageCard,
|
|
38
39
|
};
|
|
39
40
|
export const navItemMap = {
|
|
40
41
|
[NavigationItemType.Button]: NavigationButton,
|
|
@@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|
|
2
2
|
import { Spin } from '@gravity-ui/uikit';
|
|
3
3
|
import ErrorWrapper from '../../components/ErrorWrapper/ErrorWrapper';
|
|
4
4
|
import { block as blockCn } from '../../utils/cn';
|
|
5
|
-
import
|
|
5
|
+
import i18n from './i18n';
|
|
6
6
|
import './Loadable.css';
|
|
7
7
|
const b = blockCn('loadable-block');
|
|
8
8
|
const initData = {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
2
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NAMESPACE } from '../../../utils/cn';
|
|
1
|
+
import { registerKeyset } from '../../../utils/registerKeyset';
|
|
3
2
|
import en from './en.json';
|
|
4
3
|
import ru from './ru.json';
|
|
5
|
-
|
|
4
|
+
const COMPONENT = 'Loadable';
|
|
5
|
+
export default registerKeyset({ en, ru }, COMPONENT);
|
|
@@ -3,6 +3,7 @@ import { ImageContextProps } from '../../context/imageContext';
|
|
|
3
3
|
import { LocaleContextProps } from '../../context/localeContext';
|
|
4
4
|
import { LocationContextProps } from '../../context/locationContext';
|
|
5
5
|
import { MapsContextType } from '../../context/mapsContext/mapsContext';
|
|
6
|
+
import { MetrikaContextProps } from '../../context/metrikaContext';
|
|
6
7
|
import { ProjectSettingsContextProps } from '../../context/projectSettingsContext';
|
|
7
8
|
import { SSRContextProps } from '../../context/ssrContext';
|
|
8
9
|
import { Theme, WithChildren } from '../../models';
|
|
@@ -10,6 +11,7 @@ export interface PageConstructorProviderProps {
|
|
|
10
11
|
isMobile?: boolean;
|
|
11
12
|
locale?: LocaleContextProps;
|
|
12
13
|
location?: LocationContextProps;
|
|
14
|
+
metrika?: MetrikaContextProps;
|
|
13
15
|
ssrConfig?: SSRContextProps;
|
|
14
16
|
theme?: Theme;
|
|
15
17
|
mapsContext?: MapsContextType;
|
|
@@ -5,12 +5,13 @@ import { ImageContext } from '../../context/imageContext';
|
|
|
5
5
|
import { LocaleContext } from '../../context/localeContext';
|
|
6
6
|
import { LocationContext } from '../../context/locationContext';
|
|
7
7
|
import { MapsContext, initialMapValue } from '../../context/mapsContext/mapsContext';
|
|
8
|
+
import { MetrikaContext } from '../../context/metrikaContext';
|
|
8
9
|
import { MobileContext } from '../../context/mobileContext';
|
|
9
10
|
import { ProjectSettingsContext, } from '../../context/projectSettingsContext';
|
|
10
11
|
import { SSRContext } from '../../context/ssrContext';
|
|
11
12
|
import { ThemeContext } from '../../context/theme';
|
|
12
13
|
export const PageConstructorProvider = (props) => {
|
|
13
|
-
const { isMobile, mapsContext = initialMapValue, locale = {}, location = {}, analytics = {}, ssrConfig = {}, projectSettings = {}, theme = DEFAULT_THEME, children, image = {}, } = props;
|
|
14
|
+
const { isMobile, mapsContext = initialMapValue, locale = {}, location = {}, metrika = {}, analytics = {}, ssrConfig = {}, projectSettings = {}, theme = DEFAULT_THEME, children, image = {}, } = props;
|
|
14
15
|
/* eslint-disable react/jsx-key */
|
|
15
16
|
const context = [
|
|
16
17
|
React.createElement(ThemeContext.Provider, { value: { theme } }),
|
|
@@ -20,6 +21,7 @@ export const PageConstructorProvider = (props) => {
|
|
|
20
21
|
React.createElement(LocationContext.Provider, { value: location }),
|
|
21
22
|
React.createElement(MobileContext.Provider, { value: Boolean(isMobile) }),
|
|
22
23
|
React.createElement(MapsContext.Provider, { value: mapsContext }),
|
|
24
|
+
React.createElement(MetrikaContext.Provider, { value: metrika }),
|
|
23
25
|
React.createElement(AnalyticsContext.Provider, { value: analytics }),
|
|
24
26
|
React.createElement(SSRContext.Provider, { value: { isServer: ssrConfig === null || ssrConfig === void 0 ? void 0 : ssrConfig.isServer } }),
|
|
25
27
|
].reduceRight((prev, provider) => React.cloneElement(provider, {}, prev), children);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Lang } from '
|
|
2
|
+
import { Lang } from '../../utils/configure';
|
|
3
3
|
export type LocaleContextProps = {
|
|
4
|
-
lang?:
|
|
4
|
+
lang?: Lang;
|
|
5
5
|
tld?: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const LocaleContext: React.Context<LocaleContextProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './metrikaContext';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './metrikaContext';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Metrika, Pixel } from '../../models';
|
|
3
|
+
export interface MetrikaContextProps {
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Metrika will be deleted
|
|
6
|
+
*/
|
|
7
|
+
metrika?: Metrika;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Metrika will be deleted
|
|
10
|
+
*/
|
|
11
|
+
pixel?: Pixel;
|
|
12
|
+
}
|
|
13
|
+
export declare const MetrikaContext: React.Context<MetrikaContextProps>;
|
|
@@ -5,7 +5,7 @@ import { Theme, themeNames } from '../../../models';
|
|
|
5
5
|
import { block } from '../../../utils';
|
|
6
6
|
import { Tablet } from '../../icons/Tablet';
|
|
7
7
|
import { ViewModeItem } from '../../types';
|
|
8
|
-
import
|
|
8
|
+
import i18n from './i18n';
|
|
9
9
|
import './ControlPanel.css';
|
|
10
10
|
const ICON_SIZE = 14;
|
|
11
11
|
const b = block('control-panel');
|
|
@@ -27,7 +27,7 @@ const ControlPanel = ({ viewMode = ViewModeItem.Edititng, onViewModeChange, clas
|
|
|
27
27
|
React.createElement(Icon, { width: ICON_SIZE, height: ICON_SIZE }))));
|
|
28
28
|
}))),
|
|
29
29
|
React.createElement("div", { className: b('theme-switch') },
|
|
30
|
-
React.createElement("span", null, i18n('
|
|
30
|
+
React.createElement("span", null, i18n('Theme')),
|
|
31
31
|
React.createElement(Select, { value: [theme], onUpdate: (value) => onThemeChange(value[0]) }, Object.values(Theme).map((item) => (React.createElement(Select.Option, { key: item, value: item }, themeNames[item])))))));
|
|
32
32
|
};
|
|
33
33
|
export default ControlPanel;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
2
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NAMESPACE } from '../../../../utils/cn';
|
|
1
|
+
import { registerKeyset } from '../../../../utils/registerKeyset';
|
|
3
2
|
import en from './en.json';
|
|
4
3
|
import ru from './ru.json';
|
|
5
|
-
|
|
4
|
+
const COMPONENT = 'ControlPanel';
|
|
5
|
+
export default registerKeyset({ en, ru }, COMPONENT);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { block } from '../../../utils';
|
|
3
3
|
import { getBlockId } from '../../utils';
|
|
4
|
-
import
|
|
4
|
+
import i18n from './i18n';
|
|
5
5
|
import './ErrorBoundary.css';
|
|
6
6
|
const b = block('error-boundary');
|
|
7
7
|
export class ErrorBoundary extends React.Component {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
2
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NAMESPACE } from '../../../../utils/cn';
|
|
1
|
+
import { registerKeyset } from '../../../../utils/registerKeyset';
|
|
3
2
|
import en from './en.json';
|
|
4
3
|
import ru from './ru.json';
|
|
5
|
-
|
|
4
|
+
const COMPONENT = 'ErrorBoundary';
|
|
5
|
+
export default registerKeyset({ en, ru }, COMPONENT);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import { BlockBase } from '../../../components';
|
|
3
3
|
import { block } from '../../../utils';
|
|
4
|
-
import
|
|
4
|
+
import i18n from './i18n';
|
|
5
5
|
import './NotFoundBlock.css';
|
|
6
6
|
const b = block('not-found-block');
|
|
7
7
|
export const NotFoundBlock = ({ type, children }) => children ? (React.createElement(Fragment, null, children)) : (React.createElement(BlockBase, null,
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
2
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NAMESPACE } from '../../../../utils/cn';
|
|
1
|
+
import { registerKeyset } from '../../../../utils/registerKeyset';
|
|
3
2
|
import en from './en.json';
|
|
4
3
|
import ru from './ru.json';
|
|
5
|
-
|
|
4
|
+
const COMPONENT = 'NotFoundBlock';
|
|
5
|
+
export default registerKeyset({ en, ru }, COMPONENT);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const useAnalytics: (name?: string, target?: string) => (e?:
|
|
1
|
+
import { AnalyticsEvent } from '../models';
|
|
2
|
+
export declare const useAnalytics: (name?: string, target?: string) => (e?: AnalyticsEvent | AnalyticsEvent[] | null, additionalContext?: Record<string, string>) => void;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { ButtonPixel, MetrikaGoal, PixelEvent } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Metrika will be deleted
|
|
4
|
+
*/
|
|
5
|
+
type UseMetrikaProps = {
|
|
6
|
+
metrikaGoals?: MetrikaGoal;
|
|
7
|
+
pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated useMetrika will be deleted
|
|
11
|
+
*/
|
|
12
|
+
export declare const useMetrika: () => ({ metrikaGoals, pixelEvents }: UseMetrikaProps) => void;
|
|
13
|
+
export {};
|
|
@@ -1 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { MetrikaContext } from '../context/metrikaContext';
|
|
3
|
+
import { isNewMetrikaFormat } from '../models/guards';
|
|
4
|
+
// eslint-disable-next-line valid-jsdoc
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Metrika will be deleted, which uses this logic
|
|
7
|
+
*/
|
|
8
|
+
function isButtonPixel(pixelEvents) {
|
|
9
|
+
if (Array.isArray(pixelEvents) && pixelEvents.length && 'name' in pixelEvents) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
// eslint-disable-next-line valid-jsdoc
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated useMetrika will be deleted
|
|
17
|
+
*/
|
|
18
|
+
export const useMetrika = () => {
|
|
19
|
+
const { metrika, pixel } = useContext(MetrikaContext);
|
|
20
|
+
return ({ metrikaGoals, pixelEvents }) => {
|
|
21
|
+
if (metrika && metrikaGoals) {
|
|
22
|
+
if (isNewMetrikaFormat(metrikaGoals)) {
|
|
23
|
+
metrikaGoals.forEach(({ name, isCrossSite }) => metrika.reachGoal(isCrossSite ? 'cross-site' : 'main', name));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
metrika.reachGoals(metrikaGoals);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (pixel && pixelEvents) {
|
|
30
|
+
if (isButtonPixel(pixelEvents)) {
|
|
31
|
+
pixelEvents.forEach(({ name, data }) => pixel.trackStandard(name, data));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
pixel.track(pixelEvents);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { I18N } from '@gravity-ui/i18n';
|
|
2
|
+
import { Lang, getConfig, subscribeConfigure } from './utils/configure';
|
|
3
|
+
export const i18n = new I18N();
|
|
4
|
+
i18n.setLang(getConfig().lang || Lang.En);
|
|
5
|
+
subscribeConfigure((config) => {
|
|
6
|
+
if (config.lang) {
|
|
7
|
+
i18n.setLang(config.lang);
|
|
8
|
+
}
|
|
9
|
+
});
|