@gravity-ui/page-constructor 1.2.3-alpha.4 → 1.2.3-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.
@@ -151,31 +151,21 @@ export declare const HeaderSliderBlock: {
151
151
  };
152
152
  background: {
153
153
  oneOf: ({
154
- fullWidth: {
155
- type: string;
156
- };
157
- fullWidthMedia: {
158
- type: string;
159
- };
160
- color: {
161
- type: string;
162
- };
163
- image: {
164
- anyOf: ({
165
- oneOf: ({
166
- type: string;
167
- properties: {
168
- when: {
169
- type: string;
170
- };
171
- };
172
- } | {
173
- type: string;
174
- pattern: string;
175
- })[];
176
- } | {
154
+ type: string;
155
+ additionalProperties: boolean;
156
+ required: never[];
157
+ properties: {
158
+ fullWidth: {
177
159
  type: string;
178
- items: {
160
+ };
161
+ fullWidthMedia: {
162
+ type: string;
163
+ };
164
+ color: {
165
+ type: string;
166
+ };
167
+ image: {
168
+ anyOf: ({
179
169
  oneOf: ({
180
170
  type: string;
181
171
  properties: {
@@ -187,103 +177,118 @@ export declare const HeaderSliderBlock: {
187
177
  type: string;
188
178
  pattern: string;
189
179
  })[];
190
- };
191
- })[];
192
- };
193
- video: {
194
- type: string;
195
- additionalProperties: boolean;
196
- required: string[];
197
- properties: {
198
- src: {
180
+ } | {
199
181
  type: string;
200
182
  items: {
183
+ oneOf: ({
184
+ type: string;
185
+ properties: {
186
+ when: {
187
+ type: string;
188
+ };
189
+ };
190
+ } | {
191
+ type: string;
192
+ pattern: string;
193
+ })[];
194
+ };
195
+ })[];
196
+ };
197
+ video: {
198
+ type: string;
199
+ additionalProperties: boolean;
200
+ required: string[];
201
+ properties: {
202
+ src: {
203
+ type: string;
204
+ items: {
205
+ type: string;
206
+ };
207
+ };
208
+ loop: {
209
+ anyOf: ({
210
+ type: string;
211
+ additionalProperties: boolean;
212
+ required: string[];
213
+ properties: {
214
+ start: {
215
+ type: string;
216
+ };
217
+ end: {
218
+ type: string;
219
+ };
220
+ };
221
+ } | {
222
+ type: string;
223
+ })[];
224
+ };
225
+ type: {
201
226
  type: string;
227
+ enum: string[];
202
228
  };
203
- };
204
- loop: {
205
- anyOf: ({
229
+ muted: {
230
+ type: string;
231
+ };
232
+ playing: {
233
+ type: string;
234
+ };
235
+ elapsedTime: {
236
+ type: string;
237
+ };
238
+ playIcon: {
206
239
  type: string;
207
240
  additionalProperties: boolean;
208
- required: string[];
209
241
  properties: {
210
- start: {
242
+ type: {
243
+ type: string;
244
+ enum: string[];
245
+ };
246
+ theme: {
211
247
  type: string;
248
+ enum: string[];
212
249
  };
213
- end: {
250
+ text: {
214
251
  type: string;
215
252
  };
216
253
  };
217
- } | {
254
+ };
255
+ controls: {
218
256
  type: string;
219
- })[];
220
- };
221
- type: {
222
- type: string;
223
- enum: string[];
224
- };
225
- muted: {
226
- type: string;
227
- };
228
- playing: {
229
- type: string;
230
- };
231
- elapsedTime: {
232
- type: string;
257
+ enum: string[];
258
+ };
233
259
  };
234
- playIcon: {
260
+ };
261
+ youtube: {
262
+ type: string;
263
+ };
264
+ parallax: {
265
+ type: string;
266
+ };
267
+ height: {
268
+ type: string;
269
+ };
270
+ previewImg: {
271
+ type: string;
272
+ };
273
+ dataLens: {
274
+ oneOf: ({
235
275
  type: string;
236
276
  additionalProperties: boolean;
277
+ required: string[];
237
278
  properties: {
238
- type: {
279
+ id: {
239
280
  type: string;
240
- enum: string[];
241
281
  };
242
282
  theme: {
243
283
  type: string;
244
284
  enum: string[];
245
285
  };
246
- text: {
247
- type: string;
248
- };
249
286
  };
250
- };
251
- controls: {
287
+ } | {
252
288
  type: string;
253
- enum: string[];
254
- };
289
+ })[];
255
290
  };
256
291
  };
257
- youtube: {
258
- type: string;
259
- };
260
- parallax: {
261
- type: string;
262
- };
263
- height: {
264
- type: string;
265
- };
266
- previewImg: {
267
- type: string;
268
- };
269
- dataLens: {
270
- oneOf: ({
271
- type: string;
272
- additionalProperties: boolean;
273
- required: string[];
274
- properties: {
275
- id: {
276
- type: string;
277
- };
278
- theme: {
279
- type: string;
280
- enum: string[];
281
- };
282
- };
283
- } | {
284
- type: string;
285
- })[];
286
- };
287
292
  } | {
288
293
  type: string;
289
294
  additionalProperties: boolean;
@@ -13,8 +13,8 @@ const b = block('header-block');
13
13
  const Background = ({ background, isMobile }) => {
14
14
  const { url, image, fullWidthMedia, video, color } = background;
15
15
  const imageObject = url ? getMediaImage(url) : image;
16
- return (React.createElement("div", { className: b('background', { media: true, 'full-width-media': fullWidthMedia }) },
17
- React.createElement(Media, Object.assign({}, background, { className: b('background-media'), imageClassName: b('image'), videoClassName: b('video'), isBackground: true, color: color, parallax: false, video: isMobile ? undefined : video, image: imageObject }))));
16
+ const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);
17
+ return (React.createElement("div", { className: b('background', { media: true, 'full-width-media': fullWidthMedia }), style: { backgroundColor: color } }, renderMedia && (React.createElement(Media, Object.assign({}, background, { className: b('background-media'), imageClassName: b('image'), videoClassName: b('video'), isBackground: true, parallax: false, video: isMobile ? undefined : video, image: imageObject })))));
18
18
  };
19
19
  const FullWidthBackground = ({ background }) => (React.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
20
20
  export const HeaderBlock = (props) => {
@@ -31,7 +31,7 @@ export const HeaderBlock = (props) => {
31
31
  const backgroundThemed = background && getThemedValue(background, theme);
32
32
  const imageThemed = image && getThemedValue(image, theme);
33
33
  const videoThemed = video && getThemedValue(video, theme);
34
- const fullWidth = backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidth;
34
+ const fullWidth = (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidth) || (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidthMedia);
35
35
  return (React.createElement("header", { className: b({ ['has-media']: hasRightSideImage, ['full-width']: fullWidth }, className) },
36
36
  backgroundThemed && fullWidth && React.createElement(FullWidthBackground, { background: backgroundThemed }),
37
37
  backgroundThemed && React.createElement(Background, { background: backgroundThemed, isMobile: isMobile }),