Releases: webkom/lego-editor
Releases · webkom/lego-editor
v1.3.0
New features
- Inputting links has been revised with a completely new component that should be a lot smoother and easy to use than the existing one.
- Support for darkmode!
A new propdarkmode
has been added to enable this.
Changes
- ts-loader is now being used the development app.
- The example project is now linted, the same as the package source files.
v1.2.1
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
orsimple
, some styles were missing from the editor.
v1.2.0
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 anat
option for theinsert_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
v1.1.0
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
canMarks
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 theevent
(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 from0.57
!). The new plugins will now have the signature:Editor => Editor
, meaning a fnuction that changes the methods on theeditor
directly and returns this. See slate docs for more details.