@gravity-ui/page-constructor 1.12.0 → 1.13.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/blocks/Banner/schema.d.ts +141 -0
- package/build/cjs/blocks/CardLayout/schema.d.ts +22 -24
- package/build/cjs/blocks/CardLayout/schema.js +1 -6
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +16 -17
- package/build/cjs/blocks/ExtendedFeatures/schema.js +1 -6
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -25
- package/build/cjs/blocks/LinkTable/schema.d.ts +29 -21
- package/build/cjs/blocks/LinkTable/schema.js +1 -1
- package/build/cjs/blocks/Media/schema.d.ts +47 -0
- package/build/cjs/blocks/Media/schema.js +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +14 -15
- package/build/cjs/blocks/PromoFeaturesBlock/schema.js +1 -6
- package/build/cjs/blocks/Slider/schema.d.ts +28 -49
- package/build/cjs/blocks/Slider/schema.js +1 -6
- package/build/cjs/blocks/Tabs/schema.d.ts +29 -25
- package/build/cjs/blocks/Tabs/schema.js +1 -4
- package/build/cjs/components/BlockHeader/BlockHeader.css +8 -19
- package/build/cjs/components/BlockHeader/BlockHeader.js +4 -3
- package/build/cjs/components/Button/Button.js +3 -3
- package/build/cjs/components/CardBase/CardBase.d.ts +2 -1
- package/build/cjs/components/CardBase/CardBase.js +2 -2
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +2 -2
- package/build/cjs/components/Link/Link.js +2 -2
- package/build/cjs/context/metrikaContext/metrikaContext.d.ts +2 -1
- package/build/cjs/hooks/useMetrika.d.ts +3 -2
- package/build/cjs/hooks/useMetrika.js +10 -2
- package/build/cjs/models/common.d.ts +4 -1
- package/build/cjs/models/constructor-items/common.d.ts +21 -0
- package/build/cjs/schema/validators/common.d.ts +125 -0
- package/build/cjs/schema/validators/common.js +12 -1
- package/build/cjs/schema/validators/ga-events.d.ts +47 -0
- package/build/cjs/schema/validators/ga-events.js +50 -0
- package/build/cjs/sub-blocks/CardWithImage/schema.js +1 -1
- package/build/cjs/text-transform/blocks.js +44 -54
- package/build/esm/blocks/Banner/schema.d.ts +141 -0
- package/build/esm/blocks/CardLayout/schema.d.ts +22 -24
- package/build/esm/blocks/CardLayout/schema.js +2 -7
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +16 -17
- package/build/esm/blocks/ExtendedFeatures/schema.js +2 -7
- package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -25
- package/build/esm/blocks/LinkTable/schema.d.ts +29 -21
- package/build/esm/blocks/LinkTable/schema.js +2 -2
- package/build/esm/blocks/Media/schema.d.ts +47 -0
- package/build/esm/blocks/Media/schema.js +1 -1
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +14 -15
- package/build/esm/blocks/PromoFeaturesBlock/schema.js +2 -7
- package/build/esm/blocks/Slider/schema.d.ts +28 -49
- package/build/esm/blocks/Slider/schema.js +2 -7
- package/build/esm/blocks/Tabs/schema.d.ts +29 -25
- package/build/esm/blocks/Tabs/schema.js +2 -5
- package/build/esm/components/BlockHeader/BlockHeader.css +8 -19
- package/build/esm/components/BlockHeader/BlockHeader.js +5 -4
- package/build/esm/components/Button/Button.js +3 -3
- package/build/esm/components/CardBase/CardBase.d.ts +2 -1
- package/build/esm/components/CardBase/CardBase.js +2 -2
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +2 -2
- package/build/esm/components/Link/Link.js +2 -2
- package/build/esm/context/metrikaContext/metrikaContext.d.ts +2 -1
- package/build/esm/hooks/useMetrika.d.ts +3 -2
- package/build/esm/hooks/useMetrika.js +10 -2
- package/build/esm/models/common.d.ts +4 -1
- package/build/esm/models/constructor-items/common.d.ts +21 -0
- package/build/esm/schema/validators/common.d.ts +125 -0
- package/build/esm/schema/validators/common.js +11 -0
- package/build/esm/schema/validators/ga-events.d.ts +47 -0
- package/build/esm/schema/validators/ga-events.js +47 -0
- package/build/esm/sub-blocks/CardWithImage/schema.js +1 -1
- package/build/esm/text-transform/blocks.js +44 -54
- package/package.json +1 -1
- package/server/models/common.d.ts +4 -1
- package/server/models/constructor-items/common.d.ts +21 -0
- package/server/text-transform/blocks.js +44 -54
|
@@ -272,31 +272,6 @@ export declare const TabsBlock: {
|
|
|
272
272
|
additionalProperties: boolean;
|
|
273
273
|
required: string[];
|
|
274
274
|
properties: {
|
|
275
|
-
title: {
|
|
276
|
-
type: string;
|
|
277
|
-
additionalProperties: boolean;
|
|
278
|
-
required: string[];
|
|
279
|
-
properties: {
|
|
280
|
-
text: {
|
|
281
|
-
type: string;
|
|
282
|
-
contentType: string;
|
|
283
|
-
};
|
|
284
|
-
textSize: {
|
|
285
|
-
type: string;
|
|
286
|
-
enum: string[];
|
|
287
|
-
};
|
|
288
|
-
url: {
|
|
289
|
-
type: string;
|
|
290
|
-
};
|
|
291
|
-
resetMargin: {
|
|
292
|
-
type: string;
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
description: {
|
|
297
|
-
type: string;
|
|
298
|
-
contentType: string;
|
|
299
|
-
};
|
|
300
275
|
tabsColSizes: {};
|
|
301
276
|
direction: {
|
|
302
277
|
type: string;
|
|
@@ -316,6 +291,35 @@ export declare const TabsBlock: {
|
|
|
316
291
|
};
|
|
317
292
|
};
|
|
318
293
|
};
|
|
294
|
+
title: {
|
|
295
|
+
oneOf: ({
|
|
296
|
+
type: string;
|
|
297
|
+
additionalProperties: boolean;
|
|
298
|
+
required: string[];
|
|
299
|
+
properties: {
|
|
300
|
+
text: {
|
|
301
|
+
type: string;
|
|
302
|
+
contentType: string;
|
|
303
|
+
};
|
|
304
|
+
textSize: {
|
|
305
|
+
type: string;
|
|
306
|
+
enum: string[];
|
|
307
|
+
};
|
|
308
|
+
url: {
|
|
309
|
+
type: string;
|
|
310
|
+
};
|
|
311
|
+
resetMargin: {
|
|
312
|
+
type: string;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
} | {
|
|
316
|
+
type: string;
|
|
317
|
+
})[];
|
|
318
|
+
};
|
|
319
|
+
description: {
|
|
320
|
+
type: string;
|
|
321
|
+
contentType: string;
|
|
322
|
+
};
|
|
319
323
|
anchor: {
|
|
320
324
|
type: string;
|
|
321
325
|
additionalProperties: boolean;
|
|
@@ -28,10 +28,7 @@ exports.TabsBlock = {
|
|
|
28
28
|
'tabs-block': {
|
|
29
29
|
additionalProperties: false,
|
|
30
30
|
required: ['title', 'items'],
|
|
31
|
-
properties: Object.assign(Object.assign({}, common_1.BlockBaseProps), {
|
|
32
|
-
type: 'string',
|
|
33
|
-
contentType: 'text',
|
|
34
|
-
}, tabsColSizes: common_1.containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: common_1.sizeNumber })), {}), direction: {
|
|
31
|
+
properties: Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.BlockHeaderProps), { tabsColSizes: common_1.containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: common_1.sizeNumber })), {}), direction: {
|
|
35
32
|
type: 'string',
|
|
36
33
|
enum: common_1.mediaDirection,
|
|
37
34
|
}, centered: { type: 'boolean' }, items: (0, utils_1.filteredArray)(exports.tabsItem) }),
|
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-
|
|
4
|
-
|
|
5
|
-
line-height: var(--yc-text-body-2-line-height);
|
|
6
|
-
margin-top: 16px;
|
|
7
|
-
}
|
|
8
|
-
.pc-BlockHeader__description_titleSize_s {
|
|
9
|
-
margin-top: 8px;
|
|
3
|
+
.pc-block-header__description {
|
|
4
|
+
margin-top: 12px;
|
|
10
5
|
}
|
|
11
|
-
.pc-
|
|
6
|
+
.pc-block-header__description .yfm {
|
|
12
7
|
font-size: var(--yc-text-body-3-font-size);
|
|
13
8
|
line-height: var(--yc-text-body-3-line-height);
|
|
14
9
|
}
|
|
15
|
-
.pc-
|
|
16
|
-
|
|
17
|
-
color: var(--yc-color-text-link);
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
}
|
|
21
|
-
.utilityfocus .pc-BlockHeader__description a:focus {
|
|
22
|
-
outline: 2px solid #ffdb4d;
|
|
10
|
+
.pc-block-header__description_titleSize_s {
|
|
11
|
+
margin-top: 8px;
|
|
23
12
|
}
|
|
24
|
-
.pc-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
.pc-block-header__description_titleSize_s .yfm {
|
|
14
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
15
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
27
16
|
}
|
|
@@ -5,7 +5,8 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const grid_1 = require("../../grid");
|
|
7
7
|
const __1 = require("../");
|
|
8
|
-
const
|
|
8
|
+
const YFMWrapper_1 = tslib_1.__importDefault(require("../YFMWrapper/YFMWrapper"));
|
|
9
|
+
const b = (0, utils_1.block)('block-header');
|
|
9
10
|
const BlockHeader = ({ title, description, className, colSizes = { all: 12, sm: 8 }, }) => {
|
|
10
11
|
if (!title && !description) {
|
|
11
12
|
return null;
|
|
@@ -14,8 +15,8 @@ const BlockHeader = ({ title, description, className, colSizes = { all: 12, sm:
|
|
|
14
15
|
return (react_1.default.createElement("div", { className: b(null, className) },
|
|
15
16
|
text && (react_1.default.createElement(grid_1.Col, { reset: true, sizes: colSizes },
|
|
16
17
|
react_1.default.createElement(__1.Title, Object.assign({ text: text }, titleProps)))),
|
|
17
|
-
description && (react_1.default.createElement(grid_1.Col, { reset: true, sizes:
|
|
18
|
+
description && (react_1.default.createElement(grid_1.Col, { reset: true, sizes: colSizes },
|
|
18
19
|
react_1.default.createElement("div", { className: b('description', { titleSize: titleProps === null || titleProps === void 0 ? void 0 : titleProps.textSize }) },
|
|
19
|
-
react_1.default.createElement(
|
|
20
|
+
react_1.default.createElement(YFMWrapper_1.default, { content: description, modifiers: { constructor: true } }))))));
|
|
20
21
|
};
|
|
21
22
|
exports.default = BlockHeader;
|
|
@@ -12,14 +12,14 @@ const b = (0, utils_1.block)('button-block');
|
|
|
12
12
|
const Button = (props) => {
|
|
13
13
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
14
14
|
const { lang, tld } = (0, react_1.useContext)(localeContext_1.LocaleContext);
|
|
15
|
-
const { className, metrikaGoals, pixelEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text } = props, rest = tslib_1.__rest(props, ["className", "metrikaGoals", "pixelEvents", "size", "theme", "url", "img", "onClick", "text"]);
|
|
15
|
+
const { className, metrikaGoals, pixelEvents, gaEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text } = props, rest = tslib_1.__rest(props, ["className", "metrikaGoals", "pixelEvents", "gaEvents", "size", "theme", "url", "img", "onClick", "text"]);
|
|
16
16
|
const defaultImgPosition = 'left';
|
|
17
17
|
const onClick = (0, react_1.useCallback)(() => {
|
|
18
|
-
handleMetrika({ metrikaGoals, pixelEvents });
|
|
18
|
+
handleMetrika({ metrikaGoals, pixelEvents, gaEvents });
|
|
19
19
|
if (onClickOrigin) {
|
|
20
20
|
onClickOrigin();
|
|
21
21
|
}
|
|
22
|
-
}, [handleMetrika, metrikaGoals, pixelEvents, onClickOrigin]);
|
|
22
|
+
}, [handleMetrika, metrikaGoals, pixelEvents, gaEvents, onClickOrigin]);
|
|
23
23
|
const buttonImg = img instanceof Object
|
|
24
24
|
? { url: img.url, position: img.position || defaultImgPosition, alt: img.alt }
|
|
25
25
|
: { url: img, position: defaultImgPosition };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactElement, HTMLAttributeAnchorTarget } from 'react';
|
|
2
|
-
import { ButtonPixel, CardBaseProps as CardBaseParams, ImageProps, MetrikaGoal, WithChildren } from '../../models';
|
|
2
|
+
import { ButtonPixel, CardBaseProps as CardBaseParams, GAEvents, ImageProps, MetrikaGoal, WithChildren } from '../../models';
|
|
3
3
|
export interface CardBaseProps extends CardBaseParams {
|
|
4
4
|
className?: string;
|
|
5
5
|
bodyClassName?: string;
|
|
@@ -9,6 +9,7 @@ export interface CardBaseProps extends CardBaseParams {
|
|
|
9
9
|
target?: HTMLAttributeAnchorTarget;
|
|
10
10
|
metrikaGoals?: MetrikaGoal;
|
|
11
11
|
pixelEvents?: ButtonPixel;
|
|
12
|
+
gaEvents?: GAEvents;
|
|
12
13
|
}
|
|
13
14
|
export interface CardHeaderBaseProps {
|
|
14
15
|
className?: string;
|
|
@@ -12,7 +12,7 @@ const Header = () => null;
|
|
|
12
12
|
const Content = () => null;
|
|
13
13
|
const Footer = () => null;
|
|
14
14
|
const Layout = (props) => {
|
|
15
|
-
const { className, bodyClassName, metrikaGoals, pixelEvents, contentClassName, children, url, target, border = 'shadow', } = props;
|
|
15
|
+
const { className, bodyClassName, metrikaGoals, pixelEvents, gaEvents, contentClassName, children, url, target, border = 'shadow', } = props;
|
|
16
16
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
17
17
|
let header, content, footer, image, headerClass, footerClass;
|
|
18
18
|
function handleChild(child) {
|
|
@@ -45,7 +45,7 @@ const Layout = (props) => {
|
|
|
45
45
|
footer && react_1.default.createElement("div", { className: b('footer', footerClass) }, footer))));
|
|
46
46
|
const fullClassName = b({ border }, className);
|
|
47
47
|
const onClick = () => {
|
|
48
|
-
handleMetrika({ metrikaGoals, pixelEvents });
|
|
48
|
+
handleMetrika({ metrikaGoals, pixelEvents, gaEvents });
|
|
49
49
|
};
|
|
50
50
|
return url ? (react_1.default.createElement(RouterLink_1.default, { href: url },
|
|
51
51
|
react_1.default.createElement("a", { href: url, target: target, rel: target === '_blank' ? 'noopener noreferrer' : undefined, className: fullClassName, draggable: false, onDragStart: (e) => e.preventDefault(), onClick: onClick }, cardContent))) : (react_1.default.createElement("div", { className: fullClassName }, cardContent));
|
|
@@ -6,10 +6,10 @@ const utils_1 = require("../../utils");
|
|
|
6
6
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
7
7
|
const b = (0, utils_1.block)('header-breadcrumbs');
|
|
8
8
|
function HeaderBreadcrumbs(props) {
|
|
9
|
-
const { items, metrikaGoals, pixelEvents, theme = 'light', className } = props;
|
|
9
|
+
const { items, metrikaGoals, pixelEvents, gaEvents, theme = 'light', className } = props;
|
|
10
10
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
11
11
|
const onClick = () => {
|
|
12
|
-
handleMetrika({ metrikaGoals, pixelEvents });
|
|
12
|
+
handleMetrika({ metrikaGoals, pixelEvents, gaEvents });
|
|
13
13
|
};
|
|
14
14
|
return (react_1.default.createElement("div", { className: b({ theme }, className) }, items.map((item) => (react_1.default.createElement("div", { className: b('item'), key: item.url },
|
|
15
15
|
react_1.default.createElement("a", { href: item.url, className: b('text'), onClick: onClick }, item.text))))));
|
|
@@ -25,14 +25,14 @@ function getArrowSize(size) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
const LinkBlock = (props) => {
|
|
28
|
-
const { text, url, arrow, metrikaGoals, pixelEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, } = props;
|
|
28
|
+
const { text, url, arrow, metrikaGoals, pixelEvents, gaEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, } = props;
|
|
29
29
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
30
30
|
const { hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
31
31
|
const { tld } = (0, react_1.useContext)(localeContext_1.LocaleContext);
|
|
32
32
|
const href = (0, utils_1.setUrlTld)(props.url, tld);
|
|
33
33
|
const defaultTextSize = theme === 'back' ? 'l' : 'm';
|
|
34
34
|
const onClick = () => {
|
|
35
|
-
handleMetrika({ metrikaGoals, pixelEvents });
|
|
35
|
+
handleMetrika({ metrikaGoals, pixelEvents, gaEvents });
|
|
36
36
|
};
|
|
37
37
|
const getLinkByType = () => {
|
|
38
38
|
switch (theme) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Metrika, Pixel } from '../../models';
|
|
2
|
+
import { GaInline, Metrika, Pixel } from '../../models';
|
|
3
3
|
export interface MetrikaContextProps {
|
|
4
4
|
metrika?: Metrika;
|
|
5
5
|
pixel?: Pixel;
|
|
6
|
+
gaInline?: GaInline;
|
|
6
7
|
}
|
|
7
8
|
export declare const MetrikaContext: React.Context<MetrikaContextProps>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ButtonPixel, MetrikaGoal, PixelEvent } from '../models';
|
|
1
|
+
import { ButtonPixel, MetrikaGoal, PixelEvent, GAEvents } from '../models';
|
|
2
2
|
type UseMetrikaProps = {
|
|
3
3
|
metrikaGoals?: MetrikaGoal;
|
|
4
4
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
|
|
5
|
+
gaEvents?: GAEvents;
|
|
5
6
|
};
|
|
6
|
-
export declare const useMetrika: () => ({ metrikaGoals, pixelEvents }: UseMetrikaProps) => void;
|
|
7
|
+
export declare const useMetrika: () => ({ metrikaGoals, pixelEvents, gaEvents }: UseMetrikaProps) => void;
|
|
7
8
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useMetrika = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const metrikaContext_1 = require("../context/metrikaContext");
|
|
6
7
|
const models_1 = require("../models");
|
|
@@ -12,8 +13,8 @@ function isButtonPixel(pixelEvents) {
|
|
|
12
13
|
return false;
|
|
13
14
|
}
|
|
14
15
|
const useMetrika = () => {
|
|
15
|
-
const { metrika, pixel } = (0, react_1.useContext)(metrikaContext_1.MetrikaContext);
|
|
16
|
-
return ({ metrikaGoals, pixelEvents }) => {
|
|
16
|
+
const { metrika, pixel, gaInline } = (0, react_1.useContext)(metrikaContext_1.MetrikaContext);
|
|
17
|
+
return ({ metrikaGoals, pixelEvents, gaEvents }) => {
|
|
17
18
|
if (metrika && metrikaGoals) {
|
|
18
19
|
if ((0, guards_1.isNewMetrikaFormat)(metrikaGoals)) {
|
|
19
20
|
metrikaGoals.forEach(({ name, isCrossSite }) => metrika.reachGoal(isCrossSite ? 'cross-site' : 'main', name));
|
|
@@ -36,6 +37,13 @@ const useMetrika = () => {
|
|
|
36
37
|
pixel.track(pixelEvents);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
if (gaInline && gaEvents) {
|
|
41
|
+
const gaEventsArray = Array.isArray(gaEvents) ? gaEvents : [gaEvents];
|
|
42
|
+
gaEventsArray.forEach((_a) => {
|
|
43
|
+
var { eventName } = _a, rest = tslib_1.__rest(_a, ["eventName"]);
|
|
44
|
+
gaInline.event(eventName, rest);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
39
47
|
};
|
|
40
48
|
};
|
|
41
49
|
exports.useMetrika = useMetrika;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MetrikaGoal } from './';
|
|
2
|
+
import { GAEventParams, MetrikaGoal } from './';
|
|
3
3
|
export interface Refable<T> {
|
|
4
4
|
ref?: React.Ref<T>;
|
|
5
5
|
}
|
|
@@ -45,6 +45,9 @@ export interface Metrika {
|
|
|
45
45
|
reachGoal: (counterName: string, ...args: any) => void;
|
|
46
46
|
reachGoals: (goals: MetrikaGoal, counterName?: string) => void;
|
|
47
47
|
}
|
|
48
|
+
export interface GaInline {
|
|
49
|
+
event: (eventName: string, params?: GAEventParams) => void;
|
|
50
|
+
}
|
|
48
51
|
export interface ClassNameProps {
|
|
49
52
|
className?: string;
|
|
50
53
|
}
|
|
@@ -121,6 +121,7 @@ export interface LinkProps extends Stylable {
|
|
|
121
121
|
target?: string;
|
|
122
122
|
metrikaGoals?: MetrikaGoal;
|
|
123
123
|
pixelEvents?: ButtonPixel;
|
|
124
|
+
gaEvents?: GAEvents;
|
|
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
|
+
gaEvents?: GAEvents;
|
|
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
|
+
gaEvents?: GAEvents;
|
|
225
228
|
}
|
|
226
229
|
export interface PreviewContentItemProps {
|
|
227
230
|
title: string;
|
|
@@ -337,4 +340,22 @@ export interface BlockHeaderProps {
|
|
|
337
340
|
title?: TitleProps | string;
|
|
338
341
|
description?: string;
|
|
339
342
|
}
|
|
343
|
+
export declare type GaParameterValue = string | number | boolean;
|
|
344
|
+
declare type GACommandConfig<T> = T & {
|
|
345
|
+
[key: string]: GaParameterValue;
|
|
346
|
+
};
|
|
347
|
+
declare type GACommonParams = {
|
|
348
|
+
groups?: string | string[];
|
|
349
|
+
sendTo?: string | string[];
|
|
350
|
+
eventTimeout?: number;
|
|
351
|
+
};
|
|
352
|
+
export declare type GAEventParams = GACommandConfig<GACommonParams & {
|
|
353
|
+
eventCategory?: string;
|
|
354
|
+
eventLabel?: string;
|
|
355
|
+
value?: number;
|
|
356
|
+
}>;
|
|
357
|
+
export type GAEvent = GAEventParams & {
|
|
358
|
+
eventName: string;
|
|
359
|
+
};
|
|
360
|
+
export type GAEvents = GAEvent | GAEvent[];
|
|
340
361
|
export {};
|
|
@@ -499,6 +499,53 @@ export declare const ButtonProps: {
|
|
|
499
499
|
};
|
|
500
500
|
};
|
|
501
501
|
};
|
|
502
|
+
gaEvents: {
|
|
503
|
+
type: string;
|
|
504
|
+
items: {
|
|
505
|
+
type: string;
|
|
506
|
+
required: string[];
|
|
507
|
+
additionalProperties: boolean;
|
|
508
|
+
properties: {
|
|
509
|
+
eventName: {
|
|
510
|
+
type: string;
|
|
511
|
+
};
|
|
512
|
+
eventCategory: {
|
|
513
|
+
type: string;
|
|
514
|
+
};
|
|
515
|
+
eventLabel: {
|
|
516
|
+
type: string;
|
|
517
|
+
};
|
|
518
|
+
value: {
|
|
519
|
+
type: string;
|
|
520
|
+
};
|
|
521
|
+
groups: {
|
|
522
|
+
oneOf: ({
|
|
523
|
+
type: string;
|
|
524
|
+
items?: undefined;
|
|
525
|
+
} | {
|
|
526
|
+
type: string;
|
|
527
|
+
items: {
|
|
528
|
+
type: string;
|
|
529
|
+
};
|
|
530
|
+
})[];
|
|
531
|
+
};
|
|
532
|
+
sendTo: {
|
|
533
|
+
oneOf: ({
|
|
534
|
+
type: string;
|
|
535
|
+
items?: undefined;
|
|
536
|
+
} | {
|
|
537
|
+
type: string;
|
|
538
|
+
items: {
|
|
539
|
+
type: string;
|
|
540
|
+
};
|
|
541
|
+
})[];
|
|
542
|
+
};
|
|
543
|
+
eventTimeout: {
|
|
544
|
+
type: string;
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
};
|
|
548
|
+
};
|
|
502
549
|
target: {
|
|
503
550
|
type: string;
|
|
504
551
|
enum: string[];
|
|
@@ -714,6 +761,53 @@ export declare const ButtonBlock: {
|
|
|
714
761
|
};
|
|
715
762
|
};
|
|
716
763
|
};
|
|
764
|
+
gaEvents: {
|
|
765
|
+
type: string;
|
|
766
|
+
items: {
|
|
767
|
+
type: string;
|
|
768
|
+
required: string[];
|
|
769
|
+
additionalProperties: boolean;
|
|
770
|
+
properties: {
|
|
771
|
+
eventName: {
|
|
772
|
+
type: string;
|
|
773
|
+
};
|
|
774
|
+
eventCategory: {
|
|
775
|
+
type: string;
|
|
776
|
+
};
|
|
777
|
+
eventLabel: {
|
|
778
|
+
type: string;
|
|
779
|
+
};
|
|
780
|
+
value: {
|
|
781
|
+
type: string;
|
|
782
|
+
};
|
|
783
|
+
groups: {
|
|
784
|
+
oneOf: ({
|
|
785
|
+
type: string;
|
|
786
|
+
items?: undefined;
|
|
787
|
+
} | {
|
|
788
|
+
type: string;
|
|
789
|
+
items: {
|
|
790
|
+
type: string;
|
|
791
|
+
};
|
|
792
|
+
})[];
|
|
793
|
+
};
|
|
794
|
+
sendTo: {
|
|
795
|
+
oneOf: ({
|
|
796
|
+
type: string;
|
|
797
|
+
items?: undefined;
|
|
798
|
+
} | {
|
|
799
|
+
type: string;
|
|
800
|
+
items: {
|
|
801
|
+
type: string;
|
|
802
|
+
};
|
|
803
|
+
})[];
|
|
804
|
+
};
|
|
805
|
+
eventTimeout: {
|
|
806
|
+
type: string;
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
};
|
|
717
811
|
target: {
|
|
718
812
|
type: string;
|
|
719
813
|
enum: string[];
|
|
@@ -869,3 +963,34 @@ export declare const CardBase: {
|
|
|
869
963
|
enum: string[];
|
|
870
964
|
};
|
|
871
965
|
};
|
|
966
|
+
export declare const BlockHeaderProps: {
|
|
967
|
+
title: {
|
|
968
|
+
oneOf: ({
|
|
969
|
+
type: string;
|
|
970
|
+
additionalProperties: boolean;
|
|
971
|
+
required: string[];
|
|
972
|
+
properties: {
|
|
973
|
+
text: {
|
|
974
|
+
type: string;
|
|
975
|
+
contentType: string;
|
|
976
|
+
};
|
|
977
|
+
textSize: {
|
|
978
|
+
type: string;
|
|
979
|
+
enum: string[];
|
|
980
|
+
};
|
|
981
|
+
url: {
|
|
982
|
+
type: string;
|
|
983
|
+
};
|
|
984
|
+
resetMargin: {
|
|
985
|
+
type: string;
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
} | {
|
|
989
|
+
type: string;
|
|
990
|
+
})[];
|
|
991
|
+
};
|
|
992
|
+
description: {
|
|
993
|
+
type: string;
|
|
994
|
+
contentType: string;
|
|
995
|
+
};
|
|
996
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CardBase = exports.MediaProps = exports.ButtonBlock = exports.TitleProps = exports.BlockBaseProps = exports.AnchorProps = exports.withTheme = exports.MenuProps = exports.ButtonProps = exports.authorItem = exports.FileLinkProps = exports.LinkProps = exports.BackgroundProps = exports.DataLensProps = exports.DataLensObjectProps = exports.JustifyProps = exports.ThemeProps = exports.VideoProps = exports.PlayIconProps = exports.LoopProps = exports.ChildrenCardsProps = exports.ChildrenProps = exports.AnimatableProps = exports.sliderSizesObject = exports.containerSizesObject = exports.BaseProps = exports.contentThemes = exports.sizeNumber = exports.dividerEnum = exports.fileLinkTypes = exports.videoControlsTypes = exports.playIconThemes = exports.playIconTypes = exports.videoTypes = exports.contentTextWidth = exports.contentSizes = exports.sliderSizesArray = exports.containerSizesArray = exports.textSize = exports.mediaDirection = void 0;
|
|
3
|
+
exports.BlockHeaderProps = exports.CardBase = exports.MediaProps = exports.ButtonBlock = exports.TitleProps = exports.BlockBaseProps = exports.AnchorProps = exports.withTheme = exports.MenuProps = exports.ButtonProps = exports.authorItem = exports.FileLinkProps = exports.LinkProps = exports.BackgroundProps = exports.DataLensProps = exports.DataLensObjectProps = exports.JustifyProps = exports.ThemeProps = exports.VideoProps = exports.PlayIconProps = exports.LoopProps = exports.ChildrenCardsProps = exports.ChildrenProps = exports.AnimatableProps = exports.sliderSizesObject = exports.containerSizesObject = exports.BaseProps = exports.contentThemes = exports.sizeNumber = exports.dividerEnum = exports.fileLinkTypes = exports.videoControlsTypes = exports.playIconThemes = exports.playIconTypes = exports.videoTypes = exports.contentTextWidth = exports.contentSizes = exports.sliderSizesArray = exports.containerSizesArray = exports.textSize = exports.mediaDirection = void 0;
|
|
4
|
+
const ga_events_1 = require("./ga-events");
|
|
4
5
|
const pixel_1 = require("./pixel");
|
|
5
6
|
const models_1 = require("../../models");
|
|
6
7
|
const schema_1 = require("../../components/Image/schema");
|
|
@@ -332,6 +333,7 @@ exports.ButtonProps = {
|
|
|
332
333
|
],
|
|
333
334
|
},
|
|
334
335
|
pixelEvents: pixel_1.pixelEvents,
|
|
336
|
+
gaEvents: ga_events_1.gaEvents,
|
|
335
337
|
target: {
|
|
336
338
|
type: 'string',
|
|
337
339
|
enum: ['_self', '_blank', '_parent', '_top'],
|
|
@@ -448,3 +450,12 @@ exports.CardBase = {
|
|
|
448
450
|
enum: ['border', 'shadow', 'none'],
|
|
449
451
|
},
|
|
450
452
|
};
|
|
453
|
+
exports.BlockHeaderProps = {
|
|
454
|
+
title: {
|
|
455
|
+
oneOf: [{ type: 'string' }, exports.TitleProps],
|
|
456
|
+
},
|
|
457
|
+
description: {
|
|
458
|
+
type: 'string',
|
|
459
|
+
contentType: 'yfm',
|
|
460
|
+
},
|
|
461
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const gaEvents: {
|
|
2
|
+
type: string;
|
|
3
|
+
items: {
|
|
4
|
+
type: string;
|
|
5
|
+
required: string[];
|
|
6
|
+
additionalProperties: boolean;
|
|
7
|
+
properties: {
|
|
8
|
+
eventName: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
eventCategory: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
eventLabel: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
value: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
groups: {
|
|
21
|
+
oneOf: ({
|
|
22
|
+
type: string;
|
|
23
|
+
items?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
type: string;
|
|
26
|
+
items: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
})[];
|
|
30
|
+
};
|
|
31
|
+
sendTo: {
|
|
32
|
+
oneOf: ({
|
|
33
|
+
type: string;
|
|
34
|
+
items?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
type: string;
|
|
37
|
+
items: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
})[];
|
|
41
|
+
};
|
|
42
|
+
eventTimeout: {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gaEvents = void 0;
|
|
4
|
+
exports.gaEvents = {
|
|
5
|
+
type: 'array',
|
|
6
|
+
items: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
required: ['eventName'],
|
|
9
|
+
additionalProperties: false,
|
|
10
|
+
properties: {
|
|
11
|
+
eventName: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
},
|
|
14
|
+
eventCategory: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
},
|
|
17
|
+
eventLabel: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
},
|
|
20
|
+
value: {
|
|
21
|
+
type: 'number',
|
|
22
|
+
},
|
|
23
|
+
groups: {
|
|
24
|
+
oneOf: [
|
|
25
|
+
{ type: 'string' },
|
|
26
|
+
{
|
|
27
|
+
type: 'array',
|
|
28
|
+
items: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
sendTo: {
|
|
35
|
+
oneOf: [
|
|
36
|
+
{ type: 'string' },
|
|
37
|
+
{
|
|
38
|
+
type: 'array',
|
|
39
|
+
items: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
eventTimeout: {
|
|
46
|
+
type: 'number',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -4,7 +4,7 @@ exports.CardWithImage = exports.CardWithImageItem = void 0;
|
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const common_1 = require("../../schema/validators/common");
|
|
6
6
|
const utils_1 = require("../../schema/validators/utils");
|
|
7
|
-
const schema_1 = require("
|
|
7
|
+
const schema_1 = require("../../sub-blocks/Content/schema");
|
|
8
8
|
const CardWithImageContentProps = (0, lodash_1.omit)(schema_1.ContentBase, ['links', 'size', 'text', 'theme']);
|
|
9
9
|
const CardWithImageLinks = {
|
|
10
10
|
type: 'object',
|