@gravity-ui/page-constructor 3.0.0 → 3.1.1

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 (63) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +15 -0
  3. package/build/cjs/blocks/Header/schema.d.ts +234 -0
  4. package/build/cjs/blocks/HeaderSlider/schema.d.ts +78 -0
  5. package/build/cjs/blocks/Media/schema.d.ts +156 -0
  6. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +78 -0
  7. package/build/cjs/blocks/Slider/Slider.js +1 -1
  8. package/build/cjs/blocks/Tabs/schema.d.ts +78 -0
  9. package/build/cjs/components/BlockBase/BlockBase.js +2 -2
  10. package/build/cjs/components/Media/Media.js +1 -1
  11. package/build/cjs/components/VideoBlock/VideoBlock.d.ts +2 -1
  12. package/build/cjs/components/VideoBlock/VideoBlock.js +6 -2
  13. package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +2 -2
  14. package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +2 -2
  15. package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +5 -3
  16. package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
  17. package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +4 -2
  18. package/build/cjs/customization/BlockDecoration.d.ts +1 -1
  19. package/build/cjs/customization/BlockDecoration.js +4 -8
  20. package/build/cjs/models/common.d.ts +2 -1
  21. package/build/cjs/models/common.js +1 -0
  22. package/build/cjs/models/constructor-items/blocks.d.ts +1 -0
  23. package/build/cjs/models/customization.d.ts +1 -1
  24. package/build/cjs/schema/validators/common.d.ts +78 -0
  25. package/build/cjs/schema/validators/common.js +3 -0
  26. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +78 -0
  27. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +78 -0
  28. package/build/cjs/utils/blocks.d.ts +0 -1
  29. package/build/cjs/utils/blocks.js +1 -3
  30. package/build/esm/blocks/Header/schema.d.ts +234 -0
  31. package/build/esm/blocks/HeaderSlider/schema.d.ts +78 -0
  32. package/build/esm/blocks/Media/schema.d.ts +156 -0
  33. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +78 -0
  34. package/build/esm/blocks/Slider/Slider.js +2 -2
  35. package/build/esm/blocks/Tabs/schema.d.ts +78 -0
  36. package/build/esm/components/BlockBase/BlockBase.js +2 -2
  37. package/build/esm/components/Media/Media.js +1 -1
  38. package/build/esm/components/VideoBlock/VideoBlock.d.ts +2 -1
  39. package/build/esm/components/VideoBlock/VideoBlock.js +6 -2
  40. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +2 -2
  41. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +2 -2
  42. package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +5 -3
  43. package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
  44. package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +4 -2
  45. package/build/esm/customization/BlockDecoration.d.ts +1 -1
  46. package/build/esm/customization/BlockDecoration.js +4 -8
  47. package/build/esm/models/common.d.ts +2 -1
  48. package/build/esm/models/common.js +1 -0
  49. package/build/esm/models/constructor-items/blocks.d.ts +1 -0
  50. package/build/esm/models/customization.d.ts +1 -1
  51. package/build/esm/schema/validators/common.d.ts +78 -0
  52. package/build/esm/schema/validators/common.js +3 -0
  53. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +78 -0
  54. package/build/esm/sub-blocks/MediaCard/schema.d.ts +78 -0
  55. package/build/esm/utils/blocks.d.ts +0 -1
  56. package/build/esm/utils/blocks.js +0 -1
  57. package/package.json +1 -1
  58. package/server/models/common.d.ts +2 -1
  59. package/server/models/common.js +1 -0
  60. package/server/models/constructor-items/blocks.d.ts +1 -0
  61. package/server/models/customization.d.ts +1 -1
  62. package/server/utils/blocks.d.ts +0 -1
  63. package/server/utils/blocks.js +1 -3
