@node-projects/web-component-designer 0.1.59 → 0.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -62,6 +62,12 @@ export class UndoService {
|
|
|
62
62
|
this._redoStack = [];
|
|
63
63
|
this._transactionStack = [];
|
|
64
64
|
}
|
|
65
|
+
clearTransactionstackIfNotEmpty() {
|
|
66
|
+
if (this._transactionStack.length) {
|
|
67
|
+
console.warn("transactionStack was not empty, but should be", this._transactionStack);
|
|
68
|
+
this._transactionStack = [];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
65
71
|
undo() {
|
|
66
72
|
if (!this.canUndo())
|
|
67
73
|
return;
|
|
@@ -667,6 +667,7 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
|
667
667
|
this.snapLines.clearSnaplines();
|
|
668
668
|
}
|
|
669
669
|
setDesignItems(designItems) {
|
|
670
|
+
this.instanceServiceContainer.undoService.clearTransactionstackIfNotEmpty();
|
|
670
671
|
const setItemsAction = new SetDesignItemsAction(designItems, [...this.rootDesignItem.children()]);
|
|
671
672
|
this.instanceServiceContainer.undoService.execute(setItemsAction);
|
|
672
673
|
}
|