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

Block Bindings: Rely on Text component instead of Truncate in bindings panel #65007

Merged
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
15 changes: 6 additions & 9 deletions packages/block-editor/src/hooks/block-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
__experimentalText as Text,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
__experimentalTruncate as Truncate,
__experimentalVStack as VStack,
privateApis as componentsPrivateApis,
} from '@wordpress/components';
Expand Down Expand Up @@ -98,19 +97,17 @@ function BlockBindingsAttribute( { attribute, binding } ) {
unlock( blocksPrivateApis ).getBlockBindingsSource( sourceName );
const isSourceInvalid = ! sourceProps;
return (
<VStack>
<Truncate>{ attribute }</Truncate>
<VStack className="block-editor-bindings__item">
<Text truncate>{ attribute }</Text>
{ !! binding && (
<Text
truncate
variant={ ! isSourceInvalid && 'muted' }
className="block-editor-bindings__item-explanation"
isDestructive={ isSourceInvalid }
>
<Truncate>
{ isSourceInvalid
? __( 'Invalid source' )
: args?.key || sourceProps?.label || sourceName }
</Truncate>
{ isSourceInvalid
? __( 'Invalid source' )
: args?.key || sourceProps?.label || sourceName }
</Text>
) }
</VStack>
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/block-bindings.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
div.block-editor-bindings__panel {
grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
button:hover .block-editor-bindings__item-explanation {
button:hover .block-editor-bindings__item span {
color: inherit;
}
}
Loading