@gravity-ui/page-constructor 4.30.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.
Files changed (126) hide show
  1. package/build/cjs/blocks/Banner/schema.d.ts +9 -0
  2. package/build/cjs/blocks/CardLayout/schema.d.ts +12 -0
  3. package/build/cjs/blocks/ContentLayout/schema.d.ts +6 -0
  4. package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +9 -0
  5. package/build/cjs/blocks/FilterBlock/schema.d.ts +12 -0
  6. package/build/cjs/blocks/Form/Form.css +136 -0
  7. package/build/cjs/blocks/Form/Form.d.ts +4 -0
  8. package/build/cjs/blocks/Form/Form.js +61 -0
  9. package/build/cjs/blocks/Form/HubspotInlineForm.d.ts +7 -0
  10. package/build/cjs/blocks/Form/HubspotInlineForm.js +14 -0
  11. package/build/cjs/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
  12. package/build/cjs/blocks/Form/InnerForm/InnerForm.js +28 -0
  13. package/build/cjs/blocks/Form/schema.d.ts +202 -0
  14. package/build/cjs/blocks/Form/schema.js +44 -0
  15. package/build/cjs/blocks/Header/schema.d.ts +3 -0
  16. package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
  17. package/build/cjs/blocks/Icons/schema.d.ts +6 -0
  18. package/build/cjs/blocks/Info/schema.d.ts +6 -0
  19. package/build/cjs/blocks/Map/schema.d.ts +9 -0
  20. package/build/cjs/blocks/Media/schema.d.ts +18 -0
  21. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
  22. package/build/cjs/blocks/Questions/schema.d.ts +6 -0
  23. package/build/cjs/blocks/Slider/schema.d.ts +6 -0
  24. package/build/cjs/blocks/Table/schema.d.ts +3 -0
  25. package/build/cjs/blocks/Tabs/schema.d.ts +12 -0
  26. package/build/cjs/blocks/index.d.ts +1 -0
  27. package/build/cjs/blocks/index.js +3 -1
  28. package/build/cjs/components/Button/Button.d.ts +1 -0
  29. package/build/cjs/components/Button/Button.js +2 -2
  30. package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -17
  31. package/build/cjs/components/YandexForm/YandexForm.js +6 -4
  32. package/build/cjs/components/YandexForm/schema.d.ts +16 -0
  33. package/build/cjs/components/YandexForm/schema.js +13 -0
  34. package/build/cjs/constructor-items.d.ts +1 -0
  35. package/build/cjs/constructor-items.js +1 -0
  36. package/build/cjs/editor/data/templates/form-block.json +20 -0
  37. package/build/cjs/models/constructor-items/blocks.d.ts +31 -4
  38. package/build/cjs/models/constructor-items/blocks.js +13 -1
  39. package/build/cjs/models/constructor-items/common.d.ts +17 -1
  40. package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -0
  41. package/build/cjs/models/guards.d.ts +3 -1
  42. package/build/cjs/models/guards.js +9 -1
  43. package/build/cjs/schema/constants.d.ts +18 -0
  44. package/build/cjs/schema/constants.js +2 -1
  45. package/build/cjs/schema/validators/blocks.d.ts +1 -0
  46. package/build/cjs/schema/validators/blocks.js +1 -0
  47. package/build/cjs/schema/validators/common.d.ts +21 -0
  48. package/build/cjs/schema/validators/common.js +11 -0
  49. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +6 -0
  50. package/build/cjs/sub-blocks/BackgroundCard/schema.js +2 -0
  51. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +6 -0
  52. package/build/cjs/sub-blocks/BasicCard/schema.js +2 -0
  53. package/build/cjs/sub-blocks/Content/schema.d.ts +6 -0
  54. package/build/cjs/sub-blocks/HubspotForm/schema.d.ts +22 -0
  55. package/build/cjs/sub-blocks/HubspotForm/schema.js +17 -0
  56. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +3 -0
  57. package/build/cjs/sub-blocks/Quote/Quote.js +2 -2
  58. package/build/cjs/sub-blocks/Quote/schema.d.ts +3 -0
  59. package/build/cjs/sub-blocks/Quote/schema.js +2 -0
  60. package/build/esm/blocks/Banner/schema.d.ts +9 -0
  61. package/build/esm/blocks/CardLayout/schema.d.ts +12 -0
  62. package/build/esm/blocks/ContentLayout/schema.d.ts +6 -0
  63. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +9 -0
  64. package/build/esm/blocks/FilterBlock/schema.d.ts +12 -0
  65. package/build/esm/blocks/Form/Form.css +136 -0
  66. package/build/esm/blocks/Form/Form.d.ts +5 -0
  67. package/build/esm/blocks/Form/Form.js +59 -0
  68. package/build/esm/blocks/Form/HubspotInlineForm.d.ts +7 -0
  69. package/build/esm/blocks/Form/HubspotInlineForm.js +12 -0
  70. package/build/esm/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
  71. package/build/esm/blocks/Form/InnerForm/InnerForm.js +26 -0
  72. package/build/esm/blocks/Form/schema.d.ts +202 -0
  73. package/build/esm/blocks/Form/schema.js +40 -0
  74. package/build/esm/blocks/Header/schema.d.ts +3 -0
  75. package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
  76. package/build/esm/blocks/Icons/schema.d.ts +6 -0
  77. package/build/esm/blocks/Info/schema.d.ts +6 -0
  78. package/build/esm/blocks/Map/schema.d.ts +9 -0
  79. package/build/esm/blocks/Media/schema.d.ts +18 -0
  80. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
  81. package/build/esm/blocks/Questions/schema.d.ts +6 -0
  82. package/build/esm/blocks/Slider/schema.d.ts +6 -0
  83. package/build/esm/blocks/Table/schema.d.ts +3 -0
  84. package/build/esm/blocks/Tabs/schema.d.ts +12 -0
  85. package/build/esm/blocks/index.d.ts +1 -0
  86. package/build/esm/blocks/index.js +1 -0
  87. package/build/esm/components/Button/Button.d.ts +1 -0
  88. package/build/esm/components/Button/Button.js +2 -2
  89. package/build/esm/components/YandexForm/YandexForm.d.ts +2 -17
  90. package/build/esm/components/YandexForm/YandexForm.js +5 -3
  91. package/build/esm/components/YandexForm/schema.d.ts +16 -0
  92. package/build/esm/components/YandexForm/schema.js +10 -0
  93. package/build/esm/constructor-items.d.ts +1 -0
  94. package/build/esm/constructor-items.js +2 -1
  95. package/build/esm/editor/data/templates/form-block.json +20 -0
  96. package/build/esm/models/constructor-items/blocks.d.ts +31 -4
  97. package/build/esm/models/constructor-items/blocks.js +12 -0
  98. package/build/esm/models/constructor-items/common.d.ts +17 -1
  99. package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -0
  100. package/build/esm/models/guards.d.ts +3 -1
  101. package/build/esm/models/guards.js +7 -1
  102. package/build/esm/schema/constants.d.ts +18 -0
  103. package/build/esm/schema/constants.js +3 -2
  104. package/build/esm/schema/validators/blocks.d.ts +1 -0
  105. package/build/esm/schema/validators/blocks.js +1 -0
  106. package/build/esm/schema/validators/common.d.ts +21 -0
  107. package/build/esm/schema/validators/common.js +11 -0
  108. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +6 -0
  109. package/build/esm/sub-blocks/BackgroundCard/schema.js +2 -0
  110. package/build/esm/sub-blocks/BasicCard/schema.d.ts +6 -0
  111. package/build/esm/sub-blocks/BasicCard/schema.js +2 -0
  112. package/build/esm/sub-blocks/Content/schema.d.ts +6 -0
  113. package/build/esm/sub-blocks/HubspotForm/schema.d.ts +22 -0
  114. package/build/esm/sub-blocks/HubspotForm/schema.js +14 -0
  115. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +3 -0
  116. package/build/esm/sub-blocks/Quote/Quote.js +2 -2
  117. package/build/esm/sub-blocks/Quote/schema.d.ts +3 -0
  118. package/build/esm/sub-blocks/Quote/schema.js +2 -0
  119. package/package.json +1 -1
  120. package/server/models/constructor-items/blocks.d.ts +31 -4
  121. package/server/models/constructor-items/blocks.js +13 -1
  122. package/server/models/constructor-items/common.d.ts +17 -1
  123. package/server/models/constructor-items/sub-blocks.d.ts +2 -0
  124. package/server/models/guards.d.ts +3 -1
  125. package/server/models/guards.js +9 -1
  126. package/widget/index.js +1 -1