@@ -140,6 +140,84 @@ export declare const HeaderBackgroundProps: {
140
140
  fullscreen: {
141
141
  type: string;
142
142
  };
143
+ analyticsEvents: {
144
+ anyOf: ({
145
+ type: string;
146
+ additionalProperties: {
147
+ type: string;
148
+ };
149
+ required: string[];
150
+ properties: {
151
+ name: {
152
+ type: string;
153
+ };
154
+ type: {
155
+ type: string;
156
+ };
157
+ counters: {
158
+ type: string;
159
+ additionalProperties: boolean;
160
+ required: never[];
161
+ properties: {
162
+ include: {
163
+ type: string;
164
+ items: {
165
+ type: string;
166
+ };
167
+ };
168
+ exclude: {
169
+ type: string;
170
+ items: {
171
+ type: string;
172
+ };
173
+ };
174
+ };
175
+ };
176
+ context: {
177
+ type: string;
178
+ };
179
+ };
180
+ } | {
181
+ type: string;
182
+ items: {
183
+ type: string;
184
+ additionalProperties: {
185
+ type: string;
186
+ };
187
+ required: string[];
188
+ properties: {
189
+ name: {
190
+ type: string;
191
+ };
192
+ type: {
193
+ type: string;
194
+ };
195
+ counters: {
196
+ type: string;
197
+ additionalProperties: boolean;
198
+ required: never[];
199
+ properties: {
200
+ include: {
201
+ type: string;
202
+ items: {
203
+ type: string;
204
+ };
205
+ };
206
+ exclude: {
207
+ type: string;
208
+ items: {
209
+ type: string;
210
+ };
211
+ };
212
+ };
213
+ };
214
+ context: {
215
+ type: string;
216
+ };
217
+ };
218
+ };
219
+ })[];
220
+ };
143
221
  };
144
222
  };
