Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/artf/grapesjs into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed May 11, 2024
2 parents a18743b + 5aef0b9 commit f2b0bb9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/modules/Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ grapesjs.init({

## Boilerplate

For fast plugin development, we highly recommend using [grapesjs-cli](https://github.com/GrapesJS/cli) which helps to avoid the hassle of setting up all the dependencies and configurations for development and building (no need to touch Webpack o Babel configurations). For more information check the repository.
For fast plugin development, we highly recommend using [grapesjs-cli](https://github.com/GrapesJS/cli) which helps to avoid the hassle of setting up all the dependencies and configurations for development and building (no need to touch Webpack or Babel configurations). For more information check the repository.
2 changes: 1 addition & 1 deletion src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default class CommandsModule extends Module<CommandsConfig & { pStylePref
const trg = opts.target as Component | undefined;
const trgs = trg ? [trg] : [...ed.getSelectedAll()];
const targets = trgs.map(trg => trg.delegate?.move?.(trg) || trg).filter(Boolean);
const target = targets[0] as Component | undefined;
const target = targets[targets.length - 1] as Component | undefined;
const nativeDrag = event?.type === 'dragstart';
const modes = ['absolute', 'translate'];

Expand Down
8 changes: 8 additions & 0 deletions src/undo_manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,14 @@ export default class UndoManagerModule extends Module<UndoManagerConfig & { name
return result;
}

/**
* Execute the provided callback temporarily stopping tracking changes
* @param clb The callback to execute with changes tracking stopped
* @example
* um.skip(() => {
* // Do stuff without tracking
* });
*/
skip(clb: Function) {
const isTracking = !!this.um.isTracking();

Expand Down

0 comments on commit f2b0bb9

Please sign in to comment.