@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
@@ -1,5 +1,5 @@
1
1
  import { PixelEvent } from '../../models';
2
- import { AnalyticsEventV2 } from '../../models/common';
2
+ import { AnalyticsEvent } from '../../models/common';
3
3
  export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
4
4
  export interface YandexFormProps {
5
5
  id: number | string;
@@ -15,7 +15,8 @@ export interface YandexFormProps {
15
15
  onLoad?: () => void;
16
16
  metrikaGoals?: string | string[];
17
17
  pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
18
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
18
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
19
+ blockName?: string;
19
20
  }
20
21
  declare const YandexForm: (props: YandexFormProps) => JSX.Element;
21
22
  export default YandexForm;
@@ -4,17 +4,23 @@ import { LocaleContext } from '../../context/localeContext';
4
4
  import { MobileContext } from '../../context/mobileContext';
5
5
  import { block } from '../../utils';
6
6
  import { useMetrika } from '../../hooks/useMetrika';
7
- import { useAnalytics } from '../..//hooks';
7
+ import { PredefinedEventTypes } from '../../models/common';
8
+ import { useAnalytics } from '../../hooks';
8
9
  export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
9
10
  const CONTAINER_ID = 'pc-yandex-form-container';
11
+ const COMPONENT_NAME = 'yandex-form';
10
12
  const b = block('yandex-form');
11
13
  const YandexForm = (props) => {
12
- const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
14
+ const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, blockName = COMPONENT_NAME, } = props;
13
15
  const formContainerRef = useRef(null);
14
16
  const iframeRef = useRef();
15
17
  const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;
16
18
  const handleMetrika = useMetrika();
17
- const handleAnalytics = useAnalytics();
19
+ const handleAnalytics = useAnalytics({
20
+ name: 'yndex-form-submit',
21
+ type: PredefinedEventTypes.Default,
22
+ blockName: blockName,
23
+ });
18
24
  const isMobile = useContext(MobileContext);
19
25
  const locale = useContext(LocaleContext);
20
26
  const updateFormIframe = useCallback((container) => {
@@ -1,7 +1,7 @@
1
1
  export declare const blockMap: {
2
2
  "slider-block": (props: import("./models").WithChildren<import("./blocks/Slider/Slider").SliderProps>) => JSX.Element;
3
3
  "simple-block": (props: import("./models").WithChildren<import("./models").SimpleBlockProps>) => JSX.Element;
4
- "extended-features-block": ({ title, description, items, colSizes, animated, }: import("./models").ExtendedFeaturesProps) => JSX.Element;
4
+ "extended-features-block": ({ title, description, items, colSizes, animated, blockName, }: import("./models").ExtendedFeaturesProps) => JSX.Element;
5
5
  "promo-features-block": (props: import("./models").PromoFeaturesProps) => JSX.Element;
6
6
  "questions-block": (props: import("./models").QuestionsProps) => JSX.Element;
7
7
  "banner-block": (props: import("./models").BannerBlockProps) => JSX.Element;
@@ -11,14 +11,14 @@ export declare const blockMap: {
11
11
  "info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
12
12
  "security-block": (props: import("./models").SecurityBlockProps) => JSX.Element;
13
13
  "table-block": (props: import("./models").TableBlockProps) => JSX.Element;
14
- "tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, }: import("./models").TabsBlockProps) => JSX.Element;
14
+ "tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, blockName, }: import("./models").TabsBlockProps) => JSX.Element;
15
15
  "link-table-block": ({ items, title, description, linkTheme }: import("./models").LinkTableBlockProps) => JSX.Element;
16
16
  "header-block": (props: import("./models").WithChildren<import("./models").HeaderBlockProps & import("./models").ClassNameProps>) => JSX.Element;
17
17
  "icons-block": ({ title, size, items }: import("./models").IconsBlockProps) => JSX.Element;
18
18
  "header-slider-block": ({ items, arrows, ...props }: import("./models").HeaderSliderBlockProps) => JSX.Element;
19
19
  "card-layout-block": ({ title, description, animated, colSizes, children, }: import("./blocks/CardLayout/CardLayout").CardLayoutBlockProps) => JSX.Element;
20
20
  "content-layout-block": (props: import("./models").ContentLayoutBlockProps) => JSX.Element;
21
- "share-block": ({ items, title }: import("./models").ShareBlockProps) => JSX.Element;
21
+ "share-block": ({ items, title, blockName }: import("./models").ShareBlockProps) => JSX.Element;
22
22
  };
23
23
  export declare const subBlockMap: {
24
24
  divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
@@ -31,10 +31,10 @@ export declare const subBlockMap: {
31
31
  */
32
32
  partner: ({ text, logo, url, border }: import("./models").PartnerProps) => JSX.Element;
33
33
  "price-detailed": (props: import("./models").PriceDetailedProps) => JSX.Element;
34
- "media-card": ({ border, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
34
+ "media-card": ({ border, blockName, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
35
35
  "banner-card": (props: import("./models").BannerCardProps) => JSX.Element;
36
36
  "news-card": (props: import("./models").NewsCardProps) => JSX.Element;
37
- "card-with-image": ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }: import("./models").CardWithImageProps) => JSX.Element;
37
+ "card-with-image": ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, blockName, }: import("./models").CardWithImageProps) => JSX.Element;
38
38
  "background-card": (props: import("./models").BackgroundCardProps) => JSX.Element;
39
39
  "basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
40
40
  content: (props: import("./models").ContentBlockProps & import("./models").ClassNameProps) => JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- import { AnalyticsEventV2 } from '../../models';
2
+ import { AnalyticsEvent } from '../../models';
3
3
  export interface AnalyticsContextProps {
4
- sendEvents?: (e: AnalyticsEventV2 | AnalyticsEventV2[]) => void;
4
+ sendEvents?: (events: AnalyticsEvent[]) => void;
5
+ sendDefaultEvent?: boolean;
5
6
  }
6
7
  export declare const AnalyticsContext: React.Context<AnalyticsContextProps>;
@@ -1,2 +1,2 @@
1
- import { AnalyticsEventV2 } from '../models';
2
- export declare const useAnalytics: () => ((e?: AnalyticsEventV2 | AnalyticsEventV2[]) => void) | undefined;
1
+ import { AnalyticsEvent } from '../models';
2
+ export declare const useAnalytics: (defaultEvent?: AnalyticsEvent) => ((e?: AnalyticsEvent | AnalyticsEvent[]) => void) | undefined;
@@ -1,14 +1,19 @@
1
1
  import { useContext } from 'react';
2
2
  import { AnalyticsContext } from '../context/analyticsContext';
3
- export const useAnalytics = () => {
4
- const { sendEvents } = useContext(AnalyticsContext);
3
+ export const useAnalytics = (defaultEvent) => {
4
+ const { sendEvents, sendDefaultEvent } = useContext(AnalyticsContext);
5
5
  if (!sendEvents) {
6
6
  return undefined;
7
7
  }
8
+ const defaultEvents = defaultEvent && sendDefaultEvent ? [defaultEvent] : [];
8
9
  return (e) => {
9
- if (!e) {
10
+ let events = defaultEvents;
11
+ if (e) {
12
+ events = Array.isArray(e) ? [...events, ...e] : [...events, e];
13
+ }
14
+ if (!events) {
10
15
  return;
11
16
  }
12
- sendEvents(e);
17
+ sendEvents(events);
13
18
  };
14
19
  };
@@ -68,21 +68,19 @@ export type AnalyticsParameter = {
68
68
  key: string;
69
69
  value: string | number | boolean;
70
70
  };
71
+ export declare enum PredefinedEventTypes {
72
+ Default = "default-event",
73
+ Play = "play",
74
+ Stop = "stop"
75
+ }
71
76
  export type AnalyticsCounters = {
72
77
  include?: string[];
73
78
  exclude?: string[];
74
79
  };
75
- export type AnalyticsEvent = {
76
- name: string;
77
- type?: string;
78
- counters?: AnalyticsCounters;
79
- category?: string;
80
- label?: string;
81
- params?: AnalyticsParameter[];
82
- };
83
- export type AnalyticsEventV2<T = {}> = T & {
80
+ export type AnalyticsEvent<T = {}> = T & {
84
81
  name: string;
85
82
  type?: string;
86
83
  counters?: AnalyticsCounters;
84
+ blockName?: string;
87
85
  };
88
86
  export {};
@@ -27,3 +27,9 @@ export var PixelEventType;
27
27
  PixelEventType["Subscribe"] = "Subscribe";
28
28
  PixelEventType["ViewContent"] = "ViewContent";
29
29
  })(PixelEventType || (PixelEventType = {}));
30
+ export var PredefinedEventTypes;
31
+ (function (PredefinedEventTypes) {
32
+ PredefinedEventTypes["Default"] = "default-event";
33
+ PredefinedEventTypes["Play"] = "play";
34
+ PredefinedEventTypes["Stop"] = "stop";
35
+ })(PredefinedEventTypes || (PredefinedEventTypes = {}));
@@ -109,6 +109,7 @@ export interface HeaderBlockProps {
109
109
  verticalOffset?: 's' | 'm' | 'l' | 'xl';
110
110
  breadcrumbs?: HeaderBreadCrumbsProps;
111
111
  status?: JSX.Element;
112
+ blockName?: string;
112
113
  }
113
114
  export type CalculatorProps = Animatable;
114
115
  export interface SimpleBlockProps extends Animatable, Childable {
@@ -127,6 +128,7 @@ export interface ExtendedFeaturesProps extends Animatable {
127
128
  title?: TitleProps | string;
128
129
  description?: string;
129
130
  colSizes?: GridColumnSizesType;
131
+ blockName?: string;
130
132
  }
131
133
  export interface PromoFeaturesItem {
132
134
  title: string;
@@ -139,6 +141,7 @@ export interface PromoFeaturesProps extends Animatable {
139
141
  title?: TitleProps | string;
140
142
  description?: string;
141
143
  theme?: 'grey' | 'default';
144
+ blockName?: string;
142
145
  }
143
146
  export interface QuestionItem {
144
147
  title: string;
@@ -163,6 +166,7 @@ export interface MediaContentProps {
163
166
  links?: LinkProps[];
164
167
  buttons?: ButtonProps[];
165
168
  size?: ContentSize;
169
+ blockName?: string;
166
170
  }
167
171
  export interface MediaBlockProps extends Animatable, MediaContentProps {
168
172
  media: ThemeSupporting<MediaProps>;
@@ -180,6 +184,7 @@ export interface PreviewBlockProps extends Animatable {
180
184
  ratioMediaContent?: PreviewRatioMediaContent;
181
185
  stopVideo?: boolean;
182
186
  showImmediately?: boolean;
187
+ blockName?: string;
183
188
  }
184
189
  export interface InfoBlockProps {
185
190
  theme?: TextTheme;
@@ -194,6 +199,7 @@ export interface InfoBlockProps {
194
199
  links?: Pick<LinkProps, 'text' | 'url'>[];
195
200
  leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
196
201
  rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
202
+ blockName?: string;
197
203
  }
198
204
  export interface SecurityBlockPoint {
199
205
  img: string;
@@ -209,6 +215,7 @@ export interface SecurityBlockProps extends Animatable {
209
215
  title: string;
210
216
  points?: SecurityBlockPoint[];
211
217
  media: MediaProps;
218
+ blockName?: string;
212
219
  }
213
220
  export interface TableProps {
214
221
  content: string[][];
@@ -235,6 +242,7 @@ export interface TabsBlockProps extends BlockHeaderProps, Animatable {
235
242
  centered?: boolean;
236
243
  direction?: MediaDirection;
237
244
  items: TabsBlockItem[];
245
+ blockName?: string;
238
246
  }
239
247
  export interface LinkTableBlockProps extends BlockHeaderProps {
240
248
  items: LinkProps[][];
@@ -264,6 +272,7 @@ export interface ContentLayoutBlockProps {
264
272
  };
265
273
  textContent: ContentBlockProps;
266
274
  fileContent?: FileLinkProps[];
275
+ blockName?: string;
267
276
  }
268
277
  export interface ContentBlockProps {
269
278
  title?: TitleBaseProps | string;
@@ -275,6 +284,7 @@ export interface ContentBlockProps {
275
284
  colSizes?: GridColumnSizesType;
276
285
  centered?: boolean;
277
286
  theme?: ContentTheme;
287
+ blockName?: string;
278
288
  }
279
289
  export declare enum PCShareSocialNetwork {
280
290
  Vk = "vk",
@@ -286,6 +296,7 @@ export declare enum PCShareSocialNetwork {
286
296
  export interface ShareBlockProps {
287
297
  items: PCShareSocialNetwork[];
288
298
  title?: string;
299
+ blockName?: string;
289
300
  }
290
301
  export type HeaderBlockModel = {
291
302
  type: BlockType.HeaderBlock;
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { ButtonSize, ButtonView } from '@gravity-ui/uikit';
3
3
  import { ThemeSupporting } from '../../utils/theme';
4
- import { AnalyticsEventV2, ClassNameProps, PixelEventType } from '../common';
4
+ import { AnalyticsEvent, ClassNameProps, PixelEventType } from '../common';
5
5
  export declare enum AuthorType {
6
6
  Column = "column",
7
7
  Line = "line"
@@ -110,7 +110,8 @@ export interface MediaVideoProps {
110
110
  playButton?: PlayButtonProps;
111
111
  controls?: MediaVideoControlsType;
112
112
  metrika?: MetrikaVideo;
113
- analyticsEvents?: AnalyticsEventV2[];
113
+ analyticsEvents?: AnalyticsEvent[];
114
+ blockName?: string;
114
115
  }
115
116
  export interface LinkProps extends Stylable {
116
117
  url: string;
@@ -122,7 +123,8 @@ export interface LinkProps extends Stylable {
122
123
  target?: string;
123
124
  metrikaGoals?: MetrikaGoal;
124
125
  pixelEvents?: ButtonPixel;
125
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
126
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
127
+ blockName?: string;
126
128
  }
127
129
  export interface FileLinkProps extends ClassNameProps {
128
130
  href: string;
@@ -141,8 +143,9 @@ export interface ButtonProps {
141
143
  img?: ButtonImageProps | string;
142
144
  metrikaGoals?: MetrikaGoal;
143
145
  pixelEvents?: ButtonPixel;
144
- analyticsEvents?: AnalyticsEventV2[];
146
+ analyticsEvents?: AnalyticsEvent[];
145
147
  target?: string;
148
+ blockName?: string;
146
149
  }
147
150
  export interface ButtonImageProps {
148
151
  url: string;
@@ -170,7 +173,8 @@ export interface MediaComponentVideoProps {
170
173
  video: MediaVideoProps;
171
174
  height?: number;
172
175
  metrika?: MetrikaVideo;
173
- analyticsEvents?: AnalyticsEventV2[];
176
+ analyticsEvents?: AnalyticsEvent[];
177
+ blockName?: string;
174
178
  previewImg?: string;
175
179
  }
176
180
  export interface MediaComponentYoutubeProps {
@@ -226,7 +230,8 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
226
230
  theme?: TextTheme;
227
231
  metrikaGoals?: MetrikaGoal;
228
232
  pixelEvents?: ButtonPixel;
229
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
233
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
234
+ blockName?: string;
230
235
  }
231
236
  export interface PreviewContentItemProps {
232
237
  title: string;
@@ -3,7 +3,7 @@ import { ThemeSupporting } from '../../utils';
3
3
  import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
4
4
  import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
5
5
  import { ContentBlockProps } from './blocks';
6
- import { AnalyticsEventV2, PixelEvent } from '../common';
6
+ import { AnalyticsEvent, PixelEvent } from '../common';
7
7
  export declare enum SubBlockType {
8
8
  Divider = "divider",
9
9
  Quote = "quote",
@@ -61,7 +61,8 @@ export interface HubspotFormProps extends HubspotEventHandlers {
61
61
  onLoad?: (arg: HubspotEventData) => void;
62
62
  pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
63
63
  hubspotEvents?: string[];
64
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
64
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
65
+ blockName?: string;
65
66
  }
66
67
  export interface PartnerProps extends CardBaseProps {
67
68
  text: string;
@@ -77,6 +78,7 @@ export interface QuoteProps extends Themable, CardBaseProps {
77
78
  author?: AuthorItem;
78
79
  buttonText?: string;
79
80
  theme?: TextTheme;
81
+ blockName?: string;
80
82
  }
81
83
  export interface NewsCardData {
82
84
  id: number;
@@ -111,6 +113,7 @@ export interface BannerCardProps {
111
113
  color?: ThemeSupporting<string>;
112
114
  theme?: TextTheme;
113
115
  button: Pick<ButtonProps, 'text' | 'url' | 'target'>;
116
+ blockName?: string;
114
117
  }
115
118
  export interface MediaCardProps extends MediaProps, CardBaseProps {
116
119
  }
@@ -118,7 +121,7 @@ export interface CardWithImageLinkProps extends Omit<LinkProps, 'text' | 'url'>
118
121
  title: string;
119
122
  link: string;
120
123
  }
121
- export interface CardWithImageProps extends ClassNameProps, Pick<ContentBlockProps, 'title' | 'additionalInfo' | 'buttons' | 'theme'> {
124
+ export interface CardWithImageProps extends ClassNameProps, Pick<ContentBlockProps, 'title' | 'additionalInfo' | 'buttons' | 'theme' | 'blockName'> {
122
125
  image: string;
123
126
  description?: string;
124
127
  disableCompress?: boolean;
@@ -9,6 +9,7 @@ import SocialIcon from '../SocialIcon/SocialIcon';
9
9
  import { getMediaImage } from '../../../components/Media/Image/utils';
10
10
  import './NavigationItem.css';
11
11
  const b = block('navigation-item');
12
+ const BLOCK_NAME = 'navigation';
12
13
  const Content = ({ text, icon }) => (React.createElement(Fragment, null,
13
14
  icon && typeof icon !== 'string' && React.createElement(Image, Object.assign({ className: b('icon') }, icon)),
14
15
  React.createElement("span", { className: b('text') }, text)));
@@ -37,8 +38,8 @@ const NavigationLink = (props) => {
37
38
  };
38
39
  const NavigationButton = (props) => {
39
40
  const { url, target } = props;
40
- return target ? (React.createElement(Button, Object.assign({}, props, { url: url }))) : (React.createElement(RouterLink, { href: url },
41
- React.createElement(Button, Object.assign({}, props, { url: url }))));
41
+ return target ? (React.createElement(Button, Object.assign({}, props, { url: url, blockName: BLOCK_NAME }))) : (React.createElement(RouterLink, { href: url },
42
+ React.createElement(Button, Object.assign({}, props, { url: url, blockName: BLOCK_NAME }))));
42
43
  };
43
44
  //todo: add types support form component in map
44
45
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -508,10 +508,7 @@ export declare const ButtonProps: {
508
508
  analyticsEvents: {
509
509
  anyOf: ({
510
510
  type: string;
511
- propertyNames: {
512
- type: string;
513
- };
514
- additionalProperty: {
511
+ additionalProperties: {
515
512
  type: string;
516
513
  };
517
514
  required: string[];
@@ -541,15 +538,15 @@ export declare const ButtonProps: {
541
538
  };
542
539
  };
543
540
  };
541
+ blockName: {
542
+ type: string;
543
+ };
544
544
  };
545
545
  } | {
546
546
  type: string;
547
547
  items: {
548
548
  type: string;
549
- propertyNames: {
550
- type: string;
551
- };
552
- additionalProperty: {
549
+ additionalProperties: {
553
550
  type: string;
554
551
  };
555
552
  required: string[];
@@ -579,6 +576,9 @@ export declare const ButtonProps: {
579
576
  };
580
577
  };
581
578
  };
579
+ blockName: {
580
+ type: string;
581
+ };
582
582
  };
583
583
  };
584
584
  })[];
@@ -642,6 +642,9 @@ export declare const BlockBaseProps: {
642
642
  resetPaddings: {
643
643
  type: string;
644
644
  };
645
+ blockName: {
646
+ type: string;
647
+ };
645
648
  type: {};
646
649
  when: {};
647
650
  };
@@ -807,10 +810,7 @@ export declare const ButtonBlock: {
807
810
  analyticsEvents: {
808
811
  anyOf: ({
809
812
  type: string;
810
- propertyNames: {
811
- type: string;
812
- };
813
- additionalProperty: {
813
+ additionalProperties: {
814
814
  type: string;
815
815
  };
816
816
  required: string[];
@@ -840,15 +840,15 @@ export declare const ButtonBlock: {
840
840
  };
841
841
  };
842
842
  };
843
+ blockName: {
844
+ type: string;
845
+ };
843
846
  };
844
847
  } | {
845
848
  type: string;
846
849
  items: {
847
850
  type: string;
848
- propertyNames: {
849
- type: string;
850
- };
851
- additionalProperty: {
851
+ additionalProperties: {
852
852
  type: string;
853
853
  };
854
854
  required: string[];
@@ -878,6 +878,9 @@ export declare const ButtonBlock: {
878
878
  };
879
879
  };
880
880
  };
881
+ blockName: {
882
+ type: string;
883
+ };
881
884
  };
882
885
  };
883
886
  })[];
@@ -1,7 +1,7 @@
1
1
  import { pixelEvents } from './pixel';
2
2
  import { Theme } from '../../models';
3
3
  import { ImageProps, urlPattern } from '../../components/Image/schema';
4
- import { AnalyticsEventV2Schema } from './event';
4
+ import { AnalyticsEventSchema } from './event';
5
5
  export const mediaDirection = ['media-content', 'content-media'];
6
6
  export const textSize = ['s', 'm', 'l'];
7
7
  export const containerSizesArray = ['sm', 'md', 'lg', 'xl', 'all'];
@@ -337,7 +337,7 @@ export const ButtonProps = {
337
337
  */
338
338
  pixelEvents,
339
339
  analyticsEvents: {
340
- anyOf: [AnalyticsEventV2Schema, { type: 'array', items: AnalyticsEventV2Schema }],
340
+ anyOf: [AnalyticsEventSchema, { type: 'array', items: AnalyticsEventSchema }],
341
341
  },
342
342
  target: {
343
343
  type: 'string',
@@ -386,6 +386,8 @@ export const BlockBaseProps = Object.assign(Object.assign({}, BaseProps), { anch
386
386
  enum: containerSizesArray,
387
387
  }, resetPaddings: {
388
388
  type: 'boolean',
389
+ }, blockName: {
390
+ type: 'string',
389
391
  } });
390
392
  export const TitleProps = {
391
393
  type: 'object',
@@ -1,63 +1,6 @@
1
1
  export declare const AnalyticsEventSchema: {
2
2
  type: string;
3
- additionalProperties: boolean;
4
- required: string[];
5
- properties: {
6
- name: {
7
- type: string;
8
- };
9
- type: {
10
- type: string;
11
- };
12
- counters: {
13
- type: string;
14
- additionalProperties: boolean;
15
- required: never[];
16
- properties: {
17
- include: {
18
- type: string;
19
- items: {
20
- type: string;
21
- };
22
- };
23
- exclude: {
24
- type: string;
25
- items: {
26
- type: string;
27
- };
28
- };
29
- };
30
- };
31
- category: {
32
- type: string;
33
- };
34
- label: {
35
- type: string;
36
- };
37
- params: {
38
- type: string;
39
- items: {
40
- type: string;
41
- additionalProperties: boolean;
42
- required: string[];
43
- properties: {
44
- key: {
45
- type: string;
46
- };
47
- value: {
48
- type: string;
49
- };
50
- };
51
- };
52
- };
53
- };
54
- };
55
- export declare const AnalyticsEventV2Schema: {
56
- type: string;
57
- propertyNames: {
58
- type: string;
59
- };
60
- additionalProperty: {
3
+ additionalProperties: {
61
4
  type: string;
62
5
  };
63
6
  required: string[];
@@ -87,5 +30,8 @@ export declare const AnalyticsEventV2Schema: {
87
30
  };
88
31
  };
89
32
  };
33
+ blockName: {
34
+ type: string;
35
+ };
90
36
  };
91
37
  };
@@ -1,6 +1,6 @@
1
1
  export const AnalyticsEventSchema = {
2
2
  type: 'object',
3
- additionalProperties: false,
3
+ additionalProperties: { type: 'string' },
4
4
  required: ['name'],
5
5
  properties: {
6
6
  name: {
@@ -28,60 +28,8 @@ export const AnalyticsEventSchema = {
28
28
  },
29
29
  },
30
30
  },
31
- category: {
31
+ blockName: {
32
32
  type: 'string',
33
33
  },
34
- label: {
35
- type: 'string',
36
- },
37
- params: {
38
- type: 'array',
39
- items: {
40
- type: 'object',
41
- additionalProperties: false,
42
- required: ['key', 'value'],
43
- properties: {
44
- key: {
45
- type: 'string',
46
- },
47
- value: {
48
- type: 'string',
49
- },
50
- },
51
- },
52
- },
53
- },
54
- };
55
- export const AnalyticsEventV2Schema = {
56
- type: 'object',
57
- propertyNames: { type: 'string' },
58
- additionalProperty: { type: 'number' },
59
- required: ['name'],
60
- properties: {
61
- name: {
62
- type: 'string',
63
- },
64
- type: {
65
- type: 'string',
66
- },
67
- counters: {
68
- type: 'object',
69
- additionalProperties: false,
70
- required: [],
71
- properties: {
72
- include: {
73
- type: 'array',
74
- items: {
75
- type: 'string',
76
- },
77
- },
78
- exclude: {
79
- type: 'array',
80
- items: {
81
- type: 'string',
82
- },
83
- },
84
- },
85
- },
86
34
  },
87
35
  };
@@ -1,12 +1,13 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { block, getThemedValue } from '../../utils';
3
3
  import { CardBase, BackgroundImage } from '../../components/';
4
+ import { SubBlockType } from '../../models';
4
5
  import Content from '../Content/Content';
5
6
  import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
6
7
  import './BackgroundCard.css';
7
8
  const b = block('background-card');
8
9
  const BackgroundCard = (props) => {
9
- const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, } = props;
10
+ const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, blockName = SubBlockType.BackgroundCard, } = props;
10
11
  const { themeValue: theme } = useContext(ThemeValueContext);
11
12
  const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
12
13
  const link = hasBackgroundColor || border === 'line' ? undefined : url;
@@ -14,6 +15,6 @@ const BackgroundCard = (props) => {
14
15
  return (React.createElement(CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), url: link, border: borderType },
15
16
  React.createElement(CardBase.Content, null,
16
17
  React.createElement(BackgroundImage, Object.assign({ className: b('image') }, getThemedValue(background, theme), { style: { backgroundColor } })),
17
- React.createElement(Content, { title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: links, buttons: buttons, colSizes: { all: 12, md: 12 } }))));
18
+ React.createElement(Content, { title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, blockName: blockName }))));
18
19
  };
19
20
  export default BackgroundCard;