@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.
- package/build/cjs/blocks/Banner/schema.d.ts +9 -0
- package/build/cjs/blocks/CardLayout/schema.d.ts +12 -0
- package/build/cjs/blocks/ContentLayout/schema.d.ts +6 -0
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +9 -0
- package/build/cjs/blocks/FilterBlock/schema.d.ts +12 -0
- package/build/cjs/blocks/Form/Form.css +136 -0
- package/build/cjs/blocks/Form/Form.d.ts +4 -0
- package/build/cjs/blocks/Form/Form.js +61 -0
- package/build/cjs/blocks/Form/HubspotInlineForm.d.ts +7 -0
- package/build/cjs/blocks/Form/HubspotInlineForm.js +14 -0
- package/build/cjs/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
- package/build/cjs/blocks/Form/InnerForm/InnerForm.js +28 -0
- package/build/cjs/blocks/Form/schema.d.ts +202 -0
- package/build/cjs/blocks/Form/schema.js +44 -0
- package/build/cjs/blocks/Header/Header.js +2 -2
- package/build/cjs/blocks/Header/schema.d.ts +3 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/cjs/blocks/Icons/schema.d.ts +6 -0
- package/build/cjs/blocks/Info/schema.d.ts +6 -0
- package/build/cjs/blocks/Map/schema.d.ts +9 -0
- package/build/cjs/blocks/Media/schema.d.ts +18 -0
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
- package/build/cjs/blocks/Questions/schema.d.ts +6 -0
- package/build/cjs/blocks/Slider/schema.d.ts +6 -0
- package/build/cjs/blocks/Table/schema.d.ts +3 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +12 -0
- package/build/cjs/blocks/index.d.ts +1 -0
- package/build/cjs/blocks/index.js +3 -1
- package/build/cjs/components/Button/Button.d.ts +1 -0
- package/build/cjs/components/Button/Button.js +2 -2
- package/build/cjs/components/Media/Image/Image.js +4 -4
- package/build/cjs/components/ReactPlayer/ReactPlayer.d.ts +1 -2
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -17
- package/build/cjs/components/YandexForm/YandexForm.js +6 -4
- package/build/cjs/components/YandexForm/schema.d.ts +16 -0
- package/build/cjs/components/YandexForm/schema.js +13 -0
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/editor/data/templates/form-block.json +20 -0
- package/build/cjs/models/components.d.ts +1 -2
- package/build/cjs/models/constructor-items/blocks.d.ts +33 -5
- package/build/cjs/models/constructor-items/blocks.js +13 -1
- package/build/cjs/models/constructor-items/common.d.ts +21 -1
- package/build/cjs/models/constructor-items/common.js +6 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -1
- package/build/cjs/models/guards.d.ts +3 -1
- package/build/cjs/models/guards.js +9 -1
- package/build/cjs/schema/constants.d.ts +22 -0
- package/build/cjs/schema/constants.js +2 -1
- package/build/cjs/schema/validators/blocks.d.ts +1 -0
- package/build/cjs/schema/validators/blocks.js +1 -0
- package/build/cjs/schema/validators/common.d.ts +23 -1
- package/build/cjs/schema/validators/common.js +13 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +6 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +2 -0
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +6 -0
- package/build/cjs/sub-blocks/BasicCard/schema.js +2 -0
- package/build/cjs/sub-blocks/Content/schema.d.ts +6 -0
- package/build/cjs/sub-blocks/HubspotForm/schema.d.ts +22 -0
- package/build/cjs/sub-blocks/HubspotForm/schema.js +17 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +3 -0
- package/build/cjs/sub-blocks/Quote/Quote.css +12 -3
- package/build/cjs/sub-blocks/Quote/Quote.js +3 -3
- package/build/cjs/sub-blocks/Quote/schema.d.ts +7 -0
- package/build/cjs/sub-blocks/Quote/schema.js +6 -1
- package/build/esm/blocks/Banner/schema.d.ts +9 -0
- package/build/esm/blocks/CardLayout/schema.d.ts +12 -0
- package/build/esm/blocks/ContentLayout/schema.d.ts +6 -0
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +9 -0
- package/build/esm/blocks/FilterBlock/schema.d.ts +12 -0
- package/build/esm/blocks/Form/Form.css +136 -0
- package/build/esm/blocks/Form/Form.d.ts +5 -0
- package/build/esm/blocks/Form/Form.js +59 -0
- package/build/esm/blocks/Form/HubspotInlineForm.d.ts +7 -0
- package/build/esm/blocks/Form/HubspotInlineForm.js +12 -0
- package/build/esm/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
- package/build/esm/blocks/Form/InnerForm/InnerForm.js +26 -0
- package/build/esm/blocks/Form/schema.d.ts +202 -0
- package/build/esm/blocks/Form/schema.js +40 -0
- package/build/esm/blocks/Header/Header.js +2 -2
- package/build/esm/blocks/Header/schema.d.ts +3 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/esm/blocks/Icons/schema.d.ts +6 -0
- package/build/esm/blocks/Info/schema.d.ts +6 -0
- package/build/esm/blocks/Map/schema.d.ts +9 -0
- package/build/esm/blocks/Media/schema.d.ts +18 -0
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
- package/build/esm/blocks/Questions/schema.d.ts +6 -0
- package/build/esm/blocks/Slider/schema.d.ts +6 -0
- package/build/esm/blocks/Table/schema.d.ts +3 -0
- package/build/esm/blocks/Tabs/schema.d.ts +12 -0
- package/build/esm/blocks/index.d.ts +1 -0
- package/build/esm/blocks/index.js +1 -0
- package/build/esm/components/Button/Button.d.ts +1 -0
- package/build/esm/components/Button/Button.js +2 -2
- package/build/esm/components/Media/Image/Image.js +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.d.ts +1 -2
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -17
- package/build/esm/components/YandexForm/YandexForm.js +5 -3
- package/build/esm/components/YandexForm/schema.d.ts +16 -0
- package/build/esm/components/YandexForm/schema.js +10 -0
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/editor/data/templates/form-block.json +20 -0
- package/build/esm/models/components.d.ts +1 -2
- package/build/esm/models/constructor-items/blocks.d.ts +33 -5
- package/build/esm/models/constructor-items/blocks.js +12 -0
- package/build/esm/models/constructor-items/common.d.ts +21 -1
- package/build/esm/models/constructor-items/common.js +5 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -1
- package/build/esm/models/guards.d.ts +3 -1
- package/build/esm/models/guards.js +7 -1
- package/build/esm/schema/constants.d.ts +22 -0
- package/build/esm/schema/constants.js +3 -2
- package/build/esm/schema/validators/blocks.d.ts +1 -0
- package/build/esm/schema/validators/blocks.js +1 -0
- package/build/esm/schema/validators/common.d.ts +23 -1
- package/build/esm/schema/validators/common.js +13 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +6 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.js +2 -0
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +6 -0
- package/build/esm/sub-blocks/BasicCard/schema.js +2 -0
- package/build/esm/sub-blocks/Content/schema.d.ts +6 -0
- package/build/esm/sub-blocks/HubspotForm/schema.d.ts +22 -0
- package/build/esm/sub-blocks/HubspotForm/schema.js +14 -0
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +3 -0
- package/build/esm/sub-blocks/Quote/Quote.css +12 -3
- package/build/esm/sub-blocks/Quote/Quote.js +4 -4
- package/build/esm/sub-blocks/Quote/schema.d.ts +7 -0
- package/build/esm/sub-blocks/Quote/schema.js +7 -2
- package/package.json +2 -2
- package/server/models/components.d.ts +1 -2
- package/server/models/constructor-items/blocks.d.ts +33 -5
- package/server/models/constructor-items/blocks.js +13 -1
- package/server/models/constructor-items/common.d.ts +21 -1
- package/server/models/constructor-items/common.js +6 -1
- package/server/models/constructor-items/sub-blocks.d.ts +4 -1
- package/server/models/guards.d.ts +3 -1
- package/server/models/guards.js +9 -1
- package/widget/index.js +1 -1
|
@@ -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: {
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -4,6 +4,7 @@ import './Button.css';
|
|
|
4
4
|
export interface ButtonProps extends Omit<ButtonParams, 'url'>, QAProps {
|
|
5
5
|
className?: string;
|
|
6
6
|
url?: string;
|
|
7
|
+
urlTitle?: string;
|
|
7
8
|
onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
8
9
|
}
|
|
9
10
|
declare const Button: (props: ButtonProps) => JSX.Element;
|
|
@@ -15,7 +15,7 @@ const b = block('button-block');
|
|
|
15
15
|
const Button = (props) => {
|
|
16
16
|
const handleMetrika = useMetrika();
|
|
17
17
|
const { tld } = useContext(LocaleContext);
|
|
18
|
-
const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text, width } = props, rest = __rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "img", "onClick", "text", "width"]);
|
|
18
|
+
const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, urlTitle, img, onClick: onClickOrigin, text, width } = props, rest = __rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "urlTitle", "img", "onClick", "text", "width"]);
|
|
19
19
|
const defaultImgPosition = 'left';
|
|
20
20
|
const handleAnalytics = useAnalytics(DefaultEventNames.Button, url);
|
|
21
21
|
const onClick = useCallback((e) => {
|
|
@@ -44,7 +44,7 @@ const Button = (props) => {
|
|
|
44
44
|
image = undefined;
|
|
45
45
|
}
|
|
46
46
|
const buttonTheme = theme === 'scale' ? 'accent' : theme;
|
|
47
|
-
return (React.createElement(CommonButton, Object.assign({ className: buttonClass, view: toCommonView(buttonTheme), size: toCommonSize(size), href: url ? setUrlTld(url, tld) : undefined, width: width }, buttonProps),
|
|
47
|
+
return (React.createElement(CommonButton, Object.assign({ className: buttonClass, view: toCommonView(buttonTheme), size: toCommonSize(size), href: url ? setUrlTld(url, tld) : undefined, title: urlTitle, width: width }, buttonProps),
|
|
48
48
|
icon && buttonImg.position === 'left' ? icon : null,
|
|
49
49
|
React.createElement("span", { className: b('content') },
|
|
50
50
|
image && buttonImg.position === 'left' ? image : null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Fragment, useEffect, useState } from 'react';
|
|
2
|
+
import { animated, config, useSpring } from '@react-spring/web';
|
|
2
3
|
import debounce from 'lodash/debounce';
|
|
3
|
-
import { animated, config, useSpring } from 'react-spring';
|
|
4
4
|
import SliderBlock from '../../../blocks/Slider/Slider';
|
|
5
5
|
import { SliderType } from '../../../models';
|
|
6
6
|
import { block, getQaAttrubutes } from '../../../utils';
|
|
@@ -12,6 +12,5 @@ export interface ReactPlayerBlockProps extends Omit<MediaVideoProps, 'loop' | 's
|
|
|
12
12
|
ratio?: number;
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
export declare const ReactPlayerBlock: React.ForwardRefExoticComponent<ReactPlayerBlockProps & React.RefAttributes<ReactPlayerBlockRefType>>;
|
|
15
|
+
export declare const ReactPlayerBlock: React.ForwardRefExoticComponent<ReactPlayerBlockProps & React.RefAttributes<ReactPlayerBlockHandler>>;
|
|
17
16
|
export default ReactPlayerBlock;
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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}
|
|
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,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
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export type ArrowDirection = 'left' | 'right';
|
|
2
|
-
export
|
|
3
|
-
}
|
|
2
|
+
export type ReactPlayerBlockHandler = Pick<HTMLVideoElement, 'play' | 'pause' | 'addEventListener'> | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
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
|
|
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 {};
|
|
@@ -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"
|
|
@@ -42,6 +42,10 @@ export declare enum MediaVideoControlsType {
|
|
|
42
42
|
Default = "default",
|
|
43
43
|
Custom = "custom"
|
|
44
44
|
}
|
|
45
|
+
export declare enum QuoteType {
|
|
46
|
+
Chevron = "chevron",
|
|
47
|
+
EnglishDouble = "english-double"
|
|
48
|
+
}
|
|
45
49
|
export type TextTheme = 'light' | 'dark';
|
|
46
50
|
export type TextSize = 'xs' | 's' | 'm' | 'l';
|
|
47
51
|
export type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';
|
|
@@ -333,4 +337,20 @@ export interface TitleProps {
|
|
|
333
337
|
title?: TitleItemProps | string;
|
|
334
338
|
subtitle?: string;
|
|
335
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
|
+
}
|
|
336
356
|
export {};
|
|
@@ -48,3 +48,8 @@ export var MediaVideoControlsType;
|
|
|
48
48
|
MediaVideoControlsType["Default"] = "default";
|
|
49
49
|
MediaVideoControlsType["Custom"] = "custom";
|
|
50
50
|
})(MediaVideoControlsType || (MediaVideoControlsType = {}));
|
|
51
|
+
export var QuoteType;
|
|
52
|
+
(function (QuoteType) {
|
|
53
|
+
QuoteType["Chevron"] = "chevron";
|
|
54
|
+
QuoteType["EnglishDouble"] = "english-double";
|
|
55
|
+
})(QuoteType || (QuoteType = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassNameProps } from '../../models';
|
|
1
|
+
import { ClassNameProps, QuoteType } from '../../models';
|
|
2
2
|
import { ThemeSupporting } from '../../utils';
|
|
3
3
|
import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
|
|
4
4
|
import { AnalyticsEventsBase, PixelEvent } from '../common';
|
|
@@ -67,9 +67,11 @@ 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;
|
|
74
|
+
quoteType?: QuoteType;
|
|
73
75
|
}
|
|
74
76
|
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
75
77
|
url?: string;
|
|
@@ -80,6 +82,7 @@ export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase,
|
|
|
80
82
|
}
|
|
81
83
|
export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
|
|
82
84
|
url: string;
|
|
85
|
+
urlTitle?: string;
|
|
83
86
|
icon?: ImageProps;
|
|
84
87
|
target?: string;
|
|
85
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
|
+
}
|