@gravity-ui/page-constructor 1.13.0 → 1.14.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 (59) hide show
  1. package/build/cjs/blocks/Banner/schema.d.ts +321 -0
  2. package/build/cjs/blocks/Media/schema.d.ts +107 -0
  3. package/build/cjs/components/Button/Button.js +5 -2
  4. package/build/cjs/components/CardBase/CardBase.d.ts +2 -0
  5. package/build/cjs/components/CardBase/CardBase.js +4 -1
  6. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -1
  7. package/build/cjs/components/Link/Link.js +4 -1
  8. package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -0
  9. package/build/cjs/components/YandexForm/YandexForm.js +13 -2
  10. package/build/cjs/context/analyticsContext/analyticsContext.d.ts +6 -0
  11. package/build/cjs/context/analyticsContext/analyticsContext.js +6 -0
  12. package/build/cjs/context/analyticsContext/index.d.ts +1 -0
  13. package/build/cjs/context/analyticsContext/index.js +4 -0
  14. package/build/cjs/context/metrikaContext/metrikaContext.d.ts +6 -0
  15. package/build/cjs/hooks/useAnalytics.d.ts +2 -0
  16. package/build/cjs/hooks/useAnalytics.js +15 -0
  17. package/build/cjs/hooks/useMetrika.d.ts +6 -0
  18. package/build/cjs/hooks/useMetrika.js +8 -0
  19. package/build/cjs/models/common.d.ts +30 -0
  20. package/build/cjs/models/common.js +3 -0
  21. package/build/cjs/models/constructor-items/common.d.ts +4 -1
  22. package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -1
  23. package/build/cjs/schema/validators/common.d.ts +226 -0
  24. package/build/cjs/schema/validators/common.js +10 -0
  25. package/build/cjs/schema/validators/event.d.ts +50 -0
  26. package/build/cjs/schema/validators/event.js +53 -0
  27. package/build/cjs/sub-blocks/HubspotForm/index.js +14 -2
  28. package/build/esm/blocks/Banner/schema.d.ts +321 -0
  29. package/build/esm/blocks/Media/schema.d.ts +107 -0
  30. package/build/esm/components/Button/Button.js +5 -2
  31. package/build/esm/components/CardBase/CardBase.d.ts +2 -0
  32. package/build/esm/components/CardBase/CardBase.js +4 -1
  33. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -1
  34. package/build/esm/components/Link/Link.js +4 -1
  35. package/build/esm/components/YandexForm/YandexForm.d.ts +2 -0
  36. package/build/esm/components/YandexForm/YandexForm.js +13 -2
  37. package/build/esm/context/analyticsContext/analyticsContext.d.ts +6 -0
  38. package/build/esm/context/analyticsContext/analyticsContext.js +2 -0
  39. package/build/esm/context/analyticsContext/index.d.ts +1 -0
  40. package/build/esm/context/analyticsContext/index.js +1 -0
  41. package/build/esm/context/metrikaContext/metrikaContext.d.ts +6 -0
  42. package/build/esm/hooks/useAnalytics.d.ts +2 -0
  43. package/build/esm/hooks/useAnalytics.js +11 -0
  44. package/build/esm/hooks/useMetrika.d.ts +6 -0
  45. package/build/esm/hooks/useMetrika.js +8 -0
  46. package/build/esm/models/common.d.ts +30 -0
  47. package/build/esm/models/common.js +3 -0
  48. package/build/esm/models/constructor-items/common.d.ts +4 -1
  49. package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -1
  50. package/build/esm/schema/validators/common.d.ts +226 -0
  51. package/build/esm/schema/validators/common.js +10 -0
  52. package/build/esm/schema/validators/event.d.ts +50 -0
  53. package/build/esm/schema/validators/event.js +50 -0
  54. package/build/esm/sub-blocks/HubspotForm/index.js +14 -2
  55. package/package.json +4 -1
  56. package/server/models/common.d.ts +30 -0
  57. package/server/models/common.js +3 -0
  58. package/server/models/constructor-items/common.d.ts +4 -1
  59. package/server/models/constructor-items/sub-blocks.d.ts +2 -1
@@ -173,6 +173,113 @@ export declare const BannerCardProps: {
173
173
  };
174
174
  };
175
175
  };
