diff --git a/packages/edit-post/README.md b/packages/edit-post/README.md index 65e31953e1ae57..82b106daaf6b6c 100644 --- a/packages/edit-post/README.md +++ b/packages/edit-post/README.md @@ -41,65 +41,51 @@ _Parameters_ ### PluginBlockSettingsMenuItem -Undocumented declaration. - -### PluginDocumentSettingPanel +_Related_ -Undocumented declaration. +- PluginBlockSettingsMenuItem in @wordpress/editor package. -### PluginMoreMenuItem +### PluginDocumentSettingPanel -Undocumented declaration. +_Related_ -### PluginPostPublishPanel +- PluginDocumentSettingPanel in @wordpress/editor package. -> **Deprecated** since 6.6, use `wp.editor.PluginPostPublishPanel` instead. +### PluginMoreMenuItem -Renders provided content to the post-publish panel in the publish flow (side panel that opens after a user publishes the post). +_Related_ -_Parameters_ +- PluginMoreMenuItem in @wordpress/editor package. -- _props_ `Object`: Component properties. -- _props.className_ `[string]`: An optional class name added to the panel. -- _props.title_ `[string]`: Title displayed at the top of the panel. -- _props.initialOpen_ `[boolean]`: Whether to have the panel initially opened. When no title is provided it is always opened. -- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar. -- _props.children_ `Element`: Children to be rendered +### PluginPostPublishPanel -_Returns_ +_Related_ -- `Component`: The component to be rendered. +- PluginPostPublishPanel in @wordpress/editor package. ### PluginPostStatusInfo -Undocumented declaration. - -### PluginPrePublishPanel - -> **Deprecated** since 6.6, use `wp.editor.PluginPrePublishPanel` instead. - -Renders provided content to the pre-publish side panel in the publish flow (side panel that opens when a user first pushes "Publish" from the main editor). +_Related_ -_Parameters_ +- PluginPostStatusInfo in @wordpress/editor package. -- _props_ `Object`: Component props. -- _props.className_ `[string]`: An optional class name added to the panel. -- _props.title_ `[string]`: Title displayed at the top of the panel. -- _props.initialOpen_ `[boolean]`: Whether to have the panel initially opened. When no title is provided it is always opened. -- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar. -- _props.children_ `Element`: Children to be rendered +### PluginPrePublishPanel -_Returns_ +_Related_ -- `Component`: The component to be rendered. +- PluginPrePublishPanel in @wordpress/editor package. ### PluginSidebar -Undocumented declaration. +_Related_ + +- PluginSidebar in @wordpress/editor package. ### PluginSidebarMoreMenuItem -Undocumented declaration. +_Related_ + +- PluginSidebarMoreMenuItem in @wordpress/editor package. ### reinitializeEditor diff --git a/packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js b/packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js deleted file mode 100644 index 4d4838214b2829..00000000000000 --- a/packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * WordPress dependencies - */ -import deprecated from '@wordpress/deprecated'; -import { PluginPostPublishPanel } from '@wordpress/editor'; - -/** - * Renders provided content to the post-publish panel in the publish flow - * (side panel that opens after a user publishes the post). - * - * @deprecated since 6.6, use `wp.editor.PluginPostPublishPanel` instead. - * - * @param {Object} props Component properties. - * @param {string} [props.className] An optional class name added to the panel. - * @param {string} [props.title] Title displayed at the top of the panel. - * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened. - * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar. - * @param {Element} props.children Children to be rendered - * @return {Component} The component to be rendered. - */ -export default function EditPostPluginPostPublishPanel( props ) { - deprecated( 'wp.editPost.PluginPostPublishPanel', { - since: '6.6', - version: '6.8', - alternative: 'wp.editor.PluginPostPublishPanel', - } ); - return ; -} diff --git a/packages/edit-post/src/components/sidebar/plugin-pre-publish-panel/index.js b/packages/edit-post/src/components/sidebar/plugin-pre-publish-panel/index.js deleted file mode 100644 index 4353c1f6fd2ae9..00000000000000 --- a/packages/edit-post/src/components/sidebar/plugin-pre-publish-panel/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * WordPress dependencies - */ -import deprecated from '@wordpress/deprecated'; -import { PluginPrePublishPanel } from '@wordpress/editor'; - -/** - * Renders provided content to the pre-publish side panel in the publish flow - * (side panel that opens when a user first pushes "Publish" from the main editor). - * - * @deprecated since 6.6, use `wp.editor.PluginPrePublishPanel` instead. - * - * @param {Object} props Component props. - * @param {string} [props.className] An optional class name added to the panel. - * @param {string} [props.title] Title displayed at the top of the panel. - * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. - * When no title is provided it is always opened. - * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) - * icon slug string, or an SVG WP element, to be rendered when - * the sidebar is pinned to toolbar. - * @param {Element} props.children Children to be rendered - * - * @return {Component} The component to be rendered. - */ -export default function EditPostPluginPrePublishPanel( props ) { - deprecated( 'wp.editPost.PluginPrePublishPanel', { - since: '6.6', - version: '6.8', - alternative: 'wp.editor.PluginPrePublishPanel', - } ); - return ; -} diff --git a/packages/edit-post/src/deprecated.js b/packages/edit-post/src/deprecated.js new file mode 100644 index 00000000000000..c07d93602091f2 --- /dev/null +++ b/packages/edit-post/src/deprecated.js @@ -0,0 +1,87 @@ +/** + * WordPress dependencies + */ +import { + PluginBlockSettingsMenuItem as EditorPluginBlockSettingsMenuItem, + PluginDocumentSettingPanel as EditorPluginDocumentSettingPanel, + PluginMoreMenuItem as EditorPluginMoreMenuItem, + PluginPrePublishPanel as EditorPluginPrePublishPanel, + PluginPostPublishPanel as EditorPluginPostPublishPanel, + PluginPostStatusInfo as EditorPluginPostStatusInfo, + PluginSidebar as EditorPluginSidebar, + PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem, +} from '@wordpress/editor'; +import deprecated from '@wordpress/deprecated'; + +const deprecateSlot = ( name ) => { + deprecated( `wp.editPost.${ name }`, { + since: '6.6', + alternative: `wp.editor.${ name }`, + } ); +}; + +/* eslint-disable jsdoc/require-param */ +/** + * @see PluginBlockSettingsMenuItem in @wordpress/editor package. + */ +export function PluginBlockSettingsMenuItem( props ) { + deprecateSlot( 'PluginBlockSettingsMenuItem' ); + return ; +} + +/** + * @see PluginDocumentSettingPanel in @wordpress/editor package. + */ +export function PluginDocumentSettingPanel( props ) { + deprecateSlot( 'PluginDocumentSettingPanel' ); + return ; +} + +/** + * @see PluginMoreMenuItem in @wordpress/editor package. + */ +export function PluginMoreMenuItem( props ) { + deprecateSlot( 'PluginMoreMenuItem' ); + return ; +} + +/** + * @see PluginPrePublishPanel in @wordpress/editor package. + */ +export function PluginPrePublishPanel( props ) { + deprecateSlot( 'PluginPrePublishPanel' ); + return ; +} + +/** + * @see PluginPostPublishPanel in @wordpress/editor package. + */ +export function PluginPostPublishPanel( props ) { + deprecateSlot( 'PluginPostPublishPanel' ); + return ; +} + +/** + * @see PluginPostStatusInfo in @wordpress/editor package. + */ +export function PluginPostStatusInfo( props ) { + deprecateSlot( 'PluginPostStatusInfo' ); + return ; +} + +/** + * @see PluginSidebar in @wordpress/editor package. + */ +export function PluginSidebar( props ) { + deprecateSlot( 'PluginSidebar' ); + return ; +} + +/** + * @see PluginSidebarMoreMenuItem in @wordpress/editor package. + */ +export function PluginSidebarMoreMenuItem( props ) { + deprecateSlot( 'PluginSidebarMoreMenuItem' ); + return ; +} +/* eslint-enable jsdoc/require-param */ diff --git a/packages/edit-post/src/index.js b/packages/edit-post/src/index.js index 656fa54d87bfeb..88aae97f7af92b 100644 --- a/packages/edit-post/src/index.js +++ b/packages/edit-post/src/index.js @@ -15,12 +15,6 @@ import { registerWidgetGroupBlock, } from '@wordpress/widgets'; import { - PluginBlockSettingsMenuItem, - PluginDocumentSettingPanel, - PluginMoreMenuItem, - PluginPostStatusInfo, - PluginSidebar, - PluginSidebarMoreMenuItem, privateApis as editorPrivateApis, store as editorStore, } from '@wordpress/editor'; @@ -165,15 +159,8 @@ export function reinitializeEditor() { } ); } -export { PluginBlockSettingsMenuItem }; -export { PluginDocumentSettingPanel }; -export { PluginMoreMenuItem }; -export { PluginPostStatusInfo }; -export { PluginSidebar }; -export { PluginSidebarMoreMenuItem }; -export { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel'; -export { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel'; export { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close'; export { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button'; export { __experimentalPluginPostExcerpt }; export { store } from './store'; +export * from './deprecated'; diff --git a/packages/edit-site/src/deprecated.js b/packages/edit-site/src/deprecated.js new file mode 100644 index 00000000000000..446ac1860989a9 --- /dev/null +++ b/packages/edit-site/src/deprecated.js @@ -0,0 +1,42 @@ +/** + * WordPress dependencies + */ +import { + PluginMoreMenuItem as EditorPluginMoreMenuItem, + PluginSidebar as EditorPluginSidebar, + PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem, +} from '@wordpress/editor'; +import deprecated from '@wordpress/deprecated'; + +const deprecateSlot = ( name ) => { + deprecated( `wp.editPost.${ name }`, { + since: '6.6', + alternative: `wp.editor.${ name }`, + } ); +}; + +/* eslint-disable jsdoc/require-param */ +/** + * @see PluginMoreMenuItem in @wordpress/editor package. + */ +export function PluginMoreMenuItem( props ) { + deprecateSlot( 'PluginMoreMenuItem' ); + return ; +} + +/** + * @see PluginSidebar in @wordpress/editor package. + */ +export function PluginSidebar( props ) { + deprecateSlot( 'PluginSidebar' ); + return ; +} + +/** + * @see PluginSidebarMoreMenuItem in @wordpress/editor package. + */ +export function PluginSidebarMoreMenuItem( props ) { + deprecateSlot( 'PluginSidebarMoreMenuItem' ); + return ; +} +/* eslint-enable jsdoc/require-param */ diff --git a/packages/edit-site/src/index.js b/packages/edit-site/src/index.js index 7bac4bca10b649..f42842f504e54d 100644 --- a/packages/edit-site/src/index.js +++ b/packages/edit-site/src/index.js @@ -10,12 +10,7 @@ import { import { dispatch } from '@wordpress/data'; import deprecated from '@wordpress/deprecated'; import { createRoot } from '@wordpress/element'; -import { - PluginMoreMenuItem, - PluginSidebar, - PluginSidebarMoreMenuItem, - store as editorStore, -} from '@wordpress/editor'; +import { store as editorStore } from '@wordpress/editor'; import { store as preferencesStore } from '@wordpress/preferences'; import { registerLegacyWidgetBlock, @@ -102,8 +97,6 @@ export function reinitializeEditor() { } ); } -export { PluginMoreMenuItem }; -export { PluginSidebar }; -export { PluginSidebarMoreMenuItem }; export { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel'; export { store } from './store'; +export * from './deprecated';