Skip to content

Commit

Permalink
prep build 03/20
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Mar 20, 2024
2 parents b74aa1b + cbea1e5 commit 7d0d84c
Show file tree
Hide file tree
Showing 97 changed files with 8,686 additions and 15,102 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,21 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2.0.0
id: cpu-cores

- name: npm build
# It's not necessary to run the full build, since Jest can interpret
# source files with `babel-jest`. Some packages have their own custom
# build tasks, however. These must be run.
run: npx lerna run build

- name: Running the tests
run: npm run test:unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
run: npm run test:unit -- --ci --maxWorkers=${{ steps.cpu-cores.outputs.count }} --cacheDirectory="$HOME/.jest-cache"

- name: Running the date tests
run: npm run test:unit:date -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
run: npm run test:unit:date -- --ci --maxWorkers=${{ steps.cpu-cores.outputs.count }} --cacheDirectory="$HOME/.jest-cache"

compute-previous-wordpress-version:
name: Compute previous WordPress version
Expand Down Expand Up @@ -293,6 +297,10 @@ jobs:
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2.0.0
id: cpu-cores

- name: Setup Node.js and install dependencies
uses: ./.github/setup-node

Expand All @@ -303,4 +311,4 @@ jobs:
run: npx lerna run build

- name: Running the tests
run: npm run test:native -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
run: npm run test:native -- --ci --maxWorkers=${{ steps.cpu-cores.outputs.count }} --cacheDirectory="$HOME/.jest-cache"
118 changes: 113 additions & 5 deletions docs/contributors/versions-in-wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,161 @@ If anything looks incorrect here, please bring it up in #core-editor in [WordPre
| 16.2-16.7 | 6.4.2 |
| 16.2-16.7 | 6.4.1 |
| 16.2-16.7 | 6.4 |
| 15.2-16.1 | 6.3.2 |
| 15.2-16.1 | 6.3.1 |
| 15.2-16.1 | 6.3 |
| 14.2-15.1 | 6.2.3 |
| 14.2-15.1 | 6.2.2 |
| 14.2-15.1 | 6.2.1 |
| 14.2-15.1 | 6.2 |
| 13.1-14.1 | 6.1.4 |
| 13.1-14.1 | 6.1.3 |
| 13.1-14.1 | 6.1.2 |
| 13.1-14.1 | 6.1.1 |
| 13.1-14.1 | 6.1 |
| 12.0-13.0 | 6.0.6 |
| 12.0-13.0 | 6.0.5 |
| 12.0-13.0 | 6.0.4 |
| 12.0-13.0 | 6.0.3 |
| 12.0-13.0 | 6.0.2 |
| 12.0-13.0 | 6.0.1 |
| 12.0-13.0 | 6.0 |
| 10.8-11.9 | 5.9.8 |
| 10.8-11.9 | 5.9.7 |
| 10.8-11.9 | 5.9.6 |
| 10.8-11.9 | 5.9.5 |
| 10.8-11.9 | 5.9.4 |
| 10.8-11.9 | 5.9.3 |
| 10.8-11.9 | 5.9.2 |
| 10.8-11.9 | 5.9.1 |
| 10.8-11.9 | 5.9 |
| 10.0-10.7 | 5.8.8 |
| 10.0-10.7 | 5.8.7 |
| 10.0-10.7 | 5.8.6 |
| 10.0-10.7 | 5.8.5 |
| 10.0-10.7 | 5.8.4 |
| 10.0-10.7 | 5.8.3 |
| 10.0-10.7 | 5.8.2 |
| 10.0-10.7 | 5.8.1 |
| 10.0-10.7 | 5.8 |
| 9.3-9.9 | 5.7.10 |
| 9.3-9.9 | 5.7.9 |
| 9.3-9.9 | 5.7.8 |
| 9.3-9.9 | 5.7.7 |
| 9.3-9.9 | 5.7.6 |
| 9.3-9.9 | 5.7.5 |
| 9.3-9.9 | 5.7.4 |
| 9.3-9.9 | 5.7.3 |
| 9.3-9.9 | 5.7.2 |
| 9.3-9.9 | 5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 4.7.1 | 5.0.15 |
| 4.7.1 | 5.0.14 |
| 4.7.1 | 5.0.13 |
| 4.7.1 | 5.0.12 |
| 4.7.1 | 5.0.11 |
| 4.7.1 | 5.0.10 |
| 4.7.1 | 5.0.9 |
| 4.7.1 | 5.0.8 |
Expand All @@ -68,4 +176,4 @@ If anything looks incorrect here, please bring it up in #core-editor in [WordPre
| 4.7.1 | 5.0.3 |
| 4.7.0 | 5.0.2 |
| 4.6.1 | 5.0.1 |
| 4.6.1 | 5.0.0 |
| 4.6.1 | 5.0 |
2 changes: 1 addition & 1 deletion docs/how-to-guides/format-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In WordPress lingo, a _format_ is a [HTML tag with text-level semantics](https:/

## Before you start

This guide assumes you are already familiar with WordPress plugins and loading JavaScript with them, see the [Plugin Handbook](https://developer.wordpress.org/plugins/) or [JavaScript Tutorial](/docs/how-to-guides/javascript/README.md) to brush up.
This guide assumes you are already familiar with WordPress plugins and loading JavaScript with them, see the [Plugin Handbook](https://developer.wordpress.org/plugins/) or [JavaScript Tutorial](/docs/getting-started/fundamentals/javascript-in-the-block-editor.md) to brush up.

You will need:

Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/metabox.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This guide shows how to create a block that prompts a user for a single value, a

## Before you start

This guide assumes you are already familiar with WordPress plugins, post meta, and basic JavaScript. Review the [Getting started with JavaScript tutorial](/docs/how-to-guides/javascript/README.md) for an introduction.
This guide assumes you are already familiar with WordPress plugins, post meta, and basic JavaScript. Review the [Getting started with JavaScript tutorial](/docs/getting-started/fundamentals/javascript-in-the-block-editor.md) for an introduction.

The guide will walk through creating a basic block, but recommended to go through the [Create Block tutorial](/docs/getting-started/devenv/get-started-with-create-block.md) for a deeper understanding of creating custom blocks.

Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/plugin-sidebar-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _Note: this tutorial covers a custom sidebar, if you are looking to add controls

## Before you start

The tutorial assumes you have an existing plugin setup and are ready to add PHP and JavaScript code. Please, refer to [Getting started with JavaScript](/docs/how-to-guides/javascript/README.md) tutorial for an introduction to WordPress plugins and how to use JavaScript to extend the block editor.
The tutorial assumes you have an existing plugin setup and are ready to add PHP and JavaScript code. Please, refer to [Getting started with JavaScript](/docs/getting-started/fundamentals/javascript-in-the-block-editor.md) tutorial for an introduction to WordPress plugins and how to use JavaScript to extend the block editor.

## Step-by-step guide

Expand Down
6 changes: 0 additions & 6 deletions docs/reference-guides/block-api/block-selectors.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Selectors

<div class="callout callout-alert">
This API was stabilized in Gutenberg 15.5 and is planned for core release
in WordPress 6.3. To use this prior to WordPress 6.3, you will need to
install and activate Gutenberg >= 15.5.
</div>

Block Selectors is the API that allows blocks to customize the CSS selector used
when their styles are generated.

Expand Down
4 changes: 2 additions & 2 deletions docs/reference-guides/block-api/block-supports.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ supports: {
- Type: `boolean` or `array`
- Default value: `false`

This property adds block controls which allow you to change the block's alignment.
This property adds block controls, which enable changes to a block's alignment.

```js
supports: {
Expand Down Expand Up @@ -113,7 +113,7 @@ ARIA-labels let you define an accessible label for elements. This property allow

```js
supports: {
// Add support for the aria label.
// Add support for an aria label.
ariaLabel: true
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-guides/filters/block-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ const withMyPluginControls = createHigherOrderComponent( ( BlockEdit ) => {
return (
<>
<BlockEdit { ...props } />
{ props.isSelected && {
{ props.isSelected && (
<InspectorControls>
<PanelBody>My custom control</PanelBody>
</InspectorControls>
}}
) }
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This SlotFill allows registering a UI to edit Document settings.

```js
import { registerPlugin } from '@wordpress/plugins';
import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
import { PluginDocumentSettingPanel } from '@wordpress/editor';

const PluginDocumentSettingPanelDemo = () => (
<PluginDocumentSettingPanel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Settings related to colors.
| text | boolean | true | |
| heading | boolean | true | |
| button | boolean | true | |
| caption | boolean | true | |

---

Expand Down
36 changes: 33 additions & 3 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -2518,6 +2518,7 @@ private static function get_block_nodes( $theme_json, $selectors = array() ) {
* Gets the CSS rules for a particular block from theme.json.
*
* @since 6.1.0
* @since 6.6.0 Setting a min-height of HTML when root styles have a background gradient or image.
*
* @param array $block_metadata Metadata about the block to get styles for.
*
Expand All @@ -2528,6 +2529,7 @@ public function get_styles_for_block( $block_metadata ) {
$use_root_padding = isset( $this->theme_json['settings']['useRootPaddingAwareAlignments'] ) && true === $this->theme_json['settings']['useRootPaddingAwareAlignments'];
$selector = $block_metadata['selector'];
$settings = $this->theme_json['settings'] ?? null;
$is_root_selector = static::ROOT_BLOCK_SELECTOR === $selector;

$feature_declarations = static::get_feature_declarations_for_node( $block_metadata, $node );

Expand Down Expand Up @@ -2613,10 +2615,16 @@ static function ( $pseudo_selector ) use ( $selector ) {
$block_rules = '';

/*
* 1. Separate the declarations that use the general selector
* 1. Bespoke declaration modifiers:
* - 'filter': Separate the declarations that use the general selector
* from the ones using the duotone selector.
* - 'background|background-image': set the html min-height to 100%
* to ensure the background covers the entire viewport.
*
*/
$declarations_duotone = array();
$declarations_duotone = array();
$should_set_root_min_height = false;

foreach ( $declarations as $index => $declaration ) {
if ( 'filter' === $declaration['name'] ) {
/*
Expand All @@ -2633,6 +2641,28 @@ static function ( $pseudo_selector ) use ( $selector ) {
}
unset( $declarations[ $index ] );
}

if ( $is_root_selector && ( 'background-image' === $declaration['name'] || 'background' === $declaration['name'] ) ) {
$should_set_root_min_height = true;
}
}

/*
* If root styles has a background-image or a background (gradient) set,
* set the min-height to '100%'. Minus `--wp-admin--admin-bar--height` for logged-in view.
* Setting the CSS rule on the HTML tag ensures background gradients and images behave similarly,
* and matches the behavior of the site editor.
*/
if ( $should_set_root_min_height ) {
$block_rules .= static::to_ruleset(
'html',
array(
array(
'name' => 'min-height',
'value' => 'calc(100% - var(--wp-admin--admin-bar--height, 0px))',
),
)
);
}

// Update declarations if there are separators with only background color defined.
Expand All @@ -2650,7 +2680,7 @@ static function ( $pseudo_selector ) use ( $selector ) {

// 4. Generate Layout block gap styles.
if (
static::ROOT_BLOCK_SELECTOR !== $selector &&
! $is_root_selector &&
! empty( $block_metadata['name'] )
) {
$block_rules .= $this->get_layout_styles( $block_metadata );
Expand Down
Loading

0 comments on commit 7d0d84c

Please sign in to comment.