@atlaskit/adf-schema 36.18.1 → 36.18.3

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 (38) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/next-schema/generated/markTypes.js +27 -16
  3. package/dist/cjs/next-schema/generated/nodeTypes.js +4 -4
  4. package/dist/cjs/next-schema/groups/searchQueryMarkGroup.js +2 -1
  5. package/dist/cjs/next-schema/marks/annotation.js +1 -0
  6. package/dist/cjs/next-schema/marks/confluenceInlineComment.js +18 -0
  7. package/dist/cjs/next-schema/marks/fragment.js +2 -0
  8. package/dist/cjs/next-schema/marks/typeAheadQuery.js +17 -0
  9. package/dist/cjs/next-schema/marks/unsupportedMark.js +3 -2
  10. package/dist/cjs/next-schema/marks/unsupportedNodeAttribute.js +4 -6
  11. package/dist/cjs/next-schema/nodes/text.js +3 -1
  12. package/dist/es2019/next-schema/generated/markTypes.js +26 -15
  13. package/dist/es2019/next-schema/generated/nodeTypes.js +4 -4
  14. package/dist/es2019/next-schema/groups/searchQueryMarkGroup.js +2 -1
  15. package/dist/es2019/next-schema/marks/annotation.js +2 -1
  16. package/dist/es2019/next-schema/marks/confluenceInlineComment.js +12 -0
  17. package/dist/es2019/next-schema/marks/fragment.js +3 -1
  18. package/dist/es2019/next-schema/marks/typeAheadQuery.js +11 -0
  19. package/dist/es2019/next-schema/marks/unsupportedMark.js +4 -3
  20. package/dist/es2019/next-schema/marks/unsupportedNodeAttribute.js +4 -6
  21. package/dist/es2019/next-schema/nodes/text.js +3 -1
  22. package/dist/esm/next-schema/generated/markTypes.js +26 -15
  23. package/dist/esm/next-schema/generated/nodeTypes.js +4 -4
  24. package/dist/esm/next-schema/groups/searchQueryMarkGroup.js +2 -1
  25. package/dist/esm/next-schema/marks/annotation.js +2 -1
  26. package/dist/esm/next-schema/marks/confluenceInlineComment.js +12 -0
  27. package/dist/esm/next-schema/marks/fragment.js +3 -1
  28. package/dist/esm/next-schema/marks/typeAheadQuery.js +11 -0
  29. package/dist/esm/next-schema/marks/unsupportedMark.js +4 -3
  30. package/dist/esm/next-schema/marks/unsupportedNodeAttribute.js +4 -6
  31. package/dist/esm/next-schema/nodes/text.js +3 -1
  32. package/dist/types/next-schema/generated/markTypes.d.ts +23 -1
  33. package/dist/types/next-schema/generated/nodeTypes.d.ts +2 -2
  34. package/dist/types/next-schema/marks/confluenceInlineComment.d.ts +1 -0
  35. package/dist/types/next-schema/marks/typeAheadQuery.d.ts +1 -0
  36. package/package.json +3 -2
  37. package/schema-generators/__tests__/unit/json-full-schema-backwards-compat.unit.ts +129 -0
  38. package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +3 -25
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 36.18.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 3ed35ed: refacotor build attrs when build pm spec, unskip few tests of validation for mark spec
8
+
9
+ ## 36.18.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 4126ead: json schema validation for the next schema produced by adf-schema-generator
14
+
3
15
  ## 36.18.1
4
16
 
