@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
63 lines (62 loc) • 1.84 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.multiBodiedExtension = void 0;
var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
var _unsupportedMark = require("../marks/unsupportedMark");
var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
var _extensionFrame = require("./extensionFrame");
var multiBodiedExtension = exports.multiBodiedExtension = (0, _adfSchemaGenerator.adfNode)('multiBodiedExtension').define({
stage0: true,
definingAsContext: true,
selectable: true,
// Marks don't make it into the PM node spec, as they get overridden by the marks in
// packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
marks: [_unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
hasEmptyMarks: true,
marksMaxItems: 0,
attrs: {
extensionKey: {
type: 'string',
default: '',
minLength: 1
},
extensionType: {
type: 'string',
default: '',
minLength: 1
},
parameters: {
type: 'object',
optional: true,
default: null
},
text: {
type: 'string',
optional: true,
default: null
},
layout: {
type: 'enum',
values: ['default', 'wide', 'full-width'],
optional: true,
default: 'default'
},
localId: {
type: 'string',
optional: true,
default: null,
minLength: 1
}
},
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_extensionFrame.extensionFrame))],
DANGEROUS_MANUAL_OVERRIDE: {
'validator-spec': {
'props.content.minItems': {
remove: true,
reason: "@DSLCompatibilityException - The content expression and minItems don't match in the current validator schema."
}
}
}
});
;