- A new prop
toolbarConfig
has been introduced. So instead of passing whole configuration intoblockButtons
andinlineButtons
, you can just pass,toolbarConfig
with value
{block: ["header-three", "blockquote", ...], inline: ["BOLD", "ITALIC", "UNDERLINE", "hyperlink"]}
Note that the string values of the array must already be present in BLOCK_BUTTON
and INLINE_BUTTONS
in medium-draft
(@roy-gbiv)
- Extra props can be passed to the
component
of each item insideButtons
inside theprop
key. Earlier, onlytitle
andcomponent
were accepted. Now a 3rd keyprop
can also be passed whose keys can be accessed inside thecomponent
throughthis.props
(@ jaspersorrio) - Fixed paste handling when cursor is inside image block caption. Earlier, the
src
of image becameundefined
. Now, plaintext will be pasted if the cursor is inside Image block. Otherwise, Draft's pasting will take over. - Now a string of text can also be passed to
createEditorState
as the first argument to create initialeditorState
pre-filled with the text.
- Added
medium-draft-importer
to convert html exported usingmedium-draft-exporter
to draft's json format (@Yukaii) - Fixed arrow navigation around image blocks
- Allow inline styles to be applied to heading blocks
- Remove hardcoded fonts from css files
- Now, the toolbar buttons also accept a react component instead of just a string as label. This can be used to customize the icon of the toolbar button. For ex - in the demo, blockquote and link buttons are svg components which previously were just string labels.
- Added a link info tooltip that shows up when cursor is inside a word with hyperlink.
- The tooltip has option to edit that link or unlink.
- Added medium's shortcut to add a link to text selection
- CTRL/CMD + K -> Add link
- CTRL/CMD + SHIFT + K -> Remove link if cursor is inside a word with link.
- Optimized build process by minifying css and removing prop-types from the build files.
- Migrated to React 15.5 (@baldwmic) with external
prop-types
dependency.
- Moved away from the deprecated
Entity
usage ofdraft-js
and updated to draft-js 0.10.1 (@valthon) - Fix for unintentional page navigation when adding links (@J00nz)
- Fix where first click on side (+) button made it dissappear (@J00nz)
- Accept only image files through file selector (@anthonyjgrove)
- Added medium-draft-exporter to convert the draft-js JSON data to HTML.
- Moved away from string refs to recommended refs in React.
- Updated to use draft-js v0.9.1
- Namespaced all classes to start with
md-
- Add relevant class to editor container based on whether editing is enabled or disabled