@gravity-ui/page-constructor 1.14.0-alpha.8 → 1.15.0-alpha.0

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 (83) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/cjs/blocks/Banner/schema.d.ts +36 -138
  3. package/build/cjs/blocks/Media/schema.d.ts +12 -46
  4. package/build/cjs/components/Button/Button.js +3 -3
  5. package/build/cjs/components/CardBase/CardBase.d.ts +2 -2
  6. package/build/cjs/components/CardBase/CardBase.js +3 -3
  7. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +3 -3
  8. package/build/cjs/components/Link/Link.js +3 -3
  9. package/build/cjs/components/Media/Media.js +3 -2
  10. package/build/cjs/components/Media/Video/Video.js +4 -3
  11. package/build/cjs/components/ReactPlayer/ReactPlayer.js +27 -3
  12. package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -2
  13. package/build/cjs/components/YandexForm/YandexForm.js +3 -3
  14. package/build/cjs/context/analyticsContext/analyticsContext.d.ts +2 -2
  15. package/build/cjs/hooks/index.d.ts +1 -0
  16. package/build/cjs/hooks/index.js +1 -0
  17. package/build/cjs/hooks/useAnalytics.d.ts +2 -2
  18. package/build/cjs/hooks/useAnalytics.js +4 -1
  19. package/build/cjs/models/common.d.ts +11 -5
  20. package/build/cjs/models/constructor-items/common.d.ts +6 -4
  21. package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -2
  22. package/build/cjs/models/navigation.d.ts +1 -3
  23. package/build/cjs/navigation/components/Header/Header.css +5 -3
  24. package/build/cjs/navigation/components/Logo/Logo.css +5 -6
  25. package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +1 -0
  26. package/build/cjs/navigation/schema.d.ts +60 -0
  27. package/build/cjs/navigation/schema.js +80 -0
  28. package/build/cjs/schema/index.d.ts +67 -0
  29. package/build/cjs/schema/index.js +2 -1
  30. package/build/cjs/schema/validators/common.d.ts +24 -92
  31. package/build/cjs/schema/validators/common.js +1 -1
  32. package/build/cjs/schema/validators/event.d.ts +37 -0
  33. package/build/cjs/schema/validators/event.js +34 -1
  34. package/build/cjs/schema/validators/index.d.ts +2 -0
  35. package/build/cjs/schema/validators/index.js +2 -0
  36. package/build/cjs/schema/validators/navigation.d.ts +1 -0
  37. package/build/cjs/schema/validators/navigation.js +4 -0
  38. package/build/cjs/sub-blocks/HubspotForm/index.js +2 -3
  39. package/build/cjs/text-transform/blocks.js +1 -10
  40. package/build/esm/blocks/Banner/schema.d.ts +36 -138
  41. package/build/esm/blocks/Media/schema.d.ts +12 -46
  42. package/build/esm/components/Button/Button.js +2 -2
  43. package/build/esm/components/CardBase/CardBase.d.ts +2 -2
  44. package/build/esm/components/CardBase/CardBase.js +2 -2
  45. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +2 -2
  46. package/build/esm/components/Link/Link.js +2 -2
  47. package/build/esm/components/Media/Media.js +3 -2
  48. package/build/esm/components/Media/Video/Video.js +4 -3
  49. package/build/esm/components/ReactPlayer/ReactPlayer.js +27 -3
  50. package/build/esm/components/YandexForm/YandexForm.d.ts +2 -2
  51. package/build/esm/components/YandexForm/YandexForm.js +2 -2
  52. package/build/esm/context/analyticsContext/analyticsContext.d.ts +2 -2
  53. package/build/esm/hooks/index.d.ts +1 -0
  54. package/build/esm/hooks/index.js +1 -0
  55. package/build/esm/hooks/useAnalytics.d.ts +2 -2
  56. package/build/esm/hooks/useAnalytics.js +4 -1
  57. package/build/esm/models/common.d.ts +11 -5
  58. package/build/esm/models/constructor-items/common.d.ts +6 -4
  59. package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -2
  60. package/build/esm/models/navigation.d.ts +1 -3
  61. package/build/esm/navigation/components/Header/Header.css +5 -3
  62. package/build/esm/navigation/components/Logo/Logo.css +5 -6
  63. package/build/esm/navigation/components/NavigationItem/NavigationItem.css +1 -0
  64. package/build/esm/navigation/schema.d.ts +60 -0
  65. package/build/esm/navigation/schema.js +77 -0
  66. package/build/esm/schema/index.d.ts +67 -0
  67. package/build/esm/schema/index.js +2 -1
  68. package/build/esm/schema/validators/common.d.ts +24 -92
  69. package/build/esm/schema/validators/common.js +2 -2
  70. package/build/esm/schema/validators/event.d.ts +37 -0
  71. package/build/esm/schema/validators/event.js +33 -0
  72. package/build/esm/schema/validators/index.d.ts +2 -0
  73. package/build/esm/schema/validators/index.js +2 -0
  74. package/build/esm/schema/validators/navigation.d.ts +1 -0
  75. package/build/esm/schema/validators/navigation.js +1 -0
  76. package/build/esm/sub-blocks/HubspotForm/index.js +2 -3
  77. package/build/esm/text-transform/blocks.js +1 -10
  78. package/package.json +1 -1
  79. package/server/models/common.d.ts +11 -5
  80. package/server/models/constructor-items/common.d.ts +6 -4
  81. package/server/models/constructor-items/sub-blocks.d.ts +2 -2
  82. package/server/models/navigation.d.ts +1 -3
  83. package/server/text-transform/blocks.js +1 -10
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnalyticsEventSchema = void 0;
3
+ exports.AnalyticsEventV2Schema = exports.AnalyticsEventSchema = void 0;
4
4
  exports.AnalyticsEventSchema = {
5
5
  type: 'object',
6
6
  additionalProperties: false,
@@ -55,3 +55,36 @@ exports.AnalyticsEventSchema = {
55
55
  },
56
56
  },
