UNPKG

@atlaskit/adf-schema

Version:

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

95 lines 1.98 kB
import { adfNode } from '@atlaskit/adf-schema-generator'; import { annotation } from '../marks/annotation'; import { border } from '../marks/border'; import { link } from '../marks/link'; import { unsupportedMark } from '../marks/unsupportedMark'; import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute'; export const mediaInline = adfNode('mediaInline').define({ selectable: true, // atom: false, inline: true, marks: [link, annotation, border, unsupportedMark, unsupportedNodeAttribute], attrs: { type: { type: 'enum', values: ['link', 'file', 'image'], optional: true, default: 'file' }, url: { type: 'string', default: null, optional: true }, id: { minLength: 1, type: 'string', default: '' }, alt: { type: 'string', default: '', optional: true }, collection: { type: 'string', default: '' }, occurrenceKey: { minLength: 1, type: 'string', optional: true, default: null }, width: { type: 'number', default: null, optional: true }, height: { type: 'number', default: null, optional: true }, __fileName: { type: 'string', optional: true, default: null }, __fileSize: { type: 'number', optional: true, default: null }, __fileMimeType: { type: 'string', optional: true, default: null }, __displayType: { type: 'enum', values: ['file', 'thumbnail'], optional: true, default: null }, __contextId: { type: 'string', optional: true, default: null }, __mediaTraceId: { type: 'string', optional: true, default: null }, __external: { type: 'boolean', optional: true, default: false }, data: { type: 'object', optional: true } } });