@@ -1,20 +1,5 @@
1
- import { PixelEvent } from '../../models';
2
- import { AnalyticsEventsBase } from '../../models/common';
1
+ import { YandexFormProps } from '../../models';
3
2
  export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
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
- }
3
+ export declare const YANDEX_FORM_SECTION = "surveys";
19
4
  declare const YandexForm: (props: YandexFormProps) => JSX.Element;
20
5
  export default YandexForm;
@@ -7,13 +7,15 @@ 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';
10
11
  const CONTAINER_ID = 'pc-yandex-form-container';
11
12
  const b = block('yandex-form');
12
13
  const YandexForm = (props) => {
13
- const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
14
+ const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, customFormSection, } = props;
14
15
  const formContainerRef = useRef(null);
15
16
  const iframeRef = useRef();
16
17
  const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;
18
+ const yaFormSection = customFormSection || YANDEX_FORM_SECTION;
17
19
  const handleMetrika = useMetrika();
18
20
  const handleAnalytics = useAnalytics(DefaultEventNames.YandexFormSubmit);
19
21
  const isMobile = useContext(MobileContext);
@@ -35,7 +37,7 @@ const YandexForm = (props) => {
35
37
  queryParams.set(param, params[param]);
36
38
  });
37
39
  }
38
- const src = `${yaFormOrigin}/surveys/${id}/?${queryParams}`;
40
+ const src = `${yaFormOrigin}/${yaFormSection}/${id}/?${queryParams}`;
39
41
  if (iframeRef.current) {
40
42
  iframeRef.current.src = src;
41
43
  }
