import { set } from "lodash";
import { EditorModule } from "..";
import { DesignComp } from "../../objects/DesignTemp/DesignComp";

export const textActions = EditorModule.action({
  setTextarea(comp: DesignComp, path: string, value: any) {
    const { historyCtrl } = this.controls;
    historyCtrl.historyActionDoing = true;
    historyCtrl.historyCombine = true;
    set(comp, path, value);
    historyCtrl.historyCombine = false;
    historyCtrl.historyActionDoing = false;
  },
});