145
223
  export declare const HeaderProperties: {
@@ -430,6 +508,84 @@ export declare const HeaderProperties: {
430
508
  fullscreen: {
431
509
  type: string;
432
510
  };
511
+ analyticsEvents: {
512
+ anyOf: ({
513
+ type: string;
514
+ additionalProperties: {
515
+ type: string;
516
+ };
517
+ required: string[];
518
+ properties: {
519
+ name: {
520
+ type: string;
521
+ };
522
+ type: {
523
+ type: string;
524
+ };
525
+ counters: {
526
+ type: string;
527
+ additionalProperties: boolean;
528
+ required: never[];
529
+ properties: {
530
+ include: {
531
+ type: string;
532
+ items: {
533
+ type: string;
534
+ };
535
+ };
536
+ exclude: {
537
+ type: string;
538
+ items: {
539
+ type: string;
540
+ };
541
+ };
542
+ };
543
+ };
544
+ context: {
545
+ type: string;
546
+ };
547
+ };
548
+ } | {
549
+ type: string;
550
+ items: {
551
+ type: string;
552
+ additionalProperties: {
553
+ type: string;
554
+ };
555
+ required: string[];
556
+ properties: {
557
+ name: {
558
+ type: string;
559
+ };
560
+ type: {
561
+ type: string;
562
+ };
563
+ counters: {
564
+ type: string;
565
+ additionalProperties: boolean;
566
+ required: never[];
567
+ properties: {
568
+ include: {
569
+ type: string;
570
+ items: {
571
+ type: string;
572
+ };
573
+ };
574
+ exclude: {
575
+ type: string;
576
+ items: {
577
+ type: string;
578
+ };
579
+ };
580
+ };
581
+ };
582
+ context: {
583
+ type: string;
584
+ };
585
+ };
586
+ };
587
+ })[];
588
+ };
433
589
  };
434
590
  } | {
435
591
  type: string;
@@ -766,6 +922,84 @@ export declare const HeaderBlock: {
766
922
  fullscreen: {
767
923
  type: string;
768
924
  };
925
+ analyticsEvents: {
926
+ anyOf: ({
927
+ type: string;
928
+ additionalProperties: {
929
+ type: string;
930
+ };
931
+ required: string[];
932
+ properties: {
933
+ name: {
934
+ type: string;
935
+ };
936
+ type: {
937
+ type: string;
938
+ };
939
+ counters: {
940
+ type: string;
941
+ additionalProperties: boolean;
942
+ required: never[];
943
+ properties: {
944
+ include: {
945
+ type: string;
946
+ items: {
947
+ type: string;
948
+ };
949
+ };
950
+ exclude: {
951
+ type: string;
952
+ items: {
953
+ type: string;
954
+ };
955
+ };
956
+ };
957
+ };
958
+ context: {
959
+ type: string;
960
+ };
961
+ };
962
+ } | {
963
+ type: string;
964
+ items: {
965
+ type: string;
966
+ additionalProperties: {
967
+ type: string;
968
+ };
969
+ required: string[];
970
+ properties: {
971
+ name: {
972
+ type: string;
973
+ };
974
+ type: {
975
+ type: string;
976
+ };
977
+ counters: {
978
+ type: string;
979
+ additionalProperties: boolean;
980
+ required: never[];
981
+ properties: {
982
+ include: {
983
+ type: string;
984
+ items: {
985
+ type: string;
986
+ };
987
+ };
988
+ exclude: {
989
+ type: string;
990
+ items: {
991
+ type: string;
992
+ };
993
+ };
994
+ };
995
+ };
996
+ context: {
997
+ type: string;
998
+ };
999
+ };
1000
+ };
1001
+ })[];
1002
+ };
769
1003
  };
770
1004
  } | {
771
1005
  type: string;
@@ -297,6 +297,84 @@ export declare const HeaderSliderBlock: {
297
297
  fullscreen: {
298
298
  type: string;
299
299
  };
300
+ analyticsEvents: {
301
+ anyOf: ({
302
+ type: string;
303
+ additionalProperties: {
304
+ type: string;
305
+ };
306
+ required: string[];
307
+ properties: {
308
+ name: {
309
+ type: string;
310
+ };
311
+ type: {
312
+ type: string;
313
+ };
314
+ counters: {
315
+ type: string;
316
+ additionalProperties: boolean;
317
+ required: never[];
318
+ properties: {
319
+ include: {
320
+ type: string;
321
+ items: {
322
+ type: string;
323
+ };
324
+ };
325
+ exclude: {
326
+ type: string;
327
+ items: {
328
+ type: string;
329
+ };
330
+ };
331
+ };
332
+ };
333
+ context: {
334
+ type: string;
335
+ };
336
+ };
337
+ } | {
338
+ type: string;
339
+ items: {
340
+ type: string;
341
+ additionalProperties: {
342
+ type: string;
343
+ };
344
+ required: string[];
345
+ properties: {
346
+ name: {
347
+ type: string;
348
+ };
349
+ type: {
350
+ type: string;
351
+ };
352
+ counters: {
353
+ type: string;
354
+ additionalProperties: boolean;
355
+ required: never[];
356
+ properties: {
357
+ include: {
358
+ type: string;
359
+ items: {
360
+ type: string;
361
+ };
362
+ };
363
+ exclude: {
364
+ type: string;
365
+ items: {
366
+ type: string;
367
+ };
368
+ };
369
+ };
370
+ };
371
+ context: {
372
+ type: string;
373
+ };
374
+ };
375
+ };
376
+ })[];
377
+ };
300
378
  };
301
379
  } | {
302
380
  type: string;
@@ -134,6 +134,84 @@ export declare const Media: {
134
134
  fullscreen: {
135
135
  type: string;
136
136
  };
137
+ analyticsEvents: {
138
+ anyOf: ({
139
+ type: string;
140
+ additionalProperties: {
141
+ type: string;
142
+ };
143
+ required: string[];
144
+ properties: {
145
+ name: {
146
+ type: string;
147
+ };
148
+ type: {
149
+ type: string;
150
+ };
151
+ counters: {
152
+ type: string;
153
+ additionalProperties: boolean;
154
+ required: never[];
155
+ properties: {
156
+ include: {
157
+ type: string;
158
+ items: {
159
+ type: string;
160
+ };
161
+ };
162
+ exclude: {
163
+ type: string;
164
+ items: {
165
+ type: string;
166
+ };
167
+ };
168
+ };
169
+ };
170
+ context: {
171
+ type: string;
172
+ };
173
+ };
174
+ } | {
175
+ type: string;
176
+ items: {
177
+ type: string;
178
+ additionalProperties: {
179
+ type: string;
180
+ };
181
+ required: string[];
182
+ properties: {
183
+ name: {
184
+ type: string;
185
+ };
186
+ type: {
187
+ type: string;
188
+ };
189
+ counters: {
190
+ type: string;
191
+ additionalProperties: boolean;
192
+ required: never[];
193
+ properties: {
194
+ include: {
195
+ type: string;
196
+ items: {
197
+ type: string;
198
+ };
199
+ };
200
+ exclude: {
201
+ type: string;
202
+ items: {
203
+ type: string;
204
+ };
205
+ };
206
+ };
207
+ };
208
+ context: {
209
+ type: string;
210
+ };
211
+ };
212
+ };
213
+ })[];
214
+ };
137
215
  };
138
216
  };
