96 Commits

Author SHA1 Message Date
Michal Czaplinski
34c861b6a5 Script Loader: Add @wordpress/a11y as a Script Module.
The Script Module has the same API as the `wp-a11y` WP Script.

Key changes:
- Add `@wordpress/a11y` to the list of Script and Module dual packages.
- Update `script-modules-packages.min.php` to include the a11y module.
- Modify `WP_Script_Modules` class to track and handle a11y module availability.
- Add method to print required HTML markup for a11y `speak()` functionality.

See #60647.
Props jonsurrell, gziolo, czapla.


git-svn-id: https://develop.svn.wordpress.org/trunk@59089 602fd350-edb4-49c9-b593-d223f7449a82
2024-09-25 16:49:01 +00:00
Michal Czaplinski
9fc6fa134d Revert [59087] due to empty commit message
git-svn-id: https://develop.svn.wordpress.org/trunk@59088 602fd350-edb4-49c9-b593-d223f7449a82
2024-09-25 16:32:23 +00:00
Michal Czaplinski
6df7ce67ca git-svn-id: https://develop.svn.wordpress.org/trunk@59087 602fd350-edb4-49c9-b593-d223f7449a82 2024-09-25 15:55:56 +00:00
Greg Ziółkowski
0b8b80449f Build: Prepare for more Script Modules
This is a companion to https://github.com/WordPress/gutenberg/pull/65460 that requires syncing in WordPress Core. Namely, the block-library changes require registration with their updated script module IDs so that the blocks continue to work correctly.

They key improvement is script modules registration is handled in one central place, and a combined asset file is used to improve the performance by avoiding multiple disk operations for every individual file.

Props jonsurrell, gziolo, wildworks, noisysocks.
See #60647, #59462.



git-svn-id: https://develop.svn.wordpress.org/trunk@59083 602fd350-edb4-49c9-b593-d223f7449a82
2024-09-24 07:33:55 +00:00
Pascal Birchler
35f82135f1 Script Loader: Remove importmap polyfill.
The polyfill was added in [57492], but all browsers supported by WordPress already support import maps.

This not only disables the polyfill, but completely removes it as it was only added recently and there is no usage outside of core.

Props swissspidy, desrosj, luisherranz, gziolo.
Fixes #60970.

git-svn-id: https://develop.svn.wordpress.org/trunk@58952 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-29 06:04:02 +00:00
Riad Benguella
f003fd07ba Build Tools: Use umd builds provided by React instead of bundling our own builds.
We tried moving away from the deprecated React UMD builds previously,
the problem we faced is that there's a warning that is triggered on the console because we're not using a separate impact for `createRoot`.

This warning has been removed in React 19 along with the removal of the UMD builds, so we should be able to revert this commit when we upgrade to React 19 but for now, we need to restore the usage of the umd builds.

Props mamaduka.
See #61324.

git-svn-id: https://develop.svn.wordpress.org/trunk@58775 602fd350-edb4-49c9-b593-d223f7449a82
2024-07-22 10:00:09 +00:00
Greg Ziółkowski
6027cea244 Build: Remove legacy webpack DefinePlugin configuration
Follow-up [58193].
Fixes #61262.
Props jonsurrell.



git-svn-id: https://develop.svn.wordpress.org/trunk@58577 602fd350-edb4-49c9-b593-d223f7449a82
2024-06-26 08:25:13 +00:00
Ella
5aea85cad3 Add missing vendors file after r58271.
See #61324.



git-svn-id: https://develop.svn.wordpress.org/trunk@58273 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-31 18:08:56 +00:00
Ella
430c8b091b React: Upgrade to the new JSX transform.
See https://github.com/WordPress/gutenberg/pull/61692.
See https://github.com/WordPress/wordpress-develop/pull/6678.

Props youknowriad.

Fixes #61324.



git-svn-id: https://develop.svn.wordpress.org/trunk@58271 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-31 17:54:41 +00:00
Greg Ziółkowski
6bb6a45e39 Interactivity API: Include preact/debug when SCRIPT_DEBUG is enabled
Syncs the changes from Gutenberg: https://github.com/WordPress/gutenberg/pull/60514. Enqueues a different Interactivity API runtime version with preact/debug when SCRIPT_DEBUG is enabled.

