@gravity-ui/page-constructor 1.14.0-alpha.8 → 1.14.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 +29 -0
- package/build/cjs/blocks/Banner/schema.d.ts +0 -336
- package/build/cjs/blocks/Media/schema.d.ts +0 -112
- package/build/cjs/components/Button/Button.js +2 -5
- package/build/cjs/components/CardBase/CardBase.d.ts +0 -2
- package/build/cjs/components/CardBase/CardBase.js +1 -4
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -4
- package/build/cjs/components/Link/Link.js +1 -4
- package/build/cjs/components/YandexForm/YandexForm.d.ts +0 -2
- package/build/cjs/components/YandexForm/YandexForm.js +2 -13
- package/build/cjs/containers/PageConstructor/Provider.d.ts +0 -2
- package/build/cjs/containers/PageConstructor/Provider.js +1 -3
- package/build/cjs/context/metrikaContext/metrikaContext.d.ts +0 -6
- package/build/cjs/hooks/useMetrika.d.ts +0 -6
- package/build/cjs/hooks/useMetrika.js +0 -8
- package/build/cjs/models/common.d.ts +0 -30
- package/build/cjs/models/common.js +0 -3
- package/build/cjs/models/constructor-items/common.d.ts +1 -4
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +1 -2
- package/build/cjs/models/navigation.d.ts +1 -3
- package/build/cjs/navigation/components/Header/Header.css +5 -3
- package/build/cjs/navigation/components/Logo/Logo.css +5 -6
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +1 -0
- package/build/cjs/navigation/schema.d.ts +60 -0
- package/build/cjs/navigation/schema.js +80 -0
- package/build/cjs/schema/index.d.ts +67 -0
- package/build/cjs/schema/index.js +2 -1
- package/build/cjs/schema/validators/common.d.ts +0 -236
- package/build/cjs/schema/validators/common.js +0 -10
- package/build/cjs/schema/validators/index.d.ts +2 -0
- package/build/cjs/schema/validators/index.js +2 -0
- package/build/cjs/schema/validators/navigation.d.ts +1 -0
- package/build/cjs/{context/analyticsContext/index.js → schema/validators/navigation.js} +1 -1
- package/build/cjs/sub-blocks/HubspotForm/index.js +2 -14
- package/build/cjs/text-transform/blocks.js +1 -10
- package/build/esm/blocks/Banner/schema.d.ts +0 -336
- package/build/esm/blocks/Media/schema.d.ts +0 -112
- package/build/esm/components/Button/Button.js +2 -5
- package/build/esm/components/CardBase/CardBase.d.ts +0 -2
- package/build/esm/components/CardBase/CardBase.js +1 -4
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -4
- package/build/esm/components/Link/Link.js +1 -4
- package/build/esm/components/YandexForm/YandexForm.d.ts +0 -2
- package/build/esm/components/YandexForm/YandexForm.js +2 -13
- package/build/esm/containers/PageConstructor/Provider.d.ts +0 -2
- package/build/esm/containers/PageConstructor/Provider.js +1 -3
- package/build/esm/context/metrikaContext/metrikaContext.d.ts +0 -6
- package/build/esm/hooks/useMetrika.d.ts +0 -6
- package/build/esm/hooks/useMetrika.js +0 -8
- package/build/esm/models/common.d.ts +0 -30
- package/build/esm/models/common.js +0 -3
- package/build/esm/models/constructor-items/common.d.ts +1 -4
- package/build/esm/models/constructor-items/sub-blocks.d.ts +1 -2
- package/build/esm/models/navigation.d.ts +1 -3
- package/build/esm/navigation/components/Header/Header.css +5 -3
- package/build/esm/navigation/components/Logo/Logo.css +5 -6
- package/build/esm/navigation/components/NavigationItem/NavigationItem.css +1 -0
- package/build/esm/navigation/schema.d.ts +60 -0
- package/build/esm/navigation/schema.js +77 -0
- package/build/esm/schema/index.d.ts +67 -0
- package/build/esm/schema/index.js +2 -1
- package/build/esm/schema/validators/common.d.ts +0 -236
- package/build/esm/schema/validators/common.js +0 -10
- package/build/esm/schema/validators/index.d.ts +2 -0
- package/build/esm/schema/validators/index.js +2 -0
- package/build/esm/schema/validators/navigation.d.ts +1 -0
- package/build/esm/schema/validators/navigation.js +1 -0
- package/build/esm/sub-blocks/HubspotForm/index.js +2 -14
- package/build/esm/text-transform/blocks.js +1 -10
- package/package.json +1 -4
- package/server/models/common.d.ts +0 -30
- package/server/models/common.js +0 -3
- package/server/models/constructor-items/common.d.ts +1 -4
- package/server/models/constructor-items/sub-blocks.d.ts +1 -2
- package/server/models/navigation.d.ts +1 -3
- package/server/text-transform/blocks.js +1 -10
- package/build/cjs/context/analyticsContext/analyticsContext.d.ts +0 -6
- package/build/cjs/context/analyticsContext/analyticsContext.js +0 -6
- package/build/cjs/context/analyticsContext/index.d.ts +0 -1
- package/build/cjs/hooks/useAnalytics.d.ts +0 -2
- package/build/cjs/hooks/useAnalytics.js +0 -15
- package/build/cjs/schema/validators/event.d.ts +0 -54
- package/build/cjs/schema/validators/event.js +0 -57
- package/build/esm/context/analyticsContext/analyticsContext.d.ts +0 -6
- package/build/esm/context/analyticsContext/analyticsContext.js +0 -2
- package/build/esm/context/analyticsContext/index.d.ts +0 -1
- package/build/esm/context/analyticsContext/index.js +0 -1
- package/build/esm/hooks/useAnalytics.d.ts +0 -2
- package/build/esm/hooks/useAnalytics.js +0 -11
- package/build/esm/schema/validators/event.d.ts +0 -54
- package/build/esm/schema/validators/event.js +0 -54
|
@@ -414,9 +414,6 @@ export declare const ButtonProps: {
|
|
|
414
414
|
};
|
|
415
415
|
})[];
|
|
416
416
|
};
|
|
417
|
-
/**
|
|
418
|
-
* @deprecated Metrika will be deleted
|
|
419
|
-
*/
|
|
420
417
|
metrikaGoals: {
|
|
421
418
|
anyOf: ({
|
|
422
419
|
type: string;
|
|
@@ -446,9 +443,6 @@ export declare const ButtonProps: {
|
|
|
446
443
|
};
|
|
447
444
|
})[];
|
|
448
445
|
};
|
|
449
|
-
/**
|
|
450
|
-
* @deprecated Pixel will be deleted
|
|
451
|
-
*/
|
|
452
446
|
pixelEvents: {
|
|
453
447
|
type: string;
|
|
454
448
|
items: {
|
|
@@ -505,118 +499,6 @@ export declare const ButtonProps: {
|
|
|
505
499
|
};
|
|
506
500
|
};
|
|
507
501
|
};
|
|
508
|
-
analyticsEvents: {
|
|
509
|
-
anyOf: ({
|
|
510
|
-
type: string;
|
|
511
|
-
additionalProperties: boolean;
|
|
512
|
-
required: string[];
|
|
513
|
-
properties: {
|
|
514
|
-
name: {
|
|
515
|
-
type: string;
|
|
516
|
-
};
|
|
517
|
-
type: {
|
|
518
|
-
type: string;
|
|
519
|
-
};
|
|
520
|
-
counters: {
|
|
521
|
-
type: string;
|
|
522
|
-
additionalProperties: boolean;
|
|
523
|
-
required: never[];
|
|
524
|
-
properties: {
|
|
525
|
-
include: {
|
|
526
|
-
type: string;
|
|
527
|
-
items: {
|
|
528
|
-
type: string;
|
|
529
|
-
};
|
|
530
|
-
};
|
|
531
|
-
exclude: {
|
|
532
|
-
type: string;
|
|
533
|
-
items: {
|
|
534
|
-
type: string;
|
|
535
|
-
};
|
|
536
|
-
};
|
|
537
|
-
};
|
|
538
|
-
};
|
|
539
|
-
category: {
|
|
540
|
-
type: string;
|
|
541
|
-
};
|
|
542
|
-
label: {
|
|
543
|
-
type: string;
|
|
544
|
-
};
|
|
545
|
-
params: {
|
|
546
|
-
type: string;
|
|
547
|
-
items: {
|
|
548
|
-
type: string;
|
|
549
|
-
additionalProperties: boolean;
|
|
550
|
-
required: string[];
|
|
551
|
-
properties: {
|
|
552
|
-
key: {
|
|
553
|
-
type: string;
|
|
554
|
-
};
|
|
555
|
-
value: {
|
|
556
|
-
type: string;
|
|
557
|
-
};
|
|
558
|
-
};
|
|
559
|
-
};
|
|
560
|
-
};
|
|
561
|
-
};
|
|
562
|
-
} | {
|
|
563
|
-
type: string;
|
|
564
|
-
items: {
|
|
565
|
-
type: string;
|
|
566
|
-
additionalProperties: boolean;
|
|
567
|
-
required: string[];
|
|
568
|
-
properties: {
|
|
569
|
-
name: {
|
|
570
|
-
type: string;
|
|
571
|
-
};
|
|
572
|
-
type: {
|
|
573
|
-
type: string;
|
|
574
|
-
};
|
|
575
|
-
counters: {
|
|
576
|
-
type: string;
|
|
577
|
-
additionalProperties: boolean;
|
|
578
|
-
required: never[];
|
|
579
|
-
properties: {
|
|
580
|
-
include: {
|
|
581
|
-
type: string;
|
|
582
|
-
items: {
|
|
583
|
-
type: string;
|
|
584
|
-
};
|
|
585
|
-
};
|
|
586
|
-
exclude: {
|
|
587
|
-
type: string;
|
|
588
|
-
items: {
|
|
589
|
-
type: string;
|
|
590
|
-
};
|
|
591
|
-
};
|
|
592
|
-
};
|
|
593
|
-
};
|
|
594
|
-
category: {
|
|
595
|
-
type: string;
|
|
596
|
-
};
|
|
597
|
-
label: {
|
|
598
|
-
type: string;
|
|
599
|
-
};
|
|
600
|
-
params: {
|
|
601
|
-
type: string;
|
|
602
|
-
items: {
|
|
603
|
-
type: string;
|
|
604
|
-
additionalProperties: boolean;
|
|
605
|
-
required: string[];
|
|
606
|
-
properties: {
|
|
607
|
-
key: {
|
|
608
|
-
type: string;
|
|
609
|
-
};
|
|
610
|
-
value: {
|
|
611
|
-
type: string;
|
|
612
|
-
};
|
|
613
|
-
};
|
|
614
|
-
};
|
|
615
|
-
};
|
|
616
|
-
};
|
|
617
|
-
};
|
|
618
|
-
})[];
|
|
619
|
-
};
|
|
620
502
|
target: {
|
|
621
503
|
type: string;
|
|
622
504
|
enum: string[];
|
|
@@ -747,9 +629,6 @@ export declare const ButtonBlock: {
|
|
|
747
629
|
};
|
|
748
630
|
})[];
|
|
749
631
|
};
|
|
750
|
-
/**
|
|
751
|
-
* @deprecated Metrika will be deleted
|
|
752
|
-
*/
|
|
753
632
|
metrikaGoals: {
|
|
754
633
|
anyOf: ({
|
|
755
634
|
type: string;
|
|
@@ -779,9 +658,6 @@ export declare const ButtonBlock: {
|
|
|
779
658
|
};
|
|
780
659
|
})[];
|
|
781
660
|
};
|
|
782
|
-
/**
|
|
783
|
-
* @deprecated Pixel will be deleted
|
|
784
|
-
*/
|
|
785
661
|
pixelEvents: {
|
|
786
662
|
type: string;
|
|
787
663
|
items: {
|
|
@@ -838,118 +714,6 @@ export declare const ButtonBlock: {
|
|
|
838
714
|
};
|
|
839
715
|
};
|
|
840
716
|
};
|
|
841
|
-
analyticsEvents: {
|
|
842
|
-
anyOf: ({
|
|
843
|
-
type: string;
|
|
844
|
-
additionalProperties: boolean;
|
|
845
|
-
required: string[];
|
|
846
|
-
properties: {
|
|
847
|
-
name: {
|
|
848
|
-
type: string;
|
|
849
|
-
};
|
|
850
|
-
type: {
|
|
851
|
-
type: string;
|
|
852
|
-
};
|
|
853
|
-
counters: {
|
|
854
|
-
type: string;
|
|
855
|
-
additionalProperties: boolean;
|
|
856
|
-
required: never[];
|
|
857
|
-
properties: {
|
|
858
|
-
include: {
|
|
859
|
-
type: string;
|
|
860
|
-
items: {
|
|
861
|
-
type: string;
|
|
862
|
-
};
|
|
863
|
-
};
|
|
864
|
-
exclude: {
|
|
865
|
-
type: string;
|
|
866
|
-
items: {
|
|
867
|
-
type: string;
|
|
868
|
-
};
|
|
869
|
-
};
|
|
870
|
-
};
|
|
871
|
-
};
|
|
872
|
-
category: {
|
|
873
|
-
type: string;
|
|
874
|
-
};
|
|
875
|
-
label: {
|
|
876
|
-
type: string;
|
|
877
|
-
};
|
|
878
|
-
params: {
|
|
879
|
-
type: string;
|
|
880
|
-
items: {
|
|
881
|
-
type: string;
|
|
882
|
-
additionalProperties: boolean;
|
|
883
|
-
required: string[];
|
|
884
|
-
properties: {
|
|
885
|
-
key: {
|
|
886
|
-
type: string;
|
|
887
|
-
};
|
|
888
|
-
value: {
|
|
889
|
-
type: string;
|
|
890
|
-
};
|
|
891
|
-
};
|
|
892
|
-
};
|
|
893
|
-
};
|
|
894
|
-
};
|
|
895
|
-
} | {
|
|
896
|
-
type: string;
|
|
897
|
-
items: {
|
|
898
|
-
type: string;
|
|
899
|
-
additionalProperties: boolean;
|
|
900
|
-
required: string[];
|
|
901
|
-
properties: {
|
|
902
|
-
name: {
|
|
903
|
-
type: string;
|
|
904
|
-
};
|
|
905
|
-
type: {
|
|
906
|
-
type: string;
|
|
907
|
-
};
|
|
908
|
-
counters: {
|
|
909
|
-
type: string;
|
|
910
|
-
additionalProperties: boolean;
|
|
911
|
-
required: never[];
|
|
912
|
-
properties: {
|
|
913
|
-
include: {
|
|
914
|
-
type: string;
|
|
915
|
-
items: {
|
|
916
|
-
type: string;
|
|
917
|
-
};
|
|
918
|
-
};
|
|
919
|
-
exclude: {
|
|
920
|
-
type: string;
|
|
921
|
-
items: {
|
|
922
|
-
type: string;
|
|
923
|
-
};
|
|
924
|
-
};
|
|
925
|
-
};
|
|
926
|
-
};
|
|
927
|
-
category: {
|
|
928
|
-
type: string;
|
|
929
|
-
};
|
|
930
|
-
label: {
|
|
931
|
-
type: string;
|
|
932
|
-
};
|
|
933
|
-
params: {
|
|
934
|
-
type: string;
|
|
935
|
-
items: {
|
|
936
|
-
type: string;
|
|
937
|
-
additionalProperties: boolean;
|
|
938
|
-
required: string[];
|
|
939
|
-
properties: {
|
|
940
|
-
key: {
|
|
941
|
-
type: string;
|
|
942
|
-
};
|
|
943
|
-
value: {
|
|
944
|
-
type: string;
|
|
945
|
-
};
|
|
946
|
-
};
|
|
947
|
-
};
|
|
948
|
-
};
|
|
949
|
-
};
|
|
950
|
-
};
|
|
951
|
-
})[];
|
|
952
|
-
};
|
|
953
717
|
target: {
|
|
954
718
|
type: string;
|
|
955
719
|
enum: string[];
|
|
@@ -1,7 +1,6 @@
|
|
|
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';
|
|
5
4
|
export const mediaDirection = ['media-content', 'content-media'];
|
|
6
5
|
export const textSize = ['s', 'm', 'l'];
|
|
7
6
|
export const containerSizesArray = ['sm', 'md', 'lg', 'xl', 'all'];
|
|
@@ -307,9 +306,6 @@ export const ButtonProps = {
|
|
|
307
306
|
},
|
|
308
307
|
],
|
|
309
308
|
},
|
|
310
|
-
/**
|
|
311
|
-
* @deprecated Metrika will be deleted
|
|
312
|
-
*/
|
|
313
309
|
metrikaGoals: {
|
|
314
310
|
anyOf: [
|
|
315
311
|
{ type: 'string' },
|
|
@@ -332,13 +328,7 @@ export const ButtonProps = {
|
|
|
332
328
|
},
|
|
333
329
|
],
|
|
334
330
|
},
|
|
335
|
-
/**
|
|
336
|
-
* @deprecated Pixel will be deleted
|
|
337
|
-
*/
|
|
338
331
|
pixelEvents,
|
|
339
|
-
analyticsEvents: {
|
|
340
|
-
anyOf: [AnalyticsEventSchema, { type: 'array', items: AnalyticsEventSchema }],
|
|
341
|
-
},
|
|
342
332
|
target: {
|
|
343
333
|
type: 'string',
|
|
344
334
|
enum: ['_self', '_blank', '_parent', '_top'],
|
|
@@ -3,10 +3,12 @@ import * as common from './common';
|
|
|
3
3
|
import * as subBlocks from './sub-blocks';
|
|
4
4
|
import * as pixel from './pixel';
|
|
5
5
|
import * as utils from './utils';
|
|
6
|
+
import * as navigation from './navigation';
|
|
6
7
|
export declare const validators: {
|
|
7
8
|
blocks: typeof blocks;
|
|
8
9
|
common: typeof common;
|
|
9
10
|
subBlocks: typeof subBlocks;
|
|
10
11
|
pixel: typeof pixel;
|
|
11
12
|
utils: typeof utils;
|
|
13
|
+
navigation: typeof navigation;
|
|
12
14
|
};
|
|
@@ -3,10 +3,12 @@ import * as common from './common';
|
|
|
3
3
|
import * as subBlocks from './sub-blocks';
|
|
4
4
|
import * as pixel from './pixel';
|
|
5
5
|
import * as utils from './utils';
|
|
6
|
+
import * as navigation from './navigation';
|
|
6
7
|
export const validators = {
|
|
7
8
|
blocks,
|
|
8
9
|
common,
|
|
9
10
|
subBlocks,
|
|
10
11
|
pixel,
|
|
11
12
|
utils,
|
|
13
|
+
navigation,
|
|
12
14
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../navigation/schema';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../navigation/schema';
|
|
@@ -5,15 +5,13 @@ import { MobileContext } from '../../context/mobileContext';
|
|
|
5
5
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
6
6
|
import { useHandleHubspotEvents } from '../../hooks';
|
|
7
7
|
import HubspotFormContainer from './HubspotFormContainer';
|
|
8
|
-
import { useAnalytics } from '../../hooks/useAnalytics';
|
|
9
8
|
import './HubspotForm.css';
|
|
10
9
|
const b = block('hubspot-form');
|
|
11
10
|
const HubspotForm = (props) => {
|
|
12
11
|
const { className, theme: themeProp, isMobile: isMobileProp, formId, formInstanceId, portalId, region, formClassName, pixelEvents,
|
|
13
12
|
// hubspotEvents, // TODO: decide how to handle them
|
|
14
|
-
|
|
13
|
+
onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, } = props;
|
|
15
14
|
const handleMetrika = useMetrika();
|
|
16
|
-
const handleAnalytics = useAnalytics();
|
|
17
15
|
const { themeValue } = useContext(ThemeValueContext);
|
|
18
16
|
const isMobileValue = useContext(MobileContext);
|
|
19
17
|
const theme = themeProp !== null && themeProp !== void 0 ? themeProp : themeValue;
|
|
@@ -24,19 +22,9 @@ const HubspotForm = (props) => {
|
|
|
24
22
|
onLoad,
|
|
25
23
|
onSubmit: (e) => {
|
|
26
24
|
handleMetrika === null || handleMetrika === void 0 ? void 0 : handleMetrika({ pixelEvents });
|
|
27
|
-
handleAnalytics(analyticsEvents);
|
|
28
25
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(e);
|
|
29
26
|
},
|
|
30
|
-
}), [
|
|
31
|
-
onBeforeLoad,
|
|
32
|
-
onBeforeSubmit,
|
|
33
|
-
onLoad,
|
|
34
|
-
handleMetrika,
|
|
35
|
-
pixelEvents,
|
|
36
|
-
handleAnalytics,
|
|
37
|
-
analyticsEvents,
|
|
38
|
-
onSubmit,
|
|
39
|
-
]);
|
|
27
|
+
}), [onBeforeLoad, onBeforeSubmit, onLoad, handleMetrika, pixelEvents, onSubmit]);
|
|
40
28
|
useHandleHubspotEvents(handlers, formId);
|
|
41
29
|
return (React.createElement(HubspotFormContainer, { key: [formClassName, formId, formInstanceId, portalId, region].join(), className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region }));
|
|
42
30
|
};
|
|
@@ -156,15 +156,7 @@ const config = {
|
|
|
156
156
|
},
|
|
157
157
|
],
|
|
158
158
|
[BlockType.PromoFeaturesBlock]: [
|
|
159
|
-
|
|
160
|
-
fields: ['title'],
|
|
161
|
-
transformer: typografTransformer,
|
|
162
|
-
parser: parseTitle,
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
fields: ['description'],
|
|
166
|
-
transformer: yfmTransformer,
|
|
167
|
-
},
|
|
159
|
+
...blockHeaderTransfomer,
|
|
168
160
|
{
|
|
169
161
|
fields: ['items'],
|
|
170
162
|
transformer: yfmTransformer,
|
|
@@ -303,7 +295,6 @@ const config = {
|
|
|
303
295
|
parser: parseTitle,
|
|
304
296
|
},
|
|
305
297
|
],
|
|
306
|
-
[BlockType.PromoFeaturesBlock]: blockHeaderTransfomer,
|
|
307
298
|
[BlockType.InfoBlock]: [
|
|
308
299
|
{
|
|
309
300
|
fields: ['rightContent', 'leftContent'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.1",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -132,8 +132,5 @@
|
|
|
132
132
|
"*.{json,yaml,yml,md}": [
|
|
133
133
|
"prettier --write"
|
|
134
134
|
]
|
|
135
|
-
},
|
|
136
|
-
"publishConfig": {
|
|
137
|
-
"tag": "alpha"
|
|
138
135
|
}
|
|
139
136
|
}
|
|
@@ -7,21 +7,12 @@ export declare enum Theme {
|
|
|
7
7
|
Light = "light",
|
|
8
8
|
Dark = "dark"
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Pixel will be deleted
|
|
12
|
-
*/
|
|
13
10
|
type PixelCommand = 'track' | 'trackCustom';
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Pixel will be deleted
|
|
16
|
-
*/
|
|
17
11
|
export interface PixelEvent {
|
|
18
12
|
command: PixelCommand;
|
|
19
13
|
event: PixelEventType | string;
|
|
20
14
|
data?: Object;
|
|
21
15
|
}
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Pixel will be deleted from package
|
|
24
|
-
*/
|
|
25
16
|
export declare enum PixelEventType {
|
|
26
17
|
AddPaymentInfo = "AddPaymentInfo",
|
|
27
18
|
AddToCart = "AddToCart",
|
|
@@ -45,17 +36,11 @@ export declare enum PixelEventType {
|
|
|
45
36
|
export type Modifiers = {
|
|
46
37
|
[name: string]: string | boolean | undefined;
|
|
47
38
|
};
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Pixel will be deleted
|
|
50
|
-
*/
|
|
51
39
|
export interface Pixel<TEvent = string> {
|
|
52
40
|
trackStandard: (event: TEvent, data?: Object) => void;
|
|
53
41
|
trackCustom: (event: string, data?: Object) => void;
|
|
54
42
|
track: (trackEvents: string | string[] | PixelEvent[] | PixelEvent) => void;
|
|
55
43
|
}
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated Metrika will be deleted
|
|
58
|
-
*/
|
|
59
44
|
export interface Metrika {
|
|
60
45
|
reachGoal: (counterName: string, ...args: any) => void;
|
|
61
46
|
reachGoals: (goals: MetrikaGoal, counterName?: string) => void;
|
|
@@ -64,19 +49,4 @@ export interface ClassNameProps {
|
|
|
64
49
|
className?: string;
|
|
65
50
|
}
|
|
66
51
|
export type Timeout = ReturnType<typeof setTimeout> | undefined;
|
|
67
|
-
export type AnalyticsParameter = {
|
|
68
|
-
key: string;
|
|
69
|
-
value: string;
|
|
70
|
-
};
|
|
71
|
-
export type AnalyticsEvent = {
|
|
72
|
-
name: string;
|
|
73
|
-
type?: string;
|
|
74
|
-
counters?: {
|
|
75
|
-
include?: string[];
|
|
76
|
-
exclude?: string[];
|
|
77
|
-
};
|
|
78
|
-
category?: string;
|
|
79
|
-
label?: string;
|
|
80
|
-
params?: AnalyticsParameter[];
|
|
81
|
-
};
|
|
82
52
|
export {};
|
package/server/models/common.js
CHANGED
|
@@ -6,9 +6,6 @@ var 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
|
-
*/
|
|
12
9
|
var PixelEventType;
|
|
13
10
|
(function (PixelEventType) {
|
|
14
11
|
PixelEventType["AddPaymentInfo"] = "AddPaymentInfo";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonSize, ButtonView } from '@gravity-ui/uikit';
|
|
3
3
|
import { ThemeSupporting } from '../../utils/theme';
|
|
4
|
-
import {
|
|
4
|
+
import { ClassNameProps, PixelEventType } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -121,7 +121,6 @@ export interface LinkProps extends Stylable {
|
|
|
121
121
|
target?: string;
|
|
122
122
|
metrikaGoals?: MetrikaGoal;
|
|
123
123
|
pixelEvents?: ButtonPixel;
|
|
124
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
125
124
|
}
|
|
126
125
|
export interface FileLinkProps extends ClassNameProps {
|
|
127
126
|
href: string;
|
|
@@ -140,7 +139,6 @@ export interface ButtonProps {
|
|
|
140
139
|
img?: ButtonImageProps | string;
|
|
141
140
|
metrikaGoals?: MetrikaGoal;
|
|
142
141
|
pixelEvents?: ButtonPixel;
|
|
143
|
-
analyticsEvents?: AnalyticsEvent[];
|
|
144
142
|
target?: string;
|
|
145
143
|
}
|
|
146
144
|
export interface ButtonImageProps {
|
|
@@ -224,7 +222,6 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
224
222
|
theme?: TextTheme;
|
|
225
223
|
metrikaGoals?: MetrikaGoal;
|
|
226
224
|
pixelEvents?: ButtonPixel;
|
|
227
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
228
225
|
}
|
|
229
226
|
export interface PreviewContentItemProps {
|
|
230
227
|
title: string;
|
|
@@ -3,7 +3,7 @@ import { ThemeSupporting } from '../../utils';
|
|
|
3
3
|
import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
|
|
4
4
|
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
|
|
5
5
|
import { ContentBlockProps } from './blocks';
|
|
6
|
-
import {
|
|
6
|
+
import { PixelEvent } from '../common';
|
|
7
7
|
export declare enum SubBlockType {
|
|
8
8
|
Divider = "divider",
|
|
9
9
|
Quote = "quote",
|
|
@@ -61,7 +61,6 @@ export interface HubspotFormProps extends HubspotEventHandlers {
|
|
|
61
61
|
onLoad?: (arg: HubspotEventData) => void;
|
|
62
62
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
|
|
63
63
|
hubspotEvents?: string[];
|
|
64
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
65
64
|
}
|
|
66
65
|
export interface PartnerProps extends CardBaseProps {
|
|
67
66
|
text: string;
|
|
@@ -11,7 +11,7 @@ export interface NavigationItemBase {
|
|
|
11
11
|
icon?: ImageProps;
|
|
12
12
|
url?: string;
|
|
13
13
|
}
|
|
14
|
-
export interface NavigationLinkItem extends NavigationItemBase {
|
|
14
|
+
export interface NavigationLinkItem extends Omit<NavigationItemBase, 'url'> {
|
|
15
15
|
type: NavigationItemType.Link;
|
|
16
16
|
url: string;
|
|
17
17
|
arrow?: boolean;
|
|
@@ -19,8 +19,6 @@ export interface NavigationLinkItem extends NavigationItemBase {
|
|
|
19
19
|
}
|
|
20
20
|
export interface NavigationButtonItem extends ButtonProps {
|
|
21
21
|
type: NavigationItemType.Button;
|
|
22
|
-
url: string;
|
|
23
|
-
target?: string;
|
|
24
22
|
}
|
|
25
23
|
export interface NavigationDropdownItem extends NavigationItemBase {
|
|
26
24
|
type: NavigationItemType.Dropdown;
|
|
@@ -175,15 +175,7 @@ const config = {
|
|
|
175
175
|
},
|
|
176
176
|
],
|
|
177
177
|
[models_1.BlockType.PromoFeaturesBlock]: [
|
|
178
|
-
|
|
179
|
-
fields: ['title'],
|
|
180
|
-
transformer: typografTransformer,
|
|
181
|
-
parser: parseTitle,
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
fields: ['description'],
|
|
185
|
-
transformer: yfmTransformer,
|
|
186
|
-
},
|
|
178
|
+
...blockHeaderTransfomer,
|
|
187
179
|
{
|
|
188
180
|
fields: ['items'],
|
|
189
181
|
transformer: yfmTransformer,
|
|
@@ -322,7 +314,6 @@ const config = {
|
|
|
322
314
|
parser: parseTitle,
|
|
323
315
|
},
|
|
324
316
|
],
|
|
325
|
-
[models_1.BlockType.PromoFeaturesBlock]: blockHeaderTransfomer,
|
|
326
317
|
[models_1.BlockType.InfoBlock]: [
|
|
327
318
|
{
|
|
328
319
|
fields: ['rightContent', 'leftContent'],
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AnalyticsContext = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
exports.AnalyticsContext = react_1.default.createContext({});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './analyticsContext';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAnalytics = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const analyticsContext_1 = require("../context/analyticsContext");
|
|
6
|
-
const useAnalytics = () => {
|
|
7
|
-
const { sendEvents } = (0, react_1.useContext)(analyticsContext_1.AnalyticsContext);
|
|
8
|
-
return (e) => {
|
|
9
|
-
if (!e) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
sendEvents === null || sendEvents === void 0 ? void 0 : sendEvents(e);
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
exports.useAnalytics = useAnalytics;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export declare const AnalyticsEventSchema: {
|
|
2
|
-
type: string;
|
|
3
|
-
additionalProperties: boolean;
|
|
4
|
-
required: string[];
|
|
5
|
-
properties: {
|
|
6
|
-
name: {
|
|
7
|
-
type: string;
|
|
8
|
-
};
|
|
9
|
-
type: {
|
|
10
|
-
type: string;
|
|
11
|
-
};
|
|
12
|
-
counters: {
|
|
13
|
-
type: string;
|
|
14
|
-
additionalProperties: boolean;
|
|
15
|
-
required: never[];
|
|
16
|
-
properties: {
|
|
17
|
-
include: {
|
|
18
|
-
type: string;
|
|
19
|
-
items: {
|
|
20
|
-
type: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
exclude: {
|
|
24
|
-
type: string;
|
|
25
|
-
items: {
|
|
26
|
-
type: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
category: {
|
|
32
|
-
type: string;
|
|
33
|
-
};
|
|
34
|
-
label: {
|
|
35
|
-
type: string;
|
|
36
|
-
};
|
|
37
|
-
params: {
|
|
38
|
-
type: string;
|
|
39
|
-
items: {
|
|
40
|
-
type: string;
|
|
41
|
-
additionalProperties: boolean;
|
|
42
|
-
required: string[];
|
|
43
|
-
properties: {
|
|
44
|
-
key: {
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
value: {
|
|
48
|
-
type: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
};
|