@gravity-ui/page-constructor 4.31.0 → 4.31.1-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/Form/Form.css +136 -0
- package/build/cjs/blocks/Form/Form.d.ts +4 -0
- package/build/cjs/blocks/Form/Form.js +61 -0
- package/build/cjs/blocks/Form/HubspotInlineForm.d.ts +7 -0
- package/build/cjs/blocks/Form/HubspotInlineForm.js +14 -0
- package/build/cjs/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
- package/build/cjs/blocks/Form/InnerForm/InnerForm.js +28 -0
- package/build/cjs/blocks/Form/schema.d.ts +202 -0
- package/build/cjs/blocks/Form/schema.js +44 -0
- package/build/cjs/blocks/index.d.ts +1 -0
- package/build/cjs/blocks/index.js +3 -1
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -17
- package/build/cjs/components/YandexForm/YandexForm.js +6 -4
- package/build/cjs/components/YandexForm/schema.d.ts +16 -0
- package/build/cjs/components/YandexForm/schema.js +13 -0
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/editor/data/templates/form-block.json +20 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +31 -4
- package/build/cjs/models/constructor-items/blocks.js +13 -1
- package/build/cjs/models/constructor-items/common.d.ts +17 -1
- package/build/cjs/models/guards.d.ts +3 -1
- package/build/cjs/models/guards.js +9 -1
- package/build/cjs/schema/constants.js +2 -1
- package/build/cjs/schema/validators/blocks.d.ts +1 -0
- package/build/cjs/schema/validators/blocks.js +1 -0
- package/build/cjs/sub-blocks/HubspotForm/schema.d.ts +22 -0
- package/build/cjs/sub-blocks/HubspotForm/schema.js +17 -0
- package/build/esm/blocks/Form/Form.css +136 -0
- package/build/esm/blocks/Form/Form.d.ts +5 -0
- package/build/esm/blocks/Form/Form.js +59 -0
- package/build/esm/blocks/Form/HubspotInlineForm.d.ts +7 -0
- package/build/esm/blocks/Form/HubspotInlineForm.js +12 -0
- package/build/esm/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
- package/build/esm/blocks/Form/InnerForm/InnerForm.js +26 -0
- package/build/esm/blocks/Form/schema.d.ts +202 -0
- package/build/esm/blocks/Form/schema.js +40 -0
- package/build/esm/blocks/index.d.ts +1 -0
- package/build/esm/blocks/index.js +1 -0
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -17
- package/build/esm/components/YandexForm/YandexForm.js +5 -3
- package/build/esm/components/YandexForm/schema.d.ts +16 -0
- package/build/esm/components/YandexForm/schema.js +10 -0
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/editor/data/templates/form-block.json +20 -0
- package/build/esm/models/constructor-items/blocks.d.ts +31 -4
- package/build/esm/models/constructor-items/blocks.js +12 -0
- package/build/esm/models/constructor-items/common.d.ts +17 -1
- package/build/esm/models/guards.d.ts +3 -1
- package/build/esm/models/guards.js +7 -1
- package/build/esm/schema/constants.js +3 -2
- package/build/esm/schema/validators/blocks.d.ts +1 -0
- package/build/esm/schema/validators/blocks.js +1 -0
- package/build/esm/sub-blocks/HubspotForm/schema.d.ts +22 -0
- package/build/esm/sub-blocks/HubspotForm/schema.js +14 -0
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +31 -4
- package/server/models/constructor-items/blocks.js +13 -1
- package/server/models/constructor-items/common.d.ts +17 -1
- package/server/models/guards.d.ts +3 -1
- package/server/models/guards.js +9 -1
- package/widget/index.js +1 -1
|
@@ -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 } from './common';
|
|
7
|
-
import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
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, YandexFormProps } from './common';
|
|
7
|
+
import { BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
8
8
|
export declare enum BlockType {
|
|
9
9
|
PromoFeaturesBlock = "promo-features-block",
|
|
10
10
|
ExtendedFeaturesBlock = "extended-features-block",
|
|
@@ -23,7 +23,8 @@ export declare enum BlockType {
|
|
|
23
23
|
ContentLayoutBlock = "content-layout-block",
|
|
24
24
|
ShareBlock = "share-block",
|
|
25
25
|
MapBlock = "map-block",
|
|
26
|
-
FilterBlock = "filter-block"
|
|
26
|
+
FilterBlock = "filter-block",
|
|
27
|
+
FormBlock = "form-block"
|
|
27
28
|
}
|
|
28
29
|
export declare const BlockTypes: BlockType[];
|
|
29
30
|
export declare const HeaderBlockTypes: BlockType[];
|
|
@@ -295,6 +296,29 @@ export interface ShareBlockProps {
|
|
|
295
296
|
items: PCShareSocialNetwork[];
|
|
296
297
|
title?: string;
|
|
297
298
|
}
|
|
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
|
+
}
|
|
298
322
|
export type HeaderBlockModel = {
|
|
299
323
|
type: BlockType.HeaderBlock;
|
|
300
324
|
} & HeaderBlockProps;
|
|
@@ -349,6 +373,9 @@ export type ContentLayoutBlockModel = {
|
|
|
349
373
|
export type ShareBLockModel = {
|
|
350
374
|
type: BlockType.ShareBlock;
|
|
351
375
|
} & ShareBlockProps;
|
|
352
|
-
type
|
|
376
|
+
export type FormBlockModel = {
|
|
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;
|
|
353
380
|
export type Block = BlockModels & BlockBaseProps;
|
|
354
381
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PCShareSocialNetwork = exports.SliderType = exports.SliderBreakpointNames = exports.HeaderBlockTypes = exports.BlockTypes = exports.BlockType = void 0;
|
|
3
|
+
exports.FormBlockDirection = exports.FormBlockDataTypes = 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,6 +21,7 @@ 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";
|
|
24
25
|
})(BlockType = exports.BlockType || (exports.BlockType = {}));
|
|
25
26
|
exports.BlockTypes = Object.values(BlockType);
|
|
26
27
|
exports.HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];
|
|
@@ -44,3 +45,14 @@ var PCShareSocialNetwork;
|
|
|
44
45
|
PCShareSocialNetwork["Facebook"] = "facebook";
|
|
45
46
|
PCShareSocialNetwork["LinkedIn"] = "linkedin";
|
|
46
47
|
})(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, PixelEventType, QAProps } from '../common';
|
|
4
|
+
import { AnalyticsEventsBase, ClassNameProps, PixelEvent, PixelEventType, QAProps } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -337,4 +337,20 @@ 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
|
+
}
|
|
340
356
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Block, ConstructorItem } from './';
|
|
1
|
+
import { Block, ConstructorItem, FormBlockData, FormBlockHubspotData, FormBlockYandexData } 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;
|
package/server/models/guards.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNewMetrikaFormat = exports.isBlock = void 0;
|
|
3
|
+
exports.isHubspotDataForm = exports.isYandexDataForm = 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,3 +10,11 @@ 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;
|