editWithManualHistory.ts 744 B

12345678910111213141516171819202122232425262728
  1. import { set } from "lodash";
  2. import { EditorModule } from "..";
  3. import { DesignComp } from "../../objects/DesignTemp/DesignComp";
  4. import { CompObject } from "../../controllers/SelectCtrl/compObj";
  5. import { ICompKeys } from "../../typings";
  6. import { queenApi } from "queenjs";
  7. export const manualActions = EditorModule.action({
  8. updateCompData(comp: DesignComp, path: string, value: any) {
  9. const { historyCtrl } = this.controls;
  10. historyCtrl.historyActionDoing = true;
  11. historyCtrl.historyCombine = true;
  12. set(comp, path, value);
  13. // call action method
  14. historyCtrl.historyCombine = false;
  15. historyCtrl.historyActionDoing = false;
  16. },
  17. submitUpdate() {
  18. this.controls.historyCtrl.history.submit();
  19. },
  20. });