@gravity-ui/page-constructor 4.29.0 → 4.29.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 (140) 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/Header.js +2 -2
  16. package/build/cjs/blocks/Header/schema.d.ts +3 -0
  17. package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
  18. package/build/cjs/blocks/Icons/schema.d.ts +6 -0
  19. package/build/cjs/blocks/Info/schema.d.ts +6 -0
  20. package/build/cjs/blocks/Map/schema.d.ts +9 -0
  21. package/build/cjs/blocks/Media/schema.d.ts +18 -0
  22. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
  23. package/build/cjs/blocks/Questions/schema.d.ts +6 -0
  24. package/build/cjs/blocks/Slider/schema.d.ts +6 -0
  25. package/build/cjs/blocks/Table/schema.d.ts +3 -0
  26. package/build/cjs/blocks/Tabs/schema.d.ts +12 -0
  27. package/build/cjs/blocks/index.d.ts +1 -0
  28. package/build/cjs/blocks/index.js +3 -1
  29. package/build/cjs/components/Button/Button.d.ts +1 -0
  30. package/build/cjs/components/Button/Button.js +2 -2
  31. package/build/cjs/components/Media/Image/Image.js +4 -4
  32. package/build/cjs/components/ReactPlayer/ReactPlayer.d.ts +1 -2
  33. package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -17
  34. package/build/cjs/components/YandexForm/YandexForm.js +6 -4
  35. package/build/cjs/components/YandexForm/schema.d.ts +16 -0
  36. package/build/cjs/components/YandexForm/schema.js +13 -0
  37. package/build/cjs/constructor-items.d.ts +1 -0
  38. package/build/cjs/constructor-items.js +1 -0
  39. package/build/cjs/editor/data/templates/form-block.json +20 -0
  40. package/build/cjs/models/components.d.ts +1 -2
  41. package/build/cjs/models/constructor-items/blocks.d.ts +33 -5
  42. package/build/cjs/models/constructor-items/blocks.js +13 -1
  43. package/build/cjs/models/constructor-items/common.d.ts +21 -1
  44. package/build/cjs/models/constructor-items/common.js +6 -1
  45. package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -1
  46. package/build/cjs/models/guards.d.ts +3 -1
  47. package/build/cjs/models/guards.js +9 -1
  48. package/build/cjs/schema/constants.d.ts +22 -0
  49. package/build/cjs/schema/constants.js +2 -1
  50. package/build/cjs/schema/validators/blocks.d.ts +1 -0
  51. package/build/cjs/schema/validators/blocks.js +1 -0
  52. package/build/cjs/schema/validators/common.d.ts +23 -1
  53. package/build/cjs/schema/validators/common.js +13 -1
  54. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +6 -0
  55. package/build/cjs/sub-blocks/BackgroundCard/schema.js +2 -0
  56. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +6 -0
  57. package/build/cjs/sub-blocks/BasicCard/schema.js +2 -0
  58. package/build/cjs/sub-blocks/Content/schema.d.ts +6 -0
  59. package/build/cjs/sub-blocks/HubspotForm/schema.d.ts +22 -0
  60. package/build/cjs/sub-blocks/HubspotForm/schema.js +17 -0
  61. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +3 -0
  62. package/build/cjs/sub-blocks/Quote/Quote.css +12 -3
  63. package/build/cjs/sub-blocks/Quote/Quote.js +3 -3
  64. package/build/cjs/sub-blocks/Quote/schema.d.ts +7 -0
  65. package/build/cjs/sub-blocks/Quote/schema.js +6 -1
  66. package/build/esm/blocks/Banner/schema.d.ts +9 -0
  67. package/build/esm/blocks/CardLayout/schema.d.ts +12 -0
  68. package/build/esm/blocks/ContentLayout/schema.d.ts +6 -0
  69. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +9 -0
  70. package/build/esm/blocks/FilterBlock/schema.d.ts +12 -0
  71. package/build/esm/blocks/Form/Form.css +136 -0
  72. package/build/esm/blocks/Form/Form.d.ts +5 -0
  73. package/build/esm/blocks/Form/Form.js +59 -0
  74. package/build/esm/blocks/Form/HubspotInlineForm.d.ts +7 -0
  75. package/build/esm/blocks/Form/HubspotInlineForm.js +12 -0
  76. package/build/esm/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
  77. package/build/esm/blocks/Form/InnerForm/InnerForm.js +26 -0
  78. package/build/esm/blocks/Form/schema.d.ts +202 -0
  79. package/build/esm/blocks/Form/schema.js +40 -0
  80. package/build/esm/blocks/Header/Header.js +2 -2
  81. package/build/esm/blocks/Header/schema.d.ts +3 -0
  82. package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
  83. package/build/esm/blocks/Icons/schema.d.ts +6 -0
  84. package/build/esm/blocks/Info/schema.d.ts +6 -0
  85. package/build/esm/blocks/Map/schema.d.ts +9 -0
  86. package/build/esm/blocks/Media/schema.d.ts +18 -0
  87. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
  88. package/build/esm/blocks/Questions/schema.d.ts +6 -0
  89. package/build/esm/blocks/Slider/schema.d.ts +6 -0
  90. package/build/esm/blocks/Table/schema.d.ts +3 -0
  91. package/build/esm/blocks/Tabs/schema.d.ts +12 -0
  92. package/build/esm/blocks/index.d.ts +1 -0
  93. package/build/esm/blocks/index.js +1 -0
  94. package/build/esm/components/Button/Button.d.ts +1 -0
  95. package/build/esm/components/Button/Button.js +2 -2
  96. package/build/esm/components/Media/Image/Image.js +1 -1
  97. package/build/esm/components/ReactPlayer/ReactPlayer.d.ts +1 -2
  98. package/build/esm/components/YandexForm/YandexForm.d.ts +2 -17
  99. package/build/esm/components/YandexForm/YandexForm.js +5 -3
  100. package/build/esm/components/YandexForm/schema.d.ts +16 -0
  101. package/build/esm/components/YandexForm/schema.js +10 -0
  102. package/build/esm/constructor-items.d.ts +1 -0
  103. package/build/esm/constructor-items.js +2 -1
  104. package/build/esm/editor/data/templates/form-block.json +20 -0
  105. package/build/esm/models/components.d.ts +1 -2
  106. package/build/esm/models/constructor-items/blocks.d.ts +33 -5
  107. package/build/esm/models/constructor-items/blocks.js +12 -0
  108. package/build/esm/models/constructor-items/common.d.ts +21 -1
  109. package/build/esm/models/constructor-items/common.js +5 -0
  110. package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -1
  111. package/build/esm/models/guards.d.ts +3 -1
  112. package/build/esm/models/guards.js +7 -1
  113. package/build/esm/schema/constants.d.ts +22 -0
  114. package/build/esm/schema/constants.js +3 -2
  115. package/build/esm/schema/validators/blocks.d.ts +1 -0
  116. package/build/esm/schema/validators/blocks.js +1 -0
  117. package/build/esm/schema/validators/common.d.ts +23 -1
  118. package/build/esm/schema/validators/common.js +13 -1
  119. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +6 -0
  120. package/build/esm/sub-blocks/BackgroundCard/schema.js +2 -0
  121. package/build/esm/sub-blocks/BasicCard/schema.d.ts +6 -0
  122. package/build/esm/sub-blocks/BasicCard/schema.js +2 -0
  123. package/build/esm/sub-blocks/Content/schema.d.ts +6 -0
  124. package/build/esm/sub-blocks/HubspotForm/schema.d.ts +22 -0
  125. package/build/esm/sub-blocks/HubspotForm/schema.js +14 -0
  126. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +3 -0
  127. package/build/esm/sub-blocks/Quote/Quote.css +12 -3
  128. package/build/esm/sub-blocks/Quote/Quote.js +4 -4
  129. package/build/esm/sub-blocks/Quote/schema.d.ts +7 -0
  130. package/build/esm/sub-blocks/Quote/schema.js +7 -2
  131. package/package.json +2 -2
  132. package/server/models/components.d.ts +1 -2
  133. package/server/models/constructor-items/blocks.d.ts +33 -5
  134. package/server/models/constructor-items/blocks.js +13 -1
  135. package/server/models/constructor-items/common.d.ts +21 -1
  136. package/server/models/constructor-items/common.js +6 -1
  137. package/server/models/constructor-items/sub-blocks.d.ts +4 -1
  138. package/server/models/guards.d.ts +3 -1
  139. package/server/models/guards.js +9 -1
  140. package/widget/index.js +1 -1
