@gravity-ui/page-constructor 1.19.0 → 1.20.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 (135) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +79 -6
  3. package/build/cjs/blocks/Banner/schema.d.ts +234 -0
  4. package/build/cjs/blocks/CardLayout/schema.d.ts +6 -0
  5. package/build/cjs/blocks/ContentLayout/schema.d.ts +3 -0
  6. package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +81 -0
  7. package/build/cjs/blocks/Header/schema.d.ts +3 -0
  8. package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
  9. package/build/cjs/blocks/Icons/schema.d.ts +6 -0
  10. package/build/cjs/blocks/LinkTable/schema.d.ts +3 -0
  11. package/build/cjs/blocks/Map/schema.d.ts +129 -34
  12. package/build/cjs/blocks/Media/schema.d.ts +162 -0
  13. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  14. package/build/cjs/blocks/Questions/schema.d.ts +3 -0
  15. package/build/cjs/blocks/Share/Share.js +5 -1
  16. package/build/cjs/blocks/Simple/schema.d.ts +3 -0
  17. package/build/cjs/blocks/Slider/schema.d.ts +3 -0
  18. package/build/cjs/blocks/Table/schema.d.ts +3 -0
  19. package/build/cjs/blocks/Tabs/schema.d.ts +81 -0
  20. package/build/cjs/components/BackLink/BackLink.js +5 -1
  21. package/build/cjs/components/Button/Button.js +6 -2
  22. package/build/cjs/components/CardBase/CardBase.d.ts +2 -1
  23. package/build/cjs/components/CardBase/CardBase.js +5 -1
  24. package/build/cjs/components/Link/Link.js +5 -1
  25. package/build/cjs/components/Media/Media.js +3 -2
  26. package/build/cjs/components/Media/Video/Video.js +3 -2
  27. package/build/cjs/components/ReactPlayer/ReactPlayer.js +16 -3
  28. package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -1
  29. package/build/cjs/components/YandexForm/YandexForm.js +14 -2
  30. package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -0
  31. package/build/cjs/containers/PageConstructor/Provider.js +3 -1
  32. package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +7 -4
  33. package/build/cjs/context/analyticsContext/analyticsContext.d.ts +7 -0
  34. package/build/cjs/context/analyticsContext/analyticsContext.js +6 -0
  35. package/build/cjs/context/analyticsContext/index.d.ts +1 -0
  36. package/build/cjs/context/analyticsContext/index.js +4 -0
  37. package/build/cjs/context/blockIdContext/blockIdContext.d.ts +3 -0
  38. package/build/cjs/context/blockIdContext/blockIdContext.js +6 -0
  39. package/build/cjs/context/blockIdContext/index.d.ts +1 -0
  40. package/build/cjs/context/blockIdContext/index.js +4 -0
  41. package/build/cjs/context/metrikaContext/metrikaContext.d.ts +6 -0
  42. package/build/cjs/hooks/index.d.ts +1 -0
  43. package/build/cjs/hooks/index.js +1 -0
  44. package/build/cjs/hooks/useAnalytics.d.ts +2 -0
  45. package/build/cjs/hooks/useAnalytics.js +35 -0
  46. package/build/cjs/hooks/useMetrika.d.ts +6 -0
  47. package/build/cjs/hooks/useMetrika.js +8 -0
  48. package/build/cjs/models/common.d.ts +45 -0
  49. package/build/cjs/models/common.js +22 -1
  50. package/build/cjs/models/constructor-items/common.d.ts +5 -5
  51. package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -2
  52. package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +5 -1
  53. package/build/cjs/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +4 -2
  54. package/build/cjs/schema/validators/common.d.ts +309 -43
  55. package/build/cjs/schema/validators/common.js +39 -18
  56. package/build/cjs/schema/validators/event.d.ts +37 -0
  57. package/build/cjs/schema/validators/event.js +38 -0
  58. package/build/cjs/sub-blocks/HubspotForm/index.js +15 -2
  59. package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +13 -0
  60. package/build/cjs/sub-blocks/Quote/Quote.js +4 -1
  61. package/build/cjs/utils/analytics.d.ts +2 -0
  62. package/build/cjs/utils/analytics.js +17 -0
  63. package/build/cjs/utils/index.d.ts +1 -0
  64. package/build/cjs/utils/index.js +1 -0
  65. package/build/esm/blocks/Banner/schema.d.ts +234 -0
  66. package/build/esm/blocks/CardLayout/schema.d.ts +6 -0
  67. package/build/esm/blocks/ContentLayout/schema.d.ts +3 -0
  68. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +81 -0
  69. package/build/esm/blocks/Header/schema.d.ts +3 -0
  70. package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
  71. package/build/esm/blocks/Icons/schema.d.ts +6 -0
  72. package/build/esm/blocks/LinkTable/schema.d.ts +3 -0
  73. package/build/esm/blocks/Map/schema.d.ts +129 -34
  74. package/build/esm/blocks/Media/schema.d.ts +162 -0
  75. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
  76. package/build/esm/blocks/Questions/schema.d.ts +3 -0
  77. package/build/esm/blocks/Share/Share.js +6 -2
  78. package/build/esm/blocks/Simple/schema.d.ts +3 -0
  79. package/build/esm/blocks/Slider/schema.d.ts +3 -0
  80. package/build/esm/blocks/Table/schema.d.ts +3 -0
  81. package/build/esm/blocks/Tabs/schema.d.ts +81 -0
  82. package/build/esm/components/BackLink/BackLink.js +5 -1
  83. package/build/esm/components/Button/Button.js +6 -2
  84. package/build/esm/components/CardBase/CardBase.d.ts +2 -1
  85. package/build/esm/components/CardBase/CardBase.js +5 -1
  86. package/build/esm/components/Link/Link.js +5 -1
  87. package/build/esm/components/Media/Media.js +3 -2
  88. package/build/esm/components/Media/Video/Video.js +3 -2
  89. package/build/esm/components/ReactPlayer/ReactPlayer.js +17 -4
  90. package/build/esm/components/YandexForm/YandexForm.d.ts +2 -1
  91. package/build/esm/components/YandexForm/YandexForm.js +14 -2
  92. package/build/esm/containers/PageConstructor/Provider.d.ts +2 -0
  93. package/build/esm/containers/PageConstructor/Provider.js +3 -1
  94. package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +7 -4
  95. package/build/esm/context/analyticsContext/analyticsContext.d.ts +7 -0
  96. package/build/esm/context/analyticsContext/analyticsContext.js +2 -0
  97. package/build/esm/context/analyticsContext/index.d.ts +1 -0
  98. package/build/esm/context/analyticsContext/index.js +1 -0
  99. package/build/esm/context/blockIdContext/blockIdContext.d.ts +3 -0
  100. package/build/esm/context/blockIdContext/blockIdContext.js +2 -0
  101. package/build/esm/context/blockIdContext/index.d.ts +1 -0
  102. package/build/esm/context/blockIdContext/index.js +1 -0
  103. package/build/esm/context/metrikaContext/metrikaContext.d.ts +6 -0
  104. package/build/esm/hooks/index.d.ts +1 -0
  105. package/build/esm/hooks/index.js +1 -0
  106. package/build/esm/hooks/useAnalytics.d.ts +2 -0
  107. package/build/esm/hooks/useAnalytics.js +31 -0
  108. package/build/esm/hooks/useMetrika.d.ts +6 -0
  109. package/build/esm/hooks/useMetrika.js +8 -0
  110. package/build/esm/models/common.d.ts +45 -0
  111. package/build/esm/models/common.js +21 -0
  112. package/build/esm/models/constructor-items/common.d.ts +5 -5
  113. package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -2
  114. package/build/esm/navigation/components/NavigationItem/NavigationItem.js +5 -1
  115. package/build/esm/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +4 -2
  116. package/build/esm/schema/validators/common.d.ts +309 -43
  117. package/build/esm/schema/validators/common.js +39 -18
  118. package/build/esm/schema/validators/event.d.ts +37 -0
  119. package/build/esm/schema/validators/event.js +35 -0
  120. package/build/esm/sub-blocks/HubspotForm/index.js +16 -3
  121. package/build/esm/sub-blocks/LayoutItem/utils.d.ts +13 -0
  122. package/build/esm/sub-blocks/Quote/Quote.js +6 -3
  123. package/build/esm/utils/analytics.d.ts +2 -0
  124. package/build/esm/utils/analytics.js +13 -0
  125. package/build/esm/utils/index.d.ts +1 -0
  126. package/build/esm/utils/index.js +1 -0
  127. package/package.json +1 -1
  128. package/server/models/common.d.ts +45 -0
  129. package/server/models/common.js +22 -1
  130. package/server/models/constructor-items/common.d.ts +5 -5
  131. package/server/models/constructor-items/sub-blocks.d.ts +2 -2
  132. package/server/utils/analytics.d.ts +2 -0
  133. package/server/utils/analytics.js +17 -0
  134. package/server/utils/index.d.ts +1 -0
  135. package/server/utils/index.js +1 -0
@@ -5,11 +5,13 @@ const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const utils_1 = require("../../../../../utils");
7
7
  const components_1 = require("../../../../../components");
8
+ const blockIdContext_1 = require("../../../../../context/blockIdContext");
8
9
  const b = (0, utils_1.block)('navigation-button');
10
+ const ANALYTICS_ID = 'navigation';
9
11
  const NavigationButton = (props) => {
10
12
  const { url, target, className } = props;
11
13
  const classes = b(null, className);
12
- return target ? (react_1.default.createElement(components_1.Button, Object.assign({ className: classes }, props, { url: url }))) : (react_1.default.createElement(components_1.RouterLink, { href: url },
13
- react_1.default.createElement(components_1.Button, Object.assign({}, props, { className: classes, url: url }))));
14
+ return (react_1.default.createElement(blockIdContext_1.BlockIdContext.Provider, { value: ANALYTICS_ID }, target ? (react_1.default.createElement(components_1.Button, Object.assign({ className: classes }, props, { url: url }))) : (react_1.default.createElement(components_1.RouterLink, { href: url },
15
+ react_1.default.createElement(components_1.Button, Object.assign({}, props, { className: classes, url: url }))))));
14
16
  };
15
17
  exports.NavigationButton = NavigationButton;
@@ -318,6 +318,84 @@ export declare const LinkProps: {
318
318
  type: string;
319
319
  enum: string[];
320
320
  };
