@gravity-ui/page-constructor 1.14.0-alpha.7 → 1.14.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/cjs/blocks/Banner/schema.d.ts +0 -336
  3. package/build/cjs/blocks/Media/schema.d.ts +0 -112
  4. package/build/cjs/components/Button/Button.js +2 -5
  5. package/build/cjs/components/CardBase/CardBase.d.ts +0 -2
  6. package/build/cjs/components/CardBase/CardBase.js +1 -4
  7. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -4
  8. package/build/cjs/components/Link/Link.js +1 -4
  9. package/build/cjs/components/YandexForm/YandexForm.d.ts +0 -2
  10. package/build/cjs/components/YandexForm/YandexForm.js +2 -13
  11. package/build/cjs/containers/PageConstructor/Provider.d.ts +0 -2
  12. package/build/cjs/containers/PageConstructor/Provider.js +1 -3
  13. package/build/cjs/context/metrikaContext/metrikaContext.d.ts +0 -6
  14. package/build/cjs/hooks/useMetrika.d.ts +0 -6
  15. package/build/cjs/hooks/useMetrika.js +0 -8
  16. package/build/cjs/models/common.d.ts +0 -30
  17. package/build/cjs/models/common.js +0 -3
  18. package/build/cjs/models/constructor-items/common.d.ts +1 -4
  19. package/build/cjs/models/constructor-items/sub-blocks.d.ts +1 -2
  20. package/build/cjs/models/navigation.d.ts +1 -3
  21. package/build/cjs/navigation/components/Header/Header.css +5 -3
  22. package/build/cjs/navigation/components/Logo/Logo.css +5 -6
  23. package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +1 -0
  24. package/build/cjs/navigation/schema.d.ts +60 -0
  25. package/build/cjs/navigation/schema.js +80 -0
  26. package/build/cjs/schema/index.d.ts +67 -0
  27. package/build/cjs/schema/index.js +2 -1
  28. package/build/cjs/schema/validators/common.d.ts +0 -236
  29. package/build/cjs/schema/validators/common.js +0 -10
  30. package/build/cjs/schema/validators/index.d.ts +2 -0
  31. package/build/cjs/schema/validators/index.js +2 -0
  32. package/build/cjs/schema/validators/navigation.d.ts +1 -0
  33. package/build/cjs/{context/analyticsContext/index.js → schema/validators/navigation.js} +1 -1
  34. package/build/cjs/sub-blocks/HubspotForm/index.js +2 -14
  35. package/build/cjs/text-transform/blocks.js +1 -10
  36. package/build/esm/blocks/Banner/schema.d.ts +0 -336
  37. package/build/esm/blocks/Media/schema.d.ts +0 -112
  38. package/build/esm/components/Button/Button.js +2 -5
  39. package/build/esm/components/CardBase/CardBase.d.ts +0 -2
  40. package/build/esm/components/CardBase/CardBase.js +1 -4
  41. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -4
  42. package/build/esm/components/Link/Link.js +1 -4
  43. package/build/esm/components/YandexForm/YandexForm.d.ts +0 -2
  44. package/build/esm/components/YandexForm/YandexForm.js +2 -13
  45. package/build/esm/containers/PageConstructor/Provider.d.ts +0 -2
  46. package/build/esm/containers/PageConstructor/Provider.js +1 -3
  47. package/build/esm/context/metrikaContext/metrikaContext.d.ts +0 -6
  48. package/build/esm/hooks/useMetrika.d.ts +0 -6
  49. package/build/esm/hooks/useMetrika.js +0 -8
  50. package/build/esm/models/common.d.ts +0 -30
  51. package/build/esm/models/common.js +0 -3
  52. package/build/esm/models/constructor-items/common.d.ts +1 -4
  53. package/build/esm/models/constructor-items/sub-blocks.d.ts +1 -2
  54. package/build/esm/models/navigation.d.ts +1 -3
  55. package/build/esm/navigation/components/Header/Header.css +5 -3
  56. package/build/esm/navigation/components/Logo/Logo.css +5 -6
  57. package/build/esm/navigation/components/NavigationItem/NavigationItem.css +1 -0
  58. package/build/esm/navigation/schema.d.ts +60 -0
  59. package/build/esm/navigation/schema.js +77 -0
  60. package/build/esm/schema/index.d.ts +67 -0
  61. package/build/esm/schema/index.js +2 -1
  62. package/build/esm/schema/validators/common.d.ts +0 -236
  63. package/build/esm/schema/validators/common.js +0 -10
  64. package/build/esm/schema/validators/index.d.ts +2 -0
  65. package/build/esm/schema/validators/index.js +2 -0
  66. package/build/esm/schema/validators/navigation.d.ts +1 -0
  67. package/build/esm/schema/validators/navigation.js +1 -0
  68. package/build/esm/sub-blocks/HubspotForm/index.js +2 -14
  69. package/build/esm/text-transform/blocks.js +1 -10
  70. package/package.json +1 -4
  71. package/server/models/common.d.ts +0 -30
  72. package/server/models/common.js +0 -3
  73. package/server/models/constructor-items/common.d.ts +1 -4
  74. package/server/models/constructor-items/sub-blocks.d.ts +1 -2
  75. package/server/models/navigation.d.ts +1 -3
  76. package/server/text-transform/blocks.js +1 -10
  77. package/build/cjs/context/analyticsContext/analyticsContext.d.ts +0 -6
  78. package/build/cjs/context/analyticsContext/analyticsContext.js +0 -6
  79. package/build/cjs/context/analyticsContext/index.d.ts +0 -1
  80. package/build/cjs/hooks/useAnalytics.d.ts +0 -2
  81. package/build/cjs/hooks/useAnalytics.js +0 -15
  82. package/build/cjs/schema/validators/event.d.ts +0 -54
  83. package/build/cjs/schema/validators/event.js +0 -57
  84. package/build/esm/context/analyticsContext/analyticsContext.d.ts +0 -6
  85. package/build/esm/context/analyticsContext/analyticsContext.js +0 -2
  86. package/build/esm/context/analyticsContext/index.d.ts +0 -1
  87. package/build/esm/context/analyticsContext/index.js +0 -1
  88. package/build/esm/hooks/useAnalytics.d.ts +0 -2
  89. package/build/esm/hooks/useAnalytics.js +0 -11
  90. package/build/esm/schema/validators/event.d.ts +0 -54
  91. 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
