UNPKG

@atlaskit/adf-schema

Version:

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

51 lines 1.24 kB
import { adfNode } from '@atlaskit/adf-schema-generator'; import { breakout } from '../marks/breakout'; import { unsupportedMark } from '../marks/unsupportedMark'; import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute'; const ruleAttributes = { localId: { type: 'string', 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 const rule = adfNode('rule').define({ attrs: { localId: { type: 'string', default: null, optional: true } } }).variant('with_attrs', { stage0: true, attrs: ruleAttributes }) // this variant is used to support breakout resizing for rule nodes at the document root .variant('root_only', { stage0: true, marks: [breakout, unsupportedMark, unsupportedNodeAttribute] }).variant('with_attrs_root_only', { stage0: true, attrs: ruleAttributes, marks: [breakout, unsupportedMark, unsupportedNodeAttribute] });