UNPKG

@atlaskit/adf-schema

Version:

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

27 lines 1.85 kB
import { layoutSectionWithSingleColumn } from './nodes'; import { border } from './marks'; import { createSchema } from './create-schema'; var getDefaultSchemaConfig = function getDefaultSchemaConfig() { var defaultSchemaConfig = { nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'panel', 'rule', 'image', 'caption', 'mention', 'media', 'mediaGroup', 'mediaSingle', 'mediaInline', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'hardBreak', 'emoji', 'table', 'tableCell', 'tableHeader', 'tableRow', 'decisionList', 'decisionItem', 'taskList', 'taskItem', 'unknownBlock', 'date', 'status', 'placeholder', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard', 'unsupportedBlock', 'unsupportedInline'], marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'dataConsumer', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery', // https://product-fabric.atlassian.net/browse/ED-10214, 'fragment'] }; return defaultSchemaConfig; }; export var defaultSchemaConfig = getDefaultSchemaConfig(); export var getSchemaBasedOnStage = function getSchemaBasedOnStage() { var stage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'final'; var defaultSchemaConfig = getDefaultSchemaConfig(); if (stage === 'stage0') { defaultSchemaConfig.customNodeSpecs = { layoutSection: layoutSectionWithSingleColumn }; defaultSchemaConfig.customMarkSpecs = { border: border }; } return createSchema(defaultSchemaConfig); }; export var defaultSchema = getSchemaBasedOnStage();