UNPKG

@atlaskit/adf-schema

Version:

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

50 lines 1.37 kB
import { $or, $range, adfNode } from '@atlaskit/adf-schema-generator'; import { breakout } from '../marks/breakout'; import { unsupportedMark } from '../marks/unsupportedMark'; import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute'; import { heading } from './heading'; import { paragraph } from './paragraph'; var bodiedRuleAttributes = { localId: { type: 'string', default: '', minLength: 1 }, alignment: { type: 'enum', values: ['start', 'center', 'end'], default: null, optional: true }, color: { type: 'string', default: null, optional: true, pattern: '^#[0-9a-fA-F]{6}$' }, style: { type: 'enum', values: ['solid', 'dashed', 'dotted', 'sketch', 'fade'], default: null, optional: true }, weight: { type: 'number', default: null, minimum: 1, maximum: 3, optional: true } }; export var bodiedRule = adfNode('bodiedRule').define({ stage0: true, attrs: bodiedRuleAttributes, content: [$range(1, 1, $or(paragraph.use('with_no_marks'), heading.use('with_no_marks')))], marks: [unsupportedMark, unsupportedNodeAttribute] }) // this variant is used to support breakout resizing for bodiedRule nodes at the document root .variant('root_only', { stage0: true, marks: [breakout, unsupportedMark, unsupportedNodeAttribute], noExtend: true });