{"action":"created","comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/171359779","pull_request_review_id":100192136,"id":171359779,"diff_hunk":"@@ -0,0 +1,91 @@\n+/* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */\n+\n+/**\n+ * External dependencies\n+ */\n+\n+/**\n+ * Internal dependencies\n+ */\n+import { applyFilters } from '@wordpress/hooks';\n+import { isString } from 'util';\n+import { validateNamespacedId } from '../../utils/plugins';\n+import { activateSidebar } from './sidebar';\n+\n+const menuItems = {};\n+\n+/**\n+ * Registers a plugin under the more menu.\n+ *\n+ * @param {string}   menuItemId        The unique identifier of the plugin. Should be in\n+ *                                     `[namespace]/[name]` format.\n+ * @param {Object}   settings          The settings for this menu item.\n+ * @param {string}   settings.title    The name to show in the settings menu.\n+ * @param {func}     settings.target   The registered plugin that should be activated.\n+ * @param {string}   [settings.icon]   SVG Icon url.","path":"edit-post/api/more-menu-item.js","position":25,"original_position":25,"commit_id":"e70c88dba3fbeb6d2760da959f9349c6297092cb","original_commit_id":"e70c88dba3fbeb6d2760da959f9349c6297092cb","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":"Superfluous whitespace after the tag type can be collapsed.","created_at":"2018-02-28T19:33:00Z","updated_at":"2018-02-28T19:39:47Z","html_url":"https://github.com/WordPress/gutenberg/pull/4484#discussion_r171359779","pull_request_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/4484","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/171359779"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/4484#discussion_r171359779"},"pull_request":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/4484"}},"in_reply_to_id":171359723},"pull_request":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/4484","id":162959391,"html_url":"https://github.com/WordPress/gutenberg/pull/4484","diff_url":"https://github.com/WordPress/gutenberg/pull/4484.diff","patch_url":"https://github.com/WordPress/gutenberg/pull/4484.patch","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/4484","number":4484,"state":"open","locked":false,"title":"Add More Menu Item Api","user":{"login":"Xyfi","id":5389513,"avatar_url":"https://avatars3.githubusercontent.com/u/5389513?v=4","gravatar_id":"","url":"https://api.github.com/users/Xyfi","html_url":"https://github.com/Xyfi","followers_url":"https://api.github.com/users/Xyfi/followers","following_url":"https://api.github.com/users/Xyfi/following{/other_user}","gists_url":"https://api.github.com/users/Xyfi/gists{/gist_id}","starred_url":"https://api.github.com/users/Xyfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xyfi/subscriptions","organizations_url":"https://api.github.com/users/Xyfi/orgs","repos_url":"https://api.github.com/users/Xyfi/repos","events_url":"https://api.github.com/users/Xyfi/events{/privacy}","received_events_url":"https://api.github.com/users/Xyfi/received_events","type":"User","site_admin":false},"body":"Props to @mfolkeseth, he did the initial set up of this PR.\r\n\r\n## Description\r\n<!-- Please describe your changes -->\r\nAdds an API to add a menu item for plugins to the ellipsis menu.\r\n\r\nUsing this PR in regards to the `registerSidebar` API:\r\n```js\r\nwp.editPost.registerSidebar( \r\n    'plugin-namespace/plugin-id', \r\n    { title: \"Plugin Title\", render: () => \"Plugin content\" }\r\n);\r\n\r\nwp.editPost.registerEditorMenuItem( 'plugin-namespace/plugin-menu-item', {\r\n\t'title': \"Name\",\r\n\t'target': 'plugin-namespace/plugin-id',\r\n\t'icon': () => {\r\n\t\t// Return SVG as react component.\r\n\t\treturn (\r\n\t\t\t<svg>\r\n\t\t\t\t<circle cx={50} cy={50} r={10} fill=\"red\" />\r\n\t\t\t</svg>\r\n\t\t)\r\n\t}\r\n} );\r\n```\r\n\r\n## How Has This Been Tested?\r\n<!-- Please describe in detail how you tested your changes. -->\r\n<!-- Include details of your testing environment, tests ran to see how -->\r\n<!-- your change affects other areas of the code, etc. -->\r\nIt has been tested with 1, 0 and more added menu items.\r\nI used `console.log`'s to see whether the callbacks are actually called.\r\n\r\n## Screenshots (jpeg or gifs if applicable):\r\n\r\n## Types of changes\r\n<!-- What types of changes does your code introduce?  -->\r\n<!-- Bug fix (non-breaking change which fixes an issue) -->\r\n<!-- New feature (non-breaking change which adds functionality) -->\r\n<!-- Breaking change (fix or feature that would cause existing functionality to not work as expected) -->\r\nNew feature.\r\n\r\n## Checklist:\r\n- [x] My code is tested.\r\n- [x] My code follows the WordPress code style.\r\n- [x] My code follows has proper inline documentation.","created_at":"2018-01-15T14:04:37Z","updated_at":"2018-02-28T19:39:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f102ac5e13083312e679e92780e4ce024d806aeb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":631490822,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/Extensibility","name":"Extensibility","color":"655104","default":false}],"milestone":{"url":"https://api.github.com/repos/WordPress/gutenberg/milestones/8","html_url":"https://github.com/WordPress/gutenberg/milestone/8","labels_url":"https://api.github.com/repos/WordPress/gutenberg/milestones/8/labels","id":2564182,"number":8,"title":"Feature Complete","description":"Remaining high-level features to conclude the first version of Gutenberg.","creator":{"login":"jasmussen","id":1204802,"avatar_url":"https://avatars3.githubusercontent.com/u/1204802?v=4","gravatar_id":"","url":"https://api.github.com/users/jasmussen","html_url":"https://github.com/jasmussen","followers_url":"https://api.github.com/users/jasmussen/followers","following_url":"https://api.github.com/users/jasmussen/following{/other_user}","gists_url":"https://api.github.com/users/jasmussen/gists{/gist_id}","starred_url":"https://api.github.com/users/jasmussen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasmussen/subscriptions","organizations_url":"https://api.github.com/users/jasmussen/orgs","repos_url":"https://api.github.com/users/jasmussen/repos","events_url":"https://api.github.com/users/jasmussen/events{/privacy}","received_events_url":"https://api.github.com/users/jasmussen/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":18,"state":"open","created_at":"2017-06-06T07:41:55Z","updated_at":"2018-02-21T13:45:16Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/4484/commits","review_comments_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/4484/comments","review_comment_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/4484/comments","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/e70c88dba3fbeb6d2760da959f9349c6297092cb","head":{"label":"Yoast:add/api-add-ellipsis-menu-item","ref":"add/api-add-ellipsis-menu-item","sha":"e70c88dba3fbeb6d2760da959f9349c6297092cb","user":{"login":"Yoast","id":4690436,"avatar_url":"https://avatars0.githubusercontent.com/u/4690436?v=4","gravatar_id":"","url":"https://api.github.com/users/Yoast","html_url":"https://github.com/Yoast","followers_url":"https://api.github.com/users/Yoast/followers","following_url":"https://api.github.com/users/Yoast/following{/other_user}","gists_url":"https://api.github.com/users/Yoast/gists{/gist_id}","starred_url":"https://api.github.com/users/Yoast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yoast/subscriptions","organizations_url":"https://api.github.com/users/Yoast/orgs","repos_url":"https://api.github.com/users/Yoast/repos","events_url":"https://api.github.com/users/Yoast/events{/privacy}","received_events_url":"https://api.github.com/users/Yoast/received_events","type":"Organization","site_admin":false},"repo":{"id":112218128,"name":"gutenberg","full_name":"Yoast/gutenberg","owner":{"login":"Yoast","id":4690436,"avatar_url":"https://avatars0.githubusercontent.com/u/4690436?v=4","gravatar_id":"","url":"https://api.github.com/users/Yoast","html_url":"https://github.com/Yoast","followers_url":"https://api.github.com/users/Yoast/followers","following_url":"https://api.github.com/users/Yoast/following{/other_user}","gists_url":"https://api.github.com/users/Yoast/gists{/gist_id}","starred_url":"https://api.github.com/users/Yoast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yoast/subscriptions","organizations_url":"https://api.github.com/users/Yoast/orgs","repos_url":"https://api.github.com/users/Yoast/repos","events_url":"https://api.github.com/users/Yoast/events{/privacy}","received_events_url":"https://api.github.com/users/Yoast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yoast/gutenberg","description":"Printing since 1440. Development hub for the editor focus in core. Beta plugin is available from the official WordPress repository.","fork":true,"url":"https://api.github.com/repos/Yoast/gutenberg","forks_url":"https://api.github.com/repos/Yoast/gutenberg/forks","keys_url":"https://api.github.com/repos/Yoast/gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yoast/gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yoast/gutenberg/teams","hooks_url":"https://api.github.com/repos/Yoast/gutenberg/hooks","issue_events_url":"https://api.github.com/repos/Yoast/gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/Yoast/gutenberg/events","assignees_url":"https://api.github.com/repos/Yoast/gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/Yoast/gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/Yoast/gutenberg/tags","blobs_url":"https://api.github.com/repos/Yoast/gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yoast/gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yoast/gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yoast/gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yoast/gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/Yoast/gutenberg/languages","stargazers_url":"https://api.github.com/repos/Yoast/gutenberg/stargazers","contributors_url":"https://api.github.com/repos/Yoast/gutenberg/contributors","subscribers_url":"https://api.github.com/repos/Yoast/gutenberg/subscribers","subscription_url":"https://api.github.com/repos/Yoast/gutenberg/subscription","commits_url":"https://api.github.com/repos/Yoast/gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yoast/gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yoast/gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yoast/gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yoast/gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/Yoast/gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yoast/gutenberg/merges","archive_url":"https://api.github.com/repos/Yoast/gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yoast/gutenberg/downloads","issues_url":"https://api.github.com/repos/Yoast/gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/Yoast/gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/Yoast/gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/Yoast/gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yoast/gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/Yoast/gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/Yoast/gutenberg/deployments","created_at":"2017-11-27T16:08:02Z","updated_at":"2018-01-18T10:53:04Z","pushed_at":"2018-02-28T18:11:31Z","git_url":"git://github.com/Yoast/gutenberg.git","ssh_url":"git@github.com:Yoast/gutenberg.git","clone_url":"https://github.com/Yoast/gutenberg.git","svn_url":"https://github.com/Yoast/gutenberg","homepage":"https://wordpress.org/plugins/gutenberg/ ","size":10454,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"WordPress:master","ref":"master","sha":"4004ee2afb9ad099387a57ecfa9bdd0777d76d82","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-02-28T19:29:59Z","pushed_at":"2018-02-28T19:39:46Z","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":10777,"stargazers_count":2027,"watchers_count":2027,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":459,"mirror_url":null,"archived":false,"open_issues_count":789,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":459,"open_issues":789,"watchers":2027,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/4484"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/4484"},"issue":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/4484"},"comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/4484/comments"},"review_comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/4484/comments"},"review_comment":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/4484/commits"},"statuses":{"href":"https://api.github.com/repos/WordPress/gutenberg/statuses/e70c88dba3fbeb6d2760da959f9349c6297092cb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aduth"}}