@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
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Fragment, useContext } from 'react';
|
|
2
2
|
import { Image } from '../../../components';
|
|
3
3
|
import { getMediaImage } from '../../../components/Media/Image/utils';
|
|
4
4
|
import RouterLink from '../../../components/RouterLink/RouterLink';
|
|
5
|
+
import { LocationContext } from '../../../context/locationContext';
|
|
5
6
|
import { useTheme } from '../../../context/theme';
|
|
6
|
-
import { block, getThemedValue } from '../../../utils';
|
|
7
|
+
import { block, getLinkProps, getThemedValue } from '../../../utils';
|
|
7
8
|
import './Logo.css';
|
|
8
9
|
const b = block('logo');
|
|
9
10
|
const Logo = (props) => {
|
|
11
|
+
const { hostname, Link } = useContext(LocationContext);
|
|
10
12
|
const theme = useTheme();
|
|
11
13
|
const themedLogoProps = getThemedValue(props, theme) || props;
|
|
12
14
|
const imageData = getMediaImage(themedLogoProps.icon || props.icon);
|
|
13
15
|
const textData = themedLogoProps.text || props.text;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const url = themedLogoProps.url || props.url || '/';
|
|
17
|
+
const urlTitle = themedLogoProps.urlTitle || props.urlTitle || textData;
|
|
18
|
+
const linkExtraProps = getLinkProps(url, hostname);
|
|
19
|
+
const content = (React.createElement(Fragment, null,
|
|
20
|
+
imageData && React.createElement(Image, Object.assign({ className: b('icon') }, imageData)),
|
|
21
|
+
React.createElement("span", { className: b('text') }, textData)));
|
|
22
|
+
return (React.createElement(RouterLink, { href: url, passHref: true }, Link ? (React.createElement("span", { className: b(null, props.className) }, content)) : (React.createElement("a", Object.assign({ className: b(null, props.className), href: url, title: urlTitle }, linkExtraProps), content))));
|
|
18
23
|
};
|
|
19
24
|
export default Logo;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock,
|
|
1
|
+
import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, MapBlock, MediaBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SliderBlock, TableBlock, TabsBlock, } from './validators/blocks';
|
|
2
2
|
import { BackgroundCard, BasicCard, Divider, MediaCardBlock, PriceDetailedBlock, Quote, } from './validators/sub-blocks';
|
|
3
|
-
export const 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(
|
|
3
|
+
export const 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({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), MapBlock), InfoBlock), TableBlock), TabsBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock), FilterBlock);
|
|
4
4
|
export const cardSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, MediaCardBlock), BannerCard), PriceDetailedBlock), BackgroundCard), Quote), BasicCard);
|
|
5
5
|
export const constructorBlockSchemaNames = [
|
|
6
6
|
'divider',
|
|
@@ -27,7 +27,6 @@ export const constructorBlockSchemaNames = [
|
|
|
27
27
|
'content-layout-block',
|
|
28
28
|
'share-block',
|
|
29
29
|
'filter-block',
|
|
30
|
-
'form-block',
|
|
31
30
|
];
|
|
32
31
|
export const constructorCardSchemaNames = [
|
|
33
32
|
'media-card',
|
package/package.json
CHANGED
|
@@ -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;
|
package/server/models/guards.js
CHANGED
|
@@ -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;
|