Commit c4b37e85 authored by chris's avatar chris

add table nodes

parent 282b602b
...@@ -3,6 +3,7 @@ import styled, { createGlobalStyle } from "styled-components"; ...@@ -3,6 +3,7 @@ import styled, { createGlobalStyle } from "styled-components";
import { Wax, CreateSchema } from "wax-prosemirror-core"; import { Wax, CreateSchema } from "wax-prosemirror-core";
import { EditoriaSchema } from "wax-prosemirror-schema"; import { EditoriaSchema } from "wax-prosemirror-schema";
import { orderedList, bulletList, listItem } from "prosemirror-schema-list"; import { orderedList, bulletList, listItem } from "prosemirror-schema-list";
import { tableNodes } from "prosemirror-tables";
import { MainMenuBar, SideMenuBar } from "wax-prosemirror-components"; import { MainMenuBar, SideMenuBar } from "wax-prosemirror-components";
import "wax-prosemirror-layouts/layouts/editoria-layout.css"; import "wax-prosemirror-layouts/layouts/editoria-layout.css";
import "wax-prosemirror-themes/themes/editoria-theme.css"; import "wax-prosemirror-themes/themes/editoria-theme.css";
...@@ -25,7 +26,11 @@ const extraNodes = { ...@@ -25,7 +26,11 @@ const extraNodes = {
...listItem, ...listItem,
content: "paragraph block*", content: "paragraph block*",
group: "block" group: "block"
} },
...tableNodes({
tableGroup: "block",
cellContent: "block+"
})
}; };
EditoriaSchema.nodes = { ...EditoriaSchema.nodes, ...extraNodes }; EditoriaSchema.nodes = { ...EditoriaSchema.nodes, ...extraNodes };
...@@ -63,6 +68,23 @@ class Editoria extends Component { ...@@ -63,6 +68,23 @@ class Editoria extends Component {
theme="editoria" theme="editoria"
layout="editoria" layout="editoria"
debug debug
value="<p>hello</p><table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>"
renderLayout={({ editor, ...props }) => ( renderLayout={({ editor, ...props }) => (
<React.Fragment> <React.Fragment>
<MainMenuBar {...props} /> <MainMenuBar {...props} />
......
Markdown is supported
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