@atlaskit/adf-schema 36.10.2 → 36.10.3

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.3
4
+
5
+ ### Patch Changes
6
+
7
+ - b94c981: Add content field to JSON ADF transformer from ADF DSL
8
+
3
9
  ## 36.10.2
4
10
 
5
11
  ### Patch Changes
@@ -8,8 +8,6 @@ var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  var _annotation = require("../marks/annotation");
9
9
  var _border = require("../marks/border");
10
10
  var _link = require("../marks/link");
11
- var _caption = require("./caption");
12
- var _media = require("./media");
13
11
  var mediaInline = exports.mediaInline = (0, _adfSchemaGenerator.adfNode)('mediaInline').define({
14
12
  selectable: true,
15
13
  atom: false,
@@ -78,6 +76,5 @@ var mediaInline = exports.mediaInline = (0, _adfSchemaGenerator.adfNode)('mediaI
78
76
  type: 'boolean',
79
77
  optional: true
80
78
  }
81
- },
82
- content: [(0, _adfSchemaGenerator.$or)(_media.media), (0, _adfSchemaGenerator.$or)(_caption.caption)]
79
+ }
83
80
  });
@@ -50,8 +50,7 @@ var mediaSingle = exports.mediaSingle = (0, _adfSchemaGenerator.adfNode)('mediaS
50
50
  optional: true
51
51
  }
52
52
  }]
53
- },
54
- content: [(0, _adfSchemaGenerator.$or)(_media.media)]
53
+ }
55
54
  }).variant('caption', {
56
55
  atom: false,
57
56
  content: [(0, _adfSchemaGenerator.$or)(_media.media), (0, _adfSchemaGenerator.$or)(_caption.caption)]
@@ -1,9 +1,7 @@
1
- import { $or, adfNode } from '@atlaskit/adf-schema-generator';
1
+ import { adfNode } from '@atlaskit/adf-schema-generator';
2
2
  import { annotation } from '../marks/annotation';
3
3
  import { border } from '../marks/border';
4
4
  import { link } from '../marks/link';
5
- import { caption } from './caption';
6
- import { media } from './media';
7
5
  export const mediaInline = adfNode('mediaInline').define({
8
6
  selectable: true,
9
7
  atom: false,
@@ -72,6 +70,5 @@ export const mediaInline = adfNode('mediaInline').define({
72
70
  type: 'boolean',
73
71
  optional: true
74
72
  }
75
- },
76
- content: [$or(media), $or(caption)]
73
+ }
77
74
  });
@@ -44,8 +44,7 @@ export const mediaSingle = adfNode('mediaSingle').define({
44
44
  optional: true
45
45
  }
46
46
  }]
47
- },
48
- content: [$or(media)]
47
+ }
49
48
  }).variant('caption', {
50
49
  atom: false,
51
50
  content: [$or(media), $or(caption)]
@@ -1,9 +1,7 @@
1
- import { $or, adfNode } from '@atlaskit/adf-schema-generator';
1
+ import { adfNode } from '@atlaskit/adf-schema-generator';
2
2
  import { annotation } from '../marks/annotation';
3
3
  import { border } from '../marks/border';
4
4
  import { link } from '../marks/link';
5
- import { caption } from './caption';
6
- import { media } from './media';
7
5
  export var mediaInline = adfNode('mediaInline').define({
8
6
  selectable: true,
9
7
  atom: false,
@@ -72,6 +70,5 @@ export var mediaInline = adfNode('mediaInline').define({
72
70
  type: 'boolean',
73
71
  optional: true
74
72
  }
75
- },
76
- content: [$or(media), $or(caption)]
73
+ }
77
74
  });
@@ -44,8 +44,7 @@ export var mediaSingle = adfNode('mediaSingle').define({
44
44
  optional: true
45
45
  }
46
46
  }]
