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

Interactivity API: Add block supports for clientNavigation and interactive properties on block.json schema. #58132

Merged
merged 25 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
aa490ab
Add interactivity schemas
cbravobernal Jan 23, 2024
53c0f34
Update all blocks with clientNavigation support
cbravobernal Jan 23, 2024
35f558e
Update non compatible with client side navigation blocks
cbravobernal Jan 23, 2024
d6ed376
Add clientNavigation conditional to Query block
cbravobernal Jan 23, 2024
f548120
Update changelog
cbravobernal Jan 23, 2024
6a7a5a1
Add interactivty enabled
cbravobernal Jan 24, 2024
2224a6f
Update with new schema
cbravobernal Jan 26, 2024
d3aecc7
Update with new schema
cbravobernal Jan 26, 2024
8d32c4b
Still not working, but updates on query
cbravobernal Jan 26, 2024
0ffdfd9
Hard reset of query PHP part, tests should pass
cbravobernal Jan 31, 2024
4279bfc
Update supports version and query code, tests still failing
cbravobernal Jan 31, 2024
c5bafa5
Remove comment template interactivity
cbravobernal Feb 1, 2024
7fd4df2
Simplify query
cbravobernal Feb 1, 2024
5f8f077
Simplify query
cbravobernal Feb 1, 2024
787767f
Remove not needed interactive false
cbravobernal Feb 1, 2024
e519909
Revert duplicated interactivity
cbravobernal Feb 2, 2024
0f01dda
Update supports
cbravobernal Feb 2, 2024
072c51f
Update schema
cbravobernal Feb 2, 2024
60efcbe
Update docs
cbravobernal Feb 2, 2024
dccc845
Fix query php render
cbravobernal Feb 2, 2024
e9fbe23
Improve comment
cbravobernal Feb 2, 2024
dfc7f6d
Add consistency to the render query
cbravobernal Feb 2, 2024
39d79ad
Avoid not needed serialization
cbravobernal Feb 2, 2024
4dede2f
Revert "Avoid not needed serialization"
cbravobernal Feb 2, 2024
36d9491
Improve `interactive` descriptions
luisherranz Feb 2, 2024
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
170 changes: 85 additions & 85 deletions docs/reference-guides/core-blocks.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ function wp_interactivity_process_directives_of_interactive_blocks( $parsed_bloc
$block_name = $parsed_block['blockName'];
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block_name );

if ( isset( $block_name ) && isset( $block_type->supports['interactivity'] ) && $block_type->supports['interactivity'] ) {
if (
isset( $block_name ) &&
( ( isset( $block_type->supports['interactivity'] ) && true === $block_type->supports['interactivity'] ) ||
( isset( $block_type->supports['interactivity']['interactive'] ) && true === $block_type->supports['interactivity']['interactive'] ) )
) {
// Annotates the root interactive block for processing.
$root_interactive_block = array( $block_name, md5( serialize( $parsed_block ) ) );

Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/archives/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-archives-editor"
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/audio/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
"margin": false,
"padding": false
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-audio-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/avatar/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"text": false,
"background": false,
"__experimentalDuotone": "img"
},
"interactivity": {
"clientNavigation": true
}
},
"selectors": {
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/block/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"customClassName": false,
"html": false,
"inserter": false,
"renaming": false
"renaming": false,
"interactivity": {
"clientNavigation": true
}
}
}
5 changes: 4 additions & 1 deletion packages/block-library/src/button/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@
"width": true
}
},
"__experimentalSelector": ".wp-block-button .wp-block-button__link"
"__experimentalSelector": ".wp-block-button .wp-block-button__link",
"interactivity": {
"clientNavigation": true
}
},
"styles": [
{ "name": "fill", "label": "Fill", "isDefault": true },
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/buttons/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"default": {
"type": "flex"
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-buttons-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/calendar/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"style": "wp-block-calendar"
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/categories/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-categories-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/code/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
"background": true,
"text": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"style": "wp-block-code"
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/column/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
"fontSize": true
}
},
"layout": true
"layout": true,
"interactivity": {
"clientNavigation": true
}
}
}
3 changes: 3 additions & 0 deletions packages/block-library/src/columns/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-columns-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-author-avatar/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"__experimentalSkipSerialization": true,
"margin": true,
"padding": true
},
"interactivity": {
"clientNavigation": true
}
}
}
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-author-name/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
}
}
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-date/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
}
}
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-edit-link/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
}
}
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-template/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"style": "wp-block-comment-template"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
}
}
3 changes: 3 additions & 0 deletions packages/block-library/src/comments-pagination/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-comments-pagination-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/comments-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
"__experimentalFontStyle": true,
"__experimentalFontWeight": true
}
},
"interactivity": {
"clientNavigation": true
}
}
}
3 changes: 3 additions & 0 deletions packages/block-library/src/cover/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
},
"layout": {
"allowJustification": false
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-cover-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/details/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
},
"layout": {
"allowEditing": false
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-details-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/embed/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"align": true,
"spacing": {
"margin": true
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-embed-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/footnotes/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"style": "wp-block-footnotes"
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/gallery/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
"default": {
"type": "flex"
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-gallery-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/group/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
},
"layout": {
"allowSizingOnChildren": true
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-group-editor",
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/heading/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
}
},
"__unstablePasteTextInline": true,
"__experimentalSlashInserter": true
"__experimentalSlashInserter": true,
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-heading-editor",
"style": "wp-block-heading"
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/home-link/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-home-link-editor",
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/html/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"supports": {
"customClassName": false,
"className": false,
"html": false
"html": false,
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-html-editor"
}
3 changes: 3 additions & 0 deletions packages/block-library/src/latest-comments/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-latest-comments-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/latest-posts/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-latest-posts-editor",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/list-item/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
}
}
5 changes: 4 additions & 1 deletion packages/block-library/src/list/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
"__unstablePasteTextInline": true,
"__experimentalSelector": "ol,ul",
"__experimentalOnMerge": true,
"__experimentalSlashInserter": true
"__experimentalSlashInserter": true,
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-list-editor",
"style": "wp-block-list"
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/loginout/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
}
}
3 changes: 3 additions & 0 deletions packages/block-library/src/media-text/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-media-text-editor",
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/missing/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"customClassName": false,
"inserter": false,
"html": false,
"reusable": false
"reusable": false,
"interactivity": {
"clientNavigation": true
}
}
}
Loading
Loading