UNPKG

@atlaskit/adf-schema

Version:

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

60 lines (59 loc) 1.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.bodiedExtension = void 0; var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator"); var _nonNestableBlockContentGroup = require("../groups/nonNestableBlockContentGroup"); var _dataConsumer = require("../marks/dataConsumer"); var _fragment = require("../marks/fragment"); var _unsupportedMark = require("../marks/unsupportedMark"); var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute"); var bodiedExtension = exports.bodiedExtension = (0, _adfSchemaGenerator.adfNode)('bodiedExtension').define({ defining: true, selectable: true, isolating: 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: [_unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute], hasEmptyMarks: true, attrs: { extensionKey: { minLength: 1, type: 'string', default: '' }, extensionType: { minLength: 1, type: 'string', default: '' }, parameters: { type: 'object', optional: true, default: null }, text: { type: 'string', optional: true, default: null }, layout: { type: 'enum', values: ['wide', 'full-width', 'default'], optional: true, default: 'default' }, localId: { minLength: 1, type: 'string', optional: true, default: null } }, content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_nonNestableBlockContentGroup.nonNestableBlockContentGroup))] }).variant('with_marks', { marks: [_dataConsumer.dataConsumer, _fragment.fragment, _unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute], content: [], ignore: [] });