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

simpler config

parent 9bb201f8
No related branches found
No related tags found
1 merge request!45Develop
......@@ -18,11 +18,6 @@ import {
sinkListItem
} from "prosemirror-schema-list";
import invisibles, {
space,
hardBreak,
paragraph
} from "@guardian/prosemirror-invisibles";
import { LayoutService } from "./customServices/LayoutService/LayoutService";
import { CreateSchema } from "wax-prosemirror-core";
......@@ -33,8 +28,6 @@ import {
LinkService
} from "wax-prosemirror-plugins";
// import { MainMenuBar, SideMenuBar } from "wax-prosemirror-components";
import { tableNodes, columnResizing, tableEditing } from "prosemirror-tables";
import { EditoriaSchema } from "wax-prosemirror-schema";
......@@ -49,27 +42,8 @@ const extraNodes = {
EditoriaSchema.nodes = { ...EditoriaSchema.nodes, ...extraNodes };
const schema = new CreateSchema(EditoriaSchema);
// Add Plugins
const plugins = [
columnResizing(),
tableEditing(),
TrackChangePlugin({ options: {} }),
invisibles([hardBreak()])
// FindAndReplacePlugin,
// MenuBarPlugin({
// Component: MainMenuBar,
// renderArea: "topBar",
// menuItems: ["undo", "redo"]
// }),
// MenuBarPlugin({
// Component: SideMenuBar,
// renderArea: "leftSideBar"
// //menuItems: ["plain"]
// })
];
const services = [new LinkService()];
// Add Rules
export { schema, plugins, services };
export { schema, services };
import { emDash, ellipsis } from "prosemirror-inputrules";
import { columnResizing, tableEditing } from "prosemirror-tables";
import invisibles, {
space,
hardBreak,
paragraph
} from "@guardian/prosemirror-invisibles";
export default {
MenuService: [
......@@ -11,14 +17,15 @@ export default {
toolGroups: ["TextStyle"]
}
],
RulesService: [
{
rules: [emDash, ellipsis]
}
],
ShortCutsService: [
{
shortCuts: {}
}
RulesService: [emDash, ellipsis],
ShortCutsService: {},
PluginsService: [
columnResizing(),
tableEditing(),
// TrackChangePlugin({ options: {} }),
invisibles([hardBreak()])
]
};
......@@ -7,13 +7,15 @@ import {
PlaceholderService,
RulesService,
ShortCutsService,
TextStyleService
TextStyleService,
PluginsService
} from "wax-prosemirror-plugins";
export default {
services: [
new RulesService(),
new ShortCutsService(),
new PluginsService(),
new LayoutService(),
new MenuService(),
new RedoUndoService(),
......
......@@ -22,4 +22,5 @@ export { default as RulesService } from "./src/RulesService/RulesService";
export {
default as ShortCutsService
} from "./src/ShortCutsService/ShortCutsService";
export { default as PluginsService } from "./src/PluginsService/PluginsService";
export { default as Tool } from "./src/lib/Tools";
......@@ -16,7 +16,7 @@ export default class RulesService extends Service {
.bind("Rules")
.toDynamicValue(() => new Rules(schema, PmPlugins))
.inSingletonScope();
const configRules = this.config[0].rules;
const configRules = this.config;
const rules = this.container.get("Rules");
rules.addRule(configRules);
}
......
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