Docs
Changed
- Avoid scrollIntoView if the element isn't found
- Clean JS from
script
on component remove - Print a warning when trying to use not existing component type
Added
- Added Comment component
- Added
textable
property #481 example - Added
stopCommand
method to all commands - Added
extend
method to the Commands module - Added
findType
,removeTrait
,addTrait
,updateTrait
andgetTraitIndex
methods to Component
For more details about those methods check the Component API Reference - Added options argument to
Editor.select
method
The only available option for now isscroll
, which allows you to scroll the canvas
to the selected component:editor.select(component, { scroll: true })
- Added
appendOnClick
option (defaultfalse
) to Blocks module #1951
This would allow appending blocks also on click, not only by drag & drop - Enable the possibility to accept components as a function
You can easily create components with dynamic default templatesdomc.addType('some-type', { model: { defaults: { label: 'Value for some custom prop', // You can return an HTML string, Component object or // an array which mixes all of them components: component => `<div class="something"> ${this.get('label')} </div>`, } } });
- Improved
addType
in Components module. AddedextendFn
andextendFnView
options.
When you need to reuse functions, of the parent you're extending, generally what you do is this:Now you can do it faster by doing:domc.addType('new-type', { extend: 'parent-type', model: { init() { domc.getType('parent-type').model.prototype.init.apply(this, arguments); // do something; }, } });
The same would be for the view by usingdomc.addType('new-type', { extend: 'parent-type', extendFn: ['init'], // array of model functions to extend model: { init() { // do something; }, } });
extendFnView
Fixed
- Scroll the RTE toolbar if the text component is bigger than the view. Closes #1980
- Fix autosave issue in remote storage. Closes #1985
- Avoid moving styles from Components to Rules. Fixes #1978
- Store the last return of the stateful command
- Make Layers more reliable and generally more aware of textnodes #1949
- Skip rendering for temporary components #1941
- Avoid
undefined
value in select traits - Avoid the default link behavior in the canvas
- Avoid showing in layers not layerable components
Removed
- Removed old deprecated commands: CreateComponent, DeleteComponent, SelectParent