Props darerodz, jonsurrell, gziolo.
Fixes #61171.



git-svn-id: https://develop.svn.wordpress.org/trunk@58195 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-24 09:40:04 +00:00
Greg Ziółkowski
93f36a09fe Build: Add globalThis DefinePlugin config to webpack
This updates the build to account for related changes in WordPress packages. More details in https://github.com/WordPress/gutenberg/pull/61486.

Props jonsurrell, youknowriad, swissspidy, gziolo.
Fixes #61262.




git-svn-id: https://develop.svn.wordpress.org/trunk@58193 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-24 07:58:42 +00:00
Pascal Birchler
559e729cc8 Script Loader: Disable injectPolyfill flag in webpack config.
This is a follow-up to [57981] to ensure that `wp-polyfill` is no longer automatically added as a dependency to package scripts. This avoids unnecessarily loading the polyfill script in places such as the block editor.

See #60962.

git-svn-id: https://develop.svn.wordpress.org/trunk@58162 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-16 16:42:57 +00:00
Riad Benguella
9453f3a85b Editor: Update WordPress packages to Gutenberg 16.7 RC3.
It brings with a set of iterations and follow-ups to the initial package update.
It also fixes a regression that happened for interactive blocks.

Props gziolo, luisherranz, cbravobernal.
See #60315.

git-svn-id: https://develop.svn.wordpress.org/trunk@57499 602fd350-edb4-49c9-b593-d223f7449a82
2024-01-31 11:54:09 +00:00
Greg Ziółkowski
dc15d66ee6 Script Modules API: Add import map polyfill for older browsers
Syncs the changes from https://github.com/WordPress/gutenberg/pull/58263. Adds a polyfill to make import maps compatible with unsported browsers (https://caniuse.com/import-maps).

Fixes #60348.
Props cbravobernal, jorbin, luisherranz, jonsurrell.



git-svn-id: https://develop.svn.wordpress.org/trunk@57492 602fd350-edb4-49c9-b593-d223f7449a82
2024-01-31 08:29:18 +00:00
Riad Benguella
cf8b74de16 Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress. 
This includes features like:

 - DataViews.
 - Customization tools like box shadow, background size and repeat.
 - UI improvements in the site editor. 
 - Preferences sharing between the post and site editors.
 - Unified panels and editors between post and site editors.
 - Improved template mode in the post editor.
 - Iterations to multiple interactive blocks.
 - Preparing the blocks and UI for pattern overrides.
 - and a lot more.

Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.

git-svn-id: https://develop.svn.wordpress.org/trunk@57377 602fd350-edb4-49c9-b593-d223f7449a82
2024-01-29 21:04:18 +00:00
Tammie Lister
ae1484cbb6 Update editor related npm packages
The npm packages needed updating for 6.4 to the latest.

Props mikachan, mukesdpanchal27, luisherranz, youknowriad, tellthemachines, gziolo, ockham, michalczaplinski

Fixes #59411



git-svn-id: https://develop.svn.wordpress.org/trunk@56710 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 14:20:18 +00:00
Greg Ziółkowski
a3c6b4c634 Build: Introduce SCRIPT_DEBUG global in webpack processing
Backports the same changes to the webpack config in the Gutenberg plugin with https://github.com/WordPress/gutenberg/pull/50122.

The `warning` function from `@wordpress/warning` no longer worked correctly with webpack 5. In practice, it no longer called `console.warn`. To fix it, the usage of `process.env.NODE_ENV` check got replaced with another optional global: `SCRIPT_DEBUG`. All the tools used in the Gutenberg, get updated to work with this new constant, including `@wordpress/scripts`. This way, developers are able to guard code that should be run only in development mode. In WordPress core, the same constant needs to be added mostly to ensure that the code behind the check gets completely removed in production mode.

Fixes #59407.



git-svn-id: https://develop.svn.wordpress.org/trunk@56699 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 06:49:55 +00:00
Jonathan Desrosiers
d13208e291 Build/Test Tools: Update build related dependencies to their latest versions.
This updates the following npm dependencies:
- `autoprefixer` to version `10.4.16`.
- `grunt-contrib-qunit` to version `8.0.1`.
- `postcss` to version `8.4.30`.
- `react-refresh` to version `0.14.0`.
- `sass` to version `1.68.0`.
- `sinon` to version `16.0.0`.
- `uuid` to version `9.0.1`.
- `tslib` to version `2.6.2`.