321
+ analyticsEvents: {
322
+ anyOf: ({
323
+ type: string;
324
+ additionalProperties: {
325
+ type: string;
326
+ };
327
+ required: string[];
328
+ properties: {
329
+ name: {
330
+ type: string;
331
+ };
332
+ type: {
333
+ type: string;
334
+ };
335
+ counters: {
336
+ type: string;
337
+ additionalProperties: boolean;
338
+ required: never[];
339
+ properties: {
340
+ include: {
341
+ type: string;
342
+ items: {
343
+ type: string;
344
+ };
345
+ };
346
+ exclude: {
347
+ type: string;
348
+ items: {
349
+ type: string;
350
+ };
351
+ };
352
+ };
353
+ };
354
+ context: {
355
+ type: string;
356
+ };
357
+ };
358
+ } | {
359
+ type: string;
360
+ items: {
361
+ type: string;
362
+ additionalProperties: {
363
+ type: string;
364
+ };
365
+ required: string[];
366
+ properties: {
367
+ name: {
368
+ type: string;
369
+ };
370
+ type: {
371
+ type: string;
372
+ };
373
+ counters: {
374
+ type: string;
375
+ additionalProperties: boolean;
376
+ required: never[];
377
+ properties: {
378
+ include: {
379
+ type: string;
380
+ items: {
381
+ type: string;
382
+ };
383
+ };
384
+ exclude: {
385
+ type: string;
386
+ items: {
387
+ type: string;
388
+ };
389
+ };
390
+ };
391
+ };
392
+ context: {
393
+ type: string;
394
+ };
395
+ };
396
+ };
397
+ })[];
398
+ };
321
399
  type: {};
322
400
  when: {};
323
401
  };
@@ -414,6 +492,9 @@ export declare const ButtonProps: {
414
492
  };