57
57
  };
58
+ exports.AnalyticsEventV2Schema = {
59
+ type: 'object',
60
+ propertyNames: { type: 'string' },
61
+ additionalProperty: { type: 'number' },
62
+ required: ['name'],
63
+ properties: {
64
+ name: {
65
+ type: 'string',
66
+ },
67
+ type: {
68
+ type: 'string',
69
+ },
70
+ counters: {
71
+ type: 'object',
72
+ additionalProperties: false,
73
+ required: [],
74
+ properties: {
75
+ include: {
76
+ type: 'array',
77
+ items: {
78
+ type: 'string',
79
+ },
80
+ },
81
+ exclude: {
82
+ type: 'array',
83
+ items: {
84
+ type: 'string',
85
+ },
86
+ },
87
+ },
88
+ },
89
+ },
90
+ };
@@ -3,10 +3,12 @@ import * as common from './common';
3
3
  import * as subBlocks from './sub-blocks';
4
4
  import * as pixel from './pixel';
5
5
  import * as utils from './utils';
6
+ import * as navigation from './navigation';
6
7
  export declare const validators: {
7
8
  blocks: typeof blocks;
8
9
  common: typeof common;
9
10
  subBlocks: typeof subBlocks;
10
11
  pixel: typeof pixel;
11
12
  utils: typeof utils;
13
+ navigation: typeof navigation;
12
14
  };
@@ -7,10 +7,12 @@ const common = tslib_1.__importStar(require("./common"));
7
7
  const subBlocks = tslib_1.__importStar(require("./sub-blocks"));
8
8
  const pixel = tslib_1.__importStar(require("./pixel"));
9
9
  const utils = tslib_1.__importStar(require("./utils"));
10
+ const navigation = tslib_1.__importStar(require("./navigation"));
10
11
  exports.validators = {
11
12
  blocks,
12
13
  common,
13
14
  subBlocks,
14
15
  pixel,
15
16
  utils,
17
+ navigation,
16
18
  };
@@ -0,0 +1 @@
1
+ export * from '../../navigation/schema';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("../../navigation/schema"), exports);
@@ -8,14 +8,13 @@ const mobileContext_1 = require("../../context/mobileContext");
8
8
  const useMetrika_1 = require("../../hooks/useMetrika");
9
9
  const hooks_1 = require("../../hooks");
10
10
  const HubspotFormContainer_1 = tslib_1.__importDefault(require("./HubspotFormContainer"));
11
- const useAnalytics_1 = require("../../hooks/useAnalytics");
12
11
  const b = (0, utils_1.block)('hubspot-form');
