Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rich text: remove deprecated wrapperClassName prop #44033

Merged
merged 2 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions packages/block-editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function RichTextWrapper(
}

const TagName = tagName;
const content = (
return (
<>
{ isSelected && (
<keyboardShortcutContext.Provider value={ keyboardShortcuts }>
Expand Down Expand Up @@ -424,19 +424,6 @@ function RichTextWrapper(
/>
</>
);

if ( ! wrapperClassName ) {
return content;
}

deprecated( 'wp.blockEditor.RichText wrapperClassName prop', {
since: '5.4',
alternative: 'className prop or create your own wrapper div',
version: '6.2',
} );

const className = classnames( 'block-editor-rich-text', wrapperClassName );
return <div className={ className }>{ content }</div>;
}

const ForwardedRichTextContainer = forwardRef( RichTextWrapper );
Expand Down
20 changes: 1 addition & 19 deletions packages/block-editor/src/components/rich-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import {
toHTMLString,
slice,
} from '@wordpress/rich-text';
import deprecated from '@wordpress/deprecated';
import { isURL } from '@wordpress/url';

/**
Expand All @@ -58,7 +57,6 @@ import {
} from './utils';
import EmbedHandlerPicker from './embed-handler-picker';

const wrapperClasses = 'block-editor-rich-text';
const classes = 'block-editor-rich-text__editable';

function RichTextWrapper(
Expand Down Expand Up @@ -582,7 +580,7 @@ function RichTextWrapper(

const mergedRef = useMergeRefs( [ forwardedRef, fallbackRef ] );

const content = (
return (
<RichText
clientId={ clientId }
identifier={ identifier }
Expand Down Expand Up @@ -710,22 +708,6 @@ function RichTextWrapper(
) }
</RichText>
);

if ( ! wrapperClassName ) {
return content;
}

deprecated( 'wp.blockEditor.RichText wrapperClassName prop', {
since: '5.4',
alternative: 'className prop or create your own wrapper div',
version: '6.2',
} );

return (
<div className={ classnames( wrapperClasses, wrapperClassName ) }>
{ content }
</div>
);
}

const ForwardedRichTextContainer = forwardRef( RichTextWrapper );
Expand Down