This change accompanies a similar one in the Gutenberg repository: https://github.com/WordPress/gutenberg/pull/54657.

Props gziolo, desrosj.
Fixes #58863.

git-svn-id: https://develop.svn.wordpress.org/trunk@56647 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-21 13:24:50 +00:00
Isabel Brison
9520d9eb69 Editor: update npm packages with second round of bug fixes for 6.3 RC1.
Includes miscellaneous bug fixes for 6.3 RC1.

Props ramonopoly, mukesh27.
Fixes #58804.


git-svn-id: https://develop.svn.wordpress.org/trunk@56255 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-18 07:17:23 +00:00
Peter Wilson
4aeb284d44 Editor: Update block-serialization-default-parser package for WP 6.3 Beta 1.
Update the `@wordpress/block-serialization-default-parser` to 4.35.1 for WordPress 6.3 Beta 1. These changes split the following classes in to their own files in order to match the WordPress PHP coding standards:

* `WP_Block_Parser_Block`
* `WP_Block_Parser_Frame`
* `WP_Block_Parser`

These classes were previously all included in the `src/wp-includes/class-wp-block-parser.php` file. In order to maintain backward compatibly for developers requiring the file directly, the relocated classes are replaced with `require_once` calls in the original file.

In order to retain the commit history of the new files, they have been created using the `svn copy` command.

Props aristath, rajanpanchal2028, jrf, SergeyBiryukov, costdev, manfcarlo, spacedmonkey, mukesh27, isabel_brison, dd32.
Fixes #57832.
See #58623.



git-svn-id: https://develop.svn.wordpress.org/trunk@56048 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 00:43:42 +00:00
zieladam
d125ed019c Build/Test tools: Prevent registering the same private JavaScript API twice.
This sets the IS_WORDPRESS_CORE global variable to true in the webpack build script to enable extra safeguards around private JavaScript APIs.

Props costdev, hellofromTonya, gziolo, peterwilsoncc.
Fixes #57795.


git-svn-id: https://develop.svn.wordpress.org/trunk@55512 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-10 12:35:42 +00:00
Jonathan Desrosiers
86dc3ffe0b External Libraries: Update element-closest.
This updates the `element-closest` polyfill to the latest version, `3.0.2`.

Because of changes to how the package is now built and distributed, both files for the library now contain minified code.

This library is no longer used by Core itself and maintained as a courtesy. Any projects utilizing it should reevaluate their usage requirements with modern browsers.

Props hareesh-pillai, gziolo, mukesh27, costdev.
Fixes #52851.

git-svn-id: https://develop.svn.wordpress.org/trunk@55275 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 16:46:34 +00:00
Felix Arntz
99702c84eb Editor: Remove unnecessary CSS comments from compiled styles.
Props aristath, adamsilverstein, SergeyBiryukov, gziolo.
Fixes #56388.


git-svn-id: https://develop.svn.wordpress.org/trunk@55193 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 18:57:39 +00:00
Riad Benguella
15b5159d49 Editor: Add inert attribute polyfill.
The new Gutenberg packages are using the inert attribute
to disable some parts of the HTML tree in an accessible way.

Props ntsekouras.
Fixes #57492.


git-svn-id: https://develop.svn.wordpress.org/trunk@55084 602fd350-edb4-49c9-b593-d223f7449a82
2023-01-18 11:14:33 +00:00
Greg Ziółkowski
9fb661c7b7 Tools: Simplify syncing core blocks from Gutenberg plugin to Core
Follow-up [53688].

Removes the hardcoded list of blocks that should be synced from the Gutenberg plugin. webpack reads all information from the `@wordpress/block-library` by scanning `block.json` files.

Props zieladam, azaozz.
Fixes #56179.



git-svn-id: https://develop.svn.wordpress.org/trunk@54308 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-26 11:40:44 +00:00
Greg Ziółkowski
00d2562fe2 Tools: Fix running build scripts on Windows does not generate CSS files for blocks
Starting with WordPress 6.0, when running `npm run build` or `npm run build:dev`, no CSS files were generated for the blocks within `wp-includes/blocks/**`.

