{"action":"created","comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/173807047","pull_request_review_id":103054881,"id":173807047,"diff_hunk":"@@ -10,66 +11,97 @@ import { keycodes } from '@wordpress/utils';\n  */\n import './style.scss';\n \n+/**\n+ * Module constants\n+ */\n const { ESCAPE } = keycodes;\n \n-function ReusableBlockEditPanel( props ) {\n-\tconst { isEditing, title, isSaving, onEdit, onChangeTitle, onSave, onCancel } = props;\n+class ReusableBlockEditPanel extends Component {\n+\tconstructor() {\n+\t\tsuper( ...arguments );\n+\n+\t\tthis.bindTitleRef = this.bindTitleRef.bind( this );\n+\t\tthis.handleFormSubmit = this.handleFormSubmit.bind( this );\n+\t\tthis.handleTitleChange = this.handleTitleChange.bind( this );\n+\t\tthis.handleTitleKeyDown = this.handleTitleKeyDown.bind( this );\n+\t}\n+\n+\tbindTitleRef( ref ) {\n+\t\tthis.titleRef = ref;\n+\t}\n+\n+\tcomponentDidMount() {","path":"blocks/library/block/edit-panel/index.js","position":33,"original_position":33,"commit_id":"d7044868f425a67d567ec0f44116714c29373e83","original_commit_id":"d7044868f425a67d567ec0f44116714c29373e83","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars1.githubusercontent.com/u/1779930?v=4","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"body":"Conventionally like to see all component lifecycle following the constructor, with no functions in between.","created_at":"2018-03-12T14:05:02Z","updated_at":"2018-03-12T14:10:44Z","html_url":"https://github.com/WordPress/gutenberg/pull/5428#discussion_r173807047","pull_request_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/5428","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/173807047"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/5428#discussion_r173807047"},"pull_request":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/5428"}}},"pull_request":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/5428","id":173067287,"html_url":"https://github.com/WordPress/gutenberg/pull/5428","diff_url":"https://github.com/WordPress/gutenberg/pull/5428.diff","patch_url":"https://github.com/WordPress/gutenberg/pull/5428.patch","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/5428","number":5428,"state":"open","locked":false,"title":"Improve reusable block creation flow","user":{"login":"noisysocks","id":612155,"avatar_url":"https://avatars1.githubusercontent.com/u/612155?v=4","gravatar_id":"","url":"https://api.github.com/users/noisysocks","html_url":"https://github.com/noisysocks","followers_url":"https://api.github.com/users/noisysocks/followers","following_url":"https://api.github.com/users/noisysocks/following{/other_user}","gists_url":"https://api.github.com/users/noisysocks/gists{/gist_id}","starred_url":"https://api.github.com/users/noisysocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisysocks/subscriptions","organizations_url":"https://api.github.com/users/noisysocks/orgs","repos_url":"https://api.github.com/users/noisysocks/repos","events_url":"https://api.github.com/users/noisysocks/events{/privacy}","received_events_url":"https://api.github.com/users/noisysocks/received_events","type":"User","site_admin":false},"body":"## Description\r\n\r\nCloses #4527.\r\n\r\nModifies the flow to create a reusable block to look like this:\r\n\r\n1) The user selects a block and clicks _Convert to Reusable Block_.\r\n\r\n<img width=\"713\" alt=\"screen shot 2018-02-28 at 10 28 02\" src=\"https://user-images.githubusercontent.com/612155/36761290-74e7dc26-1c72-11e8-8797-518a2ed21f66.png\">\r\n\r\n2) The reusable block is created and is immediately in editing mode. **The title of the block is selected, allowing the user to start typing the title straight away.** If the user abandons the flow at this point, the new block will be titled  _Untitled block_.\r\n\r\n<img width=\"709\" alt=\"screen shot 2018-02-28 at 10 28 18\" src=\"https://user-images.githubusercontent.com/612155/36761296-7ad085a2-1c72-11e8-9526-62087b396bd3.png\">\r\n\r\n3) The user clicks _Save_ to rename their reusable block.\r\n\r\n<img width=\"697\" alt=\"screen shot 2018-02-28 at 10 28 41\" src=\"https://user-images.githubusercontent.com/612155/36761338-aca7e458-1c72-11e8-8cb4-d27101fdab7e.png\">\r\n\r\nThis removes two steps from the flow of creating a reusable block.\r\n\r\n<!-- Please describe your changes -->\r\n\r\n## Testing\r\n\r\n1. Create a block\r\n2. Convert it to a reusable block. Confirm that the title input is selected straight away\r\n3. Test creating and inserting reusable blocks","created_at":"2018-03-06T06:16:17Z","updated_at":"2018-03-12T14:10:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0de17e1f224141502aa5236448807222fe188d0e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":570263070,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/Blocks","name":"Blocks","color":"fbca04","default":false},{"id":783337752,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/Shared%20Blocks","name":"Shared Blocks","color":"fbca04","default":false},{"id":531680825,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Enhancement","name":"[Type] Enhancement","color":"c5def5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/5428/commits","review_comments_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/5428/comments","review_comment_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/5428/comments","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/d7044868f425a67d567ec0f44116714c29373e83","head":{"label":"WordPress:update/reusable-block-flow","ref":"update/reusable-block-flow","sha":"d7044868f425a67d567ec0f44116714c29373e83","user":{"login":"WordPress","id":276006,"avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"repo":{"id":80862584,"name":"gutenberg","full_name":"WordPress/gutenberg","owner":{"login":"WordPress","id":276006,"avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WordPress/gutenberg","description":"Printing since 1440. Development hub for the editor focus in core. Beta plugin is available from the official WordPress repository.","fork":false,"url":"https://api.github.com/repos/WordPress/gutenberg","forks_url":"https://api.github.com/repos/WordPress/gutenberg/forks","keys_url":"https://api.github.com/repos/WordPress/gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WordPress/gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WordPress/gutenberg/teams","hooks_url":"https://api.github.com/repos/WordPress/gutenberg/hooks","issue_events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/WordPress/gutenberg/events","assignees_url":"https://api.github.com/repos/WordPress/gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/WordPress/gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/WordPress/gutenberg/tags","blobs_url":"https://api.github.com/repos/WordPress/gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WordPress/gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WordPress/gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/WordPress/gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/WordPress/gutenberg/languages","stargazers_url":"https://api.github.com/repos/WordPress/gutenberg/stargazers","contributors_url":"https://api.github.com/repos/WordPress/gutenberg/contributors","subscribers_url":"https://api.github.com/repos/WordPress/gutenberg/subscribers","subscription_url":"https://api.github.com/repos/WordPress/gutenberg/subscription","commits_url":"https://api.github.com/repos/WordPress/gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/WordPress/gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/WordPress/gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/WordPress/gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WordPress/gutenberg/merges","archive_url":"https://api.github.com/repos/WordPress/gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WordPress/gutenberg/downloads","issues_url":"https://api.github.com/repos/WordPress/gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/WordPress/gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/WordPress/gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/WordPress/gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WordPress/gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/WordPress/gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/WordPress/gutenberg/deployments","created_at":"2017-02-03T19:34:19Z","updated_at":"2018-03-12T09:04:20Z","pushed_at":"2018-03-12T14:00:52Z","git_url":"git://github.com/WordPress/gutenberg.git","ssh_url":"git@github.com:WordPress/gutenberg.git","clone_url":"https://github.com/WordPress/gutenberg.git","svn_url":"https://github.com/WordPress/gutenberg","homepage":"https://wordpress.org/plugins/gutenberg/ ","size":11294,"stargazers_count":2111,"watchers_count":2111,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":485,"mirror_url":null,"archived":false,"open_issues_count":770,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":485,"open_issues":770,"watchers":2111,"default_branch":"master"}},"base":{"label":"WordPress:master","ref":"master","sha":"77465b55bd0a1c318c6b1d2b9a846c8be57fe697","user":{"login":"WordPress","id":276006,"avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"repo":{"id":80862584,"name":"gutenberg","full_name":"WordPress/gutenberg","owner":{"login":"WordPress","id":276006,"avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WordPress/gutenberg","description":"Printing since 1440. Development hub for the editor focus in core. Beta plugin is available from the official WordPress repository.","fork":false,"url":"https://api.github.com/repos/WordPress/gutenberg","forks_url":"https://api.github.com/repos/WordPress/gutenberg/forks","keys_url":"https://api.github.com/repos/WordPress/gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WordPress/gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WordPress/gutenberg/teams","hooks_url":"https://api.github.com/repos/WordPress/gutenberg/hooks","issue_events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/WordPress/gutenberg/events","assignees_url":"https://api.github.com/repos/WordPress/gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/WordPress/gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/WordPress/gutenberg/tags","blobs_url":"https://api.github.com/repos/WordPress/gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WordPress/gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WordPress/gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/WordPress/gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/WordPress/gutenberg/languages","stargazers_url":"https://api.github.com/repos/WordPress/gutenberg/stargazers","contributors_url":"https://api.github.com/repos/WordPress/gutenberg/contributors","subscribers_url":"https://api.github.com/repos/WordPress/gutenberg/subscribers","subscription_url":"https://api.github.com/repos/WordPress/gutenberg/subscription","commits_url":"https://api.github.com/repos/WordPress/gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/WordPress/gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/WordPress/gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/WordPress/gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WordPress/gutenberg/merges","archive_url":"https://api.github.com/repos/WordPress/gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WordPress/gutenberg/downloads","issues_url":"https://api.github.com/repos/WordPress/gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/WordPress/gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/WordPress/gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/WordPress/gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WordPress/gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/WordPress/gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/WordPress/gutenberg/deployments","created_at":"2017-02-03T19:34:19Z","updated_at":"2018-03-12T09:04:20Z","pushed_at":"2018-03-12T14:00:52Z","git_url":"git://github.com/WordPress/gutenberg.git","ssh_url":"git@github.com:WordPress/gutenberg.git","clone_url":"https://github.com/WordPress/gutenberg.git","svn_url":"https://github.com/WordPress/gutenberg","homepage":"https://wordpress.org/plugins/gutenberg/ ","size":11294,"stargazers_count":2111,"watchers_count":2111,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":485,"mirror_url":null,"archived":false,"open_issues_count":770,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":485,"open_issues":770,"watchers":2111,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/5428"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/5428"},"issue":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/5428"},"comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/5428/comments"},"review_comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/5428/comments"},"review_comment":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/5428/commits"},"statuses":{"href":"https://api.github.com/repos/WordPress/gutenberg/statuses/d7044868f425a67d567ec0f44116714c29373e83"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"aduth"}}