@gravity-ui/page-constructor 4.31.1-alpha.0 → 4.31.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/index.d.ts +0 -1
- package/build/cjs/blocks/index.js +1 -3
- package/build/cjs/components/YandexForm/YandexForm.d.ts +17 -2
- package/build/cjs/components/YandexForm/YandexForm.js +4 -6
- package/build/cjs/constructor-items.d.ts +0 -1
- package/build/cjs/constructor-items.js +0 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +4 -31
- package/build/cjs/models/constructor-items/blocks.js +1 -13
- package/build/cjs/models/constructor-items/common.d.ts +1 -17
- package/build/cjs/models/guards.d.ts +1 -3
- package/build/cjs/models/guards.js +1 -9
- package/build/cjs/models/navigation.d.ts +1 -0
- package/build/cjs/navigation/components/Logo/Logo.css +1 -0
- package/build/cjs/navigation/components/Logo/Logo.js +10 -5
- package/build/cjs/schema/constants.js +1 -2
- package/build/cjs/schema/validators/blocks.d.ts +0 -1
- package/build/cjs/schema/validators/blocks.js +0 -1
- package/build/esm/blocks/index.d.ts +0 -1
- package/build/esm/blocks/index.js +0 -1
- package/build/esm/components/YandexForm/YandexForm.d.ts +17 -2
- package/build/esm/components/YandexForm/YandexForm.js +3 -5
- package/build/esm/constructor-items.d.ts +0 -1
- package/build/esm/constructor-items.js +1 -2
- package/build/esm/models/constructor-items/blocks.d.ts +4 -31
- package/build/esm/models/constructor-items/blocks.js +0 -12
- package/build/esm/models/constructor-items/common.d.ts +1 -17
- package/build/esm/models/guards.d.ts +1 -3
- package/build/esm/models/guards.js +1 -7
- package/build/esm/models/navigation.d.ts +1 -0
- package/build/esm/navigation/components/Logo/Logo.css +1 -0
- package/build/esm/navigation/components/Logo/Logo.js +11 -6
- package/build/esm/schema/constants.js +2 -3
- package/build/esm/schema/validators/blocks.d.ts +0 -1
- package/build/esm/schema/validators/blocks.js +0 -1
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +4 -31
- package/server/models/constructor-items/blocks.js +1 -13
- package/server/models/constructor-items/common.d.ts +1 -17
- package/server/models/guards.d.ts +1 -3
- package/server/models/guards.js +1 -9
- package/server/models/navigation.d.ts +1 -0
- package/widget/index.js +1 -1
- package/build/cjs/blocks/Form/Form.css +0 -136
- package/build/cjs/blocks/Form/Form.d.ts +0 -4
- package/build/cjs/blocks/Form/Form.js +0 -61
- package/build/cjs/blocks/Form/HubspotInlineForm.d.ts +0 -7
- package/build/cjs/blocks/Form/HubspotInlineForm.js +0 -14
- package/build/cjs/blocks/Form/InnerForm/InnerForm.d.ts +0 -9
- package/build/cjs/blocks/Form/InnerForm/InnerForm.js +0 -28
- package/build/cjs/blocks/Form/schema.d.ts +0 -202
- package/build/cjs/blocks/Form/schema.js +0 -44
- package/build/cjs/components/YandexForm/schema.d.ts +0 -16
- package/build/cjs/components/YandexForm/schema.js +0 -13
- package/build/cjs/editor/data/templates/form-block.json +0 -20
- package/build/cjs/sub-blocks/HubspotForm/schema.d.ts +0 -22
- package/build/cjs/sub-blocks/HubspotForm/schema.js +0 -17
- package/build/esm/blocks/Form/Form.css +0 -136
- package/build/esm/blocks/Form/Form.d.ts +0 -5
- package/build/esm/blocks/Form/Form.js +0 -59
- package/build/esm/blocks/Form/HubspotInlineForm.d.ts +0 -7
- package/build/esm/blocks/Form/HubspotInlineForm.js +0 -12
- package/build/esm/blocks/Form/InnerForm/InnerForm.d.ts +0 -9
- package/build/esm/blocks/Form/InnerForm/InnerForm.js +0 -26
- package/build/esm/blocks/Form/schema.d.ts +0 -202
- package/build/esm/blocks/Form/schema.js +0 -40
- package/build/esm/components/YandexForm/schema.d.ts +0 -16
- package/build/esm/components/YandexForm/schema.js +0 -10
- package/build/esm/editor/data/templates/form-block.json +0 -20
- package/build/esm/sub-blocks/HubspotForm/schema.d.ts +0 -22
- package/build/esm/sub-blocks/HubspotForm/schema.js +0 -14
|
@@ -16,4 +16,3 @@ export { default as CardLayoutBlock } from './CardLayout/CardLayout';
|
|
|
16
16
|
export { default as ContentLayoutBlock } from './ContentLayout/ContentLayout';
|
|
17
17
|
export { default as ShareBlock } from './Share/Share';
|
|
18
18
|
export { default as FilterBlock } from './FilterBlock/FilterBlock';
|
|
19
|
-
export { default as FormBlock } from './Form/Form';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
|
|
7
7
|
var Banner_1 = require("./Banner/Banner");
|
|
8
8
|
Object.defineProperty(exports, "BannerBlock", { enumerable: true, get: function () { return __importDefault(Banner_1).default; } });
|
|
9
9
|
var Companies_1 = require("./Companies/Companies");
|
|
@@ -40,5 +40,3 @@ var Share_1 = require("./Share/Share");
|
|
|
40
40
|
Object.defineProperty(exports, "ShareBlock", { enumerable: true, get: function () { return __importDefault(Share_1).default; } });
|
|
41
41
|
var FilterBlock_1 = require("./FilterBlock/FilterBlock");
|
|
42
42
|
Object.defineProperty(exports, "FilterBlock", { enumerable: true, get: function () { return __importDefault(FilterBlock_1).default; } });
|
|
43
|
-
var Form_1 = require("./Form/Form");
|
|
44
|
-
Object.defineProperty(exports, "FormBlock", { enumerable: true, get: function () { return __importDefault(Form_1).default; } });
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PixelEvent } from '../../models';
|
|
2
|
+
import { AnalyticsEventsBase } from '../../models/common';
|
|
2
3
|
export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
|
|
3
|
-
export
|
|
4
|
+
export interface YandexFormProps extends AnalyticsEventsBase {
|
|
5
|
+
id: number | string;
|
|
6
|
+
containerId?: string;
|
|
7
|
+
theme?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
headerHeight?: number;
|
|
10
|
+
customFormOrigin?: string;
|
|
11
|
+
params?: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
onSubmit?: () => void;
|
|
15
|
+
onLoad?: () => void;
|
|
16
|
+
metrikaGoals?: string | string[];
|
|
17
|
+
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
18
|
+
}
|
|
4
19
|
declare const YandexForm: (props: YandexFormProps) => JSX.Element;
|
|
5
20
|
export default YandexForm;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.YANDEX_FORM_ORIGIN = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const localeContext_1 = require("../../context/localeContext");
|
|
@@ -11,15 +11,13 @@ const common_1 = require("../../models/common");
|
|
|
11
11
|
const utils_1 = require("../../utils");
|
|
12
12
|
const constants_1 = require("../constants");
|
|
13
13
|
exports.YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
|
|
14
|
-
exports.YANDEX_FORM_SECTION = 'surveys';
|
|
15
14
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
16
15
|
const b = (0, utils_1.block)('yandex-form');
|
|
17
16
|
const YandexForm = (props) => {
|
|
18
|
-
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin,
|
|
17
|
+
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
|
|
19
18
|
const formContainerRef = (0, react_1.useRef)(null);
|
|
20
19
|
const iframeRef = (0, react_1.useRef)();
|
|
21
20
|
const yaFormOrigin = customFormOrigin || exports.YANDEX_FORM_ORIGIN;
|
|
22
|
-
const yaFormSection = customFormSection || exports.YANDEX_FORM_SECTION;
|
|
23
21
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
24
22
|
const handleAnalytics = (0, hooks_1.useAnalytics)(common_1.DefaultEventNames.YandexFormSubmit);
|
|
25
23
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
@@ -41,7 +39,7 @@ const YandexForm = (props) => {
|
|
|
41
39
|
queryParams.set(param, params[param]);
|
|
42
40
|
});
|
|
43
41
|
}
|
|
44
|
-
const src = `${yaFormOrigin}/${
|
|
42
|
+
const src = `${yaFormOrigin}/surveys/${id}/?${queryParams}`;
|
|
45
43
|
if (iframeRef.current) {
|
|
46
44
|
iframeRef.current.src = src;
|
|
47
45
|
}
|
|
@@ -56,7 +54,7 @@ const YandexForm = (props) => {
|
|
|
56
54
|
iframeRef.current.width = '100%';
|
|
57
55
|
container.appendChild(iframeRef.current);
|
|
58
56
|
}
|
|
59
|
-
}, [locale.lang, theme, isMobile, yaFormOrigin,
|
|
57
|
+
}, [locale.lang, theme, isMobile, yaFormOrigin, id, containerId, params]);
|
|
60
58
|
const handleSubmit = (0, react_1.useCallback)(() => {
|
|
61
59
|
if (formContainerRef && formContainerRef.current) {
|
|
62
60
|
const { top } = formContainerRef.current.getBoundingClientRect();
|
|
@@ -17,7 +17,6 @@ export declare const blockMap: {
|
|
|
17
17
|
"share-block": ({ items, title }: import("./models").ShareBlockProps) => JSX.Element;
|
|
18
18
|
"map-block": ({ map, ...props }: import("./models").MapBlockProps) => JSX.Element;
|
|
19
19
|
"filter-block": import("react").FC<import("./models").FilterBlockProps>;
|
|
20
|
-
"form-block": import("react").FC<import("./models").FormBlockProps>;
|
|
21
20
|
};
|
|
22
21
|
export declare const subBlockMap: {
|
|
23
22
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
@@ -26,7 +26,6 @@ exports.blockMap = {
|
|
|
26
26
|
[models_1.BlockType.ShareBlock]: blocks_1.ShareBlock,
|
|
27
27
|
[models_1.BlockType.MapBlock]: blocks_1.MapBlock,
|
|
28
28
|
[models_1.BlockType.FilterBlock]: blocks_1.FilterBlock,
|
|
29
|
-
[models_1.BlockType.FormBlock]: blocks_1.FormBlock,
|
|
30
29
|
};
|
|
31
30
|
exports.subBlockMap = {
|
|
32
31
|
[models_1.SubBlockType.Divider]: sub_blocks_1.Divider,
|
|
@@ -3,8 +3,8 @@ import { ButtonSize } from '@gravity-ui/uikit';
|
|
|
3
3
|
import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
|
|
4
4
|
import { ThemeSupporting } from '../../utils';
|
|
5
5
|
import { AnalyticsEventsBase } from '../common';
|
|
6
|
-
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps
|
|
7
|
-
import { BannerCardProps,
|
|
6
|
+
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps } from './common';
|
|
7
|
+
import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
8
8
|
export declare enum BlockType {
|
|
9
9
|
PromoFeaturesBlock = "promo-features-block",
|
|
10
10
|
ExtendedFeaturesBlock = "extended-features-block",
|
|
@@ -23,8 +23,7 @@ export declare enum BlockType {
|
|
|
23
23
|
ContentLayoutBlock = "content-layout-block",
|
|
24
24
|
ShareBlock = "share-block",
|
|
25
25
|
MapBlock = "map-block",
|
|
26
|
-
FilterBlock = "filter-block"
|
|
27
|
-
FormBlock = "form-block"
|
|
26
|
+
FilterBlock = "filter-block"
|
|
28
27
|
}
|
|
29
28
|
export declare const BlockTypes: BlockType[];
|
|
30
29
|
export declare const HeaderBlockTypes: BlockType[];
|
|
@@ -296,29 +295,6 @@ export interface ShareBlockProps {
|
|
|
296
295
|
items: PCShareSocialNetwork[];
|
|
297
296
|
title?: string;
|
|
298
297
|
}
|
|
299
|
-
export declare enum FormBlockDataTypes {
|
|
300
|
-
YANDEX = "yandex",
|
|
301
|
-
HUBSPOT_INLINE = "hubspot-inline"
|
|
302
|
-
}
|
|
303
|
-
export declare enum FormBlockDirection {
|
|
304
|
-
FormContent = "form-content",
|
|
305
|
-
ContentForm = "content-form",
|
|
306
|
-
Center = "center"
|
|
307
|
-
}
|
|
308
|
-
export interface FormBlockYandexData {
|
|
309
|
-
yandex: YandexFormProps;
|
|
310
|
-
}
|
|
311
|
-
export interface FormBlockHubspotData {
|
|
312
|
-
hubspot: HubspotFormProps;
|
|
313
|
-
}
|
|
314
|
-
export type FormBlockData = FormBlockYandexData | FormBlockHubspotData;
|
|
315
|
-
export interface FormBlockProps {
|
|
316
|
-
formData: FormBlockData;
|
|
317
|
-
title?: string;
|
|
318
|
-
textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;
|
|
319
|
-
direction?: FormBlockDirection;
|
|
320
|
-
background?: BackgroundImageProps;
|
|
321
|
-
}
|
|
322
298
|
export type HeaderBlockModel = {
|
|
323
299
|
type: BlockType.HeaderBlock;
|
|
324
300
|
} & HeaderBlockProps;
|
|
@@ -373,9 +349,6 @@ export type ContentLayoutBlockModel = {
|
|
|
373
349
|
export type ShareBLockModel = {
|
|
374
350
|
type: BlockType.ShareBlock;
|
|
375
351
|
} & ShareBlockProps;
|
|
376
|
-
|
|
377
|
-
type: BlockType.FormBlock;
|
|
378
|
-
} & FormBlockProps;
|
|
379
|
-
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel;
|
|
352
|
+
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
|
|
380
353
|
export type Block = BlockModels & BlockBaseProps;
|
|
381
354
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PCShareSocialNetwork = exports.SliderType = exports.SliderBreakpointNames = exports.HeaderBlockTypes = exports.BlockTypes = exports.BlockType = void 0;
|
|
4
4
|
var BlockType;
|
|
5
5
|
(function (BlockType) {
|
|
6
6
|
BlockType["PromoFeaturesBlock"] = "promo-features-block";
|
|
@@ -21,7 +21,6 @@ var BlockType;
|
|
|
21
21
|
BlockType["ShareBlock"] = "share-block";
|
|
22
22
|
BlockType["MapBlock"] = "map-block";
|
|
23
23
|
BlockType["FilterBlock"] = "filter-block";
|
|
24
|
-
BlockType["FormBlock"] = "form-block";
|
|
25
24
|
})(BlockType = exports.BlockType || (exports.BlockType = {}));
|
|
26
25
|
exports.BlockTypes = Object.values(BlockType);
|
|
27
26
|
exports.HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];
|
|
@@ -45,14 +44,3 @@ var PCShareSocialNetwork;
|
|
|
45
44
|
PCShareSocialNetwork["Facebook"] = "facebook";
|
|
46
45
|
PCShareSocialNetwork["LinkedIn"] = "linkedin";
|
|
47
46
|
})(PCShareSocialNetwork = exports.PCShareSocialNetwork || (exports.PCShareSocialNetwork = {}));
|
|
48
|
-
var FormBlockDataTypes;
|
|
49
|
-
(function (FormBlockDataTypes) {
|
|
50
|
-
FormBlockDataTypes["YANDEX"] = "yandex";
|
|
51
|
-
FormBlockDataTypes["HUBSPOT_INLINE"] = "hubspot-inline";
|
|
52
|
-
})(FormBlockDataTypes = exports.FormBlockDataTypes || (exports.FormBlockDataTypes = {}));
|
|
53
|
-
var FormBlockDirection;
|
|
54
|
-
(function (FormBlockDirection) {
|
|
55
|
-
FormBlockDirection["FormContent"] = "form-content";
|
|
56
|
-
FormBlockDirection["ContentForm"] = "content-form";
|
|
57
|
-
FormBlockDirection["Center"] = "center";
|
|
58
|
-
})(FormBlockDirection = exports.FormBlockDirection || (exports.FormBlockDirection = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
|
|
3
3
|
import { ThemeSupporting } from '../../utils';
|
|
4
|
-
import { AnalyticsEventsBase, ClassNameProps,
|
|
4
|
+
import { AnalyticsEventsBase, ClassNameProps, PixelEventType, QAProps } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -337,20 +337,4 @@ export interface TitleProps {
|
|
|
337
337
|
title?: TitleItemProps | string;
|
|
338
338
|
subtitle?: string;
|
|
339
339
|
}
|
|
340
|
-
export interface YandexFormProps extends AnalyticsEventsBase {
|
|
341
|
-
id: number | string;
|
|
342
|
-
containerId?: string;
|
|
343
|
-
theme?: string;
|
|
344
|
-
className?: string;
|
|
345
|
-
headerHeight?: number;
|
|
346
|
-
customFormOrigin?: string;
|
|
347
|
-
customFormSection?: string;
|
|
348
|
-
params?: {
|
|
349
|
-
[key: string]: string;
|
|
350
|
-
};
|
|
351
|
-
onSubmit?: () => void;
|
|
352
|
-
onLoad?: () => void;
|
|
353
|
-
metrikaGoals?: string | string[];
|
|
354
|
-
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
355
|
-
}
|
|
356
340
|
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Block, ConstructorItem
|
|
1
|
+
import { Block, ConstructorItem } from './';
|
|
2
2
|
import { MetrikaGoal, NewMetrikaGoal } from './index';
|
|
3
3
|
export declare function isBlock(block: ConstructorItem): block is Block;
|
|
4
4
|
export declare function isNewMetrikaFormat(metrika: MetrikaGoal): metrika is NewMetrikaGoal[];
|
|
5
|
-
export declare function isYandexDataForm(data: FormBlockData): data is FormBlockYandexData;
|
|
6
|
-
export declare function isHubspotDataForm(data: FormBlockData): data is FormBlockHubspotData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isNewMetrikaFormat = exports.isBlock = void 0;
|
|
4
4
|
const _1 = require("./");
|
|
5
5
|
function isBlock(block) {
|
|
6
6
|
return block.type in _1.BlockTypes;
|
|
@@ -10,11 +10,3 @@ function isNewMetrikaFormat(metrika) {
|
|
|
10
10
|
return Boolean(Array.isArray(metrika) && metrika.length && typeof metrika[0] === 'object');
|
|
11
11
|
}
|
|
12
12
|
exports.isNewMetrikaFormat = isNewMetrikaFormat;
|
|
13
|
-
function isYandexDataForm(data) {
|
|
14
|
-
return Boolean(data.yandex);
|
|
15
|
-
}
|
|
16
|
-
exports.isYandexDataForm = isYandexDataForm;
|
|
17
|
-
function isHubspotDataForm(data) {
|
|
18
|
-
return Boolean(data.hubspot);
|
|
19
|
-
}
|
|
20
|
-
exports.isHubspotDataForm = isHubspotDataForm;
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const components_1 = require("../../../components");
|
|
6
6
|
const utils_1 = require("../../../components/Media/Image/utils");
|
|
7
7
|
const RouterLink_1 = tslib_1.__importDefault(require("../../../components/RouterLink/RouterLink"));
|
|
8
|
+
const locationContext_1 = require("../../../context/locationContext");
|
|
8
9
|
const theme_1 = require("../../../context/theme");
|
|
9
10
|
const utils_2 = require("../../../utils");
|
|
10
11
|
const b = (0, utils_2.block)('logo');
|
|
11
12
|
const Logo = (props) => {
|
|
13
|
+
const { hostname, Link } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
12
14
|
const theme = (0, theme_1.useTheme)();
|
|
13
15
|
const themedLogoProps = (0, utils_2.getThemedValue)(props, theme) || props;
|
|
14
16
|
const imageData = (0, utils_1.getMediaImage)(themedLogoProps.icon || props.icon);
|
|
15
17
|
const textData = themedLogoProps.text || props.text;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const url = themedLogoProps.url || props.url || '/';
|
|
19
|
+
const urlTitle = themedLogoProps.urlTitle || props.urlTitle || textData;
|
|
20
|
+
const linkExtraProps = (0, utils_2.getLinkProps)(url, hostname);
|
|
21
|
+
const content = (react_1.default.createElement(react_1.Fragment, null,
|
|
22
|
+
imageData && react_1.default.createElement(components_1.Image, Object.assign({ className: b('icon') }, imageData)),
|
|
23
|
+
react_1.default.createElement("span", { className: b('text') }, textData)));
|
|
24
|
+
return (react_1.default.createElement(RouterLink_1.default, { href: url, passHref: true }, Link ? (react_1.default.createElement("span", { className: b(null, props.className) }, content)) : (react_1.default.createElement("a", Object.assign({ className: b(null, props.className), href: url, title: urlTitle }, linkExtraProps), content))));
|
|
20
25
|
};
|
|
21
26
|
exports.default = Logo;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.constructorCardSchemaNames = exports.constructorBlockSchemaNames = exports.cardSchemas = exports.blockSchemas = void 0;
|
|
4
4
|
const blocks_1 = require("./validators/blocks");
|
|
5
5
|
const sub_blocks_1 = require("./validators/sub-blocks");
|
|
6
|
-
exports.blockSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
6
|
+
exports.blockSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.TableBlock), blocks_1.TabsBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock), blocks_1.FilterBlock);
|
|
7
7
|
exports.cardSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.MediaCardBlock), blocks_1.BannerCard), sub_blocks_1.PriceDetailedBlock), sub_blocks_1.BackgroundCard), sub_blocks_1.Quote), sub_blocks_1.BasicCard);
|
|
8
8
|
exports.constructorBlockSchemaNames = [
|
|
9
9
|
'divider',
|
|
@@ -30,7 +30,6 @@ exports.constructorBlockSchemaNames = [
|
|
|
30
30
|
'content-layout-block',
|
|
31
31
|
'share-block',
|
|
32
32
|
'filter-block',
|
|
33
|
-
'form-block',
|
|
34
33
|
];
|
|
35
34
|
exports.constructorCardSchemaNames = [
|
|
36
35
|
'media-card',
|
|
@@ -19,4 +19,3 @@ tslib_1.__exportStar(require("../../blocks/CardLayout/schema"), exports);
|
|
|
19
19
|
tslib_1.__exportStar(require("../../blocks/ContentLayout/schema"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("../../blocks/Share/schema"), exports);
|
|
21
21
|
tslib_1.__exportStar(require("../../blocks/FilterBlock/schema"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("../../blocks/Form/schema"), exports);
|
|
@@ -16,4 +16,3 @@ export { default as CardLayoutBlock } from './CardLayout/CardLayout';
|
|
|
16
16
|
export { default as ContentLayoutBlock } from './ContentLayout/ContentLayout';
|
|
17
17
|
export { default as ShareBlock } from './Share/Share';
|
|
18
18
|
export { default as FilterBlock } from './FilterBlock/FilterBlock';
|
|
19
|
-
export { default as FormBlock } from './Form/Form';
|
|
@@ -16,4 +16,3 @@ export { default as CardLayoutBlock } from './CardLayout/CardLayout';
|
|
|
16
16
|
export { default as ContentLayoutBlock } from './ContentLayout/ContentLayout';
|
|
17
17
|
export { default as ShareBlock } from './Share/Share';
|
|
18
18
|
export { default as FilterBlock } from './FilterBlock/FilterBlock';
|
|
19
|
-
export { default as FormBlock } from './Form/Form';
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PixelEvent } from '../../models';
|
|
2
|
+
import { AnalyticsEventsBase } from '../../models/common';
|
|
2
3
|
export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
|
|
3
|
-
export
|
|
4
|
+
export interface YandexFormProps extends AnalyticsEventsBase {
|
|
5
|
+
id: number | string;
|
|
6
|
+
containerId?: string;
|
|
7
|
+
theme?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
headerHeight?: number;
|
|
10
|
+
customFormOrigin?: string;
|
|
11
|
+
params?: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
onSubmit?: () => void;
|
|
15
|
+
onLoad?: () => void;
|
|
16
|
+
metrikaGoals?: string | string[];
|
|
17
|
+
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
18
|
+
}
|
|
4
19
|
declare const YandexForm: (props: YandexFormProps) => JSX.Element;
|
|
5
20
|
export default YandexForm;
|
|
@@ -7,15 +7,13 @@ import { DefaultEventNames } from '../../models/common';
|
|
|
7
7
|
import { block } from '../../utils';
|
|
8
8
|
import { HEADER_HEIGHT } from '../constants';
|
|
9
9
|
export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
|
|
10
|
-
export const YANDEX_FORM_SECTION = 'surveys';
|
|
11
10
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
12
11
|
const b = block('yandex-form');
|
|
13
12
|
const YandexForm = (props) => {
|
|
14
|
-
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin,
|
|
13
|
+
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
|
|
15
14
|
const formContainerRef = useRef(null);
|
|
16
15
|
const iframeRef = useRef();
|
|
17
16
|
const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;
|
|
18
|
-
const yaFormSection = customFormSection || YANDEX_FORM_SECTION;
|
|
19
17
|
const handleMetrika = useMetrika();
|
|
20
18
|
const handleAnalytics = useAnalytics(DefaultEventNames.YandexFormSubmit);
|
|
21
19
|
const isMobile = useContext(MobileContext);
|
|
@@ -37,7 +35,7 @@ const YandexForm = (props) => {
|
|
|
37
35
|
queryParams.set(param, params[param]);
|
|
38
36
|
});
|
|
39
37
|
}
|
|
40
|
-
const src = `${yaFormOrigin}/${
|
|
38
|
+
const src = `${yaFormOrigin}/surveys/${id}/?${queryParams}`;
|
|
41
39
|
if (iframeRef.current) {
|
|
42
40
|
iframeRef.current.src = src;
|
|
43
41
|
}
|
|
@@ -52,7 +50,7 @@ const YandexForm = (props) => {
|
|
|
52
50
|
iframeRef.current.width = '100%';
|
|
53
51
|
container.appendChild(iframeRef.current);
|
|
54
52
|
}
|
|
55
|
-
}, [locale.lang, theme, isMobile, yaFormOrigin,
|
|
53
|
+
}, [locale.lang, theme, isMobile, yaFormOrigin, id, containerId, params]);
|
|
56
54
|
const handleSubmit = useCallback(() => {
|
|
57
55
|
if (formContainerRef && formContainerRef.current) {
|
|
58
56
|
const { top } = formContainerRef.current.getBoundingClientRect();
|
|
@@ -17,7 +17,6 @@ export declare const blockMap: {
|
|
|
17
17
|
"share-block": ({ items, title }: import("./models").ShareBlockProps) => JSX.Element;
|
|
18
18
|
"map-block": ({ map, ...props }: import("./models").MapBlockProps) => JSX.Element;
|
|
19
19
|
"filter-block": import("react").FC<import("./models").FilterBlockProps>;
|
|
20
|
-
"form-block": import("react").FC<import("./models").FormBlockProps>;
|
|
21
20
|
};
|
|
22
21
|
export declare const subBlockMap: {
|
|
23
22
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock,
|
|
1
|
+
import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, MapBlock, MediaBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SliderBlock, TableBlock, TabsBlock, } from './blocks';
|
|
2
2
|
import { BlockType, NavigationItemType, SubBlockType } from './models';
|
|
3
3
|
import { GithubButton, NavigationButton, NavigationDropdown, NavigationLink, } from './navigation/components/NavigationItem';
|
|
4
4
|
import SocialIcon from './navigation/components/SocialIcon/SocialIcon';
|
|
@@ -22,7 +22,6 @@ export const blockMap = {
|
|
|
22
22
|
[BlockType.ShareBlock]: ShareBlock,
|
|
23
23
|
[BlockType.MapBlock]: MapBlock,
|
|
24
24
|
[BlockType.FilterBlock]: FilterBlock,
|
|
25
|
-
[BlockType.FormBlock]: FormBlock,
|
|
26
25
|
};
|
|
27
26
|
export const subBlockMap = {
|
|
28
27
|
[SubBlockType.Divider]: Divider,
|
|
@@ -3,8 +3,8 @@ import { ButtonSize } from '@gravity-ui/uikit';
|
|
|
3
3
|
import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
|
|
4
4
|
import { ThemeSupporting } from '../../utils';
|
|
5
5
|
import { AnalyticsEventsBase } from '../common';
|
|
6
|
-
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps
|
|
7
|
-
import { BannerCardProps,
|
|
6
|
+
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps } from './common';
|
|
7
|
+
import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
8
8
|
export declare enum BlockType {
|
|
9
9
|
PromoFeaturesBlock = "promo-features-block",
|
|
10
10
|
ExtendedFeaturesBlock = "extended-features-block",
|
|
@@ -23,8 +23,7 @@ export declare enum BlockType {
|
|
|
23
23
|
ContentLayoutBlock = "content-layout-block",
|
|
24
24
|
ShareBlock = "share-block",
|
|
25
25
|
MapBlock = "map-block",
|
|
26
|
-
FilterBlock = "filter-block"
|
|
27
|
-
FormBlock = "form-block"
|
|
26
|
+
FilterBlock = "filter-block"
|
|
28
27
|
}
|
|
29
28
|
export declare const BlockTypes: BlockType[];
|
|
30
29
|
export declare const HeaderBlockTypes: BlockType[];
|
|
@@ -296,29 +295,6 @@ export interface ShareBlockProps {
|
|
|
296
295
|
items: PCShareSocialNetwork[];
|
|
297
296
|
title?: string;
|
|
298
297
|
}
|
|
299
|
-
export declare enum FormBlockDataTypes {
|
|
300
|
-
YANDEX = "yandex",
|
|
301
|
-
HUBSPOT_INLINE = "hubspot-inline"
|
|
302
|
-
}
|
|
303
|
-
export declare enum FormBlockDirection {
|
|
304
|
-
FormContent = "form-content",
|
|
305
|
-
ContentForm = "content-form",
|
|
306
|
-
Center = "center"
|
|
307
|
-
}
|
|
308
|
-
export interface FormBlockYandexData {
|
|
309
|
-
yandex: YandexFormProps;
|
|
310
|
-
}
|
|
311
|
-
export interface FormBlockHubspotData {
|
|
312
|
-
hubspot: HubspotFormProps;
|
|
313
|
-
}
|
|
314
|
-
export type FormBlockData = FormBlockYandexData | FormBlockHubspotData;
|
|
315
|
-
export interface FormBlockProps {
|
|
316
|
-
formData: FormBlockData;
|
|
317
|
-
title?: string;
|
|
318
|
-
textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;
|
|
319
|
-
direction?: FormBlockDirection;
|
|
320
|
-
background?: BackgroundImageProps;
|
|
321
|
-
}
|
|
322
298
|
export type HeaderBlockModel = {
|
|
323
299
|
type: BlockType.HeaderBlock;
|
|
324
300
|
} & HeaderBlockProps;
|
|
@@ -373,9 +349,6 @@ export type ContentLayoutBlockModel = {
|
|
|
373
349
|
export type ShareBLockModel = {
|
|
374
350
|
type: BlockType.ShareBlock;
|
|
375
351
|
} & ShareBlockProps;
|
|
376
|
-
|
|
377
|
-
type: BlockType.FormBlock;
|
|
378
|
-
} & FormBlockProps;
|
|
379
|
-
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel;
|
|
352
|
+
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
|
|
380
353
|
export type Block = BlockModels & BlockBaseProps;
|
|
381
354
|
export {};
|
|
@@ -18,7 +18,6 @@ export var BlockType;
|
|
|
18
18
|
BlockType["ShareBlock"] = "share-block";
|
|
19
19
|
BlockType["MapBlock"] = "map-block";
|
|
20
20
|
BlockType["FilterBlock"] = "filter-block";
|
|
21
|
-
BlockType["FormBlock"] = "form-block";
|
|
22
21
|
})(BlockType || (BlockType = {}));
|
|
23
22
|
export const BlockTypes = Object.values(BlockType);
|
|
24
23
|
export const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];
|
|
@@ -42,14 +41,3 @@ export var PCShareSocialNetwork;
|
|
|
42
41
|
PCShareSocialNetwork["Facebook"] = "facebook";
|
|
43
42
|
PCShareSocialNetwork["LinkedIn"] = "linkedin";
|
|
44
43
|
})(PCShareSocialNetwork || (PCShareSocialNetwork = {}));
|
|
45
|
-
export var FormBlockDataTypes;
|
|
46
|
-
(function (FormBlockDataTypes) {
|
|
47
|
-
FormBlockDataTypes["YANDEX"] = "yandex";
|
|
48
|
-
FormBlockDataTypes["HUBSPOT_INLINE"] = "hubspot-inline";
|
|
49
|
-
})(FormBlockDataTypes || (FormBlockDataTypes = {}));
|
|
50
|
-
export var FormBlockDirection;
|
|
51
|
-
(function (FormBlockDirection) {
|
|
52
|
-
FormBlockDirection["FormContent"] = "form-content";
|
|
53
|
-
FormBlockDirection["ContentForm"] = "content-form";
|
|
54
|
-
FormBlockDirection["Center"] = "center";
|
|
55
|
-
})(FormBlockDirection || (FormBlockDirection = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
|
|
3
3
|
import { ThemeSupporting } from '../../utils';
|
|
4
|
-
import { AnalyticsEventsBase, ClassNameProps,
|
|
4
|
+
import { AnalyticsEventsBase, ClassNameProps, PixelEventType, QAProps } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -337,20 +337,4 @@ export interface TitleProps {
|
|
|
337
337
|
title?: TitleItemProps | string;
|
|
338
338
|
subtitle?: string;
|
|
339
339
|
}
|
|
340
|
-
export interface YandexFormProps extends AnalyticsEventsBase {
|
|
341
|
-
id: number | string;
|
|
342
|
-
containerId?: string;
|
|
343
|
-
theme?: string;
|
|
344
|
-
className?: string;
|
|
345
|
-
headerHeight?: number;
|
|
346
|
-
customFormOrigin?: string;
|
|
347
|
-
customFormSection?: string;
|
|
348
|
-
params?: {
|
|
349
|
-
[key: string]: string;
|
|
350
|
-
};
|
|
351
|
-
onSubmit?: () => void;
|
|
352
|
-
onLoad?: () => void;
|
|
353
|
-
metrikaGoals?: string | string[];
|
|
354
|
-
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
355
|
-
}
|
|
356
340
|
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Block, ConstructorItem
|
|
1
|
+
import { Block, ConstructorItem } from './';
|
|
2
2
|
import { MetrikaGoal, NewMetrikaGoal } from './index';
|
|
3
3
|
export declare function isBlock(block: ConstructorItem): block is Block;
|
|
4
4
|
export declare function isNewMetrikaFormat(metrika: MetrikaGoal): metrika is NewMetrikaGoal[];
|
|
5
|
-
export declare function isYandexDataForm(data: FormBlockData): data is FormBlockYandexData;
|
|
6
|
-
export declare function isHubspotDataForm(data: FormBlockData): data is FormBlockHubspotData;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { BlockTypes
|
|
1
|
+
import { BlockTypes } from './';
|
|
2
2
|
export function isBlock(block) {
|
|
3
3
|
return block.type in BlockTypes;
|
|
4
4
|
}
|
|
5
5
|
export function isNewMetrikaFormat(metrika) {
|
|
6
6
|
return Boolean(Array.isArray(metrika) && metrika.length && typeof metrika[0] === 'object');
|
|
7
7
|
}
|
|
8
|
-
export function isYandexDataForm(data) {
|
|
9
|
-
return Boolean(data.yandex);
|
|
10
|
-
}
|
|
11
|
-
export function isHubspotDataForm(data) {
|
|
12
|
-
return Boolean(data.hubspot);
|
|
13
|
-
}
|