@gravity-ui/page-constructor 1.15.0-alpha.1 → 1.15.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +27 -0
  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 +9 -0
  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 +15 -0
  71. package/build/cjs/schema/validators/common.js +3 -1
  72. package/build/cjs/schema/validators/event.d.ts +3 -54
  73. package/build/cjs/schema/validators/event.js +3 -54
  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 +27 -0
  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 +9 -0
  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 +15 -0
  157. package/build/esm/schema/validators/common.js +4 -2
  158. package/build/esm/schema/validators/event.d.ts +3 -54
  159. package/build/esm/schema/validators/event.js +2 -53
  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,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnalyticsEventV2Schema = exports.AnalyticsEventSchema = void 0;
3
+ exports.AnalyticsEventSchema = void 0;
4
4
  exports.AnalyticsEventSchema = {
5
5
  type: 'object',
6
- additionalProperties: false,
6
+ additionalProperties: { type: 'string' },
7
7
  required: ['name'],
8
8
  properties: {
9
9
  name: {
@@ -31,59 +31,8 @@ exports.AnalyticsEventSchema = {
31
31
  },
32
32
  },
33
33
  },
34
- category: {
35
- type: 'string',
36
- },
37
- label: {
34
+ blockName: {
38
35
  type: 'string',
39
36
  },
40
- params: {
41
- type: 'array',
42
- items: {
43
- type: 'object',
44
- additionalProperties: false,
45
- required: ['key', 'value'],
46
- properties: {
47
- key: {
48
- type: 'string',
49
- },
50
- value: {
51
- type: 'string',
52
- },
53
- },
54
- },
55
- },
56
- },
57
- };
58
- exports.AnalyticsEventV2Schema = {
59
- type: 'object',
60
- additionalProperties: { type: 'string' },
61
- required: ['name'],
62
- properties: {
63
- name: {
64
- type: 'string',
65
- },
66
- type: {
67
- type: 'string',
68
- },
69
- counters: {
70
- type: 'object',
71
- additionalProperties: false,
72
- required: [],
73
- properties: {
74
- include: {
75
- type: 'array',
76
- items: {
77
- type: 'string',
78
- },
79
- },
80
- exclude: {
81
- type: 'array',
82
- items: {
83
- type: 'string',
84
- },
85
- },
86
- },
87
- },
88
37
  },
89
38
  };
@@ -4,11 +4,12 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const utils_1 = require("../../utils");
6
6
  const components_1 = require("../../components/");
7
+ const models_1 = require("../../models");
7
8
  const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
8
9
  const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
9
10
  const b = (0, utils_1.block)('background-card');
10
11
  const BackgroundCard = (props) => {
11
- const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, } = props;
12
+ const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, blockName = models_1.SubBlockType.BackgroundCard, } = props;
12
13
  const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
13
14
  const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
14
15
  const link = hasBackgroundColor || border === 'line' ? undefined : url;
@@ -16,6 +17,6 @@ const BackgroundCard = (props) => {
16
17
  return (react_1.default.createElement(components_1.CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), url: link, border: borderType },
17
18
  react_1.default.createElement(components_1.CardBase.Content, null,
18
19
  react_1.default.createElement(components_1.BackgroundImage, Object.assign({ className: b('image') }, (0, utils_1.getThemedValue)(background, theme), { style: { backgroundColor } })),
19
- react_1.default.createElement(Content_1.default, { title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: links, buttons: buttons, colSizes: { all: 12, md: 12 } }))));
20
+ react_1.default.createElement(Content_1.default, { title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, blockName: blockName }))));
20
21
  };
21
22
  exports.default = BackgroundCard;
@@ -38,6 +38,9 @@ export declare const BackgroundCard: {
38
38
  type: string;
39
39
  enum: string[];
40
40
  };
41
+ blockName: {
42
+ type: string;
43
+ };
41
44
  title: {
42
45
  oneOf: ({
43
46
  type: string;
@@ -18,6 +18,8 @@ exports.BackgroundCard = {
18
18
  }, paddingBottom: {
19
19
  type: 'string',
20
20
  enum: ['s', 'm', 'l', 'xl'],
21
+ }, blockName: {
22
+ type: 'string',
21
23
  } }),
22
24
  },
23
25
  };
