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

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 (32) hide show
  1. package/build/cjs/blocks/Banner/schema.d.ts +6 -24
  2. package/build/cjs/blocks/Media/schema.d.ts +2 -8
  3. package/build/cjs/components/CardBase/CardBase.d.ts +2 -2
  4. package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -2
  5. package/build/cjs/context/analyticsContext/analyticsContext.d.ts +2 -2
  6. package/build/cjs/hooks/useAnalytics.d.ts +2 -2
  7. package/build/cjs/hooks/useAnalytics.js +2 -2
  8. package/build/cjs/models/common.d.ts +1 -9
  9. package/build/cjs/models/constructor-items/common.d.ts +6 -6
  10. package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -2
  11. package/build/cjs/schema/validators/common.d.ts +4 -16
  12. package/build/cjs/schema/validators/common.js +1 -1
  13. package/build/cjs/schema/validators/event.d.ts +1 -58
  14. package/build/cjs/schema/validators/event.js +2 -57
  15. package/build/esm/blocks/Banner/schema.d.ts +6 -24
  16. package/build/esm/blocks/Media/schema.d.ts +2 -8
  17. package/build/esm/components/CardBase/CardBase.d.ts +2 -2
  18. package/build/esm/components/YandexForm/YandexForm.d.ts +2 -2
  19. package/build/esm/context/analyticsContext/analyticsContext.d.ts +2 -2
  20. package/build/esm/hooks/useAnalytics.d.ts +2 -2
  21. package/build/esm/hooks/useAnalytics.js +2 -2
  22. package/build/esm/models/common.d.ts +1 -9
  23. package/build/esm/models/constructor-items/common.d.ts +6 -6
  24. package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -2
  25. package/build/esm/schema/validators/common.d.ts +4 -16
  26. package/build/esm/schema/validators/common.js +2 -2
  27. package/build/esm/schema/validators/event.d.ts +1 -58
  28. package/build/esm/schema/validators/event.js +1 -56
  29. package/package.json +1 -1
  30. package/server/models/common.d.ts +1 -9
  31. package/server/models/constructor-items/common.d.ts +6 -6
  32. package/server/models/constructor-items/sub-blocks.d.ts +2 -2
