@atlaskit/adf-schema 36.16.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 (76) hide show
  1. package/CHANGELOG.md +6 -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/codeBlock.js +5 -0
  9. package/dist/cjs/next-schema/nodes/confluenceJiraIssue.js +38 -0
  10. package/dist/cjs/next-schema/nodes/decisionItem.js +1 -2
  11. package/dist/cjs/next-schema/nodes/extensionFrame.js +3 -1
  12. package/dist/cjs/next-schema/nodes/heading.js +1 -2
  13. package/dist/cjs/next-schema/nodes/image.js +28 -0
  14. package/dist/cjs/next-schema/nodes/mediaGroup.js +2 -0
  15. package/dist/cjs/next-schema/nodes/mediaInline.js +0 -4
  16. package/dist/cjs/next-schema/nodes/mediaSingle.js +1 -1
  17. package/dist/cjs/next-schema/nodes/paragraph.js +1 -2
  18. package/dist/cjs/next-schema/nodes/status.js +1 -0
  19. package/dist/cjs/next-schema/nodes/table.js +1 -1
  20. package/dist/cjs/next-schema/nodes/task.js +1 -2
  21. package/dist/cjs/schema/create-schema.js +21 -0
  22. package/dist/cjs/schema/nodes/multi-bodied-extension.js +0 -2
  23. package/dist/cjs/schema/nodes/paragraph.js +2 -2
  24. package/dist/es2019/next-schema/full-schema.adf.js +1 -5
  25. package/dist/es2019/next-schema/generated/markTypes.js +19 -19
  26. package/dist/es2019/next-schema/generated/nodeTypes.js +421 -315
  27. package/dist/es2019/next-schema/groups/blockGroup.js +1 -5
  28. package/dist/es2019/next-schema/groups/blockRootOnlyGroup.js +2 -1
  29. package/dist/es2019/next-schema/groups/inlineGroup.js +3 -1
  30. package/dist/es2019/next-schema/nodes/codeBlock.js +5 -0
  31. package/dist/es2019/next-schema/nodes/confluenceJiraIssue.js +32 -0
  32. package/dist/es2019/next-schema/nodes/decisionItem.js +1 -2
  33. package/dist/es2019/next-schema/nodes/extensionFrame.js +3 -1
  34. package/dist/es2019/next-schema/nodes/heading.js +1 -2
  35. package/dist/es2019/next-schema/nodes/image.js +22 -0
  36. package/dist/es2019/next-schema/nodes/mediaGroup.js +2 -0
  37. package/dist/es2019/next-schema/nodes/mediaInline.js +0 -4
  38. package/dist/es2019/next-schema/nodes/mediaSingle.js +1 -1
  39. package/dist/es2019/next-schema/nodes/paragraph.js +1 -2
  40. package/dist/es2019/next-schema/nodes/status.js +1 -0
  41. package/dist/es2019/next-schema/nodes/table.js +1 -1
  42. package/dist/es2019/next-schema/nodes/task.js +1 -2
  43. package/dist/es2019/schema/create-schema.js +22 -0
  44. package/dist/es2019/schema/nodes/multi-bodied-extension.js +0 -2
  45. package/dist/es2019/schema/nodes/paragraph.js +2 -2
  46. package/dist/esm/next-schema/full-schema.adf.js +1 -5
  47. package/dist/esm/next-schema/generated/markTypes.js +19 -19
  48. package/dist/esm/next-schema/generated/nodeTypes.js +421 -315
  49. package/dist/esm/next-schema/groups/blockGroup.js +1 -5
  50. package/dist/esm/next-schema/groups/blockRootOnlyGroup.js +2 -1
  51. package/dist/esm/next-schema/groups/inlineGroup.js +3 -1
  52. package/dist/esm/next-schema/nodes/codeBlock.js +5 -0
  53. package/dist/esm/next-schema/nodes/confluenceJiraIssue.js +32 -0
  54. package/dist/esm/next-schema/nodes/decisionItem.js +1 -2
  55. package/dist/esm/next-schema/nodes/extensionFrame.js +3 -1
  56. package/dist/esm/next-schema/nodes/heading.js +1 -2
  57. package/dist/esm/next-schema/nodes/image.js +22 -0
  58. package/dist/esm/next-schema/nodes/mediaGroup.js +2 -0
  59. package/dist/esm/next-schema/nodes/mediaInline.js +0 -4
  60. package/dist/esm/next-schema/nodes/mediaSingle.js +1 -1
  61. package/dist/esm/next-schema/nodes/paragraph.js +1 -2
  62. package/dist/esm/next-schema/nodes/status.js +1 -0
  63. package/dist/esm/next-schema/nodes/table.js +1 -1
  64. package/dist/esm/next-schema/nodes/task.js +1 -2
  65. package/dist/esm/schema/create-schema.js +20 -0
  66. package/dist/esm/schema/nodes/multi-bodied-extension.js +0 -2
  67. package/dist/esm/schema/nodes/paragraph.js +2 -2
  68. package/dist/types/next-schema/generated/markTypes.d.ts +24 -24
  69. package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +6 -4
  70. package/dist/types/next-schema/generated/nodeTypes.d.ts +336 -280
  71. package/dist/types/next-schema/nodes/confluenceJiraIssue.d.ts +22 -0
  72. package/dist/types/next-schema/nodes/image.d.ts +22 -0
  73. package/dist/types/schema/create-schema.d.ts +4 -0
  74. package/package.json +2 -2
  75. package/schema-generators/__tests__/unit/json-full-schema.unit.ts +297 -20
  76. 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.16.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.15.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",
