@atlaskit/adf-schema 37.1.35 → 37.1.37

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 (25) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/next-schema/groups/blockRootOnlyGroup.js +5 -1
  3. package/dist/cjs/next-schema/marks/confluenceInlineComment.js +1 -1
  4. package/dist/cjs/next-schema/nodes/mediaSingle.js +3 -1
  5. package/dist/cjs/next-schema/nodes/tableCell.js +4 -0
  6. package/dist/cjs/next-schema/nodes/tableHeader.js +4 -0
  7. package/dist/cjs/next-schema/nodes/text.js +10 -1
  8. package/dist/es2019/next-schema/groups/blockRootOnlyGroup.js +5 -1
  9. package/dist/es2019/next-schema/marks/confluenceInlineComment.js +2 -2
  10. package/dist/es2019/next-schema/nodes/mediaSingle.js +3 -1
  11. package/dist/es2019/next-schema/nodes/tableCell.js +4 -0
  12. package/dist/es2019/next-schema/nodes/tableHeader.js +4 -0
  13. package/dist/es2019/next-schema/nodes/text.js +10 -1
  14. package/dist/esm/next-schema/groups/blockRootOnlyGroup.js +5 -1
  15. package/dist/esm/next-schema/marks/confluenceInlineComment.js +2 -2
  16. package/dist/esm/next-schema/nodes/mediaSingle.js +3 -1
  17. package/dist/esm/next-schema/nodes/tableCell.js +4 -0
  18. package/dist/esm/next-schema/nodes/tableHeader.js +4 -0
  19. package/dist/esm/next-schema/nodes/text.js +10 -1
  20. package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +1 -1
  21. package/dist/types/next-schema/nodes/mediaSingle.d.ts +1 -1
  22. package/dist/types/next-schema/nodes/text.d.ts +8 -0
  23. package/package.json +2 -2
  24. package/schema-generators/__tests__/unit/adfToValidatorSpecValidation.unit.ts +0 -3
  25. package/schema-generators/__tests__/unit/json-full-schema-backwards-compat.unit.ts +41 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 37.1.37
4
+
5
+ ### Patch Changes
6
+
7
+ - 407f5d1: Align table cell and table header to validator spec.
8
+ - e596783: Align confluence inline comment mark to validator spec.
9
+
10
+ ## 37.1.36
11
+
12
+ ### Patch Changes
13
+
14
+ - 3faf4f8: Reverse compatability for doc, blockRootOnly and block in full JSON Schema
15
+
3
16
  ## 37.1.35
4
17
 
5
18
  ### Patch Changes
