index.ts 839 B

1234567891011121314151617181920212223242526272829
  1. import { ModuleRoot } from "queenjs";
  2. import { editActions } from "./actions/edit";
  3. import { initActions } from "./actions/init";
  4. import components from "./components";
  5. import config from "./config";
  6. import { HistoryCtrl } from "./controllers/HistoryCtrl";
  7. import { helpers } from "./helpers";
  8. import { https } from "./https";
  9. import { store } from "./stores";
  10. export class EditorModule extends ModuleRoot {
  11. config = this.setConfig(config);
  12. components = this.useComponents(components);
  13. actions = this.createActions([initActions, editActions]);
  14. https = this.createHttps(https);
  15. store = this.createStore(store);
  16. helper = this.createHelper(helpers);
  17. controls = {
  18. historyCtrl: new HistoryCtrl(this),
  19. };
  20. onReady() {
  21. this.actions.init();
  22. }
  23. }
  24. export const { useEditor, initEditor } = EditorModule.hook("Editor");