Skip to content

Commit

Permalink
Add effects and filters screens to the block screen
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Apr 7, 2023
1 parent 90af4dc commit 5c20803
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 145 deletions.
40 changes: 0 additions & 40 deletions packages/edit-site/src/components/global-styles/effects-panel.js

This file was deleted.

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

This file was deleted.

24 changes: 24 additions & 0 deletions packages/edit-site/src/components/global-styles/screen-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ const {
useGlobalSetting,
useSettingsForBlockElement,
useHasColorPanel,
useHasEffectsPanel,
useHasFiltersPanel,
useGlobalStyle,
BorderPanel: StylesBorderPanel,
ColorPanel: StylesColorPanel,
TypographyPanel: StylesTypographyPanel,
DimensionsPanel: StylesDimensionsPanel,
EffectsPanel: StylesEffectsPanel,
FiltersPanel: StylesFiltersPanel,
} = unlock( blockEditorPrivateApis );

function ScreenBlock( { name, variation } ) {
Expand All @@ -46,6 +50,8 @@ function ScreenBlock( { name, variation } ) {
const hasColorPanel = useHasColorPanel( settings );
const hasBorderPanel = useHasBorderPanel( settings );
const hasDimensionsPanel = useHasDimensionsPanel( settings );
const hasEffectsPanel = useHasEffectsPanel( settings );
const hasFiltersPanel = useHasFiltersPanel( settings );

// These intermediary objects are needed because the "layout" property is stored
// in settings rather than styles.
Expand Down Expand Up @@ -111,6 +117,24 @@ function ScreenBlock( { name, variation } ) {
includeLayoutControls
/>
) }
{ hasEffectsPanel && (
<StylesEffectsPanel
inheritedValue={ inheritedStyleWithLayout }
value={ styleWithLayout }
onChange={ onChangeDimensions }
settings={ settings }
includeLayoutControls
/>
) }
{ hasFiltersPanel && (
<StylesFiltersPanel
inheritedValue={ inheritedStyleWithLayout }
value={ styleWithLayout }
onChange={ onChangeDimensions }
settings={ settings }
includeLayoutControls
/>
) }
</>
);
}
Expand Down
35 changes: 0 additions & 35 deletions packages/edit-site/src/components/global-styles/screen-effects.js

This file was deleted.

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

This file was deleted.

10 changes: 0 additions & 10 deletions packages/edit-site/src/components/global-styles/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
import ScreenBlock from './screen-block';
import ScreenTypography from './screen-typography';
import ScreenTypographyElement from './screen-typography-element';
import ScreenFilters from './screen-filters';
import ScreenColors from './screen-colors';
import ScreenColorPalette from './screen-color-palette';
import ScreenLayout from './screen-layout';
Expand All @@ -40,7 +39,6 @@ import { ScreenVariation } from './screen-variations';
import StyleBook from '../style-book';
import ScreenCSS from './screen-css';
import { unlock } from '../../private-apis';
import ScreenEffects from './screen-effects';

const SLOT_FILL_NAME = 'GlobalStylesMenu';
const { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =
Expand Down Expand Up @@ -215,14 +213,6 @@ function ContextScreens( { name, parentMenu = '', variation = '' } ) {
<ScreenColorPalette name={ name } />
</GlobalStylesNavigationScreen>

<GlobalStylesNavigationScreen path={ parentMenu + '/filters' }>
<ScreenFilters name={ name } />
</GlobalStylesNavigationScreen>

<GlobalStylesNavigationScreen path={ parentMenu + '/effects' }>
<ScreenEffects name={ name } variation={ variation } />
</GlobalStylesNavigationScreen>

<GlobalStylesNavigationScreen path={ parentMenu + '/layout' }>
<ScreenLayout name={ name } variation={ variation } />
</GlobalStylesNavigationScreen>
Expand Down

0 comments on commit 5c20803

Please sign in to comment.