@@ -4,11 +4,12 @@ exports.BannerCard = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(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 ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
9
10
  const b = (0, utils_1.block)('banner-card');
10
11
  const BannerCard = (props) => {
11
- const { title, subtitle, button: { url, text, target }, color, theme: textTheme = 'light', image, disableCompress, } = props;
12
+ const { title, subtitle, button: { url, text, target }, color, theme: textTheme = 'light', image, disableCompress, blockName = models_1.SubBlockType.BannerCard, } = props;
12
13
  const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
13
14
  const contentStyle = {};
14
15
  if (color) {
@@ -21,7 +22,7 @@ const BannerCard = (props) => {
21
22
  react_1.default.createElement("h2", { className: b('title') },
22
23
  react_1.default.createElement(components_1.HTML, null, title)),
23
24
  subtitle && (react_1.default.createElement(components_1.YFMWrapper, { className: b('subtitle'), content: subtitle, modifiers: { constructor: true } }))),
24
- react_1.default.createElement(components_1.Button, { className: b('button'), theme: "raised", size: "xl", text: text, url: url, target: target })),
25
+ react_1.default.createElement(components_1.Button, { className: b('button'), theme: "raised", size: "xl", text: text, url: url, target: target, blockName: blockName })),
25
26
  react_1.default.createElement(components_1.BackgroundImage, { className: b('image'), src: (0, utils_1.getThemedValue)(image, theme), disableCompress: disableCompress }))));
26
27
  };
27
28
  exports.BannerCard = BannerCard;
@@ -4,16 +4,17 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importDefault(require("react"));
5
5
  const utils_1 = require("../../utils");
6
6
  const CardBase_1 = tslib_1.__importDefault(require("../../components/CardBase/CardBase"));
7
+ const models_1 = require("../../models");
7
8
  const Image_1 = tslib_1.__importDefault(require("../../components/Image/Image"));
8
9
  const __1 = require("../");
9
10
  const utils_2 = require("../../components/Media/Image/utils");
10
11
  const b = (0, utils_1.block)('basic-card');
11
12
  const BasicCard = (props) => {
12
- const { url, title, text, border, icon, additionalInfo, links, buttons } = props;
13
+ const { url, title, text, border, icon, additionalInfo, links, buttons, blockName = models_1.SubBlockType.BasicCard, } = props;
13
14
  const iconProps = icon && (0, utils_2.getMediaImage)(icon);
14
15
  return (react_1.default.createElement(CardBase_1.default, { className: b(), url: url, border: border },
15
16
  react_1.default.createElement(CardBase_1.default.Content, null,
16
17
  iconProps && react_1.default.createElement(Image_1.default, Object.assign({}, iconProps, { className: b('icon') })),
17
- react_1.default.createElement(__1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, size: "s" }))));
18
+ react_1.default.createElement(__1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, size: "s", blockName: blockName }))));
18
19
  };
19
20
  exports.default = BasicCard;
@@ -1,3 +1,3 @@
1
1
  import { CardWithImageProps } from '../../models';
2
- declare const CardWithImage: ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }: CardWithImageProps) => JSX.Element;
2
+ declare const CardWithImage: ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, blockName, }: CardWithImageProps) => JSX.Element;
3
3
  export default CardWithImage;
@@ -3,14 +3,15 @@ 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 components_1 = require("../../components");
7
8
  const __1 = require("../");
8
9
  const b = (0, utils_1.block)('card-with-image');
9
- const CardWithImage = ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }) => {
10
+ const CardWithImage = ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, blockName = models_1.SubBlockType.CardWithImage, }) => {
10
11
  const unifiedLinks = links === null || links === void 0 ? void 0 : links.map((link) => (Object.assign(Object.assign({ theme: 'normal' }, link), { text: link.title, url: link.link })));
11
12
  return (react_1.default.createElement("div", { className: b(null, className) },
12
13
  react_1.default.createElement("div", { className: b('image', { border }) }, fullScreen ? (react_1.default.createElement(components_1.FullscreenImage, { src: image, imageClassName: b('image-item'), disableCompress: disableCompress })) : (react_1.default.createElement(components_1.Image, { className: b('image-item'), src: image, alt: 'card-image', disableCompress: disableCompress }))),
13
14
  react_1.default.createElement("div", { className: b('content') },
14
- react_1.default.createElement(__1.Content, { title: title, text: description, links: unifiedLinks, additionalInfo: additionalInfo, buttons: buttons, size: "s", colSizes: { all: 12, md: 12 } }))));
15
+ react_1.default.createElement(__1.Content, { title: title, text: description, links: unifiedLinks, additionalInfo: additionalInfo, buttons: buttons, size: "s", colSizes: { all: 12, md: 12 }, blockName: blockName }))));
15
16
  };
