@gravity-ui/page-constructor 1.9.0 → 1.9.1-alpha.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 (132) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/cjs/blocks/Banner/schema.d.ts +12 -0
  3. package/build/cjs/blocks/Banner/schema.js +2 -0
  4. package/build/cjs/blocks/CardLayout/schema.d.ts +8 -0
  5. package/build/cjs/blocks/CardLayout/schema.js +2 -1
  6. package/build/cjs/blocks/Companies/schema.d.ts +2 -0
  7. package/build/cjs/blocks/Companies/schema.js +2 -0
  8. package/build/cjs/blocks/ContentLayout/schema.d.ts +6 -0
  9. package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +7 -0
  10. package/build/cjs/blocks/ExtendedFeatures/schema.js +4 -1
  11. package/build/cjs/blocks/Header/schema.d.ts +16 -0
  12. package/build/cjs/blocks/Header/schema.js +5 -0
  13. package/build/cjs/blocks/HeaderSlider/schema.d.ts +11 -0
  14. package/build/cjs/blocks/Icons/schema.d.ts +6 -0
  15. package/build/cjs/blocks/Icons/schema.js +2 -0
  16. package/build/cjs/blocks/Info/schema.d.ts +10 -0
  17. package/build/cjs/blocks/Info/schema.js +2 -0
  18. package/build/cjs/blocks/LinkTable/schema.d.ts +2 -0
  19. package/build/cjs/blocks/Media/schema.d.ts +9 -0
  20. package/build/cjs/blocks/Media/schema.js +3 -1
  21. package/build/cjs/blocks/Preview/schema.d.ts +2 -0
  22. package/build/cjs/blocks/Preview/schema.js +4 -0
  23. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +7 -0
  24. package/build/cjs/blocks/PromoFeaturesBlock/schema.js +4 -1
  25. package/build/cjs/blocks/Questions/schema.d.ts +5 -0
  26. package/build/cjs/blocks/Questions/schema.js +2 -0
  27. package/build/cjs/blocks/Security/schema.d.ts +2 -0
  28. package/build/cjs/blocks/Security/schema.js +2 -0
  29. package/build/cjs/blocks/Simple/schema.d.ts +3 -0
  30. package/build/cjs/blocks/Simple/schema.js +1 -0
  31. package/build/cjs/blocks/Slider/schema.d.ts +7 -0
  32. package/build/cjs/blocks/Slider/schema.js +2 -0
  33. package/build/cjs/blocks/Table/schema.d.ts +4 -0
  34. package/build/cjs/blocks/Table/schema.js +3 -0
  35. package/build/cjs/blocks/Tabs/Tabs.js +6 -1
  36. package/build/cjs/blocks/Tabs/schema.d.ts +10 -0
  37. package/build/cjs/blocks/Tabs/schema.js +2 -0
  38. package/build/cjs/components/Author/schema.d.ts +3 -0
  39. package/build/cjs/components/Image/schema.d.ts +2 -0
  40. package/build/cjs/components/Image/schema.js +2 -0
  41. package/build/cjs/components/Media/Media.js +1 -1
  42. package/build/cjs/components/Media/Video/Video.js +4 -3
  43. package/build/cjs/components/ReactPlayer/ReactPlayer.d.ts +1 -0
  44. package/build/cjs/components/ReactPlayer/ReactPlayer.js +5 -5
  45. package/build/cjs/components/VideoBlock/VideoBlock.d.ts +2 -0
  46. package/build/cjs/components/VideoBlock/VideoBlock.js +7 -6
  47. package/build/cjs/schema/index.d.ts +2 -0
  48. package/build/cjs/schema/validators/common.d.ts +17 -0
  49. package/build/cjs/schema/validators/common.js +11 -0
  50. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +5 -0
  51. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +4 -0
  52. package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +8 -0
  53. package/build/cjs/sub-blocks/CardWithImage/schema.js +4 -1
  54. package/build/cjs/sub-blocks/Content/schema.d.ts +8 -0
  55. package/build/cjs/sub-blocks/Content/schema.js +3 -1
  56. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +1 -0
  57. package/build/cjs/sub-blocks/NewsCard/schema.d.ts +1 -0
  58. package/build/cjs/sub-blocks/NewsCard/schema.js +1 -0
  59. package/build/cjs/sub-blocks/Partner/schema.d.ts +1 -0
  60. package/build/cjs/sub-blocks/Partner/schema.js +1 -0
  61. package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +1 -0
  62. package/build/cjs/sub-blocks/PriceDetailed/schema.js +8 -0
  63. package/build/cjs/sub-blocks/Quote/schema.d.ts +4 -0
  64. package/build/cjs/sub-blocks/Quote/schema.js +1 -0
  65. package/build/cjs/sub-blocks/TutorialCard/schema.d.ts +2 -0
  66. package/build/cjs/sub-blocks/TutorialCard/schema.js +2 -0
  67. package/build/esm/blocks/Banner/schema.d.ts +12 -0
  68. package/build/esm/blocks/Banner/schema.js +2 -0
  69. package/build/esm/blocks/CardLayout/schema.d.ts +8 -0
  70. package/build/esm/blocks/CardLayout/schema.js +2 -1
  71. package/build/esm/blocks/Companies/schema.d.ts +2 -0
  72. package/build/esm/blocks/Companies/schema.js +2 -0
  73. package/build/esm/blocks/ContentLayout/schema.d.ts +6 -0
  74. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +7 -0
  75. package/build/esm/blocks/ExtendedFeatures/schema.js +4 -1
  76. package/build/esm/blocks/Header/schema.d.ts +16 -0
  77. package/build/esm/blocks/Header/schema.js +5 -0
  78. package/build/esm/blocks/HeaderSlider/schema.d.ts +11 -0
  79. package/build/esm/blocks/Icons/schema.d.ts +6 -0
  80. package/build/esm/blocks/Icons/schema.js +2 -0
  81. package/build/esm/blocks/Info/schema.d.ts +10 -0
  82. package/build/esm/blocks/Info/schema.js +2 -0
  83. package/build/esm/blocks/LinkTable/schema.d.ts +2 -0
  84. package/build/esm/blocks/Media/schema.d.ts +9 -0
  85. package/build/esm/blocks/Media/schema.js +3 -1
  86. package/build/esm/blocks/Preview/schema.d.ts +2 -0
  87. package/build/esm/blocks/Preview/schema.js +4 -0
  88. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +7 -0
  89. package/build/esm/blocks/PromoFeaturesBlock/schema.js +4 -1
  90. package/build/esm/blocks/Questions/schema.d.ts +5 -0
  91. package/build/esm/blocks/Questions/schema.js +2 -0
  92. package/build/esm/blocks/Security/schema.d.ts +2 -0
  93. package/build/esm/blocks/Security/schema.js +2 -0
  94. package/build/esm/blocks/Simple/schema.d.ts +3 -0
  95. package/build/esm/blocks/Simple/schema.js +1 -0
  96. package/build/esm/blocks/Slider/schema.d.ts +7 -0
  97. package/build/esm/blocks/Slider/schema.js +2 -0
  98. package/build/esm/blocks/Table/schema.d.ts +4 -0
  99. package/build/esm/blocks/Table/schema.js +3 -0
  100. package/build/esm/blocks/Tabs/Tabs.js +7 -2
  101. package/build/esm/blocks/Tabs/schema.d.ts +10 -0
  102. package/build/esm/blocks/Tabs/schema.js +2 -0
  103. package/build/esm/components/Author/schema.d.ts +3 -0
  104. package/build/esm/components/Image/schema.d.ts +2 -0
  105. package/build/esm/components/Image/schema.js +2 -0
  106. package/build/esm/components/Media/Media.js +1 -1
  107. package/build/esm/components/Media/Video/Video.js +4 -3
  108. package/build/esm/components/ReactPlayer/ReactPlayer.d.ts +1 -0
  109. package/build/esm/components/ReactPlayer/ReactPlayer.js +5 -5
  110. package/build/esm/components/VideoBlock/VideoBlock.d.ts +2 -0
  111. package/build/esm/components/VideoBlock/VideoBlock.js +6 -6
  112. package/build/esm/schema/index.d.ts +2 -0
  113. package/build/esm/schema/validators/common.d.ts +17 -0
  114. package/build/esm/schema/validators/common.js +11 -0
  115. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +5 -0
  116. package/build/esm/sub-blocks/BasicCard/schema.d.ts +4 -0
  117. package/build/esm/sub-blocks/CardWithImage/schema.d.ts +8 -0
  118. package/build/esm/sub-blocks/CardWithImage/schema.js +4 -1
  119. package/build/esm/sub-blocks/Content/schema.d.ts +8 -0
  120. package/build/esm/sub-blocks/Content/schema.js +3 -1
  121. package/build/esm/sub-blocks/MediaCard/schema.d.ts +1 -0
  122. package/build/esm/sub-blocks/NewsCard/schema.d.ts +1 -0
  123. package/build/esm/sub-blocks/NewsCard/schema.js +1 -0
  124. package/build/esm/sub-blocks/Partner/schema.d.ts +1 -0
  125. package/build/esm/sub-blocks/Partner/schema.js +1 -0
  126. package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +1 -0
  127. package/build/esm/sub-blocks/PriceDetailed/schema.js +8 -0
  128. package/build/esm/sub-blocks/Quote/schema.d.ts +4 -0
  129. package/build/esm/sub-blocks/Quote/schema.js +1 -0
  130. package/build/esm/sub-blocks/TutorialCard/schema.d.ts +2 -0
  131. package/build/esm/sub-blocks/TutorialCard/schema.js +2 -0
  132. package/package.json +4 -1
