@gravity-ui/page-constructor 1.15.0-alpha.1 → 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.
- package/build/cjs/components/CardBase/CardBase.d.ts +2 -2
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -2
- package/build/cjs/context/analyticsContext/analyticsContext.d.ts +2 -2
- package/build/cjs/hooks/useAnalytics.d.ts +2 -2
- package/build/cjs/hooks/useAnalytics.js +2 -2
- package/build/cjs/models/common.d.ts +1 -9
- package/build/cjs/models/constructor-items/common.d.ts +6 -6
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -2
- package/build/cjs/schema/validators/common.js +1 -1
- package/build/cjs/schema/validators/event.d.ts +0 -54
- package/build/cjs/schema/validators/event.js +1 -55
- package/build/esm/components/CardBase/CardBase.d.ts +2 -2
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -2
- package/build/esm/context/analyticsContext/analyticsContext.d.ts +2 -2
- package/build/esm/hooks/useAnalytics.d.ts +2 -2
- package/build/esm/hooks/useAnalytics.js +2 -2
- package/build/esm/models/common.d.ts +1 -9
- package/build/esm/models/constructor-items/common.d.ts +6 -6
- package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -2
- package/build/esm/schema/validators/common.js +2 -2
- package/build/esm/schema/validators/event.d.ts +0 -54
- package/build/esm/schema/validators/event.js +0 -54
- package/package.json +1 -1
- package/server/models/common.d.ts +1 -9
- package/server/models/constructor-items/common.d.ts +6 -6
- package/server/models/constructor-items/sub-blocks.d.ts +2 -2
|
@@ -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 {
|
|
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?:
|
|
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 {
|
|
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?:
|
|
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 {
|
|
2
|
+
import { AnalyticsEvent } from '../../models';
|
|
3
3
|
export interface AnalyticsContextProps {
|
|
4
|
-
sendEvents?: (e:
|
|
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 {
|
|
2
|
-
export declare const useAnalytics: () => ((e?:
|
|
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 {
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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 {
|
|
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?:
|
|
64
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
65
65
|
}
|
|
66
66
|
export interface PartnerProps extends CardBaseProps {
|
|
67
67
|
text: string;
|
|
@@ -340,7 +340,7 @@ exports.ButtonProps = {
|
|
|
340
340
|
*/
|
|
341
341
|
pixelEvents: pixel_1.pixelEvents,
|
|
342
342
|
analyticsEvents: {
|
|
343
|
-
anyOf: [event_1.
|
|
343
|
+
anyOf: [event_1.AnalyticsEventSchema, { type: 'array', items: event_1.AnalyticsEventSchema }],
|
|
344
344
|
},
|
|
345
345
|
target: {
|
|
346
346
|
type: 'string',
|
|
@@ -1,58 +1,4 @@
|
|
|
1
1
|
export declare const AnalyticsEventSchema: {
|
|
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
2
|
type: string;
|
|
57
3
|
additionalProperties: {
|
|
58
4
|
type: string;
|
|
@@ -1,61 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AnalyticsEventSchema = void 0;
|
|
4
4
|
exports.AnalyticsEventSchema = {
|
|
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
5
|
type: 'object',
|
|
60
6
|
additionalProperties: { type: 'string' },
|
|
61
7
|
required: ['name'],
|
|
@@ -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 {
|
|
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?:
|
|
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 {
|
|
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?:
|
|
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 {
|
|
2
|
+
import { AnalyticsEvent } from '../../models';
|
|
3
3
|
export interface AnalyticsContextProps {
|
|
4
|
-
sendEvents?: (e:
|
|
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 {
|
|
2
|
-
export declare const useAnalytics: () => ((e?:
|
|
1
|
+
import { AnalyticsEvent } from '../models';
|
|
2
|
+
export declare const useAnalytics: () => ((e?: AnalyticsEvent | AnalyticsEvent[], defaults?: Record<string, string | boolean | number>) => void) | undefined;
|
|
@@ -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 {
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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 {
|
|
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?:
|
|
64
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
65
65
|
}
|
|
66
66
|
export interface PartnerProps extends CardBaseProps {
|
|
67
67
|
text: 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 {
|
|
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: [
|
|
340
|
+
anyOf: [AnalyticsEventSchema, { type: 'array', items: AnalyticsEventSchema }],
|
|
341
341
|
},
|
|
342
342
|
target: {
|
|
343
343
|
type: 'string',
|
|
@@ -1,58 +1,4 @@
|
|
|
1
1
|
export declare const AnalyticsEventSchema: {
|
|
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
2
|
type: string;
|
|
57
3
|
additionalProperties: {
|
|
58
4
|
type: string;
|
|
@@ -1,58 +1,4 @@
|
|
|
1
1
|
export const AnalyticsEventSchema = {
|
|
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
2
|
type: 'object',
|
|
57
3
|
additionalProperties: { type: 'string' },
|
|
58
4
|
required: ['name'],
|
package/package.json
CHANGED
|
@@ -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 {
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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 {
|
|
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?:
|
|
64
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
65
65
|
}
|
|
66
66
|
export interface PartnerProps extends CardBaseProps {
|
|
67
67
|
text: string;
|