@atlaskit/adf-schema 36.10.2 → 36.10.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 +12 -0
- package/dist/cjs/next-schema/nodes/mediaInline.js +1 -4
- package/dist/cjs/next-schema/nodes/mediaSingle.js +1 -2
- package/dist/es2019/next-schema/nodes/mediaInline.js +2 -5
- package/dist/es2019/next-schema/nodes/mediaSingle.js +1 -2
- package/dist/esm/next-schema/nodes/mediaInline.js +2 -5
- package/dist/esm/next-schema/nodes/mediaSingle.js +1 -2
- package/package.json +2 -2
- package/schema-generators/__tests__/unit/jqueries.md +26 -0
- package/schema-generators/__tests__/unit/json-full-schema.unit.ts +78 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 36.10.4
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- ec6b9e2: Add type field to content in JSON transformer for ADF DSL
|
8
|
+
|
9
|
+
## 36.10.3
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- b94c981: Add content field to JSON ADF transformer from ADF DSL
|
14
|
+
|
3
15
|
## 36.10.2
|
4
16
|
|
5
17
|
### 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 {
|
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
|
});
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import {
|
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
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "36.10.
|
3
|
+
"version": "36.10.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/"
|
@@ -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.
|
48
|
+
"@atlaskit/adf-schema-generator": "^1.7.9",
|
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,29 @@ 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
|
+
```
|
91
|
+
|
92
|
+
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.
|
93
|
+
|
94
|
+
All fields of content except for type have been deleted as well.
|
95
|
+
|
96
|
+
A number of nodes have `marks` defined, yet the array is empty. Assuming this is redundant, I've removed them.
|
97
|
+
|
98
|
+
```sh
|
99
|
+
cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(
|
100
|
+
.version, .required, .additionalProperties, .allOf, .minItems, .content.items, .content."$ref",
|
101
|
+
.block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
|
102
|
+
.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
|
103
|
+
```
|
@@ -46,6 +46,9 @@ const jsonWithTypes = {
|
|
46
46
|
type: {
|
47
47
|
enum: ['codeBlock'],
|
48
48
|
},
|
49
|
+
content: {
|
50
|
+
type: 'array',
|
51
|
+
},
|
49
52
|
attrs: {
|
50
53
|
type: 'object',
|
51
54
|
properties: {
|
@@ -677,6 +680,9 @@ const jsonWithTypes = {
|
|
677
680
|
type: {
|
678
681
|
enum: ['paragraph'],
|
679
682
|
},
|
683
|
+
content: {
|
684
|
+
type: 'array',
|
685
|
+
},
|
680
686
|
},
|
681
687
|
},
|
682
688
|
paragraph_with_no_marks_node: {},
|
@@ -688,6 +694,9 @@ const jsonWithTypes = {
|
|
688
694
|
type: {
|
689
695
|
enum: ['caption'],
|
690
696
|
},
|
697
|
+
content: {
|
698
|
+
type: 'array',
|
699
|
+
},
|
691
700
|
},
|
692
701
|
},
|
693
702
|
mediaSingle_node: {
|
@@ -763,6 +772,9 @@ const jsonWithTypes = {
|
|
763
772
|
type: {
|
764
773
|
enum: ['taskItem'],
|
765
774
|
},
|
775
|
+
content: {
|
776
|
+
type: 'array',
|
777
|
+
},
|
766
778
|
attrs: {
|
767
779
|
type: 'object',
|
768
780
|
properties: {
|
@@ -782,6 +794,9 @@ const jsonWithTypes = {
|
|
782
794
|
type: {
|
783
795
|
enum: ['taskList'],
|
784
796
|
},
|
797
|
+
content: {
|
798
|
+
type: 'array',
|
799
|
+
},
|
785
800
|
attrs: {
|
786
801
|
type: 'object',
|
787
802
|
properties: {
|
@@ -798,6 +813,9 @@ const jsonWithTypes = {
|
|
798
813
|
type: {
|
799
814
|
enum: ['listItem'],
|
800
815
|
},
|
816
|
+
content: {
|
817
|
+
type: 'array',
|
818
|
+
},
|
801
819
|
},
|
802
820
|
},
|
803
821
|
bulletList_node: {
|
@@ -806,6 +824,9 @@ const jsonWithTypes = {
|
|
806
824
|
type: {
|
807
825
|
enum: ['bulletList'],
|
808
826
|
},
|
827
|
+
content: {
|
828
|
+
type: 'array',
|
829
|
+
},
|
809
830
|
},
|
810
831
|
},
|
811
832
|
orderedList_node: {
|
@@ -814,6 +835,9 @@ const jsonWithTypes = {
|
|
814
835
|
type: {
|
815
836
|
enum: ['orderedList'],
|
816
837
|
},
|
838
|
+
content: {
|
839
|
+
type: 'array',
|
840
|
+
},
|
817
841
|
attrs: {
|
818
842
|
type: 'object',
|
819
843
|
properties: {
|
@@ -831,6 +855,9 @@ const jsonWithTypes = {
|
|
831
855
|
type: {
|
832
856
|
enum: ['heading'],
|
833
857
|
},
|
858
|
+
content: {
|
859
|
+
type: 'array',
|
860
|
+
},
|
834
861
|
attrs: {
|
835
862
|
type: 'object',
|
836
863
|
properties: {
|
@@ -852,6 +879,9 @@ const jsonWithTypes = {
|
|
852
879
|
type: {
|
853
880
|
enum: ['mediaGroup'],
|
854
881
|
},
|
882
|
+
content: {
|
883
|
+
type: 'array',
|
884
|
+
},
|
855
885
|
},
|
856
886
|
},
|
857
887
|
decisionItem_node: {
|
@@ -860,6 +890,9 @@ const jsonWithTypes = {
|
|
860
890
|
type: {
|
861
891
|
enum: ['decisionItem'],
|
862
892
|
},
|
893
|
+
content: {
|
894
|
+
type: 'array',
|
895
|
+
},
|
863
896
|
attrs: {
|
864
897
|
type: 'object',
|
865
898
|
properties: {
|
@@ -879,6 +912,9 @@ const jsonWithTypes = {
|
|
879
912
|
type: {
|
880
913
|
enum: ['decisionList'],
|
881
914
|
},
|
915
|
+
content: {
|
916
|
+
type: 'array',
|
917
|
+
},
|
882
918
|
attrs: {
|
883
919
|
type: 'object',
|
884
920
|
properties: {
|
@@ -931,6 +967,9 @@ const jsonWithTypes = {
|
|
931
967
|
},
|
932
968
|
},
|
933
969
|
},
|
970
|
+
content: {
|
971
|
+
type: 'array',
|
972
|
+
},
|
934
973
|
},
|
935
974
|
},
|
936
975
|
blockquote_node: {
|
@@ -939,6 +978,9 @@ const jsonWithTypes = {
|
|
939
978
|
type: {
|
940
979
|
enum: ['blockquote'],
|
941
980
|
},
|
981
|
+
content: {
|
982
|
+
type: 'array',
|
983
|
+
},
|
942
984
|
},
|
943
985
|
},
|
944
986
|
extension_node: {
|
@@ -1026,6 +1068,7 @@ const jsonWithTypes = {
|
|
1026
1068
|
},
|
1027
1069
|
},
|
1028
1070
|
},
|
1071
|
+
content: {},
|
1029
1072
|
},
|
1030
1073
|
},
|
1031
1074
|
nestedExpand_with_no_marks_node: {},
|
@@ -1063,6 +1106,9 @@ const jsonWithTypes = {
|
|
1063
1106
|
},
|
1064
1107
|
},
|
1065
1108
|
},
|
1109
|
+
content: {
|
1110
|
+
type: 'array',
|
1111
|
+
},
|
1066
1112
|
marks: {
|
1067
1113
|
type: 'array',
|
1068
1114
|
items: {
|
@@ -1077,6 +1123,9 @@ const jsonWithTypes = {
|
|
1077
1123
|
type: {
|
1078
1124
|
enum: ['tableRow'],
|
1079
1125
|
},
|
1126
|
+
content: {
|
1127
|
+
type: 'array',
|
1128
|
+
},
|
1080
1129
|
},
|
1081
1130
|
},
|
1082
1131
|
table_cell_node: {
|
@@ -1105,6 +1154,7 @@ const jsonWithTypes = {
|
|
1105
1154
|
},
|
1106
1155
|
},
|
1107
1156
|
},
|
1157
|
+
content: {},
|
1108
1158
|
},
|
1109
1159
|
},
|
1110
1160
|
table_header_node: {
|
@@ -1133,6 +1183,7 @@ const jsonWithTypes = {
|
|
1133
1183
|
},
|
1134
1184
|
},
|
1135
1185
|
},
|
1186
|
+
content: {},
|
1136
1187
|
},
|
1137
1188
|
},
|
1138
1189
|
expand_node: {
|
@@ -1149,6 +1200,9 @@ const jsonWithTypes = {
|
|
1149
1200
|
},
|
1150
1201
|
},
|
1151
1202
|
},
|
1203
|
+
content: {
|
1204
|
+
type: 'array',
|
1205
|
+
},
|
1152
1206
|
},
|
1153
1207
|
},
|
1154
1208
|
expand_with_no_mark_node: {},
|
@@ -1183,6 +1237,9 @@ const jsonWithTypes = {
|
|
1183
1237
|
},
|
1184
1238
|
},
|
1185
1239
|
},
|
1240
|
+
content: {
|
1241
|
+
type: 'array',
|
1242
|
+
},
|
1186
1243
|
},
|
1187
1244
|
},
|
1188
1245
|
bodiedExtension_with_marks_node: {},
|
@@ -1202,6 +1259,9 @@ const jsonWithTypes = {
|
|
1202
1259
|
},
|
1203
1260
|
},
|
1204
1261
|
},
|
1262
|
+
content: {
|
1263
|
+
type: 'array',
|
1264
|
+
},
|
1205
1265
|
},
|
1206
1266
|
},
|
1207
1267
|
layoutSection_node: {
|
@@ -1216,6 +1276,9 @@ const jsonWithTypes = {
|
|
1216
1276
|
$ref: '#/definitions/breakout_mark',
|
1217
1277
|
},
|
1218
1278
|
},
|
1279
|
+
content: {
|
1280
|
+
type: 'array',
|
1281
|
+
},
|
1219
1282
|
},
|
1220
1283
|
},
|
1221
1284
|
layoutSection_full_node: {},
|
@@ -1225,7 +1288,22 @@ const jsonWithTypes = {
|
|
1225
1288
|
type: {
|
1226
1289
|
enum: ['doc'],
|
1227
1290
|
},
|
1291
|
+
content: {
|
1292
|
+
type: 'array',
|
1293
|
+
},
|
1228
1294
|
},
|
1229
1295
|
},
|
1230
1296
|
},
|
1231
1297
|
};
|
1298
|
+
|
1299
|
+
// New JSON, different to the old JSON schema
|
1300
|
+
jsonWithTypes.definitions.heading_node.properties.content = { type: 'array' };
|
1301
|
+
jsonWithTypes.definitions.nestedExpand_node.properties.content = {
|
1302
|
+
type: 'array',
|
1303
|
+
};
|
1304
|
+
jsonWithTypes.definitions.table_cell_node.properties.content = {
|
1305
|
+
type: 'array',
|
1306
|
+
};
|
1307
|
+
jsonWithTypes.definitions.table_header_node.properties.content = {
|
1308
|
+
type: 'array',
|
1309
|
+
};
|