Releases: GrapesJS/grapesjs
Releases · GrapesJS/grapesjs
v0.16.12
Added
- Added Brazilian Portuguese language #2653
- Added
closestType
andempty
methods to Component API - Added
disable
property to the Block - Added module aliases to the Editor object
DomComponents
->Components
LayerManager
->Layers
CssComposer
->Css
StorageManager
->Storage
AssetManager
->Assets
BlockManager
->Blocks
TraitManager
->Traits
SelectorManager
->Selectors
StyleManager
->Styles
DeviceManager
->Devices
Changed
- Customize Sorter placeholder color via CSS #2662
- Add a default limit (500) of maximum steps in UndoManager
Can be changed byconfig.undoManager.maximumStackLength
option on init
Fixed
- Update canvas tools on input event trigger in components
- Fix borders not always toggling back when exiting preview #2689
- Close the color picker if click event happens on canvas #2695
- Avoid canvas errors by ensuring the view on the element render
- Fixed wrong toolbar position #2656
- Fixed major memory leaks in components
- Fixed TableRow model component #2697
- Fixes on color picker #2694
v0.16.3
v0.16.2
Added
- Added
style:update
andstyle:update:{property}
events for StyleManager - Added new
component:drag
events #2500 - Added a new
svg-in
component to handle better inner SVG elements - Trigger
component:drag
events in Layers #2528 - Added German translation by @chickahoona #2578
- Added new
config.assetManager.showUrlInput
option. by @jcamejo #2602
Changed
- Refactored the canvas #2524
- Improved how the style property is taken in stack properties
Fixed
- Check property visibility on render #2497
- Fix Selector Manager styles for Firefox/IE/Edge #2490
- Update video attributes on render #2501
- Avoid useless attributes on nodes inside text components #2508
- Avoid 404 requests on background property change #2538
- Update style on block drop in absolute mode
- Check visibility borders on preview stop #2589
- Preserve the display value on layer hide #2571
- Check for the href value in appendStyles to avoid 404 errors #2605
- Fix ComponentImage's default src not being base64 encoded #2619
v0.15.10
Added
- Added new options for customization to
config.selectorManager
and the component-first selection viaconfig.selectorManager.componentFirst
option #2474 - Added
state
option in RTE actions to enable custom checks for enabling/disabling action buttons. Thanks @adriangroch #2429 - Added Spanish language. Thanks to @josfh2005 #2443
- Added French language. Thanks to @jmalapeer #2449
Changed
- Escape HTML characters when converting text node to HTML. Thanks @mcammisa #2446
- Use
custom-name
property on layer name edit - Update layers view when component prop
layerable
changes #2433
Fixed
v0.15.9
Docs
- Added documentation about I18n Module and its API
Changed
- Sync text component content with custom RTE #2292
- Removed FontAwesome from dependencies to load it asynchronously by the new
cssIcons
option #644
Added
- I18n module
Fixed
- Fixed text component issue on toolbar commands execution #2294
- Fixed Firefox bug with label editing #2332
- Fixed issues in absolute mode and components with scripts #2359
- Fixed body counter in Layers #2413
- Make integer property extendable #2360
- Fixed issue on component drag in absolute mode #2371
- Preserve selection after
canvas:drop
#2396 - Remove empty value from
target
trait #2411
v0.15.8
Changed
- Make
config.avoidInlineStyle
true by default
We actually gonna stop to support the old inline-style method so this option will be removed soon - Guarantee the uniqueness of components id
Now if you update the component with the id attribute that already exists, it will rollback to the previous one
Added
- Added
config.styleManager.textLayer
option #2246
Fixed
v0.15.5
Docs
- Update docs for richTextEditor config #2241
Changed
⚠️ Typo fixconfig.wrappesIsBody
->config.wrapperIsBody
@jcamejo #2222- Set
avoidDefaults
true by default - Support objects/arrays in script interpolations #2239
Added
- Added
at
option toaddProperty
method in StyleManager #2213 - Added
config.assetManager.beforeUpload
callback option (thanks to @tliscomb) #2227
Fixed
v0.15.3
Docs
- Updated Traits module page
Changed
⚠️ editor.addComponents
now returns always an array of added components. So, if you ever used its result like this:now it should beconst component = editor.addComponents('<div>...');
const component = editor.addComponents('<div>...')[0];
⚠️ Updated traits layout. If you've ever customized the CSS of your traits you might see something broken- Upgrade to Babel 7
- Recreate view element on
script
prop update - Log a warning in case no sector, in StyleManager, is found #2068
Added
- Added support for components generated from JSX (React preset).
In this way, you can useeditor.addComponents(<div>Hello JSX</div>)
to add components. JSX helps the editor in performances as it skips the parsing of an HTML string but keeps the readability of your code.
If you work in a different framework environment with JSX support (eg. writing JSX in Vue SFC generates another kind of objects) you can use a customprocessor
callback function as an option in theDomComponent
module to transform those objects (quick example from the code). - Added the possibility to specify the position on sector add via API #2094
- Added
draggableComponents
option (defaulttrue
) in DomComponents. This allows moving
components by dragging the component itself (not only by the move icon in the toolbar) - Allow dropping blocks absolutely when the
absolute
mode is active - Added
script-export
property to Component (check the API Reference of the property) - Added
escapeName
option and method in SelectorManager #1703
With this option you can now set a custom name escape strategy on selectors (eg. classes)grapesjs.init({ ... selectorManager: { escapeName: name => name.replace(' ', '___'), }, });
- Added
props
method in Trait and Component - Added new [API for extending Traits] (https://grapesjs.com/docs/modules/Traits.html#define-new-trait-type)
- Added new Drag Mode API for changing drag modes of components in canvas
config.dragMode
- The initial configuration for the global drag modeeditor.setDragMode
- change the global drag mode of componentscomponent.setDragMode
- change the drag mode of a single component
Fixed
v0.14.62
Changed
- Avoid the default form behavior on submit
- Prefer target value first in Select trait
- Remove traits information from component JSON
- Update icon styles in layers and component name editing
- Trigger
component:add
also on inner added components
Added
- Added
media
option to blocks (for icons) - Added
removeType
method inDomComponents
module
Fixed
- Update sortMediaObject to sort CSS correctly also in the mobile first approach #1996
- Fix regression with textable components
- Render attributes for temporary components. Fixes #2010
- Fix drag and drop from outside of the canvas
- Avoid
fetchFile
in temporary image components - Fix unit change in Style manager #2028
- Avoid errors on class status toggle. Closes #2035
- Fix position of the toolbar when is outside of the canvas
- Propagate the extension of new commands to old. #2054
v0.14.61
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