@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
47 lines (45 loc) • 1.28 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.decisionListSelector = exports.decisionList = void 0;
var _uuid = require("../../utils/uuid");
/**
* @name decisionList_node
*/
var name = 'decisionList';
var decisionListSelector = "[data-node-type=\"".concat(name, "\"]");
exports.decisionListSelector = decisionListSelector;
var decisionList = {
group: 'block',
defining: true,
content: '(decisionItem|unsupportedBlock)+',
marks: 'unsupportedMark unsupportedNodeAttribute',
selectable: false,
attrs: {
localId: {
default: ''
}
},
parseDOM: [{
tag: "ol".concat(decisionListSelector),
// Default priority is 50. We normally don't change this but since this node type is
// also used by ordered-list we need to make sure that we run this parser first.
priority: 100,
getAttrs: function getAttrs() {
return {
localId: _uuid.uuid.generate()
};
}
}],
toDOM: function toDOM(node) {
var localId = node.attrs.localId;
var attrs = {
'data-node-type': name,
'data-decision-list-local-id': localId || 'local-decision-list',
style: 'list-style: none; padding-left: 0'
};
return ['ol', attrs, 0];
}
};
exports.decisionList = decisionList;
;