Releases: GrapesJS/grapesjs
Releases · GrapesJS/grapesjs
v0.14.50
Docs
Changed
- Improved the extension of components via
DomComponents.addType
Read more about this here - In
isComponent
is not necessary anymore to return the object with itstype
to accept it, any truthy value is enough.
// Before
isComponent: el => {
if (el.tagName === 'SOME-TAG') {
return { type: 'my-component' };
}
}
// After
isComponent: el => el.tagName === 'SOME-TAG'
- Add default attributes in the creation of new components
- Emit
component:clone
event on the component which was cloned - Clear old attributes in
updateAttributes
- Don't trigger component hooks for temporary components
- Improved the parserHtml
Added
- Added
getTypes
method inDomComponents
v0.14.49
v0.14.48
Changed
- Rename the event
component:clone
in PasteComponent tocomponent:paste
and addcomponent:clone
to the clone method in Component
Added
- Added
index
method to the Component API - Make work the
visible
property in Panels. Closes #1602 by @arthuralmeidap - Add new hook methods to Component,
updated
andremoved
Fixed
- Avoid the delete of inputs on canc key. Fixes #1606
- Take care of parenthesis when split CSS style values. Fixes #1579
- Adjust the sorter placeholder when the parent has flex direction as column. Fixes #1626
- Clear properly composite style properties. Fixes #1613
- Check if fullscreen is active before running
exitFullscreen
. Fixes #1667
v0.14.43
Changed
- Changed the method name in ComponentTextView:
enableEditing
->onActive
- Update Property (Style Manager), make the
toRequire
option, work also with IDs of the property
Added
- Added
target
option infullscreen
command. Closes #1526 by @mcsekar12 - Create PropertySelect in styleManager
- Added
component:create
andcomponent:mount
events - Added
removeAll
method in Keymaps module
Fixed
- Fix highlightable property in canvas
- Load traits only if are not instance of Traits. Fixes #1563
- Pass the correct model to
component:styleUpdate
event. Fixes #1575 - Update correctly the text component on content change. Fixes #1511
- Sort media queries in export code. Fixes #1506
- Update how TextComponent handle children on change. Fixes #1593
- Unbind all key shortcuts on destroy. Fixes #1501
Docs
- Fix links in Blocks. Closes #1559
v0.14.40
Changed
- Allow strings in upload function of component image #1462
- Append external styles inside head instead of body #1473
- Improved Style Manager for a better extensibility
- Avoid adding styles for temporary components (eg. created when you drag blocks around the canvas)
Added
- Accepts strings as argument for the assets callback in Style Manager. Closes #1457
- Added
valueTrue
andvalueFalse
options to trait checkbox type. Closes #1424
This feature allows you to customize the boolean attribute on components
Example:
traits: [{
type: 'checkbox',
label: 'Show Name',
name: 'show-name',
valueTrue: 'TRUE-value',
valueFalse: 'FALSE-value',
// For default values you have to specify same true/false values
// You can add `value` in trait or on your components
value: 'FALSE-value',
}]
- Added ComponentStyleClear command and
style-signature
option in Component - Added
setTarget
method in StyleManager - Added
button
trait type - Added
styleManager:update:target
event to track target changes (Component or CSSRule) in Style Manager - Added
getTrait(traitName)
method in Component - Added new methods in Editor:
once
,getWrapper
- Added
log
option to the main config object
Fixed
- Avoid removing component on selector editing
- Store the wrapper if
avoidInlineStyle
is false #TODO issue in project - Return
body
selector, instead of#wrapper
, for the wrapper when requested - Run
npm start
cross-platform. Closes #1456 - Improve hover in SelectComponent command. Fixes #1448
- Avoid errors in case of textnode selection
- Fix duplicated CSS rules with at-rules. Closes #1513
- Update traits when a component is removed. Fixes #1535
v0.14.33
Changed
- Improved the Text component. Fixes #1394
- Improved the Resizer, make it understand
auto
values. #1415 by @nojacko - Re-render buttons on change of any of its properties
- Re-render blocks on change of any of its properties
Added
- Added
remove
method in Component API - Added ComponentWrapper which might be used to help identify the wrapper via
[data-gjs-type=wrapper]
- Added
component:update:components
event, which allows listen to inner components changes. Closes #1409 - Added the possibility to add custom CSS parsers, this will help to avoid inconsistency with built-in browser parsers.
editor.setCustomParserCss(css => {
const result = [];
// ... parse the CSS string
result.push({
atRule: 'media',
params: 'screen and (min-width: 480px)',
selectors: '.someclass:hover, div .otherclass',
style: { color: 'red' }
})
// ...
return result;
});
For an overview on how to built correctly rule objects check the guide here
- Implemented a simple event-based log system, eg:
editor.log('Something done!', { ns: 'from-plugin-x', level: 'info' });
// This will trigger following events
// `log`, `log:info`, `log-from-plugin-x`, `log-from-plugin-x:info`
// Callbacks of those events will always receive the message and
// options, as arguments, eg:
// editor.on('log:info', (msg, opts) => console.info(msg, opts))
Fixed
- Fixed default types in
open-assets
command. Closes #1411 - Don't mess with onbeforeunload unless user wants to. #1417 by @dsgh
- Fixed the class for disabled state of panel buttons. Closes #1421
- Fixed the loading of component, accept also arrays and objects. Closes #1429
- Fixed the initialization of checkbox traits. #1435
- Fix name editing of layers, which was deleting components
v0.14.29
Added
- Added touch support.
In order to make it work properly on all touch devices, you have to use grapesjs-touch plugin, which just includes some essential polyfills (eg. native drag & drop). Big thanks go to @saltyfoam for funding this feature and @Unsigno who actually made the work. There are still few issues regarding some devices (probably not even related to the feature itself), but we hope to fix them soon
v0.14.27
Docs
- Added Canvas module API https://grapesjs.com/docs/api/canvas.html
- Added Component API https://grapesjs.com/docs/api/component.html
Changed
- Replace
isInputFocused
withisEditing
in UndoManager - Clear traits values on init in Components
- Now command's state (active or not) is tracked.
const cm = editor.Commands; cm.run('preview'); cm.isActive('preview'); // -> true cm.stop('preview'); cm.isActive('preview'); // -> false
Added
- Added the possibility to use plugins assigned in
window
. More on this - Added new methods to Commands API:
getAll
,isActive
,getActive
Fixed
v0.14.25
Bug fixes and API improvements
Changed
- Adjust toolbar positioning on component change
Added
- Added
onActive
method in ComponentView which executes onactive
event - Added the possibility to open the modal with title and content via options
eg.editor.Modal.open({ title: 'Title', content: 'Content' })
- Added the possibility to append
label
on component toolbar buttons - Added
run
andstop
methods in Commands module
Fixed
v0.14.23
Changed
- Switched to Webpack v4,
⚠️ runnpm i
if you develop on GrapesJS - Don't output style declaration without value
- Refactored Modal view
Added
- Added
core:component-delete
to the keymap module - Added
togglable
option to Buttons, if it'sfalse
you can't turn off the button once enabled - Added documentation files in
docs
- Added youtube-nocookie.com as video provider #1270