Skip to content
Snippets Groups Projects
Commit 27151b74 authored by chris's avatar chris
Browse files

base service in progress

parent 6f7ba8f0
No related branches found
No related tags found
1 merge request!45Develop
Showing
with 32 additions and 45 deletions
......@@ -10,12 +10,7 @@ export default {
MenuService: [
{
templateArea: "topBar",
toolGroups: [
"Annotations",
"Lists",
"Tables",
{ name: "RedoUndo", exclude: ["Redo"] }
]
toolGroups: ["Annotations", "Lists", "Tables"]
},
{
templateArea: "leftSideBar",
......
......@@ -4,7 +4,6 @@ import {
ImageService,
MenuService,
SchemaService,
RedoUndoService,
PlaceholderService,
RulesService,
ShortCutsService,
......@@ -24,7 +23,6 @@ export default {
new ShortCutsService(),
new LayoutService(),
new MenuService(),
new RedoUndoService(),
new AnnotationToolGroupService(),
new ListToolGroupService(),
new TextStyleService(),
......
export { default as MenuService } from "./src/MenuService/MenuService";
export { default as LinkService } from "./src/LinkService/LinkService";
export {
default as RedoUndoService
} from "./src/RedoUndoService/RedoUndoService";
export {
default as TextStyleService
} from "./src/TextStyleService/TextStyleService";
......
import BaseServices from "./index";
import Service from "wax-prosemirror-core/src/services/Service";
class BaseService extends Service {
register() {
this.config.pushToArray("services", BaseServices);
}
}
export default BaseService;
import { injectable, inject } from "inversify";
import ToolGroup from "../lib/ToolGroup";
@injectable()
export default class RedoUndo extends ToolGroup {
tools = [];
constructor(@inject("Redo") redo, @inject("Undo") undo) {
super();
this.tools = [redo, undo];
}
renderTools(view) {
const tools = [];
this.tools.forEach(tool => {
tools.push(tool.renderTool(view));
});
return tools;
}
}
import RedoUndo from "./RedoUndo";
import Service from "wax-prosemirror-core/src/services/Service";
import Redo from "./Redo";
import Undo from "./Undo";
export default class RedoService extends Service {
name = "RedoService";
register() {
this.container.bind("RedoUndo").to(RedoUndo);
this.container.bind("Redo").to(Redo);
this.container.bind("Undo").to(Undo);
}
}
import { injectable, inject } from "inversify";
import ToolGroup from "../../lib/ToolGroup";
@injectable()
class Base extends ToolGroup {
tools = [];
constructor() {
super();
this.tools = [];
}
renderTools(view) {
const tools = [];
this.tools.forEach(tool => {
tools.push(tool.renderTool(view));
});
return tools;
}
}
export default Base;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment