@atlaskit/adf-schema 49.0.5 → 49.1.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 +114 -0
- package/dist/cjs/next-schema/generated/nodeTypes.js +118 -1
- package/dist/cjs/next-schema/nodes/blockCard.js +15 -0
- package/dist/cjs/next-schema/nodes/blockquote.js +16 -2
- package/dist/cjs/next-schema/nodes/caption.js +7 -0
- package/dist/cjs/next-schema/nodes/codeBlock.js +5 -0
- package/dist/cjs/next-schema/nodes/date.js +5 -0
- package/dist/cjs/next-schema/nodes/embedCard.js +5 -0
- package/dist/cjs/next-schema/nodes/emoji.js +5 -0
- package/dist/cjs/next-schema/nodes/expand.js +5 -0
- package/dist/cjs/next-schema/nodes/hardBreak.js +5 -0
- package/dist/cjs/next-schema/nodes/inlineCard.js +10 -0
- package/dist/cjs/next-schema/nodes/layoutColumn.js +5 -0
- package/dist/cjs/next-schema/nodes/layoutSection.js +12 -0
- package/dist/cjs/next-schema/nodes/list.js +20 -1
- package/dist/cjs/next-schema/nodes/media.js +10 -0
- package/dist/cjs/next-schema/nodes/mediaInline.js +5 -0
- package/dist/cjs/next-schema/nodes/mediaSingle.js +10 -0
- package/dist/cjs/next-schema/nodes/nestedExpand.js +5 -0
- package/dist/cjs/next-schema/nodes/panel.js +5 -0
- package/dist/cjs/next-schema/nodes/placeholder.js +5 -0
- package/dist/cjs/next-schema/nodes/rule.js +9 -1
- package/dist/cjs/schema/index.js +120 -0
- package/dist/cjs/schema/marks/background-color.js +9 -9
- package/dist/cjs/schema/nodes/block-card.js +48 -1
- package/dist/cjs/schema/nodes/blockquote.js +20 -2
- package/dist/cjs/schema/nodes/bullet-list.js +20 -1
- package/dist/cjs/schema/nodes/caption.js +20 -1
- package/dist/cjs/schema/nodes/code-block.js +72 -2
- package/dist/cjs/schema/nodes/date.js +22 -1
- package/dist/cjs/schema/nodes/embed-card.js +36 -1
- package/dist/cjs/schema/nodes/emoji.js +73 -1
- package/dist/cjs/schema/nodes/expand.js +56 -1
- package/dist/cjs/schema/nodes/hard-break.js +18 -1
- package/dist/cjs/schema/nodes/index.js +120 -0
- package/dist/cjs/schema/nodes/inline-card.js +46 -1
- package/dist/cjs/schema/nodes/layout-column.js +37 -1
- package/dist/cjs/schema/nodes/layout-section.js +31 -1
- package/dist/cjs/schema/nodes/list-item.js +34 -1
- package/dist/cjs/schema/nodes/media-inline.js +12 -2
- package/dist/cjs/schema/nodes/media-single.js +22 -2
- package/dist/cjs/schema/nodes/media.js +21 -4
- package/dist/cjs/schema/nodes/nested-expand.js +34 -7
- package/dist/cjs/schema/nodes/ordered-list.js +54 -3
- package/dist/cjs/schema/nodes/panel.js +13 -5
- package/dist/cjs/schema/nodes/placeholder.js +24 -1
- package/dist/cjs/schema/nodes/rule.js +18 -1
- package/dist/cjs/validator-schema/generated/validatorSpec.js +142 -0
- package/dist/es2019/index.js +2 -2
- package/dist/es2019/next-schema/generated/nodeTypes.js +118 -1
- package/dist/es2019/next-schema/nodes/blockCard.js +15 -0
- package/dist/es2019/next-schema/nodes/blockquote.js +16 -2
- package/dist/es2019/next-schema/nodes/caption.js +7 -0
- package/dist/es2019/next-schema/nodes/codeBlock.js +5 -0
- package/dist/es2019/next-schema/nodes/date.js +5 -0
- package/dist/es2019/next-schema/nodes/embedCard.js +5 -0
- package/dist/es2019/next-schema/nodes/emoji.js +5 -0
- package/dist/es2019/next-schema/nodes/expand.js +5 -0
- package/dist/es2019/next-schema/nodes/hardBreak.js +5 -0
- package/dist/es2019/next-schema/nodes/inlineCard.js +10 -0
- package/dist/es2019/next-schema/nodes/layoutColumn.js +5 -0
- package/dist/es2019/next-schema/nodes/layoutSection.js +12 -0
- package/dist/es2019/next-schema/nodes/list.js +20 -1
- package/dist/es2019/next-schema/nodes/media.js +10 -0
- package/dist/es2019/next-schema/nodes/mediaInline.js +5 -0
- package/dist/es2019/next-schema/nodes/mediaSingle.js +10 -0
- package/dist/es2019/next-schema/nodes/nestedExpand.js +5 -0
- package/dist/es2019/next-schema/nodes/panel.js +5 -0
- package/dist/es2019/next-schema/nodes/placeholder.js +5 -0
- package/dist/es2019/next-schema/nodes/rule.js +9 -1
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/marks/background-color.js +9 -9
- package/dist/es2019/schema/nodes/block-card.js +50 -0
- package/dist/es2019/schema/nodes/blockquote.js +19 -1
- package/dist/es2019/schema/nodes/bullet-list.js +19 -0
- package/dist/es2019/schema/nodes/caption.js +19 -0
- package/dist/es2019/schema/nodes/code-block.js +68 -0
- package/dist/es2019/schema/nodes/date.js +19 -0
- package/dist/es2019/schema/nodes/embed-card.js +34 -0
- package/dist/es2019/schema/nodes/emoji.js +71 -0
- package/dist/es2019/schema/nodes/expand.js +59 -0
- package/dist/es2019/schema/nodes/hard-break.js +15 -0
- package/dist/es2019/schema/nodes/index.js +19 -19
- package/dist/es2019/schema/nodes/inline-card.js +45 -0
- package/dist/es2019/schema/nodes/layout-column.js +38 -0
- package/dist/es2019/schema/nodes/layout-section.js +32 -0
- package/dist/es2019/schema/nodes/list-item.js +29 -0
- package/dist/es2019/schema/nodes/media-inline.js +8 -1
- package/dist/es2019/schema/nodes/media-single.js +20 -1
- package/dist/es2019/schema/nodes/media.js +17 -4
- package/dist/es2019/schema/nodes/nested-expand.js +21 -6
- package/dist/es2019/schema/nodes/ordered-list.js +51 -2
- package/dist/es2019/schema/nodes/panel.js +11 -5
- package/dist/es2019/schema/nodes/placeholder.js +23 -0
- package/dist/es2019/schema/nodes/rule.js +15 -0
- package/dist/es2019/validator-schema/generated/validatorSpec.js +142 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/next-schema/generated/nodeTypes.js +118 -1
- package/dist/esm/next-schema/nodes/blockCard.js +15 -0
- package/dist/esm/next-schema/nodes/blockquote.js +16 -2
- package/dist/esm/next-schema/nodes/caption.js +7 -0
- package/dist/esm/next-schema/nodes/codeBlock.js +5 -0
- package/dist/esm/next-schema/nodes/date.js +5 -0
- package/dist/esm/next-schema/nodes/embedCard.js +5 -0
- package/dist/esm/next-schema/nodes/emoji.js +5 -0
- package/dist/esm/next-schema/nodes/expand.js +5 -0
- package/dist/esm/next-schema/nodes/hardBreak.js +5 -0
- package/dist/esm/next-schema/nodes/inlineCard.js +10 -0
- package/dist/esm/next-schema/nodes/layoutColumn.js +5 -0
- package/dist/esm/next-schema/nodes/layoutSection.js +12 -0
- package/dist/esm/next-schema/nodes/list.js +20 -1
- package/dist/esm/next-schema/nodes/media.js +10 -0
- package/dist/esm/next-schema/nodes/mediaInline.js +5 -0
- package/dist/esm/next-schema/nodes/mediaSingle.js +10 -0
- package/dist/esm/next-schema/nodes/nestedExpand.js +5 -0
- package/dist/esm/next-schema/nodes/panel.js +5 -0
- package/dist/esm/next-schema/nodes/placeholder.js +5 -0
- package/dist/esm/next-schema/nodes/rule.js +9 -1
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/marks/background-color.js +9 -9
- package/dist/esm/schema/nodes/block-card.js +47 -0
- package/dist/esm/schema/nodes/blockquote.js +19 -1
- package/dist/esm/schema/nodes/bullet-list.js +19 -0
- package/dist/esm/schema/nodes/caption.js +19 -0
- package/dist/esm/schema/nodes/code-block.js +71 -1
- package/dist/esm/schema/nodes/date.js +21 -0
- package/dist/esm/schema/nodes/embed-card.js +35 -0
- package/dist/esm/schema/nodes/emoji.js +71 -0
- package/dist/esm/schema/nodes/expand.js +55 -0
- package/dist/esm/schema/nodes/hard-break.js +17 -0
- package/dist/esm/schema/nodes/index.js +19 -19
- package/dist/esm/schema/nodes/inline-card.js +45 -0
- package/dist/esm/schema/nodes/layout-column.js +36 -0
- package/dist/esm/schema/nodes/layout-section.js +30 -0
- package/dist/esm/schema/nodes/list-item.js +33 -0
- package/dist/esm/schema/nodes/media-inline.js +10 -1
- package/dist/esm/schema/nodes/media-single.js +21 -1
- package/dist/esm/schema/nodes/media.js +19 -3
- package/dist/esm/schema/nodes/nested-expand.js +32 -6
- package/dist/esm/schema/nodes/ordered-list.js +53 -2
- package/dist/esm/schema/nodes/panel.js +12 -4
- package/dist/esm/schema/nodes/placeholder.js +23 -0
- package/dist/esm/schema/nodes/rule.js +17 -0
- package/dist/esm/validator-schema/generated/validatorSpec.js +142 -0
- package/dist/json-schema/v1/full.json +125 -2
- package/dist/json-schema/v1/stage-0.json +137 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/next-schema/generated/nodeTypes.d.ts +62 -0
- package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +7 -0
- package/dist/types/next-schema/groups/tableCellContentPseudoGroup.d.ts +7 -0
- package/dist/types/next-schema/nodes/blockquote.d.ts +7 -0
- package/dist/types/next-schema/nodes/layoutSection.d.ts +5 -0
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/nodes/block-card.d.ts +4 -0
- package/dist/types/schema/nodes/blockquote.d.ts +4 -0
- package/dist/types/schema/nodes/bullet-list.d.ts +1 -0
- package/dist/types/schema/nodes/caption.d.ts +4 -0
- package/dist/types/schema/nodes/code-block.d.ts +2 -0
- package/dist/types/schema/nodes/date.d.ts +2 -0
- package/dist/types/schema/nodes/embed-card.d.ts +2 -0
- package/dist/types/schema/nodes/emoji.d.ts +2 -0
- package/dist/types/schema/nodes/expand.d.ts +2 -0
- package/dist/types/schema/nodes/hard-break.d.ts +2 -0
- package/dist/types/schema/nodes/index.d.ts +19 -19
- package/dist/types/schema/nodes/inline-card.d.ts +1 -0
- package/dist/types/schema/nodes/layout-column.d.ts +2 -0
- package/dist/types/schema/nodes/layout-section.d.ts +4 -0
- package/dist/types/schema/nodes/list-item.d.ts +2 -0
- package/dist/types/schema/nodes/media-inline.d.ts +1 -0
- package/dist/types/schema/nodes/media-single.d.ts +3 -1
- package/dist/types/schema/nodes/media.d.ts +3 -1
- package/dist/types/schema/nodes/nested-expand.d.ts +2 -0
- package/dist/types/schema/nodes/ordered-list.d.ts +2 -0
- package/dist/types/schema/nodes/panel.d.ts +2 -0
- package/dist/types/schema/nodes/placeholder.d.ts +2 -0
- package/dist/types/schema/nodes/rule.d.ts +4 -0
- package/dist/types/schema/nodes/types/list.d.ts +7 -0
- package/dist/types/schema/nodes/types/rich-media-common.d.ts +1 -0
- package/dist/types/validator-schema/generated/validatorSpec.d.ts +142 -0
- package/json-schema/v1/full.json +125 -2
- package/json-schema/v1/stage-0.json +137 -2
- package/package.json +2 -2
- package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +1 -0
@@ -13,8 +13,22 @@ export const blockquote = adfNode('blockquote').define({
|
|
13
13
|
defining: true,
|
14
14
|
selectable: true,
|
15
15
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
16
|
-
content: [$onePlus($or(...blockQuoteContent))]
|
16
|
+
content: [$onePlus($or(...blockQuoteContent))],
|
17
|
+
attrs: {
|
18
|
+
localId: {
|
19
|
+
type: 'string',
|
20
|
+
default: null,
|
21
|
+
optional: true
|
22
|
+
}
|
23
|
+
}
|
17
24
|
}).variant('legacy', {
|
18
25
|
ignore: ['json-schema', 'validator-spec'],
|
19
|
-
content: [$onePlus($or(paragraph, unsupportedBlock))]
|
26
|
+
content: [$onePlus($or(paragraph, unsupportedBlock))],
|
27
|
+
attrs: {
|
28
|
+
localId: {
|
29
|
+
type: 'string',
|
30
|
+
default: null,
|
31
|
+
optional: true
|
32
|
+
}
|
33
|
+
}
|
20
34
|
});
|
@@ -15,5 +15,12 @@ export const caption = adfNode('caption').define({
|
|
15
15
|
selectable: false,
|
16
16
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
17
17
|
allowAnyChildMark: true,
|
18
|
+
attrs: {
|
19
|
+
localId: {
|
20
|
+
type: 'string',
|
21
|
+
default: null,
|
22
|
+
optional: true
|
23
|
+
}
|
24
|
+
},
|
18
25
|
content: [$zeroPlus($or(hardBreak, mention, emoji, date, placeholder, inlineCard, status, text.use('formatted'), text.use('code_inline'), unsupportedInline))]
|
19
26
|
});
|
@@ -18,6 +18,11 @@ export const expand = adfNode('expand').define({
|
|
18
18
|
type: 'boolean',
|
19
19
|
default: true,
|
20
20
|
optional: true
|
21
|
+
},
|
22
|
+
localId: {
|
23
|
+
type: 'string',
|
24
|
+
default: null,
|
25
|
+
optional: true
|
21
26
|
}
|
22
27
|
},
|
23
28
|
content: [$onePlus($or(nonNestableBlockContentGroup, nestedExpand.use('with_no_marks')))]
|
@@ -13,11 +13,21 @@ export const inlineCard = adfNode('inlineCard').define({
|
|
13
13
|
type: 'string',
|
14
14
|
default: null,
|
15
15
|
validatorFn: 'safeUrl'
|
16
|
+
},
|
17
|
+
localId: {
|
18
|
+
type: 'string',
|
19
|
+
default: null,
|
20
|
+
optional: true
|
16
21
|
}
|
17
22
|
}, {
|
18
23
|
data: {
|
19
24
|
type: 'object',
|
20
25
|
default: null
|
26
|
+
},
|
27
|
+
localId: {
|
28
|
+
type: 'string',
|
29
|
+
default: null,
|
30
|
+
optional: true
|
21
31
|
}
|
22
32
|
}]
|
23
33
|
},
|
@@ -14,6 +14,11 @@ export const layoutColumn = adfNode('layoutColumn').define({
|
|
14
14
|
minimum: 0,
|
15
15
|
maximum: 100,
|
16
16
|
default: undefined
|
17
|
+
},
|
18
|
+
localId: {
|
19
|
+
type: 'string',
|
20
|
+
default: null,
|
21
|
+
optional: true
|
17
22
|
}
|
18
23
|
},
|
19
24
|
content: [$onePlus($or(blockGroup, blockContentGroup, unsupportedBlock))]
|
@@ -6,6 +6,13 @@ import { layoutColumn } from './layoutColumn';
|
|
6
6
|
import { unsupportedBlock } from './unsupportedBlock';
|
7
7
|
export const layoutSection = adfNode('layoutSection').define({
|
8
8
|
isolating: true,
|
9
|
+
attrs: {
|
10
|
+
localId: {
|
11
|
+
type: 'string',
|
12
|
+
default: null,
|
13
|
+
optional: true
|
14
|
+
}
|
15
|
+
},
|
9
16
|
marks: [breakout, unsupportedMark, unsupportedNodeAttribute],
|
10
17
|
content: [$range(1, 3, $or(layoutColumn, unsupportedBlock)), $zeroPlus($or(unsupportedBlock))]
|
11
18
|
}).variant('with_single_column', {
|
@@ -18,6 +25,11 @@ export const layoutSection = adfNode('layoutSection').define({
|
|
18
25
|
values: ['solid'],
|
19
26
|
default: null,
|
20
27
|
optional: true
|
28
|
+
},
|
29
|
+
localId: {
|
30
|
+
type: 'string',
|
31
|
+
default: null,
|
32
|
+
optional: true
|
21
33
|
}
|
22
34
|
}
|
23
35
|
}).variant('full', {
|
@@ -13,6 +13,13 @@ export const bulletList = adfNode('bulletList');
|
|
13
13
|
const listItem = adfNode('listItem').define({
|
14
14
|
defining: true,
|
15
15
|
selectable: false,
|
16
|
+
attrs: {
|
17
|
+
localId: {
|
18
|
+
type: 'string',
|
19
|
+
default: null,
|
20
|
+
optional: true
|
21
|
+
}
|
22
|
+
},
|
16
23
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
17
24
|
contentMinItems: 1,
|
18
25
|
content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock, extension.use('with_marks')), $zeroPlus($or(paragraph.use('with_no_marks'), bulletList, orderedList, taskList, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock, extension.use('with_marks')))]
|
@@ -30,6 +37,11 @@ orderedList.define({
|
|
30
37
|
minimum: 0,
|
31
38
|
default: 1,
|
32
39
|
optional: true
|
40
|
+
},
|
41
|
+
localId: {
|
42
|
+
type: 'string',
|
43
|
+
default: null,
|
44
|
+
optional: true
|
33
45
|
}
|
34
46
|
},
|
35
47
|
content: [$onePlus($or(listItem, listItem.use('with_nested_decision')))]
|
@@ -37,5 +49,12 @@ orderedList.define({
|
|
37
49
|
bulletList.define({
|
38
50
|
selectable: false,
|
39
51
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
40
|
-
content: [$onePlus($or(listItem, listItem.use('with_nested_decision')))]
|
52
|
+
content: [$onePlus($or(listItem, listItem.use('with_nested_decision')))],
|
53
|
+
attrs: {
|
54
|
+
localId: {
|
55
|
+
type: 'string',
|
56
|
+
default: null,
|
57
|
+
optional: true
|
58
|
+
}
|
59
|
+
}
|
41
60
|
});
|
@@ -14,6 +14,11 @@ export const media = adfNode('media').define({
|
|
14
14
|
values: ['link', 'file'],
|
15
15
|
default: 'file'
|
16
16
|
},
|
17
|
+
localId: {
|
18
|
+
type: 'string',
|
19
|
+
default: null,
|
20
|
+
optional: true
|
21
|
+
},
|
17
22
|
id: {
|
18
23
|
minLength: 1,
|
19
24
|
type: 'string',
|
@@ -86,6 +91,11 @@ export const media = adfNode('media').define({
|
|
86
91
|
values: ['external'],
|
87
92
|
default: 'file'
|
88
93
|
},
|
94
|
+
localId: {
|
95
|
+
type: 'string',
|
96
|
+
default: null,
|
97
|
+
optional: true
|
98
|
+
},
|
89
99
|
alt: {
|
90
100
|
type: 'string',
|
91
101
|
default: '',
|
@@ -11,6 +11,11 @@ export const mediaSingle = adfNode('mediaSingle').define({
|
|
11
11
|
marks: [link, unsupportedMark, unsupportedNodeAttribute],
|
12
12
|
attrs: {
|
13
13
|
anyOf: [{
|
14
|
+
localId: {
|
15
|
+
type: 'string',
|
16
|
+
default: null,
|
17
|
+
optional: true
|
18
|
+
},
|
14
19
|
width: {
|
15
20
|
type: 'number',
|
16
21
|
minimum: 0,
|
@@ -30,6 +35,11 @@ export const mediaSingle = adfNode('mediaSingle').define({
|
|
30
35
|
optional: true
|
31
36
|
}
|
32
37
|
}, {
|
38
|
+
localId: {
|
39
|
+
type: 'string',
|
40
|
+
default: null,
|
41
|
+
optional: true
|
42
|
+
},
|
33
43
|
width: {
|
34
44
|
type: 'number',
|
35
45
|
minimum: 0,
|
@@ -29,6 +29,11 @@ export const nestedExpand = adfNode('nestedExpand').define({
|
|
29
29
|
type: 'boolean',
|
30
30
|
default: true,
|
31
31
|
optional: true
|
32
|
+
},
|
33
|
+
localId: {
|
34
|
+
type: 'string',
|
35
|
+
default: null,
|
36
|
+
optional: true
|
32
37
|
}
|
33
38
|
},
|
34
39
|
content: [$onePlus($or(...nestedExpandContent, extension.use('with_marks')))],
|
@@ -42,6 +42,11 @@ export const panel = adfNode('panel').define({
|
|
42
42
|
type: 'string',
|
43
43
|
default: null,
|
44
44
|
optional: true
|
45
|
+
},
|
46
|
+
localId: {
|
47
|
+
type: 'string',
|
48
|
+
default: null,
|
49
|
+
optional: true
|
45
50
|
}
|
46
51
|
},
|
47
52
|
content: [$onePlus($or(...panelContent, extension.use('with_marks')))]
|
@@ -1,4 +1,4 @@
|
|
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';
|
1
|
+
export { PanelType, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, codeBlock, codeBlockWithLocalId, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, hardBreak, hardBreakWithLocalId, heading, image, inlineCard, inlineCardWithLocalId, inlineExtension, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, listItem, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, 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, backgroundColorPaletteNext } from './marks';
|
4
4
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
@@ -24,17 +24,17 @@ const colorArrayPalette = [[Neutral300, 'Gray'],
|
|
24
24
|
];
|
25
25
|
const colorArrayPaletteNext = [[Neutral300, 'Gray'],
|
26
26
|
// token: color.background.accent.gray.subtler
|
27
|
-
[
|
28
|
-
// token: color.background.accent.
|
29
|
-
[L200, 'Lime'],
|
30
|
-
// token: color.background.accent.lime.subtler
|
31
|
-
[Yellow200, 'Yellow'],
|
32
|
-
// token: color.background.accent.yellow.subtler
|
33
|
-
[O200, 'Orange'],
|
34
|
-
// token: color.background.accent.orange.subtler
|
27
|
+
[P200, 'Purple'],
|
28
|
+
// token: color.background.accent.purple.subtler
|
35
29
|
[M200, 'Magenta'],
|
36
30
|
// token: color.background.accent.magenta.subtler
|
37
|
-
[
|
31
|
+
[O200, 'Orange'],
|
32
|
+
// token: color.background.accent.orange.subtler
|
33
|
+
[Yellow200, 'Yellow'],
|
34
|
+
// token: color.background.accent.yellow.subtler
|
35
|
+
[L200, 'Lime'],
|
36
|
+
// token: color.background.accent.lime.subtler
|
37
|
+
[T200, 'Teal'] // token: color.background.accent.teal.subtler
|
38
38
|
];
|
39
39
|
|
40
40
|
// @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { blockCard as blockCardFactory } from '../../next-schema/generated/nodeTypes';
|
2
|
+
import { uuid } from '../../utils';
|
2
3
|
|
3
4
|
/**
|
4
5
|
* @name blockCard_node
|
@@ -60,4 +61,53 @@ export const blockCard = blockCardFactory({
|
|
60
61
|
};
|
61
62
|
return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.url) || ' '];
|
62
63
|
}
|
64
|
+
});
|
65
|
+
export const blockCardWithLocalId = blockCardFactory({
|
66
|
+
parseDOM: [{
|
67
|
+
tag: 'a[data-block-card]',
|
68
|
+
// bump priority higher than hyperlink
|
69
|
+
priority: 100,
|
70
|
+
getAttrs: dom => {
|
71
|
+
const anchor = dom;
|
72
|
+
return {
|
73
|
+
url: anchor.getAttribute('href') || undefined,
|
74
|
+
...getCommonAttributesFromDom(dom),
|
75
|
+
localId: uuid.generate()
|
76
|
+
};
|
77
|
+
}
|
78
|
+
}, {
|
79
|
+
tag: 'div[data-block-card]',
|
80
|
+
getAttrs: dom => {
|
81
|
+
const anchor = dom;
|
82
|
+
return {
|
83
|
+
url: anchor.getAttribute('data-card-url') || undefined,
|
84
|
+
...getCommonAttributesFromDom(dom),
|
85
|
+
localId: uuid.generate()
|
86
|
+
};
|
87
|
+
}
|
88
|
+
}],
|
89
|
+
toDOM(node) {
|
90
|
+
var _node$attrs2, _node$attrs3;
|
91
|
+
const {
|
92
|
+
url
|
93
|
+
} = node.attrs;
|
94
|
+
const {
|
95
|
+
data
|
96
|
+
} = node.attrs;
|
97
|
+
const {
|
98
|
+
layout,
|
99
|
+
width,
|
100
|
+
datasource
|
101
|
+
} = node.attrs;
|
102
|
+
const attrs = {
|
103
|
+
'data-block-card': '',
|
104
|
+
href: url || '',
|
105
|
+
'data-card-data': data ? JSON.stringify(data) : '',
|
106
|
+
'data-datasource': datasource ? JSON.stringify(datasource) : '',
|
107
|
+
'data-layout': layout,
|
108
|
+
'data-width': `${width}`,
|
109
|
+
'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId) || undefined
|
110
|
+
};
|
111
|
+
return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.url) || ' '];
|
112
|
+
}
|
63
113
|
});
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { blockquote as blockquoteFactory } from '../../next-schema/generated/nodeTypes';
|
2
2
|
import { blockquoteLegacy as blockquoteLegacyFactory } from '../../next-schema/generated/nodeTypes';
|
3
|
+
import { uuid } from '../../utils';
|
3
4
|
|
4
5
|
/**
|
5
6
|
* @name blockquote_node
|
@@ -19,4 +20,21 @@ export const blockquote = blockquoteLegacyFactory(nodeSpecOptions);
|
|
19
20
|
* @name extentedBlockquote
|
20
21
|
* @description the block quote node with nested code block, media, and extension
|
21
22
|
*/
|
22
|
-
export const extendedBlockquote = blockquoteFactory(nodeSpecOptions);
|
23
|
+
export const extendedBlockquote = blockquoteFactory(nodeSpecOptions);
|
24
|
+
const nodeSpecOptionsWithLocalId = {
|
25
|
+
parseDOM: [{
|
26
|
+
tag: 'blockquote',
|
27
|
+
getAttrs: () => {
|
28
|
+
return {
|
29
|
+
localId: uuid.generate()
|
30
|
+
};
|
31
|
+
}
|
32
|
+
}],
|
33
|
+
toDOM(node) {
|
34
|
+
var _node$attrs;
|
35
|
+
return ['blockquote', {
|
36
|
+
'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
|
37
|
+
}, 0];
|
38
|
+
}
|
39
|
+
};
|
40
|
+
export const extendedBlockquoteWithLocalId = blockquoteFactory(nodeSpecOptionsWithLocalId);
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { uuid } from '../../utils';
|
1
2
|
import { bulletList as bulletListFactory } from '../../next-schema/generated/nodeTypes';
|
2
3
|
export const bulletListSelector = '.ak-ul';
|
3
4
|
export const bulletList = bulletListFactory({
|
@@ -10,4 +11,22 @@ export const bulletList = bulletListFactory({
|
|
10
11
|
};
|
11
12
|
return ['ul', attrs, 0];
|
12
13
|
}
|
14
|
+
});
|
15
|
+
export const bulletListWithLocalId = bulletListFactory({
|
16
|
+
parseDOM: [{
|
17
|
+
tag: 'ul',
|
18
|
+
getAttrs: () => {
|
19
|
+
return {
|
20
|
+
localId: uuid.generate()
|
21
|
+
};
|
22
|
+
}
|
23
|
+
}],
|
24
|
+
toDOM(node) {
|
25
|
+
var _node$attrs;
|
26
|
+
const attrs = {
|
27
|
+
class: bulletListSelector.substr(1),
|
28
|
+
'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
|
29
|
+
};
|
30
|
+
return ['ul', attrs, 0];
|
31
|
+
}
|
13
32
|
});
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { caption as captionFactory } from '../../next-schema/generated/nodeTypes';
|
2
|
+
import { uuid } from '../../utils';
|
2
3
|
|
3
4
|
/**
|
4
5
|
* @name caption_node
|
@@ -14,4 +15,22 @@ export const caption = captionFactory({
|
|
14
15
|
};
|
15
16
|
return ['figcaption', attrs, 0];
|
16
17
|
}
|
18
|
+
});
|
19
|
+
export const captionWithLocalId = captionFactory({
|
20
|
+
parseDOM: [{
|
21
|
+
tag: 'figcaption[data-caption]',
|
22
|
+
getAttrs: () => {
|
23
|
+
return {
|
24
|
+
localId: uuid.generate()
|
25
|
+
};
|
26
|
+
}
|
27
|
+
}],
|
28
|
+
toDOM(node) {
|
29
|
+
var _node$attrs;
|
30
|
+
const attrs = {
|
31
|
+
'data-caption': 'true',
|
32
|
+
'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
|
33
|
+
};
|
34
|
+
return ['figcaption', attrs, 0];
|
35
|
+
}
|
17
36
|
});
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
2
2
|
import { codeBlock as codeBlockFactory } from '../../next-schema/generated/nodeTypes';
|
3
|
+
import { uuid } from '../../utils';
|
3
4
|
|
4
5
|
/**
|
5
6
|
* @name codeBlock_with_no_marks_node
|
@@ -141,4 +142,71 @@ export const toJSON = node => ({
|
|
141
142
|
memo[key] = node.attrs[key];
|
142
143
|
return memo;
|
143
144
|
}, {})
|
145
|
+
});
|
146
|
+
export const codeBlockWithLocalId = codeBlockFactory({
|
147
|
+
parseDOM: [{
|
148
|
+
tag: 'pre',
|
149
|
+
preserveWhitespace: 'full',
|
150
|
+
getAttrs: domNode => {
|
151
|
+
let dom = domNode;
|
152
|
+
const language = getLanguageFromBitbucketStyle(dom.parentElement) || getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) || dom.getAttribute('data-language');
|
153
|
+
dom = removeLastNewLine(dom);
|
154
|
+
return {
|
155
|
+
language,
|
156
|
+
localId: uuid.generate()
|
157
|
+
};
|
158
|
+
}
|
159
|
+
},
|
160
|
+
// Handle VSCode, Android Studio paste
|
161
|
+
// Checking `white-space: pre-wrap` is too aggressive @see ED-2627
|
162
|
+
{
|
163
|
+
tag: 'div[style]',
|
164
|
+
preserveWhitespace: 'full',
|
165
|
+
getAttrs: domNode => {
|
166
|
+
const dom = domNode;
|
167
|
+
if (dom.style.whiteSpace === 'pre' || dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') > -1) {
|
168
|
+
return {};
|
169
|
+
}
|
170
|
+
return false;
|
171
|
+
},
|
172
|
+
getContent: (domNode, schema) => {
|
173
|
+
const code = parseCodeFromHtml(domNode);
|
174
|
+
return code ? Fragment.from(schema.text(code)) : Fragment.empty;
|
175
|
+
}
|
176
|
+
},
|
177
|
+
// Handle GitHub/Gist paste
|
178
|
+
{
|
179
|
+
tag: 'table[style]',
|
180
|
+
preserveWhitespace: 'full',
|
181
|
+
getAttrs: dom => {
|
182
|
+
if (dom.querySelector('td[class*="blob-code"]')) {
|
183
|
+
return {};
|
184
|
+
}
|
185
|
+
return false;
|
186
|
+
}
|
187
|
+
}, {
|
188
|
+
tag: 'div.code-block',
|
189
|
+
preserveWhitespace: 'full',
|
190
|
+
getAttrs: domNode => {
|
191
|
+
const dom = domNode;
|
192
|
+
// TODO: ED-5604 Fix it inside `react-syntax-highlighter`
|
193
|
+
// Remove line numbers
|
194
|
+
const lineNumber = dom.querySelectorAll('.react-syntax-highlighter-line-number');
|
195
|
+
if (lineNumber.length > 0) {
|
196
|
+
// It's possible to copy without the line numbers too hence this
|
197
|
+
// `react-syntax-highlighter-line-number` check, so that we don't remove real code
|
198
|
+
lineNumber.forEach(line => line.remove());
|
199
|
+
}
|
200
|
+
return {};
|
201
|
+
}
|
202
|
+
}],
|
203
|
+
toDOM(node) {
|
204
|
+
var _node$attrs;
|
205
|
+
const attrs = {
|
206
|
+
'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
|
207
|
+
};
|
208
|
+
return ['pre', attrs, ['code', {
|
209
|
+
'data-language': node.attrs.language
|
210
|
+
}, 0]];
|
211
|
+
}
|
144
212
|
});
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { date as dateFactory } from '../../next-schema/generated/nodeTypes';
|
2
|
+
import { uuid } from '../../utils';
|
2
3
|
|
3
4
|
/**
|
4
5
|
* @name date_node
|
@@ -18,4 +19,22 @@ export const date = dateFactory({
|
|
18
19
|
};
|
19
20
|
return ['span', attrs];
|
20
21
|
}
|
22
|
+
});
|
23
|
+
export const dateWithLocalId = dateFactory({
|
24
|
+
parseDOM: [{
|
25
|
+
tag: 'span[data-node-type="date"]',
|
26
|
+
getAttrs: dom => ({
|
27
|
+
timestamp: dom.getAttribute('data-timestamp'),
|
28
|
+
localId: uuid.generate()
|
29
|
+
})
|
30
|
+
}],
|
31
|
+
toDOM(node) {
|
32
|
+
var _node$attrs;
|
33
|
+
const attrs = {
|
34
|
+
'data-node-type': 'date',
|
35
|
+
'data-timestamp': node.attrs.timestamp,
|
36
|
+
'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
|
37
|
+
};
|
38
|
+
return ['span', attrs];
|
39
|
+
}
|
21
40
|
});
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { embedCard as embedCardFactory } from '../../next-schema/generated/nodeTypes';
|
2
|
+
import { uuid } from '../../utils/uuid';
|
2
3
|
|
3
4
|
/**
|
4
5
|
* @name embedCard_node
|
@@ -33,4 +34,37 @@ export const embedCard = embedCardFactory({
|
|
33
34
|
};
|
34
35
|
return ['div', attrs];
|
35
36
|
}
|
37
|
+
});
|
38
|
+
export const embedCardWithLocalId = embedCardFactory({
|
39
|
+
parseDOM: [{
|
40
|
+
tag: 'div[data-embed-card]',
|
41
|
+
getAttrs: dom => ({
|
42
|
+
url: dom.getAttribute('data-card-url'),
|
43
|
+
layout: dom.getAttribute('data-layout') || 'center',
|
44
|
+
width: Number(dom.getAttribute('data-width')) || null,
|
45
|
+
originalWidth: Number(dom.getAttribute('data-card-original-width')) || null,
|
46
|
+
originalHeight: Number(dom.getAttribute('data-card-original-height')) || null,
|
47
|
+
localId: uuid.generate()
|
48
|
+
})
|
49
|
+
}],
|
50
|
+
toDOM(node) {
|
51
|
+
var _node$attrs;
|
52
|
+
const {
|
53
|
+
url,
|
54
|
+
layout,
|
55
|
+
width,
|
56
|
+
originalWidth,
|
57
|
+
originalHeight
|
58
|
+
} = node.attrs;
|
59
|
+
const attrs = {
|
60
|
+
'data-embed-card': '',
|
61
|
+
'data-card-url': url,
|
62
|
+
'data-layout': layout,
|
63
|
+
'data-width': width,
|
64
|
+
'data-original-width': originalWidth,
|
65
|
+
'data-original-height': originalHeight,
|
66
|
+
'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
|
67
|
+
};
|
68
|
+
return ['div', attrs];
|
69
|
+
}
|
36
70
|
});
|