@atlaskit/adf-schema 47.7.1 → 49.0.0
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/index.js +0 -48
- package/dist/cjs/next-schema/generated/nodeTypes.js +1 -73
- package/dist/cjs/next-schema/groups/blockContentGroup.js +2 -2
- package/dist/cjs/next-schema/groups/blockGroup.js +2 -2
- package/dist/cjs/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/cjs/next-schema/nodes/blockquote.js +0 -8
- package/dist/cjs/next-schema/nodes/expand.js +1 -4
- package/dist/cjs/next-schema/nodes/list.js +2 -6
- package/dist/cjs/next-schema/nodes/nestedExpand.js +0 -6
- package/dist/cjs/next-schema/nodes/panel.js +0 -4
- package/dist/cjs/schema/create-schema.js +1 -1
- package/dist/cjs/schema/index.js +0 -48
- package/dist/cjs/schema/nodes/blockquote.js +2 -34
- package/dist/cjs/schema/nodes/expand.js +1 -2
- package/dist/cjs/schema/nodes/index.js +0 -48
- package/dist/cjs/schema/nodes/list-item.js +1 -19
- package/dist/cjs/schema/nodes/nested-expand.js +2 -32
- package/dist/cjs/schema/nodes/panel.js +1 -4
- package/dist/es2019/index.js +2 -2
- package/dist/es2019/next-schema/generated/nodeTypes.js +0 -72
- package/dist/es2019/next-schema/groups/blockContentGroup.js +2 -2
- package/dist/es2019/next-schema/groups/blockGroup.js +2 -2
- package/dist/es2019/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/es2019/next-schema/nodes/blockquote.js +0 -8
- package/dist/es2019/next-schema/nodes/expand.js +1 -4
- package/dist/es2019/next-schema/nodes/list.js +2 -6
- package/dist/es2019/next-schema/nodes/nestedExpand.js +0 -6
- package/dist/es2019/next-schema/nodes/panel.js +0 -4
- package/dist/es2019/schema/create-schema.js +2 -2
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/nodes/blockquote.js +2 -34
- package/dist/es2019/schema/nodes/expand.js +1 -2
- package/dist/es2019/schema/nodes/index.js +5 -5
- package/dist/es2019/schema/nodes/list-item.js +1 -19
- package/dist/es2019/schema/nodes/nested-expand.js +2 -32
- package/dist/es2019/schema/nodes/panel.js +2 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/next-schema/generated/nodeTypes.js +0 -72
- package/dist/esm/next-schema/groups/blockContentGroup.js +2 -2
- package/dist/esm/next-schema/groups/blockGroup.js +2 -2
- package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/esm/next-schema/nodes/blockquote.js +0 -8
- package/dist/esm/next-schema/nodes/expand.js +1 -4
- package/dist/esm/next-schema/nodes/list.js +2 -6
- package/dist/esm/next-schema/nodes/nestedExpand.js +0 -6
- package/dist/esm/next-schema/nodes/panel.js +0 -4
- package/dist/esm/schema/create-schema.js +2 -2
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/nodes/blockquote.js +2 -34
- package/dist/esm/schema/nodes/expand.js +1 -2
- package/dist/esm/schema/nodes/index.js +5 -5
- package/dist/esm/schema/nodes/list-item.js +1 -19
- package/dist/esm/schema/nodes/nested-expand.js +2 -32
- package/dist/esm/schema/nodes/panel.js +1 -4
- package/dist/types/index.d.ts +2 -2
- package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +2 -2
- package/dist/types/next-schema/generated/nodeTypes.d.ts +8 -63
- package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +1 -11
- package/dist/types/next-schema/groups/tableCellContentPseudoGroup.d.ts +1 -17
- package/dist/types/next-schema/nodes/blockquote.d.ts +1 -7
- package/dist/types/next-schema/nodes/expand.d.ts +1 -4
- package/dist/types/next-schema/nodes/nestedExpand.d.ts +1 -7
- package/dist/types/next-schema/nodes/panel.d.ts +1 -5
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/nodes/blockquote.d.ts +0 -15
- package/dist/types/schema/nodes/expand.d.ts +0 -1
- package/dist/types/schema/nodes/index.d.ts +5 -5
- package/dist/types/schema/nodes/list-item.d.ts +0 -10
- package/dist/types/schema/nodes/nested-expand.d.ts +0 -5
- package/dist/types/schema/nodes/panel.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/validator-schema/utils/sortNestedArrays.js +0 -33
- package/dist/es2019/validator-schema/utils/sortNestedArrays.js +0 -24
- package/dist/esm/validator-schema/utils/sortNestedArrays.js +0 -26
- package/dist/types/validator-schema/utils/sortNestedArrays.d.ts +0 -1
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.nestedExpand = void 0;
|
7
7
|
var _nodeTypes = require("../../next-schema/generated/nodeTypes");
|
8
8
|
/**
|
9
9
|
* @name nestedExpand_content
|
@@ -50,39 +50,9 @@ var nestedExpandFactoryOptions = {
|
|
50
50
|
return ['div', attrs, 0];
|
51
51
|
}
|
52
52
|
};
|
53
|
-
var nestedExpandWithoutNonBodiedMacrosFactoryOptions = {
|
54
|
-
parseDOM: [{
|
55
|
-
context: 'nestedExpand//',
|
56
|
-
tag: '[data-node-type="nestedExpand"]',
|
57
|
-
getAttrs: getExpandAttrs
|
58
|
-
}, {
|
59
|
-
tag: '[data-node-type="nestedExpand"] button',
|
60
|
-
ignore: true
|
61
|
-
}, {
|
62
|
-
tag: '[data-node-type="expand"] button',
|
63
|
-
ignore: true
|
64
|
-
}, {
|
65
|
-
tag: 'div[data-node-type="nestedExpand"]',
|
66
|
-
getAttrs: getExpandAttrs
|
67
|
-
}],
|
68
|
-
toDOM: function toDOM(node) {
|
69
|
-
var attrs = {
|
70
|
-
'data-node-type': 'nestedExpand',
|
71
|
-
'data-title': node.attrs.title,
|
72
|
-
'data-expanded': node.attrs.__expanded
|
73
|
-
};
|
74
|
-
return ['div', attrs, 0];
|
75
|
-
}
|
76
|
-
};
|
77
53
|
|
78
54
|
/**
|
79
55
|
* @name nestedExpand
|
80
56
|
* @description an expand that can be nested (eg. inside table, layout).
|
81
57
|
*/
|
82
|
-
var nestedExpand = exports.nestedExpand = (0, _nodeTypes.nestedExpand)(nestedExpandFactoryOptions);
|
83
|
-
|
84
|
-
/**
|
85
|
-
* @name nestedExpandWithNonBodiedMacros
|
86
|
-
* @description an expand that can be nested (eg. inside table, layout).
|
87
|
-
*/
|
88
|
-
var nestedExpandWithoutNonBodiedMacros = exports.nestedExpandWithoutNonBodiedMacros = (0, _nodeTypes.nestedExpandWithoutNonBodiedMacros)(nestedExpandWithoutNonBodiedMacrosFactoryOptions);
|
58
|
+
var nestedExpand = exports.nestedExpand = (0, _nodeTypes.nestedExpand)(nestedExpandFactoryOptions);
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
|
-
exports.
|
7
|
+
exports.extendedPanel = exports.PanelType = void 0;
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
9
|
var _nodeTypes = require("../../next-schema/generated/nodeTypes");
|
10
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
@@ -74,7 +74,4 @@ var createPanelNodeSpecOptions = function createPanelNodeSpecOptions(allowCustom
|
|
74
74
|
*/
|
75
75
|
var extendedPanel = exports.extendedPanel = function extendedPanel(allowCustomPanel) {
|
76
76
|
return (0, _nodeTypes.panel)(createPanelNodeSpecOptions(allowCustomPanel));
|
77
|
-
};
|
78
|
-
var panelWithoutNestedNonBodiedMacros = exports.panelWithoutNestedNonBodiedMacros = function panelWithoutNestedNonBodiedMacros(allowCustomPanel) {
|
79
|
-
return (0, _nodeTypes.panelWithoutNestedNonBodiedMacros)(createPanelNodeSpecOptions(allowCustomPanel));
|
80
77
|
};
|
package/dist/es2019/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote,
|
2
|
-
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji,
|
1
|
+
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, extendedBlockquote, 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, expandWithNestedExpand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable } from './schema';
|
3
3
|
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
4
|
|
5
5
|
// ADF createPMSpecFactory
|
@@ -41,20 +41,6 @@ export const blockquoteLegacy = createPMNodeSpecFactory({
|
|
41
41
|
selectable: true,
|
42
42
|
defining: true
|
43
43
|
});
|
44
|
-
export const blockquoteWithoutNestedCodeblockOrMedia = createPMNodeSpecFactory({
|
45
|
-
content: '(paragraph | orderedList | bulletList | unsupportedBlock)+',
|
46
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
47
|
-
group: 'block',
|
48
|
-
selectable: true,
|
49
|
-
defining: true
|
50
|
-
});
|
51
|
-
export const blockquoteWithoutNonBodiedMacros = createPMNodeSpecFactory({
|
52
|
-
content: '(paragraph | orderedList | bulletList | unsupportedBlock | codeBlock | mediaSingle | mediaGroup)+',
|
53
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
54
|
-
group: 'block',
|
55
|
-
selectable: true,
|
56
|
-
defining: true
|
57
|
-
});
|
58
44
|
export const bodiedExtension = createPMNodeSpecFactory({
|
59
45
|
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaGroup | mediaSingle | decisionList | taskList | table | blockCard | embedCard | extension | unsupportedBlock)+',
|
60
46
|
marks: 'dataConsumer fragment unsupportedMark unsupportedNodeAttribute',
|
@@ -322,21 +308,6 @@ export const expandRootOnly = createPMNodeSpecFactory({
|
|
322
308
|
selectable: true,
|
323
309
|
isolating: true
|
324
310
|
});
|
325
|
-
export const expandWithoutNestedExpand = createPMNodeSpecFactory({
|
326
|
-
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaGroup | mediaSingle | decisionList | taskList | table | blockCard | embedCard | extension | unsupportedBlock)+',
|
327
|
-
marks: 'unsupportedMark unsupportedNodeAttribute fragment dataConsumer',
|
328
|
-
group: 'block',
|
329
|
-
attrs: {
|
330
|
-
title: {
|
331
|
-
default: ''
|
332
|
-
},
|
333
|
-
__expanded: {
|
334
|
-
default: true
|
335
|
-
}
|
336
|
-
},
|
337
|
-
selectable: true,
|
338
|
-
isolating: true
|
339
|
-
});
|
340
311
|
export const extension = createPMNodeSpecFactory({
|
341
312
|
group: 'block',
|
342
313
|
atom: true,
|
@@ -592,12 +563,6 @@ export const listItemWithNestedDecisionStage0 = createPMNodeSpecFactory({
|
|
592
563
|
selectable: false,
|
593
564
|
defining: true
|
594
565
|
});
|
595
|
-
export const listItemWithoutNonBodiedMacros = createPMNodeSpecFactory({
|
596
|
-
content: '(paragraph | mediaSingle | codeBlock | unsupportedBlock) (paragraph | bulletList | orderedList | taskList | mediaSingle | codeBlock | unsupportedBlock)*',
|
597
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
598
|
-
selectable: false,
|
599
|
-
defining: true
|
600
|
-
});
|
601
566
|
export const media = createPMNodeSpecFactory({
|
602
567
|
attrs: {
|
603
568
|
type: {
|
@@ -870,20 +835,6 @@ export const nestedExpandWithNoMarks = createPMNodeSpecFactory({
|
|
870
835
|
selectable: true,
|
871
836
|
isolating: true
|
872
837
|
});
|
873
|
-
export const nestedExpandWithoutNonBodiedMacros = createPMNodeSpecFactory({
|
874
|
-
content: '(paragraph | heading | mediaSingle | mediaGroup | codeBlock | bulletList | orderedList | taskList | decisionList | rule | panel | blockquote | unsupportedBlock)+',
|
875
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
876
|
-
attrs: {
|
877
|
-
title: {
|
878
|
-
default: ''
|
879
|
-
},
|
880
|
-
__expanded: {
|
881
|
-
default: true
|
882
|
-
}
|
883
|
-
},
|
884
|
-
selectable: true,
|
885
|
-
isolating: true
|
886
|
-
});
|
887
838
|
export const orderedList = createPMNodeSpecFactory({
|
888
839
|
content: 'listItem+',
|
889
840
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
@@ -918,29 +869,6 @@ export const panel = createPMNodeSpecFactory({
|
|
918
869
|
},
|
919
870
|
selectable: true
|
920
871
|
});
|
921
|
-
export const panelWithoutNestedNonBodiedMacros = createPMNodeSpecFactory({
|
922
|
-
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock)+',
|
923
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
924
|
-
group: 'block',
|
925
|
-
attrs: {
|
926
|
-
panelType: {
|
927
|
-
default: 'info'
|
928
|
-
},
|
929
|
-
panelIcon: {
|
930
|
-
default: null
|
931
|
-
},
|
932
|
-
panelIconId: {
|
933
|
-
default: null
|
934
|
-
},
|
935
|
-
panelIconText: {
|
936
|
-
default: null
|
937
|
-
},
|
938
|
-
panelColor: {
|
939
|
-
default: null
|
940
|
-
}
|
941
|
-
},
|
942
|
-
selectable: true
|
943
|
-
});
|
944
872
|
export const paragraph = createPMNodeSpecFactory({
|
945
873
|
content: 'inline*',
|
946
874
|
marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
|
@@ -30,8 +30,8 @@ import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
|
30
30
|
* - no base mediaSingle
|
31
31
|
* - no base heading
|
32
32
|
*/
|
33
|
-
export const blockContentGroup = adfNodeGroup('block_content', [blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), paragraph.use('with_indentation'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel,
|
33
|
+
export const blockContentGroup = adfNodeGroup('block_content', [blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), paragraph.use('with_indentation'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, table,
|
34
34
|
// @ts-expect-error - types don't deal well with circular references for the variant
|
35
|
-
table.use('with_nested_table'), expand,
|
35
|
+
table.use('with_nested_table'), expand, bodiedExtension.use('with_marks'), confluenceUnsupportedBlock, unsupportedBlock], {
|
36
36
|
ignore: ['pm-spec']
|
37
37
|
});
|
@@ -18,9 +18,9 @@ import { rule } from '../nodes/rule';
|
|
18
18
|
import { table } from '../nodes/tableNodes';
|
19
19
|
import { taskList } from '../nodes/task';
|
20
20
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
21
|
-
export const blockGroup = adfNodeGroup('block', [blockCard, codeBlock, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), taskList, orderedList, bulletList, blockquote, blockquote.use('legacy'),
|
21
|
+
export const blockGroup = adfNodeGroup('block', [blockCard, codeBlock, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), taskList, orderedList, bulletList, blockquote, blockquote.use('legacy'), decisionList, embedCard, extension, extension.use('with_marks'), heading, heading.use('with_indentation'), heading.use('with_no_marks'), heading.use('with_alignment'), mediaGroup, rule, panel, table,
|
22
22
|
// @ts-expect-error - types don't deal well with circular references for the variant
|
23
|
-
table.use('with_nested_table'), bodiedExtension, bodiedExtension.use('with_marks'), expand,
|
23
|
+
table.use('with_nested_table'), bodiedExtension, bodiedExtension.use('with_marks'), expand, confluenceUnsupportedBlock, unsupportedBlock], {
|
24
24
|
// @DSLCompatibilityException
|
25
25
|
// Block group in PM doesn't match ADF
|
26
26
|
ignore: ['validator-spec', 'json-schema']
|
@@ -15,7 +15,7 @@ import { paragraph } from '../nodes/paragraph';
|
|
15
15
|
import { rule } from '../nodes/rule';
|
16
16
|
import { taskList } from '../nodes/task';
|
17
17
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
18
|
-
export const tableCellContentNodes = [paragraph.use('with_no_marks'), paragraph.use('with_alignment'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), codeBlock, mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, decisionList, taskList, blockCard, embedCard, extension.use('with_marks'), nestedExpand.use('content'), nestedExpand.use('with_no_marks')
|
18
|
+
export const tableCellContentNodes = [paragraph.use('with_no_marks'), paragraph.use('with_alignment'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), codeBlock, mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, decisionList, taskList, blockCard, embedCard, extension.use('with_marks'), nestedExpand.use('content'), nestedExpand.use('with_no_marks')];
|
19
19
|
|
20
20
|
// This is not an actual group, but a collection of nodes
|
21
21
|
// @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
|
@@ -17,12 +17,4 @@ export const blockquote = adfNode('blockquote').define({
|
|
17
17
|
}).variant('legacy', {
|
18
18
|
ignore: ['json-schema', 'validator-spec'],
|
19
19
|
content: [$onePlus($or(paragraph, unsupportedBlock))]
|
20
|
-
}).variant('without_non_bodied_macros', {
|
21
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), orderedList, bulletList, unsupportedBlock, codeBlock, mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup))],
|
22
|
-
ignore: ['json-schema', 'validator-spec']
|
23
|
-
})
|
24
|
-
// TODO: Clean up this variant
|
25
|
-
.variant('without_nested_codeblock_or_media', {
|
26
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), orderedList, bulletList, unsupportedBlock))],
|
27
|
-
ignore: ['json-schema', 'validator-spec']
|
28
20
|
});
|
@@ -20,10 +20,7 @@ export const expand = adfNode('expand').define({
|
|
20
20
|
optional: true
|
21
21
|
}
|
22
22
|
},
|
23
|
-
content: [$onePlus($or(nonNestableBlockContentGroup, nestedExpand.use('with_no_marks')
|
24
|
-
}).variant('without_nested_expand', {
|
25
|
-
content: [$onePlus($or(nonNestableBlockContentGroup))],
|
26
|
-
ignore: ['json-schema', 'validator-spec']
|
23
|
+
content: [$onePlus($or(nonNestableBlockContentGroup, nestedExpand.use('with_no_marks')))]
|
27
24
|
}).variant('root_only', {
|
28
25
|
marks: [breakout, unsupportedMark, unsupportedNodeAttribute],
|
29
26
|
noMarks: false,
|
@@ -20,10 +20,6 @@ const listItem = adfNode('listItem').define({
|
|
20
20
|
content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock, decisionList, extension.use('with_marks')), $zeroPlus($or(paragraph.use('with_no_marks'), bulletList, orderedList, taskList, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock, decisionList, extension.use('with_marks')))],
|
21
21
|
noExtend: true,
|
22
22
|
stage0: true
|
23
|
-
}).variant('without_non_bodied_macros', {
|
24
|
-
content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock), $zeroPlus($or(paragraph.use('with_no_marks'), bulletList, orderedList, taskList, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock))],
|
25
|
-
noExtend: true,
|
26
|
-
ignore: ['json-schema', 'validator-spec']
|
27
23
|
});
|
28
24
|
orderedList.define({
|
29
25
|
selectable: false,
|
@@ -36,10 +32,10 @@ orderedList.define({
|
|
36
32
|
optional: true
|
37
33
|
}
|
38
34
|
},
|
39
|
-
content: [$onePlus($or(listItem, listItem.use('with_nested_decision')
|
35
|
+
content: [$onePlus($or(listItem, listItem.use('with_nested_decision')))]
|
40
36
|
});
|
41
37
|
bulletList.define({
|
42
38
|
selectable: false,
|
43
39
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
44
|
-
content: [$onePlus($or(listItem, listItem.use('with_nested_decision')
|
40
|
+
content: [$onePlus($or(listItem, listItem.use('with_nested_decision')))]
|
45
41
|
});
|
@@ -54,10 +54,4 @@ export const nestedExpand = adfNode('nestedExpand').define({
|
|
54
54
|
marks: [],
|
55
55
|
content: [],
|
56
56
|
noMarks: true
|
57
|
-
}).variant('without_non_bodied_macros', {
|
58
|
-
marks: [],
|
59
|
-
content: [$onePlus($or(...nestedExpandContent))],
|
60
|
-
noMarks: true,
|
61
|
-
noExtend: true,
|
62
|
-
ignore: ['json-schema', 'validator-spec']
|
63
57
|
});
|
@@ -45,8 +45,4 @@ export const panel = adfNode('panel').define({
|
|
45
45
|
}
|
46
46
|
},
|
47
47
|
content: [$onePlus($or(...panelContent, extension.use('with_marks')))]
|
48
|
-
}).variant('without_nested_non_bodied_macros', {
|
49
|
-
content: [$onePlus($or(...panelContent))],
|
50
|
-
noExtend: true,
|
51
|
-
ignore: ['json-schema', 'validator-spec']
|
52
48
|
});
|
@@ -2,7 +2,7 @@ import { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
|
3
3
|
import { sanitizeNodes } from './sanitizeNodes';
|
4
4
|
import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border, backgroundColor } from './marks';
|
5
|
-
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder,
|
5
|
+
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, codeBlock, extendedPanel, rule, image, mention, media, mediaInline, mediaSingleFull, mediaGroup, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, multiBodiedExtension, extensionFrame, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expandWithNestedExpand, nestedExpand, embedCard, caption, extendedBlockquote } from './nodes';
|
6
6
|
function addItems(builtInItems, config, customSpecs = {}) {
|
7
7
|
if (!config) {
|
8
8
|
return {};
|
@@ -67,7 +67,7 @@ const nodesInOrder = [{
|
|
67
67
|
spec: orderedListWithOrder
|
68
68
|
}, {
|
69
69
|
name: 'listItem',
|
70
|
-
spec:
|
70
|
+
spec: listItem
|
71
71
|
}, {
|
72
72
|
name: 'heading',
|
73
73
|
spec: heading
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { PanelType, blockCard, blockquote,
|
1
|
+
export { PanelType, blockCard, blockquote, extendedBlockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expandWithNestedExpand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable } from './nodes';
|
2
2
|
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
3
|
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
4
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { blockquote as blockquoteFactory } from '../../next-schema/generated/nodeTypes';
|
2
|
-
import { blockquoteLegacy as blockquoteLegacyFactory
|
2
|
+
import { blockquoteLegacy as blockquoteLegacyFactory } from '../../next-schema/generated/nodeTypes';
|
3
3
|
|
4
4
|
/**
|
5
5
|
* @name blockquote_node
|
@@ -15,40 +15,8 @@ const nodeSpecOptions = {
|
|
15
15
|
};
|
16
16
|
export const blockquote = blockquoteLegacyFactory(nodeSpecOptions);
|
17
17
|
|
18
|
-
/**
|
19
|
-
* @name blockquoteWithNestedCodeblockOrMedia
|
20
|
-
* @deprecated use extentedBlockquote instead
|
21
|
-
*/
|
22
|
-
export const blockquoteWithNestedCodeblockOrMedia = blockquoteWithoutNonBodiedMacrosFactory(nodeSpecOptions);
|
23
|
-
|
24
18
|
/**
|
25
19
|
* @name extentedBlockquote
|
26
20
|
* @description the block quote node with nested code block, media, and extension
|
27
21
|
*/
|
28
|
-
export const extendedBlockquote = blockquoteFactory(nodeSpecOptions);
|
29
|
-
|
30
|
-
/**
|
31
|
-
* @name blockquote_with_list_node
|
32
|
-
* @deprecated use extentedBlockquote instead
|
33
|
-
* TODO: remove this node in the next major version
|
34
|
-
*/
|
35
|
-
export const blockquoteWithList = blockquoteWithoutNestedCodeblockOrMediaFactory({
|
36
|
-
parseDOM: [{
|
37
|
-
tag: 'blockquote'
|
38
|
-
}],
|
39
|
-
toDOM() {
|
40
|
-
return ['blockquote', 0];
|
41
|
-
}
|
42
|
-
});
|
43
|
-
|
44
|
-
/**
|
45
|
-
* @name blockquote_without_non_bodied_macros_node
|
46
|
-
*/
|
47
|
-
export const blockquoteWithoutNonBodiedMacros = blockquoteWithoutNonBodiedMacrosFactory({
|
48
|
-
parseDOM: [{
|
49
|
-
tag: 'blockquote'
|
50
|
-
}],
|
51
|
-
toDOM() {
|
52
|
-
return ['blockquote', 0];
|
53
|
-
}
|
54
|
-
});
|
22
|
+
export const extendedBlockquote = blockquoteFactory(nodeSpecOptions);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { expand as expandFactory } from '../../next-schema/generated/nodeTypes';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* @name expand_node
|
@@ -51,7 +51,6 @@ const nodeSpecOptions = {
|
|
51
51
|
return ['div', attrs, 0];
|
52
52
|
}
|
53
53
|
};
|
54
|
-
export const expand = expandWithoutNestedExpandFactory(nodeSpecOptions);
|
55
54
|
export const expandWithNestedExpand = expandFactory(nodeSpecOptions);
|
56
55
|
export const toJSON = node => ({
|
57
56
|
attrs: Object.keys(node.attrs).filter(key => !key.startsWith('__')).reduce((obj, key) => {
|
@@ -1,9 +1,9 @@
|
|
1
|
-
export {
|
1
|
+
export { expandWithNestedExpand, toJSON as expandToJSON } from './expand';
|
2
2
|
export { confluenceJiraIssue } from './confluence-jira-issue';
|
3
3
|
export { confluenceUnsupportedBlock } from './confluence-unsupported-block';
|
4
4
|
export { confluenceUnsupportedInline } from './confluence-unsupported-inline';
|
5
5
|
export { doc } from './doc';
|
6
|
-
export { blockquote,
|
6
|
+
export { blockquote, extendedBlockquote } from './blockquote';
|
7
7
|
export { bulletList, bulletListSelector } from './bullet-list';
|
8
8
|
export { codeBlock, toJSON as codeBlockToJSON } from './code-block';
|
9
9
|
export { hardBreak } from './hard-break';
|
@@ -14,8 +14,8 @@ export { paragraph } from './paragraph';
|
|
14
14
|
export { emoji } from './emoji';
|
15
15
|
export { image } from './image';
|
16
16
|
export { mention, toJSON as mentionToJSON } from './mention';
|
17
|
-
export { listItem,
|
18
|
-
export { extendedPanel,
|
17
|
+
export { listItem, listItemWithDecisionStage0 } from './list-item';
|
18
|
+
export { extendedPanel, PanelType } from './panel';
|
19
19
|
export { text } from './text';
|
20
20
|
export { default as unknownBlock } from './unknown-block';
|
21
21
|
export { caption } from './caption';
|
@@ -37,7 +37,7 @@ export { blockCard } from './block-card';
|
|
37
37
|
export { unsupportedBlock } from './unsupported-block';
|
38
38
|
export { unsupportedInline } from './unsupported-inline';
|
39
39
|
export { status } from './status';
|
40
|
-
export { nestedExpand
|
40
|
+
export { nestedExpand } from './nested-expand';
|
41
41
|
export { embedCard } from './embed-card';
|
42
42
|
// Extensions
|
43
43
|
export { extension } from './extension';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { listItem as listItemFactory, listItemWithNestedDecisionStage0 as listItemWithNestedDecisionStage0Factory
|
1
|
+
import { listItem as listItemFactory, listItemWithNestedDecisionStage0 as listItemWithNestedDecisionStage0Factory } from '../../next-schema/generated/nodeTypes';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* @name list_item
|
@@ -13,12 +13,6 @@ export const listItem = listItemFactory({
|
|
13
13
|
}
|
14
14
|
});
|
15
15
|
|
16
|
-
/**
|
17
|
-
* @name list_item_with_task
|
18
|
-
* @description this node allows task-list to be nested inside list-item
|
19
|
-
*/
|
20
|
-
export const listItemWithTask = listItem;
|
21
|
-
|
22
16
|
/**
|
23
17
|
* @name list_item_with_decision_stage0
|
24
18
|
* @description this node allows decisions to be nested inside list-item
|
@@ -30,16 +24,4 @@ export const listItemWithDecisionStage0 = listItemWithNestedDecisionStage0Factor
|
|
30
24
|
toDOM() {
|
31
25
|
return ['li', 0];
|
32
26
|
}
|
33
|
-
});
|
34
|
-
/**
|
35
|
-
* @name list_item_without_non_bodied_macros
|
36
|
-
* @description this node does not allow extension inside list-item
|
37
|
-
*/
|
38
|
-
export const listItemWithoutNonBodiedMacros = listItemWithoutNonBodiedMacrosFactory({
|
39
|
-
parseDOM: [{
|
40
|
-
tag: 'li'
|
41
|
-
}],
|
42
|
-
toDOM() {
|
43
|
-
return ['li', 0];
|
44
|
-
}
|
45
27
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { nestedExpand as nestedExpandFactory
|
1
|
+
import { nestedExpand as nestedExpandFactory } from '../../next-schema/generated/nodeTypes';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* @name nestedExpand_content
|
@@ -45,39 +45,9 @@ const nestedExpandFactoryOptions = {
|
|
45
45
|
return ['div', attrs, 0];
|
46
46
|
}
|
47
47
|
};
|
48
|
-
const nestedExpandWithoutNonBodiedMacrosFactoryOptions = {
|
49
|
-
parseDOM: [{
|
50
|
-
context: 'nestedExpand//',
|
51
|
-
tag: '[data-node-type="nestedExpand"]',
|
52
|
-
getAttrs: getExpandAttrs
|
53
|
-
}, {
|
54
|
-
tag: '[data-node-type="nestedExpand"] button',
|
55
|
-
ignore: true
|
56
|
-
}, {
|
57
|
-
tag: '[data-node-type="expand"] button',
|
58
|
-
ignore: true
|
59
|
-
}, {
|
60
|
-
tag: 'div[data-node-type="nestedExpand"]',
|
61
|
-
getAttrs: getExpandAttrs
|
62
|
-
}],
|
63
|
-
toDOM(node) {
|
64
|
-
const attrs = {
|
65
|
-
'data-node-type': 'nestedExpand',
|
66
|
-
'data-title': node.attrs.title,
|
67
|
-
'data-expanded': node.attrs.__expanded
|
68
|
-
};
|
69
|
-
return ['div', attrs, 0];
|
70
|
-
}
|
71
|
-
};
|
72
48
|
|
73
49
|
/**
|
74
50
|
* @name nestedExpand
|
75
51
|
* @description an expand that can be nested (eg. inside table, layout).
|
76
52
|
*/
|
77
|
-
export const nestedExpand = nestedExpandFactory(nestedExpandFactoryOptions);
|
78
|
-
|
79
|
-
/**
|
80
|
-
* @name nestedExpandWithNonBodiedMacros
|
81
|
-
* @description an expand that can be nested (eg. inside table, layout).
|
82
|
-
*/
|
83
|
-
export const nestedExpandWithoutNonBodiedMacros = nestedExpandWithoutNonBodiedMacrosFactory(nestedExpandWithoutNonBodiedMacrosFactoryOptions);
|
53
|
+
export const nestedExpand = nestedExpandFactory(nestedExpandFactoryOptions);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { panel as panelFactory
|
1
|
+
import { panel as panelFactory } from '../../next-schema/generated/nodeTypes';
|
2
2
|
export let PanelType = /*#__PURE__*/function (PanelType) {
|
3
3
|
PanelType["INFO"] = "info";
|
4
4
|
PanelType["NOTE"] = "note";
|
@@ -61,5 +61,4 @@ const createPanelNodeSpecOptions = allowCustomPanel => ({
|
|
61
61
|
* Specifically, it allows Media, action, code-block, rule and decision nodes in
|
62
62
|
* addition to content allowed inside panel
|
63
63
|
*/
|
64
|
-
export const extendedPanel = allowCustomPanel => panelFactory(createPanelNodeSpecOptions(allowCustomPanel));
|
65
|
-
export const panelWithoutNestedNonBodiedMacros = allowCustomPanel => panelWithoutNestedNonBodiedMacrosFactory(createPanelNodeSpecOptions(allowCustomPanel));
|
64
|
+
export const extendedPanel = allowCustomPanel => panelFactory(createPanelNodeSpecOptions(allowCustomPanel));
|
package/dist/esm/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote,
|
2
|
-
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji,
|
1
|
+
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, extendedBlockquote, 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, expandWithNestedExpand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable } from './schema';
|
3
3
|
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
4
|
|
5
5
|
// ADF createPMSpecFactory
|