Skip to content

Commit

Permalink
Unify the global block styles panel with the block inspector panels (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored May 5, 2023
1 parent 227f9ec commit 43d777b
Show file tree
Hide file tree
Showing 25 changed files with 398 additions and 722 deletions.
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() {
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

0 comments on commit 43d777b

Please sign in to comment.