UNPKG

@atlaskit/adf-schema

Version:

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

44 lines (43 loc) 2.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator"); var _blockGroup = require("./groups/blockGroup"); var _layoutSection = require("./nodes/layoutSection"); var _blockRootOnlyGroup = require("./groups/blockRootOnlyGroup"); var _blockContentGroup = require("./groups/blockContentGroup"); var _expand = require("./nodes/expand"); var _codeBlock = require("./nodes/codeBlock"); var _syncBlock = require("./nodes/syncBlock"); var _bodiedSyncBlock = require("./nodes/bodiedSyncBlock"); var _bodiedExtension = require("./nodes/bodiedExtension"); var _extension = require("./nodes/extension"); var _multiBodiedExtension = require("./nodes/multiBodiedExtension"); var _panel = require("./nodes/panel"); var _rule = require("./nodes/rule"); var _bodiedRule = require("./nodes/bodiedRule"); var doc = (0, _adfSchemaGenerator.adfNode)('doc').define({ root: true, version: 1, content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, // `panel.use('c1')` must precede `blockContentGroup`, which contributes the bare `panel` // name to the validator spec. The validator's repairing loop takes the FIRST candidate that // reports valid, and with a repairing callback the less permissive base `panel` "succeeds" // by wrapping a nested table as `unsupportedBlock`, so `panel_c1` is never reached. // Safe because panel_c1's content is a strict superset of the base's (it only adds `table`). // Deliberately placed AFTER `blockGroup` rather than first: `blockContentGroup` is ignored // for `pm-spec`, so this keeps `block` the leading alternative in the PM content // expression and leaves ProseMirror's defaultType/fill behaviour untouched. _panel.panel.use('c1'), _blockContentGroup.blockContentGroup, _codeBlock.codeBlock.use('root_only'), _panel.panel.use('root_only'), _panel.panel.use('c1_root_only'), _rule.rule.use('root_only'), _rule.rule.use('with_attrs_root_only'), _bodiedRule.bodiedRule.use('root_only'), _extension.extension.use('root_only'), _bodiedExtension.bodiedExtension.use('root_only'), _multiBodiedExtension.multiBodiedExtension.use('root_only'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _expand.expand.use('root_only'), _syncBlock.syncBlock, _bodiedSyncBlock.bodiedSyncBlock))], 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." } } } }); var _default = exports.default = doc;