Skip to content

Commit

Permalink
feat: implement new table plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
erichartline committed May 22, 2019
1 parent 034aa6a commit 9e4d8a8
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 158 deletions.
38 changes: 34 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.2",
"slate": "^0.45.1",
"slate-deep-table": "^0.8.0",
"slate-html-serializer": "^0.6.11",
"slate-react": "^0.21.21",
"slate-schema-violations": "^0.1.39",
Expand Down
18 changes: 9 additions & 9 deletions src/components/editor/PageEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
OrderedListNode,
UnorderedListNode,
} from "./plugins/list"
// import { TableNode, TableRowNode, TableCellNode } from "./plugins/table"
import { TableNode, TableRowNode, TableCellNode } from "./plugins/table"
import { VideoNode } from "./plugins/video"

/** Import custom plugins */
Expand All @@ -53,7 +53,7 @@ import { ImagePlugin } from "./plugins/image"
import { ItalicPlugin } from "./plugins/italic"
import { ListPlugin } from "./plugins/list"
import { StrikethroughPlugin } from "./plugins/strikethrough"
// import { TablePlugin } from "./plugins/table"
import { TablePlugin } from "./plugins/table"
import { UnderlinePlugin } from "./plugins/underline"

const styles = theme => ({
Expand Down Expand Up @@ -123,7 +123,7 @@ const plugins = [
ItalicPlugin(),
ListPlugin,
StrikethroughPlugin(),
// TablePlugin,
TablePlugin,
UnderlinePlugin(),
]

Expand Down Expand Up @@ -197,12 +197,12 @@ export const renderNode = (props: nodeProps, editor, next) => {
return <UnorderedListNode {...props} />
case "ordered-list":
return <OrderedListNode {...props} />
// case "table":
// return <TableNode {...props} />
// case "table-row":
// return <TableRowNode {...props} />
// case "table-cell":
// return <TableCellNode {...props} />
case "table":
return <TableNode {...props} />
case "table-row":
return <TableRowNode {...props} />
case "table-cell":
return <TableCellNode {...props} />
case "video":
return <VideoNode {...props} />
default:
Expand Down
Loading

0 comments on commit 9e4d8a8

Please sign in to comment.