415
493
  })[];
416
494
  };
495
+ /**
496
+ * @deprecated Metrika will be deleted
497
+ */
417
498
  metrikaGoals: {
418
499
  anyOf: ({
419
500
  type: string;
@@ -443,6 +524,9 @@ export declare const ButtonProps: {
443
524
  };
444
525
  })[];
445
526
  };
527
+ /**
528
+ * @deprecated Pixel will be deleted
529
+ */
446
530
  pixelEvents: {
447
531
  type: string;
448
532
  items: {
@@ -499,6 +583,84 @@ export declare const ButtonProps: {
499
583
  };
500
584
  };
501
585
  };
586
+ analyticsEvents: {
587
+ anyOf: ({
588
+ type: string;
589
+ additionalProperties: {
590
+ type: string;
591
+ };
592
+ required: string[];
593
+ properties: {
594
+ name: {
595
+ type: string;
596
+ };
597
+ type: {
598
+ type: string;
599
+ };
600
+ counters: {
601
+ type: string;
602
+ additionalProperties: boolean;
603
+ required: never[];
604
+ properties: {
605
+ include: {
606
+ type: string;
607
+ items: {
608
+ type: string;
609
+ };
610
+ };
611
+ exclude: {
612
+ type: string;
613
+ items: {
614
+ type: string;
615
+ };
616
+ };
617
+ };
618
+ };
619
+ context: {
620
+ type: string;
621
+ };
622
+ };
623
+ } | {
624
+ type: string;
625
+ items: {
626
+ type: string;
627
+ additionalProperties: {
628
+ type: string;
629
+ };
630
+ required: string[];
631
+ properties: {
632
+ name: {
633
+ type: string;
634
+ };
635
+ type: {
636
+ type: string;
637
+ };
638
+ counters: {
639
+ type: string;
640
+ additionalProperties: boolean;
641
+ required: never[];
642
+ properties: {
643
+ include: {
644
+ type: string;
645
+ items: {
646
+ type: string;
647
+ };
648
+ };
649
+ exclude: {
650
+ type: string;
651
+ items: {
652
+ type: string;
653
+ };
654
+ };
655
+ };
656
+ };
657
+ context: {
658
+ type: string;
659
+ };
660
+ };
661
+ };
662
+ })[];
663
+ };
502
664
  target: {
503
665
  type: string;
504
666
  enum: string[];
@@ -558,6 +720,9 @@ export declare const BlockBaseProps: {
558
720
  resetPaddings: {
559
721
  type: string;
560
722
  };
723
+ context: {
724
+ type: string;
725
+ };
561
726
  type: {};
562
727
  when: {};
563
728
  };
@@ -629,6 +794,9 @@ export declare const ButtonBlock: {
629
794
  };
630
795
  })[];
631
796
  };
797
+ /**
798
+ * @deprecated Metrika will be deleted
799
+ */
632
800
  metrikaGoals: {
633
801
  anyOf: ({
634
802
  type: string;
@@ -658,6 +826,9 @@ export declare const ButtonBlock: {
658
826
  };
659
827
  })[];
660
828
  };
829
+ /**
830
+ * @deprecated Pixel will be deleted
831
+ */
661
832
  pixelEvents: {
662
833
  type: string;
663
834
  items: {
@@ -714,6 +885,84 @@ export declare const ButtonBlock: {
714
885
  };
715
886
  };
716
887
  };
