Skip to content
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

Merged
merged 274 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
10c9ed0
Update comment functionality and reformating code
MD-sunilprajapati Jun 10, 2024
271895a
remove style import
MD-sunilprajapati Jun 10, 2024
f2b7114
Merge pull request #8 from MD-sunilprajapati/try/inline-block-commenting
poojabhimani12 Jun 10, 2024
5e0890c
revert the changes
MD-sunilprajapati Jun 10, 2024
031e8d5
resolved conflicts
poojabhimani12 Jun 10, 2024
6b0c3b3
Merge branch 'poojabhimani12:try/inline-block-commenting' into try/in…
MD-sunilprajapati Jun 10, 2024
d2d6215
Adjust spacing between icons
MD-sunilprajapati Jun 10, 2024
cbee86f
Merge pull request #9 from MD-sunilprajapati/try/inline-block-commenting
poojabhimani12 Jun 10, 2024
b36c2ab
resolved conflicts
poojabhimani12 Jun 10, 2024
b7b1ba4
Fix linting errors
MD-sunilprajapati Jun 11, 2024
6c0862d
Merge pull request #10 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 12, 2024
77ee009
Add experimental condition
MD-sunilprajapati Jun 13, 2024
a8ea60e
Show sidebar on zero comments
MD-sunilprajapati Jun 13, 2024
ec302ff
Add package lock
MD-sunilprajapati Jun 13, 2024
f002607
Merge pull request #11 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 13, 2024
fdc44a3
Update comment
MD-sunilprajapati Jun 14, 2024
bb2c0bd
Merge pull request #12 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 14, 2024
e6ac0b4
Address feedbacks
MD-sunilprajapati Jun 18, 2024
9447911
Use useEntityProp
MD-sunilprajapati Jun 18, 2024
bf84cc4
Update sidebar content on new comment
MD-sunilprajapati Jun 18, 2024
57ed39a
Remove unneccessory changes
MD-sunilprajapati Jun 19, 2024
b9668fd
Relocate border styles for commented blocks
MD-sunilprajapati Jun 19, 2024
6628689
Merge pull request #13 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 19, 2024
1d81922
set initial state instead of mount effect for block class
MD-sunilprajapati Jun 19, 2024
87fe4f9
Fix linting errors
MD-sunilprajapati Jun 19, 2024
139135d
Add dependencies
MD-sunilprajapati Jun 19, 2024
20f2bd3
Merge pull request #14 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 19, 2024
2df0bdb
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Jun 19, 2024
515a592
Update package lock
MD-sunilprajapati Jun 19, 2024
08fd837
Merge pull request #15 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 20, 2024
251ae5f
Implement inline commenting
MD-sunilprajapati Jun 20, 2024
e747430
Update doc for collabboard component
MD-sunilprajapati Jun 20, 2024
b7a5bd7
Highlight inline text with comment
MD-sunilprajapati Jun 20, 2024
16d2186
Remove comments and console logs
MD-sunilprajapati Jul 24, 2024
877f090
Merge pull request #16 from MD-sunilprajapati/enabled-inline-commenting
poojabhimani12 Jul 25, 2024
1ce0191
made changes for collab.php file and removed block border color
rishishah-multidots Jul 29, 2024
1a677d8
Merge pull request #17 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Jul 29, 2024
d67d2b1
Resolved conflicts
poojabhimani12 Jul 29, 2024
e0cb8b5
Merge branch 'try/inline-block-commenting' of https://github.com/pooj…
poojabhimani12 Jul 29, 2024
9004004
Update editor-settings.php
poojabhimani12 Jul 29, 2024
d23a0a6
made changes for block comment feature
rishishah-multidots Aug 22, 2024
cf605d5
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Aug 22, 2024
f115c3b
made changes for code_sniffer error on rest_api file
rishishah-multidots Aug 22, 2024
f748ad9
made changes for code_sniffer error on rest_api file
rishishah-multidots Aug 22, 2024
59e96c4
remove readme.md file from collab folder
rishishah-multidots Aug 22, 2024
18e5081
remove static email for comment author
rishishah-multidots Aug 22, 2024
c9f4964
Merge pull request #18 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 22, 2024
1ed6d54
added edit/delete comment from sidebar feature
rishishah-multidots Aug 23, 2024
84733c5
resolve PHP coding standards errors
rishishah-multidots Aug 23, 2024
2d5d162
resolve PHP coding standards errors
rishishah-multidots Aug 23, 2024
e68cdcc
Merge pull request #19 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 23, 2024
8042e22
Resolved Conflicts
poojabhimani12 Aug 28, 2024
ceb188c
Add idenrifier to collab sidebar
MD-sunilprajapati Aug 28, 2024
575361c
Relocate Add Comment button below in more action popover
MD-sunilprajapati Aug 29, 2024
8c45982
Update comment button action to focus new comment form in sidebar on …
MD-sunilprajapati Aug 29, 2024
a2345e8
Merge pull request #20 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Aug 29, 2024
2004c04
Update experimental field lable for commenting functionality
MD-sunilprajapati Aug 29, 2024
8ac8328
Revert format library changes
MD-sunilprajapati Aug 29, 2024
868c095
made changes as per Github
rishishah-multidots Aug 29, 2024
ab73559
Refactor collab sidebar
MD-sunilprajapati Aug 29, 2024
d5df8cc
Refactor collab sidebar
MD-sunilprajapati Aug 29, 2024
533c5d4
Remove unneccessory snapshot tests
MD-sunilprajapati Aug 29, 2024
c0a5dcd
Remove collab board component
MD-sunilprajapati Aug 29, 2024
56e475b
Fix linting errors
MD-sunilprajapati Aug 29, 2024
9de8c69
Merge pull request #21 from MD-sunilprajapati/collab-sidebar-update
poojabhimani12 Aug 29, 2024
4104869
made changes as per Github
rishishah-multidots Aug 29, 2024
b8b0292
made changes as per github feedback
rishishah-multidots Aug 29, 2024
6996e5f
Merge pull request #22 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 29, 2024
0321430
comment board hide/show on Add comment and cancel button
rishishah-multidots Aug 29, 2024
3bf3c4c
Merge pull request #23 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 29, 2024
c66fbcd
Revert format library changes
MD-sunilprajapati Aug 30, 2024
751d727
Sync with trunk and resolved conflicts
MD-sunilprajapati Aug 30, 2024
9a42d64
Merge pull request #24 from MD-sunilprajapati/address-feedbacks
poojabhimani12 Aug 30, 2024
68d5e1c
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Aug 30, 2024
1f5a2c2
Focus comment board on comment icon click
MD-sunilprajapati Aug 30, 2024
6477102
Address feedback and create smaller component
MD-sunilprajapati Aug 30, 2024
66832a7
Create comment header component
MD-sunilprajapati Aug 30, 2024
5c70d90
Fix linting errors
MD-sunilprajapati Aug 30, 2024
cc28c6a
Remove logs
MD-sunilprajapati Aug 30, 2024
951d8b4
Fix linting errors
MD-sunilprajapati Aug 30, 2024
b0ad9d5
Merge pull request #25 from MD-sunilprajapati/refactor-collab-sidebar
poojabhimani12 Aug 30, 2024
a5e12e1
made changes as per PR feedback
rishishah-multidots Aug 30, 2024
cf59158
made changes as per PR feedback
rishishah-multidots Aug 30, 2024
6cfdb29
resolve style.scss conflict
rishishah-multidots Aug 30, 2024
465b438
Merge pull request #26 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 30, 2024
c9d50d8
Refactor collab components
MD-sunilprajapati Sep 2, 2024
fd6f327
Implement comment reload on comment crud operation
MD-sunilprajapati Sep 2, 2024
15c85e0
remove string literals for data stores
MD-sunilprajapati Sep 2, 2024
c7be827
remove package json file changes
MD-sunilprajapati Sep 2, 2024
bd1a7ce
Add docs for components
MD-sunilprajapati Sep 2, 2024
19dfab8
Merge pull request #27 from MD-sunilprajapati/refactor-inline-commenting
poojabhimani12 Sep 2, 2024
48ee928
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Sep 2, 2024
8fa3f85
remove revert function to show comments in sidebar and show comments …
rishishah-multidots Sep 2, 2024
5f0ae80
remove revert function to show comments in sidebar and show comments …
rishishah-multidots Sep 2, 2024
69d1878
Merge pull request #28 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 2, 2024
d6e01f3
Remove string literels for gutenberg stores
MD-sunilprajapati Sep 2, 2024
668671b
Merge pull request #29 from MD-sunilprajapati/refactor-inline-comment…
poojabhimani12 Sep 2, 2024
ee6fe75
Sync with trunk and resolved conflicts
MD-sunilprajapati Sep 3, 2024
de2cd8f
Sync with trunk
MD-sunilprajapati Sep 3, 2024
8e6da19
Addressed feedback of collab sidebar component
MD-sunilprajapati Sep 3, 2024
90ba459
Merge pull request #30 from MD-sunilprajapati/collab-sidebar-feedbacks
poojabhimani12 Sep 3, 2024
e2fd75a
made changes for feedback
rishishah-multidots Sep 3, 2024
aad19d0
Merge pull request #31 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 3, 2024
6f03c48
Refresh state on every new comment
MD-sunilprajapati Sep 3, 2024
2b057cc
Sync file with trunk
MD-sunilprajapati Sep 3, 2024
59caf1c
made changes for css property
rishishah-multidots Sep 3, 2024
efa41ac
Merge pull request #32 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 3, 2024
4ee210d
code cleanup
MD-sunilprajapati Sep 3, 2024
38bea58
Merge pull request #33 from MD-sunilprajapati/collab-sidebar-cleanup
poojabhimani12 Sep 3, 2024
609cad6
Merge branch 'trunk' of gutenberg
MD-sunilprajapati Sep 4, 2024
8a54986
Update classes name and remove unwanted classes
minaldiwan Sep 4, 2024
2fd78b0
Merge pull request #35 from minaldiwan/try/inline-block-commenting
poojabhimani12 Sep 4, 2024
f236a42
made changes for translators and context
rishishah-multidots Sep 4, 2024
b3c879d
made changes for translators and context
rishishah-multidots Sep 4, 2024
bc308e9
Merge pull request #36 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 4, 2024
11cf1f1
use entity record function instead api fetch
MD-sunilprajapati Sep 4, 2024
22c189a
Sync with origin and resolved coflicts
MD-sunilprajapati Sep 4, 2024
33cd398
small fix for translator string
rishishah-multidots Sep 4, 2024
211944c
Merge pull request #37 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 4, 2024
a4abbec
Fix linting errors
MD-sunilprajapati Sep 4, 2024
5c99dcc
Merge branch 'try/inline-block-commenting' of gutenberg into collab-c…
MD-sunilprajapati Sep 4, 2024
50e8101
fix comment edit issue
MD-sunilprajapati Sep 5, 2024
ce7f7bc
Sync with origin and resolved coflicts
MD-sunilprajapati Sep 5, 2024
b0c5960
Fix linting errors
MD-sunilprajapati Sep 5, 2024
f768b4a
Merge pull request #34 from MD-sunilprajapati/collab-comment-cleanup
poojabhimani12 Sep 5, 2024
92870c4
pipeline error fixes
rishishah-multidots Sep 5, 2024
37fa922
pipeline error fixes and resolve conflicts
rishishah-multidots Sep 5, 2024
4d6841a
Merge pull request #38 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 5, 2024
71f7a39
Fix linting errors
MD-sunilprajapati Sep 5, 2024
6f73a0b
Merge pull request #39 from MD-sunilprajapati/code-cleanup
poojabhimani12 Sep 5, 2024
edab788
Fix style linting issue
MD-sunilprajapati Sep 5, 2024
6e528a1
Fix useMemo dependacy
MD-sunilprajapati Sep 5, 2024
b129367
Merge pull request #40 from MD-sunilprajapati/fix-linting-errors
poojabhimani12 Sep 5, 2024
8d17f22
Remove styling for input and textarea box as per core team feedback
minaldiwan Sep 5, 2024
fd4c045
Merge pull request #41 from minaldiwan/try/inline-block-commenting
poojabhimani12 Sep 5, 2024
4d3eeb1
added error message for add comment on draft mode or duplicate comment
rishishah-multidots Sep 5, 2024
f06340a
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Sep 5, 2024
6b8027a
resolve eslint error and update blockEditorStore feature
rishishah-multidots Sep 5, 2024
06c8526
revert package files as per trunk
rishishah-multidots Sep 5, 2024
e1d4396
revert package files as per main branch
rishishah-multidots Sep 5, 2024
c78f981
Merge pull request #42 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 5, 2024
da72b79
Addressed feedback
MD-sunilprajapati Sep 6, 2024
d7bca6e
cleanup code
MD-sunilprajapati Sep 6, 2024
68d203e
Update context for edit button
MD-sunilprajapati Sep 6, 2024
b296d2d
Merge pull request #43 from MD-sunilprajapati/address-feedback
poojabhimani12 Sep 6, 2024
bddceeb
feedback changes
rishishah-multidots Sep 6, 2024
c5094a0
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Sep 6, 2024
a23241a
feedback changes for comment rest API
rishishah-multidots Sep 6, 2024
9548565
Merge pull request #44 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 6, 2024
06e840f
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Sep 6, 2024
3883a11
comment rest api function in condition
rishishah-multidots Sep 6, 2024
334daf2
Merge pull request #45 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 6, 2024
b028876
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Sep 9, 2024
cd63f6a
Fix reply comment issue
MD-sunilprajapati Sep 10, 2024
9b12661
Merge pull request #50 from MD-sunilprajapati/fix-reply-comment-issue
poojabhimani12 Sep 10, 2024
f287eff
Remove comment icon
MD-sunilprajapati Sep 10, 2024
16ebd4c
Merge pull request #51 from MD-sunilprajapati/remove-icon
poojabhimani12 Sep 10, 2024
7aa5508
update comment icon code for menu and toolbar group
rishishah-multidots Sep 13, 2024
e55109f
resolve eslint errors
rishishah-multidots Sep 13, 2024
f66d825
revert package-lock file
rishishah-multidots Sep 13, 2024
7ff9a79
Merge pull request #59 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 13, 2024
d01c693
resolve trunk conflicts
rishishah-multidots Sep 16, 2024
2caf2d1
Merge pull request #60 from rishishah-multidots/sync-with-trunk
poojabhimani12 Sep 16, 2024
6bda66d
sync rest-api file with api PR
rishishah-multidots Sep 24, 2024
64b1b31
sync rest-api file with api PR
rishishah-multidots Sep 24, 2024
31ea3b5
Merge pull request #61 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 24, 2024
bdf982f
remove autop package and update code according to it
rishishah-multidots Oct 3, 2024
c5a53a2
remove console statement
rishishah-multidots Oct 3, 2024
c0aee07
remove linting error
rishishah-multidots Oct 3, 2024
1a251ba
remove tag replace code from add/edit/fetch comment
rishishah-multidots Oct 3, 2024
452181d
remove tag replace code from add/edit/fetch comment
rishishah-multidots Oct 3, 2024
898a924
revert rahHRML tag for render comment in sidebar
rishishah-multidots Oct 3, 2024
11d6693
Merge pull request #64 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 3, 2024
0326444
resolve conflict
rishishah-multidots Oct 3, 2024
bf20345
Merge pull request #65 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 3, 2024
c419ce4
Merge branch 'trunk' of github.com:MD-sunilprajapati/gutenberg into s…
MD-sunilprajapati Oct 4, 2024
667163e
Remove unneccessory changes
MD-sunilprajapati Oct 4, 2024
25364d8
Merge pull request #67 from MD-sunilprajapati/sync-with-trunk
poojabhimani12 Oct 4, 2024
5a53245
Add backport changelog
MD-sunilprajapati Oct 4, 2024
f4dd385
Merge pull request #68 from MD-sunilprajapati/backport-log
poojabhimani12 Oct 4, 2024
83a5955
Merge branch 'trunk' of github.com:rishishah-multidots/gutenberg into…
rishishah-multidots Oct 15, 2024
ec1a8b3
Merge pull request #69 from rishishah-multidots/sync-with-trunk
poojabhimani12 Oct 15, 2024
2a4a427
update feedback points regarding classes and typography
minaldiwan Oct 15, 2024
ffc7f51
Merge pull request #70 from minaldiwan/try/inline-block-commenting
poojabhimani12 Oct 15, 2024
0d36a58
feedback changes
rishishah-multidots Oct 15, 2024
ed6e2e6
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Oct 15, 2024
9a6556f
linting error fixes
rishishah-multidots Oct 15, 2024
ebc28ca
Merge pull request #71 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 15, 2024
02bd950
made changes for private API and comment controller
rishishah-multidots Oct 16, 2024
f5be6ac
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Oct 16, 2024
973f559
remove comment code and added comment controller file
rishishah-multidots Oct 16, 2024
e3c49b7
Merge pull request #72 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 16, 2024
ab1395c
fix conding standerds warnings and error
rishishah-multidots Oct 16, 2024
f9f24d9
fix coding standard warnings and error
rishishah-multidots Oct 16, 2024
63f915f
fix coding standard warnings and error
rishishah-multidots Oct 16, 2024
fc43c1e
Merge pull request #73 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 16, 2024
68c5272
Implement confirmDialog box for delete and resolve comment box
minaldiwan Oct 17, 2024
3d14991
Merge pull request #74 from minaldiwan/try/inline-block-commenting
poojabhimani12 Oct 17, 2024
6b32fcf
feedback changes
rishishah-multidots Oct 17, 2024
9db107b
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Oct 17, 2024
c92de93
made changes to hide block_comment from admin screen
rishishah-multidots Oct 17, 2024
97a6d6e
fix coding standard warnings and error
rishishah-multidots Oct 17, 2024
0136fae
fix coding standard warnings and error
rishishah-multidots Oct 17, 2024
13f53d8
fix coding standard warnings and error
rishishah-multidots Oct 17, 2024
4d0ca6e
fix coding standard warnings and error
rishishah-multidots Oct 17, 2024
c5b76e8
updated doc file
rishishah-multidots Oct 17, 2024
02aabd9
Merge pull request #75 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 17, 2024
65e1eb4
Merge branch 'trunk' of github.com:rishishah-multidots/gutenberg into…
rishishah-multidots Oct 17, 2024
e3bc354
Merge pull request #76 from rishishah-multidots/sync-with-trunk
poojabhimani12 Oct 17, 2024
c8ff644
fix delete comment on reply feedback
rishishah-multidots Oct 18, 2024
8cd46c3
Merge pull request #77 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 18, 2024
45f9553
fix private API import from same API test cases fail errors
rishishah-multidots Oct 21, 2024
27ab929
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Oct 21, 2024
b9017a4
Merge pull request #78 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 21, 2024
e3cb45b
fix e2e error while testing
rishishah-multidots Oct 21, 2024
c4d4b1d
made conditional changes for default attributes
rishishah-multidots Oct 21, 2024
345c227
Merge pull request #79 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 21, 2024
7a6c085
made openGeneralSidebar to private
rishishah-multidots Oct 21, 2024
aa2d47b
Merge pull request #80 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 21, 2024
7ce91e9
made changes as per the feedback
rishishah-multidots Oct 22, 2024
4cd5835
made changes as per the feedback
rishishah-multidots Oct 22, 2024
00076ff
made changes as per the feedback
rishishah-multidots Oct 22, 2024
7bf2c78
Merge pull request #81 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 22, 2024
514853c
made changes as per the feedback
rishishah-multidots Oct 22, 2024
4b59a86
made changes as per the feedback
rishishah-multidots Oct 22, 2024
1cfd88e
Merge pull request #82 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 22, 2024
45f6ac9
made changes as per the feedback
rishishah-multidots Oct 22, 2024
42a4eb2
Merge pull request #83 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 22, 2024
e42e647
remove components fields css
minaldiwan Oct 23, 2024
8744c83
made changes as per the feedback
rishishah-multidots Oct 23, 2024
127228b
Merge branch 'poojabhimani12:try/inline-block-commenting' into try/in…
rishishah-multidots Oct 23, 2024
5781530
Merge pull request #84 from minaldiwan/try/inline-block-commenting
poojabhimani12 Oct 23, 2024
ca54345
Merge pull request #85 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
2e212c1
made changes as per the feedback
rishishah-multidots Oct 23, 2024
4b8986b
Merge pull request #86 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
b42cd97
made changes as per the feedback
rishishah-multidots Oct 23, 2024
30ddf61
Merge pull request #87 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
e446297
made changes as per the feedback
rishishah-multidots Oct 23, 2024
1955469
made changes as per the feedback
rishishah-multidots Oct 23, 2024
22893f8
Merge pull request #88 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
b89ce85
made changes as per the feedback
rishishah-multidots Oct 23, 2024
3f9d745
Merge pull request #89 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
90b038b
define empty array outside the component
rishishah-multidots Oct 23, 2024
b7c0c46
Merge pull request #90 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
48c3351
made changes to compatible with FSE
rishishah-multidots Oct 23, 2024
7c00570
Merge pull request #91 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
047e07f
made changes to compatible with FSE
rishishah-multidots Oct 23, 2024
a342e27
Merge pull request #92 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
ae50d7a
fix lint error
rishishah-multidots Oct 23, 2024
2ca51c3
Merge pull request #93 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7488.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7488

