@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.
Files changed (179) hide show
  1. package/README.md +110 -5
  2. package/build/cjs/blocks/Banner/Banner.js +3 -2
  3. package/build/cjs/blocks/Banner/schema.d.ts +33 -24
  4. package/build/cjs/blocks/Banner/schema.js +3 -1
  5. package/build/cjs/blocks/CardLayout/schema.d.ts +6 -0
  6. package/build/cjs/blocks/ContentLayout/ContentLayout.js +3 -2
  7. package/build/cjs/blocks/ContentLayout/schema.d.ts +3 -0
  8. package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.d.ts +1 -1
  9. package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +3 -2
  10. package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +3 -0
  11. package/build/cjs/blocks/Header/Header.js +6 -5
  12. package/build/cjs/blocks/Header/schema.d.ts +3 -0
  13. package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
  14. package/build/cjs/blocks/Icons/schema.d.ts +6 -0
  15. package/build/cjs/blocks/Info/Info.js +4 -3
  16. package/build/cjs/blocks/Info/schema.d.ts +3 -0
  17. package/build/cjs/blocks/Info/schema.js +2 -0
  18. package/build/cjs/blocks/LinkTable/schema.d.ts +3 -0
  19. package/build/cjs/blocks/Media/Media.js +3 -2
  20. package/build/cjs/blocks/Media/MediaContent.js +3 -2
  21. package/build/cjs/blocks/Media/schema.d.ts +11 -8
  22. package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +2 -1
  23. package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +3 -2
  24. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +1 -0
  25. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +3 -2
  26. package/build/cjs/blocks/Preview/Preview.js +3 -2
  27. package/build/cjs/blocks/Preview/schema.d.ts +3 -0
  28. package/build/cjs/blocks/Preview/schema.js +3 -1
  29. package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +3 -2
  30. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  31. package/build/cjs/blocks/Questions/Questions.js +3 -2
  32. package/build/cjs/blocks/Questions/schema.d.ts +3 -0
  33. package/build/cjs/blocks/Security/Security.js +3 -2
  34. package/build/cjs/blocks/Security/schema.d.ts +3 -0
  35. package/build/cjs/blocks/Security/schema.js +3 -1
  36. package/build/cjs/blocks/Share/Share.d.ts +1 -1
  37. package/build/cjs/blocks/Share/Share.js +10 -2
  38. package/build/cjs/blocks/Simple/schema.d.ts +3 -0
  39. package/build/cjs/blocks/Slider/schema.d.ts +3 -0
  40. package/build/cjs/blocks/Table/schema.d.ts +3 -0
  41. package/build/cjs/blocks/Tabs/Tabs.d.ts +1 -1
  42. package/build/cjs/blocks/Tabs/Tabs.js +5 -4
  43. package/build/cjs/blocks/Tabs/schema.d.ts +3 -0
  44. package/build/cjs/components/BackLink/BackLink.d.ts +1 -0
  45. package/build/cjs/components/BackLink/BackLink.js +11 -2
  46. package/build/cjs/components/BackgroundMedia/BackgroundMedia.js +2 -1
  47. package/build/cjs/components/Button/Button.d.ts +1 -0
  48. package/build/cjs/components/Button/Button.js +8 -2
  49. package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +1 -0
  50. package/build/cjs/components/ButtonTabs/ButtonTabs.js +11 -2
  51. package/build/cjs/components/CardBase/CardBase.d.ts +3 -2
  52. package/build/cjs/components/CardBase/CardBase.js +8 -2
  53. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +8 -2
  54. package/build/cjs/components/Link/Link.js +9 -3
  55. package/build/cjs/components/Media/Media.js +4 -2
  56. package/build/cjs/components/Media/Video/Video.js +5 -3
  57. package/build/cjs/components/ReactPlayer/ReactPlayer.js +14 -26
  58. package/build/cjs/components/YandexForm/YandexForm.d.ts +3 -2
  59. package/build/cjs/components/YandexForm/YandexForm.js +9 -3
  60. package/build/cjs/constructor-items.d.ts +5 -5
  61. package/build/cjs/context/analyticsContext/analyticsContext.d.ts +3 -2
  62. package/build/cjs/hooks/useAnalytics.d.ts +2 -2
  63. package/build/cjs/hooks/useAnalytics.js +9 -4
  64. package/build/cjs/models/common.d.ts +7 -9
  65. package/build/cjs/models/common.js +7 -1
  66. package/build/cjs/models/constructor-items/blocks.d.ts +11 -0
  67. package/build/cjs/models/constructor-items/common.d.ts +11 -6
  68. package/build/cjs/models/constructor-items/sub-blocks.d.ts +6 -3
  69. package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +3 -2
  70. package/build/cjs/schema/validators/common.d.ts +19 -16
  71. package/build/cjs/schema/validators/common.js +3 -1
  72. package/build/cjs/schema/validators/event.d.ts +4 -58
  73. package/build/cjs/schema/validators/event.js +3 -55
  74. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +3 -2
  75. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +3 -0
  76. package/build/cjs/sub-blocks/BackgroundCard/schema.js +2 -0
  77. package/build/cjs/sub-blocks/BannerCard/BannerCard.js +3 -2
  78. package/build/cjs/sub-blocks/BasicCard/BasicCard.js +3 -2
  79. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +1 -1
  80. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +3 -2
  81. package/build/cjs/sub-blocks/Content/Content.js +4 -3
  82. package/build/cjs/sub-blocks/HubspotForm/index.js +7 -2
  83. package/build/cjs/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
  84. package/build/cjs/sub-blocks/MediaCard/MediaCard.js +3 -2
  85. package/build/cjs/sub-blocks/Quote/Quote.js +9 -2
  86. package/build/cjs/sub-blocks/Quote/schema.d.ts +3 -0
  87. package/build/cjs/sub-blocks/Quote/schema.js +3 -1
  88. package/build/esm/blocks/Banner/Banner.js +3 -2
  89. package/build/esm/blocks/Banner/schema.d.ts +33 -24
  90. package/build/esm/blocks/Banner/schema.js +3 -1
  91. package/build/esm/blocks/CardLayout/schema.d.ts +6 -0
  92. package/build/esm/blocks/ContentLayout/ContentLayout.js +3 -2
  93. package/build/esm/blocks/ContentLayout/schema.d.ts +3 -0
  94. package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.d.ts +1 -1
  95. package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +3 -2
  96. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +3 -0
  97. package/build/esm/blocks/Header/Header.js +6 -5
  98. package/build/esm/blocks/Header/schema.d.ts +3 -0
  99. package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
  100. package/build/esm/blocks/Icons/schema.d.ts +6 -0
  101. package/build/esm/blocks/Info/Info.js +4 -3
  102. package/build/esm/blocks/Info/schema.d.ts +3 -0
  103. package/build/esm/blocks/Info/schema.js +2 -0
  104. package/build/esm/blocks/LinkTable/schema.d.ts +3 -0
  105. package/build/esm/blocks/Media/Media.js +3 -2
  106. package/build/esm/blocks/Media/MediaContent.js +3 -2
  107. package/build/esm/blocks/Media/schema.d.ts +11 -8
  108. package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +2 -1
  109. package/build/esm/blocks/Preview/MediaContent/MediaContent.js +3 -2
  110. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +1 -0
  111. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +3 -2
  112. package/build/esm/blocks/Preview/Preview.js +3 -2
  113. package/build/esm/blocks/Preview/schema.d.ts +3 -0
  114. package/build/esm/blocks/Preview/schema.js +3 -1
  115. package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +3 -2
  116. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  117. package/build/esm/blocks/Questions/Questions.js +3 -2
  118. package/build/esm/blocks/Questions/schema.d.ts +3 -0
  119. package/build/esm/blocks/Security/Security.js +3 -2
  120. package/build/esm/blocks/Security/schema.d.ts +3 -0
  121. package/build/esm/blocks/Security/schema.js +3 -1
  122. package/build/esm/blocks/Share/Share.d.ts +1 -1
  123. package/build/esm/blocks/Share/Share.js +11 -3
  124. package/build/esm/blocks/Simple/schema.d.ts +3 -0
  125. package/build/esm/blocks/Slider/schema.d.ts +3 -0
  126. package/build/esm/blocks/Table/schema.d.ts +3 -0
  127. package/build/esm/blocks/Tabs/Tabs.d.ts +1 -1
  128. package/build/esm/blocks/Tabs/Tabs.js +5 -4
  129. package/build/esm/blocks/Tabs/schema.d.ts +3 -0
  130. package/build/esm/components/BackLink/BackLink.d.ts +1 -0
  131. package/build/esm/components/BackLink/BackLink.js +11 -2
  132. package/build/esm/components/BackgroundMedia/BackgroundMedia.js +2 -1
  133. package/build/esm/components/Button/Button.d.ts +1 -0
  134. package/build/esm/components/Button/Button.js +8 -2
  135. package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +1 -0
  136. package/build/esm/components/ButtonTabs/ButtonTabs.js +11 -2
  137. package/build/esm/components/CardBase/CardBase.d.ts +3 -2
  138. package/build/esm/components/CardBase/CardBase.js +8 -2
  139. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +8 -2
  140. package/build/esm/components/Link/Link.js +9 -3
  141. package/build/esm/components/Media/Media.js +4 -2
  142. package/build/esm/components/Media/Video/Video.js +5 -3
  143. package/build/esm/components/ReactPlayer/ReactPlayer.js +15 -27
  144. package/build/esm/components/YandexForm/YandexForm.d.ts +3 -2
  145. package/build/esm/components/YandexForm/YandexForm.js +9 -3
  146. package/build/esm/constructor-items.d.ts +5 -5
  147. package/build/esm/context/analyticsContext/analyticsContext.d.ts +3 -2
  148. package/build/esm/hooks/useAnalytics.d.ts +2 -2
  149. package/build/esm/hooks/useAnalytics.js +9 -4
  150. package/build/esm/models/common.d.ts +7 -9
  151. package/build/esm/models/common.js +6 -0
  152. package/build/esm/models/constructor-items/blocks.d.ts +11 -0
  153. package/build/esm/models/constructor-items/common.d.ts +11 -6
  154. package/build/esm/models/constructor-items/sub-blocks.d.ts +6 -3
  155. package/build/esm/navigation/components/NavigationItem/NavigationItem.js +3 -2
  156. package/build/esm/schema/validators/common.d.ts +19 -16
  157. package/build/esm/schema/validators/common.js +4 -2
  158. package/build/esm/schema/validators/event.d.ts +4 -58
  159. package/build/esm/schema/validators/event.js +2 -54
  160. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +3 -2
  161. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +3 -0
  162. package/build/esm/sub-blocks/BackgroundCard/schema.js +2 -0
  163. package/build/esm/sub-blocks/BannerCard/BannerCard.js +3 -2
  164. package/build/esm/sub-blocks/BasicCard/BasicCard.js +3 -2
  165. package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +1 -1
  166. package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +3 -2
  167. package/build/esm/sub-blocks/Content/Content.js +4 -3
  168. package/build/esm/sub-blocks/HubspotForm/index.js +7 -2
  169. package/build/esm/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
  170. package/build/esm/sub-blocks/MediaCard/MediaCard.js +3 -2
  171. package/build/esm/sub-blocks/Quote/Quote.js +11 -4
  172. package/build/esm/sub-blocks/Quote/schema.d.ts +3 -0
  173. package/build/esm/sub-blocks/Quote/schema.js +3 -1
  174. package/package.json +1 -1
  175. package/server/models/common.d.ts +7 -9
  176. package/server/models/common.js +7 -1
  177. package/server/models/constructor-items/blocks.d.ts +11 -0
  178. package/server/models/constructor-items/common.d.ts +11 -6
  179. 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
