{"action":"created","issue":{"url":"https://api.github.com/repos/the-grid/ed/issues/70","repository_url":"https://api.github.com/repos/the-grid/ed","labels_url":"https://api.github.com/repos/the-grid/ed/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/the-grid/ed/issues/70/comments","events_url":"https://api.github.com/repos/the-grid/ed/issues/70/events","html_url":"https://github.com/the-grid/ed/issues/70","id":134529910,"number":70,"title":"Separation of concerns: Placeholder creation spread across App and Ed","user":{"login":"hannesstruss","id":115381,"avatar_url":"https://avatars.githubusercontent.com/u/115381?v=3","gravatar_id":"","url":"https://api.github.com/users/hannesstruss","html_url":"https://github.com/hannesstruss","followers_url":"https://api.github.com/users/hannesstruss/followers","following_url":"https://api.github.com/users/hannesstruss/following{/other_user}","gists_url":"https://api.github.com/users/hannesstruss/gists{/gist_id}","starred_url":"https://api.github.com/users/hannesstruss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannesstruss/subscriptions","organizations_url":"https://api.github.com/users/hannesstruss/orgs","repos_url":"https://api.github.com/users/hannesstruss/repos","events_url":"https://api.github.com/users/hannesstruss/events{/privacy}","received_events_url":"https://api.github.com/users/hannesstruss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-18T09:45:18Z","updated_at":"2016-02-18T13:23:16Z","closed_at":null,"body":"Currently, when sharing URLs, Ed creates the placeholder. For sharing images, there is `ed.insertBlocks(index, blocks)`, which requires the app to create the placeholders itself.\r\n\r\nI think for consistency it should only be one component's responsibility to actually construct placeholder blocks. Currently, the knowledge about placeholder construction, the placeholder block's internal structure (`metadata.status` etc.) is spread across app and Ed. Since Ed has to interpret placeholder blocks anyway, it should be the single source of construction as well. I'd encapsulate that behind a more narrowly scoped API like (a less verbose version of) `ed.createPlaceholdersForImages(originalPlaceholderBlockId, numberOfPlaceholders)` which could return an array of placeholder block IDs to share into. \r\n\r\nLet's discuss that in the meeting suggested in #editor!\r\n\r\ncc @nickvelloff "},"comment":{"url":"https://api.github.com/repos/the-grid/ed/issues/comments/185716012","html_url":"https://github.com/the-grid/ed/issues/70#issuecomment-185716012","issue_url":"https://api.github.com/repos/the-grid/ed/issues/70","id":185716012,"user":{"login":"forresto","id":395307,"avatar_url":"https://avatars.githubusercontent.com/u/395307?v=3","gravatar_id":"","url":"https://api.github.com/users/forresto","html_url":"https://github.com/forresto","followers_url":"https://api.github.com/users/forresto/followers","following_url":"https://api.github.com/users/forresto/following{/other_user}","gists_url":"https://api.github.com/users/forresto/gists{/gist_id}","starred_url":"https://api.github.com/users/forresto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forresto/subscriptions","organizations_url":"https://api.github.com/users/forresto/orgs","repos_url":"https://api.github.com/users/forresto/repos","events_url":"https://api.github.com/users/forresto/events{/privacy}","received_events_url":"https://api.github.com/users/forresto/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T13:23:16Z","updated_at":"2016-02-18T13:23:16Z","body":"That's easy enough. Making it work with `setContent` was @JohnRandom's ask to keep it flow fluxy. Convenience methods like these are fine to add on top for apps. Would be more like\r\n\r\n`ed.createPlaceholders(index, count)`\r\n\r\nSince app only has the index at that point, and placeholders are the same for files and urls (though we could add cover via data url in future). Going down this path (apps don't munge blocks), would you also want `ed.updatePlaceholder(id, {status, progress})`?"}}