16
17
  exports.default = CardWithImage;
@@ -3,6 +3,7 @@ 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 components_1 = require("../../components");
7
8
  const Link_1 = tslib_1.__importDefault(require("../../components/Link/Link"));
8
9
  const grid_1 = require("../../grid");
@@ -35,7 +36,7 @@ function getButtonSize(size) {
35
36
  }
36
37
  }
37
38
  const Content = (props) => {
38
- const { title, text, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, } = props;
39
+ const { title, text, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, blockName = models_1.SubBlockType.Content, } = props;
39
40
  const titleProps = tslib_1.__rest(!title || typeof title === 'string'
40
41
  ? { text: title, textSize: getTextSize(size) }
41
42
  : title, []);
@@ -50,7 +51,7 @@ const Content = (props) => {
50
51
  'constructor-notice': true,
51
52
  [`constructor-size-${size}`]: true,
52
53
  } }))),
53
- links && (react_1.default.createElement("div", { className: b('links') }, links.map((link) => (react_1.default.createElement(Link_1.default, Object.assign({ className: b('link') }, link, { textSize: getLinkSize(size), key: link.url })))))),
54
- buttons && (react_1.default.createElement("div", { className: b('buttons') }, buttons.map((item) => (react_1.default.createElement(components_1.Button, Object.assign({ className: b('button') }, item, { key: item.url, size: getButtonSize(size) }))))))));
54
+ links && (react_1.default.createElement("div", { className: b('links') }, links.map((link) => (react_1.default.createElement(Link_1.default, Object.assign({ className: b('link') }, link, { textSize: getLinkSize(size), key: link.url, blockName: blockName })))))),
55
+ buttons && (react_1.default.createElement("div", { className: b('buttons') }, buttons.map((item) => (react_1.default.createElement(components_1.Button, Object.assign({ className: b('button') }, item, { key: item.url, size: getButtonSize(size), blockName: blockName }))))))));
55
56
  };
56
57
  exports.default = Content;
@@ -6,15 +6,20 @@ const utils_1 = require("../../utils");
6
6
  const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
7
7
  const mobileContext_1 = require("../../context/mobileContext");
8
8
  const useMetrika_1 = require("../../hooks/useMetrika");
9
+ const models_1 = require("../../models");
9
10
  const hooks_1 = require("../../hooks");
10
11
  const HubspotFormContainer_1 = tslib_1.__importDefault(require("./HubspotFormContainer"));
11
12
  const b = (0, utils_1.block)('hubspot-form');
12
13
  const HubspotForm = (props) => {
13
14
  const { className, theme: themeProp, isMobile: isMobileProp, formId, formInstanceId, portalId, region, formClassName, pixelEvents,
14
15
  // hubspotEvents, // TODO: decide how to handle them
15
- analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, } = props;
16
+ analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, blockName = models_1.SubBlockType.HubspotForm, } = props;
16
17
  const handleMetrika = (0, useMetrika_1.useMetrika)();
17
- const handleAnalytics = (0, hooks_1.useAnalytics)();
18
+ const handleAnalytics = (0, hooks_1.useAnalytics)({
19
+ name: 'hubspot-form-submit',
20
+ type: models_1.PredefinedEventTypes.Default,
21
+ blockName: blockName,
22
+ });
18
23
  const { themeValue } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
19
24
  const isMobileValue = (0, react_1.useContext)(mobileContext_1.MobileContext);
20
25
  const theme = themeProp !== null && themeProp !== void 0 ? themeProp : themeValue;
@@ -1,3 +1,3 @@
1
1
  import { MediaCardProps } from '../../models';
2
- declare const MediaCard: ({ border, ...mediaProps }: MediaCardProps) => JSX.Element;
2
+ declare const MediaCard: ({ border, blockName, ...mediaProps }: MediaCardProps) => JSX.Element;
3
3
  export default MediaCard;