- propertyNames: {
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
- propertyNames: {
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') },
@@ -4,6 +4,7 @@ interface PreviewMediaProps {
4
4
  media: MediaProps;
5
5
  play: boolean;
6
6
  mods: Modifiers | null;
7
+ blockName?: string;
7
8
  }
8
9
  declare const PreviewMedia: (props: PreviewMediaProps) => JSX.Element;
9
10
  export default PreviewMedia;
@@ -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) {
@@ -30,6 +30,9 @@ export declare const PreviewBlock: {
30
30
  };
31
31
  };
32
32
  };
33
+ blockName: {
34
+ type: string;
35
+ };
33
36
  animated: {
34
37
  type: string;
35
38
  };
@@ -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;
@@ -222,6 +222,9 @@ export declare const PromoFeaturesBlock: {
222
222
  resetPaddings: {
223
223
  type: string;
224
224
  };
225
+ blockName: {
226
+ type: string;
227
+ };
225
228
  type: {};
226
229
  when: {};
227
230
  };
@@ -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') },
@@ -91,6 +91,9 @@ export declare const QuestionsBlock: {
91
91
  resetPaddings: {
92
92
  type: string;
93
93
  };
94
+ blockName: {
95
+ type: string;
96
+ };
94
97
  type: {};
95
98
  when: {};
96
99
  };