* https://github.com/WordPress/gutenberg/pull/60622
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7498.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7498

* https://github.com/WordPress/gutenberg/pull/60622
70 changes: 70 additions & 0 deletions lib/compat/wordpress-6.8/block-comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
/**
* Updates the comment type in the REST API for WordPress version 6.7.
*
* This function is used as a filter callback for the 'rest_pre_insert_comment' hook.
* It checks if the 'comment_type' parameter is set to 'block_comment' in the REST API request,
* and if so, updates the 'comment_type' and 'comment_approved' properties of the prepared comment.
*
* @param array $prepared_comment The prepared comment data.
* @param WP_REST_Request $request The REST API request object.
* @return array The updated prepared comment data.
*/
if ( ! function_exists( 'update_comment_type_in_rest_api_6_8' ) && gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) {
function update_comment_type_in_rest_api_6_8( $prepared_comment, $request ) {
if ( ! empty( $request['comment_type'] ) && 'block_comment' === $request['comment_type'] ) {
$prepared_comment['comment_type'] = $request['comment_type'];
$prepared_comment['comment_approved'] = $request['comment_approved'];
}

return $prepared_comment;
}
add_filter( 'rest_pre_insert_comment', 'update_comment_type_in_rest_api_6_8', 10, 2 );
}

/**
* Updates the comment type for avatars in the WordPress REST API.
*
* This function adds the 'block_comment' type to the list of comment types
* for which avatars should be retrieved in the WordPress REST API.
*
* @param array $comment_type The array of comment types.
* @return array The updated array of comment types.
*/
if ( ! function_exists( 'update_get_avatar_comment_type' ) && gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) {
function update_get_avatar_comment_type( $comment_type ) {
$comment_type[] = 'block_comment';
return $comment_type;
}
add_filter( 'get_avatar_comment_types', 'update_get_avatar_comment_type' );
}

