@atlaskit/adf-schema 36.10.11 → 36.10.12

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,11 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 36.10.12
4
+
5
+ ### Patch Changes
6
+
7
+ - cc7c8bf: Add content list field and $ref field to JSON Schema transformer from ADF DSL
8
+
3
9
  ## 36.10.11
4
10
 
5
11
  ### Patch Changes
@@ -10,7 +10,7 @@ var _paragraph = require("./paragraph");
10
10
  var blockquote = exports.blockquote = (0, _adfSchemaGenerator.adfNode)('blockquote').define({
11
11
  defining: true,
12
12
  selectable: false,
13
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph))]
13
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _list.bulletList, _list.orderedList))]
14
14
  }).variant('with_list', {
15
15
  content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph, _list.orderedList, _list.bulletList))]
16
16
  });
@@ -30,5 +30,5 @@ bulletList.define({
30
30
  listItem.define({
31
31
  defining: true,
32
32
  selectable: false,
33
- content: [(0, _adfSchemaGenerator.$or)(_paragraph.paragraph, _mediaSingle.mediaSingle, _codeBlock.codeBlock), (0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph, orderedList, bulletList, _mediaSingle.mediaSingle, _codeBlock.codeBlock, _task.taskList))]
33
+ content: [(0, _adfSchemaGenerator.$or)(_codeBlock.codeBlock.use('with_no_marks'), _paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full')), (0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_codeBlock.codeBlock.use('with_no_marks'), _paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _task.taskList, bulletList, orderedList))]
34
34
  });
@@ -4,7 +4,7 @@ import { paragraph } from './paragraph';
4
4
  export const blockquote = adfNode('blockquote').define({
5
5
  defining: true,
6
6
  selectable: false,
7
- content: [$onePlus($or(paragraph))]
7
+ content: [$onePlus($or(paragraph.use('with_no_marks'), bulletList, orderedList))]
8
8
  }).variant('with_list', {
9
9
  content: [$onePlus($or(paragraph, orderedList, bulletList))]
10
10
  });
@@ -24,5 +24,5 @@ bulletList.define({
24
24
  listItem.define({
25
25
  defining: true,
26
26
  selectable: false,
27
- content: [$or(paragraph, mediaSingle, codeBlock), $zeroPlus($or(paragraph, orderedList, bulletList, mediaSingle, codeBlock, taskList))]
27
+ content: [$or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full')), $zeroPlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList))]
28
28
  });
@@ -4,7 +4,7 @@ import { paragraph } from './paragraph';
4
4
  export var blockquote = adfNode('blockquote').define({
5
5
  defining: true,
6
6
  selectable: false,
7
- content: [$onePlus($or(paragraph))]
7
+ content: [$onePlus($or(paragraph.use('with_no_marks'), bulletList, orderedList))]
8
8
  }).variant('with_list', {
9
9
  content: [$onePlus($or(paragraph, orderedList, bulletList))]
10
10
  });
@@ -24,5 +24,5 @@ bulletList.define({
24
24
  listItem.define({
25
25
  defining: true,
26
26
  selectable: false,
27
- content: [$or(paragraph, mediaSingle, codeBlock), $zeroPlus($or(paragraph, orderedList, bulletList, mediaSingle, codeBlock, taskList))]
27
+ content: [$or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full')), $zeroPlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList))]
28
28
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.10.11",
3
+ "version": "36.10.12",
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/"
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@atlassian/adf-schema-json": "^1.15.0",
48
- "@atlaskit/adf-schema-generator": "^1.8.4",
48
+ "@atlaskit/adf-schema-generator": "^1.8.6",
49
49
  "@babel/cli": "^7.22.9",
50
50
  "@babel/core": "^7.22.9",
51
51
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -140,3 +140,16 @@ A number of nodes have `marks` defined, yet the array is empty. Assuming this is
140
140
  .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
141
141
  .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)' | pbcopy
142
142
  ```
143
+
144
+ Base level content objects (not nodes) are deleted. `inline` is also deleted, as it is a content object for paragraph.
145
+
146
+ All fields of content except for type, items, items.$ref and $ref have been deleted as well.
147
+
148
+ A number of nodes have `marks` defined, yet the array is empty. Assuming this is redundant, I've removed them.
149
+
150
+ ```sh
151
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(
152
+ .required, .additionalProperties, .allOf, .content.items.anyOf?,
153
+ .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
154
+ .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)' | pbcopy
155
+ ```
@@ -685,7 +685,9 @@ const jsonWithTypes = {
685
685
  },
686
686
  content: {
687
687
  type: 'array',
688
- items: {},
688
+ items: {
689
+ $ref: '#/definitions/inline_node',
690
+ },
689
691
  },
690
692
  },
691
693
  },
@@ -780,7 +782,9 @@ const jsonWithTypes = {
780
782
  },
781
783
  content: {
782
784
  type: 'array',
783
- items: {},
785
+ items: {
786
+ $ref: '#/definitions/inline_node',
787
+ },
784
788
  },
785
789
  attrs: {
786
790
  type: 'object',
@@ -803,7 +807,21 @@ const jsonWithTypes = {
803
807
  },
804
808
  content: {
805
809
  type: 'array',
806
- items: [],
810
+ items: [
811
+ {
812
+ $ref: '#/definitions/taskItem_node',
813
+ },
814
+ {
815
+ anyOf: [
816
+ {
817
+ $ref: '#/definitions/taskItem_node',
818
+ },
819
+ {
820
+ $ref: '#/definitions/taskList_node',
821
+ },
822
+ ],
823
+ },
824
+ ],
807
825
  minItems: 1,
808
826
  },
809
827
  attrs: {
@@ -824,7 +842,49 @@ const jsonWithTypes = {
824
842
  },
825
843
  content: {
826
844
  type: 'array',
827
- items: [],
845
+ items: [
846
+ {
847
+ anyOf: [
848
+ {
849
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
850
+ },
851
+ {
852
+ $ref: '#/definitions/paragraph_with_no_marks_node',
853
+ },
854
+ {
855
+ $ref: '#/definitions/mediaSingle_caption_node',
856
+ },
857
+ {
858
+ $ref: '#/definitions/mediaSingle_full_node',
859
+ },
860
+ ],
861
+ },
862
+ {
863
+ anyOf: [
864
+ {
865
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
866
+ },
867
+ {
868
+ $ref: '#/definitions/paragraph_with_no_marks_node',
869
+ },
870
+ {
871
+ $ref: '#/definitions/mediaSingle_caption_node',
872
+ },
873
+ {
874
+ $ref: '#/definitions/mediaSingle_full_node',
875
+ },
876
+ {
877
+ $ref: '#/definitions/taskList_node',
878
+ },
879
+ {
880
+ $ref: '#/definitions/bulletList_node',
881
+ },
882
+ {
883
+ $ref: '#/definitions/orderedList_node',
884
+ },
885
+ ],
886
+ },
887
+ ],
828
888
  minItems: 1,
829
889
  },
830
890
  },
@@ -837,7 +897,9 @@ const jsonWithTypes = {
837
897
  },
838
898
  content: {
839
899
  type: 'array',
840
- items: {},
900
+ items: {
901
+ $ref: '#/definitions/listItem_node',
902
+ },
841
903
  minItems: 1,
842
904
  },
843
905
  },
@@ -850,7 +912,9 @@ const jsonWithTypes = {
850
912
  },
851
913
  content: {
852
914
  type: 'array',
853
- items: {},
915
+ items: {
916
+ $ref: '#/definitions/listItem_node',
917
+ },
854
918
  minItems: 1,
855
919
  },
856
920
  attrs: {
@@ -872,7 +936,9 @@ const jsonWithTypes = {
872
936
  },
873
937
  content: {
874
938
  type: 'array',
875
- items: {},
939
+ items: {
940
+ $ref: '#/definitions/inline_node',
941
+ },
876
942
  },
877
943
  attrs: {
878
944
  type: 'object',
@@ -897,7 +963,9 @@ const jsonWithTypes = {
897
963
  },
898
964
  content: {
899
965
  type: 'array',
900
- items: {},
966
+ items: {
967
+ $ref: '#/definitions/media_node',
968
+ },
901
969
  minItems: 1,
902
970
  },
903
971
  },
@@ -910,7 +978,9 @@ const jsonWithTypes = {
910
978
  },
911
979
  content: {
912
980
  type: 'array',
913
- items: {},
981
+ items: {
982
+ $ref: '#/definitions/inline_node',
983
+ },
914
984
  },
915
985
  attrs: {
916
986
  type: 'object',
@@ -933,7 +1003,9 @@ const jsonWithTypes = {
933
1003
  },
934
1004
  content: {
935
1005
  type: 'array',
936
- items: {},
1006
+ items: {
1007
+ $ref: '#/definitions/decisionItem_node',
1008
+ },
937
1009
  minItems: 1,
938
1010
  },
939
1011
  attrs: {
@@ -1093,7 +1165,9 @@ const jsonWithTypes = {
1093
1165
  },
1094
1166
  },
1095
1167
  },
1096
- content: {},
1168
+ content: {
1169
+ $ref: '#/definitions/nestedExpand_content',
1170
+ },
1097
1171
  },
1098
1172
  },
1099
1173
  nestedExpand_with_no_marks_node: {},
@@ -1133,7 +1207,9 @@ const jsonWithTypes = {
1133
1207
  },
1134
1208
  content: {
1135
1209
  type: 'array',
1136
- items: {},
1210
+ items: {
1211
+ $ref: '#/definitions/table_row_node',
1212
+ },
1137
1213
  minItems: 1,
1138
1214
  },
1139
1215
  marks: {
@@ -1182,7 +1258,9 @@ const jsonWithTypes = {
1182
1258
  },
1183
1259
  },
1184
1260
  },
1185
- content: {},
1261
+ content: {
1262
+ $ref: '#/definitions/table_cell_content',
1263
+ },
1186
1264
  },
1187
1265
  },
1188
1266
  table_header_node: {
@@ -1211,7 +1289,9 @@ const jsonWithTypes = {
1211
1289
  },
1212
1290
  },
1213
1291
  },
1214
- content: {},
1292
+ content: {
1293
+ $ref: '#/definitions/table_cell_content',
1294
+ },
1215
1295
  },
1216
1296
  },
1217
1297
  expand_node: {
@@ -1230,7 +1310,9 @@ const jsonWithTypes = {
1230
1310
  },
1231
1311
  content: {
1232
1312
  type: 'array',
1233
- items: {},
1313
+ items: {
1314
+ $ref: '#/definitions/non_nestable_block_content',
1315
+ },
1234
1316
  minItems: 1,
1235
1317
  },
1236
1318
  },
@@ -1269,7 +1351,9 @@ const jsonWithTypes = {
1269
1351
  },
1270
1352
  content: {
1271
1353
  type: 'array',
1272
- items: {},
1354
+ items: {
1355
+ $ref: '#/definitions/non_nestable_block_content',
1356
+ },
1273
1357
  minItems: 1,
1274
1358
  },
1275
1359
  },
@@ -1293,7 +1377,9 @@ const jsonWithTypes = {
1293
1377
  },
1294
1378
  content: {
1295
1379
  type: 'array',
1296
- items: {},
1380
+ items: {
1381
+ $ref: '#/definitions/block_content',
1382
+ },
1297
1383
  minItems: 1,
1298
1384
  },
1299
1385
  },
@@ -1312,7 +1398,9 @@ const jsonWithTypes = {
1312
1398
  },
1313
1399
  content: {
1314
1400
  type: 'array',
1315
- items: {},
1401
+ items: {
1402
+ $ref: '#/definitions/layoutColumn_node',
1403
+ },
1316
1404
  },
1317
1405
  },
1318
1406
  },
@@ -1336,15 +1424,13 @@ const jsonWithTypes = {
1336
1424
  };
1337
1425
 
1338
1426
  // New JSON, different to the old JSON schema
1339
- jsonWithTypes.definitions.heading_node.properties.content = {
1340
- type: 'array',
1341
- items: {},
1342
- };
1343
1427
  jsonWithTypes.definitions.nestedExpand_node.properties.content = {
1344
1428
  type: 'array',
1345
1429
  items: {},
1346
1430
  minItems: 1,
1347
1431
  };
1432
+ jsonWithTypes.definitions.expand_node.properties.content.items = {};
1433
+ jsonWithTypes.definitions.bodiedExtension_node.properties.content.items = {};
1348
1434
  jsonWithTypes.definitions.table_cell_node.properties.content = {
1349
1435
  type: 'array',
1350
1436
  items: {},