@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
36 lines • 1.18 kB
JavaScript
import { $onePlus } from '@atlaskit/adf-schema-generator/$onePlus';
import { $or } from '@atlaskit/adf-schema-generator/$or';
import { adfNode } from '@atlaskit/adf-schema-generator/adfNode';
import { nonNestableBlockContentGroup } from '../groups/nonNestableBlockContentGroup';
import { breakout } from '../marks/breakout';
import { unsupportedMark } from '../marks/unsupportedMark';
import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
import { extension } from './extension';
import { nestedExpand } from './nestedExpand';
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
},
localId: {
type: 'string',
default: null,
optional: true
}
},
content: [$onePlus($or(nonNestableBlockContentGroup, extension.use('with_annotation'), nestedExpand.use('with_no_marks')))]
}).variant('root_only', {
marks: [breakout, unsupportedMark, unsupportedNodeAttribute],
noMarks: false,
noExtend: true
});