@@ -50,7 +52,7 @@ const YandexForm = (props) => {
50
52
  iframeRef.current.width = '100%';
51
53
  container.appendChild(iframeRef.current);
52
54
  }
53
- }, [locale.lang, theme, isMobile, yaFormOrigin, id, containerId, params]);
55
+ }, [locale.lang, theme, isMobile, yaFormOrigin, yaFormSection, id, containerId, params]);
54
56
  const handleSubmit = useCallback(() => {
55
57
  if (formContainerRef && formContainerRef.current) {
56
58
  const { top } = formContainerRef.current.getBoundingClientRect();
@@ -0,0 +1,16 @@
1
+ export declare const YandexFormProps: {
2
+ type: string;
3
+ required: string[];
4
+ properties: {
5
+ id: {
6
+ type: string;
7
+ };
8
+ containerId: {
9
+ type: string;
10
+ };
11
+ type: {};
12
+ when: {
13
+ type: string;
14
+ };
15
+ };
16
+ };
@@ -0,0 +1,10 @@
1
+ import { BaseProps } from '../../schema/validators/common';
2
+ export const YandexFormProps = {
3
+ type: 'object',
4
+ required: ['id'],
5
+ properties: Object.assign(Object.assign({}, BaseProps), { id: {
6
+ type: 'string',
7
+ }, containerId: {
8
+ type: 'string',
9
+ } }),
10
+ };
@@ -17,6 +17,7 @@ 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>;
20
21
  };
21
22
  export declare const subBlockMap: {
22
23
  divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, MapBlock, MediaBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SliderBlock, TableBlock, TabsBlock, } from './blocks';
1
+ import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, FormBlock, 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,6 +22,7 @@ export const blockMap = {
22
22
  [BlockType.ShareBlock]: ShareBlock,
23
23
  [BlockType.MapBlock]: MapBlock,
24
24
  [BlockType.FilterBlock]: FilterBlock,
25
+ [BlockType.FormBlock]: FormBlock,
25
26
  };
26
27
  export const subBlockMap = {
27
28
  [SubBlockType.Divider]: Divider,
@@ -0,0 +1,20 @@
1
+ {
2
+ "template": {
3
+ "type": "form-block",
4
+ "formData": {
5
+ "yandex": {
6
+ "hash": "hashString",
7
+ "title": ""
8
+ }
9
+ },
10
+ "direction": "center",
11
+ "textContent": {
12
+ "title": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
13
+ "text": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
14
+ },
15
+ "image": {
16
+ "src": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-mini_4-12_light.png"
17
+ },
18
+ "backgroundColor": "#262626"
19
+ }
20
+ }
@@ -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 BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
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 {};
@@ -18,6 +18,7 @@ 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";
21
22
  })(BlockType || (BlockType = {}));
22
23
  export const BlockTypes = Object.values(BlockType);
23
24
  export const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];
@@ -41,3 +42,14 @@ export var PCShareSocialNetwork;
41
42
  PCShareSocialNetwork["Facebook"] = "facebook";
