@atlaskit/adf-schema 37.1.41 → 37.1.43
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/groups/atomicInlineGroup.js +19 -0
- package/dist/cjs/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/cjs/next-schema/nodes/nestedExpand.js +1 -1
- package/dist/cjs/next-schema/nodes/paragraph.js +2 -1
- package/dist/cjs/next-schema/nodes/tableCellContent.js +1 -1
- package/dist/cjs/validator-schema/generated/validatorSpec.js +59 -63
- package/dist/es2019/next-schema/groups/atomicInlineGroup.js +13 -0
- package/dist/es2019/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/es2019/next-schema/nodes/nestedExpand.js +1 -1
- package/dist/es2019/next-schema/nodes/paragraph.js +2 -1
- package/dist/es2019/next-schema/nodes/tableCellContent.js +1 -1
- package/dist/es2019/validator-schema/generated/validatorSpec.js +58 -62
- package/dist/esm/next-schema/groups/atomicInlineGroup.js +13 -0
- package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/esm/next-schema/nodes/nestedExpand.js +1 -1
- package/dist/esm/next-schema/nodes/paragraph.js +2 -1
- package/dist/esm/next-schema/nodes/tableCellContent.js +1 -1
- package/dist/esm/validator-schema/generated/validatorSpec.js +58 -62
- package/dist/types/next-schema/groups/atomicInlineGroup.d.ts +1 -0
- package/dist/types/next-schema/nodes/nestedExpand.d.ts +1 -1
- package/dist/types/validator-schema/generated/validatorSpec.d.ts +35 -39
- package/package.json +2 -2
- package/schema-generators/__tests__/unit/adfToValidatorSpecValidation.unit.ts +1 -7
- package/schema-generators/__tests__/unit/json-full-schema-backwards-compat.unit.ts +23 -46
@@ -146,8 +146,8 @@ export declare const codeBlock_with_marks: (string | {
|
|
146
146
|
props: {
|
147
147
|
marks: {
|
148
148
|
type: string;
|
149
|
-
items: string[];
|
150
149
|
optional: boolean;
|
150
|
+
items: string[];
|
151
151
|
};
|
152
152
|
};
|
153
153
|
})[];
|
@@ -206,8 +206,8 @@ export declare const mediaSingle: {
|
|
206
206
|
})[];
|
207
207
|
marks: {
|
208
208
|
type: string;
|
209
|
-
items: string[];
|
210
209
|
optional: boolean;
|
210
|
+
items: string[];
|
211
211
|
};
|
212
212
|
};
|
213
213
|
};
|
@@ -277,8 +277,8 @@ export declare const media: {
|
|
277
277
|
})[];
|
278
278
|
marks: {
|
279
279
|
type: string;
|
280
|
-
items: string[][];
|
281
280
|
optional: boolean;
|
281
|
+
items: string[][];
|
282
282
|
};
|
283
283
|
};
|
284
284
|
required: string[];
|
@@ -420,8 +420,8 @@ export declare const mention: {
|
|
420
420
|
};
|
421
421
|
marks: {
|
422
422
|
type: string;
|
423
|
-
items: string[];
|
424
423
|
optional: boolean;
|
424
|
+
items: string[];
|
425
425
|
};
|
426
426
|
};
|
427
427
|
};
|
@@ -448,8 +448,8 @@ export declare const emoji: {
|
|
448
448
|
};
|
449
449
|
marks: {
|
450
450
|
type: string;
|
451
|
-
items: string[];
|
452
451
|
optional: boolean;
|
452
|
+
items: string[];
|
453
453
|
};
|
454
454
|
};
|
455
455
|
};
|
@@ -469,8 +469,8 @@ export declare const date: {
|
|
469
469
|
};
|
470
470
|
marks: {
|
471
471
|
type: string;
|
472
|
-
items: string[];
|
473
472
|
optional: boolean;
|
473
|
+
items: string[];
|
474
474
|
};
|
475
475
|
};
|
476
476
|
};
|
@@ -547,8 +547,8 @@ export declare const status: {
|
|
547
547
|
};
|
548
548
|
marks: {
|
549
549
|
type: string;
|
550
|
-
items: string[];
|
551
550
|
optional: boolean;
|
551
|
+
items: string[];
|
552
552
|
};
|
553
553
|
};
|
554
554
|
};
|
@@ -556,8 +556,8 @@ export declare const formatted_text_inline: (string | {
|
|
556
556
|
props: {
|
557
557
|
marks: {
|
558
558
|
type: string;
|
559
|
-
items: string[][];
|
560
559
|
optional: boolean;
|
560
|
+
items: string[][];
|
561
561
|
};
|
562
562
|
};
|
563
563
|
})[];
|
@@ -565,8 +565,8 @@ export declare const code_inline: (string | {
|
|
565
565
|
props: {
|
566
566
|
marks: {
|
567
567
|
type: string;
|
568
|
-
items: string[][];
|
569
568
|
optional: boolean;
|
569
|
+
items: string[][];
|
570
570
|
};
|
571
571
|
};
|
572
572
|
})[];
|
@@ -725,8 +725,8 @@ export declare const link_text_inline: (string | {
|
|
725
725
|
props: {
|
726
726
|
marks: {
|
727
727
|
type: string;
|
728
|
-
items: string[];
|
729
728
|
optional: boolean;
|
729
|
+
items: string[];
|
730
730
|
};
|
731
731
|
};
|
732
732
|
})[];
|
@@ -772,8 +772,8 @@ export declare const inlineExtension_with_marks: (string | {
|
|
772
772
|
props: {
|
773
773
|
marks: {
|
774
774
|
type: string;
|
775
|
-
items: string[][];
|
776
775
|
optional: boolean;
|
776
|
+
items: string[][];
|
777
777
|
};
|
778
778
|
};
|
779
779
|
})[];
|
@@ -822,8 +822,8 @@ export declare const mediaInline: {
|
|
822
822
|
};
|
823
823
|
marks: {
|
824
824
|
type: string;
|
825
|
-
items: string[][];
|
826
825
|
optional: boolean;
|
826
|
+
items: string[][];
|
827
827
|
};
|
828
828
|
};
|
829
829
|
};
|
@@ -896,6 +896,7 @@ export declare const confluenceUnsupportedInline: {
|
|
896
896
|
};
|
897
897
|
};
|
898
898
|
};
|
899
|
+
export declare const atomic_inline: string[];
|
899
900
|
export declare const inline: string[];
|
900
901
|
export declare const paragraph: {
|
901
902
|
props: {
|
@@ -929,8 +930,8 @@ export declare const paragraph_with_alignment: (string | {
|
|
929
930
|
props: {
|
930
931
|
marks: {
|
931
932
|
type: string;
|
932
|
-
items: string[];
|
933
933
|
optional: boolean;
|
934
|
+
items: string[];
|
934
935
|
};
|
935
936
|
};
|
936
937
|
})[];
|
@@ -938,8 +939,8 @@ export declare const paragraph_with_indentation: (string | {
|
|
938
939
|
props: {
|
939
940
|
marks: {
|
940
941
|
type: string;
|
941
|
-
items: string[];
|
942
942
|
optional: boolean;
|
943
|
+
items: string[];
|
943
944
|
};
|
944
945
|
};
|
945
946
|
})[];
|
@@ -1212,8 +1213,8 @@ export declare const extension_with_marks: (string | {
|
|
1212
1213
|
props: {
|
1213
1214
|
marks: {
|
1214
1215
|
type: string;
|
1215
|
-
items: string[][];
|
1216
1216
|
optional: boolean;
|
1217
|
+
items: string[][];
|
1217
1218
|
};
|
1218
1219
|
};
|
1219
1220
|
})[];
|
@@ -1253,8 +1254,8 @@ export declare const heading_with_indentation: (string | {
|
|
1253
1254
|
props: {
|
1254
1255
|
marks: {
|
1255
1256
|
type: string;
|
1256
|
-
items: string[];
|
1257
1257
|
optional: boolean;
|
1258
|
+
items: string[];
|
1258
1259
|
};
|
1259
1260
|
};
|
1260
1261
|
})[];
|
@@ -1272,8 +1273,8 @@ export declare const heading_with_alignment: (string | {
|
|
1272
1273
|
props: {
|
1273
1274
|
marks: {
|
1274
1275
|
type: string;
|
1275
|
-
items: string[];
|
1276
1276
|
optional: boolean;
|
1277
|
+
items: string[];
|
1277
1278
|
};
|
1278
1279
|
};
|
1279
1280
|
})[];
|
@@ -1347,9 +1348,12 @@ export declare const panel_legacy: (string | {
|
|
1347
1348
|
};
|
1348
1349
|
};
|
1349
1350
|
})[];
|
1350
|
-
export declare const nestedExpand_content:
|
1351
|
-
|
1352
|
-
|
1351
|
+
export declare const nestedExpand_content: {
|
1352
|
+
type: string;
|
1353
|
+
items: string[][];
|
1354
|
+
minItems: number;
|
1355
|
+
allowUnsupportedBlock: boolean;
|
1356
|
+
};
|
1353
1357
|
export declare const nestedExpand_with_no_marks: (string | {
|
1354
1358
|
props: {
|
1355
1359
|
marks: {
|
@@ -1518,19 +1522,11 @@ export declare const tableHeader: {
|
|
1518
1522
|
};
|
1519
1523
|
required: string[];
|
1520
1524
|
};
|
1521
|
-
export declare const
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
};
|
1527
|
-
content: {
|
1528
|
-
type: string;
|
1529
|
-
items: string[][];
|
1530
|
-
minItems: number;
|
1531
|
-
allowUnsupportedBlock: boolean;
|
1532
|
-
};
|
1533
|
-
};
|
1525
|
+
export declare const tableCell_content: {
|
1526
|
+
type: string;
|
1527
|
+
items: string[][];
|
1528
|
+
minItems: number;
|
1529
|
+
allowUnsupportedBlock: boolean;
|
1534
1530
|
};
|
1535
1531
|
export declare const tableRow: {
|
1536
1532
|
props: {
|
@@ -1585,8 +1581,8 @@ export declare const table: {
|
|
1585
1581
|
};
|
1586
1582
|
marks: {
|
1587
1583
|
type: string;
|
1588
|
-
items: string[];
|
1589
1584
|
optional: boolean;
|
1585
|
+
items: string[];
|
1590
1586
|
};
|
1591
1587
|
};
|
1592
1588
|
};
|
@@ -1644,8 +1640,8 @@ export declare const bodiedExtension_with_marks: (string | {
|
|
1644
1640
|
props: {
|
1645
1641
|
marks: {
|
1646
1642
|
type: string;
|
1647
|
-
items: string[][];
|
1648
1643
|
optional: boolean;
|
1644
|
+
items: string[][];
|
1649
1645
|
};
|
1650
1646
|
};
|
1651
1647
|
})[];
|
@@ -1690,8 +1686,8 @@ export declare const expand_with_breakout_mark: (string | {
|
|
1690
1686
|
props: {
|
1691
1687
|
marks: {
|
1692
1688
|
type: string;
|
1693
|
-
items: string[];
|
1694
1689
|
optional: boolean;
|
1690
|
+
items: string[];
|
1695
1691
|
};
|
1696
1692
|
};
|
1697
1693
|
})[];
|
@@ -1746,8 +1742,8 @@ export declare const layoutSection: {
|
|
1746
1742
|
};
|
1747
1743
|
marks: {
|
1748
1744
|
type: string;
|
1749
|
-
items: string[];
|
1750
1745
|
optional: boolean;
|
1746
|
+
items: string[];
|
1751
1747
|
};
|
1752
1748
|
};
|
1753
1749
|
};
|
@@ -1762,8 +1758,8 @@ export declare const layoutSection_full: (string | {
|
|
1762
1758
|
};
|
1763
1759
|
marks: {
|
1764
1760
|
type: string;
|
1765
|
-
items: string[];
|
1766
1761
|
optional: boolean;
|
1762
|
+
items: string[];
|
1767
1763
|
};
|
1768
1764
|
type: {
|
1769
1765
|
type: string;
|
@@ -1804,8 +1800,8 @@ export declare const extensionFrame: {
|
|
1804
1800
|
};
|
1805
1801
|
marks: {
|
1806
1802
|
type: string;
|
1807
|
-
items: string[][];
|
1808
1803
|
optional: boolean;
|
1804
|
+
items: string[][];
|
1809
1805
|
};
|
1810
1806
|
};
|
1811
1807
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "37.1.
|
3
|
+
"version": "37.1.43",
|
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/"
|
@@ -48,7 +48,7 @@
|
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
50
|
"@atlassian/adf-schema-json": "^1.16.0",
|
51
|
-
"@atlaskit/adf-schema-generator": "^1.
|
51
|
+
"@atlaskit/adf-schema-generator": "^1.26.0",
|
52
52
|
"@atlaskit/adf-utils": "^19.2.2",
|
53
53
|
"@atlaskit/codemod-utils": "^4.2.4",
|
54
54
|
"@atlaskit/json-schema-generator": "^3.3.9",
|
@@ -4,11 +4,6 @@ import adfNode from '../../../src/next-schema/full-schema.adf';
|
|
4
4
|
import { sortNestedArrays } from '../../../src/validator-schema/utils/sortNestedArrays';
|
5
5
|
|
6
6
|
const newSpecs = sortNestedArrays(adfToValidatorSpec(adfNode));
|
7
|
-
const SKIP_LIST = [
|
8
|
-
'atomic_inline', // doesn't exist in the output, not even used anywhere...
|
9
|
-
'nestedExpand_content', // doesn't exist in the output, completely different format from other groups
|
10
|
-
'tableCell_content', // doesn't exist in the output, completely different format from other groups
|
11
|
-
];
|
12
7
|
|
13
8
|
const testCases = Object.entries(currentSpecs).map(([key, value]) => {
|
14
9
|
return {
|
@@ -19,8 +14,7 @@ const testCases = Object.entries(currentSpecs).map(([key, value]) => {
|
|
19
14
|
});
|
20
15
|
|
21
16
|
testCases.forEach(({ name, currentSpec, newSpec }) => {
|
22
|
-
|
23
|
-
testMethod(`should be able to handle ${name}`, () => {
|
17
|
+
it(`should be able to handle ${name}`, () => {
|
24
18
|
expect(newSpec).toEqual(currentSpec);
|
25
19
|
});
|
26
20
|
});
|
@@ -101,63 +101,40 @@ test('JSON Schema to ADF DSL backwards compatibility for full schema', () => {
|
|
101
101
|
expect(currentSchema).toBeBackwardsCompatibleWith(nextSchema);
|
102
102
|
});
|
103
103
|
|
104
|
-
const
|
105
|
-
'blockCard_node',
|
106
|
-
'block_content',
|
107
|
-
'bodiedExtension_node',
|
108
|
-
'bodiedExtension_with_marks_node',
|
109
|
-
'codeBlock_node',
|
110
|
-
'codeBlock_with_marks_node',
|
111
|
-
'codeBlock_with_no_marks_node',
|
112
|
-
'code_inline_node',
|
113
|
-
'date_node',
|
104
|
+
const DEFINITIONS_TO_SKIP_STAGE_0_BACKWARDS = [
|
114
105
|
'doc_node',
|
115
|
-
'emoji_node',
|
116
|
-
'expand_node',
|
117
|
-
'expand_with_breakout_mark_node',
|
118
|
-
'expand_with_no_mark_node',
|
119
|
-
'extensionFrame_node',
|
120
|
-
'extension_node',
|
121
|
-
'extension_with_marks_node',
|
122
|
-
'formatted_text_inline_node',
|
123
|
-
'heading_node',
|
124
|
-
'heading_with_alignment_node',
|
125
|
-
'heading_with_indentation_node',
|
126
|
-
'heading_with_no_marks_node',
|
127
106
|
'inlineCard_node',
|
128
|
-
'inlineExtension_node',
|
129
|
-
'inlineExtension_with_marks_node',
|
130
|
-
'inline_node',
|
131
|
-
'layoutSection_node',
|
132
|
-
'layoutSection_full_node',
|
133
107
|
'layoutSection_with_single_column_node',
|
134
|
-
'mediaInline_node',
|
135
|
-
'mediaSingle_caption_node',
|
136
|
-
'mediaSingle_full_node',
|
137
|
-
'mediaSingle_node',
|
138
|
-
'mention_node',
|
139
108
|
'multiBodiedExtension_node',
|
140
|
-
'nestedExpand_content',
|
141
|
-
'nestedExpand_node',
|
142
|
-
'nestedExpand_with_no_marks_node',
|
143
|
-
'non_nestable_block_content',
|
144
|
-
'paragraph_node',
|
145
|
-
'paragraph_with_alignment_node',
|
146
|
-
'paragraph_with_indentation_node',
|
147
|
-
'paragraph_with_no_marks_node',
|
148
|
-
'status_node',
|
149
|
-
'table_cell_content',
|
150
|
-
'table_cell_node',
|
151
|
-
'table_header_node',
|
152
|
-
'text_node',
|
153
109
|
];
|
154
110
|
test('ADF DSL to JSON Schema backwards compatibility for stage0 schema', () => {
|
155
111
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
156
112
|
const currentSchema = require('../../../json-schema/v1/stage-0.json');
|
157
113
|
const nextSchema = adfToJSON(adfNode);
|
158
|
-
|
114
|
+
DEFINITIONS_TO_SKIP_STAGE_0_BACKWARDS.forEach((definition) => {
|
159
115
|
nextSchema.definitions[definition] = currentSchema.definitions[definition];
|
160
116
|
});
|
161
117
|
|
162
118
|
expect(nextSchema).toBeBackwardsCompatibleWith(currentSchema);
|
163
119
|
});
|
120
|
+
|
121
|
+
const DEFINITIONS_TO_SKIP_STAGE_0_FORWARDS = [
|
122
|
+
'extensionFrame_node',
|
123
|
+
'inline_node',
|
124
|
+
'table_row_node',
|
125
|
+
'table_cell_content',
|
126
|
+
'codeBlock_node',
|
127
|
+
'codeBlock_with_marks_node',
|
128
|
+
'mediaInline_node',
|
129
|
+
'mediaGroup_node',
|
130
|
+
];
|
131
|
+
test('JSON Schema to ADF DSL backwards compatibility for stage0 schema', () => {
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
133
|
+
const currentSchema = require('../../../json-schema/v1/stage-0.json');
|
134
|
+
const nextSchema = adfToJSON(adfNode);
|
135
|
+
DEFINITIONS_TO_SKIP_STAGE_0_FORWARDS.forEach((definition) => {
|
136
|
+
currentSchema.definitions[definition] = nextSchema.definitions[definition];
|
137
|
+
});
|
138
|
+
|
139
|
+
expect(currentSchema).toBeBackwardsCompatibleWith(nextSchema);
|
140
|
+
});
|