{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/6753","repository_url":"https://api.github.com/repos/WordPress/gutenberg","labels_url":"https://api.github.com/repos/WordPress/gutenberg/issues/6753/labels{/name}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/6753/comments","events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/6753/events","html_url":"https://github.com/WordPress/gutenberg/pull/6753","id":323103189,"number":6753,"title":"Add support for Child Blocks","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},"labels":[{"id":631490822,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/Extensibility","name":"Extensibility","color":"655104","default":false},{"id":531680825,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Enhancement","name":"[Type] Enhancement","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":{"url":"https://api.github.com/repos/WordPress/gutenberg/milestones/54","html_url":"https://github.com/WordPress/gutenberg/milestone/54","labels_url":"https://api.github.com/repos/WordPress/gutenberg/milestones/54/labels","id":3350800,"number":54,"title":"3.0","description":"","creator":{"login":"gziolo","id":699132,"avatar_url":"https://avatars2.githubusercontent.com/u/699132?v=4","gravatar_id":"","url":"https://api.github.com/users/gziolo","html_url":"https://github.com/gziolo","followers_url":"https://api.github.com/users/gziolo/followers","following_url":"https://api.github.com/users/gziolo/following{/other_user}","gists_url":"https://api.github.com/users/gziolo/gists{/gist_id}","starred_url":"https://api.github.com/users/gziolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gziolo/subscriptions","organizations_url":"https://api.github.com/users/gziolo/orgs","repos_url":"https://api.github.com/users/gziolo/repos","events_url":"https://api.github.com/users/gziolo/events{/privacy}","received_events_url":"https://api.github.com/users/gziolo/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":31,"state":"open","created_at":"2018-05-16T07:11:53Z","updated_at":"2018-05-23T21:39:58Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2018-05-15T07:48:12Z","updated_at":"2018-05-24T09:00:03Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/6753","html_url":"https://github.com/WordPress/gutenberg/pull/6753","diff_url":"https://github.com/WordPress/gutenberg/pull/6753.diff","patch_url":"https://github.com/WordPress/gutenberg/pull/6753.patch"},"body":"## Description\r\n\r\nCloses #5540. I split this out from https://github.com/WordPress/gutenberg/pull/6346 which was mostly experimental — head there for extra context!\r\n\r\nAdds `parent` which lets you restrict a block so that it is only available as a nested block. \r\n\r\n```js\r\nregisterBlockType( 'acme/buy-button', {\r\n\ttitle: 'Buy Button',\r\n\ticon: 'cart',\r\n\tcategory: 'common',\r\n\r\n\t// Only allow in products:\r\n\tparent: [ 'acme/product' ],\r\n\r\n\t...\r\n} );\r\n```\r\n\r\n## How has this been tested?\r\nI wrote a [test plugin](https://gist.github.com/noisysocks/9b9503bd6489ffa51088d35c7a2a8ba0) which uses the new API. I then made sure that _Buy Button_ blocks only appear when inserted into a _Product_ block.\r\n\r\nA quick way to test this is to paste the contents of [`block.js`](https://gist.github.com/noisysocks/9b9503bd6489ffa51088d35c7a2a8ba0#file-block-js) into your browser console.\r\n\r\n## Screenshots <!-- if applicable -->\r\n\r\n![child-blocks](https://user-images.githubusercontent.com/612155/40043490-ee6a50b6-5867-11e8-824b-1fc87a1c275d.gif)\r\n\r\n## Types of changes\r\n\r\nBlock registration API changes:\r\n\r\n- Introduces `parent` which lets one specify which block types a block can be nested into.\r\n\r\nSelector changes:\r\n\r\n- Adds `canInsertBlockType` which is the source of truth for whether a block can be inserted or nested.\r\n- Removes the `allowedBlockTypes` argument from `getInserterItems`. This can be determined from state, now.\r\n- Items returned by `getInserterItems` will include new `utility` and `frecency` attributes. `utility` indicates how useful we think inserting the block will be. This lets us show contextually useful blocks at the top of the Suggested tab.\r\n- Deprecates `getSupportedBlockTypes`. `getInserterItems` will remove any blocks that are not supported. Alternatively, `canInsertBlockType` can be called directly.\r\n- Deprecates `getFrecentInserterItems`. Instead, call `getInserterItems` and filter/sort by `frecency`.\r\n\r\nInserter changes:\r\n\r\n- Both `inserter` and `inserter-with-shortcuts` have been changed to use `getInserterItems` and its new functionality."},"comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments/391642017","html_url":"https://github.com/WordPress/gutenberg/pull/6753#issuecomment-391642017","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/6753","id":391642017,"user":{"login":"jorgefilipecosta","id":11271197,"avatar_url":"https://avatars1.githubusercontent.com/u/11271197?v=4","gravatar_id":"","url":"https://api.github.com/users/jorgefilipecosta","html_url":"https://github.com/jorgefilipecosta","followers_url":"https://api.github.com/users/jorgefilipecosta/followers","following_url":"https://api.github.com/users/jorgefilipecosta/following{/other_user}","gists_url":"https://api.github.com/users/jorgefilipecosta/gists{/gist_id}","starred_url":"https://api.github.com/users/jorgefilipecosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorgefilipecosta/subscriptions","organizations_url":"https://api.github.com/users/jorgefilipecosta/orgs","repos_url":"https://api.github.com/users/jorgefilipecosta/repos","events_url":"https://api.github.com/users/jorgefilipecosta/events{/privacy}","received_events_url":"https://api.github.com/users/jorgefilipecosta/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T09:00:02Z","updated_at":"2018-05-24T09:00:02Z","author_association":"MEMBER","body":"Thank you for the clarification @noisysocks and @mtias!"}}
{"actor":{"display_login":"jorgefilipecosta"}}