Closed mattgrill closed 6 years ago
I worked with Draft.js for couple of months. I would make a deep research before choosing this library specially because it implements its own data structure https://medium.com/@rajaraodv/how-draft-js-represents-rich-text-data-eeabb5f25cf2 and DraftJS doesn’t offer any “exportToHTML” serialisation. You rely on community efforts like https://github.com/hubspot/draft-convert or https://github.com/jpuri/draftjs-to-html to get your HTML out There is much more promising https://github.com/ianstormtaylor/slate but I haven’t used it personally. It’s still marked as beta @wimleers spent a lot of time researching wysiwyg editors when doing inline editing, and collaborating with CKeditor guys. Maybe he could have suggestions where to look
I think it'd be great to use CKEditor5 and continue that collaboration. I also saw a demo of it which resembled Dropbox Paper's editor. Where you can do inline markdown editing (##
then space makes h2, etc). And "Medium" like editing where select + hover allows formatting changes.
There are existing bridges with that community and technology, so there are benefits I believe.
@dcorb There is also, https://github.com/sstur/draft-js-utils/tree/master/packages/draft-js-export-html which appears to be pretty feature rich for exporting HTML. There is also, https://github.com/icelab/draft-js-ast-exporter for storing the state as an AST.
@mattgrill those 2 repos don't look well maintained to me Another issue I experienced with DraftJS is the lack of Android support. FB is not interested to fix bugs in Android browsers https://github.com/facebook/draft-js/search?q=android&type=Issues The situation with Android could improve.. it seems: https://github.com/facebook/draft-js/pull/1672#issuecomment-369367386
I don't know what are the implications of choosing Draft.js for drupal-admin-ui (is this project just a demo to throw away? Or the foundation for future work?)
A customizable framework for wysiwyg ediitor independent from react (https://github.com/ianstormtaylor/slate)
It seems to have a good amount of momentum and it is designed for more usecases, especiially embedding custom objects, see https://github.com/ianstormtaylor/slate#why
Gutenberg from Wordpress could be used / ported to Drupal https://testgutenberg.com/ These guys ported Gutenberg to Drupal "hacking" some files and they want to talk about it in DrupalEurope https://www.drupaleurope.org/session/introducing-gutenberg-content-editor-drupal-8
Probably very few chances of happening, for multiple reasons. But just to keep in the radar
Some initial research around WYSIWYG solutions. There are probably others, and some I skipped over for that that did not seem feature rich enough for our needs.
Draft.js
React Draft Wysiwyg - https://github.com/jpuri/react-draft-wysiwyg
React Rich Text Editor - https://github.com/sstur/react-rte/
Medium Draft - https://github.com/brijeshb42/medium-draft
TinyMCE & CKEditor
React TinyMCE - https://github.com/instructure-react/react-tinymce
CKEditor React - https://github.com/ckeditor/ckeditor5-react