- events: {
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
- events: {
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[];
@@ -4,7 +4,6 @@ exports.BlockHeaderProps = exports.CardBase = exports.MediaProps = exports.Butto
4
4
  const pixel_1 = require("./pixel");
5
5
  const models_1 = require("../../models");
6
6
  const schema_1 = require("../../components/Image/schema");
7
- const event_1 = require("./event");
8
7
  exports.mediaDirection = ['media-content', 'content-media'];
9
8
  exports.textSize = ['s', 'm', 'l'];
10
9
  exports.containerSizesArray = ['sm', 'md', 'lg', 'xl', 'all'];
@@ -310,9 +309,6 @@ exports.ButtonProps = {
310
309
  },
311
310
  ],
312
311
  },
313
- /**
314
- * @deprecated Metrika will be deleted
315
- */
316
312
  metrikaGoals: {
317
313
  anyOf: [
318
314
  { type: 'string' },
@@ -335,13 +331,7 @@ exports.ButtonProps = {
335
331
  },
336
332
  ],
337
333
  },
338
- /**
339
- * @deprecated Pixel will be deleted
340
- */
341
334
  pixelEvents: pixel_1.pixelEvents,
342
- events: {
343
- anyOf: [event_1.AnalyticsEventSchema, { type: 'array', items: event_1.AnalyticsEventSchema }],
344
- },
345
335
  target: {
346
336
  type: 'string',
347
337
  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
  };
