@gravity-ui/page-constructor 1.14.0-alpha.2 → 1.14.0-alpha.4

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,25 +1,55 @@
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: ({
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: {
7
35
  type: string;
8
36
  additionalProperties: boolean;
9
37
  required: string[];
10
38
  properties: {
11
- icon: {
12
- oneOf: ({
39
+ type: {
40
+ type: string;
41
+ enum: string[];
42
+ };
43
+ items: {
44
+ type: string;
45
+ items: {
13
46
  type: string;
14
47
  properties: {
15
48
  when: {
16
49
  type: string;
17
50
  };
18
51
  };
19
- } | {
20
- type: string;
21
- pattern: string;
22
- })[];
52
+ };
23
53
  };
24
54
  text: {
25
55
  type: string;
@@ -28,342 +58,47 @@ export declare const NavigationProps: {
28
58
  url: {
29
59
  type: string;
30
60
  };
61
+ icon: {
62
+ type: string;
63
+ pattern: string;
64
+ };
31
65
  };
32
- } | {
66
+ }[];
67
+ };
68
+ rightItems: {
69
+ oneOf: {
33
70
  type: string;
34
71
  additionalProperties: boolean;
35
- required: import("..").Theme[];
36
- properties: {};
37
- })[];
38
- };
39
- header: {
40
- type: string;
41
- additionalProperties: boolean;
42
- required: string[];
43
- properties: {
44
- leftItems: {
45
- oneOf: {
72
+ required: string[];
73
+ properties: {
74
+ type: {
46
75
  type: string;
47
- additionalProperties: boolean;
48
- required: never[];
49
- properties: {
50
- type: {
51
- type: string;
52
- enum: string[];
53
- };
54
- additionalProperties: boolean;
55
- properties: {
56
- text: {
57
- type: string;
58
- contentType: string;
59
- };
60
- url: {
61
- type: string;
62
- };
63
- primary: {
64
- type: string;
65
- };
66
- size: {
67
- type: string;
68
- enum: string[];
69
- };
70
- theme: {
71
- type: string;
72
- enum: string[];
73
- };
74
- img: {
75
- anyOf: ({
76
- type: string;
77
- additionalProperties?: undefined;
78
- required?: undefined;
79
- properties?: undefined;
80
- } | {
81
- type: string;
82
- additionalProperties: boolean;
83
- required: string[];
84
- properties: {
85
- data: {
86
- type: string;
87
- };
88
- position: {
89
- type: string;
90
- enum: string[];
91
- };
92
- alt: {
93
- type: string;
94
- contentType: string;
95
- };
96
- };
97
- })[];
98
- };
99
- metrikaGoals: {
100
- anyOf: ({
101
- type: string;
102
- items?: undefined;
103
- } | {
104
- type: string;
105
- items: {
106
- type: string;
107
- additionalProperties?: undefined;
108
- required?: undefined;
109
- properties?: undefined;
110
- };
111
- } | {
112
- type: string;
113
- items: {
114
- type: string;
115
- additionalProperties: boolean;
116
- required: string[];
117
- properties: {
118
- name: {
119
- type: string;
120
- };
121
- isCrossSite: {
122
- type: string;
123
- };
124
- };
125
- };
126
- })[];
127
- };
128
- pixelEvents: {
129
- type: string;
130
- items: {
131
- type: string;
132
- required: string[];
133
- additionalProperties: boolean;
134
- properties: {
135
- name: {
136
- type: string;
137
- enum: import("..").PixelEventType[];
138
- };
139
- data: {};
140
- };
141
- select: {
142
- $data: string;
143
- };
144
- selectCases: {
145
- SubmitApplication: {
146
- additionalProperties: boolean;
147
- properties: {
148
- name: {};
149
- };
150
- };
151
- Contact: {
152
- additionalProperties: boolean;
153
- properties: {
154
- name: {};
155
- };
156
- };
157
- Lead: {
158
- additionalProperties: boolean;
159
- properties: {
160
- name: {};
161
- data: {
162
- type: string;
163
- additionalProperties: boolean;
164
- properties: {
165
- content_category: {
166
- type: string;
167
- };
168
- content_name: {
169
- type: string;
170
- };
171
- currency: {
172
- type: string;
173
- };
174
- value: {
175
- type: string;
176
- };
177
- };
178
- };
179
- };
180
- };
181
- };
182
- };
183
- };
184
- target: {
185
- type: string;
186
- enum: string[];
187
- };
188
- };
189
- if: {
190
- properties: {
191
- theme: {
192
- enum: string[];
193
- };
194
- };
195
- };
196
- then: {
197
- required: string[];
198
- };
199
- else: {
200
- required: string[];
201
- };
202
- };
203
- }[];
204
- };
205
- rightItems: {
206
- oneOf: {
76
+ enum: string[];
77
+ };
78
+ items: {
207
79
  type: string;
208
- additionalProperties: boolean;
209
- required: never[];
210
- properties: {
211
- type: {
212
- type: string;
213
- enum: string[];
214
- };
215
- additionalProperties: boolean;
80
+ items: {
81
+ type: string;
216
82
  properties: {
217
- text: {
218
- type: string;
219
- contentType: string;
220
- };
221
- url: {
222
- type: string;
223
- };
224
- primary: {
225
- type: string;
226
- };
227
- size: {
228
- type: string;
229
- enum: string[];
230
- };
231
- theme: {
232
- type: string;
233
- enum: string[];
234
- };
235
- img: {
236
- anyOf: ({
237
- type: string;
238
- additionalProperties?: undefined;
239
- required?: undefined;
240
- properties?: undefined;
241
- } | {
242
- type: string;
243
- additionalProperties: boolean;
244
- required: string[];
245
- properties: {
246
- data: {
247
- type: string;
248
- };
249
- position: {
250
- type: string;
251
- enum: string[];
252
- };
253
- alt: {
254
- type: string;
255
- contentType: string;
256
- };
257
- };
258
- })[];
259
- };
260
- metrikaGoals: {
261
- anyOf: ({
262
- type: string;
263
- items?: undefined;
264
- } | {
265
- type: string;
266
- items: {
267
- type: string;
268
- additionalProperties?: undefined;
269
- required?: undefined;
270
- properties?: undefined;
271
- };
272
- } | {
273
- type: string;
274
- items: {
275
- type: string;
276
- additionalProperties: boolean;
277
- required: string[];
278
- properties: {
279
- name: {
280
- type: string;
281
- };
282
- isCrossSite: {
283
- type: string;
284
- };
285
- };
286
- };
287
- })[];
288
- };
289
- pixelEvents: {
290
- type: string;
291
- items: {
292
- type: string;
293
- required: string[];
294
- additionalProperties: boolean;
295
- properties: {
296
- name: {
297
- type: string;
298
- enum: import("..").PixelEventType[];
299
- };
300
- data: {};
301
- };
302
- select: {
303
- $data: string;
304
- };
305
- selectCases: {
306
- SubmitApplication: {
307
- additionalProperties: boolean;
308
- properties: {
309
- name: {};
310
- };
311
- };
312
- Contact: {
313
- additionalProperties: boolean;
314
- properties: {
315
- name: {};
316
- };
317
- };
318
- Lead: {
319
- additionalProperties: boolean;
320
- properties: {
321
- name: {};
322
- data: {
323
- type: string;
324
- additionalProperties: boolean;
325
- properties: {
326
- content_category: {
327
- type: string;
328
- };
329
- content_name: {
330
- type: string;
331
- };
332
- currency: {
333
- type: string;
334
- };
335
- value: {
336
- type: string;
337
- };
338
- };
339
- };
340
- };
341
- };
342
- };
343
- };
344
- };
345
- target: {
83
+ when: {
346
84
  type: string;
347
- enum: string[];
348
- };
349
- };
350
- if: {
351
- properties: {
352
- theme: {
353
- enum: string[];
354
- };
355
85
  };
356
86
  };
357
- then: {
358
- required: string[];
359
- };
360
- else: {
361
- required: string[];
362
- };
363
87
  };
364
- }[];
88
+ };
89
+ text: {
90
+ type: string;
91
+ contentType: string;
92
+ };
93
+ url: {
94
+ type: string;
95
+ };
96
+ icon: {
97
+ type: string;
98
+ pattern: string;
99
+ };
365
100
  };
366
- };
101
+ }[];
367
102
  };
368
103
  };
369
104
  };
@@ -1,11 +1,12 @@
1
- import { ButtonBlock, 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
+ import { filteredArray } from '../schema/validators/utils';
4
5
  const NavigationItemType = {
5
6
  type: 'string',
6
7
  enum: ['link', 'button', 'dropdown'],
7
8
  };
8
- const LogoProps = {
9
+ export const LogoProps = {
9
10
  type: 'object',
10
11
  additionalProperties: false,
11
12
  required: ['icon'],
@@ -21,28 +22,23 @@ const LogoProps = {
21
22
  },
22
23
  };
23
24
  const NavigationItemBaseProps = {
24
- type: 'object',
25
- additionalProperties: false,
26
- required: ['text'],
27
- properties: {
28
- text: {
29
- type: 'string',
30
- contentType: 'text',
31
- },
32
- url: {
33
- type: 'string',
34
- },
35
- icon: {
36
- type: 'string',
37
- pattern: urlPattern,
38
- },
25
+ text: {
26
+ type: 'string',
27
+ contentType: 'text',
28
+ },
29
+ url: {
30
+ type: 'string',
31
+ },
32
+ icon: {
33
+ type: 'string',
34
+ pattern: urlPattern,
39
35
  },
40
36
  };
41
37
  const NavigationItemBaseLinkProps = omit(NavigationItemBaseProps, ['url']);
42
38
  const NavigationLinkItemProps = {
43
39
  type: 'object',
44
40
  additionalProperties: false,
45
- required: [],
41
+ required: ['type', 'text'],
46
42
  properties: Object.assign(Object.assign({}, NavigationItemBaseLinkProps), { type: Object.assign({}, NavigationItemType), url: {
47
43
  type: 'string',
48
44
  }, target: {
@@ -54,33 +50,26 @@ const NavigationLinkItemProps = {
54
50
  const NavigationButtonItemProps = {
55
51
  type: 'object',
56
52
  additionalProperties: false,
57
- required: [],
58
- properties: Object.assign(Object.assign({}, ButtonBlock), { type: Object.assign({}, NavigationItemType) }),
53
+ required: ['type', 'text', 'url'],
54
+ properties: Object.assign(Object.assign({}, ButtonProps), { type: Object.assign({}, NavigationItemType) }),
59
55
  };
60
56
  const NavigationDropdownItemProps = {
61
57
  type: 'object',
62
58
  additionalProperties: false,
63
- required: [],
64
- properties: Object.assign(Object.assign({}, ButtonBlock), { type: Object.assign({}, NavigationItemType) }),
59
+ required: ['type', 'items'],
60
+ properties: Object.assign(Object.assign({}, NavigationItemBaseProps), { type: Object.assign({}, NavigationItemType), items: filteredArray(NavigationLinkItemProps) }),
65
61
  };
66
62
  const NavigationItemProps = {
67
63
  oneOf: [
68
64
  Object.assign(Object.assign(Object.assign({}, NavigationLinkItemProps), NavigationButtonItemProps), NavigationDropdownItemProps),
69
65
  ],
70
66
  };
71
- export const NavigationProps = {
67
+ export const NavigationHeaderProps = {
68
+ type: 'object',
72
69
  additionalProperties: false,
73
- required: [],
70
+ required: ['leftItems'],
74
71
  properties: {
75
- logo: withTheme(LogoProps),
76
- header: {
77
- type: 'object',
78
- additionalProperties: false,
79
- required: ['leftItems'],
80
- properties: {
81
- leftItems: NavigationItemProps,
82
- rightItems: NavigationItemProps,
83
- },
84
- },
72
+ leftItems: NavigationItemProps,
73
+ rightItems: NavigationItemProps,
85
74
  },
86
75
  };