@atlaskit/adf-schema 36.14.0 → 36.15.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.
Files changed (116) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/next-schema/full-schema.adf.js +3 -2
  3. package/dist/cjs/next-schema/generated/markTypes.js +23 -23
  4. package/dist/cjs/next-schema/generated/nodeTypes.js +136 -202
  5. package/dist/cjs/next-schema/groups/blockGroup.js +5 -1
  6. package/dist/cjs/next-schema/groups/inlineGroup.js +1 -3
  7. package/dist/cjs/next-schema/nodes/blockCard.js +7 -3
  8. package/dist/cjs/next-schema/nodes/caption.js +1 -0
  9. package/dist/cjs/next-schema/nodes/codeBlock.js +2 -2
  10. package/dist/cjs/next-schema/nodes/decisionItem.js +1 -0
  11. package/dist/cjs/next-schema/nodes/inlineExtension.js +5 -1
  12. package/dist/cjs/next-schema/nodes/layoutColumn.js +2 -1
  13. package/dist/cjs/next-schema/nodes/media.js +2 -2
  14. package/dist/cjs/next-schema/nodes/mediaInline.js +29 -12
  15. package/dist/cjs/next-schema/nodes/mediaSingle.js +2 -1
  16. package/dist/cjs/next-schema/nodes/mention.js +2 -1
  17. package/dist/cjs/next-schema/nodes/placeholder.js +2 -0
  18. package/dist/cjs/next-schema/nodes/table.js +1 -0
  19. package/dist/cjs/next-schema/nodes/tableCell.js +2 -2
  20. package/dist/cjs/next-schema/nodes/tableHeader.js +2 -2
  21. package/dist/cjs/next-schema/nodes/tableRow.js +2 -1
  22. package/dist/cjs/next-schema/nodes/task.js +1 -0
  23. package/dist/es2019/next-schema/full-schema.adf.js +3 -2
  24. package/dist/es2019/next-schema/generated/markTypes.js +23 -23
  25. package/dist/es2019/next-schema/generated/nodeTypes.js +135 -201
  26. package/dist/es2019/next-schema/groups/blockGroup.js +5 -1
  27. package/dist/es2019/next-schema/groups/inlineGroup.js +1 -3
  28. package/dist/es2019/next-schema/nodes/blockCard.js +7 -3
  29. package/dist/es2019/next-schema/nodes/caption.js +1 -0
  30. package/dist/es2019/next-schema/nodes/codeBlock.js +1 -1
  31. package/dist/es2019/next-schema/nodes/decisionItem.js +1 -0
  32. package/dist/es2019/next-schema/nodes/inlineExtension.js +5 -1
  33. package/dist/es2019/next-schema/nodes/layoutColumn.js +2 -1
  34. package/dist/es2019/next-schema/nodes/media.js +2 -2
  35. package/dist/es2019/next-schema/nodes/mediaInline.js +29 -12
  36. package/dist/es2019/next-schema/nodes/mediaSingle.js +2 -1
  37. package/dist/es2019/next-schema/nodes/mention.js +2 -1
  38. package/dist/es2019/next-schema/nodes/placeholder.js +2 -0
  39. package/dist/es2019/next-schema/nodes/table.js +1 -0
  40. package/dist/es2019/next-schema/nodes/tableCell.js +2 -2
  41. package/dist/es2019/next-schema/nodes/tableHeader.js +2 -2
  42. package/dist/es2019/next-schema/nodes/tableRow.js +2 -1
  43. package/dist/es2019/next-schema/nodes/task.js +1 -0
  44. package/dist/esm/next-schema/full-schema.adf.js +3 -2
  45. package/dist/esm/next-schema/generated/markTypes.js +23 -23
  46. package/dist/esm/next-schema/generated/nodeTypes.js +135 -201
  47. package/dist/esm/next-schema/groups/blockGroup.js +5 -1
  48. package/dist/esm/next-schema/groups/inlineGroup.js +1 -3
  49. package/dist/esm/next-schema/nodes/blockCard.js +7 -3
  50. package/dist/esm/next-schema/nodes/caption.js +1 -0
  51. package/dist/esm/next-schema/nodes/codeBlock.js +1 -1
  52. package/dist/esm/next-schema/nodes/decisionItem.js +1 -0
  53. package/dist/esm/next-schema/nodes/inlineExtension.js +5 -1
  54. package/dist/esm/next-schema/nodes/layoutColumn.js +2 -1
  55. package/dist/esm/next-schema/nodes/media.js +2 -2
  56. package/dist/esm/next-schema/nodes/mediaInline.js +29 -12
  57. package/dist/esm/next-schema/nodes/mediaSingle.js +2 -1
  58. package/dist/esm/next-schema/nodes/mention.js +2 -1
  59. package/dist/esm/next-schema/nodes/placeholder.js +2 -0
  60. package/dist/esm/next-schema/nodes/table.js +1 -0
  61. package/dist/esm/next-schema/nodes/tableCell.js +2 -2
  62. package/dist/esm/next-schema/nodes/tableHeader.js +2 -2
  63. package/dist/esm/next-schema/nodes/tableRow.js +2 -1
  64. package/dist/esm/next-schema/nodes/task.js +1 -0
  65. package/dist/types/next-schema/full-schema.adf.d.ts +3 -0
  66. package/dist/types/next-schema/generated/markTypes.d.ts +36 -36
  67. package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +4 -4
  68. package/dist/types/next-schema/generated/nodeTypes.d.ts +59 -120
  69. package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +12 -0
  70. package/dist/types/next-schema/nodes/blockCard.d.ts +3 -0
  71. package/dist/types/next-schema/nodes/blockquote.d.ts +3 -0
  72. package/dist/types/next-schema/nodes/bodiedExtension.d.ts +3 -0
  73. package/dist/types/next-schema/nodes/caption.d.ts +3 -0
  74. package/dist/types/next-schema/nodes/codeBlock.d.ts +7 -1
  75. package/dist/types/next-schema/nodes/confluenceUnsupportedBlock.d.ts +3 -0
  76. package/dist/types/next-schema/nodes/confluenceUnsupportedInline.d.ts +3 -0
  77. package/dist/types/next-schema/nodes/date.d.ts +3 -0
  78. package/dist/types/next-schema/nodes/decisionItem.d.ts +3 -0
  79. package/dist/types/next-schema/nodes/decisionList.d.ts +3 -0
  80. package/dist/types/next-schema/nodes/embedCard.d.ts +3 -0
  81. package/dist/types/next-schema/nodes/emoji.d.ts +3 -0
  82. package/dist/types/next-schema/nodes/expand.d.ts +3 -0
  83. package/dist/types/next-schema/nodes/extension.d.ts +3 -0
  84. package/dist/types/next-schema/nodes/extensionFrame.d.ts +3 -0
  85. package/dist/types/next-schema/nodes/hardBreak.d.ts +3 -0
  86. package/dist/types/next-schema/nodes/heading.d.ts +3 -0
  87. package/dist/types/next-schema/nodes/inlineCard.d.ts +3 -0
  88. package/dist/types/next-schema/nodes/inlineExtension.d.ts +5 -0
  89. package/dist/types/next-schema/nodes/layoutColumn.d.ts +3 -0
  90. package/dist/types/next-schema/nodes/layoutSection.d.ts +3 -0
  91. package/dist/types/next-schema/nodes/list.d.ts +6 -0
  92. package/dist/types/next-schema/nodes/media.d.ts +3 -0
  93. package/dist/types/next-schema/nodes/mediaGroup.d.ts +3 -0
  94. package/dist/types/next-schema/nodes/mediaInline.d.ts +3 -0
  95. package/dist/types/next-schema/nodes/mediaSingle.d.ts +3 -0
  96. package/dist/types/next-schema/nodes/mention.d.ts +3 -0
  97. package/dist/types/next-schema/nodes/multiBodiedExtension.d.ts +3 -0
  98. package/dist/types/next-schema/nodes/nestedExpand.d.ts +3 -0
  99. package/dist/types/next-schema/nodes/panel.d.ts +3 -0
  100. package/dist/types/next-schema/nodes/paragraph.d.ts +3 -0
  101. package/dist/types/next-schema/nodes/placeholder.d.ts +3 -0
  102. package/dist/types/next-schema/nodes/rule.d.ts +3 -0
  103. package/dist/types/next-schema/nodes/status.d.ts +3 -0
  104. package/dist/types/next-schema/nodes/table.d.ts +3 -0
  105. package/dist/types/next-schema/nodes/tableCell.d.ts +3 -0
  106. package/dist/types/next-schema/nodes/tableHeader.d.ts +3 -0
  107. package/dist/types/next-schema/nodes/tableRow.d.ts +3 -0
  108. package/dist/types/next-schema/nodes/task.d.ts +6 -0
  109. package/dist/types/next-schema/nodes/text.d.ts +3 -0
  110. package/dist/types/next-schema/nodes/unsupportedBlock.d.ts +3 -0
  111. package/dist/types/next-schema/nodes/unsupportedInline.d.ts +3 -0
  112. package/package.json +2 -2
  113. package/schema-generators/__tests__/helpers/_utils.ts +123 -0
  114. package/schema-generators/__tests__/helpers/utils.unit.ts +66 -0
  115. package/schema-generators/__tests__/unit/json-full-schema.unit.ts +1142 -1231
  116. package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +157 -36
@@ -1,4 +1,6 @@
1
1
  import { adfNode } from '@atlaskit/adf-schema-generator';
2
+ import { dataConsumer } from '../marks/dataConsumer';
3
+ import { fragment } from '../marks/fragment';
2
4
  import { unsupportedMark } from '../marks/unsupportedMark';
3
5
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
4
6
  export const inlineExtension = adfNode('inlineExtension').define({
@@ -32,4 +34,6 @@ export const inlineExtension = adfNode('inlineExtension').define({
32
34
  default: null
33
35
  }
34
36
  }
35
- }).variant('with_marks', {});
37
+ }).variant('with_marks', {
38
+ marks: [dataConsumer, fragment, unsupportedNodeAttribute, unsupportedMark]
39
+ });
@@ -2,6 +2,7 @@ import { $onePlus, $or, adfNode } from '@atlaskit/adf-schema-generator';
2
2
  import { blockGroup } from '../groups/blockGroup';
3
3
  import { unsupportedMark } from '../marks/unsupportedMark';
4
4
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
5
+ import { unsupportedBlock } from '../nodes/unsupportedBlock';
5
6
  export const layoutColumn = adfNode('layoutColumn').define({
6
7
  isolating: true,
7
8
  selectable: false,
@@ -14,5 +15,5 @@ export const layoutColumn = adfNode('layoutColumn').define({
14
15
  default: undefined
15
16
  }
16
17
  },
17
- content: [$onePlus($or(blockGroup))]
18
+ content: [$onePlus($or(blockGroup, unsupportedBlock))]
18
19
  });