13
12
  const HubspotForm = (props) => {
14
13
  const { className, theme: themeProp, isMobile: isMobileProp, formId, formInstanceId, portalId, region, formClassName, pixelEvents,
15
14
  // hubspotEvents, // TODO: decide how to handle them
16
15
  analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, } = props;
17
16
  const handleMetrika = (0, useMetrika_1.useMetrika)();
18
- const handleAnalytics = (0, useAnalytics_1.useAnalytics)();
17
+ const handleAnalytics = (0, hooks_1.useAnalytics)();
19
18
  const { themeValue } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
20
19
  const isMobileValue = (0, react_1.useContext)(mobileContext_1.MobileContext);
21
20
  const theme = themeProp !== null && themeProp !== void 0 ? themeProp : themeValue;
@@ -26,7 +25,7 @@ const HubspotForm = (props) => {
26
25
  onLoad,
27
26
  onSubmit: (e) => {
28
27
  handleMetrika === null || handleMetrika === void 0 ? void 0 : handleMetrika({ pixelEvents });
29
- handleAnalytics(analyticsEvents);
28
+ handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
30
29
  onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(e);
31
30
  },
32
31
  }), [
@@ -162,15 +162,7 @@ const config = {
162
162
  },
163
163
  ],
164
164
  [models_1.BlockType.PromoFeaturesBlock]: [
165
- {
166
- fields: ['title'],
167
- transformer: typografTransformer,
168
- parser: parseTitle,
169
- },
170
- {
171
- fields: ['description'],
172
- transformer: yfmTransformer,
173
- },
165
+ ...blockHeaderTransfomer,
174
166
  {
175
167
  fields: ['items'],
176
168
  transformer: yfmTransformer,
@@ -309,7 +301,6 @@ const config = {
309
301
  parser: parseTitle,
310
302
  },
311
303
  ],
312
- [models_1.BlockType.PromoFeaturesBlock]: blockHeaderTransfomer,
313
304
  [models_1.BlockType.InfoBlock]: [
314
305
  {
315
306
  fields: ['rightContent', 'leftContent'],
@@ -176,7 +176,12 @@ export declare const BannerCardProps: {
176
176
  analyticsEvents: {
177
177
  anyOf: ({
178
178
  type: string;
179
- additionalProperties: boolean;
179
+ propertyNames: {
180
+ type: string;
181
+ };
182
+ additionalProperty: {
183
+ type: string;
184
+ };
180
185
  required: string[];
181
186
  properties: {
182
187
  name: {
@@ -204,34 +209,17 @@ export declare const BannerCardProps: {
204
209
  };
205
210
  };
206
211
  };
207
- category: {
208
- type: string;
209
- };
210
- label: {
211
- type: string;
212
- };
213
- params: {
214
- type: string;
215
- items: {
216
- type: string;
217
- additionalProperties: boolean;
218
- required: string[];
219
- properties: {
220
- key: {
221
- type: string;
222
- };
223
- value: {
224
- type: string;
225
- };
226
- };
227
- };
228
- };
229
212
  };
230
213
  } | {
231
214
  type: string;
232
215
  items: {
233
216
  type: string;
234
- additionalProperties: boolean;
217
+ propertyNames: {
218
+ type: string;
219
+ };
220
+ additionalProperty: {
221
+ type: string;
222
+ };
235
223
  required: string[];
236
224
  properties: {
237
225
  name: {
@@ -259,28 +247,6 @@ export declare const BannerCardProps: {
259
247
  };
260
248
  };
261
249
  };
262
- category: {
263
- type: string;
264
- };
265
- label: {
266
- type: string;
267
- };
268
- params: {
269
- type: string;
270
- items: {
271
- type: string;
272
- additionalProperties: boolean;
273
- required: string[];
274
- properties: {
275
- key: {
276
- type: string;
277
- };
278
- value: {
279
- type: string;
280
- };
281
- };
282
- };
283
- };
284
250
  };
285
251
  };
286
252
  })[];
@@ -490,7 +456,12 @@ export declare const BannerBlock: {
490
456
  analyticsEvents: {
491
457
  anyOf: ({
492
458
  type: string;
493
- additionalProperties: boolean;
459
+ propertyNames: {
460
+ type: string;
461
+ };
462
+ additionalProperty: {
463
+ type: string;
464
+ };
494
465
  required: string[];
495
466
  properties: {
496
467
  name: {
@@ -518,34 +489,17 @@ export declare const BannerBlock: {
518
489
  };
519
490
  };
520
491
  };
521
- category: {
522
- type: string;
523
- };
524
- label: {
525
- type: string;
526
- };
527
- params: {
528
- type: string;
529
- items: {
530
- type: string;
531
- additionalProperties: boolean;
532
- required: string[];
533
- properties: {
534
- key: {
535
- type: string;
536
- };
537
- value: {
538
- type: string;
539
- };
540
- };
541
- };
542
- };
543
492
  };
544
493
  } | {
545
494
  type: string;
546
495
  items: {
547
496
  type: string;
548
- additionalProperties: boolean;
497
+ propertyNames: {
498
+ type: string;
499
+ };
500
+ additionalProperty: {
501
+ type: string;
502
+ };
549
503
  required: string[];
550
504
  properties: {
551
505
  name: {
@@ -573,28 +527,6 @@ export declare const BannerBlock: {
573
527
  };
574
528
  };
575
529
  };
576
- category: {
577
- type: string;
578
- };
579
- label: {
580
- type: string;
581
- };
582
- params: {
583
- type: string;
584
- items: {
585
- type: string;
586
- additionalProperties: boolean;
587
- required: string[];
588
- properties: {
589
- key: {
590
- type: string;
591
- };
592
- value: {
593
- type: string;
594
- };
595
- };
596
- };
597
- };
598
530
  };
599
531
  };
600
532
  })[];
@@ -805,7 +737,12 @@ export declare const BannerCard: {
805
737
  analyticsEvents: {
806
738
  anyOf: ({
807
739
  type: string;
808
- additionalProperties: boolean;
740
+ propertyNames: {
741
+ type: string;
742
+ };
743
+ additionalProperty: {
744
+ type: string;
745
+ };
809
746
  required: string[];
810
747
  properties: {
811
748
  name: {
@@ -833,34 +770,17 @@ export declare const BannerCard: {
833
770
  };
834
771
  };
835
772
  };
836
- category: {
837
- type: string;
838
- };
839
- label: {
840
- type: string;
841
- };
842
- params: {
843
- type: string;
844
- items: {
845
- type: string;
846
- additionalProperties: boolean;
847
- required: string[];
848
- properties: {
849
- key: {
850
- type: string;
851
- };
852
- value: {
853
- type: string;
854
- };
855
- };
856
- };
857
- };
858
773
  };
859
774
  } | {
860
775
  type: string;
861
776
  items: {
862
777
  type: string;
863
- additionalProperties: boolean;
778
+ propertyNames: {
779
+ type: string;
780
+ };
781
+ additionalProperty: {
782
+ type: string;
783
+ };
864
784
  required: string[];
865
785
  properties: {
866
786
  name: {
@@ -888,28 +808,6 @@ export declare const BannerCard: {
888
808
  };
889
809
  };
890
810
  };
891
- category: {
892
- type: string;
893
- };
894
- label: {
895
- type: string;
896
- };
897
- params: {
898
- type: string;
899
- items: {
900
- type: string;
901
- additionalProperties: boolean;
902
- required: string[];
903
- properties: {
904
- key: {
905
- type: string;
906
- };
907
- value: {
908
- type: string;
909
- };
910
- };
911
- };
912
- };
913
811
  };
914
812
  };
915
813
  })[];
@@ -429,7 +429,12 @@ export declare const MediaBlock: {
429
429
  analyticsEvents: {
430
430
  anyOf: ({
431
431
  type: string;
432
- additionalProperties: boolean;
432
+ propertyNames: {
433
+ type: string;
434
+ };
435
+ additionalProperty: {
436
+ type: string;
437
+ };
433
438
  required: string[];
434
439
  properties: {
435
440
  name: {
@@ -457,34 +462,17 @@ export declare const MediaBlock: {
457
462
  };
458
463
  };
459
464
  };
460
- category: {
461
- type: string;
462
- };
463
- label: {
464
- type: string;
465
- };
466
- params: {
467
- type: string;
468
- items: {
469
- type: string;
470
- additionalProperties: boolean;
471
- required: string[];
472
- properties: {
473
- key: {
474
- type: string;
475
- };
476
- value: {
477
- type: string;
478
- };
479
- };
480
- };
481
- };
482
465
  };
483
466
  } | {
484
467
  type: string;
485
468
  items: {
486
469
  type: string;
487
- additionalProperties: boolean;
470
+ propertyNames: {
471
+ type: string;
472
+ };
473
+ additionalProperty: {
474
+ type: string;
475
+ };
488
476
  required: string[];
489
477
  properties: {
490
478
  name: {
@@ -512,28 +500,6 @@ export declare const MediaBlock: {
512
500
  };
513
501
  };
514
502
  };
515
- category: {
516
- type: string;
517
- };
518
- label: {
519
- type: string;
520
- };
521
- params: {
522
- type: string;
523
- items: {
524
- type: string;
525
- additionalProperties: boolean;
526
- required: string[];
527
- properties: {
528
- key: {
529
- type: string;
530
- };
531
- value: {
532
- type: string;
533
- };
534
- };
535
- };
536
- };
537
503
  };
538
504
  };
539
505
  })[];
@@ -5,7 +5,7 @@ import { block, setUrlTld } from '../../utils';
5
5
  import { toCommonSize, toCommonView } from './utils';
6
6
  import { LocaleContext } from '../../context/localeContext/localeContext';
7
7
  import { useMetrika } from '../../hooks/useMetrika';
8
- import { useAnalytics } from '../../hooks/useAnalytics';
8
+ import { useAnalytics } from '../../hooks';
9
9
  import { Github } from '../../icons';
10
10
  import './Button.css';
11
11
  const b = block('button-block');
@@ -17,7 +17,7 @@ const Button = (props) => {
17
17
  const defaultImgPosition = 'left';
18
18
  const onClick = useCallback(() => {
19
19
  handleMetrika({ metrikaGoals, pixelEvents });
20
- handleAnalytics(analyticsEvents);
20
+ handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
21
21
  if (onClickOrigin) {
22
22
  onClickOrigin();
23
23
  }
@@ -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 { AnalyticsEvent } from '../../models/common';
3
+ import { AnalyticsEventV2 } from '../../models/common';
4
4
  import './CardBase.css';
5
5
  export interface CardBaseProps extends CardBaseParams {
6
6
  className?: string;
@@ -11,7 +11,7 @@ export interface CardBaseProps extends CardBaseParams {
11
11
  target?: HTMLAttributeAnchorTarget;
12
12
  metrikaGoals?: MetrikaGoal;
13
13
  pixelEvents?: ButtonPixel;
14
- analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
14
+ analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
15
15
  }
16
16
  export interface CardHeaderBaseProps {
17
17
  className?: string;
@@ -3,7 +3,7 @@ import { block } from '../../utils';
3
3
  import BackgroundImage from '../BackgroundImage/BackgroundImage';
4
4
  import RouterLink from '../RouterLink/RouterLink';
5
5
  import { useMetrika } from '../../hooks/useMetrika';
6
- import { useAnalytics } from '../../hooks/useAnalytics';
6
+ import { useAnalytics } from '../../hooks';
7
7
  import './CardBase.css';
8
8
  const b = block('card-base-block');
9
9
  const Header = () => null;
@@ -45,7 +45,7 @@ export const Layout = (props) => {
45
45
  const fullClassName = b({ border }, className);
46
46
  const onClick = () => {
47
47
  handleMetrika({ metrikaGoals, pixelEvents });
48
- handleAnalytics(analyticsEvents);
48
+ handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
49
49
  };
50
50
  return url ? (React.createElement(RouterLink, { href: url },
51
51
  React.createElement("a", { href: url, target: target, rel: target === '_blank' ? 'noopener noreferrer' : undefined, className: fullClassName, draggable: false, onDragStart: (e) => e.preventDefault(), onClick: onClick }, cardContent))) : (React.createElement("div", { className: fullClassName }, cardContent));
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { block } from '../../utils';
3
3
  import { useMetrika } from '../../hooks/useMetrika';
4
- import { useAnalytics } from '../../hooks/useAnalytics';
4
+ import { useAnalytics } from '../../hooks';
5
5
  import './HeaderBreadcrumbs.css';
6
6
  const b = block('header-breadcrumbs');
7
7
  export default function HeaderBreadcrumbs(props) {
@@ -10,7 +10,7 @@ export default function HeaderBreadcrumbs(props) {
10
10
  const handleAnalytics = useAnalytics();
11
11
  const onClick = () => {
12
12
  handleMetrika({ metrikaGoals, pixelEvents });
13
- handleAnalytics(analyticsEvents);
13
+ handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
14
14
  };
15
15
  return (React.createElement("div", { className: b({ theme }, className) }, items.map((item) => (React.createElement("div", { className: b('item'), key: item.url },
16
16
  React.createElement("a", { href: item.url, className: b('text'), onClick: onClick }, item.text))))));
@@ -7,7 +7,7 @@ import BackLink from '../BackLink/BackLink';
7
7
  import { LocaleContext } from '../../context/localeContext/localeContext';
8
8
  import { LocationContext } from '../../context/locationContext/locationContext';
9
9
  import { useMetrika } from '../../hooks/useMetrika';
10
- import { useAnalytics } from '../../hooks/useAnalytics';
10
+ import { useAnalytics } from '../../hooks';
11
11
  import './Link.css';
12
12
  const b = block('link-block');
13
13
  const WORD_JOINER_SYM = '\u200b';
@@ -33,7 +33,7 @@ const LinkBlock = (props) => {
33
33
  const defaultTextSize = theme === 'back' ? 'l' : 'm';
34
34
  const onClick = () => {
35
35
  handleMetrika({ metrikaGoals, pixelEvents });
36
- handleAnalytics(analyticsEvents);
36
+ handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
37
37
  };
38
38
  const getLinkByType = () => {
39
39
  switch (theme) {
@@ -7,7 +7,7 @@ import YoutubeBlock from '../VideoBlock/VideoBlock';
7
7
  import './Media.css';
8
8
  const b = block('Media');
9
9
  export const Media = (props) => {
10
- const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, } = props;
10
+ const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, analyticsEvents, } = props;
11
11
  const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, } = props;
12
12
  const [hasVideoFallback, setHasVideoFallback] = useState(false);
13
13
  const content = useMemo(() => {
@@ -16,7 +16,7 @@ export const Media = (props) => {
16
16
  result.push(React.createElement(Image, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback }));
17
17
  }
18
18
  if (video) {
19
- result.push(React.createElement(Video, { key: "video", video: video, videoClassName: videoClassName, height: height, metrika: metrika, playVideo: playVideo, previewImg: previewImg, playButton: playButton, customBarControlsClassName: customBarControlsClassName, hasVideoFallback: hasVideoFallback, setHasVideoFallback: setHasVideoFallback }));
19
+ result.push(React.createElement(Video, { key: "video", video: video, videoClassName: videoClassName, height: height, metrika: metrika, analyticsEvents: analyticsEvents, playVideo: playVideo, previewImg: previewImg, playButton: playButton, customBarControlsClassName: customBarControlsClassName, hasVideoFallback: hasVideoFallback, setHasVideoFallback: setHasVideoFallback }));
20
20
  }
21
21
  if (youtube) {
22
22
  result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height }));
@@ -37,6 +37,7 @@ export const Media = (props) => {
37
37
  hasVideoFallback,
38
38
  videoClassName,
39
39
  metrika,
40
+ analyticsEvents,
40
41
  playVideo,
41
42
  previewImg,
42
43
  playButton,
@@ -6,7 +6,7 @@ import { block } from '../../../utils';
6
6
  import './Video.css';
7
7
  const b = block('media-component-video');
8
8
  const Video = (props) => {
9
- const { video, height, metrika, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, } = props;
9
+ const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, } = props;
10
10
  const ref = useRef(null);
11
11
  useEffect(() => {
12
12
  if (ref && ref.current) {
@@ -29,16 +29,17 @@ const Video = (props) => {
29
29
  }, [playVideo, video, setHasVideoFallback]);
30
30
  const reactPlayerBlock = useMemo(() => {
31
31
  const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton } = video;
32
- return (React.createElement(ReactPlayerBlock, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, height: height }));
32
+ return (React.createElement(ReactPlayerBlock, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, analyticsEvents: analyticsEvents, height: height }));
33
33
  }, [
34
34
  video,
35
- height,
36
35
  videoClassName,
37
36
  previewImg,
38
37
  playVideo,
39
38
  commonPlayButton,
40
39
  customBarControlsClassName,
41
40
  metrika,
41
+ analyticsEvents,
42
+ height,
42
43
  ]);
43
44
  const defaultVideoBlock = useMemo(() => {
44
45
  return video.src.length && !hasVideoFallback ? (React.createElement("div", { className: b('wrap', videoClassName), style: { height } },