diff --git a/backport-changelog/7.2/15138.md b/backport-changelog/7.2/15138.md new file mode 100644 index 00000000000000..444e71f1fe631b --- /dev/null +++ b/backport-changelog/7.2/15138.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/15138 + +* https://github.com/WordPress/gutenberg/pull/85565 diff --git a/lib/compat/wordpress-7.2/class-gutenberg-rest-comment-controller-7-2.php b/lib/compat/wordpress-7.2/class-gutenberg-rest-comment-controller-7-2.php index 2fbc6dec6b9b3a..ca7bd0f0e5897f 100644 --- a/lib/compat/wordpress-7.2/class-gutenberg-rest-comment-controller-7-2.php +++ b/lib/compat/wordpress-7.2/class-gutenberg-rest-comment-controller-7-2.php @@ -27,12 +27,12 @@ class Gutenberg_REST_Comment_Controller_7_2 extends WP_REST_Comments_Controller * * @since 7.2.0 * - * @return string[] Hex keys for heart, celebration, smile, eyes and rocket. + * @return string[] Hex keys for thumbs up, plus, heart, celebration, smile, eyes and rocket. * * @phpstan-return non-empty-list */ private static function get_note_reaction_keys(): array { - return array( '2764', '1f389', '1f604', '1f440', '1f680' ); + return array( '1f44d', '2795', '2764', '1f389', '1f604', '1f440', '1f680' ); } // END CHANGE. diff --git a/packages/editor/src/components/collab-sidebar/reactions/reaction-emojis.ts b/packages/editor/src/components/collab-sidebar/reactions/reaction-emojis.ts index 25d6721bb6e42d..d0c750fd06d837 100644 --- a/packages/editor/src/components/collab-sidebar/reactions/reaction-emojis.ts +++ b/packages/editor/src/components/collab-sidebar/reactions/reaction-emojis.ts @@ -21,6 +21,21 @@ export interface ReactionEmoji { * that phrase needs. */ export const REACTION_EMOJIS: ReactionEmoji[] = [ + { + emoji: '👍', + hexKey: '1f44d', + label: _x( 'Thumbs up', 'emoji reaction' ), + sentenceLabel: _x( + 'thumbs up', + 'emoji reaction, after "reacted with"' + ), + }, + { + emoji: '➕', + hexKey: '2795', + label: _x( 'Plus', 'emoji reaction' ), + sentenceLabel: _x( 'plus', 'emoji reaction, after "reacted with"' ), + }, { emoji: '❤️', hexKey: '2764', diff --git a/phpunit/experimental/class-wp-rest-comments-controller-gutenberg-test.php b/phpunit/experimental/class-wp-rest-comments-controller-gutenberg-test.php index 610eedf869392b..0c88e31576c429 100644 --- a/phpunit/experimental/class-wp-rest-comments-controller-gutenberg-test.php +++ b/phpunit/experimental/class-wp-rest-comments-controller-gutenberg-test.php @@ -804,7 +804,7 @@ public function data_invalid_reaction_inputs() { 'no parent' => array( 'none', '2764', true, 'rest_comment_invalid_parent', 400 ), 'parent is a regular comment' => array( 'comment', '2764', true, 'rest_comment_invalid_parent', 400 ), 'content is not in emoji list' => array( 'note', 'invalid_emoji', true, 'rest_comment_invalid_reaction', 400 ), - 'emoji outside the curated set' => array( 'note', '1f44d', true, 'rest_comment_invalid_reaction', 400 ), + 'emoji outside the curated set' => array( 'note', '1f525', true, 'rest_comment_invalid_reaction', 400 ), 'uppercase hex key' => array( 'note', '1F680', true, 'rest_comment_invalid_reaction', 400 ), 'emoji name instead of hex' => array( 'note', 'heart', true, 'rest_comment_invalid_reaction', 400 ), 'anonymous user' => array( 'none', '2764', false, 'rest_comment_login_required', 401 ), @@ -941,8 +941,10 @@ public function test_create_reaction_valid_emojis( $emoji ) { } public function data_valid_reaction_emojis() { - // The five quick reactions: heart, celebration, smile, eyes, rocket. + // The seven quick reactions: thumbs up, plus, heart, celebration, smile, eyes, rocket. return array( + 'thumbs up' => array( '1f44d' ), + 'plus' => array( '2795' ), 'heart' => array( '2764' ), 'celebration' => array( '1f389' ), 'smile' => array( '1f604' ), diff --git a/test/e2e/specs/editor/various/block-notes.spec.js b/test/e2e/specs/editor/various/block-notes.spec.js index e9176d21cd589e..082a2b6d1c78ee 100644 --- a/test/e2e/specs/editor/various/block-notes.spec.js +++ b/test/e2e/specs/editor/various/block-notes.spec.js @@ -1353,25 +1353,25 @@ test.describe( 'Block Notes', () => { // The arrow keys move through the emoji, and Enter picks one. await page.keyboard.press( 'Enter' ); await expect( - menu.getByRole( 'menuitemcheckbox', { name: 'Heart' } ) + menu.getByRole( 'menuitemcheckbox', { name: 'Thumbs up' } ) ).toBeFocused(); await page.keyboard.press( 'ArrowRight' ); await expect( - menu.getByRole( 'menuitemcheckbox', { name: 'Celebration' } ) + menu.getByRole( 'menuitemcheckbox', { name: 'Plus' } ) ).toBeFocused(); await page.keyboard.press( 'Enter' ); await expect( - page.getByRole( 'button', { name: /Celebration/ } ) + page.getByRole( 'button', { name: /Plus/ } ) ).toContainText( '1' ); // The menu marks the emoji the user has already reacted with. await trigger.click(); await expect( - menu.getByRole( 'menuitemcheckbox', { name: 'Celebration' } ) + menu.getByRole( 'menuitemcheckbox', { name: 'Plus' } ) ).toBeChecked(); await expect( - menu.getByRole( 'menuitemcheckbox', { name: 'Heart' } ) + menu.getByRole( 'menuitemcheckbox', { name: 'Thumbs up' } ) ).not.toBeChecked(); // The emoji name shows in a tooltip, and one Escape closes both.