@@ -12,10 +12,12 @@ export const InfoBlock = {
12
12
  required: ['title', 'sectionsTitle'],
13
13
  properties: Object.assign(Object.assign({}, BaseProps), { title: {
14
14
  type: 'string',
15
+ content: 'text',
15
16
  }, backgroundColor: withTheme({
16
17
  type: 'string',
17
18
  }), sectionsTitle: {
18
19
  type: 'string',
20
+ content: 'text',
19
21
  }, buttons: filteredArray(ButtonBlock), theme: ThemeProps, links: filteredArray(LinkProps), leftContent: ContentProps, rightContent: ContentProps }),
20
22
  },
21
23
  };
@@ -10,6 +10,7 @@ export declare const LinkTableBlock: {
10
10
  properties: {
11
11
  text: {
12
12
  type: string;
13
+ content: string;
13
14
  };
14
15
  textSize: {
15
16
  type: string;
@@ -44,6 +45,7 @@ export declare const LinkTableBlock: {
44
45
  properties: {
45
46
  text: {
46
47
  type: string;
48
+ content: string;
47
49
  };
48
50
  url: {
49
51
  type: string;
@@ -91,6 +91,7 @@ export declare const Media: {
91
91
  };
92
92
  text: {
93
93
  type: string;
94
+ content: string;
94
95
  };
95
96
  };
96
97
  };
@@ -145,6 +146,7 @@ export declare const MediaBlock: {
145
146
  properties: {
146
147
  text: {
147
148
  type: string;
149
+ content: string;
148
150
  };
149
151
  textSize: {
150
152
  type: string;
@@ -159,13 +161,16 @@ export declare const MediaBlock: {
159
161
  };
160
162
  } | {
161
163
  type: string;
164
+ content: string;
162
165
  })[];
163
166
  };
164
167
  additionalInfo: {
165
168
  type: string;
169
+ content: string;
166
170
  };
167
171
  description: {
168
172
  type: string;
173
+ content: string;
169
174
  };
170
175
  size: {
171
176
  type: string;
@@ -303,6 +308,7 @@ export declare const MediaBlock: {
303
308
  };
304
309
  text: {
305
310
  type: string;
311
+ content: string;
306
312
  };
307
313
  };
308
314
  };
@@ -350,6 +356,7 @@ export declare const MediaBlock: {
350
356
  properties: {
351
357
  text: {
352
358
  type: string;
359
+ content: string;
353
360
  };
354
361
  url: {
355
362
  type: string;
@@ -385,6 +392,7 @@ export declare const MediaBlock: {
385
392
  };
386
393
  alt: {
387
394
  type: string;
395
+ content: string;
388
396
  };
389
397
  };
390
398
  })[];
@@ -503,6 +511,7 @@ export declare const MediaBlock: {
503
511
  properties: {
504
512
  text: {
505
513
  type: string;
514
+ content: string;
506
515
  };
507
516
  url: {
508
517
  type: string;
@@ -11,11 +11,13 @@ export const MediaBlock = {
11
11
  additionalProperties: false,
12
12
  required: ['title', 'media'],
13
13
  properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), { title: {
14
- oneOf: [{ type: 'string' }, TitleProps],
14
+ oneOf: [{ type: 'string', content: 'text' }, TitleProps],
15
15
  }, additionalInfo: {
16
16
  type: 'string',
17
+ content: 'yfm',
17
18
  }, description: {
18
19
  type: 'string',
20
+ content: 'yfm',
19
21
  }, size: {
20
22
  type: 'string',
21
23
  enum: contentSizes,
@@ -5,9 +5,11 @@ export declare const PreviewBlock: {
5
5
  properties: {
6
6
  title: {
7
7
  type: string;
8
+ content: string;
8
9
  };
9
10
  description: {
10
11
  type: string;
12
+ content: string;
11
13
  };
12
14
  direction: {
13
15
  type: string;
@@ -8,9 +8,11 @@ const PreviewContentItem = {
8
8
  properties: {
9
9
  title: {
10
10
  type: 'string',
11
+ content: 'text',
11
12
  },
12
13
  description: {
13
14
  type: 'string',
15
+ content: 'yfm',
14
16
  },
15
17
  },
16
18
  };
@@ -33,8 +35,10 @@ export const PreviewBlock = {
33
35
  required: ['title', 'items'],
34
36
  properties: Object.assign(Object.assign(Object.assign({}, BaseProps), AnimatableProps), { title: {
35
37
  type: 'string',
38
+ content: 'text',
36
39
  }, description: {
37
40
  type: 'string',
41
+ content: 'text',
38
42
  }, direction: {
39
43
  type: 'string',
40
44
  enum: mediaDirection,
@@ -4,9 +4,11 @@ export declare const PromoFeaturesItem: {
4
4
  properties: {
5
5
  title: {
6
6
  type: string;
7
+ content: string;
7
8
  };
8
9
  text: {
9
10
  type: string;
11
+ content: string;
10
12
  };
11
13
  theme: {
12
14
  enum: string[];
@@ -104,6 +106,7 @@ export declare const PromoFeaturesItem: {
104
106
  };
105
107
  text: {
106
108
  type: string;
109
+ content: string;
107
110
  };
108
111
  };
109
112
  };
@@ -160,6 +163,7 @@ export declare const PromoFeaturesBlock: {
160
163
  properties: {
161
164
  text: {
162
165
  type: string;
166
+ content: string;
163
167
  };
164
168
  textSize: {
165
169
  type: string;
@@ -174,10 +178,12 @@ export declare const PromoFeaturesBlock: {
174
178
  };
175
179
  } | {
176
180
  type: string;
181
+ content: string;
177
182
  })[];
178
183
  };
179
184
  description: {
180
185
  type: string;
186
+ content: string;
181
187
  };
182
188
  theme: {
183
189
  enum: string[];
@@ -203,6 +209,7 @@ export declare const PromoFeaturesBlock: {
203
209
  properties: {
204
210
  text: {
205
211
  type: string;
212
+ content: string;
206
213
  };
207
214
  url: {
208
215
  type: string;
@@ -7,9 +7,11 @@ export const PromoFeaturesItem = {
7
7
  properties: {
8
8
  title: {
9
9
  type: 'string',
10
+ content: 'text',
10
11
  },
11
12
  text: {
12
13
  type: 'string',
14
+ content: 'yfm',
13
15
  },
14
16
  theme: {
15
17
  enum: ['accent', 'accent-light', 'primary'],
@@ -22,9 +24,10 @@ export const PromoFeaturesBlock = {
22
24
  additionalProperties: false,
23
25
  required: ['items'],
24
26
  properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), { title: {
25
- oneOf: [{ type: 'string' }, TitleProps],
27
+ oneOf: [{ type: 'string', content: 'text' }, TitleProps],
26
28
  }, description: {
27
29
  type: 'string',
30
+ content: 'text',
28
31
  }, theme: {
29
32
  enum: ['grey', 'default'],
30
33
  }, items: filteredArray(PromoFeaturesItem) }),
@@ -22,6 +22,7 @@ export declare const QuestionsBlock: {
22
22
  properties: {
23
23
  text: {
24
24
  type: string;
25
+ content: string;
25
26
  };
26
27
  textSize: {
27
28
  type: string;
@@ -36,13 +37,16 @@ export declare const QuestionsBlock: {
36
37
  };
37
38
  } | {
38
39
  type: string;
40
+ content: string;
39
41
  })[];
40
42
  };
41
43
  text: {
42
44
  type: string;
45
+ content: string;
43
46
  };
44
47
  additionalInfo: {
45
48
  type: string;
49
+ content: string;
46
50
  };
47
51
  links: {
48
52
  type: string;
@@ -73,6 +77,7 @@ export declare const QuestionsBlock: {
73
77
  properties: {
74
78
  text: {
75
79
  type: string;
80
+ content: string;
76
81
  };
77
82
  url: {
78
83
  type: string;
@@ -13,9 +13,11 @@ export const QuestionsBlock = {
13
13
  properties: {
14
14
  title: {
15
15
  type: 'string',
16
+ content: 'yfm',
16
17
  },
17
18
  text: {
18
19
  type: 'string',
20
+ content: 'yfm',
19
21
  },
20
22
  link: LinkProps,
21
23
  listStyle: {
@@ -12,6 +12,7 @@ export declare const SecurityBlock: {
12
12
  };
13
13
  title: {
14
14
  type: string;
15
+ content: string;
15
16
  };
16
17
  media: {
17
18
  type: string;
@@ -106,6 +107,7 @@ export declare const SecurityBlock: {
106
107
  };
107
108
  text: {
108
109
  type: string;
110
+ content: string;
109
111
  };
110
112
  };
111
113
  };
@@ -10,6 +10,7 @@ export const SecurityBlock = {
10
10
  type: 'string',
11
11
  }, title: {
12
12
  type: 'string',
13
+ content: 'text',
13
14
  }, media: Media, points: filteredArray({
14
15
  type: 'object',
15
16
  properties: {
@@ -18,6 +19,7 @@ export const SecurityBlock = {
18
19
  },
19
20
  text: {
20
21
  type: 'string',
22
+ content: 'text',
21
23
  },
22
24
  link: _.pick(LinkProps, ['text', 'url']),
23
25
  },
@@ -19,6 +19,7 @@ export declare const SimpleBlock: {
19
19
  properties: {
20
20
  text: {
21
21
  type: string;
22
+ content: string;
22
23
  };
23
24
  url: {
24
25
  type: string;
@@ -41,6 +42,7 @@ export declare const SimpleBlock: {
41
42
  properties: {
42
43
  text: {
43
44
  type: string;
45
+ content: string;
44
46
  };
45
47
  textSize: {
46
48
  type: string;
@@ -56,6 +58,7 @@ export declare const SimpleBlock: {
56
58
  };
57
59
  description: {
58
60
  type: string;
61
+ content: string;
59
62
  };
60
63
  };
61
64
  };
@@ -5,6 +5,7 @@ export const SimpleBlock = {
5
5
  required: ['title', 'description'],
6
6
  properties: Object.assign(Object.assign(Object.assign({ title: TitleProps, description: {
7
7
  type: 'string',
8
+ content: 'yfm',
8
9
  } }, BlockBaseProps), AnimatableProps), { children: ChildrenProps }),
9
10
  },
10
11
  };
@@ -7,6 +7,7 @@ export declare const SliderProps: {
7
7
  };
8
8
  description: {
9
9
  type: string;
10
+ content: string;
10
11
  };
11
12
  title: {
12
13
  type: string;
@@ -15,6 +16,7 @@ export declare const SliderProps: {
15
16
  properties: {
16
17
  text: {
17
18
  type: string;
19
+ content: string;
18
20
  };
19
21
  textSize: {
20
22
  type: string;
@@ -56,6 +58,7 @@ export declare const SliderProps: {
56
58
  properties: {
57
59
  text: {
58
60
  type: string;
61
+ content: string;
59
62
  };
60
63
  size: {
61
64
  type: string;
@@ -113,6 +116,7 @@ export declare const SliderBlock: {
113
116
  };
114
117
  description: {
115
118
  type: string;
119
+ content: string;
116
120
  };
117
121
  title: {
118
122
  type: string;
@@ -121,6 +125,7 @@ export declare const SliderBlock: {
121
125
  properties: {
122
126
  text: {
123
127
  type: string;
128
+ content: string;
124
129
  };
125
130
  textSize: {
126
131
  type: string;
@@ -162,6 +167,7 @@ export declare const SliderBlock: {
162
167
  properties: {
163
168
  text: {
164
169
  type: string;
170
+ content: string;
165
171
  };
166
172
  size: {
167
173
  type: string;
@@ -212,6 +218,7 @@ export declare const SliderBlock: {
212
218
  properties: {
213
219
  text: {
214
220
  type: string;
221
+ content: string;
215
222
  };
216
223
  url: {
217
224
  type: string;
@@ -33,6 +33,7 @@ const DisclaimerProps = {
33
33
  properties: {
34
34
  text: {
35
35
  type: 'string',
36
+ content: 'text',
36
37
  },
37
38
  size: {
38
39
  type: 'string',
@@ -49,6 +50,7 @@ export const SliderProps = {
49
50
  },
50
51
  description: {
51
52
  type: 'string',
53
+ content: 'text',
52
54
  },
53
55
  title: TitleProps,
54
56
  randomOrder: {
@@ -5,6 +5,7 @@ export declare const TableBlock: {
5
5
  properties: {
6
6
  title: {
7
7
  type: string;
8
+ content: string;
8
9
  };
9
10
  table: {
10
11
  additionalProperties: boolean;
@@ -16,6 +17,7 @@ export declare const TableBlock: {
16
17
  type: string;
17
18
  items: {
18
19
  type: string[];
20
+ content: string;
19
21
  };
20
22
  };
21
23
  };
@@ -23,6 +25,7 @@ export declare const TableBlock: {
23
25
  type: string;
24
26
  items: {
25
27
  type: string;
28
+ content: string;
26
29
  };
27
30
  };
28
31
  justify: {
@@ -47,6 +50,7 @@ export declare const TableBlock: {
47
50
  properties: {
48
51
  text: {
49
52
  type: string;
53
+ content: string;
50
54
  };
51
55
  url: {
52
56
  type: string;
@@ -5,6 +5,7 @@ export const TableBlock = {
5
5
  required: ['title', 'table'],
6
6
  properties: Object.assign(Object.assign({}, BlockBaseProps), { title: {
7
7
  type: 'string',
8
+ content: 'text',
8
9
  }, table: {
9
10
  additionalProperties: false,
10
11
  required: ['content'],
@@ -14,12 +15,14 @@ export const TableBlock = {
14
15
  type: 'array',
15
16
  items: {
16
17
  type: ['string', 'number'],
18
+ content: 'text',
17
19
  },
18
20
  },
19
21
  }, legend: {
20
22
  type: 'array',
21
23
  items: {
22
24
  type: 'string',
25
+ content: 'yfm',
23
26
  },
24
27
  }, justify: {
25
28
  type: 'array',
@@ -1,4 +1,4 @@
1
- import React, { Fragment, useContext, useState } from 'react';
1
+ import React, { Fragment, useContext, useRef, useState } from 'react';
2
2
  import { block, getThemedValue } from '../../utils';
3
3
  import { Row, Col, GridColumnOrderClasses } from '../../grid';
4
4
  import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
@@ -9,15 +9,20 @@ import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
9
9
  import { getMediaImage } from '../../components/Media/Image/utils';
10
10
  import ButtonTabs from '../../components/ButtonTabs/ButtonTabs';
11
11
  import { Content } from '../../sub-blocks';
12
+ import { getHeight } from '../../components/VideoBlock/VideoBlock';
12
13
  import './Tabs.css';
13
14
  const b = block('tabs-block');
14
15
  export const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', }) => {
16
+ var _a;
15
17
  const [activeTab, setActiveTab] = useState(items[0].tabName);
16
18
  const [play, setPlay] = useState(false);
17
19
  const { themeValue: theme } = useContext(ThemeValueContext);
18
20
  const tabs = items.map(({ tabName }) => ({ title: tabName, id: tabName }));
19
21
  const activeTabData = items.find(({ tabName }) => tabName === activeTab);
20
22
  const isReverse = direction === 'content-media';
23
+ const ref = useRef(null);
24
+ const mediaWidth = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
25
+ const mediaHeight = mediaWidth && getHeight(mediaWidth);
21
26
  let imageProps;
22
27
  if (activeTabData) {
23
28
  const themedImage = getThemedValue(activeTabData.image, theme);
@@ -37,7 +42,7 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
37
42
  all: GridColumnOrderClasses.Last,
38
43
  md: GridColumnOrderClasses.First,
39
44
  }, className: b('col', { centered: centered }) },
40
- (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play }))),
45
+ React.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight })))),
41
46
  imageProps && (React.createElement(Fragment, null,
42
47
  React.createElement(FullScreenImage, Object.assign({}, imageProps, { imageClassName: b('image') })),
43
48
  (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (React.createElement("p", { className: b('caption') }, activeTabData.caption))))));
@@ -8,6 +8,7 @@ export declare const tabsItem: {
8
8
  };
9
9
  caption: {
10
10
  type: string;
11
+ content: string;
11
12
  };
12
13
  media: {
13
14
  oneOf: ({
@@ -101,6 +102,7 @@ export declare const tabsItem: {
101
102
  };
102
103
  text: {
103
104
  type: string;
105
+ content: string;
104
106
  };
105
107
  };
106
108
  };
@@ -155,6 +157,7 @@ export declare const tabsItem: {
155
157
  properties: {
156
158
  text: {
157
159
  type: string;
160
+ content: string;
158
161
  };
159
162
  url: {
160
163
  type: string;
@@ -206,6 +209,7 @@ export declare const tabsItem: {
206
209
  properties: {
207
210
  text: {
208
211
  type: string;
212
+ content: string;
209
213
  };
210
214
  textSize: {
211
215
  type: string;
@@ -220,13 +224,16 @@ export declare const tabsItem: {
220
224
  };
221
225
  } | {
222
226
  type: string;
227
+ content: string;
223
228
  })[];
224
229
  } | undefined;
225
230
  text?: {
226
231
  type: string;
232
+ content: string;
227
233
  } | undefined;
228
234
  additionalInfo?: {
229
235
  type: string;
236
+ content: string;
230
237
  } | undefined;
231
238
  size?: {
232
239
  type: string;
@@ -272,6 +279,7 @@ export declare const TabsBlock: {
272
279
  properties: {
273
280
  text: {
274
281
  type: string;
282
+ content: string;
275
283
  };
276
284
  textSize: {
277
285
  type: string;
@@ -287,6 +295,7 @@ export declare const TabsBlock: {
287
295
  };
288
296
  description: {
289
297
  type: string;
298
+ content: string;
290
299
  };
291
300
  tabsColSizes: {};
292
301
  direction: {
@@ -314,6 +323,7 @@ export declare const TabsBlock: {
314
323
  properties: {
315
324
  text: {
316
325
  type: string;
326
+ content: string;
317
327
  };
318
328
  url: {
319
329
  type: string;
@@ -12,6 +12,7 @@ export const tabsItem = {
12
12
  type: 'string',
13
13
  }, caption: {
14
14
  type: 'string',
15
+ content: 'text',
15
16
  }, media: withTheme({
16
17
  type: 'object',
17
18
  properties: MediaProps,
@@ -25,6 +26,7 @@ export const TabsBlock = {
25
26
  required: ['title', 'items'],
26
27
  properties: Object.assign(Object.assign({}, BlockBaseProps), { title: TitleProps, description: {
27
28
  type: 'string',
29
+ content: 'text',
28
30
  }, tabsColSizes: containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: sizeNumber })), {}), direction: {
29
31
  type: 'string',
30
32
  enum: mediaDirection,
@@ -10,9 +10,11 @@ export declare const author: {
10
10
  properties: {
11
11
  firstName: {
12
12
  type: string;
13
+ content: string;
13
14
  };
14
15
  secondName: {
15
16
  type: string;
17
+ content: string;
16
18
  };
17
19
  avatar: {
18
20
  type: string;
@@ -20,6 +22,7 @@ export declare const author: {
20
22
  };
21
23
  description: {
22
24
  type: string;
25
+ content: string;
23
26
  };
24
27
  };
25
28
  };
@@ -18,6 +18,7 @@ export declare const ImageDeviceProps: {
18
18
  };
19
19
  alt: {
20
20
  type: string;
21
+ content: string;
21
22
  };
22
23
  disableCompress: {
23
24
  type: string;
@@ -35,6 +36,7 @@ export declare const ImageObjectProps: {
35
36
  };
36
37
  alt: {
37
38
  type: string;
39
+ content: string;
38
40
  };
39
41
  disableCompress: {
40
42
  type: string;
@@ -16,6 +16,7 @@ export const ImageDeviceProps = {
16
16
  },
17
17
  alt: {
18
18
  type: 'string',
19
+ content: 'text',
19
20
  },
20
21
  disableCompress: {
21
22
  type: 'boolean',
@@ -33,6 +34,7 @@ export const ImageObjectProps = {
33
34
  },
34
35
  alt: {
35
36
  type: 'string',
37
+ content: 'text',
36
38
  },
37
39
  disableCompress: {
38
40
  type: 'boolean',
@@ -19,7 +19,7 @@ export const Media = (props) => {
19
19
  result.push(React.createElement(Video, { key: "video", video: video, videoClassName: videoClassName, height: height, metrika: metrika, playVideo: playVideo, previewImg: previewImg, playButton: playButton, customBarControlsClassName: customBarControlsClassName, hasVideoFallback: hasVideoFallback, setHasVideoFallback: setHasVideoFallback }));
20
20
  }
21
21
  if (youtube) {
22
- result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg }));
22
+ result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height }));
23
23
  }
24
24
  if (dataLens) {
25
25
  result = React.createElement(DataLens, { dataLens: dataLens });
@@ -29,15 +29,16 @@ const Video = (props) => {
29
29
  }, [playVideo, video, setHasVideoFallback]);
30
30
  const reactPlayerBlock = useMemo(() => {
31
31
  const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton } = video;
32
- return (React.createElement(ReactPlayerBlock, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika }));
32
+ return (React.createElement(ReactPlayerBlock, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, height: height }));
33
33
  }, [
34
34
  video,
35
- metrika,
35
+ height,
36
+ videoClassName,
36
37
  previewImg,
37
38
  playVideo,
38
- videoClassName,
39
39
  commonPlayButton,
40
40
  customBarControlsClassName,
41
+ metrika,
41
42
  ]);
42
43
  const defaultVideoBlock = useMemo(() => {
43
44
  return video.src.length && !hasVideoFallback ? (React.createElement("div", { className: b('wrap', videoClassName), style: { height } },