@@ -2,13 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importDefault(require("react"));
5
+ const models_1 = require("../../models");
5
6
  const utils_1 = require("../../utils");
6
7
  const components_1 = require("../../components");
7
8
  const b = (0, utils_1.block)('MediaCard');
8
9
  const MediaCard = (_a) => {
9
- var { border } = _a, mediaProps = tslib_1.__rest(_a, ["border"]);
10
+ var { border, blockName = models_1.SubBlockType.MediaCard } = _a, mediaProps = tslib_1.__rest(_a, ["border", "blockName"]);
10
11
  return (react_1.default.createElement(components_1.CardBase, { className: b(), bodyClassName: b('body'), border: border },
11
12
  react_1.default.createElement(components_1.CardBase.Content, null,
12
- react_1.default.createElement(components_1.Media, Object.assign({}, mediaProps)))));
13
+ react_1.default.createElement(components_1.Media, Object.assign({}, mediaProps, { blockName: blockName })))));
13
14
  };
14
15
  exports.default = MediaCard;
@@ -8,15 +8,22 @@ const models_1 = require("../../models");
8
8
  const components_1 = require("../../components");
9
9
  const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
10
10
  const utils_2 = require("../../components/Media/Image/utils");
11
+ const hooks_1 = require("../../hooks");
11
12
  const b = (0, utils_1.block)('quote');
12
13
  const Quote = (props) => {
13
- const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, buttonText, } = props;
14
+ const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, buttonText, blockName = models_1.SubBlockType.Quote, } = props;
14
15
  const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
15
16
  const imageThemed = (0, utils_1.getThemedValue)(image, theme);
16
17
  const imageData = (0, utils_2.getMediaImage)(imageThemed);
18
+ const handleAnalytics = (0, hooks_1.useAnalytics)({
19
+ name: 'quote-button-click',
20
+ type: models_1.PredefinedEventTypes.Default,
21
+ blockName: blockName,
22
+ });
23
+ const handleButtonClick = (0, react_1.useCallback)(() => handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(), [handleAnalytics]);
17
24
  const renderFooter = Boolean(author || url) && (react_1.default.createElement("div", { className: b('author-wrapper') },
18
25
  author && (react_1.default.createElement(components_1.Author, { className: b('author', { theme: textTheme }), author: author, type: models_1.AuthorType.Line })),
19
- url && buttonText && (react_1.default.createElement(uikit_1.Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }) }, buttonText))));
26
+ url && buttonText && (react_1.default.createElement(uikit_1.Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick }, buttonText))));
20
27
  return (react_1.default.createElement("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {} },
21
28
  react_1.default.createElement("div", { key: text, className: b('content-wrapper') },
22
29
  react_1.default.createElement("div", null,
@@ -64,6 +64,9 @@ export declare const Quote: {
64
64
  };
65
65
  };
66
66
  };
67
+ blockName: {
68
+ type: string;
69
+ };
67
70
  type: {};
68
71
  when: {};
69
72
  };
@@ -18,6 +18,8 @@ exports.Quote = {
18
18
  }, url: {
19
19
  type: 'string',
20
20
  pattern: schema_1.urlPattern,
21
- }, theme: common_1.ThemeProps, author: common_1.authorItem }),
21
+ }, theme: common_1.ThemeProps, author: common_1.authorItem, blockName: {
22
+ type: 'string',
23
+ } }),
22
24
  },
23
25
  };
@@ -1,13 +1,14 @@
1
1
  import { __rest } from "tslib";
2
2
  import React from 'react';
3
3
  import { block } from '../../utils';
4
+ import { BlockType } from '../../models';
4
5
  import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
5
6
  import { BannerCard } from '../../sub-blocks';
6
7
  import './Banner.css';
7
8
  const b = block('banner-block');
8
9
  export const BannerBlock = (props) => {
9
- const { animated } = props, bannerProps = __rest(props, ["animated"]);
10
+ const { animated, blockName = BlockType.BannerBlock } = props, bannerProps = __rest(props, ["animated", "blockName"]);
10
11
  return (React.createElement(AnimateBlock, { className: b(), animate: animated },
11
- React.createElement(BannerCard, Object.assign({}, bannerProps))));
12
+ React.createElement(BannerCard, Object.assign({}, bannerProps, { blockName: blockName }))));
12
13
  };