/**
* Excludes block comments from the admin comments query.
*
* This function modifies the comments query to exclude comments of type 'block_comment'
* when the query is for comments in the WordPress admin.
*
* @param WP_Comment_Query $query The current comments query.
*
* @return void
*/
if ( ! function_exists( 'exclude_block_comments_from_admin' ) && gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) {
function exclude_block_comments_from_admin( $query ) {
// Only modify the query if it's for comments
if ( isset( $query->query_vars['type'] ) && '' === $query->query_vars['type'] ) {
$query->set( 'type', '' );

add_filter(
'comments_clauses',
function ( $clauses ) {
global $wpdb;
// Exclude comments of type 'block_comment'
$clauses['where'] .= " AND {$wpdb->comments}.comment_type != 'block_comment'";
return $clauses;
}
);
}
}
add_action( 'pre_get_comments', 'exclude_block_comments_from_admin' );
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?php
/**
* A custom REST server for Gutenberg.
*
* @package gutenberg
* @since 6.8.0
*/

// Create a new class that extends WP_REST_Comments_Controller
class Gutenberg_REST_Comment_Controller_6_8 extends WP_REST_Comments_Controller {

public function create_item_permissions_check( $request ) {
if ( ! is_user_logged_in() ) {
if ( get_option( 'comment_registration' ) ) {
return new WP_Error(
'rest_comment_login_required',
__( 'Sorry, you must be logged in to comment.' ),
array( 'status' => 401 )
);
}

/**
* Filters whether comments can be created via the REST API without authentication.
*
* Enables creating comments for anonymous users.
*
* @since 4.7.0
*
* @param bool $allow_anonymous Whether to allow anonymous comments to
* be created. Default `false`.
* @param WP_REST_Request $request Request used to generate the
* response.
*/
$allow_anonymous = apply_filters( 'rest_allow_anonymous_comments', false, $request );

if ( ! $allow_anonymous ) {
return new WP_Error(
'rest_comment_login_required',
__( 'Sorry, you must be logged in to comment.' ),
array( 'status' => 401 )
);
}
}

// Limit who can set comment `author`, `author_ip` or `status` to anything other than the default.
if ( isset( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( 'moderate_comments' ) ) {
return new WP_Error(
'rest_comment_invalid_author',
/* translators: %s: Request parameter. */
sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'author' ),
array( 'status' => rest_authorization_required_code() )
);
}

if ( isset( $request['author_ip'] ) && ! current_user_can( 'moderate_comments' ) ) {
if ( empty( $_SERVER['REMOTE_ADDR'] ) || $request['author_ip'] !== $_SERVER['REMOTE_ADDR'] ) {
return new WP_Error(
'rest_comment_invalid_author_ip',
/* translators: %s: Request parameter. */
sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'author_ip' ),
array( 'status' => rest_authorization_required_code() )
);
}
}

if ( isset( $request['status'] ) && ! current_user_can( 'moderate_comments' ) ) {
return new WP_Error(
'rest_comment_invalid_status',
/* translators: %s: Request parameter. */
sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'status' ),
array( 'status' => rest_authorization_required_code() )
);
}

if ( empty( $request['post'] ) ) {
return new WP_Error(
'rest_comment_invalid_post_id',
__( 'Sorry, you are not allowed to create this comment without a post.' ),
array( 'status' => 403 )
);
}

$post = get_post( (int) $request['post'] );

if ( ! $post ) {
return new WP_Error(
'rest_comment_invalid_post_id',
__( 'Sorry, you are not allowed to create this comment without a post.' ),
array( 'status' => 403 )
);
}

if ( 'draft' === $post->post_status && 'comment' === $request['comment_type'] ) {
return new WP_Error(
'rest_comment_draft_post',
__( 'Sorry, you are not allowed to create a comment on this post.' ),
array( 'status' => 403 )
);
}

if ( 'trash' === $post->post_status ) {
Copy link
Member

@ellatrix ellatrix Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at https://github.com/WordPress/wordpress-develop/blob/0d9c56edfb94eba08eeb7a2a43d5614542a097ea/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php#L525, it seems you simply removed the condition. Could we add a filter here instead so it's something we can ship in core? We can't just remove the condition entirely, otherwise normal comments can be posted on draft posts. There should be a new filter that we can then use to bypass it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the comments_open check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative is to check if the comment type is comment and otherwise skip all these checks. I think that could work too. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm saying this because, currently, someone who installs the Gutenberg plugin and enables this experiment will suddenly find that you can comment through the REST API on any post that the "comments closed" setting on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return new WP_Error(
'rest_comment_trash_post',
__( 'Sorry, you are not allowed to create a comment on this post.' ),
array( 'status' => 403 )
);
}

