From 5b1126601f000e73f86864283143070d6a0d684b Mon Sep 17 00:00:00 2001 From: Ramon Date: Thu, 8 Feb 2024 11:33:32 +1100 Subject: [PATCH] This commit: (#58706) - The individual global style changes are shown below the checkbox, typography $gray-700 color and $helptext-font-size. - The individual items next to the checkbox are no longer bold, they are regular text. - The wording has been changed for pages being edited, to avoid the widow. Instead of "The following content has been modified." it's "The following has been modified. Co-authored-by: ramonjd Co-authored-by: jasmussen --- .../entity-record-item.js | 5 +---- .../entities-saved-states/entity-type-list.js | 16 +++++++------- .../components/entities-saved-states/index.js | 21 +++++++++++++++---- .../entities-saved-states/style.scss | 5 +++++ 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/packages/editor/src/components/entities-saved-states/entity-record-item.js b/packages/editor/src/components/entities-saved-states/entity-record-item.js index 70ca2b83c4dfdf..15bdc8c2f22842 100644 --- a/packages/editor/src/components/entities-saved-states/entity-record-item.js +++ b/packages/editor/src/components/entities-saved-states/entity-record-item.js @@ -39,10 +39,7 @@ export default function EntityRecordItem( { record, checked, onChange } ) { - { decodeEntities( entityRecordTitle ) || - __( 'Untitled' ) } - + decodeEntities( entityRecordTitle ) || __( 'Untitled' ) } checked={ checked } onChange={ onChange } diff --git a/packages/editor/src/components/entities-saved-states/entity-type-list.js b/packages/editor/src/components/entities-saved-states/entity-type-list.js index cb050a370c4e34..ed2f4aeacfd763 100644 --- a/packages/editor/src/components/entities-saved-states/entity-type-list.js +++ b/packages/editor/src/components/entities-saved-states/entity-type-list.js @@ -30,7 +30,7 @@ function getEntityDescription( entity, count ) { ); case 'page': case 'post': - return __( 'The following content has been modified.' ); + return __( 'The following has been modified.' ); } } @@ -55,18 +55,15 @@ function GlobalStylesDescription( { record } ) { } ); return globalStylesChanges.length ? ( - <> -

- { __( 'Changes made to:' ) } -

- { globalStylesChanges.join( ', ' ) }. - + + { globalStylesChanges.join( ', ' ) }. + ) : null; } function EntityDescription( { record, count } ) { if ( 'globalStyles' === record?.name ) { - return ; + return null; } const description = getEntityDescription( record?.name, count ); return description ? { description } : null; @@ -117,6 +114,9 @@ export default function EntityTypeList( { /> ); } ) } + { 'globalStyles' === firstRecord?.name && ( + + ) } ); } diff --git a/packages/editor/src/components/entities-saved-states/index.js b/packages/editor/src/components/entities-saved-states/index.js index 8e531ce5801017..413a27d27dfd39 100644 --- a/packages/editor/src/components/entities-saved-states/index.js +++ b/packages/editor/src/components/entities-saved-states/index.js @@ -2,9 +2,13 @@ * WordPress dependencies */ import { Button, Flex, FlexItem } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; +import { __, _n, sprintf } from '@wordpress/i18n'; import { useSelect, useDispatch } from '@wordpress/data'; -import { useCallback, useRef } from '@wordpress/element'; +import { + useCallback, + useRef, + createInterpolateElement, +} from '@wordpress/element'; import { store as coreStore } from '@wordpress/core-data'; import { store as blockEditorStore } from '@wordpress/block-editor'; import { __experimentalUseDialog as useDialog } from '@wordpress/compose'; @@ -215,8 +219,17 @@ export function EntitiesSavedStatesExtensible( { { additionalPrompt }

{ isDirty - ? __( - 'The following changes have been made to your site, templates, and content.' + ? createInterpolateElement( + sprintf( + /* translators: %d: number of site changes waiting to be saved. */ + _n( + 'There is %d site change waiting to be saved.', + 'There are %d site changes waiting to be saved.', + sortedPartitionedSavables.length + ), + sortedPartitionedSavables.length + ), + { strong: } ) : __( 'Select the items you want to save.' ) }

diff --git a/packages/editor/src/components/entities-saved-states/style.scss b/packages/editor/src/components/entities-saved-states/style.scss index 6fb981c22f9600..15878a14ff978e 100644 --- a/packages/editor/src/components/entities-saved-states/style.scss +++ b/packages/editor/src/components/entities-saved-states/style.scss @@ -19,3 +19,8 @@ .entities-saved-states__description-heading { font-size: $default-font-size; } + +.entities-saved-states__change-summary { + color: $gray-700; + font-size: $helptext-font-size; +}