13
14
  export default BannerBlock;
@@ -206,6 +206,9 @@ export declare const BannerCardProps: {
206
206
  };
207
207
  };
208
208
  };
209
+ blockName: {
210
+ type: string;
211
+ };
209
212
  };
210
213
  } | {
211
214
  type: string;
@@ -241,6 +244,9 @@ export declare const BannerCardProps: {
241
244
  };
242
245
  };
243
246
  };
247
+ blockName: {
248
+ type: string;
249
+ };
244
250
  };
245
251
  };
246
252
  })[];
@@ -264,6 +270,9 @@ export declare const BannerCardProps: {
264
270
  required: string[];
265
271
  };
266
272
  };
273
+ blockName: {
274
+ type: string;
275
+ };
267
276
  animated: {
268
277
  type: string;
269
278
  };
@@ -480,6 +489,9 @@ export declare const BannerBlock: {
480
489
  };
481
490
  };
482
491
  };
492
+ blockName: {
493
+ type: string;
494
+ };
483
495
  };
484
496
  } | {
485
497
  type: string;
@@ -515,6 +527,9 @@ export declare const BannerBlock: {
515
527
  };
516
528
  };
517
529
  };
530
+ blockName: {
531
+ type: string;
532
+ };
518
533
  };
519
534
  };
520
535
  })[];
@@ -538,6 +553,9 @@ export declare const BannerBlock: {
538
553
  required: string[];
539
554
  };
540
555
  };
556
+ blockName: {
557
+ type: string;
558
+ };
541
559
  animated: {
542
560
  type: string;
543
561
  };
@@ -755,6 +773,9 @@ export declare const BannerCard: {
755
773
  };
756
774
  };
757
775
  };
776
+ blockName: {
777
+ type: string;
778
+ };
758
779
  };
759
780
  } | {
760
781
  type: string;
@@ -790,6 +811,9 @@ export declare const BannerCard: {
790
811
  };
791
812
  };
792
813
  };
814
+ blockName: {
815
+ type: string;
816
+ };
793
817
  };
794
818
  };
795
819
  })[];
@@ -813,6 +837,9 @@ export declare const BannerCard: {
813
837
  required: string[];
814
838
  };
815
839
  };
840
+ blockName: {
841
+ type: string;
842
+ };
816
843
  animated: {
817
844
  type: string;
818
845
  };
@@ -17,7 +17,9 @@ export const BannerCardProps = {
17
17
  }), theme: ThemeProps, width: {
18
18
  type: 'string',
19
19
  enum: ['s', 'm', 'l'],
20
- }, button: ButtonBlock }),
20
+ }, button: ButtonBlock, blockName: {
21
+ type: 'string',
22
+ } }),
21
23
  };
22
24
  export const BannerBlock = {
23
25
  'banner-block': BannerCardProps,
@@ -66,6 +66,9 @@ export declare const CardLayoutProps: {
66
66
  resetPaddings: {
67
67
  type: string;
68
68
  };
69
+ blockName: {
70
+ type: string;
71
+ };
69
72
  type: {};
70
73
  when: {};
71
74
  };
@@ -139,6 +142,9 @@ export declare const CardLayoutBlock: {
139
142
  resetPaddings: {
140
143
  type: string;
141
144
  };
145
+ blockName: {
146
+ type: string;
147
+ };
142
148
  type: {};
143
149
  when: {};
144
150
  };
@@ -1,5 +1,6 @@
1
1
  import React, { useContext, useMemo } from 'react';
2
2
  import { block } from '../../utils';
3
+ import { BlockType } from '../../models';
3
4
  import { Content } from '../../sub-blocks';
4
5
  import { BackgroundImage, FileLink } from '../../components';
5
6
  import { Col } from '../../grid';
@@ -28,11 +29,11 @@ function getTextWidth(size) {
28
29
  }
29
30
  export const ContentLayoutBlock = (props) => {
30
31
  const isMobile = useContext(MobileContext);
31
- const { textContent, fileContent, properties: cardLayoutProperties = { size: 'l' } } = props;
32
+ const { textContent, fileContent, properties: cardLayoutProperties = { size: 'l' }, blockName = BlockType.ContentLayoutBlock, } = props;
32
33
  const { size = 'l', background, centered, theme = 'default', textWidth = 'm', } = cardLayoutProperties;
33
34
  const colSizes = useMemo(() => getTextWidth(textWidth), [textWidth]);
34
35
  return (React.createElement("div", { className: b({ size, background: Boolean(background) }) },
35
- React.createElement(Content, Object.assign({ className: b('content') }, textContent, { size: size, centered: centered, colSizes: colSizes, theme: theme })),
36
+ React.createElement(Content, Object.assign({ className: b('content') }, textContent, { size: size, centered: centered, colSizes: colSizes, theme: theme, blockName: blockName })),
36
37
  fileContent && (React.createElement(Col, { className: b('files', { size, centered }), reset: true, sizes: colSizes }, fileContent.map((file) => (React.createElement(FileLink, Object.assign({ className: b('file') }, file, { key: file.href, type: "horizontal", textSize: getFileTextSize(size), theme: theme })))))),
37
38
  background && (React.createElement("div", { className: b('background') },
38
39
  React.createElement(BackgroundImage, Object.assign({ className: b('background-item') }, background, { hide: isMobile }))))));
@@ -144,6 +144,9 @@ export declare const ContentLayoutBlock: {
144
144
  resetPaddings: {
145
145
  type: string;
146
146
  };
147
+ blockName: {
148
+ type: string;
149
+ };
147
150
  type: {};
148
151
  when: {};
149
152
  };
@@ -1,4 +1,4 @@
1
1
  import { ExtendedFeaturesProps } from '../../models';
2
2
  import './ExtendedFeatures.css';
3
- export declare const ExtendedFeaturesBlock: ({ title, description, items, colSizes, animated, }: ExtendedFeaturesProps) => JSX.Element;
3
+ export declare const ExtendedFeaturesBlock: ({ title, description, items, colSizes, animated, blockName, }: ExtendedFeaturesProps) => JSX.Element;
4
4
  export default ExtendedFeaturesBlock;
@@ -1,5 +1,6 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { block, getThemedValue } from '../../utils';
3
+ import { BlockType } from '../../models';
3
4
  import { Row, Col } from '../../grid';
4
5
  import { AnimateBlock, BlockHeader, HTML } from '../../components/';
5
6
  import { Content } from '../../sub-blocks';
@@ -13,7 +14,7 @@ const DEFAULT_SIZES = {
13
14
  sm: 6,
14
15
  md: 4,
15
16
  };
16
- export const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DEFAULT_SIZES, animated, }) => {
17
+ export const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DEFAULT_SIZES, animated, blockName = BlockType.ExtendedFeaturesBlock, }) => {
17
18
  const { themeValue: theme } = useContext(ThemeValueContext);
18
19
  return (React.createElement(AnimateBlock, { className: b(), animate: animated },
19
20
  React.createElement(BlockHeader, { title: title, description: description, className: b('header') }),
@@ -31,7 +32,7 @@ export const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DE
31
32
  itemTitle && (React.createElement("h5", { className: b('item-title') },
32
33
  React.createElement(HTML, null, itemTitle),
33
34
  label && (React.createElement("div", { className: b('item-label') }, label)))),
34
- React.createElement(Content, { text: text, links: itemLinks, size: "s", colSizes: { all: 12, md: 12 }, buttons: buttons, additionalInfo: additionalInfo }))));
35
+ React.createElement(Content, { text: text, links: itemLinks, size: "s", colSizes: { all: 12, md: 12 }, buttons: buttons, additionalInfo: additionalInfo, blockName: blockName }))));
35
36
  })))));
36
37
  };
37
38
  export default ExtendedFeaturesBlock;
@@ -124,6 +124,9 @@ export declare const ExtendedFeaturesBlock: {
124
124
  resetPaddings: {
125
125
  type: string;
126
126
  };
127
+ blockName: {
128
+ type: string;
129
+ };
127
130
  type: {};
128
131
  when: {};
129
132
  };
@@ -1,5 +1,6 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { block, getThemedValue } from '../../utils';
3
+ import { BlockType, } from '../../models';
3
4
  import { Button, Media, RouterLink, HTML } from '../../components';
4
5
  import { Grid, Row, Col } from '../../grid';
