-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Inline comment experimental flag #60622
Open
poojabhimani12
wants to merge
204
commits into
WordPress:trunk
Choose a base branch
from
poojabhimani12:try/inline-block-commenting
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,127
−0
Open
Changes from all commits
Commits
Show all changes
204 commits
Select commit
Hold shift + click to select a range
200bd36
Add Inline comment experimental flag
poojabhimani12 08d520f
Experimental block commenting
akashdhawade1991 4cddd7b
Fix comment display issue
akashdhawade1991 4fce70c
Fix comment button text issue
akashdhawade1991 ead6f64
Merge pull request #1 from akashdhawade2005/try/inline-block-commenting
poojabhimani12 5225f4d
Merge branch 'trunk' into try/inline-block-commenting
poojabhimani12 89930f1
Sync with trunk
akashdhawade1991 48ddd17
Merge pull request #2 from akashdhawade2005/try/inline-block-commenting
poojabhimani12 694c2ea
Update editor-settings.php
poojabhimani12 5be0043
Update experiments-page.php
poojabhimani12 682a21b
Fix: Broken README.md link for block library
akashdhawade1991 f4d866e
Block collab
akashdhawade1991 768d87d
Address pipeline issues
akashdhawade1991 d82ecc2
Address pipeline issues
akashdhawade1991 0cea02c
Merge pull request #3 from akashdhawade2005/try/inline-block-commenting
poojabhimani12 871c745
Added UI Design changes for Comment Popover section
juhibhatt19 82a01f4
Collab sidebar
akashdhawade1991 db64f73
Collab sidebar
akashdhawade1991 94c9d67
Fix sidebar comment icon issue
akashdhawade1991 ecd5c98
Merge pull request #6 from akashdhawade2005/try/inline-block-commenting
poojabhimani12 6d3eb6d
resolved conflicts
poojabhimani12 6132e5e
resolved conflicts
poojabhimani12 b9e182a
Resolved conflicts & added sidebar UI changes
juhibhatt19 618254a
Merge pull request #7 from juhibhatt19/try/inline-block-commenting
poojabhimani12 10c9ed0
Update comment functionality and reformating code
MD-sunilprajapati 271895a
remove style import
MD-sunilprajapati f2b7114
Merge pull request #8 from MD-sunilprajapati/try/inline-block-commenting
poojabhimani12 5e0890c
revert the changes
MD-sunilprajapati 031e8d5
resolved conflicts
poojabhimani12 6b0c3b3
Merge branch 'poojabhimani12:try/inline-block-commenting' into try/in…
MD-sunilprajapati d2d6215
Adjust spacing between icons
MD-sunilprajapati cbee86f
Merge pull request #9 from MD-sunilprajapati/try/inline-block-commenting
poojabhimani12 b36c2ab
resolved conflicts
poojabhimani12 b7b1ba4
Fix linting errors
MD-sunilprajapati 6c0862d
Merge pull request #10 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 77ee009
Add experimental condition
MD-sunilprajapati a8ea60e
Show sidebar on zero comments
MD-sunilprajapati ec302ff
Add package lock
MD-sunilprajapati f002607
Merge pull request #11 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 fdc44a3
Update comment
MD-sunilprajapati bb2c0bd
Merge pull request #12 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 e6ac0b4
Address feedbacks
MD-sunilprajapati 9447911
Use useEntityProp
MD-sunilprajapati bf84cc4
Update sidebar content on new comment
MD-sunilprajapati 57ed39a
Remove unneccessory changes
MD-sunilprajapati b9668fd
Relocate border styles for commented blocks
MD-sunilprajapati 6628689
Merge pull request #13 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 1d81922
set initial state instead of mount effect for block class
MD-sunilprajapati 87fe4f9
Fix linting errors
MD-sunilprajapati 139135d
Add dependencies
MD-sunilprajapati 20f2bd3
Merge pull request #14 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 2df0bdb
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 515a592
Update package lock
MD-sunilprajapati 08fd837
Merge pull request #15 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 251ae5f
Implement inline commenting
MD-sunilprajapati e747430
Update doc for collabboard component
MD-sunilprajapati b7a5bd7
Highlight inline text with comment
MD-sunilprajapati 16d2186
Remove comments and console logs
MD-sunilprajapati 877f090
Merge pull request #16 from MD-sunilprajapati/enabled-inline-commenting
poojabhimani12 1ce0191
made changes for collab.php file and removed block border color
rishishah-multidots 1a677d8
Merge pull request #17 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 d67d2b1
Resolved conflicts
poojabhimani12 e0cb8b5
Merge branch 'try/inline-block-commenting' of https://github.com/pooj…
poojabhimani12 9004004
Update editor-settings.php
poojabhimani12 d23a0a6
made changes for block comment feature
rishishah-multidots cf605d5
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots f115c3b
made changes for code_sniffer error on rest_api file
rishishah-multidots f748ad9
made changes for code_sniffer error on rest_api file
rishishah-multidots 59e96c4
remove readme.md file from collab folder
rishishah-multidots 18e5081
remove static email for comment author
rishishah-multidots c9f4964
Merge pull request #18 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 1ed6d54
added edit/delete comment from sidebar feature
rishishah-multidots 84733c5
resolve PHP coding standards errors
rishishah-multidots 2d5d162
resolve PHP coding standards errors
rishishah-multidots e68cdcc
Merge pull request #19 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 8042e22
Resolved Conflicts
poojabhimani12 ceb188c
Add idenrifier to collab sidebar
MD-sunilprajapati 575361c
Relocate Add Comment button below in more action popover
MD-sunilprajapati 8c45982
Update comment button action to focus new comment form in sidebar on …
MD-sunilprajapati a2345e8
Merge pull request #20 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 2004c04
Update experimental field lable for commenting functionality
MD-sunilprajapati 8ac8328
Revert format library changes
MD-sunilprajapati 868c095
made changes as per Github
rishishah-multidots ab73559
Refactor collab sidebar
MD-sunilprajapati d5df8cc
Refactor collab sidebar
MD-sunilprajapati 533c5d4
Remove unneccessory snapshot tests
MD-sunilprajapati c0a5dcd
Remove collab board component
MD-sunilprajapati 56e475b
Fix linting errors
MD-sunilprajapati 9de8c69
Merge pull request #21 from MD-sunilprajapati/collab-sidebar-update
poojabhimani12 4104869
made changes as per Github
rishishah-multidots b8b0292
made changes as per github feedback
rishishah-multidots 6996e5f
Merge pull request #22 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 0321430
comment board hide/show on Add comment and cancel button
rishishah-multidots 3bf3c4c
Merge pull request #23 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 c66fbcd
Revert format library changes
MD-sunilprajapati 751d727
Sync with trunk and resolved conflicts
MD-sunilprajapati 9a42d64
Merge pull request #24 from MD-sunilprajapati/address-feedbacks
poojabhimani12 68d5e1c
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 1f5a2c2
Focus comment board on comment icon click
MD-sunilprajapati 6477102
Address feedback and create smaller component
MD-sunilprajapati 66832a7
Create comment header component
MD-sunilprajapati 5c70d90
Fix linting errors
MD-sunilprajapati cc28c6a
Remove logs
MD-sunilprajapati 951d8b4
Fix linting errors
MD-sunilprajapati b0ad9d5
Merge pull request #25 from MD-sunilprajapati/refactor-collab-sidebar
poojabhimani12 a5e12e1
made changes as per PR feedback
rishishah-multidots cf59158
made changes as per PR feedback
rishishah-multidots 6cfdb29
resolve style.scss conflict
rishishah-multidots 465b438
Merge pull request #26 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 c9d50d8
Refactor collab components
MD-sunilprajapati fd6f327
Implement comment reload on comment crud operation
MD-sunilprajapati 15c85e0
remove string literals for data stores
MD-sunilprajapati c7be827
remove package json file changes
MD-sunilprajapati bd1a7ce
Add docs for components
MD-sunilprajapati 19dfab8
Merge pull request #27 from MD-sunilprajapati/refactor-inline-commenting
poojabhimani12 48ee928
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 8fa3f85
remove revert function to show comments in sidebar and show comments …
rishishah-multidots 5f0ae80
remove revert function to show comments in sidebar and show comments …
rishishah-multidots 69d1878
Merge pull request #28 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 d6e01f3
Remove string literels for gutenberg stores
MD-sunilprajapati 668671b
Merge pull request #29 from MD-sunilprajapati/refactor-inline-comment…
poojabhimani12 ee6fe75
Sync with trunk and resolved conflicts
MD-sunilprajapati de2cd8f
Sync with trunk
MD-sunilprajapati 8e6da19
Addressed feedback of collab sidebar component
MD-sunilprajapati 90ba459
Merge pull request #30 from MD-sunilprajapati/collab-sidebar-feedbacks
poojabhimani12 e2fd75a
made changes for feedback
rishishah-multidots aad19d0
Merge pull request #31 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 6f03c48
Refresh state on every new comment
MD-sunilprajapati 2b057cc
Sync file with trunk
MD-sunilprajapati 59caf1c
made changes for css property
rishishah-multidots efa41ac
Merge pull request #32 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 4ee210d
code cleanup
MD-sunilprajapati 38bea58
Merge pull request #33 from MD-sunilprajapati/collab-sidebar-cleanup
poojabhimani12 609cad6
Merge branch 'trunk' of gutenberg
MD-sunilprajapati 8a54986
Update classes name and remove unwanted classes
minaldiwan 2fd78b0
Merge pull request #35 from minaldiwan/try/inline-block-commenting
poojabhimani12 f236a42
made changes for translators and context
rishishah-multidots b3c879d
made changes for translators and context
rishishah-multidots bc308e9
Merge pull request #36 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 11cf1f1
use entity record function instead api fetch
MD-sunilprajapati 22c189a
Sync with origin and resolved coflicts
MD-sunilprajapati 33cd398
small fix for translator string
rishishah-multidots 211944c
Merge pull request #37 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 a4abbec
Fix linting errors
MD-sunilprajapati 5c99dcc
Merge branch 'try/inline-block-commenting' of gutenberg into collab-c…
MD-sunilprajapati 50e8101
fix comment edit issue
MD-sunilprajapati ce7f7bc
Sync with origin and resolved coflicts
MD-sunilprajapati b0c5960
Fix linting errors
MD-sunilprajapati f768b4a
Merge pull request #34 from MD-sunilprajapati/collab-comment-cleanup
poojabhimani12 92870c4
pipeline error fixes
rishishah-multidots 37fa922
pipeline error fixes and resolve conflicts
rishishah-multidots 4d6841a
Merge pull request #38 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 71f7a39
Fix linting errors
MD-sunilprajapati 6f73a0b
Merge pull request #39 from MD-sunilprajapati/code-cleanup
poojabhimani12 edab788
Fix style linting issue
MD-sunilprajapati 6e528a1
Fix useMemo dependacy
MD-sunilprajapati b129367
Merge pull request #40 from MD-sunilprajapati/fix-linting-errors
poojabhimani12 8d17f22
Remove styling for input and textarea box as per core team feedback
minaldiwan fd4c045
Merge pull request #41 from minaldiwan/try/inline-block-commenting
poojabhimani12 4d3eeb1
added error message for add comment on draft mode or duplicate comment
rishishah-multidots f06340a
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots 6b8027a
resolve eslint error and update blockEditorStore feature
rishishah-multidots 06c8526
revert package files as per trunk
rishishah-multidots e1d4396
revert package files as per main branch
rishishah-multidots c78f981
Merge pull request #42 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 da72b79
Addressed feedback
MD-sunilprajapati d7bca6e
cleanup code
MD-sunilprajapati 68d203e
Update context for edit button
MD-sunilprajapati b296d2d
Merge pull request #43 from MD-sunilprajapati/address-feedback
poojabhimani12 bddceeb
feedback changes
rishishah-multidots c5094a0
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots a23241a
feedback changes for comment rest API
rishishah-multidots 9548565
Merge pull request #44 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 06e840f
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 3883a11
comment rest api function in condition
rishishah-multidots 334daf2
Merge pull request #45 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 b028876
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 cd63f6a
Fix reply comment issue
MD-sunilprajapati 9b12661
Merge pull request #50 from MD-sunilprajapati/fix-reply-comment-issue
poojabhimani12 f287eff
Remove comment icon
MD-sunilprajapati 16ebd4c
Merge pull request #51 from MD-sunilprajapati/remove-icon
poojabhimani12 7aa5508
update comment icon code for menu and toolbar group
rishishah-multidots e55109f
resolve eslint errors
rishishah-multidots f66d825
revert package-lock file
rishishah-multidots 7ff9a79
Merge pull request #59 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 d01c693
resolve trunk conflicts
rishishah-multidots 2caf2d1
Merge pull request #60 from rishishah-multidots/sync-with-trunk
poojabhimani12 6bda66d
sync rest-api file with api PR
rishishah-multidots 64b1b31
sync rest-api file with api PR
rishishah-multidots 31ea3b5
Merge pull request #61 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 bdf982f
remove autop package and update code according to it
rishishah-multidots c5a53a2
remove console statement
rishishah-multidots c0aee07
remove linting error
rishishah-multidots 1a251ba
remove tag replace code from add/edit/fetch comment
rishishah-multidots 452181d
remove tag replace code from add/edit/fetch comment
rishishah-multidots 898a924
revert rahHRML tag for render comment in sidebar
rishishah-multidots 11d6693
Merge pull request #64 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 0326444
resolve conflict
rishishah-multidots bf20345
Merge pull request #65 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 c419ce4
Merge branch 'trunk' of github.com:MD-sunilprajapati/gutenberg into s…
MD-sunilprajapati 667163e
Remove unneccessory changes
MD-sunilprajapati 25364d8
Merge pull request #67 from MD-sunilprajapati/sync-with-trunk
poojabhimani12 5a53245
Add backport changelog
MD-sunilprajapati f4dd385
Merge pull request #68 from MD-sunilprajapati/backport-log
poojabhimani12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
https://github.com/WordPress/wordpress-develop/pull/7488 | ||
|
||
* https://github.com/WordPress/gutenberg/pull/60622 | ||
* https://github.com/WordPress/gutenberg/pull/65181 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
https://github.com/WordPress/wordpress-develop/pull/7498 | ||
|
||
* https://github.com/WordPress/gutenberg/pull/60622 | ||
* https://github.com/WordPress/gutenberg/pull/65181 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/block-editor/src/components/collab/block-comment-icon-slot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { createSlotFill } from '@wordpress/components'; | ||
|
||
const { Fill: __unstableCommentIconFill, Slot } = createSlotFill( | ||
'__unstableCommentIconFill' | ||
); | ||
|
||
__unstableCommentIconFill.Slot = Slot; | ||
|
||
export default __unstableCommentIconFill; |
12 changes: 12 additions & 0 deletions
12
packages/block-editor/src/components/collab/block-comment-icon-toolbar-slot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { createSlotFill } from '@wordpress/components'; | ||
|
||
const { Fill: __unstableCommentIconToolbarFill, Slot } = createSlotFill( | ||
'__unstableCommentIconToolbarFill' | ||
); | ||
|
||
__unstableCommentIconToolbarFill.Slot = Slot; | ||
|
||
export default __unstableCommentIconToolbarFill; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
packages/editor/src/components/collab-sidebar/add-comment.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __, _x } from '@wordpress/i18n'; | ||
import { useSelect } from '@wordpress/data'; | ||
import { useState, useEffect } from '@wordpress/element'; | ||
import { | ||
__experimentalHStack as HStack, | ||
__experimentalVStack as VStack, | ||
Button, | ||
TextControl, | ||
} from '@wordpress/components'; | ||
import { store as blockEditorStore } from '@wordpress/block-editor'; | ||
import { store as coreStore } from '@wordpress/core-data'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { sanitizeCommentString } from './utils'; | ||
|
||
/** | ||
* Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar. | ||
* | ||
* @param {Object} props - The component props. | ||
* @param {Function} props.onSubmit - A callback function to be called when the user submits a comment. | ||
* @param {boolean} props.showCommentBoard - The function to edit the comment. | ||
* @param {Function} props.setShowCommentBoard - The function to delete the comment. | ||
* @return {JSX.Element} The rendered comment input UI. | ||
*/ | ||
export function AddComment( { | ||
onSubmit, | ||
showCommentBoard, | ||
setShowCommentBoard, | ||
} ) { | ||
// State to manage the comment thread. | ||
const [ inputComment, setInputComment ] = useState( '' ); | ||
|
||
const { | ||
defaultAvatar, | ||
clientId, | ||
blockCommentId, | ||
showAddCommentBoard, | ||
currentUser, | ||
} = useSelect( ( select ) => { | ||
const { getSettings } = select( blockEditorStore ); | ||
const { __experimentalDiscussionSettings } = getSettings(); | ||
const selectedBlock = select( blockEditorStore ).getSelectedBlock(); | ||
const userData = select( coreStore ).getCurrentUser(); | ||
return { | ||
defaultAvatar: __experimentalDiscussionSettings?.avatarURL, | ||
clientId: selectedBlock?.clientId, | ||
blockCommentId: selectedBlock?.attributes?.blockCommentId, | ||
showAddCommentBoard: showCommentBoard, | ||
currentUser: userData, | ||
}; | ||
} ); | ||
|
||
const userAvatar = currentUser?.avatar_urls[ 48 ] ?? defaultAvatar; | ||
|
||
useEffect( () => { | ||
setInputComment( '' ); | ||
}, [ clientId ] ); | ||
|
||
const handleCancel = () => { | ||
setShowCommentBoard( false ); | ||
setInputComment( '' ); | ||
}; | ||
|
||
if ( ! showAddCommentBoard || ! clientId || 0 !== blockCommentId ) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<VStack | ||
spacing="3" | ||
className="editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread" | ||
> | ||
<HStack alignment="left" spacing="3"> | ||
<img | ||
src={ userAvatar } | ||
// translators: alt text for user avatar image | ||
alt={ __( 'User Avatar' ) } | ||
className="editor-collab-sidebar-panel__user-avatar" | ||
width={ 32 } | ||
height={ 32 } | ||
/> | ||
<span className="editor-collab-sidebar-panel__user-name"> | ||
{ currentUser?.name ?? '' } | ||
</span> | ||
</HStack> | ||
<TextControl | ||
__next40pxDefaultSize | ||
__nextHasNoMarginBottom | ||
value={ inputComment } | ||
onChange={ setInputComment } | ||
placeholder={ _x( 'Comment', 'noun' ) } | ||
/> | ||
<HStack alignment="right" spacing="3"> | ||
<Button | ||
__next40pxDefaultSize | ||
variant="tertiary" | ||
text={ _x( 'Cancel', 'Cancel comment button' ) } | ||
onClick={ handleCancel } | ||
size="compact" | ||
/> | ||
<Button | ||
__next40pxDefaultSize | ||
accessibleWhenDisabled | ||
variant="primary" | ||
text={ _x( 'Comment', 'Add comment button' ) } | ||
disabled={ | ||
0 === sanitizeCommentString( inputComment ).length | ||
} | ||
onClick={ () => onSubmit( inputComment ) } | ||
size="compact" | ||
/> | ||
</HStack> | ||
</VStack> | ||
); | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/editor/src/components/collab-sidebar/commentButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { MenuItem } from '@wordpress/components'; | ||
import { _x } from '@wordpress/i18n'; | ||
import { comment as commentIcon } from '@wordpress/icons'; | ||
import { __unstableCommentIconFill as CommentIconFill } from '@wordpress/block-editor'; | ||
|
||
const AddCommentButton = ( { onClick } ) => { | ||
return ( | ||
<CommentIconFill> | ||
<MenuItem | ||
icon={ commentIcon } | ||
onClick={ onClick } | ||
aria-haspopup="dialog" | ||
> | ||
{ _x( 'Comment', 'Add comment button' ) } | ||
</MenuItem> | ||
</CommentIconFill> | ||
); | ||
}; | ||
|
||
export default AddCommentButton; |
22 changes: 22 additions & 0 deletions
22
packages/editor/src/components/collab-sidebar/commentButtonToolbar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { ToolbarButton } from '@wordpress/components'; | ||
import { _x } from '@wordpress/i18n'; | ||
import { comment as commentIcon } from '@wordpress/icons'; | ||
import { __unstableCommentIconToolbarFill as CommentIconToolbarFill } from '@wordpress/block-editor'; | ||
|
||
const AddCommentToolbarButton = ( { onClick } ) => { | ||
return ( | ||
<CommentIconToolbarFill> | ||
<ToolbarButton | ||
accessibleWhenDisabled | ||
icon={ commentIcon } | ||
label={ _x( 'Comment', 'Open comment button' ) } | ||
onClick={ onClick } | ||
/> | ||
</CommentIconToolbarFill> | ||
); | ||
}; | ||
|
||
export default AddCommentToolbarButton; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should say something about being internal or for collaborators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We’ve made this update based on the feedback provided here: #60622 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to defer to Matías if he has suggestions. Perhaps: "Enable collaborative commenting on blocks."?