@@ -6,4 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.blockRootOnlyGroup = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  var _multiBodiedExtension = require("../nodes/multiBodiedExtension");
9
- var blockRootOnlyGroup = exports.blockRootOnlyGroup = (0, _adfSchemaGenerator.adfNodeGroup)('blockRootOnly', [_multiBodiedExtension.multiBodiedExtension]);
9
+ var blockRootOnlyGroup = exports.blockRootOnlyGroup = (0, _adfSchemaGenerator.adfNodeGroup)('blockRootOnly', [_multiBodiedExtension.multiBodiedExtension], {
10
+ // @DSLCompatibilityException - Generated JSON Schema does not have this.
11
+ // We should introduce this to the JSON Schema since it is in PM Spec
12
+ ignore: ['json-schema']
13
+ });
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.confluenceInlineComment = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  var confluenceInlineComment = exports.confluenceInlineComment = (0, _adfSchemaGenerator.adfMark)('confluenceInlineComment').define({
9
- ignore: [_adfSchemaGenerator.JSONSchemaTransformerName, _adfSchemaGenerator.ValidatorSpecTransformerName],
9
+ ignore: [_adfSchemaGenerator.JSONSchemaTransformerName],
10
10
  inclusive: false,
11
11
  excludes: _adfSchemaGenerator.MarkExcludesNone,
12
12
  attrs: {
@@ -123,7 +123,9 @@ var mediaSingle = exports.mediaSingle = (0, _adfSchemaGenerator.adfNode)('mediaS
123
123
  }
124
124
  }).variant('width_type', {
125
125
  content: [(0, _adfSchemaGenerator.$range)(1, 1, (0, _adfSchemaGenerator.$or)(_media.media, _unsupportedBlock.unsupportedBlock))],
126
- ignore: [],
126
+ // @DSLCompatibilityException - Generated JSON Schema does not have this.
127
+ // We should introduce this to the JSON Schema since it is in PM Spec
128
+ ignore: ['json-schema'],
127
129
  marks: [],
128
130
  DANGEROUS_MANUAL_OVERRIDE: {
129
131
  'pm-spec': {
@@ -44,6 +44,10 @@ var tableCell = exports.tableCell = (0, _adfSchemaGenerator.adfNode)('tableCell'
44
44
  required: {
45
45
  reason: '@DSLCompatibilityException - required for tableHeader validator spec',
46
46
  value: ['content']
47
+ },
48
+ 'props.content': {
49
+ reason: '@DSLCompatibilityException - required for tableHeader validator spec',
50
+ value: 'tableCell_content'
47
51
  }
48
52
  }
49
53
  }
@@ -44,6 +44,10 @@ var tableHeader = exports.tableHeader = (0, _adfSchemaGenerator.adfNode)('tableH
44
44
  required: {
45
45
  reason: '@DSLCompatibilityException - required for tableHeader validator spec',
46
46
  value: ['content']
47
+ },
48
+ 'props.content': {
49
+ reason: '@DSLCompatibilityException - required for tableHeader validator spec',
50
+ value: 'tableCell_content'
47
51
  }
48
52
  }
49
53
  }
@@ -25,7 +25,16 @@ var text = exports.text = (0, _adfSchemaGenerator.adfNode)('text').define({
25
25
  marks: [_link.link],
26
26
  ignore: ['pm-spec', 'json-schema']
27
27
  }).variant('formatted', {
28
- 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]
28
+ 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],
29
+ DANGEROUS_MANUAL_OVERRIDE: {
30
+ 'validator-spec': {
31
+ // Refers to confluence inline comment value (9th on list)
32
+ 'props.marks.items[0][9]': {
33
+ remove: true,
34
+ reason: '@DSLCompatibilityException - Confluence inline comment is not matched on the validator'
35
+ }
36
+ }
37
+ }
29
38
  }).variant('code_inline', {
30
39
  marks: [_code.code, _link.link, _annotation.annotation, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark]
31
40
  });
@@ -1,3 +1,7 @@
1
1
  import { adfNodeGroup } from '@atlaskit/adf-schema-generator';
2
2
  import { multiBodiedExtension } from '../nodes/multiBodiedExtension';
3
- export const blockRootOnlyGroup = adfNodeGroup('blockRootOnly', [multiBodiedExtension]);
3
+ export const blockRootOnlyGroup = adfNodeGroup('blockRootOnly', [multiBodiedExtension], {
4
+ // @DSLCompatibilityException - Generated JSON Schema does not have this.
5
+ // We should introduce this to the JSON Schema since it is in PM Spec
6
+ ignore: ['json-schema']
7
+ });
@@ -1,6 +1,6 @@
1
- import { ValidatorSpecTransformerName, JSONSchemaTransformerName, adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
1
+ import { JSONSchemaTransformerName, adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
2
2
  export const confluenceInlineComment = adfMark('confluenceInlineComment').define({
3
- ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
3
+ ignore: [JSONSchemaTransformerName],
4
4
  inclusive: false,
5
5
  excludes: MarkExcludesNone,
6
6
  attrs: {
@@ -117,7 +117,9 @@ export const mediaSingle = adfNode('mediaSingle').define({
117
117
  }
118
118
  }).variant('width_type', {
119
119
  content: [$range(1, 1, $or(media, unsupportedBlock))],
120
- ignore: [],
120
+ // @DSLCompatibilityException - Generated JSON Schema does not have this.
121
+ // We should introduce this to the JSON Schema since it is in PM Spec
122
+ ignore: ['json-schema'],
121
123
  marks: [],
122
124
  DANGEROUS_MANUAL_OVERRIDE: {
123
125
  'pm-spec': {
@@ -38,6 +38,10 @@ export const tableCell = adfNode('tableCell').define({
38
38
  required: {
39
39
  reason: '@DSLCompatibilityException - required for tableHeader validator spec',
40
40
  value: ['content']
41
+ },
42
+ 'props.content': {
43
+ reason: '@DSLCompatibilityException - required for tableHeader validator spec',
44
+ value: 'tableCell_content'
41
45
  }
42
46
  }
43
47
  }
@@ -38,6 +38,10 @@ export const tableHeader = adfNode('tableHeader').define({
38
38
  required: {
39
39
  reason: '@DSLCompatibilityException - required for tableHeader validator spec',
40
40
  value: ['content']
41
+ },
42
+ 'props.content': {
43
+ reason: '@DSLCompatibilityException - required for tableHeader validator spec',
44
+ value: 'tableCell_content'
41
45
  }
42
46
  }
43
47
  }
@@ -19,7 +19,16 @@ export const text = adfNode('text').define({
19
19
  marks: [link],
20
20
  ignore: ['pm-spec', 'json-schema']
21
21
  }).variant('formatted', {
22
- marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark]
22
+ marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark],
23
+ DANGEROUS_MANUAL_OVERRIDE: {
24
+ 'validator-spec': {
25
+ // Refers to confluence inline comment value (9th on list)
26
+ 'props.marks.items[0][9]': {
27
+ remove: true,
28
+ reason: '@DSLCompatibilityException - Confluence inline comment is not matched on the validator'
29
+ }
30
+ }
31
+ }
23
32
  }).variant('code_inline', {
24
33
  marks: [code, link, annotation, unsupportedNodeAttribute, unsupportedMark]
25
34
  });
@@ -1,3 +1,7 @@
1
1
  import { adfNodeGroup } from '@atlaskit/adf-schema-generator';
2
2
  import { multiBodiedExtension } from '../nodes/multiBodiedExtension';
3
- export var blockRootOnlyGroup = adfNodeGroup('blockRootOnly', [multiBodiedExtension]);
3
+ export var blockRootOnlyGroup = adfNodeGroup('blockRootOnly', [multiBodiedExtension], {
4
+ // @DSLCompatibilityException - Generated JSON Schema does not have this.
5
+ // We should introduce this to the JSON Schema since it is in PM Spec
6
+ ignore: ['json-schema']
7
+ });
@@ -1,6 +1,6 @@
1
- import { ValidatorSpecTransformerName, JSONSchemaTransformerName, adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
1
+ import { JSONSchemaTransformerName, adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
2
2
  export var confluenceInlineComment = adfMark('confluenceInlineComment').define({
3
- ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
3
+ ignore: [JSONSchemaTransformerName],
4
4
  inclusive: false,
5
5
  excludes: MarkExcludesNone,
6
6
  attrs: {
@@ -117,7 +117,9 @@ export var mediaSingle = adfNode('mediaSingle').define({
117
117
  }
118
118
  }).variant('width_type', {
119
119
  content: [$range(1, 1, $or(media, unsupportedBlock))],
120
- ignore: [],
120
+ // @DSLCompatibilityException - Generated JSON Schema does not have this.
121
+ // We should introduce this to the JSON Schema since it is in PM Spec
122
+ ignore: ['json-schema'],
121
123
  marks: [],
122
124
  DANGEROUS_MANUAL_OVERRIDE: {
123
125
  'pm-spec': {
@@ -38,6 +38,10 @@ export var tableCell = adfNode('tableCell').define({
38
38
  required: {
39
39
  reason: '@DSLCompatibilityException - required for tableHeader validator spec',
40
40
  value: ['content']
41
+ },
42
+ 'props.content': {
43
+ reason: '@DSLCompatibilityException - required for tableHeader validator spec',
44
+ value: 'tableCell_content'
41
45
  }
42
46
  }
43
47
  }
@@ -38,6 +38,10 @@ export var tableHeader = adfNode('tableHeader').define({
38
38
  required: {
39
39
  reason: '@DSLCompatibilityException - required for tableHeader validator spec',
40
40
  value: ['content']
41
+ },
42
+ 'props.content': {
43
+ reason: '@DSLCompatibilityException - required for tableHeader validator spec',
44
+ value: 'tableCell_content'
41
45
  }
42
46
  }
43
47
  }
@@ -19,7 +19,16 @@ export var text = adfNode('text').define({
19
19
  marks: [link],
20
20
  ignore: ['pm-spec', 'json-schema']
21
21
  }).variant('formatted', {
22
- marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark]
22
+ marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark],
23
+ DANGEROUS_MANUAL_OVERRIDE: {
24
+ 'validator-spec': {
25
+ // Refers to confluence inline comment value (9th on list)
26
+ 'props.marks.items[0][9]': {
27
+ remove: true,
28
+ reason: '@DSLCompatibilityException - Confluence inline comment is not matched on the validator'
29
+ }
30
+ }
31
+ }
23
32
  }).variant('code_inline', {
24
33
  marks: [code, link, annotation, unsupportedNodeAttribute, unsupportedMark]
25
34
  });
@@ -97,7 +97,7 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
97
97
  };
98
98
  } & {
99
99
  content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentRangeSpec[];
100
- ignore: any[];
100
+ ignore: "json-schema"[];
101
101
  marks: any[];
102
102
  DANGEROUS_MANUAL_OVERRIDE: {
103
103
  'pm-spec': {
@@ -68,7 +68,7 @@ export declare const mediaSingle: import("@atlaskit/adf-schema-generator/dist/ty
68
68
  };
69
69
  } & {
70
70
  content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentRangeSpec[];
71
- ignore: any[];
71
+ ignore: "json-schema"[];
72
72
  marks: any[];
73
73
  DANGEROUS_MANUAL_OVERRIDE: {
74
74
  'pm-spec': {
@@ -32,6 +32,14 @@ export declare const text: import("@atlaskit/adf-schema-generator/dist/types/adf
32
32
  ignore: ("pm-spec" | "json-schema")[];
33
33
  } & {
34
34
  marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
35
+ DANGEROUS_MANUAL_OVERRIDE: {
36
+ 'validator-spec': {
37
+ 'props.marks.items[0][9]': {
38
+ remove: true;
39
+ reason: string;
40
+ };
41
+ };
42
+ };
35
43
  } & {
36
44
  marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
37
45
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "37.1.35",
3
+ "version": "37.1.37",
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/"
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@atlassian/adf-schema-json": "^1.16.0",
50
- "@atlaskit/adf-schema-generator": "^1.25.6",
50
+ "@atlaskit/adf-schema-generator": "^1.25.8",
51
51
  "@atlaskit/adf-utils": "^19.2.2",
52
52
  "@atlaskit/codemod-utils": "^4.2.4",
53
53
  "@atlaskit/json-schema-generator": "^3.3.9",
@@ -4,12 +4,9 @@ import adfNode from '../../../src/next-schema/full-schema.adf';
4
4
 
5
5
  const newSpecs = sortNestedArrays(adfToValidatorSpec(adfNode));
6
6
  const SKIP_LIST = [
7
- 'inline_comment_marker', // doesn't exist in the output
8
7
  'layoutSection_with_single_column', // doesn't exist in the output
9
8
  'multiBodiedExtension', // doesn't match existing spec
10
9
  'nestedExpand', // doesn't match existing spec
11
- 'tableCell', // doesn't match existing spec
12
- 'tableHeader', // doesn't match existing spec
13
10
 
14
11
  'atomic_inline', // doesn't exist in the output, not even used anywhere...
15
12
  'nestedExpand_content', // doesn't exist in the output, completely different format from other groups
@@ -48,23 +48,48 @@ test('ADF DSL to JSON Schema backwards compatibility for full schema', () => {
48
48
  function transformFullFixtureForKnownFailures(json) {
49
49
  const definitions = json.definitions;
50
50
 
51
- delete definitions.doc_node;
52
- delete definitions.blockRootOnly_node;
51
+ // Extra nodes in anyOf
52
+ definitions.inline_node.anyOf = definitions.inline_node.anyOf.filter(
53
+ (v) =>
54
+ ![
55
+ '#/definitions/confluenceJiraIssue_node',
56
+ '#/definitions/confluenceUnsupportedInline_node',
57
+ '#/definitions/image_node',
58
+ '#/definitions/inlineExtension_node',
59
+ '#/definitions/text_link_inline_node',
60
+ '#/definitions/text_node',
61
+ '#/definitions/unsupportedInline_node',
62
+ ].includes(v.$ref),
63
+ );
64
+
65
+ // Extra nodes in content.items.anyOf
66
+ definitions.table_row_node.properties.content.items.anyOf =
67
+ definitions.table_row_node.properties.content.items.anyOf.filter(
68
+ (v) => v.$ref !== '#/definitions/table_cell_content',
69
+ );
70
+
71
+ // Extra definitions
53
72
  delete definitions.extensionFrame_node;
54
- delete definitions.block_content;
55
- delete definitions.non_nestable_block_content;
56
- delete definitions.table_row_node;
57
- delete definitions.table_cell_content;
58
- delete definitions.mediaGroup_node;
59
- delete definitions.inline_node;
60
- delete definitions.mediaInline_node;
61
- delete definitions.mediaSingle_width_type_node;
62
- delete definitions.status_node;
63
- delete definitions.date_node;
64
- delete definitions.emoji_node;
65
- delete definitions.mention_node;
66
- delete definitions.codeBlock_with_marks_node;
67
- delete definitions.codeBlock_node;
73
+
74
+ // // Extra marks
75
+ delete definitions.date_node.properties.marks;
76
+ delete definitions.emoji_node.properties.marks;
77
+ delete definitions.mention_node.properties.marks;
78
+ delete definitions.status_node.properties.marks;
79
+
80
+ // // Extra properties
81
+ delete definitions.codeBlock_node.properties.attrs.properties.uniqueId;
82
+ delete definitions.codeBlock_with_marks_node.allOf.find(
83
+ (v) => v.type === 'object',
84
+ ).properties.content;
85
+ delete definitions.mediaGroup_node.properties.attrs;
86
+ delete definitions.mediaInline_node.properties.attrs.properties.url;
87
+
88
+ // Special case for table_cell_content
89
+ definitions.table_cell_content.items.anyOf =
90
+ definitions.table_cell_content.items.anyOf.filter(
91
+ (v) => v.$ref !== '#/definitions/nestedExpand_content',
92
+ );
68
93
 
69
94
  return json;
70
95
  }