@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
79 lines (78 loc) • 2.09 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.blockCard = void 0;
var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
var _unsupportedMark = require("../marks/unsupportedMark");
var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
var blockCard = exports.blockCard = (0, _adfSchemaGenerator.adfNode)('blockCard').define({
draggable: true,
selectable: true,
marks: [_unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
attrs: {
anyOf: [{
url: {
type: 'string',
optional: true,
default: null,
validatorFn: 'safeUrl'
},
datasource: {
type: 'object',
default: null,
additionalProperties: false,
properties: {
id: {
type: 'string'
},
// Empty parameters object carried over from original JSON Schema.
parameters: {
type: 'object'
},
views: {
items: {
additionalProperties: false,
properties: {
// Empty properties object carried over from original JSON Schema
properties: {
optional: true,
type: 'object'
},
type: {
type: 'string'
}
},
required: ['type'],
type: 'object'
},
minItems: 1,
type: 'array'
}
},
required: ['id', 'parameters', 'views']
},
width: {
type: 'number',
optional: true,
default: null
},
layout: {
type: 'enum',
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start'],
optional: true,
default: null
}
}, {
url: {
type: 'string',
validatorFn: 'safeUrl'
}
}, {
data: {
type: 'object',
default: null
}
}]
}
});