@atlaskit/adf-schema 36.15.0 → 36.17.0

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/next-schema/full-schema.adf.js +1 -5
  3. package/dist/cjs/next-schema/generated/markTypes.js +19 -19
  4. package/dist/cjs/next-schema/generated/nodeTypes.js +422 -316
  5. package/dist/cjs/next-schema/groups/blockGroup.js +1 -5
  6. package/dist/cjs/next-schema/groups/blockRootOnlyGroup.js +2 -1
  7. package/dist/cjs/next-schema/groups/inlineGroup.js +3 -1
  8. package/dist/cjs/next-schema/nodes/blockCard.js +1 -0
  9. package/dist/cjs/next-schema/nodes/bodiedExtension.js +1 -0
  10. package/dist/cjs/next-schema/nodes/codeBlock.js +5 -0
  11. package/dist/cjs/next-schema/nodes/confluenceJiraIssue.js +38 -0
  12. package/dist/cjs/next-schema/nodes/decisionItem.js +1 -2
  13. package/dist/cjs/next-schema/nodes/extension.js +1 -0
  14. package/dist/cjs/next-schema/nodes/extensionFrame.js +3 -1
  15. package/dist/cjs/next-schema/nodes/heading.js +1 -2
  16. package/dist/cjs/next-schema/nodes/image.js +28 -0
  17. package/dist/cjs/next-schema/nodes/inlineCard.js +1 -0
  18. package/dist/cjs/next-schema/nodes/inlineExtension.js +1 -0
  19. package/dist/cjs/next-schema/nodes/mediaGroup.js +2 -0
  20. package/dist/cjs/next-schema/nodes/mediaInline.js +0 -3
  21. package/dist/cjs/next-schema/nodes/mediaSingle.js +1 -1
  22. package/dist/cjs/next-schema/nodes/multiBodiedExtension.js +1 -0
  23. package/dist/cjs/next-schema/nodes/paragraph.js +1 -2
  24. package/dist/cjs/next-schema/nodes/status.js +1 -0
  25. package/dist/cjs/next-schema/nodes/table.js +1 -1
  26. package/dist/cjs/next-schema/nodes/task.js +1 -2
  27. package/dist/cjs/schema/create-schema.js +21 -0
  28. package/dist/cjs/schema/nodes/multi-bodied-extension.js +0 -2
  29. package/dist/cjs/schema/nodes/paragraph.js +2 -2
  30. package/dist/es2019/next-schema/full-schema.adf.js +1 -5
  31. package/dist/es2019/next-schema/generated/markTypes.js +19 -19
  32. package/dist/es2019/next-schema/generated/nodeTypes.js +421 -315
  33. package/dist/es2019/next-schema/groups/blockGroup.js +1 -5
  34. package/dist/es2019/next-schema/groups/blockRootOnlyGroup.js +2 -1
  35. package/dist/es2019/next-schema/groups/inlineGroup.js +3 -1
  36. package/dist/es2019/next-schema/nodes/blockCard.js +1 -0
  37. package/dist/es2019/next-schema/nodes/bodiedExtension.js +1 -0
  38. package/dist/es2019/next-schema/nodes/codeBlock.js +5 -0
  39. package/dist/es2019/next-schema/nodes/confluenceJiraIssue.js +32 -0
  40. package/dist/es2019/next-schema/nodes/decisionItem.js +1 -2
  41. package/dist/es2019/next-schema/nodes/extension.js +1 -0
  42. package/dist/es2019/next-schema/nodes/extensionFrame.js +3 -1
  43. package/dist/es2019/next-schema/nodes/heading.js +1 -2
  44. package/dist/es2019/next-schema/nodes/image.js +22 -0
  45. package/dist/es2019/next-schema/nodes/inlineCard.js +1 -0
  46. package/dist/es2019/next-schema/nodes/inlineExtension.js +1 -0
  47. package/dist/es2019/next-schema/nodes/mediaGroup.js +2 -0
  48. package/dist/es2019/next-schema/nodes/mediaInline.js +0 -3
  49. package/dist/es2019/next-schema/nodes/mediaSingle.js +1 -1
  50. package/dist/es2019/next-schema/nodes/multiBodiedExtension.js +1 -0
  51. package/dist/es2019/next-schema/nodes/paragraph.js +1 -2
  52. package/dist/es2019/next-schema/nodes/status.js +1 -0
  53. package/dist/es2019/next-schema/nodes/table.js +1 -1
  54. package/dist/es2019/next-schema/nodes/task.js +1 -2
  55. package/dist/es2019/schema/create-schema.js +22 -0
  56. package/dist/es2019/schema/nodes/multi-bodied-extension.js +0 -2
  57. package/dist/es2019/schema/nodes/paragraph.js +2 -2
  58. package/dist/esm/next-schema/full-schema.adf.js +1 -5
  59. package/dist/esm/next-schema/generated/markTypes.js +19 -19
  60. package/dist/esm/next-schema/generated/nodeTypes.js +421 -315
  61. package/dist/esm/next-schema/groups/blockGroup.js +1 -5
  62. package/dist/esm/next-schema/groups/blockRootOnlyGroup.js +2 -1
  63. package/dist/esm/next-schema/groups/inlineGroup.js +3 -1
  64. package/dist/esm/next-schema/nodes/blockCard.js +1 -0
  65. package/dist/esm/next-schema/nodes/bodiedExtension.js +1 -0
  66. package/dist/esm/next-schema/nodes/codeBlock.js +5 -0
  67. package/dist/esm/next-schema/nodes/confluenceJiraIssue.js +32 -0
  68. package/dist/esm/next-schema/nodes/decisionItem.js +1 -2
  69. package/dist/esm/next-schema/nodes/extension.js +1 -0
  70. package/dist/esm/next-schema/nodes/extensionFrame.js +3 -1
  71. package/dist/esm/next-schema/nodes/heading.js +1 -2
  72. package/dist/esm/next-schema/nodes/image.js +22 -0
  73. package/dist/esm/next-schema/nodes/inlineCard.js +1 -0
  74. package/dist/esm/next-schema/nodes/inlineExtension.js +1 -0
  75. package/dist/esm/next-schema/nodes/mediaGroup.js +2 -0
  76. package/dist/esm/next-schema/nodes/mediaInline.js +0 -3
  77. package/dist/esm/next-schema/nodes/mediaSingle.js +1 -1
  78. package/dist/esm/next-schema/nodes/multiBodiedExtension.js +1 -0
  79. package/dist/esm/next-schema/nodes/paragraph.js +1 -2
  80. package/dist/esm/next-schema/nodes/status.js +1 -0
  81. package/dist/esm/next-schema/nodes/table.js +1 -1
  82. package/dist/esm/next-schema/nodes/task.js +1 -2
  83. package/dist/esm/schema/create-schema.js +20 -0
  84. package/dist/esm/schema/nodes/multi-bodied-extension.js +0 -2
  85. package/dist/esm/schema/nodes/paragraph.js +2 -2
  86. package/dist/types/next-schema/generated/markTypes.d.ts +24 -24
  87. package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +6 -4
  88. package/dist/types/next-schema/generated/nodeTypes.d.ts +342 -246
  89. package/dist/types/next-schema/nodes/confluenceJiraIssue.d.ts +22 -0
  90. package/dist/types/next-schema/nodes/image.d.ts +22 -0
  91. package/dist/types/schema/create-schema.d.ts +4 -0
  92. package/package.json +2 -2
  93. package/schema-generators/__tests__/unit/json-full-schema.unit.ts +303 -20
  94. package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +21 -30