Props wildworks, clorith, sergeybiryukov.
Fixes #56616.



git-svn-id: https://develop.svn.wordpress.org/trunk@54307 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-26 11:20:43 +00:00
Greg Ziółkowski
108c92d8dd Build: Improve how combined assets are generated
Allows to revert changes applied in [54277] - temporary workaround for the failing Test NPM CI check on Windows.

Improvements included:
- generate combined asset files for both production and development
- store in the repository only the production version of the combined assets for packages, we use everything else only in development
- to make unit tests work, ensure that they ignore react fast refresh and use the production version of combined assets that are present in the source code

Props bernhard-reiter, jsnajdr, clorith, wildworks.
Fixes #56615.



git-svn-id: https://develop.svn.wordpress.org/trunk@54289 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-23 08:25:45 +00:00
Greg Ziółkowski
3b63a75108 Editor: Sync changes from the Gutenberg plugin 14.1 release
Updated WordPress packages necessary for releasing WordPress 6.1 Beta 1:

- @wordpress/a11y@3.17.1
 - @wordpress/annotations@2.17.2
 - @wordpress/api-fetch@6.14.1
 - @wordpress/autop@3.17.1
 - @wordpress/babel-plugin-import-jsx-pragma@4.0.1
 - @wordpress/babel-plugin-makepot@5.1.1
 - @wordpress/babel-preset-default@7.1.1
 - @wordpress/base-styles@4.8.1
 - @wordpress/blob@3.17.1
 - @wordpress/block-directory@3.15.2
 - @wordpress/block-editor@10.0.2
 - @wordpress/block-library@7.14.2
 - @wordpress/block-serialization-default-parser@4.17.1
 - @wordpress/block-serialization-spec-parser@4.17.1
 - @wordpress/blocks@11.16.2
 - @wordpress/browserslist-config@5.0.1
 - @wordpress/components@21.0.2
 - @wordpress/compose@5.15.2
 - @wordpress/core-data@5.0.2
 - @wordpress/create-block-tutorial-template@2.5.1
 - @wordpress/create-block@4.1.1
 - @wordpress/custom-templated-path-webpack-plugin@2.1.3
 - @wordpress/customize-widgets@3.14.2
 - @wordpress/data-controls@2.17.2
 - @wordpress/data@7.1.2
 - @wordpress/date@4.17.1
 - @wordpress/dependency-extraction-webpack-plugin@4.0.2
 - @wordpress/deprecated@3.17.1
 - @wordpress/docgen@1.26.1
 - @wordpress/dom-ready@3.17.1
 - @wordpress/dom@3.17.2
 - @wordpress/e2e-test-utils@8.1.1
 - @wordpress/e2e-tests@5.1.2
 - @wordpress/edit-post@6.14.2
 - @wordpress/edit-site@4.14.2
 - @wordpress/edit-widgets@4.14.2
 - @wordpress/editor@12.16.2
 - @wordpress/element@4.15.1
 - @wordpress/env@5.2.1
 - @wordpress/escape-html@2.17.1
 - @wordpress/eslint-plugin@13.1.1
 - @wordpress/format-library@3.15.2
 - @wordpress/hooks@3.17.1
 - @wordpress/html-entities@3.17.1
 - @wordpress/i18n@4.17.1
 - @wordpress/icons@9.8.1
 - @wordpress/interface@4.16.2
 - @wordpress/is-shallow-equal@4.17.1
 - @wordpress/jest-console@6.0.1
 - @wordpress/jest-preset-default@9.0.1
 - @wordpress/jest-puppeteer-axe@5.0.1
 - @wordpress/keyboard-shortcuts@3.15.2
 - @wordpress/keycodes@3.17.1
 - @wordpress/lazy-import@1.4.3
 - @wordpress/library-export-default-webpack-plugin@2.3.3
 - @wordpress/list-reusable-blocks@3.15.2
 - @wordpress/media-utils@4.8.1
 - @wordpress/notices@3.17.2
 - @wordpress/npm-package-json-lint-config@4.2.1
 - @wordpress/nux@5.15.2
 - @wordpress/plugins@4.15.2
 - @wordpress/postcss-plugins-preset@4.1.1
 - @wordpress/postcss-themes@5.0.1
 - @wordpress/preferences-persistence@1.9.1
 - @wordpress/preferences@2.9.2
 - @wordpress/prettier-config@2.0.1
 - @wordpress/primitives@3.15.1
 - @wordpress/priority-queue@2.17.2
 - @wordpress/project-management-automation@1.16.1
 - @wordpress/react-i18n@3.15.1
 - @wordpress/readable-js-assets-webpack-plugin@2.0.1
 - @wordpress/redux-routine@4.17.1
 - @wordpress/reusable-blocks@3.15.2
 - @wordpress/rich-text@5.15.2
 - @wordpress/scripts@24.1.2
 - @wordpress/server-side-render@3.15.2
 - @wordpress/shortcode@3.17.1
 - @wordpress/style-engine@1.0.1
 - @wordpress/stylelint-config@21.0.1
 - @wordpress/token-list@2.17.1
 - @wordpress/url@3.18.1
 - @wordpress/viewport@4.15.2
 - @wordpress/warning@2.17.1
 - @wordpress/widgets@2.15.2
 - @wordpress/wordcount@3.17.1


