Skip to content

Commit

Permalink
Removed prioritizePatterns instances where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitmathur-7 committed Dec 13, 2024
1 parent ac915f4 commit ea8d016
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
13 changes: 0 additions & 13 deletions packages/block-editor/src/components/inserter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const defaultRenderToggle = ( {
blockTitle,
hasSingleBlockType,
toggleProps = {},
prioritizePatterns,
} ) => {
const {
as: Wrapper = Button,
Expand All @@ -45,8 +44,6 @@ const defaultRenderToggle = ( {
_x( 'Add %s', 'directly add the only allowed block' ),
blockTitle
);
} else if ( ! label && prioritizePatterns ) {
label = __( 'Add pattern' );
} else if ( ! label ) {
label = _x( 'Add block', 'Generic label for block inserter button' );
}
Expand Down Expand Up @@ -113,7 +110,6 @@ class Inserter extends Component {
toggleProps,
hasItems,
renderToggle = defaultRenderToggle,
prioritizePatterns,
} = this.props;

return renderToggle( {
Expand All @@ -124,7 +120,6 @@ class Inserter extends Component {
hasSingleBlockType,
directInsertBlock,
toggleProps,
prioritizePatterns,
} );
}

Expand All @@ -147,7 +142,6 @@ class Inserter extends Component {
// This prop is experimental to give some time for the quick inserter to mature
// Feel free to make them stable after a few releases.
__experimentalIsQuick: isQuick,
prioritizePatterns,
onSelectOrClose,
selectBlockOnInsert,
} = this.props;
Expand All @@ -171,7 +165,6 @@ class Inserter extends Component {
rootClientId={ rootClientId }
clientId={ clientId }
isAppender={ isAppender }
prioritizePatterns={ prioritizePatterns }
selectBlockOnInsert={ selectBlockOnInsert }
/>
);
Expand Down Expand Up @@ -230,7 +223,6 @@ export default compose( [
hasInserterItems,
getAllowedBlocks,
getDirectInsertBlock,
getSettings,
} = select( blockEditorStore );

const { getBlockVariations } = select( blocksStore );
Expand All @@ -243,8 +235,6 @@ export default compose( [
const directInsertBlock =
shouldDirectInsert && getDirectInsertBlock( rootClientId );

const settings = getSettings();

const hasSingleBlockType =
allowedBlocks?.length === 1 &&
getBlockVariations( allowedBlocks[ 0 ].name, 'inserter' )
Expand All @@ -262,9 +252,6 @@ export default compose( [
allowedBlockType,
directInsertBlock,
rootClientId,
prioritizePatterns:
settings.__experimentalPreferPatternsOnRoot &&
! rootClientId,
};
}
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default function QuickInserter( {
rootClientId,
clientId,
isAppender,
prioritizePatterns,
selectBlockOnInsert,
hasSearch = true,
} ) {
Expand Down Expand Up @@ -110,7 +109,6 @@ export default function QuickInserter( {
maxBlockPatterns={ 0 }
maxBlockTypes={ SHOWN_BLOCK_TYPES }
isDraggable={ false }
prioritizePatterns={ prioritizePatterns }
selectBlockOnInsert={ selectBlockOnInsert }
isQuick
/>
Expand Down

0 comments on commit ea8d016

Please sign in to comment.