UNPKG

@atlaskit/adf-schema

Version:

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

35 lines (32 loc) 731 B
import { ALIGNMENT, INDENTATION } from '../groups'; /** TODO: Flip these positions for RTL */ export const alignmentPositionMap = { end: 'right', right: 'end', center: 'center' }; /** * @name alignment_mark */ export const alignment = { excludes: `alignment ${INDENTATION}`, group: ALIGNMENT, attrs: { align: {} }, parseDOM: [{ tag: 'div.fabric-editor-block-mark', getAttrs: dom => { const align = dom.getAttribute('data-align'); return align ? { align } : false; } }], toDOM(mark) { return ['div', { class: `fabric-editor-block-mark fabric-editor-alignment fabric-editor-align-${mark.attrs.align}`, 'data-align': mark.attrs.align }, 0]; } };