UNPKG

@atlaskit/adf-schema

Version:

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

28 lines 903 B
import { $onePlus, $or, adfNode } from '@atlaskit/adf-schema-generator'; import { breakout } from '../marks/breakout'; import { unsupportedMark } from '../marks/unsupportedMark'; import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute'; import { nestedExpand } from './nestedExpand'; import { nonNestableBlockContentGroup } from '../groups/nonNestableBlockContentGroup'; export const expand = adfNode('expand').define({ isolating: true, selectable: true, noMarks: true, attrs: { title: { type: 'string', default: '', optional: true }, __expanded: { type: 'boolean', default: true, optional: true } }, content: [$onePlus($or(nonNestableBlockContentGroup, nestedExpand.use('with_no_marks')))] }).variant('root_only', { marks: [breakout, unsupportedMark, unsupportedNodeAttribute], noMarks: false, noExtend: true });