@@ -0,0 +1,22 @@
1
+ export declare const confluenceJiraIssue: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
2
+ ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
3
+ root?: boolean;
4
+ atom?: boolean;
5
+ version?: 1;
6
+ attrs?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFAttribute").ADFAttributes;
7
+ inline?: true;
8
+ code?: boolean;
9
+ content?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentSpec[];
10
+ defining?: boolean;
11
+ definingAsContext?: boolean;
12
+ definingForContent?: boolean;
13
+ draggable?: boolean;
14
+ group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
15
+ isolating?: boolean;
16
+ marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
17
+ allowAnyChildMark?: boolean;
18
+ allowNoChildMark?: boolean;
19
+ selectable?: boolean;
20
+ whitespace?: "pre" | "normal";
21
+ tableRole?: "table" | "row" | "cell" | "header_cell";
22
+ }>;
@@ -0,0 +1,22 @@
1
+ export declare const image: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
2
+ ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
3
+ root?: boolean;
4
+ atom?: boolean;
5
+ version?: 1;
6
+ attrs?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFAttribute").ADFAttributes;
7
+ inline?: true;
8
+ code?: boolean;
9
+ content?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentSpec[];
10
+ defining?: boolean;
11
+ definingAsContext?: boolean;
12
+ definingForContent?: boolean;
13
+ draggable?: boolean;
14
+ group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
15
+ isolating?: boolean;
16
+ marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
17
+ allowAnyChildMark?: boolean;
18
+ allowNoChildMark?: boolean;
19
+ selectable?: boolean;
20
+ whitespace?: "pre" | "normal";
21
+ tableRole?: "table" | "row" | "cell" | "header_cell";
22
+ }>;
@@ -1,4 +1,8 @@
1
1
  import { NodeSpec, MarkSpec, Schema } from '@atlaskit/editor-prosemirror/model';
