UNPKG

@atlaskit/adf-schema

Version:

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

41 lines (39 loc) 983 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.alignmentPositionMap = exports.alignment = void 0; var _groups = require("../groups"); /** TODO: Flip these positions for RTL */ var alignmentPositionMap = { end: 'right', right: 'end', center: 'center' }; /** * @name alignment_mark */ exports.alignmentPositionMap = alignmentPositionMap; var alignment = { excludes: "alignment ".concat(_groups.INDENTATION), group: _groups.ALIGNMENT, attrs: { align: {} }, parseDOM: [{ tag: 'div.fabric-editor-block-mark', getAttrs: function getAttrs(dom) { var align = dom.getAttribute('data-align'); return align ? { align: align } : false; } }], toDOM: function toDOM(mark) { return ['div', { class: "fabric-editor-block-mark fabric-editor-alignment fabric-editor-align-".concat(mark.attrs.align), 'data-align': mark.attrs.align }, 0]; } }; exports.alignment = alignment;