-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Pullquote: Add Block Bindings support #70975
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5938fa1
Pullquote: Try adding Block Bindings support
gziolo 570f5a8
Use the Block Bindings polyfill
gziolo 8f1d461
Clean up the save method
gziolo ed7805f
Refactor integration logic
gziolo b27d92f
Update backport information
gziolo 76105c8
Sync the list of partially synced blocks with block bindings
gziolo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| https://github.com/WordPress/wordpress-develop/pull/9702 | ||
|
|
||
| * https://github.com/WordPress/gutenberg/pull/71483 | ||
| * https://github.com/WordPress/gutenberg/pull/71483 |
This file contains hidden or 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 @@ | ||
| https://github.com/WordPress/wordpress-develop/pull/9990 | ||
|
|
||
| * https://github.com/WordPress/gutenberg/pull/70975 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
7 changes: 7 additions & 0 deletions
7
test/integration/fixtures/blocks/core__pullquote__citation-block-bindings.html
This file contains hidden or 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,7 @@ | ||
| <!-- wp:core/pullquote {"metadata":{"bindings":{"citation":{"source":"core/post-data","args":{"key":"date"}}}}} --> | ||
| <figure class="wp-block-pullquote"> | ||
| <blockquote> | ||
| <p>Testing pullquote block...</p><cite></cite> | ||
| </blockquote> | ||
| </figure> | ||
| <!-- /wp:core/pullquote --> |
21 changes: 21 additions & 0 deletions
21
test/integration/fixtures/blocks/core__pullquote__citation-block-bindings.json
This file contains hidden or 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,21 @@ | ||
| [ | ||
| { | ||
| "name": "core/pullquote", | ||
| "isValid": true, | ||
| "attributes": { | ||
| "value": "Testing pullquote block...", | ||
| "citation": "", | ||
| "metadata": { | ||
| "bindings": { | ||
| "citation": { | ||
| "source": "core/post-data", | ||
| "args": { | ||
| "key": "date" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "innerBlocks": [] | ||
| } | ||
| ] |
22 changes: 22 additions & 0 deletions
22
test/integration/fixtures/blocks/core__pullquote__citation-block-bindings.parsed.json
This file contains hidden or 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,22 @@ | ||
| [ | ||
| { | ||
| "blockName": "core/pullquote", | ||
| "attrs": { | ||
| "metadata": { | ||
| "bindings": { | ||
| "citation": { | ||
| "source": "core/post-data", | ||
| "args": { | ||
| "key": "date" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "innerBlocks": [], | ||
| "innerHTML": "\n<figure class=\"wp-block-pullquote\">\n <blockquote>\n <p>Testing pullquote block...</p><cite></cite>\n </blockquote>\n</figure>\n", | ||
| "innerContent": [ | ||
| "\n<figure class=\"wp-block-pullquote\">\n <blockquote>\n <p>Testing pullquote block...</p><cite></cite>\n </blockquote>\n</figure>\n" | ||
| ] | ||
| } | ||
| ] |
3 changes: 3 additions & 0 deletions
3
test/integration/fixtures/blocks/core__pullquote__citation-block-bindings.serialized.html
This file contains hidden or 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:pullquote {"metadata":{"bindings":{"citation":{"source":"core/post-data","args":{"key":"date"}}}}} --> | ||
| <figure class="wp-block-pullquote"><blockquote><p>Testing pullquote block...</p><cite></cite></blockquote></figure> | ||
| <!-- /wp:pullquote --> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@talldan, any reason this list should differ from bindable attributes?
@ockham, perhaps we should eliminate this list in a follow-up and replicate the same check as on the server with some filtering capabilities when consuming
BLOCK_BINDINGS_ALLOWED_BLOCKS?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of a reason, as long as the blocks/attributes work correctly for users should be fine to support them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, right now, the list is duplicated in way too many places.
I think my preferred option would be to make the server-side list the source of truth (since it already supports filtering), and communicate it to the client. I just haven't decided yet how to do that; I couldn't think of an existing REST API endpoint to add it to, and introducing a dedicated one seemed overblown.
Maybe I'll just add it to
$editor_settings🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drafted a Core PR: WordPress/wordpress-develop#9992.
Will continue work on that (and a GB counterpart) later today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GB counterpart: #71820
Both are ready for review!