2
+ export declare function getNodesAndMarksMap(): {
3
+ nodes: Record<string, NodeSpec>;
4
+ marks: Record<string, MarkSpec>;
5
+ };
2
6
  /**
3
7
  * Creates a schema preserving order of marks and nodes.
4
8
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.15.0",
3
+ "version": "36.17.0",
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.14.0",
47
+ "@atlaskit/adf-schema-generator": "^1.16.0",
48
48
  "@atlaskit/codemod-utils": "^4.2.4",
49
49
  "@atlaskit/json-schema-generator": "^3.3.9",
50
50
  "@babel/cli": "^7.22.9",
@@ -144,7 +144,9 @@ const jsonWithTypes = {
144
144
  {
145
145
  additionalProperties: false,
146
146
  properties: {
147
- data: {},
147
+ data: {
148
+ type: 'object',
149
+ },
148
150
  },
149
151
  required: ['data'],
150
152
  type: 'object',
@@ -186,6 +188,103 @@ const jsonWithTypes = {
186
188
  type: 'object',
187
189
  },
188
190
  blockquote_with_list_node: {},
191
+ bodiedExtension_node: {
192
+ additionalProperties: false,
193
+ properties: {
194
+ attrs: {
195
+ additionalProperties: false,
196
+ properties: {
197
+ extensionKey: {
198
+ minLength: 1,
199
+ type: 'string',
200
+ },
201
+ extensionType: {
202
+ minLength: 1,
203
+ type: 'string',
204
+ },
205
+ layout: {
206
+ enum: ['wide', 'full-width', 'default'],
207
+ },
208
+ localId: {
209
+ minLength: 1,
210
+ type: 'string',
211
+ },
212
+ parameters: {
213
+ type: 'object',
214
+ },
215
+ text: {
216
+ type: 'string',
217
+ },
218
+ },
219
+ required: ['extensionKey', 'extensionType'],
220
+ type: 'object',
221
+ },
222
+ content: {
223
+ items: {
224
+ anyOf: [
225
+ {
226
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
227
+ },
228
+ {
229
+ $ref: '#/definitions/blockCard_node',
230
+ },
231
+ {
232
+ $ref: '#/definitions/paragraph_with_no_marks_node',
233
+ },
234
+ {
235
+ $ref: '#/definitions/mediaSingle_caption_node',
236
+ },
237
+ {
238
+ $ref: '#/definitions/mediaSingle_full_node',
239
+ },
240
+ {
241
+ $ref: '#/definitions/taskList_node',
242
+ },
243
+ {
244
+ $ref: '#/definitions/bulletList_node',
245
+ },
246
+ {
247
+ $ref: '#/definitions/orderedList_node',
248
+ },
249
+ {
250
+ $ref: '#/definitions/heading_with_no_marks_node',
251
+ },
252
+ {
253
+ $ref: '#/definitions/mediaGroup_node',
254
+ },
255
+ {
256
+ $ref: '#/definitions/decisionList_node',
257
+ },
258
+ {
259
+ $ref: '#/definitions/rule_node',
260
+ },
261
+ {
262
+ $ref: '#/definitions/panel_node',
263
+ },
264
+ {
265
+ $ref: '#/definitions/blockquote_node',
266
+ },
267
+ {
268
+ $ref: '#/definitions/extension_with_marks_node',
269
+ },
270
+ {
271
+ $ref: '#/definitions/embedCard_node',
272
+ },
273
+ {
274
+ $ref: '#/definitions/table_node',
275
+ },
276
+ ],
277
+ },
278
+ minItems: 1,
279
+ type: 'array',
280
+ },
281
+ type: {
282
+ enum: ['bodiedExtension'],
283
+ },
284
+ },
285
+ required: ['type', 'attrs', 'content'],
286
+ type: 'object',
287
+ },
189
288
  bodiedExtension_with_marks_node: {},
190
289
  border_mark: {
191
290
  additionalProperties: false,
@@ -295,7 +394,32 @@ const jsonWithTypes = {
295
394
  required: ['type', 'content'],
296
395
  type: 'object',
297
396
  },
298
- codeBlock_with_marks_node: {},
397
+ codeBlock_node: {
398
+ additionalProperties: false,
399
+ properties: {
400
+ attrs: {
401
+ additionalProperties: false,
402
+ properties: {
403
+ language: {
404
+ type: 'string',
405
+ },
406
+ uniqueId: {
407
+ type: 'string',
408
+ },
409
+ },
410
+ type: 'object',
411
+ },
412
+ content: {
413
+ items: {},
414
+ type: 'array',
415
+ },
416
+ type: {
417
+ enum: ['codeBlock'],
418
+ },
419
+ },
420
+ required: ['type'],
421
+ type: 'object',
422
+ },
299
423
  codeBlock_with_no_marks_node: {},
300
424
  code_inline_node: {},
301
425
  code_mark: {
@@ -422,19 +546,7 @@ const jsonWithTypes = {
422
546
  $ref: '#/definitions/layoutSection_node',
423
547
  },
424
548
  {
425
- $ref: '#/definitions/layoutSection_full_node',
426
- },
427
- {
428
- $ref: '#/definitions/expand_with_breakout_mark_node',
429
- },
430
- {
431
- $ref: '#/definitions/codeBlock_with_no_marks_node',
432
- },
433
- {
434
- $ref: '#/definitions/codeBlock_with_marks_node',
435
- },
436
- {
437
- $ref: '#/definitions/paragraph_with_indentation_node',
549
+ $ref: '#/definitions/blockRootOnly_node',
438
550
  },
439
551
  ],
440
552
  },
@@ -528,8 +640,132 @@ const jsonWithTypes = {
528
640
  required: ['type', 'attrs'],
529
641
  type: 'object',
530
642
  },
531
- expand_with_breakout_mark_node: {},
532
643
  expand_with_no_mark_node: {},
644
+ extensionFrame_node: {
645
+ additionalProperties: false,
646
+ properties: {
647
+ attrs: {
648
+ additionalProperties: false,
649
+ properties: {},
650
+ type: 'object',
651
+ },
652
+ content: {
653
+ items: {
654
+ anyOf: [
655
+ {
656
+ $ref: '#/definitions/bodiedExtension_node',
657
+ },
658
+ {
659
+ $ref: '#/definitions/panel_node',
660
+ },
661
+ {
662
+ $ref: '#/definitions/paragraph_node',
663
+ },
664
+ {
665
+ $ref: '#/definitions/blockquote_node',
666
+ },
667
+ {
668
+ $ref: '#/definitions/orderedList_node',
669
+ },
670
+ {
671
+ $ref: '#/definitions/bulletList_node',
672
+ },
673
+ {
674
+ $ref: '#/definitions/rule_node',
675
+ },
676
+ {
677
+ $ref: '#/definitions/heading_node',
678
+ },
679
+ {
680
+ $ref: '#/definitions/codeBlock_node',
681
+ },
682
+ {
683
+ $ref: '#/definitions/mediaGroup_node',
684
+ },
685
+ {
686
+ $ref: '#/definitions/mediaSingle_node',
687
+ },
688
+ {
689
+ $ref: '#/definitions/decisionList_node',
690
+ },
691
+ {
692
+ $ref: '#/definitions/taskList_node',
693
+ },
694
+ {
695
+ $ref: '#/definitions/table_node',
696
+ },
697
+ {
698
+ $ref: '#/definitions/extension_node',
699
+ },
700
+ {
701
+ $ref: '#/definitions/blockCard_node',
702
+ },
703
+ {
704
+ $ref: '#/definitions/embedCard_node',
705
+ },
706
+ ],
707
+ },
708
+ minItems: 1,
709
+ type: 'array',
710
+ },
711
+ marks: {
712
+ items: {
713
+ anyOf: [
714
+ {
715
+ $ref: '#/definitions/dataConsumer_mark',
716
+ },
717
+ {
718
+ $ref: '#/definitions/fragment_mark',
719
+ },
720
+ ],
721
+ },
722
+ type: 'array',
723
+ },
724
+ type: {
725
+ enum: ['extensionFrame'],
726
+ },
727
+ },
728
+ required: ['type', 'content'],
729
+ type: 'object',
730
+ },
731
+ extension_node: {
732
+ additionalProperties: false,
733
+ properties: {
734
+ attrs: {
735
+ additionalProperties: false,
736
+ properties: {
737
+ extensionKey: {
738
+ minLength: 1,
739
+ type: 'string',
740
+ },
741
+ extensionType: {
742
+ minLength: 1,
743
+ type: 'string',
744
+ },
745
+ layout: {
746
+ enum: ['wide', 'full-width', 'default'],
747
+ },
748
+ localId: {
749
+ minLength: 1,
750
+ type: 'string',
751
+ },
752
+ parameters: {
753
+ type: 'object',
754
+ },
755
+ text: {
756
+ type: 'string',
757
+ },
758
+ },
759
+ required: ['extensionKey', 'extensionType'],
760
+ type: 'object',
761
+ },
762
+ type: {
763
+ enum: ['extension'],
764
+ },
765
+ },
766
+ required: ['type', 'attrs'],
767
+ type: 'object',
768
+ },
533
769
  extension_with_marks_node: {},
534
770
  formatted_text_inline_node: {},
535
771
  fragment_mark: {
@@ -646,7 +882,9 @@ const jsonWithTypes = {
646
882
  {
647
883
  additionalProperties: false,
648
884
  properties: {
649
- data: {},
885
+ data: {
886
+ type: 'object',
887
+ },
650
888
  },
651
889
  required: ['data'],
652
890
  type: 'object',
@@ -690,7 +928,6 @@ const jsonWithTypes = {
690
928
  required: ['type', 'attrs', 'content'],
691
929
  type: 'object',
692
930
  },
693
- layoutSection_full_node: {},
694
931
  layoutSection_node: {
695
932
  additionalProperties: false,
696
933
  properties: {
@@ -805,6 +1042,11 @@ const jsonWithTypes = {
805
1042
  mediaGroup_node: {
806
1043
  additionalProperties: false,
807
1044
  properties: {
1045
+ attrs: {
1046
+ additionalProperties: false,
1047
+ properties: {},
1048
+ type: 'object',
1049
+ },
808
1050
  content: {
809
1051
  items: {
810
1052
  $ref: '#/definitions/media_node',
@@ -831,7 +1073,6 @@ const jsonWithTypes = {
831
1073
  collection: {
832
1074
  type: 'string',
833
1075
  },
834
- data: {},
835
1076
  height: {
836
1077
  type: 'number',
837
1078
  },
@@ -1073,6 +1314,48 @@ const jsonWithTypes = {
1073
1314
  required: ['type', 'attrs'],
1074
1315
  type: 'object',
1075
1316
  },
1317
+ multiBodiedExtension_node: {
1318
+ additionalProperties: false,
1319
+ properties: {
1320
+ attrs: {
1321
+ additionalProperties: false,
1322
+ properties: {
1323
+ extensionKey: {
1324
+ type: 'string',
1325
+ },
1326
+ extensionType: {
1327
+ type: 'string',
1328
+ },
1329
+ layout: {
1330
+ enum: ['default', 'wide', 'full-width'],
1331
+ },
1332
+ localId: {
1333
+ type: 'string',
1334
+ },
1335
+ parameters: {
1336
+ type: 'object',
1337
+ },
1338
+ text: {
1339
+ type: 'string',
1340
+ },
1341
+ },
1342
+ required: ['extensionKey', 'extensionType'],
1343
+ type: 'object',
1344
+ },
1345
+ content: {
1346
+ items: {
1347
+ $ref: '#/definitions/extensionFrame_node',
1348
+ },
1349
+ minItems: 1,
1350
+ type: 'array',
1351
+ },
1352
+ type: {
1353
+ enum: ['multiBodiedExtension'],
1354
+ },
1355
+ },
1356
+ required: ['type', 'attrs', 'content'],
1357
+ type: 'object',
1358
+ },
1076
1359
  nestedExpand_with_no_marks_node: {},
1077
1360
  orderedList_node: {
1078
1361
  additionalProperties: false,
@@ -1202,7 +1485,7 @@ const jsonWithTypes = {
1202
1485
  type: 'object',
1203
1486
  },
1204
1487
  paragraph_with_alignment_node: {},
1205
- paragraph_with_indentation_node: {},
1488
+ paragraph_with_marks_node: {},
1206
1489
  paragraph_with_no_marks_node: {},
1207
1490
  placeholder_node: {
1208
1491
  additionalProperties: false,
@@ -1,14 +1,16 @@
1
- import { MarkSpec, NodeSpec, Schema } from '@atlaskit/editor-prosemirror/model';
1
+ import { MarkSpec, NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
2
  import * as newMarkSpecs from '@atlaskit/adf-schema/src/next-schema/generated/markTypes';
3
3
  import * as newNodeSpecs from '@atlaskit/adf-schema/src/next-schema/generated/nodeTypes';
4
4
  import {
5
5
  MarkSpecFactory,
6
6
  NodeSpecFactory,
7
7
  } from '@atlaskit/adf-schema-generator/src/transforms/adfToPm/createPMSpecFactory';
8
- import { defaultSchema } from '../../../src/schema/default-schema';
8
+ import { getNodesAndMarksMap } from '../../../src/schema/create-schema';
9
9
  import { printExpected, printReceived, matcherHint } from 'jest-matcher-utils';
10
10
  import { filterAndSortMarks, formatContent } from '../helpers/_utils';
11
11
 
12
+ const defaultSchema = getNodesAndMarksMap();
13
+
12
14
  /**
13
15
  * TODO: The EXCLUDE and SKIPPED consts are defined to pass the test
14
16
  * Once following ticket is done, will need to remove exclude and unskip tests.
@@ -29,28 +31,9 @@ const SKIPPED_MARKSPEC_TESTS = [
29
31
  'typeAheadQuery', // not exist in ADF DSL
30
32
  ];
31
33
  const SKIPPED_NODESPEC_TESTS = [
32
- 'doc', // defined in ADF DSL, but not matching old spec
33
- 'unknownBlock', // not exist in new ADF DSL
34
- 'confluenceUnsupportedBlock', // not exist in new ADF DSL
35
- 'confluenceUnsupportedInline', // not exist in new ADF DSL
36
- 'confluenceJiraIssue', // not exist in new ADF DSL
37
- 'expand', // in ADF DSL, only expand.use('with_no_marks') is in use. Old spec have marks with 'dataConsumer, fragment'
38
- 'status', // has uuid localId in old spec
39
- 'nestedExpandWithNoMarks', // old nodeSpec have blockCard, but not in type NestedExpandContent, new DSL doesn't have blockCard as to match NestedExpandContent.
40
- 'hardBreak', // not aligned with old spec due to attr.text
41
- 'mediaInline', // not aligned with old spec due to attr.data
42
- 'image', // not exist in new ADF DSL
43
- 'mediaSingleFull', // not aligned with old spec - content is different
44
- 'table', // displayMode is default in new ADF DSL, but having null in old spec
45
- 'codeBlockWithNoMarks', // codeBlock doesn't have uniqueID in new ADF DSL, but have it in old spec.
46
- 'bodiedExtensionWithMarks', // old spec defaults to use bodiedExtension_with_marks_node, new DSL
47
- 'paragraph', // new ADF DSL have unsupporedInline, but not in old nodeSpec
48
- 'decisionItem', // new ADF DSL have unsupporedInline, but not in old nodeSpec
49
- 'taskItem', // new ADF DSL have unsupporedInline, but not in old nodeSpec
50
- 'heading', // new ADF DSL have unsupporedInline, but not in old nodeSpec
51
- 'blockquoteWithList', // new ADF DSL have unsupportedMark unsupportedNodeAttribute, but not in old nodeSpec
52
- 'layoutSection', // new ADF DSL doesn't have unsupportedBlock*|unsupportedBlock+ in content
53
- 'mediaGroup', // old spec have attrs: {}, but not in new ADF DSL.
34
+ 'unknownBlock', // unused node
35
+ 'mediaSingleFull', // not aligned with old spec - content is different, another case similar to layoutSection
36
+ 'layoutSection', // new ADF DSL doesn't have unsupportedBlock*|unsupportedBlock+ in content, it's not supported in DSL and doesn't make much sense, might have to hard code this one
54
37
  ];
55
38
 
56
39
  /**
@@ -70,6 +53,9 @@ const defaultSchemaNodeSpecMap = () => {
70
53
  mediaSingle: 'mediaSingleFull',
71
54
  nestedExpand: 'nestedExpandWithNoMarks',
72
55
  codeBlock: 'codeBlockWithNoMarks',
56
+ heading: 'headingWithNoMarks',
57
+ // Base variant is not used anywhere
58
+ expand: 'expandWithNoMark',
73
59
  };
74
60
  };
75
61
 
@@ -111,6 +97,11 @@ expect.extend({
111
97
  }),
112
98
  };
113
99
 
100
+ // TODO: why
101
+ if (formattedExpected?.attrs?.localId?.default) {
102
+ formattedExpected.attrs.localId.default = '';
103
+ }
104
+
114
105
  const pass = this.equals(formattedActual, formattedExpected);
115
106
  return {
116
107
  pass,
@@ -119,11 +110,11 @@ expect.extend({
119
110
  },
120
111
  });
121
112
 
122
- function isMarkSpec(value: MarkSpec | NodeSpec): value is MarkSpec {
113
+ function isMarkSpec(_value: MarkSpec | NodeSpec): _value is MarkSpec {
123
114
  return true;
124
115
  }
125
116
 
126
- function isNodeSpec(value: MarkSpec | NodeSpec): value is NodeSpec {
117
+ function isNodeSpec(_value: MarkSpec | NodeSpec): _value is NodeSpec {
127
118
  return true;
128
119
  }
129
120
 
@@ -159,13 +150,13 @@ function omit<T extends object>(data: T, keys = []): T {
159
150
 
160
151
  describe('validate PM schema', () => {
161
152
  describe('marks', () => {
162
- const { marks } = defaultSchema as Schema;
153
+ const { marks } = defaultSchema;
163
154
  const skipLists = SKIPPED_MARKSPEC_TESTS;
164
155
 
165
156
  const testCases = Object.entries(marks).map(([key, value]) => {
166
157
  return {
167
158
  name: key,
168
- legacyMarkSpec: value.spec,
159
+ legacyMarkSpec: value,
169
160
  newMarkSpecFn: newMarkSpecs[key] as MarkSpecFactory,
170
161
  skip: skipLists.includes(key) || key.startsWith('__'),
171
162
  };
@@ -190,13 +181,13 @@ describe('validate PM schema', () => {
190
181
  });
191
182
 
192
183
  describe('nodes', () => {
193
- const { nodes } = defaultSchema as Schema;
184
+ const { nodes } = defaultSchema;
194
185
  const skipLists = SKIPPED_NODESPEC_TESTS;
195
186
  const testCases = Object.entries(nodes).map(([key, value]) => {
196
187
  const specName = getDefaultSpecName(key);
197
188
  return {
198
189
  name: specName,
199
- legacyNodeSpec: value.spec,
190
+ legacyNodeSpec: value,
200
191
  newNodeSpecFn: newNodeSpecs[specName] as NodeSpecFactory,
201
192
  testingMethod: {
202
193
  skip: skipLists.includes(specName),