888
+ analyticsEvents: {
889
+ anyOf: ({
890
+ type: string;
891
+ additionalProperties: {
892
+ type: string;
893
+ };
894
+ required: string[];
895
+ properties: {
896
+ name: {
897
+ type: string;
898
+ };
899
+ type: {
900
+ type: string;
901
+ };
902
+ counters: {
903
+ type: string;
904
+ additionalProperties: boolean;
905
+ required: never[];
906
+ properties: {
907
+ include: {
908
+ type: string;
909
+ items: {
910
+ type: string;
911
+ };
912
+ };
913
+ exclude: {
914
+ type: string;
915
+ items: {
916
+ type: string;
917
+ };
918
+ };
919
+ };
920
+ };
921
+ context: {
922
+ type: string;
923
+ };
924
+ };
925
+ } | {
926
+ type: string;
927
+ items: {
928
+ type: string;
929
+ additionalProperties: {
930
+ type: string;
931
+ };
932
+ required: string[];
933
+ properties: {
934
+ name: {
935
+ type: string;
936
+ };
937
+ type: {
938
+ type: string;
939
+ };
940
+ counters: {
941
+ type: string;
942
+ additionalProperties: boolean;
943
+ required: never[];
944
+ properties: {
945
+ include: {
946
+ type: string;
947
+ items: {
948
+ type: string;
949
+ };
950
+ };
951
+ exclude: {
952
+ type: string;
953
+ items: {
954
+ type: string;
955
+ };
956
+ };
957
+ };
958
+ };
959
+ context: {
960
+ type: string;
961
+ };
962
+ };
963
+ };
964
+ })[];
965
+ };
717
966
  target: {
718
967
  type: string;
719
968
  enum: string[];
@@ -864,33 +1113,9 @@ export declare const MediaProps: {
864
1113
  };
865
1114
  };
