Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,14 @@ const BlockInspectorSingleBlock = ( {
selectedBlockStyleState,
showStateOnCanvas,
isResponsiveEditing,
isBlockStyleStateSelected,
} ) => {
const listViewRef = useRef( null );
const hasMultipleTabs = availableTabs?.length > 1;
const hasPseudoState = hasPseudoBlockStyleState( selectedBlockStyleState );
const isEditingStyleState =
isBlockStyleStateSelected || isResponsiveEditing;
( hasViewportBlockStyleState( selectedBlockStyleState ) &&
isResponsiveEditing ) ||
hasPseudoBlockStyleState( selectedBlockStyleState );
const hasParentChildBlockCards =
editedContentOnlySection &&
editedContentOnlySection !== renderedBlockClientId;
Expand Down
18 changes: 6 additions & 12 deletions packages/block-editor/src/hooks/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ export const RESPONSIVE_STATE_LABELS = {
'@mobile': __( 'Mobile' ),
};

// Viewport states are selected globally via the editor's device preview
// (Responsive editing). 'default' maps to the Desktop device, the remaining
// options are derived from the shared responsive-state labels.
const DEVICE_STATE_OPTIONS = [
{ value: 'default', label: __( 'Desktop' ) },
...Object.entries( RESPONSIVE_STATE_LABELS ).map(
( [ value, label ] ) => ( {
value,
label,
} )
),
];
const DEVICE_STATE_OPTIONS = Object.entries( RESPONSIVE_STATE_LABELS ).map(
( [ value, label ] ) => ( {
value,
label,
} )
);

// Keep in sync with WP_Theme_JSON_Gutenberg::VALID_BLOCK_PSEUDO_SELECTORS
// and packages/global-styles-engine/src/core/render.tsx.
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/preview-dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
role="menuitemcheckbox"
onClick={ handleResponsiveEditingChange }
info={ __(
'Edits apply only to the current state.'
'Style changes apply only to the current viewport.'
) }
>
{ __( 'Responsive editing' ) }
Expand Down
Loading