@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
19 lines • 629 B
JavaScript
import { getDomAttrs } from './get-dom-attrs';
import { getParseDOMAttrs } from './get-parse-dom-attrs';
export var createPanelNodeSpecOptions = function createPanelNodeSpecOptions(allowCustomPanel, generateLocalId) {
return {
parseDOM: [{
tag: 'div[data-panel-type]',
getAttrs: function getAttrs(dom) {
return getParseDOMAttrs(allowCustomPanel, dom, generateLocalId);
}
}],
toDOM: function toDOM(node) {
var attrs = getDomAttrs(node.attrs);
var contentAttrs = {
'data-panel-content': 'true'
};
return ['div', attrs, ['div', contentAttrs, 0]];
}
};
};