{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/draft-js/issues/93","repository_url":"https://api.github.com/repos/facebook/draft-js","labels_url":"https://api.github.com/repos/facebook/draft-js/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/facebook/draft-js/issues/93/comments","events_url":"https://api.github.com/repos/facebook/draft-js/issues/93/events","html_url":"https://github.com/facebook/draft-js/issues/93","id":136532912,"number":93,"title":"Collaborative Editing","user":{"login":"simonlast","id":1704018,"avatar_url":"https://avatars.githubusercontent.com/u/1704018?v=3","gravatar_id":"","url":"https://api.github.com/users/simonlast","html_url":"https://github.com/simonlast","followers_url":"https://api.github.com/users/simonlast/followers","following_url":"https://api.github.com/users/simonlast/following{/other_user}","gists_url":"https://api.github.com/users/simonlast/gists{/gist_id}","starred_url":"https://api.github.com/users/simonlast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonlast/subscriptions","organizations_url":"https://api.github.com/users/simonlast/orgs","repos_url":"https://api.github.com/users/simonlast/repos","events_url":"https://api.github.com/users/simonlast/events{/privacy}","received_events_url":"https://api.github.com/users/simonlast/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/draft-js/labels/discussion","name":"discussion","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-02-25T22:35:37Z","updated_at":"2016-06-07T10:24:33Z","closed_at":null,"body":"It would be great if this library exposed abstractions required for collaborative editing.\r\n\r\nOne way to do this would be to expose an event handler that, instead of emitting the entire new state, emitted a transaction object that described how the state changed. An implementer would then need to have a collaborative data model, which would then ingest the transaction objects.\r\n\r\nAnother way would be for Draft.js to represent its state using a collaborative data model (CRDT for example), and be able to both emit and ingest transactions. This would obviously be a lot harder."},"comment":{"url":"https://api.github.com/repos/facebook/draft-js/issues/comments/224240361","html_url":"https://github.com/facebook/draft-js/issues/93#issuecomment-224240361","issue_url":"https://api.github.com/repos/facebook/draft-js/issues/93","id":224240361,"user":{"login":"slorber","id":749374,"avatar_url":"https://avatars.githubusercontent.com/u/749374?v=3","gravatar_id":"","url":"https://api.github.com/users/slorber","html_url":"https://github.com/slorber","followers_url":"https://api.github.com/users/slorber/followers","following_url":"https://api.github.com/users/slorber/following{/other_user}","gists_url":"https://api.github.com/users/slorber/gists{/gist_id}","starred_url":"https://api.github.com/users/slorber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slorber/subscriptions","organizations_url":"https://api.github.com/users/slorber/orgs","repos_url":"https://api.github.com/users/slorber/repos","events_url":"https://api.github.com/users/slorber/events{/privacy}","received_events_url":"https://api.github.com/users/slorber/received_events","type":"User","site_admin":false},"created_at":"2016-06-07T10:24:33Z","updated_at":"2016-06-07T10:24:33Z","body":"> One option I have considered is the Quip approach of locking blocks that are being edited by others. In this way, as the remote user modifies the locked block, the full state of that block can be sent at intervals. (Live per-character changes aren't especially important if the block is locked.) It's a heavier payload to send a whole block, of course.\r\n\r\n@hellendag Hi. I don't know so much DraftJS so far but I'm interested to know. Do you think this approach can be implemented in userland? For example can it be possible to add a class to locked blocks, and refuse new inputs only on these blocks?\r\n\r\nI'm interested by this because I need the annotate/highlight like Medium does. They mark every top-level text node (p, h1, h2, pre, code...) with a name, and their annotations are positionned with (nodeName,offset). This way it's easy for them to keep sanity in their annotations even after text edition (while plugins like AnnotatorJS, based on XPath strings, tend to fail hard after edits). So I'll probably already have named blocks, and I'm ok to not have the shiniest CRDT algorithm and locking text nodes is fine for me."}}
{"actor":{"display_login":"slorber"}}