-
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.
* Initial attempt at table block caption Try using a figcaption for the table caption Revert "Try using a figcaption for the table caption" Switch back to a standard table caption This reverts commit b5f00dd. Add comment explaining location of RichText Ensure table cell is deselected when navigating from a table cell to the caption Styling tweaks Add an inline toolbar to the caption to match the image block implementation Adjust margin to match image block Add e2e test for the table block caption Refine caption accessibility. Use a div for the caption content Update caption to use a figcaption element with aria-labelledby Update table block deprecation so that it has its own attribute definition Update existing fixtures and add a new fixture for table captions Minor refinements Fix hasCaption logic Update snapshots Update comment with latest understanding of issue Use client id to generate non-clashing caption element id Update block-transforms fixture Update test to use a regular expression * Reuse the captionId when already set as an attribute * Change style rule to use figcaption selector * Explain use of aria-labelledby * Update deprecation * Use RichText for figcaption, strip out a11y hacks * Ensure empty classname is not output onto table element and update snapshots * Update raw handling test * Revert "Update raw handling test" This reverts commit f3ae751. * Revert "Ensure empty classname is not output onto table element and update snapshots" This reverts commit 0265104. * Update table caption fixtures and deprecations
- Loading branch information
Showing
15 changed files
with
339 additions
and
7 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
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 |
---|---|---|
|
@@ -7,4 +7,8 @@ | |
border: 1px solid; | ||
word-break: normal; | ||
} | ||
|
||
figcaption { | ||
@include caption-style-theme(); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"isValid": true, | ||
"attributes": { | ||
"hasFixedLayout": false, | ||
"caption": "", | ||
"head": [ | ||
{ | ||
"cells": [ | ||
|
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:core/table --> | ||
<figure class="wp-block-table"><table class=""><thead><tr><th>Version</th><th>Musician</th><th>Date</th></tr></thead><tbody><tr><td><a href="https://wordpress.org/news/2003/05/wordpress-now-available/">.70</a></td><td>No musician chosen.</td><td>May 27, 2003</td></tr><tr><td><a href="https://wordpress.org/news/2004/01/wordpress-10/">1.0</a></td><td>Miles Davis</td><td>January 3, 2004</td></tr><tr><td>Lots of versions skipped, see <a href="https://codex.wordpress.org/WordPress_Versions">the full list</a></td><td>…</td><td>…</td></tr><tr><td><a href="https://wordpress.org/news/2015/12/clifford/">4.4</a></td><td>Clifford Brown</td><td>December 8, 2015</td></tr><tr><td><a href="https://wordpress.org/news/2016/04/coleman/">4.5</a></td><td>Coleman Hawkins</td><td>April 12, 2016</td></tr><tr><td><a href="https://wordpress.org/news/2016/08/pepper/">4.6</a></td><td>Pepper Adams</td><td>August 16, 2016</td></tr><tr><td><a href="https://wordpress.org/news/2016/12/vaughan/">4.7</a></td><td>Sarah Vaughan</td><td>December 6, 2016</td></tr></tbody></table><figcaption>A table for testing</figcaption></figure> | ||
<!-- /wp:core/table --> |
146 changes: 146 additions & 0 deletions
146
packages/e2e-tests/fixtures/blocks/core__table__caption.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,146 @@ | ||
[ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "core/table", | ||
"isValid": true, | ||
"attributes": { | ||
"hasFixedLayout": false, | ||
"caption": "A table for testing", | ||
"head": [ | ||
{ | ||
"cells": [ | ||
{ | ||
"content": "Version", | ||
"tag": "th" | ||
}, | ||
{ | ||
"content": "Musician", | ||
"tag": "th" | ||
}, | ||
{ | ||
"content": "Date", | ||
"tag": "th" | ||
} | ||
] | ||
} | ||
], | ||
"body": [ | ||
{ | ||
"cells": [ | ||
{ | ||
"content": "<a href=\"https://wordpress.org/news/2003/05/wordpress-now-available/\">.70</a>", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "No musician chosen.", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "May 27, 2003", | ||
"tag": "td" | ||
} | ||
] | ||
}, | ||
{ | ||
"cells": [ | ||
{ | ||
"content": "<a href=\"https://wordpress.org/news/2004/01/wordpress-10/\">1.0</a>", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "Miles Davis", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "January 3, 2004", | ||
"tag": "td" | ||
} | ||
] | ||
}, | ||
{ | ||
"cells": [ | ||
{ | ||
"content": "Lots of versions skipped, see <a href=\"https://codex.wordpress.org/WordPress_Versions\">the full list</a>", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "…", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "…", | ||
"tag": "td" | ||
} | ||
] | ||
}, | ||
{ | ||
"cells": [ | ||
{ | ||
"content": "<a href=\"https://wordpress.org/news/2015/12/clifford/\">4.4</a>", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "Clifford Brown", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "December 8, 2015", | ||
"tag": "td" | ||
} | ||
] | ||
}, | ||
{ | ||
"cells": [ | ||
{ | ||
"content": "<a href=\"https://wordpress.org/news/2016/04/coleman/\">4.5</a>", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "Coleman Hawkins", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "April 12, 2016", | ||
"tag": "td" | ||
} | ||
] | ||
}, | ||
{ | ||
"cells": [ | ||
{ | ||
"content": "<a href=\"https://wordpress.org/news/2016/08/pepper/\">4.6</a>", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "Pepper Adams", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "August 16, 2016", | ||
"tag": "td" | ||
} | ||
] | ||
}, | ||
{ | ||
"cells": [ | ||
{ | ||
"content": "<a href=\"https://wordpress.org/news/2016/12/vaughan/\">4.7</a>", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "Sarah Vaughan", | ||
"tag": "td" | ||
}, | ||
{ | ||
"content": "December 6, 2016", | ||
"tag": "td" | ||
} | ||
] | ||
} | ||
], | ||
"foot": [] | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "<figure class=\"wp-block-table\"><table class=\"\"><thead><tr><th>Version</th><th>Musician</th><th>Date</th></tr></thead><tbody><tr><td><a href=\"https://wordpress.org/news/2003/05/wordpress-now-available/\">.70</a></td><td>No musician chosen.</td><td>May 27, 2003</td></tr><tr><td><a href=\"https://wordpress.org/news/2004/01/wordpress-10/\">1.0</a></td><td>Miles Davis</td><td>January 3, 2004</td></tr><tr><td>Lots of versions skipped, see <a href=\"https://codex.wordpress.org/WordPress_Versions\">the full list</a></td><td>…</td><td>…</td></tr><tr><td><a href=\"https://wordpress.org/news/2015/12/clifford/\">4.4</a></td><td>Clifford Brown</td><td>December 8, 2015</td></tr><tr><td><a href=\"https://wordpress.org/news/2016/04/coleman/\">4.5</a></td><td>Coleman Hawkins</td><td>April 12, 2016</td></tr><tr><td><a href=\"https://wordpress.org/news/2016/08/pepper/\">4.6</a></td><td>Pepper Adams</td><td>August 16, 2016</td></tr><tr><td><a href=\"https://wordpress.org/news/2016/12/vaughan/\">4.7</a></td><td>Sarah Vaughan</td><td>December 6, 2016</td></tr></tbody></table><figcaption>A table for testing</figcaption></figure>" | ||
} | ||
] |
Oops, something went wrong.