5
6
  import { getImageSize, getTitleSizes, titleWithImageSizes } from './utils';
@@ -10,15 +11,15 @@ import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
10
11
  import { getMediaImage } from '../../components/Media/Image/utils';
11
12
  import './Header.css';
12
13
  const b = block('header-block');
13
- const Background = ({ background, isMobile }) => {
14
+ const Background = ({ background, isMobile, blockName }) => {
14
15
  const { url, image, fullWidthMedia, video, color } = background;
15
16
  const imageObject = url ? getMediaImage(url) : image;
16
17
  const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);
17
- return (React.createElement("div", { className: b('background', { media: true, 'full-width-media': fullWidthMedia }), style: { backgroundColor: color } }, renderMedia && (React.createElement(Media, Object.assign({}, background, { className: b('background-media'), imageClassName: b('image'), videoClassName: b('video'), isBackground: true, parallax: false, video: isMobile ? undefined : video, image: imageObject })))));
18
+ return (React.createElement("div", { className: b('background', { media: true, 'full-width-media': fullWidthMedia }), style: { backgroundColor: color } }, renderMedia && (React.createElement(Media, Object.assign({}, background, { className: b('background-media'), imageClassName: b('image'), videoClassName: b('video'), isBackground: true, parallax: false, video: isMobile ? undefined : video, image: imageObject, blockName: blockName })))));
18
19
  };
19
20
  const FullWidthBackground = ({ background }) => (React.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
20
21
  export const HeaderBlock = (props) => {
21
- const { title, overtitle, description, buttons, image, video, width = 'm', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, children, } = props;
22
+ const { title, overtitle, description, buttons, image, video, width = 'm', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, children, blockName = BlockType.HeaderBlock, } = props;
22
23
  const isMobile = useContext(MobileContext);
23
24
  const { themeValue: theme } = useContext(ThemeValueContext);
24
25
  const hasRightSideImage = Boolean(image || video);
@@ -57,8 +58,8 @@ export const HeaderBlock = (props) => {
57
58
  React.createElement(YFMWrapper, { content: description, modifiers: { constructor: true } }))),
58
59
  buttons && (React.createElement("div", { className: b('buttons'), "data-qa": "header-buttons" }, buttons &&
59
60
  buttons.map((button, index) => (React.createElement(RouterLink, { href: button.url, key: index },
60
- React.createElement(Button, Object.assign({ key: index, className: b('button'), size: "xl" }, button))))))),
61
+ React.createElement(Button, Object.assign({ key: index, className: b('button'), size: "xl" }, button, { blockName: BlockType.HeaderBlock }))))))),
61
62
  children))),
62
- hasRightSideImage && (React.createElement(Media, { className: b('media', { [curImageSize]: true }), videoClassName: b('video'), imageClassName: b('image'), video: videoThemed, image: imageThemed })))))));
63
+ hasRightSideImage && (React.createElement(Media, { className: b('media', { [curImageSize]: true }), videoClassName: b('video'), imageClassName: b('image'), video: videoThemed, image: imageThemed, blockName: blockName })))))));
63
64
  };
64
65
  export default HeaderBlock;
@@ -821,6 +821,9 @@ export declare const HeaderBlock: {
821
821
  resetPaddings: {
822
822
  type: string;
823
823
  };
824
+ blockName: {
825
+ type: string;
826
+ };
824
827
  type: {};
825
828
  when: {};
826
829
  };
@@ -433,6 +433,9 @@ export declare const HeaderSliderBlock: {
433
433
  resetPaddings: {
434
434
  type: string;
435
435
  };
436
+ blockName: {
437
+ type: string;
438
+ };
436
439
  type: {};
437
440
  when: {};
438
441
  };
@@ -54,6 +54,9 @@ export declare const IconsProps: {
54
54
  resetPaddings: {
55
55
  type: string;
56
56
  };
57
+ blockName: {
58
+ type: string;
59
+ };
57
60
  type: {};
58
61
  when: {};
59
62
  };
@@ -115,6 +118,9 @@ export declare const IconsBlock: {
115
118
  resetPaddings: {
116
119
  type: string;
117
120
  };
121
+ blockName: {
122
+ type: string;
123
+ };
118
124
  type: {};
119
125
  when: {};
120
126
  };