176
+ events: {
177
+ anyOf: ({
178
+ type: {
179
+ type: string;
180
+ additionalProperties: boolean;
181
+ required: string[];
182
+ properties: {
183
+ name: {
184
+ type: string;
185
+ };
186
+ type: {
187
+ type: string;
188
+ };
189
+ counters: {
190
+ type: string;
191
+ additionalProperties: boolean;
192
+ required: never[];
193
+ properties: {
194
+ include: {
195
+ type: string;
196
+ items: string;
197
+ };
198
+ exclude: {
199
+ type: string;
200
+ items: string;
201
+ };
202
+ };
203
+ };
204
+ category: {
205
+ type: string;
206
+ };
207
+ label: {
208
+ type: string;
209
+ };
210
+ params: {
211
+ type: string;
212
+ items: {
213
+ type: string;
214
+ additionalProperties: boolean;
215
+ required: string[];
216
+ properties: {
217
+ key: {
218
+ type: string;
219
+ };
220
+ value: {
221
+ type: string;
222
+ };
223
+ };
224
+ };
225
+ };
226
+ };
227
+ };
228
+ items?: undefined;
229
+ } | {
230
+ type: string;
231
+ items: {
232
+ type: string;
233
+ additionalProperties: boolean;
234
+ required: string[];
235
+ properties: {
236
+ name: {
237
+ type: string;
238
+ };
239
+ type: {
240
+ type: string;
241
+ };
242
+ counters: {
243
+ type: string;
244
+ additionalProperties: boolean;
245
+ required: never[];
246
+ properties: {
247
+ include: {
248
+ type: string;
249
+ items: string;
250
+ };
251
+ exclude: {
252
+ type: string;
253
+ items: string;
254
+ };
255
+ };
256
+ };
257
+ category: {
258
+ type: string;
259
+ };
260
+ label: {
261
+ type: string;
262
+ };
263
+ params: {
264
+ type: string;
265
+ items: {
266
+ type: string;
267
+ additionalProperties: boolean;
268
+ required: string[];
269
+ properties: {
270
+ key: {
271
+ type: string;
272
+ };
273
+ value: {
274
+ type: string;
275
+ };
276
+ };
277
+ };
278
+ };
279
+ };
280
+ };
281
+ })[];
282
+ };
176
283
  target: {
177
284
  type: string;
178
285
  enum: string[];
@@ -375,6 +482,113 @@ export declare const BannerBlock: {
375
482
  };
376
483
  };
377
484
  };
485
+ events: {
486
+ anyOf: ({
487
+ type: {
488
+ type: string;
489
+ additionalProperties: boolean;
490
+ required: string[];
491
+ properties: {
492
+ name: {
493
+ type: string;
494
+ };
495
+ type: {
496
+ type: string;
497
+ };
498
+ counters: {
499
+ type: string;
500
+ additionalProperties: boolean;
501
+ required: never[];
502
+ properties: {
503
+ include: {
504
+ type: string;
505
+ items: string;
506
+ };
507
+ exclude: {
508
+ type: string;
509
+ items: string;
510
+ };
511
+ };
512
+ };
513
+ category: {
514
+ type: string;
515
+ };
516
+ label: {
517
+ type: string;
518
+ };
519
+ params: {
520
+ type: string;
521
+ items: {
522
+ type: string;
523
+ additionalProperties: boolean;
524
+ required: string[];
525
+ properties: {
526
+ key: {
527
+ type: string;
528
+ };
529
+ value: {
530
+ type: string;
531
+ };
532
+ };
533
+ };
534
+ };
535
+ };
536
+ };
537
+ items?: undefined;
538
+ } | {
539
+ type: string;
540
+ items: {
541
+ type: string;
542
+ additionalProperties: boolean;
543
+ required: string[];
544
+ properties: {
545
+ name: {
546
+ type: string;
547
+ };
548
+ type: {
549
+ type: string;
550
+ };
551
+ counters: {
552
+ type: string;
553
+ additionalProperties: boolean;
554
+ required: never[];
555
+ properties: {
556
+ include: {
557
+ type: string;
558
+ items: string;
559
+ };
560
+ exclude: {
561
+ type: string;
562
+ items: string;
563
+ };
564
+ };
565
+ };
566
+ category: {
567
+ type: string;
568
+ };
569
+ label: {
570
+ type: string;
571
+ };
572
+ params: {
573
+ type: string;
574
+ items: {
575
+ type: string;
576
+ additionalProperties: boolean;
577
+ required: string[];
578
+ properties: {
579
+ key: {
580
+ type: string;
581
+ };
582
+ value: {
583
+ type: string;
584
+ };
585
+ };
586
+ };
587
+ };
588
+ };
589
+ };
590
+ })[];
591
+ };
378
592
  target: {
379
593
  type: string;
380
594
  enum: string[];
@@ -578,6 +792,113 @@ export declare const BannerCard: {
578
792
  };
579
793
  };