139
217
  export declare const MediaBlockBaseProps: {
@@ -614,6 +692,84 @@ export declare const MediaBlock: {
614
692
  fullscreen: {
615
693
  type: string;
616
694
  };
695
+ analyticsEvents: {
696
+ anyOf: ({
697
+ type: string;
698
+ additionalProperties: {
699
+ type: string;
700
+ };
701
+ required: string[];
702
+ properties: {
703
+ name: {
704
+ type: string;
705
+ };
706
+ type: {
707
+ type: string;
708
+ };
709
+ counters: {
710
+ type: string;
711
+ additionalProperties: boolean;
712
+ required: never[];
713
+ properties: {
714
+ include: {
715
+ type: string;
716
+ items: {
717
+ type: string;
718
+ };
719
+ };
720
+ exclude: {
721
+ type: string;
722
+ items: {
723
+ type: string;
724
+ };
725
+ };
726
+ };
727
+ };
728
+ context: {
729
+ type: string;
730
+ };
731
+ };
732
+ } | {
733
+ type: string;
734
+ items: {
735
+ type: string;
736
+ additionalProperties: {
737
+ type: string;
738
+ };
739
+ required: string[];
740
+ properties: {
741
+ name: {
742
+ type: string;
743
+ };
744
+ type: {
745
+ type: string;
746
+ };
747
+ counters: {
748
+ type: string;
749
+ additionalProperties: boolean;
750
+ required: never[];
751
+ properties: {
752
+ include: {
753
+ type: string;
754
+ items: {
755
+ type: string;
756
+ };
757
+ };
758
+ exclude: {
759
+ type: string;
760
+ items: {
761
+ type: string;
762
+ };
763
+ };
764
+ };
765
+ };
766
+ context: {
767
+ type: string;
768
+ };
769
+ };
770
+ };
771
+ })[];
772
+ };
617
773
  };
618
774
  };
619
775
  description: {
@@ -149,6 +149,84 @@ export declare const PromoFeaturesItem: {
149
149
  fullscreen: {
150
150
  type: string;
151
151
  };
152
+ analyticsEvents: {
153
+ anyOf: ({
154
+ type: string;
155
+ additionalProperties: {
156
+ type: string;
157
+ };
158
+ required: string[];
159
+ properties: {
160
+ name: {
161
+ type: string;
162
+ };
163
+ type: {
164
+ type: string;
165
+ };
166
+ counters: {
167
+ type: string;
168
+ additionalProperties: boolean;
169
+ required: never[];
170
+ properties: {
171
+ include: {
172
+ type: string;
173
+ items: {
174
+ type: string;
175
+ };
176
+ };
177
+ exclude: {
178
+ type: string;
179
+ items: {
180
+ type: string;
181
+ };
182
+ };
183
+ };
184
+ };
185
+ context: {
186
+ type: string;
187
+ };
188
+ };
189
+ } | {
190
+ type: string;
191
+ items: {
192
+ type: string;
193
+ additionalProperties: {
194
+ type: string;
195
+ };
196
+ required: string[];
197
+ properties: {
198
+ name: {
199
+ type: string;
200
+ };
201
+ type: {
202
+ type: string;
203
+ };
204
+ counters: {
205
+ type: string;
206
+ additionalProperties: boolean;
207
+ required: never[];
208
+ properties: {
209
+ include: {
210
+ type: string;
211
+ items: {
212
+ type: string;
213
+ };
214
+ };
215
+ exclude: {
216
+ type: string;
217
+ items: {
218
+ type: string;
219
+ };
220
+ };
221
+ };
222
+ };
223
+ context: {
224
+ type: string;
225
+ };
226
+ };
227
+ };
228
+ })[];
229
+ };
152
230
  };
153
231
  };
154
232
  };
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
1
+ import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import _ from 'lodash';
3
3
  import SlickSlider from 'react-slick';
4
4
  import Anchor from '../../components/Anchor/Anchor';
@@ -25,7 +25,7 @@ export const SliderBlock = (props) => {
25
25
  const { isServer } = useContext(SSRContext);
26
26
  const isMobile = useContext(MobileContext);
27
27
  const [breakpoint, setBreakpoint] = useState(BREAKPOINTS.xl);
28
- const [disclosedChildren] = useState(() => discloseAllNestedChildren(children));
28
+ const disclosedChildren = useMemo(() => discloseAllNestedChildren(children), [children]);
29
29
  const childrenCount = disclosedChildren.length;
30
30
  const [slidesToShow] = useState(getSlidesToShowWithDefaults({
31
31
  contentLength: childrenCount,