@gravity-ui/page-constructor 1.14.0-alpha.0 → 1.14.0-alpha.2
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 +0 -321
- package/build/cjs/blocks/Media/schema.d.ts +0 -107
- 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/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 +369 -0
- package/build/cjs/navigation/schema.js +89 -0
- package/build/cjs/schema/index.d.ts +367 -0
- package/build/cjs/schema/index.js +2 -1
- package/build/cjs/schema/validators/common.d.ts +0 -226
- 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/esm/blocks/Banner/schema.d.ts +0 -321
- package/build/esm/blocks/Media/schema.d.ts +0 -107
- 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/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 +369 -0
- package/build/esm/navigation/schema.js +86 -0
- package/build/esm/schema/index.d.ts +367 -0
- package/build/esm/schema/index.js +2 -1
- package/build/esm/schema/validators/common.d.ts +0 -226
- 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/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/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 -50
- package/build/cjs/schema/validators/event.js +0 -53
- 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 -50
- package/build/esm/schema/validators/event.js +0 -50
|
@@ -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,113 +499,6 @@ export declare const ButtonProps: {
|
|
|
505
499
|
};
|
|
506
500
|
};
|
|
507
501
|
};
|
|
508
|
-
events: {
|
|
509
|
-
anyOf: ({
|
|
510
|
-
type: {
|
|
511
|
-
type: string;
|
|
512
|
-
additionalProperties: boolean;
|
|
513
|
-
required: string[];
|
|
514
|
-
properties: {
|
|
515
|
-
name: {
|
|
516
|
-
type: string;
|
|
517
|
-
};
|
|
518
|
-
type: {
|
|
519
|
-
type: string;
|
|
520
|
-
};
|
|
521
|
-
counters: {
|
|
522
|
-
type: string;
|
|
523
|
-
additionalProperties: boolean;
|
|
524
|
-
required: never[];
|
|
525
|
-
properties: {
|
|
526
|
-
include: {
|
|
527
|
-
type: string;
|
|
528
|
-
items: string;
|
|
529
|
-
};
|
|
530
|
-
exclude: {
|
|
531
|
-
type: string;
|
|
532
|
-
items: string;
|
|
533
|
-
};
|
|
534
|
-
};
|
|
535
|
-
};
|
|
536
|
-
category: {
|
|
537
|
-
type: string;
|
|
538
|
-
};
|
|
539
|
-
label: {
|
|
540
|
-
type: string;
|
|
541
|
-
};
|
|
542
|
-
params: {
|
|
543
|
-
type: string;
|
|
544
|
-
items: {
|
|
545
|
-
type: string;
|
|
546
|
-
additionalProperties: boolean;
|
|
547
|
-
required: string[];
|
|
548
|
-
properties: {
|
|
549
|
-
key: {
|
|
550
|
-
type: string;
|
|
551
|
-
};
|
|
552
|
-
value: {
|
|
553
|
-
type: string;
|
|
554
|
-
};
|
|
555
|
-
};
|
|
556
|
-
};
|
|
557
|
-
};
|
|
558
|
-
};
|
|
559
|
-
};
|
|
560
|
-
items?: undefined;
|
|
561
|
-
} | {
|
|
562
|
-
type: string;
|
|
563
|
-
items: {
|
|
564
|
-
type: string;
|
|
565
|
-
additionalProperties: boolean;
|
|
566
|
-
required: string[];
|
|
567
|
-
properties: {
|
|
568
|
-
name: {
|
|
569
|
-
type: string;
|
|
570
|
-
};
|
|
571
|
-
type: {
|
|
572
|
-
type: string;
|
|
573
|
-
};
|
|
574
|
-
counters: {
|
|
575
|
-
type: string;
|
|
576
|
-
additionalProperties: boolean;
|
|
577
|
-
required: never[];
|
|
578
|
-
properties: {
|
|
579
|
-
include: {
|
|
580
|
-
type: string;
|
|
581
|
-
items: string;
|
|
582
|
-
};
|
|
583
|
-
exclude: {
|
|
584
|
-
type: string;
|
|
585
|
-
items: string;
|
|
586
|
-
};
|
|
587
|
-
};
|
|
588
|
-
};
|
|
589
|
-
category: {
|
|
590
|
-
type: string;
|
|
591
|
-
};
|
|
592
|
-
label: {
|
|
593
|
-
type: string;
|
|
594
|
-
};
|
|
595
|
-
params: {
|
|
596
|
-
type: string;
|
|
597
|
-
items: {
|
|
598
|
-
type: string;
|
|
599
|
-
additionalProperties: boolean;
|
|
600
|
-
required: string[];
|
|
601
|
-
properties: {
|
|
602
|
-
key: {
|
|
603
|
-
type: string;
|
|
604
|
-
};
|
|
605
|
-
value: {
|
|
606
|
-
type: string;
|
|
607
|
-
};
|
|
608
|
-
};
|
|
609
|
-
};
|
|
610
|
-
};
|
|
611
|
-
};
|
|
612
|
-
};
|
|
613
|
-
})[];
|
|
614
|
-
};
|
|
615
502
|
target: {
|
|
616
503
|
type: string;
|
|
617
504
|
enum: string[];
|
|
@@ -742,9 +629,6 @@ export declare const ButtonBlock: {
|
|
|
742
629
|
};
|
|
743
630
|
})[];
|
|
744
631
|
};
|
|
745
|
-
/**
|
|
746
|
-
* @deprecated Metrika will be deleted
|
|
747
|
-
*/
|
|
748
632
|
metrikaGoals: {
|
|
749
633
|
anyOf: ({
|
|
750
634
|
type: string;
|
|
@@ -774,9 +658,6 @@ export declare const ButtonBlock: {
|
|
|
774
658
|
};
|
|
775
659
|
})[];
|
|
776
660
|
};
|
|
777
|
-
/**
|
|
778
|
-
* @deprecated Pixel will be deleted
|
|
779
|
-
*/
|
|
780
661
|
pixelEvents: {
|
|
781
662
|
type: string;
|
|
782
663
|
items: {
|
|
@@ -833,113 +714,6 @@ export declare const ButtonBlock: {
|
|
|
833
714
|
};
|
|
834
715
|
};
|
|
835
716
|
};
|
|
836
|
-
events: {
|
|
837
|
-
anyOf: ({
|
|
838
|
-
type: {
|
|
839
|
-
type: string;
|
|
840
|
-
additionalProperties: boolean;
|
|
841
|
-
required: string[];
|
|
842
|
-
properties: {
|
|
843
|
-
name: {
|
|
844
|
-
type: string;
|
|
845
|
-
};
|
|
846
|
-
type: {
|
|
847
|
-
type: string;
|
|
848
|
-
};
|
|
849
|
-
counters: {
|
|
850
|
-
type: string;
|
|
851
|
-
additionalProperties: boolean;
|
|
852
|
-
required: never[];
|
|
853
|
-
properties: {
|
|
854
|
-
include: {
|
|
855
|
-
type: string;
|
|
856
|
-
items: string;
|
|
857
|
-
};
|
|
858
|
-
exclude: {
|
|
859
|
-
type: string;
|
|
860
|
-
items: string;
|
|
861
|
-
};
|
|
862
|
-
};
|
|
863
|
-
};
|
|
864
|
-
category: {
|
|
865
|
-
type: string;
|
|
866
|
-
};
|
|
867
|
-
label: {
|
|
868
|
-
type: string;
|
|
869
|
-
};
|
|
870
|
-
params: {
|
|
871
|
-
type: string;
|
|
872
|
-
items: {
|
|
873
|
-
type: string;
|
|
874
|
-
additionalProperties: boolean;
|
|
875
|
-
required: string[];
|
|
876
|
-
properties: {
|
|
877
|
-
key: {
|
|
878
|
-
type: string;
|
|
879
|
-
};
|
|
880
|
-
value: {
|
|
881
|
-
type: string;
|
|
882
|
-
};
|
|
883
|
-
};
|
|
884
|
-
};
|
|
885
|
-
};
|
|
886
|
-
};
|
|
887
|
-
};
|
|
888
|
-
items?: undefined;
|
|
889
|
-
} | {
|
|
890
|
-
type: string;
|
|
891
|
-
items: {
|
|
892
|
-
type: string;
|
|
893
|
-
additionalProperties: boolean;
|
|
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: string;
|
|
910
|
-
};
|
|
911
|
-
exclude: {
|
|
912
|
-
type: string;
|
|
913
|
-
items: string;
|
|
914
|
-
};
|
|
915
|
-
};
|
|
916
|
-
};
|
|
917
|
-
category: {
|
|
918
|
-
type: string;
|
|
919
|
-
};
|
|
920
|
-
label: {
|
|
921
|
-
type: string;
|
|
922
|
-
};
|
|
923
|
-
params: {
|
|
924
|
-
type: string;
|
|
925
|
-
items: {
|
|
926
|
-
type: string;
|
|
927
|
-
additionalProperties: boolean;
|
|
928
|
-
required: string[];
|
|
929
|
-
properties: {
|
|
930
|
-
key: {
|
|
931
|
-
type: string;
|
|
932
|
-
};
|
|
933
|
-
value: {
|
|
934
|
-
type: string;
|
|
935
|
-
};
|
|
936
|
-
};
|
|
937
|
-
};
|
|
938
|
-
};
|
|
939
|
-
};
|
|
940
|
-
};
|
|
941
|
-
})[];
|
|
942
|
-
};
|
|
943
717
|
target: {
|
|
944
718
|
type: string;
|
|
945
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
|
-
events: {
|
|
340
|
-
anyOf: [{ type: 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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "1.14.0-alpha.
|
|
3
|
+
"version": "1.14.0-alpha.2",
|
|
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;
|
|
@@ -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,50 +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: string;
|
|
20
|
-
};
|
|
21
|
-
exclude: {
|
|
22
|
-
type: string;
|
|
23
|
-
items: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
category: {
|
|
28
|
-
type: string;
|
|
29
|
-
};
|
|
30
|
-
label: {
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
params: {
|
|
34
|
-
type: string;
|
|
35
|
-
items: {
|
|
36
|
-
type: string;
|
|
37
|
-
additionalProperties: boolean;
|
|
38
|
-
required: string[];
|
|
39
|
-
properties: {
|
|
40
|
-
key: {
|
|
41
|
-
type: string;
|
|
42
|
-
};
|
|
43
|
-
value: {
|
|
44
|
-
type: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AnalyticsEventSchema = void 0;
|
|
4
|
-
exports.AnalyticsEventSchema = {
|
|
5
|
-
type: 'object',
|
|
6
|
-
additionalProperties: false,
|
|
7
|
-
required: ['name'],
|
|
8
|
-
properties: {
|
|
9
|
-
name: {
|
|
10
|
-
type: 'string',
|
|
11
|
-
},
|
|
12
|
-
type: {
|
|
13
|
-
type: 'string',
|
|
14
|
-
},
|
|
15
|
-
counters: {
|
|
16
|
-
type: 'object',
|
|
17
|
-
additionalProperties: false,
|
|
18
|
-
required: [],
|
|
19
|
-
properties: {
|
|
20
|
-
include: {
|
|
21
|
-
type: 'array',
|
|
22
|
-
items: 'string',
|
|
23
|
-
},
|
|
24
|
-
exclude: {
|
|
25
|
-
type: 'array',
|
|
26
|
-
items: 'string',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
category: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
},
|
|
33
|
-
label: {
|
|
34
|
-
type: 'string',
|
|
35
|
-
},
|
|
36
|
-
params: {
|
|
37
|
-
type: 'array',
|
|
38
|
-
items: {
|
|
39
|
-
type: 'object',
|
|
40
|
-
additionalProperties: false,
|
|
41
|
-
required: ['key', 'value'],
|
|
42
|
-
properties: {
|
|
43
|
-
key: {
|
|
44
|
-
type: 'string',
|
|
45
|
-
},
|
|
46
|
-
value: {
|
|
47
|
-
type: 'string',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './analyticsContext';
|