580
794
  };
795
+ events: {
796
+ anyOf: ({
797
+ type: {
798
+ type: string;
799
+ additionalProperties: boolean;
800
+ required: string[];
801
+ properties: {
802
+ name: {
803
+ type: string;
804
+ };
805
+ type: {
806
+ type: string;
807
+ };
808
+ counters: {
809
+ type: string;
810
+ additionalProperties: boolean;
811
+ required: never[];
812
+ properties: {
813
+ include: {
814
+ type: string;
815
+ items: string;
816
+ };
817
+ exclude: {
818
+ type: string;
819
+ items: string;
820
+ };
821
+ };
822
+ };
823
+ category: {
824
+ type: string;
825
+ };
826
+ label: {
827
+ type: string;
828
+ };
829
+ params: {
830
+ type: string;
831
+ items: {
832
+ type: string;
833
+ additionalProperties: boolean;
834
+ required: string[];
835
+ properties: {
836
+ key: {
837
+ type: string;
838
+ };
839
+ value: {
840
+ type: string;
841
+ };
842
+ };
843
+ };
844
+ };
845
+ };
846
+ };
847
+ items?: undefined;
848
+ } | {
849
+ type: string;
850
+ items: {
851
+ type: string;
852
+ additionalProperties: boolean;
853
+ required: string[];
854
+ properties: {
855
+ name: {
856
+ type: string;
857
+ };
858
+ type: {
859
+ type: string;
860
+ };
861
+ counters: {
862
+ type: string;
863
+ additionalProperties: boolean;
864
+ required: never[];
865
+ properties: {
866
+ include: {
867
+ type: string;
868
+ items: string;
869
+ };
870
+ exclude: {
871
+ type: string;
872
+ items: string;
873
+ };
874
+ };
875
+ };
876
+ category: {
877
+ type: string;
878
+ };
879
+ label: {
880
+ type: string;
881
+ };
882
+ params: {
883
+ type: string;
884
+ items: {
885
+ type: string;
886
+ additionalProperties: boolean;
887
+ required: string[];
888
+ properties: {
889
+ key: {
890
+ type: string;
891
+ };
892
+ value: {
893
+ type: string;
894
+ };
895
+ };
896
+ };
897
+ };
898
+ };
899
+ };
900
+ })[];
901
+ };
581
902
  target: {
582
903
  type: string;
583
904
  enum: string[];
@@ -426,6 +426,113 @@ export declare const MediaBlock: {
426
426
  };
427
427
  };
428
428
  };
429
+ events: {
430
+ anyOf: ({
431
+ type: {
432
+ type: string;
433
+ additionalProperties: boolean;
434
+ required: string[];
435
+ properties: {
436
+ name: {
437
+ type: string;
438
+ };
439
+ type: {
440
+ type: string;
441
+ };
442
+ counters: {
443
+ type: string;
444
+ additionalProperties: boolean;
445
+ required: never[];
446
+ properties: {
447
+ include: {
448
+ type: string;
449
+ items: string;
450
+ };
451
+ exclude: {
452
+ type: string;
453
+ items: string;
454
+ };
455
+ };
456
+ };
457
+ category: {
458
+ type: string;
459
+ };
460
+ label: {
461
+ type: string;
462
+ };
463
+ params: {
464
+ type: string;
465
+ items: {
466
+ type: string;
467
+ additionalProperties: boolean;
468
+ required: string[];
469
+ properties: {
470
+ key: {
471
+ type: string;
472
+ };
473
+ value: {
474
+ type: string;
475
+ };
476
+ };
477
+ };
478
+ };
479
+ };
480
+ };
481
+ items?: undefined;
482
+ } | {
483
+ type: string;
484
+ items: {
485
+ type: string;
486
+ additionalProperties: boolean;
487
+ required: string[];
488
+ properties: {
489
+ name: {
490
+ type: string;
491
+ };
492
+ type: {
493
+ type: string;
494
+ };
495
+ counters: {
496
+ type: string;
497
+ additionalProperties: boolean;
498
+ required: never[];
499
+ properties: {
500
+ include: {
501
+ type: string;
502
+ items: string;
503
+ };
504
+ exclude: {
505
+ type: string;
506
+ items: string;
507
+ };
508
+ };
509
+ };
510
+ category: {
511
+ type: string;
512
+ };
513
+ label: {
514
+ type: string;
515
+ };
516
+ params: {
517
+ type: string;
518
+ items: {
519
+ type: string;
520
+ additionalProperties: boolean;
521
+ required: string[];
522
+ properties: {
523
+ key: {
524
+ type: string;
525
+ };
526
+ value: {
527
+ type: string;
528
+ };
529
+ };
530
+ };
531
+ };
532
+ };
533
+ };
534
+ })[];
535
+ };
429
536
  target: {
430
537
  type: string;
431
538
  enum: string[];
@@ -5,20 +5,23 @@ 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
9
  import { Github } from '../../icons';
9
10
  import './Button.css';
10
11
  const b = block('button-block');
11
12
  const Button = (props) => {
12
13
  const handleMetrika = useMetrika();
14
+ const handleAnalytics = useAnalytics();
13
15
  const { lang, tld } = useContext(LocaleContext);
14
- const { className, metrikaGoals, pixelEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text } = props, rest = __rest(props, ["className", "metrikaGoals", "pixelEvents", "size", "theme", "url", "img", "onClick", "text"]);
16
+ const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text } = props, rest = __rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "img", "onClick", "text"]);
15
17
  const defaultImgPosition = 'left';
