UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

30 lines (28 loc) 567 B
const allowedTypes = ['wide', 'full-width']; /** * @name breakout_mark */ export const breakout = { spanning: false, inclusive: false, parseDOM: [{ tag: 'div.fabric-editor-breakout-mark', getAttrs(dom) { const mode = dom.getAttribute('data-mode'); return { mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode }; } }], attrs: { mode: { default: 'wide' } }, toDOM(mark) { return ['div', { class: 'fabric-editor-breakout-mark', 'data-mode': mark.attrs.mode }, 0]; } };