@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
34 lines (31 loc) • 943 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.breakout = void 0;
var _markTypes = require("../../next-schema/generated/markTypes");
var allowedTypes = ['wide', 'full-width'];
/**
* @name breakout_mark
*/
var breakout = exports.breakout = (0, _markTypes.breakout)({
parseDOM: [{
tag: 'div.fabric-editor-breakout-mark',
getAttrs: function getAttrs(dom) {
var mode = dom.getAttribute('data-mode');
var width = dom.getAttribute('data-width');
return {
mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode,
width: width ? parseInt(width) : null
};
}
}],
toDOM: function toDOM(mark) {
var _mark$attrs;
return ['div', {
class: 'fabric-editor-breakout-mark',
'data-mode': mark.attrs.mode,
'data-width': (_mark$attrs = mark.attrs) === null || _mark$attrs === void 0 ? void 0 : _mark$attrs.width
}, 0];
}
});
;