Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create comments title with simple styling #40419

Merged
merged 15 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update fixtures
  • Loading branch information
cbravobernal committed Apr 19, 2022
commit e5d2a2b9e29477e9d11c0d700f8b072bab19e96c
56 changes: 24 additions & 32 deletions test/integration/fixtures/blocks/core__comments-query-loop.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
<!-- wp:comments-query-loop -->
<div class="wp-block-comments-query-loop">
<div class="wp-block-comments-query-loop"><!-- wp:comments-title {"level":4,"style":{"spacing":{"padding":{"top":"6px","right":"6px","bottom":"6px","left":"6px"}},"border":{"width":"3px","radius":"100px"}},"borderColor":"vivid-red","backgroundColor":"primary","textColor":"background","fontSize":"large"} /-->

<!-- wp:comment-template -->
<!-- wp:columns -->
<div class="wp-block-columns">
<!-- wp:column {"width":"40px"} -->
<div class="wp-block-column" style="flex-basis:40px">
<!-- wp:avatar {"size":40,"style":{"border":{"radius":"20px"}}} /-->
</div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:comment-author-name /-->

<!-- wp:group {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}}},"layout":{"type":"flex"}} -->
<div class="wp-block-group" style="margin-top:0px;margin-bottom:0px">
<!-- wp:comment-date /-->

<!-- wp:comment-edit-link /-->
</div>
<!-- /wp:group -->

<!-- wp:comment-content /-->

<!-- wp:comment-reply-link /-->
</div>
<!-- /wp:column -->
</div>
<div class="wp-block-columns"><!-- wp:column {"width":"40px"} -->
<div class="wp-block-column" style="flex-basis:40px"><!-- wp:avatar {"size":40,"style":{"border":{"radius":"20px"}}} /--></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:comment-author-name /-->

<!-- wp:group {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}}},"layout":{"type":"flex"}} -->
<div class="wp-block-group" style="margin-top:0px;margin-bottom:0px"><!-- wp:comment-date /-->

<!-- wp:comment-edit-link /--></div>
<!-- /wp:group -->

<!-- wp:comment-content /-->

<!-- wp:comment-reply-link /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
<!-- /wp:comment-template -->

<!-- wp:comments-pagination -->
<!-- wp:comments-pagination-previous /-->

<!-- wp:comments-pagination-numbers /-->

<!-- wp:comments-pagination-next /-->
<!-- /wp:comments-pagination -->
</div>
<!-- /wp:comments-query-loop -->
<!-- /wp:comments-pagination --></div>
<!-- /wp:comments-query-loop -->
28 changes: 28 additions & 0 deletions test/integration/fixtures/blocks/core__comments-query-loop.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@
"tagName": "div"
},
"innerBlocks": [
{
"name": "core/comments-title",
"isValid": true,
"attributes": {
"showPostTitle": true,
"showCommentsCount": true,
"level": 4,
"borderColor": "vivid-red",
"backgroundColor": "primary",
"textColor": "background",
"fontSize": "large",
"style": {
"spacing": {
"padding": {
"top": "6px",
"right": "6px",
"bottom": "6px",
"left": "6px"
}
},
"border": {
"width": "3px",
"radius": "100px"
}
}
},
"innerBlocks": []
},
{
"name": "core/comment-template",
"isValid": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@
"blockName": "core/comments-query-loop",
"attrs": {},
"innerBlocks": [
{
"blockName": "core/comments-title",
"attrs": {
"level": 4,
"style": {
"spacing": {
"padding": {
"top": "6px",
"right": "6px",
"bottom": "6px",
"left": "6px"
}
},
"border": {
"width": "3px",
"radius": "100px"
}
},
"borderColor": "vivid-red",
"backgroundColor": "primary",
"textColor": "background",
"fontSize": "large"
},
"innerBlocks": [],
"innerHTML": "",
"innerContent": []
},
{
"blockName": "core/comment-template",
"attrs": {},
Expand Down Expand Up @@ -32,11 +59,11 @@
"innerContent": []
}
],
"innerHTML": "\n\t\t<div class=\"wp-block-column\" style=\"flex-basis:40px\">\n\t\t\t\n\t\t</div>\n\t\t",
"innerHTML": "\n\t<div class=\"wp-block-column\" style=\"flex-basis:40px\"></div>\n\t",
"innerContent": [
"\n\t\t<div class=\"wp-block-column\" style=\"flex-basis:40px\">\n\t\t\t",
"\n\t<div class=\"wp-block-column\" style=\"flex-basis:40px\">",
null,
"\n\t\t</div>\n\t\t"
"</div>\n\t"
]
},
{
Expand Down Expand Up @@ -81,13 +108,13 @@
"innerContent": []
}
],
"innerHTML": "\n\t\t\t<div class=\"wp-block-group\" style=\"margin-top:0px;margin-bottom:0px\">\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t</div>\n\t\t\t",
"innerHTML": "\n\t<div class=\"wp-block-group\" style=\"margin-top:0px;margin-bottom:0px\">\n\t\n\t</div>\n\t",
"innerContent": [
"\n\t\t\t<div class=\"wp-block-group\" style=\"margin-top:0px;margin-bottom:0px\">\n\t\t\t\t",
"\n\t<div class=\"wp-block-group\" style=\"margin-top:0px;margin-bottom:0px\">",
null,
"\n\n\t\t\t\t",
"\n\t\n\t",
null,
"\n\t\t\t</div>\n\t\t\t"
"</div>\n\t"
]
},
{
Expand All @@ -105,27 +132,27 @@
"innerContent": []
}
],
"innerHTML": "\n\t\t<div class=\"wp-block-column\">\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\t\t</div>\n\t\t",
"innerHTML": "\n\t<div class=\"wp-block-column\">\n\t\n\t\n\t\n\t\n\t\n\t</div>\n\t",
"innerContent": [
"\n\t\t<div class=\"wp-block-column\">\n\t\t\t",
"\n\t<div class=\"wp-block-column\">",
null,
"\n\n\t\t\t",
"\n\t\n\t",
null,
"\n\n\t\t\t",
"\n\t\n\t",
null,
"\n\n\t\t\t",
"\n\t\n\t",
null,
"\n\t\t</div>\n\t\t"
"</div>\n\t"
]
}
],
"innerHTML": "\n\t<div class=\"wp-block-columns\">\n\t\t\n\n\t\t\n\t</div>\n\t",
"innerHTML": "\n\t<div class=\"wp-block-columns\">\n\t\n\t</div>\n\t",
"innerContent": [
"\n\t<div class=\"wp-block-columns\">\n\t\t",
"\n\t<div class=\"wp-block-columns\">",
null,
"\n\n\t\t",
"\n\t\n\t",
null,
"\n\t</div>\n\t"
"</div>\n\t"
]
}
],
Expand Down Expand Up @@ -158,25 +185,27 @@
"innerContent": []
}
],
"innerHTML": "\n\t\n\n\t\n\n\t\n\t",
"innerHTML": "\n\t\n\t\n\t\n\t\n\t\n\t",
"innerContent": [
"\n\t",
null,
"\n\n\t",
"\n\t\n\t",
null,
"\n\n\t",
"\n\t\n\t",
null,
"\n\t"
]
}
],
"innerHTML": "\n<div class=\"wp-block-comments-query-loop\">\n\t\n\n\t\n</div>\n",
"innerHTML": "\n<div class=\"wp-block-comments-query-loop\">\n\n\t\n\t\n\t</div>\n\t",
"innerContent": [
"\n<div class=\"wp-block-comments-query-loop\">\n\t",
"\n<div class=\"wp-block-comments-query-loop\">",
null,
"\n\n\t",
null,
"\n</div>\n"
"\n\t\n\t",
null,
"</div>\n\t"
]
}
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- wp:comments-query-loop -->
<div class="wp-block-comments-query-loop"><!-- wp:comment-template -->
<div class="wp-block-comments-query-loop"><!-- wp:comments-title {"level":4,"borderColor":"vivid-red","backgroundColor":"primary","textColor":"background","fontSize":"large","style":{"spacing":{"padding":{"top":"6px","right":"6px","bottom":"6px","left":"6px"}},"border":{"width":"3px","radius":"100px"}}} /-->

