diff --git a/Gruntfile.js b/Gruntfile.js index b720379a23101..ef82a84128ce9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -697,7 +697,7 @@ module.exports = function(grunt) { src: 'vendor/composer/ca-bundle/res/cacert.pem', dest: SOURCE_DIR + 'wp-includes/certificates/ca-bundle.crt' }, - // Gutenberg PHP infrastructure files (routes.php, pages.php, constants.php, pages/). + // Gutenberg PHP infrastructure files (routes.php, pages.php, constants.php, pages/, core actions, core fields). 'gutenberg-php': { options: { process: function( content ) { @@ -716,6 +716,10 @@ module.exports = function(grunt) { 'pages.php', 'constants.php', 'pages/**/*.php', + // The actions Core registers through the entity actions API. + 'scripts/core-actions/**/*.php', + // The fields Core registers through the entity fields API. + 'scripts/core-fields/**/*.php', ], dest: SOURCE_DIR + 'wp-includes/build/', } ], diff --git a/package.json b/package.json index eb165bda5b0f0..0aa204288908d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://develop.svn.wordpress.org/trunk" }, "gutenberg": { - "sha": "954fe7f9e04631c41aec4552acd627a7203a2aad", + "sha": "e18c3cafbe1dc2f370fdc4cb7a44811766ea177c", "ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build" }, "engines": { diff --git a/src/wp-includes/assets/icon-library-manifest.php b/src/wp-includes/assets/icon-library-manifest.php index 6af5b7d421051..10b34a0b86a83 100644 --- a/src/wp-includes/assets/icon-library-manifest.php +++ b/src/wp-includes/assets/icon-library-manifest.php @@ -49,16 +49,18 @@ 'label' => _x( 'At Symbol (@)', 'icon label' ), 'filePath' => 'at-symbol.svg', 'collections' => array( 'core' ), + 'keywords' => array( _x( 'email', 'icon keyword' ) ), ), 'audio' => array( 'label' => _x( 'Audio', 'icon label' ), 'filePath' => 'audio.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), + 'keywords' => array( _x( 'music', 'icon keyword' ), _x( 'note', 'icon keyword' ) ), ), 'bell' => array( 'label' => _x( 'Bell', 'icon label' ), 'filePath' => 'bell.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'block-default' => array( 'label' => _x( 'Block Default', 'icon label' ), @@ -83,7 +85,7 @@ 'calendar' => array( 'label' => _x( 'Calendar', 'icon label' ), 'filePath' => 'calendar.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'capture-photo' => array( 'label' => _x( 'Capture Photo', 'icon label' ), @@ -98,7 +100,7 @@ 'cart' => array( 'label' => _x( 'Cart', 'icon label' ), 'filePath' => 'cart.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'category' => array( 'label' => _x( 'Category', 'icon label' ), @@ -109,11 +111,12 @@ 'label' => _x( 'Caution', 'icon label' ), 'filePath' => 'caution.svg', 'collections' => array( 'core' ), + 'keywords' => array( _x( 'alert', 'icon keyword' ), _x( 'exclamation', 'icon keyword' ), _x( 'warning', 'icon keyword' ) ), ), 'chart-bar' => array( 'label' => _x( 'Chart Bar', 'icon label' ), 'filePath' => 'chart-bar.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'check' => array( 'label' => _x( 'Check', 'icon label' ), @@ -179,6 +182,7 @@ 'label' => _x( 'Create', 'icon label' ), 'filePath' => 'create.svg', 'collections' => array( 'core' ), + 'keywords' => array( _x( 'add', 'icon keyword' ), _x( 'new', 'icon keyword' ), _x( 'plus', 'icon keyword' ) ), ), 'dashboard' => array( 'label' => _x( 'Dashboard', 'icon label' ), @@ -208,12 +212,14 @@ 'envelope' => array( 'label' => _x( 'Envelope', 'icon label' ), 'filePath' => 'envelope.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), + 'keywords' => array( _x( 'email', 'icon keyword' ), _x( 'letter', 'icon keyword' ), _x( 'post', 'icon keyword' ) ), ), 'error' => array( 'label' => _x( 'Error', 'icon label' ), 'filePath' => 'error.svg', 'collections' => array( 'core' ), + 'keywords' => array( _x( 'alert', 'icon keyword' ), _x( 'caution', 'icon keyword' ), _x( 'exclamation', 'icon keyword' ), _x( 'warning', 'icon keyword' ) ), ), 'external' => array( 'label' => _x( 'External', 'icon label' ), @@ -224,11 +230,12 @@ 'label' => _x( 'File', 'icon label' ), 'filePath' => 'file.svg', 'collections' => array( 'core' ), + 'keywords' => array( _x( 'archive', 'icon keyword' ), _x( 'document', 'icon keyword' ), _x( 'folder', 'icon keyword' ) ), ), 'gallery' => array( 'label' => _x( 'Gallery', 'icon label' ), 'filePath' => 'gallery.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'group' => array( 'label' => _x( 'Group', 'icon label' ), @@ -243,7 +250,7 @@ 'help' => array( 'label' => _x( 'Help', 'icon label' ), 'filePath' => 'help.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'home' => array( 'label' => _x( 'Home', 'icon label' ), @@ -253,7 +260,7 @@ 'image' => array( 'label' => _x( 'Image', 'icon label' ), 'filePath' => 'image.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'info' => array( 'label' => _x( 'Info', 'icon label' ), @@ -278,7 +285,7 @@ 'map-marker' => array( 'label' => _x( 'Map Marker', 'icon label' ), 'filePath' => 'map-marker.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'media' => array( 'label' => _x( 'Media', 'icon label' ), @@ -323,12 +330,13 @@ 'payment' => array( 'label' => _x( 'Payment', 'icon label' ), 'filePath' => 'payment.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'pencil' => array( 'label' => _x( 'Pencil', 'icon label' ), 'filePath' => 'pencil.svg', 'collections' => array( 'core', 'core-admin' ), + 'keywords' => array( _x( 'edit', 'icon keyword' ) ), ), 'people' => array( 'label' => _x( 'People', 'icon label' ), @@ -368,17 +376,17 @@ 'quote' => array( 'label' => _x( 'Quote', 'icon label' ), 'filePath' => 'quote.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'receipt' => array( 'label' => _x( 'Receipt', 'icon label' ), 'filePath' => 'receipt.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'rss' => array( 'label' => _x( 'RSS', 'icon label' ), 'filePath' => 'rss.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'scheduled' => array( 'label' => _x( 'Scheduled', 'icon label' ), @@ -403,12 +411,12 @@ 'share' => array( 'label' => _x( 'Share', 'icon label' ), 'filePath' => 'share.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'shield' => array( 'label' => _x( 'Shield', 'icon label' ), 'filePath' => 'shield.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'shuffle' => array( 'label' => _x( 'Shuffle', 'icon label' ), @@ -429,6 +437,7 @@ 'label' => _x( 'Star Filled', 'icon label' ), 'filePath' => 'star-filled.svg', 'collections' => array( 'core' ), + 'keywords' => array( _x( 'favorite', 'icon keyword' ) ), ), 'star-half' => array( 'label' => _x( 'Star Half', 'icon label' ), @@ -438,7 +447,7 @@ 'store' => array( 'label' => _x( 'Store', 'icon label' ), 'filePath' => 'store.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'styles' => array( 'label' => _x( 'Styles', 'icon label' ), @@ -468,7 +477,7 @@ 'tag' => array( 'label' => _x( 'Tag', 'icon label' ), 'filePath' => 'tag.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'tip' => array( 'label' => _x( 'Tip', 'icon label' ), diff --git a/src/wp-includes/assets/script-loader-packages.php b/src/wp-includes/assets/script-loader-packages.php index 130c022842931..c5049e6d1ad09 100644 --- a/src/wp-includes/assets/script-loader-packages.php +++ b/src/wp-includes/assets/script-loader-packages.php @@ -67,7 +67,7 @@ 'wp-url', 'wp-warning' ), - 'version' => '56da94f1b6ed56573e78' + 'version' => '2cd675763a8218c966ec' ), 'block-editor.js' => array( 'dependencies' => array( @@ -105,7 +105,7 @@ 'wp-url', 'wp-warning' ), - 'version' => '578ad9eb61ae8af0123d' + 'version' => 'da6e796949fcb911a90f' ), 'block-library.js' => array( 'dependencies' => array( @@ -151,7 +151,7 @@ 'import' => 'dynamic' ) ), - 'version' => '0999d15ea60b2ca101bc' + 'version' => 'f71a7a01a0cb1ba6e9a1' ), 'block-serialization-default-parser.js' => array( 'dependencies' => array( @@ -184,7 +184,7 @@ 'wp-shortcode', 'wp-warning' ), - 'version' => 'c453468c6e4fc4dacf25' + 'version' => '8e35a0edaf0ac8ebf0fb' ), 'commands.js' => array( 'dependencies' => array( @@ -201,7 +201,7 @@ 'wp-primitives', 'wp-private-apis' ), - 'version' => '4a4a518ce9c4838666fe' + 'version' => 'bfadfc4e96de15d6f689' ), 'components.js' => array( 'dependencies' => array( @@ -226,11 +226,10 @@ 'wp-theme', 'wp-warning' ), - 'version' => 'fecbc7a454bacff1527c' + 'version' => '94fead7ee78ffbb72667' ), 'compose.js' => array( 'dependencies' => array( - 'react', 'react-jsx-runtime', 'wp-deprecated', 'wp-dom', @@ -241,7 +240,7 @@ 'wp-private-apis', 'wp-undo-manager' ), - 'version' => '18547cd8d2e6674f7b98' + 'version' => '2c882cef80a075bd7c3d' ), 'core-commands.js' => array( 'dependencies' => array( @@ -258,7 +257,7 @@ 'wp-router', 'wp-url' ), - 'version' => '738a4beca871c27833f1' + 'version' => '8839a8b3ea5cc4eb698e' ), 'core-data.js' => array( 'dependencies' => array( @@ -271,6 +270,7 @@ 'wp-data', 'wp-deprecated', 'wp-element', + 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', @@ -278,12 +278,11 @@ 'wp-private-apis', 'wp-rich-text', 'wp-style-engine', - 'wp-sync', 'wp-undo-manager', 'wp-url', 'wp-warning' ), - 'version' => 'a1d74a5d3b46ac893e05' + 'version' => 'd2b82f6369d5503e99bb' ), 'customize-widgets.js' => array( 'dependencies' => array( @@ -319,7 +318,7 @@ 'import' => 'static' ) ), - 'version' => 'dcab974f036fbee73086' + 'version' => '50c2d8139dc39c1e047a' ), 'data.js' => array( 'dependencies' => array( @@ -347,7 +346,7 @@ 'moment', 'wp-deprecated' ), - 'version' => '8173fc0fc12b7bb7eaf0' + 'version' => 'af0f72250d99230696c5' ), 'deprecated.js' => array( 'dependencies' => array( @@ -359,7 +358,7 @@ 'dependencies' => array( 'wp-deprecated' ), - 'version' => 'd72034b45da1dc03f5fb' + 'version' => 'd9b90cd4513d2092fd3c' ), 'dom-ready.js' => array( 'dependencies' => array( @@ -410,7 +409,7 @@ 'import' => 'static' ) ), - 'version' => 'b4b1fb53ee012caa42fb' + 'version' => 'f1cb12c1fd14293aec82' ), 'edit-site.js' => array( 'dependencies' => array( @@ -450,8 +449,7 @@ 'wp-theme', 'wp-url', 'wp-warning', - 'wp-widgets', - 'wp-wordcount' + 'wp-widgets' ), 'module_dependencies' => array( array( @@ -459,7 +457,7 @@ 'import' => 'static' ) ), - 'version' => '1d1116c276ed95618737' + 'version' => 'c8492f0430258646a606' ), 'edit-widgets.js' => array( 'dependencies' => array( @@ -501,7 +499,7 @@ 'import' => 'static' ) ), - 'version' => 'b66dc643708560ba6922' + 'version' => '3a5bc43bc625e0f5774a' ), 'editor.js' => array( 'dependencies' => array( @@ -523,7 +521,6 @@ 'wp-deprecated', 'wp-dom', 'wp-element', - 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', @@ -552,7 +549,7 @@ 'import' => 'static' ) ), - 'version' => '021570d5ceb676201638' + 'version' => 'd029bd62a89843653c78' ), 'element.js' => array( 'dependencies' => array( @@ -560,7 +557,7 @@ 'react-dom', 'wp-escape-html' ), - 'version' => '4822427ad9c627826631' + 'version' => '5a4b1aa0e42aad8ef7db' ), 'escape-html.js' => array( 'dependencies' => array( @@ -594,7 +591,7 @@ 'import' => 'dynamic' ) ), - 'version' => 'f9ce39fe8a3d8aaf2fd6' + 'version' => '80364106dc5cdf6f30e0' ), 'hooks.js' => array( 'dependencies' => array( @@ -627,7 +624,7 @@ 'wp-element', 'wp-keycodes' ), - 'version' => 'ba3985e44a8fdca9462f' + 'version' => '2871b9b36c2a9aef74c4' ), 'keycodes.js' => array( 'dependencies' => array( @@ -662,6 +659,7 @@ 'wp-date', 'wp-deprecated', 'wp-element', + 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', @@ -672,15 +670,26 @@ 'wp-url', 'wp-warning' ), - 'version' => '64a4692e40e4685caccd' + 'version' => 'e41aab29ecfcd5067912' ), 'notices.js' => array( 'dependencies' => array( + 'react', + 'react-dom', 'react-jsx-runtime', + 'wp-a11y', 'wp-components', - 'wp-data' + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-element', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' ), - 'version' => 'c09a068fdab0eb465e14' + 'version' => '50f64da182bc1a7417c8' ), 'nux.js' => array( 'dependencies' => array( @@ -711,7 +720,7 @@ 'wp-url', 'wp-warning' ), - 'version' => 'bb86130c876014c4db11' + 'version' => 'ced901bac0e8160bedae' ), 'plugins.js' => array( 'dependencies' => array( @@ -723,7 +732,7 @@ 'wp-is-shallow-equal', 'wp-primitives' ), - 'version' => 'a03a674fba0130981f2d' + 'version' => '4c53884fe0283a7ee4c5' ), 'preferences.js' => array( 'dependencies' => array( @@ -739,13 +748,13 @@ 'wp-primitives', 'wp-private-apis' ), - 'version' => 'f0a611a312173e6b7648' + 'version' => '00228fed7f2d274a78ab' ), 'preferences-persistence.js' => array( 'dependencies' => array( 'wp-api-fetch' ), - 'version' => 'a34abbdacd8f50f9acb1' + 'version' => '63049460a74cb385aa0a' ), 'primitives.js' => array( 'dependencies' => array( @@ -764,7 +773,7 @@ 'dependencies' => array( ), - 'version' => 'df3615fd5cb379fb7ffe' + 'version' => '81dd8f4c0e768e396025' ), 'react-i18n.js' => array( 'dependencies' => array( @@ -800,7 +809,7 @@ 'wp-keycodes', 'wp-private-apis' ), - 'version' => 'd04c731671320d12f4e9' + 'version' => '961958792146058e5f18' ), 'router.js' => array( 'dependencies' => array( @@ -824,7 +833,7 @@ 'wp-i18n', 'wp-url' ), - 'version' => '83e806a0634df6b93530' + 'version' => '93e0b8da5b06ea5406ab' ), 'shortcode.js' => array( 'dependencies' => array( @@ -836,15 +845,7 @@ 'dependencies' => array( ), - 'version' => '914befb08774033e6265' - ), - 'sync.js' => array( - 'dependencies' => array( - 'wp-api-fetch', - 'wp-hooks', - 'wp-private-apis' - ), - 'version' => '7179e38284ff7aba21e6' + 'version' => '6500509f32193fe14392' ), 'theme.js' => array( 'dependencies' => array( @@ -854,7 +855,7 @@ 'wp-element', 'wp-private-apis' ), - 'version' => '795a74a11c336f95159b' + 'version' => '21b0c3318f26c7b3d71e' ), 'token-list.js' => array( 'dependencies' => array( @@ -876,8 +877,7 @@ 'wp-data', 'wp-element', 'wp-i18n', - 'wp-private-apis', - 'wp-url' + 'wp-private-apis' ), 'module_dependencies' => array( array( @@ -889,13 +889,13 @@ 'import' => 'dynamic' ) ), - 'version' => '86068d5116da27ca40a5' + 'version' => '4bd74c9d859a5ffe1e31' ), 'url.js' => array( 'dependencies' => array( ), - 'version' => '65e1ab123ef3bf825dea' + 'version' => '3c0d9743cc6cd9591281' ), 'viewport.js' => array( 'dependencies' => array( @@ -913,7 +913,10 @@ ), 'widgets.js' => array( 'dependencies' => array( + 'react', + 'react-dom', 'react-jsx-runtime', + 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', @@ -924,9 +927,12 @@ 'wp-element', 'wp-i18n', 'wp-notices', - 'wp-primitives' + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' ), - 'version' => 'f2802a2d8ac37b86bc43' + 'version' => '809cf178473fab752cef' ), 'wordcount.js' => array( 'dependencies' => array( diff --git a/src/wp-includes/assets/script-modules-packages.php b/src/wp-includes/assets/script-modules-packages.php index b000cd3d852b6..fc801f0ae0590 100644 --- a/src/wp-includes/assets/script-modules-packages.php +++ b/src/wp-includes/assets/script-modules-packages.php @@ -10,7 +10,7 @@ 'wp-data', 'wp-i18n' ), - 'version' => 'e5fcd7e304ead0fc9779' + 'version' => '9448bb3053516a39086d' ), 'block-editor/utils/fit-text-frontend.js' => array( 'dependencies' => array( @@ -36,6 +36,18 @@ ), 'version' => '6d4bb8df9c7539843ad3' ), + 'block-library/cover/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => 'ef26735bd1dbc6c830a0' + ), 'block-library/file/view.js' => array( 'dependencies' => array( @@ -58,7 +70,7 @@ 'import' => 'static' ) ), - 'version' => '25ee935fd6c67371d0f3' + 'version' => 'b5457389a410156f7ef6' ), 'block-library/navigation/view.js' => array( 'dependencies' => array( @@ -82,7 +94,7 @@ 'import' => 'static' ) ), - 'version' => 'fde7e3309a48521aed56' + 'version' => 'dcead465d87ec21eea99' ), 'block-library/query/view.js' => array( 'dependencies' => array( @@ -124,6 +136,18 @@ ), 'version' => '0684c8bb3dc8582b92ea' ), + 'block-library/video/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => 'a75554c34e6430cbfdd5' + ), 'boot/index.js' => array( 'dependencies' => array( 'react', @@ -162,7 +186,7 @@ 'import' => 'static' ) ), - 'version' => 'f6c3c0c637fe0ed2dbd2' + 'version' => 'd8489a9113a214b5278c' ), 'connectors/index.js' => array( 'dependencies' => array( @@ -188,6 +212,222 @@ ), 'version' => '012760fd849397dd0031' ), + 'core-actions/page.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-components', + 'wp-core-data', + 'wp-data', + 'wp-html-entities', + 'wp-i18n', + 'wp-notices' + ), + 'version' => 'b7ea80c796cbace5c19c' + ), + 'core-actions/post_type_supports.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-blocks', + 'wp-components', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-notices', + 'wp-patterns', + 'wp-primitives', + 'wp-private-apis', + 'wp-url' + ), + 'version' => 'c68e5c9a605e907ca528' + ), + 'core-actions/wp_block.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-blob', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-patterns', + 'wp-primitives', + 'wp-private-apis' + ), + 'version' => 'fc39ba4261c0c13a18da' + ), + 'core-actions/wp_template_part.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-blocks', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-notices', + 'wp-patterns', + 'wp-private-apis' + ), + 'version' => 'c8126a6b5289ae455bf2' + ), + 'core-fields/attachment.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-url', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => '3a28135598a5699ab7f1' + ), + 'core-fields/page.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => 'cc78f2192db7a69e99c1' + ), + 'core-fields/post_type_supports.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-date', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-media-utils', + 'wp-notices', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-url', + 'wp-warning', + 'wp-wordcount' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => 'af71ae1624cb6d030f74' + ), + 'core-fields/root_site.js' => array( + 'dependencies' => array( + 'wp-html-entities', + 'wp-media-utils', + 'wp-private-apis' + ), + 'version' => 'e94092be498b0e24d377' + ), + 'core-fields/wp_block.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-compose', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => '98921ca4890d4baead31' + ), + 'core-fields/wp_template.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => 'd94f646d08e9c4a6ba08' + ), + 'core-fields/wp_template_part.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => 'b528ca2741b1c38e32ff' + ), 'dashboard-init/index.js' => array( 'dependencies' => array( 'react', @@ -219,13 +459,13 @@ 'import' => 'static' ) ), - 'version' => '9e49b9edcfc16dc5203c' + 'version' => '4b2e3230d57e16afb0ad' ), 'interactivity/index.js' => array( 'dependencies' => array( ), - 'version' => 'b0929e0bd08daccaa778' + 'version' => '38309185015c9ca20405' ), 'interactivity-router/full-page.js' => array( 'dependencies' => array( @@ -253,13 +493,13 @@ 'import' => 'static' ) ), - 'version' => '711aa380e66c57009b7a' + 'version' => '3ee11de34faed693e7a5' ), 'latex-to-mathml/index.js' => array( 'dependencies' => array( ), - 'version' => '662cb0e7f68d2a21cd68' + 'version' => '4ec5f96f5cf884f76516' ), 'latex-to-mathml/loader.js' => array( 'dependencies' => array( @@ -287,7 +527,7 @@ 'wp-private-apis', 'wp-style-engine' ), - 'version' => 'e50dce77f58e6e3ffa9b' + 'version' => 'b1449ad638987b6a4b90' ), 'route/index.js' => array( 'dependencies' => array( @@ -314,7 +554,7 @@ 'dependencies' => array( ), - 'version' => '4d3627c45251ceb4f9a2' + 'version' => 'fa777d9ac60940d2e501' ), 'vips/loader.js' => array( 'dependencies' => array( @@ -332,14 +572,14 @@ 'dependencies' => array( ), - 'version' => '7e33cd8c4128731126e8' + 'version' => '4aef10eaf28026b90482' ), 'widget-primitives/index.js' => array( 'dependencies' => array( 'react-jsx-runtime', 'wp-element' ), - 'version' => '3047de39283129372300' + 'version' => '355066e7b5d458a5968d' ), 'workflow/index.js' => array( 'dependencies' => array( @@ -350,6 +590,7 @@ 'wp-compose', 'wp-data', 'wp-element', + 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', @@ -372,6 +613,6 @@ 'import' => 'dynamic' ) ), - 'version' => '02fa947b818b1e4c07fd' + 'version' => 'fc89488ffb88c0560c75' ) ); \ No newline at end of file diff --git a/src/wp-includes/blocks/accordion-heading/block.json b/src/wp-includes/blocks/accordion-heading/block.json index 8f51644120d41..c301c6c1b7e5e 100644 --- a/src/wp-includes/blocks/accordion-heading/block.json +++ b/src/wp-includes/blocks/accordion-heading/block.json @@ -13,6 +13,9 @@ ], "supports": { "anchor": true, + "background": { + "gradient": true + }, "color": { "background": true, "gradients": true @@ -45,6 +48,7 @@ "letterSpacing" ], "fontSize": true, + "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, diff --git a/src/wp-includes/blocks/archives/block.json b/src/wp-includes/blocks/archives/block.json index 7455b558c0d18..b0063dd06663b 100644 --- a/src/wp-includes/blocks/archives/block.json +++ b/src/wp-includes/blocks/archives/block.json @@ -42,6 +42,9 @@ "gradient": true } }, + "dimensions": { + "minHeight": true + }, "html": false, "spacing": { "margin": true, diff --git a/src/wp-includes/blocks/avatar.php b/src/wp-includes/blocks/avatar.php index 196d67a4d480c..c257175432685 100644 --- a/src/wp-includes/blocks/avatar.php +++ b/src/wp-includes/blocks/avatar.php @@ -19,6 +19,7 @@ function render_block_core_avatar( $attributes, $content, $block ) { $size = $attributes['size'] ?? 96; $wrapper_attributes = get_block_wrapper_attributes(); $border_attributes = get_block_core_avatar_border_attributes( $attributes ); + $shadow_styles = wp_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ?? null ) ); // Class gets passed through `esc_attr` via `get_avatar`. $image_classes = ! empty( $border_attributes['class'] ) @@ -26,10 +27,11 @@ function render_block_core_avatar( $attributes, $content, $block ) { : 'wp-block-avatar__image'; // Unlike class, `get_avatar` doesn't filter the styles via `esc_attr`. - // The style engine does pass the border styles through + // The style engine does pass the border and shadow styles through // `safecss_filter_attr` however. - $image_styles = ! empty( $border_attributes['style'] ) - ? sprintf( ' style="%s"', esc_attr( $border_attributes['style'] ) ) + $image_css = ( $border_attributes['style'] ?? '' ) . ( $shadow_styles['css'] ?? '' ); + $image_styles = ! empty( $image_css ) + ? sprintf( ' style="%s"', esc_attr( $image_css ) ) : ''; if ( ! isset( $block->context['commentId'] ) ) { diff --git a/src/wp-includes/blocks/avatar/block.json b/src/wp-includes/blocks/avatar/block.json index 0cb92d81865c7..7d8b2ddee1f10 100644 --- a/src/wp-includes/blocks/avatar/block.json +++ b/src/wp-includes/blocks/avatar/block.json @@ -54,12 +54,16 @@ "filter": { "duotone": true }, + "shadow": { + "__experimentalSkipSerialization": true + }, "interactivity": { "clientNavigation": true } }, "selectors": { "border": ".wp-block-avatar img", + "shadow": ".wp-block-avatar img", "filter": { "duotone": ".wp-block-avatar img" } diff --git a/src/wp-includes/blocks/blocks-json.php b/src/wp-includes/blocks/blocks-json.php index 73e0bebb8fb78..ee655132af3ac 100644 --- a/src/wp-includes/blocks/blocks-json.php +++ b/src/wp-includes/blocks/blocks-json.php @@ -120,6 +120,9 @@ ), 'supports' => array( 'anchor' => true, + 'background' => array( + 'gradient' => true + ), 'color' => array( 'background' => true, 'gradients' => true @@ -152,6 +155,7 @@ 'letterSpacing' ), 'fontSize' => true, + 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, @@ -414,6 +418,9 @@ 'gradient' => true ) ), + 'dimensions' => array( + 'minHeight' => true + ), 'html' => false, 'spacing' => array( 'margin' => true, @@ -591,12 +598,16 @@ 'filter' => array( 'duotone' => true ), + 'shadow' => array( + '__experimentalSkipSerialization' => true + ), 'interactivity' => array( 'clientNavigation' => true ) ), 'selectors' => array( 'border' => '.wp-block-avatar img', + 'shadow' => '.wp-block-avatar img', 'filter' => array( 'duotone' => '.wp-block-avatar img' ) @@ -808,6 +819,12 @@ 'splitting' => true, 'align' => false, 'alignWide' => false, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true, + '__experimentalSkipSerialization' => true + ), 'color' => array( '__experimentalSkipSerialization' => true, 'gradients' => true, @@ -971,6 +988,10 @@ 'fontSize' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, @@ -994,7 +1015,8 @@ 'clientNavigation' => true ), 'listView' => true, - 'contentRole' => true + 'contentRole' => true, + 'shadow' => true ), 'editorStyle' => 'wp-block-buttons-editor', 'style' => 'wp-block-buttons' @@ -1196,6 +1218,10 @@ 'gradient' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, @@ -1400,6 +1426,10 @@ 'gradient' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'blockGap' => array( '__experimentalDefault' => '2em', @@ -1995,6 +2025,11 @@ 'type' => 'flex' ) ), + 'spacing' => array( + 'padding' => true, + 'margin' => true, + 'blockGap' => true + ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, @@ -2008,6 +2043,12 @@ 'fontSize' => true ) ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ), 'interactivity' => array( 'clientNavigation' => true ) @@ -2064,8 +2105,21 @@ ), 'interactivity' => array( 'clientNavigation' => true + ), + 'spacing' => array( + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => false + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true ) - ) + ), + 'style' => 'wp-block-comments-pagination-next' ), 'comments-pagination-numbers' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', @@ -2172,8 +2226,21 @@ ), 'interactivity' => array( 'clientNavigation' => true + ), + 'spacing' => array( + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => false + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true ) - ) + ), + 'style' => 'wp-block-comments-pagination-previous' ), 'comments-title' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', @@ -2398,6 +2465,8 @@ 'color' => array( 'heading' => true, 'text' => true, + 'link' => true, + 'button' => true, 'background' => false, '__experimentalSkipSerialization' => array( 'gradients' @@ -2405,7 +2474,8 @@ 'enableContrastChecker' => false ), 'dimensions' => array( - 'aspectRatio' => true + 'aspectRatio' => true, + 'minWidth' => true ), 'typography' => array( 'fontSize' => true, @@ -2424,7 +2494,8 @@ 'allowJustification' => false ), 'interactivity' => array( - 'clientNavigation' => true + 'clientNavigation' => true, + 'interactive' => true ), 'filter' => array( 'duotone' => true @@ -2515,6 +2586,9 @@ 'padding' => false ) ), + 'dimensions' => array( + 'minWidth' => true + ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, @@ -2584,8 +2658,13 @@ 'supports' => array( 'anchor' => true, 'align' => true, + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( - 'margin' => true + 'margin' => true, + 'padding' => true ), 'interactivity' => array( 'clientNavigation' => true @@ -2678,6 +2757,10 @@ 'margin' => true, 'padding' => true ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'color' => array( 'gradients' => true, 'link' => true, @@ -2699,6 +2782,20 @@ 'style' => true ) ), + 'shadow' => true, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), 'interactivity' => true ), 'editorStyle' => 'wp-block-file-editor', @@ -2764,6 +2861,10 @@ 'padding' => false ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, @@ -3005,6 +3106,11 @@ 'background' => true, 'gradients' => true ), + 'shadow' => true, + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'layout' => array( 'allowSwitching' => false, 'allowInheriting' => false, @@ -3018,11 +3124,19 @@ 'type' => 'flex' ) ), + 'filter' => array( + 'duotone' => true + ), 'interactivity' => array( 'clientNavigation' => true ), 'listView' => true ), + 'selectors' => array( + 'filter' => array( + 'duotone' => '.wp-block-gallery :where(img)' + ) + ), 'editorStyle' => 'wp-block-gallery-editor', 'style' => 'wp-block-gallery' ), @@ -3186,6 +3300,7 @@ 'className' => true, 'splitting' => true, 'background' => array( + 'backgroundClip' => true, 'backgroundImage' => true, 'backgroundSize' => true, 'gradient' => true, @@ -3208,6 +3323,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'shadow' => true, 'spacing' => array( 'margin' => true, @@ -3221,6 +3340,7 @@ 'fontSize' => true, 'lineHeight' => true, 'textAlign' => true, + 'textIndent' => true, '__experimentalFontFamily' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, @@ -3299,6 +3419,10 @@ ) ), 'shadow' => true, + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, @@ -3311,6 +3435,14 @@ 'width' => false ) ), + 'spacing' => array( + 'margin' => true, + 'padding' => true, + '__experimentalDefaultControls' => array( + 'margin' => false, + 'padding' => false + ) + ), 'interactivity' => array( 'clientNavigation' => true ) @@ -3388,6 +3520,12 @@ 'center', 'right' ), + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true, + '__experimentalSkipSerialization' => true + ), 'html' => false, 'color' => array( '__experimentalSkipSerialization' => true, @@ -3399,6 +3537,9 @@ 'interactivity' => array( 'clientNavigation' => true ), + 'shadow' => array( + '__experimentalSkipSerialization' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, @@ -3425,8 +3566,12 @@ ), 'dimensions' => array( 'width' => true, + 'minWidth' => true, + 'minHeight' => true, '__experimentalSkipSerialization' => array( - 'width' + 'width', + 'minWidth', + 'minHeight' ), '__experimentalDefaultControls' => array( 'width' => true @@ -3436,6 +3581,7 @@ 'selectors' => array( 'root' => '.wp-block-icon svg', 'css' => '.wp-block-icon', + 'shadow' => '.wp-block-icon svg', 'spacing' => array( 'margin' => '.wp-block-icon' ) @@ -3674,11 +3820,21 @@ 'link' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'html' => false, 'spacing' => array( 'margin' => true, 'padding' => true ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true + ), 'shadow' => true, 'typography' => array( 'fontSize' => true, @@ -3804,6 +3960,10 @@ 'link' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true, @@ -3945,6 +4105,15 @@ 'fontSize' => true ) ), + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true, + '__experimentalDefaultControls' => array( + 'backgroundImage' => true, + 'gradient' => true + ) + ), 'color' => array( 'gradients' => true, 'link' => true, @@ -3953,6 +4122,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true, @@ -3961,6 +4134,7 @@ 'padding' => false ) ), + 'shadow' => true, '__unstablePasteTextInline' => true, '__experimentalOnMerge' => true, '__experimentalSlashInserter' => true, @@ -3970,7 +4144,9 @@ 'listView' => true ), 'selectors' => array( - 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list)' + 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list)', + 'dimensions' => '.wp-block-list:not(.wp-block-list .wp-block-list)', + 'shadow' => '.wp-block-list:not(.wp-block-list .wp-block-list)' ), 'editorStyle' => 'wp-block-list-editor', 'style' => 'wp-block-list' @@ -4005,6 +4181,11 @@ 'html' => false, 'className' => false, 'splitting' => true, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, @@ -4027,6 +4208,7 @@ 'padding' => false ) ), + 'shadow' => true, 'typography' => array( 'fontSize' => true, 'lineHeight' => true, @@ -4046,7 +4228,8 @@ ), 'selectors' => array( 'root' => '.wp-block-list > li', - 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list) > li' + 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list) > li', + 'shadow' => '.wp-block-list:not(.wp-block-list .wp-block-list) > li' ) ), 'loginout' => array( @@ -4093,6 +4276,10 @@ 'gradients' => true, 'link' => true ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true, @@ -4123,7 +4310,8 @@ 'shadow' => true, 'interactivity' => array( 'clientNavigation' => true - ) + ), + 'contentRole' => true ), 'style' => 'wp-block-loginout' ), @@ -4166,6 +4354,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'shadow' => true, 'spacing' => array( 'margin' => true, @@ -4310,6 +4502,11 @@ 'full' ), 'html' => false, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, @@ -4332,10 +4529,15 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true ), + 'shadow' => true, 'typography' => array( 'fontSize' => true, 'lineHeight' => true, @@ -4349,11 +4551,19 @@ 'fontSize' => true ) ), + 'filter' => array( + 'duotone' => true + ), 'interactivity' => array( 'clientNavigation' => true ), 'allowedBlocks' => true ), + 'selectors' => array( + 'filter' => array( + 'duotone' => '.wp-block-media-text > .wp-block-media-text__media img, .wp-block-media-text > .wp-block-media-text__media video' + ) + ), 'editorStyle' => 'wp-block-media-text-editor', 'style' => 'wp-block-media-text' ), @@ -4741,6 +4951,10 @@ ) ), 'shadow' => true, + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, @@ -4749,6 +4963,7 @@ ), 'spacing' => array( 'padding' => true, + 'margin' => true, '__experimentalDefaultControls' => array( 'padding' => true ) @@ -4989,6 +5204,10 @@ ) ), 'shadow' => true, + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'contentRole' => true ), 'editorStyle' => 'wp-block-page-list-editor', @@ -5098,12 +5317,19 @@ 'splitting' => true, 'anchor' => true, 'className' => false, + 'background' => array( + 'backgroundClip' => true, + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ), + 'shadow' => true, 'color' => array( 'gradients' => true, 'link' => true, @@ -5112,6 +5338,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true, @@ -5260,6 +5490,15 @@ 'supports' => array( 'anchor' => true, 'align' => true, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true, + '__experimentalDefaultControls' => array( + 'backgroundImage' => true, + 'gradient' => true + ) + ), 'color' => array( 'gradients' => true, 'link' => true, @@ -5278,6 +5517,10 @@ 'width' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'interactivity' => true, 'shadow' => true, 'spacing' => array( @@ -5499,6 +5742,7 @@ 'lineHeight' => true, 'textAlign' => true, 'textColumns' => true, + 'textIndent' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, @@ -5698,6 +5942,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true @@ -5706,6 +5954,7 @@ 'fontSize' => true, 'lineHeight' => true, 'textAlign' => true, + '__experimentalFontFamily' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, @@ -5844,7 +6093,8 @@ ) ), 'dimensions' => array( - 'minHeight' => true + 'minHeight' => true, + 'minWidth' => true ), 'shadow' => true, 'spacing' => array( @@ -6031,6 +6281,10 @@ 'margin' => true, 'padding' => true ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, @@ -6151,6 +6405,7 @@ '__experimentalBorder' => array( 'color' => true, 'radius' => true, + 'style' => true, 'width' => true, '__experimentalSkipSerialization' => true, '__experimentalDefaultControls' => array( @@ -6226,6 +6481,12 @@ 'anchor' => true, 'reusable' => false, 'html' => false, + 'background' => array( + '__experimentalSkipSerialization' => true, + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true + ), 'color' => array( 'link' => true ), @@ -6250,6 +6511,11 @@ 'interactivity' => array( 'clientNavigation' => true ), + 'dimensions' => array( + '__experimentalSkipSerialization' => true, + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( '__experimentalSkipSerialization' => true, 'margin' => true, @@ -6274,7 +6540,9 @@ ) ), 'selectors' => array( + 'background' => '.wp-block-post-navigation-link:not(:empty)', 'border' => '.wp-block-post-navigation-link:not(:empty)', + 'dimensions' => '.wp-block-post-navigation-link:not(:empty)', 'shadow' => '.wp-block-post-navigation-link:not(:empty)', 'spacing' => '.wp-block-post-navigation-link:not(:empty)' ), @@ -6354,6 +6622,10 @@ 'margin' => false ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'interactivity' => array( 'clientNavigation' => true ), @@ -6419,6 +6691,10 @@ 'link' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'shadow' => true, 'spacing' => array( 'margin' => true, @@ -6496,6 +6772,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'html' => false, 'shadow' => true, 'spacing' => array( @@ -6600,6 +6880,10 @@ 'link' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'shadow' => true, 'spacing' => array( 'margin' => true, @@ -6615,6 +6899,7 @@ '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, + 'fitText' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) @@ -6669,6 +6954,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'shadow' => true, 'spacing' => array( 'padding' => true, @@ -6754,7 +7043,8 @@ ) ), 'dimensions' => array( - 'minHeight' => true + 'minHeight' => true, + 'minWidth' => true ), 'shadow' => true, 'spacing' => array( @@ -6765,12 +7055,14 @@ 'fontSize' => true, 'lineHeight' => true, 'textAlign' => true, + 'textIndent' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, + '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) @@ -6913,6 +7205,10 @@ 'heading' => true, 'button' => true ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'padding' => true, 'margin' => true, @@ -6998,6 +7294,11 @@ 'link' => true ) ), + 'spacing' => array( + 'padding' => true, + 'margin' => true, + 'blockGap' => true + ), 'layout' => array( 'allowSwitching' => false, 'allowInheriting' => false, @@ -7018,6 +7319,18 @@ 'fontSize' => true ) ), + '__experimentalBorder' => array( + 'color' => true, + 'radius' => true, + 'style' => true, + 'width' => true, + '__experimentalDefaultControls' => array( + 'color' => false, + 'radius' => false, + 'style' => false, + 'width' => false + ) + ), 'interactivity' => array( 'clientNavigation' => true ) @@ -7316,6 +7629,10 @@ 'margin' => true, 'padding' => true ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'color' => array( 'gradients' => true, '__experimentalDefaultControls' => array( @@ -7418,6 +7735,7 @@ ), 'dimensions' => array( 'minHeight' => true, + 'minWidth' => true, '__experimentalDefaultControls' => array( 'minHeight' => false ) @@ -7433,6 +7751,7 @@ '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, + '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) @@ -7441,6 +7760,7 @@ 'gradients' => true, 'heading' => true, 'link' => true, + 'button' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true @@ -7521,6 +7841,10 @@ 'textDecoration' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => array( 'top', @@ -7534,6 +7858,7 @@ '__experimentalBorder' => array( 'color' => true, 'radius' => true, + 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'width' => true @@ -7621,6 +7946,10 @@ 'margin' => false ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'shadow' => true, 'background' => array( 'backgroundImage' => true, @@ -7698,6 +8027,10 @@ 'center', 'right' ), + 'background' => array( + 'gradient' => true, + '__experimentalSkipSerialization' => true + ), 'color' => array( 'gradients' => true, '__experimentalSkipSerialization' => true, @@ -7725,6 +8058,7 @@ '__experimentalBorder' => array( 'color' => true, 'radius' => true, + 'style' => true, 'width' => true, '__experimentalSkipSerialization' => true, '__experimentalDefaultControls' => array( @@ -7733,8 +8067,17 @@ 'width' => true ) ), + 'shadow' => array( + '__experimentalSkipSerialization' => true + ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true, + '__experimentalSkipSerialization' => true + ), 'spacing' => array( - 'margin' => true + 'margin' => true, + 'padding' => true ), 'html' => false ), @@ -7742,7 +8085,10 @@ 'style' => 'wp-block-search', 'selectors' => array( 'color' => '.wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input', - 'border' => '.wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper' + 'background' => '.wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input', + 'border' => '.wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper', + 'shadow' => '.wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper', + 'dimensions' => '.wp-block-search .wp-block-search__inside-wrapper' ) ), 'separator' => array( @@ -7976,6 +8322,10 @@ ) ), 'contentRole' => true, + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true, @@ -8074,6 +8424,10 @@ 'link' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'padding' => true, 'margin' => true, @@ -8274,6 +8628,7 @@ 'style' => true ) ), + 'shadow' => true, 'contentRole' => true, 'listView' => true ), @@ -8369,6 +8724,12 @@ 'ariaLabel' => true, 'visibility' => false, 'lock' => false, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true, + '__experimentalSkipSerialization' => true + ), 'color' => array( 'background' => true, 'text' => true, @@ -8380,7 +8741,11 @@ ), 'typography' => array( 'fontSize' => true, - '__experimentalFontFamily' => true + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalTextTransform' => true, + '__experimentalLetterSpacing' => true ), '__experimentalBorder' => array( 'color' => true, @@ -8408,10 +8773,15 @@ 'padding' => true, 'blockGap' => true ) + ), + 'shadow' => array( + '__experimentalSkipSerialization' => true ) ), 'selectors' => array( + 'background' => '.wp-block-tab-list button', 'border' => '.wp-block-tab-list button', + 'shadow' => '.wp-block-tab-list button', 'color' => array( 'background' => '.wp-block-tab-list button', 'text' => '.wp-block-tab-list button' @@ -8541,6 +8911,9 @@ 'spacing' => array( 'padding' => true ), + 'dimensions' => array( + 'minHeight' => true + ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, @@ -8732,9 +9105,18 @@ 'supports' => array( 'anchor' => true, 'align' => true, - 'color' => array( + 'background' => array( '__experimentalSkipSerialization' => true, + 'gradient' => true + ), + 'color' => array( + '__experimentalSkipSerialization' => array( + 'text', + 'background', + 'gradients' + ), 'gradients' => true, + 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true @@ -8749,6 +9131,9 @@ ) ), 'typography' => array( + '__experimentalSkipSerialization' => array( + 'textAlign' + ), 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, @@ -8757,6 +9142,7 @@ '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, + 'textAlign' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) @@ -8854,6 +9240,9 @@ 'margin' => true, 'padding' => true ), + 'dimensions' => array( + 'minWidth' => true + ), 'shadow' => true, 'typography' => array( 'fontSize' => true, @@ -9010,7 +9399,8 @@ 'textdomain' => 'default', 'usesContext' => array( 'termId', - 'taxonomy' + 'taxonomy', + 'termData' ), 'attributes' => array( 'bracketType' => array( @@ -9042,8 +9432,13 @@ ), 'shadow' => true, 'spacing' => array( + 'margin' => true, 'padding' => true ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, @@ -9109,6 +9504,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'padding' => true, 'margin' => true @@ -9198,9 +9597,14 @@ 'link' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'shadow' => true, 'spacing' => array( - 'padding' => true + 'padding' => true, + 'margin' => true ), 'typography' => array( 'fontSize' => true, @@ -9267,6 +9671,8 @@ 'color' => array( 'gradients' => true, 'link' => true, + 'heading' => true, + 'button' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true @@ -9285,6 +9691,10 @@ 'fontSize' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true, @@ -9361,6 +9771,11 @@ ), 'html' => false, 'layout' => true, + 'spacing' => array( + 'padding' => true, + 'margin' => true, + 'blockGap' => true + ), 'interactivity' => true ) ), @@ -9456,6 +9871,7 @@ ), 'dimensions' => array( 'minHeight' => true, + 'minWidth' => true, '__experimentalDefaultControls' => array( 'minHeight' => false ) @@ -9465,12 +9881,15 @@ '__experimentalFontFamily' => true, 'lineHeight' => true, 'textAlign' => true, + 'textColumns' => true, + 'textIndent' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalWritingMode' => true, + 'fitText' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) @@ -9594,6 +10013,9 @@ 'supports' => array( 'anchor' => true, 'align' => true, + 'filter' => array( + 'duotone' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true, @@ -9603,14 +10025,24 @@ ) ), 'interactivity' => array( - 'clientNavigation' => true + 'clientNavigation' => true, + 'interactive' => true ), 'shadow' => array( '__experimentalSkipSerialization' => true + ), + 'dimensions' => array( + 'minWidth' => true, + 'minHeight' => true, + '__experimentalSkipSerialization' => true ) ), 'selectors' => array( - 'shadow' => '.wp-block-video video' + 'dimensions' => '.wp-block-video video', + 'shadow' => '.wp-block-video video', + 'filter' => array( + 'duotone' => '.wp-block-video video' + ) ), 'editorStyle' => 'wp-block-video-editor', 'style' => 'wp-block-video' diff --git a/src/wp-includes/blocks/breadcrumbs.php b/src/wp-includes/blocks/breadcrumbs.php index 02c038dd057ea..b659afd8259b1 100644 --- a/src/wp-includes/blocks/breadcrumbs.php +++ b/src/wp-includes/blocks/breadcrumbs.php @@ -188,7 +188,7 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) { $wrapper_attributes = get_block_wrapper_attributes( array( 'style' => '--separator: "' . $separator . '";', - 'aria-label' => _x( 'Breadcrumbs', 'area label' ), + 'aria-label' => _x( 'Breadcrumbs', 'aria label' ), ) ); diff --git a/src/wp-includes/blocks/button.php b/src/wp-includes/blocks/button.php index 7b67ad158aed1..fd117e9436a57 100644 --- a/src/wp-includes/blocks/button.php +++ b/src/wp-includes/blocks/button.php @@ -60,6 +60,53 @@ function render_block_core_button( $attributes, $content ) { return ''; } + // Background skips serialization, so apply it to the link like color. + $background = $attributes['style']['background'] ?? null; + + if ( is_array( $background ) ) { + $background_styles = array( + 'backgroundImage' => $background['backgroundImage'] ?? null, + 'backgroundSize' => $background['backgroundSize'] ?? null, + 'backgroundPosition' => $background['backgroundPosition'] ?? null, + 'backgroundRepeat' => $background['backgroundRepeat'] ?? null, + 'backgroundAttachment' => $background['backgroundAttachment'] ?? null, + 'gradient' => $background['gradient'] ?? null, + ); + + // Mirror the background block support defaults. + if ( ! empty( $background_styles['backgroundImage'] ) ) { + $background_styles['backgroundSize'] = $background_styles['backgroundSize'] ?? 'cover'; + if ( 'contain' === $background_styles['backgroundSize'] && ! $background_styles['backgroundPosition'] ) { + $background_styles['backgroundPosition'] = '50% 50%'; + } + } + + $styles = wp_style_engine_get_styles( array( 'background' => $background_styles ) ); + + if ( ! empty( $styles['css'] ) ) { + $processor = new WP_HTML_Tag_Processor( $content ); + while ( $processor->next_tag() ) { + if ( $tag !== $processor->get_tag() ) { + continue; + } + + $existing_style = $processor->get_attribute( 'style' ); + if ( is_string( $existing_style ) && '' !== $existing_style ) { + $separator = str_ends_with( $existing_style, ';' ) ? '' : ';'; + $processor->set_attribute( 'style', $existing_style . $separator . $styles['css'] ); + } else { + $processor->set_attribute( 'style', $styles['css'] ); + } + + if ( ! empty( $background_styles['backgroundImage'] ) || ! empty( $background_styles['gradient'] ) ) { + $processor->add_class( 'has-background' ); + } + break; + } + $content = $processor->get_updated_html(); + } + } + $width = $attributes['style']['dimensions']['width'] ?? null; if ( is_string( $width ) && '' !== $width ) { diff --git a/src/wp-includes/blocks/button/block.json b/src/wp-includes/blocks/button/block.json index 2e23a64c8f559..29e3c1f22c50f 100644 --- a/src/wp-includes/blocks/button/block.json +++ b/src/wp-includes/blocks/button/block.json @@ -70,6 +70,12 @@ "splitting": true, "align": false, "alignWide": false, + "background": { + "backgroundImage": true, + "backgroundSize": true, + "gradient": true, + "__experimentalSkipSerialization": true + }, "color": { "__experimentalSkipSerialization": true, "gradients": true, diff --git a/src/wp-includes/blocks/buttons/block.json b/src/wp-includes/blocks/buttons/block.json index 4927a9644837b..03092ff3dc10a 100644 --- a/src/wp-includes/blocks/buttons/block.json +++ b/src/wp-includes/blocks/buttons/block.json @@ -50,6 +50,10 @@ "fontSize": true } }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "__experimentalBorder": { "color": true, "radius": true, @@ -73,7 +77,8 @@ "clientNavigation": true }, "listView": true, - "contentRole": true + "contentRole": true, + "shadow": true }, "editorStyle": "wp-block-buttons-editor", "style": "wp-block-buttons" diff --git a/src/wp-includes/blocks/code/block.json b/src/wp-includes/blocks/code/block.json index 028a64620cac3..4fad135a9706d 100644 --- a/src/wp-includes/blocks/code/block.json +++ b/src/wp-includes/blocks/code/block.json @@ -27,6 +27,10 @@ "gradient": true } }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "typography": { "fontSize": true, "lineHeight": true, diff --git a/src/wp-includes/blocks/columns/block.json b/src/wp-includes/blocks/columns/block.json index dcd1193ca093e..7f742a87931a1 100644 --- a/src/wp-includes/blocks/columns/block.json +++ b/src/wp-includes/blocks/columns/block.json @@ -43,6 +43,10 @@ "gradient": true } }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "spacing": { "blockGap": { "__experimentalDefault": "2em", diff --git a/src/wp-includes/blocks/comments-pagination-next/block.json b/src/wp-includes/blocks/comments-pagination-next/block.json index 3b3c122a9084d..7cbc1bba7cd1c 100644 --- a/src/wp-includes/blocks/comments-pagination-next/block.json +++ b/src/wp-includes/blocks/comments-pagination-next/block.json @@ -42,6 +42,19 @@ }, "interactivity": { "clientNavigation": true + }, + "spacing": { + "padding": true, + "__experimentalDefaultControls": { + "padding": false + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true } - } + }, + "style": "wp-block-comments-pagination-next" } diff --git a/src/wp-includes/blocks/comments-pagination-previous/block.json b/src/wp-includes/blocks/comments-pagination-previous/block.json index de141ba2bb553..6f857f2030f1d 100644 --- a/src/wp-includes/blocks/comments-pagination-previous/block.json +++ b/src/wp-includes/blocks/comments-pagination-previous/block.json @@ -45,6 +45,19 @@ }, "interactivity": { "clientNavigation": true + }, + "spacing": { + "padding": true, + "__experimentalDefaultControls": { + "padding": false + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true } - } + }, + "style": "wp-block-comments-pagination-previous" } diff --git a/src/wp-includes/blocks/comments-pagination/block.json b/src/wp-includes/blocks/comments-pagination/block.json index a2b7d9fe0b170..867a29736413d 100644 --- a/src/wp-includes/blocks/comments-pagination/block.json +++ b/src/wp-includes/blocks/comments-pagination/block.json @@ -50,6 +50,11 @@ "type": "flex" } }, + "spacing": { + "padding": true, + "margin": true, + "blockGap": true + }, "typography": { "fontSize": true, "lineHeight": true, @@ -63,6 +68,12 @@ "fontSize": true } }, + "__experimentalBorder": { + "color": true, + "radius": true, + "style": true, + "width": true + }, "interactivity": { "clientNavigation": true } diff --git a/src/wp-includes/blocks/cover.php b/src/wp-includes/blocks/cover.php index 8bd1c3f5cd38f..bd7ee8b88034a 100644 --- a/src/wp-includes/blocks/cover.php +++ b/src/wp-includes/blocks/cover.php @@ -16,6 +16,15 @@ * @return string Returns the cover block markup, if useFeaturedImage is true. */ function render_block_core_cover( $attributes, $content ) { + // The view module decides whether a background video may play, so it is + // only needed for the two video background types. + if ( + isset( $attributes['backgroundType'] ) && + in_array( $attributes['backgroundType'], array( 'video', 'embed-video' ), true ) + ) { + wp_enqueue_script_module( '@wordpress/block-library/cover/view' ); + } + // Handle embed video background. if ( isset( $attributes['backgroundType'] ) && @@ -30,11 +39,13 @@ function render_block_core_cover( $attributes, $content ) { $oembed_html = wp_oembed_get( $url ); if ( $oembed_html ) { - // Extract iframe src from the oEmbed HTML. - preg_match( '/src=["\']([^"\']+)["\']/', $oembed_html, $src_matches ); - if ( ! empty( $src_matches[1] ) ) { - $iframe_src = $src_matches[1]; - + // Read the iframe src with the HTML API, which returns the attribute + // value decoded, so `&` in the query string becomes `&`. + $oembed_processor = new WP_HTML_Tag_Processor( $oembed_html ); + $iframe_src = $oembed_processor->next_tag( 'IFRAME' ) + ? $oembed_processor->get_attribute( 'src' ) + : null; + if ( is_string( $iframe_src ) && '' !== $iframe_src ) { // Detect provider from iframe src URL. $lower_src = strtolower( $iframe_src ); $provider = null; @@ -50,7 +61,8 @@ function render_block_core_cover( $attributes, $content ) { } // Modify iframe src to add background video parameters based on provider. - $parsed_url = wp_parse_url( $iframe_src ); + $parsed_url = wp_parse_url( $iframe_src ); + $reduced_motion_src = null; if ( $parsed_url && isset( $parsed_url['host'] ) ) { // Parse existing query parameters. $query_params = array(); @@ -58,9 +70,12 @@ function render_block_core_cover( $attributes, $content ) { parse_str( $parsed_url['query'], $query_params ); } - // Add background video parameters based on provider. + // Add background video parameters based on provider. The + // autoplay parameters are kept separate so a source without + // them can also be built, which the view script swaps in for + // a visitor who has asked for reduced motion. + $autoplay_params = array(); if ( 'youtube' === $provider ) { - $query_params['autoplay'] = '1'; $query_params['mute'] = '1'; $query_params['loop'] = '1'; $query_params['controls'] = '0'; @@ -74,32 +89,53 @@ function render_block_core_cover( $attributes, $content ) { if ( $video_id ) { $query_params['playlist'] = $video_id; } + + $autoplay_params['autoplay'] = '1'; } elseif ( 'vimeo' === $provider ) { - $query_params['autoplay'] = '1'; $query_params['muted'] = '1'; $query_params['loop'] = '1'; - $query_params['background'] = '1'; $query_params['controls'] = '0'; $query_params['transparent'] = '0'; + + // Vimeo's background mode always autoplays, so it can only + // be used when autoplay is allowed. + $autoplay_params['autoplay'] = '1'; + $autoplay_params['background'] = '1'; } elseif ( 'videopress' === $provider || 'wordpress-tv' === $provider ) { - $query_params['autoplay'] = '1'; - $query_params['loop'] = '1'; - $query_params['muted'] = '1'; + $query_params['loop'] = '1'; + $query_params['muted'] = '1'; + + $autoplay_params['autoplay'] = '1'; } // Rebuild the URL with new parameters. - $iframe_src = $parsed_url['scheme'] . '://' . $parsed_url['host']; + $iframe_base = $parsed_url['scheme'] . '://' . $parsed_url['host']; if ( isset( $parsed_url['path'] ) ) { - $iframe_src .= $parsed_url['path']; - } - if ( ! empty( $query_params ) ) { - $iframe_src .= '?' . http_build_query( $query_params ); + $iframe_base .= $parsed_url['path']; } + + $reduced_motion_src = empty( $query_params ) + ? $iframe_base + : $iframe_base . '?' . http_build_query( $query_params ); + + $iframe_src = empty( $autoplay_params ) + ? $reduced_motion_src + : $iframe_base . '?' . http_build_query( array_merge( $query_params, $autoplay_params ) ); } - // Build the iframe HTML that will replace the figure. + // Build the iframe HTML that will replace the figure. The server + // renders the autoplaying source, and the view script swaps in the + // one without autoplay for a visitor who prefers reduced motion. $iframe_html = sprintf( - '
', + '
', + esc_attr( + wp_json_encode( + array( + 'src' => $iframe_src, + 'reducedMotionSrc' => $reduced_motion_src, + ) + ) + ), esc_url( $iframe_src ) ); @@ -130,6 +166,31 @@ function render_block_core_cover( $attributes, $content ) { return $content; } + // Handle uploaded video background. The video is saved with `autoplay`, so + // the view module stops it for a visitor who prefers reduced motion. The + // directives are added here rather than in the saved markup so existing + // content does not need a deprecation. + if ( + isset( $attributes['backgroundType'] ) && + 'video' === $attributes['backgroundType'] + ) { + $processor = new WP_HTML_Tag_Processor( $content ); + + if ( $processor->next_tag( + array( + 'tag_name' => 'VIDEO', + 'class_name' => 'wp-block-cover__video-background', + ) + ) ) { + $processor->set_attribute( 'data-wp-interactive', 'core/cover' ); + $processor->set_attribute( 'data-wp-init', 'callbacks.stopBackgroundVideo' ); + + $content = $processor->get_updated_html(); + } + + return $content; + } + if ( 'image' !== $attributes['backgroundType'] || false === $attributes['useFeaturedImage'] ) { return $content; } diff --git a/src/wp-includes/blocks/cover/block.json b/src/wp-includes/blocks/cover/block.json index 1d95f80402e61..5419ecfcd6eb0 100644 --- a/src/wp-includes/blocks/cover/block.json +++ b/src/wp-includes/blocks/cover/block.json @@ -129,12 +129,15 @@ "color": { "heading": true, "text": true, + "link": true, + "button": true, "background": false, "__experimentalSkipSerialization": [ "gradients" ], "enableContrastChecker": false }, "dimensions": { - "aspectRatio": true + "aspectRatio": true, + "minWidth": true }, "typography": { "fontSize": true, @@ -153,7 +156,8 @@ "allowJustification": false }, "interactivity": { - "clientNavigation": true + "clientNavigation": true, + "interactive": true }, "filter": { "duotone": true diff --git a/src/wp-includes/blocks/details/block.json b/src/wp-includes/blocks/details/block.json index f5a2a1a6c3edc..ef2ad1428c39c 100644 --- a/src/wp-includes/blocks/details/block.json +++ b/src/wp-includes/blocks/details/block.json @@ -67,6 +67,9 @@ "padding": false } }, + "dimensions": { + "minWidth": true + }, "typography": { "fontSize": true, "lineHeight": true, diff --git a/src/wp-includes/blocks/embed/block.json b/src/wp-includes/blocks/embed/block.json index d6f7c501d6507..41db597f29949 100644 --- a/src/wp-includes/blocks/embed/block.json +++ b/src/wp-includes/blocks/embed/block.json @@ -43,8 +43,13 @@ "supports": { "anchor": true, "align": true, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "spacing": { - "margin": true + "margin": true, + "padding": true }, "interactivity": { "clientNavigation": true diff --git a/src/wp-includes/blocks/file/block.json b/src/wp-includes/blocks/file/block.json index 24eeba2b2c386..68e389a4d28fb 100644 --- a/src/wp-includes/blocks/file/block.json +++ b/src/wp-includes/blocks/file/block.json @@ -78,6 +78,10 @@ "margin": true, "padding": true }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "color": { "gradients": true, "link": true, @@ -99,6 +103,20 @@ "style": true } }, + "shadow": true, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, "interactivity": true }, "editorStyle": "wp-block-file-editor", diff --git a/src/wp-includes/blocks/footnotes/block.json b/src/wp-includes/blocks/footnotes/block.json index 393f7f702ab99..07fb9171aa243 100644 --- a/src/wp-includes/blocks/footnotes/block.json +++ b/src/wp-includes/blocks/footnotes/block.json @@ -53,6 +53,10 @@ "padding": false } }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "typography": { "fontSize": true, "lineHeight": true, diff --git a/src/wp-includes/blocks/gallery.php b/src/wp-includes/blocks/gallery.php index 5474503702a65..587a6e349f93a 100644 --- a/src/wp-includes/blocks/gallery.php +++ b/src/wp-includes/blocks/gallery.php @@ -469,6 +469,11 @@ function block_core_gallery_render_dynamic_image( $attachment_id, $attributes, $ * @return string The content of the block being rendered. */ function block_core_gallery_render( $attributes, $content, $block ) { + /* + * Reads global styles once per request. wp_get_global_styles() has no cache + * of its own, so without this static each gallery would merge the theme.json + * data again wherever the resolver does not cache the merged result. + */ static $global_styles = null; // Gallery blocks created before layout variations existed do not have an @@ -554,13 +559,6 @@ function block_core_gallery_render( $attributes, $content, $block ) { $style_attr = is_array( $attributes['style'] ?? null ) ? $attributes['style'] : array(); - if ( - defined( 'IS_GUTENBERG_PLUGIN' ) && - IS_GUTENBERG_PLUGIN && - function_exists( 'gutenberg_resolve_style_state_aliases' ) - ) { - $style_attr = gutenberg_resolve_style_state_aliases( $style_attr, 'core/gallery' ); - } $global_settings = wp_get_global_settings(); $viewport_settings = $global_settings['viewport'] ?? null; diff --git a/src/wp-includes/blocks/gallery/block.json b/src/wp-includes/blocks/gallery/block.json index 44158bb0fd0ad..a18adb2573b8c 100644 --- a/src/wp-includes/blocks/gallery/block.json +++ b/src/wp-includes/blocks/gallery/block.json @@ -166,6 +166,11 @@ "background": true, "gradients": true }, + "shadow": true, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "layout": { "allowSwitching": false, "allowInheriting": false, @@ -179,11 +184,19 @@ "type": "flex" } }, + "filter": { + "duotone": true + }, "interactivity": { "clientNavigation": true }, "listView": true }, + "selectors": { + "filter": { + "duotone": ".wp-block-gallery :where(img)" + } + }, "editorStyle": "wp-block-gallery-editor", "style": "wp-block-gallery" } diff --git a/src/wp-includes/blocks/heading/block.json b/src/wp-includes/blocks/heading/block.json index 4498f79781735..a19a6ecdd33a7 100644 --- a/src/wp-includes/blocks/heading/block.json +++ b/src/wp-includes/blocks/heading/block.json @@ -31,6 +31,7 @@ "className": true, "splitting": true, "background": { + "backgroundClip": true, "backgroundImage": true, "backgroundSize": true, "gradient": true, @@ -53,6 +54,10 @@ "text": true } }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "shadow": true, "spacing": { "margin": true, @@ -66,6 +71,7 @@ "fontSize": true, "lineHeight": true, "textAlign": true, + "textIndent": true, "__experimentalFontFamily": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, diff --git a/src/wp-includes/blocks/home-link/block.json b/src/wp-includes/blocks/home-link/block.json index 036e967883164..733a3afdd8e0d 100644 --- a/src/wp-includes/blocks/home-link/block.json +++ b/src/wp-includes/blocks/home-link/block.json @@ -52,6 +52,10 @@ } }, "shadow": true, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "__experimentalBorder": { "color": true, "radius": true, @@ -64,6 +68,14 @@ "width": false } }, + "spacing": { + "margin": true, + "padding": true, + "__experimentalDefaultControls": { + "margin": false, + "padding": false + } + }, "interactivity": { "clientNavigation": true } diff --git a/src/wp-includes/blocks/icon.php b/src/wp-includes/blocks/icon.php index 1b615c8a6dc96..fe5e9dcb41fe4 100644 --- a/src/wp-includes/blocks/icon.php +++ b/src/wp-includes/blocks/icon.php @@ -15,7 +15,7 @@ * @return string Returns the Icon. */ function render_block_core_icon( $attributes ) { - if ( empty( $attributes['icon'] ) ) { + if ( empty( $attributes['icon'] ) || ! is_string( $attributes['icon'] ) ) { return; } @@ -39,6 +39,23 @@ function render_block_core_icon( $attributes ) { $custom_background_color = $attributes['style']['color']['background'] ?? null; $color_styles['background'] = $preset_background_color ? $preset_background_color : $custom_background_color; + // Background image, size and gradient. + $background_styles = array(); + if ( isset( $attributes['style']['background'] ) && is_array( $attributes['style']['background'] ) ) { + $background_styles = array_intersect_key( + $attributes['style']['background'], + array_flip( array( 'backgroundImage', 'backgroundSize', 'backgroundPosition', 'backgroundRepeat', 'backgroundAttachment', 'gradient' ) ) + ); + + // Mirror of the defaults in the background block support. + if ( ! empty( $background_styles['backgroundImage'] ) ) { + $background_styles['backgroundSize'] = $background_styles['backgroundSize'] ?? 'cover'; + if ( 'contain' === $background_styles['backgroundSize'] && empty( $background_styles['backgroundPosition'] ) ) { + $background_styles['backgroundPosition'] = '50% 50%'; + } + } + } + // Border. $border_styles = array(); $sides = array( 'top', 'right', 'bottom', 'left' ); @@ -66,23 +83,30 @@ function render_block_core_icon( $attributes ) { ); } + // Shadow. + $shadow_styles = $attributes['style']['shadow'] ?? null; + // Spacing (Padding). $spacing_styles = array(); if ( isset( $attributes['style']['spacing']['padding'] ) ) { $spacing_styles['padding'] = $attributes['style']['spacing']['padding']; } - // Dimensions (Width). + // Dimensions (Width, Min width, Min height). $dimensions_styles = array(); - if ( isset( $attributes['style']['dimensions']['width'] ) ) { - $dimensions_styles['width'] = $attributes['style']['dimensions']['width']; + foreach ( array( 'width', 'minWidth', 'minHeight' ) as $dimension ) { + if ( isset( $attributes['style']['dimensions'][ $dimension ] ) ) { + $dimensions_styles[ $dimension ] = $attributes['style']['dimensions'][ $dimension ]; + } } // Generate styles and classes. $styles = wp_style_engine_get_styles( array( 'color' => $color_styles, + 'background' => $background_styles, 'border' => $border_styles, + 'shadow' => $shadow_styles, 'spacing' => $spacing_styles, 'dimensions' => $dimensions_styles, ), @@ -118,6 +142,11 @@ function render_block_core_icon( $attributes ) { $processor->set_attribute( 'style', $merged_style ); } + // The style engine only adds `has-background` for a gradient. + if ( ! empty( $background_styles['backgroundImage'] ) ) { + $processor->add_class( 'has-background' ); + } + // Apply flip classes to the SVG. $flip_horizontal = $attributes['flipHorizontal'] ?? false; $flip_vertical = $attributes['flipVertical'] ?? false; diff --git a/src/wp-includes/blocks/icon/block.json b/src/wp-includes/blocks/icon/block.json index de9f71af79e4b..ddc62d6216c12 100644 --- a/src/wp-includes/blocks/icon/block.json +++ b/src/wp-includes/blocks/icon/block.json @@ -31,6 +31,12 @@ "__experimentalSkipSerialization": true }, "align": [ "left", "center", "right" ], + "background": { + "backgroundImage": true, + "backgroundSize": true, + "gradient": true, + "__experimentalSkipSerialization": true + }, "html": false, "color": { "__experimentalSkipSerialization": true, @@ -42,6 +48,9 @@ "interactivity": { "clientNavigation": true }, + "shadow": { + "__experimentalSkipSerialization": true + }, "__experimentalBorder": { "color": true, "radius": true, @@ -66,7 +75,13 @@ }, "dimensions": { "width": true, - "__experimentalSkipSerialization": [ "width" ], + "minWidth": true, + "minHeight": true, + "__experimentalSkipSerialization": [ + "width", + "minWidth", + "minHeight" + ], "__experimentalDefaultControls": { "width": true } @@ -75,6 +90,7 @@ "selectors": { "root": ".wp-block-icon svg", "css": ".wp-block-icon", + "shadow": ".wp-block-icon svg", "spacing": { "margin": ".wp-block-icon" } diff --git a/src/wp-includes/blocks/image.php b/src/wp-includes/blocks/image.php index aef905ef59a64..8035a99782c7f 100644 --- a/src/wp-includes/blocks/image.php +++ b/src/wp-includes/blocks/image.php @@ -369,13 +369,13 @@ class="wp-lightbox-overlay zoom" data-wp-on--touchstart="actions.handleTouchStart" data-wp-on--touchmove="actions.handleTouchMove" data-wp-on--touchend="actions.handleTouchEnd" - data-wp-on--click="actions.hideLightbox" + data-wp-on--touchcancel="actions.handleTouchCancel" data-wp-on-window--resize="callbacks.setOverlayStyles" data-wp-on-window--scroll="actions.handleScroll" data-wp-bind--style="state.overlayStyles" tabindex="-1" > - @@ -383,7 +383,7 @@ class="wp-lightbox-overlay zoom" {$prev_button_icon} {$prev_button_text} -