npm grapesjs 0.14.61
v0.14.61

latest releases: 0.21.10, 0.21.9, 0.21.8...
4 years ago

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 and getTraitIndex 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 is scroll, which allows you to scroll the canvas
    to the selected component: editor.select(component, { scroll: true })
  • Added appendOnClick option (default false) 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 templates
    domc.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. Added extendFn and extendFnView 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;
        },
      }
    });
    Now you can do it faster by doing:
    domc.addType('new-type', {
      extend: 'parent-type',
      extendFn: ['init'], // array of model functions to extend
      model: {
        init() {
          // do something;
        },
      }
    });
    The same would be for the view by using 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

Don't miss a new grapesjs release

NewReleases is sending notifications on new releases.