From 7b840cd43b2ec93d36b57485a84190246f9abd0a Mon Sep 17 00:00:00 2001 From: akasunil Date: Thu, 24 Oct 2024 18:38:30 +0530 Subject: [PATCH 1/2] Display reply input on border focus --- .../src/components/collab-sidebar/comments.js | 39 ++++--------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/packages/editor/src/components/collab-sidebar/comments.js b/packages/editor/src/components/collab-sidebar/comments.js index c0b4bd3d4dc38a..7b90d077e32207 100644 --- a/packages/editor/src/components/collab-sidebar/comments.js +++ b/packages/editor/src/components/collab-sidebar/comments.js @@ -97,15 +97,6 @@ export function Comments( { setActionState( { action: 'delete', id: thread.id } ); setIsConfirmDialogOpen( true ); } } - onReply={ - ! parentThread - ? () => - setActionState( { - action: 'reply', - id: thread.id, - } ) - : undefined - } status={ parentThread?.status ?? thread.status } /> - { 'reply' === actionState?.action && - thread.id === actionState?.id && ( + { 'edit' !== actionState?.action && + thread.id === blockCommentId && ( - setActionState( false ) - } /> @@ -292,9 +279,11 @@ function CommentForm( { onSubmit, onCancel, thread } ) { ? _x( 'Update', 'verb' ) : _x( 'Reply', 'Add reply comment' ) } - + { onCancel && ( + + ) } @@ -309,18 +298,10 @@ function CommentForm( { onSubmit, onCancel, thread } ) { * @param {Function} props.onResolve - The function to resolve the comment. * @param {Function} props.onEdit - The function to edit the comment. * @param {Function} props.onDelete - The function to delete the comment. - * @param {Function} props.onReply - The function to reply to the comment. * @param {string} props.status - The status of the comment. * @return {JSX.Element} The rendered comment header. */ -function CommentHeader( { - thread, - onResolve, - onEdit, - onDelete, - onReply, - status, -} ) { +function CommentHeader( { thread, onResolve, onEdit, onDelete, status } ) { const dateSettings = getDateSettings(); const [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp( 'root', @@ -337,10 +318,6 @@ function CommentHeader( { title: _x( 'Delete', 'Delete comment' ), onClick: onDelete, }, - { - title: _x( 'Reply', 'Reply on a comment' ), - onClick: onReply, - }, ]; const moreActions = actions.filter( ( item ) => item.onClick ); From ffd26bd5d3563cc41dd0c58a4a349ec9a7eab78e Mon Sep 17 00:00:00 2001 From: akasunil Date: Tue, 19 Nov 2024 18:02:38 +0530 Subject: [PATCH 2/2] Remove unneccessory changes --- packages/block-library/src/image/block.json | 9 +-------- packages/block-library/src/post-content/block.json | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/block-library/src/image/block.json b/packages/block-library/src/image/block.json index 26835df9e856cd..16e31217476026 100644 --- a/packages/block-library/src/image/block.json +++ b/packages/block-library/src/image/block.json @@ -4,14 +4,7 @@ "name": "core/image", "title": "Image", "category": "media", - "usesContext": [ - "allowResize", - "imageCrop", - "fixedHeight", - "postId", - "postType", - "queryId" - ], + "usesContext": [ "allowResize", "imageCrop", "fixedHeight", "postId", "postType", "queryId" ], "description": "Insert an image to make a visual statement.", "keywords": [ "img", "photo", "picture" ], "textdomain": "default", diff --git a/packages/block-library/src/post-content/block.json b/packages/block-library/src/post-content/block.json index e5d455b97a8a3d..ed9c47154b2f8e 100644 --- a/packages/block-library/src/post-content/block.json +++ b/packages/block-library/src/post-content/block.json @@ -69,4 +69,4 @@ }, "style": "wp-block-post-content", "editorStyle": "wp-block-post-content-editor" -} +} \ No newline at end of file