UNPKG

@aurigma/design-atoms

Version:

Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.

25 lines 1.24 kB
import { PlaceholderItem } from "@aurigma/design-atoms-model/Product/Items"; import { NotImplementedException } from "@aurigma/design-atoms-model/Exception"; import { BaseItemsCommand } from "./BaseItemsCommand"; export class PlaceholderContentResetCommand extends BaseItemsCommand { constructor(productHandler, args, historyArgs) { super(productHandler, historyArgs, args); } async _executeCommandBody() { var _a, _b, _c, _d; const items = (_d = this._getTargetItems((_a = this._args) === null || _a === void 0 ? void 0 : _a.items, (_b = this._args) === null || _b === void 0 ? void 0 : _b.query, (_c = this._args) === null || _c === void 0 ? void 0 : _c.queryOptions)) !== null && _d !== void 0 ? _d : this._productHandler.selectedItems; items.forEach(i => { if (!(i instanceof PlaceholderItem)) return; const placeholderItemHandler = this._productHandler.getHandler(i); placeholderItemHandler.resetContent(); }); } redo() { throw new NotImplementedException(); } undo() { throw new NotImplementedException(); } } //# sourceMappingURL=PlaceholderContentResetCommand.js.map