@gravity-ui/page-constructor 1.14.0-alpha.5 → 1.14.0-alpha.6
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/CHANGELOG.md +0 -7
- package/build/cjs/blocks/Banner/schema.d.ts +312 -0
- package/build/cjs/blocks/Media/schema.d.ts +104 -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/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/{schema/validators/navigation.js → context/analyticsContext/index.js} +1 -1
- package/build/cjs/context/metrikaContext/metrikaContext.d.ts +6 -0
- package/build/cjs/hooks/useAnalytics.d.ts +2 -0
- package/build/cjs/hooks/useAnalytics.js +15 -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 +30 -0
- package/build/cjs/models/common.js +3 -0
- package/build/cjs/models/constructor-items/common.d.ts +4 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/cjs/models/navigation.d.ts +3 -1
- package/build/cjs/navigation/components/Header/Header.css +3 -5
- package/build/cjs/navigation/components/Logo/Logo.css +6 -5
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +0 -1
- package/build/cjs/schema/index.d.ts +0 -67
- package/build/cjs/schema/index.js +1 -2
- package/build/cjs/schema/validators/common.d.ts +220 -0
- package/build/cjs/schema/validators/common.js +10 -0
- package/build/cjs/schema/validators/event.d.ts +50 -0
- package/build/cjs/schema/validators/event.js +53 -0
- package/build/cjs/schema/validators/index.d.ts +0 -2
- package/build/cjs/schema/validators/index.js +0 -2
- package/build/cjs/sub-blocks/HubspotForm/index.js +14 -2
- package/build/esm/blocks/Banner/schema.d.ts +312 -0
- package/build/esm/blocks/Media/schema.d.ts +104 -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/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/useAnalytics.d.ts +2 -0
- package/build/esm/hooks/useAnalytics.js +11 -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 +30 -0
- package/build/esm/models/common.js +3 -0
- package/build/esm/models/constructor-items/common.d.ts +4 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/esm/models/navigation.d.ts +3 -1
- package/build/esm/navigation/components/Header/Header.css +3 -5
- package/build/esm/navigation/components/Logo/Logo.css +6 -5
- package/build/esm/navigation/components/NavigationItem/NavigationItem.css +0 -1
- package/build/esm/schema/index.d.ts +0 -67
- package/build/esm/schema/index.js +1 -2
- package/build/esm/schema/validators/common.d.ts +220 -0
- package/build/esm/schema/validators/common.js +10 -0
- package/build/esm/schema/validators/event.d.ts +50 -0
- package/build/esm/schema/validators/event.js +50 -0
- package/build/esm/schema/validators/index.d.ts +0 -2
- package/build/esm/schema/validators/index.js +0 -2
- package/build/esm/sub-blocks/HubspotForm/index.js +14 -2
- package/package.json +1 -1
- package/server/models/common.d.ts +30 -0
- package/server/models/common.js +3 -0
- package/server/models/constructor-items/common.d.ts +4 -1
- package/server/models/constructor-items/sub-blocks.d.ts +2 -1
- package/server/models/navigation.d.ts +3 -1
- package/build/cjs/navigation/schema.d.ts +0 -60
- package/build/cjs/navigation/schema.js +0 -80
- package/build/cjs/schema/validators/navigation.d.ts +0 -1
- package/build/esm/navigation/schema.d.ts +0 -60
- package/build/esm/navigation/schema.js +0 -77
- package/build/esm/schema/validators/navigation.d.ts +0 -1
- package/build/esm/schema/validators/navigation.js +0 -1
|
@@ -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
|
-
}, [
|
|
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;
|
|
@@ -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 @@
|
|
|
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,11 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { AnalyticsContext } from '../context/analyticsContext';
|
|
3
|
+
export const useAnalytics = () => {
|
|
4
|
+
const { sendEvents } = useContext(AnalyticsContext);
|
|
5
|
+
return (e) => {
|
|
6
|
+
if (!e) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
sendEvents === null || sendEvents === void 0 ? void 0 : sendEvents(e);
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -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,19 @@ 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;
|
|
70
|
+
};
|
|
71
|
+
export type AnalyticsEvent = {
|
|
72
|
+
name: string;
|
|
73
|
+
type?: string;
|
|
74
|
+
counters?: {
|
|
75
|
+
include?: string[];
|
|
76
|
+
exclude?: string[];
|
|
77
|
+
};
|
|
78
|
+
category?: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
params?: AnalyticsParameter[];
|
|
81
|
+
};
|
|
52
82
|
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 { AnalyticsEvent, ClassNameProps, PixelEventType } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -121,6 +121,7 @@ export interface LinkProps extends Stylable {
|
|
|
121
121
|
target?: string;
|
|
122
122
|
metrikaGoals?: MetrikaGoal;
|
|
123
123
|
pixelEvents?: ButtonPixel;
|
|
124
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
124
125
|
}
|
|
125
126
|
export interface FileLinkProps extends ClassNameProps {
|
|
126
127
|
href: string;
|
|
@@ -139,6 +140,7 @@ export interface ButtonProps {
|
|
|
139
140
|
img?: ButtonImageProps | string;
|
|
140
141
|
metrikaGoals?: MetrikaGoal;
|
|
141
142
|
pixelEvents?: ButtonPixel;
|
|
143
|
+
analyticsEvents?: AnalyticsEvent[];
|
|
142
144
|
target?: string;
|
|
143
145
|
}
|
|
144
146
|
export interface ButtonImageProps {
|
|
@@ -222,6 +224,7 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
222
224
|
theme?: TextTheme;
|
|
223
225
|
metrikaGoals?: MetrikaGoal;
|
|
224
226
|
pixelEvents?: ButtonPixel;
|
|
227
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
225
228
|
}
|
|
226
229
|
export interface PreviewContentItemProps {
|
|
227
230
|
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 { AnalyticsEvent, 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?: AnalyticsEvent | AnalyticsEvent[];
|
|
64
65
|
}
|
|
65
66
|
export interface PartnerProps extends CardBaseProps {
|
|
66
67
|
text: string;
|
|
@@ -11,7 +11,7 @@ export interface NavigationItemBase {
|
|
|
11
11
|
icon?: ImageProps;
|
|
12
12
|
url?: string;
|
|
13
13
|
}
|
|
14
|
-
export interface NavigationLinkItem extends
|
|
14
|
+
export interface NavigationLinkItem extends NavigationItemBase {
|
|
15
15
|
type: NavigationItemType.Link;
|
|
16
16
|
url: string;
|
|
17
17
|
arrow?: boolean;
|
|
@@ -19,6 +19,8 @@ export interface NavigationLinkItem extends Omit<NavigationItemBase, 'url'> {
|
|
|
19
19
|
}
|
|
20
20
|
export interface NavigationButtonItem extends ButtonProps {
|
|
21
21
|
type: NavigationItemType.Button;
|
|
22
|
+
url: string;
|
|
23
|
+
target?: string;
|
|
22
24
|
}
|
|
23
25
|
export interface NavigationDropdownItem extends NavigationItemBase {
|
|
24
26
|
type: NavigationItemType.Dropdown;
|
|
@@ -18,27 +18,25 @@ unpredictable css rules order in build */
|
|
|
18
18
|
height: var(--header-height);
|
|
19
19
|
}
|
|
20
20
|
@media (min-width: 769px) {
|
|
21
|
-
.pc-header__mobile-menu-button
|
|
21
|
+
.pc-header__mobile-menu-button {
|
|
22
22
|
display: none;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
|
|
26
25
|
.pc-header__navigation, .pc-header__left, .pc-header__right {
|
|
27
26
|
display: flex;
|
|
28
27
|
align-items: center;
|
|
29
28
|
}
|
|
30
|
-
.pc-header__navigation
|
|
29
|
+
.pc-header__navigation {
|
|
31
30
|
position: relative;
|
|
32
31
|
margin-right: 20px;
|
|
33
32
|
flex: 1 0 0;
|
|
34
33
|
justify-content: flex-start;
|
|
35
34
|
}
|
|
36
35
|
@media (max-width: 768px) {
|
|
37
|
-
.pc-header__navigation
|
|
36
|
+
.pc-header__navigation {
|
|
38
37
|
display: none;
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
|
-
|
|
42
40
|
.pc-header__right {
|
|
43
41
|
flex: 0;
|
|
44
42
|
justify-content: flex-end;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.pc-
|
|
1
|
+
.pc-logo {
|
|
2
2
|
margin: 0;
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -7,6 +7,11 @@ unpredictable css rules order in build */
|
|
|
7
7
|
.pc-logo {
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
11
|
+
font-size: var(--yc-text-header-1-font-size);
|
|
12
|
+
line-height: var(--yc-text-header-1-line-height);
|
|
13
|
+
color: var(--pc-text-header-color);
|
|
14
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
10
15
|
}
|
|
11
16
|
.pc-logo__icon {
|
|
12
17
|
display: flex;
|
|
@@ -14,9 +19,5 @@ unpredictable css rules order in build */
|
|
|
14
19
|
object-fit: contain;
|
|
15
20
|
}
|
|
16
21
|
.pc-logo__text {
|
|
17
|
-
font-size: var(--yc-text-header-1-font-size);
|
|
18
|
-
line-height: var(--yc-text-header-1-line-height);
|
|
19
|
-
color: var(--pc-text-header-color);
|
|
20
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
21
22
|
white-space: nowrap;
|
|
22
23
|
}
|
|
@@ -31,73 +31,6 @@ export declare function generateDefaultSchema(config?: SchemaCustomConfig): {
|
|
|
31
31
|
additionalProperties: boolean;
|
|
32
32
|
required: string[];
|
|
33
33
|
properties: {
|
|
34
|
-
logo: {
|
|
35
|
-
oneOf: ({
|
|
36
|
-
type: string;
|
|
37
|
-
additionalProperties: boolean;
|
|
38
|
-
required: string[];
|
|
39
|
-
properties: {
|
|
40
|
-
icon: {
|
|
41
|
-
oneOf: ({
|
|
42
|
-
type: string;
|
|
43
|
-
properties: {
|
|
44
|
-
when: {
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
} | {
|
|
49
|
-
type: string;
|
|
50
|
-
pattern: string;
|
|
51
|
-
})[];
|
|
52
|
-
};
|
|
53
|
-
text: {
|
|
54
|
-
type: string;
|
|
55
|
-
contentType: string;
|
|
56
|
-
};
|
|
57
|
-
url: {
|
|
58
|
-
type: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
} | {
|
|
62
|
-
type: string;
|
|
63
|
-
additionalProperties: boolean;
|
|
64
|
-
required: import("..").Theme[];
|
|
65
|
-
properties: {};
|
|
66
|
-
})[];
|
|
67
|
-
};
|
|
68
|
-
header: {
|
|
69
|
-
type: string;
|
|
70
|
-
additionalProperties: boolean;
|
|
71
|
-
required: string[];
|
|
72
|
-
properties: {
|
|
73
|
-
leftItems: {
|
|
74
|
-
oneOf: {
|
|
75
|
-
type: string;
|
|
76
|
-
items: {
|
|
77
|
-
type: string;
|
|
78
|
-
properties: {
|
|
79
|
-
when: {
|
|
80
|
-
type: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
}[];
|
|
85
|
-
};
|
|
86
|
-
rightItems: {
|
|
87
|
-
oneOf: {
|
|
88
|
-
type: string;
|
|
89
|
-
items: {
|
|
90
|
-
type: string;
|
|
91
|
-
properties: {
|
|
92
|
-
when: {
|
|
93
|
-
type: string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
}[];
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
34
|
blocks: {
|
|
102
35
|
type: string;
|
|
103
36
|
items: {
|
|
@@ -3,7 +3,6 @@ import { TabsBlock, BannerCard, SliderBlock, ExtendedFeaturesBlock, HeaderBlock,
|
|
|
3
3
|
import { PartnerBlock, MediaCardBlock, TutorialCard, BackgroundCard, NewsCard, CardWithImage, PriceDetailedBlock, Quote, Divider, BasicCard, } from './validators/sub-blocks';
|
|
4
4
|
import { AnimatableProps, BackgroundProps, MenuProps, withTheme } from './validators/common';
|
|
5
5
|
import { filteredItem } from './validators/utils';
|
|
6
|
-
import { LogoProps, NavigationHeaderProps } from './validators/navigation';
|
|
7
6
|
export const getBlocksCases = (blocks) => {
|
|
8
7
|
return Object.values(blocks).reduce((acc, block) => (Object.assign(Object.assign({}, acc), block)));
|
|
9
8
|
};
|
|
@@ -84,7 +83,7 @@ export function generateDefaultSchema(config) {
|
|
|
84
83
|
type: 'object',
|
|
85
84
|
additionalProperties: false,
|
|
86
85
|
required: ['blocks'],
|
|
87
|
-
properties: Object.assign(Object.assign(Object.assign({}, AnimatableProps), {
|
|
86
|
+
properties: Object.assign(Object.assign(Object.assign({}, AnimatableProps), { blocks: {
|
|
88
87
|
type: 'array',
|
|
89
88
|
items: {
|
|
90
89
|
$ref: '#/definitions/children',
|