@atlaskit/adf-schema 36.18.2 → 37.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/index.js +0 -24
  3. package/dist/cjs/next-schema/generated/markTypes.js +27 -16
  4. package/dist/cjs/next-schema/generated/nodeTypes.js +36 -4
  5. package/dist/cjs/next-schema/groups/searchQueryMarkGroup.js +2 -1
  6. package/dist/cjs/next-schema/marks/annotation.js +1 -0
  7. package/dist/cjs/next-schema/marks/confluenceInlineComment.js +18 -0
  8. package/dist/cjs/next-schema/marks/fragment.js +2 -0
  9. package/dist/cjs/next-schema/marks/typeAheadQuery.js +17 -0
  10. package/dist/cjs/next-schema/marks/unsupportedMark.js +3 -2
  11. package/dist/cjs/next-schema/marks/unsupportedNodeAttribute.js +4 -6
  12. package/dist/cjs/next-schema/nodes/heading.js +5 -0
  13. package/dist/cjs/next-schema/nodes/paragraph.js +7 -0
  14. package/dist/cjs/next-schema/nodes/text.js +3 -1
  15. package/dist/cjs/schema/create-schema.js +2 -2
  16. package/dist/cjs/schema/default-schema.js +1 -3
  17. package/dist/cjs/schema/index.js +0 -24
  18. package/dist/cjs/schema/nodes/heading.js +2 -51
  19. package/dist/cjs/schema/nodes/index.js +0 -24
  20. package/dist/cjs/schema/nodes/paragraph.js +2 -18
  21. package/dist/es2019/index.js +1 -1
  22. package/dist/es2019/next-schema/generated/markTypes.js +26 -15
  23. package/dist/es2019/next-schema/generated/nodeTypes.js +36 -4
  24. package/dist/es2019/next-schema/groups/searchQueryMarkGroup.js +2 -1
  25. package/dist/es2019/next-schema/marks/annotation.js +2 -1
  26. package/dist/es2019/next-schema/marks/confluenceInlineComment.js +12 -0
  27. package/dist/es2019/next-schema/marks/fragment.js +3 -1
  28. package/dist/es2019/next-schema/marks/typeAheadQuery.js +11 -0
  29. package/dist/es2019/next-schema/marks/unsupportedMark.js +4 -3
  30. package/dist/es2019/next-schema/marks/unsupportedNodeAttribute.js +4 -6
  31. package/dist/es2019/next-schema/nodes/heading.js +5 -0
  32. package/dist/es2019/next-schema/nodes/paragraph.js +7 -0
  33. package/dist/es2019/next-schema/nodes/text.js +3 -1
  34. package/dist/es2019/schema/create-schema.js +3 -3
  35. package/dist/es2019/schema/default-schema.js +2 -4
  36. package/dist/es2019/schema/index.js +1 -1
  37. package/dist/es2019/schema/nodes/heading.js +2 -48
  38. package/dist/es2019/schema/nodes/index.js +2 -2
  39. package/dist/es2019/schema/nodes/paragraph.js +2 -15
  40. package/dist/esm/index.js +1 -1
  41. package/dist/esm/next-schema/generated/markTypes.js +26 -15
  42. package/dist/esm/next-schema/generated/nodeTypes.js +36 -4
  43. package/dist/esm/next-schema/groups/searchQueryMarkGroup.js +2 -1
  44. package/dist/esm/next-schema/marks/annotation.js +2 -1
  45. package/dist/esm/next-schema/marks/confluenceInlineComment.js +12 -0
  46. package/dist/esm/next-schema/marks/fragment.js +3 -1
  47. package/dist/esm/next-schema/marks/typeAheadQuery.js +11 -0
  48. package/dist/esm/next-schema/marks/unsupportedMark.js +4 -3
  49. package/dist/esm/next-schema/marks/unsupportedNodeAttribute.js +4 -6
  50. package/dist/esm/next-schema/nodes/heading.js +5 -0
  51. package/dist/esm/next-schema/nodes/paragraph.js +7 -0
  52. package/dist/esm/next-schema/nodes/text.js +3 -1
  53. package/dist/esm/schema/create-schema.js +3 -3
  54. package/dist/esm/schema/default-schema.js +2 -4
  55. package/dist/esm/schema/index.js +1 -1
  56. package/dist/esm/schema/nodes/heading.js +1 -50
  57. package/dist/esm/schema/nodes/index.js +2 -2
  58. package/dist/esm/schema/nodes/paragraph.js +1 -17
  59. package/dist/json-schema/v1/full.json +12 -0
  60. package/dist/types/index.d.ts +1 -1
  61. package/dist/types/next-schema/generated/markTypes.d.ts +23 -1
  62. package/dist/types/next-schema/generated/nodeTypes.d.ts +18 -2
  63. package/dist/types/next-schema/marks/confluenceInlineComment.d.ts +1 -0
  64. package/dist/types/next-schema/marks/typeAheadQuery.d.ts +1 -0
  65. package/dist/types/schema/index.d.ts +1 -1
  66. package/dist/types/schema/nodes/heading.d.ts +1 -3
  67. package/dist/types/schema/nodes/index.d.ts +2 -2
  68. package/dist/types/schema/nodes/paragraph.d.ts +1 -6
  69. package/json-schema/v1/full.json +12 -0
  70. package/package.json +3 -3
  71. package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +7 -1
  72. package/schema-generators/__tests__/unit/json-full-schema.unit.ts +12 -0
  73. package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +3 -25
@@ -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