Skip to content

Commit

Permalink
Merge branch 'trunk' into add/site-logo-border
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Nov 24, 2023
2 parents 038906b + fce345d commit 5e438e3
Show file tree
Hide file tree
Showing 62 changed files with 1,459 additions and 543 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ concurrency:

jobs:
e2e-puppeteer:
name: Puppeteer - ${{ matrix.part }}
name: Puppeteer
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
part: [1, 2, 3]
totalParts: [3]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -43,8 +40,7 @@ jobs:
- name: Running the tests
run: |
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % ${{ matrix.totalParts }} == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache"
- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand All @@ -69,8 +65,8 @@ jobs:
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4]
totalParts: [4]
part: [1, 2, 3, 4, 5, 6, 7, 8]
totalParts: [8]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ jobs:
- name: Compare performance with base branch
if: github.event_name == 'push'
# The base hash used here need to be a commit that is compatible with the current WP version
# The current one is bd2a881101727b03b0be09382b34841af5a3c03e and it needs to be updated every WP major release.
# The current one is b61dde2e5ec29d98801e623de968bfb286c5be3f and it needs to be updated every WP major release.
# It is used as a base comparison point to avoid fluctuation in the performance metrics.
run: |
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf $GITHUB_SHA bd2a881101727b03b0be09382b34841af5a3c03e --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
./bin/plugin/cli.js perf $GITHUB_SHA b61dde2e5ec29d98801e623de968bfb286c5be3f --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- name: Compare performance with custom branches
if: github.event_name == 'workflow_dispatch'
Expand All @@ -97,7 +97,7 @@ jobs:
CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }}
run: |
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI")
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA bd2a881101727b03b0be09382b34841af5a3c03e $COMMITTED_AT
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA b61dde2e5ec29d98801e623de968bfb286c5be3f $COMMITTED_AT
- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand Down
17 changes: 17 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
== Changelog ==

= 17.1.2 =

## Changelog

### Bug Fixes

#### Block Editor

- PostCSS style transformation: fail gracefully instead of throwing an error (https://github.com/WordPress/gutenberg/pull/56093)

## Contributors

The following contributors merged PRs in this release:

@zaguiini


= 17.1.1 =

# Changelog
Expand Down
6 changes: 6 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,12 @@
"markdown_source": "../packages/components/src/confirm-dialog/README.md",
"parent": "components"
},
{
"title": "CustomSelectControlV2",
"slug": "custom-select-control-v2",
"markdown_source": "../packages/components/src/custom-select-control-v2/README.md",
"parent": "components"
},
{
"title": "CustomSelectControl",
"slug": "custom-select-control",
Expand Down
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality.
* Requires at least: 6.2
* Requires PHP: 7.0
* Version: 17.1.1
* Version: 17.1.2
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
"version": "17.1.1",
"version": "17.1.2",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TouchableWithoutFeedback, View } from 'react-native';
*/
import { __, sprintf } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { useDispatch, useSelect } from '@wordpress/data';
import { useSelect } from '@wordpress/data';

