-
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.
Add fixtures, add dimension panel for padding
- Loading branch information
Carlos Bravo
committed
Sep 29, 2021
1 parent
d6fe6c8
commit 7c2395f
Showing
8 changed files
with
108 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* Server-side rendering of the `core/post-comment-avatar` block. | ||
* | ||
* @package WordPress | ||
*/ | ||
|
||
/** | ||
* Registers the `core/post-comment-avatar` block on the server. | ||
* We need to do this to make context available for inner blocks. | ||
*/ | ||
function register_block_core_post_comment_avatar() { | ||
register_block_type_from_metadata( | ||
__DIR__ . '/post-comment-avatar' | ||
); | ||
} | ||
add_action( 'init', 'register_block_core_post_comment_avatar' ); |
14 changes: 14 additions & 0 deletions
14
test/integration/fixtures/blocks/core__post-comment-avatar.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,14 @@ | ||
<!-- wp:post-comment-avatar {"url":"http://0.gravatar.com/avatar/c2b06ae950033b392998ada50767b50e?s=96\u0026d=monsterid\u0026r=g","style":{"spacing":{"padding":{"top":"5px","right":"10px","bottom":"15px","left":"20px"}}}} --> | ||
<img | ||
style=" | ||
padding-top: 5px; | ||
padding-right: 10px; | ||
padding-bottom: 15px; | ||
padding-left: 20px; | ||
" | ||
src="http://0.gravatar.com/avatar/c2b06ae950033b392998ada50767b50e?s=96&d=monsterid&r=g" | ||
alt="" | ||
width="96" | ||
height="96" | ||
/> | ||
<!-- /wp:post-comment-avatar --> |
25 changes: 25 additions & 0 deletions
25
test/integration/fixtures/blocks/core__post-comment-avatar.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,25 @@ | ||
[ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "core/post-comment-avatar", | ||
"isValid": true, | ||
"attributes": { | ||
"width": 96, | ||
"height": 96, | ||
"url": "http://0.gravatar.com/avatar/c2b06ae950033b392998ada50767b50e?s=96&d=monsterid&r=g", | ||
"alt": "", | ||
"style": { | ||
"spacing": { | ||
"padding": { | ||
"top": "5px", | ||
"right": "10px", | ||
"bottom": "15px", | ||
"left": "20px" | ||
} | ||
} | ||
} | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "<img\n\tstyle=\"\n\t\tpadding-top: 5px;\n\t\tpadding-right: 10px;\n\t\tpadding-bottom: 15px;\n\t\tpadding-left: 20px;\n\t\"\n\tsrc=\"http://0.gravatar.com/avatar/c2b06ae950033b392998ada50767b50e?s=96&d=monsterid&r=g\"\n\talt=\"\"\n\twidth=\"96\"\n\theight=\"96\"\n/>" | ||
} | ||
] |
23 changes: 23 additions & 0 deletions
23
test/integration/fixtures/blocks/core__post-comment-avatar.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,23 @@ | ||
[ | ||
{ | ||
"blockName": "core/post-comment-avatar", | ||
"attrs": { | ||
"url": "http://0.gravatar.com/avatar/c2b06ae950033b392998ada50767b50e?s=96&d=monsterid&r=g", | ||
"style": { | ||
"spacing": { | ||
"padding": { | ||
"top": "5px", | ||
"right": "10px", | ||
"bottom": "15px", | ||
"left": "20px" | ||
} | ||
} | ||
} | ||
}, | ||
"innerBlocks": [], | ||
"innerHTML": "\n<img\n\tstyle=\"\n\t\tpadding-top: 5px;\n\t\tpadding-right: 10px;\n\t\tpadding-bottom: 15px;\n\t\tpadding-left: 20px;\n\t\"\n\tsrc=\"http://0.gravatar.com/avatar/c2b06ae950033b392998ada50767b50e?s=96&d=monsterid&r=g\"\n\talt=\"\"\n\twidth=\"96\"\n\theight=\"96\"\n/>\n", | ||
"innerContent": [ | ||
"\n<img\n\tstyle=\"\n\t\tpadding-top: 5px;\n\t\tpadding-right: 10px;\n\t\tpadding-bottom: 15px;\n\t\tpadding-left: 20px;\n\t\"\n\tsrc=\"http://0.gravatar.com/avatar/c2b06ae950033b392998ada50767b50e?s=96&d=monsterid&r=g\"\n\talt=\"\"\n\twidth=\"96\"\n\theight=\"96\"\n/>\n" | ||
] | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
test/integration/fixtures/blocks/core__post-comment-avatar.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,3 @@ | ||
<!-- wp:post-comment-avatar {"url":"http://0.gravatar.com/avatar/c2b06ae950033b392998ada50767b50e?s=96\u0026d=monsterid\u0026r=g","style":{"spacing":{"padding":{"top":"5px","right":"10px","bottom":"15px","left":"20px"}}}} --> | ||
<img style="padding-top:5px;padding-right:10px;padding-bottom:15px;padding-left:20px" src="http://0.gravatar.com/avatar/c2b06ae950033b392998ada50767b50e?s=96&d=monsterid&r=g" alt="" width="96" height="96"/> | ||
<!-- /wp:post-comment-avatar --> |