Skip to content

Releases: webkom/lego-editor

v1.2.1

26 Sep 16:56
ddf66ef
Compare
Choose a tag to compare

Fixes

  • Editor could crash in some instances when editing complicated nested lists
  • Deleting/outdenting nested list items could move some items around or at worst, delete elements.
  • Pressing backspace on a list item with soft breaks and/or multiple blocks would delete the entire list item instead of deleting the line break/block.
  • When set to disabled or simple, some styles were missing from the editor.

v1.2.0

14 Jul 22:28
46d5e0d
Compare
Choose a tag to compare

New features

  • Added a new prop domParser to the editor. This props takes a function that parses a string to a HTML document for deserialization. This allows for the editor to be rendered in node.js using something like jsdom.

Fixes

  • With a slow uploadFunction for images, images would be places on top of each other and removed. This has been fixed along with an at option for the insert_image command from the images plugin. This also means that the image should be inserted in the correct location even though the editor loses focus.
  • Fixes an issue where the deserializer could crash in some rare cases.

v1.1.1

30 Jun 19:01
320c59f
Compare
Choose a tag to compare

Fixes

  • The onChange prop is now properly debounced and memoized. This should greatly improve performance when using the editor with form handlers like redux-form.

v1.1.0

20 Mar 01:33
6e1839d
Compare
Choose a tag to compare

This release brings a complete rewrite of all core parts of the editor! And with it a lot of bugfixes and improvements!

Improvements

  • Support for pasting rich text! When pasting rich text, it will be serialized in best effort to keep formatting. Note that google docs and some other editors may display text in strange ways (such as using span for all text and lists) and not serialize everything properly.
  • New markown shortcuts: 1. + space now creates an ordered list and > + space creates a blockquote.
  • Support for blockquotes. There is no button in the toolbar, but you can use shortcut as well as pasting pre-formatted text.
  • Indenting/outdenting a selection of lists is now possible.
  • The link input on the toolbar should be a lot more user-friendly with autofocus and auto-prepending http, as well as submit on click away.
  • A lot of issues have been fixed and editing should be a lot smoother and error-free in general.

Changes

  • The editor is now based on slate 0.56. This brings included types and a redisigned api.
  • shift + enter now gives newline at all times.
  • Elements and marks are now typed explicitly. The Elements can Marks types can be imported for use in plugins.
  • A helper interface LEditor is availble for use in plugins as well. (This is mostly used internally, but it gives a few helper function useful when extending the editor.
  • Custom key handlers can be added by adding a plugin which utilizes the 'key_handler' event. The command includes the event (KeyboardEvent). This can override any internal key handlers if wanted.

Breaking changes

  • Plugins now need to conform to slate 0.56 (note that this is different from 0.57!). The new plugins will now have the signature: Editor => Editor, meaning a fnuction that changes the methods on the editor directly and returns this. See slate docs for more details.

v1.0.3

14 Sep 19:55
Compare
Choose a tag to compare

Fixes a bug where the image deserializer did not assign the attribute name to the node data properly.

v1.0.1

14 Sep 18:21
64fff3e
Compare
Choose a tag to compare

Changes

  • The image uploader now retains the file name in the inserted file.

v1.0.0

14 Sep 18:18
c6722cd
Compare
Choose a tag to compare
Merge pull request #9 from webkom/image-fixes

Image fixes ++