@gravity-ui/page-constructor 1.19.1 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +81 -0
- 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/models/navigation.d.ts +3 -9
- package/build/cjs/models/navigation.js +0 -1
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +4 -3
- package/build/cjs/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +4 -2
- package/build/cjs/schema/validators/common.d.ts +249 -0
- package/build/cjs/schema/validators/common.js +14 -0
- 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 +81 -0
- 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/models/navigation.d.ts +3 -9
- package/build/esm/models/navigation.js +0 -1
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +4 -3
- package/build/esm/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +4 -2
- package/build/esm/schema/validators/common.d.ts +249 -0
- package/build/esm/schema/validators/common.js +14 -0
- 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 -2
- 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/models/navigation.d.ts +3 -9
- package/server/models/navigation.js +0 -1
- 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
- package/build/cjs/navigation/components/NavigationItem/components/GithubStars/GithubStars.css +0 -14
- package/build/cjs/navigation/components/NavigationItem/components/GithubStars/GithubStars.d.ts +0 -5
- package/build/cjs/navigation/components/NavigationItem/components/GithubStars/GithubStars.js +0 -11
- package/build/esm/navigation/components/NavigationItem/components/GithubStars/GithubStars.css +0 -14
- package/build/esm/navigation/components/NavigationItem/components/GithubStars/GithubStars.d.ts +0 -6
- package/build/esm/navigation/components/NavigationItem/components/GithubStars/GithubStars.js +0 -7
|
@@ -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[];
|
|
@@ -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',
|
|
@@ -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,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const isCounterAllowed = (counter, counters) => {
|
|
2
|
+
var _a, _b;
|
|
3
|
+
if (!counters) {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
if ((_a = counters.exclude) === null || _a === void 0 ? void 0 : _a.includes(counter)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
else if ((_b = counters.include) === null || _b === void 0 ? void 0 : _b.includes(counter)) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
};
|
package/build/esm/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.1",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"@gravity-ui/i18n": "^1.0.0",
|
|
50
50
|
"bem-cn-lite": "^4.0.0",
|
|
51
51
|
"lodash": "^4.17.21",
|
|
52
|
-
"react-github-btn": "^1.4.0",
|
|
53
52
|
"react-player": "^2.9.0",
|
|
54
53
|
"react-slick": "^0.28.1",
|
|
55
54
|
"react-spring": "^9.3.0",
|
|
@@ -7,12 +7,21 @@ export declare enum Theme {
|
|
|
7
7
|
Light = "light",
|
|
8
8
|
Dark = "dark"
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Pixel will be deleted
|
|
12
|
+
*/
|
|
10
13
|
type PixelCommand = 'track' | 'trackCustom';
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Pixel will be deleted
|
|
16
|
+
*/
|
|
11
17
|
export interface PixelEvent {
|
|
12
18
|
command: PixelCommand;
|
|
13
19
|
event: PixelEventType | string;
|
|
14
20
|
data?: Object;
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Pixel will be deleted from package
|
|
24
|
+
*/
|
|
16
25
|
export declare enum PixelEventType {
|
|
17
26
|
AddPaymentInfo = "AddPaymentInfo",
|
|
18
27
|
AddToCart = "AddToCart",
|
|
@@ -36,11 +45,17 @@ export declare enum PixelEventType {
|
|
|
36
45
|
export type Modifiers = {
|
|
37
46
|
[name: string]: string | boolean | undefined;
|
|
38
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Pixel will be deleted
|
|
50
|
+
*/
|
|
39
51
|
export interface Pixel<TEvent = string> {
|
|
40
52
|
trackStandard: (event: TEvent, data?: Object) => void;
|
|
41
53
|
trackCustom: (event: string, data?: Object) => void;
|
|
42
54
|
track: (trackEvents: string | string[] | PixelEvent[] | PixelEvent) => void;
|
|
43
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Metrika will be deleted
|
|
58
|
+
*/
|
|
44
59
|
export interface Metrika {
|
|
45
60
|
reachGoal: (counterName: string, ...args: any) => void;
|
|
46
61
|
reachGoals: (goals: MetrikaGoal, counterName?: string) => void;
|
|
@@ -49,4 +64,34 @@ export interface ClassNameProps {
|
|
|
49
64
|
className?: string;
|
|
50
65
|
}
|
|
51
66
|
export type Timeout = ReturnType<typeof setTimeout> | undefined;
|
|
67
|
+
export declare enum PredefinedEventTypes {
|
|
68
|
+
Default = "default-event",
|
|
69
|
+
Play = "play",
|
|
70
|
+
Stop = "stop"
|
|
71
|
+
}
|
|
72
|
+
export declare enum DefaultEventNames {
|
|
73
|
+
ShareButton = "share-button-click",
|
|
74
|
+
Button = "button-click",
|
|
75
|
+
CardBase = "card-base-click",
|
|
76
|
+
Link = "link-click",
|
|
77
|
+
ReactPlayerControls = "react-player-controls-click",
|
|
78
|
+
YandexFormSubmit = "yandex-form-submit",
|
|
79
|
+
HubspotFormSubmit = "hubspot-form-submit",
|
|
80
|
+
QuoteButton = "quote-button-click",
|
|
81
|
+
BackLink = "back-link-click"
|
|
82
|
+
}
|
|
83
|
+
export type AnalyticsCounters = {
|
|
84
|
+
include?: string[];
|
|
85
|
+
exclude?: string[];
|
|
86
|
+
};
|
|
87
|
+
export type AnalyticsEvent<T = {}> = T & {
|
|
88
|
+
name: string;
|
|
89
|
+
type?: string;
|
|
90
|
+
counters?: AnalyticsCounters;
|
|
91
|
+
context?: string;
|
|
92
|
+
target?: string;
|
|
93
|
+
};
|
|
94
|
+
export interface AnalyticsEventsBase {
|
|
95
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
96
|
+
}
|
|
52
97
|
export {};
|
package/server/models/common.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PixelEventType = exports.Theme = void 0;
|
|
3
|
+
exports.DefaultEventNames = exports.PredefinedEventTypes = exports.PixelEventType = exports.Theme = void 0;
|
|
4
4
|
var Theme;
|
|
5
5
|
(function (Theme) {
|
|
6
6
|
Theme["Light"] = "light";
|
|
7
7
|
Theme["Dark"] = "dark";
|
|
8
8
|
})(Theme = exports.Theme || (exports.Theme = {}));
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Pixel will be deleted from package
|
|
11
|
+
*/
|
|
9
12
|
var PixelEventType;
|
|
10
13
|
(function (PixelEventType) {
|
|
11
14
|
PixelEventType["AddPaymentInfo"] = "AddPaymentInfo";
|
|
@@ -27,3 +30,21 @@ var PixelEventType;
|
|
|
27
30
|
PixelEventType["Subscribe"] = "Subscribe";
|
|
28
31
|
PixelEventType["ViewContent"] = "ViewContent";
|
|
29
32
|
})(PixelEventType = exports.PixelEventType || (exports.PixelEventType = {}));
|
|
33
|
+
var PredefinedEventTypes;
|
|
34
|
+
(function (PredefinedEventTypes) {
|
|
35
|
+
PredefinedEventTypes["Default"] = "default-event";
|
|
36
|
+
PredefinedEventTypes["Play"] = "play";
|
|
37
|
+
PredefinedEventTypes["Stop"] = "stop";
|
|
38
|
+
})(PredefinedEventTypes = exports.PredefinedEventTypes || (exports.PredefinedEventTypes = {}));
|
|
39
|
+
var DefaultEventNames;
|
|
40
|
+
(function (DefaultEventNames) {
|
|
41
|
+
DefaultEventNames["ShareButton"] = "share-button-click";
|
|
42
|
+
DefaultEventNames["Button"] = "button-click";
|
|
43
|
+
DefaultEventNames["CardBase"] = "card-base-click";
|
|
44
|
+
DefaultEventNames["Link"] = "link-click";
|
|
45
|
+
DefaultEventNames["ReactPlayerControls"] = "react-player-controls-click";
|
|
46
|
+
DefaultEventNames["YandexFormSubmit"] = "yandex-form-submit";
|
|
47
|
+
DefaultEventNames["HubspotFormSubmit"] = "hubspot-form-submit";
|
|
48
|
+
DefaultEventNames["QuoteButton"] = "quote-button-click";
|
|
49
|
+
DefaultEventNames["BackLink"] = "back-link-click";
|
|
50
|
+
})(DefaultEventNames = exports.DefaultEventNames || (exports.DefaultEventNames = {}));
|