5
17
  ### Patch Changes
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.unsupportedNodeAttribute = exports.unsupportedMark = exports.underline = exports.textColor = exports.subsup = exports.strong = exports.strike = exports.link = exports.indentation = exports.fragment = exports.em = exports.dataConsumer = exports.code = exports.breakout = exports.border = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
6
+ exports.unsupportedNodeAttribute = exports.unsupportedMark = exports.underline = exports.typeAheadQuery = exports.textColor = exports.subsup = exports.strong = exports.strike = exports.link = exports.indentation = exports.fragment = exports.em = exports.dataConsumer = exports.confluenceInlineComment = exports.code = exports.breakout = exports.border = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  /**
9
9
  * This file was automatically generated by @atlaskit/adf-schema-generator
@@ -13,28 +13,19 @@ var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
13
13
 
14
14
  var unsupportedNodeAttribute = exports.unsupportedNodeAttribute = (0, _adfSchemaGenerator.createPMMarkSpecFactory)({
15
15
  attrs: {
16
- type: {
17
- default: null
18
- },
19
- unsupported: {
20
- default: {}
21
- }
16
+ unsupported: {},
17
+ type: {}
22
18
  }
23
19
  });
24
20
  var unsupportedMark = exports.unsupportedMark = (0, _adfSchemaGenerator.createPMMarkSpecFactory)({
25
21
  attrs: {
26
- originalValue: {
27
- default: {}
28
- }
29
- }
22
+ originalValue: {}
23
+ },
24
+ excludes: ''
30
25
  });
31
26
  var link = exports.link = (0, _adfSchemaGenerator.createPMMarkSpecFactory)({
32
27
  attrs: {
33
28
  href: {},
34
- title: {},
35
- id: {},
36
- collection: {},
37
- occurrenceKey: {},
38
29
  __confluenceMetadata: {
39
30
  default: null
40
31
  }
@@ -85,6 +76,7 @@ var annotation = exports.annotation = (0, _adfSchemaGenerator.createPMMarkSpecFa
85
76
  }
86
77
  },
87
78
  inclusive: true,
79
+ excludes: '',
88
80
  group: 'annotation'
89
81
  });
90
82
  var backgroundColor = exports.backgroundColor = (0, _adfSchemaGenerator.createPMMarkSpecFactory)({
@@ -95,6 +87,24 @@ var backgroundColor = exports.backgroundColor = (0, _adfSchemaGenerator.createPM
95
87
  excludes: 'color',
96
88
  group: 'color'
97
89
  });
90
+ var typeAheadQuery = exports.typeAheadQuery = (0, _adfSchemaGenerator.createPMMarkSpecFactory)({
91
+ attrs: {
92
+ trigger: {
93
+ default: ''
94
+ }
95
+ },
96
+ inclusive: true,
97
+ group: 'searchQuery'
98
+ });
99
+ var confluenceInlineComment = exports.confluenceInlineComment = (0, _adfSchemaGenerator.createPMMarkSpecFactory)({
100
+ attrs: {
101
+ reference: {
102
+ default: ''
103
+ }
104
+ },
105
+ inclusive: false,
106
+ excludes: ''
107
+ });
98
108
  var code = exports.code = (0, _adfSchemaGenerator.createPMMarkSpecFactory)({
99
109
  inclusive: true,
100
110
  excludes: 'fontStyle link searchQuery color'
@@ -115,7 +125,8 @@ var fragment = exports.fragment = (0, _adfSchemaGenerator.createPMMarkSpecFactor
115
125
  default: null
116
126
  }
117
127
  },
118
- inclusive: false
128
+ inclusive: false,
129
+ excludes: ''
119
130
  });
120
131
  var border = exports.border = (0, _adfSchemaGenerator.createPMMarkSpecFactory)({
121
132
  attrs: {
@@ -288,7 +288,7 @@ var confluenceUnsupportedInline = exports.confluenceUnsupportedInline = (0, _adf
288
288
  });
289
289
  var paragraphWithNoMarks = exports.paragraphWithNoMarks = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
290
290
  content: 'inline*',
291
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
291
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
292
292
  selectable: false
293
293
  });
294
294
  var media = exports.media = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
@@ -513,13 +513,13 @@ var panel = exports.panel = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
513
513
  });
514
514
  var paragraph = exports.paragraph = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
515
515
  content: 'inline*',
516
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
516
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
517
517
  group: 'block',
518
518
  selectable: false
519
519
  });
520
520
  var paragraphWithMarks = exports.paragraphWithMarks = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
521
521
  content: 'inline*',
522
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
522
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
523
523
  group: 'block',
524
524
  selectable: false
525
525
  });
@@ -553,7 +553,7 @@ var headingWithIndentation = exports.headingWithIndentation = (0, _adfSchemaGene
553
553
  });
554
554
  var paragraphWithAlignment = exports.paragraphWithAlignment = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
555
555
  content: 'inline*',
556
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
556
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
557
557
  selectable: false
558
558
  });
559
559
  var blockquote = exports.blockquote = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
@@ -5,4 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.searchQueryMarkGroup = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
- var searchQueryMarkGroup = exports.searchQueryMarkGroup = (0, _adfSchemaGenerator.adfMarkGroup)('searchQuery');
8
+ var _typeAheadQuery = require("../marks/typeAheadQuery");
9
+ var searchQueryMarkGroup = exports.searchQueryMarkGroup = (0, _adfSchemaGenerator.adfMarkGroup)('searchQuery', [_typeAheadQuery.typeAheadQuery]);
@@ -9,6 +9,7 @@ var annotation = exports.annotation = (0, _adfSchemaGenerator.adfMark)('annotati
9
9
  var annotationGroup = exports.annotationGroup = (0, _adfSchemaGenerator.adfMarkGroup)('annotation', [annotation]);
10
10
  annotation.define({
11
11
  inclusive: true,
12
+ excludes: _adfSchemaGenerator.MarkExcludesNone,
12
13
  group: annotationGroup,
13
14
  attrs: {
14
15
  id: {
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.confluenceInlineComment = void 0;
7
+ var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
+ var confluenceInlineComment = exports.confluenceInlineComment = (0, _adfSchemaGenerator.adfMark)('confluenceInlineComment').define({
9
+ ignore: [_adfSchemaGenerator.JSONSchemaTransformerName, _adfSchemaGenerator.ValidatorSpecTransformerName],
10
+ inclusive: false,
11
+ excludes: _adfSchemaGenerator.MarkExcludesNone,
12
+ attrs: {
13
+ reference: {
14
+ type: 'string',
15
+ default: ''
16
+ }
17
+ }
18
+ });
@@ -7,6 +7,8 @@ exports.fragment = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  var fragment = exports.fragment = (0, _adfSchemaGenerator.adfMark)('fragment').define({
9
9
  inclusive: false,
10
+ excludes: _adfSchemaGenerator.MarkExcludesNone,
11
+ allowExcludesEmpty: true,
10
12
  attrs: {
11
13
  localId: {
12
14
  minLength: 1,
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.typeAheadQuery = void 0;
7
+ var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
+ var typeAheadQuery = exports.typeAheadQuery = (0, _adfSchemaGenerator.adfMark)('typeAheadQuery').define({
9
+ ignore: [_adfSchemaGenerator.JSONSchemaTransformerName, _adfSchemaGenerator.ValidatorSpecTransformerName],
10
+ inclusive: true,
11
+ attrs: {
12
+ trigger: {
13
+ type: 'string',
14
+ default: ''
15
+ }
16
+ }
17
+ });
@@ -7,10 +7,11 @@ exports.unsupportedMark = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  var unsupportedMark = exports.unsupportedMark = (0, _adfSchemaGenerator.adfMark)('unsupportedMark').define({
9
9
  ignore: [_adfSchemaGenerator.JSONSchemaTransformerName, _adfSchemaGenerator.ValidatorSpecTransformerName],
10
+ excludes: _adfSchemaGenerator.MarkExcludesNone,
11
+ allowExcludesEmpty: true,
10
12
  attrs: {
11
13
  originalValue: {
12
- type: 'object',
13
- default: {}
14
+ type: 'object'
14
15
  }
15
16
  }
16
17
  });
@@ -8,13 +8,11 @@ var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  var unsupportedNodeAttribute = exports.unsupportedNodeAttribute = (0, _adfSchemaGenerator.adfMark)('unsupportedNodeAttribute').define({
9
9
  ignore: [_adfSchemaGenerator.JSONSchemaTransformerName, _adfSchemaGenerator.ValidatorSpecTransformerName],
10
10
  attrs: {
11
- type: {
12
- type: 'string',
13
- default: null
14
- },
15
11
  unsupported: {
16
- type: 'object',
17
- default: {}
12
+ type: 'object'
13
+ },
14
+ type: {
15
+ type: 'string'
18
16
  }
19
17
  }
20
18
  });
@@ -16,8 +16,10 @@ var _underline = require("../marks/underline");
16
16
  var _color = require("../marks/color");
17
17
  var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
18
18
  var _unsupportedMark = require("../marks/unsupportedMark");
19
+ var _typeAheadQuery = require("../marks/typeAheadQuery");
20
+ var _confluenceInlineComment = require("../marks/confluenceInlineComment");
19
21
  var text = exports.text = (0, _adfSchemaGenerator.adfNode)('text').define({}).variant('formatted', {
20
- marks: [_link.link, _em.em, _strong.strong, _strike.strike, _subsup.subsup, _underline.underline, _color.textColor, _annotation.annotation, _color.backgroundColor, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark]
22
+ marks: [_link.link, _em.em, _strong.strong, _strike.strike, _subsup.subsup, _underline.underline, _color.textColor, _annotation.annotation, _color.backgroundColor, _typeAheadQuery.typeAheadQuery, _confluenceInlineComment.confluenceInlineComment, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark]
21
23
  }).variant('code_inline', {
22
24
  marks: [_code.code, _link.link, _annotation.annotation, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark]
23
25
  });
@@ -7,28 +7,19 @@
7
7
  import { createPMMarkSpecFactory } from '@atlaskit/adf-schema-generator';
8
8
  export const unsupportedNodeAttribute = createPMMarkSpecFactory({
9
9
  attrs: {
10
- type: {
11
- default: null
12
- },
13
- unsupported: {
14
- default: {}
15
- }
10
+ unsupported: {},
11
+ type: {}
16
12
  }
17
13
  });
18
14
  export const unsupportedMark = createPMMarkSpecFactory({
19
15
  attrs: {
20
- originalValue: {
21
- default: {}
22
- }
23
- }
16
+ originalValue: {}
17
+ },
18
+ excludes: ''
24
19
  });
25
20
  export const link = createPMMarkSpecFactory({
26
21
  attrs: {
27
22
  href: {},
28
- title: {},
29
- id: {},
30
- collection: {},
31
- occurrenceKey: {},
32
23
  __confluenceMetadata: {
33
24
  default: null
34
25
  }
@@ -79,6 +70,7 @@ export const annotation = createPMMarkSpecFactory({
79
70
  }
80
71
  },
81
72
  inclusive: true,
73
+ excludes: '',
82
74
  group: 'annotation'
83
75
  });
84
76
  export const backgroundColor = createPMMarkSpecFactory({
@@ -89,6 +81,24 @@ export const backgroundColor = createPMMarkSpecFactory({
89
81
  excludes: 'color',
90
82
  group: 'color'
91
83
  });
84
+ export const typeAheadQuery = createPMMarkSpecFactory({
85
+ attrs: {
86
+ trigger: {
87
+ default: ''
88
+ }
89
+ },
90
+ inclusive: true,
91
+ group: 'searchQuery'
92
+ });
93
+ export const confluenceInlineComment = createPMMarkSpecFactory({
94
+ attrs: {
95
+ reference: {
96
+ default: ''
97
+ }
98
+ },
99
+ inclusive: false,
100
+ excludes: ''
101
+ });
92
102
  export const code = createPMMarkSpecFactory({
93
103
  inclusive: true,
94
104
  excludes: 'fontStyle link searchQuery color'
@@ -109,7 +119,8 @@ export const fragment = createPMMarkSpecFactory({
109
119
  default: null
110
120
  }
111
121
  },
112
- inclusive: false
122
+ inclusive: false,
123
+ excludes: ''
113
124
  });
114
125
  export const border = createPMMarkSpecFactory({
115
126
  attrs: {
@@ -282,7 +282,7 @@ export const confluenceUnsupportedInline = createPMNodeSpecFactory({
282
282
  });
283
283
  export const paragraphWithNoMarks = createPMNodeSpecFactory({
284
284
  content: 'inline*',
285
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
285
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
286
286
  selectable: false
287
287
  });
288
288
  export const media = createPMNodeSpecFactory({
@@ -507,13 +507,13 @@ export const panel = createPMNodeSpecFactory({
507
507
  });
508
508
  export const paragraph = createPMNodeSpecFactory({
509
509
  content: 'inline*',
510
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
510
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
511
511
  group: 'block',
512
512
  selectable: false
513
513
  });
514
514
  export const paragraphWithMarks = createPMNodeSpecFactory({
515
515
  content: 'inline*',
516
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
516
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
517
517
  group: 'block',
518
518
  selectable: false
519
519
  });
@@ -547,7 +547,7 @@ export const headingWithIndentation = createPMNodeSpecFactory({
547
547
  });
548
548
  export const paragraphWithAlignment = createPMNodeSpecFactory({
549
549
  content: 'inline*',
550
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
550
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
551
551
  selectable: false
552
552
  });
553
553
  export const blockquote = createPMNodeSpecFactory({
@@ -1,2 +1,3 @@
1
1
  import { adfMarkGroup } from '@atlaskit/adf-schema-generator';
2
- export const searchQueryMarkGroup = adfMarkGroup('searchQuery');
2
+ import { typeAheadQuery } from '../marks/typeAheadQuery';
3
+ export const searchQueryMarkGroup = adfMarkGroup('searchQuery', [typeAheadQuery]);
@@ -1,8 +1,9 @@
1
- import { adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
1
+ import { MarkExcludesNone, adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
2
2
  export const annotation = adfMark('annotation');
3
3
  export const annotationGroup = adfMarkGroup('annotation', [annotation]);
4
4
  annotation.define({
5
5
  inclusive: true,
6
+ excludes: MarkExcludesNone,
6
7
  group: annotationGroup,
7
8
  attrs: {
8
9
  id: {
@@ -0,0 +1,12 @@
1
+ import { ValidatorSpecTransformerName, JSONSchemaTransformerName, adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
2
+ export const confluenceInlineComment = adfMark('confluenceInlineComment').define({
3
+ ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
+ inclusive: false,
5
+ excludes: MarkExcludesNone,
6
+ attrs: {
7
+ reference: {
8
+ type: 'string',
9
+ default: ''
10
+ }
11
+ }
12
+ });
@@ -1,6 +1,8 @@
1
- import { adfMark } from '@atlaskit/adf-schema-generator';
1
+ import { MarkExcludesNone, adfMark } from '@atlaskit/adf-schema-generator';
2
2
  export const fragment = adfMark('fragment').define({
3
3
  inclusive: false,
4
+ excludes: MarkExcludesNone,
5
+ allowExcludesEmpty: true,
4
6
  attrs: {
5
7
  localId: {
6
8
  minLength: 1,
@@ -0,0 +1,11 @@
1
+ import { ValidatorSpecTransformerName, JSONSchemaTransformerName, adfMark } from '@atlaskit/adf-schema-generator';
2
+ export const typeAheadQuery = adfMark('typeAheadQuery').define({
3
+ ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
+ inclusive: true,
5
+ attrs: {
6
+ trigger: {
7
+ type: 'string',
8
+ default: ''
9
+ }
10
+ }
11
+ });
@@ -1,10 +1,11 @@
1
- import { adfMark, JSONSchemaTransformerName, ValidatorSpecTransformerName } from '@atlaskit/adf-schema-generator';
1
+ import { adfMark, JSONSchemaTransformerName, MarkExcludesNone, ValidatorSpecTransformerName } from '@atlaskit/adf-schema-generator';
2
2
  export const unsupportedMark = adfMark('unsupportedMark').define({
3
3
  ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
+ excludes: MarkExcludesNone,
5
+ allowExcludesEmpty: true,
4
6
  attrs: {
5
7
  originalValue: {
6
- type: 'object',
7
- default: {}
8
+ type: 'object'
8
9
  }
9
10
  }
10
11
  });
@@ -2,13 +2,11 @@ import { adfMark, JSONSchemaTransformerName, ValidatorSpecTransformerName } from
2
2
  export const unsupportedNodeAttribute = adfMark('unsupportedNodeAttribute').define({
3
3
  ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
4
  attrs: {
5
- type: {
6
- type: 'string',
7
- default: null
8
- },
9
5
  unsupported: {
10
- type: 'object',
11
- default: {}
6
+ type: 'object'
7
+ },
8
+ type: {
9
+ type: 'string'
12
10
  }
13
11
  }
14
12
  });
@@ -10,8 +10,10 @@ import { underline } from '../marks/underline';
10
10
  import { backgroundColor, textColor } from '../marks/color';
11
11
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
12
12
  import { unsupportedMark } from '../marks/unsupportedMark';
13
+ import { typeAheadQuery } from '../marks/typeAheadQuery';
14
+ import { confluenceInlineComment } from '../marks/confluenceInlineComment';
13
15
  export const text = adfNode('text').define({}).variant('formatted', {
14
- marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, unsupportedNodeAttribute, unsupportedMark]
16
+ marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark]
15
17
  }).variant('code_inline', {
16
18
  marks: [code, link, annotation, unsupportedNodeAttribute, unsupportedMark]
17
19
  });
@@ -7,28 +7,19 @@
7
7
  import { createPMMarkSpecFactory } from '@atlaskit/adf-schema-generator';
8
8
  export var unsupportedNodeAttribute = createPMMarkSpecFactory({
9
9
  attrs: {
10
- type: {
11
- default: null
12
- },
13
- unsupported: {
14
- default: {}
15
- }
10
+ unsupported: {},
11
+ type: {}
16
12
  }
17
13
  });
18
14
  export var unsupportedMark = createPMMarkSpecFactory({
19
15
  attrs: {
20
- originalValue: {
21
- default: {}
22
- }
23
- }
16
+ originalValue: {}
17
+ },
18
+ excludes: ''
24
19
  });
25
20
  export var link = createPMMarkSpecFactory({
26
21
  attrs: {
27
22
  href: {},
28
- title: {},
29
- id: {},
30
- collection: {},
31
- occurrenceKey: {},
32
23
  __confluenceMetadata: {
33
24
  default: null
34
25
  }
@@ -79,6 +70,7 @@ export var annotation = createPMMarkSpecFactory({
79
70
  }
80
71
  },
81
72
  inclusive: true,
73
+ excludes: '',
82
74
  group: 'annotation'
83
75
  });
84
76
  export var backgroundColor = createPMMarkSpecFactory({
@@ -89,6 +81,24 @@ export var backgroundColor = createPMMarkSpecFactory({
89
81
  excludes: 'color',
90
82
  group: 'color'
91
83
  });
84
+ export var typeAheadQuery = createPMMarkSpecFactory({
85
+ attrs: {
86
+ trigger: {
87
+ default: ''
88
+ }
89
+ },
90
+ inclusive: true,
91
+ group: 'searchQuery'
92
+ });
93
+ export var confluenceInlineComment = createPMMarkSpecFactory({
94
+ attrs: {
95
+ reference: {
96
+ default: ''
97
+ }
98
+ },
99
+ inclusive: false,
100
+ excludes: ''
101
+ });
92
102
  export var code = createPMMarkSpecFactory({
93
103
  inclusive: true,
94
104
  excludes: 'fontStyle link searchQuery color'
@@ -109,7 +119,8 @@ export var fragment = createPMMarkSpecFactory({
109
119
  default: null
110
120
  }
111
121
  },
112
- inclusive: false
122
+ inclusive: false,
123
+ excludes: ''
113
124
  });
114
125
  export var border = createPMMarkSpecFactory({
115
126
  attrs: {
@@ -282,7 +282,7 @@ export var confluenceUnsupportedInline = createPMNodeSpecFactory({
282
282
  });
283
283
  export var paragraphWithNoMarks = createPMNodeSpecFactory({
284
284
  content: 'inline*',
285
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
285
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
286
286
  selectable: false
287
287
  });
288
288
  export var media = createPMNodeSpecFactory({
@@ -507,13 +507,13 @@ export var panel = createPMNodeSpecFactory({
507
507
  });
508
508
  export var paragraph = createPMNodeSpecFactory({
509
509
  content: 'inline*',
510
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
510
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
511
511
  group: 'block',
512
512
  selectable: false
513
513
  });
514
514
  export var paragraphWithMarks = createPMNodeSpecFactory({
515
515
  content: 'inline*',
516
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
516
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
517
517
  group: 'block',
518
518
  selectable: false
519
519
  });
@@ -547,7 +547,7 @@ export var headingWithIndentation = createPMNodeSpecFactory({
547
547
  });
548
548
  export var paragraphWithAlignment = createPMNodeSpecFactory({
549
549
  content: 'inline*',
550
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
550
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
551
551
  selectable: false
552
552
  });
553
553
  export var blockquote = createPMNodeSpecFactory({
@@ -1,2 +1,3 @@
1
1
  import { adfMarkGroup } from '@atlaskit/adf-schema-generator';
2
- export var searchQueryMarkGroup = adfMarkGroup('searchQuery');
2
+ import { typeAheadQuery } from '../marks/typeAheadQuery';
3
+ export var searchQueryMarkGroup = adfMarkGroup('searchQuery', [typeAheadQuery]);
@@ -1,8 +1,9 @@
1
- import { adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
1
+ import { MarkExcludesNone, adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
2
2
  export var annotation = adfMark('annotation');
3
3
  export var annotationGroup = adfMarkGroup('annotation', [annotation]);
4
4
  annotation.define({
5
5
  inclusive: true,
6
+ excludes: MarkExcludesNone,
6
7
  group: annotationGroup,
7
8
  attrs: {
8
9
  id: {
@@ -0,0 +1,12 @@
1
+ import { ValidatorSpecTransformerName, JSONSchemaTransformerName, adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
2
+ export var confluenceInlineComment = adfMark('confluenceInlineComment').define({
3
+ ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
+ inclusive: false,
5
+ excludes: MarkExcludesNone,
6
+ attrs: {
7
+ reference: {
8
+ type: 'string',
9
+ default: ''
10
+ }
11
+ }
12
+ });
@@ -1,6 +1,8 @@
1
- import { adfMark } from '@atlaskit/adf-schema-generator';
1
+ import { MarkExcludesNone, adfMark } from '@atlaskit/adf-schema-generator';
2
2
  export var fragment = adfMark('fragment').define({
3
3
  inclusive: false,
4
+ excludes: MarkExcludesNone,
5
+ allowExcludesEmpty: true,
4
6
  attrs: {
5
7
  localId: {
6
8
  minLength: 1,
@@ -0,0 +1,11 @@
1
+ import { ValidatorSpecTransformerName, JSONSchemaTransformerName, adfMark } from '@atlaskit/adf-schema-generator';
2
+ export var typeAheadQuery = adfMark('typeAheadQuery').define({
3
+ ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
+ inclusive: true,
5
+ attrs: {
6
+ trigger: {
7
+ type: 'string',
8
+ default: ''
9
+ }
10
+ }
11
+ });
@@ -1,10 +1,11 @@
1
- import { adfMark, JSONSchemaTransformerName, ValidatorSpecTransformerName } from '@atlaskit/adf-schema-generator';
1
+ import { adfMark, JSONSchemaTransformerName, MarkExcludesNone, ValidatorSpecTransformerName } from '@atlaskit/adf-schema-generator';
2
2
  export var unsupportedMark = adfMark('unsupportedMark').define({
3
3
  ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
+ excludes: MarkExcludesNone,
5
+ allowExcludesEmpty: true,
4
6
  attrs: {
5
7
  originalValue: {
6
- type: 'object',
7
- default: {}
8
+ type: 'object'
8
9
  }
9
10
  }
10
11
  });
@@ -2,13 +2,11 @@ import { adfMark, JSONSchemaTransformerName, ValidatorSpecTransformerName } from
2
2
  export var unsupportedNodeAttribute = adfMark('unsupportedNodeAttribute').define({
3
3
  ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
4
  attrs: {
5
- type: {
6
- type: 'string',
7
- default: null
8
- },
9
5
  unsupported: {
10
- type: 'object',
11
- default: {}
6
+ type: 'object'
7
+ },
8
+ type: {
9
+ type: 'string'
12
10
  }
13
11
  }
14
12
  });
@@ -10,8 +10,10 @@ import { underline } from '../marks/underline';
10
10
  import { backgroundColor, textColor } from '../marks/color';
11
11
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
12
12
  import { unsupportedMark } from '../marks/unsupportedMark';
13
+ import { typeAheadQuery } from '../marks/typeAheadQuery';
14
+ import { confluenceInlineComment } from '../marks/confluenceInlineComment';
13
15
  export var text = adfNode('text').define({}).variant('formatted', {
14
- marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, unsupportedNodeAttribute, unsupportedMark]
16
+ marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark]
15
17
  }).variant('code_inline', {
16
18
  marks: [code, link, annotation, unsupportedNodeAttribute, unsupportedMark]
17
19
  });
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { Mark } from '@atlaskit/editor-prosemirror/model';
7
7
  export interface UnsupportedNodeAttributeMarkAttributes {
8
- type: string;
9
8
  unsupported: Record<string, unknown>;
9
+ type: string;
10
10
  }
11
11
  export interface UnsupportedNodeAttributeDefinition {
12
12
  type: 'unsupportedNodeAttribute';
@@ -108,6 +108,28 @@ export interface BackgroundColorMark extends Mark {
108
108
  attrs: BackgroundColorMarkAttributes;
109
109
  }
110
110
  export declare const backgroundColor: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").MarkSpecOptions<BackgroundColorMark>) => import("prosemirror-model").MarkSpec;
111
+ export interface TypeAheadQueryMarkAttributes {
112
+ trigger: string;
113
+ }
114
+ export interface TypeAheadQueryDefinition {
115
+ type: 'typeAheadQuery';
116
+ attrs: TypeAheadQueryMarkAttributes;
117
+ }
118
+ export interface TypeAheadQueryMark extends Mark {
119
+ attrs: TypeAheadQueryMarkAttributes;
120
+ }
121
+ export declare const typeAheadQuery: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").MarkSpecOptions<TypeAheadQueryMark>) => import("prosemirror-model").MarkSpec;
122
+ export interface ConfluenceInlineCommentMarkAttributes {
123
+ reference: string;
124
+ }
125
+ export interface ConfluenceInlineCommentDefinition {
126
+ type: 'confluenceInlineComment';
127
+ attrs: ConfluenceInlineCommentMarkAttributes;
128
+ }
129
+ export interface ConfluenceInlineCommentMark extends Mark {
130
+ attrs: ConfluenceInlineCommentMarkAttributes;
131
+ }
132
+ export declare const confluenceInlineComment: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").MarkSpecOptions<ConfluenceInlineCommentMark>) => import("prosemirror-model").MarkSpec;
111
133
  export interface CodeDefinition {
112
134
  type: 'code';
113
135
  }
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import { InlineDefinition, BlockDefinition, BlockRootOnlyDefinition } from './nodeGroupTypes';
8
- import { UnsupportedNodeAttributeMark, UnsupportedMarkMark, LinkMark, EmMark, StrongMark, StrikeMark, SubsupMark, UnderlineMark, TextColorMark, AnnotationMark, BackgroundColorMark, CodeMark, DataConsumerMark, FragmentMark, BorderMark, AlignmentMark, IndentationMark, BreakoutMark } from './markTypes';
8
+ import { UnsupportedNodeAttributeMark, UnsupportedMarkMark, LinkMark, EmMark, StrongMark, StrikeMark, SubsupMark, UnderlineMark, TextColorMark, AnnotationMark, BackgroundColorMark, TypeAheadQueryMark, ConfluenceInlineCommentMark, CodeMark, DataConsumerMark, FragmentMark, BorderMark, AlignmentMark, IndentationMark, BreakoutMark } from './markTypes';
9
9
  export interface TextDefinition {
10
10
  type: 'text';
11
11
  }
@@ -51,7 +51,7 @@ export type BlockCardNode = PMNode & BlockCardDefinition;
51
51
  export declare const blockCard: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<BlockCardNode>) => import("prosemirror-model").NodeSpec;
52
52
  export interface TextFormattedDefinition {
53
53
  type: 'text';
54
- marks: Array<LinkMark | EmMark | StrongMark | StrikeMark | SubsupMark | UnderlineMark | TextColorMark | AnnotationMark | BackgroundColorMark | UnsupportedNodeAttributeMark | UnsupportedMarkMark>;
54
+ marks: Array<LinkMark | EmMark | StrongMark | StrikeMark | SubsupMark | UnderlineMark | TextColorMark | AnnotationMark | BackgroundColorMark | TypeAheadQueryMark | ConfluenceInlineCommentMark | UnsupportedNodeAttributeMark | UnsupportedMarkMark>;
55
55
  }
56
56
  export type TextFormattedNode = PMNode & TextFormattedDefinition;
57
57
  export declare const textFormatted: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<TextFormattedNode>) => import("prosemirror-model").NodeSpec;
@@ -0,0 +1 @@
1
+ export declare const confluenceInlineComment: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>;
@@ -0,0 +1 @@
1
+ export declare const typeAheadQuery: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.18.1",
3
+ "version": "36.18.3",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@atlassian/adf-schema-json": "^1.15.0",
47
- "@atlaskit/adf-schema-generator": "^1.17.1",
47
+ "@atlaskit/adf-schema-generator": "^1.17.2",
48
48
  "@atlaskit/codemod-utils": "^4.2.4",
49
49
  "@atlaskit/json-schema-generator": "^3.3.9",
50
50
  "@babel/cli": "^7.22.9",
@@ -66,6 +66,7 @@
66
66
  "cross-env": "^7.0.3",
67
67
  "jest": "^29.6.2",
68
68
  "jest-environment-jsdom": "^29.6.2",
69
+ "json-schema-diff-validator": "^0.4.1",
69
70
  "prop-types": "^15.5.4",
70
71
  "react": "^16.8.0",
71
72
  "react-dom": "^16.8.0",
@@ -0,0 +1,129 @@
1
+ import { validateSchemaCompatibility } from 'json-schema-diff-validator';
2
+ import { adfToJSON } from '@atlaskit/adf-schema-generator';
3
+ import adfNode from '@atlaskit/adf-schema/src/next-schema/full-schema.adf';
4
+
5
+ const DEFINITIONS_TO_SKIP_FULL = [
6
+ 'blockCard_node',
7
+ 'block_content',
8
+ 'bodiedExtension_node',
9
+ 'bodiedExtension_with_marks_node',
10
+ 'codeBlock_node',
11
+ 'codeBlock_with_marks_node',
12
+ 'codeBlock_with_no_marks_node',
13
+ 'code_inline_node',
14
+ 'doc_node',
15
+ 'expand_node',
16
+ 'expand_with_breakout_mark_node',
17
+ 'expand_with_no_mark_node',
18
+ 'extension_node',
19
+ 'extension_with_marks_node',
20
+ 'formatted_text_inline_node',
21
+ 'heading_node',
22
+ 'heading_with_alignment_node',
23
+ 'heading_with_indentation_node',
24
+ 'heading_with_no_marks_node',
25
+ 'inlineCard_node',
26
+ 'inlineExtension_node',
27
+ 'inlineExtension_with_marks_node',
28
+ 'inline_node',
29
+ 'layoutSection_full_node',
30
+ 'mediaInline_node',
31
+ 'mediaSingle_caption_node',
32
+ 'mediaSingle_full_node',
33
+ 'mediaSingle_node',
34
+ 'nestedExpand_content',
35
+ 'nestedExpand_node',
36
+ 'nestedExpand_with_no_marks_node',
37
+ 'non_nestable_block_content',
38
+ 'paragraph_node',
39
+ 'paragraph_with_alignment_node',
40
+ 'paragraph_with_indentation_node',
41
+ 'paragraph_with_no_marks_node',
42
+ 'table_cell_content',
43
+ 'table_cell_node',
44
+ 'table_header_node',
45
+ 'text_node',
46
+ ];
47
+
48
+ test('ADF DSL to JSON Schema backwards compatibility for full schema', () => {
49
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
50
+ const currentSchema = require('../../../json-schema/v1/full.json');
51
+ const nextSchema = adfToJSON(adfNode);
52
+ DEFINITIONS_TO_SKIP_FULL.forEach((definition) => {
53
+ nextSchema.definitions[definition] = currentSchema.definitions[definition];
54
+ });
55
+
56
+ expect(() => {
57
+ validateSchemaCompatibility(currentSchema, nextSchema, {
58
+ allowNewOneOf: true,
59
+ allowNewEnumValue: true,
60
+ allowReorder: true,
61
+ });
62
+ }).not.toThrow();
63
+ });
64
+
65
+ const DEFINITIONS_TO_SKIP_STAGE_0 = [
66
+ 'blockCard_node',
67
+ 'block_content',
68
+ 'bodiedExtension_node',
69
+ 'bodiedExtension_with_marks_node',
70
+ 'codeBlock_node',
71
+ 'codeBlock_with_marks_node',
72
+ 'codeBlock_with_no_marks_node',
73
+ 'code_inline_node',
74
+ 'date_node',
75
+ 'doc_node',
76
+ 'emoji_node',
77
+ 'expand_node',
78
+ 'expand_with_breakout_mark_node',
79
+ 'expand_with_no_mark_node',
80
+ 'extensionFrame_node',
81
+ 'extension_node',
82
+ 'extension_with_marks_node',
83
+ 'formatted_text_inline_node',
84
+ 'heading_node',
85
+ 'heading_with_alignment_node',
86
+ 'heading_with_indentation_node',
87
+ 'heading_with_no_marks_node',
88
+ 'inlineCard_node',
89
+ 'inlineExtension_node',
90
+ 'inlineExtension_with_marks_node',
91
+ 'inline_node',
92
+ 'layoutSection_full_node',
93
+ 'layoutSection_with_single_column_node',
94
+ 'mediaInline_node',
95
+ 'mediaSingle_caption_node',
96
+ 'mediaSingle_full_node',
97
+ 'mediaSingle_node',
98
+ 'mention_node',
99
+ 'multiBodiedExtension_node',
100
+ 'nestedExpand_content',
101
+ 'nestedExpand_node',
102
+ 'nestedExpand_with_no_marks_node',
103
+ 'non_nestable_block_content',
104
+ 'paragraph_node',
105
+ 'paragraph_with_alignment_node',
106
+ 'paragraph_with_indentation_node',
107
+ 'paragraph_with_no_marks_node',
108
+ 'status_node',
109
+ 'table_cell_content',
110
+ 'table_cell_node',
111
+ 'table_header_node',
112
+ 'text_node',
113
+ ];
114
+ test('ADF DSL to JSON Schema backwards compatibility for stage0 schema', () => {
115
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
116
+ const currentSchema = require('../../../json-schema/v1/stage-0.json');
117
+ const nextSchema = adfToJSON(adfNode);
118
+ DEFINITIONS_TO_SKIP_STAGE_0.forEach((definition) => {
119
+ nextSchema.definitions[definition] = currentSchema.definitions[definition];
120
+ });
121
+
122
+ expect(() => {
123
+ validateSchemaCompatibility(currentSchema, nextSchema, {
124
+ allowNewOneOf: true,
125
+ allowNewEnumValue: true,
126
+ allowReorder: true,
127
+ });
128
+ }).not.toThrow();
129
+ });
@@ -19,17 +19,7 @@ const defaultSchema = getNodesAndMarksMap();
19
19
  const EXCLUDE_CONTENT_FROM_NODESPEC = [
20
20
  'uknownBlock', // We won't have it in DSL
21
21
  ];
22
- const EXCLUDE_MARKS_FROM_NODESPEC = [
23
- 'confluenceInlineComment', // not exist in ADF DSL
24
- 'typeAheadQuery', // not exist in ADF DSL
25
- ];
26
- const SKIPPED_MARKSPEC_TESTS = [
27
- 'link', // new link mark is not matching old link mark
28
- 'confluenceInlineComment', // not exist in ADF DSL
29
- 'unsupportedMark', // exist in ADF DSL but have default value where old spec doesn't have
30
- 'unsupportedNodeAttribute', // exist in ADF DSL but have default value where old spec doesn't have
31
- 'typeAheadQuery', // not exist in ADF DSL
32
- ];
22
+
33
23
  const SKIPPED_NODESPEC_TESTS = [
34
24
  'unknownBlock', // unused node
35
25
  'mediaSingleFull', // not aligned with old spec - content is different, another case similar to layoutSection
@@ -93,7 +83,7 @@ expect.extend({
93
83
  content: formatContent(expected.content, EXCLUDE_CONTENT_FROM_NODESPEC),
94
84
  }),
95
85
  ...(expected.marks && {
96
- marks: filterAndSortMarks(expected.marks, EXCLUDE_MARKS_FROM_NODESPEC),
86
+ marks: filterAndSortMarks(expected.marks),
97
87
  }),
98
88
  };
99
89
 
@@ -110,10 +100,6 @@ expect.extend({
110
100
  },
111
101
  });
112
102
 
113
- function isMarkSpec(_value: MarkSpec | NodeSpec): _value is MarkSpec {
114
- return true;
115
- }
116
-
117
103
  function isNodeSpec(_value: MarkSpec | NodeSpec): _value is NodeSpec {
118
104
  return true;
119
105
  }
@@ -131,13 +117,6 @@ function omit<T extends object>(data: T, keys = []): T {
131
117
  // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
132
118
  delete result[k];
133
119
  }
134
- if (isMarkSpec(data)) {
135
- // Treat excludes: '' same as no excludes property
136
- if (data.excludes !== undefined && data.excludes === '') {
137
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
138
- delete result['excludes'];
139
- }
140
- }
141
120
  if (isNodeSpec(data)) {
142
121
  // Treat inline: false same as no inline property
143
122
  if (data.inline !== undefined && data.inline === false) {
@@ -151,14 +130,13 @@ function omit<T extends object>(data: T, keys = []): T {
151
130
  describe('validate PM schema', () => {
152
131
  describe('marks', () => {
153
132
  const { marks } = defaultSchema;
154
- const skipLists = SKIPPED_MARKSPEC_TESTS;
155
133
 
156
134
  const testCases = Object.entries(marks).map(([key, value]) => {
157
135
  return {
158
136
  name: key,
159
137
  legacyMarkSpec: value,
160
138
  newMarkSpecFn: newMarkSpecs[key] as MarkSpecFactory,
161
- skip: skipLists.includes(key) || key.startsWith('__'),
139
+ skip: key.startsWith('__'),
162
140
  };
163
141
  });
164
142