Props bernhard-reiter, cbravobernal, czapla, oandregal, isabel_brison, andrewserong, mciampini.
See #56467.



git-svn-id: https://develop.svn.wordpress.org/trunk@54257 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-20 15:14:54 +00:00
Sergey Biryukov
d4da924446 Editor: Alphabetize block lists in various places.
This affects:
* `wp-includes/blocks/index.php`
* `tools/webpack/blocks.js`
* `_unhook_block_registration()` in `tests/phpunit/includes/functions.php`

Follow-up to [47250], [52069], [52730], [53157], [53278].

Fixes #56131.

git-svn-id: https://develop.svn.wordpress.org/trunk@53633 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-02 17:44:46 +00:00
Greg Ziółkowski
e0837a8b18 Editor: Update WordPress packages for 6.0 Beta 4
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 Beta 3.

Props zieladam, ndiego, darerodz.
See #55567.




git-svn-id: https://develop.svn.wordpress.org/trunk@53329 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 10:36:45 +00:00
Greg Ziółkowski
26413556c9 Editor: Update WordPress packages for 6.0 Beta 3
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 Beta 2.

Props zieladam, ndiego.
See #55567.



git-svn-id: https://develop.svn.wordpress.org/trunk@53278 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-26 13:39:57 +00:00
Greg Ziółkowski
eb0d801267 Build: Update the constant used to remove experimental Gutenberg code
We missed the change for blocks that got applied to packages. `process.env.GUTENBERG_PHASE` got renamed to `process.env.IS_GUTENBERG_PLUGIN`.

See #55567.
Follow-up for [53157].



git-svn-id: https://develop.svn.wordpress.org/trunk@53262 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-25 17:01:40 +00:00
Greg Ziółkowski
5d3a78bbd8 Editor: Update WordPress packages for 6.0 Beta 2
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 Beta 1.

Props zieladam, ndiego.
See #55567.



git-svn-id: https://develop.svn.wordpress.org/trunk@53219 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 15:08:48 +00:00
Greg Ziółkowski
8fafc11932 Editor: Correctly register the dynamic Cover block
The new "Featured Image" enhancement is handled dynamically, so we need to update how the Cover block is handled in the build processa and registered in the code.

Props ironprogrammer, costdev, Mamaduka, chaion07.
Fixes #55580.



git-svn-id: https://develop.svn.wordpress.org/trunk@53212 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 11:35:50 +00:00
Greg Ziółkowski
bab610091d Editor: Update WordPress packages based based on Gutenberg v13.0 RC3
This is the last step of backports from the Gutenberg plugin for WordPress 6.0 Beta 1 release. It includes all updates WordPress packages published to npm based on the Gutenberg plugin v13.0 RC3 release. This patch also includes all the necessary changes applied to core blocks. New blocks included:

- Avatar
- Comment Author Name
- Comment Content
- Comment Date
- Comment Edit Link
- Comment Rely Link
- Comment Template
- Comments Pagination
- Comments Pagination Next
- Comments Pagination Previous
- Comments Query Loop
- Home Link
- Post Author Biography
- Query No Results
- Read More
See more details in https://github.com/WordPress/wordpress-develop/pull/2564.

Props zieladam, ramonopoly, ocean90.
Fixes #55505.



git-svn-id: https://develop.svn.wordpress.org/trunk@53157 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-12 15:10:30 +00:00
Greg Ziółkowski
b726922bb9 Build: Enable React Fast Refresh for block development
Brings the same functionality introduced in the Gutenberg plugin with https://github.com/WordPress/gutenberg/pull/28273. In effect, it brings React Fast Refresh support to WordPress core for block development with `@wordpress/scripts`.

Props walbo, antonvlasenko.
See #51750, #55505.
Follow-up [53135].



git-svn-id: https://develop.svn.wordpress.org/trunk@53140 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-11 16:08:12 +00:00
Greg Ziółkowski
4f64273933 Build: Update webpack to v5.x
Update webpack version to latest version https://www.npmjs.com/package/webpack. This aligns closer with how the Gutenberg plugin handles WordPress packages. Related update in Gutenberg from August 2021: https://github.com/WordPress/gutenberg/pull/33818.

Props walbo, desrosj, mukesh27.
Fixes #51750.




git-svn-id: https://develop.svn.wordpress.org/trunk@53135 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-11 12:02:14 +00:00
Robert Anderson
667fb94b79 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Image block: Set image display to grid when no alignment sent to properly align caption on resize
- Update and align template descriptions
- Site Editor - prevent loading state from showing the admin menu.
- Add client side routing for Site Editor
- Navigation: Add clearance for appender in submenus.
- Fix CSS Custom Properties for presets in the site editor
- Add/navigation blocks post processing after migration from menu items
- Allow selector ordering to ensure theme.json root selector margin takes precedence 
- Do not remove theme presets if defaults are hidden
- Format library: fix unsetting highlight color
- FSE: Fix template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity
- ColorPalette: Improving accessibility and visibility
- Update: Make the color popover on the gradient picker appear as expected
- Site Editor: Display a notice if export fails
- Fix docs and function naming for gallery block registration in PHP
- Switch to addEventListener for load event in the navigation block view script
- Fix mistake in _remove_theme_attribute_in_block_template_content
- Better synchronisation between Gutenberg and Core code
- Move the block page templates hook into compat/5.9 folder
- Moves to the template loader hooks and functions into lib/compat folder
- Refactor the gutenberg_is_fse_theme function to use wp_is_block_theme
- Site Editor: Update support doc URL in Welcome Guide
- Global Styles: Add Welcome Guide toggle
- Hide remove control point when removing would break gradient control
- Don't request the deprecated navigation areas endpoint outside of the Gutenberg plugin
- Image: Fix resizer controls being hidden in Safari when switching between alignments
- Remove Navigation Menus from WP Admin sidebar
- Site Editor: Hide the block appender in the Template Part editor
- Site Editor: Use server definition for the Template Areas
- Synchronize wp_is_block_theme and block-templates block support with Core
- E2E: Retry login again after a bad nonce request to prevent intermittent test failures 
- Fix theme requirement validation with WP 5.8
- Fix WP 5.9 check for conditionally running code
- Fix post comment form input width
- Border Style Control: Update styling for consistency with border width control
- Fix form-submit styles by adding button classes to the submit-button in post-comments block
- Site Editor: Fix edit template part link in header dropdown
- Move duotone palette to the bottom of global styles gradients
- Fix how appearanceTools works
- Move WP 5.9 wp-admin menus compatibility code to lib/compat folder
- Revert "Site Editor: Set the <title> on the list page to be same as the CPT name"
- Site Editor: Document Actions: add SR text to heading 1
- Do not register global styles CPT in WordPress 5.9
- Global Styles: Move the 'Edit colors' button to a standard menu item
- Fix styles for previews and patterns
- Site Editor: Fix failing E2E test
- Templates: Search for old template names in the parent theme too
- Remove 4 instances of 'gutenberg' text domain from WordPress core
- Fix content loss when ungrouping template parts or reusable blocks
- Simplify the RESET_BLOCK action to fix template part focus mode content loss
- [Global Styles]: Make Blocks section more distinguishable
- Only use block markup for comment form button when using a block theme
- Navigation: Fix vertical alignment of page list in modal.
- Fix: ToggleGroupControl active state
- Remove gutenberg_ prefix from @wordpress/block-library

