@gravity-ui/page-constructor 1.14.0 → 1.15.0-alpha.1
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/blocks/Banner/schema.d.ts +216 -0
- package/build/cjs/blocks/Media/schema.d.ts +72 -0
- package/build/cjs/components/Button/Button.js +5 -2
- package/build/cjs/components/CardBase/CardBase.d.ts +2 -0
- package/build/cjs/components/CardBase/CardBase.js +4 -1
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -1
- package/build/cjs/components/Link/Link.js +4 -1
- package/build/cjs/components/Media/Media.js +3 -2
- package/build/cjs/components/Media/Video/Video.js +4 -3
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +27 -3
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -0
- package/build/cjs/components/YandexForm/YandexForm.js +13 -2
- package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/cjs/containers/PageConstructor/Provider.js +3 -1
- package/build/cjs/context/analyticsContext/analyticsContext.d.ts +6 -0
- package/build/cjs/context/analyticsContext/analyticsContext.js +6 -0
- package/build/cjs/context/analyticsContext/index.d.ts +1 -0
- package/build/cjs/context/analyticsContext/index.js +4 -0
- package/build/cjs/context/metrikaContext/metrikaContext.d.ts +6 -0
- package/build/cjs/hooks/index.d.ts +1 -0
- package/build/cjs/hooks/index.js +1 -0
- package/build/cjs/hooks/useAnalytics.d.ts +2 -0
- package/build/cjs/hooks/useAnalytics.js +18 -0
- package/build/cjs/hooks/useMetrika.d.ts +6 -0
- package/build/cjs/hooks/useMetrika.js +8 -0
- package/build/cjs/models/common.d.ts +36 -0
- package/build/cjs/models/common.js +3 -0
- package/build/cjs/models/constructor-items/common.d.ts +6 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/cjs/schema/validators/common.d.ts +156 -0
- package/build/cjs/schema/validators/common.js +10 -0
- package/build/cjs/schema/validators/event.d.ts +88 -0
- package/build/cjs/schema/validators/event.js +89 -0
- package/build/cjs/sub-blocks/HubspotForm/index.js +13 -2
- package/build/esm/blocks/Banner/schema.d.ts +216 -0
- package/build/esm/blocks/Media/schema.d.ts +72 -0
- package/build/esm/components/Button/Button.js +5 -2
- package/build/esm/components/CardBase/CardBase.d.ts +2 -0
- package/build/esm/components/CardBase/CardBase.js +4 -1
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -1
- package/build/esm/components/Link/Link.js +4 -1
- package/build/esm/components/Media/Media.js +3 -2
- package/build/esm/components/Media/Video/Video.js +4 -3
- package/build/esm/components/ReactPlayer/ReactPlayer.js +27 -3
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -0
- package/build/esm/components/YandexForm/YandexForm.js +13 -2
- package/build/esm/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/esm/containers/PageConstructor/Provider.js +3 -1
- package/build/esm/context/analyticsContext/analyticsContext.d.ts +6 -0
- package/build/esm/context/analyticsContext/analyticsContext.js +2 -0
- package/build/esm/context/analyticsContext/index.d.ts +1 -0
- package/build/esm/context/analyticsContext/index.js +1 -0
- package/build/esm/context/metrikaContext/metrikaContext.d.ts +6 -0
- package/build/esm/hooks/index.d.ts +1 -0
- package/build/esm/hooks/index.js +1 -0
- package/build/esm/hooks/useAnalytics.d.ts +2 -0
- package/build/esm/hooks/useAnalytics.js +14 -0
- package/build/esm/hooks/useMetrika.d.ts +6 -0
- package/build/esm/hooks/useMetrika.js +8 -0
- package/build/esm/models/common.d.ts +36 -0
- package/build/esm/models/common.js +3 -0
- package/build/esm/models/constructor-items/common.d.ts +6 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/esm/schema/validators/common.d.ts +156 -0
- package/build/esm/schema/validators/common.js +10 -0
- package/build/esm/schema/validators/event.d.ts +88 -0
- package/build/esm/schema/validators/event.js +86 -0
- package/build/esm/sub-blocks/HubspotForm/index.js +14 -3
- package/package.json +4 -1
- package/server/models/common.d.ts +36 -0
- package/server/models/common.js +3 -0
- package/server/models/constructor-items/common.d.ts +6 -1
- package/server/models/constructor-items/sub-blocks.d.ts +2 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MetrikaContextProps } from '../../context/metrikaContext';
|
|
2
|
+
import { AnalyticsContextProps } from '../../context/analyticsContext';
|
|
2
3
|
import { ProjectSettingsContextProps } from '../../context/projectSettingsContext';
|
|
3
4
|
import { SSRContextProps } from '../../context/ssrContext';
|
|
4
5
|
import { LocaleContextProps } from '../../context/localeContext';
|
|
@@ -13,5 +14,6 @@ export interface PageConstructorProviderProps {
|
|
|
13
14
|
ssrConfig?: SSRContextProps;
|
|
14
15
|
theme?: ConstructorTheme;
|
|
15
16
|
projectSettings?: ProjectSettingsContextProps;
|
|
17
|
+
analytics?: AnalyticsContextProps;
|
|
16
18
|
}
|
|
17
19
|
export declare const PageConstructorProvider: (props: WithChildren<PageConstructorProviderProps>) => JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import { MetrikaContext } from '../../context/metrikaContext';
|
|
3
|
+
import { AnalyticsContext } from '../../context/analyticsContext';
|
|
3
4
|
import { MobileContext } from '../../context/mobileContext';
|
|
4
5
|
import { ProjectSettingsContext, } from '../../context/projectSettingsContext';
|
|
5
6
|
import { SSRContext } from '../../context/ssrContext';
|
|
@@ -8,7 +9,7 @@ import { LocationContext } from '../../context/locationContext';
|
|
|
8
9
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
9
10
|
import { DEFAULT_THEME } from '../../components/constants';
|
|
10
11
|
export const PageConstructorProvider = (props) => {
|
|
11
|
-
const { isMobile, locale = {}, location = {}, metrika = {}, ssrConfig = {}, projectSettings = {}, theme = DEFAULT_THEME, children, } = props;
|
|
12
|
+
const { isMobile, locale = {}, location = {}, metrika = {}, analytics = {}, ssrConfig = {}, projectSettings = {}, theme = DEFAULT_THEME, children, } = props;
|
|
12
13
|
/* eslint-disable react/jsx-key */
|
|
13
14
|
const context = [
|
|
14
15
|
React.createElement(ThemeValueContext.Provider, { value: { themeValue: theme } }),
|
|
@@ -17,6 +18,7 @@ export const PageConstructorProvider = (props) => {
|
|
|
17
18
|
React.createElement(LocationContext.Provider, { value: location }),
|
|
18
19
|
React.createElement(MobileContext.Provider, { value: Boolean(isMobile) }),
|
|
19
20
|
React.createElement(MetrikaContext.Provider, { value: metrika }),
|
|
21
|
+
React.createElement(AnalyticsContext.Provider, { value: analytics }),
|
|
20
22
|
React.createElement(SSRContext.Provider, { value: { isServer: ssrConfig === null || ssrConfig === void 0 ? void 0 : ssrConfig.isServer } }),
|
|
21
23
|
].reduceRight((prev, provider) => React.cloneElement(provider, {}, prev), children);
|
|
22
24
|
/* eslint-enable react/jsx-key */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsEventV2 } from '../../models';
|
|
3
|
+
export interface AnalyticsContextProps {
|
|
4
|
+
sendEvents?: (e: AnalyticsEventV2 | AnalyticsEventV2[]) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const AnalyticsContext: React.Context<AnalyticsContextProps>;
|
|
@@ -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>;
|
|
@@ -2,4 +2,5 @@ export { default as useFocus } from './useFocus';
|
|
|
2
2
|
export { default as useWindowBreakpoint } from './useWindowBreakpoint';
|
|
3
3
|
export { useIntersection } from './useIntersection';
|
|
4
4
|
export { default as useMount } from './useMount';
|
|
5
|
+
export * from './useAnalytics';
|
|
5
6
|
export * from './hubspot';
|
package/build/esm/hooks/index.js
CHANGED
|
@@ -2,4 +2,5 @@ export { default as useFocus } from './useFocus';
|
|
|
2
2
|
export { default as useWindowBreakpoint } from './useWindowBreakpoint';
|
|
3
3
|
export { useIntersection } from './useIntersection';
|
|
4
4
|
export { default as useMount } from './useMount';
|
|
5
|
+
export * from './useAnalytics';
|
|
5
6
|
export * from './hubspot';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { AnalyticsContext } from '../context/analyticsContext';
|
|
3
|
+
export const useAnalytics = () => {
|
|
4
|
+
const { sendEvents } = useContext(AnalyticsContext);
|
|
5
|
+
if (!sendEvents) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
return (e) => {
|
|
9
|
+
if (!e) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
sendEvents(e);
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { ButtonPixel, MetrikaGoal, PixelEvent } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Metrika will be deleted
|
|
4
|
+
*/
|
|
2
5
|
type UseMetrikaProps = {
|
|
3
6
|
metrikaGoals?: MetrikaGoal;
|
|
4
7
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
|
|
5
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated useMetrika will be deleted
|
|
11
|
+
*/
|
|
6
12
|
export declare const useMetrika: () => ({ metrikaGoals, pixelEvents }: UseMetrikaProps) => void;
|
|
7
13
|
export {};
|
|
@@ -2,12 +2,20 @@ import { useContext } from 'react';
|
|
|
2
2
|
import { MetrikaContext } from '../context/metrikaContext';
|
|
3
3
|
import { PixelEventType } from '../models';
|
|
4
4
|
import { isNewMetrikaFormat } from '../models/guards';
|
|
5
|
+
// eslint-disable-next-line valid-jsdoc
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Metrika will be deleted, which uses this logic
|
|
8
|
+
*/
|
|
5
9
|
function isButtonPixel(pixelEvents) {
|
|
6
10
|
if (Array.isArray(pixelEvents) && pixelEvents.length && 'name' in pixelEvents) {
|
|
7
11
|
return true;
|
|
8
12
|
}
|
|
9
13
|
return false;
|
|
10
14
|
}
|
|
15
|
+
// eslint-disable-next-line valid-jsdoc
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated useMetrika will be deleted
|
|
18
|
+
*/
|
|
11
19
|
export const useMetrika = () => {
|
|
12
20
|
const { metrika, pixel } = useContext(MetrikaContext);
|
|
13
21
|
return ({ metrikaGoals, pixelEvents }) => {
|
|
@@ -7,12 +7,21 @@ export declare enum Theme {
|
|
|
7
7
|
Light = "light",
|
|
8
8
|
Dark = "dark"
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Pixel will be deleted
|
|
12
|
+
*/
|
|
10
13
|
type PixelCommand = 'track' | 'trackCustom';
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Pixel will be deleted
|
|
16
|
+
*/
|
|
11
17
|
export interface PixelEvent {
|
|
12
18
|
command: PixelCommand;
|
|
13
19
|
event: PixelEventType | string;
|
|
14
20
|
data?: Object;
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Pixel will be deleted from package
|
|
24
|
+
*/
|
|
16
25
|
export declare enum PixelEventType {
|
|
17
26
|
AddPaymentInfo = "AddPaymentInfo",
|
|
18
27
|
AddToCart = "AddToCart",
|
|
@@ -36,11 +45,17 @@ export declare enum PixelEventType {
|
|
|
36
45
|
export type Modifiers = {
|
|
37
46
|
[name: string]: string | boolean | undefined;
|
|
38
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Pixel will be deleted
|
|
50
|
+
*/
|
|
39
51
|
export interface Pixel<TEvent = string> {
|
|
40
52
|
trackStandard: (event: TEvent, data?: Object) => void;
|
|
41
53
|
trackCustom: (event: string, data?: Object) => void;
|
|
42
54
|
track: (trackEvents: string | string[] | PixelEvent[] | PixelEvent) => void;
|
|
43
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Metrika will be deleted
|
|
58
|
+
*/
|
|
44
59
|
export interface Metrika {
|
|
45
60
|
reachGoal: (counterName: string, ...args: any) => void;
|
|
46
61
|
reachGoals: (goals: MetrikaGoal, counterName?: string) => void;
|
|
@@ -49,4 +64,25 @@ export interface ClassNameProps {
|
|
|
49
64
|
className?: string;
|
|
50
65
|
}
|
|
51
66
|
export type Timeout = ReturnType<typeof setTimeout> | undefined;
|
|
67
|
+
export type AnalyticsParameter = {
|
|
68
|
+
key: string;
|
|
69
|
+
value: string | number | boolean;
|
|
70
|
+
};
|
|
71
|
+
export type AnalyticsCounters = {
|
|
72
|
+
include?: string[];
|
|
73
|
+
exclude?: string[];
|
|
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 & {
|
|
84
|
+
name: string;
|
|
85
|
+
type?: string;
|
|
86
|
+
counters?: AnalyticsCounters;
|
|
87
|
+
};
|
|
52
88
|
export {};
|
|
@@ -3,6 +3,9 @@ export var Theme;
|
|
|
3
3
|
Theme["Light"] = "light";
|
|
4
4
|
Theme["Dark"] = "dark";
|
|
5
5
|
})(Theme || (Theme = {}));
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Pixel will be deleted from package
|
|
8
|
+
*/
|
|
6
9
|
export var PixelEventType;
|
|
7
10
|
(function (PixelEventType) {
|
|
8
11
|
PixelEventType["AddPaymentInfo"] = "AddPaymentInfo";
|
|
@@ -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 { ClassNameProps, PixelEventType } from '../common';
|
|
4
|
+
import { AnalyticsEventV2, ClassNameProps, PixelEventType } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -110,6 +110,7 @@ export interface MediaVideoProps {
|
|
|
110
110
|
playButton?: PlayButtonProps;
|
|
111
111
|
controls?: MediaVideoControlsType;
|
|
112
112
|
metrika?: MetrikaVideo;
|
|
113
|
+
analyticsEvents?: AnalyticsEventV2[];
|
|
113
114
|
}
|
|
114
115
|
export interface LinkProps extends Stylable {
|
|
115
116
|
url: string;
|
|
@@ -121,6 +122,7 @@ export interface LinkProps extends Stylable {
|
|
|
121
122
|
target?: string;
|
|
122
123
|
metrikaGoals?: MetrikaGoal;
|
|
123
124
|
pixelEvents?: ButtonPixel;
|
|
125
|
+
analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
|
|
124
126
|
}
|
|
125
127
|
export interface FileLinkProps extends ClassNameProps {
|
|
126
128
|
href: string;
|
|
@@ -139,6 +141,7 @@ export interface ButtonProps {
|
|
|
139
141
|
img?: ButtonImageProps | string;
|
|
140
142
|
metrikaGoals?: MetrikaGoal;
|
|
141
143
|
pixelEvents?: ButtonPixel;
|
|
144
|
+
analyticsEvents?: AnalyticsEventV2[];
|
|
142
145
|
target?: string;
|
|
143
146
|
}
|
|
144
147
|
export interface ButtonImageProps {
|
|
@@ -167,6 +170,7 @@ export interface MediaComponentVideoProps {
|
|
|
167
170
|
video: MediaVideoProps;
|
|
168
171
|
height?: number;
|
|
169
172
|
metrika?: MetrikaVideo;
|
|
173
|
+
analyticsEvents?: AnalyticsEventV2[];
|
|
170
174
|
previewImg?: string;
|
|
171
175
|
}
|
|
172
176
|
export interface MediaComponentYoutubeProps {
|
|
@@ -222,6 +226,7 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
222
226
|
theme?: TextTheme;
|
|
223
227
|
metrikaGoals?: MetrikaGoal;
|
|
224
228
|
pixelEvents?: ButtonPixel;
|
|
229
|
+
analyticsEvents?: AnalyticsEventV2 | AnalyticsEventV2[];
|
|
225
230
|
}
|
|
226
231
|
export interface PreviewContentItemProps {
|
|
227
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 { PixelEvent } from '../common';
|
|
6
|
+
import { AnalyticsEventV2, PixelEvent } from '../common';
|
|
7
7
|
export declare enum SubBlockType {
|
|
8
8
|
Divider = "divider",
|
|
9
9
|
Quote = "quote",
|
|
@@ -61,6 +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
65
|
}
|
|
65
66
|
export interface PartnerProps extends CardBaseProps {
|
|
66
67
|
text: string;
|
|
@@ -414,6 +414,9 @@ export declare const ButtonProps: {
|
|
|
414
414
|
};
|
|
415
415
|
})[];
|
|
416
416
|
};
|
|
417
|
+
/**
|
|
418
|
+
* @deprecated Metrika will be deleted
|
|
419
|
+
*/
|
|
417
420
|
metrikaGoals: {
|
|
418
421
|
anyOf: ({
|
|
419
422
|
type: string;
|
|
@@ -443,6 +446,9 @@ export declare const ButtonProps: {
|
|
|
443
446
|
};
|
|
444
447
|
})[];
|
|
445
448
|
};
|
|
449
|
+
/**
|
|
450
|
+
* @deprecated Pixel will be deleted
|
|
451
|
+
*/
|
|
446
452
|
pixelEvents: {
|
|
447
453
|
type: string;
|
|
448
454
|
items: {
|
|
@@ -499,6 +505,78 @@ export declare const ButtonProps: {
|
|
|
499
505
|
};
|
|
500
506
|
};
|
|
501
507
|
};
|
|
508
|
+
analyticsEvents: {
|
|
509
|
+
anyOf: ({
|
|
510
|
+
type: string;
|
|
511
|
+
additionalProperties: {
|
|
512
|
+
type: string;
|
|
513
|
+
};
|
|
514
|
+
required: string[];
|
|
515
|
+
properties: {
|
|
516
|
+
name: {
|
|
517
|
+
type: string;
|
|
518
|
+
};
|
|
519
|
+
type: {
|
|
520
|
+
type: string;
|
|
521
|
+
};
|
|
522
|
+
counters: {
|
|
523
|
+
type: string;
|
|
524
|
+
additionalProperties: boolean;
|
|
525
|
+
required: never[];
|
|
526
|
+
properties: {
|
|
527
|
+
include: {
|
|
528
|
+
type: string;
|
|
529
|
+
items: {
|
|
530
|
+
type: string;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
exclude: {
|
|
534
|
+
type: string;
|
|
535
|
+
items: {
|
|
536
|
+
type: string;
|
|
537
|
+
};
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
} | {
|
|
543
|
+
type: string;
|
|
544
|
+
items: {
|
|
545
|
+
type: string;
|
|
546
|
+
additionalProperties: {
|
|
547
|
+
type: string;
|
|
548
|
+
};
|
|
549
|
+
required: string[];
|
|
550
|
+
properties: {
|
|
551
|
+
name: {
|
|
552
|
+
type: string;
|
|
553
|
+
};
|
|
554
|
+
type: {
|
|
555
|
+
type: string;
|
|
556
|
+
};
|
|
557
|
+
counters: {
|
|
558
|
+
type: string;
|
|
559
|
+
additionalProperties: boolean;
|
|
560
|
+
required: never[];
|
|
561
|
+
properties: {
|
|
562
|
+
include: {
|
|
563
|
+
type: string;
|
|
564
|
+
items: {
|
|
565
|
+
type: string;
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
exclude: {
|
|
569
|
+
type: string;
|
|
570
|
+
items: {
|
|
571
|
+
type: string;
|
|
572
|
+
};
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
})[];
|
|
579
|
+
};
|
|
502
580
|
target: {
|
|
503
581
|
type: string;
|
|
504
582
|
enum: string[];
|
|
@@ -629,6 +707,9 @@ export declare const ButtonBlock: {
|
|
|
629
707
|
};
|
|
630
708
|
})[];
|
|
631
709
|
};
|
|
710
|
+
/**
|
|
711
|
+
* @deprecated Metrika will be deleted
|
|
712
|
+
*/
|
|
632
713
|
metrikaGoals: {
|
|
633
714
|
anyOf: ({
|
|
634
715
|
type: string;
|
|
@@ -658,6 +739,9 @@ export declare const ButtonBlock: {
|
|
|
658
739
|
};
|
|
659
740
|
})[];
|
|
660
741
|
};
|
|
742
|
+
/**
|
|
743
|
+
* @deprecated Pixel will be deleted
|
|
744
|
+
*/
|
|
661
745
|
pixelEvents: {
|
|
662
746
|
type: string;
|
|
663
747
|
items: {
|
|
@@ -714,6 +798,78 @@ export declare const ButtonBlock: {
|
|
|
714
798
|
};
|
|
715
799
|
};
|
|
716
800
|
};
|
|
801
|
+
analyticsEvents: {
|
|
802
|
+
anyOf: ({
|
|
803
|
+
type: string;
|
|
804
|
+
additionalProperties: {
|
|
805
|
+
type: string;
|
|
806
|
+
};
|
|
807
|
+
required: string[];
|
|
808
|
+
properties: {
|
|
809
|
+
name: {
|
|
810
|
+
type: string;
|
|
811
|
+
};
|
|
812
|
+
type: {
|
|
813
|
+
type: string;
|
|
814
|
+
};
|
|
815
|
+
counters: {
|
|
816
|
+
type: string;
|
|
817
|
+
additionalProperties: boolean;
|
|
818
|
+
required: never[];
|
|
819
|
+
properties: {
|
|
820
|
+
include: {
|
|
821
|
+
type: string;
|
|
822
|
+
items: {
|
|
823
|
+
type: string;
|
|
824
|
+
};
|
|
825
|
+
};
|
|
826
|
+
exclude: {
|
|
827
|
+
type: string;
|
|
828
|
+
items: {
|
|
829
|
+
type: string;
|
|
830
|
+
};
|
|
831
|
+
};
|
|
832
|
+
};
|
|
833
|
+
};
|
|
834
|
+
};
|
|
835
|
+
} | {
|
|
836
|
+
type: string;
|
|
837
|
+
items: {
|
|
838
|
+
type: string;
|
|
839
|
+
additionalProperties: {
|
|
840
|
+
type: string;
|
|
841
|
+
};
|
|
842
|
+
required: string[];
|
|
843
|
+
properties: {
|
|
844
|
+
name: {
|
|
845
|
+
type: string;
|
|
846
|
+
};
|
|
847
|
+
type: {
|
|
848
|
+
type: string;
|
|
849
|
+
};
|
|
850
|
+
counters: {
|
|
851
|
+
type: string;
|
|
852
|
+
additionalProperties: boolean;
|
|
853
|
+
required: never[];
|
|
854
|
+
properties: {
|
|
855
|
+
include: {
|
|
856
|
+
type: string;
|
|
857
|
+
items: {
|
|
858
|
+
type: string;
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
exclude: {
|
|
862
|
+
type: string;
|
|
863
|
+
items: {
|
|
864
|
+
type: string;
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
};
|
|
870
|
+
};
|
|
871
|
+
})[];
|
|
872
|
+
};
|
|
717
873
|
target: {
|
|
718
874
|
type: string;
|
|
719
875
|
enum: string[];
|
|
@@ -1,6 +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
5
|
export const mediaDirection = ['media-content', 'content-media'];
|
|
5
6
|
export const textSize = ['s', 'm', 'l'];
|
|
6
7
|
export const containerSizesArray = ['sm', 'md', 'lg', 'xl', 'all'];
|
|
@@ -306,6 +307,9 @@ export const ButtonProps = {
|
|
|
306
307
|
},
|
|
307
308
|
],
|
|
308
309
|
},
|
|
310
|
+
/**
|
|
311
|
+
* @deprecated Metrika will be deleted
|
|
312
|
+
*/
|
|
309
313
|
metrikaGoals: {
|
|
310
314
|
anyOf: [
|
|
311
315
|
{ type: 'string' },
|
|
@@ -328,7 +332,13 @@ export const ButtonProps = {
|
|
|
328
332
|
},
|
|
329
333
|
],
|
|
330
334
|
},
|
|
335
|
+
/**
|
|
336
|
+
* @deprecated Pixel will be deleted
|
|
337
|
+
*/
|
|
331
338
|
pixelEvents,
|
|
339
|
+
analyticsEvents: {
|
|
340
|
+
anyOf: [AnalyticsEventV2Schema, { type: 'array', items: AnalyticsEventV2Schema }],
|
|
341
|
+
},
|
|
332
342
|
target: {
|
|
333
343
|
type: 'string',
|
|
334
344
|
enum: ['_self', '_blank', '_parent', '_top'],
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
type: string;
|
|
57
|
+
additionalProperties: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
required: string[];
|
|
61
|
+
properties: {
|
|
62
|
+
name: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
type: {
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
counters: {
|
|
69
|
+
type: string;
|
|
70
|
+
additionalProperties: boolean;
|
|
71
|
+
required: never[];
|
|
72
|
+
properties: {
|
|
73
|
+
include: {
|
|
74
|
+
type: string;
|
|
75
|
+
items: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
exclude: {
|
|
80
|
+
type: string;
|
|
81
|
+
items: {
|
|
82
|
+
type: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
type: 'object',
|
|
57
|
+
additionalProperties: { type: 'string' },
|
|
58
|
+
required: ['name'],
|
|
59
|
+
properties: {
|
|
60
|
+
name: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
},
|
|
63
|
+
type: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
},
|
|
66
|
+
counters: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
additionalProperties: false,
|
|
69
|
+
required: [],
|
|
70
|
+
properties: {
|
|
71
|
+
include: {
|
|
72
|
+
type: 'array',
|
|
73
|
+
items: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
exclude: {
|
|
78
|
+
type: 'array',
|
|
79
|
+
items: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
};
|