@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
121 lines (120 loc) • 2.69 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.media = void 0;
var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
var _annotation = require("../marks/annotation");
var _border = require("../marks/border");
var _link = require("../marks/link");
var _unsupportedMark = require("../marks/unsupportedMark");
var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
var media = exports.media = (0, _adfSchemaGenerator.adfNode)('media').define({
selectable: true,
marks: [_link.link, _annotation.annotation, _border.border, _unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
attrs: {
anyOf: [{
type: {
type: 'enum',
values: ['link', 'file'],
default: 'file'
},
id: {
minLength: 1,
type: 'string',
default: ''
},
alt: {
type: 'string',
default: '',
optional: true
},
collection: {
type: 'string',
default: ''
},
height: {
type: 'number',
default: null,
optional: true
},
occurrenceKey: {
minLength: 1,
type: 'string',
default: null,
optional: true
},
width: {
type: 'number',
default: null,
optional: true
},
__contextId: {
type: 'string',
default: null,
optional: true
},
__displayType: {
type: 'enum',
values: ['file', 'thumbnail'],
default: null,
optional: true
},
__external: {
type: 'boolean',
default: false,
optional: true
},
__fileMimeType: {
type: 'string',
default: null,
optional: true
},
__fileName: {
type: 'number',
default: null,
optional: true
},
__fileSize: {
type: 'string',
default: null,
optional: true
},
__mediaTraceId: {
type: 'string',
default: null,
optional: true
}
}, {
type: {
type: 'enum',
values: ['external'],
default: 'file'
},
alt: {
type: 'string',
default: '',
optional: true
},
height: {
type: 'number',
default: null,
optional: true
},
width: {
type: 'number',
default: null,
optional: true
},
url: {
type: 'string',
default: null
},
__external: {
type: 'boolean',
default: false,
optional: true
}
}]
}
});