Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/classic-site-editor-access
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Feb 28, 2025
2 parents 759ef87 + 18a4c0d commit c0c0fc6
Show file tree
Hide file tree
Showing 52 changed files with 560 additions and 178 deletions.
4 changes: 2 additions & 2 deletions .github/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
path: '**/node_modules'
key: node_modules-${{ runner.os }}-${{ runner.arch }}-${{ steps.node-version.outputs.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
Expand All @@ -36,7 +36,7 @@ runs:
npm ci
shell: bash
- name: Upload npm logs as an artifact on failure
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
if: failure()
with:
name: npm-logs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-plugin-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ jobs:
run: echo "version=$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' )" >> $GITHUB_OUTPUT

- name: Download Plugin Zip Artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: gutenberg-plugin

- name: Download Release Notes Artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: release-notes

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
ref: trunk
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- uses: actions/[email protected].8
- uses: actions/[email protected].9
# Don't fail the job if there isn't any flaky tests report.
continue-on-error: true
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: ./.github/setup-node

- name: Restore tests setup cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
path: |
~/.appium
Expand All @@ -53,7 +53,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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
# uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
# 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 @@ -43,7 +43,7 @@ jobs:
uses: ./.github/setup-node

- name: Restore tests setup cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
path: |
~/.appium
Expand All @@ -56,15 +56,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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
path: |
packages/react-native-editor/ios/Pods
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")

- name: Download built JavaScript assets
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: build-assets

Expand Down 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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
path: .cache/phpcs.json
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ jobs:
sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" ./trunk/readme.txt
- name: Download Changelog Artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: changelog trunk
path: trunk
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" "$VERSION/readme.txt"
- name: Download Changelog Artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: changelog trunk
path: ${{ github.event.release.name }}
Expand Down
3 changes: 3 additions & 0 deletions backport-changelog/6.8/8274.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/8274

* https://github.com/WordPress/gutenberg/pull/69096
23 changes: 23 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
== Changelog ==

= 20.0.3 =

## Changelog

### Bug Fixes

#### Block Hooks

- Fix truncation of post content. (https://github.com/WordPress/gutenberg/pull/68926)
- Fix duplicated insertion in Post Content. (https://github.com/WordPress/gutenberg/pull/69142)
- Enable first/last child insertion next to Classic block. (https://github.com/WordPress/gutenberg/pull/69241)

#### Block Library

- Template Part block: Guard against `get_block_file_template` returning `null`. (https://github.com/WordPress/gutenberg/pull/69309)

### Code Quality

#### Block Hooks

- Add end-to-end test Coverage. (https://github.com/WordPress/gutenberg/pull/69044)


= 20.0.2 =

### Bug Fixes
Expand Down
63 changes: 63 additions & 0 deletions lib/block-supports/aria-label.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/**
* Aria label block support flag.
*
* @package gutenberg
*/

/**
* Registers the aria-label block attribute for block types that support it.
*
* @param WP_Block_Type $block_type Block Type.
*/
function gutenberg_register_aria_label_support( $block_type ) {
$has_aria_label_support = block_has_support( $block_type, array( 'ariaLabel' ), false );

if ( ! $has_aria_label_support ) {
return;
}

if ( ! $block_type->attributes ) {
$block_type->attributes = array();
}

if ( ! array_key_exists( 'ariaLabel', $block_type->attributes ) ) {
$block_type->attributes['ariaLabel'] = array(
'type' => 'string',
);
}
}

/**
* Add the aria-label to the output.
*
* @param WP_Block_Type $block_type Block Type.
* @param array $block_attributes Block attributes.
*
* @return array Block aria-label.
*/
function gutenberg_apply_aria_label_support( $block_type, $block_attributes ) {
if ( ! $block_attributes ) {
return array();
}

$has_aria_label_support = block_has_support( $block_type, array( 'ariaLabel' ), false );
if ( ! $has_aria_label_support ) {
return array();
}

$has_aria_label = array_key_exists( 'ariaLabel', $block_attributes );
if ( ! $has_aria_label ) {
return array();
}
return array( 'aria-label' => $block_attributes['ariaLabel'] );
}

// Register the block support.
WP_Block_Supports::get_instance()->register(
'aria-label',
array(
'register_attribute' => 'gutenberg_register_aria_label_support',
'apply' => 'gutenberg_apply_aria_label_support',
)
);
1 change: 1 addition & 0 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/block-supports/shadow.php';
require __DIR__ . '/block-supports/background.php';
require __DIR__ . '/block-supports/block-style-variations.php';
require __DIR__ . '/block-supports/aria-label.php';

// Data views.
require_once __DIR__ . '/experimental/data-views.php';
Expand Down
1 change: 0 additions & 1 deletion packages/base-styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@
}

&::-moz-placeholder {
opacity: 1; // Necessary because Firefox reduces this from 1.
color: $dark-gray-placeholder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import PatternExplorerSidebar from './pattern-explorer-sidebar';
import PatternList from './pattern-list';
import { usePatternCategories } from '../block-patterns-tab/use-pattern-categories';

function PatternsExplorer( { initialCategory, rootClientId } ) {
function PatternsExplorer( { initialCategory, rootClientId, onModalClose } ) {
const [ searchValue, setSearchValue ] = useState( '' );
const [ selectedCategory, setSelectedCategory ] = useState(
initialCategory?.name
Expand All @@ -34,6 +34,7 @@ function PatternsExplorer( { initialCategory, rootClientId } ) {
selectedCategory={ selectedCategory }
patternCategories={ patternCategories }
rootClientId={ rootClientId }
onModalClose={ onModalClose }
/>
</div>
);
Expand All @@ -46,7 +47,7 @@ function PatternsExplorerModal( { onModalClose, ...restProps } ) {
onRequestClose={ onModalClose }
isFullScreen
>
<PatternsExplorer { ...restProps } />
<PatternsExplorer onModalClose={ onModalClose } { ...restProps } />
</Modal>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function PatternList( {
selectedCategory,
patternCategories,
rootClientId,
onModalClose,
} ) {
const container = useRef();
const debouncedSpeak = useDebounce( speak, 500 );
Expand Down Expand Up @@ -152,7 +153,10 @@ function PatternList( {
<>
<BlockPatternsList
blockPatterns={ pagingProps.categoryPatterns }
onClickPattern={ onClickPattern }
onClickPattern={ ( pattern, blocks ) => {
onClickPattern( pattern, blocks );
onModalClose();
} }
isDraggable={ false }
/>
<BlockPatternsPaging { ...pagingProps } />
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/form/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
help={ __(
'The email address where form submissions will be sent. Separate multiple email addresses with a comma.'
) }
type="email"
/>
) }
</PanelBody>
Expand Down Expand Up @@ -159,6 +160,7 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
help={ __(
'The URL where the form should be submitted.'
) }
type="url"
/>
</InspectorControls>
) }
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
);
} }
autoComplete="off"
type="url"
/>
</ToolsPanelItem>

Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/navigation-submenu/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ export default function NavigationSubmenuEdit( {
} }
label={ __( 'Link' ) }
autoComplete="off"
type="url"
/>
</ToolsPanelItem>

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default function PostNavigationLinkEdit( {
aria-label={ ariaLabel }
placeholder={ placeholder }
value={ label }
allowedFormats={ [ 'core/bold', 'core/italic' ] }
withoutInteractiveFormatting
onChange={ ( newLabel ) =>
setAttributes( { label: newLabel } )
}
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/pullquote/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
.wp-block-pullquote.has-text-align-right blockquote {
text-align: right;
}
// Ensure that we are reasonably specific to override theme defaults.
.wp-block-pullquote.has-text-align-center blockquote {
text-align: center;
}

// .is-style-solid-color is deprecated.
// This selector has not been scoped with `:root :where`, as global styles
Expand Down
4 changes: 3 additions & 1 deletion packages/block-library/src/template-part/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ function render_block_core_template_part( $attributes ) {
if ( 0 === validate_file( $attributes['slug'] ) ) {
$block_template = get_block_file_template( $template_part_id, 'wp_template_part' );

$content = $block_template->content;
if ( isset( $block_template->content ) ) {
$content = $block_template->content;
}
if ( isset( $block_template->area ) ) {
$area = $block_template->area;
}
Expand Down
11 changes: 11 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

## Unreleased

### Documentation

- `FontSizePicker`: Fix Storybook units control type to use `inline-check` and improve documentation clarifying unitless mode in `README.md` ([#68936](https://github.com/WordPress/gutenberg/pull/68936)).

### Bug Fixes

- `TextControl`: Ensures email and url inputs have consistent LTR alignment in RTL languages ([#68561](https://github.com/WordPress/gutenberg/pull/68561)).
- `InputControl`: Ensure consistent placeholder color ([#69334](https://github.com/WordPress/gutenberg/pull/69334)).

### Enhancement

- `TextareaControl`: Fix Firefox placeholder text opacity override ([#69312](https://github.com/WordPress/gutenberg/pull/69312)).
- `BorderControlDropdown`, `BorderControl`: Reset button is always visible. ([#69066](https://github.com/WordPress/gutenberg/pull/69066)).

### Internal
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/font-size-picker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ Available units for custom font size selection.

The current font size value.

**Note**: For the `units` property to work, the current font size value must be specified as strings with units (e.g., `'12px'` instead of `12`). When the font size is provided as a number, the component operates in "unitless mode" where the `units` property has no effect.

- Required: No

### `withReset`: `boolean`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const meta: Meta< typeof FontSizePicker > = {
component: FontSizePicker,
argTypes: {
value: { control: false },
units: {
control: 'inline-check',
options: [ 'px', 'em', 'rem', 'vw', 'vh' ],
},
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/font-size-picker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export type FontSizePickerProps = {
units?: string[];
/**
* The current font size value.
*
* Note: For the `units` property to work, the current font size value must be specified
* as strings with units (e.g., '12px' instead of 12). When the font size is provided
* as a number, the component operates in "unitless mode" where the `units` property has no effect.
*/
value?: number | string;
/**
Expand Down
Loading

0 comments on commit c0c0fc6

Please sign in to comment.