@gravity-ui/page-constructor 1.15.0-alpha.1 → 1.15.0-alpha.10
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 +110 -5
- package/build/cjs/blocks/Banner/Banner.js +3 -2
- package/build/cjs/blocks/Banner/schema.d.ts +27 -0
- package/build/cjs/blocks/Banner/schema.js +3 -1
- package/build/cjs/blocks/CardLayout/schema.d.ts +6 -0
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +3 -2
- package/build/cjs/blocks/ContentLayout/schema.d.ts +3 -0
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.d.ts +1 -1
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +3 -2
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +3 -0
- package/build/cjs/blocks/Header/Header.js +6 -5
- package/build/cjs/blocks/Header/schema.d.ts +3 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/cjs/blocks/Icons/schema.d.ts +6 -0
- package/build/cjs/blocks/Info/Info.js +4 -3
- package/build/cjs/blocks/Info/schema.d.ts +3 -0
- package/build/cjs/blocks/Info/schema.js +2 -0
- package/build/cjs/blocks/LinkTable/schema.d.ts +3 -0
- package/build/cjs/blocks/Media/Media.js +3 -2
- package/build/cjs/blocks/Media/MediaContent.js +3 -2
- package/build/cjs/blocks/Media/schema.d.ts +9 -0
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +2 -1
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +3 -2
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +1 -0
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +3 -2
- package/build/cjs/blocks/Preview/Preview.js +3 -2
- package/build/cjs/blocks/Preview/schema.d.ts +3 -0
- package/build/cjs/blocks/Preview/schema.js +3 -1
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +3 -2
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/cjs/blocks/Questions/Questions.js +3 -2
- package/build/cjs/blocks/Questions/schema.d.ts +3 -0
- package/build/cjs/blocks/Security/Security.js +3 -2
- package/build/cjs/blocks/Security/schema.d.ts +3 -0
- package/build/cjs/blocks/Security/schema.js +3 -1
- package/build/cjs/blocks/Share/Share.d.ts +1 -1
- package/build/cjs/blocks/Share/Share.js +10 -2
- package/build/cjs/blocks/Simple/schema.d.ts +3 -0
- package/build/cjs/blocks/Slider/schema.d.ts +3 -0
- package/build/cjs/blocks/Table/schema.d.ts +3 -0
- package/build/cjs/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/cjs/blocks/Tabs/Tabs.js +5 -4
- package/build/cjs/blocks/Tabs/schema.d.ts +3 -0
- package/build/cjs/components/BackLink/BackLink.d.ts +1 -0
- package/build/cjs/components/BackLink/BackLink.js +11 -2
- package/build/cjs/components/BackgroundMedia/BackgroundMedia.js +2 -1
- package/build/cjs/components/Button/Button.d.ts +1 -0
- package/build/cjs/components/Button/Button.js +8 -2
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +1 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.js +11 -2
- package/build/cjs/components/CardBase/CardBase.d.ts +3 -2
- package/build/cjs/components/CardBase/CardBase.js +8 -2
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +8 -2
- package/build/cjs/components/Link/Link.js +9 -3
- package/build/cjs/components/Media/Media.js +4 -2
- package/build/cjs/components/Media/Video/Video.js +5 -3
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +14 -26
- package/build/cjs/components/YandexForm/YandexForm.d.ts +3 -2
- package/build/cjs/components/YandexForm/YandexForm.js +9 -3
- package/build/cjs/constructor-items.d.ts +5 -5
- package/build/cjs/context/analyticsContext/analyticsContext.d.ts +3 -2
- package/build/cjs/hooks/useAnalytics.d.ts +2 -2
- package/build/cjs/hooks/useAnalytics.js +9 -4
- package/build/cjs/models/common.d.ts +7 -9
- package/build/cjs/models/common.js +7 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +11 -0
- package/build/cjs/models/constructor-items/common.d.ts +11 -6
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +6 -3
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +3 -2
- package/build/cjs/schema/validators/common.d.ts +15 -0
- package/build/cjs/schema/validators/common.js +3 -1
- package/build/cjs/schema/validators/event.d.ts +3 -54
- package/build/cjs/schema/validators/event.js +3 -54
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +3 -2
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +3 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +2 -0
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +3 -2
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +3 -2
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +1 -1
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +3 -2
- package/build/cjs/sub-blocks/Content/Content.js +4 -3
- package/build/cjs/sub-blocks/HubspotForm/index.js +7 -2
- package/build/cjs/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
- package/build/cjs/sub-blocks/MediaCard/MediaCard.js +3 -2
- package/build/cjs/sub-blocks/Quote/Quote.js +9 -2
- package/build/cjs/sub-blocks/Quote/schema.d.ts +3 -0
- package/build/cjs/sub-blocks/Quote/schema.js +3 -1
- package/build/esm/blocks/Banner/Banner.js +3 -2
- package/build/esm/blocks/Banner/schema.d.ts +27 -0
- package/build/esm/blocks/Banner/schema.js +3 -1
- package/build/esm/blocks/CardLayout/schema.d.ts +6 -0
- package/build/esm/blocks/ContentLayout/ContentLayout.js +3 -2
- package/build/esm/blocks/ContentLayout/schema.d.ts +3 -0
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.d.ts +1 -1
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +3 -2
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +3 -0
- package/build/esm/blocks/Header/Header.js +6 -5
- package/build/esm/blocks/Header/schema.d.ts +3 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/esm/blocks/Icons/schema.d.ts +6 -0
- package/build/esm/blocks/Info/Info.js +4 -3
- package/build/esm/blocks/Info/schema.d.ts +3 -0
- package/build/esm/blocks/Info/schema.js +2 -0
- package/build/esm/blocks/LinkTable/schema.d.ts +3 -0
- package/build/esm/blocks/Media/Media.js +3 -2
- package/build/esm/blocks/Media/MediaContent.js +3 -2
- package/build/esm/blocks/Media/schema.d.ts +9 -0
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +2 -1
- package/build/esm/blocks/Preview/MediaContent/MediaContent.js +3 -2
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +1 -0
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +3 -2
- package/build/esm/blocks/Preview/Preview.js +3 -2
- package/build/esm/blocks/Preview/schema.d.ts +3 -0
- package/build/esm/blocks/Preview/schema.js +3 -1
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +3 -2
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/esm/blocks/Questions/Questions.js +3 -2
- package/build/esm/blocks/Questions/schema.d.ts +3 -0
- package/build/esm/blocks/Security/Security.js +3 -2
- package/build/esm/blocks/Security/schema.d.ts +3 -0
- package/build/esm/blocks/Security/schema.js +3 -1
- package/build/esm/blocks/Share/Share.d.ts +1 -1
- package/build/esm/blocks/Share/Share.js +11 -3
- package/build/esm/blocks/Simple/schema.d.ts +3 -0
- package/build/esm/blocks/Slider/schema.d.ts +3 -0
- package/build/esm/blocks/Table/schema.d.ts +3 -0
- package/build/esm/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/esm/blocks/Tabs/Tabs.js +5 -4
- package/build/esm/blocks/Tabs/schema.d.ts +3 -0
- package/build/esm/components/BackLink/BackLink.d.ts +1 -0
- package/build/esm/components/BackLink/BackLink.js +11 -2
- package/build/esm/components/BackgroundMedia/BackgroundMedia.js +2 -1
- package/build/esm/components/Button/Button.d.ts +1 -0
- package/build/esm/components/Button/Button.js +8 -2
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +1 -0
- package/build/esm/components/ButtonTabs/ButtonTabs.js +11 -2
- package/build/esm/components/CardBase/CardBase.d.ts +3 -2
- package/build/esm/components/CardBase/CardBase.js +8 -2
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +8 -2
- package/build/esm/components/Link/Link.js +9 -3
- package/build/esm/components/Media/Media.js +4 -2
- package/build/esm/components/Media/Video/Video.js +5 -3
- package/build/esm/components/ReactPlayer/ReactPlayer.js +15 -27
- package/build/esm/components/YandexForm/YandexForm.d.ts +3 -2
- package/build/esm/components/YandexForm/YandexForm.js +9 -3
- package/build/esm/constructor-items.d.ts +5 -5
- package/build/esm/context/analyticsContext/analyticsContext.d.ts +3 -2
- package/build/esm/hooks/useAnalytics.d.ts +2 -2
- package/build/esm/hooks/useAnalytics.js +9 -4
- package/build/esm/models/common.d.ts +7 -9
- package/build/esm/models/common.js +6 -0
- package/build/esm/models/constructor-items/blocks.d.ts +11 -0
- package/build/esm/models/constructor-items/common.d.ts +11 -6
- package/build/esm/models/constructor-items/sub-blocks.d.ts +6 -3
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +3 -2
- package/build/esm/schema/validators/common.d.ts +15 -0
- package/build/esm/schema/validators/common.js +4 -2
- package/build/esm/schema/validators/event.d.ts +3 -54
- package/build/esm/schema/validators/event.js +2 -53
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +3 -2
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +3 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.js +2 -0
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +3 -2
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +3 -2
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +1 -1
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +3 -2
- package/build/esm/sub-blocks/Content/Content.js +4 -3
- package/build/esm/sub-blocks/HubspotForm/index.js +7 -2
- package/build/esm/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
- package/build/esm/sub-blocks/MediaCard/MediaCard.js +3 -2
- package/build/esm/sub-blocks/Quote/Quote.js +11 -4
- package/build/esm/sub-blocks/Quote/schema.d.ts +3 -0
- package/build/esm/sub-blocks/Quote/schema.js +3 -1
- package/package.json +1 -1
- package/server/models/common.d.ts +7 -9
- package/server/models/common.js +7 -1
- package/server/models/constructor-items/blocks.d.ts +11 -0
- package/server/models/constructor-items/common.d.ts +11 -6
- package/server/models/constructor-items/sub-blocks.d.ts +6 -3
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
|
+
import { PredefinedEventTypes } from '../../models';
|
|
3
4
|
import { Button } from '../index';
|
|
5
|
+
import { useAnalytics } from '../../hooks';
|
|
4
6
|
import './ButtonTabs.css';
|
|
5
7
|
const b = block('button-tabs');
|
|
8
|
+
const COMPONENT_NAME = 'button-tabs';
|
|
6
9
|
const ButtonTabs = (props) => {
|
|
7
|
-
const { className, items, activeTab, onSelectTab } = props;
|
|
10
|
+
const { className, items, activeTab, onSelectTab, blockName = COMPONENT_NAME } = props;
|
|
11
|
+
const handleAnalytics = useAnalytics({
|
|
12
|
+
name: 'button-tabs-click',
|
|
13
|
+
type: PredefinedEventTypes.Default,
|
|
14
|
+
blockName: blockName,
|
|
15
|
+
});
|
|
8
16
|
const activeTabId = useMemo(() => {
|
|
9
17
|
if (activeTab) {
|
|
10
18
|
return activeTab;
|
|
@@ -12,10 +20,11 @@ const ButtonTabs = (props) => {
|
|
|
12
20
|
return items[0].id;
|
|
13
21
|
}, [activeTab, items]);
|
|
14
22
|
const handleClick = useCallback((tabId) => {
|
|
23
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics();
|
|
15
24
|
if (onSelectTab) {
|
|
16
25
|
onSelectTab(tabId);
|
|
17
26
|
}
|
|
18
|
-
}, [onSelectTab]);
|
|
27
|
+
}, [handleAnalytics, onSelectTab]);
|
|
19
28
|
return (React.createElement("div", { className: b(null, className) }, items.map((item) => {
|
|
20
29
|
const isActive = item.id === activeTabId;
|
|
21
30
|
return (React.createElement(Button, { text: item.title, className: b('item', { active: isActive }), key: item.title, size: 'l', onClick: () => handleClick(item.id), theme: isActive ? 'monochrome' : 'normal' }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement, HTMLAttributeAnchorTarget } from 'react';
|
|
2
2
|
import { ButtonPixel, CardBaseProps as CardBaseParams, ImageProps, MetrikaGoal, WithChildren } from '../../models';
|
|
3
|
-
import {
|
|
3
|
+
import { AnalyticsEvent } from '../../models/common';
|
|
4
4
|
import './CardBase.css';
|
|
5
5
|
export interface CardBaseProps extends CardBaseParams {
|
|
6
6
|
className?: string;
|
|
@@ -11,7 +11,8 @@ export interface CardBaseProps extends CardBaseParams {
|
|
|
11
11
|
target?: HTMLAttributeAnchorTarget;
|
|
12
12
|
metrikaGoals?: MetrikaGoal;
|
|
13
13
|
pixelEvents?: ButtonPixel;
|
|
14
|
-
analyticsEvents?:
|
|
14
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
15
|
+
blockName?: string;
|
|
15
16
|
}
|
|
16
17
|
export interface CardHeaderBaseProps {
|
|
17
18
|
className?: string;
|
|
@@ -3,16 +3,22 @@ import { block } from '../../utils';
|
|
|
3
3
|
import BackgroundImage from '../BackgroundImage/BackgroundImage';
|
|
4
4
|
import RouterLink from '../RouterLink/RouterLink';
|
|
5
5
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
6
|
+
import { PredefinedEventTypes } from '../../models/common';
|
|
6
7
|
import { useAnalytics } from '../../hooks';
|
|
7
8
|
import './CardBase.css';
|
|
9
|
+
const COMPONENT_NAME = 'card-base';
|
|
8
10
|
const b = block('card-base-block');
|
|
9
11
|
const Header = () => null;
|
|
10
12
|
const Content = () => null;
|
|
11
13
|
const Footer = () => null;
|
|
12
14
|
export const Layout = (props) => {
|
|
13
|
-
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', } = props;
|
|
15
|
+
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', blockName = COMPONENT_NAME, } = props;
|
|
14
16
|
const handleMetrika = useMetrika();
|
|
15
|
-
const handleAnalytics = useAnalytics(
|
|
17
|
+
const handleAnalytics = useAnalytics({
|
|
18
|
+
name: 'card-base-click',
|
|
19
|
+
type: PredefinedEventTypes.Default,
|
|
20
|
+
blockName: blockName,
|
|
21
|
+
});
|
|
16
22
|
let header, content, footer, image, headerClass, footerClass;
|
|
17
23
|
function handleChild(child) {
|
|
18
24
|
switch (child.type) {
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
|
+
import { PredefinedEventTypes } from '../../models';
|
|
3
4
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
4
5
|
import { useAnalytics } from '../../hooks';
|
|
5
6
|
import './HeaderBreadcrumbs.css';
|
|
6
7
|
const b = block('header-breadcrumbs');
|
|
8
|
+
const COMPONENT_NAME = 'header-breadcrumbs';
|
|
7
9
|
export default function HeaderBreadcrumbs(props) {
|
|
8
|
-
const { items, metrikaGoals, pixelEvents, analyticsEvents, theme = 'light', className } = props;
|
|
10
|
+
const { items, metrikaGoals, pixelEvents, analyticsEvents, theme = 'light', blockName = COMPONENT_NAME, className, } = props;
|
|
9
11
|
const handleMetrika = useMetrika();
|
|
10
|
-
const handleAnalytics = useAnalytics(
|
|
12
|
+
const handleAnalytics = useAnalytics({
|
|
13
|
+
name: 'header-breadcrumbs-click',
|
|
14
|
+
type: PredefinedEventTypes.Default,
|
|
15
|
+
blockName: blockName,
|
|
16
|
+
});
|
|
11
17
|
const onClick = () => {
|
|
12
18
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
13
19
|
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Fragment, useContext } from 'react';
|
|
2
2
|
import { Icon } from '@gravity-ui/uikit';
|
|
3
3
|
import { block, getLinkProps, setUrlTld } from '../../utils';
|
|
4
|
+
import { PredefinedEventTypes, } from '../../models';
|
|
4
5
|
import { Chevron } from '../../icons';
|
|
5
6
|
import FileLink from '../FileLink/FileLink';
|
|
6
7
|
import BackLink from '../BackLink/BackLink';
|
|
@@ -11,6 +12,7 @@ import { useAnalytics } from '../../hooks';
|
|
|
11
12
|
import './Link.css';
|
|
12
13
|
const b = block('link-block');
|
|
13
14
|
const WORD_JOINER_SYM = '\u200b';
|
|
15
|
+
const COMPONENT_NAME = 'link';
|
|
14
16
|
function getArrowSize(size) {
|
|
15
17
|
switch (size) {
|
|
16
18
|
case 'l':
|
|
@@ -24,9 +26,13 @@ function getArrowSize(size) {
|
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
const LinkBlock = (props) => {
|
|
27
|
-
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, } = props;
|
|
29
|
+
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, blockName = COMPONENT_NAME, } = props;
|
|
28
30
|
const handleMetrika = useMetrika();
|
|
29
|
-
const handleAnalytics = useAnalytics(
|
|
31
|
+
const handleAnalytics = useAnalytics({
|
|
32
|
+
name: 'link-click',
|
|
33
|
+
type: PredefinedEventTypes.Default,
|
|
34
|
+
blockName: blockName,
|
|
35
|
+
});
|
|
30
36
|
const { hostname } = useContext(LocationContext);
|
|
31
37
|
const { tld } = useContext(LocaleContext);
|
|
32
38
|
const href = setUrlTld(props.url, tld);
|
|
@@ -38,7 +44,7 @@ const LinkBlock = (props) => {
|
|
|
38
44
|
const getLinkByType = () => {
|
|
39
45
|
switch (theme) {
|
|
40
46
|
case 'back':
|
|
41
|
-
return React.createElement(BackLink, { title: children || text, url: href, onClick: onClick });
|
|
47
|
+
return (React.createElement(BackLink, { title: children || text, url: href, onClick: onClick, blockName: blockName }));
|
|
42
48
|
case 'file-link':
|
|
43
49
|
case 'underline':
|
|
44
50
|
return (React.createElement(FileLink, { text: children || text, href: href, type: "horizontal", textSize: textSize, onClick: onClick }));
|
|
@@ -6,9 +6,10 @@ import Video from './Video/Video';
|
|
|
6
6
|
import YoutubeBlock from '../VideoBlock/VideoBlock';
|
|
7
7
|
import './Media.css';
|
|
8
8
|
const b = block('Media');
|
|
9
|
+
const COMPONENT_NAME = 'media-component';
|
|
9
10
|
export const Media = (props) => {
|
|
10
11
|
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, analyticsEvents, } = props;
|
|
11
|
-
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, } = props;
|
|
12
|
+
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, blockName = COMPONENT_NAME, } = props;
|
|
12
13
|
const [hasVideoFallback, setHasVideoFallback] = useState(false);
|
|
13
14
|
const content = useMemo(() => {
|
|
14
15
|
let result = [];
|
|
@@ -16,7 +17,7 @@ export const Media = (props) => {
|
|
|
16
17
|
result.push(React.createElement(Image, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback }));
|
|
17
18
|
}
|
|
18
19
|
if (video) {
|
|
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
|
+
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, blockName: blockName }));
|
|
20
21
|
}
|
|
21
22
|
if (youtube) {
|
|
22
23
|
result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height }));
|
|
@@ -42,6 +43,7 @@ export const Media = (props) => {
|
|
|
42
43
|
previewImg,
|
|
43
44
|
playButton,
|
|
44
45
|
customBarControlsClassName,
|
|
46
|
+
blockName,
|
|
45
47
|
youtubeClassName,
|
|
46
48
|
]);
|
|
47
49
|
return (React.createElement("div", { className: b(null, className), style: { backgroundColor: color } }, content));
|
|
@@ -5,8 +5,9 @@ import { getVideoTypesWithPriority } from './utils';
|
|
|
5
5
|
import { block } from '../../../utils';
|
|
6
6
|
import './Video.css';
|
|
7
7
|
const b = block('media-component-video');
|
|
8
|
+
const COMPONENT_NAME = 'media-video';
|
|
8
9
|
const Video = (props) => {
|
|
9
|
-
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, } = props;
|
|
10
|
+
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, blockName = COMPONENT_NAME, } = props;
|
|
10
11
|
const ref = useRef(null);
|
|
11
12
|
useEffect(() => {
|
|
12
13
|
if (ref && ref.current) {
|
|
@@ -29,9 +30,10 @@ const Video = (props) => {
|
|
|
29
30
|
}, [playVideo, video, setHasVideoFallback]);
|
|
30
31
|
const reactPlayerBlock = useMemo(() => {
|
|
31
32
|
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton } = video;
|
|
32
|
-
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 }));
|
|
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, blockName: blockName }));
|
|
33
34
|
}, [
|
|
34
35
|
video,
|
|
36
|
+
height,
|
|
35
37
|
videoClassName,
|
|
36
38
|
previewImg,
|
|
37
39
|
playVideo,
|
|
@@ -39,7 +41,7 @@ const Video = (props) => {
|
|
|
39
41
|
customBarControlsClassName,
|
|
40
42
|
metrika,
|
|
41
43
|
analyticsEvents,
|
|
42
|
-
|
|
44
|
+
blockName,
|
|
43
45
|
]);
|
|
44
46
|
const defaultVideoBlock = useMemo(() => {
|
|
45
47
|
return video.src.length && !hasVideoFallback ? (React.createElement("div", { className: b('wrap', videoClassName), style: { height } },
|
|
@@ -3,7 +3,7 @@ import ReactPlayer from 'react-player';
|
|
|
3
3
|
import React, { useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState, } from 'react';
|
|
4
4
|
import { Icon } from '@gravity-ui/uikit';
|
|
5
5
|
import { block } from '../../utils';
|
|
6
|
-
import { PlayButtonThemes, PlayButtonType, MediaVideoControlsType, } from '../../models';
|
|
6
|
+
import { PlayButtonThemes, PlayButtonType, MediaVideoControlsType, PredefinedEventTypes, } from '../../models';
|
|
7
7
|
import CustomBarControls from './CustomBarControls';
|
|
8
8
|
import { VideoContext } from '../../context/videoContext';
|
|
9
9
|
import { MetrikaContext } from '../../context/metrikaContext';
|
|
@@ -13,11 +13,12 @@ import { useAnalytics } from '../../hooks';
|
|
|
13
13
|
import './ReactPlayer.css';
|
|
14
14
|
const b = block('ReactPlayer');
|
|
15
15
|
const FPS = 60;
|
|
16
|
+
const COMPONENT_NAME = 'react-player';
|
|
16
17
|
// eslint-disable-next-line react/display-name
|
|
17
18
|
export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
18
19
|
const isMobile = useContext(MobileContext);
|
|
19
20
|
const { metrika } = useContext(MetrikaContext);
|
|
20
|
-
const { src, previewImgUrl, loop = false, controls = MediaVideoControlsType.Default, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, } = props;
|
|
21
|
+
const { src, previewImgUrl, loop = false, controls = MediaVideoControlsType.Default, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, blockName = COMPONENT_NAME, } = props;
|
|
21
22
|
const { type = PlayButtonType.Default, theme = PlayButtonThemes.Blue, text, className: buttonClassName, } = playButton || {};
|
|
22
23
|
const autoPlay = Boolean(!isMobile && !previewImgUrl && props.autoplay);
|
|
23
24
|
const mute = initiallyMuted || autoPlay;
|
|
@@ -32,7 +33,11 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
32
33
|
const [started, setStarted] = useState(autoPlay);
|
|
33
34
|
const [paused, setPaused] = useState(false);
|
|
34
35
|
const [ended, setEnded] = useState(false);
|
|
35
|
-
const handleAnalytics = useAnalytics(
|
|
36
|
+
const handleAnalytics = useAnalytics({
|
|
37
|
+
name: 'react-player-controls-click',
|
|
38
|
+
type: PredefinedEventTypes.Default,
|
|
39
|
+
blockName: blockName,
|
|
40
|
+
});
|
|
36
41
|
useImperativeHandle(originRef, () => ({
|
|
37
42
|
pause: () => setIsPlaying(false),
|
|
38
43
|
}));
|
|
@@ -81,8 +86,8 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
81
86
|
window.removeEventListener('resize', updateSize);
|
|
82
87
|
};
|
|
83
88
|
}, []);
|
|
84
|
-
const playEvents = useMemo(() => analyticsEvents === null || analyticsEvents === void 0 ? void 0 : analyticsEvents.filter((e) => e.type ===
|
|
85
|
-
const stopEvents = useMemo(() => analyticsEvents === null || analyticsEvents === void 0 ? void 0 : analyticsEvents.filter((e) => e.type ===
|
|
89
|
+
const playEvents = useMemo(() => analyticsEvents === null || analyticsEvents === void 0 ? void 0 : analyticsEvents.filter((e) => e.type === PredefinedEventTypes.Play), [analyticsEvents]);
|
|
90
|
+
const stopEvents = useMemo(() => analyticsEvents === null || analyticsEvents === void 0 ? void 0 : analyticsEvents.filter((e) => e.type === PredefinedEventTypes.Stop), [analyticsEvents]);
|
|
86
91
|
const playIcon = useMemo(() => {
|
|
87
92
|
let playButtonContent;
|
|
88
93
|
switch (type) {
|
|
@@ -108,27 +113,14 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
108
113
|
metrika.reachGoals(goal, counterName);
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (events) {
|
|
114
|
-
handleAnalytics(events);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
116
|
+
const events = isMuted ? playEvents : stopEvents;
|
|
117
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(events);
|
|
117
118
|
if (isMuted) {
|
|
118
119
|
setProps({ playingVideoRef: ref.current });
|
|
119
120
|
}
|
|
120
121
|
// In order to the progress bar to update (equals 0) before displaying
|
|
121
122
|
setTimeout(() => setMuted(!isMuted), 0);
|
|
122
|
-
}, [
|
|
123
|
-
playerRef,
|
|
124
|
-
metrika,
|
|
125
|
-
videoMetrika,
|
|
126
|
-
handleAnalytics,
|
|
127
|
-
analyticsEvents,
|
|
128
|
-
playEvents,
|
|
129
|
-
stopEvents,
|
|
130
|
-
setProps,
|
|
131
|
-
]);
|
|
123
|
+
}, [playerRef, metrika, videoMetrika, handleAnalytics, playEvents, stopEvents, setProps]);
|
|
132
124
|
const handleClick = useCallback(() => changeMute(muted), [changeMute, muted]);
|
|
133
125
|
const handleClickPreview = useCallback(() => {
|
|
134
126
|
setIsPlaying(true);
|
|
@@ -139,12 +131,8 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
139
131
|
metrika.reachGoals(play, counterName);
|
|
140
132
|
}
|
|
141
133
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
handleAnalytics(playEvents);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}, [onClickPreview, metrika, videoMetrika, handleAnalytics, analyticsEvents, playEvents]);
|
|
134
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(playEvents);
|
|
135
|
+
}, [onClickPreview, metrika, videoMetrika, handleAnalytics, playEvents]);
|
|
148
136
|
const onPause = useCallback(() => {
|
|
149
137
|
// For support correct state for youtube
|
|
150
138
|
setIsPlaying(false);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PixelEvent } from '../../models';
|
|
2
|
-
import {
|
|
2
|
+
import { AnalyticsEvent } from '../../models/common';
|
|
3
3
|
export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
|
|
4
4
|
export interface YandexFormProps {
|
|
5
5
|
id: number | string;
|
|
@@ -15,7 +15,8 @@ export interface YandexFormProps {
|
|
|
15
15
|
onLoad?: () => void;
|
|
16
16
|
metrikaGoals?: string | string[];
|
|
17
17
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
18
|
-
analyticsEvents?:
|
|
18
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
19
|
+
blockName?: string;
|
|
19
20
|
}
|
|
20
21
|
declare const YandexForm: (props: YandexFormProps) => JSX.Element;
|
|
21
22
|
export default YandexForm;
|
|
@@ -4,17 +4,23 @@ import { LocaleContext } from '../../context/localeContext';
|
|
|
4
4
|
import { MobileContext } from '../../context/mobileContext';
|
|
5
5
|
import { block } from '../../utils';
|
|
6
6
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
7
|
-
import {
|
|
7
|
+
import { PredefinedEventTypes } from '../../models/common';
|
|
8
|
+
import { useAnalytics } from '../../hooks';
|
|
8
9
|
export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
|
|
9
10
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
11
|
+
const COMPONENT_NAME = 'yandex-form';
|
|
10
12
|
const b = block('yandex-form');
|
|
11
13
|
const YandexForm = (props) => {
|
|
12
|
-
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
|
|
14
|
+
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, blockName = COMPONENT_NAME, } = props;
|
|
13
15
|
const formContainerRef = useRef(null);
|
|
14
16
|
const iframeRef = useRef();
|
|
15
17
|
const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;
|
|
16
18
|
const handleMetrika = useMetrika();
|
|
17
|
-
const handleAnalytics = useAnalytics(
|
|
19
|
+
const handleAnalytics = useAnalytics({
|
|
20
|
+
name: 'yndex-form-submit',
|
|
21
|
+
type: PredefinedEventTypes.Default,
|
|
22
|
+
blockName: blockName,
|
|
23
|
+
});
|
|
18
24
|
const isMobile = useContext(MobileContext);
|
|
19
25
|
const locale = useContext(LocaleContext);
|
|
20
26
|
const updateFormIframe = useCallback((container) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const blockMap: {
|
|
2
2
|
"slider-block": (props: import("./models").WithChildren<import("./blocks/Slider/Slider").SliderProps>) => JSX.Element;
|
|
3
3
|
"simple-block": (props: import("./models").WithChildren<import("./models").SimpleBlockProps>) => JSX.Element;
|
|
4
|
-
"extended-features-block": ({ title, description, items, colSizes, animated, }: import("./models").ExtendedFeaturesProps) => JSX.Element;
|
|
4
|
+
"extended-features-block": ({ title, description, items, colSizes, animated, blockName, }: import("./models").ExtendedFeaturesProps) => JSX.Element;
|
|
5
5
|
"promo-features-block": (props: import("./models").PromoFeaturesProps) => JSX.Element;
|
|
6
6
|
"questions-block": (props: import("./models").QuestionsProps) => JSX.Element;
|
|
7
7
|
"banner-block": (props: import("./models").BannerBlockProps) => JSX.Element;
|
|
@@ -11,14 +11,14 @@ export declare const blockMap: {
|
|
|
11
11
|
"info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
|
|
12
12
|
"security-block": (props: import("./models").SecurityBlockProps) => JSX.Element;
|
|
13
13
|
"table-block": (props: import("./models").TableBlockProps) => JSX.Element;
|
|
14
|
-
"tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, }: import("./models").TabsBlockProps) => JSX.Element;
|
|
14
|
+
"tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, blockName, }: import("./models").TabsBlockProps) => JSX.Element;
|
|
15
15
|
"link-table-block": ({ items, title, description, linkTheme }: import("./models").LinkTableBlockProps) => JSX.Element;
|
|
16
16
|
"header-block": (props: import("./models").WithChildren<import("./models").HeaderBlockProps & import("./models").ClassNameProps>) => JSX.Element;
|
|
17
17
|
"icons-block": ({ title, size, items }: import("./models").IconsBlockProps) => JSX.Element;
|
|
18
18
|
"header-slider-block": ({ items, arrows, ...props }: import("./models").HeaderSliderBlockProps) => JSX.Element;
|
|
19
19
|
"card-layout-block": ({ title, description, animated, colSizes, children, }: import("./blocks/CardLayout/CardLayout").CardLayoutBlockProps) => JSX.Element;
|
|
20
20
|
"content-layout-block": (props: import("./models").ContentLayoutBlockProps) => JSX.Element;
|
|
21
|
-
"share-block": ({ items, title }: import("./models").ShareBlockProps) => JSX.Element;
|
|
21
|
+
"share-block": ({ items, title, blockName }: import("./models").ShareBlockProps) => JSX.Element;
|
|
22
22
|
};
|
|
23
23
|
export declare const subBlockMap: {
|
|
24
24
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
@@ -31,10 +31,10 @@ export declare const subBlockMap: {
|
|
|
31
31
|
*/
|
|
32
32
|
partner: ({ text, logo, url, border }: import("./models").PartnerProps) => JSX.Element;
|
|
33
33
|
"price-detailed": (props: import("./models").PriceDetailedProps) => JSX.Element;
|
|
34
|
-
"media-card": ({ border, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
|
|
34
|
+
"media-card": ({ border, blockName, ...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
|
-
"card-with-image": ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }: import("./models").CardWithImageProps) => JSX.Element;
|
|
37
|
+
"card-with-image": ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, blockName, }: import("./models").CardWithImageProps) => JSX.Element;
|
|
38
38
|
"background-card": (props: import("./models").BackgroundCardProps) => JSX.Element;
|
|
39
39
|
"basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
|
|
40
40
|
content: (props: import("./models").ContentBlockProps & import("./models").ClassNameProps) => JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AnalyticsEvent } from '../../models';
|
|
3
3
|
export interface AnalyticsContextProps {
|
|
4
|
-
sendEvents?: (
|
|
4
|
+
sendEvents?: (events: AnalyticsEvent[]) => void;
|
|
5
|
+
sendDefaultEvent?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare const AnalyticsContext: React.Context<AnalyticsContextProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const useAnalytics: () => ((e?:
|
|
1
|
+
import { AnalyticsEvent } from '../models';
|
|
2
|
+
export declare const useAnalytics: (defaultEvent?: AnalyticsEvent) => ((e?: AnalyticsEvent | AnalyticsEvent[]) => void) | undefined;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { AnalyticsContext } from '../context/analyticsContext';
|
|
3
|
-
export const useAnalytics = () => {
|
|
4
|
-
const { sendEvents } = useContext(AnalyticsContext);
|
|
3
|
+
export const useAnalytics = (defaultEvent) => {
|
|
4
|
+
const { sendEvents, sendDefaultEvent } = useContext(AnalyticsContext);
|
|
5
5
|
if (!sendEvents) {
|
|
6
6
|
return undefined;
|
|
7
7
|
}
|
|
8
|
+
const defaultEvents = defaultEvent && sendDefaultEvent ? [defaultEvent] : [];
|
|
8
9
|
return (e) => {
|
|
9
|
-
|
|
10
|
+
let events = defaultEvents;
|
|
11
|
+
if (e) {
|
|
12
|
+
events = Array.isArray(e) ? [...events, ...e] : [...events, e];
|
|
13
|
+
}
|
|
14
|
+
if (!events) {
|
|
10
15
|
return;
|
|
11
16
|
}
|
|
12
|
-
sendEvents(
|
|
17
|
+
sendEvents(events);
|
|
13
18
|
};
|
|
14
19
|
};
|
|
@@ -68,21 +68,19 @@ export type AnalyticsParameter = {
|
|
|
68
68
|
key: string;
|
|
69
69
|
value: string | number | boolean;
|
|
70
70
|
};
|
|
71
|
+
export declare enum PredefinedEventTypes {
|
|
72
|
+
Default = "default-event",
|
|
73
|
+
Play = "play",
|
|
74
|
+
Stop = "stop"
|
|
75
|
+
}
|
|
71
76
|
export type AnalyticsCounters = {
|
|
72
77
|
include?: string[];
|
|
73
78
|
exclude?: string[];
|
|
74
79
|
};
|
|
75
|
-
export type AnalyticsEvent = {
|
|
76
|
-
name: string;
|
|
77
|
-
type?: string;
|
|
78
|
-
counters?: AnalyticsCounters;
|
|
79
|
-
category?: string;
|
|
80
|
-
label?: string;
|
|
81
|
-
params?: AnalyticsParameter[];
|
|
82
|
-
};
|
|
83
|
-
export type AnalyticsEventV2<T = {}> = T & {
|
|
80
|
+
export type AnalyticsEvent<T = {}> = T & {
|
|
84
81
|
name: string;
|
|
85
82
|
type?: string;
|
|
86
83
|
counters?: AnalyticsCounters;
|
|
84
|
+
blockName?: string;
|
|
87
85
|
};
|
|
88
86
|
export {};
|
|
@@ -27,3 +27,9 @@ export var PixelEventType;
|
|
|
27
27
|
PixelEventType["Subscribe"] = "Subscribe";
|
|
28
28
|
PixelEventType["ViewContent"] = "ViewContent";
|
|
29
29
|
})(PixelEventType || (PixelEventType = {}));
|
|
30
|
+
export var PredefinedEventTypes;
|
|
31
|
+
(function (PredefinedEventTypes) {
|
|
32
|
+
PredefinedEventTypes["Default"] = "default-event";
|
|
33
|
+
PredefinedEventTypes["Play"] = "play";
|
|
34
|
+
PredefinedEventTypes["Stop"] = "stop";
|
|
35
|
+
})(PredefinedEventTypes || (PredefinedEventTypes = {}));
|
|
@@ -109,6 +109,7 @@ export interface HeaderBlockProps {
|
|
|
109
109
|
verticalOffset?: 's' | 'm' | 'l' | 'xl';
|
|
110
110
|
breadcrumbs?: HeaderBreadCrumbsProps;
|
|
111
111
|
status?: JSX.Element;
|
|
112
|
+
blockName?: string;
|
|
112
113
|
}
|
|
113
114
|
export type CalculatorProps = Animatable;
|
|
114
115
|
export interface SimpleBlockProps extends Animatable, Childable {
|
|
@@ -127,6 +128,7 @@ export interface ExtendedFeaturesProps extends Animatable {
|
|
|
127
128
|
title?: TitleProps | string;
|
|
128
129
|
description?: string;
|
|
129
130
|
colSizes?: GridColumnSizesType;
|
|
131
|
+
blockName?: string;
|
|
130
132
|
}
|
|
131
133
|
export interface PromoFeaturesItem {
|
|
132
134
|
title: string;
|
|
@@ -139,6 +141,7 @@ export interface PromoFeaturesProps extends Animatable {
|
|
|
139
141
|
title?: TitleProps | string;
|
|
140
142
|
description?: string;
|
|
141
143
|
theme?: 'grey' | 'default';
|
|
144
|
+
blockName?: string;
|
|
142
145
|
}
|
|
143
146
|
export interface QuestionItem {
|
|
144
147
|
title: string;
|
|
@@ -163,6 +166,7 @@ export interface MediaContentProps {
|
|
|
163
166
|
links?: LinkProps[];
|
|
164
167
|
buttons?: ButtonProps[];
|
|
165
168
|
size?: ContentSize;
|
|
169
|
+
blockName?: string;
|
|
166
170
|
}
|
|
167
171
|
export interface MediaBlockProps extends Animatable, MediaContentProps {
|
|
168
172
|
media: ThemeSupporting<MediaProps>;
|
|
@@ -180,6 +184,7 @@ export interface PreviewBlockProps extends Animatable {
|
|
|
180
184
|
ratioMediaContent?: PreviewRatioMediaContent;
|
|
181
185
|
stopVideo?: boolean;
|
|
182
186
|
showImmediately?: boolean;
|
|
187
|
+
blockName?: string;
|
|
183
188
|
}
|
|
184
189
|
export interface InfoBlockProps {
|
|
185
190
|
theme?: TextTheme;
|
|
@@ -194,6 +199,7 @@ export interface InfoBlockProps {
|
|
|
194
199
|
links?: Pick<LinkProps, 'text' | 'url'>[];
|
|
195
200
|
leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
|
|
196
201
|
rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
|
|
202
|
+
blockName?: string;
|
|
197
203
|
}
|
|
198
204
|
export interface SecurityBlockPoint {
|
|
199
205
|
img: string;
|
|
@@ -209,6 +215,7 @@ export interface SecurityBlockProps extends Animatable {
|
|
|
209
215
|
title: string;
|
|
210
216
|
points?: SecurityBlockPoint[];
|
|
211
217
|
media: MediaProps;
|
|
218
|
+
blockName?: string;
|
|
212
219
|
}
|
|
213
220
|
export interface TableProps {
|
|
214
221
|
content: string[][];
|
|
@@ -235,6 +242,7 @@ export interface TabsBlockProps extends BlockHeaderProps, Animatable {
|
|
|
235
242
|
centered?: boolean;
|
|
236
243
|
direction?: MediaDirection;
|
|
237
244
|
items: TabsBlockItem[];
|
|
245
|
+
blockName?: string;
|
|
238
246
|
}
|
|
239
247
|
export interface LinkTableBlockProps extends BlockHeaderProps {
|
|
240
248
|
items: LinkProps[][];
|
|
@@ -264,6 +272,7 @@ export interface ContentLayoutBlockProps {
|
|
|
264
272
|
};
|
|
265
273
|
textContent: ContentBlockProps;
|
|
266
274
|
fileContent?: FileLinkProps[];
|
|
275
|
+
blockName?: string;
|
|
267
276
|
}
|
|
268
277
|
export interface ContentBlockProps {
|
|
269
278
|
title?: TitleBaseProps | string;
|
|
@@ -275,6 +284,7 @@ export interface ContentBlockProps {
|
|
|
275
284
|
colSizes?: GridColumnSizesType;
|
|
276
285
|
centered?: boolean;
|
|
277
286
|
theme?: ContentTheme;
|
|
287
|
+
blockName?: string;
|
|
278
288
|
}
|
|
279
289
|
export declare enum PCShareSocialNetwork {
|
|
280
290
|
Vk = "vk",
|
|
@@ -286,6 +296,7 @@ export declare enum PCShareSocialNetwork {
|
|
|
286
296
|
export interface ShareBlockProps {
|
|
287
297
|
items: PCShareSocialNetwork[];
|
|
288
298
|
title?: string;
|
|
299
|
+
blockName?: string;
|
|
289
300
|
}
|
|
290
301
|
export type HeaderBlockModel = {
|
|
291
302
|
type: BlockType.HeaderBlock;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonSize, ButtonView } from '@gravity-ui/uikit';
|
|
3
3
|
import { ThemeSupporting } from '../../utils/theme';
|
|
4
|
-
import {
|
|
4
|
+
import { AnalyticsEvent, ClassNameProps, PixelEventType } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -110,7 +110,8 @@ export interface MediaVideoProps {
|
|
|
110
110
|
playButton?: PlayButtonProps;
|
|
111
111
|
controls?: MediaVideoControlsType;
|
|
112
112
|
metrika?: MetrikaVideo;
|
|
113
|
-
analyticsEvents?:
|
|
113
|
+
analyticsEvents?: AnalyticsEvent[];
|
|
114
|
+
blockName?: string;
|
|
114
115
|
}
|
|
115
116
|
export interface LinkProps extends Stylable {
|
|
116
117
|
url: string;
|
|
@@ -122,7 +123,8 @@ export interface LinkProps extends Stylable {
|
|
|
122
123
|
target?: string;
|
|
123
124
|
metrikaGoals?: MetrikaGoal;
|
|
124
125
|
pixelEvents?: ButtonPixel;
|
|
125
|
-
analyticsEvents?:
|
|
126
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
127
|
+
blockName?: string;
|
|
126
128
|
}
|
|
127
129
|
export interface FileLinkProps extends ClassNameProps {
|
|
128
130
|
href: string;
|
|
@@ -141,8 +143,9 @@ export interface ButtonProps {
|
|
|
141
143
|
img?: ButtonImageProps | string;
|
|
142
144
|
metrikaGoals?: MetrikaGoal;
|
|
143
145
|
pixelEvents?: ButtonPixel;
|
|
144
|
-
analyticsEvents?:
|
|
146
|
+
analyticsEvents?: AnalyticsEvent[];
|
|
145
147
|
target?: string;
|
|
148
|
+
blockName?: string;
|
|
146
149
|
}
|
|
147
150
|
export interface ButtonImageProps {
|
|
148
151
|
url: string;
|
|
@@ -170,7 +173,8 @@ export interface MediaComponentVideoProps {
|
|
|
170
173
|
video: MediaVideoProps;
|
|
171
174
|
height?: number;
|
|
172
175
|
metrika?: MetrikaVideo;
|
|
173
|
-
analyticsEvents?:
|
|
176
|
+
analyticsEvents?: AnalyticsEvent[];
|
|
177
|
+
blockName?: string;
|
|
174
178
|
previewImg?: string;
|
|
175
179
|
}
|
|
176
180
|
export interface MediaComponentYoutubeProps {
|
|
@@ -226,7 +230,8 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
226
230
|
theme?: TextTheme;
|
|
227
231
|
metrikaGoals?: MetrikaGoal;
|
|
228
232
|
pixelEvents?: ButtonPixel;
|
|
229
|
-
analyticsEvents?:
|
|
233
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
234
|
+
blockName?: string;
|
|
230
235
|
}
|
|
231
236
|
export interface PreviewContentItemProps {
|
|
232
237
|
title: string;
|