42
43
  PCShareSocialNetwork["LinkedIn"] = "linkedin";
43
44
  })(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, 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 {};
@@ -67,6 +67,7 @@ export interface QuoteProps extends Themable, CardBaseProps {
67
67
  logo: ImageProps;
68
68
  color?: string;
69
69
  url?: string;
70
+ urlTitle?: string;
70
71
  author?: AuthorItem;
71
72
  buttonText?: string;
72
73
  theme?: TextTheme;
@@ -81,6 +82,7 @@ export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase,
81
82
  }
82
83
  export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
83
84
  url: string;
85
+ urlTitle?: string;
84
86
  icon?: ImageProps;
85
87
  target?: string;
86
88
  iconPosition?: IconPosition;
@@ -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;
@@ -1,7 +1,13 @@
1
- import { BlockTypes } from './';
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
+ }
@@ -8,6 +8,9 @@ export declare const cardSchemas: {
8
8
  url: {
9
9
  type: string;
10
10
  };
11
+ urlTitle: {
12
+ type: string;
13
+ };
11
14
  icon: {
12
15
  oneOf: ({
13
16
  type: string;
@@ -52,6 +55,9 @@ export declare const cardSchemas: {
52
55
  url: {
53
56
  type: string;
54
57
  };
58
+ urlTitle: {
59
+ type: string;
60
+ };
55
61
  resetMargin: {
56
62
  type: string;
57
63
  };
@@ -163,6 +169,9 @@ export declare const cardSchemas: {
163
169
  url: {
164
170
  type: string;
165
171
  };
172
+ urlTitle: {
173
+ type: string;
174
+ };
166
175
  buttonText: {
167
176
  type: string;
168
177
  };
@@ -219,6 +228,9 @@ export declare const cardSchemas: {
219
228
  url: {
220
229
  type: string;
221
230
  };
231
+ urlTitle: {
232
+ type: string;
233
+ };
222
234
  background: {
223
235
  oneOf: (({
224
236
  type: string;
@@ -376,6 +388,9 @@ export declare const cardSchemas: {
376
388
  url: {
377
389
  type: string;
378
390
  };
391
+ urlTitle: {
392
+ type: string;
393
+ };
379
394
  resetMargin: {
380
395
  type: string;
381
396
  };
@@ -593,6 +608,9 @@ export declare const cardSchemas: {
593
608
  url: {
594
609
  type: string;
595
610
  };
611
+ urlTitle: {
612
+ type: string;
613
+ };
596
614
  primary: {
597
615
  type: string;
598
616
  };
@@ -1,6 +1,6 @@
1
- import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, HeaderBlock, HeaderSliderBlock, IconsBlock, InfoBlock, MapBlock, MediaBlock, PromoFeaturesBlock, QuestionsBlock, ShareBlock, SliderBlock, TableBlock, TabsBlock, } from './validators/blocks';
1
+ import { BannerBlock, BannerCard, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, ExtendedFeaturesBlock, FilterBlock, FormBlock, 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({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), MapBlock), InfoBlock), TableBlock), TabsBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock), FilterBlock);
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(Object.assign({}, Divider), ExtendedFeaturesBlock), PromoFeaturesBlock), SliderBlock), QuestionsBlock), HeaderBlock), BannerBlock), CompaniesBlock), MediaBlock), MapBlock), InfoBlock), TableBlock), TabsBlock), HeaderSliderBlock), IconsBlock), CardLayoutBlock), ContentLayoutBlock), ShareBlock), FilterBlock), FormBlock);
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,6 +27,7 @@ export const constructorBlockSchemaNames = [
27
27
  'content-layout-block',
28
28
  'share-block',
29
29
  'filter-block',
30
+ 'form-block',
30
31
  ];
