From 476c5afeb968872b96bc71e1a7f20388a7262dab Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Mon, 18 May 2026 08:35:28 -0400 Subject: [PATCH 1/8] Ensure new and binary files are detected. This adjusts the GitHub Actions workflow code to account for new and/or binary files when checking for changes to files subject to version control. --- .../workflows/reusable-check-built-files.yml | 10 +++++++--- .../workflows/test-and-zip-default-themes.yml | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reusable-check-built-files.yml b/.github/workflows/reusable-check-built-files.yml index 10f4dbb76d8c0..acaca2882e1e8 100644 --- a/.github/workflows/reusable-check-built-files.yml +++ b/.github/workflows/reusable-check-built-files.yml @@ -88,19 +88,23 @@ jobs: - name: Check for changes to versioned files id: built-file-check run: | - if git diff --quiet; then + if [ -z "$(git status --porcelain)" ]; then echo "uncommitted_changes=false" >> "$GITHUB_OUTPUT" else echo "uncommitted_changes=true" >> "$GITHUB_OUTPUT" fi + - name: Stage all changes for diff generation + if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }} + run: git add -A + - name: Display changes to versioned files if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }} - run: git diff + run: git diff --cached - name: Save diff to a file if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }} - run: git diff > ./changes.diff + run: git diff --cached --binary > ./changes.diff # Uploads the diff file as an artifact. - name: Upload diff file as artifact diff --git a/.github/workflows/test-and-zip-default-themes.yml b/.github/workflows/test-and-zip-default-themes.yml index 1a44a8ff12e3a..beddb9b0d178b 100644 --- a/.github/workflows/test-and-zip-default-themes.yml +++ b/.github/workflows/test-and-zip-default-themes.yml @@ -160,19 +160,23 @@ jobs: id: built-file-check if: ${{ github.event_name == 'pull_request' }} run: | - if git diff --quiet; then + if [ -z "$(git status --porcelain)" ]; then echo "uncommitted_changes=false" >> "$GITHUB_OUTPUT" else echo "uncommitted_changes=true" >> "$GITHUB_OUTPUT" fi + - name: Stage all changes for diff generation + if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }} + run: git add -A + - name: Display changes to versioned files if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }} - run: git diff + run: git diff --cached - name: Save diff to a file if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }} - run: git diff > ./changes.diff + run: git diff --cached --binary > ./changes.diff # Uploads the diff file as an artifact. - name: Upload diff file as artifact @@ -183,7 +187,12 @@ jobs: path: src/wp-content/themes/${{ matrix.theme }}/changes.diff - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "Uncommitted changes detected after build:" + git status --porcelain + exit 1 + fi # Prepares bundled themes for release. # From 13f4df5b9b5e94af323342ba758e95ecd8d6d2b1 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Wed, 27 May 2026 15:17:06 -0400 Subject: [PATCH 2/8] Bump `gutenberg.sha` to version `23.2.2`. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 430efdd2fba85..bbe002da7d1e8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://develop.svn.wordpress.org/trunk" }, "gutenberg": { - "sha": "a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd", + "sha": "218238c46b9161375b1969989cb750038d44355d", "ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build" }, "engines": { From 97e56efe043a610ae92cd18e4c74253fcb9751b4 Mon Sep 17 00:00:00 2001 From: "wordpress-develop-pr-bot[bot]" <1178653+wordpress-develop-pr-bot[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 19:19:34 +0000 Subject: [PATCH 3/8] Automation: Updating built files with changes. --- .../assets/script-loader-packages.php | 113 +- .../assets/script-modules-packages.php | 53 +- src/wp-includes/blocks/accordion-item.php | 1 - .../blocks/accordion-item/block.json | 1 + src/wp-includes/blocks/blocks-json.php | 82 +- src/wp-includes/blocks/button.php | 68 + src/wp-includes/blocks/button/block.json | 14 +- src/wp-includes/blocks/cover.php | 8 +- src/wp-includes/blocks/group/block.json | 7 +- src/wp-includes/blocks/home-link.php | 47 +- src/wp-includes/blocks/icon.php | 4 +- src/wp-includes/blocks/latest-posts.php | 2 +- src/wp-includes/blocks/list-item/block.json | 1 + src/wp-includes/blocks/loginout.php | 13 + src/wp-includes/blocks/navigation-link.php | 68 +- .../blocks/navigation-link/block.json | 5 + .../shared/build-css-font-sizes.php | 43 + src/wp-includes/blocks/navigation-submenu.php | 76 +- src/wp-includes/blocks/navigation.php | 11 - src/wp-includes/blocks/page-list.php | 57 +- src/wp-includes/blocks/post-date/block.json | 4 +- .../blocks/post-excerpt/block.json | 4 +- .../blocks/post-featured-image.php | 6 +- .../blocks/post-navigation-link/block.json | 4 +- src/wp-includes/blocks/post-template.php | 3 + src/wp-includes/blocks/post-title/block.json | 7 +- src/wp-includes/blocks/pullquote/block.json | 5 +- src/wp-includes/blocks/query-title.php | 2 +- src/wp-includes/blocks/query-title/block.json | 4 +- src/wp-includes/blocks/search.php | 28 +- src/wp-includes/blocks/search/block.json | 10 +- .../blocks/site-tagline/block.json | 10 +- src/wp-includes/blocks/site-title/block.json | 4 +- src/wp-includes/build/constants.php | 2 +- src/wp-includes/build/pages.php | 24 +- .../build/pages/content-types/loader.js | 1 + .../pages/content-types/page-wp-admin.php | 294 + .../build/pages/content-types/page.php | 332 + .../build/pages/dashboard/loader.js | 1 + .../build/pages/dashboard/page-wp-admin.php | 294 + .../build/pages/dashboard/page.php | 332 + .../build/pages/experiments/loader.js | 1 + .../build/pages/experiments/page-wp-admin.php | 294 + .../build/pages/experiments/page.php | 332 + .../pages/font-library/page-wp-admin.php | 46 +- .../build/pages/font-library/page.php | 17 +- .../build/pages/guidelines/loader.js | 1 + .../build/pages/guidelines/page-wp-admin.php | 294 + .../build/pages/guidelines/page.php | 332 + .../build/pages/media-editor/loader.js | 1 + .../pages/media-editor/page-wp-admin.php | 294 + .../build/pages/media-editor/page.php | 332 + .../options-connectors/page-wp-admin.php | 46 +- .../build/pages/options-connectors/page.php | 17 +- src/wp-includes/build/routes.php | 95 + .../build/routes/connectors-home/content.js | 10584 ++++- .../connectors-home/content.min.asset.php | 2 +- .../routes/connectors-home/content.min.js | 26 +- .../build/routes/content-types/route.js | 46 + .../routes/content-types/route.min.asset.php | 1 + .../build/routes/content-types/route.min.js | 1 + .../build/routes/dashboard/content.js | 38249 ++++++++++++++++ .../routes/dashboard/content.min.asset.php | 1 + .../build/routes/dashboard/content.min.js | 35 + .../build/routes/experiments-home/content.js | 11219 +++++ .../experiments-home/content.min.asset.php | 1 + .../routes/experiments-home/content.min.js | 1 + .../build/routes/experiments-home/route.js | 41 + .../experiments-home/route.min.asset.php | 1 + .../routes/experiments-home/route.min.js | 1 + .../build/routes/font-list/content.js | 1377 +- .../routes/font-list/content.min.asset.php | 2 +- .../build/routes/font-list/content.min.js | 14 +- .../build/routes/guidelines/content.js | 23749 ++++++++++ .../routes/guidelines/content.min.asset.php | 1 + .../build/routes/guidelines/content.min.js | 14 + .../build/routes/guidelines/route.js | 79 + .../routes/guidelines/route.min.asset.php | 1 + .../build/routes/guidelines/route.min.js | 1 + .../build/routes/media-editor/content.js | 17746 +++++++ .../routes/media-editor/content.min.asset.php | 1 + .../build/routes/media-editor/content.min.js | 1 + .../build/routes/media-editor/route.js | 103 + .../routes/media-editor/route.min.asset.php | 1 + .../build/routes/media-editor/route.min.js | 1 + .../build/routes/post-type-edit/content.js | 16 + .../post-type-edit/content.min.asset.php | 1 + .../routes/post-type-edit/content.min.js | 1 + .../build/routes/post-type-edit/route.js | 106 + .../routes/post-type-edit/route.min.asset.php | 1 + .../build/routes/post-type-edit/route.min.js | 1 + .../build/routes/post-types-list/content.js | 19 + .../post-types-list/content.min.asset.php | 1 + .../routes/post-types-list/content.min.js | 1 + .../build/routes/post-types-list/route.js | 41 + .../post-types-list/route.min.asset.php | 1 + .../build/routes/post-types-list/route.min.js | 1 + src/wp-includes/build/routes/registry.php | 63 + .../build/routes/taxonomies-list/content.js | 19 + .../taxonomies-list/content.min.asset.php | 1 + .../routes/taxonomies-list/content.min.js | 1 + .../build/routes/taxonomies-list/route.js | 41 + .../taxonomies-list/route.min.asset.php | 1 + .../build/routes/taxonomies-list/route.min.js | 1 + .../build/routes/taxonomy-edit/content.js | 16 + .../taxonomy-edit/content.min.asset.php | 1 + .../build/routes/taxonomy-edit/content.min.js | 1 + .../build/routes/taxonomy-edit/route.js | 106 + .../routes/taxonomy-edit/route.min.asset.php | 1 + .../build/routes/taxonomy-edit/route.min.js | 1 + .../images/icon-library/tab-list.svg | 1 + .../images/icon-library/tab-panel.svg | 1 + src/wp-includes/images/icon-library/tab.svg | 2 +- src/wp-includes/theme.json | 25 + 114 files changed, 106707 insertions(+), 1212 deletions(-) create mode 100644 src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php create mode 100644 src/wp-includes/build/pages/content-types/loader.js create mode 100644 src/wp-includes/build/pages/content-types/page-wp-admin.php create mode 100644 src/wp-includes/build/pages/content-types/page.php create mode 100644 src/wp-includes/build/pages/dashboard/loader.js create mode 100644 src/wp-includes/build/pages/dashboard/page-wp-admin.php create mode 100644 src/wp-includes/build/pages/dashboard/page.php create mode 100644 src/wp-includes/build/pages/experiments/loader.js create mode 100644 src/wp-includes/build/pages/experiments/page-wp-admin.php create mode 100644 src/wp-includes/build/pages/experiments/page.php create mode 100644 src/wp-includes/build/pages/guidelines/loader.js create mode 100644 src/wp-includes/build/pages/guidelines/page-wp-admin.php create mode 100644 src/wp-includes/build/pages/guidelines/page.php create mode 100644 src/wp-includes/build/pages/media-editor/loader.js create mode 100644 src/wp-includes/build/pages/media-editor/page-wp-admin.php create mode 100644 src/wp-includes/build/pages/media-editor/page.php create mode 100644 src/wp-includes/build/routes/content-types/route.js create mode 100644 src/wp-includes/build/routes/content-types/route.min.asset.php create mode 100644 src/wp-includes/build/routes/content-types/route.min.js create mode 100644 src/wp-includes/build/routes/dashboard/content.js create mode 100644 src/wp-includes/build/routes/dashboard/content.min.asset.php create mode 100644 src/wp-includes/build/routes/dashboard/content.min.js create mode 100644 src/wp-includes/build/routes/experiments-home/content.js create mode 100644 src/wp-includes/build/routes/experiments-home/content.min.asset.php create mode 100644 src/wp-includes/build/routes/experiments-home/content.min.js create mode 100644 src/wp-includes/build/routes/experiments-home/route.js create mode 100644 src/wp-includes/build/routes/experiments-home/route.min.asset.php create mode 100644 src/wp-includes/build/routes/experiments-home/route.min.js create mode 100644 src/wp-includes/build/routes/guidelines/content.js create mode 100644 src/wp-includes/build/routes/guidelines/content.min.asset.php create mode 100644 src/wp-includes/build/routes/guidelines/content.min.js create mode 100644 src/wp-includes/build/routes/guidelines/route.js create mode 100644 src/wp-includes/build/routes/guidelines/route.min.asset.php create mode 100644 src/wp-includes/build/routes/guidelines/route.min.js create mode 100644 src/wp-includes/build/routes/media-editor/content.js create mode 100644 src/wp-includes/build/routes/media-editor/content.min.asset.php create mode 100644 src/wp-includes/build/routes/media-editor/content.min.js create mode 100644 src/wp-includes/build/routes/media-editor/route.js create mode 100644 src/wp-includes/build/routes/media-editor/route.min.asset.php create mode 100644 src/wp-includes/build/routes/media-editor/route.min.js create mode 100644 src/wp-includes/build/routes/post-type-edit/content.js create mode 100644 src/wp-includes/build/routes/post-type-edit/content.min.asset.php create mode 100644 src/wp-includes/build/routes/post-type-edit/content.min.js create mode 100644 src/wp-includes/build/routes/post-type-edit/route.js create mode 100644 src/wp-includes/build/routes/post-type-edit/route.min.asset.php create mode 100644 src/wp-includes/build/routes/post-type-edit/route.min.js create mode 100644 src/wp-includes/build/routes/post-types-list/content.js create mode 100644 src/wp-includes/build/routes/post-types-list/content.min.asset.php create mode 100644 src/wp-includes/build/routes/post-types-list/content.min.js create mode 100644 src/wp-includes/build/routes/post-types-list/route.js create mode 100644 src/wp-includes/build/routes/post-types-list/route.min.asset.php create mode 100644 src/wp-includes/build/routes/post-types-list/route.min.js create mode 100644 src/wp-includes/build/routes/taxonomies-list/content.js create mode 100644 src/wp-includes/build/routes/taxonomies-list/content.min.asset.php create mode 100644 src/wp-includes/build/routes/taxonomies-list/content.min.js create mode 100644 src/wp-includes/build/routes/taxonomies-list/route.js create mode 100644 src/wp-includes/build/routes/taxonomies-list/route.min.asset.php create mode 100644 src/wp-includes/build/routes/taxonomies-list/route.min.js create mode 100644 src/wp-includes/build/routes/taxonomy-edit/content.js create mode 100644 src/wp-includes/build/routes/taxonomy-edit/content.min.asset.php create mode 100644 src/wp-includes/build/routes/taxonomy-edit/content.min.js create mode 100644 src/wp-includes/build/routes/taxonomy-edit/route.js create mode 100644 src/wp-includes/build/routes/taxonomy-edit/route.min.asset.php create mode 100644 src/wp-includes/build/routes/taxonomy-edit/route.min.js create mode 100644 src/wp-includes/images/icon-library/tab-list.svg create mode 100644 src/wp-includes/images/icon-library/tab-panel.svg diff --git a/src/wp-includes/assets/script-loader-packages.php b/src/wp-includes/assets/script-loader-packages.php index fa631e47f7afd..11907dd114bf3 100644 --- a/src/wp-includes/assets/script-loader-packages.php +++ b/src/wp-includes/assets/script-loader-packages.php @@ -4,7 +4,7 @@ 'wp-dom-ready', 'wp-i18n' ), - 'version' => 'af934e5259bc51b8718e' + 'version' => '483af07a6016f640f456' ), 'annotations.js' => array( 'dependencies' => array( @@ -13,14 +13,14 @@ 'wp-i18n', 'wp-rich-text' ), - 'version' => '4b07d06c67c3b5ea590c' + 'version' => 'd4fe1eeb787c2fd5ee89' ), 'api-fetch.js' => array( 'dependencies' => array( 'wp-i18n', 'wp-url' ), - 'version' => 'd7efe4dc1468d36c39b8' + 'version' => 'b76aeca1c88ecc790e48' ), 'autop.js' => array( 'dependencies' => array( @@ -42,6 +42,8 @@ ), 'block-directory.js' => array( 'dependencies' => array( + 'react', + 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', @@ -59,9 +61,11 @@ 'wp-notices', 'wp-plugins', 'wp-primitives', + 'wp-private-apis', + 'wp-theme', 'wp-url' ), - 'version' => '23207f52d0d266f6e1c4' + 'version' => '43a9d7ab2fbaa04615a1' ), 'block-editor.js' => array( 'dependencies' => array( @@ -69,7 +73,6 @@ 'react-dom', 'react-jsx-runtime', 'wp-a11y', - 'wp-api-fetch', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-blocks', @@ -100,11 +103,12 @@ 'wp-url', 'wp-warning' ), - 'version' => '93c3566b7f24c15b7e17' + 'version' => '5a398d1da02bf80f3f98' ), 'block-library.js' => array( 'dependencies' => array( 'react', + 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', @@ -132,6 +136,8 @@ 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', + 'wp-shortcode', + 'wp-theme', 'wp-upload-media', 'wp-url', 'wp-wordcount' @@ -142,7 +148,7 @@ 'import' => 'dynamic' ) ), - 'version' => '2dffdfe77b9c5cba960e' + 'version' => '9c1171e882b2ba2f7411' ), 'block-serialization-default-parser.js' => array( 'dependencies' => array( @@ -175,7 +181,7 @@ 'wp-shortcode', 'wp-warning' ), - 'version' => 'ef38e42500165bfda301' + 'version' => 'ece1f172d5b708916ebc' ), 'commands.js' => array( 'dependencies' => array( @@ -187,10 +193,11 @@ 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', + 'wp-preferences', 'wp-primitives', 'wp-private-apis' ), - 'version' => 'e3d8bba53f4ffea4fcd2' + 'version' => '8b8663311faa33540c1b' ), 'components.js' => array( 'dependencies' => array( @@ -214,7 +221,7 @@ 'wp-rich-text', 'wp-warning' ), - 'version' => '5dedfe13f08880193a28' + 'version' => '83936472a0d07a3a4c92' ), 'compose.js' => array( 'dependencies' => array( @@ -228,7 +235,7 @@ 'wp-priority-queue', 'wp-undo-manager' ), - 'version' => 'edb5a8c0b5bf71686403' + 'version' => '2b5a9d090a41c1120be7' ), 'core-commands.js' => array( 'dependencies' => array( @@ -245,7 +252,7 @@ 'wp-router', 'wp-url' ), - 'version' => 'b209152e7e51279d7c28' + 'version' => 'c5adbb84012bd7834c04' ), 'core-data.js' => array( 'dependencies' => array( @@ -257,20 +264,23 @@ 'wp-data', 'wp-deprecated', 'wp-element', - 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-private-apis', 'wp-rich-text', + 'wp-sync', 'wp-undo-manager', 'wp-url', 'wp-warning' ), - 'version' => '89931f90e4df5eb5f8a3' + 'version' => '21fd0114d22869dbe459' ), 'customize-widgets.js' => array( 'dependencies' => array( + 'react', + 'react-dom', 'react-jsx-runtime', + 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', @@ -289,9 +299,10 @@ 'wp-preferences', 'wp-primitives', 'wp-private-apis', + 'wp-theme', 'wp-widgets' ), - 'version' => '524dc7a4326b77064831' + 'version' => '4da0091c281df82bd222' ), 'data.js' => array( 'dependencies' => array( @@ -304,7 +315,7 @@ 'wp-private-apis', 'wp-redux-routine' ), - 'version' => '1756b6a2676c1b3369ab' + 'version' => 'ee4e907a070c9780da2b' ), 'data-controls.js' => array( 'dependencies' => array( @@ -319,7 +330,7 @@ 'moment', 'wp-deprecated' ), - 'version' => 'c9f8e7dd3232716f34e9' + 'version' => '2faaf49020b2074de156' ), 'deprecated.js' => array( 'dependencies' => array( @@ -331,7 +342,7 @@ 'dependencies' => array( 'wp-deprecated' ), - 'version' => '66a6cf58e0c4cd128af0' + 'version' => '1acdd4ebd6969685a9d3' ), 'dom-ready.js' => array( 'dependencies' => array( @@ -381,7 +392,7 @@ 'import' => 'static' ) ), - 'version' => '28ef50b859708963e197' + 'version' => 'e5a1146f8586938ade23' ), 'edit-site.js' => array( 'dependencies' => array( @@ -409,6 +420,7 @@ 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', + 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', @@ -420,7 +432,8 @@ 'wp-theme', 'wp-url', 'wp-warning', - 'wp-widgets' + 'wp-widgets', + 'wp-wordcount' ), 'module_dependencies' => array( array( @@ -428,7 +441,7 @@ 'import' => 'static' ) ), - 'version' => 'dfd078032a67983c4d32' + 'version' => '25ce07d8e96c49452e7a' ), 'edit-widgets.js' => array( 'dependencies' => array( @@ -469,7 +482,7 @@ 'import' => 'static' ) ), - 'version' => '899c5ac5dcb94e19d378' + 'version' => '3382b8166d24bc8ebc42' ), 'editor.js' => array( 'dependencies' => array( @@ -519,7 +532,7 @@ 'import' => 'static' ) ), - 'version' => '37faadbdf6c40cb0c71c' + 'version' => '3e365e98ba94f24ff5cf' ), 'element.js' => array( 'dependencies' => array( @@ -527,7 +540,7 @@ 'react-dom', 'wp-escape-html' ), - 'version' => '15ba804677f72a8db97b' + 'version' => 'ce395381f7d64d2a6d71' ), 'escape-html.js' => array( 'dependencies' => array( @@ -537,6 +550,8 @@ ), 'format-library.js' => array( 'dependencies' => array( + 'react', + 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-block-editor', @@ -549,6 +564,7 @@ 'wp-primitives', 'wp-private-apis', 'wp-rich-text', + 'wp-theme', 'wp-url' ), 'module_dependencies' => array( @@ -557,7 +573,7 @@ 'import' => 'dynamic' ) ), - 'version' => 'f89be9586f2d9ce4545a' + 'version' => 'b38d376fe79b3eac1578' ), 'hooks.js' => array( 'dependencies' => array( @@ -575,7 +591,7 @@ 'dependencies' => array( 'wp-hooks' ), - 'version' => '781d11515ad3d91786ec' + 'version' => '125448662852c5e18937' ), 'is-shallow-equal.js' => array( 'dependencies' => array( @@ -590,7 +606,7 @@ 'wp-element', 'wp-keycodes' ), - 'version' => '2ed78d3b4c23f38804e0' + 'version' => '0dd268b2132a3f82b1d4' ), 'keycodes.js' => array( 'dependencies' => array( @@ -608,7 +624,7 @@ 'wp-element', 'wp-i18n' ), - 'version' => '2e35ebd5dbaccb5a90c5' + 'version' => 'a44da9be02cdfef6e44d' ), 'media-utils.js' => array( 'dependencies' => array( @@ -628,13 +644,14 @@ 'wp-i18n', 'wp-keycodes', 'wp-notices', + 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-theme', 'wp-url', 'wp-warning' ), - 'version' => '85f1375ab5f23cd5d13c' + 'version' => '597bd2b6e79b271e52c7' ), 'notices.js' => array( 'dependencies' => array( @@ -642,7 +659,7 @@ 'wp-components', 'wp-data' ), - 'version' => '218d0173a31ae7269246' + 'version' => '1869781df3f0e4f0c6b8' ), 'nux.js' => array( 'dependencies' => array( @@ -655,7 +672,7 @@ 'wp-i18n', 'wp-primitives' ), - 'version' => '14d2335a0007b36b9112' + 'version' => 'ee8845ac5a9ad98ee3f7' ), 'patterns.js' => array( 'dependencies' => array( @@ -687,7 +704,7 @@ 'wp-is-shallow-equal', 'wp-primitives' ), - 'version' => '72e3cf01c2b3535a9432' + 'version' => '9bce3a8f6306f5380b9a' ), 'preferences.js' => array( 'dependencies' => array( @@ -703,7 +720,7 @@ 'wp-primitives', 'wp-private-apis' ), - 'version' => '035813168e404aa30193' + 'version' => '6595a0115a9c144c0f3a' ), 'preferences-persistence.js' => array( 'dependencies' => array( @@ -728,7 +745,7 @@ 'dependencies' => array( ), - 'version' => '835912f0086b9e59aed4' + 'version' => 'ebe55c7ec838043537c7' ), 'react-i18n.js' => array( 'dependencies' => array( @@ -758,7 +775,7 @@ 'wp-primitives', 'wp-url' ), - 'version' => '21d86e46535b79d9afda' + 'version' => '372c845659b9a298e4fb' ), 'rich-text.js' => array( 'dependencies' => array( @@ -773,7 +790,7 @@ 'wp-keycodes', 'wp-private-apis' ), - 'version' => '16449e6108f48327f368' + 'version' => '1b3e411a54ef29d2bf7a' ), 'router.js' => array( 'dependencies' => array( @@ -809,7 +826,15 @@ 'dependencies' => array( ), - 'version' => 'faa37ce61b7ec8394b2a' + 'version' => '10a88969c2fbccc89f91' + ), + 'sync.js' => array( + 'dependencies' => array( + 'wp-api-fetch', + 'wp-hooks', + 'wp-private-apis' + ), + 'version' => '63df27e4e1555a2ed89e' ), 'theme.js' => array( 'dependencies' => array( @@ -817,7 +842,7 @@ 'wp-element', 'wp-private-apis' ), - 'version' => 'e22ce547a4420507b323' + 'version' => '3b1949512f2ec0c938bd' ), 'token-list.js' => array( 'dependencies' => array( @@ -845,21 +870,21 @@ 'module_dependencies' => array( ), - 'version' => 'd359c2cccf866d7082d2' + 'version' => '1399274c1ad48fc29498' ), 'url.js' => array( 'dependencies' => array( ), - 'version' => 'bb0f766c3d2efe497871' + 'version' => '9dd5f16a5ce37bf4ba2c' ), 'viewport.js' => array( 'dependencies' => array( - 'react-jsx-runtime', 'wp-compose', - 'wp-data' + 'wp-data', + 'wp-element' ), - 'version' => '8614025b8075d220d78f' + 'version' => '97845df4d1a7269c5c2b' ), 'warning.js' => array( 'dependencies' => array( @@ -882,7 +907,7 @@ 'wp-notices', 'wp-primitives' ), - 'version' => '02b8dd683bc610f979fa' + 'version' => '3ab93e442c755a6b2b4e' ), '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 7ece82f318d50..44faa1e97011d 100644 --- a/src/wp-includes/assets/script-modules-packages.php +++ b/src/wp-includes/assets/script-modules-packages.php @@ -34,7 +34,7 @@ 'import' => 'static' ) ), - 'version' => '2af01b43d30739c3fb8d' + 'version' => 'f77b871ece5a791f449e' ), 'block-library/file/view.js' => array( 'dependencies' => array( @@ -46,7 +46,7 @@ 'import' => 'static' ) ), - 'version' => '7d4d261d10dca47ebecb' + 'version' => 'a9114a756e418400594c' ), 'block-library/form/view.js' => array( 'dependencies' => array( @@ -88,7 +88,7 @@ 'import' => 'static' ) ), - 'version' => '99f747d731f80246db11' + 'version' => '1ecf748f10b95c76b349' ), 'block-library/query/view.js' => array( 'dependencies' => array( @@ -166,7 +166,7 @@ 'import' => 'static' ) ), - 'version' => '54bb5a420026a61c7e4f' + 'version' => '5e02fdb03b9e05e7ba82' ), 'connectors/index.js' => array( 'dependencies' => array( @@ -177,7 +177,42 @@ 'wp-i18n', 'wp-private-apis' ), - 'version' => '274797868955a828dfdc' + 'version' => 'dce5e2b0fc240815717b' + ), + 'content-types/index.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-date', + 'wp-deprecated', + 'wp-element', + 'wp-i18n', + 'wp-is-shallow-equal', + 'wp-keycodes', + 'wp-notices', + 'wp-preferences', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-url', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ), + array( + 'id' => '@wordpress/route', + 'import' => 'static' + ) + ), + 'version' => '9a35d0da8badd6a33cf8' ), 'core-abilities/index.js' => array( 'dependencies' => array( @@ -205,7 +240,7 @@ 'import' => 'static' ) ), - 'version' => 'e57f44d1a9f69e75d2d9' + 'version' => '3e9b6e117adbaf70a10f' ), 'interactivity/index.js' => array( 'dependencies' => array( @@ -273,7 +308,7 @@ 'wp-private-apis', 'wp-style-engine' ), - 'version' => '30ab62f45bfe9f971ea0' + 'version' => '8bd91519756b243fc835' ), 'route/index.js' => array( 'dependencies' => array( @@ -282,7 +317,7 @@ 'react-jsx-runtime', 'wp-private-apis' ), - 'version' => 'c5843b6c5e84b352f43b' + 'version' => '48a77bfa70722b4254e4' ), 'workflow/index.js' => array( 'dependencies' => array( @@ -303,6 +338,6 @@ 'import' => 'static' ) ), - 'version' => '13556bc597bbf2a8d620' + 'version' => 'c1055ffa9d3634a7dfe7' ) ); \ No newline at end of file diff --git a/src/wp-includes/blocks/accordion-item.php b/src/wp-includes/blocks/accordion-item.php index a16a1426e346d..8530b34de12d8 100644 --- a/src/wp-includes/blocks/accordion-item.php +++ b/src/wp-includes/blocks/accordion-item.php @@ -39,7 +39,6 @@ function block_core_accordion_item_render( array $attributes, string $content ): if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-heading__toggle' ) ) ) { $p->set_attribute( 'data-wp-on--click', 'actions.toggle' ); - $p->set_attribute( 'data-wp-on--keydown', 'actions.handleKeyDown' ); $p->set_attribute( 'id', $unique_id ); $p->set_attribute( 'aria-controls', $unique_id . '-panel' ); $p->set_attribute( 'data-wp-bind--aria-expanded', 'state.isOpen' ); diff --git a/src/wp-includes/blocks/accordion-item/block.json b/src/wp-includes/blocks/accordion-item/block.json index 74bfddde0e68b..22987b9558a5f 100644 --- a/src/wp-includes/blocks/accordion-item/block.json +++ b/src/wp-includes/blocks/accordion-item/block.json @@ -16,6 +16,7 @@ "interactivity": true, "spacing": { "margin": [ "top", "bottom" ], + "padding": true, "blockGap": true }, "__experimentalBorder": { diff --git a/src/wp-includes/blocks/blocks-json.php b/src/wp-includes/blocks/blocks-json.php index e905b113502ac..e35268ffe6c74 100644 --- a/src/wp-includes/blocks/blocks-json.php +++ b/src/wp-includes/blocks/blocks-json.php @@ -224,6 +224,7 @@ 'top', 'bottom' ), + 'padding' => true, 'blockGap' => true ), '__experimentalBorder' => array( @@ -759,9 +760,6 @@ ), 'gradient' => array( 'type' => 'string' - ), - 'width' => array( - 'type' => 'number' ) ), 'supports' => array( @@ -777,6 +775,15 @@ 'text' => true ) ), + 'dimensions' => array( + 'width' => true, + '__experimentalSkipSerialization' => array( + 'width' + ), + '__experimentalDefaultControls' => array( + 'width' => true + ) + ), 'typography' => array( '__experimentalSkipSerialization' => array( 'fontSize', @@ -851,6 +858,10 @@ 'root' => '.wp-block-button .wp-block-button__link', 'typography' => array( 'writingMode' => '.wp-block-button' + ), + 'dimensions' => array( + 'root' => '.wp-block-button', + 'width' => '.wp-block-button' ) ) ), @@ -2865,8 +2876,10 @@ 'background' => array( 'backgroundImage' => true, 'backgroundSize' => true, + 'gradient' => true, '__experimentalDefaultControls' => array( - 'backgroundImage' => true + 'backgroundImage' => true, + 'gradient' => true ) ), 'color' => array( @@ -2893,7 +2906,8 @@ ) ), 'dimensions' => array( - 'minHeight' => true + 'minHeight' => true, + 'minWidth' => true ), '__experimentalBorder' => array( 'color' => true, @@ -3711,6 +3725,7 @@ ), 'supports' => array( 'anchor' => true, + 'html' => false, 'className' => false, 'splitting' => true, '__experimentalBorder' => array( @@ -4378,6 +4393,11 @@ 'clientNavigation' => true ) ), + 'selectors' => array( + 'states' => array( + '@current' => '.wp-block-navigation .current-menu-item' + ) + ), 'editorStyle' => 'wp-block-navigation-link-editor', 'style' => 'wp-block-navigation-link' ), @@ -5348,9 +5368,6 @@ 'type' => 'string', 'role' => 'content' ), - 'textAlign' => array( - 'type' => 'string' - ), 'format' => array( 'type' => 'string' ), @@ -5387,6 +5404,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, @@ -5423,9 +5441,6 @@ 'description' => 'Display the excerpt.', 'textdomain' => 'default', 'attributes' => array( - 'textAlign' => array( - 'type' => 'string' - ), 'moreText' => array( 'type' => 'string', 'role' => 'content' @@ -5466,6 +5481,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, 'textColumns' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, @@ -5624,9 +5640,6 @@ 'description' => 'Displays the next or previous post link that is adjacent to the current post.', 'textdomain' => 'default', 'attributes' => array( - 'textAlign' => array( - 'type' => 'string' - ), 'type' => array( 'type' => 'string', 'default' => 'next' @@ -5665,6 +5678,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, @@ -5922,9 +5936,6 @@ 'queryId' ), 'attributes' => array( - 'textAlign' => array( - 'type' => 'string' - ), 'level' => array( 'type' => 'number', 'default' => 2 @@ -5947,6 +5958,9 @@ 'type' => 'string', 'default' => '_self', 'role' => 'content' + ), + 'placeholder' => array( + 'type' => 'string' ) ), 'example' => array( @@ -5975,6 +5989,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, @@ -6114,10 +6129,7 @@ ) ), 'dimensions' => array( - 'minHeight' => true, - '__experimentalDefaultControls' => array( - 'minHeight' => false - ) + 'minHeight' => true ), 'spacing' => array( 'margin' => true, @@ -6523,9 +6535,6 @@ 'type' => array( 'type' => 'string' ), - 'textAlign' => array( - 'type' => 'string' - ), 'level' => array( 'type' => 'number', 'default' => 1 @@ -6571,6 +6580,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, @@ -6984,10 +6994,6 @@ 'default' => array( ) - ), - 'isSearchFieldHidden' => array( - 'type' => 'boolean', - 'default' => false ) ), 'supports' => array( @@ -7038,7 +7044,11 @@ 'html' => false ), 'editorStyle' => 'wp-block-search-editor', - 'style' => 'wp-block-search' + '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' + ) ), 'separator' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', @@ -7224,9 +7234,6 @@ ), 'textdomain' => 'default', 'attributes' => array( - 'textAlign' => array( - 'type' => 'string' - ), 'level' => array( 'type' => 'number', 'default' => 0 @@ -7247,7 +7254,11 @@ 'example' => array( 'viewportWidth' => 350, 'attributes' => array( - 'textAlign' => 'center' + 'style' => array( + 'typography' => array( + 'textAlign' => 'center' + ) + ) ) ), 'supports' => array( @@ -7276,6 +7287,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, @@ -7325,9 +7337,6 @@ 6 ) ), - 'textAlign' => array( - 'type' => 'string' - ), 'isLink' => array( 'type' => 'boolean', 'default' => true, @@ -7369,6 +7378,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, diff --git a/src/wp-includes/blocks/button.php b/src/wp-includes/blocks/button.php index 0d03440b1cb0f..8a7b43a2df315 100644 --- a/src/wp-includes/blocks/button.php +++ b/src/wp-includes/blocks/button.php @@ -60,6 +60,74 @@ function render_block_core_button( $attributes, $content ) { return ''; } + $width = $attributes['style']['dimensions']['width'] ?? null; + + if ( $width ) { + // Resolve preset references to their actual values. + $resolved_width = $width; + $is_preset = str_starts_with( $width, 'var:preset|dimension|' ); + + if ( $is_preset ) { + $slug = substr( $width, strlen( 'var:preset|dimension|' ) ); + $dimension_presets = wp_get_global_settings( + array( 'dimensions', 'dimensionSizes' ), + array( 'block_name' => 'core/button' ) + ); + + // Search origins in priority order: custom > theme > default. + if ( is_array( $dimension_presets ) ) { + foreach ( array( 'custom', 'theme', 'default' ) as $origin ) { + if ( empty( $dimension_presets[ $origin ] ) || ! is_array( $dimension_presets[ $origin ] ) ) { + continue; + } + foreach ( $dimension_presets[ $origin ] as $preset ) { + if ( isset( $preset['slug'] ) && $preset['slug'] === $slug ) { + $resolved_width = $preset['size'] ?? $width; + break 2; + } + } + } + } + } + + $is_percentage = str_ends_with( $resolved_width, '%' ); + + $processor = new WP_HTML_Tag_Processor( $content ); + // Target the outer wrapper div. + if ( $processor->next_tag( array( 'class_name' => 'wp-block-button' ) ) ) { + $processor->add_class( 'has-custom-width' ); + $existing_style = $processor->get_attribute( 'style' ); + $existing_style = is_string( $existing_style ) ? $existing_style : ''; + + if ( $is_percentage ) { + $numeric_width = (float) $resolved_width; + $processor->add_class( 'wp-block-button__width' ); + + // Maintain legacy class for the standard percentage widths. + $legacy_widths = array( + '25%' => 'wp-block-button__width-25', + '50%' => 'wp-block-button__width-50', + '75%' => 'wp-block-button__width-75', + '100%' => 'wp-block-button__width-100', + ); + if ( isset( $legacy_widths[ $resolved_width ] ) ) { + $processor->add_class( $legacy_widths[ $resolved_width ] ); + } + + $width_style = "--wp--block-button--width: $numeric_width;"; + $processor->set_attribute( 'style', $width_style . ( $existing_style ? ' ' . $existing_style : '' ) ); + } else { + $css_value = $is_preset + ? 'var(--wp--preset--dimension--' . _wp_to_kebab_case( $slug ) . ')' + : $width; + $width_style = "width: $css_value;"; + $processor->set_attribute( 'style', $width_style . ( $existing_style ? ' ' . $existing_style : '' ) ); + } + + $content = $processor->get_updated_html(); + } + } + return $content; } diff --git a/src/wp-includes/blocks/button/block.json b/src/wp-includes/blocks/button/block.json index 50ba4cda9c688..2e23a64c8f559 100644 --- a/src/wp-includes/blocks/button/block.json +++ b/src/wp-includes/blocks/button/block.json @@ -63,9 +63,6 @@ }, "gradient": { "type": "string" - }, - "width": { - "type": "number" } }, "supports": { @@ -81,6 +78,13 @@ "text": true } }, + "dimensions": { + "width": true, + "__experimentalSkipSerialization": [ "width" ], + "__experimentalDefaultControls": { + "width": true + } + }, "typography": { "__experimentalSkipSerialization": [ "fontSize", @@ -145,6 +149,10 @@ "root": ".wp-block-button .wp-block-button__link", "typography": { "writingMode": ".wp-block-button" + }, + "dimensions": { + "root": ".wp-block-button", + "width": ".wp-block-button" } } } diff --git a/src/wp-includes/blocks/cover.php b/src/wp-includes/blocks/cover.php index 8da5db23ddc3f..16533acacd764 100644 --- a/src/wp-includes/blocks/cover.php +++ b/src/wp-includes/blocks/cover.php @@ -39,13 +39,13 @@ function render_block_core_cover( $attributes, $content ) { $lower_src = strtolower( $iframe_src ); $provider = null; - if ( strpos( $lower_src, 'youtube.com' ) !== false || strpos( $lower_src, 'youtu.be' ) !== false ) { + if ( str_contains( $lower_src, 'youtube.com' ) || str_contains( $lower_src, 'youtu.be' ) ) { $provider = 'youtube'; - } elseif ( strpos( $lower_src, 'vimeo.com' ) !== false ) { + } elseif ( str_contains( $lower_src, 'vimeo.com' ) ) { $provider = 'vimeo'; - } elseif ( strpos( $lower_src, 'videopress.com' ) !== false ) { + } elseif ( str_contains( $lower_src, 'videopress.com' ) ) { $provider = 'videopress'; - } elseif ( strpos( $lower_src, 'wordpress.tv' ) !== false ) { + } elseif ( str_contains( $lower_src, 'wordpress.tv' ) ) { $provider = 'wordpress-tv'; } diff --git a/src/wp-includes/blocks/group/block.json b/src/wp-includes/blocks/group/block.json index e83fb60d31fc7..7fa2ad2ccf4c7 100644 --- a/src/wp-includes/blocks/group/block.json +++ b/src/wp-includes/blocks/group/block.json @@ -28,8 +28,10 @@ "background": { "backgroundImage": true, "backgroundSize": true, + "gradient": true, "__experimentalDefaultControls": { - "backgroundImage": true + "backgroundImage": true, + "gradient": true } }, "color": { @@ -53,7 +55,8 @@ } }, "dimensions": { - "minHeight": true + "minHeight": true, + "minWidth": true }, "__experimentalBorder": { "color": true, diff --git a/src/wp-includes/blocks/home-link.php b/src/wp-includes/blocks/home-link.php index d61aa0bc235e2..7ae02ed266f0b 100644 --- a/src/wp-includes/blocks/home-link.php +++ b/src/wp-includes/blocks/home-link.php @@ -5,6 +5,8 @@ * @package WordPress */ +require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php'; + /** * Build an array with CSS classes and inline styles defining the colors * which will be applied to the home link markup in the front-end. @@ -59,36 +61,6 @@ function block_core_home_link_build_css_colors( $context ) { return $colors; } -/** - * Build an array with CSS classes and inline styles defining the font sizes - * which will be applied to the home link markup in the front-end. - * - * @since 6.0.0 - * - * @param array $context Home link block context. - * @return array Font size CSS classes and inline styles. - */ -function block_core_home_link_build_css_font_sizes( $context ) { - // CSS classes. - $font_sizes = array( - 'css_classes' => array(), - 'inline_styles' => '', - ); - - $has_named_font_size = array_key_exists( 'fontSize', $context ); - $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); - - if ( $has_named_font_size ) { - // Add the font size class. - $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); - } elseif ( $has_custom_font_size ) { - // Add the custom font size inline style. - $font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] ); - } - - return $font_sizes; -} - /** * Builds an array with classes and style for the li wrapper * @@ -98,12 +70,21 @@ function block_core_home_link_build_css_font_sizes( $context ) { * @return string The li wrapper attributes. */ function block_core_home_link_build_li_wrapper_attributes( $context ) { - $colors = block_core_home_link_build_css_colors( $context ); - $font_sizes = block_core_home_link_build_css_font_sizes( $context ); - $classes = array_merge( + $colors = block_core_home_link_build_css_colors( $context ); + // The build system prefixes this function with "gutenberg_" to avoid + // collisions with the core version. Until this function is backported to + // core, we need to guard it's use and only call the prefixed name in + // the plugin. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + $font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $context ); + } else { + $font_sizes = block_core_shared_navigation_build_css_font_sizes( $context ); + } + $classes = array_merge( $colors['css_classes'], $font_sizes['css_classes'] ); + $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); $classes[] = 'wp-block-navigation-item'; diff --git a/src/wp-includes/blocks/icon.php b/src/wp-includes/blocks/icon.php index e09319cffea3b..1b7a27a147698 100644 --- a/src/wp-includes/blocks/icon.php +++ b/src/wp-includes/blocks/icon.php @@ -10,9 +10,7 @@ * * @since 7.0.0 * - * @param array $attributes The block attributes. - * @param string $content The block content. - * @param WP_Block $block The block instance. + * @param array $attributes The block attributes. * * @return string Returns the Icon. */ diff --git a/src/wp-includes/blocks/latest-posts.php b/src/wp-includes/blocks/latest-posts.php index 44231ac6d14a1..c829852f8cfde 100644 --- a/src/wp-includes/blocks/latest-posts.php +++ b/src/wp-includes/blocks/latest-posts.php @@ -163,7 +163,7 @@ function render_block_core_latest_posts( $attributes ) { $trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 ); $trimmed_excerpt .= sprintf( /* translators: 1: A URL to a post, 2: Hidden accessibility text: Post title */ - __( '… Read more: %2$s' ), + __( '… Read more: %2$s' ), esc_url( $post_link ), esc_html( $title ) ); diff --git a/src/wp-includes/blocks/list-item/block.json b/src/wp-includes/blocks/list-item/block.json index 1cdba86f19b2e..cdefd6c232bf3 100644 --- a/src/wp-includes/blocks/list-item/block.json +++ b/src/wp-includes/blocks/list-item/block.json @@ -21,6 +21,7 @@ }, "supports": { "anchor": true, + "html": false, "className": false, "splitting": true, "__experimentalBorder": { diff --git a/src/wp-includes/blocks/loginout.php b/src/wp-includes/blocks/loginout.php index f83d8be424ece..a9e05f8630bfe 100644 --- a/src/wp-includes/blocks/loginout.php +++ b/src/wp-includes/blocks/loginout.php @@ -38,6 +38,19 @@ function render_block_core_loginout( $attributes ) { // Get the form. $contents = wp_login_form( array( 'echo' => false ) ); + + if ( wp_is_block_theme() ) { + $processor = new WP_HTML_Tag_Processor( $contents ); + + while ( $processor->next_tag( 'input' ) ) { + if ( 'submit' === $processor->get_attribute( 'type' ) && 'wp-submit' === $processor->get_attribute( 'name' ) ) { + $processor->add_class( 'wp-block-button__link' ); + $processor->add_class( wp_theme_get_element_class_name( 'button' ) ); + $contents = $processor->get_updated_html(); + break; + } + } + } } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); diff --git a/src/wp-includes/blocks/navigation-link.php b/src/wp-includes/blocks/navigation-link.php index 0888d7b5acebd..f92a2ff344e50 100644 --- a/src/wp-includes/blocks/navigation-link.php +++ b/src/wp-includes/blocks/navigation-link.php @@ -5,14 +5,9 @@ * @package WordPress */ -// Path differs between source and build: './shared/' in source, './navigation-link/shared/' in build. -if ( file_exists( __DIR__ . '/shared/item-should-render.php' ) ) { - require_once __DIR__ . '/shared/item-should-render.php'; - require_once __DIR__ . '/shared/render-submenu-icon.php'; -} else { - require_once __DIR__ . '/navigation-link/shared/item-should-render.php'; - require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php'; -} +require_once __DIR__ . '/navigation-link/shared/item-should-render.php'; +require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php'; +require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php'; /** * Build an array with CSS classes and inline styles defining the colors @@ -86,43 +81,6 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is return $colors; } -/** - * Build an array with CSS classes and inline styles defining the font sizes - * which will be applied to the navigation markup in the front-end. - * - * @since 5.9.0 - * - * @param array $context Navigation block context. - * @return array Font size CSS classes and inline styles. - */ -function block_core_navigation_link_build_css_font_sizes( $context ) { - // CSS classes. - $font_sizes = array( - 'css_classes' => array(), - 'inline_styles' => '', - ); - - $has_named_font_size = array_key_exists( 'fontSize', $context ); - $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); - - if ( $has_named_font_size ) { - // Add the font size class. - $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); - } elseif ( $has_custom_font_size ) { - // Add the custom font size inline style. - $font_sizes['inline_styles'] = sprintf( - 'font-size: %s;', - wp_get_typography_font_size_value( - array( - 'size' => $context['style']['typography']['fontSize'], - ) - ) - ); - } - - return $font_sizes; -} - /** * Decodes a url if it's encoded, returning the same url if not. * @@ -180,7 +138,15 @@ function render_block_core_navigation_link( $attributes, $content, $block ) { return ''; } - $font_sizes = block_core_navigation_link_build_css_font_sizes( $block->context ); + // The build system prefixes this function with "gutenberg_" to avoid + // collisions with the core version. Until this function is backported to + // core, we need to guard its use and only call the prefixed name in + // the plugin. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + $font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $block->context ); + } else { + $font_sizes = block_core_shared_navigation_build_css_font_sizes( $block->context ); + } $classes = array_merge( $font_sizes['css_classes'] ); @@ -262,7 +228,13 @@ function render_block_core_navigation_link( $attributes, $content, $block ) { if ( isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'] && $has_submenu ) { // The submenu icon can be hidden by a CSS rule on the Navigation Block. - $html .= ''; + $html .= ''; } if ( $has_submenu ) { @@ -485,4 +457,4 @@ function register_block_core_navigation_link() { * Creates all variations for post types / taxonomies dynamically (= each time when variations are requested). * Do not use variation_callback, to also account for unregistering post types/taxonomies later on. */ -add_action( 'get_block_type_variations', 'block_core_navigation_link_filter_variations', 10, 2 ); +add_filter( 'get_block_type_variations', 'block_core_navigation_link_filter_variations', 10, 2 ); diff --git a/src/wp-includes/blocks/navigation-link/block.json b/src/wp-includes/blocks/navigation-link/block.json index 997275574f1ac..0735461d0b29a 100644 --- a/src/wp-includes/blocks/navigation-link/block.json +++ b/src/wp-includes/blocks/navigation-link/block.json @@ -85,6 +85,11 @@ "clientNavigation": true } }, + "selectors": { + "states": { + "@current": ".wp-block-navigation .current-menu-item" + } + }, "editorStyle": "wp-block-navigation-link-editor", "style": "wp-block-navigation-link" } diff --git a/src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php b/src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php new file mode 100644 index 0000000000000..38fd82d12dac8 --- /dev/null +++ b/src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php @@ -0,0 +1,43 @@ + array(), + 'inline_styles' => '', + ); + + $has_named_font_size = array_key_exists( 'fontSize', $context ); + $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); + + if ( $has_named_font_size ) { + // Add the font size class. + $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); + } elseif ( $has_custom_font_size ) { + // Add the custom font size inline style. + $font_sizes['inline_styles'] = sprintf( + 'font-size: %s;', + wp_get_typography_font_size_value( + array( + 'size' => $context['style']['typography']['fontSize'], + ) + ) + ); + } + + return $font_sizes; +} diff --git a/src/wp-includes/blocks/navigation-submenu.php b/src/wp-includes/blocks/navigation-submenu.php index 9138b5a5e08da..2677988707836 100644 --- a/src/wp-includes/blocks/navigation-submenu.php +++ b/src/wp-includes/blocks/navigation-submenu.php @@ -5,6 +5,10 @@ * @package WordPress */ +require_once __DIR__ . '/navigation-link/shared/item-should-render.php'; +require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php'; +require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php'; + /** * Returns the submenu visibility value with backward compatibility * for the deprecated openSubmenusOnClick attribute. @@ -46,52 +50,6 @@ function block_core_navigation_submenu_get_submenu_visibility( $context ) { return $submenu_visibility ?? 'hover'; } -// Path differs between source and build: '../navigation-link/shared/' in source, './navigation-link/shared/' in build. -if ( file_exists( __DIR__ . '/../navigation-link/shared/item-should-render.php' ) ) { - require_once __DIR__ . '/../navigation-link/shared/item-should-render.php'; - require_once __DIR__ . '/../navigation-link/shared/render-submenu-icon.php'; -} else { - require_once __DIR__ . '/navigation-link/shared/item-should-render.php'; - require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php'; -} - -/** - * Build an array with CSS classes and inline styles defining the font sizes - * which will be applied to the navigation markup in the front-end. - * - * @since 5.9.0 - * - * @param array $context Navigation block context. - * @return array Font size CSS classes and inline styles. - */ -function block_core_navigation_submenu_build_css_font_sizes( $context ) { - // CSS classes. - $font_sizes = array( - 'css_classes' => array(), - 'inline_styles' => '', - ); - - $has_named_font_size = array_key_exists( 'fontSize', $context ); - $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); - - if ( $has_named_font_size ) { - // Add the font size class. - $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); - } elseif ( $has_custom_font_size ) { - // Add the custom font size inline style. - $font_sizes['inline_styles'] = sprintf( - 'font-size: %s;', - wp_get_typography_font_size_value( - array( - 'size' => $context['style']['typography']['fontSize'], - ) - ) - ); - } - - return $font_sizes; -} - /** * Renders the `core/navigation-submenu` block. * @@ -116,7 +74,15 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { return ''; } - $font_sizes = block_core_navigation_submenu_build_css_font_sizes( $block->context ); + // The build system prefixes this function with "gutenberg_" to avoid + // collisions with the core version. Until this function is backported to + // core, we need to guard its use and only call the prefixed name in + // the plugin. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + $font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $block->context ); + } else { + $font_sizes = block_core_shared_navigation_build_css_font_sizes( $block->context ); + } $style_attribute = $font_sizes['inline_styles']; // Render inner blocks first to check if any menu items will actually display. @@ -240,7 +206,13 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { if ( $show_submenu_indicators && $has_submenu ) { // The submenu icon is rendered in a button here // so that there's a clickable element to open the submenu. - $html .= ''; + $html .= ''; } } else { $html .= ''; if ( $has_submenu ) { - $html .= ''; + $html .= ''; } } diff --git a/src/wp-includes/blocks/navigation.php b/src/wp-includes/blocks/navigation.php index 71e8d85b035dc..a530494ff36e7 100644 --- a/src/wp-includes/blocks/navigation.php +++ b/src/wp-includes/blocks/navigation.php @@ -1354,17 +1354,6 @@ function block_core_navigation_build_css_font_sizes( $attributes ) { return $font_sizes; } -/** - * Returns the top-level submenu SVG chevron icon. - * - * @since 5.9.0 - * - * @return string - */ -function block_core_navigation_render_submenu_icon() { - return ''; -} - /** * Filter out empty "null" blocks from the block list. * 'parse_blocks' includes a null block with '\n\n' as the content when diff --git a/src/wp-includes/blocks/page-list.php b/src/wp-includes/blocks/page-list.php index 27e63f250a811..685f79331784b 100644 --- a/src/wp-includes/blocks/page-list.php +++ b/src/wp-includes/blocks/page-list.php @@ -5,6 +5,8 @@ * @package WordPress */ +require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php'; + /** * Returns the submenu visibility value with backward compatibility * for the deprecated openSubmenusOnClick attribute. @@ -123,50 +125,12 @@ function block_core_page_list_build_css_colors( $attributes, $context ) { return $colors; } - -/** - * Build an array with CSS classes and inline styles defining the font sizes - * which will be applied to the pages markup in the front-end when it is a descendant of navigation. - * - * @since 5.8.0 - * - * @param array $context Navigation block context. - * @return array Font size CSS classes and inline styles. - */ -function block_core_page_list_build_css_font_sizes( $context ) { - // CSS classes. - $font_sizes = array( - 'css_classes' => array(), - 'inline_styles' => '', - ); - - $has_named_font_size = array_key_exists( 'fontSize', $context ); - $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); - - if ( $has_named_font_size ) { - // Add the font size class. - $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); - } elseif ( $has_custom_font_size ) { - // Add the custom font size inline style. - $font_sizes['inline_styles'] = sprintf( - 'font-size: %s;', - wp_get_typography_font_size_value( - array( - 'size' => $context['style']['typography']['fontSize'], - ) - ) - ); - } - - return $font_sizes; -} - /** * Outputs Page list markup from an array of pages with nested children. * * @since 5.8.0 * - * @param boolean $open_submenus_on_click Whether to open submenus on click instead of hover. + * @param string $submenu_visibility The submenu visibility mode: 'hover', 'click', or 'always'. * @param boolean $show_submenu_icons Whether to show submenu indicator icons. * @param boolean $is_navigation_child If block is a child of Navigation block. * @param array $nested_pages The array of nested pages. @@ -342,12 +306,21 @@ function render_block_core_page_list( $attributes, $content, $block ) { } } - $colors = block_core_page_list_build_css_colors( $attributes, $block->context ); - $font_sizes = block_core_page_list_build_css_font_sizes( $block->context ); - $classes = array_merge( + $colors = block_core_page_list_build_css_colors( $attributes, $block->context ); + // The build system prefixes this function with "gutenberg_" to avoid + // collisions with the core version. Until this function is backported to + // core, we need to guard its use and only call the prefixed name in + // the plugin. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + $font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $block->context ); + } else { + $font_sizes = block_core_shared_navigation_build_css_font_sizes( $block->context ); + } + $classes = array_merge( $colors['css_classes'], $font_sizes['css_classes'] ); + $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); $css_classes = trim( implode( ' ', $classes ) ); diff --git a/src/wp-includes/blocks/post-date/block.json b/src/wp-includes/blocks/post-date/block.json index 7952e36af3661..75eb1eda38d8f 100644 --- a/src/wp-includes/blocks/post-date/block.json +++ b/src/wp-includes/blocks/post-date/block.json @@ -11,9 +11,6 @@ "type": "string", "role": "content" }, - "textAlign": { - "type": "string" - }, "format": { "type": "string" }, @@ -46,6 +43,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, diff --git a/src/wp-includes/blocks/post-excerpt/block.json b/src/wp-includes/blocks/post-excerpt/block.json index 99f6d5dcc99ed..17678a35c2950 100644 --- a/src/wp-includes/blocks/post-excerpt/block.json +++ b/src/wp-includes/blocks/post-excerpt/block.json @@ -7,9 +7,6 @@ "description": "Display the excerpt.", "textdomain": "default", "attributes": { - "textAlign": { - "type": "string" - }, "moreText": { "type": "string", "role": "content" @@ -46,6 +43,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "textColumns": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, diff --git a/src/wp-includes/blocks/post-featured-image.php b/src/wp-includes/blocks/post-featured-image.php index e9fc60f7038f5..56cf9a66e4e03 100644 --- a/src/wp-includes/blocks/post-featured-image.php +++ b/src/wp-includes/blocks/post-featured-image.php @@ -166,10 +166,8 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes } // Apply overlay and gradient classes. - if ( $has_dim_background ) { - $class_names[] = 'has-background-dim'; - $class_names[] = "has-background-dim-{$attributes['dimRatio']}"; - } + $class_names[] = 'has-background-dim'; + $class_names[] = "has-background-dim-{$attributes['dimRatio']}"; if ( $has_solid_overlay ) { $class_names[] = "has-{$attributes['overlayColor']}-background-color"; diff --git a/src/wp-includes/blocks/post-navigation-link/block.json b/src/wp-includes/blocks/post-navigation-link/block.json index 6d51d619637c9..83cf63af7841b 100644 --- a/src/wp-includes/blocks/post-navigation-link/block.json +++ b/src/wp-includes/blocks/post-navigation-link/block.json @@ -7,9 +7,6 @@ "description": "Displays the next or previous post link that is adjacent to the current post.", "textdomain": "default", "attributes": { - "textAlign": { - "type": "string" - }, "type": { "type": "string", "default": "next" @@ -46,6 +43,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, diff --git a/src/wp-includes/blocks/post-template.php b/src/wp-includes/blocks/post-template.php index 72ebbe0e13d13..9ce4ce47343e1 100644 --- a/src/wp-includes/blocks/post-template.php +++ b/src/wp-includes/blocks/post-template.php @@ -94,6 +94,9 @@ function render_block_core_post_template( $attributes, $content, $block ) { if ( isset( $attributes['layout']['type'] ) && 'grid' === $attributes['layout']['type'] && ! empty( $attributes['layout']['columnCount'] ) ) { $classnames .= ' ' . sanitize_title( 'columns-' . $attributes['layout']['columnCount'] ); } + if ( isset( $attributes['layout']['type'] ) && 'grid' === $attributes['layout']['type'] && ! empty( $attributes['layout']['columnCount'] ) && ! empty( $attributes['layout']['minimumColumnWidth'] ) ) { + $classnames .= ' has-native-responsive-grid'; + } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( $classnames ) ) ); diff --git a/src/wp-includes/blocks/post-title/block.json b/src/wp-includes/blocks/post-title/block.json index 1fb7efcf82db5..d1ded484486bd 100644 --- a/src/wp-includes/blocks/post-title/block.json +++ b/src/wp-includes/blocks/post-title/block.json @@ -8,9 +8,6 @@ "textdomain": "default", "usesContext": [ "postId", "postType", "queryId" ], "attributes": { - "textAlign": { - "type": "string" - }, "level": { "type": "number", "default": 2 @@ -33,6 +30,9 @@ "type": "string", "default": "_self", "role": "content" + }, + "placeholder": { + "type": "string" } }, "example": { @@ -58,6 +58,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, diff --git a/src/wp-includes/blocks/pullquote/block.json b/src/wp-includes/blocks/pullquote/block.json index 271bba74d0252..9469f420d1db7 100644 --- a/src/wp-includes/blocks/pullquote/block.json +++ b/src/wp-includes/blocks/pullquote/block.json @@ -43,10 +43,7 @@ } }, "dimensions": { - "minHeight": true, - "__experimentalDefaultControls": { - "minHeight": false - } + "minHeight": true }, "spacing": { "margin": true, diff --git a/src/wp-includes/blocks/query-title.php b/src/wp-includes/blocks/query-title.php index d26a3d08ae42a..845a4bdc05aa7 100644 --- a/src/wp-includes/blocks/query-title.php +++ b/src/wp-includes/blocks/query-title.php @@ -13,7 +13,7 @@ * @since 5.8.0 * * @param array $attributes Block attributes. - * @param array $_content Block content. + * @param array $content Block content. * @param object $block Block instance. * * @return string Returns the query title based on the queried object. diff --git a/src/wp-includes/blocks/query-title/block.json b/src/wp-includes/blocks/query-title/block.json index 41e9e3fd29b62..786a46fe5cb1b 100644 --- a/src/wp-includes/blocks/query-title/block.json +++ b/src/wp-includes/blocks/query-title/block.json @@ -10,9 +10,6 @@ "type": { "type": "string" }, - "textAlign": { - "type": "string" - }, "level": { "type": "number", "default": 1 @@ -53,6 +50,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, diff --git a/src/wp-includes/blocks/search.php b/src/wp-includes/blocks/search.php index 7073d6ce8ab3f..07c051b8f6eb9 100644 --- a/src/wp-includes/blocks/search.php +++ b/src/wp-includes/blocks/search.php @@ -69,10 +69,13 @@ function render_block_core_search( $attributes ) { if ( ! empty( $typography_classes ) ) { $input_classes[] = $typography_classes; } + if ( ! $show_button && ! empty( $color_classes ) ) { + $input_classes[] = $color_classes; + } if ( $input->next_tag() ) { $input->add_class( implode( ' ', $input_classes ) ); $input->set_attribute( 'id', $input_id ); - $input->set_attribute( 'value', get_search_query() ); + $input->set_attribute( 'value', get_search_query( false ) ); $input->set_attribute( 'placeholder', $attributes['placeholder'] ); // If it's interactive, enqueue the script module and add the directives. @@ -430,20 +433,37 @@ function styles_for_block_core_search( $attributes ) { } } + $use_input_for_colors = ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition']; + // Add color styles. $has_text_color = ! empty( $attributes['style']['color']['text'] ); if ( $has_text_color ) { - $button_styles[] = sprintf( 'color: %s;', $attributes['style']['color']['text'] ); + $text_color_style = sprintf( 'color: %s;', $attributes['style']['color']['text'] ); + if ( $use_input_for_colors ) { + $input_styles[] = $text_color_style; + } else { + $button_styles[] = $text_color_style; + } } $has_background_color = ! empty( $attributes['style']['color']['background'] ); if ( $has_background_color ) { - $button_styles[] = sprintf( 'background-color: %s;', $attributes['style']['color']['background'] ); + $background_color_style = sprintf( 'background-color: %s;', $attributes['style']['color']['background'] ); + if ( $use_input_for_colors ) { + $input_styles[] = $background_color_style; + } else { + $button_styles[] = $background_color_style; + } } $has_custom_gradient = ! empty( $attributes['style']['color']['gradient'] ); if ( $has_custom_gradient ) { - $button_styles[] = sprintf( 'background: %s;', $attributes['style']['color']['gradient'] ); + $custom_gradient_style = sprintf( 'background: %s;', $attributes['style']['color']['gradient'] ); + if ( $use_input_for_colors ) { + $input_styles[] = $custom_gradient_style; + } else { + $button_styles[] = $custom_gradient_style; + } } // Get typography styles to be shared across inner elements. diff --git a/src/wp-includes/blocks/search/block.json b/src/wp-includes/blocks/search/block.json index a6146d4404041..be9c0e3cdc2d5 100644 --- a/src/wp-includes/blocks/search/block.json +++ b/src/wp-includes/blocks/search/block.json @@ -42,10 +42,6 @@ "query": { "type": "object", "default": {} - }, - "isSearchFieldHidden": { - "type": "boolean", - "default": false } }, "supports": { @@ -92,5 +88,9 @@ "html": false }, "editorStyle": "wp-block-search-editor", - "style": "wp-block-search" + "style": "wp-block-search", + "selectors": { + "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" + } } diff --git a/src/wp-includes/blocks/site-tagline/block.json b/src/wp-includes/blocks/site-tagline/block.json index 756b2dcb8183a..1b2764d0cfa9a 100644 --- a/src/wp-includes/blocks/site-tagline/block.json +++ b/src/wp-includes/blocks/site-tagline/block.json @@ -8,9 +8,6 @@ "keywords": [ "description" ], "textdomain": "default", "attributes": { - "textAlign": { - "type": "string" - }, "level": { "type": "number", "default": 0 @@ -23,7 +20,11 @@ "example": { "viewportWidth": 350, "attributes": { - "textAlign": "center" + "style": { + "typography": { + "textAlign": "center" + } + } } }, "supports": { @@ -49,6 +50,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalTextTransform": true, "__experimentalTextDecoration": true, diff --git a/src/wp-includes/blocks/site-title/block.json b/src/wp-includes/blocks/site-title/block.json index ac6a3c10e086a..0631de6560ba4 100644 --- a/src/wp-includes/blocks/site-title/block.json +++ b/src/wp-includes/blocks/site-title/block.json @@ -15,9 +15,6 @@ "type": "array", "default": [ 0, 1, 2, 3, 4, 5, 6 ] }, - "textAlign": { - "type": "string" - }, "isLink": { "type": "boolean", "default": true, @@ -56,6 +53,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalTextTransform": true, "__experimentalTextDecoration": true, diff --git a/src/wp-includes/build/constants.php b/src/wp-includes/build/constants.php index 37c81b5ccc21b..6343c96fcb296 100644 --- a/src/wp-includes/build/constants.php +++ b/src/wp-includes/build/constants.php @@ -9,6 +9,6 @@ */ return array( - 'version' => '22.6.0-rc.1', + 'version' => '23.2.2', 'build_url' => includes_url( 'build/' ), ); diff --git a/src/wp-includes/build/pages.php b/src/wp-includes/build/pages.php index 14ca6a08fbbc1..d9fa3cfef0f7f 100644 --- a/src/wp-includes/build/pages.php +++ b/src/wp-includes/build/pages.php @@ -6,7 +6,23 @@ * @package wp */ -require_once __DIR__ . '/pages/font-library/page.php'; -require_once __DIR__ . '/pages/font-library/page-wp-admin.php'; -require_once __DIR__ . '/pages/options-connectors/page.php'; -require_once __DIR__ . '/pages/options-connectors/page-wp-admin.php'; +foreach ( [ + __DIR__ . '/pages/media-editor/page.php', + __DIR__ . '/pages/media-editor/page-wp-admin.php', + __DIR__ . '/pages/font-library/page.php', + __DIR__ . '/pages/font-library/page-wp-admin.php', + __DIR__ . '/pages/options-connectors/page.php', + __DIR__ . '/pages/options-connectors/page-wp-admin.php', + __DIR__ . '/pages/guidelines/page.php', + __DIR__ . '/pages/guidelines/page-wp-admin.php', + __DIR__ . '/pages/experiments/page.php', + __DIR__ . '/pages/experiments/page-wp-admin.php', + __DIR__ . '/pages/content-types/page.php', + __DIR__ . '/pages/content-types/page-wp-admin.php', + __DIR__ . '/pages/dashboard/page.php', + __DIR__ . '/pages/dashboard/page-wp-admin.php', +] as $file ) { + if ( file_exists( $file ) ) { + require_once $file; + } +} diff --git a/src/wp-includes/build/pages/content-types/loader.js b/src/wp-includes/build/pages/content-types/loader.js new file mode 100644 index 0000000000000..9f7e5db19d51d --- /dev/null +++ b/src/wp-includes/build/pages/content-types/loader.js @@ -0,0 +1 @@ +// Empty module loader for page dependencies diff --git a/src/wp-includes/build/pages/content-types/page-wp-admin.php b/src/wp-includes/build/pages/content-types/page-wp-admin.php new file mode 100644 index 0000000000000..f59c8b4f34c80 --- /dev/null +++ b/src/wp-includes/build/pages/content-types/page-wp-admin.php @@ -0,0 +1,294 @@ + $path ); + if ( ! empty( $content_module ) ) { + $route['content_module'] = $content_module; + } + if ( ! empty( $route_module ) ) { + $route['route_module'] = $route_module; + } + + $wp_content_types_wp_admin_routes[] = $route; +} + +/** + * Register a menu item for the content-types-wp-admin page. + * Note: Menu items are registered but not displayed in single-page mode. + * + * @param string $id Menu item ID. + * @param string $label Display label. + * @param string $to Route path to navigate to. + * @param string $parent_id Optional. Parent menu item ID. + */ +function wp_register_content_types_wp_admin_menu_item( $id, $label, $to, $parent_id = '' ) { + global $wp_content_types_wp_admin_menu_items; + + $menu_item = array( + 'id' => $id, + 'label' => $label, + 'to' => $to, + ); + + if ( ! empty( $parent_id ) ) { + $menu_item['parent'] = $parent_id; + } + + $wp_content_types_wp_admin_menu_items[] = $menu_item; +} + +/** + * Get all registered routes for the content-types-wp-admin page. + * + * @return array Array of route objects. + */ +function wp_get_content_types_wp_admin_routes() { + global $wp_content_types_wp_admin_routes; + return $wp_content_types_wp_admin_routes ?? array(); +} + +/** + * Get all registered menu items for the content-types-wp-admin page. + * + * @return array Array of menu item objects. + */ +function wp_get_content_types_wp_admin_menu_items() { + global $wp_content_types_wp_admin_menu_items; + return $wp_content_types_wp_admin_menu_items ?? array(); +} + +/** + * Preload REST API data for the content-types-wp-admin page. + * Automatically called during page rendering. + */ +function wp_content_types_wp_admin_preload_data() { + // Define paths to preload - same for all pages + // Please also change packages/core-data/src/entities.js when changing this. + $preload_paths = array( + '/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', + array( '/wp/v2/settings', 'OPTIONS' ), + ); + + // Use rest_preload_api_request to gather the preloaded data + $preload_data = array_reduce( + $preload_paths, + 'rest_preload_api_request', + array() + ); + + // Register the preloading middleware with wp-api-fetch + wp_add_inline_script( + 'wp-api-fetch', + sprintf( + 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', + wp_json_encode( $preload_data ) + ), + 'after' + ); +} + +/** + * Enqueue scripts and styles for the content-types-wp-admin page. + * Hooked to admin_enqueue_scripts. + * + * @param string $hook_suffix The current admin page. + */ +function wp_content_types_wp_admin_enqueue_scripts( $hook_suffix ) { + // Check all possible ways this page can be accessed: + // 1. Menu page via admin.php?page=content-types-wp-admin (plugin) + // 2. Direct file via content-types.php (Core) - screen ID will be 'content-types' + $current_screen = get_current_screen(); + $is_our_page = ( + ( isset( $_GET['page'] ) && 'content-types-wp-admin' === $_GET['page'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended + ( $current_screen && 'content-types' === $current_screen->id ) + ); + + if ( ! $is_our_page ) { + return; + } + + // Load build constants + $build_constants = require __DIR__ . '/../../constants.php'; + + // Fire init action for extensions to register routes and menu items + do_action( 'content-types-wp-admin_init' ); + + // Preload REST API data + wp_content_types_wp_admin_preload_data(); + + // Get all registered routes + $routes = wp_get_content_types_wp_admin_routes(); + + // Get boot module asset file for dependencies + $asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php'; + if ( file_exists( $asset_file ) ) { + $asset = require $asset_file; + + // This script serves two purposes: + // 1. It ensures all the globals that are made available to the modules are loaded. + // 2. It initializes the boot module as an inline script. + wp_register_script( 'content-types-wp-admin-prerequisites', '', $asset['dependencies'], $asset['version'], true ); + + // Add inline script to initialize the app using initSinglePage (no menuItems) + wp_add_inline_script( + 'content-types-wp-admin-prerequisites', + sprintf( + 'import("@wordpress/boot").then(mod => mod.initSinglePage({mountId: "%s", routes: %s}));', + 'content-types-wp-admin-app', + wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) + ) + ); + + // Register prerequisites style by filtering script dependencies to find registered styles + $style_dependencies = array_filter( + $asset['dependencies'], + function ( $handle ) { + return wp_style_is( $handle, 'registered' ); + } + ); + wp_register_style( 'content-types-wp-admin-prerequisites', false, $style_dependencies, $asset['version'] ); + + // Build dependencies for content-types-wp-admin module + $boot_dependencies = array( + array( + 'import' => 'static', + 'id' => '@wordpress/boot', + ), + ); + + // Add all registered routes as dependencies + foreach ( $routes as $route ) { + if ( isset( $route['route_module'] ) ) { + $boot_dependencies[] = array( + 'import' => 'static', + 'id' => $route['route_module'], + ); + } + if ( isset( $route['content_module'] ) ) { + $boot_dependencies[] = array( + 'import' => 'dynamic', + 'id' => $route['content_module'], + ); + } + } + + /** + * Filters the boot script-module dependencies for the + * content-types-wp-admin page. + * + * Surfaces extending this page can append entries to the boot + * dependency list. Each entry is an array with 'import' (string + * 'static' or 'dynamic') and 'id' (script-module handle) keys. + * + * @param array $boot_dependencies Boot dependencies for the page. + */ + $boot_dependencies = apply_filters( + 'content-types-wp-admin_boot_dependencies', + $boot_dependencies + ); + + // Dummy script module to ensure dependencies are loaded + wp_register_script_module( + 'content-types-wp-admin', + $build_constants['build_url'] . 'pages/content-types/loader.js', + $boot_dependencies + ); + + // Enqueue the boot scripts and styles + wp_enqueue_script( 'content-types-wp-admin-prerequisites' ); + wp_enqueue_script_module( 'content-types-wp-admin' ); + wp_enqueue_style( 'content-types-wp-admin-prerequisites' ); + } +} + +/** + * Render the content-types-wp-admin page. + * Call this function from add_menu_page or add_submenu_page. + * This renders within the normal WordPress admin interface. + */ +function wp_content_types_wp_admin_render_page() { + ?> + +
+ $path ); + if ( ! empty( $content_module ) ) { + $route['content_module'] = $content_module; + } + if ( ! empty( $route_module ) ) { + $route['route_module'] = $route_module; + } + + $wp_content_types_routes[] = $route; +} + +/** + * Register a menu item for the content-types page. + * + * @param string $id Menu item ID. + * @param string $label Display label. + * @param string $to Route path to navigate to. + * @param string $parent_id Optional. Parent menu item ID. + * @param string $parent_type Optional. Parent type: 'drilldown' or 'dropdown'. + */ +function wp_register_content_types_menu_item( $id, $label, $to, $parent_id = '', $parent_type = '' ) { + global $wp_content_types_menu_items; + + $menu_item = array( + 'id' => $id, + 'label' => $label, + 'to' => $to, + ); + + if ( ! empty( $parent_id ) ) { + $menu_item['parent'] = $parent_id; + } + + if ( ! empty( $parent_type ) && in_array( $parent_type, array( 'drilldown', 'dropdown' ), true ) ) { + $menu_item['parent_type'] = $parent_type; + } + + $wp_content_types_menu_items[] = $menu_item; +} + +/** + * Get all registered routes for the content-types page. + * + * @return array Array of route objects. + */ +function wp_get_content_types_routes() { + global $wp_content_types_routes; + return $wp_content_types_routes ?? array(); +} + +/** + * Get all registered menu items for the content-types page. + * + * @return array Array of menu item objects. + */ +function wp_get_content_types_menu_items() { + global $wp_content_types_menu_items; + return $wp_content_types_menu_items ?? array(); +} + +/** + * Preload REST API data for the content-types page. + * Automatically called during page rendering. + */ +function wp_content_types_preload_data() { + // Define paths to preload - same for all pages + // Please also change packages/core-data/src/entities.js when changing this. + $preload_paths = array( + '/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', + array( '/wp/v2/settings', 'OPTIONS' ), + ); + + // Use rest_preload_api_request to gather the preloaded data + $preload_data = array_reduce( + $preload_paths, + 'rest_preload_api_request', + array() + ); + + // Register the preloading middleware with wp-api-fetch + wp_add_inline_script( + 'wp-api-fetch', + sprintf( + 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', + wp_json_encode( $preload_data ) + ), + 'after' + ); +} + +/** + * Render the content-types page. + * Call this function from add_menu_page or add_submenu_page. + */ +function wp_content_types_render_page() { + // Load build constants + $build_constants = require __DIR__ . '/../../constants.php'; + + // Set current screen + set_current_screen(); + + // Remove unwanted deprecated handler + remove_action( 'admin_head', 'wp_admin_bar_header' ); + + // Remove unwanted scripts and styles that were enqueued during `admin_init` + foreach ( wp_scripts()->queue as $script ) { + wp_dequeue_script( $script ); + } + foreach ( wp_styles()->queue as $style ) { + wp_dequeue_style( $style ); + } + + // Fire init action for extensions to register routes and menu items + do_action( 'content-types_init' ); + + // Enqueue command palette assets for boot-based pages + if ( function_exists( 'wp_enqueue_command_palette_assets' ) ) { + wp_enqueue_command_palette_assets(); + } + + // Preload REST API data + wp_content_types_preload_data(); + + // Get all registered routes and menu items + $menu_items = wp_get_content_types_menu_items(); + $routes = wp_get_content_types_routes(); + + // Get boot module asset file for dependencies + $asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php'; + if ( file_exists( $asset_file ) ) { + $asset = require $asset_file; + + // This script serves two purposes: + // 1. It ensures all the globals that are made available to the modules are loaded. + // 2. It initializes the boot module as an inline script. + wp_register_script( 'content-types-prerequisites', '', $asset['dependencies'], $asset['version'], true ); + + // Add inline script to initialize the app + $init_modules = []; + wp_add_inline_script( + 'content-types-prerequisites', + sprintf( + 'import("@wordpress/boot").then(mod => mod.init({mountId: "%s", menuItems: %s, routes: %s, initModules: %s, dashboardLink: "%s"}));', + 'content-types-app', + wp_json_encode( $menu_items, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), + wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), + wp_json_encode( $init_modules, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), + esc_url( admin_url( '/' ) ) + ) + ); + + // Register prerequisites style by filtering script dependencies to find registered styles + $style_dependencies = array_filter( + $asset['dependencies'], + function ( $handle ) { + return wp_style_is( $handle, 'registered' ); + } + ); + wp_register_style( 'content-types-prerequisites', false, $style_dependencies, $asset['version'] ); + + // Build dependencies for content-types module + $boot_dependencies = array( + array( + 'import' => 'static', + 'id' => '@wordpress/boot', + ), + ); + + // Add init modules as static dependencies + // No init modules configured + + // Add all registered routes as dependencies + foreach ( $routes as $route ) { + if ( isset( $route['route_module'] ) ) { + $boot_dependencies[] = array( + 'import' => 'static', + 'id' => $route['route_module'], + ); + } + if ( isset( $route['content_module'] ) ) { + $boot_dependencies[] = array( + 'import' => 'dynamic', + 'id' => $route['content_module'], + ); + } + } + + /** + * Filters the boot script-module dependencies for the + * content-types page. + * + * Surfaces extending this page can append entries to the boot + * dependency list. Each entry is an array with 'import' (string + * 'static' or 'dynamic') and 'id' (script-module handle) keys. + * + * @param array $boot_dependencies Boot dependencies for the page. + */ + $boot_dependencies = apply_filters( + 'content-types_boot_dependencies', + $boot_dependencies + ); + + // Dummy script module to ensure dependencies are loaded + wp_register_script_module( + 'content-types', + $build_constants['build_url'] . 'pages/content-types/loader.js', + $boot_dependencies + ); + + // Enqueue the boot scripts and styles + wp_enqueue_script( 'content-types-prerequisites' ); + wp_enqueue_script_module( 'content-types' ); + wp_enqueue_style( 'content-types-prerequisites' ); + } + + // Output the HTML + ?> + + > + + + +