UNPKG

1.05 kBJavaScriptView Raw
1import { uuid } from '../../utils/uuid';
2var name = 'actionList';
3export var taskListSelector = "[data-node-type=\"" + name + "\"]";
4export 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 // Default priority is 50. We normaly don't change this but since this node type is
15 // also used by ordered-list we need to make sure that we run this parser first.
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//# sourceMappingURL=task-list.js.map
\No newline at end of file