@@ -55,8 +55,8 @@ export const media = adfNode('media').define({
55
55
  optional: true
56
56
  },
57
57
  __external: {
58
- type: 'number',
59
- default: null,
58
+ type: 'boolean',
59
+ default: false,
60
60
  optional: true
61
61
  },
62
62
  __fileMimeType: {
@@ -6,7 +6,8 @@ import { unsupportedMark } from '../marks/unsupportedMark';
6
6
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
7
7
  export const mediaInline = adfNode('mediaInline').define({
8
8
  selectable: true,
9
- atom: false,
9
+ // atom: false,
10
+ inline: true,
10
11
  marks: [link, annotation, border, unsupportedNodeAttribute, unsupportedMark],
11
12
  attrs: {
12
13
  data: {
@@ -15,23 +16,32 @@ export const mediaInline = adfNode('mediaInline').define({
15
16
  type: {
16
17
  type: 'enum',
17
18
  values: ['link', 'file', 'image'],
18
- optional: true
19
+ optional: true,
20
+ default: 'file'
21
+ },
22
+ url: {
23
+ type: 'string',
24
+ default: null
19
25
  },
20
26
  id: {
21
27
  minLength: 1,
22
- type: 'string'
28
+ type: 'string',
29
+ default: ''
23
30
  },
24
31
  alt: {
25
32
  type: 'string',
33
+ default: '',
26
34
  optional: true
27
35
  },
28
36
  collection: {
29
- type: 'string'
37
+ type: 'string',
38
+ default: ''
30
39
  },
31
40
  occurrenceKey: {
32
41
  minLength: 1,
33
42
  type: 'string',
34
- optional: true
43
+ optional: true,
44
+ default: null
35
45
  },
36
46
  width: {
37
47
  type: 'number',
@@ -45,32 +55,39 @@ export const mediaInline = adfNode('mediaInline').define({
45
55
  },
46
56
  __fileName: {
47
57
  type: 'string',
48
- optional: true
58
+ optional: true,
59
+ default: null
49
60
  },
50
61
  __fileSize: {
51
62
  type: 'number',
52
- optional: true
63
+ optional: true,
64
+ default: null
53
65
  },
54
66
  __fileMimeType: {
55
67
  type: 'string',
56
- optional: true
68
+ optional: true,
69
+ default: null
57
70
  },
58
71
  __displayType: {
59
72
  type: 'enum',
60
73
  values: ['file', 'thumbnail'],
61
- optional: true
74
+ optional: true,
75
+ default: null
62
76
  },
63
77
  __contextId: {
64
78
  type: 'string',
65
- optional: true
79
+ optional: true,
80
+ default: null
66
81
  },
67
82
  __mediaTraceId: {
68
83
  type: 'string',
69
- optional: true
84
+ optional: true,
85
+ default: null
70
86
  },
71
87
  __external: {
72
88
  type: 'boolean',
73
- optional: true
89
+ optional: true,
90
+ default: false
74
91
  }
75
92
  }
76
93
  });
@@ -46,7 +46,8 @@ export const mediaSingle = adfNode('mediaSingle').define({
46
46
  default: 'center'
47
47
  }
48
48
  }]
49
- }
49
+ },
50
+ content: [$or(media)]
50
51
  }).variant('caption', {
51
52
  atom: false,
52
53
  content: [$or(media, unsupportedBlock), $or(caption, unsupportedBlock)]
@@ -12,7 +12,8 @@ export const mention = adfNode('mention').define({
12
12
  },
13
13
  localId: {
14
14
  type: 'string',
15
- optional: true
15
+ optional: true,
16
+ default: null
16
17
  },
17
18
  text: {
18
19
  type: 'string',
@@ -3,7 +3,9 @@ import { unsupportedMark } from '../marks/unsupportedMark';
3
3
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
4
4
  export const placeholder = adfNode('placeholder').define({
5
5
  selectable: false,
6
+ inline: true,
6
7
  marks: [unsupportedNodeAttribute, unsupportedMark],
8
+ allowNoChildMark: true,
7
9
  attrs: {
8
10
  text: {
9
11
  type: 'string',
@@ -6,6 +6,7 @@ import { tableRow } from './tableRow';
6
6
  export const table = adfNode('table').define({
7
7
  isolating: true,
8
8
  selectable: true,
9
+ tableRole: 'table',
9
10
  marks: [fragment, unsupportedNodeAttribute, unsupportedMark],
10
11
  attrs: {
11
12
  displayMode: {
@@ -35,12 +35,12 @@ export const tableCell = adfNode('tableCell').define({
35
35
  },
36
36
  colwidth: {
37
37
  type: 'numberList',
38
- default: [],
38
+ default: null,
39
39
  optional: true
40
40
  },
41
41
  background: {
42
42
  type: 'string',
43
- default: '',
43
+ default: null,
44
44
  optional: true
45
45
  }
46
46
  },
@@ -34,12 +34,12 @@ export const tableHeader = adfNode('tableHeader').define({
34
34
  },
35
35
  colwidth: {
36
36
  type: 'numberList',
37
- default: [],
37
+ default: null,
38
38
  optional: true
39
39
  },
40
40
  background: {
41
41
  type: 'string',
42
- default: '',
42
+ default: null,
43
43
  optional: true
44
44
  }
45
45
  },
@@ -6,5 +6,6 @@ import { tableHeader } from './tableHeader';
6
6
  export const tableRow = adfNode('tableRow').define({
7
7
  selectable: false,
8
8
  marks: [unsupportedNodeAttribute, unsupportedMark],
9
- content: [$onePlus($or(tableCell, tableHeader))]
9
+ content: [$onePlus($or(tableCell, tableHeader))],
10
+ tableRole: 'row'
10
11
  });
@@ -10,6 +10,7 @@ taskItem.define({
10
10
  defining: true,
11
11
  selectable: false,
12
12
  marks: [unsupportedNodeAttribute, unsupportedMark],
13
+ allowAnyChildMark: true,
13
14
  attrs: {
14
15
  localId: {
15
16
  type: 'string',
@@ -2,12 +2,13 @@ import { $or, $onePlus, adfNode } from '@atlaskit/adf-schema-generator';
2
2
  import { blockGroup } from './groups/blockGroup';
3
3
  import { layoutSection } from './nodes/layoutSection';
4
4
  import { blockRootOnlyGroup } from './groups/blockRootOnlyGroup';
5
- import { nestedExpand } from './nodes/nestedExpand';
6
5
  import { paragraph } from './nodes/paragraph';
6
+ import { expand } from './nodes/expand';
7
+ import { codeBlock } from './nodes/codeBlock';
7
8
  import { unsupportedBlock } from './nodes/unsupportedBlock';
8
9
  var doc = adfNode('doc').define({
9
10
  root: true,
10
11
  version: 1,
11
- content: [$onePlus($or(blockGroup, layoutSection, layoutSection.use('full'), blockRootOnlyGroup, nestedExpand, paragraph, unsupportedBlock))]
12
+ content: [$onePlus($or(blockGroup, layoutSection, layoutSection.use('full'), blockRootOnlyGroup, expand.use('with_breakout_mark'), codeBlock.use('with_no_marks'), codeBlock.use('with_marks'), paragraph.use('with_indentation'), unsupportedBlock))]
12
13
  });
13
14
  export default doc;
@@ -16,15 +16,6 @@ export var unsupportedMark = createPMMarkSpecFactory({
16
16
  }
17
17
  }
18
18
  });
19
- export var breakout = createPMMarkSpecFactory({
20
- attrs: {
21
- mode: {
22
- default: 'wide'
23
- }
24
- },
25
- inclusive: false,
26
- spanning: false
27
- });
28
19
  export var link = createPMMarkSpecFactory({
29
20
  attrs: {
30
21
  href: {},
@@ -103,20 +94,6 @@ export var code = createPMMarkSpecFactory({
103
94
  inclusive: true,
104
95
  excludes: 'fontStyle link searchQuery color'
105
96
  });
106
- export var alignment = createPMMarkSpecFactory({
107
- attrs: {
108
- align: {}
109
- },
110
- excludes: 'alignment indentation',
111
- group: 'alignment'
112
- });
113
- export var indentation = createPMMarkSpecFactory({
114
- attrs: {
115
- level: {}
116
- },
117
- excludes: 'indentation alignment',
118
- group: 'indentation'
119
- });
120
97
  export var dataConsumer = createPMMarkSpecFactory({
121
98
  attrs: {
122
99
  sources: {
@@ -134,4 +111,27 @@ export var fragment = createPMMarkSpecFactory({
134
111
  }
135
112
  },
136
113
  inclusive: false
114
+ });
115
+ export var alignment = createPMMarkSpecFactory({
116
+ attrs: {
117
+ align: {}
118
+ },
119
+ excludes: 'alignment indentation',
120
+ group: 'alignment'
121
+ });
122
+ export var indentation = createPMMarkSpecFactory({
123
+ attrs: {
124
+ level: {}
125
+ },
126
+ excludes: 'indentation alignment',
127
+ group: 'indentation'
128
+ });
129
+ export var breakout = createPMMarkSpecFactory({
130
+ attrs: {
131
+ mode: {
132
+ default: 'wide'
133
+ }
134
+ },
135
+ inclusive: false,
136
+ spanning: false
137
137
  });