Props ocean90, oandregal, hellofromtonya, youknowriad.
See #54487.


git-svn-id: https://develop.svn.wordpress.org/trunk@52364 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 01:55:28 +00:00
Jonny Harris
a9e66f4bcb Editor: Remove Navigation Areas
Navigation area were merged as part of full site editing and the new navigation block. This functionality is experimental and not currently used in WordPress core, so should be removed.

Props noisysocks, spacedmonkey, get_dave, zieladam.
Fixes #54506.



git-svn-id: https://develop.svn.wordpress.org/trunk@52272 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 22:04:48 +00:00
Robert Anderson
f034bc832e Add Site Editor and PHP changes from Gutenberg 10.1 - 11.9
- First pass at adding the site editor from the Gutenberg plugin to
  wp-admin/site-editor.php.
- Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9.

Follows [52042].
See #54337.
Props youknowriad, aristath, hellofromtonya, gziolo.


git-svn-id: https://develop.svn.wordpress.org/trunk@52069 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 02:15:23 +00:00
Robert Anderson
39e33bed83 Editor: Add block theme infrastructure
Adds the required infrastructure to render block-based themes. This is sourced
from the Gutenberg plugin.

Fixes #54335.
Props bernhard-reiter, youknowriad, ntsekouras, hellofromtonya.


git-svn-id: https://develop.svn.wordpress.org/trunk@52062 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 23:09:53 +00:00
Greg Ziółkowski
1918fe9e25 Build: Remove polyfills from block view scripts
Related changes in Gutenberg: https://github.com/WordPress/gutenberg/pull/35038.

When adding a block with a view.js script, the frontend loads an additional ~20kb of scripts that were previously not there. These are coming from polyfills that are defined as a dependency for view.js scripts.
Since WordPress dropped support for IE, these polyfills are no longer needed and can be removed.

Follow-up to [51501].
See #53690.
Props aristath.



git-svn-id: https://develop.svn.wordpress.org/trunk@52011 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-04 15:56:06 +00:00
gziolo
ad976addb3 Build: Split packages and blocks to their webpack configs
It aligns with the changes proposed added in Gutenberg: https://github.com/WordPress/gutenberg/pull/33293.

The idea here is to split the growing webpack config into two parts: blocks and  packages.

We need to add handling for JavaScript files that are going to be used with blocks on the frontend. They didn't work quite well with the current setup for entry points created for packages.

As part of the effort, it adds support for `viewScript` in `block.json` metadata file that is later translated to `$view_script` in `WP_Block_Type` class and exposed as `view_script` from the REST API endpoint for block types.

Props youknowriad, desrosj, aristath.
Fixes #53690.



git-svn-id: https://develop.svn.wordpress.org/trunk@51501 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-28 10:05:01 +00:00
Jonathan Desrosiers
36012064f6 Build/Test Tools: Revert [51259-51256,51265].
[51259] introduced a PHP notice that was not actually fixed by [51265]. Reverting these changes in order to investigate further.

See #53397.

git-svn-id: https://develop.svn.wordpress.org/trunk@51268 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 02:13:30 +00:00
Riad Benguella
51cbe7eeb7 Build: Split packages and blocks to their webpack configs.
This also adds support for the viewScript for blocks fixing 
the PDF preview for file blocks.

Props desrosj, gziolo.
See #53397.


git-svn-id: https://develop.svn.wordpress.org/trunk@51259 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-29 15:08:16 +00:00
Jonathan Desrosiers
1ec56ec5b5 Build/Test Tools: Add the regenerator-runtime script as a dependency to wp-polyfill.
In [51146], the `core-js` package replaced the deprecated `@babel//polyfill` one. The `core-js` package builds `wp-polyfill` from a configuration provided by `@wordpress/babel-preset-default` instead of copying a one size fits all polyfill.

