This repository has been archived by the owner on Feb 21, 2019. It is now read-only.
/
state.js
56 lines (53 loc) · 1.64 KB
/
state.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/** @jsx h */
// eslint-disable-next-line
import { createHyperscript } from 'slate-hyperscript';
const h = createHyperscript({
blocks: {
heading: 'heading',
paragraph: 'paragraph',
table: 'table',
table_row: 'table_row',
table_cell: 'table_cell'
}
});
const state = (
<state>
<document>
<heading>Slate + Table Edition</heading>
<paragraph>
This page is a basic example of Slate + slate-edit-table plugin.
</paragraph>
<table>
<table_row>
<table_cell>
<text>Cell 0,0</text>
</table_cell>
<table_cell>
<text>Cell 0,1</text>
</table_cell>
</table_row>
<table_row>
<table_cell>
<text>Cell 1,0</text>
</table_cell>
<table_cell>
<text>Cell 1,1</text>
</table_cell>
</table_row>
<table_row>
<table_cell>
<text>Cell 2,0</text>
</table_cell>
<table_cell>
<text>Cell 2,1</text>
</table_cell>
</table_row>
</table>
<paragraph>
Use Tab and Shift+Tab to move from cell to cells. Press Enter to
go to next row. Press Up/Down to navigate the rows.
</paragraph>
</document>
</state>
);
export default state;