GrapesJS - 一个通过拖拽建站开源工具
GrapesJS - 免费和开源Web Builder框架,用于无需编码构建模板的下一代工具
v0.16.30
Added
- Added Catalan language #3105
- Allow to pass
el
prop to Buttons from Panels module - New
getRules(selector)
method added in CssComposer module - Added and improved destroy method in all modules, in order to fix general memory leaks
- Added
limitlessMax
andlimitlessMin
props to InputNumber in order to allow showing calculated values from components #3147 - Added keydown event to handle up and down arrows in InputNumber #3158
- Added
contains
method to Component - Started Symbol implementation (for now, only private APIs)
Changed
- Codemirror version upgrade #3106
- Improve number trait #3132
- Replaced
node-sass
withdart-sass
#3148 - Apply
avoidDefaults
option also toSelectors
intoJSON
method
Fixed
- Clone properly the component with its related styles #3093
- Fix unbind of keymaps #2758
- Fix RTE update in text components #3069
- Fix update of properties on
setTarget
in StyleManager #3081 - Fix hover state in Layers #3065
- Prevent frame scroll on the first component drag #3134
- Parse single textnode as component #3034
- Prevent losing component id on undo/redo
Assets
2
v0.16.27
Added
- Expose PropertyFactory in StyleManager
- Added
tools
option toeditor.refresh()
- Handle multiple selection in Layers
- Trigger
change:style
andchange:style:PROPERTY
event on selected componets during style update via Style Manager - Added
attributes
option to theModal.open()
method #2592
editor.Modal.open({ title: 'T', content: 'C', attributes: { class: 'custom-cls' } })
- Added
parse:html
andparse:css
events for catching parsers results - Added Polish language #3087
Changed
Fixed
- Fixed for in loop in commands #3006
- Check only the component style for the target update #2657
- Avoid dragging in canvas non-draggable components #3014
- Destroy correctly the LayerManager #3005
- Prevent update trigger from TraitNumberView
- Fixed default value get in TraitNumberView
- Fixed non integer steps for slider property #3029
- Don't use
display: block
on visible sectors and properites in StyleManager #3067 - Rollback to the
strikeThrough
RTE command #3047 - Avoid style remove on blur from the text component #3069
- Fixed setTarget method in StyleManager #3081
Assets
2
v0.16.22
Added
- Expose options parameter to
setStyle
&setComponents
#2872 - Added Korean language #2983
- New API for custom properties in Style Manager (similar to Traits)
Changed
- Made Helvetica sans-serif by default #2881
- Replace obsolete tag
<strike>
by<s>
in RTE #2886 - Avoid adding, to components, empty parsed HTML strings
- Added
options
as a second argument ofcomponent.addAttributes
method
Fixed
- Output properly boolean attributes from HTML string import (eg. required, disabled) #2844
- Update component tools box once image finished to load #2871
- Fixed retrieval of layers' visibility #2863
- Ensure resizer on the correct component #2876
- Disable component drag on preview #2904
- Render correctly the textnode component #2882
- Add
list
prop to video component (youtube related) #2887 - Ensure selected value in select Trait type #2896
- Fully clear hover state on mouseleave #2907
- Avoid infinite recursion in Firefox on component drag #2911
- Fixed
editor.load
bug with undo manager #2921 - Make textnodes correctly removable #2918
- Prevent error on
editor.destroy()
with selection #2953 - Update Style Manager on Layer visibility change #2938
- Prevent errors on body hover #2974
- Added
listenToEl
option in order to refresh the editor on scrollable elements #2722 - Put quotes around URLs in CSS property like
background-image
#2975 - Fixed retrieval of text component content with custom RTE #2977
- Fixed issues with the stack property in StyleManager
Assets
2
v0.16.17
Added
- Added Bosnian locale file #2736
- Added Chinese (simplified) locale file #2804
- Added
colorPicker
option to color trait type, for color picker customization - Added the possibility to change block attributes dynamically
Changed
- Render only visible blocks for external block containers
- Use postRender in ComponentScriptView
- Init a component by using class from attributes if
classes
property is missing #2836
Fixed
- Ensure selectors on CSS rule add
- Update external SCSS imports
- Prevent errors, in SelectComponent, from debounced functions #2802
- Fixed French translations
- Catch error and skip rendering of invalid Component definitions (eg. invalid attribute name) #2029
- Fixed video component issues #2773
- Trigger change on values with empty value #2835
- Fix remove unused styles #2800
- Prevent default for delete shortcut #2765
Assets
2
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
Assets
2
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
Assets
2
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
Assets
2
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
Assets
2
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
Assets
2
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
Assets
2
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:const 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
Assets
2
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
Assets
2
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:domc.addType('new-type', { extend: 'parent-type', model: { init() { domc.getType('parent-type').model.prototype.init.apply(this, arguments); // do something; }, } });
domc.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
Assets
2
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
Assets
2
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
Assets
2
v0.14.52
Assets
2
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
Assets
2
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.43
Assets
2
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
artf released this
Assets
2
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
热门度与活跃度
9.0
10.0
Watchers:440 |
Star:12422 |
Fork:2320 |
创建时间: 2016-01-22 08:23:19 |
最后Commits: 16天前 |
许可协议:BSD-3-Clause |
基本信息
分类:内容管理系统 / JavaScript开发 |
收录时间:2018-09-19 22:40:49 |
458f623
Compare
Docs
The biggest advantage over the previous one is how the final code is created. With the old one, you could have the whole
script
content duplicated as many times as components of the same type (new script content will be output only once per type). The new approach avoids also issues with different JS minifiers (due to string templates).Added
script-props
property to Component. Read the new Components & JSnoCount
option to avoid triggering the count of changes (eg. for skipping the Storage)move()
method to the ComponentChanged
grapesjs-cli
for the dev server and the buildnoUndo
option instead ofavoidStore
for skipping the triggerFixed
src
in Image components #3201