UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

29 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var uuid_1 = require("../../plugins/tasks-and-decisions/uuid"); exports.taskItem = { content: 'inline<_>*', attrs: { localId: { compute: uuid_1.default.generate }, state: { default: 'TODO' }, }, parseDOM: [{ tag: 'li[data-task-local-id]', // Default priority is 50. We normaly don't change this but since this node type is // also used by list-item we need to make sure that we run this parser first. priority: 100, getAttrs: function (dom) { return ({ localId: uuid_1.default.generate(), state: dom.getAttribute('data-task-state'), }); } }], toDOM: function (node) { var _a = node.attrs, localId = _a.localId, state = _a.state; var attrs = { 'data-task-local-id': localId || 'local-task', 'data-task-state': state, }; return ['li', attrs, 0]; } }; //# sourceMappingURL=task-item.js.map