@atlaskit/adf-schema 36.8.2 → 36.8.4

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.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 9323c96: Add mark items
8
+
9
+ ## 36.8.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 3d6a62a: Add properties, marks, and mark array type
14
+
3
15
  ## 36.8.2
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
+ });
@@ -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
+ });
@@ -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
+ });
@@ -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.2",
3
+ "version": "36.8.4",
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.1",
47
+ "@atlaskit/adf-schema-generator": "^1.7.3",
48
48
  "@babel/cli": "^7.22.9",
49
49
  "@babel/core": "^7.22.9",
50
50
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -25,3 +25,31 @@ Delete all subfields except for type and properties. Content objects are also de
25
25
  ```sh
26
26
  cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(.content, .text, .marks, .attrs, .version, .required, .additionalProperties, .allOf, .anyOf, .items, .minItems, .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node) else . end)'
27
27
  ```
28
+
29
+ Delete all subfields except for marks, type and properties. Content objects are also deleted. Inline is also deleted, as it is a content object for paragraph.
30
+
31
+ ```sh
32
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(.content, .text, .attrs, .version, .required, .additionalProperties, .allOf, .anyOf, .items, .minItems, .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node) else . end)'
33
+ ```
34
+
35
+ Delete all subfields except for marks, type and properties. Content objects are also deleted. Inline is also deleted, as it is a content object for paragraph.
36
+
37
+ A number of nodes have `marks` defined, yet the array is empty. Assuming this is redundant, I've removed them.
38
+
39
+ ```sh
40
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(
41
+ .content, .text, .attrs, .version, .required, .additionalProperties, .allOf, .anyOf, .items, .minItems,
42
+ .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
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
+ ```
45
+
46
+ Delete all subfields except for marks, 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, .anyOf, .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
 
@@ -238,6 +237,10 @@ const jsonWithTypes = {
238
237
  type: {
239
238
  enum: ['media'],
240
239
  },
240
+ marks: {
241
+ type: 'array',
242
+ items: {},
243
+ },
241
244
  },
242
245
  },
243
246
  mediaInline_node: {
@@ -246,6 +249,10 @@ const jsonWithTypes = {
246
249
  type: {
247
250
  enum: ['mediaInline'],
248
251
  },
252
+ marks: {
253
+ type: 'array',
254
+ items: {},
255
+ },
249
256
  },
250
257
  },
251
258
  formatted_text_inline_node: {},
@@ -275,6 +282,12 @@ const jsonWithTypes = {
275
282
  type: {
276
283
  enum: ['mediaSingle'],
277
284
  },
285
+ marks: {
286
+ type: 'array',
287
+ items: {
288
+ $ref: '#/definitions/link_mark',
289
+ },
290
+ },
278
291
  },
279
292
  },
280
293
  mediaSingle_caption_node: {},
@@ -410,6 +423,12 @@ const jsonWithTypes = {
410
423
  type: {
411
424
  enum: ['table'],
412
425
  },
426
+ marks: {
427
+ type: 'array',
428
+ items: {
429
+ $ref: '#/definitions/fragment_mark',
430
+ },
431
+ },
413
432
  },
414
433
  },
415
434
  table_row_node: {
@@ -469,6 +488,12 @@ const jsonWithTypes = {
469
488
  type: {
470
489
  enum: ['layoutSection'],
471
490
  },
491
+ marks: {
492
+ type: 'array',
493
+ items: {
494
+ $ref: '#/definitions/breakout_mark',
495
+ },
496
+ },
472
497
  },
473
498
  },
474
499
  layoutSection_full_node: {},