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

hard break

parent c1ffbb4c
No related branches found
No related tags found
1 merge request!5Develop
...@@ -7,8 +7,6 @@ import Editor from "./Editor"; ...@@ -7,8 +7,6 @@ import Editor from "./Editor";
import plugins from "./config/plugins"; import plugins from "./config/plugins";
import placeholder from "./config/plugins/placeholder"; import placeholder from "./config/plugins/placeholder";
import MainMenuBar from "./components/menu/MainMenuBar";
import defaultMenuItems from "./config/DefaultMenuItems";
import WaxKeys from "./config/classes/WaxKeys"; import WaxKeys from "./config/classes/WaxKeys";
const parser = schema => { const parser = schema => {
...@@ -46,12 +44,10 @@ class Wax extends Component { ...@@ -46,12 +44,10 @@ class Wax extends Component {
// TO DO Find a way to start plugins with options // TO DO Find a way to start plugins with options
plugins.push(...[placeholder({ content: this.props.placeholder }), keys]); plugins.push(...[placeholder({ content: this.props.placeholder }), keys]);
this.WaxOptions = options this.WaxOptions = {
? options schema,
: { plugins
plugins, };
schema
};
const parse = parser(schema); const parse = parser(schema);
const serialize = serializer(schema); const serialize = serializer(schema);
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
liftListItem, liftListItem,
sinkListItem sinkListItem
} from "prosemirror-schema-list"; } from "prosemirror-schema-list";
// import { goToNextCell } from "prosemirror-tables";
import { import {
baseKeymap, baseKeymap,
toggleMark, toggleMark,
...@@ -21,8 +21,6 @@ import { ...@@ -21,8 +21,6 @@ import {
selectParentNode selectParentNode
} from "prosemirror-commands"; } from "prosemirror-commands";
import { goToNextCell } from "prosemirror-tables";
class WaxKeys { class WaxKeys {
constructor(config) { constructor(config) {
this.schema = config.schema; this.schema = config.schema;
...@@ -88,9 +86,7 @@ class WaxKeys { ...@@ -88,9 +86,7 @@ class WaxKeys {
"Shift-Ctrl-4": setBlockType(this.schema.nodes.heading, { level: 4 }), "Shift-Ctrl-4": setBlockType(this.schema.nodes.heading, { level: 4 }),
"Shift-Ctrl-5": setBlockType(this.schema.nodes.heading, { level: 5 }), "Shift-Ctrl-5": setBlockType(this.schema.nodes.heading, { level: 5 }),
"Shift-Ctrl-6": setBlockType(this.schema.nodes.heading, { level: 6 }), "Shift-Ctrl-6": setBlockType(this.schema.nodes.heading, { level: 6 }),
"Mod-_": this.insertRule, "Mod-_": this.insertRule
Tab: goToNextCell(1),
"Shift-Tab": goToNextCell(-1)
}; };
} }
......
export { default as Wax } from "./Wax"; export { default as Wax } from "./Wax";
export { default as createSchema } from "./config/classes/createSchema"; export { default as createSchema } from "./config/classes/createSchema";
export { default as plugins } from "./config/plugins"; export { default as plugins } from "./config/plugins";
//Components //Components
......
const pDOM = ["p", 0]; const pDOM = ["p", 0],
brDOM = ["br"];
const defaultSchema = { const defaultSchema = {
nodes: { nodes: {
doc: { doc: {
content: "block+" content: "block+"
}, },
text: { text: {
group: "inline" group: "inline"
}, },
hard_break: {
inline: true,
group: "inline",
selectable: false,
parseDOM: [{ tag: "br" }],
toDOM() {
return brDOM;
}
},
paragraph: { paragraph: {
content: "inline*", content: "inline*",
group: "block", group: "block",
......
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