if ( ! $this->check_read_post_permission( $post, $request ) ) {
return new WP_Error(
'rest_cannot_read_post',
__( 'Sorry, you are not allowed to read the post for this comment.' ),
array( 'status' => rest_authorization_required_code() )
);
}

if ( ! comments_open( $post->ID ) && 'comment' === $request['comment_type'] ) {
return new WP_Error(
'rest_comment_closed',
__( 'Sorry, comments are closed for this item.' ),
array( 'status' => 403 )
);
}

return true;
}
}

add_action(
'rest_api_init',
function () {
$controller = new Gutenberg_REST_Comment_Controller_6_8();
$controller->register_routes();
}
);
3 changes: 3 additions & 0 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ function gutenberg_enable_experiments() {
if ( gutenberg_is_experiment_enabled( 'gutenberg-full-page-client-side-navigation' ) ) {
wp_add_inline_script( 'wp-block-library', 'window.__experimentalFullPageClientSideNavigation = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-block-comment', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableBlockComment = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-quick-edit-dataviews', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalQuickEditDataViews = true', 'before' );
}
Expand Down
12 changes: 12 additions & 0 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-block-comment',
__( 'Block Comments', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Enable multi-user commenting on blocks', 'gutenberg' ),
Copy link
Member

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.

Copy link
Contributor Author

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).

Copy link
Contributor

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."?

'id' => 'gutenberg-block-comment',
)
);

