From d824d42ae41345c11ada55a7f41b264fbc14eeb3 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 12 Feb 2024 12:54:57 +0100 Subject: [PATCH] Remove preffered style variations legacy support --- .../block-api/block-supports.md | 14 --- .../data/data-core-edit-post.md | 7 +- .../src/components/block-inspector/index.js | 11 -- .../src/components/block-styles/style.scss | 4 - .../components/default-style-picker/index.js | 70 ------------ .../inspector-controls-tabs/styles-tab.js | 7 -- packages/block-editor/src/store/actions.js | 40 +------ .../block-editor/src/store/test/actions.js | 101 ------------------ packages/block-library/src/buttons/edit.js | 19 +--- .../block-library/src/buttons/edit.native.js | 18 +--- packages/block-library/src/gallery/edit.js | 9 -- packages/edit-post/src/editor.js | 23 +--- packages/edit-post/src/index.js | 1 - packages/edit-post/src/index.native.js | 1 - packages/edit-post/src/store/actions.js | 47 ++------ packages/edit-post/src/store/selectors.js | 18 ---- packages/edit-post/src/store/test/actions.js | 52 --------- .../provider/use-block-editor-settings.js | 2 - .../legacy-local-storage-data/index.js | 5 - .../legacy-local-storage-data/test/index.js | 10 -- .../preferences-package-data/test/index.js | 6 -- .../local-storage-overrides.json | 3 +- schemas/json/block.json | 5 - 23 files changed, 20 insertions(+), 453 deletions(-) delete mode 100644 packages/block-editor/src/components/default-style-picker/index.js diff --git a/docs/reference-guides/block-api/block-supports.md b/docs/reference-guides/block-api/block-supports.md index f035e026ff2e1..c25b6e35fa232 100644 --- a/docs/reference-guides/block-api/block-supports.md +++ b/docs/reference-guides/block-api/block-supports.md @@ -414,20 +414,6 @@ supports: { } ``` -## defaultStylePicker - -- Type: `boolean` -- Default value: `true` - -When the style picker is shown, the user can set a default style for a block type based on the block's currently active style. If you prefer not to make this option available, set this property to `false`. - -```js -supports: { - // Remove the Default Style picker. - defaultStylePicker: false -} -``` - ## dimensions _**Note:** Since WordPress 6.2._ diff --git a/docs/reference-guides/data/data-core-edit-post.md b/docs/reference-guides/data/data-core-edit-post.md index 1716482d5178c..7834d1ee1b88b 100644 --- a/docs/reference-guides/data/data-core-edit-post.md +++ b/docs/reference-guides/data/data-core-edit-post.md @@ -536,11 +536,8 @@ _Returns_ ### updatePreferredStyleVariations -Returns an action object used in signaling that a style should be auto-applied when a block is created. - -_Parameters_ +> **Deprecated** -- _blockName_ `string`: Name of the block. -- _blockStyle_ `?string`: Name of the style that should be auto applied. If undefined, the "auto apply" setting of the block is removed. +Returns an action object used in signaling that a style should be auto-applied when a block is created. diff --git a/packages/block-editor/src/components/block-inspector/index.js b/packages/block-editor/src/components/block-inspector/index.js index e8df38232306c..beeda0d9b647b 100644 --- a/packages/block-editor/src/components/block-inspector/index.js +++ b/packages/block-editor/src/components/block-inspector/index.js @@ -5,7 +5,6 @@ import { __ } from '@wordpress/i18n'; import { getBlockType, getUnregisteredTypeHandlerName, - hasBlockSupport, store as blocksStore, } from '@wordpress/blocks'; import { PanelBody, __unstableMotion as motion } from '@wordpress/components'; @@ -21,7 +20,6 @@ import BlockVariationTransforms from '../block-variation-transforms'; import useBlockDisplayInformation from '../use-block-display-information'; import { store as blockEditorStore } from '../../store'; import BlockStyles from '../block-styles'; -import DefaultStylePicker from '../default-style-picker'; import { default as InspectorControls } from '../inspector-controls'; import { default as InspectorControlsTabs } from '../inspector-controls-tabs'; import useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs'; @@ -275,15 +273,6 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
- { hasBlockSupport( - blockName, - 'defaultStylePicker', - true - ) && ( - - ) }
) } diff --git a/packages/block-editor/src/components/block-styles/style.scss b/packages/block-editor/src/components/block-styles/style.scss index b2747df04c1c0..a83adb25c6ae1 100644 --- a/packages/block-editor/src/components/block-styles/style.scss +++ b/packages/block-editor/src/components/block-styles/style.scss @@ -1,7 +1,3 @@ -.block-editor-block-styles + .default-style-picker__default-switcher { - margin-top: $grid-unit-20; -} - .block-editor-block-styles__preview-panel { display: none; // Same layer as the sidebar from which it's triggered. diff --git a/packages/block-editor/src/components/default-style-picker/index.js b/packages/block-editor/src/components/default-style-picker/index.js deleted file mode 100644 index 0f3190a7a24f7..0000000000000 --- a/packages/block-editor/src/components/default-style-picker/index.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * WordPress dependencies - */ -import { store as blocksStore } from '@wordpress/blocks'; -import { useMemo, useCallback } from '@wordpress/element'; -import { __ } from '@wordpress/i18n'; -import { SelectControl } from '@wordpress/components'; -import { useSelect } from '@wordpress/data'; - -/** - * Internal dependencies - */ -import { store as blockEditorStore } from '../../store'; -import { getDefaultStyle } from '../block-styles/utils'; - -export default function DefaultStylePicker( { blockName } ) { - const { preferredStyle, onUpdatePreferredStyleVariations, styles } = - useSelect( - ( select ) => { - const settings = select( blockEditorStore ).getSettings(); - const preferredStyleVariations = - settings.__experimentalPreferredStyleVariations; - return { - preferredStyle: - preferredStyleVariations?.value?.[ blockName ], - onUpdatePreferredStyleVariations: - preferredStyleVariations?.onChange ?? null, - styles: select( blocksStore ).getBlockStyles( blockName ), - }; - }, - [ blockName ] - ); - const selectOptions = useMemo( - () => [ - { label: __( 'Not set' ), value: '' }, - ...styles.map( ( { label, name } ) => ( { label, value: name } ) ), - ], - [ styles ] - ); - const defaultStyleName = useMemo( - () => getDefaultStyle( styles )?.name, - [ styles ] - ); - const selectOnChange = useCallback( - ( blockStyle ) => { - onUpdatePreferredStyleVariations( blockName, blockStyle ); - }, - [ blockName, onUpdatePreferredStyleVariations ] - ); - - // Until the functionality is migrated to global styles, - // only show the default style picker if a non-default style has already been selected. - if ( ! preferredStyle || preferredStyle === defaultStyleName ) { - return null; - } - - return ( - onUpdatePreferredStyleVariations && ( -
- -
- ) - ); -} diff --git a/packages/block-editor/src/components/inspector-controls-tabs/styles-tab.js b/packages/block-editor/src/components/inspector-controls-tabs/styles-tab.js index 6c2556f2378ff..eab4d47e0c372 100644 --- a/packages/block-editor/src/components/inspector-controls-tabs/styles-tab.js +++ b/packages/block-editor/src/components/inspector-controls-tabs/styles-tab.js @@ -1,7 +1,6 @@ /** * WordPress dependencies */ -import { hasBlockSupport } from '@wordpress/blocks'; import { PanelBody } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; @@ -9,7 +8,6 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import BlockStyles from '../block-styles'; -import DefaultStylePicker from '../default-style-picker'; import InspectorControls from '../inspector-controls'; import { getBorderPanelLabel } from '../../hooks/border'; @@ -22,11 +20,6 @@ const StylesTab = ( { blockName, clientId, hasBlockStyles } ) => {
- { hasBlockSupport( - blockName, - 'defaultStylePicker', - true - ) && }
) } diff --git a/packages/block-editor/src/store/actions.js b/packages/block-editor/src/store/actions.js index 6adbafe28341c..33c76bd2f6e4c 100644 --- a/packages/block-editor/src/store/actions.js +++ b/packages/block-editor/src/store/actions.js @@ -331,36 +331,6 @@ export function toggleSelection( isSelectionEnabled = true ) { }; } -function getBlocksWithDefaultStylesApplied( blocks, blockEditorSettings ) { - const preferredStyleVariations = - blockEditorSettings?.__experimentalPreferredStyleVariations?.value ?? - {}; - return blocks.map( ( block ) => { - const blockName = block.name; - if ( ! hasBlockSupport( blockName, 'defaultStylePicker', true ) ) { - return block; - } - if ( ! preferredStyleVariations[ blockName ] ) { - return block; - } - const className = block.attributes?.className; - if ( className?.includes( 'is-style-' ) ) { - return block; - } - const { attributes = {} } = block; - const blockStyle = preferredStyleVariations[ blockName ]; - return { - ...block, - attributes: { - ...attributes, - className: `${ - className || '' - } is-style-${ blockStyle }`.trim(), - }, - }; - } ); -} - /* eslint-disable jsdoc/valid-types */ /** * Action that replaces given blocks with one or more replacement blocks. @@ -378,10 +348,7 @@ export const replaceBlocks = ( { select, dispatch, registry } ) => { /* eslint-enable jsdoc/valid-types */ clientIds = castArray( clientIds ); - blocks = getBlocksWithDefaultStylesApplied( - castArray( blocks ), - select.getSettings() - ); + blocks = castArray( blocks ); const rootClientId = select.getBlockRootClientId( clientIds[ 0 ] ); // Replace is valid if the new blocks can be inserted in the root block. for ( let index = 0; index < blocks.length; index++ ) { @@ -594,10 +561,7 @@ export const insertBlocks = ); } - blocks = getBlocksWithDefaultStylesApplied( - castArray( blocks ), - select.getSettings() - ); + blocks = castArray( blocks ); const allowedBlocks = []; for ( const block of blocks ) { const isValid = select.canInsertBlockType( diff --git a/packages/block-editor/src/store/test/actions.js b/packages/block-editor/src/store/test/actions.js index e65921e30a6ce..932e97d95e2f2 100644 --- a/packages/block-editor/src/store/test/actions.js +++ b/packages/block-editor/src/store/test/actions.js @@ -380,107 +380,6 @@ describe( 'actions', () => { } ); describe( 'insertBlocks', () => { - it( 'should apply default styles to blocks if blocks do not contain a style', () => { - const ribsBlock = { - clientId: 'ribs', - name: 'core/test-ribs', - }; - const chickenBlock = { - clientId: 'chicken', - name: 'core/test-chicken', - }; - const chickenRibsBlock = { - clientId: 'chicken-ribs', - name: 'core/test-chicken-ribs', - }; - const blocks = [ ribsBlock, chickenBlock, chickenRibsBlock ]; - - const select = { - getSettings: () => ( { - __experimentalPreferredStyleVariations: { - value: { - 'core/test-ribs': 'squared', - 'core/test-chicken-ribs': 'colorful', - }, - }, - } ), - canInsertBlockType: () => true, - }; - const dispatch = jest.fn(); - - insertBlocks( - blocks, - 5, - 'testrootid', - false - )( { select, dispatch } ); - - expect( dispatch ).toHaveBeenCalledWith( { - type: 'INSERT_BLOCKS', - blocks: [ - { - ...ribsBlock, - attributes: { className: 'is-style-squared' }, - }, - chickenBlock, - { - ...chickenRibsBlock, - attributes: { className: 'is-style-colorful' }, - }, - ], - index: 5, - rootClientId: 'testrootid', - time: expect.any( Number ), - updateSelection: false, - initialPosition: null, - } ); - } ); - - it( 'should keep styles explicitly set even if different from the default', () => { - const ribsWithStyleBlock = { - clientId: 'ribs', - name: 'core/test-ribs', - attributes: { - className: 'is-style-colorful', - }, - }; - const blocks = [ ribsWithStyleBlock ]; - - const select = { - getSettings: () => ( { - __experimentalPreferredStyleVariations: { - value: { - 'core/test-ribs': 'squared', - }, - }, - } ), - canInsertBlockType: () => true, - }; - const dispatch = jest.fn(); - - insertBlocks( - blocks, - 5, - 'testrootid', - false - )( { select, dispatch } ); - - expect( dispatch ).toHaveBeenCalledWith( { - type: 'INSERT_BLOCKS', - blocks: [ - { - ...ribsWithStyleBlock, - attributes: { className: 'is-style-colorful' }, - }, - ], - index: 5, - rootClientId: 'testrootid', - time: expect.any( Number ), - updateSelection: false, - initialPosition: null, - } ); - } ); - it( 'should filter the allowed blocks in INSERT_BLOCKS action', () => { const ribsBlock = { clientId: 'ribs', diff --git a/packages/block-library/src/buttons/edit.js b/packages/block-library/src/buttons/edit.js index 0b9d2fe148ddd..644c0570928ad 100644 --- a/packages/block-library/src/buttons/edit.js +++ b/packages/block-library/src/buttons/edit.js @@ -6,11 +6,7 @@ import classnames from 'classnames'; /** * WordPress dependencies */ -import { - useBlockProps, - useInnerBlocksProps, - store as blockEditorStore, -} from '@wordpress/block-editor'; +import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor'; import { useSelect } from '@wordpress/data'; import { store as blocksStore } from '@wordpress/blocks'; @@ -36,16 +32,12 @@ function ButtonsEdit( { attributes, className } ) { 'has-custom-font-size': fontSize || style?.typography?.fontSize, } ), } ); - const { preferredStyle, hasButtonVariations } = useSelect( ( select ) => { - const preferredStyleVariations = - select( blockEditorStore ).getSettings() - .__experimentalPreferredStyleVariations; + const { hasButtonVariations } = useSelect( ( select ) => { const buttonVariations = select( blocksStore ).getBlockVariations( 'core/button', 'inserter' ); return { - preferredStyle: preferredStyleVariations?.value?.[ 'core/button' ], hasButtonVariations: buttonVariations.length > 0, }; }, [] ); @@ -54,12 +46,7 @@ function ButtonsEdit( { attributes, className } ) { defaultBlock: DEFAULT_BLOCK, // This check should be handled by the `Inserter` internally to be consistent across all blocks that use it. directInsert: ! hasButtonVariations, - template: [ - [ - 'core/button', - { className: preferredStyle && `is-style-${ preferredStyle }` }, - ], - ], + template: [ [ 'core/button' ] ], templateInsertUpdatesSelection: true, orientation: layout?.orientation ?? 'horizontal', } ); diff --git a/packages/block-library/src/buttons/edit.native.js b/packages/block-library/src/buttons/edit.native.js index 821d6d1932ecc..845af7556ca97 100644 --- a/packages/block-library/src/buttons/edit.native.js +++ b/packages/block-library/src/buttons/edit.native.js @@ -69,13 +69,6 @@ export default function ButtonsEdit( { [ clientId ] ); - const preferredStyle = useSelect( ( select ) => { - const preferredStyleVariations = - select( blockEditorStore ).getSettings() - .__experimentalPreferredStyleVariations; - return preferredStyleVariations?.value?.[ 'core/button' ]; - }, [] ); - const { getBlockOrder } = useSelect( blockEditorStore ); const { insertBlock, removeBlock, selectBlock } = useDispatch( blockEditorStore ); @@ -144,16 +137,7 @@ export default function ButtonsEdit( { ) } { resizeObserver } { const { getEditedPostTemplate } = select( editPostStore ); const { getEntityRecord, getPostType, canUser } = @@ -68,10 +67,6 @@ function Editor( { getPostType( currentPost.postType )?.viewable ?? false; const canEditTemplate = canUser( 'create', 'templates' ); return { - preferredStyleVariations: select( preferencesStore ).get( - 'core/edit-post', - 'preferredStyleVariations' - ), template: supportsTemplateMode && isViewable && @@ -85,26 +80,14 @@ function Editor( { [ currentPost.postType, currentPost.postId ] ); - const { updatePreferredStyleVariations } = useDispatch( editPostStore ); - const editorSettings = useMemo( () => ( { ...settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, defaultRenderingMode: 'post-only', - __experimentalPreferredStyleVariations: { - value: preferredStyleVariations, - onChange: updatePreferredStyleVariations, - }, } ), - [ - settings, - preferredStyleVariations, - updatePreferredStyleVariations, - onNavigateToEntityRecord, - onNavigateToPreviousEntityRecord, - ] + [ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ] ); if ( ! post ) { diff --git a/packages/edit-post/src/index.js b/packages/edit-post/src/index.js index 08bc7c5aa7002..a46a0c7592c68 100644 --- a/packages/edit-post/src/index.js +++ b/packages/edit-post/src/index.js @@ -55,7 +55,6 @@ export function initializeEditor( dispatch( preferencesStore ).setDefaults( 'core/edit-post', { fullscreenMode: true, isPublishSidebarEnabled: true, - preferredStyleVariations: {}, themeStyles: true, welcomeGuide: true, welcomeGuideTemplate: true, diff --git a/packages/edit-post/src/index.native.js b/packages/edit-post/src/index.native.js index c1b5126dba3b1..c0b83dc278785 100644 --- a/packages/edit-post/src/index.native.js +++ b/packages/edit-post/src/index.native.js @@ -27,7 +27,6 @@ export function initializeEditor( id, postType, postId ) { inactivePanels: [], isPublishSidebarEnabled: true, openPanels: [ 'post-status' ], - preferredStyleVariations: {}, welcomeGuide: true, } ); dispatch( preferencesStore ).setDefaults( 'core', { diff --git a/packages/edit-post/src/store/actions.js b/packages/edit-post/src/store/actions.js index 5d9f8ed24429d..b18a7d1ba9aef 100644 --- a/packages/edit-post/src/store/actions.js +++ b/packages/edit-post/src/store/actions.js @@ -239,46 +239,15 @@ export const togglePinnedPluginItem = /** * Returns an action object used in signaling that a style should be auto-applied when a block is created. * - * @param {string} blockName Name of the block. - * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the "auto apply" setting of the block is removed. + * @deprecated */ -export const updatePreferredStyleVariations = - ( blockName, blockStyle ) => - ( { registry } ) => { - if ( ! blockName ) { - return; - } - - const existingVariations = - registry - .select( preferencesStore ) - .get( 'core/edit-post', 'preferredStyleVariations' ) ?? {}; - - // When the blockStyle is omitted, remove the block's preferred variation. - if ( ! blockStyle ) { - const updatedVariations = { - ...existingVariations, - }; - - delete updatedVariations[ blockName ]; - - registry - .dispatch( preferencesStore ) - .set( - 'core/edit-post', - 'preferredStyleVariations', - updatedVariations - ); - } else { - // Else add the variation. - registry - .dispatch( preferencesStore ) - .set( 'core/edit-post', 'preferredStyleVariations', { - ...existingVariations, - [ blockName ]: blockStyle, - } ); - } - }; +export function updatePreferredStyleVariations() { + deprecated( "dispatch( 'core/edit-post' ).updatePreferredStyleVariations", { + since: '6.6', + hint: 'Preferred Style Variations are not supported anymore.', + } ); + return { type: 'NOTHING' }; +} /** * Update the provided block types to be visible. diff --git a/packages/edit-post/src/store/selectors.js b/packages/edit-post/src/store/selectors.js index f5b4a27e158ea..b9fe954e79ad5 100644 --- a/packages/edit-post/src/store/selectors.js +++ b/packages/edit-post/src/store/selectors.js @@ -161,23 +161,6 @@ export const getPreferences = createRegistrySelector( ( select ) => () => { alternative: `select( 'core/preferences' ).get`, } ); - // These preferences now exist in the preferences store. - // Fetch them so that they can be merged into the post - // editor preferences. - const preferences = [ 'preferredStyleVariations' ].reduce( - ( accumulatedPrefs, preferenceKey ) => { - const value = select( preferencesStore ).get( - 'core/edit-post', - preferenceKey - ); - - return { - ...accumulatedPrefs, - [ preferenceKey ]: value, - }; - }, - {} - ); const corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce( ( accumulatedPrefs, preferenceKey ) => { const value = select( preferencesStore ).get( @@ -205,7 +188,6 @@ export const getPreferences = createRegistrySelector( ( select ) => () => { const panels = convertPanelsToOldFormat( inactivePanels, openPanels ); return { - ...preferences, ...corePreferences, panels, }; diff --git a/packages/edit-post/src/store/test/actions.js b/packages/edit-post/src/store/test/actions.js index f1db11d26bafc..04c010630e50d 100644 --- a/packages/edit-post/src/store/test/actions.js +++ b/packages/edit-post/src/store/test/actions.js @@ -200,58 +200,6 @@ describe( 'actions', () => { } ); } ); - describe( 'updatePreferredStyleVariations', () => { - it( 'sets a preferred style variation for a block when a style name is passed', () => { - registry - .dispatch( 'core/edit-post' ) - .updatePreferredStyleVariations( 'core/paragraph', 'fancy' ); - registry - .dispatch( 'core/edit-post' ) - .updatePreferredStyleVariations( 'core/quote', 'posh' ); - - expect( - registry - .select( editPostStore ) - .getPreference( 'preferredStyleVariations' ) - ).toEqual( { - 'core/paragraph': 'fancy', - 'core/quote': 'posh', - } ); - - // Expect a deprecation message for `getPreference`. - expect( console ).toHaveWarned(); - } ); - - it( 'removes a preferred style variation for a block when a style name is omitted', () => { - registry - .dispatch( 'core/edit-post' ) - .updatePreferredStyleVariations( 'core/paragraph', 'fancy' ); - registry - .dispatch( 'core/edit-post' ) - .updatePreferredStyleVariations( 'core/quote', 'posh' ); - expect( - registry - .select( editPostStore ) - .getPreference( 'preferredStyleVariations' ) - ).toEqual( { - 'core/paragraph': 'fancy', - 'core/quote': 'posh', - } ); - - registry - .dispatch( 'core/edit-post' ) - .updatePreferredStyleVariations( 'core/paragraph' ); - - expect( - registry - .select( editPostStore ) - .getPreference( 'preferredStyleVariations' ) - ).toEqual( { - 'core/quote': 'posh', - } ); - } ); - } ); - describe( 'toggleDistractionFree', () => { it( 'should properly update settings to prevent layout corruption when enabling distraction free mode', () => { // Enable everything that shouldn't be enabled in distraction free mode. diff --git a/packages/editor/src/components/provider/use-block-editor-settings.js b/packages/editor/src/components/provider/use-block-editor-settings.js index 5ae329f7897f8..577ec977ecb94 100644 --- a/packages/editor/src/components/provider/use-block-editor-settings.js +++ b/packages/editor/src/components/provider/use-block-editor-settings.js @@ -28,7 +28,6 @@ const BLOCK_EDITOR_SETTINGS = [ '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', - '__experimentalPreferredStyleVariations', '__unstableGalleryWithImageBlocks', 'alignWide', 'blockInspectorTabs', @@ -59,7 +58,6 @@ const BLOCK_EDITOR_SETTINGS = [ 'isRTL', 'locale', 'maxWidth', - 'onUpdateDefaultBlockStyles', 'postContentAttributes', 'postsPerPage', 'readOnly', diff --git a/packages/preferences-persistence/src/migrations/legacy-local-storage-data/index.js b/packages/preferences-persistence/src/migrations/legacy-local-storage-data/index.js index 9ac1f35492030..b0b01a625ab99 100644 --- a/packages/preferences-persistence/src/migrations/legacy-local-storage-data/index.js +++ b/packages/preferences-persistence/src/migrations/legacy-local-storage-data/index.js @@ -60,11 +60,6 @@ export function convertLegacyData( data ) { { from: 'core/edit-post', to: 'core/edit-post' }, 'editorMode' ); - data = moveIndividualPreference( - data, - { from: 'core/edit-post', to: 'core/edit-post' }, - 'preferredStyleVariations' - ); data = moveIndividualPreference( data, { from: 'core/edit-post', to: 'core/edit-post' }, diff --git a/packages/preferences-persistence/src/migrations/legacy-local-storage-data/test/index.js b/packages/preferences-persistence/src/migrations/legacy-local-storage-data/test/index.js index d9507fbdaf22a..d4df39165c73d 100644 --- a/packages/preferences-persistence/src/migrations/legacy-local-storage-data/test/index.js +++ b/packages/preferences-persistence/src/migrations/legacy-local-storage-data/test/index.js @@ -49,7 +49,6 @@ const legacyData = { }, editorMode: 'text', hiddenBlockTypes: [ 'core/heading', 'core/list' ], - preferredStyleVariations: { 'core/quote': 'plain' }, localAutosaveInterval: 15, }, }, @@ -114,9 +113,6 @@ const alreadyConvertedData = { fullscreenMode: false, hiddenBlockTypes: [ 'core/audio', 'core/cover' ], editorMode: 'visual', - preferredStyleVariations: { - 'core/quote': 'large', - }, inactivePanels: [], openPanels: [ 'post-status' ], complementaryArea: 'edit-post/block', @@ -161,9 +157,6 @@ describe( 'convertLegacyData', () => { "pinnedItems": { "my-sidebar-plugin/title-sidebar": false, }, - "preferredStyleVariations": { - "core/quote": "plain", - }, "welcomeGuide": false, }, "core/edit-site": { @@ -206,9 +199,6 @@ describe( 'convertLegacyData', () => { "pinnedItems": { "my-sidebar-plugin/title-sidebar": false, }, - "preferredStyleVariations": { - "core/quote": "large", - }, "welcomeGuide": false, }, "core/edit-site": { diff --git a/packages/preferences-persistence/src/migrations/preferences-package-data/test/index.js b/packages/preferences-persistence/src/migrations/preferences-package-data/test/index.js index fefde528402ca..16edf9d39636b 100644 --- a/packages/preferences-persistence/src/migrations/preferences-package-data/test/index.js +++ b/packages/preferences-persistence/src/migrations/preferences-package-data/test/index.js @@ -20,9 +20,6 @@ const input = { fullscreenMode: false, hiddenBlockTypes: [ 'core/audio', 'core/cover' ], editorMode: 'visual', - preferredStyleVariations: { - 'core/quote': 'large', - }, inactivePanels: [], openPanels: [ 'post-status' ], pinnedItems: { @@ -63,9 +60,6 @@ describe( 'convertPreferencesPackageData', () => { "pinnedItems": { "my-sidebar-plugin/title-sidebar": false, }, - "preferredStyleVariations": { - "core/quote": "large", - }, "welcomeGuide": false, }, "core/edit-site": { diff --git a/packages/react-native-bridge/common/gutenberg-web-single-block/local-storage-overrides.json b/packages/react-native-bridge/common/gutenberg-web-single-block/local-storage-overrides.json index f9cee4142d11a..2c01a8d4e033f 100644 --- a/packages/react-native-bridge/common/gutenberg-web-single-block/local-storage-overrides.json +++ b/packages/react-native-bridge/common/gutenberg-web-single-block/local-storage-overrides.json @@ -10,8 +10,7 @@ }, "editorMode": "visual", "pinnedPluginItems": {}, - "hiddenBlockTypes": [], - "preferredStyleVariations": {} + "hiddenBlockTypes": [] } }, "core/nux": { diff --git a/schemas/json/block.json b/schemas/json/block.json index e5e63df17d732..7ac384db798ca 100644 --- a/schemas/json/block.json +++ b/schemas/json/block.json @@ -314,11 +314,6 @@ "description": "This property adds a field to define a custom className for the block’s wrapper.", "default": true }, - "defaultStylePicker": { - "type": "boolean", - "description": "When the style picker is shown, a dropdown is displayed so the user can select a default style for this block type. If you prefer not to show the dropdown, set this property to false.", - "default": true - }, "dimensions": { "type": "object", "description": "This value signals that a block supports some of the CSS style properties related to dimensions. When it does, the block editor will show UI controls for the user to set their values if the theme declares support.\n\nWhen the block declares support for a specific dimensions property, its attributes definition is extended to include the style attribute.",