866
1115
  export declare const YMapMarkerLabel: {
1116
+ type: string;
867
1117
  required: never[];
868
- iconCaption: {
869
- type: string;
870
- };
871
- iconContent: {
872
- type: string;
873
- };
874
- iconColor: {
875
- type: string;
876
- };
877
- preset: {
878
- type: string;
879
- };
880
- };
881
- export declare const YMapMarker: {
882
- required: never[];
883
- coordinate: {
884
- type: string;
885
- items: {
886
- type: string;
887
- };
888
- };
889
- address: {
890
- type: string;
891
- };
892
- label: {
893
- required: never[];
1118
+ properties: {
894
1119
  iconCaption: {
895
1120
  type: string;
896
1121
  };
@@ -905,6 +1130,40 @@ export declare const YMapMarker: {
905
1130
  };
906
1131
  };
907
1132
  };
1133
+ export declare const YMapMarker: {
1134
+ type: string;
1135
+ additionalProperties: boolean;
1136
+ required: never[];
1137
+ properties: {
1138
+ coordinate: {
1139
+ type: string;
1140
+ items: {
1141
+ type: string;
1142
+ };
1143
+ };
1144
+ address: {
1145
+ type: string;
1146
+ };
1147
+ label: {
1148
+ type: string;
1149
+ required: never[];
1150
+ properties: {
1151
+ iconCaption: {
1152
+ type: string;
1153
+ };
1154
+ iconContent: {
1155
+ type: string;
1156
+ };
1157
+ iconColor: {
1158
+ type: string;
1159
+ };
1160
+ preset: {
1161
+ type: string;
1162
+ };
1163
+ };
1164
+ };
1165
+ };
1166
+ };
908
1167
  export declare const MapProps: {
909
1168
  zoom: {
910
1169
  type: string;
@@ -925,29 +1184,36 @@ export declare const MapProps: {
925
1184
  type: string;
926
1185
  items: {
927
1186
  type: {
1187
+ type: string;
1188
+ additionalProperties: boolean;
928
1189
  required: never[];
929
- coordinate: {
930
- type: string;
931
- items: {
932
- type: string;
933
- };
934
- };
935
- address: {
936
- type: string;
937
- };
938
- label: {
939
- required: never[];
940
- iconCaption: {
941
- type: string;
942
- };
943
- iconContent: {
1190
+ properties: {
1191
+ coordinate: {
944
1192
  type: string;
1193
+ items: {
1194
+ type: string;
1195
+ };
945
1196
  };
946
- iconColor: {
1197
+ address: {
947
1198
  type: string;
948
1199
  };
949
- preset: {
1200
+ label: {
950
1201
  type: string;
1202
+ required: never[];
1203
+ properties: {
1204
+ iconCaption: {
1205
+ type: string;
1206
+ };
1207
+ iconContent: {
1208
+ type: string;
1209
+ };
1210
+ iconColor: {
1211
+ type: string;
1212
+ };
1213
+ preset: {
1214
+ type: string;
1215
+ };
1216
+ };
951
1217
  };
952
1218
  };
953
1219
  };
@@ -4,6 +4,7 @@ exports.BlockHeaderProps = exports.CardBase = exports.MapProps = exports.YMapMar
4
4
  const pixel_1 = require("./pixel");
5
5
  const models_1 = require("../../models");
6
6
  const schema_1 = require("../../components/Image/schema");
7
+ const event_1 = require("./event");
7
8
  exports.mediaDirection = ['media-content', 'content-media'];
8
9
  exports.textSize = ['s', 'm', 'l'];
9
10
  exports.containerSizesArray = ['sm', 'md', 'lg', 'xl', 'all'];
@@ -177,6 +178,8 @@ exports.LinkProps = {
177
178
  }, target: {
178
179
  type: 'string',
179
180
  enum: ['_blank', '_parent', '_top', '_self'],
181
+ }, analyticsEvents: {
182
+ anyOf: [event_1.AnalyticsEventSchema, { type: 'array', items: event_1.AnalyticsEventSchema }],
180
183
  } }),
181
184
  };
182
185
  exports.FileLinkProps = {
@@ -309,6 +312,9 @@ exports.ButtonProps = {
309
312
  },
310
313
  ],
311
314
  },
315
+ /**
316
+ * @deprecated Metrika will be deleted
317
+ */
312
318
  metrikaGoals: {
313
319
  anyOf: [
314
320
  { type: 'string' },
@@ -331,7 +337,13 @@ exports.ButtonProps = {
331
337
  },
332
338
  ],
333
339
  },
340
+ /**
341
+ * @deprecated Pixel will be deleted
342
+ */
334
343
  pixelEvents: pixel_1.pixelEvents,
344
+ analyticsEvents: {
345
+ anyOf: [event_1.AnalyticsEventSchema, { type: 'array', items: event_1.AnalyticsEventSchema }],
346
+ },
335
347
  target: {
336
348
  type: 'string',
337
349
  enum: ['_self', '_blank', '_parent', '_top'],
@@ -380,6 +392,8 @@ exports.BlockBaseProps = Object.assign(Object.assign({}, exports.BaseProps), { a
380
392
  enum: exports.containerSizesArray,
381
393
  }, resetPaddings: {
382
394
  type: 'boolean',
395
+ }, context: {
396
+ type: 'string',
383
397
  } });
384
398
  exports.TitleProps = {
385
399
  type: 'object',
@@ -443,30 +457,37 @@ exports.MediaProps = {
443
457
  dataLens: exports.DataLensProps,
444
458
  };
445
459
  exports.YMapMarkerLabel = {
460
+ type: 'object',
446
461
  required: [],
447
- iconCaption: {
448
- type: 'string',
449
- },
450
- iconContent: {
451
- type: 'string',
452
- },
453
- iconColor: {
454
- type: 'string',
455
- },
456
- preset: {
457
- type: 'string',
462
+ properties: {
463
+ iconCaption: {
464
+ type: 'string',
465
+ },
466
+ iconContent: {
467
+ type: 'string',
468
+ },
469
+ iconColor: {
470
+ type: 'string',
471
+ },
472
+ preset: {
473
+ type: 'string',
474
+ },
458
475
  },
459
476
  };
460
477
  exports.YMapMarker = {
478
+ type: 'object',
479
+ additionalProperties: false,
461
480
  required: [],
462
- coordinate: {
463
- type: 'array',
464
- items: { type: 'number' },
465
- },
466
- address: {
467
- type: 'string',
481
+ properties: {
482
+ coordinate: {
483
+ type: 'array',
484
+ items: { type: 'number' },
485
+ },
486
+ address: {
487
+ type: 'string',
488
+ },
489
+ label: exports.YMapMarkerLabel,
468
490
  },
469
- label: exports.YMapMarkerLabel,
470
491
  };
471
492
  exports.MapProps = {
472
493
  zoom: {
@@ -0,0 +1,37 @@
1
+ export declare const AnalyticsEventSchema: {
2
+ type: string;
3
+ additionalProperties: {
4
+ type: string;
5
+ };
6
+ required: string[];
7
+ properties: {
8
+ name: {
9
+ type: string;
10
+ };
11
+ type: {
12
+ type: string;
13
+ };
14
+ counters: {
15
+ type: string;
16
+ additionalProperties: boolean;
17
+ required: never[];
18
+ properties: {
19
+ include: {
20
+ type: string;
21
+ items: {
22
+ type: string;
23
+ };
24
+ };
25
+ exclude: {
26
+ type: string;
27
+ items: {
28
+ type: string;
29
+ };
30
+ };
31
+ };
32
+ };
33
+ context: {
34
+ type: string;
35
+ };
36
+ };
37
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AnalyticsEventSchema = void 0;
4
+ exports.AnalyticsEventSchema = {
5
+ type: 'object',
6
+ additionalProperties: { type: 'string' },
7
+ required: ['name'],
8
+ properties: {
9
+ name: {
10
+ type: 'string',
11
+ },
12
+ type: {
13
+ type: 'string',
14
+ },
15
+ counters: {
16
+ type: 'object',
17
+ additionalProperties: false,
18
+ required: [],
19
+ properties: {
20
+ include: {
21
+ type: 'array',
22
+ items: {
23
+ type: 'string',
24
+ },
25
+ },
26
+ exclude: {
27
+ type: 'array',
28
+ items: {
29
+ type: 'string',
30
+ },
31
+ },
32
+ },
33
+ },
34
+ context: {
35
+ type: 'string',
36
+ },
37
+ },
38
+ };
@@ -6,14 +6,16 @@ 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
- onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, createDOMElement, onSubmitError, } = props;
16
+ analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, createDOMElement, onSubmitError, } = props;
16
17
  const handleMetrika = (0, useMetrika_1.useMetrika)();
18
+ const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.HubspotFormSubmit);
17
19
  const { themeValue } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
18
20
  const isMobileValue = (0, react_1.useContext)(mobileContext_1.MobileContext);
19
21
  const theme = themeProp !== null && themeProp !== void 0 ? themeProp : themeValue;
@@ -25,9 +27,20 @@ const HubspotForm = (props) => {
25
27
  onSubmitError,
26
28
  onSubmit: (e) => {
27
29
  handleMetrika === null || handleMetrika === void 0 ? void 0 : handleMetrika({ pixelEvents });
30
+ handleAnalytics(analyticsEvents);
28
31
  onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(e);
29
32
  },
30
- }), [onBeforeLoad, onBeforeSubmit, onLoad, handleMetrika, pixelEvents, onSubmit, onSubmitError]);
33
+ }), [
34
+ onBeforeLoad,
35
+ onBeforeSubmit,
36
+ onLoad,
37
+ handleMetrika,
38
+ pixelEvents,
39
+ handleAnalytics,
40
+ analyticsEvents,
41
+ onSubmit,
42
+ onSubmitError,
43
+ ]);
31
44
  (0, hooks_1.useHandleHubspotEvents)(handlers, formId);
32
45
  return (react_1.default.createElement(HubspotFormContainer_1.default, { createDOMElement: createDOMElement, key: [formClassName, formId, formInstanceId, portalId, region].join(), className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region }));
33
46
  };
@@ -9,6 +9,19 @@ export declare const getLayoutItemLinks: (links: LayoutItemProps['content']['lin
9
9
  target?: string | undefined;
10
10
  metrikaGoals?: import("../../models").MetrikaGoal | undefined;
11
11
  pixelEvents?: import("../../models").ButtonPixel | undefined;
12
+ analyticsEvents?: {
13
+ name: string;
14
+ type?: string | undefined;
15
+ counters?: import("../../models").AnalyticsCounters | undefined;
16
+ context?: string | undefined;
17
+ target?: string | undefined;
18
+ } | {
19
+ name: string;
20
+ type?: string | undefined;
21
+ counters?: import("../../models").AnalyticsCounters | undefined;
22
+ context?: string | undefined;
23
+ target?: string | undefined;
24
+ }[] | undefined;
12
25
  className?: string | undefined;
13
26
  }[] | undefined;
14
27
  export declare const hasFullScreen: ({ dataLens, image }: MediaProps) => boolean;