Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] trunk from WordPress:trunk #80

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

- `ResizableBox`: Make drag handles focusable ([#67305](https://github.com/WordPress/gutenberg/pull/67305)).
- `CustomSelectControl`: Update correctly when `showSelectedHint` is enabled ([#67733](https://github.com/WordPress/gutenberg/pull/67733)).
- `CustomSelectControl`: Use `useStoreState` to get `currentValue` and avoid stale values ([#67815](https://github.com/WordPress/gutenberg/pull/67815)).

## 28.13.0 (2024-11-27)

Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/custom-select-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,16 @@ function CustomSelectControl< T extends CustomSelectOption >(
);
} );

const { value: currentValue } = store.getState();
const currentValue = Ariakit.useStoreState( store, 'value' );

const renderSelectedValueHint = () => {
const selectedOptionHint = options
?.map( applyOptionDeprecations )
?.find( ( { name } ) => store.getState().value === name )?.hint;
?.find( ( { name } ) => currentValue === name )?.hint;

return (
<Styled.SelectedExperimentalHintWrapper>
{ store.getState().value }
{ currentValue }
{ selectedOptionHint && (
<Styled.SelectedExperimentalHintItem
// Keeping the classname for legacy reasons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
__experimentalVStack as VStack,
__experimentalHStack as HStack,
FlexItem,
FlexBlock,
Button,
} from '@wordpress/components';
import {
Expand Down Expand Up @@ -111,23 +110,18 @@ function FontSizeGroup( {
key={ size.slug }
path={ `/typography/font-sizes/${ origin }/${ size.slug }` }
>
<HStack direction="row">
<HStack>
<FlexItem className="edit-site-font-size__item">
{ size.name }
</FlexItem>
<FlexItem>
<HStack justify="flex-end">
<FlexBlock className="edit-site-font-size__item edit-site-font-size__item-value">
{ size.size }
</FlexBlock>
<Icon
icon={
isRTL()
? chevronLeft
: chevronRight
}
/>
</HStack>
<FlexItem display="flex">
<Icon
icon={
isRTL()
? chevronLeft
: chevronRight
}
/>
</FlexItem>
</HStack>
</NavigationButtonAsItem>
Expand Down
12 changes: 8 additions & 4 deletions packages/edit-site/src/components/global-styles/shadows-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
Flex,
FlexItem,
} from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';
import { __, sprintf, isRTL } from '@wordpress/i18n';
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
import { plus, shadow as shadowIcon } from '@wordpress/icons';
import { plus, Icon, chevronLeft, chevronRight } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down Expand Up @@ -135,9 +135,13 @@ function ShadowItem( { shadow, category } ) {
return (
<NavigationButtonAsItem
path={ `/shadows/edit/${ category }/${ shadow.slug }` }
icon={ shadowIcon }
>
{ shadow.name }
<HStack>
<FlexItem>{ shadow.name }</FlexItem>
<FlexItem display="flex">
<Icon icon={ isRTL() ? chevronLeft : chevronRight } />
</FlexItem>
</HStack>
</NavigationButtonAsItem>
);
}
Loading