@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
32 lines • 900 B
JavaScript
import { uuid } from '../../utils';
import { bulletList as bulletListFactory } from '../../next-schema/generated/nodeTypes';
export var bulletListSelector = '.ak-ul';
export var bulletList = bulletListFactory({
parseDOM: [{
tag: 'ul'
}],
toDOM: function toDOM() {
var attrs = {
class: bulletListSelector.substr(1)
};
return ['ul', attrs, 0];
}
});
export var bulletListWithLocalId = bulletListFactory({
parseDOM: [{
tag: 'ul',
getAttrs: function getAttrs() {
return {
localId: uuid.generate()
};
}
}],
toDOM: function toDOM(node) {
var _node$attrs;
var attrs = {
class: bulletListSelector.substr(1),
'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
};
return ['ul', attrs, 0];
}
});