@gravity-ui/page-constructor 4.29.0 → 4.29.1-alpha.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.
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 +11 -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
@@ -21,7 +21,7 @@ const Background = ({ background, isMobile }) => {
21
21
  };
22
22
  const FullWidthBackground = ({ background }) => (react_1.default.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
23
23
  const HeaderBlock = (props) => {
24
- 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;
24
+ 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;
25
25
  const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
26
26
  const theme = (0, theme_1.useTheme)();
27
27
  const hasRightSideImage = Boolean(image || video);
@@ -59,7 +59,7 @@ const HeaderBlock = (props) => {
59
59
  react_1.default.createElement(components_1.HTML, null, overtitle))),
60
60
  react_1.default.createElement("h1", { className: b('title') },
61
61
  status,
62
- react_1.default.createElement(components_1.HTML, null, title)),
62
+ renderTitle ? renderTitle(title) : react_1.default.createElement(components_1.HTML, null, title)),
63
63
  description && (react_1.default.createElement("div", { className: b('description') },
64
64
  react_1.default.createElement(YFMWrapper_1.default, { content: description, modifiers: {
65
65
  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
  };
@@ -141,6 +141,9 @@ export declare const MapBlock: {
141
141
  url: {
142
142
  type: string;
143
143
  };
144
+ urlTitle: {
145
+ type: string;
146
+ };
144
147
  primary: {
145
148
  type: string;
146
149
  };
@@ -389,6 +392,9 @@ export declare const MapBlock: {
389
392
  url: {
390
393
  type: string;
391
394
  };
395
+ urlTitle: {
396
+ type: string;
397
+ };
392
398
  resetMargin: {
393
399
  type: string;
394
400
  };
@@ -452,6 +458,9 @@ export declare const MapBlock: {
452
458
  url: {
453
459
  type: string;
454
460
  };
461
+ urlTitle: {
462
+ type: string;
463
+ };
455
464
  };
456
465
  };
457
466
  visible: {
@@ -280,6 +280,9 @@ export declare const MediaBlockBaseProps: {
280
280
  url: {
281
281
  type: string;
282
282
  };
283
+ urlTitle: {
284
+ type: string;
285
+ };
283
286
  primary: {
284
287
  type: string;
285
288
  };
@@ -528,6 +531,9 @@ export declare const MediaBlockBaseProps: {
528
531
  url: {
529
532
  type: string;
530
533
  };
534
+ urlTitle: {
535
+ type: string;
536
+ };
531
537
  resetMargin: {
532
538
  type: string;
533
539
  };
@@ -591,6 +597,9 @@ export declare const MediaBlockBaseProps: {
591
597
  url: {
592
598
  type: string;
593
599
  };
600
+ urlTitle: {
601
+ type: string;
602
+ };
594
603
  };
595
604
  };
596
605
  visible: {
@@ -904,6 +913,9 @@ export declare const MediaBlock: {
904
913
  url: {
905
914
  type: string;
906
915
  };
916
+ urlTitle: {
917
+ type: string;
918
+ };
907
919
  primary: {
908
920
  type: string;
909
921
  };
@@ -1152,6 +1164,9 @@ export declare const MediaBlock: {
1152
1164
  url: {
1153
1165
  type: string;
1154
1166
  };
1167
+ urlTitle: {
1168
+ type: string;
1169
+ };
1155
1170
  resetMargin: {
1156
1171
  type: string;
1157
1172
  };
@@ -1215,6 +1230,9 @@ export declare const MediaBlock: {
1215
1230
  url: {
1216
1231
  type: string;
1217
1232
  };
1233
+ urlTitle: {
1234
+ type: string;
1235
+ };
1218
1236
  };
1219
1237
  };
1220
1238
  visible: {
@@ -305,6 +305,9 @@ export declare const PromoFeaturesBlock: {
305
305
  url: {
306
306
  type: string;
307
307
  };
308
+ urlTitle: {
309
+ type: string;
310
+ };
308
311
  resetMargin: {
309
312
  type: string;
310
313
  };
@@ -331,6 +334,9 @@ export declare const PromoFeaturesBlock: {
331
334
  url: {
332
335
  type: string;
333
336
  };
337
+ urlTitle: {
338
+ type: string;
339
+ };
334
340
  };
335
341
  };
336
342
  visible: {
@@ -36,6 +36,9 @@ export declare const QuestionsBlock: {
36
36
  url: {
37
37
  type: string;
38
38
  };
39
+ urlTitle: {
40
+ type: string;
41
+ };
39
42
  resetMargin: {
40
43
  type: string;
41
44
  };
@@ -97,6 +100,9 @@ export declare const QuestionsBlock: {
97
100
  url: {
98
101
  type: string;
99
102
  };
103
+ urlTitle: {
104
+ type: string;
105
+ };
100
106
  };
101
107
  };
102
108
  visible: {
@@ -100,6 +100,9 @@ export declare const SliderBlock: {
100
100
  url: {
101
101
  type: string;
102
102
  };
103
+ urlTitle: {
104
+ type: string;
105
+ };
103
106
  resetMargin: {
104
107
  type: string;
105
108
  };
@@ -197,6 +200,9 @@ export declare const SliderBlock: {
197
200
  url: {
198
201
  type: string;
199
202
  };
203
+ urlTitle: {
204
+ type: string;
205
+ };
200
206
  };
201
207
  };
202
208
  visible: {
@@ -66,6 +66,9 @@ export declare const TableBlock: {
66
66
  url: {
67
67
  type: string;
68
68
  };
69
+ urlTitle: {
70
+ type: string;
71
+ };
69
72
  };
70
73
  };
71
74
  visible: {
@@ -279,6 +279,9 @@ export declare const tabsItem: {
279
279
  url: {
280
280
  type: string;
281
281
  };
282
+ urlTitle: {
283
+ type: string;
284
+ };
282
285
  arrow: {
283
286
  type: string;
284
287
  };
@@ -427,6 +430,9 @@ export declare const tabsItem: {
427
430
  url: {
428
431
  type: string;
429
432
  };
433
+ urlTitle: {
434
+ type: string;
435
+ };
430
436
  resetMargin: {
431
437
  type: string;
432
438
  };
@@ -535,6 +541,9 @@ export declare const TabsBlock: {
535
541
  url: {
536
542
  type: string;
537
543
  };
544
+ urlTitle: {
545
+ type: string;
546
+ };
538
547
  resetMargin: {
539
548
  type: string;
540
549
  };
@@ -558,6 +567,9 @@ export declare const TabsBlock: {
558
567
  url: {
559
568
  type: string;
560
569
  };
570
+ urlTitle: {
571
+ type: string;
572
+ };
561
573
  };
562
574
  };
563
575
  visible: {
@@ -16,3 +16,4 @@ export { default as CardLayoutBlock } from './CardLayout/CardLayout';
16
16
  export { default as ContentLayoutBlock } from './ContentLayout/ContentLayout';
17
17
  export { default as ShareBlock } from './Share/Share';
18
18
  export { default as FilterBlock } from './FilterBlock/FilterBlock';
19
+ export { default as FormBlock } from './Form/Form';
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
6
+ exports.FormBlock = exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
7
7
  var Banner_1 = require("./Banner/Banner");
8
8
  Object.defineProperty(exports, "BannerBlock", { enumerable: true, get: function () { return __importDefault(Banner_1).default; } });
9
9
  var Companies_1 = require("./Companies/Companies");
@@ -40,3 +40,5 @@ var Share_1 = require("./Share/Share");
40
40
  Object.defineProperty(exports, "ShareBlock", { enumerable: true, get: function () { return __importDefault(Share_1).default; } });
41
41
  var FilterBlock_1 = require("./FilterBlock/FilterBlock");
42
42
  Object.defineProperty(exports, "FilterBlock", { enumerable: true, get: function () { return __importDefault(FilterBlock_1).default; } });
43
+ var Form_1 = require("./Form/Form");
44
+ Object.defineProperty(exports, "FormBlock", { enumerable: true, get: function () { return __importDefault(Form_1).default; } });
@@ -3,6 +3,7 @@ import { ButtonProps as ButtonParams, QAProps } from '../../models';
3
3
  export interface ButtonProps extends Omit<ButtonParams, 'url'>, QAProps {
4
4
  className?: string;
5
5
  url?: string;
6
+ urlTitle?: string;
6
7
  onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
7
8
  }
8
9
  declare const Button: (props: ButtonProps) => JSX.Element;
@@ -16,7 +16,7 @@ const b = (0, utils_1.block)('button-block');
16
16
  const Button = (props) => {
17
17
  const handleMetrika = (0, useMetrika_1.useMetrika)();
18
18
  const { tld } = (0, react_1.useContext)(localeContext_1.LocaleContext);
19
- const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text, width } = props, rest = tslib_1.__rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "img", "onClick", "text", "width"]);
19
+ const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, urlTitle, img, onClick: onClickOrigin, text, width } = props, rest = tslib_1.__rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "urlTitle", "img", "onClick", "text", "width"]);
20
20
  const defaultImgPosition = 'left';
21
21
  const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.Button, url);
22
22
  const onClick = (0, react_1.useCallback)((e) => {
@@ -45,7 +45,7 @@ const Button = (props) => {
45
45
  image = undefined;
46
46
  }
47
47
  const buttonTheme = theme === 'scale' ? 'accent' : theme;
48
- return (react_1.default.createElement(uikit_1.Button, Object.assign({ className: buttonClass, view: (0, utils_2.toCommonView)(buttonTheme), size: (0, utils_2.toCommonSize)(size), href: url ? (0, utils_1.setUrlTld)(url, tld) : undefined, width: width }, buttonProps),
48
+ return (react_1.default.createElement(uikit_1.Button, Object.assign({ className: buttonClass, view: (0, utils_2.toCommonView)(buttonTheme), size: (0, utils_2.toCommonSize)(size), href: url ? (0, utils_1.setUrlTld)(url, tld) : undefined, title: urlTitle, width: width }, buttonProps),
49
49
  icon && buttonImg.position === 'left' ? icon : null,
50
50
  react_1.default.createElement("span", { className: b('content') },
51
51
  image && buttonImg.position === 'left' ? image : null,
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultAnimatedDivQa = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
+ const web_1 = require("@react-spring/web");
6
7
  const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
7
- const react_spring_1 = require("react-spring");
8
8
  const Slider_1 = tslib_1.__importDefault(require("../../../blocks/Slider/Slider"));
9
9
  const models_1 = require("../../../models");
10
10
  const utils_1 = require("../../../utils");
@@ -18,9 +18,9 @@ const Image = (props) => {
18
18
  const { parallax, image, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, qa, } = props;
19
19
  const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'fullscreen-image', 'animate', 'background-image', 'image-view', 'slider-block');
20
20
  const [scrollY, setScrollY] = (0, react_1.useState)(0);
21
- const [{ springScrollY }, springSetScrollY] = (0, react_spring_1.useSpring)(() => ({
21
+ const [{ springScrollY }, springSetScrollY] = (0, web_1.useSpring)(() => ({
22
22
  springScrollY: 0,
23
- config: react_spring_1.config.molasses,
23
+ config: web_1.config.molasses,
24
24
  }));
25
25
  let parallaxInterpolate = '';
26
26
  (0, react_1.useEffect)(() => {
@@ -44,7 +44,7 @@ const Image = (props) => {
44
44
  };
45
45
  const imageBackground = (oneImage) => {
46
46
  const imageData = (0, utils_2.getMediaImage)(oneImage);
47
- return (react_1.default.createElement(react_spring_1.animated.div, { style: { transform: parallaxInterpolate }, "data-qa": qaAttributes.animate },
47
+ return (react_1.default.createElement(web_1.animated.div, { style: { transform: parallaxInterpolate }, "data-qa": qaAttributes.animate },
48
48
  react_1.default.createElement(BackgroundImage_1.default, Object.assign({}, imageData, { className: imageClass, style: { height }, qa: qaAttributes.backgroundImage }))));
49
49
  };
50
50
  const imageOnly = (oneImage) => {
@@ -11,6 +11,5 @@ export interface ReactPlayerBlockProps extends Omit<MediaVideoProps, 'loop' | 's
11
11
  ratio?: number;
12
12
  children?: React.ReactNode;
13
13
  }
14
- type ReactPlayerBlockRefType = ReactPlayerBlockHandler | undefined;
15
- export declare const ReactPlayerBlock: React.ForwardRefExoticComponent<ReactPlayerBlockProps & React.RefAttributes<ReactPlayerBlockRefType>>;
14
+ export declare const ReactPlayerBlock: React.ForwardRefExoticComponent<ReactPlayerBlockProps & React.RefAttributes<ReactPlayerBlockHandler>>;
16
15
  export default ReactPlayerBlock;
@@ -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;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.YANDEX_FORM_ORIGIN = void 0;
3
+ exports.YANDEX_FORM_SECTION = exports.YANDEX_FORM_ORIGIN = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const localeContext_1 = require("../../context/localeContext");
@@ -11,13 +11,15 @@ const common_1 = require("../../models/common");
11
11
  const utils_1 = require("../../utils");
12
12
  const constants_1 = require("../constants");
13
13
  exports.YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
14
+ exports.YANDEX_FORM_SECTION = 'surveys';
14
15
  const CONTAINER_ID = 'pc-yandex-form-container';
15
16
  const b = (0, utils_1.block)('yandex-form');
16
17
  const YandexForm = (props) => {
17
- const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
18
+ const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, customFormSection, } = props;
18
19
  const formContainerRef = (0, react_1.useRef)(null);
19
20
  const iframeRef = (0, react_1.useRef)();
20
21
  const yaFormOrigin = customFormOrigin || exports.YANDEX_FORM_ORIGIN;
22
+ const yaFormSection = customFormSection || exports.YANDEX_FORM_SECTION;
21
23
  const handleMetrika = (0, useMetrika_1.useMetrika)();
22
24
  const handleAnalytics = (0, hooks_1.useAnalytics)(common_1.DefaultEventNames.YandexFormSubmit);
23
25
  const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
@@ -39,7 +41,7 @@ const YandexForm = (props) => {
39
41
  queryParams.set(param, params[param]);
40
42
  });
41
43
  }
42
- const src = `${yaFormOrigin}/surveys/${id}/?${queryParams}`;
44
+ const src = `${yaFormOrigin}/${yaFormSection}/${id}/?${queryParams}`;
43
45
  if (iframeRef.current) {
44
46
  iframeRef.current.src = src;
45
47
  }
@@ -54,7 +56,7 @@ const YandexForm = (props) => {
54
56
  iframeRef.current.width = '100%';
55
57
  container.appendChild(iframeRef.current);
56
58
  }
57
- }, [locale.lang, theme, isMobile, yaFormOrigin, id, containerId, params]);
59
+ }, [locale.lang, theme, isMobile, yaFormOrigin, yaFormSection, id, containerId, params]);
58
60
  const handleSubmit = (0, react_1.useCallback)(() => {
59
61
  if (formContainerRef && formContainerRef.current) {
60
62
  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,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.YandexFormProps = void 0;
4
+ const common_1 = require("../../schema/validators/common");
5
+ exports.YandexFormProps = {
6
+ type: 'object',
7
+ required: ['id'],
8
+ properties: Object.assign(Object.assign({}, common_1.BaseProps), { id: {
9
+ type: 'string',
10
+ }, containerId: {
11
+ type: 'string',
12
+ } }),
13
+ };
@@ -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;
@@ -26,6 +26,7 @@ exports.blockMap = {
26
26
  [models_1.BlockType.ShareBlock]: blocks_1.ShareBlock,
27
27
  [models_1.BlockType.MapBlock]: blocks_1.MapBlock,
28
28
  [models_1.BlockType.FilterBlock]: blocks_1.FilterBlock,
29
+ [models_1.BlockType.FormBlock]: blocks_1.FormBlock,
29
30
  };
30
31
  exports.subBlockMap = {
31
32
  [models_1.SubBlockType.Divider]: sub_blocks_1.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
+ }
@@ -1,3 +1,2 @@
1
1
  export type ArrowDirection = 'left' | 'right';
2
- export interface ReactPlayerBlockHandler extends Pick<HTMLVideoElement, 'play' | 'pause' | 'addEventListener'> {
3
- }
2
+ export type ReactPlayerBlockHandler = Pick<HTMLVideoElement, 'play' | 'pause' | 'addEventListener'> | undefined;
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  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[];
@@ -109,6 +110,7 @@ export interface HeaderBlockProps {
109
110
  verticalOffset?: 's' | 'm' | 'l' | 'xl';
110
111
  breadcrumbs?: HeaderBreadCrumbsProps;
111
112
  status?: JSX.Element;
113
+ renderTitle?: (title: string) => React.ReactNode;
112
114
  }
113
115
  export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
114
116
  title: string;
@@ -294,6 +296,29 @@ export interface ShareBlockProps {
294
296
  items: PCShareSocialNetwork[];
295
297
  title?: string;
296
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
+ }
297
322
  export type HeaderBlockModel = {
298
323
  type: BlockType.HeaderBlock;
299
324
  } & HeaderBlockProps;
@@ -348,6 +373,9 @@ export type ContentLayoutBlockModel = {
348
373
  export type ShareBLockModel = {
349
374
  type: BlockType.ShareBlock;
350
375
  } & ShareBlockProps;
351
- 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;
352
380
  export type Block = BlockModels & BlockBaseProps;
353
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 = {}));