31
32
  export const constructorCardSchemaNames = [
32
33
  'media-card',
@@ -16,3 +16,4 @@ export * from '../../blocks/CardLayout/schema';
16
16
  export * from '../../blocks/ContentLayout/schema';
17
17
  export * from '../../blocks/Share/schema';
18
18
  export * from '../../blocks/FilterBlock/schema';
19
+ export * from '../../blocks/Form/schema';
@@ -16,3 +16,4 @@ export * from '../../blocks/CardLayout/schema';
16
16
  export * from '../../blocks/ContentLayout/schema';
17
17
  export * from '../../blocks/Share/schema';
18
18
  export * from '../../blocks/FilterBlock/schema';
19
+ export * from '../../blocks/Form/schema';
@@ -377,6 +377,9 @@ export declare const LinkProps: {
377
377
  url: {
378
378
  type: string;
379
379
  };
380
+ urlTitle: {
381
+ type: string;
382
+ };
380
383
  arrow: {
381
384
  type: string;
382
385
  };
@@ -545,6 +548,9 @@ export declare const ButtonProps: {
545
548
  url: {
546
549
  type: string;
547
550
  };
551
+ urlTitle: {
552
+ type: string;
553
+ };
548
554
  primary: {
549
555
  type: string;
550
556
  };
@@ -796,6 +802,9 @@ export declare const AnchorProps: {
796
802
  url: {
797
803
  type: string;
798
804
  };
805
+ urlTitle: {
806
+ type: string;
807
+ };
799
808
  };
800
809
  };
801
810
  export declare const BlockBaseProps: {
@@ -811,6 +820,9 @@ export declare const BlockBaseProps: {
811
820
  url: {
812
821
  type: string;
813
822
  };
823
+ urlTitle: {
824
+ type: string;
825
+ };
814
826
  };
815
827
  };
816
828
  visible: {
@@ -844,6 +856,9 @@ export declare const TitleProps: {
844
856
  url: {
845
857
  type: string;
846
858
  };
859
+ urlTitle: {
860
+ type: string;
861
+ };
847
862
  resetMargin: {
848
863
  type: string;
849
864
  };
@@ -860,6 +875,9 @@ export declare const ButtonBlock: {
860
875
  url: {
861
876
  type: string;
862
877
  };
878
+ urlTitle: {
879
+ type: string;
880
+ };
863
881
  primary: {
864
882
  type: string;
865
883
  };
@@ -1464,6 +1482,9 @@ export declare const BlockHeaderProps: {
1464
1482
  url: {
1465
1483
  type: string;
1466
1484
  };
1485
+ urlTitle: {
1486
+ type: string;
1487
+ };
1467
1488
  resetMargin: {
1468
1489
  type: string;
1469
1490
  };
@@ -208,6 +208,8 @@ export const LinkProps = {
208
208
  contentType: 'text',
209
209
  }, url: {
210
210
  type: 'string',
211
+ }, urlTitle: {
212
+ type: 'string',
211
213
  }, arrow: {
212
214
  type: 'boolean',
213
215
  }, theme: {
@@ -283,6 +285,9 @@ export const ButtonProps = {
283
285
  url: {
284
286
  type: 'string',
285
287
  },
288
+ urlTitle: {
289
+ type: 'string',
290
+ },
286
291
  primary: {
287
292
  type: 'boolean',
288
293
  },
@@ -436,6 +441,9 @@ export const AnchorProps = {
436
441
  url: {
437
442
  type: 'string',
438
443
  },
444
+ urlTitle: {
445
+ type: 'string',
446
+ },
439
447
  },
440
448
  };
441
449
  export const BlockBaseProps = Object.assign(Object.assign({}, BaseProps), { anchor: AnchorProps, visible: {
@@ -462,6 +470,9 @@ export const TitleProps = {
462
470
  url: {
463
471
  type: 'string',
464
472
  },
473
+ urlTitle: {
474
+ type: 'string',
475
+ },
465
476
  resetMargin: {
466
477
  type: 'boolean',
467
478
  },
@@ -6,6 +6,9 @@ export declare const BackgroundCard: {
6
6
  url: {
7
7
  type: string;
8
8
  };
9
+ urlTitle: {
10
+ type: string;
11
+ };
9
12
  background: {
10
13
  oneOf: (({
11
14
  type: string;
@@ -163,6 +166,9 @@ export declare const BackgroundCard: {
163
166
  url: {
164
167
  type: string;
165
168
  };
169
+ urlTitle: {
170
+ type: string;
171
+ };
166
172
  resetMargin: {
167
173
  type: string;
168
174
  };
@@ -10,6 +10,8 @@ export const BackgroundCard = {
10
10
  required: ['title', 'text'],
11
11
  properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BaseProps), CardBase), BackgroundCardContentProps), { url: {
12
12
  type: 'string',
13
+ }, urlTitle: {
14
+ type: 'string',
13
15
  }, background: withTheme(ImageObjectProps), backgroundColor: {
14
16
  type: 'string',
15
17
  }, paddingBottom: {
@@ -6,6 +6,9 @@ export declare const BasicCard: {
6
6
  url: {
7
7
  type: string;
8
8
  };
9
+ urlTitle: {
10
+ type: string;
11
+ };
9
12
  icon: {
10
13
  oneOf: ({
11
14
  type: string;
@@ -50,6 +53,9 @@ export declare const BasicCard: {
50
53
  url: {
51
54
  type: string;
52
55
  };
56
+ urlTitle: {
57
+ type: string;
58
+ };
53
59
  resetMargin: {
54
60
  type: string;
55
61
  };
@@ -9,6 +9,8 @@ export const BasicCard = {
9
9
  required: [],
10
10
  properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BaseProps), CardBase), BasicCardContentProps), { url: {
11
11
  type: 'string',
12
+ }, urlTitle: {
13
+ type: 'string',
12
14
  }, icon: ImageProps, target: {
13
15
  type: 'string',
14
16
  enum: ['_blank', '_parent', '_top', '_self'],
@@ -59,6 +59,9 @@ export declare const ContentBase: {
59
59
  url: {
60
60
  type: string;
61
61
  };
62
+ urlTitle: {
63
+ type: string;
64
+ };
62
65
  resetMargin: {
63
66
  type: string;
64
67
  };
@@ -147,6 +150,9 @@ export declare const ContentBlock: {
147
150
  url: {
148
151
  type: string;
149
152
  };
153
+ urlTitle: {
154
+ type: string;
155
+ };
150
156
  resetMargin: {
151
157
  type: string;
152
158
  };
@@ -0,0 +1,22 @@
1
+ export declare const HubspotFormProps: {
2
+ type: string;
3
+ required: string[];
4
+ properties: {
5
+ region: {
6
+ type: string;
7
+ };
8
+ portalId: {
9
+ type: string;
10
+ };
11
+ formId: {
12
+ type: string;
13
+ };
14
+ formInstanceId: {
15
+ type: string;
16
+ };
17
+ type: {};
18
+ when: {
19
+ type: string;
20
+ };
21
+ };
22
+ };
@@ -0,0 +1,14 @@
1
+ import { BaseProps } from '../../schema/validators/common';
2
+ export const HubspotFormProps = {
3
+ type: 'object',
4
+ required: ['portalId', 'formId'],
5
+ properties: Object.assign(Object.assign({}, BaseProps), { region: {
6
+ type: 'string',
7
+ }, portalId: {
8
+ type: 'string',
9
+ }, formId: {
10
+ type: 'string',
11
+ }, formInstanceId: {
12
+ type: 'string',
13
+ } }),
14
+ };
@@ -270,6 +270,9 @@ export declare const LayoutItem: {
270
270
  url: {
271
271
  type: string;
272
272
  };
273
+ urlTitle: {
274
+ type: string;
275
+ };
273
276
  resetMargin: {
274
277
  type: string;
275
278
  };
@@ -9,7 +9,7 @@ import { block, getThemedValue } from '../../utils';
9
9
  import './Quote.css';
10
10
  const b = block('quote');
11
11
  const Quote = (props) => {
12
- const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, buttonText, quoteType = QuoteType.Chevron, } = props;
12
+ const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, urlTitle, buttonText, quoteType = QuoteType.Chevron, } = props;
13
13
  const theme = useTheme();
14
14
  const imageThemed = getThemedValue(image, theme);
15
15
  const imageData = getMediaImage(imageThemed);
@@ -17,7 +17,7 @@ const Quote = (props) => {
17
17
  const handleButtonClick = useCallback(() => handleAnalytics(), [handleAnalytics]);
18
18
  const renderFooter = Boolean(author || url) && (React.createElement("div", { className: b('author-wrapper') },
19
19
  author && (React.createElement(Author, { className: b('author', { theme: textTheme }), author: author, type: AuthorType.Line })),
20
- url && buttonText && (React.createElement(Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick }, buttonText))));
20
+ url && buttonText && (React.createElement(Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick, title: urlTitle }, buttonText))));
21
21
  const logoProps = getMediaImage(logo);
22
22
  return (React.createElement("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {} },
23
23
  React.createElement("div", { key: text, className: b('content-wrapper') },
@@ -51,6 +51,9 @@ export declare const Quote: {
51
51
  url: {
52
52
  type: string;
53
53
  };
54
+ urlTitle: {
55
+ type: string;
56
+ };
54
57
  buttonText: {
55
58
  type: string;
56
59
  };