diff --git a/packages/edit-post/src/components/sidebar/settings-sidebar/index.js b/packages/edit-post/src/components/sidebar/settings-sidebar/index.js index d28a140679661..05fb4fc91e69c 100644 --- a/packages/edit-post/src/components/sidebar/settings-sidebar/index.js +++ b/packages/edit-post/src/components/sidebar/settings-sidebar/index.js @@ -126,19 +126,15 @@ const SidebarContent = ( { tabName, keyboardShortcut, isEditingTemplate } ) => { /> } /> - { ! isEditingTemplate && ( - <> - - - - - - - - - - - ) } + { ! isEditingTemplate && } + + + + + + + + { ! isEditingTemplate && } diff --git a/packages/edit-site/src/components/plugin-template-setting-panel/index.js b/packages/edit-site/src/components/plugin-template-setting-panel/index.js index 3ba04b091ba4f..5183350c63386 100644 --- a/packages/edit-site/src/components/plugin-template-setting-panel/index.js +++ b/packages/edit-site/src/components/plugin-template-setting-panel/index.js @@ -8,10 +8,16 @@ import { store as editorStore } from '@wordpress/editor'; import { useSelect } from '@wordpress/data'; import { createSlotFill } from '@wordpress/components'; +import deprecated from '@wordpress/deprecated'; const { Fill, Slot } = createSlotFill( 'PluginTemplateSettingPanel' ); const PluginTemplateSettingPanel = ( { children } ) => { + deprecated( 'wp.editSite.PluginTemplateSettingPanel', { + since: '6.6', + version: '6.8', + alternative: 'wp.editor.PluginDocumentSettingPanel', + } ); const isCurrentEntityTemplate = useSelect( ( select ) => select( editorStore ).getCurrentPostType() === 'wp_template', @@ -29,6 +35,8 @@ PluginTemplateSettingPanel.Slot = Slot; * Renders items in the Template Sidebar below the main information * like the Template Card. * + * @deprecated since 6.6. Use `wp.editor.PluginDocumentSettingPanel` instead. + * * @example * ```jsx * // Using ESNext syntax diff --git a/packages/edit-site/src/components/sidebar-edit-mode/index.js b/packages/edit-site/src/components/sidebar-edit-mode/index.js index 0fe117c3ea067..7ac2098a00c1b 100644 --- a/packages/edit-site/src/components/sidebar-edit-mode/index.js +++ b/packages/edit-site/src/components/sidebar-edit-mode/index.js @@ -11,7 +11,14 @@ import { useCallback, useContext, useEffect, useRef } from '@wordpress/element'; import { useSelect, useDispatch } from '@wordpress/data'; import { store as blockEditorStore } from '@wordpress/block-editor'; import { store as coreStore } from '@wordpress/core-data'; -import { privateApis as editorPrivateApis } from '@wordpress/editor'; +import { + PageAttributesPanel, + PostDiscussionPanel, + PostExcerptPanel, + PostLastRevisionPanel, + PostTaxonomiesPanel, + privateApis as editorPrivateApis, +} from '@wordpress/editor'; /** * Internal dependencies @@ -25,7 +32,7 @@ import { store as editSiteStore } from '../../store'; import { unlock } from '../../lock-unlock'; const { Tabs } = unlock( componentsPrivateApis ); -const { interfaceStore, useAutoSwitchEditorSidebars } = +const { interfaceStore, useAutoSwitchEditorSidebars, PatternOverridesPanel } = unlock( editorPrivateApis ); const { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill( 'EditSiteSidebarInspector' @@ -91,6 +98,12 @@ const FillContents = ( { tabName, isEditingPage, supportsGlobalStyles } ) => { focusable={ false } > { isEditingPage ? : } + + + + + + diff --git a/packages/edit-site/src/components/sidebar-edit-mode/page-panels/index.js b/packages/edit-site/src/components/sidebar-edit-mode/page-panels/index.js index 021050d2c18f5..c5d0a2cc7ba7c 100644 --- a/packages/edit-site/src/components/sidebar-edit-mode/page-panels/index.js +++ b/packages/edit-site/src/components/sidebar-edit-mode/page-panels/index.js @@ -6,12 +6,7 @@ import { __ } from '@wordpress/i18n'; import { useSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; import { - PageAttributesPanel, PluginDocumentSettingPanel, - PostDiscussionPanel, - PostExcerptPanel, - PostLastRevisionPanel, - PostTaxonomiesPanel, store as editorStore, privateApis as editorPrivateApis, } from '@wordpress/editor'; @@ -95,11 +90,6 @@ export default function PagePanels() { ) } - - - - - ); } diff --git a/packages/edit-site/src/components/sidebar-edit-mode/template-panel/index.js b/packages/edit-site/src/components/sidebar-edit-mode/template-panel/index.js index f656858e11fa2..f0abc9aed09d0 100644 --- a/packages/edit-site/src/components/sidebar-edit-mode/template-panel/index.js +++ b/packages/edit-site/src/components/sidebar-edit-mode/template-panel/index.js @@ -4,11 +4,7 @@ import { useSelect, useDispatch } from '@wordpress/data'; import { PanelBody, PanelRow } from '@wordpress/components'; import { - PageAttributesPanel, - PostDiscussionPanel, - PostExcerptPanel, - PostLastRevisionPanel, - PostTaxonomiesPanel, + PluginDocumentSettingPanel, privateApis as editorPrivateApis, store as editorStore, } from '@wordpress/editor'; @@ -30,7 +26,6 @@ import { TEMPLATE_PART_POST_TYPE } from '../../../utils/constants'; import { unlock } from '../../../lock-unlock'; const { PostCardPanel } = unlock( editorPrivateApis ); -const { PatternOverridesPanel } = unlock( editorPrivateApis ); const { useHistory } = unlock( routerPrivateApis ); function TemplatesList( { availableTemplates, onSelect } ) { @@ -114,6 +109,7 @@ export default function TemplatePanel() { } /> + { availablePatterns?.length > 0 && ( ) } - - - - - - ); }