@atlaskit/adf-schema 25.6.0 → 25.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/schema/nodes/tableNodes.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/schema/nodes/tableNodes.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/schema/nodes/tableNodes.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.0/index.d.ts +6 -0
- package/dist/types-ts4.0/json-schema/index.d.ts +2 -0
- package/dist/types-ts4.0/schema/bitbucket-schema.d.ts +5 -0
- package/dist/types-ts4.0/schema/confluence-schema.d.ts +9 -0
- package/dist/types-ts4.0/schema/create-schema.d.ts +32 -0
- package/dist/types-ts4.0/schema/default-schema.d.ts +7 -0
- package/dist/types-ts4.0/schema/groups.d.ts +6 -0
- package/dist/types-ts4.0/schema/index.d.ts +9 -0
- package/dist/types-ts4.0/schema/inline-nodes.d.ts +1 -0
- package/dist/types-ts4.0/schema/jira-schema.d.ts +65 -0
- package/dist/types-ts4.0/schema/marks/alignment.d.ts +16 -0
- package/dist/types-ts4.0/schema/marks/annotation.d.ts +32 -0
- package/dist/types-ts4.0/schema/marks/border.d.ts +24 -0
- package/dist/types-ts4.0/schema/marks/breakout.d.ts +12 -0
- package/dist/types-ts4.0/schema/marks/code.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/confluence-inline-comment.d.ts +12 -0
- package/dist/types-ts4.0/schema/marks/data-consumer.d.ts +48 -0
- package/dist/types-ts4.0/schema/marks/em.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/fragment.d.ts +29 -0
- package/dist/types-ts4.0/schema/marks/indentation.d.ts +16 -0
- package/dist/types-ts4.0/schema/marks/index.d.ts +34 -0
- package/dist/types-ts4.0/schema/marks/link.d.ts +35 -0
- package/dist/types-ts4.0/schema/marks/strike.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/strong.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/subsup.d.ts +15 -0
- package/dist/types-ts4.0/schema/marks/text-color.d.ts +22 -0
- package/dist/types-ts4.0/schema/marks/type-ahead-query.d.ts +2 -0
- package/dist/types-ts4.0/schema/marks/underline.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/unsupported-mark.d.ts +2 -0
- package/dist/types-ts4.0/schema/marks/unsupported-node-attributes.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/block-card.d.ts +22 -0
- package/dist/types-ts4.0/schema/nodes/blockquote.d.ts +14 -0
- package/dist/types-ts4.0/schema/nodes/bodied-extension.d.ts +24 -0
- package/dist/types-ts4.0/schema/nodes/bullet-list.d.ts +3 -0
- package/dist/types-ts4.0/schema/nodes/caption.d.ts +20 -0
- package/dist/types-ts4.0/schema/nodes/code-block.d.ts +31 -0
- package/dist/types-ts4.0/schema/nodes/confluence-jira-issue.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/confluence-unsupported-block.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/confluence-unsupported-inline.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/date.d.ts +14 -0
- package/dist/types-ts4.0/schema/nodes/decision-item.d.ts +17 -0
- package/dist/types-ts4.0/schema/nodes/decision-list.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/doc.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/embed-card.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/emoji.d.ts +14 -0
- package/dist/types-ts4.0/schema/nodes/expand.d.ts +33 -0
- package/dist/types-ts4.0/schema/nodes/extension.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/hard-break.d.ts +11 -0
- package/dist/types-ts4.0/schema/nodes/heading.d.ts +36 -0
- package/dist/types-ts4.0/schema/nodes/image.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/index.d.ts +93 -0
- package/dist/types-ts4.0/schema/nodes/inline-card.d.ts +10 -0
- package/dist/types-ts4.0/schema/nodes/inline-extension.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/layout-column.d.ts +21 -0
- package/dist/types-ts4.0/schema/nodes/layout-section.d.ts +44 -0
- package/dist/types-ts4.0/schema/nodes/list-item.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/media-group.d.ts +14 -0
- package/dist/types-ts4.0/schema/nodes/media-inline.d.ts +16 -0
- package/dist/types-ts4.0/schema/nodes/media-single.d.ts +61 -0
- package/dist/types-ts4.0/schema/nodes/media.d.ts +62 -0
- package/dist/types-ts4.0/schema/nodes/mention.d.ts +26 -0
- package/dist/types-ts4.0/schema/nodes/nested-expand.d.ts +27 -0
- package/dist/types-ts4.0/schema/nodes/ordered-list.d.ts +4 -0
- package/dist/types-ts4.0/schema/nodes/panel.d.ts +38 -0
- package/dist/types-ts4.0/schema/nodes/paragraph.d.ts +37 -0
- package/dist/types-ts4.0/schema/nodes/placeholder.d.ts +11 -0
- package/dist/types-ts4.0/schema/nodes/rule.d.ts +8 -0
- package/dist/types-ts4.0/schema/nodes/status.d.ts +20 -0
- package/dist/types-ts4.0/schema/nodes/tableNodes.d.ts +114 -0
- package/dist/types-ts4.0/schema/nodes/task-item.d.ts +17 -0
- package/dist/types-ts4.0/schema/nodes/task-list.d.ts +21 -0
- package/dist/types-ts4.0/schema/nodes/text.d.ts +15 -0
- package/dist/types-ts4.0/schema/nodes/types/block-content.d.ts +22 -0
- package/dist/types-ts4.0/schema/nodes/types/extensions.d.ts +34 -0
- package/dist/types-ts4.0/schema/nodes/types/inline-content.d.ts +32 -0
- package/dist/types-ts4.0/schema/nodes/types/list.d.ts +42 -0
- package/dist/types-ts4.0/schema/nodes/types/mark.d.ts +15 -0
- package/dist/types-ts4.0/schema/nodes/types/non-nestable-block-content.d.ts +20 -0
- package/dist/types-ts4.0/schema/nodes/types/rich-media-common.d.ts +9 -0
- package/dist/types-ts4.0/schema/nodes/unknown-block.d.ts +3 -0
- package/dist/types-ts4.0/schema/nodes/unsupported-block.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/unsupported-inline.d.ts +2 -0
- package/dist/types-ts4.0/schema/unsupported.d.ts +1 -0
- package/dist/types-ts4.0/steps/analytics.d.ts +59 -0
- package/dist/types-ts4.0/steps/link-meta-step.d.ts +51 -0
- package/dist/types-ts4.0/steps/set-attrs.d.ts +23 -0
- package/dist/types-ts4.0/steps/table/add-column.d.ts +88 -0
- package/dist/types-ts4.0/steps/table/constants.d.ts +4 -0
- package/dist/types-ts4.0/steps/table/sort-column.d.ts +18 -0
- package/dist/types-ts4.0/steps/table/types.d.ts +39 -0
- package/dist/types-ts4.0/steps/table/utils/cell-step.d.ts +51 -0
- package/dist/types-ts4.0/steps/table/utils/cells-at-column.d.ts +20 -0
- package/dist/types-ts4.0/steps/table/utils/find-column.d.ts +8 -0
- package/dist/types-ts4.0/steps/table/utils/get-table-rect-from-doc.d.ts +8 -0
- package/dist/types-ts4.0/steps/table/utils/side-effects/rows.d.ts +25 -0
- package/dist/types-ts4.0/steps/table/utils/side-effects/side-effects.d.ts +15 -0
- package/dist/types-ts4.0/steps/table/utils/side-effects/table.d.ts +16 -0
- package/dist/types-ts4.0/steps/table/utils/side-effects/types.d.ts +33 -0
- package/dist/types-ts4.0/steps/table/utils/table-map.d.ts +6 -0
- package/dist/types-ts4.0/steps/type-ahead.d.ts +35 -0
- package/dist/types-ts4.0/steps.d.ts +10 -0
- package/dist/types-ts4.0/utils/colors.d.ts +74 -0
- package/dist/types-ts4.0/utils/confluence/emoji.d.ts +50 -0
- package/dist/types-ts4.0/utils/extensions.d.ts +3 -0
- package/dist/types-ts4.0/utils/index.d.ts +6 -0
- package/dist/types-ts4.0/utils/parseDOM.d.ts +1 -0
- package/dist/types-ts4.0/utils/url.d.ts +31 -0
- package/dist/types-ts4.0/utils/uuid.d.ts +5 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -87,7 +87,7 @@ var getCellDomAttrs = function getCellDomAttrs(node) {
|
|
87
87
|
if (ignored) {
|
88
88
|
attrs.style = '';
|
89
89
|
} else {
|
90
|
-
var color = (0, _colors.isRgb)(background) ? (0, _colors.rgbToHex)(background) : background;
|
90
|
+
var color = (0, _colors.isRgb)(background) && (0, _colors.rgbToHex)(background) ? (0, _colors.rgbToHex)(background) : background;
|
91
91
|
var tokenName = (0, _editorPalette.hexToEditorBackgroundPaletteColorTokenName)(color);
|
92
92
|
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
93
93
|
var tokenColor = tokenName ? (0, _tokens.getTokenValue)(tokenName) : color;
|
package/dist/cjs/version.json
CHANGED
@@ -74,7 +74,7 @@ export const getCellDomAttrs = node => {
|
|
74
74
|
if (ignored) {
|
75
75
|
attrs.style = '';
|
76
76
|
} else {
|
77
|
-
const color = isRgb(background) ? rgbToHex(background) : background;
|
77
|
+
const color = isRgb(background) && rgbToHex(background) ? rgbToHex(background) : background;
|
78
78
|
const tokenName = hexToEditorBackgroundPaletteColorTokenName(color);
|
79
79
|
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
80
80
|
const tokenColor = tokenName ? getTokenValue(tokenName) : color;
|
package/dist/es2019/version.json
CHANGED
@@ -74,7 +74,7 @@ export var getCellDomAttrs = function getCellDomAttrs(node) {
|
|
74
74
|
if (ignored) {
|
75
75
|
attrs.style = '';
|
76
76
|
} else {
|
77
|
-
var color = isRgb(background) ? rgbToHex(background) : background;
|
77
|
+
var color = isRgb(background) && rgbToHex(background) ? rgbToHex(background) : background;
|
78
78
|
var tokenName = hexToEditorBackgroundPaletteColorTokenName(color);
|
79
79
|
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
80
80
|
var tokenColor = tokenName ? getTokenValue(tokenName) : color;
|
package/dist/esm/version.json
CHANGED
@@ -0,0 +1,6 @@
|
|
1
|
+
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette,
|
2
|
+
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
3
|
+
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, } from './schema';
|
4
|
+
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DataConsumerAttributes, DataConsumerDefinition, DataType, DateDefinition, DecisionItemDefinition, DecisionListDefinition, DocNode, EmbedCardDefinition, EmbedCardAttributes, EmDefinition, EmojiAttributes, EmojiDefinition, ExpandDefinition, ExtensionDefinition, ExtensionLayout, ExternalMediaAttributes, FragmentAttributes, FragmentDefinition, HardBreakDefinition, HeadingBaseDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithMarksDefinition, IndentationMarkAttributes, IndentationMarkDefinition, Inline, InlineAtomic, InlineCardDefinition, InlineCode, InlineExtensionDefinition, InlineFormattedText, InlineLinkText, LayoutColumnDefinition, LayoutSectionDefinition, LayoutSectionFullDefinition, LayoutSectionWithSingleColumnDefinition, LinkAttributes, LinkDefinition, ListItemArray, ListItemDefinition, MarksObject, MediaADFAttrs, MediaAttributes, MediaInlineAttributes, MediaInlineDefinition, MediaBaseAttributes, MediaDefinition, MediaDisplayType, MediaGroupDefinition, MediaSingleDefinition, MediaType, MentionAttributes, MentionDefinition, MentionUserType, NestedExpandContent, NestedExpandDefinition, NoMark, NonNestableBlockContent, OrderedListDefinition, PanelAttributes, PanelDefinition, ParagraphBaseDefinition, ParagraphDefinition, ParagraphWithAlignmentDefinition, ParagraphWithIndentationDefinition, ParagraphWithMarksDefinition, PlaceholderDefinition, RuleDefinition, StatusDefinition, StrikeDefinition, StrongDefinition, SubSupAttributes, SubSupDefinition, TableAttributes, TableCellDefinition, TableDefinition, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextColorAttributes, TextColorDefinition, TextDefinition, UnderlineDefinition, UrlType, AnnotationId, RichMediaAttributes, RichMediaLayout, AnnotationDataAttributes, CellDomAttrs, BorderMarkAttributes, BorderMarkDefinition, } from './schema';
|
5
|
+
export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid, } from './utils';
|
6
|
+
export type { Match, NameToEmoji } from './utils';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Schema } from 'prosemirror-model';
|
2
|
+
/**
|
3
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
4
|
+
**/
|
5
|
+
export declare const confluenceSchema: Schema;
|
6
|
+
/**
|
7
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
8
|
+
**/
|
9
|
+
export declare const confluenceSchemaWithMediaSingle: Schema;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { NodeSpec, MarkSpec, Schema } from 'prosemirror-model';
|
2
|
+
/**
|
3
|
+
* Creates a schema preserving order of marks and nodes.
|
4
|
+
*/
|
5
|
+
export declare function createSchema<N extends string = string, M extends string = string>(config: SchemaConfig<N, M>): Schema<N, M>;
|
6
|
+
export declare function sanitizeNodes(nodes: {
|
7
|
+
[key: string]: NodeSpec;
|
8
|
+
}, supportedMarks: {
|
9
|
+
[key: string]: MarkSpec;
|
10
|
+
}): {
|
11
|
+
[key: string]: NodeSpec;
|
12
|
+
};
|
13
|
+
export declare function sanitizeNodeSpecContent(nodes: {
|
14
|
+
[key: string]: NodeSpec;
|
15
|
+
}, rawContent: string): string;
|
16
|
+
export interface SchemaConfig<N = string, M = string> {
|
17
|
+
nodes: N[];
|
18
|
+
customNodeSpecs?: SchemaCustomNodeSpecs;
|
19
|
+
marks?: M[];
|
20
|
+
customMarkSpecs?: SchemaCustomMarkSpecs;
|
21
|
+
}
|
22
|
+
export interface SchemaBuiltInItem {
|
23
|
+
name: string;
|
24
|
+
spec: NodeSpec | MarkSpec;
|
25
|
+
}
|
26
|
+
export interface SchemaCustomNodeSpecs {
|
27
|
+
[name: string]: NodeSpec;
|
28
|
+
}
|
29
|
+
export interface SchemaCustomMarkSpecs {
|
30
|
+
[name: string]: MarkSpec;
|
31
|
+
}
|
32
|
+
export declare const allowCustomPanel: boolean;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { SchemaConfig } from './create-schema';
|
2
|
+
declare type DefaultSchemaNodes = 'doc' | 'paragraph' | 'text' | 'bulletList' | 'orderedList' | 'listItem' | 'heading' | 'blockquote' | 'codeBlock' | 'panel' | 'rule' | 'image' | 'mention' | 'media' | 'caption' | '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';
|
3
|
+
declare type DefaultSchemaMarks = 'link' | 'em' | 'strong' | 'strike' | 'subsup' | 'underline' | 'code' | 'textColor' | 'confluenceInlineComment' | 'breakout' | 'alignment' | 'indentation' | 'annotation' | 'unsupportedMark' | 'unsupportedNodeAttribute' | 'typeAheadQuery' | 'dataConsumer' | 'fragment';
|
4
|
+
export declare const defaultSchemaConfig: SchemaConfig<DefaultSchemaNodes, DefaultSchemaMarks>;
|
5
|
+
export declare const getSchemaBasedOnStage: (stage?: string) => import("prosemirror-model").Schema<DefaultSchemaNodes, DefaultSchemaMarks>;
|
6
|
+
export declare const defaultSchema: import("prosemirror-model").Schema<DefaultSchemaNodes, DefaultSchemaMarks>;
|
7
|
+
export {};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export declare const FONT_STYLE = "fontStyle";
|
2
|
+
export declare const SEARCH_QUERY = "searchQuery";
|
3
|
+
export declare const LINK = "link";
|
4
|
+
export declare const COLOR = "color";
|
5
|
+
export declare const ALIGNMENT = "alignment";
|
6
|
+
export declare const INDENTATION = "indentation";
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaInline, mediaSingleWithCaption, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, } from './nodes';
|
2
|
+
export type { BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, DataType, DateDefinition, DecisionItemDefinition, DecisionListDefinition, DocNode, EmbedCardDefinition, EmbedCardAttributes, EmojiAttributes, EmojiDefinition, ExpandDefinition, ExtensionDefinition, ExtensionLayout, ExternalMediaAttributes, HardBreakDefinition, HeadingBaseDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithMarksDefinition, Inline, InlineAtomic, InlineCardDefinition, InlineCode, InlineExtensionDefinition, InlineFormattedText, InlineLinkText, LayoutColumnDefinition, LayoutSectionDefinition, LayoutSectionBaseDefinition, LayoutSectionFullDefinition, LayoutSectionWithSingleColumnDefinition, ListItemArray, ListItemDefinition, MarksObject, MediaADFAttrs, MediaAttributes, MediaInlineAttributes, MediaInlineDefinition, MediaBaseAttributes, MediaDefinition, MediaDisplayType, MediaGroupDefinition, MediaSingleDefinition, MediaType, MentionAttributes, MentionDefinition, MentionUserType, NestedExpandContent, NestedExpandDefinition, NoMark, NonNestableBlockContent, OrderedListDefinition, PanelAttributes, PanelDefinition, ParagraphBaseDefinition, ParagraphDefinition, ParagraphWithAlignmentDefinition, ParagraphWithIndentationDefinition, ParagraphWithMarksDefinition, PlaceholderDefinition, RuleDefinition, StatusDefinition, TableAttributes, TableCellDefinition, TableDefinition, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextDefinition, UrlType, RichMediaAttributes, RichMediaLayout, CellDomAttrs, } from './nodes';
|
3
|
+
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
|
4
|
+
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
5
|
+
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, } from './marks';
|
6
|
+
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, CodeDefinition, EmDefinition, FragmentAttributes, FragmentDefinition, IndentationMarkAttributes, IndentationMarkDefinition, LinkAttributes, LinkDefinition, StrikeDefinition, StrongDefinition, SubSupAttributes, SubSupDefinition, TextColorAttributes, TextColorDefinition, UnderlineDefinition, AnnotationId, AnnotationDataAttributes, DataConsumerAttributes, DataConsumerDefinition, BorderMarkAttributes, BorderMarkDefinition, } from './marks';
|
7
|
+
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
8
|
+
export { inlineNodes } from './inline-nodes';
|
9
|
+
export { sanitizeNodes, createSchema } from './create-schema';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const inlineNodes: Set<string>;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { Schema } from 'prosemirror-model';
|
2
|
+
/**
|
3
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
4
|
+
**/
|
5
|
+
export interface JIRASchemaConfig {
|
6
|
+
allowLists?: boolean;
|
7
|
+
allowMentions?: boolean;
|
8
|
+
allowEmojis?: boolean;
|
9
|
+
allowLinks?: boolean;
|
10
|
+
allowAdvancedTextFormatting?: boolean;
|
11
|
+
allowCodeBlock?: boolean;
|
12
|
+
allowBlockQuote?: boolean;
|
13
|
+
allowSubSup?: boolean;
|
14
|
+
allowMedia?: boolean;
|
15
|
+
allowTextColor?: boolean;
|
16
|
+
allowTables?: boolean;
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
20
|
+
**/
|
21
|
+
export default function makeSchema(config: JIRASchemaConfig): Schema<string, string>;
|
22
|
+
/**
|
23
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
24
|
+
**/
|
25
|
+
export declare function isSchemaWithLists(schema: Schema): boolean;
|
26
|
+
/**
|
27
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
28
|
+
**/
|
29
|
+
export declare function isSchemaWithMentions(schema: Schema): boolean;
|
30
|
+
/**
|
31
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
32
|
+
**/
|
33
|
+
export declare function isSchemaWithEmojis(schema: Schema): boolean;
|
34
|
+
/**
|
35
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
36
|
+
**/
|
37
|
+
export declare function isSchemaWithLinks(schema: Schema): boolean;
|
38
|
+
/**
|
39
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
40
|
+
**/
|
41
|
+
export declare function isSchemaWithAdvancedTextFormattingMarks(schema: Schema): boolean;
|
42
|
+
/**
|
43
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
44
|
+
**/
|
45
|
+
export declare function isSchemaWithSubSupMark(schema: Schema): boolean;
|
46
|
+
/**
|
47
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
48
|
+
**/
|
49
|
+
export declare function isSchemaWithCodeBlock(schema: Schema): boolean;
|
50
|
+
/**
|
51
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
52
|
+
**/
|
53
|
+
export declare function isSchemaWithBlockQuotes(schema: Schema): boolean;
|
54
|
+
/**
|
55
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
56
|
+
**/
|
57
|
+
export declare function isSchemaWithMedia(schema: Schema): boolean;
|
58
|
+
/**
|
59
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
60
|
+
**/
|
61
|
+
export declare function isSchemaWithTextColor(schema: Schema): boolean;
|
62
|
+
/**
|
63
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
64
|
+
**/
|
65
|
+
export declare function isSchemaWithTables(schema: Schema): boolean;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { MarkSpec } from 'prosemirror-model';
|
2
|
+
/** TODO: Flip these positions for RTL */
|
3
|
+
export declare const alignmentPositionMap: {
|
4
|
+
[key: string]: string;
|
5
|
+
};
|
6
|
+
export interface AlignmentAttributes {
|
7
|
+
align: 'center' | 'end';
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* @name alignment_mark
|
11
|
+
*/
|
12
|
+
export interface AlignmentMarkDefinition {
|
13
|
+
type: 'alignment';
|
14
|
+
attrs: AlignmentAttributes;
|
15
|
+
}
|
16
|
+
export declare const alignment: MarkSpec;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { MarkSpec } from 'prosemirror-model';
|
2
|
+
/**
|
3
|
+
* @name annotation_mark
|
4
|
+
*/
|
5
|
+
export interface AnnotationMarkDefinition {
|
6
|
+
type: 'annotation';
|
7
|
+
attrs: AnnotationMarkAttributes;
|
8
|
+
}
|
9
|
+
export interface AnnotationMarkAttributes {
|
10
|
+
id: AnnotationId;
|
11
|
+
annotationType: AnnotationTypes;
|
12
|
+
}
|
13
|
+
export declare type AnnotationId = string;
|
14
|
+
export declare enum AnnotationTypes {
|
15
|
+
INLINE_COMMENT = "inlineComment"
|
16
|
+
}
|
17
|
+
export declare enum AnnotationMarkStates {
|
18
|
+
RESOLVED = "resolved",
|
19
|
+
ACTIVE = "active"
|
20
|
+
}
|
21
|
+
export declare type AnnotationDataAttributes = {
|
22
|
+
'data-mark-type': string;
|
23
|
+
'data-mark-annotation-type': AnnotationTypes;
|
24
|
+
'data-id': AnnotationId;
|
25
|
+
'data-mark-annotation-state'?: AnnotationMarkStates;
|
26
|
+
};
|
27
|
+
declare type BuildDataAttributesProps = AnnotationMarkAttributes & {
|
28
|
+
state?: AnnotationMarkStates | undefined | null;
|
29
|
+
};
|
30
|
+
export declare function buildDataAttributes({ id, annotationType, state, }: BuildDataAttributesProps): AnnotationDataAttributes;
|
31
|
+
export declare const annotation: MarkSpec;
|
32
|
+
export {};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { MarkSpec } from 'prosemirror-model';
|
2
|
+
export declare type BorderMarkAttributes = {
|
3
|
+
/**
|
4
|
+
* @minimum 1
|
5
|
+
* @maximum 3
|
6
|
+
*/
|
7
|
+
size: number;
|
8
|
+
/**
|
9
|
+
* @pattern "^#[0-9a-fA-F]{8}$|^#[0-9a-fA-F]{6}$"
|
10
|
+
*/
|
11
|
+
color: string;
|
12
|
+
};
|
13
|
+
/**
|
14
|
+
* @name border_mark
|
15
|
+
* @stage 0
|
16
|
+
* @description This mark adds decoration to an element, and any element decorated with it will also have a border style.
|
17
|
+
*/
|
18
|
+
export interface BorderMarkDefinition {
|
19
|
+
type: 'border';
|
20
|
+
attrs: BorderMarkAttributes;
|
21
|
+
}
|
22
|
+
export declare type BorderColorKey = 'Subtle gray' | 'Gray' | 'Bold gray';
|
23
|
+
export declare const borderColorPalette: Map<string, BorderColorKey>;
|
24
|
+
export declare const border: MarkSpec;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { MarkSpec } from 'prosemirror-model';
|
2
|
+
export declare type BreakoutMarkAttrs = {
|
3
|
+
mode: 'wide' | 'full-width';
|
4
|
+
};
|
5
|
+
/**
|
6
|
+
* @name breakout_mark
|
7
|
+
*/
|
8
|
+
export interface BreakoutMarkDefinition {
|
9
|
+
type: 'breakout';
|
10
|
+
attrs: BreakoutMarkAttrs;
|
11
|
+
}
|
12
|
+
export declare const breakout: MarkSpec;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { MarkSpec } from 'prosemirror-model';
|
2
|
+
/**
|
3
|
+
* @name inline_comment_marker
|
4
|
+
* @description This temporary mark represents a Confluence-backed inline comment that wraps a piece of text. It will be replaced with a cross-product inline comment solution at later date.
|
5
|
+
*/
|
6
|
+
export interface ConfluenceInlineCommentDefinition {
|
7
|
+
type: 'confluenceInlineComment';
|
8
|
+
attrs: {
|
9
|
+
reference: string;
|
10
|
+
};
|
11
|
+
}
|
12
|
+
export declare const confluenceInlineComment: MarkSpec;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { Mark, MarkSpec } from 'prosemirror-model';
|
2
|
+
/**
|
3
|
+
* This annotation is purely for reference, & does _nothing_ given annotating
|
4
|
+
* `minLength` on an array of strings is not supported with our schema+spec
|
5
|
+
* generator.
|
6
|
+
*
|
7
|
+
* We're keeping it to signal that data consumer `sources` shouldn't be empty
|
8
|
+
* strings
|
9
|
+
*
|
10
|
+
* // @minLength 1
|
11
|
+
*/
|
12
|
+
declare type DataConsumerSource = string;
|
13
|
+
export interface DataConsumerAttributes {
|
14
|
+
/**
|
15
|
+
* @minItems 1
|
16
|
+
*/
|
17
|
+
sources: Array<DataConsumerSource>;
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* @name dataConsumer_mark
|
21
|
+
* @description This mark is used for metadata surrounding a node consuming data
|
22
|
+
* from a given source node
|
23
|
+
*/
|
24
|
+
export interface DataConsumerDefinition {
|
25
|
+
type: 'dataConsumer';
|
26
|
+
attrs: DataConsumerAttributes;
|
27
|
+
}
|
28
|
+
export interface DataConsumerMark extends Mark {
|
29
|
+
attrs: DataConsumerAttributes;
|
30
|
+
}
|
31
|
+
export declare const dataConsumer: MarkSpec;
|
32
|
+
/**
|
33
|
+
* We want to ensure any "invalid ADF" doesn't get serialised, but the entire
|
34
|
+
* mark itself is not valid without a non-empty `sources`.
|
35
|
+
*
|
36
|
+
* We _almost could_ simply return `null` if sources length is < 0 & would fit
|
37
|
+
* the type signature of prosemirror-model's `fragment` but not `mark`'s toJSON.
|
38
|
+
*
|
39
|
+
* So we'll leave any extra transformation checks in
|
40
|
+
* `editor-json-transformer`(?)
|
41
|
+
*/
|
42
|
+
export declare const toJSON: (mark: Mark) => {
|
43
|
+
type: string;
|
44
|
+
attrs: {
|
45
|
+
[key: string]: any;
|
46
|
+
};
|
47
|
+
};
|
48
|
+
export {};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { Mark, MarkSpec } from 'prosemirror-model';
|
2
|
+
export declare type LocalId = string;
|
3
|
+
export interface FragmentAttributes {
|
4
|
+
/**
|
5
|
+
* @minLength 1
|
6
|
+
*/
|
7
|
+
localId: LocalId;
|
8
|
+
name?: string;
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* @name fragment_mark
|
12
|
+
* @description Indicates that the elements decorated with this mark belong to a "fragment" entity, which represents a collection of ADF nodes.
|
13
|
+
* This entity can be referred to later by its `localId` attribute.
|
14
|
+
*/
|
15
|
+
export interface FragmentDefinition {
|
16
|
+
type: 'fragment';
|
17
|
+
attrs: FragmentAttributes;
|
18
|
+
}
|
19
|
+
export interface FragmentMark extends Mark {
|
20
|
+
attrs: FragmentAttributes;
|
21
|
+
}
|
22
|
+
export declare const fragment: MarkSpec;
|
23
|
+
export declare const toJSON: (mark: Mark) => {
|
24
|
+
type: string;
|
25
|
+
attrs: {
|
26
|
+
name?: any;
|
27
|
+
localId: any;
|
28
|
+
};
|
29
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { MarkSpec } from 'prosemirror-model';
|
2
|
+
export interface IndentationMarkAttributes {
|
3
|
+
/**
|
4
|
+
* @minimum 1
|
5
|
+
* @maximum 6
|
6
|
+
*/
|
7
|
+
level: number;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* @name indentation_mark
|
11
|
+
*/
|
12
|
+
export interface IndentationMarkDefinition {
|
13
|
+
type: 'indentation';
|
14
|
+
attrs: IndentationMarkAttributes;
|
15
|
+
}
|
16
|
+
export declare const indentation: MarkSpec;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
export { em } from './em';
|
2
|
+
export type { EmDefinition } from './em';
|
3
|
+
export { code } from './code';
|
4
|
+
export type { CodeDefinition } from './code';
|
5
|
+
export { strike } from './strike';
|
6
|
+
export type { StrikeDefinition } from './strike';
|
7
|
+
export { strong } from './strong';
|
8
|
+
export type { StrongDefinition } from './strong';
|
9
|
+
export { underline } from './underline';
|
10
|
+
export type { UnderlineDefinition } from './underline';
|
11
|
+
export { link, toJSON as linkToJSON } from './link';
|
12
|
+
export type { LinkAttributes, LinkDefinition } from './link';
|
13
|
+
export { typeAheadQuery } from './type-ahead-query';
|
14
|
+
export { subsup } from './subsup';
|
15
|
+
export type { SubSupDefinition, SubSupAttributes } from './subsup';
|
16
|
+
export { textColor, colorPalette, colorPaletteExtended } from './text-color';
|
17
|
+
export type { TextColorDefinition, TextColorAttributes } from './text-color';
|
18
|
+
export { confluenceInlineComment } from './confluence-inline-comment';
|
19
|
+
export { breakout } from './breakout';
|
20
|
+
export type { BreakoutMarkAttrs, BreakoutMarkDefinition } from './breakout';
|
21
|
+
export { alignment, alignmentPositionMap } from './alignment';
|
22
|
+
export type { AlignmentAttributes, AlignmentMarkDefinition } from './alignment';
|
23
|
+
export { indentation } from './indentation';
|
24
|
+
export type { IndentationMarkAttributes, IndentationMarkDefinition, } from './indentation';
|
25
|
+
export { annotation, AnnotationMarkStates, buildDataAttributes as buildAnnotationMarkDataAttributes, AnnotationTypes, } from './annotation';
|
26
|
+
export type { AnnotationMarkDefinition, AnnotationMarkAttributes, AnnotationId, AnnotationDataAttributes, } from './annotation';
|
27
|
+
export { unsupportedMark } from './unsupported-mark';
|
28
|
+
export { unsupportedNodeAttribute } from './unsupported-node-attributes';
|
29
|
+
export type { DataConsumerAttributes, DataConsumerDefinition, } from './data-consumer';
|
30
|
+
export { dataConsumer, toJSON as dataConsumerToJSON } from './data-consumer';
|
31
|
+
export type { FragmentAttributes, FragmentDefinition, LocalId, } from './fragment';
|
32
|
+
export { fragment, toJSON as fragmentToJSON } from './fragment';
|
33
|
+
export { border, borderColorPalette } from './border';
|
34
|
+
export type { BorderMarkAttributes, BorderMarkDefinition } from './border';
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { MarkSpec, Mark } from 'prosemirror-model';
|
2
|
+
export interface ConfluenceLinkMetadata {
|
3
|
+
linkType: string;
|
4
|
+
versionAtSave?: string | null;
|
5
|
+
fileName?: string | null;
|
6
|
+
spaceKey?: string | null;
|
7
|
+
contentTitle?: string | null;
|
8
|
+
isRenamedTitle?: boolean;
|
9
|
+
anchorName?: string | null;
|
10
|
+
contentId?: string | null;
|
11
|
+
container?: ConfluenceLinkMetadata;
|
12
|
+
}
|
13
|
+
export interface LinkAttributes {
|
14
|
+
/**
|
15
|
+
* @validatorFn safeUrl
|
16
|
+
*/
|
17
|
+
href: string;
|
18
|
+
title?: string;
|
19
|
+
id?: string;
|
20
|
+
collection?: string;
|
21
|
+
occurrenceKey?: string;
|
22
|
+
__confluenceMetadata?: ConfluenceLinkMetadata;
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* @name link_mark
|
26
|
+
*/
|
27
|
+
export interface LinkDefinition {
|
28
|
+
type: 'link';
|
29
|
+
attrs: LinkAttributes;
|
30
|
+
}
|
31
|
+
export declare const link: MarkSpec;
|
32
|
+
export declare const toJSON: (mark: Mark) => {
|
33
|
+
type: string;
|
34
|
+
attrs: Record<string, string>;
|
35
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { MarkSpec, Mark } from 'prosemirror-model';
|
2
|
+
export interface SubSupAttributes {
|
3
|
+
type: 'sub' | 'sup';
|
4
|
+
}
|
5
|
+
/**
|
6
|
+
* @name subsup_mark
|
7
|
+
*/
|
8
|
+
export interface SubSupDefinition {
|
9
|
+
type: 'subsup';
|
10
|
+
attrs: SubSupAttributes;
|
11
|
+
}
|
12
|
+
export interface SubSupMark extends Mark {
|
13
|
+
attrs: SubSupAttributes;
|
14
|
+
}
|
15
|
+
export declare const subsup: MarkSpec;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Mark, MarkSpec } from 'prosemirror-model';
|
2
|
+
export interface TextColorAttributes {
|
3
|
+
/**
|
4
|
+
* @pattern "^#[0-9a-fA-F]{6}$"
|
5
|
+
*/
|
6
|
+
color: string;
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* @name textColor_mark
|
10
|
+
*/
|
11
|
+
export interface TextColorDefinition {
|
12
|
+
type: 'textColor';
|
13
|
+
attrs: TextColorAttributes;
|
14
|
+
}
|
15
|
+
export interface TextColorMark extends Mark {
|
16
|
+
attrs: TextColorAttributes;
|
17
|
+
}
|
18
|
+
export declare type TextColorKey = 'Light gray' | 'Purple' | 'Teal' | 'Green' | 'Red' | 'Orange' | 'Dark gray' | 'Blue' | 'Yellow' | 'Dark blue' | 'Dark teal' | 'Dark green' | 'Dark red' | 'Dark purple' | 'White' | 'Light blue' | 'Light teal' | 'Light green' | 'Light yellow' | 'Light red' | 'Light purple';
|
19
|
+
export declare const colorPalette: Map<string, TextColorKey>;
|
20
|
+
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
21
|
+
export declare const colorPaletteExtended: Map<string, TextColorKey>;
|
22
|
+
export declare const textColor: MarkSpec;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
export interface UrlType {
|
3
|
+
/**
|
4
|
+
* @validatorFn safeUrl
|
5
|
+
*/
|
6
|
+
url: string;
|
7
|
+
}
|
8
|
+
export interface DataType {
|
9
|
+
/**
|
10
|
+
* @additionalProperties true
|
11
|
+
*/
|
12
|
+
data: object;
|
13
|
+
}
|
14
|
+
export declare type CardAttributes = UrlType | DataType;
|
15
|
+
/**
|
16
|
+
* @name blockCard_node
|
17
|
+
*/
|
18
|
+
export interface BlockCardDefinition {
|
19
|
+
type: 'blockCard';
|
20
|
+
attrs: CardAttributes;
|
21
|
+
}
|
22
|
+
export declare const blockCard: NodeSpec;
|