Skip to content

Commit

Permalink
prep build 10/30
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Oct 30, 2024
2 parents 95ee450 + 49a9318 commit db9b1ea
Show file tree
Hide file tree
Showing 57 changed files with 843 additions and 1,001 deletions.
20 changes: 13 additions & 7 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,10 @@ public function __construct( $theme_json = array( 'version' => WP_Theme_JSON_Gut
}

$this->theme_json = WP_Theme_JSON_Schema_Gutenberg::migrate( $theme_json, $origin );
$registry = WP_Block_Type_Registry::get_instance();
$valid_block_names = array_keys( $registry->get_all_registered() );
$blocks_metadata = static::get_blocks_metadata();
$valid_block_names = array_keys( $blocks_metadata );
$valid_element_names = array_keys( static::ELEMENTS );
$valid_variations = static::get_valid_block_style_variations();
$valid_variations = static::get_valid_block_style_variations( $blocks_metadata );
$this->theme_json = static::unwrap_shared_block_style_variations( $this->theme_json, $valid_variations );
$this->theme_json = static::sanitize( $this->theme_json, $valid_block_names, $valid_element_names, $valid_variations );
$this->theme_json = static::maybe_opt_in_into_settings( $this->theme_json );
Expand Down Expand Up @@ -3506,9 +3506,10 @@ public static function remove_insecure_properties( $theme_json, $origin = 'theme

$theme_json = WP_Theme_JSON_Schema_Gutenberg::migrate( $theme_json, $origin );

$valid_block_names = array_keys( static::get_blocks_metadata() );
$blocks_metadata = static::get_blocks_metadata();
$valid_block_names = array_keys( $blocks_metadata );
$valid_element_names = array_keys( static::ELEMENTS );
$valid_variations = static::get_valid_block_style_variations();
$valid_variations = static::get_valid_block_style_variations( $blocks_metadata );

$theme_json = static::sanitize( $theme_json, $valid_block_names, $valid_element_names, $valid_variations );

Expand Down Expand Up @@ -4511,11 +4512,16 @@ function ( $matches ) use ( $variation_class ) {
/**
* Collects valid block style variations keyed by block type.
*
* @since 6.6.0
* @since 6.8.0 Added the `$blocks_metadata` parameter.
*
* @param array $blocks_metadata Optional. List of metadata per block. Default is the metadata for all blocks.
* @return array Valid block style variations by block type.
*/
protected static function get_valid_block_style_variations() {
protected static function get_valid_block_style_variations( $blocks_metadata = array() ) {
$valid_variations = array();
foreach ( self::get_blocks_metadata() as $block_name => $block_meta ) {
$blocks_metadata = empty( $blocks_metadata ) ? static::get_blocks_metadata() : $blocks_metadata;
foreach ( $blocks_metadata as $block_name => $block_meta ) {
if ( ! isset( $block_meta['styleVariations'] ) ) {
continue;
}
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

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

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { fullscreen } from '@wordpress/icons';

function BlockFullHeightAlignmentControl( {
isActive,
label = __( 'Toggle full height' ),
label = __( 'Full height' ),
onToggle,
isDisabled,
} ) {
Expand Down
28 changes: 14 additions & 14 deletions packages/block-editor/src/hooks/block-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { useBlockEditContext } from '../components/block-edit';
import { useBlockBindingsUtils } from '../utils/block-bindings';
import { store as blockEditorStore } from '../store';

const { DropdownMenuV2 } = unlock( componentsPrivateApis );
const { Menu } = unlock( componentsPrivateApis );

const EMPTY_OBJECT = {};

Expand Down Expand Up @@ -70,18 +70,18 @@ function BlockBindingsPanelDropdown( { fieldsList, attribute, binding } ) {
<>
{ Object.entries( fieldsList ).map( ( [ name, fields ], i ) => (
<Fragment key={ name }>
<DropdownMenuV2.Group>
<Menu.Group>
{ Object.keys( fieldsList ).length > 1 && (
<DropdownMenuV2.GroupLabel>
<Menu.GroupLabel>
{ registeredSources[ name ].label }
</DropdownMenuV2.GroupLabel>
</Menu.GroupLabel>
) }
{ Object.entries( fields )
.filter(
( [ , args ] ) => args?.type === attributeType
)
.map( ( [ key, args ] ) => (
<DropdownMenuV2.RadioItem
<Menu.RadioItem
key={ key }
onChange={ () =>
updateBlockBindings( {
Expand All @@ -95,17 +95,17 @@ function BlockBindingsPanelDropdown( { fieldsList, attribute, binding } ) {
value={ key }
checked={ key === currentKey }
>
<DropdownMenuV2.ItemLabel>
<Menu.ItemLabel>
{ args?.label }
</DropdownMenuV2.ItemLabel>
<DropdownMenuV2.ItemHelpText>
</Menu.ItemLabel>
<Menu.ItemHelpText>
{ args?.value }
</DropdownMenuV2.ItemHelpText>
</DropdownMenuV2.RadioItem>
</Menu.ItemHelpText>
</Menu.RadioItem>
) ) }
</DropdownMenuV2.Group>
</Menu.Group>
{ i !== Object.keys( fieldsList ).length - 1 && (
<DropdownMenuV2.Separator />
<Menu.Separator />
) }
</Fragment>
) ) }
Expand Down Expand Up @@ -175,7 +175,7 @@ function EditableBlockBindingsPanelItems( {
} );
} }
>
<DropdownMenuV2
<Menu
placement={
isMobile ? 'bottom-start' : 'left-start'
}
Expand All @@ -195,7 +195,7 @@ function EditableBlockBindingsPanelItems( {
attribute={ attribute }
binding={ binding }
/>
</DropdownMenuV2>
</Menu>
</ToolsPanelItem>
);
} ) }
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/cover/test/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ describe( 'Cover block', () => {
'min-height: 100vh;'
);

await userEvent.click(
screen.getByLabelText( 'Toggle full height' )
);
await userEvent.click( screen.getByLabelText( 'Full height' ) );

expect( screen.getByLabelText( 'Block: Cover' ) ).toHaveStyle(
'min-height: 100vh;'
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/paragraph/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function DropCapControl( { clientId, attributes, setAttributes } ) {
} else if ( dropCap ) {
helpText = __( 'Showing large initial letter.' );
} else {
helpText = __( 'Toggle to show a large initial letter.' );
helpText = __( 'Show a large initial letter.' );
}

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export default function SearchEdit( {
<BlockControls>
<ToolbarGroup>
<ToolbarButton
title={ __( 'Toggle search label' ) }
title={ __( 'Show search label' ) }
icon={ toggleLabel }
onClick={ () => {
setAttributes( {
Expand Down
2 changes: 2 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
- `Tabs`: update indicator more reactively ([#66207](https://github.com/WordPress/gutenberg/pull/66207)).
- `Tabs` and `TabPanel`: Fix arrow key navigation in RTL ([#66201](https://github.com/WordPress/gutenberg/pull/66201)).
- `Tabs`: override tablist's tabindex only when necessary ([#66209](https://github.com/WordPress/gutenberg/pull/66209)).
- `DropdownMenuV2`: rename to `Menu` ([#66289](https://github.com/WordPress/gutenberg/pull/66289)).

### Internal

- ESLint: Stop disabling `react-hooks/exhaustive-deps` rule ([#66324](https://github.com/WordPress/gutenberg/pull/66324)).
- `TabPanel`: Add 40px size prop to tab Button ([#66557](https://github.com/WordPress/gutenberg/pull/66557)).

## 28.10.0 (2024-10-16)

Expand Down
Loading

0 comments on commit db9b1ea

Please sign in to comment.