That change caused an issue where plugins and themes relying on the `regenerator-runtime` script being included in the `wp-polyfill.js` file encountering fatal JavaScript errors.

This adds the `regenerator-runtime` package to Core and registers it as a dependency for `wp-polyfill`. While Core does not require `regenerator-runtime`, it will allow for a smoother transition to using `core-js`.

This dependency will be removed in a future version of WordPress, so developers are encouraged to add `regenerator-runtime` as a dependency for any custom script that requires it.

Follow up to [51146].

Props gziolo, herregroen, jeherve, hellofromtonya, peterwilsoncc.
Fixes #52941.

git-svn-id: https://develop.svn.wordpress.org/trunk@51212 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-23 00:04:47 +00:00
Riad Benguella
0068f2646c Block Editor: Update the WordPress packages with the fixes for 5.8 beta 2.
This includes:

**Various**

 - Fix multi selection for nested blocks https://github.com/WordPress/gutenberg/pull/32536
 - Consistently show the drop indicator while dragging blocks https://github.com/WordPress/gutenberg/pull/31896
 - Fix horizontal drop indicator https://github.com/WordPress/gutenberg/pull/32589
 - Fix Safari flickering issue https://github.com/WordPress/gutenberg/pull/32581
 - Silence useSelect zombie bug errors https://github.com/WordPress/gutenberg/pull/32088

**Template Editor**

 - Clarify the template creation modal https://github.com/WordPress/gutenberg/pull/32427
 - Only add skip links for block templates https://github.com/WordPress/gutenberg/pull/32451

**Widgets Editor**

 - Add block breadcrumb https://github.com/WordPress/gutenberg/pull/32498 https://github.com/WordPress/gutenberg/pull/32528 https://github.com/WordPress/gutenberg/pull/32569
 - Saved deleted and restored widgets. https://github.com/WordPress/gutenberg/pull/32534
 - Fix unsaved changes detection https://github.com/WordPress/gutenberg/pull/32573
 - Fix button spacing in the header https://github.com/WordPress/gutenberg/pull/32585
 - Avoid extra undo levels https://github.com/WordPress/gutenberg/pull/32572
 - Move Legacy Widget block to the `@wordpress/widgets` package https://github.com/WordPress/gutenberg/pull/32501
 - Fix Social Links color inheritance https://github.com/WordPress/gutenberg/pull/32625
 - Use Button appender https://github.com/WordPress/gutenberg/pull/32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings https://github.com/WordPress/gutenberg/pull/32358 https://github.com/WordPress/gutenberg/pull/32622
 - Use CSS Custom Properties for the preset styles https://github.com/WordPress/gutenberg/pull/32627

**Performance**

 - Remove is-typing classname to improve typing performance https://github.com/WordPress/gutenberg/pull/32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.


git-svn-id: https://develop.svn.wordpress.org/trunk@51149 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 08:50:26 +00:00
Jonathan Desrosiers
825a9c7b97 Build/Test Tools: Replace the deprecated @babel/polyfill.
This replaces the dependency of the deprecated `@babel/polyfill` package with the `core-js` package through `@wordpress/babel-preset-default`.

Previously, the file consisted of a generalized group of polyfills, and not all of them were required. This change allows the contents of this file to be built according to the exact needs as dictated by the `@wordpress/babel-preset-default` package, which takes into account the current browser support.

Props gziolo, youknowriad. 
Fixes #52941.

git-svn-id: https://develop.svn.wordpress.org/trunk@51146 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-14 23:16:27 +00:00
Riad Benguella
0d4bdbf835 Block Editor: Include the page list block server-side code.
On a previous package update, this block's server-side code has been missed.
This was causing the block to not render properly.

Props Chouby, desrosj, mcsf.
Fixes #53309.


git-svn-id: https://develop.svn.wordpress.org/trunk@51105 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 18:11:31 +00:00
Riad Benguella
9ae2587b76 Block Editor: Package updates for WordPress 5.8 beta 1 (batch2).
This includes the following fixes:

 - Fix inspector opening when clicking outside the widget areas
 - Assume light theme when a transparent background is used
 - Make Post blocks non editable inside Query block
 - Rename QueryLoop to PostTemplate block

Props ntsekouras.
See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51101 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 17:31:14 +00:00