Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:WordPress/gutenberg into 66599-dat…
Browse files Browse the repository at this point in the history
…aform-improve-loading-state-management
  • Loading branch information
gigitux committed Dec 10, 2024
2 parents 3431599 + 601ede4 commit 6632305
Show file tree
Hide file tree
Showing 181 changed files with 8,102 additions and 6,692 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: ./.github/setup-node

- name: Restore tests setup cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~/.appium
Expand All @@ -52,7 +52,7 @@ jobs:
# AVD cache disabled as it caused emulator termination to hang indefinitely.
# https://github.com/ReactiveCircus/android-emulator-runner/issues/385
# - name: AVD cache
# uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
# uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
# id: avd-cache
# with:
# path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
uses: ./.github/setup-node

- name: Restore tests setup cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~/.appium
Expand All @@ -55,15 +55,15 @@ jobs:
run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt

- name: Restore build cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app
packages/react-native-editor/ios/build/WDA
key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ matrix.device }}-${{ hashFiles('ios-checksums.txt') }}

- name: Restore pods cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
packages/react-native-editor/ios/Pods
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ jobs:
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT

- name: Cache PHPCS scan cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: .cache/phpcs.json
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}
Expand Down
3 changes: 3 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"plugins": [ "." ],
"themes": [ "./test/emptytheme" ],
"env": {
"development": {
"phpmyadminPort": 9000
},
"tests": {
"mappings": {
"wp-content/plugins/gutenberg": ".",
Expand Down
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7865.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7865

* https://github.com/WordPress/gutenberg/pull/66851
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7976.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7976

* https://github.com/WordPress/gutenberg/pull/67716
15 changes: 2 additions & 13 deletions bin/plugin/commands/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require( 'path' );
const glob = require( 'fast-glob' );
const fs = require( 'fs' );
const { inc: semverInc } = require( 'semver' );
const rimraf = require( 'rimraf' );
const { rimraf } = require( 'rimraf' );
const readline = require( 'readline' );
const SimpleGit = require( 'simple-git' );

Expand Down Expand Up @@ -60,17 +60,6 @@ const pluginConfig = require( '../config' );
* @property {ReleaseType} releaseType The selected release type.
*/

/**
* Throws if given an error in the node.js callback style.
*
* @param {any|null} error If callback failed, this will hold a value.
*/
const rethrow = ( error ) => {
if ( error ) {
throw error;
}
};

/**
* Checks out the npm release branch.
*
Expand Down Expand Up @@ -599,7 +588,7 @@ async function runPackagesRelease( config, customMessages ) {
await Promise.all(
temporaryFolders
.filter( ( tempDir ) => fs.existsSync( tempDir ) )
.map( ( tempDir ) => rimraf( tempDir, rethrow ) )
.map( ( tempDir ) => rimraf( tempDir ) )
)
);

Expand Down
4 changes: 2 additions & 2 deletions docs/contributors/code/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The [Gutenberg repository](https://github.com/WordPress/gutenberg) on GitHub is
Before you begin, there are some requirements that must be met in order to successfully release a stable version of the Gutenberg plugin. You will need to:

- Be a member of the [Gutenberg development team](https://developer.wordpress.org/block-editor/block-editor/contributors/repository-management/#teams). This gives you the ability to launch the GitHub actions that are related to the release process and to backport pull requests (PRs) to the release branch.
- Have write permissions on the [Make WordPress Core](http://make.wordpress.org/core) blog. This allows you to draft the release post.
- Have write permissions on the [Make WordPress Core](https://make.wordpress.org/core) blog. This allows you to draft the release post.
- Obtain approval from a member of the Gutenberg Core team in order to upload the new version Gutenberg to the WordPress.org plugin directory.

Similar requirements apply to releasing WordPress's [npm packages](https://developer.wordpress.org/block-editor/contributors/code/release/#packages-releases-to-npm-and-wordpress-core-updates).
Expand Down Expand Up @@ -344,7 +344,7 @@ To do this, when running the Workflow, select the appropriate `release/` branch

It is possible to create a minor release for any release branch even after a more recent stable release has been published. This can be done for _any_ previous release branches, allowing more flexibility in delivering updates to users. In the past, users had to wait for the next stable release, potentially taking days. Now, fixes can be swiftly shipped to any previous release branches as required.

The process is identical to the one documented above when an RC is already out: choose a previous release branch, type `stable`, and click "Run workflow". The release will be published on the GitHub releases page for Gutenberg and to the WordPress core repository SVN as a `tag` under http://plugins.svn.wordpress.org/gutenberg/tags/. The SVN `trunk` directory will not be touched.
The process is identical to the one documented above when an RC is already out: choose a previous release branch, type `stable`, and click "Run workflow". The release will be published on the GitHub releases page for Gutenberg and to the WordPress core repository SVN as a `tag` under https://plugins.svn.wordpress.org/gutenberg/tags/. The SVN `trunk` directory will not be touched.

**IMPORTANT:** When publishing the draft created by the ["Build Plugin Zip" workflow](https://github.com/WordPress/gutenberg/actions/workflows/build-plugin-zip.yml), make sure to leave the "Set as last release" checkbox unchecked. If it is left checked by accident, the ["Upload Gutenberg plugin to WordPress.org plugin" workflow](https://github.com/WordPress/gutenberg/actions/workflows/upload-release-to-plugin-repo.yml) will still correctly upload it **as a tag (and will _not_ replace the `trunk` version)** to the WordPress plugin repository SVN - the workflow will perform some version arithmetic to determine how the plugin should be shipped - but you'll still need to fix the state on GitHub by setting the right release as `latest` on the [releases](https://github.com/WordPress/gutenberg/releases/) page!

Expand Down
2 changes: 1 addition & 1 deletion docs/contributors/design/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The Gutenberg project uses GitHub for managing code and tracking issues. The mai

If you'd like to contribute to the design or front-end, feel free to contribute to tickets labeled [Needs Design](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+label%3A%22Needs+Design%22) or [Needs Design Feedback](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+label%3A"Needs+Design+Feedback%22). We could use your thoughtful replies, mockups, animatics, sketches, doodles. Proposed changes are best done as minimal and specific iterations on the work that precedes it so we can compare.

The [WordPress Design team](http://make.wordpress.org/design/) uses [Figma](https://www.figma.com/) to collaborate and share work. If you'd like to contribute, join the [#design channel](http://wordpress.slack.com/messages/design/) in [Slack](https://make.wordpress.org/chat/) and ask the team to set you up with a free Figma account. This will give you access to a helpful [library of components](https://www.figma.com/file/ZtN5xslEVYgzU7Dd5CxgGZwq/WordPress-Components?node-id=0%3A1) used in WordPress.
The [WordPress Design team](https://make.wordpress.org/design/) uses [Figma](https://www.figma.com/) to collaborate and share work. If you'd like to contribute, join the [#design channel](https://wordpress.slack.com/messages/design/) in [Slack](https://make.wordpress.org/chat/) and ask the team to set you up with a free Figma account. This will give you access to a helpful [library of components](https://www.figma.com/file/ZtN5xslEVYgzU7Dd5CxgGZwq/WordPress-Components?node-id=0%3A1) used in WordPress.

## Principles

Expand Down
14 changes: 12 additions & 2 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ Contains the block elements used to render a post, like the title, date, feature

- **Name:** core/post-template
- **Category:** theme
- **Parent:** core/query
- **Ancestor:** core/query
- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), layout, spacing (blockGap), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~

## Post Terms
Expand Down Expand Up @@ -724,7 +724,7 @@ Contains the block elements used to render content when no query results are fou

- **Name:** core/query-no-results
- **Category:** theme
- **Parent:** core/query
- **Ancestor:** core/query
- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~

## Pagination
Expand Down Expand Up @@ -777,6 +777,16 @@ Display the query title. ([Source](https://github.com/WordPress/gutenberg/tree/t
- **Supports:** align (full, wide), color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** level, levelOptions, showPrefix, showSearchTerm, textAlign, type

## Query Total

Display the total number of results in a query. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/query-total))

- **Name:** core/query-total
- **Category:** theme
- **Ancestor:** core/query
- **Supports:** align (full, wide), color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** displayType

## Quote

Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Julio Cortázar ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/quote))
Expand Down
13 changes: 13 additions & 0 deletions lib/block-editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ function gutenberg_get_block_editor_settings( $settings ) {
$global_styles[] = $block_classes;
}

// Get any additional css from the customizer and add it before global styles custom CSS.
$global_styles[] = array(
'css' => wp_get_custom_css(),
'__unstableType' => 'user',
'isGlobalStyles' => false,
);

/*
* Add the custom CSS as a separate stylesheet so any invalid CSS
* entered by users does not break other global styles.
Expand All @@ -74,6 +81,12 @@ function gutenberg_get_block_editor_settings( $settings ) {
$block_classes['css'] = $actual_css;
$global_styles[] = $block_classes;
}
// Get any additional css from the customizer.
$global_styles[] = array(
'css' => wp_get_custom_css(),
'__unstableType' => 'user',
'isGlobalStyles' => false,
);
}

$settings['styles'] = array_merge( $global_styles, get_block_editor_theme_styles() );
Expand Down
1 change: 1 addition & 0 deletions lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function gutenberg_reregister_core_block_types() {
'query-pagination-numbers.php' => 'core/query-pagination-numbers',
'query-pagination-previous.php' => 'core/query-pagination-previous',
'query-title.php' => 'core/query-title',
'query-total.php' => 'core/query-total',
'read-more.php' => 'core/read-more',
'rss.php' => 'core/rss',
'search.php' => 'core/search',
Expand Down
2 changes: 2 additions & 0 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,8 @@ public function get_settings() {
* - `variables`: only the CSS Custom Properties for presets & custom ones.
* - `styles`: only the styles section in theme.json.
* - `presets`: only the classes for the presets.
* - `base-layout-styles`: only the base layout styles.
* - `custom-css`: only the custom CSS.
* @param array $origins A list of origins to include. By default it includes VALID_ORIGINS.
* @param array $options An array of options for now used for internal purposes only (may change without notice).
* The options currently supported are:
Expand Down
19 changes: 11 additions & 8 deletions lib/compat/wordpress-6.7/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,18 @@ function gutenberg_register_wp_rest_templates_controller_plugin_field() {
}
add_action( 'rest_api_init', 'gutenberg_register_wp_rest_templates_controller_plugin_field' );

/**
* Overrides the default 'WP_REST_Server' class.
*
* @return string The name of the custom server class.
*/
function gutenberg_override_default_rest_server() {
return 'Gutenberg_REST_Server';
// The `get_user` function was introduced in WP 6.7.
if ( ! function_exists( 'get_user' ) ) {
/**
* Overrides the default 'WP_REST_Server' class.
*
* @return string The name of the custom server class.
*/
function gutenberg_override_default_rest_server() {
return 'Gutenberg_REST_Server';
}
add_filter( 'wp_rest_server_class', 'gutenberg_override_default_rest_server', 1 );
}
add_filter( 'wp_rest_server_class', 'gutenberg_override_default_rest_server', 1 );


/**
Expand Down
26 changes: 25 additions & 1 deletion lib/compat/wordpress-6.8/site-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,33 @@ function gutenberg_redirect_site_editor_deprecated_urls() {
* @return callable The default handler or a custom handler.
*/
function gutenberg_styles_wp_die_handler( $default_handler ) {
if ( ! wp_is_block_theme() && str_contains( $_SERVER['REQUEST_URI'], 'site-editor.php' ) && isset( $_GET['p'] ) ) {
if ( ! wp_is_block_theme() && str_contains( $_SERVER['REQUEST_URI'], 'site-editor.php' ) && current_user_can( 'edit_theme_options' ) ) {
return '__return_false';
}
return $default_handler;
}
add_filter( 'wp_die_handler', 'gutenberg_styles_wp_die_handler' );

/**
* Add a Styles submenu under the Appearance menu
* for Classic themes.
*
* @global array $submenu
*/
function gutenberg_add_styles_submenu_item() {
if ( ! wp_is_block_theme() && ( current_theme_supports( 'editor-styles' ) || wp_theme_has_theme_json() ) ) {
global $submenu;

$styles_menu_item = array(
__( 'Design', 'gutenberg' ),
'edit_theme_options',
'site-editor.php',
);
// If $submenu exists, insert the Styles submenu item at position 2.
if ( $submenu && isset( $submenu['themes.php'] ) ) {
// This might not work as expected if the submenu has already been modified.
array_splice( $submenu['themes.php'], 1, 1, array( $styles_menu_item ) );
}
}
}
add_action( 'admin_init', 'gutenberg_add_styles_submenu_item' );
Loading

0 comments on commit 6632305

Please sign in to comment.