<!-- wp:comment-template -->
<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"40px"} -->
<div class="wp-block-column" style="flex-basis:40px"><!-- wp:avatar {"size":40,"style":{"border":{"radius":"20px"}}} /--></div>
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fixtures/blocks/core__comments-title.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!-- wp:comments-title {"style":{"typography":{"textTransform":"uppercase","fontStyle":"italic","fontWeight":"900","lineHeight":"3"}},"textColor":"vivid-purple","fontSize":"x-large","fontFamily":"source-serif-pro"} /-->
<!-- wp:comments-title {"level":4,"style":{"spacing":{"padding":{"top":"6px","right":"6px","bottom":"6px","left":"6px"}},"border":{"width":"3px","radius":"100px"}},"borderColor":"vivid-red","backgroundColor":"primary","textColor":"background","fontSize":"large"} /-->
25 changes: 17 additions & 8 deletions test/integration/fixtures/blocks/core__comments-title.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@
"isValid": true,
"attributes": {
"showPostTitle": true,
"textColor": "vivid-purple",
"fontFamily": "source-serif-pro",
"fontSize": "x-large",
"showCommentsCount": true,
"level": 4,
"borderColor": "vivid-red",
"backgroundColor": "primary",
"textColor": "background",
"fontSize": "large",
"style": {
"typography": {
"textTransform": "uppercase",
"fontStyle": "italic",
"fontWeight": "900",
"lineHeight": "3"
"spacing": {
"padding": {
"top": "6px",
"right": "6px",
"bottom": "6px",
"left": "6px"
}
},
"border": {
"width": "3px",
"radius": "100px"
}
}
},
Expand Down
24 changes: 16 additions & 8 deletions test/integration/fixtures/blocks/core__comments-title.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@
{
"blockName": "core/comments-title",
"attrs": {
"level": 4,
"style": {
"typography": {
"textTransform": "uppercase",
"fontStyle": "italic",
"fontWeight": "900",
"lineHeight": "3"
"spacing": {
"padding": {
"top": "6px",
"right": "6px",
"bottom": "6px",
"left": "6px"
}
},
"border": {
"width": "3px",
"radius": "100px"
}
},
"textColor": "vivid-purple",
"fontSize": "x-large",
"fontFamily": "source-serif-pro"
"borderColor": "vivid-red",
"backgroundColor": "primary",
"textColor": "background",
"fontSize": "large"
},
"innerBlocks": [],
"innerHTML": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!-- wp:comments-title {"textColor":"vivid-purple","fontFamily":"source-serif-pro","fontSize":"x-large","style":{"typography":{"textTransform":"uppercase","fontStyle":"italic","fontWeight":"900","lineHeight":"3"}}} /-->
<!-- wp:comments-title {"level":4,"borderColor":"vivid-red","backgroundColor":"primary","textColor":"background","fontSize":"large","style":{"spacing":{"padding":{"top":"6px","right":"6px","bottom":"6px","left":"6px"}},"border":{"width":"3px","radius":"100px"}}} /-->