@@ -176,10 +176,7 @@ export declare const BannerCardProps: {
176
176
  analyticsEvents: {
177
177
  anyOf: ({
178
178
  type: string;
179
- propertyNames: {
180
- type: string;
181
- };
182
- additionalProperty: {
179
+ additionalProperties: {
183
180
  type: string;
184
181
  };
185
182
  required: string[];
@@ -214,10 +211,7 @@ export declare const BannerCardProps: {
214
211
  type: string;
215
212
  items: {
216
213
  type: string;
217
- propertyNames: {
218
- type: string;
219
- };
220
- additionalProperty: {
214
+ additionalProperties: {
221
215
  type: string;
222
216
  };
223
217
  required: string[];
@@ -456,10 +450,7 @@ export declare const BannerBlock: {
456
450
  analyticsEvents: {
457
451
  anyOf: ({
458
452
  type: string;
459
- propertyNames: {
460
- type: string;
461
- };
462
- additionalProperty: {
453
+ additionalProperties: {
463
454
  type: string;
464
455
  };
465
456
  required: string[];
@@ -494,10 +485,7 @@ export declare const BannerBlock: {
494
485
  type: string;
495
486
  items: {
496
487
  type: string;
497
- propertyNames: {
498
- type: string;
499
- };
500
- additionalProperty: {
488
+ additionalProperties: {
501
489
  type: string;
502
490
  };
503
491
  required: string[];
@@ -737,10 +725,7 @@ export declare const BannerCard: {
737
725
  analyticsEvents: {
738
726
  anyOf: ({
739
727
  type: string;
740
- propertyNames: {
741
- type: string;
742
- };
743
- additionalProperty: {
728
+ additionalProperties: {
744
729
  type: string;
745
730
  };
746
731
  required: string[];
@@ -775,10 +760,7 @@ export declare const BannerCard: {
775
760
  type: string;
776
761
  items: {
777
762
  type: string;
778
- propertyNames: {
779
- type: string;
780
- };
781
- additionalProperty: {
763
+ additionalProperties: {
782
764
  type: string;
783
765
  };
784
766
  required: string[];
@@ -429,10 +429,7 @@ export declare const MediaBlock: {
429
429
  analyticsEvents: {
430
430
  anyOf: ({
431
431
  type: string;
432
- propertyNames: {
433
- type: string;
434
- };
435
- additionalProperty: {
432
+ additionalProperties: {
436
433
  type: string;
437
434
  };
438
435
  required: string[];
@@ -467,10 +464,7 @@ export declare const MediaBlock: {
467
464
  type: string;
468
465
  items: {
469
466
  type: string;
470
- propertyNames: {
471
- type: string;
472
- };
473
- additionalProperty: {
467
+ additionalProperties: {
474
468
  type: string;
475
469
  };
476
470
  required: string[];
@@ -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 { AnalyticsEventV2 } from '../../models/common';
3
+ import { AnalyticsEvent } from '../../models/common';
4
4
  export interface CardBaseProps extends CardBaseParams {
5
5
  className?: string;
6
6
  bodyClassName?: string;
@@ -10,7 +10,7 @@ export interface CardBaseProps extends CardBaseParams {
10
10
  target?: HTMLAttributeAnchorTarget;
11
11
  metrikaGoals?: MetrikaGoal;
12
12
  pixelEvents?: ButtonPixel;
13
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
13
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
14
14
  }
15
15
  export interface CardHeaderBaseProps {
16
16
  className?: string;
@@ -1,5 +1,5 @@
1
1
  import { PixelEvent } from '../../models';
2
- import { AnalyticsEventV2 } from '../../models/common';
2
+ import { AnalyticsEvent } from '../../models/common';
3
3
  export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
4
4
  export interface YandexFormProps {
5
5
  id: number | string;
@@ -15,7 +15,7 @@ export interface YandexFormProps {
15
15
  onLoad?: () => void;
16
16
  metrikaGoals?: string | string[];
17
17
  pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
18
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
18
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
19
19
  }
20
20
  declare const YandexForm: (props: YandexFormProps) => JSX.Element;
21
21
  export default YandexForm;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AnalyticsEventV2 } from '../../models';
2
+ import { AnalyticsEvent } from '../../models';
3
3
  export interface AnalyticsContextProps {
4
- sendEvents?: (e: AnalyticsEventV2 | AnalyticsEventV2[]) => void;
4
+ sendEvents?: (e: AnalyticsEvent | AnalyticsEvent[], defaults?: Record<string, string | boolean | number>) => void;
5
5
  }
6
6
  export declare const AnalyticsContext: React.Context<AnalyticsContextProps>;
@@ -1,2 +1,2 @@
1
- import { AnalyticsEventV2 } from '../models';
2
- export declare const useAnalytics: () => ((e?: AnalyticsEventV2 | AnalyticsEventV2[]) => void) | undefined;
1
+ import { AnalyticsEvent } from '../models';
2
+ export declare const useAnalytics: () => ((e?: AnalyticsEvent | AnalyticsEvent[], defaults?: Record<string, string | boolean | number>) => void) | undefined;
@@ -8,11 +8,11 @@ const useAnalytics = () => {
8
8
  if (!sendEvents) {
9
9
  return undefined;
10
10
  }
11
- return (e) => {
11
+ return (e, defaults) => {
12
12
  if (!e) {
13
13
  return;
14
14
  }
15
- sendEvents(e);
15
+ sendEvents(e, defaults);
16
16
  };
17
17
  };
18
18
  exports.useAnalytics = useAnalytics;
@@ -72,15 +72,7 @@ export type AnalyticsCounters = {
72
72
  include?: string[];
73
73
  exclude?: string[];
74
74
  };
75
- export type AnalyticsEvent = {
76
- name: string;
77
- type?: string;
78
- counters?: AnalyticsCounters;
79
- category?: string;
80
- label?: string;
81
- params?: AnalyticsParameter[];
82
- };
83
- export type AnalyticsEventV2<T = {}> = T & {
75
+ export type AnalyticsEvent<T = {}> = T & {
84
76
  name: string;
85
77
  type?: string;
86
78
  counters?: AnalyticsCounters;
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { ButtonSize, ButtonView } from '@gravity-ui/uikit';
3
3
  import { ThemeSupporting } from '../../utils/theme';
4
- import { AnalyticsEventV2, ClassNameProps, PixelEventType } from '../common';
4
+ import { AnalyticsEvent, ClassNameProps, PixelEventType } from '../common';
5
5
  export declare enum AuthorType {
6
6
  Column = "column",
7
7
  Line = "line"
@@ -110,7 +110,7 @@ export interface MediaVideoProps {
110
110
  playButton?: PlayButtonProps;
111
111
  controls?: MediaVideoControlsType;
112
112
  metrika?: MetrikaVideo;
113
- analyticsEvents?: AnalyticsEventV2[];
113
+ analyticsEvents?: AnalyticsEvent[];
114
114
  }
115
115
  export interface LinkProps extends Stylable {
116
116
  url: string;
@@ -122,7 +122,7 @@ export interface LinkProps extends Stylable {
122
122
  target?: string;
123
123
  metrikaGoals?: MetrikaGoal;
124
124
  pixelEvents?: ButtonPixel;
125
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
125
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
126
126
  }
127
127
  export interface FileLinkProps extends ClassNameProps {
128
128
  href: string;
@@ -141,7 +141,7 @@ export interface ButtonProps {
141
141
  img?: ButtonImageProps | string;
142
142
  metrikaGoals?: MetrikaGoal;
143
143
  pixelEvents?: ButtonPixel;
144
- analyticsEvents?: AnalyticsEventV2[];
144
+ analyticsEvents?: AnalyticsEvent[];
145
145
  target?: string;
146
146
  }
147
147
  export interface ButtonImageProps {
@@ -170,7 +170,7 @@ export interface MediaComponentVideoProps {
170
170
  video: MediaVideoProps;
171
171
  height?: number;
172
172
  metrika?: MetrikaVideo;
173
- analyticsEvents?: AnalyticsEventV2[];
173
+ analyticsEvents?: AnalyticsEvent[];
174
174
  previewImg?: string;
175
175
  }
176
176
  export interface MediaComponentYoutubeProps {
@@ -226,7 +226,7 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
226
226
  theme?: TextTheme;
227
227
  metrikaGoals?: MetrikaGoal;
228
228
  pixelEvents?: ButtonPixel;
229
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
229
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
230
230
  }
231
231
  export interface PreviewContentItemProps {
232
232
  title: string;
@@ -3,7 +3,7 @@ import { ThemeSupporting } from '../../utils';
3
3
  import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
4
4
  import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
5
5
  import { ContentBlockProps } from './blocks';
6
- import { AnalyticsEventV2, PixelEvent } from '../common';
6
+ import { AnalyticsEvent, PixelEvent } from '../common';
7
7
  export declare enum SubBlockType {
8
8
  Divider = "divider",
9
9
  Quote = "quote",
@@ -61,7 +61,7 @@ export interface HubspotFormProps extends HubspotEventHandlers {
61
61
  onLoad?: (arg: HubspotEventData) => void;
62
62
  pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
63
63
  hubspotEvents?: string[];
64
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
64
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
65
65
  }
66
66
  export interface PartnerProps extends CardBaseProps {
67
67
  text: string;
@@ -508,10 +508,7 @@ export declare const ButtonProps: {
508
508
  analyticsEvents: {
509
509
  anyOf: ({
510
510
  type: string;
511
- propertyNames: {
512
- type: string;
513
- };
514
- additionalProperty: {
511
+ additionalProperties: {
515
512
  type: string;
516
513
  };
517
514
  required: string[];
@@ -546,10 +543,7 @@ export declare const ButtonProps: {
546
543
  type: string;
547
544
  items: {
548
545
  type: string;
549
- propertyNames: {
550
- type: string;
551
- };
552
- additionalProperty: {
546
+ additionalProperties: {
553
547
  type: string;
554
548
  };
555
549
  required: string[];
@@ -807,10 +801,7 @@ export declare const ButtonBlock: {
807
801
  analyticsEvents: {
808
802
  anyOf: ({
809
803
  type: string;
810
- propertyNames: {
811
- type: string;
812
- };
813
- additionalProperty: {
804
+ additionalProperties: {
814
805
  type: string;
815
806
  };
816
807
  required: string[];
@@ -845,10 +836,7 @@ export declare const ButtonBlock: {
845
836
  type: string;
846
837
  items: {
847
838
  type: string;
848
- propertyNames: {
849
- type: string;
850
- };
851
- additionalProperty: {
839
+ additionalProperties: {
852
840
  type: string;
853
841
  };
854
842
  required: string[];
@@ -340,7 +340,7 @@ exports.ButtonProps = {
340
340
  */
341
341
  pixelEvents: pixel_1.pixelEvents,
342
342
  analyticsEvents: {
343
- anyOf: [event_1.AnalyticsEventV2Schema, { type: 'array', items: event_1.AnalyticsEventV2Schema }],
343
+ anyOf: [event_1.AnalyticsEventSchema, { type: 'array', items: event_1.AnalyticsEventSchema }],
344
344
  },
345
345
  target: {
346
346
  type: 'string',
@@ -1,63 +1,6 @@
1
1
  export declare const AnalyticsEventSchema: {
2
2
  type: string;
3
- additionalProperties: boolean;
4
- required: string[];
5
- properties: {
6
- name: {
7
- type: string;
8
- };
9
- type: {
10
- type: string;
11
- };
12
- counters: {
13
- type: string;
14
- additionalProperties: boolean;
15
- required: never[];
16
- properties: {
17
- include: {
18
- type: string;
19
- items: {
20
- type: string;
21
- };
22
- };
23
- exclude: {
24
- type: string;
25
- items: {
26
- type: string;
27
- };
28
- };
29
- };
30
- };
31
- category: {
32
- type: string;
33
- };
34
- label: {
35
- type: string;
36
- };
37
- params: {
38
- type: string;
39
- items: {
40
- type: string;
41
- additionalProperties: boolean;
42
- required: string[];
43
- properties: {
44
- key: {
45
- type: string;
46
- };
47
- value: {
48
- type: string;
49
- };
50
- };
51
- };
52
- };
53
- };
54
- };
55
- export declare const AnalyticsEventV2Schema: {
56
- type: string;
57
- propertyNames: {
58
- type: string;
59
- };
60
- additionalProperty: {
3
+ additionalProperties: {
61
4
  type: string;
62
5
  };
63
6
  required: string[];
@@ -1,64 +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,
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
- category: {
35
- type: 'string',
36
- },
37
- label: {
38
- type: 'string',
39
- },
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
- propertyNames: { type: 'string' },
61
- additionalProperty: { type: 'number' },
6
+ additionalProperties: { type: 'string' },
62
7
  required: ['name'],
63
8
  properties: {
64
9
  name: {
@@ -176,10 +176,7 @@ export declare const BannerCardProps: {
176
176
  analyticsEvents: {
177
177
  anyOf: ({
178
178
  type: string;
179
- propertyNames: {
180
- type: string;
181
- };
182
- additionalProperty: {
179
+ additionalProperties: {
183
180
  type: string;
184
181
  };
185
182
  required: string[];
@@ -214,10 +211,7 @@ export declare const BannerCardProps: {
214
211
  type: string;
215
212
  items: {
216
213
  type: string;
217
- propertyNames: {
218
- type: string;
219
- };
220
- additionalProperty: {
214
+ additionalProperties: {
221
215
  type: string;
222
216
  };
223
217
  required: string[];
@@ -456,10 +450,7 @@ export declare const BannerBlock: {
456
450
  analyticsEvents: {
457
451
  anyOf: ({
458
452
  type: string;
459
- propertyNames: {
460
- type: string;
461
- };
462
- additionalProperty: {
453
+ additionalProperties: {
463
454
  type: string;
464
455
  };
465
456
  required: string[];
@@ -494,10 +485,7 @@ export declare const BannerBlock: {
494
485
  type: string;
495
486
  items: {
496
487
  type: string;
497
- propertyNames: {
498
- type: string;
499
- };
500
- additionalProperty: {
488
+ additionalProperties: {
501
489
  type: string;
502
490
  };
503
491
  required: string[];
@@ -737,10 +725,7 @@ export declare const BannerCard: {
737
725
  analyticsEvents: {
738
726
  anyOf: ({
739
727
  type: string;
740
- propertyNames: {
741
- type: string;
742
- };
743
- additionalProperty: {
728
+ additionalProperties: {
744
729
  type: string;
745
730
  };
746
731
  required: string[];
@@ -775,10 +760,7 @@ export declare const BannerCard: {
775
760
  type: string;
776
761
  items: {
777
762
  type: string;
778
- propertyNames: {
779
- type: string;
780
- };
781
- additionalProperty: {
763
+ additionalProperties: {
782
764
  type: string;
783
765
  };
784
766
  required: string[];
@@ -429,10 +429,7 @@ export declare const MediaBlock: {
429
429
  analyticsEvents: {
430
430
  anyOf: ({
431
431
  type: string;
432
- propertyNames: {
433
- type: string;
434
- };
435
- additionalProperty: {
432
+ additionalProperties: {
436
433
  type: string;
437
434
  };
438
435
  required: string[];
@@ -467,10 +464,7 @@ export declare const MediaBlock: {
467
464
  type: string;
468
465
  items: {
469
466
  type: string;
470
- propertyNames: {
471
- type: string;
472
- };
473
- additionalProperty: {
467
+ additionalProperties: {
474
468
  type: string;
475
469
  };
476
470
  required: string[];
@@ -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 { AnalyticsEventV2 } from '../../models/common';
3
+ import { AnalyticsEvent } 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?: AnalyticsEventV2 | AnalyticsEventV2[];
14
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
15
15
  }
16
16
  export interface CardHeaderBaseProps {
17
17
  className?: string;
@@ -1,5 +1,5 @@
1
1
  import { PixelEvent } from '../../models';
2
- import { AnalyticsEventV2 } from '../../models/common';
2
+ import { AnalyticsEvent } from '../../models/common';
3
3
  export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
4
4
  export interface YandexFormProps {
5
5
  id: number | string;
@@ -15,7 +15,7 @@ export interface YandexFormProps {
15
15
  onLoad?: () => void;
16
16
  metrikaGoals?: string | string[];
17
17
  pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
18
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
18
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
19
19
  }
20
20
  declare const YandexForm: (props: YandexFormProps) => JSX.Element;
21
21
  export default YandexForm;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AnalyticsEventV2 } from '../../models';
2
+ import { AnalyticsEvent } from '../../models';
3
3
  export interface AnalyticsContextProps {
4
- sendEvents?: (e: AnalyticsEventV2 | AnalyticsEventV2[]) => void;
4
+ sendEvents?: (e: AnalyticsEvent | AnalyticsEvent[], defaults?: Record<string, string | boolean | number>) => void;
5
5
  }
6
6
  export declare const AnalyticsContext: React.Context<AnalyticsContextProps>;
@@ -1,2 +1,2 @@
1
- import { AnalyticsEventV2 } from '../models';
2
- export declare const useAnalytics: () => ((e?: AnalyticsEventV2 | AnalyticsEventV2[]) => void) | undefined;
1
+ import { AnalyticsEvent } from '../models';
2
+ export declare const useAnalytics: () => ((e?: AnalyticsEvent | AnalyticsEvent[], defaults?: Record<string, string | boolean | number>) => void) | undefined;
@@ -5,10 +5,10 @@ export const useAnalytics = () => {
5
5
  if (!sendEvents) {
6
6
  return undefined;
7
7
  }
8
- return (e) => {
8
+ return (e, defaults) => {
9
9
  if (!e) {
10
10
  return;
11
11
  }
12
- sendEvents(e);
12
+ sendEvents(e, defaults);
13
13
  };
14
14
  };
@@ -72,15 +72,7 @@ export type AnalyticsCounters = {
72
72
  include?: string[];
73
73
  exclude?: string[];
74
74
  };
75
- export type AnalyticsEvent = {
76
- name: string;
77
- type?: string;
78
- counters?: AnalyticsCounters;
79
- category?: string;
80
- label?: string;
81
- params?: AnalyticsParameter[];
82
- };
83
- export type AnalyticsEventV2<T = {}> = T & {
75
+ export type AnalyticsEvent<T = {}> = T & {
84
76
  name: string;
85
77
  type?: string;
86
78
  counters?: AnalyticsCounters;
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { ButtonSize, ButtonView } from '@gravity-ui/uikit';
3
3
  import { ThemeSupporting } from '../../utils/theme';
4
- import { AnalyticsEventV2, ClassNameProps, PixelEventType } from '../common';
4
+ import { AnalyticsEvent, ClassNameProps, PixelEventType } from '../common';
5
5
  export declare enum AuthorType {
6
6
  Column = "column",
7
7
  Line = "line"
@@ -110,7 +110,7 @@ export interface MediaVideoProps {
110
110
  playButton?: PlayButtonProps;
111
111
  controls?: MediaVideoControlsType;
112
112
  metrika?: MetrikaVideo;
113
- analyticsEvents?: AnalyticsEventV2[];
113
+ analyticsEvents?: AnalyticsEvent[];
114
114
  }
115
115
  export interface LinkProps extends Stylable {
116
116
  url: string;
@@ -122,7 +122,7 @@ export interface LinkProps extends Stylable {
122
122
  target?: string;
123
123
  metrikaGoals?: MetrikaGoal;
124
124
  pixelEvents?: ButtonPixel;
125
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
125
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
126
126
  }
127
127
  export interface FileLinkProps extends ClassNameProps {
128
128
  href: string;
@@ -141,7 +141,7 @@ export interface ButtonProps {
141
141
  img?: ButtonImageProps | string;
142
142
  metrikaGoals?: MetrikaGoal;
143
143
  pixelEvents?: ButtonPixel;
144
- analyticsEvents?: AnalyticsEventV2[];
144
+ analyticsEvents?: AnalyticsEvent[];
145
145
  target?: string;
146
146
  }
147
147
  export interface ButtonImageProps {
@@ -170,7 +170,7 @@ export interface MediaComponentVideoProps {
170
170
  video: MediaVideoProps;
171
171
  height?: number;
172
172
  metrika?: MetrikaVideo;
173
- analyticsEvents?: AnalyticsEventV2[];
173
+ analyticsEvents?: AnalyticsEvent[];
174
174
  previewImg?: string;
175
175
  }
176
176
  export interface MediaComponentYoutubeProps {
@@ -226,7 +226,7 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
226
226
  theme?: TextTheme;
227
227
  metrikaGoals?: MetrikaGoal;
228
228
  pixelEvents?: ButtonPixel;
229
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
229
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
230
230
  }
231
231
  export interface PreviewContentItemProps {
232
232
  title: string;
@@ -3,7 +3,7 @@ import { ThemeSupporting } from '../../utils';
3
3
  import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
4
4
  import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
5
5
  import { ContentBlockProps } from './blocks';
6
- import { AnalyticsEventV2, PixelEvent } from '../common';
6
+ import { AnalyticsEvent, PixelEvent } from '../common';
7
7
  export declare enum SubBlockType {
8
8
  Divider = "divider",
9
9
  Quote = "quote",
@@ -61,7 +61,7 @@ export interface HubspotFormProps extends HubspotEventHandlers {
61
61
  onLoad?: (arg: HubspotEventData) => void;
62
62
  pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
63
63
  hubspotEvents?: string[];
64
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
64
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
65
65
  }
66
66
  export interface PartnerProps extends CardBaseProps {
67
67
  text: string;
@@ -508,10 +508,7 @@ export declare const ButtonProps: {
508
508
  analyticsEvents: {
509
509
  anyOf: ({
510
510
  type: string;
511
- propertyNames: {
512
- type: string;
513
- };
514
- additionalProperty: {
511
+ additionalProperties: {
515
512
  type: string;
516
513
  };
517
514
  required: string[];
@@ -546,10 +543,7 @@ export declare const ButtonProps: {
546
543
  type: string;
547
544
  items: {
548
545
  type: string;
549
- propertyNames: {
550
- type: string;
551
- };
552
- additionalProperty: {
546
+ additionalProperties: {
553
547
  type: string;
554
548
  };
555
549
  required: string[];
@@ -807,10 +801,7 @@ export declare const ButtonBlock: {
807
801
  analyticsEvents: {
808
802
  anyOf: ({
809
803
  type: string;
810
- propertyNames: {
811
- type: string;
812
- };
813
- additionalProperty: {
804
+ additionalProperties: {
814
805
  type: string;
815
806
  };
816
807
  required: string[];
@@ -845,10 +836,7 @@ export declare const ButtonBlock: {
845
836
  type: string;
846
837
  items: {
847
838
  type: string;
848
- propertyNames: {
849
- type: string;
850
- };
851
- additionalProperty: {
839
+ additionalProperties: {
852
840
  type: string;
853
841
  };
854
842
  required: string[];
@@ -1,7 +1,7 @@
1
1
  import { pixelEvents } from './pixel';
2
2
  import { Theme } from '../../models';
3
3
  import { ImageProps, urlPattern } from '../../components/Image/schema';
4
- import { AnalyticsEventV2Schema } from './event';
4
+ import { AnalyticsEventSchema } from './event';
5
5
  export const mediaDirection = ['media-content', 'content-media'];
6
6
  export const textSize = ['s', 'm', 'l'];
7
7
  export const containerSizesArray = ['sm', 'md', 'lg', 'xl', 'all'];
@@ -337,7 +337,7 @@ export const ButtonProps = {
337
337
  */
338
338
  pixelEvents,
339
339
  analyticsEvents: {
340
- anyOf: [AnalyticsEventV2Schema, { type: 'array', items: AnalyticsEventV2Schema }],
340
+ anyOf: [AnalyticsEventSchema, { type: 'array', items: AnalyticsEventSchema }],
341
341
  },
342
342
  target: {
343
343
  type: 'string',
@@ -1,63 +1,6 @@
1
1
  export declare const AnalyticsEventSchema: {
2
2
  type: string;
3
- additionalProperties: boolean;
4
- required: string[];
5
- properties: {
6
- name: {
7
- type: string;
8
- };
9
- type: {
10
- type: string;
11
- };
12
- counters: {
13
- type: string;
14
- additionalProperties: boolean;
15
- required: never[];
16
- properties: {
17
- include: {
18
- type: string;
19
- items: {
20
- type: string;
21
- };
22
- };
23
- exclude: {
24
- type: string;
25
- items: {
26
- type: string;
27
- };
28
- };
29
- };
30
- };
31
- category: {
32
- type: string;
33
- };
34
- label: {
35
- type: string;
36
- };
37
- params: {
38
- type: string;
39
- items: {
40
- type: string;
41
- additionalProperties: boolean;
42
- required: string[];
43
- properties: {
44
- key: {
45
- type: string;
46
- };
47
- value: {
48
- type: string;
49
- };
50
- };
51
- };
52
- };
53
- };
54
- };
55
- export declare const AnalyticsEventV2Schema: {
56
- type: string;
57
- propertyNames: {
58
- type: string;
59
- };
60
- additionalProperty: {
3
+ additionalProperties: {
61
4
  type: string;
62
5
  };
63
6
  required: string[];
@@ -1,61 +1,6 @@
1
1
  export const AnalyticsEventSchema = {
2
2
  type: 'object',
3
- additionalProperties: false,
4
- required: ['name'],
5
- properties: {
6
- name: {
7
- type: 'string',
8
- },
9
- type: {
10
- type: 'string',
11
- },
12
- counters: {
13
- type: 'object',
14
- additionalProperties: false,
15
- required: [],
16
- properties: {
17
- include: {
18
- type: 'array',
19
- items: {
20
- type: 'string',
21
- },
22
- },
23
- exclude: {
24
- type: 'array',
25
- items: {
26
- type: 'string',
27
- },
28
- },
29
- },
30
- },
31
- category: {
32
- type: 'string',
33
- },
34
- label: {
35
- type: 'string',
36
- },
37
- params: {
38
- type: 'array',
39
- items: {
40
- type: 'object',
41
- additionalProperties: false,
42
- required: ['key', 'value'],
43
- properties: {
44
- key: {
45
- type: 'string',
46
- },
47
- value: {
48
- type: 'string',
49
- },
50
- },
51
- },
52
- },
53
- },
54
- };
55
- export const AnalyticsEventV2Schema = {
56
- type: 'object',
57
- propertyNames: { type: 'string' },
58
- additionalProperty: { type: 'number' },
3
+ additionalProperties: { type: 'string' },
59
4
  required: ['name'],
60
5
  properties: {
61
6
  name: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "1.15.0-alpha.0",
3
+ "version": "1.15.0-alpha.2",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -72,15 +72,7 @@ export type AnalyticsCounters = {
72
72
  include?: string[];
73
73
  exclude?: string[];
74
74
  };
75
- export type AnalyticsEvent = {
76
- name: string;
77
- type?: string;
78
- counters?: AnalyticsCounters;
79
- category?: string;
80
- label?: string;
81
- params?: AnalyticsParameter[];
82
- };
83
- export type AnalyticsEventV2<T = {}> = T & {
75
+ export type AnalyticsEvent<T = {}> = T & {
84
76
  name: string;
85
77
  type?: string;
86
78
  counters?: AnalyticsCounters;
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { ButtonSize, ButtonView } from '@gravity-ui/uikit';
3
3
  import { ThemeSupporting } from '../../utils/theme';
4
- import { AnalyticsEventV2, ClassNameProps, PixelEventType } from '../common';
4
+ import { AnalyticsEvent, ClassNameProps, PixelEventType } from '../common';
5
5
  export declare enum AuthorType {
6
6
  Column = "column",
7
7
  Line = "line"
@@ -110,7 +110,7 @@ export interface MediaVideoProps {
110
110
  playButton?: PlayButtonProps;
111
111
  controls?: MediaVideoControlsType;
112
112
  metrika?: MetrikaVideo;
113
- analyticsEvents?: AnalyticsEventV2[];
113
+ analyticsEvents?: AnalyticsEvent[];
114
114
  }
115
115
  export interface LinkProps extends Stylable {
116
116
  url: string;
@@ -122,7 +122,7 @@ export interface LinkProps extends Stylable {
122
122
  target?: string;
123
123
  metrikaGoals?: MetrikaGoal;
124
124
  pixelEvents?: ButtonPixel;
125
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
125
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
126
126
  }
127
127
  export interface FileLinkProps extends ClassNameProps {
128
128
  href: string;
@@ -141,7 +141,7 @@ export interface ButtonProps {
141
141
  img?: ButtonImageProps | string;
142
142
  metrikaGoals?: MetrikaGoal;
143
143
  pixelEvents?: ButtonPixel;
144
- analyticsEvents?: AnalyticsEventV2[];
144
+ analyticsEvents?: AnalyticsEvent[];
145
145
  target?: string;
146
146
  }
147
147
  export interface ButtonImageProps {
@@ -170,7 +170,7 @@ export interface MediaComponentVideoProps {
170
170
  video: MediaVideoProps;
171
171
  height?: number;
172
172
  metrika?: MetrikaVideo;
173
- analyticsEvents?: AnalyticsEventV2[];
173
+ analyticsEvents?: AnalyticsEvent[];
174
174
  previewImg?: string;
175
175
  }
176
176
  export interface MediaComponentYoutubeProps {
@@ -226,7 +226,7 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
226
226
  theme?: TextTheme;
227
227
  metrikaGoals?: MetrikaGoal;
228
228
  pixelEvents?: ButtonPixel;
229
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
229
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
230
230
  }
231
231
  export interface PreviewContentItemProps {
232
232
  title: string;
@@ -3,7 +3,7 @@ import { ThemeSupporting } from '../../utils';
3
3
  import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
4
4
  import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
5
5
  import { ContentBlockProps } from './blocks';
6
- import { AnalyticsEventV2, PixelEvent } from '../common';
6
+ import { AnalyticsEvent, PixelEvent } from '../common';
7
7
  export declare enum SubBlockType {
8
8
  Divider = "divider",
9
9
  Quote = "quote",
@@ -61,7 +61,7 @@ export interface HubspotFormProps extends HubspotEventHandlers {
61
61
  onLoad?: (arg: HubspotEventData) => void;
62
62
  pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
63
63
  hubspotEvents?: string[];
64
- analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
64
+ analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
65
65
  }
66
66
  export interface PartnerProps extends CardBaseProps {
67
67
  text: string;