/**
* Internal dependencies
Expand All @@ -18,54 +18,71 @@ import UnsupportedBlockDetails from '../unsupported-block-details';
import { store as blockEditorStore } from '../../store';
import { MAX_NESTING_DEPTH } from './constants';
import useUnsupportedBlockEditor from '../use-unsupported-block-editor';
import {
useConvertToGroupButtons,
useConvertToGroupButtonProps,
} from '../convert-to-group-buttons';

const EMPTY_ARRAY = [];

const WarningMaxDepthExceeded = ( { clientId } ) => {
const [ showDetails, setShowDetails ] = useState( false );

const { isSelected, innerBlocks } = useSelect(
( select ) => {
const { getBlock, isBlockSelected } = select( blockEditorStore );
return {
innerBlocks: getBlock( clientId )?.innerBlocks || [],
isSelected: isBlockSelected( clientId ),
};
},
const isSelected = useSelect(
( select ) => select( blockEditorStore ).isBlockSelected( clientId ),
[ clientId ]
);
const { replaceBlocks } = useDispatch( blockEditorStore );

// We rely on the logic related to the Group/Ungroup buttons used in the block options to
// determine whether to use the Ungroup action.
const convertToGroupButtonProps = useConvertToGroupButtonProps( [
clientId,
] );
const { isUngroupable } = convertToGroupButtonProps;
const convertToGroupButtons = useConvertToGroupButtons( {
...convertToGroupButtonProps,
} );
const onUngroup = convertToGroupButtons.ungroup.onSelect;

const {
isUnsupportedBlockEditorSupported,
canEnableUnsupportedBlockEditor,
} = useUnsupportedBlockEditor( clientId );

const onUngroup = () => {
if ( ! innerBlocks.length ) {
return;
}

replaceBlocks( clientId, innerBlocks );
};

let description;
// When UBE can't be used, the description mentions using the web browser to edit the block.
/* translators: Warning related to having blocks deeply nested. %d: The deepest nesting level. */
const descriptionFormat = __(
'Blocks nested deeper than %d levels may not render properly in the mobile editor.'
);
let description = sprintf( descriptionFormat, MAX_NESTING_DEPTH );
if (
! isUnsupportedBlockEditorSupported &&
! canEnableUnsupportedBlockEditor
) {
/* translators: Warning related to having blocks deeply nested. %d: The deepest nesting level. */
const descriptionFormat = __(
'Blocks nested deeper than %d levels may not render properly in the mobile editor. For this reason, we recommend flattening the content by ungrouping the block or editing the block using your web browser.'
);
description = sprintf( descriptionFormat, MAX_NESTING_DEPTH );
// When UBE can't be used, the description mentions using the web browser to edit the block.
description +=
' ' +
/* translators: Recommendation included in a warning related to having blocks deeply nested. */
__(
'For this reason, we recommend editing the block using your web browser.'
);
}
// Otherwise, the description mentions using the web editor (i.e. UBE).
else {
/* translators: Warning related to having blocks deeply nested. %d: The deepest nesting level. */
const descriptionFormat = __(
'Blocks nested deeper than %d levels may not render properly in the mobile editor. For this reason, we recommend flattening the content by ungrouping the block or editing the block using the web editor.'
);
description = sprintf( descriptionFormat, MAX_NESTING_DEPTH );
description +=
' ' +
/* translators: Recommendation included in a warning related to having blocks deeply nested. */
__(
'For this reason, we recommend editing the block using the web editor.'
);
}
// If the block can be flattened, we also suggest to ungroup the block.
if ( isUngroupable ) {
description +=
' ' +
/* translators: Alternative option included in a warning related to having blocks deeply nested. */
__(
'Alternatively, you can flatten the content by ungrouping the block.'
);
}

return (
Expand All @@ -88,9 +105,16 @@ const WarningMaxDepthExceeded = ( { clientId } ) => {
onCloseSheet={ () => setShowDetails( false ) }
title={ __( 'Deeply nested block' ) }
description={ description }
customActions={ [
{ label: __( 'Ungroup block' ), onPress: onUngroup },
] }
customActions={
isUngroupable
? [
{
label: __( 'Ungroup block' ),
onPress: onUngroup,
},
]
: EMPTY_ARRAY
}
/>
</View>
</TouchableWithoutFeedback>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const SYNC_TYPES = {

export const allPatternsCategory = {
name: 'allPatterns',
label: __( 'All patterns' ),
label: __( 'All' ),
};

export const myPatternsCategory = {
Expand Down
2 changes: 2 additions & 0 deletions packages/block-editor/src/components/preview-options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function PreviewOptions( {
deviceType,
setDeviceType,
label,
showIconLabels,
} ) {
const isMobile = useViewportMatch( 'small', '<' );
if ( isMobile ) return null;
Expand All @@ -35,6 +36,7 @@ export default function PreviewOptions( {
disabled: ! isEnabled,
__experimentalIsFocusable: ! isEnabled,
children: viewLabel,
showTooltip: ! showIconLabels,
};
const menuProps = {
'aria-label': __( 'View options' ),
Expand Down
Loading

0 comments on commit 5e438e3

Please sign in to comment.