@@ -188,6 +188,103 @@ const jsonWithTypes = {
188
188
  type: 'object',
189
189
  },
190
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
+ },
191
288
  bodiedExtension_with_marks_node: {},
192
289
  border_mark: {
193
290
  additionalProperties: false,
@@ -297,7 +394,32 @@ const jsonWithTypes = {
297
394
  required: ['type', 'content'],
298
395
  type: 'object',
299
396
  },
300
- 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
+ },
301
423
  codeBlock_with_no_marks_node: {},
302
424
  code_inline_node: {},
303
425
  code_mark: {
@@ -424,19 +546,7 @@ const jsonWithTypes = {
424
546
  $ref: '#/definitions/layoutSection_node',
425
547
  },
426
548
  {
427
- $ref: '#/definitions/layoutSection_full_node',
428
- },
429
- {
430
- $ref: '#/definitions/expand_with_breakout_mark_node',
431
- },
432
- {
433
- $ref: '#/definitions/codeBlock_with_no_marks_node',
434
- },
435
- {
436
- $ref: '#/definitions/codeBlock_with_marks_node',
437
- },
438
- {
439
- $ref: '#/definitions/paragraph_with_indentation_node',
549
+ $ref: '#/definitions/blockRootOnly_node',
440
550
  },
441
551
  ],
442
552
  },
@@ -530,8 +640,132 @@ const jsonWithTypes = {
530
640
  required: ['type', 'attrs'],
531
641
  type: 'object',
532
642
  },
533
- expand_with_breakout_mark_node: {},
534
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
+ },
535
769
  extension_with_marks_node: {},
536
770
  formatted_text_inline_node: {},
537
771
  fragment_mark: {
@@ -694,7 +928,6 @@ const jsonWithTypes = {
694
928
  required: ['type', 'attrs', 'content'],
695
929
  type: 'object',
696
930
  },
697
- layoutSection_full_node: {},
698
931
  layoutSection_node: {
699
932
  additionalProperties: false,
700
933
  properties: {
@@ -809,6 +1042,11 @@ const jsonWithTypes = {
809
1042
  mediaGroup_node: {
810
1043
  additionalProperties: false,
811
1044
  properties: {
1045
+ attrs: {
1046
+ additionalProperties: false,
1047
+ properties: {},
1048
+ type: 'object',
1049
+ },
812
1050
  content: {
813
1051
  items: {
814
1052
  $ref: '#/definitions/media_node',
@@ -835,9 +1073,6 @@ const jsonWithTypes = {
835
1073
  collection: {
836
1074
  type: 'string',
837
1075
  },
838
- data: {
839
- type: 'object',
840
- },
841
1076
  height: {
842
1077
  type: 'number',
843
1078
  },
@@ -1079,6 +1314,48 @@ const jsonWithTypes = {
1079
1314
  required: ['type', 'attrs'],
1080
1315
  type: 'object',
1081
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
+ },
1082
1359
  nestedExpand_with_no_marks_node: {},
1083
1360
  orderedList_node: {
1084
1361
  additionalProperties: false,
@@ -1208,7 +1485,7 @@ const jsonWithTypes = {
1208
1485
  type: 'object',
1209
1486
  },
1210
1487
  paragraph_with_alignment_node: {},
1211
- paragraph_with_indentation_node: {},
1488
+ paragraph_with_marks_node: {},
1212
1489
  paragraph_with_no_marks_node: {},
1213
1490
  placeholder_node: {
1214
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),