From f6e9fccc236e11af1f114509ce92c84cf0dbacc1 Mon Sep 17 00:00:00 2001 From: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com> Date: Fri, 2 Feb 2024 21:24:49 +0100 Subject: [PATCH] Interactivity API: Add `block supports` for `clientNavigation` and `interactive` properties on `block.json` schema. (#58132) * Add interactivity schemas * Update all blocks with clientNavigation support * Update non compatible with client side navigation blocks * Add clientNavigation conditional to Query block * Update changelog * Add interactivty enabled * Update with new schema * Update with new schema * Still not working, but updates on query * Hard reset of query PHP part, tests should pass * Update supports version and query code, tests still failing * Remove comment template interactivity * Simplify query * Simplify query * Remove not needed interactive false * Revert duplicated interactivity * Update supports * Update schema * Update docs * Fix query php render * Improve comment * Add consistency to the render query * Avoid not needed serialization * Revert "Avoid not needed serialization" This reverts commit 78daef1185373c7153f060f580427d0331caa57e. * Improve `interactive` descriptions --------- Co-authored-by: c4rl0sbr4v0 Co-authored-by: luisherranz Co-authored-by: sirreal --- docs/reference-guides/core-blocks.md | 170 +++++++++--------- .../interactivity-api/interactivity-api.php | 6 +- .../block-library/src/archives/block.json | 3 + packages/block-library/src/audio/block.json | 3 + packages/block-library/src/avatar/block.json | 3 + packages/block-library/src/block/block.json | 5 +- packages/block-library/src/button/block.json | 5 +- packages/block-library/src/buttons/block.json | 3 + .../block-library/src/calendar/block.json | 3 + .../block-library/src/categories/block.json | 3 + packages/block-library/src/code/block.json | 3 + packages/block-library/src/column/block.json | 5 +- packages/block-library/src/columns/block.json | 3 + .../src/comment-author-avatar/block.json | 3 + .../src/comment-author-name/block.json | 3 + .../block-library/src/comment-date/block.json | 3 + .../src/comment-edit-link/block.json | 3 + .../src/comment-template/block.json | 3 + .../src/comments-pagination-next/block.json | 3 + .../comments-pagination-numbers/block.json | 3 + .../comments-pagination-previous/block.json | 3 + .../src/comments-pagination/block.json | 3 + .../src/comments-title/block.json | 3 + packages/block-library/src/cover/block.json | 3 + packages/block-library/src/details/block.json | 3 + packages/block-library/src/embed/block.json | 3 + .../block-library/src/footnotes/block.json | 3 + packages/block-library/src/gallery/block.json | 3 + packages/block-library/src/group/block.json | 3 + packages/block-library/src/heading/block.json | 5 +- .../block-library/src/home-link/block.json | 3 + packages/block-library/src/html/block.json | 5 +- .../src/latest-comments/block.json | 3 + .../block-library/src/latest-posts/block.json | 3 + .../block-library/src/list-item/block.json | 3 + packages/block-library/src/list/block.json | 5 +- .../block-library/src/loginout/block.json | 3 + .../block-library/src/media-text/block.json | 3 + packages/block-library/src/missing/block.json | 5 +- packages/block-library/src/more/block.json | 5 +- .../src/navigation-link/block.json | 5 +- .../src/navigation-submenu/block.json | 5 +- .../block-library/src/nextpage/block.json | 5 +- .../src/page-list-item/block.json | 5 +- .../block-library/src/page-list/block.json | 3 + .../block-library/src/paragraph/block.json | 5 +- packages/block-library/src/pattern/block.json | 5 +- .../src/post-author-biography/block.json | 3 + .../src/post-author-name/block.json | 3 + .../block-library/src/post-author/block.json | 3 + .../block-library/src/post-comment/block.json | 5 +- .../src/post-comments-count/block.json | 3 + .../src/post-comments-link/block.json | 3 + .../block-library/src/post-date/block.json | 3 + .../block-library/src/post-excerpt/block.json | 3 + .../src/post-featured-image/block.json | 3 + .../src/post-navigation-link/block.json | 3 + .../src/post-template/block.json | 3 + .../block-library/src/post-terms/block.json | 3 + .../src/post-time-to-read/block.json | 3 + .../block-library/src/post-title/block.json | 3 + .../block-library/src/preformatted/block.json | 3 + .../block-library/src/pullquote/block.json | 3 + .../src/query-no-results/block.json | 3 + .../src/query-pagination-next/block.json | 3 + .../src/query-pagination-numbers/block.json | 3 + .../src/query-pagination-previous/block.json | 3 + .../src/query-pagination/block.json | 3 + .../block-library/src/query-title/block.json | 3 + packages/block-library/src/query/block.json | 4 +- packages/block-library/src/query/index.php | 26 ++- packages/block-library/src/quote/block.json | 3 + .../block-library/src/read-more/block.json | 3 + packages/block-library/src/rss/block.json | 5 +- .../block-library/src/separator/block.json | 3 + .../block-library/src/site-logo/block.json | 3 + .../block-library/src/site-tagline/block.json | 3 + .../block-library/src/site-title/block.json | 3 + .../block-library/src/social-link/block.json | 5 +- .../block-library/src/social-links/block.json | 3 + packages/block-library/src/spacer/block.json | 3 + .../src/table-of-contents/block.json | 3 + packages/block-library/src/table/block.json | 5 +- .../block-library/src/tag-cloud/block.json | 3 + .../src/template-part/block.json | 5 +- .../src/term-description/block.json | 3 + .../block-library/src/text-columns/block.json | 5 +- packages/block-library/src/verse/block.json | 3 + packages/block-library/src/video/block.json | 3 + packages/interactivity/CHANGELOG.md | 1 + phpunit/blocks/render-query-test.php | 34 ++++ schemas/json/block.json | 25 +++ 92 files changed, 445 insertions(+), 116 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index d1898f7975e51..35cecf6a27e66 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -14,7 +14,7 @@ Display a date archive of your posts. ([Source](https://github.com/WordPress/gut - **Name:** core/archives - **Category:** widgets -- **Supports:** align, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** displayAsDropdown, showLabel, showPostCounts, type ## Audio @@ -23,7 +23,7 @@ Embed a simple audio player. ([Source](https://github.com/WordPress/gutenberg/tr - **Name:** core/audio - **Category:** media -- **Supports:** align, anchor, spacing (margin, padding) +- **Supports:** align, anchor, interactivity (clientNavigation), spacing (margin, padding) - **Attributes:** autoplay, caption, id, loop, preload, src ## Avatar @@ -32,7 +32,7 @@ Add a user’s avatar. ([Source](https://github.com/WordPress/gutenberg/tree/tru - **Name:** core/avatar - **Category:** theme -- **Supports:** align, color (~~background~~, ~~text~~), spacing (margin, padding), ~~alignWide~~, ~~html~~ +- **Supports:** align, color (~~background~~, ~~text~~), interactivity (clientNavigation), spacing (margin, padding), ~~alignWide~~, ~~html~~ - **Attributes:** isLink, linkTarget, size, userId ## Pattern @@ -41,7 +41,7 @@ Reuse this design across your site. ([Source](https://github.com/WordPress/guten - **Name:** core/block - **Category:** reusable -- **Supports:** ~~customClassName~~, ~~html~~, ~~inserter~~, ~~renaming~~ +- **Supports:** interactivity (clientNavigation), ~~customClassName~~, ~~html~~, ~~inserter~~, ~~renaming~~ - **Attributes:** overrides, ref ## Button @@ -51,7 +51,7 @@ Prompt visitors to take action with a button-style link. ([Source](https://githu - **Name:** core/button - **Category:** design - **Parent:** core/buttons -- **Supports:** anchor, color (background, gradients, text), shadow, spacing (padding), typography (fontSize, lineHeight), ~~alignWide~~, ~~align~~, ~~reusable~~ +- **Supports:** anchor, color (background, gradients, text), interactivity (clientNavigation), shadow, spacing (padding), typography (fontSize, lineHeight), ~~alignWide~~, ~~align~~, ~~reusable~~ - **Attributes:** backgroundColor, gradient, linkTarget, placeholder, rel, tagName, text, textAlign, textColor, title, type, url, width ## Buttons @@ -60,7 +60,7 @@ Prompt visitors to take action with a group of button-style links. ([Source](htt - **Name:** core/buttons - **Category:** design -- **Supports:** align (full, wide), anchor, layout (default, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** ## Calendar @@ -69,7 +69,7 @@ A calendar of your site’s posts. ([Source](https://github.com/WordPress/gutenb - **Name:** core/calendar - **Category:** widgets -- **Supports:** align, color (background, link, text), typography (fontSize, lineHeight) +- **Supports:** align, color (background, link, text), interactivity (clientNavigation), typography (fontSize, lineHeight) - **Attributes:** month, year ## Categories List @@ -78,7 +78,7 @@ Display a list of all categories. ([Source](https://github.com/WordPress/gutenbe - **Name:** core/categories - **Category:** widgets -- **Supports:** align, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** displayAsDropdown, showEmpty, showHierarchy, showOnlyTopLevel, showPostCounts ## Code @@ -87,7 +87,7 @@ Display code snippets that respect your spacing and tabs. ([Source](https://gith - **Name:** core/code - **Category:** text -- **Supports:** align (wide), anchor, color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight) +- **Supports:** align (wide), anchor, color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** content ## Column @@ -97,7 +97,7 @@ A single column within a columns block. ([Source](https://github.com/WordPress/g - **Name:** core/column - **Category:** design - **Parent:** core/columns -- **Supports:** anchor, color (background, button, gradients, heading, link, text), layout, spacing (blockGap, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, color (background, button, gradients, heading, link, text), interactivity (clientNavigation), layout, spacing (blockGap, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** allowedBlocks, templateLock, verticalAlignment, width ## Columns @@ -106,7 +106,7 @@ Display content in multiple columns, with blocks added to each column. ([Source] - **Name:** core/columns - **Category:** design -- **Supports:** align (full, wide), anchor, color (background, button, gradients, heading, link, text), layout (default, ~~allowEditing~~, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, color (background, button, gradients, heading, link, text), interactivity (clientNavigation), layout (default, ~~allowEditing~~, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isStackedOnMobile, templateLock, verticalAlignment ## Comment Author Avatar (deprecated) @@ -116,7 +116,7 @@ This block is deprecated. Please use the Avatar block instead. ([Source](https:/ - **Name:** core/comment-author-avatar - **Experimental:** fse - **Category:** theme -- **Supports:** color (background, ~~text~~), spacing (margin, padding), ~~html~~, ~~inserter~~ +- **Supports:** color (background, ~~text~~), interactivity (clientNavigation), spacing (margin, padding), ~~html~~, ~~inserter~~ - **Attributes:** height, width ## Comment Author Name @@ -125,7 +125,7 @@ Displays the name of the author of the comment. ([Source](https://github.com/Wor - **Name:** core/comment-author-name - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, linkTarget, textAlign ## Comment Content @@ -143,7 +143,7 @@ Displays the date on which the comment was posted. ([Source](https://github.com/ - **Name:** core/comment-date - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** format, isLink ## Comment Edit Link @@ -152,7 +152,7 @@ Displays a link to edit the comment in the WordPress Dashboard. This link is onl - **Name:** core/comment-edit-link - **Category:** theme -- **Supports:** color (background, gradients, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, ~~text~~), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** linkTarget, textAlign ## Comment Reply Link @@ -171,7 +171,7 @@ Contains the block elements used to display a comment, like the title, date, aut - **Name:** core/comment-template - **Category:** design - **Parent:** core/comments -- **Supports:** align, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Comments @@ -190,7 +190,7 @@ Displays a paginated navigation to next/previous set of comments, when applicabl - **Name:** core/comments-pagination - **Category:** theme - **Parent:** core/comments -- **Supports:** align, color (background, gradients, link, text), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** paginationArrow ## Comments Next Page @@ -200,7 +200,7 @@ Displays the next comment's page link. ([Source](https://github.com/WordPress/gu - **Name:** core/comments-pagination-next - **Category:** theme - **Parent:** core/comments-pagination -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** color (background, gradients, ~~text~~), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Comments Page Numbers @@ -210,7 +210,7 @@ Displays a list of page numbers for comments pagination. ([Source](https://githu - **Name:** core/comments-pagination-numbers - **Category:** theme - **Parent:** core/comments-pagination -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** color (background, gradients, ~~text~~), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Comments Previous Page @@ -220,7 +220,7 @@ Displays the previous comment's page link. ([Source](https://github.com/WordPres - **Name:** core/comments-pagination-previous - **Category:** theme - **Parent:** core/comments-pagination -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** color (background, gradients, ~~text~~), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Comments Title @@ -229,7 +229,7 @@ Displays a title with the number of comments. ([Source](https://github.com/WordP - **Name:** core/comments-title - **Category:** theme -- **Supports:** align, color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~anchor~~, ~~html~~ +- **Supports:** align, color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~anchor~~, ~~html~~ - **Attributes:** level, showCommentsCount, showPostTitle, textAlign ## Cover @@ -238,7 +238,7 @@ Add an image or video with a text overlay. ([Source](https://github.com/WordPres - **Name:** core/cover - **Category:** media -- **Supports:** align, anchor, color (heading, text, ~~background~~, ~~enableContrastChecker~~), dimensions (aspectRatio), layout (~~allowJustification~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, anchor, color (heading, text, ~~background~~, ~~enableContrastChecker~~), dimensions (aspectRatio), interactivity (clientNavigation), layout (~~allowJustification~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** allowedBlocks, alt, backgroundType, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, gradient, hasParallax, id, isDark, isRepeated, isUserOverlayColor, minHeight, minHeightUnit, overlayColor, tagName, templateLock, url, useFeaturedImage ## Details @@ -247,7 +247,7 @@ Hide and show additional content. ([Source](https://github.com/WordPress/gutenbe - **Name:** core/details - **Category:** text -- **Supports:** align (full, wide), color (background, gradients, link, text), layout (~~allowEditing~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), layout (~~allowEditing~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** showContent, summary ## Embed @@ -256,7 +256,7 @@ Add a block that displays content pulled from other sites, like Twitter or YouTu - **Name:** core/embed - **Category:** embed -- **Supports:** align, spacing (margin) +- **Supports:** align, interactivity (clientNavigation), spacing (margin) - **Attributes:** allowResponsive, caption, previewable, providerNameSlug, responsive, type, url ## File @@ -274,7 +274,7 @@ Display footnotes added to the page. ([Source](https://github.com/WordPress/gute - **Name:** core/footnotes - **Category:** text -- **Supports:** color (background, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~inserter~~, ~~multiple~~, ~~reusable~~ +- **Supports:** color (background, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~inserter~~, ~~multiple~~, ~~reusable~~ - **Attributes:** ## Form @@ -332,7 +332,7 @@ Display multiple images in a rich gallery. ([Source](https://github.com/WordPres - **Name:** core/gallery - **Category:** media -- **Supports:** align, anchor, color (background, gradients, ~~text~~), layout (default, ~~allowEditing~~, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin, padding), units (em, px, rem, vh, vw), ~~html~~ +- **Supports:** align, anchor, color (background, gradients, ~~text~~), interactivity (clientNavigation), layout (default, ~~allowEditing~~, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin, padding), units (em, px, rem, vh, vw), ~~html~~ - **Attributes:** allowResize, caption, columns, fixedHeight, ids, imageCrop, images, linkTarget, linkTo, randomOrder, shortCodeTransforms, sizeSlug ## Group @@ -341,7 +341,7 @@ Gather blocks in a layout container. ([Source](https://github.com/WordPress/gute - **Name:** core/group - **Category:** design -- **Supports:** align (full, wide), anchor, ariaLabel, background (backgroundImage, backgroundSize), color (background, button, gradients, heading, link, text), dimensions (minHeight), layout (allowSizingOnChildren), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, ariaLabel, background (backgroundImage, backgroundSize), color (background, button, gradients, heading, link, text), dimensions (minHeight), interactivity (clientNavigation), layout (allowSizingOnChildren), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** allowedBlocks, tagName, templateLock ## Heading @@ -350,7 +350,7 @@ Introduce new sections and organize content to help visitors (and search engines - **Name:** core/heading - **Category:** text -- **Supports:** __unstablePasteTextInline, align (full, wide), anchor, className, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) +- **Supports:** __unstablePasteTextInline, align (full, wide), anchor, className, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** content, level, placeholder, textAlign ## Home Link @@ -360,7 +360,7 @@ Create a link that always points to the homepage of the site. Usually not necess - **Name:** core/home-link - **Category:** design - **Parent:** core/navigation -- **Supports:** typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Custom HTML @@ -369,7 +369,7 @@ Add custom HTML code and preview it as you edit. ([Source](https://github.com/Wo - **Name:** core/html - **Category:** widgets -- **Supports:** ~~className~~, ~~customClassName~~, ~~html~~ +- **Supports:** interactivity (clientNavigation), ~~className~~, ~~customClassName~~, ~~html~~ - **Attributes:** content ## Image @@ -387,7 +387,7 @@ Display a list of your most recent comments. ([Source](https://github.com/WordPr - **Name:** core/latest-comments - **Category:** widgets -- **Supports:** align, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** commentsToShow, displayAvatar, displayDate, displayExcerpt ## Latest Posts @@ -396,7 +396,7 @@ Display a list of your most recent posts. ([Source](https://github.com/WordPress - **Name:** core/latest-posts - **Category:** widgets -- **Supports:** align, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** addLinkToFeaturedImage, categories, columns, displayAuthor, displayFeaturedImage, displayPostContent, displayPostContentRadio, displayPostDate, excerptLength, featuredImageAlign, featuredImageSizeHeight, featuredImageSizeSlug, featuredImageSizeWidth, order, orderBy, postLayout, postsToShow, selectedAuthor ## List @@ -405,7 +405,7 @@ Create a bulleted or numbered list. ([Source](https://github.com/WordPress/guten - **Name:** core/list - **Category:** text -- **Supports:** __unstablePasteTextInline, anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ +- **Supports:** __unstablePasteTextInline, anchor, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ - **Attributes:** ordered, placeholder, reversed, start, type, values ## List item @@ -415,7 +415,7 @@ Create a list item. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/ - **Name:** core/list-item - **Category:** text - **Parent:** core/list -- **Supports:** spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ +- **Supports:** interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ - **Attributes:** content, placeholder ## Login/out @@ -424,7 +424,7 @@ Show login & logout links. ([Source](https://github.com/WordPress/gutenberg/tree - **Name:** core/loginout - **Category:** theme -- **Supports:** className, spacing (margin, padding), typography (fontSize, lineHeight) +- **Supports:** className, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** displayLoginAsForm, redirectToCurrent ## Media & Text @@ -433,7 +433,7 @@ Set media and words side-by-side for a richer layout. ([Source](https://github.c - **Name:** core/media-text - **Category:** media -- **Supports:** align (full, wide), anchor, color (background, gradients, heading, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, color (background, gradients, heading, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** align, allowedBlocks, focalPoint, href, imageFill, isStackedOnMobile, linkClass, linkDestination, linkTarget, mediaAlt, mediaId, mediaLink, mediaPosition, mediaSizeSlug, mediaType, mediaUrl, mediaWidth, rel, verticalAlignment ## Unsupported @@ -442,7 +442,7 @@ Your site doesn’t include support for this block. ([Source](https://github.com - **Name:** core/missing - **Category:** text -- **Supports:** ~~className~~, ~~customClassName~~, ~~html~~, ~~inserter~~, ~~reusable~~ +- **Supports:** interactivity (clientNavigation), ~~className~~, ~~customClassName~~, ~~html~~, ~~inserter~~, ~~reusable~~ - **Attributes:** originalContent, originalName, originalUndelimitedContent ## More @@ -451,7 +451,7 @@ Content before this block will be shown in the excerpt on your archives page. ([ - **Name:** core/more - **Category:** design -- **Supports:** ~~className~~, ~~customClassName~~, ~~html~~, ~~multiple~~ +- **Supports:** interactivity (clientNavigation), ~~className~~, ~~customClassName~~, ~~html~~, ~~multiple~~ - **Attributes:** customText, noTeaser ## Navigation @@ -470,7 +470,7 @@ Add a page, link, or another item to your navigation. ([Source](https://github.c - **Name:** core/navigation-link - **Category:** design - **Parent:** core/navigation -- **Supports:** typography (fontSize, lineHeight), ~~html~~, ~~renaming~~, ~~reusable~~ +- **Supports:** interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~renaming~~, ~~reusable~~ - **Attributes:** description, id, isTopLevelLink, kind, label, opensInNewTab, rel, title, type, url ## Submenu @@ -480,7 +480,7 @@ Add a submenu to your navigation. ([Source](https://github.com/WordPress/gutenbe - **Name:** core/navigation-submenu - **Category:** design - **Parent:** core/navigation -- **Supports:** ~~html~~, ~~reusable~~ +- **Supports:** interactivity (clientNavigation), ~~html~~, ~~reusable~~ - **Attributes:** description, id, isTopLevelItem, kind, label, opensInNewTab, rel, title, type, url ## Page Break @@ -490,7 +490,7 @@ Separate your content into a multi-page experience. ([Source](https://github.com - **Name:** core/nextpage - **Category:** design - **Parent:** core/post-content -- **Supports:** ~~className~~, ~~customClassName~~, ~~html~~ +- **Supports:** interactivity (clientNavigation), ~~className~~, ~~customClassName~~, ~~html~~ - **Attributes:** ## Page List @@ -499,7 +499,7 @@ Display a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tr - **Name:** core/page-list - **Category:** widgets -- **Supports:** typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** isNested, parentPageID ## Page List Item @@ -509,7 +509,7 @@ Displays a page inside a list of all pages. ([Source](https://github.com/WordPre - **Name:** core/page-list-item - **Category:** widgets - **Parent:** core/page-list -- **Supports:** ~~html~~, ~~inserter~~, ~~lock~~, ~~reusable~~ +- **Supports:** interactivity (clientNavigation), ~~html~~, ~~inserter~~, ~~lock~~, ~~reusable~~ - **Attributes:** hasChildren, id, label, link, title ## Paragraph @@ -518,7 +518,7 @@ Start with the basic building block of all narrative. ([Source](https://github.c - **Name:** core/paragraph - **Category:** text -- **Supports:** __unstablePasteTextInline, anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ +- **Supports:** __unstablePasteTextInline, anchor, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ - **Attributes:** align, content, direction, dropCap, placeholder ## Pattern placeholder @@ -527,7 +527,7 @@ Show a block pattern. ([Source](https://github.com/WordPress/gutenberg/tree/trun - **Name:** core/pattern - **Category:** theme -- **Supports:** ~~html~~, ~~inserter~~, ~~renaming~~ +- **Supports:** interactivity (clientNavigation), ~~html~~, ~~inserter~~, ~~renaming~~ - **Attributes:** slug ## Author @@ -536,7 +536,7 @@ Display post author details such as name, avatar, and bio. ([Source](https://git - **Name:** core/post-author - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** avatarSize, byline, isLink, linkTarget, showAvatar, showBio, textAlign ## Author Biography @@ -545,7 +545,7 @@ The author biography. ([Source](https://github.com/WordPress/gutenberg/tree/trun - **Name:** core/post-author-biography - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** textAlign ## Author Name @@ -554,7 +554,7 @@ The author name. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/pac - **Name:** core/post-author-name - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, linkTarget, textAlign ## Comment (deprecated) @@ -564,7 +564,7 @@ This block is deprecated. Please use the Comments block instead. ([Source](https - **Name:** core/post-comment - **Experimental:** fse - **Category:** theme -- **Supports:** ~~html~~, ~~inserter~~ +- **Supports:** interactivity (clientNavigation), ~~html~~, ~~inserter~~ - **Attributes:** commentId ## Comments Count @@ -574,7 +574,7 @@ Display a post's comments count. ([Source](https://github.com/WordPress/gutenber - **Name:** core/post-comments-count - **Experimental:** fse - **Category:** theme -- **Supports:** color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Comments Form @@ -593,7 +593,7 @@ Displays the link to the current post comments. ([Source](https://github.com/Wor - **Name:** core/post-comments-link - **Experimental:** fse - **Category:** theme -- **Supports:** color (background, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, link, ~~text~~), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Content @@ -611,7 +611,7 @@ Display the publish date for an entry such as a post or page. ([Source](https:// - **Name:** core/post-date - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** displayType, format, isLink, textAlign ## Excerpt @@ -620,7 +620,7 @@ Display the excerpt. ([Source](https://github.com/WordPress/gutenberg/tree/trunk - **Name:** core/post-excerpt - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** excerptLength, moreText, showMoreOnNewLine, textAlign ## Featured Image @@ -629,7 +629,7 @@ Display a post's featured image. ([Source](https://github.com/WordPress/gutenber - **Name:** core/post-featured-image - **Category:** theme -- **Supports:** align (center, full, left, right, wide), color (~~background~~, ~~text~~), spacing (margin, padding), ~~html~~ +- **Supports:** align (center, full, left, right, wide), color (~~background~~, ~~text~~), interactivity (clientNavigation), spacing (margin, padding), ~~html~~ - **Attributes:** aspectRatio, customGradient, customOverlayColor, dimRatio, gradient, height, isLink, linkTarget, overlayColor, rel, scale, sizeSlug, useFirstImageFromPost, width ## Post Navigation Link @@ -638,7 +638,7 @@ Displays the next or previous post link that is adjacent to the current post. ([ - **Name:** core/post-navigation-link - **Category:** theme -- **Supports:** color (background, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** color (background, link, text), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** arrow, label, linkLabel, showTitle, taxonomy, textAlign, type ## Post Template @@ -648,7 +648,7 @@ Contains the block elements used to render a post, like the title, date, feature - **Name:** core/post-template - **Category:** theme - **Parent:** core/query -- **Supports:** align (full, wide), color (background, gradients, link, text), layout, spacing (blockGap), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), layout, spacing (blockGap), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Post Terms @@ -657,7 +657,7 @@ Post terms. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages - **Name:** core/post-terms - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** prefix, separator, suffix, term, textAlign ## Time To Read @@ -667,7 +667,7 @@ Show minutes required to finish reading the post. ([Source](https://github.com/W - **Name:** core/post-time-to-read - **Experimental:** true - **Category:** theme -- **Supports:** color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Title @@ -676,7 +676,7 @@ Displays the title of a post, page, or any other content-type. ([Source](https:/ - **Name:** core/post-title - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, level, linkTarget, rel, textAlign ## Preformatted @@ -685,7 +685,7 @@ Add text that respects your spacing and tabs, and also allows styling. ([Source] - **Name:** core/preformatted - **Category:** text -- **Supports:** anchor, color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight) +- **Supports:** anchor, color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** content ## Pullquote @@ -694,7 +694,7 @@ Give special visual emphasis to a quote from your text. ([Source](https://github - **Name:** core/pullquote - **Category:** text -- **Supports:** align (full, left, right, wide), anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) +- **Supports:** align (full, left, right, wide), anchor, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** citation, textAlign, value ## Query Loop @@ -713,7 +713,7 @@ Contains the block elements used to render content when no query results are fou - **Name:** core/query-no-results - **Category:** theme - **Parent:** core/query -- **Supports:** align, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Pagination @@ -722,7 +722,7 @@ Displays a paginated navigation to next/previous set of posts, when applicable. - **Name:** core/query-pagination - **Category:** theme -- **Supports:** align, color (background, gradients, link, text), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** paginationArrow, showLabel ## Next Page @@ -732,7 +732,7 @@ Displays the next posts page link. ([Source](https://github.com/WordPress/gutenb - **Name:** core/query-pagination-next - **Category:** theme - **Parent:** core/query-pagination -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** color (background, gradients, ~~text~~), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Page Numbers @@ -742,7 +742,7 @@ Displays a list of page numbers for pagination. ([Source](https://github.com/Wor - **Name:** core/query-pagination-numbers - **Category:** theme - **Parent:** core/query-pagination -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** color (background, gradients, ~~text~~), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** midSize ## Previous Page @@ -752,7 +752,7 @@ Displays the previous posts page link. ([Source](https://github.com/WordPress/gu - **Name:** core/query-pagination-previous - **Category:** theme - **Parent:** core/query-pagination -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** color (background, gradients, ~~text~~), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Query Title @@ -761,7 +761,7 @@ Display the query title. ([Source](https://github.com/WordPress/gutenberg/tree/t - **Name:** core/query-title - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** level, showPrefix, showSearchTerm, textAlign, type ## Quote @@ -770,7 +770,7 @@ Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Ju - **Name:** core/quote - **Category:** text -- **Supports:** anchor, color (background, gradients, heading, link, text), layout (~~allowEditing~~), spacing (blockGap), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, heading, link, text), interactivity (clientNavigation), layout (~~allowEditing~~), spacing (blockGap), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** align, citation, value ## Read More @@ -779,7 +779,7 @@ Displays the link of a post, page, or any other content-type. ([Source](https:// - **Name:** core/read-more - **Category:** theme -- **Supports:** color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** content, linkTarget ## RSS @@ -788,7 +788,7 @@ Display entries from any RSS or Atom feed. ([Source](https://github.com/WordPres - **Name:** core/rss - **Category:** widgets -- **Supports:** align, ~~html~~ +- **Supports:** align, interactivity (clientNavigation), ~~html~~ - **Attributes:** blockLayout, columns, displayAuthor, displayDate, displayExcerpt, excerptLength, feedURL, itemsToShow ## Search @@ -806,7 +806,7 @@ Create a break between ideas or sections with a horizontal separator. ([Source]( - **Name:** core/separator - **Category:** design -- **Supports:** align (center, full, wide), anchor, color (background, gradients, ~~enableContrastChecker~~, ~~text~~), spacing (margin) +- **Supports:** align (center, full, wide), anchor, color (background, gradients, ~~enableContrastChecker~~, ~~text~~), interactivity (clientNavigation), spacing (margin) - **Attributes:** opacity ## Shortcode @@ -824,7 +824,7 @@ Display an image to represent this site. Update this block and the changes apply - **Name:** core/site-logo - **Category:** theme -- **Supports:** align, color (~~background~~, ~~text~~), spacing (margin, padding), ~~alignWide~~, ~~html~~ +- **Supports:** align, color (~~background~~, ~~text~~), interactivity (clientNavigation), spacing (margin, padding), ~~alignWide~~, ~~html~~ - **Attributes:** isLink, linkTarget, shouldSyncIcon, width ## Site Tagline @@ -833,7 +833,7 @@ Describe in a few words what the site is about. The tagline can be used in searc - **Name:** core/site-tagline - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Site Title @@ -842,7 +842,7 @@ Displays the name of this site. Update the block, and the changes apply everywhe - **Name:** core/site-title - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, level, linkTarget, textAlign ## Social Icon @@ -852,7 +852,7 @@ Display an icon linking to a social media profile or site. ([Source](https://git - **Name:** core/social-link - **Category:** widgets - **Parent:** core/social-links -- **Supports:** ~~html~~, ~~reusable~~ +- **Supports:** interactivity (clientNavigation), ~~html~~, ~~reusable~~ - **Attributes:** label, rel, service, url ## Social Icons @@ -861,7 +861,7 @@ Display icons linking to your social media profiles or sites. ([Source](https:// - **Name:** core/social-links - **Category:** widgets -- **Supports:** align (center, left, right), anchor, color (background, gradients, ~~enableContrastChecker~~, ~~text~~), layout (default, ~~allowInheriting~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~), spacing (blockGap, margin, padding, units) +- **Supports:** align (center, left, right), anchor, color (background, gradients, ~~enableContrastChecker~~, ~~text~~), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~), spacing (blockGap, margin, padding, units) - **Attributes:** customIconBackgroundColor, customIconColor, iconBackgroundColor, iconBackgroundColorValue, iconColor, iconColorValue, openInNewTab, showLabels, size ## Spacer @@ -870,7 +870,7 @@ Add white space between blocks and customize its height. ([Source](https://githu - **Name:** core/spacer - **Category:** design -- **Supports:** anchor, spacing (margin) +- **Supports:** anchor, interactivity (clientNavigation), spacing (margin) - **Attributes:** height, width ## Table @@ -879,7 +879,7 @@ Create structured content in rows and columns to display information. ([Source]( - **Name:** core/table - **Category:** text -- **Supports:** align, anchor, color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight) +- **Supports:** align, anchor, color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** body, caption, foot, hasFixedLayout, head ## Table of Contents @@ -889,7 +889,7 @@ Summarize your post with a list of headings. Add HTML anchors to Heading blocks - **Name:** core/table-of-contents - **Experimental:** true - **Category:** layout -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** headings, onlyIncludeCurrentPage ## Tag Cloud @@ -898,7 +898,7 @@ A cloud of your most used tags. ([Source](https://github.com/WordPress/gutenberg - **Name:** core/tag-cloud - **Category:** widgets -- **Supports:** align, spacing (margin, padding), typography (lineHeight), ~~html~~ +- **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (lineHeight), ~~html~~ - **Attributes:** largestFontSize, numberOfTags, showTagCounts, smallestFontSize, taxonomy ## Template Part @@ -907,7 +907,7 @@ Edit the different global regions of your site, like the header, footer, sidebar - **Name:** core/template-part - **Category:** theme -- **Supports:** align, ~~html~~, ~~renaming~~, ~~reusable~~ +- **Supports:** align, interactivity (clientNavigation), ~~html~~, ~~renaming~~, ~~reusable~~ - **Attributes:** area, slug, tagName, theme ## Term Description @@ -916,7 +916,7 @@ Display the description of categories, tags and custom taxonomies when viewing a - **Name:** core/term-description - **Category:** theme -- **Supports:** align (full, wide), color (background, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Text Columns (deprecated) @@ -925,7 +925,7 @@ This block is deprecated. Please use the Columns block instead. ([Source](https: - **Name:** core/text-columns - **Category:** design -- **Supports:** ~~inserter~~ +- **Supports:** interactivity (clientNavigation), ~~inserter~~ - **Attributes:** columns, content, width ## Verse @@ -934,7 +934,7 @@ Insert poetry. Use special spacing formats. Or quote song lyrics. ([Source](http - **Name:** core/verse - **Category:** text -- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) +- **Supports:** anchor, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** content, textAlign ## Video @@ -943,7 +943,7 @@ Embed a video from your media library or upload a new one. ([Source](https://git - **Name:** core/video - **Category:** media -- **Supports:** align, anchor, spacing (margin, padding) +- **Supports:** align, anchor, interactivity (clientNavigation), spacing (margin, padding) - **Attributes:** autoplay, caption, controls, id, loop, muted, playsInline, poster, preload, src, tracks diff --git a/lib/compat/wordpress-6.5/interactivity-api/interactivity-api.php b/lib/compat/wordpress-6.5/interactivity-api/interactivity-api.php index cd7ca7fb90287..32900a78f6d69 100644 --- a/lib/compat/wordpress-6.5/interactivity-api/interactivity-api.php +++ b/lib/compat/wordpress-6.5/interactivity-api/interactivity-api.php @@ -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 ) ) ); diff --git a/packages/block-library/src/archives/block.json b/packages/block-library/src/archives/block.json index 7e0f5181d2c3d..e36691f3143c2 100644 --- a/packages/block-library/src/archives/block.json +++ b/packages/block-library/src/archives/block.json @@ -47,6 +47,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-archives-editor" diff --git a/packages/block-library/src/audio/block.json b/packages/block-library/src/audio/block.json index 04df268a74a63..14b44704fb7e8 100644 --- a/packages/block-library/src/audio/block.json +++ b/packages/block-library/src/audio/block.json @@ -54,6 +54,9 @@ "margin": false, "padding": false } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-audio-editor", diff --git a/packages/block-library/src/avatar/block.json b/packages/block-library/src/avatar/block.json index fa86541b2963f..f949e60e0ace1 100644 --- a/packages/block-library/src/avatar/block.json +++ b/packages/block-library/src/avatar/block.json @@ -50,6 +50,9 @@ "text": false, "background": false, "__experimentalDuotone": "img" + }, + "interactivity": { + "clientNavigation": true } }, "selectors": { diff --git a/packages/block-library/src/block/block.json b/packages/block-library/src/block/block.json index 7eac2b705ba1f..0e5565233ef3c 100644 --- a/packages/block-library/src/block/block.json +++ b/packages/block-library/src/block/block.json @@ -19,6 +19,9 @@ "customClassName": false, "html": false, "inserter": false, - "renaming": false + "renaming": false, + "interactivity": { + "clientNavigation": true + } } } diff --git a/packages/block-library/src/button/block.json b/packages/block-library/src/button/block.json index f04d4642bb98e..aa5d81c65bad3 100644 --- a/packages/block-library/src/button/block.json +++ b/packages/block-library/src/button/block.json @@ -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 }, diff --git a/packages/block-library/src/buttons/block.json b/packages/block-library/src/buttons/block.json index fde85ae72a316..015290a4c7cc5 100644 --- a/packages/block-library/src/buttons/block.json +++ b/packages/block-library/src/buttons/block.json @@ -39,6 +39,9 @@ "default": { "type": "flex" } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-buttons-editor", diff --git a/packages/block-library/src/calendar/block.json b/packages/block-library/src/calendar/block.json index 974d47ff8ec2c..6ba8f7d725e6e 100644 --- a/packages/block-library/src/calendar/block.json +++ b/packages/block-library/src/calendar/block.json @@ -37,6 +37,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-calendar" diff --git a/packages/block-library/src/categories/block.json b/packages/block-library/src/categories/block.json index 5014da8298049..820ac8945f50f 100644 --- a/packages/block-library/src/categories/block.json +++ b/packages/block-library/src/categories/block.json @@ -51,6 +51,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-categories-editor", diff --git a/packages/block-library/src/code/block.json b/packages/block-library/src/code/block.json index bd5db3c918b96..4465c8554fc12 100644 --- a/packages/block-library/src/code/block.json +++ b/packages/block-library/src/code/block.json @@ -56,6 +56,9 @@ "background": true, "text": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-code" diff --git a/packages/block-library/src/column/block.json b/packages/block-library/src/column/block.json index 7f61f307fab15..40444d04b93e7 100644 --- a/packages/block-library/src/column/block.json +++ b/packages/block-library/src/column/block.json @@ -68,6 +68,9 @@ "fontSize": true } }, - "layout": true + "layout": true, + "interactivity": { + "clientNavigation": true + } } } diff --git a/packages/block-library/src/columns/block.json b/packages/block-library/src/columns/block.json index a35e6a5e28489..22db5b1b4ac23 100644 --- a/packages/block-library/src/columns/block.json +++ b/packages/block-library/src/columns/block.json @@ -79,6 +79,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-columns-editor", diff --git a/packages/block-library/src/comment-author-avatar/block.json b/packages/block-library/src/comment-author-avatar/block.json index 050d87c3b4634..c74b057db2ea3 100644 --- a/packages/block-library/src/comment-author-avatar/block.json +++ b/packages/block-library/src/comment-author-avatar/block.json @@ -39,6 +39,9 @@ "__experimentalSkipSerialization": true, "margin": true, "padding": true + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/comment-author-name/block.json b/packages/block-library/src/comment-author-name/block.json index 93350779fc8bd..f3422faf0264d 100644 --- a/packages/block-library/src/comment-author-name/block.json +++ b/packages/block-library/src/comment-author-name/block.json @@ -48,6 +48,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/comment-date/block.json b/packages/block-library/src/comment-date/block.json index 7e4776c68ff2f..ddc0281e6c668 100644 --- a/packages/block-library/src/comment-date/block.json +++ b/packages/block-library/src/comment-date/block.json @@ -44,6 +44,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/comment-edit-link/block.json b/packages/block-library/src/comment-edit-link/block.json index 505305f60987a..a49f9a23161b8 100644 --- a/packages/block-library/src/comment-edit-link/block.json +++ b/packages/block-library/src/comment-edit-link/block.json @@ -44,6 +44,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/comment-template/block.json b/packages/block-library/src/comment-template/block.json index 7b9bfc5e0340f..70238c45a3d92 100644 --- a/packages/block-library/src/comment-template/block.json +++ b/packages/block-library/src/comment-template/block.json @@ -28,6 +28,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-comment-template" diff --git a/packages/block-library/src/comments-pagination-next/block.json b/packages/block-library/src/comments-pagination-next/block.json index d619865ebd6f5..22e20bfa8dbf2 100644 --- a/packages/block-library/src/comments-pagination-next/block.json +++ b/packages/block-library/src/comments-pagination-next/block.json @@ -35,6 +35,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/comments-pagination-numbers/block.json b/packages/block-library/src/comments-pagination-numbers/block.json index fcebb52763870..9e9017af63197 100644 --- a/packages/block-library/src/comments-pagination-numbers/block.json +++ b/packages/block-library/src/comments-pagination-numbers/block.json @@ -30,6 +30,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/comments-pagination-previous/block.json b/packages/block-library/src/comments-pagination-previous/block.json index 2dab1e9dd7367..0871b000c569d 100644 --- a/packages/block-library/src/comments-pagination-previous/block.json +++ b/packages/block-library/src/comments-pagination-previous/block.json @@ -35,6 +35,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/comments-pagination/block.json b/packages/block-library/src/comments-pagination/block.json index e4a1a3c3a15d9..28f6c9fdfdb5d 100644 --- a/packages/block-library/src/comments-pagination/block.json +++ b/packages/block-library/src/comments-pagination/block.json @@ -53,6 +53,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-comments-pagination-editor", diff --git a/packages/block-library/src/comments-title/block.json b/packages/block-library/src/comments-title/block.json index 4107f5d590cde..f8a02f2e5089b 100644 --- a/packages/block-library/src/comments-title/block.json +++ b/packages/block-library/src/comments-title/block.json @@ -61,6 +61,9 @@ "__experimentalFontStyle": true, "__experimentalFontWeight": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/cover/block.json b/packages/block-library/src/cover/block.json index 80562da309899..eb55a8dbabec1 100644 --- a/packages/block-library/src/cover/block.json +++ b/packages/block-library/src/cover/block.json @@ -132,6 +132,9 @@ }, "layout": { "allowJustification": false + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-cover-editor", diff --git a/packages/block-library/src/details/block.json b/packages/block-library/src/details/block.json index a71d3af2a5ed3..868307d6d22a1 100644 --- a/packages/block-library/src/details/block.json +++ b/packages/block-library/src/details/block.json @@ -58,6 +58,9 @@ }, "layout": { "allowEditing": false + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-details-editor", diff --git a/packages/block-library/src/embed/block.json b/packages/block-library/src/embed/block.json index 5aac8bbd6b8ca..a42aafbab4b0b 100644 --- a/packages/block-library/src/embed/block.json +++ b/packages/block-library/src/embed/block.json @@ -44,6 +44,9 @@ "align": true, "spacing": { "margin": true + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-embed-editor", diff --git a/packages/block-library/src/footnotes/block.json b/packages/block-library/src/footnotes/block.json index 3192df7796978..1fe74abb471ee 100644 --- a/packages/block-library/src/footnotes/block.json +++ b/packages/block-library/src/footnotes/block.json @@ -55,6 +55,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-footnotes" diff --git a/packages/block-library/src/gallery/block.json b/packages/block-library/src/gallery/block.json index bfeeb792a7fa0..e9018704bf6bf 100644 --- a/packages/block-library/src/gallery/block.json +++ b/packages/block-library/src/gallery/block.json @@ -137,6 +137,9 @@ "default": { "type": "flex" } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-gallery-editor", diff --git a/packages/block-library/src/group/block.json b/packages/block-library/src/group/block.json index df59c25a7751f..db7d09c55d2c0 100644 --- a/packages/block-library/src/group/block.json +++ b/packages/block-library/src/group/block.json @@ -87,6 +87,9 @@ }, "layout": { "allowSizingOnChildren": true + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-group-editor", diff --git a/packages/block-library/src/heading/block.json b/packages/block-library/src/heading/block.json index a1eb3fce32ef1..90ef0d383af2c 100644 --- a/packages/block-library/src/heading/block.json +++ b/packages/block-library/src/heading/block.json @@ -61,7 +61,10 @@ } }, "__unstablePasteTextInline": true, - "__experimentalSlashInserter": true + "__experimentalSlashInserter": true, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-heading-editor", "style": "wp-block-heading" diff --git a/packages/block-library/src/home-link/block.json b/packages/block-library/src/home-link/block.json index a9827b7718b9b..b19fcf43ce688 100644 --- a/packages/block-library/src/home-link/block.json +++ b/packages/block-library/src/home-link/block.json @@ -36,6 +36,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-home-link-editor", diff --git a/packages/block-library/src/html/block.json b/packages/block-library/src/html/block.json index b1a2ad60625d1..08587f69bbd46 100644 --- a/packages/block-library/src/html/block.json +++ b/packages/block-library/src/html/block.json @@ -16,7 +16,10 @@ "supports": { "customClassName": false, "className": false, - "html": false + "html": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-html-editor" } diff --git a/packages/block-library/src/latest-comments/block.json b/packages/block-library/src/latest-comments/block.json index 0b213e9b7903a..aee42f1d15b48 100644 --- a/packages/block-library/src/latest-comments/block.json +++ b/packages/block-library/src/latest-comments/block.json @@ -46,6 +46,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-latest-comments-editor", diff --git a/packages/block-library/src/latest-posts/block.json b/packages/block-library/src/latest-posts/block.json index f36164614dd50..bb8c2d24962f3 100644 --- a/packages/block-library/src/latest-posts/block.json +++ b/packages/block-library/src/latest-posts/block.json @@ -110,6 +110,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-latest-posts-editor", diff --git a/packages/block-library/src/list-item/block.json b/packages/block-library/src/list-item/block.json index 0857aaac45d9a..61c6eec4bb26f 100644 --- a/packages/block-library/src/list-item/block.json +++ b/packages/block-library/src/list-item/block.json @@ -42,6 +42,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/list/block.json b/packages/block-library/src/list/block.json index a7dcf36cf4ad7..7d2de9567cc54 100644 --- a/packages/block-library/src/list/block.json +++ b/packages/block-library/src/list/block.json @@ -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" diff --git a/packages/block-library/src/loginout/block.json b/packages/block-library/src/loginout/block.json index 59fceec596e37..8663300343253 100644 --- a/packages/block-library/src/loginout/block.json +++ b/packages/block-library/src/loginout/block.json @@ -39,6 +39,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/media-text/block.json b/packages/block-library/src/media-text/block.json index cdeb4ce13e8f5..e320101bbd847 100644 --- a/packages/block-library/src/media-text/block.json +++ b/packages/block-library/src/media-text/block.json @@ -123,6 +123,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-media-text-editor", diff --git a/packages/block-library/src/missing/block.json b/packages/block-library/src/missing/block.json index 242a1d2c6b21a..f9b3efe594753 100644 --- a/packages/block-library/src/missing/block.json +++ b/packages/block-library/src/missing/block.json @@ -23,6 +23,9 @@ "customClassName": false, "inserter": false, "html": false, - "reusable": false + "reusable": false, + "interactivity": { + "clientNavigation": true + } } } diff --git a/packages/block-library/src/more/block.json b/packages/block-library/src/more/block.json index bfd95652ea176..b071f6ba5d7ef 100644 --- a/packages/block-library/src/more/block.json +++ b/packages/block-library/src/more/block.json @@ -20,7 +20,10 @@ "customClassName": false, "className": false, "html": false, - "multiple": false + "multiple": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-more-editor" } diff --git a/packages/block-library/src/navigation-link/block.json b/packages/block-library/src/navigation-link/block.json index 94a11217d5139..2762bd24e446a 100644 --- a/packages/block-library/src/navigation-link/block.json +++ b/packages/block-library/src/navigation-link/block.json @@ -77,7 +77,10 @@ "fontSize": true } }, - "renaming": false + "renaming": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-navigation-link-editor", "style": "wp-block-navigation-link" diff --git a/packages/block-library/src/navigation-submenu/block.json b/packages/block-library/src/navigation-submenu/block.json index 91364109ea740..0bcf8a1a47f38 100644 --- a/packages/block-library/src/navigation-submenu/block.json +++ b/packages/block-library/src/navigation-submenu/block.json @@ -58,7 +58,10 @@ ], "supports": { "reusable": false, - "html": false + "html": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-navigation-submenu-editor", "style": "wp-block-navigation-submenu" diff --git a/packages/block-library/src/nextpage/block.json b/packages/block-library/src/nextpage/block.json index ab88d4a7be4f0..3dd1a24d36e59 100644 --- a/packages/block-library/src/nextpage/block.json +++ b/packages/block-library/src/nextpage/block.json @@ -11,7 +11,10 @@ "supports": { "customClassName": false, "className": false, - "html": false + "html": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-nextpage-editor" } diff --git a/packages/block-library/src/page-list-item/block.json b/packages/block-library/src/page-list-item/block.json index abd86924949ab..7890771f63921 100644 --- a/packages/block-library/src/page-list-item/block.json +++ b/packages/block-library/src/page-list-item/block.json @@ -45,7 +45,10 @@ "html": false, "lock": false, "inserter": false, - "__experimentalToolbar": false + "__experimentalToolbar": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-page-list-editor", "style": "wp-block-page-list" diff --git a/packages/block-library/src/page-list/block.json b/packages/block-library/src/page-list/block.json index 5035d5611e32e..b465e4ef5dc3d 100644 --- a/packages/block-library/src/page-list/block.json +++ b/packages/block-library/src/page-list/block.json @@ -48,6 +48,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-page-list-editor", diff --git a/packages/block-library/src/paragraph/block.json b/packages/block-library/src/paragraph/block.json index 25a9a36fa8bf0..2f23d41cd0372 100644 --- a/packages/block-library/src/paragraph/block.json +++ b/packages/block-library/src/paragraph/block.json @@ -64,7 +64,10 @@ } }, "__experimentalSelector": "p", - "__unstablePasteTextInline": true + "__unstablePasteTextInline": true, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-paragraph-editor", "style": "wp-block-paragraph" diff --git a/packages/block-library/src/pattern/block.json b/packages/block-library/src/pattern/block.json index da02f7b72747e..13fc9d154b15a 100644 --- a/packages/block-library/src/pattern/block.json +++ b/packages/block-library/src/pattern/block.json @@ -8,7 +8,10 @@ "supports": { "html": false, "inserter": false, - "renaming": false + "renaming": false, + "interactivity": { + "clientNavigation": true + } }, "textdomain": "default", "attributes": { diff --git a/packages/block-library/src/post-author-biography/block.json b/packages/block-library/src/post-author-biography/block.json index 5d7a4d4585747..8e0ff61c29dfc 100644 --- a/packages/block-library/src/post-author-biography/block.json +++ b/packages/block-library/src/post-author-biography/block.json @@ -37,6 +37,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/post-author-name/block.json b/packages/block-library/src/post-author-name/block.json index 89e4b38de2c28..7889fed37b9d3 100644 --- a/packages/block-library/src/post-author-name/block.json +++ b/packages/block-library/src/post-author-name/block.json @@ -47,6 +47,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/post-author/block.json b/packages/block-library/src/post-author/block.json index 47dceef55604f..6f814810744c6 100644 --- a/packages/block-library/src/post-author/block.json +++ b/packages/block-library/src/post-author/block.json @@ -61,6 +61,9 @@ "background": true, "text": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-post-author" diff --git a/packages/block-library/src/post-comment/block.json b/packages/block-library/src/post-comment/block.json index 558f0e3496eff..071ef550deb9b 100644 --- a/packages/block-library/src/post-comment/block.json +++ b/packages/block-library/src/post-comment/block.json @@ -25,6 +25,9 @@ }, "supports": { "html": false, - "inserter": false + "inserter": false, + "interactivity": { + "clientNavigation": true + } } } diff --git a/packages/block-library/src/post-comments-count/block.json b/packages/block-library/src/post-comments-count/block.json index 43c1aaf713776..796e6e3830236 100644 --- a/packages/block-library/src/post-comments-count/block.json +++ b/packages/block-library/src/post-comments-count/block.json @@ -38,6 +38,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/post-comments-link/block.json b/packages/block-library/src/post-comments-link/block.json index 74e268c3c20b1..67831b1d15c5d 100644 --- a/packages/block-library/src/post-comments-link/block.json +++ b/packages/block-library/src/post-comments-link/block.json @@ -39,6 +39,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/post-date/block.json b/packages/block-library/src/post-date/block.json index 11ebc32d9cabe..176e5b6b0ee61 100644 --- a/packages/block-library/src/post-date/block.json +++ b/packages/block-library/src/post-date/block.json @@ -50,6 +50,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/post-excerpt/block.json b/packages/block-library/src/post-excerpt/block.json index 33b7818ebed9f..4bbc962c9838e 100644 --- a/packages/block-library/src/post-excerpt/block.json +++ b/packages/block-library/src/post-excerpt/block.json @@ -50,6 +50,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-post-excerpt-editor", diff --git a/packages/block-library/src/post-featured-image/block.json b/packages/block-library/src/post-featured-image/block.json index 4c4ba6919eaff..75f5bec3ff451 100644 --- a/packages/block-library/src/post-featured-image/block.json +++ b/packages/block-library/src/post-featured-image/block.json @@ -81,6 +81,9 @@ "spacing": { "margin": true, "padding": true + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-post-featured-image-editor", diff --git a/packages/block-library/src/post-navigation-link/block.json b/packages/block-library/src/post-navigation-link/block.json index cdfecf6c627ca..ce733759846fe 100644 --- a/packages/block-library/src/post-navigation-link/block.json +++ b/packages/block-library/src/post-navigation-link/block.json @@ -54,6 +54,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-post-navigation-link" diff --git a/packages/block-library/src/post-template/block.json b/packages/block-library/src/post-template/block.json index d2f7c09693121..6a57585558352 100644 --- a/packages/block-library/src/post-template/block.json +++ b/packages/block-library/src/post-template/block.json @@ -48,6 +48,9 @@ "__experimentalDefaultControls": { "blockGap": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-post-template", diff --git a/packages/block-library/src/post-terms/block.json b/packages/block-library/src/post-terms/block.json index 0da7fb02f8134..538768fd7e511 100644 --- a/packages/block-library/src/post-terms/block.json +++ b/packages/block-library/src/post-terms/block.json @@ -54,6 +54,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-post-terms" diff --git a/packages/block-library/src/post-time-to-read/block.json b/packages/block-library/src/post-time-to-read/block.json index 281e9bb1f1b21..d19c6e553046c 100644 --- a/packages/block-library/src/post-time-to-read/block.json +++ b/packages/block-library/src/post-time-to-read/block.json @@ -42,6 +42,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/post-title/block.json b/packages/block-library/src/post-title/block.json index 75a4fa3c3a60f..b56adecce52b1 100644 --- a/packages/block-library/src/post-title/block.json +++ b/packages/block-library/src/post-title/block.json @@ -57,6 +57,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-post-title" diff --git a/packages/block-library/src/preformatted/block.json b/packages/block-library/src/preformatted/block.json index def870e7ad2fb..fbec3581bc9d4 100644 --- a/packages/block-library/src/preformatted/block.json +++ b/packages/block-library/src/preformatted/block.json @@ -40,6 +40,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-preformatted" diff --git a/packages/block-library/src/pullquote/block.json b/packages/block-library/src/pullquote/block.json index f041d46cda8cd..410b477dd9939 100644 --- a/packages/block-library/src/pullquote/block.json +++ b/packages/block-library/src/pullquote/block.json @@ -69,6 +69,9 @@ "fontSize": "1.5em", "lineHeight": "1.6" } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-pullquote-editor", diff --git a/packages/block-library/src/query-no-results/block.json b/packages/block-library/src/query-no-results/block.json index 32088752bb060..8f3ba56adcc36 100644 --- a/packages/block-library/src/query-no-results/block.json +++ b/packages/block-library/src/query-no-results/block.json @@ -28,6 +28,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/query-pagination-next/block.json b/packages/block-library/src/query-pagination-next/block.json index 95b1169dc992f..ec56125ee3b76 100644 --- a/packages/block-library/src/query-pagination-next/block.json +++ b/packages/block-library/src/query-pagination-next/block.json @@ -41,6 +41,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/query-pagination-numbers/block.json b/packages/block-library/src/query-pagination-numbers/block.json index f22d88115d68c..8a9f0ee69f14e 100644 --- a/packages/block-library/src/query-pagination-numbers/block.json +++ b/packages/block-library/src/query-pagination-numbers/block.json @@ -36,6 +36,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-query-pagination-numbers-editor" diff --git a/packages/block-library/src/query-pagination-previous/block.json b/packages/block-library/src/query-pagination-previous/block.json index fbaac543c1da3..d1e34c8630250 100644 --- a/packages/block-library/src/query-pagination-previous/block.json +++ b/packages/block-library/src/query-pagination-previous/block.json @@ -41,6 +41,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/query-pagination/block.json b/packages/block-library/src/query-pagination/block.json index 14859628e40c6..355b188e442d8 100644 --- a/packages/block-library/src/query-pagination/block.json +++ b/packages/block-library/src/query-pagination/block.json @@ -59,6 +59,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-query-pagination-editor", diff --git a/packages/block-library/src/query-title/block.json b/packages/block-library/src/query-title/block.json index 65eb03d310c12..674daadee3bb6 100644 --- a/packages/block-library/src/query-title/block.json +++ b/packages/block-library/src/query-title/block.json @@ -52,6 +52,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-query-title" diff --git a/packages/block-library/src/query/block.json b/packages/block-library/src/query/block.json index 8ea8d81843382..b602032df3600 100644 --- a/packages/block-library/src/query/block.json +++ b/packages/block-library/src/query/block.json @@ -47,10 +47,10 @@ "enhancedPagination": "enhancedPagination" }, "supports": { - "interactivity": true, "align": [ "wide", "full" ], "html": false, - "layout": true + "layout": true, + "interactivity": true }, "editorStyle": "wp-block-query-editor" } diff --git a/packages/block-library/src/query/index.php b/packages/block-library/src/query/index.php index b92a85012415b..a33a1b59f989c 100644 --- a/packages/block-library/src/query/index.php +++ b/packages/block-library/src/query/index.php @@ -17,7 +17,9 @@ * @return string Returns the modified output of the query block. */ function render_block_core_query( $attributes, $content, $block ) { - $is_interactive = isset( $attributes['enhancedPagination'] ) && true === $attributes['enhancedPagination'] && isset( $attributes['queryId'] ); + $is_interactive = isset( $attributes['enhancedPagination'] ) + && true === $attributes['enhancedPagination'] + && isset( $attributes['queryId'] ); // Enqueue the script module and add the necessary directives if the block is // interactive. @@ -102,10 +104,18 @@ function block_core_query_disable_enhanced_pagination( $parsed_block ) { static $dirty_enhanced_queries = array(); static $render_query_callback = null; - $is_interactive = isset( $parsed_block['attrs']['enhancedPagination'] ) && true === $parsed_block['attrs']['enhancedPagination'] && isset( $parsed_block['attrs']['queryId'] ); - $block_name = $parsed_block['blockName']; - - if ( 'core/query' === $block_name && $is_interactive ) { + $block_name = $parsed_block['blockName']; + $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block_name ); + $has_enhanced_pagination = isset( $parsed_block['attrs']['enhancedPagination'] ) && true === $parsed_block['attrs']['enhancedPagination'] && isset( $parsed_block['attrs']['queryId'] ); + /* + * Client side navigation can be true in two states: + * - supports.interactivity = true; + * - supports.interactivity.clientNavigation = true; + */ + $supports_client_navigation = ( isset( $block_type->supports['interactivity']['clientNavigation'] ) && true === $block_type->supports['interactivity']['clientNavigation'] ) + || ( isset( $block_type->supports['interactivity'] ) && true === $block_type->supports['interactivity'] ); + + if ( 'core/query' === $block_name && $has_enhanced_pagination ) { $enhanced_query_stack[] = $parsed_block['attrs']['queryId']; if ( ! isset( $render_query_callback ) ) { @@ -120,9 +130,9 @@ function block_core_query_disable_enhanced_pagination( $parsed_block ) { * @return string Returns the modified output of the query block. */ $render_query_callback = static function ( $content, $block ) use ( &$enhanced_query_stack, &$dirty_enhanced_queries, &$render_query_callback ) { - $is_interactive = isset( $block['attrs']['enhancedPagination'] ) && true === $block['attrs']['enhancedPagination'] && isset( $block['attrs']['queryId'] ); + $has_enhanced_pagination = isset( $block['attrs']['enhancedPagination'] ) && true === $block['attrs']['enhancedPagination'] && isset( $block['attrs']['queryId'] ); - if ( ! $is_interactive ) { + if ( ! $has_enhanced_pagination ) { return $content; } @@ -150,7 +160,7 @@ function block_core_query_disable_enhanced_pagination( $parsed_block ) { } elseif ( ! empty( $enhanced_query_stack ) && isset( $block_name ) && - ( ! str_starts_with( $block_name, 'core/' ) || 'core/post-content' === $block_name ) + ( ! $supports_client_navigation ) ) { foreach ( $enhanced_query_stack as $query_id ) { $dirty_enhanced_queries[ $query_id ] = true; diff --git a/packages/block-library/src/quote/block.json b/packages/block-library/src/quote/block.json index 9deca000efe06..b66e64bce2eea 100644 --- a/packages/block-library/src/quote/block.json +++ b/packages/block-library/src/quote/block.json @@ -58,6 +58,9 @@ }, "spacing": { "blockGap": true + }, + "interactivity": { + "clientNavigation": true } }, "styles": [ diff --git a/packages/block-library/src/read-more/block.json b/packages/block-library/src/read-more/block.json index d3386a49d66b8..9e4fc84d193f7 100644 --- a/packages/block-library/src/read-more/block.json +++ b/packages/block-library/src/read-more/block.json @@ -50,6 +50,9 @@ "__experimentalDefaultControls": { "width": true } + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-read-more" diff --git a/packages/block-library/src/rss/block.json b/packages/block-library/src/rss/block.json index 2535eda5946fb..36d70e7b7ccb9 100644 --- a/packages/block-library/src/rss/block.json +++ b/packages/block-library/src/rss/block.json @@ -43,7 +43,10 @@ }, "supports": { "align": true, - "html": false + "html": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-rss-editor", "style": "wp-block-rss" diff --git a/packages/block-library/src/separator/block.json b/packages/block-library/src/separator/block.json index 970f6b5cbb582..484627aaa1612 100644 --- a/packages/block-library/src/separator/block.json +++ b/packages/block-library/src/separator/block.json @@ -28,6 +28,9 @@ }, "spacing": { "margin": [ "top", "bottom" ] + }, + "interactivity": { + "clientNavigation": true } }, "styles": [ diff --git a/packages/block-library/src/site-logo/block.json b/packages/block-library/src/site-logo/block.json index d1e3d1b20c3da..3bdbdc1b809ab 100644 --- a/packages/block-library/src/site-logo/block.json +++ b/packages/block-library/src/site-logo/block.json @@ -45,6 +45,9 @@ "margin": false, "padding": false } + }, + "interactivity": { + "clientNavigation": true } }, "styles": [ diff --git a/packages/block-library/src/site-tagline/block.json b/packages/block-library/src/site-tagline/block.json index 22fb59aab5ead..2361be9ea3efc 100644 --- a/packages/block-library/src/site-tagline/block.json +++ b/packages/block-library/src/site-tagline/block.json @@ -43,6 +43,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-site-tagline-editor" diff --git a/packages/block-library/src/site-title/block.json b/packages/block-library/src/site-title/block.json index 4a2685e6941fc..6179452cd15b7 100644 --- a/packages/block-library/src/site-title/block.json +++ b/packages/block-library/src/site-title/block.json @@ -58,6 +58,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-site-title-editor", diff --git a/packages/block-library/src/social-link/block.json b/packages/block-library/src/social-link/block.json index 50e95efedb630..d487465ef7966 100644 --- a/packages/block-library/src/social-link/block.json +++ b/packages/block-library/src/social-link/block.json @@ -31,7 +31,10 @@ ], "supports": { "reusable": false, - "html": false + "html": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-social-link-editor" } diff --git a/packages/block-library/src/social-links/block.json b/packages/block-library/src/social-links/block.json index 1aea3684d0c63..0c8c7be1eba9a 100644 --- a/packages/block-library/src/social-links/block.json +++ b/packages/block-library/src/social-links/block.json @@ -78,6 +78,9 @@ "margin": true, "padding": false } + }, + "interactivity": { + "clientNavigation": true } }, "styles": [ diff --git a/packages/block-library/src/spacer/block.json b/packages/block-library/src/spacer/block.json index a9da8d537f1b6..447ea99cc0b67 100644 --- a/packages/block-library/src/spacer/block.json +++ b/packages/block-library/src/spacer/block.json @@ -23,6 +23,9 @@ "__experimentalDefaultControls": { "margin": true } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-spacer-editor", diff --git a/packages/block-library/src/table-of-contents/block.json b/packages/block-library/src/table-of-contents/block.json index 5fa7e37e6acbd..7857744d91c4e 100644 --- a/packages/block-library/src/table-of-contents/block.json +++ b/packages/block-library/src/table-of-contents/block.json @@ -45,6 +45,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } }, "example": {} diff --git a/packages/block-library/src/table/block.json b/packages/block-library/src/table/block.json index 470886a1247fe..44177ef50a7e2 100644 --- a/packages/block-library/src/table/block.json +++ b/packages/block-library/src/table/block.json @@ -195,7 +195,10 @@ "width": true } }, - "__experimentalSelector": ".wp-block-table > table" + "__experimentalSelector": ".wp-block-table > table", + "interactivity": { + "clientNavigation": true + } }, "styles": [ { diff --git a/packages/block-library/src/tag-cloud/block.json b/packages/block-library/src/tag-cloud/block.json index 9481dc945666a..b95e02204faa2 100644 --- a/packages/block-library/src/tag-cloud/block.json +++ b/packages/block-library/src/tag-cloud/block.json @@ -48,6 +48,9 @@ "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalLetterSpacing": true + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-tag-cloud-editor" diff --git a/packages/block-library/src/template-part/block.json b/packages/block-library/src/template-part/block.json index 3b0946718bcb9..9710bdeee2e53 100644 --- a/packages/block-library/src/template-part/block.json +++ b/packages/block-library/src/template-part/block.json @@ -24,7 +24,10 @@ "align": true, "html": false, "reusable": false, - "renaming": false + "renaming": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-template-part-editor" } diff --git a/packages/block-library/src/term-description/block.json b/packages/block-library/src/term-description/block.json index fc91a4aff4c48..7a3f27c8063ab 100644 --- a/packages/block-library/src/term-description/block.json +++ b/packages/block-library/src/term-description/block.json @@ -37,6 +37,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "interactivity": { + "clientNavigation": true } } } diff --git a/packages/block-library/src/text-columns/block.json b/packages/block-library/src/text-columns/block.json index 3af169fadbb3b..2599df111d34b 100644 --- a/packages/block-library/src/text-columns/block.json +++ b/packages/block-library/src/text-columns/block.json @@ -29,7 +29,10 @@ } }, "supports": { - "inserter": false + "inserter": false, + "interactivity": { + "clientNavigation": true + } }, "editorStyle": "wp-block-text-columns-editor", "style": "wp-block-text-columns" diff --git a/packages/block-library/src/verse/block.json b/packages/block-library/src/verse/block.json index 846a1dc99caaf..1d6b817c00302 100644 --- a/packages/block-library/src/verse/block.json +++ b/packages/block-library/src/verse/block.json @@ -55,6 +55,9 @@ "width": true, "color": true, "style": true + }, + "interactivity": { + "clientNavigation": true } }, "style": "wp-block-verse", diff --git a/packages/block-library/src/video/block.json b/packages/block-library/src/video/block.json index 5d4680f39e79a..2bc153bc1c616 100644 --- a/packages/block-library/src/video/block.json +++ b/packages/block-library/src/video/block.json @@ -88,6 +88,9 @@ "margin": false, "padding": false } + }, + "interactivity": { + "clientNavigation": true } }, "editorStyle": "wp-block-video-editor", diff --git a/packages/interactivity/CHANGELOG.md b/packages/interactivity/CHANGELOG.md index 4f7da2d266e7b..eac1e00d38e6b 100644 --- a/packages/interactivity/CHANGELOG.md +++ b/packages/interactivity/CHANGELOG.md @@ -19,6 +19,7 @@ - Prevent the usage of Preact components in `wp-text`. ([#57879](https://github.com/WordPress/gutenberg/pull/57879)) - Update `preact`, `@preact/signals` and `deepsignal` dependencies. ([#57891](https://github.com/WordPress/gutenberg/pull/57891)) - Export `withScope()` and allow to use it with asynchronous operations. ([#58013](https://github.com/WordPress/gutenberg/pull/58013)) +- Add `block supports` for `clientNavigation` and `interactive` properties on `block.json` schema.([#58132](https://github.com/WordPress/gutenberg/pull/58132)) ### New Features diff --git a/phpunit/blocks/render-query-test.php b/phpunit/blocks/render-query-test.php index c75174c741785..a4dc8a311b44a 100644 --- a/phpunit/blocks/render-query-test.php +++ b/phpunit/blocks/render-query-test.php @@ -216,4 +216,38 @@ public function test_rendering_nested_queries_with_enhanced_pagination_auto_disa $this->assertSame( 'query-2', $p->get_attribute( 'data-wp-router-region' ) ); $this->assertSame( 'true', $p->get_attribute( 'data-wp-navigation-disabled' ) ); } + + /** + * Tests that the `core/query` block adds an extra attribute to disable the + * enhanced pagination in the browser when a plugin that does not define + * clientNavigation is found inside. + */ + public function test_rendering_query_with_enhanced_pagination_auto_disabled_when_there_is_a_non_compatible_block() { + global $wp_query, $wp_the_query; + + $content = << +
+ +
+ +HTML; + + // Set main query to single post. + $wp_query = new WP_Query( + array( + 'posts_per_page' => 1, + ) + ); + + $wp_the_query = $wp_query; + + $output = do_blocks( $content ); + + $p = new WP_HTML_Tag_Processor( $output ); + + $p->next_tag( array( 'class_name' => 'wp-block-query' ) ); + $this->assertSame( 'query-0', $p->get_attribute( 'data-wp-router-region' ) ); + $this->assertSame( 'true', $p->get_attribute( 'data-wp-navigation-disabled' ) ); + } } diff --git a/schemas/json/block.json b/schemas/json/block.json index cabaa40b7aec7..5d0c7b5281b33 100644 --- a/schemas/json/block.json +++ b/schemas/json/block.json @@ -675,6 +675,31 @@ } } ] + }, + "interactivity": { + "description": "Indicates if the block is using Interactivity API features.", + "oneOf": [ + { + "type": "boolean", + "description": "Indicates whether the block is using the Interactivity API directives.", + "default": false + }, + { + "type": "object", + "properties": { + "clientNavigation": { + "type": "boolean", + "description": "Indicates whether a block is compatible with the Interactivity API client-side navigation.\n\nSet it to true only if the block is not interactive or if it is interactive using the Interactivity API. Set it to false if the block is interactive but uses vanilla JS, jQuery or another JS framework/library other than the Interactivity API.", + "default": false + }, + "interactive": { + "type": "boolean", + "description": "Indicates whether the block is using the Interactivity API directives.", + "default": false + } + } + } + ] } } },