@@ -83,6 +83,9 @@ export declare const ContentLayoutBlock: {
83
83
  url: {
84
84
  type: string;
85
85
  };
86
+ urlTitle: {
87
+ type: string;
88
+ };
86
89
  resetMargin: {
87
90
  type: string;
88
91
  };
@@ -224,6 +227,9 @@ export declare const ContentLayoutBlock: {
224
227
  url: {
225
228
  type: string;
226
229
  };
230
+ urlTitle: {
231
+ type: string;
232
+ };
227
233
  };
228
234
  };
229
235
  visible: {
@@ -26,6 +26,9 @@ export declare const ExtendedFeaturesItem: {
26
26
  url: {
27
27
  type: string;
28
28
  };
29
+ urlTitle: {
30
+ type: string;
31
+ };
29
32
  arrow: {
30
33
  type: string;
31
34
  };
@@ -196,6 +199,9 @@ export declare const ExtendedFeaturesBlock: {
196
199
  url: {
197
200
  type: string;
198
201
  };
202
+ urlTitle: {
203
+ type: string;
204
+ };
199
205
  resetMargin: {
200
206
  type: string;
201
207
  };
@@ -222,6 +228,9 @@ export declare const ExtendedFeaturesBlock: {
222
228
  url: {
223
229
  type: string;
224
230
  };
231
+ urlTitle: {
232
+ type: string;
233
+ };
225
234
  };
226
235
  };
227
236
  visible: {
@@ -90,6 +90,9 @@ export declare const FilterProps: {
90
90
  url: {
91
91
  type: string;
92
92
  };
93
+ urlTitle: {
94
+ type: string;
95
+ };
93
96
  resetMargin: {
94
97
  type: string;
95
98
  };
@@ -116,6 +119,9 @@ export declare const FilterProps: {
116
119
  url: {
117
120
  type: string;
118
121
  };
122
+ urlTitle: {
123
+ type: string;
124
+ };
119
125
  };
120
126
  };
121
127
  visible: {
@@ -200,6 +206,9 @@ export declare const FilterBlock: {
200
206
  url: {
201
207
  type: string;
202
208
  };
209
+ urlTitle: {
210
+ type: string;
211
+ };
203
212
  resetMargin: {
204
213
  type: string;
205
214
  };
@@ -226,6 +235,9 @@ export declare const FilterBlock: {
226
235
  url: {
227
236
  type: string;
228
237
  };
238
+ urlTitle: {
239
+ type: string;
240
+ };
229
241
  };
230
242
  };
231
243
  visible: {
@@ -0,0 +1,136 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
3
+ .pc-form-block {
4
+ border-radius: 32px;
5
+ position: relative;
6
+ }
7
+ .pc-form-block__title {
8
+ margin: 0 0 24px 10px;
9
+ }
10
+ .pc-form-block__title_mobile {
11
+ margin-left: 4px;
12
+ }
13
+ .pc-form-block__full-form {
14
+ background-color: var(--g-color-base-background);
15
+ padding: 48px 64px 48px calc(64px - 10px);
16
+ border-radius: var(--pc-border-radius);
17
+ }
18
+ .pc-form-block__media {
19
+ position: absolute;
20
+ top: 0;
21
+ left: 0;
22
+ bottom: 0;
23
+ right: 0;
24
+ border-radius: 32px;
25
+ }
26
+ .pc-form-block__image {
27
+ height: 100%;
28
+ width: 100%;
29
+ object-fit: cover;
30
+ }
31
+ .pc-form-block__row_direction_form-content {
32
+ flex-direction: row-reverse;
33
+ }
34
+ .pc-form-block__row_direction_center {
35
+ padding-top: 64px;
36
+ padding-bottom: 48px;
37
+ flex-direction: column;
38
+ }
39
+ .pc-form-block__row_direction_center .pc-form-block__content-wrapper {
40
+ margin-bottom: 32px;
41
+ }
42
+ .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__full-form {
43
+ box-shadow: 0 4px 24px var(--pc-color-sfx-shadow), 0 2px 8px var(--pc-color-sfx-shadow);
44
+ }
45
+ .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row_direction_form-content .pc-form-block__content-wrapper {
46
+ padding: 48px 0 64px 64px;
47
+ }
48
+ .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row_direction_content-form .pc-form-block__content-wrapper {
49
+ padding: 48px 64px 64px 0;
50
+ }
51
+ .pc-form-block_with-background .pc-form-block__row_direction_form-content .pc-form-block__form-wrapper {
52
+ padding: 16px 0 24px 16px;
53
+ }
54
+ .pc-form-block_with-background .pc-form-block__row_direction_content-form .pc-form-block__form-wrapper {
55
+ padding: 16px 16px 24px 0;
56
+ }
57
+ .pc-form-block_with-background .pc-form-block__row_direction_form-content .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_content-form .pc-form-block__content-wrapper {
58
+ padding: 64px;
59
+ }
60
+ @media (min-width: 1081px) {
61
+ .pc-form-block_form-type_yandex .pc-form-block__row_direction_form-content .pc-form-block__content-col, .pc-form-block_form-type_yandex .pc-form-block__row_direction_content-form .pc-form-block__content-col {
62
+ flex: 1 0 0;
63
+ }
64
+ .pc-form-block_form-type_yandex .pc-form-block__row_direction_form-content .pc-form-block__form, .pc-form-block_form-type_yandex .pc-form-block__row_direction_content-form .pc-form-block__form, .pc-form-block_form-type_yandex .pc-form-block__row_direction_center .pc-form-block__form {
65
+ min-width: 475px;
66
+ }
67
+ .pc-form-block_form-type_yandex .pc-form-block__row_direction_form-content .pc-form-block__form-col, .pc-form-block_form-type_yandex .pc-form-block__row_direction_content-form .pc-form-block__form-col, .pc-form-block_form-type_yandex .pc-form-block__row_direction_center .pc-form-block__form-col {
68
+ max-width: initial;
69
+ width: fit-content;
70
+ }
71
+ }
72
+ @media (max-width: 1081px) and (min-width: 769px) {
73
+ .pc-form-block__row {
74
+ flex-direction: column;
75
+ }
76
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__form-wrapper,
77
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__content-wrapper, .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__form-wrapper,
78
+ .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__content-wrapper {
79
+ max-width: 609px;
80
+ }
81
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__center,
82
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__form-wrapper,
83
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__content-wrapper, .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__center,
84
+ .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__form-wrapper,
85
+ .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__content-wrapper {
86
+ margin: 0 auto;
87
+ padding-right: 0;
88
+ padding-left: 0;
89
+ }
90
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__form-wrapper, .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__form-wrapper {
91
+ padding-top: 0;
92
+ }
93
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__content-wrapper, .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__content-wrapper {
94
+ text-align: center;
95
+ padding-bottom: 32px;
96
+ }
97
+ .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__content-wrapper {
98
+ padding: 0 0 32px 0;
99
+ }
100
+ }
101
+ @media (max-width: 769px) {
102
+ .pc-form-block__full-form {
103
+ padding: 32px;
104
+ }
105
+ .pc-form-block_with-background .pc-form-block__row, .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row {
106
+ padding: 0;
107
+ }
108
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__form-wrapper,
109
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__content-wrapper, .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__form-wrapper,
110
+ .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__content-wrapper {
111
+ padding: 0;
112
+ }
113
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__content-wrapper, .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__content-wrapper {
114
+ padding-bottom: 32px;
115
+ margin-bottom: 0;
116
+ }
117
+ .pc-form-block_with-background {
118
+ padding: 0 8px;
119
+ }
120
+ .pc-form-block_with-background .pc-form-block__row {
121
+ padding-top: 48px;
122
+ }
123
+ .pc-form-block_with-background .pc-form-block__row_padding-bottom_m {
124
+ padding-bottom: 32px;
125
+ }
126
+ .pc-form-block_with-background .pc-form-block__row_padding-bottom_l {
127
+ padding-bottom: 48px;
128
+ }
129
+ .pc-form-block_with-background .pc-form-block__row_direction_form-content .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_content-form .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_center .pc-form-block__content-wrapper {
130
+ padding-right: 16px;
131
+ padding-left: 16px;
132
+ }
133
+ .pc-form-block_with-background .pc-form-block__row_direction_form-content, .pc-form-block_with-background .pc-form-block__row_direction_content-form {
134
+ padding-top: 32px;
135
+ }
136
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { FormBlockProps } from '../../models';
3
+ import './Form.css';
4
+ declare const FormBlock: React.FC<FormBlockProps>;
5
+ export default FormBlock;
@@ -0,0 +1,59 @@
1
+ import React, { useCallback, useContext, useMemo, useState } from 'react';
2
+ import { BackgroundImage, Title } from '../../components';
3
+ import { MobileContext } from '../../context/mobileContext';
4
+ import { Col, Grid, GridAlignItems, GridColumnSize, Row } from '../../grid';
5
+ import { FormBlockDataTypes, FormBlockDirection, isHubspotDataForm, isYandexDataForm, } from '../../models';
6
+ import { Content } from '../../sub-blocks';
7
+ import { block } from '../../utils';
8
+ import InnerForm from './InnerForm/InnerForm';
9
+ import './Form.css';
10
+ const b = block('form-block');
11
+ const colSizes = { [GridColumnSize.Lg]: 6, [GridColumnSize.All]: 12 };
12
+ const FormBlock = (props) => {
13
+ var _a;
14
+ const { formData, title, textContent, direction = FormBlockDirection.Center, background } = props;
15
+ const [contentLoaded, setContentLoaded] = useState(false);
16
+ const isMobile = useContext(MobileContext);
17
+ const hasImage = background && (background.src || background.desktop);
18
+ const paddingBottom = background && ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) && !hasImage ? 'l' : 'm'; // bigger padding for case with background color and no image
19
+ const onContentLoad = useCallback(() => {
20
+ setContentLoaded(true);
21
+ }, []);
22
+ const formType = useMemo(() => {
23
+ if (isYandexDataForm(formData)) {
24
+ return FormBlockDataTypes.YANDEX;
25
+ }
26
+ if (isHubspotDataForm(formData)) {
27
+ return FormBlockDataTypes.HUBSPOT_INLINE;
28
+ }
29
+ return undefined;
30
+ }, [formData]);
31
+ if (!formData) {
32
+ return null;
33
+ }
34
+ return (React.createElement("div", { className: b({
35
+ 'with-background': Boolean(background),
36
+ 'form-type': formType,
37
+ }) },
38
+ background && (React.createElement(BackgroundImage, Object.assign({}, background, { className: b('media'), imageClassName: b('image') }))),
39
+ React.createElement(Grid, null,
40
+ React.createElement(Row, { alignItems: direction === FormBlockDirection.Center
41
+ ? GridAlignItems.Center
42
+ : GridAlignItems.Start, className: b('row', {
43
+ direction,
44
+ 'padding-bottom': paddingBottom,
45
+ }) },
46
+ React.createElement(Col, { sizes: colSizes, className: b('content-col') }, textContent && (React.createElement("div", { className: b('content-wrapper') },
47
+ React.createElement(Content, Object.assign({ theme: "default" }, textContent, { centered: direction === FormBlockDirection.Center, colSizes: { all: 12 }, className: b('content') }))))),
48
+ React.createElement(Col, { sizes: colSizes, className: b('form-col') },
49
+ React.createElement("div", { className: b('form-wrapper') },
50
+ React.createElement("div", { className: b('full-form', {
51
+ hidden: !contentLoaded,
52
+ }) },
53
+ title && (React.createElement(Title, { title: {
54
+ text: title,
55
+ textSize: 's',
56
+ }, className: b('title', { mobile: isMobile }), colSizes: { all: 12 } })),
57
+ React.createElement(InnerForm, { className: b('form'), formData: formData, onContentLoad: onContentLoad }))))))));
58
+ };
59
+ export default FormBlock;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { HubspotFormProps } from '../../models';
3
+ type Props = HubspotFormProps & {
4
+ onReady?: () => void;
5
+ };
6
+ declare const HubspotInlineForm: React.FC<Props>;
7
+ export default HubspotInlineForm;
@@ -0,0 +1,12 @@
1
+ import { __rest } from "tslib";
2
+ import React from 'react';
3
+ import useMount from '../../hooks/useMount';
4
+ import { HubspotForm } from '../../sub-blocks';
5
+ const HubspotInlineForm = (props) => {
6
+ const { onReady } = props, rest = __rest(props, ["onReady"]);
7
+ useMount(() => {
8
+ onReady === null || onReady === void 0 ? void 0 : onReady();
9
+ });
10
+ return React.createElement(HubspotForm, Object.assign({}, rest, { createDOMElement: true }));
11
+ };
12
+ export default HubspotInlineForm;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { FormBlockData } from '../../../models';
3
+ interface InnerFormProps {
4
+ formData: FormBlockData;
5
+ onContentLoad: () => void;
6
+ className?: string;
7
+ }
8
+ declare const InnerForm: React.FC<InnerFormProps>;
9
+ export default InnerForm;
@@ -0,0 +1,26 @@
1
+ import { __rest } from "tslib";
2
+ import React, { useEffect } from 'react';
3
+ import { YandexForm } from '../../../components';
4
+ import { isHubspotDataForm, isYandexDataForm } from '../../../models';
5
+ import { HubspotForm } from '../../../sub-blocks';
6
+ const InnerForm = (props) => {
7
+ const { formData, onContentLoad, className } = props;
8
+ useEffect(() => {
9
+ if (isHubspotDataForm(formData)) {
10
+ onContentLoad();
11
+ }
12
+ }, [onContentLoad, formData]);
13
+ if (isYandexDataForm(formData)) {
14
+ const _a = formData.yandex, { onLoad } = _a, rest = __rest(_a, ["onLoad"]);
15
+ return (React.createElement("div", { className: className },
16
+ React.createElement(YandexForm, Object.assign({}, rest, { onLoad: () => {
17
+ onContentLoad();
18
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad();
19
+ } }))));
20
+ }
21
+ if (isHubspotDataForm(formData)) {
22
+ return React.createElement(HubspotForm, Object.assign({}, formData.hubspot));
23
+ }
24
+ return null;
25
+ };
26
+ export default InnerForm;
@@ -0,0 +1,202 @@
1
+ export declare const FormBlock: {
2
+ 'form-block': {
3
+ additionalProperties: boolean;
4
+ required: string[];
5
+ properties: {
6
+ title: {
7
+ type: string;
8
+ };
9
+ formData: {
10
+ oneOf: ({
11
+ type: string;
12
+ optionName: string;
13
+ properties: {
14
+ yandex: {
15
+ type: string;
16
+ required: string[];
17
+ properties: {
18
+ id: {
19
+ type: string;
20
+ };
21
+ containerId: {
22
+ type: string;
23
+ };
24
+ type: {};
25
+ when: {
26
+ type: string;
27
+ };
28
+ };
29
+ };
30
+ hubspot?: undefined;
31
+ };
32
+ } | {
33
+ type: string;
34
+ optionName: string;
35
+ properties: {
36
+ hubspot: {
37
+ type: string;
38
+ required: string[];
39
+ properties: {
40
+ region: {
41
+ type: string;
42
+ };
43
+ portalId: {
44
+ type: string;
45
+ };
46
+ formId: {
47
+ type: string;
48
+ };
49
+ formInstanceId: {
50
+ type: string;
51
+ };
52
+ type: {};
53
+ when: {
54
+ type: string;
55
+ };
56
+ };
57
+ };
58
+ yandex?: undefined;
59
+ };
60
+ })[];
61
+ };
62
+ textContent: {
63
+ additionalProperties: boolean;
64
+ properties: Partial<{
65
+ title: {
66
+ oneOf: ({
67
+ type: string;
68
+ contentType: string;
69
+ optionName: string;
70
+ } | {
71
+ optionName: string;
72
+ type: string;
73
+ additionalProperties: boolean;
74
+ required: string[];
75
+ properties: {
76
+ text: {
77
+ type: string;
78
+ contentType: string;
79
+ };
80
+ textSize: {
81
+ type: string;
82
+ enum: string[];
83
+ };
84
+ url: {
85
+ type: string;
86
+ };
87
+ urlTitle: {
88
+ type: string;
89
+ };
90
+ resetMargin: {
91
+ type: string;
92
+ };
93
+ };
94
+ contentType?: undefined;
95
+ })[];
96
+ };
97
+ text: {
98
+ type: string;
99
+ contentType: string;
100
+ inputType: string;
101
+ };
102
+ additionalInfo: {
103
+ type: string;
104
+ contentType: string;
105
+ };
106
+ size: {
107
+ type: string;
108
+ enum: string[];
109
+ };
110
+ links: {
111
+ type: string;
112
+ items: {
113
+ type: string;
114
+ properties: {
115
+ when: {
116
+ type: string;
117
+ };
118
+ };
119
+ };
120
+ };
121
+ buttons: {
122
+ type: string;
123
+ items: {
124
+ type: string;
125
+ properties: {
126
+ when: {
127
+ type: string;
128
+ };
129
+ };
130
+ };
131
+ };
132
+ theme: {
133
+ type: string;
134
+ enum: string[];
135
+ };
136
+ list: {
137
+ type: string;
138
+ items: {
139
+ type: string;
140
+ properties: {
141
+ when: {
142
+ type: string;
143
+ };
144
+ };
145
+ };
146
+ };
147
+ }>;
148
+ };
149
+ direction: {
150
+ enum: string[];
151
+ };
152
+ image: {
153
+ oneOf: ({
154
+ type: string;
155
+ properties: {
156
+ when: {
157
+ type: string;
158
+ };
159
+ };
160
+ } | {
161
+ type: string;
162
+ pattern: string;
163
+ optionName: string;
164
+ })[];
165
+ };
166
+ backgroundColor: {
167
+ type: string;
168
+ };
169
+ anchor: {
170
+ type: string;
171
+ additionalProperties: boolean;
172
+ required: string[];
173
+ properties: {
174
+ text: {
175
+ type: string;
176
+ contentType: string;
177
+ };
178
+ url: {
179
+ type: string;
180
+ };
181
+ urlTitle: {
182
+ type: string;
183
+ };
184
+ };
185
+ };
186
+ visible: {
187
+ type: string;
188
+ enum: string[];
189
+ };
190
+ resetPaddings: {
191
+ type: string;
192
+ };
193
+ context: {
194
+ type: string;
195
+ };
196
+ type: {};
197
+ when: {
198
+ type: string;
199
+ };
200
+ };
201
+ };
202
+ };
@@ -0,0 +1,40 @@
1
+ import omit from 'lodash/omit';
2
+ import { ImageProps } from '../../components/Image/schema';
3
+ import { YandexFormProps } from '../../components/YandexForm/schema';
4
+ import { BlockBaseProps } from '../../schema/validators/common';
5
+ import { ContentBase } from '../../sub-blocks/Content/schema';
6
+ import { HubspotFormProps } from '../../sub-blocks/HubspotForm/schema';
7
+ const FormBlockContentProps = omit(ContentBase, ['size', 'centered', 'colSizes']);
8
+ export const FormBlock = {
9
+ 'form-block': {
10
+ additionalProperties: false,
11
+ required: ['formData'],
12
+ properties: Object.assign(Object.assign({}, BlockBaseProps), { title: {
13
+ type: 'string',
14
+ }, formData: {
15
+ oneOf: [
16
+ {
17
+ type: 'object',
18
+ optionName: 'yandex',
19
+ properties: {
20
+ yandex: YandexFormProps,
21
+ },
22
+ },
23
+ {
24
+ type: 'object',
25
+ optionName: 'hubspot-inline',
26
+ properties: {
27
+ hubspot: HubspotFormProps,
28
+ },
29
+ },
30
+ ],
31
+ }, textContent: {
32
+ additionalProperties: false,
33
+ properties: FormBlockContentProps,
34
+ }, direction: {
35
+ enum: ['content-form', 'form-content', 'center'],
36
+ }, image: ImageProps, backgroundColor: {
37
+ type: 'string',
38
+ } }),
39
+ },
40
+ };
@@ -18,7 +18,7 @@ const Background = ({ background, isMobile }) => {
18
18
  };
19
19
  const FullWidthBackground = ({ background }) => (React.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
20
20
  export const HeaderBlock = (props) => {
21
- const { title, overtitle, description, buttons, image, video, width = 'm', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, children, mediaView = 'full', } = props;
21
+ const { title, overtitle, description, buttons, image, video, width = 'm', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', } = props;
22
22
  const isMobile = useContext(MobileContext);
23
23
  const theme = useTheme();
24
24
  const hasRightSideImage = Boolean(image || video);
@@ -56,7 +56,7 @@ export const HeaderBlock = (props) => {
56
56
  React.createElement(HTML, null, overtitle))),
57
57
  React.createElement("h1", { className: b('title') },
58
58
  status,
59
- React.createElement(HTML, null, title)),
59
+ renderTitle ? renderTitle(title) : React.createElement(HTML, null, title)),
60
60
  description && (React.createElement("div", { className: b('description') },
61
61
  React.createElement(YFMWrapper, { content: description, modifiers: {
62
62
  constructor: true,
@@ -1228,6 +1228,9 @@ export declare const HeaderBlock: {
1228
1228
  url: {
1229
1229
  type: string;
1230
1230
  };
1231
+ urlTitle: {
1232
+ type: string;
1233
+ };
1231
1234
  };
1232
1235
  };
1233
1236
  visible: {
@@ -547,6 +547,9 @@ export declare const HeaderSliderBlock: {
547
547
  url: {
548
548
  type: string;
549
549
  };
550
+ urlTitle: {
551
+ type: string;
552
+ };
550
553
  };
551
554
  };
552
555
  visible: {
@@ -127,6 +127,9 @@ export declare const IconsProps: {
127
127
  url: {
128
128
  type: string;
129
129
  };
130
+ urlTitle: {
131
+ type: string;
132
+ };
130
133
  };
131
134
  };
132
135
  visible: {
@@ -275,6 +278,9 @@ export declare const IconsBlock: {
275
278
  url: {
276
279
  type: string;
277
280
  };
281
+ urlTitle: {
282
+ type: string;
283
+ };
278
284
  };
279
285
  };
280
286
  visible: {
@@ -75,6 +75,9 @@ export declare const InfoBlock: {
75
75
  url: {
76
76
  type: string;
77
77
  };
78
+ urlTitle: {
79
+ type: string;
80
+ };
78
81
  resetMargin: {
79
82
  type: string;
80
83
  };
@@ -159,6 +162,9 @@ export declare const InfoBlock: {
159
162
  url: {
160
163
  type: string;
161
164
  };
165
+ urlTitle: {
166
+ type: string;
167
+ };
162
168
  resetMargin: {
163
169
  type: string;
164
170
  };