{"action":"created","issue":{"url":"https://api.github.com/repos/SamyPesse/draftjs-prism/issues/1","repository_url":"https://api.github.com/repos/SamyPesse/draftjs-prism","labels_url":"https://api.github.com/repos/SamyPesse/draftjs-prism/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/SamyPesse/draftjs-prism/issues/1/comments","events_url":"https://api.github.com/repos/SamyPesse/draftjs-prism/issues/1/events","html_url":"https://github.com/SamyPesse/draftjs-prism/issues/1","id":156782633,"number":1,"title":"Consider the same API as draftjs-plugins","user":{"login":"okonet","id":11071,"avatar_url":"https://avatars.githubusercontent.com/u/11071?v=3","gravatar_id":"","url":"https://api.github.com/users/okonet","html_url":"https://github.com/okonet","followers_url":"https://api.github.com/users/okonet/followers","following_url":"https://api.github.com/users/okonet/following{/other_user}","gists_url":"https://api.github.com/users/okonet/gists{/gist_id}","starred_url":"https://api.github.com/users/okonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okonet/subscriptions","organizations_url":"https://api.github.com/users/okonet/orgs","repos_url":"https://api.github.com/users/okonet/repos","events_url":"https://api.github.com/users/okonet/events{/privacy}","received_events_url":"https://api.github.com/users/okonet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SamyPesse/draftjs-prism/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-05-25T15:40:16Z","updated_at":"2016-05-30T07:54:08Z","closed_at":null,"body":"There is a cool project https://github.com/draft-js-plugins/draft-js-plugins that has a very nice plugin API for draft-js. I really like how you can just define an array of plugins you want to use:\r\n\r\n```jsx\r\nimport React, { Component } from 'react';\r\nimport Editor from 'draft-js-plugins-editor';\r\nimport createHashtagPlugin from 'draft-js-hashtag-plugin';\r\nimport createLinkifyPlugin from 'draft-js-linkify-plugin';\r\nimport { EditorState } from 'draft-js';\r\n\r\nconst hashtagPlugin = createHashtagPlugin();\r\nconst linkifyPlugin = createLinkifyPlugin();\r\n\r\nconst plugins = [\r\n  hashtagPlugin,\r\n  linkifyPlugin,\r\n];\r\n\r\nexport default class UnicornEditor extends Component {\r\n\r\n  state = {\r\n    editorState: EditorState.createEmpty(),\r\n  };\r\n\r\n  onChange = (editorState) => {\r\n    this.setState({\r\n      editorState,\r\n    });\r\n  };\r\n\r\n  render() {\r\n    return (\r\n      <Editor\r\n        editorState={this.state.editorState}\r\n        onChange={this.onChange}\r\n        plugins={plugins}\r\n        ref=\"editor\"\r\n      />\r\n    );\r\n  }\r\n}\r\n```\r\n\r\nWould you consider adapting this API?\r\n"},"comment":{"url":"https://api.github.com/repos/SamyPesse/draftjs-prism/issues/comments/222434179","html_url":"https://github.com/SamyPesse/draftjs-prism/issues/1#issuecomment-222434179","issue_url":"https://api.github.com/repos/SamyPesse/draftjs-prism/issues/1","id":222434179,"user":{"login":"SamyPesse","id":845425,"avatar_url":"https://avatars.githubusercontent.com/u/845425?v=3","gravatar_id":"","url":"https://api.github.com/users/SamyPesse","html_url":"https://github.com/SamyPesse","followers_url":"https://api.github.com/users/SamyPesse/followers","following_url":"https://api.github.com/users/SamyPesse/following{/other_user}","gists_url":"https://api.github.com/users/SamyPesse/gists{/gist_id}","starred_url":"https://api.github.com/users/SamyPesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamyPesse/subscriptions","organizations_url":"https://api.github.com/users/SamyPesse/orgs","repos_url":"https://api.github.com/users/SamyPesse/repos","events_url":"https://api.github.com/users/SamyPesse/events{/privacy}","received_events_url":"https://api.github.com/users/SamyPesse/received_events","type":"User","site_admin":false},"created_at":"2016-05-30T07:54:08Z","updated_at":"2016-05-30T07:54:08Z","body":"@nikgraf  `CompositeDecorator` are a subset of that i's possible with decorators an Draft, the problem is that `CompositeDecorator` limits the component/props to be global to the decorator.\r\n\r\nIn the case of the prism decorator, we need different props according to the type of tokens. So basically, it's not possible to build the prism highlighting as a `CompositeDecorator`.\r\n\r\nBut I've build [draftjs-multidecorators](https://github.com/SamyPesse/draftjs-multidecorators) to accept multiple decorators (composite or not) and return one.\r\n\r\nDo `draftjs-plugins` only accept composite decorator for now?"}}
{"actor":{"display_login":"SamyPesse"}}