@atlaskit/adf-schema 36.8.3 → 36.8.5

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 36.8.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 669a895: Add anyof field to json marks in DSL transformer
8
+
9
+ ## 36.8.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 9323c96: Add mark items
14
+
3
15
  ## 36.8.3
4
16
 
5
17
  ### Patch Changes
@@ -10,7 +10,6 @@ var _fragment = require("../marks/fragment");
10
10
  var extension = exports.extension = (0, _adfSchemaGenerator.adfNode)('extension').define({
11
11
  atom: true,
12
12
  selectable: true,
13
- marks: [_dataConsumer.dataConsumer, _fragment.fragment],
14
13
  attrs: {
15
14
  extensionType: {
16
15
  type: 'string',
@@ -42,4 +41,6 @@ var extension = exports.extension = (0, _adfSchemaGenerator.adfNode)('extension'
42
41
  default: null
43
42
  }
44
43
  }
45
- }).variant('with_marks', {});
44
+ }).variant('with_marks', {
45
+ marks: [_dataConsumer.dataConsumer, _fragment.fragment]
46
+ });
@@ -10,7 +10,7 @@ var _border = require("../marks/border");
10
10
  var _link = require("../marks/link");
11
11
  var media = exports.media = (0, _adfSchemaGenerator.adfNode)('media').define({
12
12
  selectable: true,
13
- marks: [_link.link, _border.border, _annotation.annotation],
13
+ marks: [_link.link, _annotation.annotation, _border.border],
14
14
  attrs: {
15
15
  type: {
16
16
  type: 'enum',
@@ -13,7 +13,7 @@ var _media = require("./media");
13
13
  var mediaInline = exports.mediaInline = (0, _adfSchemaGenerator.adfNode)('mediaInline').define({
14
14
  selectable: true,
15
15
  atom: false,
16
- marks: [_link.link, _border.border, _annotation.annotation],
16
+ marks: [_link.link, _annotation.annotation, _border.border],
17
17
  attrs: {
18
18
  data: {
19
19
  type: 'object',
@@ -9,7 +9,6 @@ var _inlineGroup = require("../groups/inlineGroup");
9
9
  var _alignmentAndIndentation = require("../marks/alignmentAndIndentation");
10
10
  var paragraph = exports.paragraph = (0, _adfSchemaGenerator.adfNode)('paragraph').define({
11
11
  selectable: false,
12
- marks: [_alignmentAndIndentation.alignment],
13
12
  content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_inlineGroup.inlineGroup))]
14
13
  }).variant('with_alignment', {
15
14
  marks: [_alignmentAndIndentation.alignment]
@@ -4,7 +4,6 @@ import { fragment } from '../marks/fragment';
4
4
  export const extension = adfNode('extension').define({
5
5
  atom: true,
6
6
  selectable: true,
7
- marks: [dataConsumer, fragment],
8
7
  attrs: {
9
8
  extensionType: {
10
9
  type: 'string',
@@ -36,4 +35,6 @@ export const extension = adfNode('extension').define({
36
35
  default: null
37
36
  }
38
37
  }
39
- }).variant('with_marks', {});
38
+ }).variant('with_marks', {
39
+ marks: [dataConsumer, fragment]
40
+ });
@@ -4,7 +4,7 @@ import { border } from '../marks/border';
4
4
  import { link } from '../marks/link';
5
5
  export const media = adfNode('media').define({
6
6
  selectable: true,
7
- marks: [link, border, annotation],
7
+ marks: [link, annotation, border],
8
8
  attrs: {
9
9
  type: {
10
10
  type: 'enum',
@@ -7,7 +7,7 @@ import { media } from './media';
7
7
  export const mediaInline = adfNode('mediaInline').define({
8
8
  selectable: true,
9
9
  atom: false,
10
- marks: [link, border, annotation],
10
+ marks: [link, annotation, border],
11
11
  attrs: {
12
12
  data: {
13
13
  type: 'object',
@@ -3,7 +3,6 @@ import { inlineGroup } from '../groups/inlineGroup';
3
3
  import { alignment, indentation } from '../marks/alignmentAndIndentation';
4
4
  export const paragraph = adfNode('paragraph').define({
5
5
  selectable: false,
6
- marks: [alignment],
7
6
  content: [$zeroPlus($or(inlineGroup))]
8
7
  }).variant('with_alignment', {
9
8
  marks: [alignment]
@@ -4,7 +4,6 @@ import { fragment } from '../marks/fragment';
4
4
  export var extension = adfNode('extension').define({
5
5
  atom: true,
6
6
  selectable: true,
7
- marks: [dataConsumer, fragment],
8
7
  attrs: {
9
8
  extensionType: {
10
9
  type: 'string',
@@ -36,4 +35,6 @@ export var extension = adfNode('extension').define({
36
35
  default: null
37
36
  }
38
37
  }
39
- }).variant('with_marks', {});
38
+ }).variant('with_marks', {
39
+ marks: [dataConsumer, fragment]
40
+ });
@@ -4,7 +4,7 @@ import { border } from '../marks/border';
4
4
  import { link } from '../marks/link';
5
5
  export var media = adfNode('media').define({
6
6
  selectable: true,
7
- marks: [link, border, annotation],
7
+ marks: [link, annotation, border],
8
8
  attrs: {
9
9
  type: {
10
10
  type: 'enum',
@@ -7,7 +7,7 @@ import { media } from './media';
7
7
  export var mediaInline = adfNode('mediaInline').define({
8
8
  selectable: true,
9
9
  atom: false,
10
- marks: [link, border, annotation],
10
+ marks: [link, annotation, border],
11
11
  attrs: {
12
12
  data: {
13
13
  type: 'object',
@@ -3,7 +3,6 @@ import { inlineGroup } from '../groups/inlineGroup';
3
3
  import { alignment, indentation } from '../marks/alignmentAndIndentation';
4
4
  export var paragraph = adfNode('paragraph').define({
5
5
  selectable: false,
6
- marks: [alignment],
7
6
  content: [$zeroPlus($or(inlineGroup))]
8
7
  }).variant('with_alignment', {
9
8
  marks: [alignment]
@@ -51,7 +51,7 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
51
51
  } & {
52
52
  atom: false;
53
53
  content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOrSpec[];
54
- }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_marks"], {
54
+ }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_alignment", "with_indentation", "with_marks", "with_no_marks"], {
55
55
  root?: boolean;
56
56
  atom?: boolean;
57
57
  attrs?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFAttribute").ADFAttributes;
@@ -67,7 +67,13 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
67
67
  marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
68
68
  selectable?: boolean;
69
69
  whitespace?: "pre" | "normal";
70
- }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_alignment", "with_indentation", "with_marks", "with_no_marks"], {
70
+ } & {
71
+ marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
72
+ } & {
73
+ marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
74
+ } & {
75
+ marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
76
+ }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_list"], {
71
77
  root?: boolean;
72
78
  atom?: boolean;
73
79
  attrs?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFAttribute").ADFAttributes;
@@ -84,12 +90,8 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
84
90
  selectable?: boolean;
85
91
  whitespace?: "pre" | "normal";
86
92
  } & {
87
- marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
88
- } & {
89
- marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
90
- } & {
91
- marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
92
- }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_list"], {
93
+ content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOneOrMoreSpec[];
94
+ }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_marks"], {
93
95
  root?: boolean;
94
96
  atom?: boolean;
95
97
  attrs?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFAttribute").ADFAttributes;
@@ -106,7 +108,7 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
106
108
  selectable?: boolean;
107
109
  whitespace?: "pre" | "normal";
108
110
  } & {
109
- content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOneOrMoreSpec[];
111
+ marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
110
112
  }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_alignment", "with_indentation", "with_no_marks"], {
111
113
  root?: boolean;
112
114
  atom?: boolean;
@@ -14,4 +14,6 @@ export declare const extension: import("@atlaskit/adf-schema-generator/dist/type
14
14
  marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
15
15
  selectable?: boolean;
16
16
  whitespace?: "pre" | "normal";
17
+ } & {
18
+ marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
17
19
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.8.3",
3
+ "version": "36.8.5",
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.7.2",
47
+ "@atlaskit/adf-schema-generator": "^1.7.4",
48
48
  "@babel/cli": "^7.22.9",
49
49
  "@babel/core": "^7.22.9",
50
50
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -42,3 +42,14 @@ A number of nodes have `marks` defined, yet the array is empty. Assuming this is
42
42
  .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
43
43
  .bodiedExtension_node.properties.marks, .codeBlock_node.properties.marks, .expand_node.properties.marks, .heading_node.properties.marks, .inlineExtension_node.properties.marks, .text_node.properties.marks) else . end)'
44
44
  ```
45
+
46
+ Delete all subfields except for marks, anyOf, items, type and properties. Content objects are also deleted. Inline is also deleted, as it is a content object for paragraph.
47
+
48
+ A number of nodes have `marks` defined, yet the array is empty. Assuming this is redundant, I've removed them.
49
+
50
+ ```sh
51
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(
52
+ .content, .text, .attrs, .version, .required, .additionalProperties, .allOf, .minItems,
53
+ .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
54
+ .bodiedExtension_node.properties.marks, .codeBlock_node.properties.marks, .expand_node.properties.marks, .heading_node.properties.marks, .inlineExtension_node.properties.marks, .text_node.properties.marks, .extension_node.properties.marks, .paragraph_node.properties.marks) else . end)'
55
+ ```
@@ -4,7 +4,6 @@ import adfNode from '@atlaskit/adf-schema/src/next-schema/full-schema.adf';
4
4
  test('It should match the existing schema', () => {
5
5
  const result = adfToJSON(adfNode);
6
6
 
7
- // TODO Compare this to the real ADF Schema as it becomes ready
8
7
  expect(result).toEqual(jsonWithTypes);
9
8
  });
10
9
 
@@ -240,6 +239,19 @@ const jsonWithTypes = {
240
239
  },
241
240
  marks: {
242
241
  type: 'array',
242
+ items: {
243
+ anyOf: [
244
+ {
245
+ $ref: '#/definitions/link_mark',
246
+ },
247
+ {
248
+ $ref: '#/definitions/annotation_mark',
249
+ },
250
+ {
251
+ $ref: '#/definitions/border_mark',
252
+ },
253
+ ],
254
+ },
243
255
  },
244
256
  },
245
257
  },
@@ -251,6 +263,19 @@ const jsonWithTypes = {
251
263
  },
252
264
  marks: {
253
265
  type: 'array',
266
+ items: {
267
+ anyOf: [
268
+ {
269
+ $ref: '#/definitions/link_mark',
270
+ },
271
+ {
272
+ $ref: '#/definitions/annotation_mark',
273
+ },
274
+ {
275
+ $ref: '#/definitions/border_mark',
276
+ },
277
+ ],
278
+ },
254
279
  },
255
280
  },
256
281
  },
@@ -262,9 +287,6 @@ const jsonWithTypes = {
262
287
  type: {
263
288
  enum: ['paragraph'],
264
289
  },
265
- marks: {
266
- type: 'array',
267
- },
268
290
  },
269
291
  },
270
292
  paragraph_with_no_marks_node: {},
@@ -286,6 +308,9 @@ const jsonWithTypes = {
286
308
  },
287
309
  marks: {
288
310
  type: 'array',
311
+ items: {
312
+ $ref: '#/definitions/link_mark',
313
+ },
289
314
  },
290
315
  },
291
316
  },
@@ -396,9 +421,6 @@ const jsonWithTypes = {
396
421
  type: {
397
422
  enum: ['extension'],
398
423
  },
399
- marks: {
400
- type: 'array',
401
- },
402
424
  },
403
425
  },
404
426
  extension_with_marks_node: {},
@@ -427,6 +449,9 @@ const jsonWithTypes = {
427
449
  },
428
450
  marks: {
429
451
  type: 'array',
452
+ items: {
453
+ $ref: '#/definitions/fragment_mark',
454
+ },
430
455
  },
431
456
  },
432
457
  },
@@ -489,6 +514,9 @@ const jsonWithTypes = {
489
514
  },
490
515
  marks: {
491
516
  type: 'array',
517
+ items: {
518
+ $ref: '#/definitions/breakout_mark',
519
+ },
492
520
  },
493
521
  },
494
522
  },