UNPKG

1.85 kBJavaScriptView Raw
1import { layoutSectionWithSingleColumn } from './nodes';
2import { border } from './marks';
3import { createSchema } from './create-schema';
4var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
5 var defaultSchemaConfig = {
6 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'],
7 marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'dataConsumer', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery',
8 // https://product-fabric.atlassian.net/browse/ED-10214,
9 'fragment']
10 };
11 return defaultSchemaConfig;
12};
13export var defaultSchemaConfig = getDefaultSchemaConfig();
14export var getSchemaBasedOnStage = function getSchemaBasedOnStage() {
15 var stage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'final';
16 var defaultSchemaConfig = getDefaultSchemaConfig();
17 if (stage === 'stage0') {
18 defaultSchemaConfig.customNodeSpecs = {
19 layoutSection: layoutSectionWithSingleColumn
20 };
21 defaultSchemaConfig.customMarkSpecs = {
22 border: border
23 };
24 }
25 return createSchema(defaultSchemaConfig);
26};
27export var defaultSchema = getSchemaBasedOnStage();
\No newline at end of file