@gravity-ui/page-constructor 1.19.0 → 1.20.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/CHANGELOG.md +14 -0
- package/README.md +79 -6
- package/build/cjs/blocks/Banner/schema.d.ts +234 -0
- package/build/cjs/blocks/CardLayout/schema.d.ts +6 -0
- package/build/cjs/blocks/ContentLayout/schema.d.ts +3 -0
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +81 -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/LinkTable/schema.d.ts +3 -0
- package/build/cjs/blocks/Map/schema.d.ts +129 -34
- package/build/cjs/blocks/Media/schema.d.ts +162 -0
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/cjs/blocks/Questions/schema.d.ts +3 -0
- package/build/cjs/blocks/Share/Share.js +5 -1
- package/build/cjs/blocks/Simple/schema.d.ts +3 -0
- package/build/cjs/blocks/Slider/schema.d.ts +3 -0
- package/build/cjs/blocks/Table/schema.d.ts +3 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +81 -0
- package/build/cjs/components/BackLink/BackLink.js +5 -1
- package/build/cjs/components/Button/Button.js +6 -2
- package/build/cjs/components/CardBase/CardBase.d.ts +2 -1
- package/build/cjs/components/CardBase/CardBase.js +5 -1
- package/build/cjs/components/Link/Link.js +5 -1
- package/build/cjs/components/Media/Media.js +3 -2
- package/build/cjs/components/Media/Video/Video.js +3 -2
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +16 -3
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -1
- package/build/cjs/components/YandexForm/YandexForm.js +14 -2
- package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/cjs/containers/PageConstructor/Provider.js +3 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +7 -4
- package/build/cjs/context/analyticsContext/analyticsContext.d.ts +7 -0
- package/build/cjs/context/analyticsContext/analyticsContext.js +6 -0
- package/build/cjs/context/analyticsContext/index.d.ts +1 -0
- package/build/cjs/context/analyticsContext/index.js +4 -0
- package/build/cjs/context/blockIdContext/blockIdContext.d.ts +3 -0
- package/build/cjs/context/blockIdContext/blockIdContext.js +6 -0
- package/build/cjs/context/blockIdContext/index.d.ts +1 -0
- package/build/cjs/context/blockIdContext/index.js +4 -0
- package/build/cjs/context/metrikaContext/metrikaContext.d.ts +6 -0
- package/build/cjs/hooks/index.d.ts +1 -0
- package/build/cjs/hooks/index.js +1 -0
- package/build/cjs/hooks/useAnalytics.d.ts +2 -0
- package/build/cjs/hooks/useAnalytics.js +35 -0
- package/build/cjs/hooks/useMetrika.d.ts +6 -0
- package/build/cjs/hooks/useMetrika.js +8 -0
- package/build/cjs/models/common.d.ts +45 -0
- package/build/cjs/models/common.js +22 -1
- package/build/cjs/models/constructor-items/common.d.ts +5 -5
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -2
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +5 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +4 -2
- package/build/cjs/schema/validators/common.d.ts +309 -43
- package/build/cjs/schema/validators/common.js +39 -18
- package/build/cjs/schema/validators/event.d.ts +37 -0
- package/build/cjs/schema/validators/event.js +38 -0
- package/build/cjs/sub-blocks/HubspotForm/index.js +15 -2
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +13 -0
- package/build/cjs/sub-blocks/Quote/Quote.js +4 -1
- package/build/cjs/utils/analytics.d.ts +2 -0
- package/build/cjs/utils/analytics.js +17 -0
- package/build/cjs/utils/index.d.ts +1 -0
- package/build/cjs/utils/index.js +1 -0
- package/build/esm/blocks/Banner/schema.d.ts +234 -0
- package/build/esm/blocks/CardLayout/schema.d.ts +6 -0
- package/build/esm/blocks/ContentLayout/schema.d.ts +3 -0
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +81 -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/LinkTable/schema.d.ts +3 -0
- package/build/esm/blocks/Map/schema.d.ts +129 -34
- package/build/esm/blocks/Media/schema.d.ts +162 -0
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/esm/blocks/Questions/schema.d.ts +3 -0
- package/build/esm/blocks/Share/Share.js +6 -2
- package/build/esm/blocks/Simple/schema.d.ts +3 -0
- package/build/esm/blocks/Slider/schema.d.ts +3 -0
- package/build/esm/blocks/Table/schema.d.ts +3 -0
- package/build/esm/blocks/Tabs/schema.d.ts +81 -0
- package/build/esm/components/BackLink/BackLink.js +5 -1
- package/build/esm/components/Button/Button.js +6 -2
- package/build/esm/components/CardBase/CardBase.d.ts +2 -1
- package/build/esm/components/CardBase/CardBase.js +5 -1
- package/build/esm/components/Link/Link.js +5 -1
- package/build/esm/components/Media/Media.js +3 -2
- package/build/esm/components/Media/Video/Video.js +3 -2
- package/build/esm/components/ReactPlayer/ReactPlayer.js +17 -4
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -1
- package/build/esm/components/YandexForm/YandexForm.js +14 -2
- package/build/esm/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/esm/containers/PageConstructor/Provider.js +3 -1
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +7 -4
- package/build/esm/context/analyticsContext/analyticsContext.d.ts +7 -0
- package/build/esm/context/analyticsContext/analyticsContext.js +2 -0
- package/build/esm/context/analyticsContext/index.d.ts +1 -0
- package/build/esm/context/analyticsContext/index.js +1 -0
- package/build/esm/context/blockIdContext/blockIdContext.d.ts +3 -0
- package/build/esm/context/blockIdContext/blockIdContext.js +2 -0
- package/build/esm/context/blockIdContext/index.d.ts +1 -0
- package/build/esm/context/blockIdContext/index.js +1 -0
- package/build/esm/context/metrikaContext/metrikaContext.d.ts +6 -0
- package/build/esm/hooks/index.d.ts +1 -0
- package/build/esm/hooks/index.js +1 -0
- package/build/esm/hooks/useAnalytics.d.ts +2 -0
- package/build/esm/hooks/useAnalytics.js +31 -0
- package/build/esm/hooks/useMetrika.d.ts +6 -0
- package/build/esm/hooks/useMetrika.js +8 -0
- package/build/esm/models/common.d.ts +45 -0
- package/build/esm/models/common.js +21 -0
- package/build/esm/models/constructor-items/common.d.ts +5 -5
- package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -2
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +5 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +4 -2
- package/build/esm/schema/validators/common.d.ts +309 -43
- package/build/esm/schema/validators/common.js +39 -18
- package/build/esm/schema/validators/event.d.ts +37 -0
- package/build/esm/schema/validators/event.js +35 -0
- package/build/esm/sub-blocks/HubspotForm/index.js +16 -3
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +13 -0
- package/build/esm/sub-blocks/Quote/Quote.js +6 -3
- package/build/esm/utils/analytics.d.ts +2 -0
- package/build/esm/utils/analytics.js +13 -0
- package/build/esm/utils/index.d.ts +1 -0
- package/build/esm/utils/index.js +1 -0
- package/package.json +1 -1
- package/server/models/common.d.ts +45 -0
- package/server/models/common.js +22 -1
- package/server/models/constructor-items/common.d.ts +5 -5
- package/server/models/constructor-items/sub-blocks.d.ts +2 -2
- package/server/utils/analytics.d.ts +2 -0
- package/server/utils/analytics.js +17 -0
- package/server/utils/index.d.ts +1 -0
- package/server/utils/index.js +1 -0
|
@@ -318,6 +318,84 @@ export declare const LinkProps: {
|
|
|
318
318
|
type: string;
|
|
319
319
|
enum: string[];
|
|
320
320
|
};
|
|
321
|
+
analyticsEvents: {
|
|
322
|
+
anyOf: ({
|
|
323
|
+
type: string;
|
|
324
|
+
additionalProperties: {
|
|
325
|
+
type: string;
|
|
326
|
+
};
|
|
327
|
+
required: string[];
|
|
328
|
+
properties: {
|
|
329
|
+
name: {
|
|
330
|
+
type: string;
|
|
331
|
+
};
|
|
332
|
+
type: {
|
|
333
|
+
type: string;
|
|
334
|
+
};
|
|
335
|
+
counters: {
|
|
336
|
+
type: string;
|
|
337
|
+
additionalProperties: boolean;
|
|
338
|
+
required: never[];
|
|
339
|
+
properties: {
|
|
340
|
+
include: {
|
|
341
|
+
type: string;
|
|
342
|
+
items: {
|
|
343
|
+
type: string;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
exclude: {
|
|
347
|
+
type: string;
|
|
348
|
+
items: {
|
|
349
|
+
type: string;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
context: {
|
|
355
|
+
type: string;
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
} | {
|
|
359
|
+
type: string;
|
|
360
|
+
items: {
|
|
361
|
+
type: string;
|
|
362
|
+
additionalProperties: {
|
|
363
|
+
type: string;
|
|
364
|
+
};
|
|
365
|
+
required: string[];
|
|
366
|
+
properties: {
|
|
367
|
+
name: {
|
|
368
|
+
type: string;
|
|
369
|
+
};
|
|
370
|
+
type: {
|
|
371
|
+
type: string;
|
|
372
|
+
};
|
|
373
|
+
counters: {
|
|
374
|
+
type: string;
|
|
375
|
+
additionalProperties: boolean;
|
|
376
|
+
required: never[];
|
|
377
|
+
properties: {
|
|
378
|
+
include: {
|
|
379
|
+
type: string;
|
|
380
|
+
items: {
|
|
381
|
+
type: string;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
exclude: {
|
|
385
|
+
type: string;
|
|
386
|
+
items: {
|
|
387
|
+
type: string;
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
context: {
|
|
393
|
+
type: string;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
})[];
|
|
398
|
+
};
|
|
321
399
|
type: {};
|
|
322
400
|
when: {};
|
|
323
401
|
};
|
|
@@ -414,6 +492,9 @@ export declare const ButtonProps: {
|
|
|
414
492
|
};
|
|
415
493
|
})[];
|
|
416
494
|
};
|
|
495
|
+
/**
|
|
496
|
+
* @deprecated Metrika will be deleted
|
|
497
|
+
*/
|
|
417
498
|
metrikaGoals: {
|
|
418
499
|
anyOf: ({
|
|
419
500
|
type: string;
|
|
@@ -443,6 +524,9 @@ export declare const ButtonProps: {
|
|
|
443
524
|
};
|
|
444
525
|
})[];
|
|
445
526
|
};
|
|
527
|
+
/**
|
|
528
|
+
* @deprecated Pixel will be deleted
|
|
529
|
+
*/
|
|
446
530
|
pixelEvents: {
|
|
447
531
|
type: string;
|
|
448
532
|
items: {
|
|
@@ -499,6 +583,84 @@ export declare const ButtonProps: {
|
|
|
499
583
|
};
|
|
500
584
|
};
|
|
501
585
|
};
|
|
586
|
+
analyticsEvents: {
|
|
587
|
+
anyOf: ({
|
|
588
|
+
type: string;
|
|
589
|
+
additionalProperties: {
|
|
590
|
+
type: string;
|
|
591
|
+
};
|
|
592
|
+
required: string[];
|
|
593
|
+
properties: {
|
|
594
|
+
name: {
|
|
595
|
+
type: string;
|
|
596
|
+
};
|
|
597
|
+
type: {
|
|
598
|
+
type: string;
|
|
599
|
+
};
|
|
600
|
+
counters: {
|
|
601
|
+
type: string;
|
|
602
|
+
additionalProperties: boolean;
|
|
603
|
+
required: never[];
|
|
604
|
+
properties: {
|
|
605
|
+
include: {
|
|
606
|
+
type: string;
|
|
607
|
+
items: {
|
|
608
|
+
type: string;
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
exclude: {
|
|
612
|
+
type: string;
|
|
613
|
+
items: {
|
|
614
|
+
type: string;
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
context: {
|
|
620
|
+
type: string;
|
|
621
|
+
};
|
|
622
|
+
};
|
|
623
|
+
} | {
|
|
624
|
+
type: string;
|
|
625
|
+
items: {
|
|
626
|
+
type: string;
|
|
627
|
+
additionalProperties: {
|
|
628
|
+
type: string;
|
|
629
|
+
};
|
|
630
|
+
required: string[];
|
|
631
|
+
properties: {
|
|
632
|
+
name: {
|
|
633
|
+
type: string;
|
|
634
|
+
};
|
|
635
|
+
type: {
|
|
636
|
+
type: string;
|
|
637
|
+
};
|
|
638
|
+
counters: {
|
|
639
|
+
type: string;
|
|
640
|
+
additionalProperties: boolean;
|
|
641
|
+
required: never[];
|
|
642
|
+
properties: {
|
|
643
|
+
include: {
|
|
644
|
+
type: string;
|
|
645
|
+
items: {
|
|
646
|
+
type: string;
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
exclude: {
|
|
650
|
+
type: string;
|
|
651
|
+
items: {
|
|
652
|
+
type: string;
|
|
653
|
+
};
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
};
|
|
657
|
+
context: {
|
|
658
|
+
type: string;
|
|
659
|
+
};
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
})[];
|
|
663
|
+
};
|
|
502
664
|
target: {
|
|
503
665
|
type: string;
|
|
504
666
|
enum: string[];
|
|
@@ -558,6 +720,9 @@ export declare const BlockBaseProps: {
|
|
|
558
720
|
resetPaddings: {
|
|
559
721
|
type: string;
|
|
560
722
|
};
|
|
723
|
+
context: {
|
|
724
|
+
type: string;
|
|
725
|
+
};
|
|
561
726
|
type: {};
|
|
562
727
|
when: {};
|
|
563
728
|
};
|
|
@@ -629,6 +794,9 @@ export declare const ButtonBlock: {
|
|
|
629
794
|
};
|
|
630
795
|
})[];
|
|
631
796
|
};
|
|
797
|
+
/**
|
|
798
|
+
* @deprecated Metrika will be deleted
|
|
799
|
+
*/
|
|
632
800
|
metrikaGoals: {
|
|
633
801
|
anyOf: ({
|
|
634
802
|
type: string;
|
|
@@ -658,6 +826,9 @@ export declare const ButtonBlock: {
|
|
|
658
826
|
};
|
|
659
827
|
})[];
|
|
660
828
|
};
|
|
829
|
+
/**
|
|
830
|
+
* @deprecated Pixel will be deleted
|
|
831
|
+
*/
|
|
661
832
|
pixelEvents: {
|
|
662
833
|
type: string;
|
|
663
834
|
items: {
|
|
@@ -714,6 +885,84 @@ export declare const ButtonBlock: {
|
|
|
714
885
|
};
|
|
715
886
|
};
|
|
716
887
|
};
|
|
888
|
+
analyticsEvents: {
|
|
889
|
+
anyOf: ({
|
|
890
|
+
type: string;
|
|
891
|
+
additionalProperties: {
|
|
892
|
+
type: string;
|
|
893
|
+
};
|
|
894
|
+
required: string[];
|
|
895
|
+
properties: {
|
|
896
|
+
name: {
|
|
897
|
+
type: string;
|
|
898
|
+
};
|
|
899
|
+
type: {
|
|
900
|
+
type: string;
|
|
901
|
+
};
|
|
902
|
+
counters: {
|
|
903
|
+
type: string;
|
|
904
|
+
additionalProperties: boolean;
|
|
905
|
+
required: never[];
|
|
906
|
+
properties: {
|
|
907
|
+
include: {
|
|
908
|
+
type: string;
|
|
909
|
+
items: {
|
|
910
|
+
type: string;
|
|
911
|
+
};
|
|
912
|
+
};
|
|
913
|
+
exclude: {
|
|
914
|
+
type: string;
|
|
915
|
+
items: {
|
|
916
|
+
type: string;
|
|
917
|
+
};
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
context: {
|
|
922
|
+
type: string;
|
|
923
|
+
};
|
|
924
|
+
};
|
|
925
|
+
} | {
|
|
926
|
+
type: string;
|
|
927
|
+
items: {
|
|
928
|
+
type: string;
|
|
929
|
+
additionalProperties: {
|
|
930
|
+
type: string;
|
|
931
|
+
};
|
|
932
|
+
required: string[];
|
|
933
|
+
properties: {
|
|
934
|
+
name: {
|
|
935
|
+
type: string;
|
|
936
|
+
};
|
|
937
|
+
type: {
|
|
938
|
+
type: string;
|
|
939
|
+
};
|
|
940
|
+
counters: {
|
|
941
|
+
type: string;
|
|
942
|
+
additionalProperties: boolean;
|
|
943
|
+
required: never[];
|
|
944
|
+
properties: {
|
|
945
|
+
include: {
|
|
946
|
+
type: string;
|
|
947
|
+
items: {
|
|
948
|
+
type: string;
|
|
949
|
+
};
|
|
950
|
+
};
|
|
951
|
+
exclude: {
|
|
952
|
+
type: string;
|
|
953
|
+
items: {
|
|
954
|
+
type: string;
|
|
955
|
+
};
|
|
956
|
+
};
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
context: {
|
|
960
|
+
type: string;
|
|
961
|
+
};
|
|
962
|
+
};
|
|
963
|
+
};
|
|
964
|
+
})[];
|
|
965
|
+
};
|
|
717
966
|
target: {
|
|
718
967
|
type: string;
|
|
719
968
|
enum: string[];
|
|
@@ -864,33 +1113,9 @@ export declare const MediaProps: {
|
|
|
864
1113
|
};
|
|
865
1114
|
};
|
|
866
1115
|
export declare const YMapMarkerLabel: {
|
|
1116
|
+
type: string;
|
|
867
1117
|
required: never[];
|
|
868
|
-
|
|
869
|
-
type: string;
|
|
870
|
-
};
|
|
871
|
-
iconContent: {
|
|
872
|
-
type: string;
|
|
873
|
-
};
|
|
874
|
-
iconColor: {
|
|
875
|
-
type: string;
|
|
876
|
-
};
|
|
877
|
-
preset: {
|
|
878
|
-
type: string;
|
|
879
|
-
};
|
|
880
|
-
};
|
|
881
|
-
export declare const YMapMarker: {
|
|
882
|
-
required: never[];
|
|
883
|
-
coordinate: {
|
|
884
|
-
type: string;
|
|
885
|
-
items: {
|
|
886
|
-
type: string;
|
|
887
|
-
};
|
|
888
|
-
};
|
|
889
|
-
address: {
|
|
890
|
-
type: string;
|
|
891
|
-
};
|
|
892
|
-
label: {
|
|
893
|
-
required: never[];
|
|
1118
|
+
properties: {
|
|
894
1119
|
iconCaption: {
|
|
895
1120
|
type: string;
|
|
896
1121
|
};
|
|
@@ -905,6 +1130,40 @@ export declare const YMapMarker: {
|
|
|
905
1130
|
};
|
|
906
1131
|
};
|
|
907
1132
|
};
|
|
1133
|
+
export declare const YMapMarker: {
|
|
1134
|
+
type: string;
|
|
1135
|
+
additionalProperties: boolean;
|
|
1136
|
+
required: never[];
|
|
1137
|
+
properties: {
|
|
1138
|
+
coordinate: {
|
|
1139
|
+
type: string;
|
|
1140
|
+
items: {
|
|
1141
|
+
type: string;
|
|
1142
|
+
};
|
|
1143
|
+
};
|
|
1144
|
+
address: {
|
|
1145
|
+
type: string;
|
|
1146
|
+
};
|
|
1147
|
+
label: {
|
|
1148
|
+
type: string;
|
|
1149
|
+
required: never[];
|
|
1150
|
+
properties: {
|
|
1151
|
+
iconCaption: {
|
|
1152
|
+
type: string;
|
|
1153
|
+
};
|
|
1154
|
+
iconContent: {
|
|
1155
|
+
type: string;
|
|
1156
|
+
};
|
|
1157
|
+
iconColor: {
|
|
1158
|
+
type: string;
|
|
1159
|
+
};
|
|
1160
|
+
preset: {
|
|
1161
|
+
type: string;
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
908
1167
|
export declare const MapProps: {
|
|
909
1168
|
zoom: {
|
|
910
1169
|
type: string;
|
|
@@ -925,29 +1184,36 @@ export declare const MapProps: {
|
|
|
925
1184
|
type: string;
|
|
926
1185
|
items: {
|
|
927
1186
|
type: {
|
|
1187
|
+
type: string;
|
|
1188
|
+
additionalProperties: boolean;
|
|
928
1189
|
required: never[];
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
items: {
|
|
932
|
-
type: string;
|
|
933
|
-
};
|
|
934
|
-
};
|
|
935
|
-
address: {
|
|
936
|
-
type: string;
|
|
937
|
-
};
|
|
938
|
-
label: {
|
|
939
|
-
required: never[];
|
|
940
|
-
iconCaption: {
|
|
941
|
-
type: string;
|
|
942
|
-
};
|
|
943
|
-
iconContent: {
|
|
1190
|
+
properties: {
|
|
1191
|
+
coordinate: {
|
|
944
1192
|
type: string;
|
|
1193
|
+
items: {
|
|
1194
|
+
type: string;
|
|
1195
|
+
};
|
|
945
1196
|
};
|
|
946
|
-
|
|
1197
|
+
address: {
|
|
947
1198
|
type: string;
|
|
948
1199
|
};
|
|
949
|
-
|
|
1200
|
+
label: {
|
|
950
1201
|
type: string;
|
|
1202
|
+
required: never[];
|
|
1203
|
+
properties: {
|
|
1204
|
+
iconCaption: {
|
|
1205
|
+
type: string;
|
|
1206
|
+
};
|
|
1207
|
+
iconContent: {
|
|
1208
|
+
type: string;
|
|
1209
|
+
};
|
|
1210
|
+
iconColor: {
|
|
1211
|
+
type: string;
|
|
1212
|
+
};
|
|
1213
|
+
preset: {
|
|
1214
|
+
type: string;
|
|
1215
|
+
};
|
|
1216
|
+
};
|
|
951
1217
|
};
|
|
952
1218
|
};
|
|
953
1219
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { pixelEvents } from './pixel';
|
|
2
2
|
import { Theme } from '../../models';
|
|
3
3
|
import { ImageProps, urlPattern } from '../../components/Image/schema';
|
|
4
|
+
import { AnalyticsEventSchema } from './event';
|
|
4
5
|
export const mediaDirection = ['media-content', 'content-media'];
|
|
5
6
|
export const textSize = ['s', 'm', 'l'];
|
|
6
7
|
export const containerSizesArray = ['sm', 'md', 'lg', 'xl', 'all'];
|
|
@@ -174,6 +175,8 @@ export const LinkProps = {
|
|
|
174
175
|
}, target: {
|
|
175
176
|
type: 'string',
|
|
176
177
|
enum: ['_blank', '_parent', '_top', '_self'],
|
|
178
|
+
}, analyticsEvents: {
|
|
179
|
+
anyOf: [AnalyticsEventSchema, { type: 'array', items: AnalyticsEventSchema }],
|
|
177
180
|
} }),
|
|
178
181
|
};
|
|
179
182
|
export const FileLinkProps = {
|
|
@@ -306,6 +309,9 @@ export const ButtonProps = {
|
|
|
306
309
|
},
|
|
307
310
|
],
|
|
308
311
|
},
|
|
312
|
+
/**
|
|
313
|
+
* @deprecated Metrika will be deleted
|
|
314
|
+
*/
|
|
309
315
|
metrikaGoals: {
|
|
310
316
|
anyOf: [
|
|
311
317
|
{ type: 'string' },
|
|
@@ -328,7 +334,13 @@ export const ButtonProps = {
|
|
|
328
334
|
},
|
|
329
335
|
],
|
|
330
336
|
},
|
|
337
|
+
/**
|
|
338
|
+
* @deprecated Pixel will be deleted
|
|
339
|
+
*/
|
|
331
340
|
pixelEvents,
|
|
341
|
+
analyticsEvents: {
|
|
342
|
+
anyOf: [AnalyticsEventSchema, { type: 'array', items: AnalyticsEventSchema }],
|
|
343
|
+
},
|
|
332
344
|
target: {
|
|
333
345
|
type: 'string',
|
|
334
346
|
enum: ['_self', '_blank', '_parent', '_top'],
|
|
@@ -376,6 +388,8 @@ export const BlockBaseProps = Object.assign(Object.assign({}, BaseProps), { anch
|
|
|
376
388
|
enum: containerSizesArray,
|
|
377
389
|
}, resetPaddings: {
|
|
378
390
|
type: 'boolean',
|
|
391
|
+
}, context: {
|
|
392
|
+
type: 'string',
|
|
379
393
|
} });
|
|
380
394
|
export const TitleProps = {
|
|
381
395
|
type: 'object',
|
|
@@ -439,30 +453,37 @@ export const MediaProps = {
|
|
|
439
453
|
dataLens: DataLensProps,
|
|
440
454
|
};
|
|
441
455
|
export const YMapMarkerLabel = {
|
|
456
|
+
type: 'object',
|
|
442
457
|
required: [],
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
458
|
+
properties: {
|
|
459
|
+
iconCaption: {
|
|
460
|
+
type: 'string',
|
|
461
|
+
},
|
|
462
|
+
iconContent: {
|
|
463
|
+
type: 'string',
|
|
464
|
+
},
|
|
465
|
+
iconColor: {
|
|
466
|
+
type: 'string',
|
|
467
|
+
},
|
|
468
|
+
preset: {
|
|
469
|
+
type: 'string',
|
|
470
|
+
},
|
|
454
471
|
},
|
|
455
472
|
};
|
|
456
473
|
export const YMapMarker = {
|
|
474
|
+
type: 'object',
|
|
475
|
+
additionalProperties: false,
|
|
457
476
|
required: [],
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
477
|
+
properties: {
|
|
478
|
+
coordinate: {
|
|
479
|
+
type: 'array',
|
|
480
|
+
items: { type: 'number' },
|
|
481
|
+
},
|
|
482
|
+
address: {
|
|
483
|
+
type: 'string',
|
|
484
|
+
},
|
|
485
|
+
label: YMapMarkerLabel,
|
|
464
486
|
},
|
|
465
|
-
label: YMapMarkerLabel,
|
|
466
487
|
};
|
|
467
488
|
export const MapProps = {
|
|
468
489
|
zoom: {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const AnalyticsEventSchema: {
|
|
2
|
+
type: string;
|
|
3
|
+
additionalProperties: {
|
|
4
|
+
type: string;
|
|
5
|
+
};
|
|
6
|
+
required: string[];
|
|
7
|
+
properties: {
|
|
8
|
+
name: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
type: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
counters: {
|
|
15
|
+
type: string;
|
|
16
|
+
additionalProperties: boolean;
|
|
17
|
+
required: never[];
|
|
18
|
+
properties: {
|
|
19
|
+
include: {
|
|
20
|
+
type: string;
|
|
21
|
+
items: {
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exclude: {
|
|
26
|
+
type: string;
|
|
27
|
+
items: {
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
context: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const AnalyticsEventSchema = {
|
|
2
|
+
type: 'object',
|
|
3
|
+
additionalProperties: { type: 'string' },
|
|
4
|
+
required: ['name'],
|
|
5
|
+
properties: {
|
|
6
|
+
name: {
|
|
7
|
+
type: 'string',
|
|
8
|
+
},
|
|
9
|
+
type: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
},
|
|
12
|
+
counters: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
additionalProperties: false,
|
|
15
|
+
required: [],
|
|
16
|
+
properties: {
|
|
17
|
+
include: {
|
|
18
|
+
type: 'array',
|
|
19
|
+
items: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
exclude: {
|
|
24
|
+
type: 'array',
|
|
25
|
+
items: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
context: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -3,15 +3,17 @@ import { block } from '../../utils';
|
|
|
3
3
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
4
4
|
import { MobileContext } from '../../context/mobileContext';
|
|
5
5
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
6
|
-
import {
|
|
6
|
+
import { DefaultEventNames } from '../../models';
|
|
7
|
+
import { useHandleHubspotEvents, useAnalytics } from '../../hooks';
|
|
7
8
|
import HubspotFormContainer from './HubspotFormContainer';
|
|
8
9
|
import './HubspotForm.css';
|
|
9
10
|
const b = block('hubspot-form');
|
|
10
11
|
const HubspotForm = (props) => {
|
|
11
12
|
const { className, theme: themeProp, isMobile: isMobileProp, formId, formInstanceId, portalId, region, formClassName, pixelEvents,
|
|
12
13
|
// hubspotEvents, // TODO: decide how to handle them
|
|
13
|
-
onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, createDOMElement, onSubmitError, } = props;
|
|
14
|
+
analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, createDOMElement, onSubmitError, } = props;
|
|
14
15
|
const handleMetrika = useMetrika();
|
|
16
|
+
const handleAnalytics = useAnalytics(DefaultEventNames.HubspotFormSubmit);
|
|
15
17
|
const { themeValue } = useContext(ThemeValueContext);
|
|
16
18
|
const isMobileValue = useContext(MobileContext);
|
|
17
19
|
const theme = themeProp !== null && themeProp !== void 0 ? themeProp : themeValue;
|
|
@@ -23,9 +25,20 @@ const HubspotForm = (props) => {
|
|
|
23
25
|
onSubmitError,
|
|
24
26
|
onSubmit: (e) => {
|
|
25
27
|
handleMetrika === null || handleMetrika === void 0 ? void 0 : handleMetrika({ pixelEvents });
|
|
28
|
+
handleAnalytics(analyticsEvents);
|
|
26
29
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(e);
|
|
27
30
|
},
|
|
28
|
-
}), [
|
|
31
|
+
}), [
|
|
32
|
+
onBeforeLoad,
|
|
33
|
+
onBeforeSubmit,
|
|
34
|
+
onLoad,
|
|
35
|
+
handleMetrika,
|
|
36
|
+
pixelEvents,
|
|
37
|
+
handleAnalytics,
|
|
38
|
+
analyticsEvents,
|
|
39
|
+
onSubmit,
|
|
40
|
+
onSubmitError,
|
|
41
|
+
]);
|
|
29
42
|
useHandleHubspotEvents(handlers, formId);
|
|
30
43
|
return (React.createElement(HubspotFormContainer, { createDOMElement: createDOMElement, key: [formClassName, formId, formInstanceId, portalId, region].join(), className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region }));
|
|
31
44
|
};
|
|
@@ -9,6 +9,19 @@ export declare const getLayoutItemLinks: (links: LayoutItemProps['content']['lin
|
|
|
9
9
|
target?: string | undefined;
|
|
10
10
|
metrikaGoals?: import("../../models").MetrikaGoal | undefined;
|
|
11
11
|
pixelEvents?: import("../../models").ButtonPixel | undefined;
|
|
12
|
+
analyticsEvents?: {
|
|
13
|
+
name: string;
|
|
14
|
+
type?: string | undefined;
|
|
15
|
+
counters?: import("../../models").AnalyticsCounters | undefined;
|
|
16
|
+
context?: string | undefined;
|
|
17
|
+
target?: string | undefined;
|
|
18
|
+
} | {
|
|
19
|
+
name: string;
|
|
20
|
+
type?: string | undefined;
|
|
21
|
+
counters?: import("../../models").AnalyticsCounters | undefined;
|
|
22
|
+
context?: string | undefined;
|
|
23
|
+
target?: string | undefined;
|
|
24
|
+
}[] | undefined;
|
|
12
25
|
className?: string | undefined;
|
|
13
26
|
}[] | undefined;
|
|
14
27
|
export declare const hasFullScreen: ({ dataLens, image }: MediaProps) => boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
1
|
+
import React, { useCallback, useContext } from 'react';
|
|
2
2
|
import { Button } from '@gravity-ui/uikit';
|
|
3
3
|
import { block, getThemedValue } from '../../utils';
|
|
4
|
-
import { AuthorType } from '../../models';
|
|
4
|
+
import { AuthorType, DefaultEventNames } from '../../models';
|
|
5
5
|
import { Author, Image, HTML } from '../../components';
|
|
6
6
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
7
7
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
8
|
+
import { useAnalytics } from '../../hooks';
|
|
8
9
|
import './Quote.css';
|
|
9
10
|
const b = block('quote');
|
|
10
11
|
const Quote = (props) => {
|
|
@@ -12,9 +13,11 @@ const Quote = (props) => {
|
|
|
12
13
|
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
13
14
|
const imageThemed = getThemedValue(image, theme);
|
|
14
15
|
const imageData = getMediaImage(imageThemed);
|
|
16
|
+
const handleAnalytics = useAnalytics(DefaultEventNames.QuoteButton, url);
|
|
17
|
+
const handleButtonClick = useCallback(() => handleAnalytics(), [handleAnalytics]);
|
|
15
18
|
const renderFooter = Boolean(author || url) && (React.createElement("div", { className: b('author-wrapper') },
|
|
16
19
|
author && (React.createElement(Author, { className: b('author', { theme: textTheme }), author: author, type: AuthorType.Line })),
|
|
17
|
-
url && buttonText && (React.createElement(Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }) }, buttonText))));
|
|
20
|
+
url && buttonText && (React.createElement(Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick }, buttonText))));
|
|
18
21
|
return (React.createElement("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {} },
|
|
19
22
|
React.createElement("div", { key: text, className: b('content-wrapper') },
|
|
20
23
|
React.createElement("div", null,
|