47
- },
48
- content: [$or(media)]
47
+ }
49
48
  }).variant('caption', {
50
49
  atom: false,
51
50
  content: [$or(media), $or(caption)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.10.2",
3
+ "version": "36.10.3",
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.7.6",
48
+ "@atlaskit/adf-schema-generator": "^1.7.8",
49
49
  "@babel/cli": "^7.22.9",
50
50
  "@babel/core": "^7.22.9",
51
51
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -75,3 +75,16 @@ A number of nodes have `marks` defined, yet the array is empty. Assuming this is
75
75
  .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
76
76
  .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)'
77
77
  ```
78
+
79
+ Delete all subfields except for content, text, marks, attrs, anyOf, items, type and properties. Base level content objects (not nodes) are also deleted. `inline` is also deleted, as it is a content object for paragraph.
80
+
81
+ All fields of content have been deleted as well.
82
+
83
+ A number of nodes have `marks` defined, yet the array is empty. Assuming this is redundant, I've removed them.
84
+
85
+ ```sh
86
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(
87
+ .version, .required, .additionalProperties, .allOf, .minItems, .content.items, .content.type, .content."$ref",
88
+ .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
89
+ .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
90
+ ```
@@ -46,6 +46,7 @@ const jsonWithTypes = {
46
46
  type: {
47
47
  enum: ['codeBlock'],
48
48
  },
49
+ content: {},
49
50
  attrs: {
50
51
  type: 'object',
51
52
  properties: {
@@ -677,6 +678,7 @@ const jsonWithTypes = {
677
678
  type: {
678
679
  enum: ['paragraph'],
679
680
  },
681
+ content: {},
680
682
  },
681
683
  },
682
684
  paragraph_with_no_marks_node: {},
@@ -688,6 +690,7 @@ const jsonWithTypes = {
688
690
  type: {
689
691
  enum: ['caption'],
690
692
  },
693
+ content: {},
691
694
  },
692
695
  },
693
696
  mediaSingle_node: {
@@ -763,6 +766,7 @@ const jsonWithTypes = {
763
766
  type: {
764
767
  enum: ['taskItem'],
765
768
  },
769
+ content: {},
766
770
  attrs: {
767
771
  type: 'object',
768
772
  properties: {
@@ -782,6 +786,7 @@ const jsonWithTypes = {
782
786
  type: {
783
787
  enum: ['taskList'],
784
788
  },
789
+ content: {},
785
790
  attrs: {
786
791
  type: 'object',
787
792
  properties: {
@@ -798,6 +803,7 @@ const jsonWithTypes = {
798
803
  type: {
799
804
  enum: ['listItem'],
800
805
  },
806
+ content: {},
801
807
  },
802
808
  },
803
809
  bulletList_node: {
@@ -806,6 +812,7 @@ const jsonWithTypes = {
806
812
  type: {
807
813
  enum: ['bulletList'],
808
814
  },
815
+ content: {},
809
816
  },
810
817
  },
811
818
  orderedList_node: {
@@ -814,6 +821,7 @@ const jsonWithTypes = {
814
821
  type: {
815
822
  enum: ['orderedList'],
816
823
  },
824
+ content: {},
817
825
  attrs: {
818
826
  type: 'object',
819
827
  properties: {
@@ -831,6 +839,7 @@ const jsonWithTypes = {
831
839
  type: {
832
840
  enum: ['heading'],
833
841
  },
842
+ content: {},
834
843
  attrs: {
835
844
  type: 'object',
836
845
  properties: {
@@ -852,6 +861,7 @@ const jsonWithTypes = {
852
861
  type: {
853
862
  enum: ['mediaGroup'],
854
863
  },
864
+ content: {},
855
865
  },
856
866
  },
857
867
  decisionItem_node: {
@@ -860,6 +870,7 @@ const jsonWithTypes = {
860
870
  type: {
861
871
  enum: ['decisionItem'],
862
872
  },
873
+ content: {},
863
874
  attrs: {
864
875
  type: 'object',
865
876
  properties: {
@@ -879,6 +890,7 @@ const jsonWithTypes = {
879
890
  type: {
880
891
  enum: ['decisionList'],
881
892
  },
893
+ content: {},
882
894
  attrs: {
883
895
  type: 'object',
884
896
  properties: {
@@ -931,6 +943,7 @@ const jsonWithTypes = {
931
943
  },
932
944
  },
933
945
  },
946
+ content: {},
934
947
  },
935
948
  },
936
949
  blockquote_node: {
@@ -939,6 +952,7 @@ const jsonWithTypes = {
939
952
  type: {
940
953
  enum: ['blockquote'],
941
954
  },
955
+ content: {},
942
956
  },
943
957
  },
944
958
  extension_node: {
@@ -1026,6 +1040,7 @@ const jsonWithTypes = {
1026
1040
  },
1027
1041
  },
1028
1042
  },
1043
+ content: {},
1029
1044
  },
1030
1045
  },
1031
1046
  nestedExpand_with_no_marks_node: {},
@@ -1063,6 +1078,7 @@ const jsonWithTypes = {
1063
1078
  },
1064
1079
  },
1065
1080
  },
1081
+ content: {},
1066
1082
  marks: {
1067
1083
  type: 'array',
1068
1084
  items: {
@@ -1077,6 +1093,7 @@ const jsonWithTypes = {
1077
1093
  type: {
1078
1094
  enum: ['tableRow'],
1079
1095
  },
1096
+ content: {},
1080
1097
  },
1081
1098
  },
1082
1099
  table_cell_node: {
@@ -1105,6 +1122,7 @@ const jsonWithTypes = {
1105
1122
  },
1106
1123
  },
1107
1124
  },
1125
+ content: {},
1108
1126
  },
1109
1127
  },
1110
1128
  table_header_node: {
@@ -1133,6 +1151,7 @@ const jsonWithTypes = {
1133
1151
  },
1134
1152
  },
1135
1153
  },
1154
+ content: {},
1136
1155
  },
1137
1156
  },
1138
1157
  expand_node: {
@@ -1149,6 +1168,7 @@ const jsonWithTypes = {
1149
1168
  },
1150
1169
  },
1151
1170
  },
1171
+ content: {},
1152
1172
  },
1153
1173
  },
1154
1174
  expand_with_no_mark_node: {},
@@ -1183,6 +1203,7 @@ const jsonWithTypes = {
1183
1203
  },
1184
1204
  },
1185
1205
  },
1206
+ content: {},
1186
1207
  },
1187
1208
  },
1188
1209
  bodiedExtension_with_marks_node: {},
@@ -1202,6 +1223,7 @@ const jsonWithTypes = {
1202
1223
  },
1203
1224
  },
1204
1225
  },
1226
+ content: {},
1205
1227
  },
1206
1228
  },
1207
1229
  layoutSection_node: {
@@ -1216,6 +1238,7 @@ const jsonWithTypes = {
1216
1238
  $ref: '#/definitions/breakout_mark',
1217
1239
  },
1218
1240
  },
1241
+ content: {},
1219
1242
  },
1220
1243
  },
1221
1244
  layoutSection_full_node: {},
@@ -1225,6 +1248,7 @@ const jsonWithTypes = {
1225
1248
  type: {
1226
1249
  enum: ['doc'],
1227
1250
  },
1251
+ content: {},
1228
1252
  },
1229
1253
  },
1230
1254
  },