diff --git a/packages/blocks/src/store/selectors.js b/packages/blocks/src/store/selectors.js index 2ff799029bca77..ddba2bac58b323 100644 --- a/packages/blocks/src/store/selectors.js +++ b/packages/blocks/src/store/selectors.js @@ -76,11 +76,6 @@ export const getBlockTypes = createSelector( ( state ) => [ state.blockTypes ] ); -export const getBlockNames = createSelector( - ( state ) => Object.keys( state.bootstrappedBlockTypes ), - ( state ) => [ state.bootstrappedBlockTypes ] -); - export const getBootstrappedBlockTypes = createSelector( ( state ) => Object.values( state.bootstrappedBlockTypes ), ( state ) => [ state.bootstrappedBlockTypes ] diff --git a/packages/edit-post/src/editor.js b/packages/edit-post/src/editor.js index 0b0bd13e1a1743..a2d0a32a2ab54e 100644 --- a/packages/edit-post/src/editor.js +++ b/packages/edit-post/src/editor.js @@ -43,7 +43,7 @@ function Editor( { postId, postType, settings, initialEdits, ...props } ) { post, preferredStyleVariations, hiddenBlockTypes, - blockNames, + blockTypes, keepCaretInsideBlock, isTemplateMode, template, @@ -58,7 +58,7 @@ function Editor( { postId, postType, settings, initialEdits, ...props } ) { const { getEntityRecord, getPostType, getEntityRecords, canUser } = select( coreStore ); const { getEditorSettings } = select( editorStore ); - const { getBlockNames } = select( blocksStore ); + const { getBootstrappedBlockTypes } = select( blocksStore ); const isTemplate = [ 'wp_template', 'wp_template_part' ].includes( postType ); @@ -89,7 +89,7 @@ function Editor( { postId, postType, settings, initialEdits, ...props } ) { 'preferredStyleVariations' ), hiddenBlockTypes: getHiddenBlockTypes(), - blockNames: getBlockNames(), + blockTypes: getBootstrappedBlockTypes(), keepCaretInsideBlock: isFeatureActive( 'keepCaretInsideBlock' ), isTemplateMode: isEditingTemplate(), template: @@ -132,7 +132,7 @@ function Editor( { postId, postType, settings, initialEdits, ...props } ) { // all block types). const defaultAllowedBlockTypes = true === settings.allowedBlockTypes - ? blockNames + ? blockTypes.map( ( { name } ) => name ) : settings.allowedBlockTypes || []; result.allowedBlockTypes = defaultAllowedBlockTypes.filter( @@ -148,7 +148,7 @@ function Editor( { postId, postType, settings, initialEdits, ...props } ) { focusMode, isDistractionFree, hiddenBlockTypes, - blockNames, + blockTypes, preferredStyleVariations, setIsInserterOpened, updatePreferredStyleVariations,