@gravity-ui/page-constructor 1.15.0-alpha.2 → 1.15.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/blocks/Banner/Banner.js +3 -2
- package/build/cjs/blocks/Banner/schema.d.ts +9 -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 +3 -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 +10 -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 +12 -3
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +1 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.js +5 -2
- package/build/cjs/components/CardBase/CardBase.d.ts +1 -0
- package/build/cjs/components/CardBase/CardBase.js +3 -2
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -2
- package/build/cjs/components/Link/Link.js +4 -3
- package/build/cjs/components/Media/Media.js +4 -2
- package/build/cjs/components/Media/Video/Video.js +4 -2
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +14 -7
- package/build/cjs/components/YandexForm/YandexForm.d.ts +1 -0
- package/build/cjs/components/YandexForm/YandexForm.js +8 -2
- package/build/cjs/constructor-items.d.ts +5 -5
- package/build/cjs/hooks/useAnalytics.d.ts +2 -2
- package/build/cjs/hooks/useAnalytics.js +2 -2
- package/build/cjs/models/common.d.ts +1 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +11 -0
- package/build/cjs/models/constructor-items/common.d.ts +4 -0
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -1
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +3 -2
- package/build/cjs/schema/validators/common.d.ts +3 -0
- package/build/cjs/schema/validators/common.js +2 -0
- 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 +8 -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 +9 -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 +3 -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 +10 -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 +12 -3
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +1 -0
- package/build/esm/components/ButtonTabs/ButtonTabs.js +5 -2
- package/build/esm/components/CardBase/CardBase.d.ts +1 -0
- package/build/esm/components/CardBase/CardBase.js +3 -2
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -2
- package/build/esm/components/Link/Link.js +4 -3
- package/build/esm/components/Media/Media.js +4 -2
- package/build/esm/components/Media/Video/Video.js +4 -2
- package/build/esm/components/ReactPlayer/ReactPlayer.js +14 -7
- package/build/esm/components/YandexForm/YandexForm.d.ts +1 -0
- package/build/esm/components/YandexForm/YandexForm.js +8 -2
- package/build/esm/constructor-items.d.ts +5 -5
- package/build/esm/hooks/useAnalytics.d.ts +2 -2
- package/build/esm/hooks/useAnalytics.js +2 -2
- package/build/esm/models/common.d.ts +1 -0
- package/build/esm/models/constructor-items/blocks.d.ts +11 -0
- package/build/esm/models/constructor-items/common.d.ts +4 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -1
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +3 -2
- package/build/esm/schema/validators/common.d.ts +3 -0
- package/build/esm/schema/validators/common.js +2 -0
- 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 +8 -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 +1 -0
- package/server/models/constructor-items/blocks.d.ts +11 -0
- package/server/models/constructor-items/common.d.ts +4 -0
- package/server/models/constructor-items/sub-blocks.d.ts +4 -1
|
@@ -4,8 +4,10 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
+
const models_1 = require("../../models");
|
|
7
8
|
const locationContext_1 = require("../../context/locationContext");
|
|
8
9
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
10
|
+
const hooks_1 = require("src/hooks");
|
|
9
11
|
const Facebook_1 = require("../../icons/Facebook");
|
|
10
12
|
const Twitter_1 = require("../../icons/Twitter");
|
|
11
13
|
const Linkedin_1 = require("../../icons/Linkedin");
|
|
@@ -19,15 +21,21 @@ const icons = {
|
|
|
19
21
|
telegram: Telegram_1.Telegram,
|
|
20
22
|
};
|
|
21
23
|
const b = (0, utils_1.block)('share-block');
|
|
22
|
-
const Share = ({ items, title }) => {
|
|
24
|
+
const Share = ({ items, title, blockName = models_1.BlockType.ShareBlock }) => {
|
|
23
25
|
const { pathname, hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
26
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)();
|
|
27
|
+
const handleButtonClick = (0, react_1.useCallback)(() => handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics([], {
|
|
28
|
+
name: 'default',
|
|
29
|
+
type: 'button',
|
|
30
|
+
block: blockName,
|
|
31
|
+
}), [handleAnalytics, blockName]);
|
|
24
32
|
return (react_1.default.createElement("div", { className: b() },
|
|
25
33
|
react_1.default.createElement("h5", { className: b('title') }, title || (0, i18n_1.default)('constructor-share')),
|
|
26
34
|
react_1.default.createElement("div", { className: b('items') }, items.map((type) => {
|
|
27
35
|
const url = (0, utils_1.getAbsolutePath)(hostname, pathname);
|
|
28
36
|
const socialUrl = (0, utils_1.getShareLink)(url, type);
|
|
29
37
|
const icon = icons[type];
|
|
30
|
-
return (react_1.default.createElement(uikit_1.Button, { key: type, view: "flat", size: "l", target: "_blank", href: socialUrl, className: b('item', { type: type.toLowerCase() }) }, icon && react_1.default.createElement(uikit_1.Icon, { data: icon, size: 24, className: b('icon', { type }) })));
|
|
38
|
+
return (react_1.default.createElement(uikit_1.Button, { key: type, view: "flat", size: "l", target: "_blank", href: socialUrl, className: b('item', { type: type.toLowerCase() }), onClick: handleButtonClick }, icon && react_1.default.createElement(uikit_1.Icon, { data: icon, size: 24, className: b('icon', { type }) })));
|
|
31
39
|
}))));
|
|
32
40
|
};
|
|
33
41
|
exports.default = Share;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TabsBlockProps } from '../../models';
|
|
2
|
-
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction, }: TabsBlockProps) => JSX.Element;
|
|
2
|
+
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction, blockName, }: TabsBlockProps) => JSX.Element;
|
|
3
3
|
export default TabsBlock;
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const grid_1 = require("../../grid");
|
|
8
|
+
const models_1 = require("../../models");
|
|
8
9
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
9
10
|
const BlockHeader_1 = tslib_1.__importDefault(require("../../components/BlockHeader/BlockHeader"));
|
|
10
11
|
const FullscreenImage_1 = tslib_1.__importDefault(require("../../components/FullscreenImage/FullscreenImage"));
|
|
@@ -15,7 +16,7 @@ const ButtonTabs_1 = tslib_1.__importDefault(require("../../components/ButtonTab
|
|
|
15
16
|
const sub_blocks_1 = require("../../sub-blocks");
|
|
16
17
|
const VideoBlock_1 = require("../../components/VideoBlock/VideoBlock");
|
|
17
18
|
const b = (0, utils_1.block)('tabs-block');
|
|
18
|
-
const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', }) => {
|
|
19
|
+
const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', blockName = models_1.BlockType.TabsBlock, }) => {
|
|
19
20
|
var _a;
|
|
20
21
|
const [activeTab, setActiveTab] = (0, react_1.useState)(items[0].tabName);
|
|
21
22
|
const [play, setPlay] = (0, react_1.useState)(false);
|
|
@@ -40,12 +41,12 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
40
41
|
react_1.default.createElement(sub_blocks_1.Content, { title: activeTabData.title, text: activeTabData.text, additionalInfo: activeTabData.additionalInfo, size: "s", links: [
|
|
41
42
|
...(activeTabData.link ? [activeTabData.link] : []),
|
|
42
43
|
...(activeTabData.links || []),
|
|
43
|
-
], buttons: activeTabData.buttons, colSizes: { all: 12 } }))));
|
|
44
|
+
], buttons: activeTabData.buttons, colSizes: { all: 12 }, blockName: blockName }))));
|
|
44
45
|
const mediaContent = showMedia && (react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 8 }, orders: {
|
|
45
46
|
all: grid_1.GridColumnOrderClasses.Last,
|
|
46
47
|
md: grid_1.GridColumnOrderClasses.First,
|
|
47
48
|
}, className: b('col', { centered: centered }) },
|
|
48
|
-
react_1.default.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_1.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight })))),
|
|
49
|
+
react_1.default.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_1.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight, blockName: blockName })))),
|
|
49
50
|
imageProps && (react_1.default.createElement(react_1.Fragment, null,
|
|
50
51
|
react_1.default.createElement(FullscreenImage_1.default, Object.assign({}, imageProps, { imageClassName: b('image') })))),
|
|
51
52
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && react_1.default.createElement("p", { className: b('caption') }, activeTabData.caption)));
|
|
@@ -53,7 +54,7 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
53
54
|
react_1.default.createElement(BlockHeader_1.default, { title: title, description: description, className: b('block-title', { centered: centered }) }),
|
|
54
55
|
react_1.default.createElement(grid_1.Row, null,
|
|
55
56
|
react_1.default.createElement(grid_1.Col, { sizes: tabsColSizes },
|
|
56
|
-
react_1.default.createElement(ButtonTabs_1.default, { items: tabs, onSelectTab: setActiveTab, activeTab: activeTab, className: b('tabs', { centered: centered }) }))),
|
|
57
|
+
react_1.default.createElement(ButtonTabs_1.default, { items: tabs, onSelectTab: setActiveTab, activeTab: activeTab, className: b('tabs', { centered: centered }), blockName: models_1.BlockType.TabsBlock }))),
|
|
57
58
|
activeTabData && (react_1.default.createElement(grid_1.Row, { className: b('row', { reverse: isReverse }) },
|
|
58
59
|
mediaContent,
|
|
59
60
|
textContent))));
|
|
@@ -5,10 +5,18 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const icons_1 = require("../../icons");
|
|
7
7
|
const locationContext_1 = require("../../context/locationContext");
|
|
8
|
+
const hooks_1 = require("src/hooks");
|
|
9
|
+
const COMPONENT_NAME = 'backlink';
|
|
8
10
|
function BackLink(props) {
|
|
9
11
|
const { history } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
10
|
-
const
|
|
12
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)();
|
|
13
|
+
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, blockName = COMPONENT_NAME, } = props;
|
|
11
14
|
const backActionHandler = (0, react_1.useCallback)(async () => {
|
|
15
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics([], {
|
|
16
|
+
name: 'default',
|
|
17
|
+
type: 'button',
|
|
18
|
+
block: blockName,
|
|
19
|
+
});
|
|
12
20
|
if (!history) {
|
|
13
21
|
return;
|
|
14
22
|
}
|
|
@@ -21,7 +29,7 @@ function BackLink(props) {
|
|
|
21
29
|
else {
|
|
22
30
|
history.push({ pathname: url });
|
|
23
31
|
}
|
|
24
|
-
}, [history, onClick, url]);
|
|
32
|
+
}, [blockName, handleAnalytics, history, onClick, url]);
|
|
25
33
|
return (react_1.default.createElement(uikit_1.Button, { className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, href: shouldHandleBackAction ? undefined : url, onClick: shouldHandleBackAction ? backActionHandler : undefined },
|
|
26
34
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.ArrowSidebar, size: 24 }),
|
|
27
35
|
react_1.default.createElement("span", null, title)));
|
|
@@ -7,11 +7,12 @@ const Media_1 = tslib_1.__importDefault(require("../Media/Media"));
|
|
|
7
7
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../AnimateBlock/AnimateBlock"));
|
|
8
8
|
const mobileContext_1 = require("../../context/mobileContext");
|
|
9
9
|
const b = (0, utils_1.block)('BackgroundMedia');
|
|
10
|
+
const COMPONENT_NAME = 'backgound-media-component';
|
|
10
11
|
const BackgroundMedia = (_a) => {
|
|
11
12
|
var { className, color, animated, parallax = true, video, mediaClassName } = _a, props = tslib_1.__rest(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName"]);
|
|
12
13
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
13
14
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(null, className), style: { backgroundColor: color }, animate: animated },
|
|
14
15
|
react_1.default.createElement(Media_1.default, Object.assign({ className: b('media', mediaClassName), imageClassName: b('image'), videoClassName: b('video'), isBackground: true }, Object.assign({ height: 720, color,
|
|
15
|
-
parallax, video: isMobile ? undefined : video }, props)))));
|
|
16
|
+
parallax, video: isMobile ? undefined : video }, props), { blockName: COMPONENT_NAME }))));
|
|
16
17
|
};
|
|
17
18
|
exports.default = BackgroundMedia;
|
|
@@ -9,20 +9,29 @@ const localeContext_1 = require("../../context/localeContext/localeContext");
|
|
|
9
9
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
10
10
|
const hooks_1 = require("../../hooks");
|
|
11
11
|
const icons_1 = require("../../icons");
|
|
12
|
+
const COMPONENT_NAME = 'button';
|
|
12
13
|
const b = (0, utils_1.block)('button-block');
|
|
13
14
|
const Button = (props) => {
|
|
14
15
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
15
16
|
const handleAnalytics = (0, hooks_1.useAnalytics)();
|
|
16
17
|
const { lang, tld } = (0, react_1.useContext)(localeContext_1.LocaleContext);
|
|
17
|
-
const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text } = props, rest = tslib_1.__rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "img", "onClick", "text"]);
|
|
18
|
+
const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text, blockName = COMPONENT_NAME } = props, rest = tslib_1.__rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "img", "onClick", "text", "blockName"]);
|
|
18
19
|
const defaultImgPosition = 'left';
|
|
19
20
|
const onClick = (0, react_1.useCallback)(() => {
|
|
20
21
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
21
|
-
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
|
|
22
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents, { name: 'default', type: 'button', block: blockName });
|
|
22
23
|
if (onClickOrigin) {
|
|
23
24
|
onClickOrigin();
|
|
24
25
|
}
|
|
25
|
-
}, [
|
|
26
|
+
}, [
|
|
27
|
+
handleMetrika,
|
|
28
|
+
metrikaGoals,
|
|
29
|
+
pixelEvents,
|
|
30
|
+
handleAnalytics,
|
|
31
|
+
analyticsEvents,
|
|
32
|
+
blockName,
|
|
33
|
+
onClickOrigin,
|
|
34
|
+
]);
|
|
26
35
|
const buttonImg = img instanceof Object
|
|
27
36
|
? { url: img.url, position: img.position || defaultImgPosition, alt: img.alt }
|
|
28
37
|
: { url: img, position: defaultImgPosition };
|
|
@@ -4,9 +4,11 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const index_1 = require("../index");
|
|
7
|
+
const hooks_1 = require("src/hooks");
|
|
7
8
|
const b = (0, utils_1.block)('button-tabs');
|
|
8
9
|
const ButtonTabs = (props) => {
|
|
9
|
-
const { className, items, activeTab, onSelectTab } = props;
|
|
10
|
+
const { className, items, activeTab, onSelectTab, blockName = '' } = props;
|
|
11
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)();
|
|
10
12
|
const activeTabId = (0, react_1.useMemo)(() => {
|
|
11
13
|
if (activeTab) {
|
|
12
14
|
return activeTab;
|
|
@@ -14,10 +16,11 @@ const ButtonTabs = (props) => {
|
|
|
14
16
|
return items[0].id;
|
|
15
17
|
}, [activeTab, items]);
|
|
16
18
|
const handleClick = (0, react_1.useCallback)((tabId) => {
|
|
19
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics([], { name: 'default', type: 'button', block: blockName });
|
|
17
20
|
if (onSelectTab) {
|
|
18
21
|
onSelectTab(tabId);
|
|
19
22
|
}
|
|
20
|
-
}, [onSelectTab]);
|
|
23
|
+
}, [blockName, handleAnalytics, onSelectTab]);
|
|
21
24
|
return (react_1.default.createElement("div", { className: b(null, className) }, items.map((item) => {
|
|
22
25
|
const isActive = item.id === activeTabId;
|
|
23
26
|
return (react_1.default.createElement(index_1.Button, { text: item.title, className: b('item', { active: isActive }), key: item.title, size: 'l', onClick: () => handleClick(item.id), theme: isActive ? 'monochrome' : 'normal' }));
|
|
@@ -11,6 +11,7 @@ export interface CardBaseProps extends CardBaseParams {
|
|
|
11
11
|
metrikaGoals?: MetrikaGoal;
|
|
12
12
|
pixelEvents?: ButtonPixel;
|
|
13
13
|
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
14
|
+
blockName?: string;
|
|
14
15
|
}
|
|
15
16
|
export interface CardHeaderBaseProps {
|
|
16
17
|
className?: string;
|
|
@@ -8,12 +8,13 @@ const BackgroundImage_1 = tslib_1.__importDefault(require("../BackgroundImage/Ba
|
|
|
8
8
|
const RouterLink_1 = tslib_1.__importDefault(require("../RouterLink/RouterLink"));
|
|
9
9
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
10
10
|
const hooks_1 = require("../../hooks");
|
|
11
|
+
const COMPONENT_NAME = 'card-base';
|
|
11
12
|
const b = (0, utils_1.block)('card-base-block');
|
|
12
13
|
const Header = () => null;
|
|
13
14
|
const Content = () => null;
|
|
14
15
|
const Footer = () => null;
|
|
15
16
|
const Layout = (props) => {
|
|
16
|
-
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', } = props;
|
|
17
|
+
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', blockName = COMPONENT_NAME, } = props;
|
|
17
18
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
18
19
|
const handleAnalytics = (0, hooks_1.useAnalytics)();
|
|
19
20
|
let header, content, footer, image, headerClass, footerClass;
|
|
@@ -48,7 +49,7 @@ const Layout = (props) => {
|
|
|
48
49
|
const fullClassName = b({ border }, className);
|
|
49
50
|
const onClick = () => {
|
|
50
51
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
51
|
-
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
|
|
52
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents, { name: 'default', type: 'card', block: blockName });
|
|
52
53
|
};
|
|
53
54
|
return url ? (react_1.default.createElement(RouterLink_1.default, { href: url },
|
|
54
55
|
react_1.default.createElement("a", { href: url, target: target, rel: target === '_blank' ? 'noopener noreferrer' : undefined, className: fullClassName, draggable: false, onDragStart: (e) => e.preventDefault(), onClick: onClick }, cardContent))) : (react_1.default.createElement("div", { className: fullClassName }, cardContent));
|
|
@@ -6,13 +6,18 @@ const utils_1 = require("../../utils");
|
|
|
6
6
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
7
7
|
const hooks_1 = require("../../hooks");
|
|
8
8
|
const b = (0, utils_1.block)('header-breadcrumbs');
|
|
9
|
+
const COMPONENT_NAME = 'header-breadcrumbs';
|
|
9
10
|
function HeaderBreadcrumbs(props) {
|
|
10
|
-
const { items, metrikaGoals, pixelEvents, analyticsEvents, theme = 'light', className } = props;
|
|
11
|
+
const { items, metrikaGoals, pixelEvents, analyticsEvents, theme = 'light', blockName = COMPONENT_NAME, className, } = props;
|
|
11
12
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
12
13
|
const handleAnalytics = (0, hooks_1.useAnalytics)();
|
|
13
14
|
const onClick = () => {
|
|
14
15
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
15
|
-
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents
|
|
16
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents, {
|
|
17
|
+
name: 'default',
|
|
18
|
+
type: 'header-breadcrumbs',
|
|
19
|
+
block: blockName,
|
|
20
|
+
});
|
|
16
21
|
};
|
|
17
22
|
return (react_1.default.createElement("div", { className: b({ theme }, className) }, items.map((item) => (react_1.default.createElement("div", { className: b('item'), key: item.url },
|
|
18
23
|
react_1.default.createElement("a", { href: item.url, className: b('text'), onClick: onClick }, item.text))))));
|
|
@@ -13,6 +13,7 @@ const useMetrika_1 = require("../../hooks/useMetrika");
|
|
|
13
13
|
const hooks_1 = require("../../hooks");
|
|
14
14
|
const b = (0, utils_1.block)('link-block');
|
|
15
15
|
const WORD_JOINER_SYM = '\u200b';
|
|
16
|
+
const COMPONENT_NAME = 'link';
|
|
16
17
|
function getArrowSize(size) {
|
|
17
18
|
switch (size) {
|
|
18
19
|
case 'l':
|
|
@@ -26,7 +27,7 @@ function getArrowSize(size) {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
const LinkBlock = (props) => {
|
|
29
|
-
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, } = props;
|
|
30
|
+
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, blockName = COMPONENT_NAME, } = props;
|
|
30
31
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
31
32
|
const handleAnalytics = (0, hooks_1.useAnalytics)();
|
|
32
33
|
const { hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
@@ -35,12 +36,12 @@ const LinkBlock = (props) => {
|
|
|
35
36
|
const defaultTextSize = theme === 'back' ? 'l' : 'm';
|
|
36
37
|
const onClick = () => {
|
|
37
38
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
38
|
-
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
|
|
39
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents, { name: 'default', type: 'link', block: blockName });
|
|
39
40
|
};
|
|
40
41
|
const getLinkByType = () => {
|
|
41
42
|
switch (theme) {
|
|
42
43
|
case 'back':
|
|
43
|
-
return react_1.default.createElement(BackLink_1.default, { title: children || text, url: href, onClick: onClick });
|
|
44
|
+
return (react_1.default.createElement(BackLink_1.default, { title: children || text, url: href, onClick: onClick, blockName: blockName }));
|
|
44
45
|
case 'file-link':
|
|
45
46
|
case 'underline':
|
|
46
47
|
return (react_1.default.createElement(FileLink_1.default, { text: children || text, href: href, type: "horizontal", textSize: textSize, onClick: onClick }));
|
|
@@ -9,9 +9,10 @@ const DataLens_1 = tslib_1.__importDefault(require("./DataLens/DataLens"));
|
|
|
9
9
|
const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
|
|
10
10
|
const VideoBlock_1 = tslib_1.__importDefault(require("../VideoBlock/VideoBlock"));
|
|
11
11
|
const b = (0, utils_1.block)('Media');
|
|
12
|
+
const COMPONENT_NAME = 'media-component';
|
|
12
13
|
const Media = (props) => {
|
|
13
14
|
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, analyticsEvents, } = props;
|
|
14
|
-
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, } = props;
|
|
15
|
+
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, blockName = COMPONENT_NAME, } = props;
|
|
15
16
|
const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
|
|
16
17
|
const content = (0, react_1.useMemo)(() => {
|
|
17
18
|
let result = [];
|
|
@@ -19,7 +20,7 @@ const Media = (props) => {
|
|
|
19
20
|
result.push(react_1.default.createElement(Image_1.default, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback }));
|
|
20
21
|
}
|
|
21
22
|
if (video) {
|
|
22
|
-
result.push(react_1.default.createElement(Video_1.default, { key: "video", video: video, videoClassName: videoClassName, height: height, metrika: metrika, analyticsEvents: analyticsEvents, playVideo: playVideo, previewImg: previewImg, playButton: playButton, customBarControlsClassName: customBarControlsClassName, hasVideoFallback: hasVideoFallback, setHasVideoFallback: setHasVideoFallback }));
|
|
23
|
+
result.push(react_1.default.createElement(Video_1.default, { 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 }));
|
|
23
24
|
}
|
|
24
25
|
if (youtube) {
|
|
25
26
|
result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height }));
|
|
@@ -45,6 +46,7 @@ const Media = (props) => {
|
|
|
45
46
|
previewImg,
|
|
46
47
|
playButton,
|
|
47
48
|
customBarControlsClassName,
|
|
49
|
+
blockName,
|
|
48
50
|
youtubeClassName,
|
|
49
51
|
]);
|
|
50
52
|
return (react_1.default.createElement("div", { className: b(null, className), style: { backgroundColor: color } }, content));
|
|
@@ -7,8 +7,9 @@ const ReactPlayer_1 = tslib_1.__importDefault(require("../../ReactPlayer/ReactPl
|
|
|
7
7
|
const utils_1 = require("./utils");
|
|
8
8
|
const utils_2 = require("../../../utils");
|
|
9
9
|
const b = (0, utils_2.block)('media-component-video');
|
|
10
|
+
const COMPONENT_NAME = 'media-video';
|
|
10
11
|
const Video = (props) => {
|
|
11
|
-
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, } = props;
|
|
12
|
+
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, blockName = COMPONENT_NAME, } = props;
|
|
12
13
|
const ref = (0, react_1.useRef)(null);
|
|
13
14
|
(0, react_1.useEffect)(() => {
|
|
14
15
|
if (ref && ref.current) {
|
|
@@ -31,7 +32,7 @@ const Video = (props) => {
|
|
|
31
32
|
}, [playVideo, video, setHasVideoFallback]);
|
|
32
33
|
const reactPlayerBlock = (0, react_1.useMemo)(() => {
|
|
33
34
|
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton } = video;
|
|
34
|
-
return (react_1.default.createElement(ReactPlayer_1.default, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, analyticsEvents: analyticsEvents, height: height }));
|
|
35
|
+
return (react_1.default.createElement(ReactPlayer_1.default, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, analyticsEvents: analyticsEvents, height: height, blockName: blockName }));
|
|
35
36
|
}, [
|
|
36
37
|
video,
|
|
37
38
|
videoClassName,
|
|
@@ -42,6 +43,7 @@ const Video = (props) => {
|
|
|
42
43
|
metrika,
|
|
43
44
|
analyticsEvents,
|
|
44
45
|
height,
|
|
46
|
+
blockName,
|
|
45
47
|
]);
|
|
46
48
|
const defaultVideoBlock = (0, react_1.useMemo)(() => {
|
|
47
49
|
return video.src.length && !hasVideoFallback ? (react_1.default.createElement("div", { className: b('wrap', videoClassName), style: { height } },
|
|
@@ -16,11 +16,12 @@ const icons_1 = require("../../icons");
|
|
|
16
16
|
const hooks_1 = require("../../hooks");
|
|
17
17
|
const b = (0, utils_1.block)('ReactPlayer');
|
|
18
18
|
const FPS = 60;
|
|
19
|
+
const COMPONENT_NAME = 'react-player';
|
|
19
20
|
// eslint-disable-next-line react/display-name
|
|
20
21
|
exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
21
22
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
22
23
|
const { metrika } = (0, react_1.useContext)(metrikaContext_1.MetrikaContext);
|
|
23
|
-
const { src, previewImgUrl, loop = false, controls = models_1.MediaVideoControlsType.Default, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, } = props;
|
|
24
|
+
const { src, previewImgUrl, loop = false, controls = models_1.MediaVideoControlsType.Default, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, blockName = COMPONENT_NAME, } = props;
|
|
24
25
|
const { type = models_1.PlayButtonType.Default, theme = models_1.PlayButtonThemes.Blue, text, className: buttonClassName, } = playButton || {};
|
|
25
26
|
const autoPlay = Boolean(!isMobile && !previewImgUrl && props.autoplay);
|
|
26
27
|
const mute = initiallyMuted || autoPlay;
|
|
@@ -111,10 +112,13 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
111
112
|
metrika.reachGoals(goal, counterName);
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
|
-
if (handleAnalytics
|
|
115
|
+
if (handleAnalytics) {
|
|
115
116
|
const events = isMuted ? playEvents : stopEvents;
|
|
116
117
|
if (events) {
|
|
117
|
-
handleAnalytics(events
|
|
118
|
+
handleAnalytics(events, {
|
|
119
|
+
type: 'react-player-change-mute',
|
|
120
|
+
block: blockName,
|
|
121
|
+
});
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
if (isMuted) {
|
|
@@ -127,9 +131,9 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
127
131
|
metrika,
|
|
128
132
|
videoMetrika,
|
|
129
133
|
handleAnalytics,
|
|
130
|
-
analyticsEvents,
|
|
131
134
|
playEvents,
|
|
132
135
|
stopEvents,
|
|
136
|
+
blockName,
|
|
133
137
|
setProps,
|
|
134
138
|
]);
|
|
135
139
|
const handleClick = (0, react_1.useCallback)(() => changeMute(muted), [changeMute, muted]);
|
|
@@ -142,12 +146,15 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
142
146
|
metrika.reachGoals(play, counterName);
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
|
-
if (handleAnalytics
|
|
149
|
+
if (handleAnalytics) {
|
|
146
150
|
if (playEvents) {
|
|
147
|
-
handleAnalytics(playEvents
|
|
151
|
+
handleAnalytics(playEvents, {
|
|
152
|
+
type: 'react-player-preview',
|
|
153
|
+
block: blockName,
|
|
154
|
+
});
|
|
148
155
|
}
|
|
149
156
|
}
|
|
150
|
-
}, [onClickPreview, metrika, videoMetrika, handleAnalytics,
|
|
157
|
+
}, [onClickPreview, metrika, videoMetrika, handleAnalytics, playEvents, blockName]);
|
|
151
158
|
const onPause = (0, react_1.useCallback)(() => {
|
|
152
159
|
// For support correct state for youtube
|
|
153
160
|
setIsPlaying(false);
|
|
@@ -16,6 +16,7 @@ export interface YandexFormProps {
|
|
|
16
16
|
metrikaGoals?: string | string[];
|
|
17
17
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
18
18
|
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
19
|
+
blockName?: string;
|
|
19
20
|
}
|
|
20
21
|
declare const YandexForm: (props: YandexFormProps) => JSX.Element;
|
|
21
22
|
export default YandexForm;
|
|
@@ -11,9 +11,10 @@ const useMetrika_1 = require("../../hooks/useMetrika");
|
|
|
11
11
|
const hooks_1 = require("../..//hooks");
|
|
12
12
|
exports.YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
|
|
13
13
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
14
|
+
const COMPONENT_NAME = 'yandex-form';
|
|
14
15
|
const b = (0, utils_1.block)('yandex-form');
|
|
15
16
|
const YandexForm = (props) => {
|
|
16
|
-
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
|
|
17
|
+
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, blockName = COMPONENT_NAME, } = props;
|
|
17
18
|
const formContainerRef = (0, react_1.useRef)(null);
|
|
18
19
|
const iframeRef = (0, react_1.useRef)();
|
|
19
20
|
const yaFormOrigin = customFormOrigin || exports.YANDEX_FORM_ORIGIN;
|
|
@@ -59,7 +60,11 @@ const YandexForm = (props) => {
|
|
|
59
60
|
window.scrollBy(0, top - headerHeight);
|
|
60
61
|
}
|
|
61
62
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
62
|
-
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents
|
|
63
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents, {
|
|
64
|
+
name: 'default',
|
|
65
|
+
type: 'yandex-form',
|
|
66
|
+
block: blockName,
|
|
67
|
+
});
|
|
63
68
|
if (onSubmit) {
|
|
64
69
|
onSubmit();
|
|
65
70
|
}
|
|
@@ -69,6 +74,7 @@ const YandexForm = (props) => {
|
|
|
69
74
|
pixelEvents,
|
|
70
75
|
handleAnalytics,
|
|
71
76
|
analyticsEvents,
|
|
77
|
+
blockName,
|
|
72
78
|
onSubmit,
|
|
73
79
|
headerHeight,
|
|
74
80
|
]);
|
|
@@ -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,2 +1,2 @@
|
|
|
1
|
-
import { AnalyticsEvent } from '../models';
|
|
2
|
-
export declare const useAnalytics: () => ((e?: AnalyticsEvent | AnalyticsEvent[],
|
|
1
|
+
import { AnalyticsEvent, DefaultEvent } from '../models';
|
|
2
|
+
export declare const useAnalytics: () => ((e?: AnalyticsEvent | AnalyticsEvent[], defaultEvent?: DefaultEvent) => void) | undefined;
|
|
@@ -8,11 +8,11 @@ const useAnalytics = () => {
|
|
|
8
8
|
if (!sendEvents) {
|
|
9
9
|
return undefined;
|
|
10
10
|
}
|
|
11
|
-
return (e,
|
|
11
|
+
return (e, defaultEvent) => {
|
|
12
12
|
if (!e) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
sendEvents(e,
|
|
15
|
+
sendEvents(e, defaultEvent);
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
exports.useAnalytics = useAnalytics;
|