Skip to content

Commit

Permalink
Block Editor: Remove the 'PrivateInserter' component (WordPress#65111)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: youknowriad <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2024
1 parent 6bbdd1e commit 7051a8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
14 changes: 4 additions & 10 deletions packages/block-editor/src/components/inserter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import clsx from 'clsx';
import { speak } from '@wordpress/a11y';
import { __, _x, sprintf } from '@wordpress/i18n';
import { Dropdown, Button } from '@wordpress/components';
import { forwardRef, Component } from '@wordpress/element';
import { Component } from '@wordpress/element';
import { withDispatch, withSelect } from '@wordpress/data';
import { compose, ifCondition } from '@wordpress/compose';
import { createBlock, store as blocksStore } from '@wordpress/blocks';
Expand Down Expand Up @@ -76,7 +76,7 @@ const defaultRenderToggle = ( {
);
};

class PrivateInserter extends Component {
class Inserter extends Component {
constructor() {
super( ...arguments );

Expand Down Expand Up @@ -222,7 +222,7 @@ class PrivateInserter extends Component {
}
}

export const ComposedPrivateInserter = compose( [
export default compose( [
withSelect(
( select, { clientId, rootClientId, shouldDirectInsert = true } ) => {
const {
Expand Down Expand Up @@ -418,10 +418,4 @@ export const ComposedPrivateInserter = compose( [
( { hasItems, isAppender, rootClientId, clientId } ) =>
hasItems || ( ! isAppender && ! rootClientId && ! clientId )
),
] )( PrivateInserter );

const Inserter = forwardRef( ( props, ref ) => {
return <ComposedPrivateInserter ref={ ref } { ...props } />;
} );

export default Inserter;
] )( Inserter );
2 changes: 0 additions & 2 deletions packages/block-editor/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ExperimentalBlockEditorProvider } from './components/provider';
import { lock } from './lock-unlock';
import { getRichTextValues } from './components/rich-text/get-rich-text-values';
import ResizableBoxPopover from './components/resizable-box-popover';
import { ComposedPrivateInserter as PrivateInserter } from './components/inserter';
import { default as PrivateQuickInserter } from './components/inserter/quick-inserter';
import {
extractWords,
Expand Down Expand Up @@ -60,7 +59,6 @@ lock( privateApis, {
ExperimentalBlockEditorProvider,
getDuotoneFilter,
getRichTextValues,
PrivateInserter,
PrivateQuickInserter,
extractWords,
getNormalizedSearchTerms,
Expand Down

0 comments on commit 7051a8f

Please sign in to comment.