@gravity-ui/page-constructor 1.15.0-alpha.0 → 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 +33 -24
- 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 +11 -8
- 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 +19 -16
- package/build/cjs/schema/validators/common.js +3 -1
- package/build/cjs/schema/validators/event.d.ts +4 -58
- package/build/cjs/schema/validators/event.js +3 -55
- 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 +33 -24
- 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 +11 -8
- 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 +19 -16
- package/build/esm/schema/validators/common.js +4 -2
- package/build/esm/schema/validators/event.d.ts +4 -58
- package/build/esm/schema/validators/event.js +2 -54
- 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
|
@@ -429,10 +429,7 @@ export declare const MediaBlock: {
|
|
|
429
429
|
analyticsEvents: {
|
|
430
430
|
anyOf: ({
|
|
431
431
|
type: string;
|
|
432
|
-
|
|
433
|
-
type: string;
|
|
434
|
-
};
|
|
435
|
-
additionalProperty: {
|
|
432
|
+
additionalProperties: {
|
|
436
433
|
type: string;
|
|
437
434
|
};
|
|
438
435
|
required: string[];
|
|
@@ -462,15 +459,15 @@ export declare const MediaBlock: {
|
|
|
462
459
|
};
|
|
463
460
|
};
|
|
464
461
|
};
|
|
462
|
+
blockName: {
|
|
463
|
+
type: string;
|
|
464
|
+
};
|
|
465
465
|
};
|
|
466
466
|
} | {
|
|
467
467
|
type: string;
|
|
468
468
|
items: {
|
|
469
469
|
type: string;
|
|
470
|
-
|
|
471
|
-
type: string;
|
|
472
|
-
};
|
|
473
|
-
additionalProperty: {
|
|
470
|
+
additionalProperties: {
|
|
474
471
|
type: string;
|
|
475
472
|
};
|
|
476
473
|
required: string[];
|
|
@@ -500,6 +497,9 @@ export declare const MediaBlock: {
|
|
|
500
497
|
};
|
|
501
498
|
};
|
|
502
499
|
};
|
|
500
|
+
blockName: {
|
|
501
|
+
type: string;
|
|
502
|
+
};
|
|
503
503
|
};
|
|
504
504
|
};
|
|
505
505
|
})[];
|
|
@@ -603,6 +603,9 @@ export declare const MediaBlock: {
|
|
|
603
603
|
resetPaddings: {
|
|
604
604
|
type: string;
|
|
605
605
|
};
|
|
606
|
+
blockName: {
|
|
607
|
+
type: string;
|
|
608
|
+
};
|
|
606
609
|
type: {};
|
|
607
610
|
when: {};
|
|
608
611
|
};
|
|
@@ -8,6 +8,7 @@ interface MediaContentProps extends Refable<HTMLDivElement> {
|
|
|
8
8
|
switching: boolean;
|
|
9
9
|
isActiveBlock: (id: number, isMediaBlock?: boolean) => boolean;
|
|
10
10
|
showMediaContent: (id: number) => void;
|
|
11
|
+
blockName?: string;
|
|
11
12
|
}
|
|
12
|
-
declare const MediaContent: React.ForwardRefExoticComponent<Pick<MediaContentProps, "title" | "items" | "description" | "ratioMediaContent" | "switching" | "isActiveBlock" | "showMediaContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const MediaContent: React.ForwardRefExoticComponent<Pick<MediaContentProps, "title" | "blockName" | "items" | "description" | "ratioMediaContent" | "switching" | "isActiveBlock" | "showMediaContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
14
|
export default MediaContent;
|
|
@@ -9,8 +9,9 @@ const PreviewContent_1 = tslib_1.__importDefault(require("./PreviewContent"));
|
|
|
9
9
|
const PreviewMedia_1 = tslib_1.__importDefault(require("./PreviewMedia"));
|
|
10
10
|
const ThemeValueContext_1 = require("../../../context/theme/ThemeValueContext");
|
|
11
11
|
const b = (0, utils_1.block)('preview-media-content-block');
|
|
12
|
+
const COMPONENT_NAME = 'preview-media-content';
|
|
12
13
|
const MediaContent = (0, react_1.forwardRef)((props, ref) => {
|
|
13
|
-
const { items, title, description = '', switching, ratioMediaContent = '1-1', isActiveBlock, showMediaContent, } = props;
|
|
14
|
+
const { items, title, description = '', switching, ratioMediaContent = '1-1', isActiveBlock, showMediaContent, blockName = COMPONENT_NAME, } = props;
|
|
14
15
|
const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
|
|
15
16
|
const [mediaSizes, setMediaSizes] = (0, react_1.useState)({ [grid_1.GridColumnSize.All]: 12 });
|
|
16
17
|
const [contentSizes, setContentSizes] = (0, react_1.useState)({ [grid_1.GridColumnSize.All]: 12 });
|
|
@@ -32,7 +33,7 @@ const MediaContent = (0, react_1.forwardRef)((props, ref) => {
|
|
|
32
33
|
const mediaMods = { active: isActiveBlock(id, true) };
|
|
33
34
|
const onClick = () => showMediaContent(id);
|
|
34
35
|
contentComponents.push(react_1.default.createElement(PreviewContent_1.default, Object.assign({ key: id, id: id }, content, { switching: switching, onClick: onClick, mods: contentMods })));
|
|
35
|
-
mediaComponents.push(react_1.default.createElement(PreviewMedia_1.default, { key: id, id: id, media: media && (0, utils_1.getThemedValue)(media, theme), play: isActive, mods: mediaMods }));
|
|
36
|
+
mediaComponents.push(react_1.default.createElement(PreviewMedia_1.default, { key: id, id: id, media: media && (0, utils_1.getThemedValue)(media, theme), play: isActive, mods: mediaMods, blockName: blockName }));
|
|
36
37
|
});
|
|
37
38
|
return (react_1.default.createElement(react_1.Fragment, null,
|
|
38
39
|
react_1.default.createElement(grid_1.Col, { sizes: contentSizes, className: b('content') },
|
|
@@ -5,9 +5,10 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
5
5
|
const utils_1 = require("../../../utils");
|
|
6
6
|
const Media_1 = tslib_1.__importDefault(require("../../../components/Media/Media"));
|
|
7
7
|
const b = (0, utils_1.block)('preview-media-block');
|
|
8
|
+
const COMPONENT_NAME = 'preview-media';
|
|
8
9
|
const PreviewMedia = (props) => {
|
|
9
|
-
const { id, media, play, mods } = props;
|
|
10
|
+
const { id, media, play, mods, blockName = COMPONENT_NAME } = props;
|
|
10
11
|
return (react_1.default.createElement("div", { key: id, className: b('media', mods) },
|
|
11
|
-
react_1.default.createElement(Media_1.default, Object.assign({}, media, { playVideo: play }))));
|
|
12
|
+
react_1.default.createElement(Media_1.default, Object.assign({}, media, { playVideo: play, blockName: blockName }))));
|
|
12
13
|
};
|
|
13
14
|
exports.default = PreviewMedia;
|
|
@@ -8,6 +8,7 @@ const breakpointContext_1 = require("../../context/breakpointContext");
|
|
|
8
8
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
9
9
|
const MediaContent_1 = tslib_1.__importDefault(require("./MediaContent/MediaContent"));
|
|
10
10
|
const grid_1 = require("../../grid");
|
|
11
|
+
const models_1 = require("../../models");
|
|
11
12
|
const constants_1 = require("../../constants");
|
|
12
13
|
const useIntersection_1 = require("../../hooks/useIntersection");
|
|
13
14
|
const b = (0, utils_1.block)('preview-block');
|
|
@@ -22,7 +23,7 @@ const INDENT_BETWEEN_TITLE_DESCRIPTION = 16;
|
|
|
22
23
|
const PreviewBlock = (props) => {
|
|
23
24
|
const { direction = 'content-media', animated, items, title, description, ratioMediaContent = '1-1', stopVideo = false,
|
|
24
25
|
// TODO YDB-server doesn't see previewRef.current and doesn't update the component CLOUDFRONT-9395
|
|
25
|
-
showImmediately = false, } = props;
|
|
26
|
+
showImmediately = false, blockName = models_1.BlockType.PreviewBlock, } = props;
|
|
26
27
|
const breakpoint = (0, react_1.useContext)(breakpointContext_1.BreakpointContext);
|
|
27
28
|
const isDesktop = breakpoint >= constants_1.BREAKPOINTS.md;
|
|
28
29
|
const menuRef = react_1.default.useRef(null);
|
|
@@ -85,7 +86,7 @@ const PreviewBlock = (props) => {
|
|
|
85
86
|
}, [changeActiveSlide, activeSlide, autoSwitchTimerId]);
|
|
86
87
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), animate: animated },
|
|
87
88
|
react_1.default.createElement(grid_1.Row, { ref: previewRef, className: b('row', { reverse: direction === 'media-content' }) },
|
|
88
|
-
react_1.default.createElement(MediaContent_1.default, { ref: menuRef, items: items, title: title, description: description, ratioMediaContent: ratioMediaContent, switching: !stopSwitching, isActiveBlock: isActiveBlock, showMediaContent: showMediaContent }))));
|
|
89
|
+
react_1.default.createElement(MediaContent_1.default, { ref: menuRef, items: items, title: title, description: description, ratioMediaContent: ratioMediaContent, switching: !stopSwitching, isActiveBlock: isActiveBlock, showMediaContent: showMediaContent, blockName: blockName }))));
|
|
89
90
|
};
|
|
90
91
|
exports.PreviewBlock = PreviewBlock;
|
|
91
92
|
function changeMenuScroll(element, nextSlide, activeSlide) {
|
|
@@ -48,6 +48,8 @@ exports.PreviewBlock = {
|
|
|
48
48
|
}, ratioMediaContent: {
|
|
49
49
|
type: 'string',
|
|
50
50
|
enum: previewRatioMediaContent,
|
|
51
|
-
}, items: (0, utils_1.filteredArray)(PreviewItem)
|
|
51
|
+
}, items: (0, utils_1.filteredArray)(PreviewItem), blockName: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
} }),
|
|
52
54
|
},
|
|
53
55
|
};
|
|
@@ -5,6 +5,7 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
7
7
|
const YFMWrapper_1 = tslib_1.__importDefault(require("../../components/YFMWrapper/YFMWrapper"));
|
|
8
|
+
const models_1 = require("../../models");
|
|
8
9
|
const Media_1 = tslib_1.__importDefault(require("../../components/Media/Media"));
|
|
9
10
|
const BlockHeader_1 = tslib_1.__importDefault(require("../../components/BlockHeader/BlockHeader"));
|
|
10
11
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
@@ -17,7 +18,7 @@ const breakpointColumns = {
|
|
|
17
18
|
[constants_1.BREAKPOINTS.sm]: 1,
|
|
18
19
|
};
|
|
19
20
|
const PromoFeaturesBlock = (props) => {
|
|
20
|
-
const { items, title, description, theme, animated = true } = props;
|
|
21
|
+
const { items, title, description, theme, animated = true, blockName = models_1.BlockType.PromoFeaturesBlock, } = props;
|
|
21
22
|
const backgroundTheme = theme || 'default';
|
|
22
23
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b({ [backgroundTheme]: true }), animate: animated },
|
|
23
24
|
react_1.default.createElement(FullWidthBackground_1.default, { className: b('background', { [backgroundTheme]: true }) }),
|
|
@@ -33,7 +34,7 @@ const PromoFeaturesBlock = (props) => {
|
|
|
33
34
|
react_1.default.createElement("h4", { className: b('card-title') }, cardTitle),
|
|
34
35
|
react_1.default.createElement("div", { className: b('card-text') },
|
|
35
36
|
react_1.default.createElement(YFMWrapper_1.default, { content: text, modifiers: { constructor: true } }))),
|
|
36
|
-
media && react_1.default.createElement(Media_1.default, Object.assign({ className: b('card-media') }, media))));
|
|
37
|
+
media && (react_1.default.createElement(Media_1.default, Object.assign({ className: b('card-media'), blockName: blockName }, media)))));
|
|
37
38
|
}))));
|
|
38
39
|
};
|
|
39
40
|
exports.default = PromoFeaturesBlock;
|
|
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
+
const models_1 = require("../../models");
|
|
6
7
|
const Link_1 = tslib_1.__importDefault(require("../../components/Link/Link"));
|
|
7
8
|
const components_1 = require("../../components");
|
|
8
9
|
const grid_1 = require("../../grid");
|
|
9
10
|
const sub_blocks_1 = require("../../sub-blocks");
|
|
10
11
|
const b = (0, utils_1.block)('QuestionsBlock');
|
|
11
12
|
const QuestionsBlock = (props) => {
|
|
12
|
-
const { title, text, additionalInfo, links, buttons, items } = props;
|
|
13
|
+
const { title, text, additionalInfo, links, buttons, items, blockName = models_1.BlockType.QuestionsBlock, } = props;
|
|
13
14
|
const [opened, setOpened] = (0, react_1.useState)([0]);
|
|
14
15
|
const toggleItem = (index) => {
|
|
15
16
|
let newState;
|
|
@@ -25,7 +26,7 @@ const QuestionsBlock = (props) => {
|
|
|
25
26
|
react_1.default.createElement(grid_1.Row, null,
|
|
26
27
|
react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 4 } },
|
|
27
28
|
react_1.default.createElement("div", { className: b('title') },
|
|
28
|
-
react_1.default.createElement(sub_blocks_1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 } }))),
|
|
29
|
+
react_1.default.createElement(sub_blocks_1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, blockName: blockName }))),
|
|
29
30
|
react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 8 } }, items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash' }, index) => {
|
|
30
31
|
const isOpened = opened.includes(index);
|
|
31
32
|
return (react_1.default.createElement("div", { key: itemTitle, className: b('item') },
|
|
@@ -4,11 +4,12 @@ exports.SecurityBlock = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
+
const models_1 = require("../../models");
|
|
7
8
|
const components_1 = require("../../components");
|
|
8
9
|
const grid_1 = require("../../grid");
|
|
9
10
|
const b = (0, utils_1.block)('SecurityBlock');
|
|
10
11
|
const SecurityBlock = (props) => {
|
|
11
|
-
const { backgroundColor, theme = 'dark', title, points, media, animated } = props;
|
|
12
|
+
const { backgroundColor, theme = 'dark', title, points, media, animated, blockName = models_1.BlockType.SecurityBlock, } = props;
|
|
12
13
|
return (react_1.default.createElement(components_1.AnimateBlock, { className: b({ theme }), offset: 200, animate: animated },
|
|
13
14
|
react_1.default.createElement("div", { className: b('content') },
|
|
14
15
|
react_1.default.createElement(components_1.FullWidthBackground, { className: b('background'), style: { backgroundColor } }),
|
|
@@ -22,7 +23,7 @@ const SecurityBlock = (props) => {
|
|
|
22
23
|
link && (react_1.default.createElement(components_1.Link, { className: b('point-link'), text: link.text, url: link.url, theme: 'normal', arrow: true }))))))),
|
|
23
24
|
media && (react_1.default.createElement(grid_1.Row, { className: b('media') },
|
|
24
25
|
react_1.default.createElement(grid_1.Col, null,
|
|
25
|
-
react_1.default.createElement(components_1.Media, Object.assign({ className: b('media') }, media)))))))));
|
|
26
|
+
react_1.default.createElement(components_1.Media, Object.assign({ className: b('media') }, media, { blockName: blockName })))))))));
|
|
26
27
|
};
|
|
27
28
|
exports.SecurityBlock = SecurityBlock;
|
|
28
29
|
exports.default = exports.SecurityBlock;
|
|
@@ -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("../../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
|
+
name: 'share-button-click',
|
|
28
|
+
type: models_1.PredefinedEventTypes.Default,
|
|
29
|
+
blockName: blockName,
|
|
30
|
+
});
|
|
31
|
+
const handleButtonClick = (0, react_1.useCallback)(() => handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(), [handleAnalytics]);
|
|
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,19 @@ 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("../../hooks");
|
|
9
|
+
const models_1 = require("../../models");
|
|
10
|
+
const COMPONENT_NAME = 'backlink';
|
|
8
11
|
function BackLink(props) {
|
|
9
12
|
const { history } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
10
|
-
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, } = props;
|
|
13
|
+
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, blockName = COMPONENT_NAME, } = props;
|
|
14
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)({
|
|
15
|
+
name: 'back-link-click',
|
|
16
|
+
type: models_1.PredefinedEventTypes.Default,
|
|
17
|
+
blockName: blockName,
|
|
18
|
+
});
|
|
11
19
|
const backActionHandler = (0, react_1.useCallback)(async () => {
|
|
20
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics();
|
|
12
21
|
if (!history) {
|
|
13
22
|
return;
|
|
14
23
|
}
|
|
@@ -21,7 +30,7 @@ function BackLink(props) {
|
|
|
21
30
|
else {
|
|
22
31
|
history.push({ pathname: url });
|
|
23
32
|
}
|
|
24
|
-
}, [history, onClick, url]);
|
|
33
|
+
}, [handleAnalytics, history, onClick, url]);
|
|
25
34
|
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
35
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.ArrowSidebar, size: 24 }),
|
|
27
36
|
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;
|
|
@@ -4,18 +4,24 @@ 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 utils_2 = require("./utils");
|
|
8
9
|
const localeContext_1 = require("../../context/localeContext/localeContext");
|
|
9
10
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
10
11
|
const hooks_1 = require("../../hooks");
|
|
11
12
|
const icons_1 = require("../../icons");
|
|
13
|
+
const COMPONENT_NAME = 'button';
|
|
12
14
|
const b = (0, utils_1.block)('button-block');
|
|
13
15
|
const Button = (props) => {
|
|
14
16
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
15
|
-
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';
|
|
20
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)({
|
|
21
|
+
name: 'button-click',
|
|
22
|
+
type: models_1.PredefinedEventTypes.Default,
|
|
23
|
+
blockName: blockName,
|
|
24
|
+
});
|
|
19
25
|
const onClick = (0, react_1.useCallback)(() => {
|
|
20
26
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
21
27
|
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
|
|
@@ -3,10 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
+
const models_1 = require("../../models");
|
|
6
7
|
const index_1 = require("../index");
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
7
9
|
const b = (0, utils_1.block)('button-tabs');
|
|
10
|
+
const COMPONENT_NAME = 'button-tabs';
|
|
8
11
|
const ButtonTabs = (props) => {
|
|
9
|
-
const { className, items, activeTab, onSelectTab } = props;
|
|
12
|
+
const { className, items, activeTab, onSelectTab, blockName = COMPONENT_NAME } = props;
|
|
13
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)({
|
|
14
|
+
name: 'button-tabs-click',
|
|
15
|
+
type: models_1.PredefinedEventTypes.Default,
|
|
16
|
+
blockName: blockName,
|
|
17
|
+
});
|
|
10
18
|
const activeTabId = (0, react_1.useMemo)(() => {
|
|
11
19
|
if (activeTab) {
|
|
12
20
|
return activeTab;
|
|
@@ -14,10 +22,11 @@ const ButtonTabs = (props) => {
|
|
|
14
22
|
return items[0].id;
|
|
15
23
|
}, [activeTab, items]);
|
|
16
24
|
const handleClick = (0, react_1.useCallback)((tabId) => {
|
|
25
|
+
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics();
|
|
17
26
|
if (onSelectTab) {
|
|
18
27
|
onSelectTab(tabId);
|
|
19
28
|
}
|
|
20
|
-
}, [onSelectTab]);
|
|
29
|
+
}, [handleAnalytics, onSelectTab]);
|
|
21
30
|
return (react_1.default.createElement("div", { className: b(null, className) }, items.map((item) => {
|
|
22
31
|
const isActive = item.id === activeTabId;
|
|
23
32
|
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' }));
|
|
@@ -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
|
export interface CardBaseProps extends CardBaseParams {
|
|
5
5
|
className?: string;
|
|
6
6
|
bodyClassName?: string;
|
|
@@ -10,7 +10,8 @@ export interface CardBaseProps extends CardBaseParams {
|
|
|
10
10
|
target?: HTMLAttributeAnchorTarget;
|
|
11
11
|
metrikaGoals?: MetrikaGoal;
|
|
12
12
|
pixelEvents?: ButtonPixel;
|
|
13
|
-
analyticsEvents?:
|
|
13
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
14
|
+
blockName?: string;
|
|
14
15
|
}
|
|
15
16
|
export interface CardHeaderBaseProps {
|
|
16
17
|
className?: string;
|
|
@@ -7,15 +7,21 @@ const utils_1 = require("../../utils");
|
|
|
7
7
|
const BackgroundImage_1 = tslib_1.__importDefault(require("../BackgroundImage/BackgroundImage"));
|
|
8
8
|
const RouterLink_1 = tslib_1.__importDefault(require("../RouterLink/RouterLink"));
|
|
9
9
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
10
|
+
const common_1 = require("../../models/common");
|
|
10
11
|
const hooks_1 = require("../../hooks");
|
|
12
|
+
const COMPONENT_NAME = 'card-base';
|
|
11
13
|
const b = (0, utils_1.block)('card-base-block');
|
|
12
14
|
const Header = () => null;
|
|
13
15
|
const Content = () => null;
|
|
14
16
|
const Footer = () => null;
|
|
15
17
|
const Layout = (props) => {
|
|
16
|
-
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', } = props;
|
|
18
|
+
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', blockName = COMPONENT_NAME, } = props;
|
|
17
19
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
18
|
-
const handleAnalytics = (0, hooks_1.useAnalytics)(
|
|
20
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)({
|
|
21
|
+
name: 'card-base-click',
|
|
22
|
+
type: common_1.PredefinedEventTypes.Default,
|
|
23
|
+
blockName: blockName,
|
|
24
|
+
});
|
|
19
25
|
let header, content, footer, image, headerClass, footerClass;
|
|
20
26
|
function handleChild(child) {
|
|
21
27
|
switch (child.type) {
|
|
@@ -3,13 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
+
const models_1 = require("../../models");
|
|
6
7
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
7
8
|
const hooks_1 = require("../../hooks");
|
|
8
9
|
const b = (0, utils_1.block)('header-breadcrumbs');
|
|
10
|
+
const COMPONENT_NAME = 'header-breadcrumbs';
|
|
9
11
|
function HeaderBreadcrumbs(props) {
|
|
10
|
-
const { items, metrikaGoals, pixelEvents, analyticsEvents, theme = 'light', className } = props;
|
|
12
|
+
const { items, metrikaGoals, pixelEvents, analyticsEvents, theme = 'light', blockName = COMPONENT_NAME, className, } = props;
|
|
11
13
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
12
|
-
const handleAnalytics = (0, hooks_1.useAnalytics)(
|
|
14
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)({
|
|
15
|
+
name: 'header-breadcrumbs-click',
|
|
16
|
+
type: models_1.PredefinedEventTypes.Default,
|
|
17
|
+
blockName: blockName,
|
|
18
|
+
});
|
|
13
19
|
const onClick = () => {
|
|
14
20
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
15
21
|
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
|