Browse Source

Merge branch 'dev' of https://github.com/artf/grapesjs into dev

pull/5907/head
Artur Arseniev 2 years ago
parent
commit
f2b0bb9fd3
  1. 2
      docs/modules/Plugins.md
  2. 2
      src/commands/index.ts
  3. 8
      src/undo_manager/index.ts

2
docs/modules/Plugins.md

@ -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
src/commands/index.ts

@ -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'];

8
src/undo_manager/index.ts

@ -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();

Loading…
Cancel
Save