diff --git a/docs/reference-guides/data/data-core-editor.md b/docs/reference-guides/data/data-core-editor.md index c50cd7a7a41531..f01d87640f0ca0 100644 --- a/docs/reference-guides/data/data-core-editor.md +++ b/docs/reference-guides/data/data-core-editor.md @@ -516,29 +516,6 @@ _Related_ - getPreviousBlockClientId in core/block-editor store. -### getReferenceByDistinctEdits - -> **Deprecated** since Gutenberg 6.5.0. - -Returns a new reference when edited values have changed. This is useful in -inferring where an edit has been made between states by comparison of the -return values using strict equality. - -_Usage_ - - const hasEditOccurred = ( - getReferenceByDistinctEdits( beforeState ) !== - getReferenceByDistinctEdits( afterState ) - ); - -_Parameters_ - -- _state_ `Object`: Editor state. - -_Returns_ - -- `*`: A value whose reference will change only when an edit occurs. - ### getSelectedBlock _Related_ diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 16a23a0d7c5062..375d76b030c6fd 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -524,10 +524,6 @@ _Related_ - -### PreserveScrollInReorder - -Undocumented declaration. - ### RichText _Related_ diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index 800e86a4935935..df21d82dda5e25 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -134,7 +134,6 @@ export { useTypingObserver as __unstableUseTypingObserver, useMouseMoveTypingReset as __unstableUseMouseMoveTypingReset, } from './observe-typing'; -export { default as PreserveScrollInReorder } from './preserve-scroll-in-reorder'; export { default as SkipToSelectedBlock } from './skip-to-selected-block'; export { default as Typewriter, diff --git a/packages/block-editor/src/components/media-placeholder/index.js b/packages/block-editor/src/components/media-placeholder/index.js index 123c8c5b0070ff..ec516ff19cd9af 100644 --- a/packages/block-editor/src/components/media-placeholder/index.js +++ b/packages/block-editor/src/components/media-placeholder/index.js @@ -17,7 +17,6 @@ import { import { __ } from '@wordpress/i18n'; import { useState, useEffect } from '@wordpress/element'; import { useSelect } from '@wordpress/data'; -import deprecated from '@wordpress/deprecated'; import { keyboardReturn } from '@wordpress/icons'; /** @@ -65,7 +64,6 @@ export function MediaPlaceholder( { addToGallery, multiple = false, handleUpload = true, - dropZoneUIOnly, disableDropZone, disableMediaButtons, onError, @@ -400,14 +398,7 @@ export function MediaPlaceholder( { return renderPlaceholder( uploadMediaLibraryButton ); }; - if ( dropZoneUIOnly || disableMediaButtons ) { - if ( dropZoneUIOnly ) { - deprecated( 'wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop', { - since: '5.4', - alternative: 'disableMediaButtons', - } ); - } - + if ( disableMediaButtons ) { return { renderDropZone() }; } diff --git a/packages/block-editor/src/components/preserve-scroll-in-reorder/index.js b/packages/block-editor/src/components/preserve-scroll-in-reorder/index.js deleted file mode 100644 index 37da4295a062e1..00000000000000 --- a/packages/block-editor/src/components/preserve-scroll-in-reorder/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * WordPress dependencies - */ -import deprecated from '@wordpress/deprecated'; - -export default function PreserveScrollInReorder() { - deprecated( 'PreserveScrollInReorder component', { - since: '5.4', - hint: 'This behavior is now built-in the block list', - } ); - return null; -} diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index d4dacb0d920512..c0659b060b7d0f 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -400,6 +400,7 @@ function RichTextWrapper( 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 ); diff --git a/packages/block-editor/src/components/rich-text/index.native.js b/packages/block-editor/src/components/rich-text/index.native.js index bdd49831331212..e5e6c7e7b87595 100644 --- a/packages/block-editor/src/components/rich-text/index.native.js +++ b/packages/block-editor/src/components/rich-text/index.native.js @@ -696,6 +696,7 @@ function RichTextWrapper( deprecated( 'wp.blockEditor.RichText wrapperClassName prop', { since: '5.4', alternative: 'className prop or create your own wrapper div', + version: '6.2', } ); return ( diff --git a/packages/block-editor/src/components/rich-text/utils.js b/packages/block-editor/src/components/rich-text/utils.js index d4f9ed310ab455..6c8275d930eebf 100644 --- a/packages/block-editor/src/components/rich-text/utils.js +++ b/packages/block-editor/src/components/rich-text/utils.js @@ -54,6 +54,7 @@ export function getAllowedFormats( { deprecated( 'wp.blockEditor.RichText formattingControls prop', { since: '5.4', alternative: 'allowedFormats', + version: '6.2', } ); return formattingControls.map( ( name ) => `core/${ name }` ); diff --git a/packages/components/src/button/deprecated.js b/packages/components/src/button/deprecated.js index 86c1ac8547d40c..5f18e0e5eb1648 100644 --- a/packages/components/src/button/deprecated.js +++ b/packages/components/src/button/deprecated.js @@ -14,6 +14,7 @@ function IconButton( { labelPosition, size, tooltip, label, ...props }, ref ) { deprecated( 'wp.components.IconButton', { since: '5.4', alternative: 'wp.components.Button', + version: '6.2', } ); return ( diff --git a/packages/components/src/button/index.js b/packages/components/src/button/index.js index 6032777ab42112..ff56ba8f3e4784 100644 --- a/packages/components/src/button/index.js +++ b/packages/components/src/button/index.js @@ -48,6 +48,7 @@ function useDeprecatedProps( { deprecated( 'Button isDefault prop', { since: '5.4', alternative: 'variant="secondary"', + version: '6.2', } ); computedVariant ??= 'secondary'; diff --git a/packages/components/src/modal/index.js b/packages/components/src/modal/index.js index 244f708ebf58e7..d30d9024eb062b 100644 --- a/packages/components/src/modal/index.js +++ b/packages/components/src/modal/index.js @@ -22,7 +22,6 @@ import { useConstrainedTabbing, useMergeRefs, } from '@wordpress/compose'; -import deprecated from '@wordpress/deprecated'; import { ESCAPE } from '@wordpress/keycodes'; import { __ } from '@wordpress/i18n'; import { closeSmall } from '@wordpress/icons'; @@ -45,8 +44,7 @@ function Modal( props, forwardedRef ) { focusOnMount = true, shouldCloseOnEsc = true, shouldCloseOnClickOutside = true, - isDismissable, // Deprecated - isDismissible = isDismissable || true, + isDismissible = true, /* accessibility */ aria = { labelledby: null, @@ -93,13 +91,6 @@ function Modal( props, forwardedRef ) { }; }, [] ); - if ( isDismissable ) { - deprecated( 'isDismissable prop of the Modal component', { - since: '5.4', - alternative: 'isDismissible prop (renamed) of the Modal component', - } ); - } - function handleEscapeKeyDown( event ) { if ( shouldCloseOnEsc && diff --git a/packages/data/src/plugins/controls/index.js b/packages/data/src/plugins/controls/index.js deleted file mode 100644 index d442dfa7c1f26c..00000000000000 --- a/packages/data/src/plugins/controls/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * WordPress dependencies - */ -import deprecated from '@wordpress/deprecated'; - -export default ( registry ) => { - deprecated( 'wp.data.plugins.controls', { - since: '5.4', - hint: 'The controls plugins is now baked-in.', - } ); - return registry; -}; diff --git a/packages/data/src/plugins/index.js b/packages/data/src/plugins/index.js index 587768f415911a..30050ad77fa62e 100644 --- a/packages/data/src/plugins/index.js +++ b/packages/data/src/plugins/index.js @@ -1,2 +1 @@ -export { default as controls } from './controls'; export { default as persistence } from './persistence'; diff --git a/packages/data/src/registry.js b/packages/data/src/registry.js index 22672faa00dd13..7f14a74a6dd348 100644 --- a/packages/data/src/registry.js +++ b/packages/data/src/registry.js @@ -291,6 +291,10 @@ export function createRegistry( storeConfigs = {}, parent = null ) { // This function will be deprecated as soon as it is no longer internally referenced. // function use( plugin, options ) { + if ( ! plugin ) { + return; + } + registry = { ...registry, ...plugin( registry, options ), diff --git a/packages/editor/src/components/deprecated.js b/packages/editor/src/components/deprecated.js index 29b08acb1c064b..690661c439c9a7 100644 --- a/packages/editor/src/components/deprecated.js +++ b/packages/editor/src/components/deprecated.js @@ -48,7 +48,6 @@ import { MultiSelectScrollIntoView as RootMultiSelectScrollIntoView, NavigableToolbar as RootNavigableToolbar, ObserveTyping as RootObserveTyping, - PreserveScrollInReorder as RootPreserveScrollInReorder, SkipToSelectedBlock as RootSkipToSelectedBlock, URLInput as RootURLInput, URLInputButton as RootURLInputButton, @@ -224,10 +223,6 @@ export const ObserveTyping = deprecateComponent( 'ObserveTyping', RootObserveTyping ); -export const PreserveScrollInReorder = deprecateComponent( - 'PreserveScrollInReorder', - RootPreserveScrollInReorder -); export const SkipToSelectedBlock = deprecateComponent( 'SkipToSelectedBlock', RootSkipToSelectedBlock diff --git a/packages/editor/src/store/selectors.js b/packages/editor/src/store/selectors.js index cde861d255b3bb..d25f3e8affc472 100644 --- a/packages/editor/src/store/selectors.js +++ b/packages/editor/src/store/selectors.js @@ -277,41 +277,6 @@ export const getPostEdits = createRegistrySelector( ( select ) => ( state ) => { ); } ); -/** - * Returns a new reference when edited values have changed. This is useful in - * inferring where an edit has been made between states by comparison of the - * return values using strict equality. - * - * @deprecated since Gutenberg 6.5.0. - * - * @example - * - * ``` - * const hasEditOccurred = ( - * getReferenceByDistinctEdits( beforeState ) !== - * getReferenceByDistinctEdits( afterState ) - * ); - * ``` - * - * @param {Object} state Editor state. - * - * @return {*} A value whose reference will change only when an edit occurs. - */ -export const getReferenceByDistinctEdits = createRegistrySelector( - ( select ) => (/* state */) => { - deprecated( - "`wp.data.select( 'core/editor' ).getReferenceByDistinctEdits`", - { - since: '5.4', - alternative: - "`wp.data.select( 'core' ).getReferenceByDistinctEdits`", - } - ); - - return select( coreStore ).getReferenceByDistinctEdits(); - } -); - /** * Returns an attribute value of the saved post. * diff --git a/packages/nux/src/index.js b/packages/nux/src/index.js index 33f9f766c2b827..a0b3e073503750 100644 --- a/packages/nux/src/index.js +++ b/packages/nux/src/index.js @@ -9,4 +9,5 @@ export { default as DotTip } from './components/dot-tip'; deprecated( 'wp.nux', { since: '5.4', hint: 'wp.components.Guide can be used to show a user guide.', + version: '6.2', } );