From 632763cc19cea829b6e2de061a391add65a82cde Mon Sep 17 00:00:00 2001 From: Ramon Date: Tue, 20 Jun 2023 11:54:03 +1000 Subject: [PATCH] Site editor sidebar: home template details (#51223) * Initial commit: - refactoring page details so that the styles and components can be used in templates - getting home template details in order * - displaying template areas - refactoring footer to show last modified in template and page details * - bare bones rest controller changes to return modified for `get_item` - linking up template areas * - passing footer class to row * - hooking into settings. * Refactoring input controls layout Tweaking CSS accordingly * Reverted prefix change to file that was not copied to GB * Removing last modified changes until the templates API supports it. We can reinstate these changes once it's merged (also adding the property to core-data/src/entity-types/wp-template-part.ts) * Showing the details pages for the index template Updating translations for entity types when saving * Fixed new unlock path * updating design of area buttons switching over site title editing to posts page title editing * Updated hover states of area buttons * This commit: - adds a last updated footer (if the modified property is available) - removes all controls and addes details * Don't need these * Reinstate post title and posts per page controls Reinstate allow comments control Abstract last modified footer * Updated copy * Update help text * SidebarNavigationItem instead of button for links to template parts from the home template * Wrap areas in ItemGroup * Remove bottom margin on last detail panel * Spacing * Large inputs * Leave border radius on inputs as 2px for now * Use NumberControl * Remove debounce Use spin custom controls on the number control component Update changelog * Restore since annotation change made in https://github.com/WordPress/gutenberg/pull/51362 --------- Co-authored-by: James Koster --- .../core-data/src/entity-types/wp-template.ts | 4 + packages/edit-site/CHANGELOG.md | 3 + .../index.js | 39 +++ .../style.scss | 5 + .../index.js | 40 ++++ ...r-navigation-screen-details-panel-label.js | 14 ++ ...bar-navigation-screen-details-panel-row.js | 29 +++ ...r-navigation-screen-details-panel-value.js | 14 ++ .../style.scss | 25 ++ .../sidebar-navigation-screen-page/index.js | 35 +-- .../page-details.js | 34 ++- .../sidebar-navigation-screen-page/style.scss | 19 +- .../home-template-details.js | 223 ++++++++++++++++++ .../index.js | 25 +- .../style.scss | 23 ++ .../sidebar-navigation-screen/style.scss | 22 ++ .../sidebar-navigation-subtitle/index.js | 5 - .../sidebar-navigation-subtitle/style.scss | 7 - packages/edit-site/src/style.scss | 3 +- .../hooks/use-is-dirty.js | 2 + 20 files changed, 487 insertions(+), 84 deletions(-) create mode 100644 packages/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js create mode 100644 packages/edit-site/src/components/sidebar-navigation-screen-details-footer/style.scss create mode 100644 packages/edit-site/src/components/sidebar-navigation-screen-details-panel/index.js create mode 100644 packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js create mode 100644 packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js create mode 100644 packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js create mode 100644 packages/edit-site/src/components/sidebar-navigation-screen-details-panel/style.scss create mode 100644 packages/edit-site/src/components/sidebar-navigation-screen-template/home-template-details.js delete mode 100644 packages/edit-site/src/components/sidebar-navigation-subtitle/index.js delete mode 100644 packages/edit-site/src/components/sidebar-navigation-subtitle/style.scss diff --git a/packages/core-data/src/entity-types/wp-template.ts b/packages/core-data/src/entity-types/wp-template.ts index 544476bbb7f36..ac6db09035f19 100644 --- a/packages/core-data/src/entity-types/wp-template.ts +++ b/packages/core-data/src/entity-types/wp-template.ts @@ -85,6 +85,10 @@ declare module './base-entity-records' { * Whether a template is a custom template. */ is_custom: Record< string, string >; + /** + * The date the template was last modified, in the site's timezone. + */ + modified: ContextualField< string, 'view' | 'edit', C >; } } } diff --git a/packages/edit-site/CHANGELOG.md b/packages/edit-site/CHANGELOG.md index 0b81a94ee6b1e..808554a1c5b1e 100644 --- a/packages/edit-site/CHANGELOG.md +++ b/packages/edit-site/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +### Enhancements +- Site editor sidebar: add home template details and controls [#51223](https://github.com/WordPress/gutenberg/pull/51223). + ## 5.12.0 (2023-06-07) ## 5.11.0 (2023-05-24) diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js new file mode 100644 index 0000000000000..4b5c4fb7de880 --- /dev/null +++ b/packages/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js @@ -0,0 +1,39 @@ +/** + * WordPress dependencies + */ +import { __, sprintf } from '@wordpress/i18n'; +import { humanTimeDiff } from '@wordpress/date'; +import { createInterpolateElement } from '@wordpress/element'; + +/** + * Internal dependencies + */ +import { + SidebarNavigationScreenDetailsPanelRow, + SidebarNavigationScreenDetailsPanelLabel, + SidebarNavigationScreenDetailsPanelValue, +} from '../sidebar-navigation-screen-details-panel'; + +export default function SidebarNavigationScreenDetailsFooter( { + lastModifiedDateTime, +} ) { + return ( + + + { __( 'Last modified' ) } + + + { createInterpolateElement( + sprintf( + /* translators: %s: is the relative time when the post was last modified. */ + __( '' ), + humanTimeDiff( lastModifiedDateTime ) + ), + { + time: + + ); +} diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-details-footer/style.scss b/packages/edit-site/src/components/sidebar-navigation-screen-details-footer/style.scss new file mode 100644 index 0000000000000..fcd20d64696eb --- /dev/null +++ b/packages/edit-site/src/components/sidebar-navigation-screen-details-footer/style.scss @@ -0,0 +1,5 @@ +.edit-site-sidebar-navigation-screen-details-footer { + padding-top: $grid-unit-10; + padding-bottom: $grid-unit-10; + padding-left: $grid-unit-20; +} diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/index.js new file mode 100644 index 0000000000000..f95ec59b4d80e --- /dev/null +++ b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/index.js @@ -0,0 +1,40 @@ +/** + * WordPress dependencies + */ +import { + __experimentalVStack as VStack, + __experimentalHeading as Heading, +} from '@wordpress/components'; + +/** + * Internal dependencies + */ +import SidebarNavigationScreenDetailsPanelLabel from './sidebar-navigation-screen-details-panel-label'; +import SidebarNavigationScreenDetailsPanelRow from './sidebar-navigation-screen-details-panel-row'; +import SidebarNavigationScreenDetailsPanelValue from './sidebar-navigation-screen-details-panel-value'; + +function SidebarNavigationScreenDetailsPanel( { title, children, spacing } ) { + return ( + + { title && ( + + { title } + + ) } + { children } + + ); +} + +export { + SidebarNavigationScreenDetailsPanel, + SidebarNavigationScreenDetailsPanelRow, + SidebarNavigationScreenDetailsPanelLabel, + SidebarNavigationScreenDetailsPanelValue, +}; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js new file mode 100644 index 0000000000000..157eecd557519 --- /dev/null +++ b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js @@ -0,0 +1,14 @@ +/** + * WordPress dependencies + */ +import { __experimentalText as Text } from '@wordpress/components'; + +export default function SidebarNavigationScreenDetailsPanelLabel( { + children, +} ) { + return ( + + { children } + + ); +} diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js new file mode 100644 index 0000000000000..541e654b0933e --- /dev/null +++ b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js @@ -0,0 +1,29 @@ +/** + * External dependencies + */ +import classnames from 'classnames'; + +/** + * WordPress dependencies + */ +import { __experimentalHStack as HStack } from '@wordpress/components'; + +export default function SidebarNavigationScreenDetailsPanelRow( { + label, + children, + className, +} ) { + return ( + + { children } + + ); +} diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js new file mode 100644 index 0000000000000..80e8ba8cf1d53 --- /dev/null +++ b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js @@ -0,0 +1,14 @@ +/** + * WordPress dependencies + */ +import { __experimentalText as Text } from '@wordpress/components'; + +export default function SidebarNavigationScreenDetailsPanelValue( { + children, +} ) { + return ( + + { children } + + ); +} diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/style.scss b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/style.scss new file mode 100644 index 0000000000000..e94894c0d6ea3 --- /dev/null +++ b/packages/edit-site/src/components/sidebar-navigation-screen-details-panel/style.scss @@ -0,0 +1,25 @@ +.edit-site-sidebar-navigation-details-screen-panel { + margin-bottom: $grid-unit-30; + + &:last-of-type { + margin-bottom: 0; + } + + .edit-site-sidebar-navigation-details-screen-panel__heading { + color: $gray-400; + text-transform: uppercase; + font-weight: 500; + font-size: 11px; + padding: 0; + margin-bottom: 0; + } +} + +.edit-site-sidebar-navigation-details-screen-panel__label.edit-site-sidebar-navigation-details-screen-panel__label { + color: $gray-600; + width: 100px; +} + +.edit-site-sidebar-navigation-details-screen-panel__value.edit-site-sidebar-navigation-details-screen-panel__value { + color: $gray-200; +} diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-page/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-page/index.js index 536da766b668c..55ca9b646f423 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-page/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-page/index.js @@ -1,21 +1,17 @@ /** * WordPress dependencies */ -import { __, sprintf } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { useDispatch, useSelect } from '@wordpress/data'; import { __experimentalUseNavigator as useNavigator, __experimentalVStack as VStack, ExternalLink, __experimentalTruncate as Truncate, - __experimentalHStack as HStack, - __experimentalText as Text, } from '@wordpress/components'; import { store as coreStore, useEntityRecord } from '@wordpress/core-data'; import { decodeEntities } from '@wordpress/html-entities'; import { pencil } from '@wordpress/icons'; -import { humanTimeDiff } from '@wordpress/date'; -import { createInterpolateElement } from '@wordpress/element'; import { __unstableStripHTML as stripHTML } from '@wordpress/dom'; import { escapeAttribute } from '@wordpress/escape-html'; @@ -26,9 +22,9 @@ import SidebarNavigationScreen from '../sidebar-navigation-screen'; import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; import SidebarButton from '../sidebar-button'; -import SidebarNavigationSubtitle from '../sidebar-navigation-subtitle'; import PageDetails from './page-details'; import PageActions from '../page-actions'; +import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer'; export default function SidebarNavigationScreenPage() { const navigator = useNavigator(); @@ -121,35 +117,14 @@ export default function SidebarNavigationScreenPage() { { stripHTML( record.excerpt.rendered ) } ) } - - { __( 'Details' ) } - } footer={ !! record?.modified && ( - - - { __( 'Last modified' ) } - - - { createInterpolateElement( - sprintf( - /* translators: %s: is the relative time when the post was last modified. */ - __( '' ), - humanTimeDiff( record.modified ) - ), - { - time: - + ) } /> diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-page/page-details.js b/packages/edit-site/src/components/sidebar-navigation-screen-page/page-details.js index 290ae4907f9a9..56a94dc64a2a9 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-page/page-details.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-page/page-details.js @@ -2,12 +2,7 @@ * WordPress dependencies */ import { __, _x, sprintf } from '@wordpress/i18n'; -import { - __experimentalHStack as HStack, - __experimentalText as Text, - __experimentalVStack as VStack, - __experimentalTruncate as Truncate, -} from '@wordpress/components'; +import { __experimentalTruncate as Truncate } from '@wordpress/components'; import { count as wordCount } from '@wordpress/wordcount'; import { useSelect } from '@wordpress/data'; import { decodeEntities } from '@wordpress/html-entities'; @@ -19,6 +14,12 @@ import { store as coreStore, useEntityRecord } from '@wordpress/core-data'; import StatusLabel from './status-label'; import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; +import { + SidebarNavigationScreenDetailsPanel, + SidebarNavigationScreenDetailsPanelRow, + SidebarNavigationScreenDetailsPanelLabel, + SidebarNavigationScreenDetailsPanelValue, +} from '../sidebar-navigation-screen-details-panel'; // Taken from packages/editor/src/components/time-to-read/index.js. const AVERAGE_READING_RATE = 189; @@ -138,26 +139,21 @@ export default function PageDetails( { id } ) { [ record?.parent ] ); return ( - + { getPageDetails( { parentTitle, templateTitle, ...record, } ).map( ( { label, value } ) => ( - - + + { label } - - + + { value } - - + + ) ) } - + ); } diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-page/style.scss b/packages/edit-site/src/components/sidebar-navigation-screen-page/style.scss index c58e9f0939246..66efe31726e8b 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-page/style.scss +++ b/packages/edit-site/src/components/sidebar-navigation-screen-page/style.scss @@ -30,6 +30,7 @@ .edit-site-sidebar-navigation-screen-page__excerpt { font-size: $helptext-font-size; + margin-bottom: $grid-unit-30; } .edit-site-sidebar-navigation-screen-page__modified { @@ -60,21 +61,3 @@ fill: $alert-green; } } - -.edit-site-sidebar-navigation-screen-page__footer { - padding-top: $grid-unit-10; - padding-bottom: $grid-unit-10; - padding-left: $grid-unit-20; -} - -.edit-site-sidebar-navigation-screen-page__details { - .edit-site-sidebar-navigation-screen-page__details-label { - color: $gray-600; - width: 100px; - } - - .edit-site-sidebar-navigation-screen-page__details-value.edit-site-sidebar-navigation-screen-page__details-value { - color: $gray-200; - } -} - diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-template/home-template-details.js b/packages/edit-site/src/components/sidebar-navigation-screen-template/home-template-details.js new file mode 100644 index 0000000000000..51c3d7e5f78e9 --- /dev/null +++ b/packages/edit-site/src/components/sidebar-navigation-screen-template/home-template-details.js @@ -0,0 +1,223 @@ +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; +import { debounce } from '@wordpress/compose'; +import { useSelect, useDispatch } from '@wordpress/data'; +import { store as coreStore } from '@wordpress/core-data'; +import { + CheckboxControl, + __experimentalUseNavigator as useNavigator, + __experimentalInputControl as InputControl, + __experimentalNumberControl as NumberControl, + __experimentalTruncate as Truncate, + __experimentalItemGroup as ItemGroup, +} from '@wordpress/components'; +import { header, footer, layout } from '@wordpress/icons'; +import { useMemo, useState, useEffect } from '@wordpress/element'; +import { decodeEntities } from '@wordpress/html-entities'; + +/** + * Internal dependencies + */ +import { + SidebarNavigationScreenDetailsPanel, + SidebarNavigationScreenDetailsPanelRow, +} from '../sidebar-navigation-screen-details-panel'; +import { unlock } from '../../lock-unlock'; +import { store as editSiteStore } from '../../store'; +import { useLink } from '../routes/link'; +import SidebarNavigationItem from '../sidebar-navigation-item'; + +const EMPTY_OBJECT = {}; + +function TemplateAreaButton( { postId, icon, title } ) { + const icons = { + header, + footer, + }; + const linkInfo = useLink( { + postType: 'wp_template_part', + postId, + } ); + + return ( + + + { decodeEntities( title ) } + + + ); +} + +export default function HomeTemplateDetails() { + const navigator = useNavigator(); + const { + params: { postType, postId }, + } = navigator; + const { editEntityRecord } = useDispatch( coreStore ); + + const { + allowCommentsOnNewPosts, + templatePartAreas, + postsPerPage, + postsPageTitle, + postsPageId, + templateRecord, + } = useSelect( + ( select ) => { + const { getEntityRecord } = select( coreStore ); + const siteSettings = getEntityRecord( 'root', 'site' ); + const { getSettings } = unlock( select( editSiteStore ) ); + const siteEditorSettings = getSettings(); + const _templateRecord = + select( coreStore ).getEditedEntityRecord( + 'postType', + postType, + postId + ) || EMPTY_OBJECT; + const _postsPageRecord = siteSettings?.page_for_posts + ? select( coreStore ).getEntityRecord( + 'postType', + 'page', + siteSettings?.page_for_posts + ) + : EMPTY_OBJECT; + + return { + templateRecord: _templateRecord, + allowCommentsOnNewPosts: + siteSettings?.default_comment_status === 'open', + postsPageTitle: _postsPageRecord?.title?.rendered, + postsPageId: _postsPageRecord?.id, + postsPerPage: siteSettings?.posts_per_page, + templatePartAreas: siteEditorSettings?.defaultTemplatePartAreas, + }; + }, + [ postType, postId ] + ); + + const [ commentsOnNewPostsValue, setCommentsOnNewPostsValue ] = + useState( '' ); + const [ postsCountValue, setPostsCountValue ] = useState( 1 ); + const [ postsPageTitleValue, setPostsPageTitleValue ] = useState( '' ); + + useEffect( () => { + setCommentsOnNewPostsValue( allowCommentsOnNewPosts ); + setPostsPageTitleValue( postsPageTitle ); + setPostsCountValue( postsPerPage ); + }, [ postsPageTitle, allowCommentsOnNewPosts, postsPerPage ] ); + + const templateAreas = useMemo( () => { + return templateRecord?.blocks && templatePartAreas + ? templateRecord.blocks + .filter( ( { name } ) => name === 'core/template-part' ) + .map( ( { attributes } ) => ( { + ...templatePartAreas?.find( + ( { area } ) => area === attributes?.tagName + ), + ...attributes, + } ) ) + : []; + }, [ templateRecord?.blocks, templatePartAreas ] ); + + const setAllowCommentsOnNewPosts = ( newValue ) => { + setCommentsOnNewPostsValue( newValue ); + editEntityRecord( 'root', 'site', undefined, { + default_comment_status: newValue ? 'open' : null, + } ); + }; + + const setPostsPageTitle = ( newValue ) => { + setPostsPageTitleValue( newValue ); + editEntityRecord( 'postType', 'page', postsPageId, { + title: newValue, + } ); + }; + + const setPostsPerPage = ( newValue ) => { + setPostsCountValue( newValue ); + editEntityRecord( 'root', 'site', undefined, { + posts_per_page: newValue, + } ); + }; + + return ( + <> + + { postsPageId && ( + + + + ) } + + + + + + + + + + + + + { templateAreas.map( ( { label, icon, theme, slug } ) => ( + + + + ) ) } + + + + ); +} diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js index ecc07deceed35..3b1bdf71fa99f 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js @@ -9,7 +9,6 @@ import { Icon, } from '@wordpress/components'; import { store as coreStore } from '@wordpress/core-data'; - /** * Internal dependencies */ @@ -20,8 +19,10 @@ import { store as editSiteStore } from '../../store'; import SidebarButton from '../sidebar-button'; import { useAddedBy } from '../list/added-by'; import TemplateActions from '../template-actions'; +import HomeTemplateDetails from './home-template-details'; +import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer'; -function useTemplateTitleAndDescription( postType, postId ) { +function useTemplateDetails( postType, postId ) { const { getDescription, getTitle, record } = useEditedEntityRecord( postType, postId @@ -42,6 +43,20 @@ function useTemplateTitleAndDescription( postType, postId ) { ); } + let content = null; + if ( record?.slug === 'home' || record?.slug === 'index' ) { + content = ; + } + + let footer = null; + if ( !! record?.modified ) { + footer = ( + + ); + } + const description = ( <> { descriptionText } @@ -74,7 +89,7 @@ function useTemplateTitleAndDescription( postType, postId ) { ); - return { title, description }; + return { title, description, content, footer }; } export default function SidebarNavigationScreenTemplate() { @@ -83,7 +98,7 @@ export default function SidebarNavigationScreenTemplate() { params: { postType, postId }, } = navigator; const { setCanvasMode } = unlock( useDispatch( editSiteStore ) ); - const { title, description } = useTemplateTitleAndDescription( + const { title, content, description, footer } = useTemplateDetails( postType, postId ); @@ -109,6 +124,8 @@ export default function SidebarNavigationScreenTemplate() { } description={ description } + content={ content } + footer={ footer } /> ); } diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-template/style.scss b/packages/edit-site/src/components/sidebar-navigation-screen-template/style.scss index e86c137a574d5..8b1cf5bbf456c 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-template/style.scss +++ b/packages/edit-site/src/components/sidebar-navigation-screen-template/style.scss @@ -23,3 +23,26 @@ } } } + +.edit-site-sidebar-navigation-screen-template__template-area-button { + color: $white; + display: flex; + align-items: center; + width: 100%; + flex-wrap: nowrap; + border-radius: 4px; + &:hover, + &:focus { + background: $gray-800; + color: $white; + } +} + +.edit-site-sidebar-navigation-screen-template__template-area-label-text { + margin: 0 $grid-unit-20 0 $grid-unit-05; + flex-grow: 1; +} + +.edit-site-sidebar-navigation-screen-template__template-icon { + display: flex; +} diff --git a/packages/edit-site/src/components/sidebar-navigation-screen/style.scss b/packages/edit-site/src/components/sidebar-navigation-screen/style.scss index 9b54e06ca77e7..417dc7d6b1f05 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen/style.scss +++ b/packages/edit-site/src/components/sidebar-navigation-screen/style.scss @@ -97,3 +97,25 @@ border-top: 1px solid $gray-800; } +/* In general style overrides are discouraged. + * This is a temporary solution to override the InputControl component's styles. + * The `Theme` component will potentially be the more appropriate approach + * once that component is stabilized. + * See: packages/components/src/theme + */ +.edit-site-sidebar-navigation-screen__input-control { + width: 100%; + .components-input-control__container { + background: transparent; + } + .components-input-control__input { + color: $gray-200 !important; + background: $gray-800 !important; + } + .components-input-control__backdrop { + border: 4px !important; + } + .components-base-control__help { + color: $gray-600; + } +} diff --git a/packages/edit-site/src/components/sidebar-navigation-subtitle/index.js b/packages/edit-site/src/components/sidebar-navigation-subtitle/index.js deleted file mode 100644 index 2a20f31ce7fb4..0000000000000 --- a/packages/edit-site/src/components/sidebar-navigation-subtitle/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export default function SidebarNavigationSubtitle( { children } ) { - return ( -

{ children }

- ); -} diff --git a/packages/edit-site/src/components/sidebar-navigation-subtitle/style.scss b/packages/edit-site/src/components/sidebar-navigation-subtitle/style.scss deleted file mode 100644 index b7ff9faba49f3..0000000000000 --- a/packages/edit-site/src/components/sidebar-navigation-subtitle/style.scss +++ /dev/null @@ -1,7 +0,0 @@ -.edit-site-sidebar-navigation-subtitle { - color: $gray-400; - text-transform: uppercase; - font-weight: 500; - font-size: 11px; - padding: $grid-unit-10 0; -} diff --git a/packages/edit-site/src/style.scss b/packages/edit-site/src/style.scss index 916d829153244..5f434bb84f8f7 100644 --- a/packages/edit-site/src/style.scss +++ b/packages/edit-site/src/style.scss @@ -29,11 +29,12 @@ @import "./components/sidebar-button/style.scss"; @import "./components/sidebar-navigation-item/style.scss"; @import "./components/sidebar-navigation-screen/style.scss"; +@import "./components/sidebar-navigation-screen-details-footer/style.scss"; @import "./components/sidebar-navigation-screen-global-styles/style.scss"; @import "./components/sidebar-navigation-screen-navigation-menu/style.scss"; @import "./components/sidebar-navigation-screen-page/style.scss"; +@import "components/sidebar-navigation-screen-details-panel/style.scss"; @import "./components/sidebar-navigation-screen-template/style.scss"; -@import "./components/sidebar-navigation-subtitle/style.scss"; @import "./components/site-hub/style.scss"; @import "./components/sidebar-navigation-screen-navigation-menus/style.scss"; @import "./components/site-icon/style.scss"; diff --git a/packages/editor/src/components/entities-saved-states/hooks/use-is-dirty.js b/packages/editor/src/components/entities-saved-states/hooks/use-is-dirty.js index e1adc68c7a82a..7906dd800c661 100644 --- a/packages/editor/src/components/entities-saved-states/hooks/use-is-dirty.js +++ b/packages/editor/src/components/entities-saved-states/hooks/use-is-dirty.js @@ -13,6 +13,8 @@ const TRANSLATED_SITE_PROPERTIES = { site_icon: __( 'Icon' ), show_on_front: __( 'Show on front' ), page_on_front: __( 'Page on front' ), + posts_per_page: __( 'Maximum posts per page' ), + default_comment_status: __( 'Allow comments on new posts' ), }; export const useIsDirty = () => {