@gravity-ui/page-constructor 4.30.0 → 4.31.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/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/constructor-items/blocks.d.ts +31 -4
- package/build/cjs/models/constructor-items/blocks.js +13 -1
- package/build/cjs/models/constructor-items/common.d.ts +17 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -0
- package/build/cjs/models/guards.d.ts +3 -1
- package/build/cjs/models/guards.js +9 -1
- package/build/cjs/schema/constants.d.ts +18 -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 +21 -0
- package/build/cjs/schema/validators/common.js +11 -0
- 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.js +2 -2
- package/build/cjs/sub-blocks/Quote/schema.d.ts +3 -0
- package/build/cjs/sub-blocks/Quote/schema.js +2 -0
- 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/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/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/constructor-items/blocks.d.ts +31 -4
- package/build/esm/models/constructor-items/blocks.js +12 -0
- package/build/esm/models/constructor-items/common.d.ts +17 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -0
- package/build/esm/models/guards.d.ts +3 -1
- package/build/esm/models/guards.js +7 -1
- package/build/esm/schema/constants.d.ts +18 -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 +21 -0
- package/build/esm/schema/validators/common.js +11 -0
- 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.js +2 -2
- package/build/esm/sub-blocks/Quote/schema.d.ts +3 -0
- package/build/esm/sub-blocks/Quote/schema.js +2 -0
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +31 -4
- package/server/models/constructor-items/blocks.js +13 -1
- package/server/models/constructor-items/common.d.ts +17 -1
- package/server/models/constructor-items/sub-blocks.d.ts +2 -0
- package/server/models/guards.d.ts +3 -1
- package/server/models/guards.js +9 -1
- package/widget/index.js +1 -1
|
@@ -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: {
|
|
@@ -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,
|
|
@@ -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;
|
|
@@ -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}
|
|
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,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
|
+
}
|
|
@@ -3,8 +3,8 @@ import { ButtonSize } from '@gravity-ui/uikit';
|
|
|
3
3
|
import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
|
|
4
4
|
import { ThemeSupporting } from '../../utils';
|
|
5
5
|
import { AnalyticsEventsBase } from '../common';
|
|
6
|
-
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps } from './common';
|
|
7
|
-
import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
6
|
+
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, YandexFormProps } from './common';
|
|
7
|
+
import { BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
8
8
|
export declare enum BlockType {
|
|
9
9
|
PromoFeaturesBlock = "promo-features-block",
|
|
10
10
|
ExtendedFeaturesBlock = "extended-features-block",
|
|
@@ -23,7 +23,8 @@ export declare enum BlockType {
|
|
|
23
23
|
ContentLayoutBlock = "content-layout-block",
|
|
24
24
|
ShareBlock = "share-block",
|
|
25
25
|
MapBlock = "map-block",
|
|
26
|
-
FilterBlock = "filter-block"
|
|
26
|
+
FilterBlock = "filter-block",
|
|
27
|
+
FormBlock = "form-block"
|
|
27
28
|
}
|
|
28
29
|
export declare const BlockTypes: BlockType[];
|
|
29
30
|
export declare const HeaderBlockTypes: BlockType[];
|
|
@@ -295,6 +296,29 @@ export interface ShareBlockProps {
|
|
|
295
296
|
items: PCShareSocialNetwork[];
|
|
296
297
|
title?: string;
|
|
297
298
|
}
|
|
299
|
+
export declare enum FormBlockDataTypes {
|
|
300
|
+
YANDEX = "yandex",
|
|
301
|
+
HUBSPOT_INLINE = "hubspot-inline"
|
|
302
|
+
}
|
|
303
|
+
export declare enum FormBlockDirection {
|
|
304
|
+
FormContent = "form-content",
|
|
305
|
+
ContentForm = "content-form",
|
|
306
|
+
Center = "center"
|
|
307
|
+
}
|
|
308
|
+
export interface FormBlockYandexData {
|
|
309
|
+
yandex: YandexFormProps;
|
|
310
|
+
}
|
|
311
|
+
export interface FormBlockHubspotData {
|
|
312
|
+
hubspot: HubspotFormProps;
|
|
313
|
+
}
|
|
314
|
+
export type FormBlockData = FormBlockYandexData | FormBlockHubspotData;
|
|
315
|
+
export interface FormBlockProps {
|
|
316
|
+
formData: FormBlockData;
|
|
317
|
+
title?: string;
|
|
318
|
+
textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;
|
|
319
|
+
direction?: FormBlockDirection;
|
|
320
|
+
background?: BackgroundImageProps;
|
|
321
|
+
}
|
|
298
322
|
export type HeaderBlockModel = {
|
|
299
323
|
type: BlockType.HeaderBlock;
|
|
300
324
|
} & HeaderBlockProps;
|
|
@@ -349,6 +373,9 @@ export type ContentLayoutBlockModel = {
|
|
|
349
373
|
export type ShareBLockModel = {
|
|
350
374
|
type: BlockType.ShareBlock;
|
|
351
375
|
} & ShareBlockProps;
|
|
352
|
-
type
|
|
376
|
+
export type FormBlockModel = {
|
|
377
|
+
type: BlockType.FormBlock;
|
|
378
|
+
} & FormBlockProps;
|
|
379
|
+
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel;
|
|
353
380
|
export type Block = BlockModels & BlockBaseProps;
|
|
354
381
|
export {};
|
|
@@ -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 = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
|
|
3
3
|
import { ThemeSupporting } from '../../utils';
|
|
4
|
-
import { AnalyticsEventsBase, ClassNameProps, PixelEventType, QAProps } from '../common';
|
|
4
|
+
import { AnalyticsEventsBase, ClassNameProps, PixelEvent, PixelEventType, QAProps } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -337,4 +337,20 @@ export interface TitleProps {
|
|
|
337
337
|
title?: TitleItemProps | string;
|
|
338
338
|
subtitle?: string;
|
|
339
339
|
}
|
|
340
|
+
export interface YandexFormProps extends AnalyticsEventsBase {
|
|
341
|
+
id: number | string;
|
|
342
|
+
containerId?: string;
|
|
343
|
+
theme?: string;
|
|
344
|
+
className?: string;
|
|
345
|
+
headerHeight?: number;
|
|
346
|
+
customFormOrigin?: string;
|
|
347
|
+
customFormSection?: string;
|
|
348
|
+
params?: {
|
|
349
|
+
[key: string]: string;
|
|
350
|
+
};
|
|
351
|
+
onSubmit?: () => void;
|
|
352
|
+
onLoad?: () => void;
|
|
353
|
+
metrikaGoals?: string | string[];
|
|
354
|
+
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
355
|
+
}
|
|
340
356
|
export {};
|
|
@@ -67,6 +67,7 @@ export interface QuoteProps extends Themable, CardBaseProps {
|
|
|
67
67
|
logo: ImageProps;
|
|
68
68
|
color?: string;
|
|
69
69
|
url?: string;
|
|
70
|
+
urlTitle?: string;
|
|
70
71
|
author?: AuthorItem;
|
|
71
72
|
buttonText?: string;
|
|
72
73
|
theme?: TextTheme;
|
|
@@ -81,6 +82,7 @@ export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase,
|
|
|
81
82
|
}
|
|
82
83
|
export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
|
|
83
84
|
url: string;
|
|
85
|
+
urlTitle?: string;
|
|
84
86
|
icon?: ImageProps;
|
|
85
87
|
target?: string;
|
|
86
88
|
iconPosition?: IconPosition;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Block, ConstructorItem } from './';
|
|
1
|
+
import { Block, ConstructorItem, FormBlockData, FormBlockHubspotData, FormBlockYandexData } from './';
|
|
2
2
|
import { MetrikaGoal, NewMetrikaGoal } from './index';
|
|
3
3
|
export declare function isBlock(block: ConstructorItem): block is Block;
|
|
4
4
|
export declare function isNewMetrikaFormat(metrika: MetrikaGoal): metrika is NewMetrikaGoal[];
|
|
5
|
+
export declare function isYandexDataForm(data: FormBlockData): data is FormBlockYandexData;
|
|
6
|
+
export declare function isHubspotDataForm(data: FormBlockData): data is FormBlockHubspotData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNewMetrikaFormat = exports.isBlock = void 0;
|
|
3
|
+
exports.isHubspotDataForm = exports.isYandexDataForm = exports.isNewMetrikaFormat = exports.isBlock = void 0;
|
|
4
4
|
const _1 = require("./");
|
|
5
5
|
function isBlock(block) {
|
|
6
6
|
return block.type in _1.BlockTypes;
|
|
@@ -10,3 +10,11 @@ function isNewMetrikaFormat(metrika) {
|
|
|
10
10
|
return Boolean(Array.isArray(metrika) && metrika.length && typeof metrika[0] === 'object');
|
|
11
11
|
}
|
|
12
12
|
exports.isNewMetrikaFormat = isNewMetrikaFormat;
|
|
13
|
+
function isYandexDataForm(data) {
|
|
14
|
+
return Boolean(data.yandex);
|
|
15
|
+
}
|
|
16
|
+
exports.isYandexDataForm = isYandexDataForm;
|
|
17
|
+
function isHubspotDataForm(data) {
|
|
18
|
+
return Boolean(data.hubspot);
|
|
19
|
+
}
|
|
20
|
+
exports.isHubspotDataForm = isHubspotDataForm;
|