@@ -7,10 +7,12 @@ const common = tslib_1.__importStar(require("./common"));
7
7
  const subBlocks = tslib_1.__importStar(require("./sub-blocks"));
8
8
  const pixel = tslib_1.__importStar(require("./pixel"));
9
9
  const utils = tslib_1.__importStar(require("./utils"));
10
+ const navigation = tslib_1.__importStar(require("./navigation"));
10
11
  exports.validators = {
11
12
  blocks,
12
13
  common,
13
14
  subBlocks,
14
15
  pixel,
15
16
  utils,
17
+ navigation,
16
18
  };
@@ -0,0 +1 @@
1
+ export * from '../../navigation/schema';
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./analyticsContext"), exports);
4
+ tslib_1.__exportStar(require("../../navigation/schema"), exports);
@@ -8,14 +8,12 @@ const mobileContext_1 = require("../../context/mobileContext");
8
8
  const useMetrika_1 = require("../../hooks/useMetrika");
9
9
  const hooks_1 = require("../../hooks");
10
10
  const HubspotFormContainer_1 = tslib_1.__importDefault(require("./HubspotFormContainer"));
11
- const useAnalytics_1 = require("../../hooks/useAnalytics");
12
11
  const b = (0, utils_1.block)('hubspot-form');
13
12
  const HubspotForm = (props) => {
14
13
  const { className, theme: themeProp, isMobile: isMobileProp, formId, formInstanceId, portalId, region, formClassName, pixelEvents,
15
14
  // hubspotEvents, // TODO: decide how to handle them
16
- analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, } = props;
15
+ onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, } = props;
17
16
  const handleMetrika = (0, useMetrika_1.useMetrika)();
18
- const handleAnalytics = (0, useAnalytics_1.useAnalytics)();
19
17
  const { themeValue } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
20
18
  const isMobileValue = (0, react_1.useContext)(mobileContext_1.MobileContext);
21
19
  const theme = themeProp !== null && themeProp !== void 0 ? themeProp : themeValue;
@@ -26,19 +24,9 @@ const HubspotForm = (props) => {
26
24
  onLoad,
27
25
  onSubmit: (e) => {
28
26
  handleMetrika === null || handleMetrika === void 0 ? void 0 : handleMetrika({ pixelEvents });
29
- handleAnalytics(analyticsEvents);
30
27
  onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(e);
31
28
  },
32
- }), [
33
- onBeforeLoad,
34
- onBeforeSubmit,
35
- onLoad,
36
- handleMetrika,
37
- pixelEvents,
38
- handleAnalytics,
39
- analyticsEvents,
40
- onSubmit,
41
- ]);
29
+ }), [onBeforeLoad, onBeforeSubmit, onLoad, handleMetrika, pixelEvents, onSubmit]);
42
30
  (0, hooks_1.useHandleHubspotEvents)(handlers, formId);
43
31
  return (react_1.default.createElement(HubspotFormContainer_1.default, { key: [formClassName, formId, formInstanceId, portalId, region].join(), className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region }));
44
32
  };
@@ -162,15 +162,7 @@ const config = {
162
162
  },
163
163
  ],
164
164
  [models_1.BlockType.PromoFeaturesBlock]: [
165
- {
166
- fields: ['title'],
167
- transformer: typografTransformer,
168
- parser: parseTitle,
169
- },
170
- {
171
- fields: ['description'],
172
- transformer: yfmTransformer,
173
- },
165
+ ...blockHeaderTransfomer,
174
166
  {
175
167
  fields: ['items'],
176
168
  transformer: yfmTransformer,
@@ -309,7 +301,6 @@ const config = {
309
301
  parser: parseTitle,
310
302
  },
311
303
  ],
312
- [models_1.BlockType.PromoFeaturesBlock]: blockHeaderTransfomer,
313
304
  [models_1.BlockType.InfoBlock]: [
314
305
  {
315
306
  fields: ['rightContent', 'leftContent'],