UNPKG

@atlaskit/adf-schema

Version:

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

26 lines 1.72 kB
import { layoutSectionWithSingleColumn } from './nodes'; import { border } from './marks'; import { createSchema } from './create-schema'; const getDefaultSchemaConfig = () => { let 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 const defaultSchemaConfig = getDefaultSchemaConfig(); export const getSchemaBasedOnStage = (stage = 'final') => { const defaultSchemaConfig = getDefaultSchemaConfig(); if (stage === 'stage0') { defaultSchemaConfig.customNodeSpecs = { layoutSection: layoutSectionWithSingleColumn }; defaultSchemaConfig.customMarkSpecs = { border }; } return createSchema(defaultSchemaConfig); }; export const defaultSchema = getSchemaBasedOnStage();