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

Unify the global block styles panel with the block inspector panels #49428

Merged
merged 10 commits into from
May 5, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const BlockPreviewPanel = ( { name, variation = '' } ) => {
...blockExample,
attributes: {
...blockExample?.attributes,
className: variation,
className: 'is-style-' + variation,
},
};
const blocks =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export default function BorderPanel( { name, variation = '' } ) {
}
const prefix = prefixParts.join( '.' );

const [ style ] = useGlobalStyle( prefix, name, 'user', false );
const [ style ] = useGlobalStyle( prefix, name, 'user', {
shouldDecodeEncode: false,
} );
const [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {
shouldDecodeEncode: false,
} );
Expand Down
175 changes: 0 additions & 175 deletions packages/edit-site/src/components/global-styles/context-menu.js

This file was deleted.

32 changes: 0 additions & 32 deletions packages/edit-site/src/components/global-styles/custom-css.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,15 @@ const DEFAULT_CONTROLS = {
childLayout: false,
};

export default function DimensionsPanel( { name, variation = '' } ) {
let prefixParts = [];
if ( variation ) {
prefixParts = [ 'variations', variation ].concat( prefixParts );
}
const prefix = prefixParts.join( '.' );

const [ style ] = useGlobalStyle( prefix, name, 'user', false );
const [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {
export default function DimensionsPanel() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only rendered for the top level dimensions global styles screen, that's why I removed the arguments. Same for the other similar screens.

const [ style ] = useGlobalStyle( '', undefined, 'user', {
shouldDecodeEncode: false,
} );
const [ inheritedStyle, setStyle ] = useGlobalStyle( '', undefined, 'all', {
shouldDecodeEncode: false,
} );
const [ rawSettings, setSettings ] = useGlobalSetting( '', name );
const settings = useSettingsForBlockElement( rawSettings, name );
const [ rawSettings, setSettings ] = useGlobalSetting( '' );
const settings = useSettingsForBlockElement( rawSettings );

// These intermediary objects are needed because the "layout" property is stored
// in settings rather than styles.
Expand Down
40 changes: 0 additions & 40 deletions packages/edit-site/src/components/global-styles/effects-panel.js

This file was deleted.

39 changes: 0 additions & 39 deletions packages/edit-site/src/components/global-styles/filters-panel.js

This file was deleted.

Loading