@gravity-ui/page-constructor 1.14.0-alpha.5 → 1.14.0-alpha.6

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 (88) hide show
  1. package/CHANGELOG.md +0 -7
  2. package/build/cjs/blocks/Banner/schema.d.ts +312 -0
  3. package/build/cjs/blocks/Media/schema.d.ts +104 -0
  4. package/build/cjs/components/Button/Button.js +5 -2
  5. package/build/cjs/components/CardBase/CardBase.d.ts +2 -0
  6. package/build/cjs/components/CardBase/CardBase.js +4 -1
  7. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -1
  8. package/build/cjs/components/Link/Link.js +4 -1
  9. package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -0
  10. package/build/cjs/components/YandexForm/YandexForm.js +13 -2
  11. package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -0
  12. package/build/cjs/containers/PageConstructor/Provider.js +3 -1
  13. package/build/cjs/context/analyticsContext/analyticsContext.d.ts +6 -0
  14. package/build/cjs/context/analyticsContext/analyticsContext.js +6 -0
  15. package/build/cjs/context/analyticsContext/index.d.ts +1 -0
  16. package/build/cjs/{schema/validators/navigation.js → context/analyticsContext/index.js} +1 -1
  17. package/build/cjs/context/metrikaContext/metrikaContext.d.ts +6 -0
  18. package/build/cjs/hooks/useAnalytics.d.ts +2 -0
  19. package/build/cjs/hooks/useAnalytics.js +15 -0
  20. package/build/cjs/hooks/useMetrika.d.ts +6 -0
  21. package/build/cjs/hooks/useMetrika.js +8 -0
  22. package/build/cjs/models/common.d.ts +30 -0
  23. package/build/cjs/models/common.js +3 -0
  24. package/build/cjs/models/constructor-items/common.d.ts +4 -1
  25. package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -1
  26. package/build/cjs/models/navigation.d.ts +3 -1
  27. package/build/cjs/navigation/components/Header/Header.css +3 -5
  28. package/build/cjs/navigation/components/Logo/Logo.css +6 -5
  29. package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +0 -1
  30. package/build/cjs/schema/index.d.ts +0 -67
  31. package/build/cjs/schema/index.js +1 -2
  32. package/build/cjs/schema/validators/common.d.ts +220 -0
  33. package/build/cjs/schema/validators/common.js +10 -0
  34. package/build/cjs/schema/validators/event.d.ts +50 -0
  35. package/build/cjs/schema/validators/event.js +53 -0
  36. package/build/cjs/schema/validators/index.d.ts +0 -2
  37. package/build/cjs/schema/validators/index.js +0 -2
  38. package/build/cjs/sub-blocks/HubspotForm/index.js +14 -2
  39. package/build/esm/blocks/Banner/schema.d.ts +312 -0
  40. package/build/esm/blocks/Media/schema.d.ts +104 -0
  41. package/build/esm/components/Button/Button.js +5 -2
  42. package/build/esm/components/CardBase/CardBase.d.ts +2 -0
  43. package/build/esm/components/CardBase/CardBase.js +4 -1
  44. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -1
  45. package/build/esm/components/Link/Link.js +4 -1
  46. package/build/esm/components/YandexForm/YandexForm.d.ts +2 -0
  47. package/build/esm/components/YandexForm/YandexForm.js +13 -2
  48. package/build/esm/containers/PageConstructor/Provider.d.ts +2 -0
  49. package/build/esm/containers/PageConstructor/Provider.js +3 -1
  50. package/build/esm/context/analyticsContext/analyticsContext.d.ts +6 -0
  51. package/build/esm/context/analyticsContext/analyticsContext.js +2 -0
  52. package/build/esm/context/analyticsContext/index.d.ts +1 -0
  53. package/build/esm/context/analyticsContext/index.js +1 -0
  54. package/build/esm/context/metrikaContext/metrikaContext.d.ts +6 -0
  55. package/build/esm/hooks/useAnalytics.d.ts +2 -0
  56. package/build/esm/hooks/useAnalytics.js +11 -0
  57. package/build/esm/hooks/useMetrika.d.ts +6 -0
  58. package/build/esm/hooks/useMetrika.js +8 -0
  59. package/build/esm/models/common.d.ts +30 -0
  60. package/build/esm/models/common.js +3 -0
  61. package/build/esm/models/constructor-items/common.d.ts +4 -1
  62. package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -1
  63. package/build/esm/models/navigation.d.ts +3 -1
  64. package/build/esm/navigation/components/Header/Header.css +3 -5
  65. package/build/esm/navigation/components/Logo/Logo.css +6 -5
  66. package/build/esm/navigation/components/NavigationItem/NavigationItem.css +0 -1
  67. package/build/esm/schema/index.d.ts +0 -67
  68. package/build/esm/schema/index.js +1 -2
  69. package/build/esm/schema/validators/common.d.ts +220 -0
  70. package/build/esm/schema/validators/common.js +10 -0
  71. package/build/esm/schema/validators/event.d.ts +50 -0
  72. package/build/esm/schema/validators/event.js +50 -0
  73. package/build/esm/schema/validators/index.d.ts +0 -2
  74. package/build/esm/schema/validators/index.js +0 -2
  75. package/build/esm/sub-blocks/HubspotForm/index.js +14 -2
  76. package/package.json +1 -1
  77. package/server/models/common.d.ts +30 -0
  78. package/server/models/common.js +3 -0
  79. package/server/models/constructor-items/common.d.ts +4 -1
  80. package/server/models/constructor-items/sub-blocks.d.ts +2 -1
  81. package/server/models/navigation.d.ts +3 -1
  82. package/build/cjs/navigation/schema.d.ts +0 -60
  83. package/build/cjs/navigation/schema.js +0 -80
  84. package/build/cjs/schema/validators/navigation.d.ts +0 -1
  85. package/build/esm/navigation/schema.d.ts +0 -60
  86. package/build/esm/navigation/schema.js +0 -77
  87. package/build/esm/schema/validators/navigation.d.ts +0 -1
  88. package/build/esm/schema/validators/navigation.js +0 -1
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NavigationHeaderProps = exports.LogoProps = void 0;
4
- const common_1 = require("../schema/validators/common");
5
- const schema_1 = require("../components/Image/schema");
6
- const lodash_1 = require("lodash");
7
- const utils_1 = require("../schema/validators/utils");
8
- const NavigationItemType = {
9
- type: 'string',
10
- enum: ['link', 'button', 'dropdown'],
11
- };
12
- exports.LogoProps = {
13
- type: 'object',
14
- additionalProperties: false,
15
- required: ['icon'],
16
- properties: {
17
- icon: schema_1.ImageProps,
18
- text: {
19
- type: 'string',
20
- contentType: 'text',
21
- },
22
- url: {
23
- type: 'string',
24
- },
25
- },
26
- };
27
- const NavigationItemBaseProps = {
28
- text: {
29
- type: 'string',
30
- contentType: 'text',
31
- },
32
- url: {
33
- type: 'string',
34
- },
35
- icon: {
36
- type: 'string',
37
- pattern: schema_1.urlPattern,
38
- },
39
- };
40
- const NavigationItemBaseLinkProps = (0, lodash_1.omit)(NavigationItemBaseProps, ['url']);
41
- const NavigationLinkItemProps = {
42
- type: 'object',
43
- additionalProperties: false,
44
- required: ['type', 'text'],
45
- properties: Object.assign(Object.assign({}, NavigationItemBaseLinkProps), { type: Object.assign({}, NavigationItemType), url: {
46
- type: 'string',
47
- }, target: {
48
- type: 'string',
49
- }, arrow: {
50
- type: 'boolean',
51
- } }),
52
- };
53
- const NavigationButtonItemProps = {
54
- type: 'object',
55
- additionalProperties: false,
56
- required: ['type', 'text', 'url'],
57
- properties: Object.assign(Object.assign({}, common_1.ButtonProps), { type: Object.assign({}, NavigationItemType) }),
58
- };
59
- const NavigationDropdownItemProps = {
60
- type: 'object',
61
- additionalProperties: false,
62
- required: ['type', 'items'],
63
- properties: Object.assign(Object.assign({}, NavigationItemBaseProps), { type: Object.assign({}, NavigationItemType), items: (0, utils_1.filteredArray)(NavigationLinkItemProps) }),
64
- };
65
- const NavigationItemProps = {
66
- oneOf: [
67
- (0, utils_1.filteredArray)(NavigationLinkItemProps),
68
- (0, utils_1.filteredArray)(NavigationButtonItemProps),
69
- (0, utils_1.filteredArray)(NavigationDropdownItemProps),
70
- ],
71
- };
72
- exports.NavigationHeaderProps = {
73
- type: 'object',
74
- additionalProperties: false,
75
- required: ['leftItems'],
76
- properties: {
77
- leftItems: NavigationItemProps,
78
- rightItems: NavigationItemProps,
79
- },
80
- };
@@ -1 +0,0 @@
1
- export * from '../../navigation/schema';
@@ -1,60 +0,0 @@
1
- export declare const LogoProps: {
2
- type: string;
3
- additionalProperties: boolean;
4
- required: string[];
5
- properties: {
6
- icon: {
7
- oneOf: ({
8
- type: string;
9
- properties: {
10
- when: {
11
- type: string;
12
- };
13
- };
14
- } | {
15
- type: string;
16
- pattern: string;
17
- })[];
18
- };
19
- text: {
20
- type: string;
21
- contentType: string;
22
- };
23
- url: {
24
- type: string;
25
- };
26
- };
27
- };
28
- export declare const NavigationHeaderProps: {
29
- type: string;
30
- additionalProperties: boolean;
31
- required: string[];
32
- properties: {
33
- leftItems: {
34
- oneOf: {
35
- type: string;
36
- items: {
37
- type: string;
38
- properties: {
39
- when: {
40
- type: string;
41
- };
42
- };
43
- };
44
- }[];
45
- };
46
- rightItems: {
47
- oneOf: {
48
- type: string;
49
- items: {
50
- type: string;
51
- properties: {
52
- when: {
53
- type: string;
54
- };
55
- };
56
- };
57
- }[];
58
- };
59
- };
60
- };
@@ -1,77 +0,0 @@
1
- import { ButtonProps } from '../schema/validators/common';
2
- import { ImageProps, urlPattern } from '../components/Image/schema';
3
- import { omit } from 'lodash';
4
- import { filteredArray } from '../schema/validators/utils';
5
- const NavigationItemType = {
6
- type: 'string',
7
- enum: ['link', 'button', 'dropdown'],
8
- };
9
- export const LogoProps = {
10
- type: 'object',
11
- additionalProperties: false,
12
- required: ['icon'],
13
- properties: {
14
- icon: ImageProps,
15
- text: {
16
- type: 'string',
17
- contentType: 'text',
18
- },
19
- url: {
20
- type: 'string',
21
- },
22
- },
23
- };
24
- const NavigationItemBaseProps = {
25
- text: {
26
- type: 'string',
27
- contentType: 'text',
28
- },
29
- url: {
30
- type: 'string',
31
- },
32
- icon: {
33
- type: 'string',
34
- pattern: urlPattern,
35
- },
36
- };
37
- const NavigationItemBaseLinkProps = omit(NavigationItemBaseProps, ['url']);
38
- const NavigationLinkItemProps = {
39
- type: 'object',
40
- additionalProperties: false,
41
- required: ['type', 'text'],
42
- properties: Object.assign(Object.assign({}, NavigationItemBaseLinkProps), { type: Object.assign({}, NavigationItemType), url: {
43
- type: 'string',
44
- }, target: {
45
- type: 'string',
46
- }, arrow: {
47
- type: 'boolean',
48
- } }),
49
- };
50
- const NavigationButtonItemProps = {
51
- type: 'object',
52
- additionalProperties: false,
53
- required: ['type', 'text', 'url'],
54
- properties: Object.assign(Object.assign({}, ButtonProps), { type: Object.assign({}, NavigationItemType) }),
55
- };
56
- const NavigationDropdownItemProps = {
57
- type: 'object',
58
- additionalProperties: false,
59
- required: ['type', 'items'],
60
- properties: Object.assign(Object.assign({}, NavigationItemBaseProps), { type: Object.assign({}, NavigationItemType), items: filteredArray(NavigationLinkItemProps) }),
61
- };
62
- const NavigationItemProps = {
63
- oneOf: [
64
- filteredArray(NavigationLinkItemProps),
65
- filteredArray(NavigationButtonItemProps),
66
- filteredArray(NavigationDropdownItemProps),
67
- ],
68
- };
69
- export const NavigationHeaderProps = {
70
- type: 'object',
71
- additionalProperties: false,
72
- required: ['leftItems'],
73
- properties: {
74
- leftItems: NavigationItemProps,
75
- rightItems: NavigationItemProps,
76
- },
77
- };
@@ -1 +0,0 @@
1
- export * from '../../navigation/schema';
@@ -1 +0,0 @@
1
- export * from '../../navigation/schema';