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

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.
@@ -1,117 +1,60 @@
1
- export declare const NavigationProps: {
1
+ export declare const LogoProps: {
2
+ type: string;
2
3
  additionalProperties: boolean;
3
- required: never[];
4
+ required: string[];
4
5
  properties: {
5
- logo: {
6
+ icon: {
6
7
  oneOf: ({
7
8
  type: string;
8
- additionalProperties: boolean;
9
- required: string[];
10
9
  properties: {
11
- icon: {
12
- oneOf: ({
13
- type: string;
14
- properties: {
15
- when: {
16
- type: string;
17
- };
18
- };
19
- } | {
20
- type: string;
21
- pattern: string;
22
- })[];
23
- };
24
- text: {
25
- type: string;
26
- contentType: string;
27
- };
28
- url: {
10
+ when: {
29
11
  type: string;
30
12
  };
31
13
  };
32
14
  } | {
33
15
  type: string;
34
- additionalProperties: boolean;
35
- required: import("..").Theme[];
36
- properties: {};
16
+ pattern: string;
37
17
  })[];
38
18
  };
39
- header: {
19
+ text: {
40
20
  type: string;
41
- additionalProperties: boolean;
42
- required: string[];
43
- properties: {
44
- leftItems: {
45
- oneOf: {
46
- type: string;
47
- additionalProperties: boolean;
48
- required: string[];
49
- properties: {
50
- type: {
51
- type: string;
52
- enum: string[];
53
- };
54
- items: {
55
- type: string;
56
- items: {
57
- type: string;
58
- properties: {
59
- when: {
60
- type: string;
61
- };
62
- };
63
- };
64
- };
65
- text: {
66
- type: string;
67
- contentType: string;
68
- };
69
- url: {
70
- type: string;
71
- };
72
- icon: {
73
- type: string;
74
- pattern: string;
75
- };
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;
76
41
  };
77
- }[];
42
+ };
78
43
  };
79
- rightItems: {
80
- oneOf: {
81
- type: string;
82
- additionalProperties: boolean;
83
- required: string[];
84
- properties: {
85
- type: {
86
- type: string;
87
- enum: string[];
88
- };
89
- items: {
90
- type: string;
91
- items: {
92
- type: string;
93
- properties: {
94
- when: {
95
- type: string;
96
- };
97
- };
98
- };
99
- };
100
- text: {
101
- type: string;
102
- contentType: string;
103
- };
104
- url: {
105
- type: string;
106
- };
107
- icon: {
108
- type: string;
109
- pattern: string;
110
- };
44
+ }[];
45
+ };
46
+ rightItems: {
47
+ oneOf: {
48
+ type: string;
49
+ items: {
50
+ type: string;
51
+ properties: {
52
+ when: {
53
+ type: string;
111
54
  };
112
- }[];
55
+ };
113
56
  };
114
- };
57
+ }[];
115
58
  };
116
59
  };
117
60
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NavigationProps = void 0;
3
+ exports.NavigationHeaderProps = exports.LogoProps = void 0;
4
4
  const common_1 = require("../schema/validators/common");
5
5
  const schema_1 = require("../components/Image/schema");
6
6
  const lodash_1 = require("lodash");
@@ -9,7 +9,7 @@ const NavigationItemType = {
9
9
  type: 'string',
10
10
  enum: ['link', 'button', 'dropdown'],
11
11
  };
12
- const LogoProps = {
12
+ exports.LogoProps = {
13
13
  type: 'object',
14
14
  additionalProperties: false,
15
15
  required: ['icon'],
@@ -64,22 +64,17 @@ const NavigationDropdownItemProps = {
64
64
  };
65
65
  const NavigationItemProps = {
66
66
  oneOf: [
67
- Object.assign(Object.assign(Object.assign({}, NavigationLinkItemProps), NavigationButtonItemProps), NavigationDropdownItemProps),
67
+ (0, utils_1.filteredArray)(NavigationLinkItemProps),
68
+ (0, utils_1.filteredArray)(NavigationButtonItemProps),
69
+ (0, utils_1.filteredArray)(NavigationDropdownItemProps),
68
70
  ],
69
71
  };
70
- exports.NavigationProps = {
72
+ exports.NavigationHeaderProps = {
73
+ type: 'object',
71
74
  additionalProperties: false,
72
- required: [],
75
+ required: ['leftItems'],
73
76
  properties: {
74
- logo: (0, common_1.withTheme)(LogoProps),
75
- header: {
76
- type: 'object',
77
- additionalProperties: false,
78
- required: ['leftItems'],
79
- properties: {
80
- leftItems: NavigationItemProps,
81
- rightItems: NavigationItemProps,
82
- },
83
- },
77
+ leftItems: NavigationItemProps,
78
+ rightItems: NavigationItemProps,
84
79
  },
85
80
  };
@@ -31,6 +31,73 @@ export declare function generateDefaultSchema(config?: SchemaCustomConfig): {
31
31
  additionalProperties: boolean;
32
32
  required: string[];
33
33
  properties: {
34
+ logo: {
35
+ oneOf: ({
36
+ type: string;
37
+ additionalProperties: boolean;
38
+ required: string[];
39
+ properties: {
40
+ icon: {
41
+ oneOf: ({
42
+ type: string;
43
+ properties: {
44
+ when: {
45
+ type: string;
46
+ };
47
+ };
48
+ } | {
49
+ type: string;
50
+ pattern: string;
51
+ })[];
52
+ };
53
+ text: {
54
+ type: string;
55
+ contentType: string;
56
+ };
57
+ url: {
58
+ type: string;
59
+ };
60
+ };
61
+ } | {
62
+ type: string;
63
+ additionalProperties: boolean;
64
+ required: import("..").Theme[];
65
+ properties: {};
66
+ })[];
67
+ };
68
+ header: {
69
+ type: string;
70
+ additionalProperties: boolean;
71
+ required: string[];
72
+ properties: {
73
+ leftItems: {
74
+ oneOf: {
75
+ type: string;
76
+ items: {
77
+ type: string;
78
+ properties: {
79
+ when: {
80
+ type: string;
81
+ };
82
+ };
83
+ };
84
+ }[];
85
+ };
86
+ rightItems: {
87
+ oneOf: {
88
+ type: string;
89
+ items: {
90
+ type: string;
91
+ properties: {
92
+ when: {
93
+ type: string;
94
+ };
95
+ };
96
+ };
97
+ }[];
98
+ };
99
+ };
100
+ };
34
101
  blocks: {
35
102
  type: string;
36
103
  items: {
@@ -159,121 +226,6 @@ export declare function generateDefaultSchema(config?: SchemaCustomConfig): {
159
226
  type: string;
160
227
  };
161
228
  };
162
- additionalProperties: boolean;
163
- required: never[];
164
- properties: {
165
- logo: {
166
- oneOf: ({
167
- type: string;
168
- additionalProperties: boolean;
169
- required: string[];
170
- properties: {
171
- icon: {
172
- oneOf: ({
173
- type: string;
174
- properties: {
175
- when: {
176
- type: string;
177
- };
178
- };
179
- } | {
180
- type: string;
181
- pattern: string;
182
- })[];
183
- };
184
- text: {
185
- type: string;
186
- contentType: string;
187
- };
188
- url: {
189
- type: string;
190
- };
191
- };
192
- } | {
193
- type: string;
194
- additionalProperties: boolean;
195
- required: import("..").Theme[];
196
- properties: {};
197
- })[];
198
- };
199
- header: {
200
- type: string;
201
- additionalProperties: boolean;
202
- required: string[];
203
- properties: {
204
- leftItems: {
205
- oneOf: {
206
- type: string;
207
- additionalProperties: boolean;
208
- required: string[];
209
- properties: {
210
- type: {
211
- type: string;
212
- enum: string[];
213
- };
214
- items: {
215
- type: string;
216
- items: {
217
- type: string;
218
- properties: {
219
- when: {
220
- type: string;
221
- };
222
- };
223
- };
224
- };
225
- text: {
226
- type: string;
227
- contentType: string;
228
- };
229
- url: {
230
- type: string;
231
- };
232
- icon: {
233
- type: string;
234
- pattern: string;
235
- };
236
- };
237
- }[];
238
- };
239
- rightItems: {
240
- oneOf: {
241
- type: string;
242
- additionalProperties: boolean;
243
- required: string[];
244
- properties: {
245
- type: {
246
- type: string;
247
- enum: string[];
248
- };
249
- items: {
250
- type: string;
251
- items: {
252
- type: string;
253
- properties: {
254
- when: {
255
- type: string;
256
- };
257
- };
258
- };
259
- };
260
- text: {
261
- type: string;
262
- contentType: string;
263
- };
264
- url: {
265
- type: string;
266
- };
267
- icon: {
268
- type: string;
269
- pattern: string;
270
- };
271
- };
272
- }[];
273
- };
274
- };
275
- };
276
- };
277
229
  animated: {
278
230
  type: string;
279
231
  };
@@ -89,7 +89,7 @@ function generateDefaultSchema(config) {
89
89
  type: 'object',
90
90
  additionalProperties: false,
91
91
  required: ['blocks'],
92
- properties: Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.AnimatableProps), navigation_1.NavigationProps), { blocks: {
92
+ properties: Object.assign(Object.assign(Object.assign({}, common_1.AnimatableProps), { logo: (0, common_1.withTheme)(navigation_1.LogoProps), header: navigation_1.NavigationHeaderProps, blocks: {
93
93
  type: 'array',
94
94
  items: {
95
95
  $ref: '#/definitions/children',
@@ -1,117 +1,60 @@
1
- export declare const NavigationProps: {
1
+ export declare const LogoProps: {
2
+ type: string;
2
3
  additionalProperties: boolean;
3
- required: never[];
4
+ required: string[];
4
5
  properties: {
5
- logo: {
6
+ icon: {
6
7
  oneOf: ({
7
8
  type: string;
8
- additionalProperties: boolean;
9
- required: string[];
10
9
  properties: {
11
- icon: {
12
- oneOf: ({
13
- type: string;
14
- properties: {
15
- when: {
16
- type: string;
17
- };
18
- };
19
- } | {
20
- type: string;
21
- pattern: string;
22
- })[];
23
- };
24
- text: {
25
- type: string;
26
- contentType: string;
27
- };
28
- url: {
10
+ when: {
29
11
  type: string;
30
12
  };
31
13
  };
32
14
  } | {
33
15
  type: string;
34
- additionalProperties: boolean;
35
- required: import("..").Theme[];
36
- properties: {};
16
+ pattern: string;
37
17
  })[];
38
18
  };
39
- header: {
19
+ text: {
40
20
  type: string;
41
- additionalProperties: boolean;
42
- required: string[];
43
- properties: {
44
- leftItems: {
45
- oneOf: {
46
- type: string;
47
- additionalProperties: boolean;
48
- required: string[];
49
- properties: {
50
- type: {
51
- type: string;
52
- enum: string[];
53
- };
54
- items: {
55
- type: string;
56
- items: {
57
- type: string;
58
- properties: {
59
- when: {
60
- type: string;
61
- };
62
- };
63
- };
64
- };
65
- text: {
66
- type: string;
67
- contentType: string;
68
- };
69
- url: {
70
- type: string;
71
- };
72
- icon: {
73
- type: string;
74
- pattern: string;
75
- };
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;
76
41
  };
77
- }[];
42
+ };
78
43
  };
79
- rightItems: {
80
- oneOf: {
81
- type: string;
82
- additionalProperties: boolean;
83
- required: string[];
84
- properties: {
85
- type: {
86
- type: string;
87
- enum: string[];
88
- };
89
- items: {
90
- type: string;
91
- items: {
92
- type: string;
93
- properties: {
94
- when: {
95
- type: string;
96
- };
97
- };
98
- };
99
- };
100
- text: {
101
- type: string;
102
- contentType: string;
103
- };
104
- url: {
105
- type: string;
106
- };
107
- icon: {
108
- type: string;
109
- pattern: string;
110
- };
44
+ }[];
45
+ };
46
+ rightItems: {
47
+ oneOf: {
48
+ type: string;
49
+ items: {
50
+ type: string;
51
+ properties: {
52
+ when: {
53
+ type: string;
111
54
  };
112
- }[];
55
+ };
113
56
  };
114
- };
57
+ }[];
115
58
  };
116
59
  };
117
60
  };
@@ -1,4 +1,4 @@
1
- import { ButtonProps, withTheme } from '../schema/validators/common';
1
+ import { ButtonProps } from '../schema/validators/common';
2
2
  import { ImageProps, urlPattern } from '../components/Image/schema';
3
3
  import { omit } from 'lodash';
4
4
  import { filteredArray } from '../schema/validators/utils';
@@ -6,7 +6,7 @@ const NavigationItemType = {
6
6
  type: 'string',
7
7
  enum: ['link', 'button', 'dropdown'],
8
8
  };
9
- const LogoProps = {
9
+ export const LogoProps = {
10
10
  type: 'object',
11
11
  additionalProperties: false,
12
12
  required: ['icon'],
@@ -61,22 +61,17 @@ const NavigationDropdownItemProps = {
61
61
  };
62
62
  const NavigationItemProps = {
63
63
  oneOf: [
64
- Object.assign(Object.assign(Object.assign({}, NavigationLinkItemProps), NavigationButtonItemProps), NavigationDropdownItemProps),
64
+ filteredArray(NavigationLinkItemProps),
65
+ filteredArray(NavigationButtonItemProps),
66
+ filteredArray(NavigationDropdownItemProps),
65
67
  ],
66
68
  };
67
- export const NavigationProps = {
69
+ export const NavigationHeaderProps = {
70
+ type: 'object',
68
71
  additionalProperties: false,
69
- required: [],
72
+ required: ['leftItems'],
70
73
  properties: {
71
- logo: withTheme(LogoProps),
72
- header: {
73
- type: 'object',
74
- additionalProperties: false,
75
- required: ['leftItems'],
76
- properties: {
77
- leftItems: NavigationItemProps,
78
- rightItems: NavigationItemProps,
79
- },
80
- },
74
+ leftItems: NavigationItemProps,
75
+ rightItems: NavigationItemProps,
81
76
  },
82
77
  };
@@ -31,6 +31,73 @@ export declare function generateDefaultSchema(config?: SchemaCustomConfig): {
31
31
  additionalProperties: boolean;
32
32
  required: string[];
33
33
  properties: {
34
+ logo: {
35
+ oneOf: ({
36
+ type: string;
37
+ additionalProperties: boolean;
38
+ required: string[];
39
+ properties: {
40
+ icon: {
41
+ oneOf: ({
42
+ type: string;
43
+ properties: {
44
+ when: {
45
+ type: string;
46
+ };
47
+ };
48
+ } | {
49
+ type: string;
50
+ pattern: string;
51
+ })[];
52
+ };
53
+ text: {
54
+ type: string;
55
+ contentType: string;
56
+ };
57
+ url: {
58
+ type: string;
59
+ };
60
+ };
61
+ } | {
62
+ type: string;
63
+ additionalProperties: boolean;
64
+ required: import("..").Theme[];
65
+ properties: {};
66
+ })[];
67
+ };
68
+ header: {
69
+ type: string;
70
+ additionalProperties: boolean;
71
+ required: string[];
72
+ properties: {
73
+ leftItems: {
74
+ oneOf: {
75
+ type: string;
76
+ items: {
77
+ type: string;
78
+ properties: {
79
+ when: {
80
+ type: string;
81
+ };
82
+ };
83
+ };
84
+ }[];
85
+ };
86
+ rightItems: {
87
+ oneOf: {
88
+ type: string;
89
+ items: {
90
+ type: string;
91
+ properties: {
92
+ when: {
93
+ type: string;
94
+ };
95
+ };
96
+ };
97
+ }[];
98
+ };
99
+ };
100
+ };
34
101
  blocks: {
35
102
  type: string;
36
103
  items: {
@@ -159,121 +226,6 @@ export declare function generateDefaultSchema(config?: SchemaCustomConfig): {
159
226
  type: string;
160
227
  };
161
228
  };
162
- additionalProperties: boolean;
163
- required: never[];
164
- properties: {
165
- logo: {
166
- oneOf: ({
167
- type: string;
168
- additionalProperties: boolean;
169
- required: string[];
170
- properties: {
171
- icon: {
172
- oneOf: ({
173
- type: string;
174
- properties: {
175
- when: {
176
- type: string;
177
- };
178
- };
179
- } | {
180
- type: string;
181
- pattern: string;
182
- })[];
183
- };
184
- text: {
185
- type: string;
186
- contentType: string;
187
- };
188
- url: {
189
- type: string;
190
- };
191
- };
192
- } | {
193
- type: string;
194
- additionalProperties: boolean;
195
- required: import("..").Theme[];
196
- properties: {};
197
- })[];
198
- };
199
- header: {
200
- type: string;
201
- additionalProperties: boolean;
202
- required: string[];
203
- properties: {
204
- leftItems: {
205
- oneOf: {
206
- type: string;
207
- additionalProperties: boolean;
208
- required: string[];
209
- properties: {
210
- type: {
211
- type: string;
212
- enum: string[];
213
- };
214
- items: {
215
- type: string;
216
- items: {
217
- type: string;
218
- properties: {
219
- when: {
220
- type: string;
221
- };
222
- };
223
- };
224
- };
225
- text: {
226
- type: string;
227
- contentType: string;
228
- };
229
- url: {
230
- type: string;
231
- };
232
- icon: {
233
- type: string;
234
- pattern: string;
235
- };
236
- };
237
- }[];
238
- };
239
- rightItems: {
240
- oneOf: {
241
- type: string;
242
- additionalProperties: boolean;
243
- required: string[];
244
- properties: {
245
- type: {
246
- type: string;
247
- enum: string[];
248
- };
249
- items: {
250
- type: string;
251
- items: {
252
- type: string;
253
- properties: {
254
- when: {
255
- type: string;
256
- };
257
- };
258
- };
259
- };
260
- text: {
261
- type: string;
262
- contentType: string;
263
- };
264
- url: {
265
- type: string;
266
- };
267
- icon: {
268
- type: string;
269
- pattern: string;
270
- };
271
- };
272
- }[];
273
- };
274
- };
275
- };
276
- };
277
229
  animated: {
278
230
  type: string;
279
231
  };
@@ -3,7 +3,7 @@ import { TabsBlock, BannerCard, SliderBlock, ExtendedFeaturesBlock, HeaderBlock,
3
3
  import { PartnerBlock, MediaCardBlock, TutorialCard, BackgroundCard, NewsCard, CardWithImage, PriceDetailedBlock, Quote, Divider, BasicCard, } from './validators/sub-blocks';
4
4
  import { AnimatableProps, BackgroundProps, MenuProps, withTheme } from './validators/common';
5
5
  import { filteredItem } from './validators/utils';
6
- import { NavigationProps } from './validators/navigation';
6
+ import { LogoProps, NavigationHeaderProps } from './validators/navigation';
7
7
  export const getBlocksCases = (blocks) => {
8
8
  return Object.values(blocks).reduce((acc, block) => (Object.assign(Object.assign({}, acc), block)));
9
9
  };
@@ -84,7 +84,7 @@ export function generateDefaultSchema(config) {
84
84
  type: 'object',
85
85
  additionalProperties: false,
86
86
  required: ['blocks'],
87
- properties: Object.assign(Object.assign(Object.assign(Object.assign({}, AnimatableProps), NavigationProps), { blocks: {
87
+ properties: Object.assign(Object.assign(Object.assign({}, AnimatableProps), { logo: withTheme(LogoProps), header: NavigationHeaderProps, blocks: {
88
88
  type: 'array',
89
89
  items: {
90
90
  $ref: '#/definitions/children',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "1.14.0-alpha.3",
3
+ "version": "1.14.0-alpha.5",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {