@wordpress/block-library 9.11.0 → 9.12.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.
- package/CHANGELOG.md +2 -0
- package/build/button/index.js +1 -1
- package/build/button/index.js.map +1 -1
- package/build/cover/deprecated.js +140 -4
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +1 -1
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/cover-placeholder.js +1 -2
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +22 -22
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/save.js +13 -13
- package/build/cover/save.js.map +1 -1
- package/build/details/index.js +1 -0
- package/build/details/index.js.map +1 -1
- package/build/file/edit.js +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/image/edit.js +1 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +144 -78
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +1 -1
- package/build/latest-posts/edit.js +0 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/navigation/edit/index.js +2 -23
- package/build/navigation/edit/index.js.map +1 -1
- package/build/paragraph/edit.js +1 -1
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-content/index.js +13 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-template/edit.js +11 -0
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -1
- package/build/query/edit/inspector-controls/index.js +2 -2
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js +0 -3
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/edit/query-content.js +10 -12
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/index.js +1 -1
- package/build/query/utils.js +32 -1
- package/build/query/utils.js.map +1 -1
- package/build/template-part/edit/index.js +1 -4
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +0 -3
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +0 -2
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/button/index.js +1 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/cover/deprecated.js +140 -4
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +1 -1
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/cover-placeholder.js +1 -2
- package/build-module/cover/edit/cover-placeholder.js.map +1 -1
- package/build-module/cover/edit/index.js +22 -22
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/save.js +13 -13
- package/build-module/cover/save.js.map +1 -1
- package/build-module/details/index.js +1 -0
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/edit.js +1 -1
- package/build-module/file/edit.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/image/edit.js +1 -1
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +149 -83
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +1 -1
- package/build-module/latest-posts/edit.js +0 -1
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/navigation/edit/index.js +2 -23
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/paragraph/edit.js +1 -1
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-content/index.js +13 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-template/edit.js +11 -0
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -1
- package/build-module/query/edit/inspector-controls/index.js +2 -2
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js +0 -3
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/edit/query-content.js +10 -12
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/index.js +1 -1
- package/build-module/query/utils.js +29 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -4
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +0 -3
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +0 -2
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/cover/editor-rtl.css +3 -5
- package/build-style/cover/editor.css +3 -5
- package/build-style/cover/style-rtl.css +19 -15
- package/build-style/cover/style.css +19 -15
- package/build-style/editor-rtl.css +7 -22
- package/build-style/editor.css +7 -22
- package/build-style/group/editor-rtl.css +0 -10
- package/build-style/group/editor.css +0 -10
- package/build-style/image/editor-rtl.css +4 -0
- package/build-style/image/editor.css +4 -0
- package/build-style/image/style-rtl.css +0 -2
- package/build-style/image/style.css +0 -2
- package/build-style/latest-posts/editor-rtl.css +0 -7
- package/build-style/latest-posts/editor.css +0 -7
- package/build-style/media-text/style-rtl.css +1 -1
- package/build-style/media-text/style.css +1 -1
- package/build-style/style-rtl.css +20 -18
- package/build-style/style.css +20 -18
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/package.json +8 -8
- package/src/button/index.js +1 -1
- package/src/comments/block.json +3 -9
- package/src/cover/deprecated.js +182 -4
- package/src/cover/edit/block-controls.js +1 -1
- package/src/cover/edit/cover-placeholder.js +0 -3
- package/src/cover/edit/index.js +41 -26
- package/src/cover/editor.scss +4 -5
- package/src/cover/save.js +27 -20
- package/src/cover/style.scss +40 -16
- package/src/cover/test/__snapshots__/edit.native.js.snap +9 -9
- package/src/cover/test/__snapshots__/transforms.native.js.snap +4 -4
- package/src/cover/test/edit.native.js +4 -4
- package/src/cover/test/transforms.native.js +4 -4
- package/src/details/block.json +1 -0
- package/src/file/edit.js +1 -1
- package/src/gallery/edit.js +1 -1
- package/src/group/editor.scss +0 -12
- package/src/image/block.json +1 -1
- package/src/image/edit.js +1 -1
- package/src/image/editor.scss +4 -0
- package/src/image/image.js +200 -109
- package/src/image/style.scss +0 -1
- package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/latest-posts/edit.js +0 -1
- package/src/latest-posts/editor.scss +0 -11
- package/src/media-text/style.scss +1 -1
- package/src/media-text/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/navigation/edit/index.js +3 -30
- package/src/navigation/index.php +1 -1
- package/src/paragraph/edit.js +1 -1
- package/src/post-content/block.json +14 -1
- package/src/post-template/block.json +2 -1
- package/src/post-template/edit.js +19 -0
- package/src/query/block.json +1 -1
- package/src/query/edit/inspector-controls/index.js +2 -2
- package/src/query/edit/pattern-selection-modal.js +0 -3
- package/src/query/edit/query-content.js +9 -17
- package/src/query/test/utils.js +59 -1
- package/src/query/utils.js +29 -0
- package/src/search/index.php +2 -2
- package/src/template-part/edit/index.js +1 -4
- package/src/template-part/edit/selection-modal.js +0 -3
- package/src/video/edit.js +1 -1
- package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/video/tracks-editor.js +0 -2
- package/tsconfig.tsbuildinfo +1 -1
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
package/src/cover/deprecated.js
CHANGED
|
@@ -164,7 +164,7 @@ const v8ToV11BlockAttributes = {
|
|
|
164
164
|
},
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
-
const
|
|
167
|
+
const v12toV13BlockAttributes = {
|
|
168
168
|
...v8ToV11BlockAttributes,
|
|
169
169
|
useFeaturedImage: {
|
|
170
170
|
type: 'boolean',
|
|
@@ -176,6 +176,20 @@ const v12BlockAttributes = {
|
|
|
176
176
|
},
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
+
const v14BlockAttributes = {
|
|
180
|
+
...v12toV13BlockAttributes,
|
|
181
|
+
isUserOverlayColor: {
|
|
182
|
+
type: 'boolean',
|
|
183
|
+
},
|
|
184
|
+
sizeSlug: {
|
|
185
|
+
type: 'string',
|
|
186
|
+
},
|
|
187
|
+
alt: {
|
|
188
|
+
type: 'string',
|
|
189
|
+
default: '',
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
179
193
|
const v7toV11BlockSupports = {
|
|
180
194
|
anchor: true,
|
|
181
195
|
align: true,
|
|
@@ -244,9 +258,173 @@ const v12BlockSupports = {
|
|
|
244
258
|
},
|
|
245
259
|
};
|
|
246
260
|
|
|
261
|
+
const v14BlockSupports = {
|
|
262
|
+
...v12BlockSupports,
|
|
263
|
+
shadow: true,
|
|
264
|
+
dimensions: {
|
|
265
|
+
aspectRatio: true,
|
|
266
|
+
},
|
|
267
|
+
interactivity: {
|
|
268
|
+
clientNavigation: true,
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
// Deprecation for blocks that have z-index.
|
|
273
|
+
const v14 = {
|
|
274
|
+
attributes: v14BlockAttributes,
|
|
275
|
+
supports: v14BlockSupports,
|
|
276
|
+
save( { attributes } ) {
|
|
277
|
+
const {
|
|
278
|
+
backgroundType,
|
|
279
|
+
gradient,
|
|
280
|
+
contentPosition,
|
|
281
|
+
customGradient,
|
|
282
|
+
customOverlayColor,
|
|
283
|
+
dimRatio,
|
|
284
|
+
focalPoint,
|
|
285
|
+
useFeaturedImage,
|
|
286
|
+
hasParallax,
|
|
287
|
+
isDark,
|
|
288
|
+
isRepeated,
|
|
289
|
+
overlayColor,
|
|
290
|
+
url,
|
|
291
|
+
alt,
|
|
292
|
+
id,
|
|
293
|
+
minHeight: minHeightProp,
|
|
294
|
+
minHeightUnit,
|
|
295
|
+
tagName: Tag,
|
|
296
|
+
sizeSlug,
|
|
297
|
+
} = attributes;
|
|
298
|
+
const overlayColorClass = getColorClassName(
|
|
299
|
+
'background-color',
|
|
300
|
+
overlayColor
|
|
301
|
+
);
|
|
302
|
+
const gradientClass = __experimentalGetGradientClass( gradient );
|
|
303
|
+
const minHeight =
|
|
304
|
+
minHeightProp && minHeightUnit
|
|
305
|
+
? `${ minHeightProp }${ minHeightUnit }`
|
|
306
|
+
: minHeightProp;
|
|
307
|
+
|
|
308
|
+
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
309
|
+
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
310
|
+
|
|
311
|
+
const isImgElement = ! ( hasParallax || isRepeated );
|
|
312
|
+
|
|
313
|
+
const style = {
|
|
314
|
+
minHeight: minHeight || undefined,
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
const bgStyle = {
|
|
318
|
+
backgroundColor: ! overlayColorClass
|
|
319
|
+
? customOverlayColor
|
|
320
|
+
: undefined,
|
|
321
|
+
background: customGradient ? customGradient : undefined,
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
const objectPosition =
|
|
325
|
+
// prettier-ignore
|
|
326
|
+
focalPoint && isImgElement
|
|
327
|
+
? mediaPosition(focalPoint)
|
|
328
|
+
: undefined;
|
|
329
|
+
|
|
330
|
+
const backgroundImage = url ? `url(${ url })` : undefined;
|
|
331
|
+
|
|
332
|
+
const backgroundPosition = mediaPosition( focalPoint );
|
|
333
|
+
|
|
334
|
+
const classes = clsx(
|
|
335
|
+
{
|
|
336
|
+
'is-light': ! isDark,
|
|
337
|
+
'has-parallax': hasParallax,
|
|
338
|
+
'is-repeated': isRepeated,
|
|
339
|
+
'has-custom-content-position':
|
|
340
|
+
! isContentPositionCenter( contentPosition ),
|
|
341
|
+
},
|
|
342
|
+
getPositionClassName( contentPosition )
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
const imgClasses = clsx(
|
|
346
|
+
'wp-block-cover__image-background',
|
|
347
|
+
id ? `wp-image-${ id }` : null,
|
|
348
|
+
{
|
|
349
|
+
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
350
|
+
'has-parallax': hasParallax,
|
|
351
|
+
'is-repeated': isRepeated,
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
const gradientValue = gradient || customGradient;
|
|
356
|
+
|
|
357
|
+
return (
|
|
358
|
+
<Tag { ...useBlockProps.save( { className: classes, style } ) }>
|
|
359
|
+
<span
|
|
360
|
+
aria-hidden="true"
|
|
361
|
+
className={ clsx(
|
|
362
|
+
'wp-block-cover__background',
|
|
363
|
+
overlayColorClass,
|
|
364
|
+
dimRatioToClass( dimRatio ),
|
|
365
|
+
{
|
|
366
|
+
'has-background-dim': dimRatio !== undefined,
|
|
367
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
368
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
369
|
+
// media, a gradient and a dim.
|
|
370
|
+
'wp-block-cover__gradient-background':
|
|
371
|
+
url && gradientValue && dimRatio !== 0,
|
|
372
|
+
'has-background-gradient': gradientValue,
|
|
373
|
+
[ gradientClass ]: gradientClass,
|
|
374
|
+
}
|
|
375
|
+
) }
|
|
376
|
+
style={ bgStyle }
|
|
377
|
+
/>
|
|
378
|
+
|
|
379
|
+
{ ! useFeaturedImage &&
|
|
380
|
+
isImageBackground &&
|
|
381
|
+
url &&
|
|
382
|
+
( isImgElement ? (
|
|
383
|
+
<img
|
|
384
|
+
className={ imgClasses }
|
|
385
|
+
alt={ alt }
|
|
386
|
+
src={ url }
|
|
387
|
+
style={ { objectPosition } }
|
|
388
|
+
data-object-fit="cover"
|
|
389
|
+
data-object-position={ objectPosition }
|
|
390
|
+
/>
|
|
391
|
+
) : (
|
|
392
|
+
<div
|
|
393
|
+
role={ alt ? 'img' : undefined }
|
|
394
|
+
aria-label={ alt ? alt : undefined }
|
|
395
|
+
className={ imgClasses }
|
|
396
|
+
style={ { backgroundPosition, backgroundImage } }
|
|
397
|
+
/>
|
|
398
|
+
) ) }
|
|
399
|
+
{ isVideoBackground && url && (
|
|
400
|
+
<video
|
|
401
|
+
className={ clsx(
|
|
402
|
+
'wp-block-cover__video-background',
|
|
403
|
+
'intrinsic-ignore'
|
|
404
|
+
) }
|
|
405
|
+
autoPlay
|
|
406
|
+
muted
|
|
407
|
+
loop
|
|
408
|
+
playsInline
|
|
409
|
+
src={ url }
|
|
410
|
+
style={ { objectPosition } }
|
|
411
|
+
data-object-fit="cover"
|
|
412
|
+
data-object-position={ objectPosition }
|
|
413
|
+
/>
|
|
414
|
+
) }
|
|
415
|
+
<div
|
|
416
|
+
{ ...useInnerBlocksProps.save( {
|
|
417
|
+
className: 'wp-block-cover__inner-container',
|
|
418
|
+
} ) }
|
|
419
|
+
/>
|
|
420
|
+
</Tag>
|
|
421
|
+
);
|
|
422
|
+
},
|
|
423
|
+
};
|
|
424
|
+
|
|
247
425
|
// Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated.
|
|
248
426
|
const v13 = {
|
|
249
|
-
attributes:
|
|
427
|
+
attributes: v12toV13BlockAttributes,
|
|
250
428
|
supports: v12BlockSupports,
|
|
251
429
|
save( { attributes } ) {
|
|
252
430
|
const {
|
|
@@ -396,7 +574,7 @@ const v13 = {
|
|
|
396
574
|
|
|
397
575
|
// Deprecation for blocks to prevent auto overlay color from overriding previously set values.
|
|
398
576
|
const v12 = {
|
|
399
|
-
attributes:
|
|
577
|
+
attributes: v12toV13BlockAttributes,
|
|
400
578
|
supports: v12BlockSupports,
|
|
401
579
|
isEligible( attributes ) {
|
|
402
580
|
return (
|
|
@@ -1824,4 +2002,4 @@ const v1 = {
|
|
|
1824
2002
|
},
|
|
1825
2003
|
};
|
|
1826
2004
|
|
|
1827
|
-
export default [ v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1 ];
|
|
2005
|
+
export default [ v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1 ];
|
|
@@ -101,7 +101,7 @@ export default function CoverBlockControls( {
|
|
|
101
101
|
onSelect={ onSelectMedia }
|
|
102
102
|
onToggleFeaturedImage={ toggleUseFeaturedImage }
|
|
103
103
|
useFeaturedImage={ useFeaturedImage }
|
|
104
|
-
name={ ! url ? __( 'Add
|
|
104
|
+
name={ ! url ? __( 'Add media' ) : __( 'Replace' ) }
|
|
105
105
|
onReset={ onClearMedia }
|
|
106
106
|
/>
|
|
107
107
|
</BlockControls>
|
|
@@ -23,9 +23,6 @@ export default function CoverPlaceholder( {
|
|
|
23
23
|
icon={ <BlockIcon icon={ icon } /> }
|
|
24
24
|
labels={ {
|
|
25
25
|
title: __( 'Cover' ),
|
|
26
|
-
instructions: __(
|
|
27
|
-
'Drag and drop onto this block, upload, or select existing media from your library.'
|
|
28
|
-
),
|
|
29
26
|
} }
|
|
30
27
|
onSelect={ onSelectMedia }
|
|
31
28
|
accept="image/*,video/*"
|
package/src/cover/edit/index.js
CHANGED
|
@@ -206,12 +206,24 @@ function CoverEdit( {
|
|
|
206
206
|
|
|
207
207
|
// Try to use the previous selected image size if it's available
|
|
208
208
|
// otherwise try the default image size or fallback to full size.
|
|
209
|
-
if (
|
|
209
|
+
if (
|
|
210
|
+
sizeSlug &&
|
|
211
|
+
( newMedia?.sizes?.[ sizeSlug ] ||
|
|
212
|
+
newMedia?.media_details?.sizes?.[ sizeSlug ] )
|
|
213
|
+
) {
|
|
210
214
|
mediaAttributes.sizeSlug = sizeSlug;
|
|
211
|
-
mediaAttributes.url =
|
|
212
|
-
|
|
215
|
+
mediaAttributes.url =
|
|
216
|
+
newMedia?.sizes?.[ sizeSlug ]?.url ||
|
|
217
|
+
newMedia?.media_details?.sizes?.[ sizeSlug ]?.source_url;
|
|
218
|
+
} else if (
|
|
219
|
+
newMedia?.sizes?.[ imageDefaultSize ] ||
|
|
220
|
+
newMedia?.media_details?.sizes?.[ imageDefaultSize ]
|
|
221
|
+
) {
|
|
213
222
|
mediaAttributes.sizeSlug = imageDefaultSize;
|
|
214
|
-
mediaAttributes.url =
|
|
223
|
+
mediaAttributes.url =
|
|
224
|
+
newMedia?.sizes?.[ imageDefaultSize ]?.url ||
|
|
225
|
+
newMedia?.media_details?.sizes?.[ imageDefaultSize ]
|
|
226
|
+
?.source_url;
|
|
215
227
|
} else {
|
|
216
228
|
mediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG;
|
|
217
229
|
}
|
|
@@ -459,7 +471,7 @@ function CoverEdit( {
|
|
|
459
471
|
setAttributes( { minHeight: newMinHeight } );
|
|
460
472
|
},
|
|
461
473
|
// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.
|
|
462
|
-
showHandle: ! attributes.style?.dimensions?.aspectRatio
|
|
474
|
+
showHandle: ! attributes.style?.dimensions?.aspectRatio,
|
|
463
475
|
size: resizableBoxDimensions,
|
|
464
476
|
width,
|
|
465
477
|
};
|
|
@@ -527,27 +539,6 @@ function CoverEdit( {
|
|
|
527
539
|
data-url={ url }
|
|
528
540
|
>
|
|
529
541
|
{ resizeListener }
|
|
530
|
-
{ showOverlay && (
|
|
531
|
-
<span
|
|
532
|
-
aria-hidden="true"
|
|
533
|
-
className={ clsx(
|
|
534
|
-
'wp-block-cover__background',
|
|
535
|
-
dimRatioToClass( dimRatio ),
|
|
536
|
-
{
|
|
537
|
-
[ overlayColor.class ]: overlayColor.class,
|
|
538
|
-
'has-background-dim': dimRatio !== undefined,
|
|
539
|
-
// For backwards compatibility. Former versions of the Cover Block applied
|
|
540
|
-
// `.wp-block-cover__gradient-background` in the presence of
|
|
541
|
-
// media, a gradient and a dim.
|
|
542
|
-
'wp-block-cover__gradient-background':
|
|
543
|
-
url && gradientValue && dimRatio !== 0,
|
|
544
|
-
'has-background-gradient': gradientValue,
|
|
545
|
-
[ gradientClass ]: gradientClass,
|
|
546
|
-
}
|
|
547
|
-
) }
|
|
548
|
-
style={ { backgroundImage: gradientValue, ...bgStyle } }
|
|
549
|
-
/>
|
|
550
|
-
) }
|
|
551
542
|
|
|
552
543
|
{ ! url && useFeaturedImage && (
|
|
553
544
|
<Placeholder
|
|
@@ -589,7 +580,31 @@ function CoverEdit( {
|
|
|
589
580
|
style={ mediaStyle }
|
|
590
581
|
/>
|
|
591
582
|
) }
|
|
583
|
+
|
|
584
|
+
{ showOverlay && (
|
|
585
|
+
<span
|
|
586
|
+
aria-hidden="true"
|
|
587
|
+
className={ clsx(
|
|
588
|
+
'wp-block-cover__background',
|
|
589
|
+
dimRatioToClass( dimRatio ),
|
|
590
|
+
{
|
|
591
|
+
[ overlayColor.class ]: overlayColor.class,
|
|
592
|
+
'has-background-dim': dimRatio !== undefined,
|
|
593
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
594
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
595
|
+
// media, a gradient and a dim.
|
|
596
|
+
'wp-block-cover__gradient-background':
|
|
597
|
+
url && gradientValue && dimRatio !== 0,
|
|
598
|
+
'has-background-gradient': gradientValue,
|
|
599
|
+
[ gradientClass ]: gradientClass,
|
|
600
|
+
}
|
|
601
|
+
) }
|
|
602
|
+
style={ { backgroundImage: gradientValue, ...bgStyle } }
|
|
603
|
+
/>
|
|
604
|
+
) }
|
|
605
|
+
|
|
592
606
|
{ isUploadingMedia && <Spinner /> }
|
|
607
|
+
|
|
593
608
|
<CoverPlaceholder
|
|
594
609
|
disableMediaButtons
|
|
595
610
|
onSelectMedia={ onSelectMedia }
|
package/src/cover/editor.scss
CHANGED
|
@@ -37,12 +37,15 @@
|
|
|
37
37
|
width: 100%;
|
|
38
38
|
z-index: 1;
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
.wp-block-cover__inner-container {
|
|
42
|
+
z-index: 2;
|
|
43
|
+
}
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
// Shown while media is being uploaded
|
|
43
47
|
.components-spinner {
|
|
44
48
|
position: absolute;
|
|
45
|
-
z-index: z-index(".wp-block-cover__inner-container");
|
|
46
49
|
top: 50%;
|
|
47
50
|
left: 50%;
|
|
48
51
|
transform: translate(-50%, -50%); // Account for spinner dimensions
|
|
@@ -104,10 +107,6 @@
|
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
|
|
107
|
-
// When uploading background images, show a transparent overlay.
|
|
108
|
-
.wp-block-cover > .components-drop-zone .components-drop-zone__content {
|
|
109
|
-
opacity: 0.8 !important;
|
|
110
|
-
}
|
|
111
110
|
|
|
112
111
|
// Remove the parallax fixed background when in the patterns preview panel as it
|
|
113
112
|
// doesn't work with the transforms that are applied to resize the block in that context.
|
package/src/cover/save.js
CHANGED
|
@@ -106,26 +106,6 @@ export default function save( { attributes } ) {
|
|
|
106
106
|
|
|
107
107
|
return (
|
|
108
108
|
<Tag { ...useBlockProps.save( { className: classes, style } ) }>
|
|
109
|
-
<span
|
|
110
|
-
aria-hidden="true"
|
|
111
|
-
className={ clsx(
|
|
112
|
-
'wp-block-cover__background',
|
|
113
|
-
overlayColorClass,
|
|
114
|
-
dimRatioToClass( dimRatio ),
|
|
115
|
-
{
|
|
116
|
-
'has-background-dim': dimRatio !== undefined,
|
|
117
|
-
// For backwards compatibility. Former versions of the Cover Block applied
|
|
118
|
-
// `.wp-block-cover__gradient-background` in the presence of
|
|
119
|
-
// media, a gradient and a dim.
|
|
120
|
-
'wp-block-cover__gradient-background':
|
|
121
|
-
url && gradientValue && dimRatio !== 0,
|
|
122
|
-
'has-background-gradient': gradientValue,
|
|
123
|
-
[ gradientClass ]: gradientClass,
|
|
124
|
-
}
|
|
125
|
-
) }
|
|
126
|
-
style={ bgStyle }
|
|
127
|
-
/>
|
|
128
|
-
|
|
129
109
|
{ ! useFeaturedImage &&
|
|
130
110
|
isImageBackground &&
|
|
131
111
|
url &&
|
|
@@ -162,6 +142,33 @@ export default function save( { attributes } ) {
|
|
|
162
142
|
data-object-position={ objectPosition }
|
|
163
143
|
/>
|
|
164
144
|
) }
|
|
145
|
+
|
|
146
|
+
{ /* The `wp-block-cover__background` needs to be immediately before
|
|
147
|
+
the `wp-block-cover__inner-container`, so the exclusion CSS selector
|
|
148
|
+
`.wp-block-cover__background + .wp-block-cover__inner-container`
|
|
149
|
+
works properly. If it needs to be changed in the future, the
|
|
150
|
+
selector for the backward compatibility for v14 deprecation also
|
|
151
|
+
needs change. */ }
|
|
152
|
+
<span
|
|
153
|
+
aria-hidden="true"
|
|
154
|
+
className={ clsx(
|
|
155
|
+
'wp-block-cover__background',
|
|
156
|
+
overlayColorClass,
|
|
157
|
+
dimRatioToClass( dimRatio ),
|
|
158
|
+
{
|
|
159
|
+
'has-background-dim': dimRatio !== undefined,
|
|
160
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
161
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
162
|
+
// media, a gradient and a dim.
|
|
163
|
+
'wp-block-cover__gradient-background':
|
|
164
|
+
url && gradientValue && dimRatio !== 0,
|
|
165
|
+
'has-background-gradient': gradientValue,
|
|
166
|
+
[ gradientClass ]: gradientClass,
|
|
167
|
+
}
|
|
168
|
+
) }
|
|
169
|
+
style={ bgStyle }
|
|
170
|
+
/>
|
|
171
|
+
|
|
165
172
|
<div
|
|
166
173
|
{ ...useInnerBlocksProps.save( {
|
|
167
174
|
className: 'wp-block-cover__inner-container',
|
package/src/cover/style.scss
CHANGED
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
left: 0;
|
|
55
55
|
bottom: 0;
|
|
56
56
|
right: 0;
|
|
57
|
-
z-index: z-index(".wp-block-cover.has-background-dim::before");
|
|
58
57
|
opacity: 0.5;
|
|
59
58
|
}
|
|
60
59
|
|
|
@@ -95,17 +94,11 @@
|
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
.wp-block-cover__inner-container {
|
|
97
|
+
position: relative; // Needed for the inner container to be positioned above other elements with absolute positioning.
|
|
98
98
|
width: 100%;
|
|
99
|
-
z-index: z-index(".wp-block-cover__inner-container");
|
|
100
99
|
color: inherit;
|
|
101
100
|
// Reset the fixed LTR direction at the root of the block in RTL languages.
|
|
102
101
|
/*rtl:raw: direction: rtl; */
|
|
103
|
-
|
|
104
|
-
// Reset the z-index to auto when the body has a modal open. So when the
|
|
105
|
-
// modal is inside the cover, it doesn't create a stacking context.
|
|
106
|
-
@at-root .has-modal-open & {
|
|
107
|
-
z-index: auto;
|
|
108
|
-
}
|
|
109
102
|
}
|
|
110
103
|
|
|
111
104
|
// Position: Top
|
|
@@ -215,14 +208,6 @@ video.wp-block-cover__video-background {
|
|
|
215
208
|
}
|
|
216
209
|
}
|
|
217
210
|
|
|
218
|
-
.wp-block-cover__video-background {
|
|
219
|
-
z-index: z-index(".wp-block-cover__video-background");
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.wp-block-cover__image-background {
|
|
223
|
-
z-index: z-index(".wp-block-cover__image-background");
|
|
224
|
-
}
|
|
225
|
-
|
|
226
211
|
// Styles below only exist to support older versions of the block.
|
|
227
212
|
// Versions that not had inner blocks and used an h2 heading had a section (and not a div) with a class wp-block-cover-image (and not a wp-block-cover).
|
|
228
213
|
// We are using the previous referred differences to target old versions.
|
|
@@ -302,3 +287,42 @@ section.wp-block-cover-image > h2,
|
|
|
302
287
|
color: inherit;
|
|
303
288
|
}
|
|
304
289
|
}
|
|
290
|
+
|
|
291
|
+
// Backward compatibility for v14 deprecation. Only applied to the frontend.
|
|
292
|
+
// Regarding the `.wp-block-cover__background + .wp-block-cover__inner-container`
|
|
293
|
+
// selector: When the `.wp-block-cover__inner-container` comes right after the
|
|
294
|
+
// `.wp-block-cover__background` , it means that it's using the new HTML
|
|
295
|
+
// structure or that it's using the color background or gradient (even in
|
|
296
|
+
// the deprecated version). In the color background or gradient option we don't
|
|
297
|
+
// need the z-index because the elements are in the expected order.
|
|
298
|
+
body:not(.editor-styles-wrapper) .wp-block-cover:not(
|
|
299
|
+
.wp-block-cover:has(
|
|
300
|
+
.wp-block-cover__background + .wp-block-cover__inner-container
|
|
301
|
+
)
|
|
302
|
+
) {
|
|
303
|
+
.wp-block-cover__video-background {
|
|
304
|
+
z-index: z-index(".wp-block-cover__video-background");
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.wp-block-cover__image-background {
|
|
308
|
+
z-index: z-index(".wp-block-cover__image-background");
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// The first selector is required for old Cover markup/
|
|
312
|
+
// Keep .wp-block-cover__gradient-background for v8 deprecation.
|
|
313
|
+
&.has-background-dim:not(.has-background-gradient)::before,
|
|
314
|
+
.wp-block-cover__background,
|
|
315
|
+
.wp-block-cover__gradient-background {
|
|
316
|
+
z-index: z-index(".wp-block-cover.has-background-dim::before");
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.wp-block-cover__inner-container {
|
|
320
|
+
z-index: z-index(".wp-block-cover__inner-container");
|
|
321
|
+
|
|
322
|
+
// Reset the z-index to auto when the body has a modal open. So when the
|
|
323
|
+
// modal is inside the cover, it doesn't create a stacking context.
|
|
324
|
+
@at-root .has-modal-open & {
|
|
325
|
+
z-index: auto;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
@@ -34,7 +34,7 @@ exports[`color settings toggles between solid colors and gradients 1`] = `
|
|
|
34
34
|
|
|
35
35
|
exports[`minimum height settings changes the height value between units 1`] = `
|
|
36
36
|
"<!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":10710,"dimRatio":50,"overlayColor":"foreground","isUserOverlayColor":true,"minHeight":50,"minHeightUnit":"px","isDark":false} -->
|
|
37
|
-
<div class="wp-block-cover is-light" style="min-height:50px"><
|
|
37
|
+
<div class="wp-block-cover is-light" style="min-height:50px"><img class="wp-block-cover__image-background wp-image-10710" alt="" src="https://cldup.com/cXyG__fTLN.jpg" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
|
|
38
38
|
<p class="has-text-align-center has-large-font-size"></p>
|
|
39
39
|
<!-- /wp:paragraph --></div></div>
|
|
40
40
|
<!-- /wp:cover -->"
|
|
@@ -42,7 +42,7 @@ exports[`minimum height settings changes the height value between units 1`] = `
|
|
|
42
42
|
|
|
43
43
|
exports[`minimum height settings changes the height value to 20(vw) 1`] = `
|
|
44
44
|
"<!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":10710,"dimRatio":50,"overlayColor":"foreground","isUserOverlayColor":true,"minHeight":20,"minHeightUnit":"vw","isDark":false} -->
|
|
45
|
-
<div class="wp-block-cover is-light" style="min-height:20vw"><
|
|
45
|
+
<div class="wp-block-cover is-light" style="min-height:20vw"><img class="wp-block-cover__image-background wp-image-10710" alt="" src="https://cldup.com/cXyG__fTLN.jpg" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
|
|
46
46
|
<p class="has-text-align-center has-large-font-size"></p>
|
|
47
47
|
<!-- /wp:paragraph --></div></div>
|
|
48
48
|
<!-- /wp:cover -->"
|
|
@@ -50,7 +50,7 @@ exports[`minimum height settings changes the height value to 20(vw) 1`] = `
|
|
|
50
50
|
|
|
51
51
|
exports[`minimum height settings disables the decrease button when reaching the minimum value for Pixels (px) 1`] = `
|
|
52
52
|
"<!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":10710,"dimRatio":50,"overlayColor":"foreground","isUserOverlayColor":true,"minHeight":50,"minHeightUnit":"px","isDark":false} -->
|
|
53
|
-
<div class="wp-block-cover is-light" style="min-height:50px"><
|
|
53
|
+
<div class="wp-block-cover is-light" style="min-height:50px"><img class="wp-block-cover__image-background wp-image-10710" alt="" src="https://cldup.com/cXyG__fTLN.jpg" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
|
|
54
54
|
<p class="has-text-align-center has-large-font-size"></p>
|
|
55
55
|
<!-- /wp:paragraph --></div></div>
|
|
56
56
|
<!-- /wp:cover -->"
|
|
@@ -58,7 +58,7 @@ exports[`minimum height settings disables the decrease button when reaching the
|
|
|
58
58
|
|
|
59
59
|
exports[`minimum height settings disables the decrease button when reaching the minimum value for Relative to parent font size (em) 1`] = `
|
|
60
60
|
"<!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":10710,"dimRatio":50,"overlayColor":"foreground","isUserOverlayColor":true,"minHeight":1,"minHeightUnit":"em","isDark":false} -->
|
|
61
|
-
<div class="wp-block-cover is-light" style="min-height:1em"><
|
|
61
|
+
<div class="wp-block-cover is-light" style="min-height:1em"><img class="wp-block-cover__image-background wp-image-10710" alt="" src="https://cldup.com/cXyG__fTLN.jpg" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
|
|
62
62
|
<p class="has-text-align-center has-large-font-size"></p>
|
|
63
63
|
<!-- /wp:paragraph --></div></div>
|
|
64
64
|
<!-- /wp:cover -->"
|
|
@@ -66,7 +66,7 @@ exports[`minimum height settings disables the decrease button when reaching the
|
|
|
66
66
|
|
|
67
67
|
exports[`minimum height settings disables the decrease button when reaching the minimum value for Relative to root font size (rem) 1`] = `
|
|
68
68
|
"<!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":10710,"dimRatio":50,"overlayColor":"foreground","isUserOverlayColor":true,"minHeight":1,"minHeightUnit":"rem","isDark":false} -->
|
|
69
|
-
<div class="wp-block-cover is-light" style="min-height:1rem"><
|
|
69
|
+
<div class="wp-block-cover is-light" style="min-height:1rem"><img class="wp-block-cover__image-background wp-image-10710" alt="" src="https://cldup.com/cXyG__fTLN.jpg" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
|
|
70
70
|
<p class="has-text-align-center has-large-font-size"></p>
|
|
71
71
|
<!-- /wp:paragraph --></div></div>
|
|
72
72
|
<!-- /wp:cover -->"
|
|
@@ -74,7 +74,7 @@ exports[`minimum height settings disables the decrease button when reaching the
|
|
|
74
74
|
|
|
75
75
|
exports[`minimum height settings disables the decrease button when reaching the minimum value for Viewport height (vh) 1`] = `
|
|
76
76
|
"<!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":10710,"dimRatio":50,"overlayColor":"foreground","isUserOverlayColor":true,"minHeight":1,"minHeightUnit":"vh","isDark":false} -->
|
|
77
|
-
<div class="wp-block-cover is-light" style="min-height:1vh"><
|
|
77
|
+
<div class="wp-block-cover is-light" style="min-height:1vh"><img class="wp-block-cover__image-background wp-image-10710" alt="" src="https://cldup.com/cXyG__fTLN.jpg" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
|
|
78
78
|
<p class="has-text-align-center has-large-font-size"></p>
|
|
79
79
|
<!-- /wp:paragraph --></div></div>
|
|
80
80
|
<!-- /wp:cover -->"
|
|
@@ -82,7 +82,7 @@ exports[`minimum height settings disables the decrease button when reaching the
|
|
|
82
82
|
|
|
83
83
|
exports[`minimum height settings disables the decrease button when reaching the minimum value for Viewport width (vw) 1`] = `
|
|
84
84
|
"<!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":10710,"dimRatio":50,"overlayColor":"foreground","isUserOverlayColor":true,"minHeight":1,"minHeightUnit":"vw","isDark":false} -->
|
|
85
|
-
<div class="wp-block-cover is-light" style="min-height:1vw"><
|
|
85
|
+
<div class="wp-block-cover is-light" style="min-height:1vw"><img class="wp-block-cover__image-background wp-image-10710" alt="" src="https://cldup.com/cXyG__fTLN.jpg" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
|
|
86
86
|
<p class="has-text-align-center has-large-font-size"></p>
|
|
87
87
|
<!-- /wp:paragraph --></div></div>
|
|
88
88
|
<!-- /wp:cover -->"
|
|
@@ -90,7 +90,7 @@ exports[`minimum height settings disables the decrease button when reaching the
|
|
|
90
90
|
|
|
91
91
|
exports[`when an image is attached updates background opacity 1`] = `
|
|
92
92
|
"<!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":10710,"dimRatio":15,"overlayColor":"foreground","isUserOverlayColor":true,"isDark":false} -->
|
|
93
|
-
<div class="wp-block-cover is-light"><
|
|
93
|
+
<div class="wp-block-cover is-light"><img class="wp-block-cover__image-background wp-image-10710" alt="" src="https://cldup.com/cXyG__fTLN.jpg" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim-20 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
|
|
94
94
|
<p class="has-text-align-center has-large-font-size"></p>
|
|
95
95
|
<!-- /wp:paragraph --></div></div>
|
|
96
96
|
<!-- /wp:cover -->"
|
|
@@ -98,7 +98,7 @@ exports[`when an image is attached updates background opacity 1`] = `
|
|
|
98
98
|
|
|
99
99
|
exports[`when no media is attached and overlay color is set adds image 1`] = `
|
|
100
100
|
"<!-- wp:cover {"url":"https://test.files.wordpress.com/local-image-1.mp4","id":2000,"dimRatio":50,"overlayColor":"cyan-bluish-gray","isUserOverlayColor":true} -->
|
|
101
|
-
<div class="wp-block-cover is-light"><
|
|
101
|
+
<div class="wp-block-cover is-light"><img class="wp-block-cover__image-background wp-image-2000" src="https://test.files.wordpress.com/local-image-1.mp4" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-cyan-bluish-gray-background-color has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…"} -->
|
|
102
102
|
<p class="has-text-align-center"></p>
|
|
103
103
|
<!-- /wp:paragraph --></div></div>
|
|
104
104
|
<!-- /wp:cover -->"
|
|
@@ -4,7 +4,7 @@ exports[`Cover block transformations with Image to Columns block 1`] = `
|
|
|
4
4
|
"<!-- wp:columns -->
|
|
5
5
|
<div class="wp-block-columns"><!-- wp:column {"width":"100%"} -->
|
|
6
6
|
<div class="wp-block-column" style="flex-basis:100%"><!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":890,"dimRatio":20,"overlayColor":"luminous-vivid-orange","isUserOverlayColor":true,"focalPoint":{"x":"0.63","y":"0.83"},"minHeight":219} -->
|
|
7
|
-
<div class="wp-block-cover" style="min-height:219px"><
|
|
7
|
+
<div class="wp-block-cover" style="min-height:219px"><img class="wp-block-cover__image-background wp-image-890" alt="" src="https://cldup.com/cXyG__fTLN.jpg" style="object-position:63% 83%" data-object-fit="cover" data-object-position="63% 83%"/><span aria-hidden="true" class="wp-block-cover__background has-luminous-vivid-orange-background-color has-background-dim-20 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","className":"has-text-color has-very-light-gray-color","fontSize":"large"} -->
|
|
8
8
|
<p class="has-text-align-center has-text-color has-very-light-gray-color has-large-font-size">Cool cover</p>
|
|
9
9
|
<!-- /wp:paragraph --></div></div>
|
|
10
10
|
<!-- /wp:cover --></div>
|
|
@@ -15,7 +15,7 @@ exports[`Cover block transformations with Image to Columns block 1`] = `
|
|
|
15
15
|
exports[`Cover block transformations with Image to Group block 1`] = `
|
|
16
16
|
"<!-- wp:group {"layout":{"type":"constrained"}} -->
|
|
17
17
|
<div class="wp-block-group"><!-- wp:cover {"url":"https://cldup.com/cXyG__fTLN.jpg","id":890,"dimRatio":20,"overlayColor":"luminous-vivid-orange","isUserOverlayColor":true,"focalPoint":{"x":"0.63","y":"0.83"},"minHeight":219} -->
|
|
18
|
-
<div class="wp-block-cover" style="min-height:219px"><
|
|
18
|
+
<div class="wp-block-cover" style="min-height:219px"><img class="wp-block-cover__image-background wp-image-890" alt="" src="https://cldup.com/cXyG__fTLN.jpg" style="object-position:63% 83%" data-object-fit="cover" data-object-position="63% 83%"/><span aria-hidden="true" class="wp-block-cover__background has-luminous-vivid-orange-background-color has-background-dim-20 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","className":"has-text-color has-very-light-gray-color","fontSize":"large"} -->
|
|
19
19
|
<p class="has-text-align-center has-text-color has-very-light-gray-color has-large-font-size">Cool cover</p>
|
|
20
20
|
<!-- /wp:paragraph --></div></div>
|
|
21
21
|
<!-- /wp:cover --></div>
|
|
@@ -40,7 +40,7 @@ exports[`Cover block transformations with Video to Columns block 1`] = `
|
|
|
40
40
|
"<!-- wp:columns -->
|
|
41
41
|
<div class="wp-block-columns"><!-- wp:column {"width":"100%"} -->
|
|
42
42
|
<div class="wp-block-column" style="flex-basis:100%"><!-- wp:cover {"url":"https://i.cloudup.com/YtZFJbuQCE.mov","id":891,"dimRatio":20,"overlayColor":"luminous-vivid-orange","isUserOverlayColor":true,"backgroundType":"video","focalPoint":{"x":"0.63","y":"0.83"},"minHeight":219,"isDark":false} -->
|
|
43
|
-
<div class="wp-block-cover is-light" style="min-height:219px"><
|
|
43
|
+
<div class="wp-block-cover is-light" style="min-height:219px"><video class="wp-block-cover__video-background intrinsic-ignore" autoplay muted loop playsinline src="https://i.cloudup.com/YtZFJbuQCE.mov" style="object-position:63% 83%" data-object-fit="cover" data-object-position="63% 83%"></video><span aria-hidden="true" class="wp-block-cover__background has-luminous-vivid-orange-background-color has-background-dim-20 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","className":"has-text-color has-very-light-gray-color","fontSize":"large"} -->
|
|
44
44
|
<p class="has-text-align-center has-text-color has-very-light-gray-color has-large-font-size">Cool cover</p>
|
|
45
45
|
<!-- /wp:paragraph --></div></div>
|
|
46
46
|
<!-- /wp:cover --></div>
|
|
@@ -51,7 +51,7 @@ exports[`Cover block transformations with Video to Columns block 1`] = `
|
|
|
51
51
|
exports[`Cover block transformations with Video to Group block 1`] = `
|
|
52
52
|
"<!-- wp:group {"layout":{"type":"constrained"}} -->
|
|
53
53
|
<div class="wp-block-group"><!-- wp:cover {"url":"https://i.cloudup.com/YtZFJbuQCE.mov","id":891,"dimRatio":20,"overlayColor":"luminous-vivid-orange","isUserOverlayColor":true,"backgroundType":"video","focalPoint":{"x":"0.63","y":"0.83"},"minHeight":219,"isDark":false} -->
|
|
54
|
-
<div class="wp-block-cover is-light" style="min-height:219px"><
|
|
54
|
+
<div class="wp-block-cover is-light" style="min-height:219px"><video class="wp-block-cover__video-background intrinsic-ignore" autoplay muted loop playsinline src="https://i.cloudup.com/YtZFJbuQCE.mov" style="object-position:63% 83%" data-object-fit="cover" data-object-position="63% 83%"></video><span aria-hidden="true" class="wp-block-cover__background has-luminous-vivid-orange-background-color has-background-dim-20 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","className":"has-text-color has-very-light-gray-color","fontSize":"large"} -->
|
|
55
55
|
<p class="has-text-align-center has-text-color has-very-light-gray-color has-large-font-size">Cool cover</p>
|
|
56
56
|
<!-- /wp:paragraph --></div></div>
|
|
57
57
|
<!-- /wp:cover --></div>
|