-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Media & Text Block: Add vertical alignment options (#13989)
* Add vertical alignment functionality to the media and text block * Remove duplicate styles * Add fixture for vertical alignment test * Add entry to changelog
- Loading branch information
1 parent
5d6527d
commit 5aed6ae
Showing
9 changed files
with
111 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/e2e-tests/fixtures/blocks/core__media-text__vertical-align-bottom.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- wp:media-text {"mediaId":11,"mediaType":"image","verticalAlignment":"bottom"} --> | ||
<div class="wp-block-media-text alignwide is-vertically-aligned-bottom"> | ||
<figure class="wp-block-media-text__media"><img | ||
src="http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg" alt="My alt text" | ||
class="wp-image-11" /></figure> | ||
<div class="wp-block-media-text__content"> | ||
<!-- wp:paragraph {"placeholder":"Content…","fontSize":"large"} --> | ||
<p class="has-large-font-size">My content</p> | ||
<!-- /wp:paragraph --> | ||
</div> | ||
</div> | ||
<!-- /wp:media-text --> |
34 changes: 34 additions & 0 deletions
34
packages/e2e-tests/fixtures/blocks/core__media-text__vertical-align-bottom.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "core/media-text", | ||
"isValid": true, | ||
"attributes": { | ||
"align": "wide", | ||
"mediaAlt": "My alt text", | ||
"mediaPosition": "left", | ||
"mediaId": 11, | ||
"mediaUrl": "http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg", | ||
"mediaType": "image", | ||
"mediaWidth": 50, | ||
"isStackedOnMobile": false, | ||
"verticalAlignment": "bottom" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "core/paragraph", | ||
"isValid": true, | ||
"attributes": { | ||
"content": "My content", | ||
"dropCap": false, | ||
"placeholder": "Content…", | ||
"fontSize": "large" | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "<p class=\"has-large-font-size\">My content</p>" | ||
} | ||
], | ||
"originalContent": "<div class=\"wp-block-media-text alignwide is-vertically-aligned-bottom\">\n\t<figure class=\"wp-block-media-text__media\"><img\n\t\t\tsrc=\"http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg\" alt=\"My alt text\"\n\t\t\tclass=\"wp-image-11\" /></figure>\n\t<div class=\"wp-block-media-text__content\">\n\t\t\n\t</div>\n</div>" | ||
} | ||
] |
30 changes: 30 additions & 0 deletions
30
packages/e2e-tests/fixtures/blocks/core__media-text__vertical-align-bottom.parsed.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[ | ||
{ | ||
"blockName": "core/media-text", | ||
"attrs": { | ||
"mediaId": 11, | ||
"mediaType": "image", | ||
"verticalAlignment": "bottom" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"blockName": "core/paragraph", | ||
"attrs": { | ||
"placeholder": "Content…", | ||
"fontSize": "large" | ||
}, | ||
"innerBlocks": [], | ||
"innerHTML": "\n\t\t<p class=\"has-large-font-size\">My content</p>\n\t\t", | ||
"innerContent": [ | ||
"\n\t\t<p class=\"has-large-font-size\">My content</p>\n\t\t" | ||
] | ||
} | ||
], | ||
"innerHTML": "\n<div class=\"wp-block-media-text alignwide is-vertically-aligned-bottom\">\n\t<figure class=\"wp-block-media-text__media\"><img\n\t\t\tsrc=\"http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg\" alt=\"My alt text\"\n\t\t\tclass=\"wp-image-11\" /></figure>\n\t<div class=\"wp-block-media-text__content\">\n\t\t\n\t</div>\n</div>\n", | ||
"innerContent": [ | ||
"\n<div class=\"wp-block-media-text alignwide is-vertically-aligned-bottom\">\n\t<figure class=\"wp-block-media-text__media\"><img\n\t\t\tsrc=\"http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg\" alt=\"My alt text\"\n\t\t\tclass=\"wp-image-11\" /></figure>\n\t<div class=\"wp-block-media-text__content\">\n\t\t", | ||
null, | ||
"\n\t</div>\n</div>\n" | ||
] | ||
} | ||
] |
5 changes: 5 additions & 0 deletions
5
packages/e2e-tests/fixtures/blocks/core__media-text__vertical-align-bottom.serialized.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!-- wp:media-text {"mediaId":11,"mediaType":"image","verticalAlignment":"bottom"} --> | ||
<div class="wp-block-media-text alignwide is-vertically-aligned-bottom"><figure class="wp-block-media-text__media"><img src="http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg" alt="My alt text" class="wp-image-11"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"Content…","fontSize":"large"} --> | ||
<p class="has-large-font-size">My content</p> | ||
<!-- /wp:paragraph --></div></div> | ||
<!-- /wp:media-text --> |