-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate-constants.js
60 lines (57 loc) · 1.69 KB
/
update-constants.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
57
58
59
60
import Quill from 'quill';
import TableUp, { defaultCustomSelect, TableAlign, TableMenuContextmenu, TableResizeBox, TableSelection, TableVirtualScrollbar, updateTableConstants } from 'table-up';
updateTableConstants({
blotName: {
container: 'a-container',
tableWrapper: 'a',
tableMain: 'a-main',
tableColgroup: 'a-colgroup',
tableCol: 'a-col',
tableBody: 'a-body',
tableRow: 'a-row',
tableCell: 'a-cell',
tableCellInner: 'a-cell-inner',
},
tableUpSize: {
colMinWidthPre: 5,
colMinWidthPx: 40,
rowMinHeightPx: 36,
},
tableUpEvent: {
AFTER_TABLE_RESIZE: 'after-table-resize',
},
});
Quill.register({
[`modules/${TableUp.moduleName}`]: TableUp,
}, true);
const _quill = new Quill('#editor1', {
theme: 'snow',
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'code'],
['link', 'image', 'video', 'formula'],
[{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
[{ script: 'sub' }, { script: 'super' }],
[{ indent: '-1' }, { indent: '+1' }],
[{ direction: 'rtl' }],
[{ size: ['small', false, 'large', 'huge'] }],
[{ header: [1, 2, 3, 4, 5, 6, false] }],
[{ color: [] }, { background: [] }],
[{ font: [] }],
[{ align: [] }],
[{ [TableUp.toolName]: [] }],
['clean'],
],
[TableUp.moduleName]: {
scrollbar: TableVirtualScrollbar,
align: TableAlign,
resize: TableResizeBox,
customSelect: defaultCustomSelect,
selection: TableSelection,
selectionOptions: {
tableMenu: TableMenuContextmenu,
},
},
},
});