@atlaskit/adf-schema 39.0.0 → 39.0.2
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 +12 -0
- package/dist/cjs/schema/nodes/panel.js +5 -0
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/schema/index.js +2 -1
- package/dist/es2019/schema/nodes/panel.js +5 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/schema/index.js +2 -1
- package/dist/esm/schema/nodes/panel.js +5 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/schema/index.d.ts +3 -1
- package/dist/types/schema/nodes/panel.d.ts +4 -0
- package/package.json +1 -1
- package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +0 -307
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 39.0.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 3d69cd2: clean up comments and remove validating pm spec unit tests as we have migrated pm spec
|
8
|
+
|
9
|
+
## 39.0.1
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 76e3778: [ED-23275] Deprecating panel node from schema. To use `extendedPanel` instead.
|
14
|
+
|
3
15
|
## 39.0.0
|
4
16
|
|
5
17
|
### Major Changes
|
@@ -48,6 +48,11 @@ var getParseDOMAttrs = function getParseDOMAttrs(allowCustomPanel, dom) {
|
|
48
48
|
}
|
49
49
|
return parseDOMAttrs;
|
50
50
|
};
|
51
|
+
|
52
|
+
/**
|
53
|
+
* @name panel
|
54
|
+
* @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead.
|
55
|
+
*/
|
51
56
|
var panel = exports.panel = function panel(allowCustomPanel) {
|
52
57
|
var panelNodeSpec = (0, _nodeTypes.panelLegacy)({
|
53
58
|
parseDOM: [{
|
package/dist/es2019/index.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, blockquoteWithList, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
2
|
-
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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder,
|
2
|
+
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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, /** @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead. */
|
3
|
+
panel, extendedPanel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, 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, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette } from './schema';
|
3
4
|
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, getDarkModeLCHColor } from './utils';
|
4
5
|
|
5
6
|
// ADF createPMSpecFactory
|
@@ -1,4 +1,5 @@
|
|
1
|
-
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder,
|
1
|
+
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, /** @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead. */
|
2
|
+
panel, extendedPanel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension } from './nodes';
|
2
3
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
3
4
|
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, backgroundColor, backgroundColorPalette } from './marks';
|
4
5
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
@@ -41,6 +41,11 @@ const getParseDOMAttrs = (allowCustomPanel, dom) => {
|
|
41
41
|
}
|
42
42
|
return parseDOMAttrs;
|
43
43
|
};
|
44
|
+
|
45
|
+
/**
|
46
|
+
* @name panel
|
47
|
+
* @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead.
|
48
|
+
*/
|
44
49
|
export const panel = allowCustomPanel => {
|
45
50
|
const panelNodeSpec = panelLegacyFactory({
|
46
51
|
parseDOM: [{
|
package/dist/esm/index.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, blockquoteWithList, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
2
|
-
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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder,
|
2
|
+
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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, /** @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead. */
|
3
|
+
panel, extendedPanel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, 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, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette } from './schema';
|
3
4
|
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, getDarkModeLCHColor } from './utils';
|
4
5
|
|
5
6
|
// ADF createPMSpecFactory
|
package/dist/esm/schema/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder,
|
1
|
+
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, /** @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead. */
|
2
|
+
panel, extendedPanel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension } from './nodes';
|
2
3
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
3
4
|
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, backgroundColor, backgroundColorPalette } from './marks';
|
4
5
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
@@ -43,6 +43,11 @@ var getParseDOMAttrs = function getParseDOMAttrs(allowCustomPanel, dom) {
|
|
43
43
|
}
|
44
44
|
return parseDOMAttrs;
|
45
45
|
};
|
46
|
+
|
47
|
+
/**
|
48
|
+
* @name panel
|
49
|
+
* @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead.
|
50
|
+
*/
|
46
51
|
export var panel = function panel(allowCustomPanel) {
|
47
52
|
var panelNodeSpec = panelLegacyFactory({
|
48
53
|
parseDOM: [{
|
package/dist/types/index.d.ts
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, blockquoteWithList, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette,
|
2
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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder,
|
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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder,
|
4
|
+
/** @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead. */
|
5
|
+
panel, extendedPanel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, 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, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette, } from './schema';
|
4
6
|
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DatasourceAttributes, DatasourceAttributeProperties, 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, TableDisplayMode, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextColorAttributes, TextColorDefinition, TextDefinition, UnderlineDefinition, UrlType, AnnotationId, RichMediaAttributes, ExtendedMediaAttributes, RichMediaLayout, AnnotationDataAttributes, CellDomAttrs, BorderMarkAttributes, BorderMarkDefinition, MultiBodiedExtensionDefinition, ExtensionFrameDefinition, BackgroundColorDefinition, } from './schema';
|
5
7
|
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, getDarkModeLCHColor, } from './utils';
|
6
8
|
export type { Match, NameToEmoji } from './utils';
|
@@ -1,4 +1,6 @@
|
|
1
|
-
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder,
|
1
|
+
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder,
|
2
|
+
/** @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead. */
|
3
|
+
panel, extendedPanel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension, } from './nodes';
|
2
4
|
export type { BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, DatasourceAttributes, DatasourceAttributeProperties, 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, TableDisplayMode, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextDefinition, UrlType, RichMediaAttributes, ExtendedMediaAttributes, RichMediaLayout, CellDomAttrs, ExtensionFrameDefinition, MultiBodiedExtensionDefinition, } from './nodes';
|
3
5
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
|
4
6
|
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
@@ -40,6 +40,10 @@ export interface PanelDefinition {
|
|
40
40
|
export interface DOMAttributes {
|
41
41
|
[propName: string]: string;
|
42
42
|
}
|
43
|
+
/**
|
44
|
+
* @name panel
|
45
|
+
* @deprecated [ED-23275] The panel node is deprecated. Use `extendedPanel` instead.
|
46
|
+
*/
|
43
47
|
export declare const panel: (allowCustomPanel: boolean) => import("prosemirror-model").NodeSpec;
|
44
48
|
/**
|
45
49
|
* @name extended_panel
|
package/package.json
CHANGED
@@ -1,307 +0,0 @@
|
|
1
|
-
import { MarkSpec, NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
-
import * as newMarkSpecs from '@atlaskit/adf-schema/src/next-schema/generated/markTypes';
|
3
|
-
import * as newNodeSpecs from '@atlaskit/adf-schema/src/next-schema/generated/nodeTypes';
|
4
|
-
import { getNodesAndMarksMap } from '../../../src/schema/create-schema';
|
5
|
-
import { printExpected, printReceived, matcherHint } from 'jest-matcher-utils';
|
6
|
-
import { filterAndSortMarks, formatContent } from '../helpers/_utils';
|
7
|
-
import {
|
8
|
-
blockCard,
|
9
|
-
blockquote,
|
10
|
-
blockquoteWithList,
|
11
|
-
bodiedExtension,
|
12
|
-
bulletList,
|
13
|
-
caption,
|
14
|
-
codeBlock,
|
15
|
-
confluenceJiraIssue,
|
16
|
-
confluenceUnsupportedBlock,
|
17
|
-
confluenceUnsupportedInline,
|
18
|
-
date,
|
19
|
-
decisionItem,
|
20
|
-
decisionList,
|
21
|
-
doc,
|
22
|
-
embedCard,
|
23
|
-
emoji,
|
24
|
-
expand,
|
25
|
-
extendedPanel,
|
26
|
-
extension,
|
27
|
-
extensionFrame,
|
28
|
-
hardBreak,
|
29
|
-
heading,
|
30
|
-
image,
|
31
|
-
inlineCard,
|
32
|
-
inlineExtension,
|
33
|
-
layoutColumn,
|
34
|
-
layoutSection,
|
35
|
-
listItem,
|
36
|
-
listItemWithTask,
|
37
|
-
media,
|
38
|
-
mediaGroup,
|
39
|
-
mediaInline,
|
40
|
-
mediaSingle,
|
41
|
-
mediaSingleFull,
|
42
|
-
mediaSingleWithCaption,
|
43
|
-
mediaSingleWithWidthType,
|
44
|
-
mention,
|
45
|
-
multiBodiedExtension,
|
46
|
-
nestedExpand,
|
47
|
-
orderedList,
|
48
|
-
orderedListWithOrder,
|
49
|
-
panel,
|
50
|
-
paragraph,
|
51
|
-
placeholder,
|
52
|
-
rule,
|
53
|
-
status,
|
54
|
-
taskItem,
|
55
|
-
taskList,
|
56
|
-
table,
|
57
|
-
tableCell,
|
58
|
-
tableHeader,
|
59
|
-
tableRow,
|
60
|
-
text,
|
61
|
-
unsupportedBlock,
|
62
|
-
unsupportedInline,
|
63
|
-
} from '../../../src/schema/nodes';
|
64
|
-
import {
|
65
|
-
MarkSpecFactory,
|
66
|
-
NodeSpecFactory,
|
67
|
-
} from '../../../src/schema/createPMSpecFactory';
|
68
|
-
|
69
|
-
const defaultSchema = getNodesAndMarksMap();
|
70
|
-
|
71
|
-
/**
|
72
|
-
* TODO: The SKIPPED consts are defined to pass the test
|
73
|
-
* Once following ticket is done, will need to remove exclude and unskip tests.
|
74
|
-
* https://product-fabric.atlassian.net/browse/ED-23488
|
75
|
-
*/
|
76
|
-
const SKIPPED_NODESPEC_TESTS = [];
|
77
|
-
|
78
|
-
const newSpecNameReference = {
|
79
|
-
blockquote: 'blockquoteLegacy',
|
80
|
-
blockquoteWithList: 'blockquote',
|
81
|
-
extendedPanel: 'panel',
|
82
|
-
inlineExtension: 'inlineExtensionWithMarks',
|
83
|
-
listItem: 'listItemLegacy',
|
84
|
-
listItemWithTask: 'listItem',
|
85
|
-
mediaSingleWithCaption: 'mediaSingleCaption',
|
86
|
-
mediaSingleWithWidthType: 'mediaSingleWidthType',
|
87
|
-
orderedListWithOrder: 'orderedList',
|
88
|
-
panel: 'panelLegacy',
|
89
|
-
multiBodiedExtension: 'multiBodiedExtensionStage0',
|
90
|
-
extensionFrame: 'extensionFrameStage0',
|
91
|
-
};
|
92
|
-
|
93
|
-
const getNewSpecName = (nodeName: string) => {
|
94
|
-
const customNodeSpecName = newSpecNameReference[nodeName];
|
95
|
-
return customNodeSpecName ? customNodeSpecName : nodeName;
|
96
|
-
};
|
97
|
-
|
98
|
-
const oldSpecReferences = {
|
99
|
-
blockCard,
|
100
|
-
blockquote,
|
101
|
-
blockquoteWithList,
|
102
|
-
bodiedExtension,
|
103
|
-
bulletList,
|
104
|
-
caption,
|
105
|
-
codeBlock,
|
106
|
-
confluenceJiraIssue,
|
107
|
-
confluenceUnsupportedBlock,
|
108
|
-
confluenceUnsupportedInline,
|
109
|
-
date,
|
110
|
-
decisionItem,
|
111
|
-
decisionList,
|
112
|
-
doc,
|
113
|
-
embedCard,
|
114
|
-
emoji,
|
115
|
-
expand,
|
116
|
-
extendedPanel: extendedPanel(true),
|
117
|
-
extension,
|
118
|
-
extensionFrame,
|
119
|
-
hardBreak,
|
120
|
-
heading,
|
121
|
-
image,
|
122
|
-
inlineCard,
|
123
|
-
inlineExtension,
|
124
|
-
layoutColumn,
|
125
|
-
layoutSection,
|
126
|
-
listItem,
|
127
|
-
listItemWithTask,
|
128
|
-
media,
|
129
|
-
mediaGroup,
|
130
|
-
mediaInline,
|
131
|
-
mediaSingle,
|
132
|
-
mediaSingleFull,
|
133
|
-
mediaSingleWithCaption,
|
134
|
-
mediaSingleWithWidthType,
|
135
|
-
mention,
|
136
|
-
multiBodiedExtension,
|
137
|
-
nestedExpand,
|
138
|
-
orderedList,
|
139
|
-
orderedListWithOrder,
|
140
|
-
panel: panel(true),
|
141
|
-
paragraph,
|
142
|
-
placeholder,
|
143
|
-
rule,
|
144
|
-
status,
|
145
|
-
taskItem,
|
146
|
-
taskList,
|
147
|
-
table,
|
148
|
-
tableCell,
|
149
|
-
tableHeader,
|
150
|
-
tableRow,
|
151
|
-
text,
|
152
|
-
unsupportedBlock,
|
153
|
-
unsupportedInline,
|
154
|
-
};
|
155
|
-
|
156
|
-
const failMessage = (actual, expected, not) => () =>
|
157
|
-
`${matcherHint(
|
158
|
-
`${not ? '.not' : ''}.toMatchNodeSpec`,
|
159
|
-
'received',
|
160
|
-
'expected',
|
161
|
-
)}
|
162
|
-
|
163
|
-
Expected nodeSpec${not ? ' not ' : ' '}to be equal:
|
164
|
-
|
165
|
-
Expected: ${printExpected(expected)}
|
166
|
-
Received: ${printReceived(actual)}`;
|
167
|
-
|
168
|
-
declare let expect: any;
|
169
|
-
expect.extend({
|
170
|
-
toMatchNodeSpec(actual: NodeSpec, expected: NodeSpec) {
|
171
|
-
const formattedActual = {
|
172
|
-
...actual,
|
173
|
-
...(actual.content && { content: formatContent(actual.content) }),
|
174
|
-
...(actual.marks && {
|
175
|
-
marks: filterAndSortMarks(actual.marks),
|
176
|
-
}),
|
177
|
-
};
|
178
|
-
|
179
|
-
const formattedExpected = {
|
180
|
-
...expected,
|
181
|
-
...(expected.content && {
|
182
|
-
content: formatContent(expected.content),
|
183
|
-
}),
|
184
|
-
...(expected.marks && {
|
185
|
-
marks: filterAndSortMarks(expected.marks),
|
186
|
-
}),
|
187
|
-
};
|
188
|
-
|
189
|
-
// status node used uuid for localId, which is incorrect, and not supported in DSL.
|
190
|
-
if (formattedExpected?.attrs?.localId?.default) {
|
191
|
-
formattedExpected.attrs.localId.default = '';
|
192
|
-
}
|
193
|
-
|
194
|
-
const pass = this.equals(
|
195
|
-
formattedActual,
|
196
|
-
formattedExpected,
|
197
|
-
undefined,
|
198
|
-
true, // enable strict equal
|
199
|
-
);
|
200
|
-
return {
|
201
|
-
pass,
|
202
|
-
message: failMessage(formattedActual, formattedExpected, pass),
|
203
|
-
};
|
204
|
-
},
|
205
|
-
});
|
206
|
-
|
207
|
-
function isNodeSpec(_value: MarkSpec | NodeSpec): _value is NodeSpec {
|
208
|
-
return true;
|
209
|
-
}
|
210
|
-
|
211
|
-
/**
|
212
|
-
* Custom omit function, mainly used to filter out parseDOM and toDOM from old spec
|
213
|
-
* and some special logic to filter out certain field when compare spec
|
214
|
-
* @param data
|
215
|
-
* @param keys
|
216
|
-
* @returns
|
217
|
-
*/
|
218
|
-
function omit<T extends object>(data: T, keys = []): T {
|
219
|
-
const result = { ...data };
|
220
|
-
for (const k of keys) {
|
221
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
222
|
-
delete result[k];
|
223
|
-
}
|
224
|
-
if (isNodeSpec(data)) {
|
225
|
-
// Treat inline: false same as no inline property
|
226
|
-
if (data.inline !== undefined && data.inline === false) {
|
227
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
228
|
-
delete result['inline'];
|
229
|
-
}
|
230
|
-
}
|
231
|
-
return result;
|
232
|
-
}
|
233
|
-
|
234
|
-
describe('validate PM schema', () => {
|
235
|
-
describe('marks', () => {
|
236
|
-
const { marks } = defaultSchema;
|
237
|
-
|
238
|
-
const testCases = Object.entries(marks).map(([key, value]) => {
|
239
|
-
return {
|
240
|
-
name: key,
|
241
|
-
legacyMarkSpec: value,
|
242
|
-
newMarkSpecFn: newMarkSpecs[key] as MarkSpecFactory,
|
243
|
-
skip: key.startsWith('__'),
|
244
|
-
};
|
245
|
-
});
|
246
|
-
|
247
|
-
const getTestingMethod = (skip: boolean) => {
|
248
|
-
return skip ? it.skip : it;
|
249
|
-
};
|
250
|
-
|
251
|
-
testCases.forEach(({ name, legacyMarkSpec, newMarkSpecFn, skip }) => {
|
252
|
-
const testMethod = getTestingMethod(skip);
|
253
|
-
|
254
|
-
testMethod(`validate markSpec for mark ${name}`, () => {
|
255
|
-
// check if there's any missing markSpec
|
256
|
-
expect(newMarkSpecFn).toBeDefined();
|
257
|
-
const newMarkSpec = newMarkSpecFn<any>({});
|
258
|
-
expect(
|
259
|
-
omit(newMarkSpec, ['parseDOM', 'toDOM', 'toDebugString']),
|
260
|
-
).toStrictEqual(
|
261
|
-
omit(legacyMarkSpec, ['parseDOM', 'toDOM', 'toDebugString']),
|
262
|
-
);
|
263
|
-
});
|
264
|
-
});
|
265
|
-
});
|
266
|
-
|
267
|
-
describe('nodes', () => {
|
268
|
-
const skipLists = SKIPPED_NODESPEC_TESTS;
|
269
|
-
const testCases = Object.entries(oldSpecReferences).map(([key, value]) => {
|
270
|
-
const newSpecName = getNewSpecName(key);
|
271
|
-
return {
|
272
|
-
name: key,
|
273
|
-
legacyNodeSpec: value,
|
274
|
-
newNodeSpecFn: newNodeSpecs[newSpecName] as NodeSpecFactory,
|
275
|
-
testingMethod: {
|
276
|
-
skip: skipLists.includes(key),
|
277
|
-
},
|
278
|
-
};
|
279
|
-
});
|
280
|
-
|
281
|
-
const getTestingMethod = ({ only = false, skip = false }) => {
|
282
|
-
if (skip) {
|
283
|
-
return it.skip;
|
284
|
-
}
|
285
|
-
if (only) {
|
286
|
-
return it.only;
|
287
|
-
}
|
288
|
-
return it;
|
289
|
-
};
|
290
|
-
|
291
|
-
testCases.forEach(
|
292
|
-
({ name, legacyNodeSpec, newNodeSpecFn, testingMethod }) => {
|
293
|
-
const testMethod = getTestingMethod(testingMethod);
|
294
|
-
testMethod(`validate nodeSpec for node ${name}`, () => {
|
295
|
-
// check if there's any missing nodeSpec
|
296
|
-
expect(newNodeSpecFn).toBeDefined();
|
297
|
-
const newNodeSpec = newNodeSpecFn<any>({});
|
298
|
-
expect(
|
299
|
-
omit(newNodeSpec, ['parseDOM', 'toDOM', 'toDebugString']),
|
300
|
-
).toMatchNodeSpec(
|
301
|
-
omit(legacyNodeSpec, ['parseDOM', 'toDOM', 'toDebugString']),
|
302
|
-
);
|
303
|
-
});
|
304
|
-
},
|
305
|
-
);
|
306
|
-
});
|
307
|
-
});
|