Skip to content
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/block-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

### Internal

- Replace experimental `ZStack`, `HStack`, `Flex`, and `FlexItem` around the Duotone labeled swatch in the Filters panel ([#83061](https://github.com/WordPress/gutenberg/pull/83061)).
- Remove the `crossorigin` MutationObserver. Under `Document-Isolation-Policy: isolate-and-credentialless` cross-origin resources load without the attribute, and adding it broke any resource served without CORS headers ([#82614](https://github.com/WordPress/gutenberg/pull/82614)).
- Block bindings and variation transforms: Use the public `Menu` from `@wordpress/ui` instead of the private Components API. ([#81925](https://github.com/WordPress/gutenberg/pull/81925))
- Layout hooks: Use `normalizeLegacyLayout` in `useLayoutClasses`, `useLayoutStyles`, the block layout styles wrapper and `isAxialBlockGapAllowed`, replacing four inline copies of the legacy `inherit` / size check ([#82710](https://github.com/WordPress/gutenberg/pull/82710)).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import clsx from 'clsx';
import {
__experimentalToolsPanel as ToolsPanel,
__experimentalHStack as HStack, // eslint-disable-line @wordpress/use-recommended-components
__experimentalZStack as ZStack, // eslint-disable-line @wordpress/use-recommended-components
__experimentalDropdownContentWrapper as DropdownContentWrapper,
MenuGroup,
ColorIndicator,
DuotonePicker,
DuotoneSwatch,
Dropdown,
Flex,
FlexItem,
Button,
} from '@wordpress/components';
import { Stack } from '@wordpress/ui';
import { __, _x } from '@wordpress/i18n';
import { useCallback, useMemo, useRef } from '@wordpress/element';
import { reset as resetIcon } from '@wordpress/icons';
Expand Down Expand Up @@ -101,23 +98,25 @@ const popoverProps = {
};

const LabeledColorIndicator = ( { indicator, label } ) => (
<HStack justify="flex-start">
<ZStack isLayered={ false } offset={ -8 }>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ZStack wasn't doing anything, there's only one child.

<Flex expanded={ false }>
{ indicator === 'unset' || ! indicator ? (
<ColorIndicator className="block-editor-duotone-control__unset-indicator" />
) : (
<DuotoneSwatch values={ indicator } />
) }
</Flex>
</ZStack>
<FlexItem
<Stack
className="block-editor-panel-duotone-settings__label-row"
direction="row"
align="center"
justify="flex-start"
gap="sm"
>
{ indicator === 'unset' || ! indicator ? (
<ColorIndicator className="block-editor-duotone-control__unset-indicator" />
) : (
<DuotoneSwatch values={ indicator } />
) }
<span
className="block-editor-panel-duotone-settings__label"
title={ label }
>
{ label }
</FlexItem>
</HStack>
</span>
</Stack>
);

const renderToggle = ( duotone, resetConfig ) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
}
}

.block-editor-panel-duotone-settings__label-row {
width: 100%;
min-width: 0;
}

.block-editor-panel-duotone-settings__label {
min-width: 0;
}

.block-editor-global-styles__shadow-editor__remove-button {
position: absolute;
right: 0;
Expand Down
3 changes: 0 additions & 3 deletions tools/eslint/suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,6 @@
}
},
"packages/block-editor/src/components/global-styles/filters-panel.jsx": {
"@wordpress/use-recommended-components": {
"count": 2
},
"react/jsx-filename-extension": {
"count": 1
}
Expand Down
Loading