@@ -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;
@@ -160,6 +160,9 @@ export declare const SecurityBlock: {
160
160
  };
161
161
  };
162
162
  };
163
+ blockName: {
164
+ type: string;
165
+ };
163
166
  animated: {
164
167
  type: string;
165
168
  };
@@ -27,6 +27,8 @@ exports.SecurityBlock = {
27
27
  },
28
28
  link: lodash_1.default.pick(common_1.LinkProps, ['text', 'url']),
29
29
  },
30
- }) }),
30
+ }), blockName: {
31
+ type: 'string',
32
+ } }),
31
33
  },
32
34
  };
@@ -1,3 +1,3 @@
1
1
  import { ShareBlockProps } from '../../models';
2
- declare const Share: ({ items, title }: ShareBlockProps) => JSX.Element;
2
+ declare const Share: ({ items, title, blockName }: ShareBlockProps) => JSX.Element;
3
3
  export default Share;
@@ -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;
@@ -33,6 +33,9 @@ export declare const SimpleBlock: {
33
33
  resetPaddings: {
34
34
  type: string;
35
35
  };
36
+ blockName: {
37
+ type: string;
38
+ };
36
39
  type: {};
37
40
  when: {};
38
41
  title: {
@@ -211,6 +211,9 @@ export declare const SliderBlock: {
211
211
  resetPaddings: {
212
212
  type: string;
213
213
  };
214
+ blockName: {
215
+ type: string;
216
+ };
214
217
  type: {};
215
218
  when: {};
216
219
  };
@@ -64,6 +64,9 @@ export declare const TableBlock: {
64
64
  resetPaddings: {
65
65
  type: string;
66
66
  };
67
+ blockName: {
68
+ type: string;
69
+ };
67
70
  type: {};
68
71
  when: {};
69
72
  };
@@ -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))));
@@ -341,6 +341,9 @@ export declare const TabsBlock: {
341
341
  resetPaddings: {
342
342
  type: string;
343
343
  };
344
+ blockName: {
345
+ type: string;
346
+ };
344
347
  type: {};
345
348
  when: {};
346
349
  };
@@ -9,5 +9,6 @@ export interface BackLinkProps {
9
9
  className?: string;
10
10
  shouldHandleBackAction?: boolean;
11
11
  onClick?: () => void;
12
+ blockName?: string;
12
13
  }
13
14
  export default function BackLink(props: BackLinkProps): JSX.Element;
@@ -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;
@@ -3,6 +3,7 @@ export interface ButtonProps extends Omit<ButtonParams, 'url'> {
3
3
  className?: string;
4
4
  url?: string;
5
5
  onClick?: () => void;
6
+ blockName?: string;
6
7
  }
7
8
  declare const Button: (props: ButtonProps) => JSX.Element;
8
9
  export default Button;
@@ -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);
@@ -8,6 +8,7 @@ export interface ButtonTabsProps {
8
8
  items: ButtonTabsItemProps[];
9
9
  activeTab?: string;
10
10
  onSelectTab?: (tabId: string) => void;
11
+ blockName?: string;
11
12
  }
12
13
  declare const ButtonTabs: (props: ButtonTabsProps) => JSX.Element;
13
14
  export default ButtonTabs;
@@ -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 { AnalyticsEventV2 } from '../../models/common';
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?: AnalyticsEventV2 | AnalyticsEventV2[];
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);