16
18
  const onClick = useCallback(() => {
17
19
  handleMetrika({ metrikaGoals, pixelEvents });
20
+ handleAnalytics(analyticsEvents);
18
21
  if (onClickOrigin) {
19
22
  onClickOrigin();
20
23
  }
21
- }, [handleMetrika, metrikaGoals, pixelEvents, onClickOrigin]);
24
+ }, [handleMetrika, metrikaGoals, pixelEvents, handleAnalytics, analyticsEvents, onClickOrigin]);
22
25
  const buttonImg = img instanceof Object
23
26
  ? { url: img.url, position: img.position || defaultImgPosition, alt: img.alt }
24
27
  : { url: img, position: defaultImgPosition };
@@ -1,5 +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
4
  import './CardBase.css';
4
5
  export interface CardBaseProps extends CardBaseParams {
5
6
  className?: string;
@@ -10,6 +11,7 @@ export interface CardBaseProps extends CardBaseParams {
10
11
  target?: HTMLAttributeAnchorTarget;
11
12
  metrikaGoals?: MetrikaGoal;
12
13
  pixelEvents?: ButtonPixel;
14
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
13
15
  }
14
16
  export interface CardHeaderBaseProps {
15
17
  className?: string;
@@ -3,14 +3,16 @@ 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
7
  import './CardBase.css';
7
8
  const b = block('card-base-block');
8
9
  const Header = () => null;
9
10
  const Content = () => null;
10
11
  const Footer = () => null;
11
12
  export const Layout = (props) => {
12
- const { className, bodyClassName, metrikaGoals, pixelEvents, contentClassName, children, url, target, border = 'shadow', } = props;
13
+ const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', } = props;
13
14
  const handleMetrika = useMetrika();
15
+ const handleAnalytics = useAnalytics();
14
16
  let header, content, footer, image, headerClass, footerClass;
15
17
  function handleChild(child) {
16
18
  switch (child.type) {
@@ -43,6 +45,7 @@ export const Layout = (props) => {
43
45
  const fullClassName = b({ border }, className);
44
46
  const onClick = () => {
45
47
  handleMetrika({ metrikaGoals, pixelEvents });
48
+ handleAnalytics(analyticsEvents);
46
49
  };
47
50
  return url ? (React.createElement(RouterLink, { href: url },
48
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,13 +1,16 @@
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
5
  import './HeaderBreadcrumbs.css';
5
6
  const b = block('header-breadcrumbs');
6
7
  export default function HeaderBreadcrumbs(props) {
7
- const { items, metrikaGoals, pixelEvents, theme = 'light', className } = props;
8
+ const { items, metrikaGoals, pixelEvents, analyticsEvents, theme = 'light', className } = props;
8
9
  const handleMetrika = useMetrika();
10
+ const handleAnalytics = useAnalytics();
9
11
  const onClick = () => {
10
12
  handleMetrika({ metrikaGoals, pixelEvents });
13
+ handleAnalytics(analyticsEvents);
11
14
  };
12
15
  return (React.createElement("div", { className: b({ theme }, className) }, items.map((item) => (React.createElement("div", { className: b('item'), key: item.url },
13
16
  React.createElement("a", { href: item.url, className: b('text'), onClick: onClick }, item.text))))));
@@ -7,6 +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
11
  import './Link.css';
11
12
  const b = block('link-block');
12
13
  const WORD_JOINER_SYM = '\u200b';
@@ -23,14 +24,16 @@ function getArrowSize(size) {
23
24
  }
24
25
  }
25
26
  const LinkBlock = (props) => {
26
- const { text, url, arrow, metrikaGoals, pixelEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, } = props;
27
+ const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, } = props;
27
28
  const handleMetrika = useMetrika();
29
+ const handleAnalytics = useAnalytics();
28
30
  const { hostname } = useContext(LocationContext);
29
31
  const { tld } = useContext(LocaleContext);
30
32
  const href = setUrlTld(props.url, tld);
31
33
  const defaultTextSize = theme === 'back' ? 'l' : 'm';
32
34
  const onClick = () => {
33
35
  handleMetrika({ metrikaGoals, pixelEvents });
36
+ handleAnalytics(analyticsEvents);
34
37
  };
35
38
  const getLinkByType = () => {
36
39
  switch (theme) {
@@ -1,4 +1,5 @@
1
1
  import { PixelEvent } from '../../models';
2
+ import { AnalyticsEvent } from '../../models/common';
2
3
  export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
3
4
  export interface YandexFormProps {
4
5
  id: number | string;
@@ -14,6 +15,7 @@ export interface YandexFormProps {
14
15
  onLoad?: () => void;
15
16
  metrikaGoals?: string | string[];
16
17
  pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
18
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
17
19
  }
18
20
  declare const YandexForm: (props: YandexFormProps) => JSX.Element;
19
21
  export default YandexForm;
@@ -4,15 +4,17 @@ import { LocaleContext } from '../../context/localeContext';
4
4
  import { MobileContext } from '../../context/mobileContext';
5
5
  import { block } from '../../utils';
6
6
  import { useMetrika } from '../../hooks/useMetrika';
7
+ import { useAnalytics } from '../..//hooks/useAnalytics';
7
8
  export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
8
9
  const CONTAINER_ID = 'pc-yandex-form-container';
9
10
  const b = block('yandex-form');
10
11
  const YandexForm = (props) => {
11
- const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, customFormOrigin, } = props;
12
+ const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
12
13
  const formContainerRef = useRef(null);
13
14
  const iframeRef = useRef();
14
15
  const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;
15
16
  const handleMetrika = useMetrika();
17
+ const handleAnalytics = useAnalytics();
16
18
  const isMobile = useContext(MobileContext);
17
19
  const locale = useContext(LocaleContext);
18
20
  const updateFormIframe = useCallback((container) => {
@@ -53,10 +55,19 @@ const YandexForm = (props) => {
53
55
  window.scrollBy(0, top - headerHeight);
54
56
  }
55
57
  handleMetrika({ metrikaGoals, pixelEvents });
58
+ handleAnalytics(analyticsEvents);
56
59
  if (onSubmit) {
57
60
  onSubmit();
58
61
  }
59
- }, [handleMetrika, metrikaGoals, pixelEvents, onSubmit, headerHeight]);
62
+ }, [
63
+ handleMetrika,
64
+ metrikaGoals,
65
+ pixelEvents,
66
+ handleAnalytics,
67
+ analyticsEvents,
68
+ onSubmit,
69
+ headerHeight,
70
+ ]);
60
71
  const handleMessage = useCallback(({ origin, data }) => {
61
72
  if (origin !== yaFormOrigin) {
62
73
  return;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { AnalyticsEvent } from '../../models';
3
+ export interface AnalyticsContextProps {
4
+ sendEvents?: (e: AnalyticsEvent | AnalyticsEvent[]) => void;
5
+ }
6
+ export declare const AnalyticsContext: React.Context<AnalyticsContextProps>;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export const AnalyticsContext = React.createContext({});
@@ -0,0 +1 @@
1
+ export * from './analyticsContext';
@@ -0,0 +1 @@
1
+ export * from './analyticsContext';
@@ -1,7 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Metrika, Pixel } from '../../models';
3
3
  export interface MetrikaContextProps {
4
+ /**
5
+ * @deprecated Metrika will be deleted
6
+ */
4
7
  metrika?: Metrika;
8
+ /**
9
+ * @deprecated Metrika will be deleted
10
+ */
5
11
  pixel?: Pixel;
6
12
  }
7
13
  export declare const MetrikaContext: React.Context<MetrikaContextProps>;
@@ -0,0 +1,2 @@
1
+ import { AnalyticsEvent } from '../models';
2
+ export declare const useAnalytics: () => (e?: AnalyticsEvent | AnalyticsEvent[]) => void;