add_settings_field(
'gutenberg-media-processing',
__( 'Client-side media processing', 'gutenberg' ),
Expand Down
4 changes: 4 additions & 0 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/compat/wordpress-6.7/class-gutenberg-rest-server.php';
require __DIR__ . '/compat/wordpress-6.7/rest-api.php';

// WordPress 6.8 compat.
require __DIR__ . '/compat/wordpress-6.8/block-comments.php';
require __DIR__ . '/compat/wordpress-6.8/class-gutenberg-rest-comment-controller-6-8.php';

// Plugin specific code.
require_once __DIR__ . '/class-wp-rest-global-styles-controller-gutenberg.php';
require_once __DIR__ . '/class-wp-rest-edit-site-export-controller-gutenberg.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { pipe, useCopyToClipboard } from '@wordpress/compose';
* Internal dependencies
*/
import BlockActions from '../block-actions';
import __unstableCommentIconFill from '../../components/collab/block-comment-icon-slot';
import BlockHTMLConvertButton from './block-html-convert-button';
import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';
import BlockSettingsMenuControls from '../block-settings-menu-controls';
Expand Down Expand Up @@ -294,6 +295,9 @@ export function BlockSettingsDropdown( {
</MenuItem>
</>
) }
<__unstableCommentIconFill.Slot
fillProps={ { onClose } }
/>
</MenuGroup>
{ canCopyStyles && ! isContentOnly && (
<MenuGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import { ToolbarGroup, ToolbarItem } from '@wordpress/components';
* Internal dependencies
*/
import BlockSettingsDropdown from './block-settings-dropdown';
import __unstableCommentIconToolbarFill from '../../components/collab/block-comment-icon-toolbar-slot';

export function BlockSettingsMenu( { clientIds, ...props } ) {
return (
<ToolbarGroup>
<__unstableCommentIconToolbarFill.Slot />

<ToolbarItem>
{ ( toggleProps ) => (
<BlockSettingsDropdown
Expand Down
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;
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;
5 changes: 4 additions & 1 deletion packages/block-editor/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ import { PrivatePublishDateTimePicker } from './components/publish-date-time-pic
import useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';
import useBlockDisplayTitle from './components/block-title/use-block-display-title';
import TabbedSidebar from './components/tabbed-sidebar';

import __unstableCommentIconFill from './components/collab/block-comment-icon-slot';
import __unstableCommentIconToolbarFill from './components/collab/block-comment-icon-toolbar-slot';
/**
* Private @wordpress/block-editor APIs.
*/
Expand Down Expand Up @@ -94,4 +95,6 @@ lock( privateApis, {
__unstableBlockStyleVariationOverridesWithConfig,
setBackgroundStyleDefaults,
sectionRootClientIdKey,
__unstableCommentIconFill,
__unstableCommentIconToolbarFill,
} );
Loading
Loading