UNPKG

@atlaskit/adf-schema

Version:

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

57 lines (56 loc) 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.rule = void 0; var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator"); var _breakout = require("../marks/breakout"); var _unsupportedMark = require("../marks/unsupportedMark"); var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute"); var ruleAttributes = { localId: { type: 'string', default: null, optional: true }, color: { type: 'string', default: null, optional: true, pattern: '^#[0-9a-fA-F]{6}$' }, style: { type: 'enum', values: ['solid', 'dashed', 'dotted', 'sketch', 'fade'], default: null, optional: true }, weight: { type: 'number', default: null, minimum: 1, maximum: 3, optional: true } }; var rule = exports.rule = (0, _adfSchemaGenerator.adfNode)('rule').define({ attrs: { localId: { type: 'string', default: null, optional: true } } }).variant('with_attrs', { stage0: true, attrs: ruleAttributes }) // this variant is used to support breakout resizing for rule nodes at the document root .variant('root_only', { stage0: true, marks: [_breakout.breakout, _unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute] }).variant('with_attrs_root_only', { stage0: true, attrs: ruleAttributes, marks: [_breakout.breakout, _unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute] });