Releases: GrapesJS/grapesjs
Releases · GrapesJS/grapesjs
v0.14.57
Changed
- Force stop commands in Panels/ButtonView
- Refactor
preview
command - Make
modal:open
/modal:close
events more reliable - Remove related CSS rules of a removed component
- Update the
textnode
component and make it more compliant to other components - Refactor
DomComponents.clear
method
Added
- Added
run
andstop
events for Commands - Add
onceClose
/onceOpen
methods in Modal module - Add
strict
option in Command module configs #1881 - Add
fetchOptions
for the RemoteStorage. Closes #1885
Fixed
v0.14.55
Changed
- Allow default as a function in component addType
- Add the possibility to preventDefault from
add
method, in Keymaps module ⚠️ Commandsrun
/stop
can't be executed many times in the same state.
So if the command is already active, calling it viaeditor.runCommand
will
not trigger that command again. But in case you need to run the command, in any
way, you can force its execution withforce
:
editor.runCommand('CMD', { force: 1 });
- Avoid duplicate IDs on components
- Refactor TraitSelectVIew and listen options changes
- Ensure default units for devices
- Move ratioDefault option from the Resize command to image component
- Accept
classes
as a string in Component - Refactor
@utils/Resizer
and update its container on text component change - Improve the recognition of stateless commands
- Merge element content in text components before toHTML. Closes #1767
Added
- Added model and property value to the trigger of
change:attributes:ATTR
event - Added the possibility to disable StorageManger with
storageManager: false
(any falsy value is ok) - Custom tag for buttons in Panels module. Closes #1787
- Added the possibility to zoom the canvas via
editor.Canvas.setZoom(VALUE_FROM_0_TO_100)
- Added custom render for blocks. Now you can pass a
render
callback function when you create blocks (Blocks docs updated) - Added
fallback
property to Image component and its default placeholder images - Added
component:type:add
andcomponent:type:update
events to track changes on component types - Added
update
event to generally listen any change to the template (HTML/CSS)
Fixed
- Fixed not working toolbar buttons with Text components. #1567 by @arthuralmeidap
- Ensure default CSS block container. Fixes #1829
- Avoid property breaking in StyleManager without
property
. Fixes #1830 - Reset upload input file in AssetManager. Closes #1816
- Fix empty provider select in the video component traits
- Check protected attribute before removing a tag #1857 by @WebEtSolutions
- Fix scrollIntoView issue in Layers. Closes #1865
Removed
- Removed old commands:
image-comp
,text-comp
,insert-custom
v0.14.52 ⚠️
Docs
- Update broken link in Components. Closes #1689
Changed
⚠️ SetcontentTypeJson
default totrue
(RemoteStorage)- Added
<a>
to defaultnotTextable
option in the Canvas configuration. Closes #1699 - Updated
add
andget
methods in Selector module, now they can receive an array of selectors to add/get - Allow to render blocks container outside by using
external
option. #1716 - Agjust
justify-content
in traits style. Closes #1726 - Adjust component toolbar positioning. #1728 by @arthuralmeidap
- Pass the Editor instance on
load
event - Update classes in SectorView to allow an easier customization. Closes #1753
Added
- Added
autoscrollLimit
option in the Canvas module - Added
credentials
option in the Storage module (for the RemoteStorage) by @arthuralmeidap - Added
modal:open
andmodal:close
events in the Modal module. Closes #1717 - Added
setRule
andgetRule
in CssComposer module - Added
ignoreCategories
option to therender
method in BlockManager module - Added
customFetch
option in AssetManager module
Fixed
- Avoid updating frame offset on Layer click. Fixes #1711
- Fixed UndoManager in components with
scripts
. Closes #1512 by @thinkanymore
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