@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
47 lines (45 loc) • 1.11 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.decisionItem = void 0;
var _uuid = require("../../utils/uuid");
/**
* @name decisionItem_node
*/
var decisionItem = {
content: 'inline*',
defining: true,
marks: '_',
attrs: {
localId: {
default: ''
},
state: {
default: 'DECIDED'
}
},
parseDOM: [{
tag: 'li[data-decision-local-id]',
// Default priority is 50. We normally 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 getAttrs(dom) {
return {
localId: _uuid.uuid.generate(),
state: dom.getAttribute('data-decision-state')
};
}
}],
toDOM: function toDOM(node) {
var _node$attrs = node.attrs,
localId = _node$attrs.localId,
state = _node$attrs.state;
var attrs = {
'data-decision-local-id': localId || 'local-decision',
'data-decision-state': state
};
return ['li', attrs, 0];
}
};
exports.decisionItem = decisionItem;
;