1 | import { uuid } from '../../utils/uuid';
|
2 | var name = 'actionList';
|
3 | export var taskListSelector = "[data-node-type=\"" + name + "\"]";
|
4 | export var taskList = {
|
5 | group: 'block',
|
6 | defining: true,
|
7 | content: 'taskItem+ (taskItem|taskList)*',
|
8 | attrs: {
|
9 | localId: { default: '' },
|
10 | },
|
11 | parseDOM: [
|
12 | {
|
13 | tag: "div" + taskListSelector,
|
14 |
|
15 |
|
16 | priority: 100,
|
17 | getAttrs: function () { return ({
|
18 | localId: uuid.generate(),
|
19 | }); },
|
20 | },
|
21 | ],
|
22 | toDOM: function (node) {
|
23 | var localId = node.attrs.localId;
|
24 | var attrs = {
|
25 | 'data-node-type': name,
|
26 | 'data-task-list-local-id': localId || 'local-task-list',
|
27 | style: 'list-style: none; padding-left: 0',
|
28 | };
|
29 | return ['div', attrs, 0];
|
30 | },
|
31 | };
|
32 |
|
\ | No newline at end of file |