abortTransaction() {
        if (this.transactionStack.length === 0) return;
        const transaction = this.transactionStack.pop();
        for (let i = transaction.length - 1; i >= 0; i--) {
            transaction[i].undo();
        }
    }
Aborts the current transaction.

@description
This method cancels the current transaction by popping it off the transaction stack and undoing all commands
in reverse order. If the transaction stack is empty, this method does nothing.

@throws {Error} If an error occurs while undoing the transaction commands.

@example
undoRedoManager.beginTransaction();
undoRedoManager.execute(command1);
undoRedoManager.execute(command2);
undoRedoManager.abortTransaction(); // Undoes command2 and command1