Back to Website
Show / Hide Table of Contents

Class CommandManager

Performs operations on the product and its design elements.

Package: @aurigma/design-editor-iframe
Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CommandManager class.

Examples
const ids = (await editor.getSelectedItems()).map(item => item.id);

const args = {
    translateX: 108,
    translateY: 0,
    itemIds: ids
};

// Moves the selected items 1.5 inches horizontally.
editor.commandManager.execute("translateItems", args);

Methods

execute(name, args, historyUpdateMode)

Executes the Translate and Resize operations.

Declaration
execute(name: any, args?: any, historyUpdateMode?: HistoryUpdateMode): Promise<any>;
Parameters
Type Name Description
any name

The name of the operation, for example, "translateItems" or "resize".

any args

An object defining arguments of the operation. The current implementation supports IExternalResizeArgs and IExternalTranslateItemCommandArgs.

HistoryUpdateMode historyUpdateMode

Defines how the history of user actions should be updated, one of NotUpdate, Update (by default), or ForceUpdate.

Returns
Type Description
Promise<any>
Examples
const ids = (await editor.getSelectedItems()).map(item => item.id);

const args = {
    translateX: 108,
    translateY: 0,
    itemIds: ids
};

// Moves the selected items 1.5 inches horizontally.
editor.commandManager.execute("translateItems", args);
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback