@atlaskit/adf-schema 57.0.4 → 57.0.5
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 +41 -0
- package/dist/cjs/validator-schema/generated/validatorSpec.js +12 -0
- package/dist/es2019/validator-schema/generated/validatorSpec.js +12 -0
- package/dist/esm/validator-schema/generated/validatorSpec.js +12 -0
- package/dist/types/validator-schema/generated/validatorSpec.d.ts +12 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# @atlaskit/adf-schema
|
|
2
2
|
|
|
3
|
+
## 57.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`249ac5d9191e0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/249ac5d9191e0) -
|
|
8
|
+
Behind `platform_editor_adf_validator_empty_marks`, accept an explicitly empty `marks` array on a
|
|
9
|
+
node that ADF gives a `marks` property no mark type may go into.
|
|
10
|
+
|
|
11
|
+
ADF spells that property `marks: { type: 'array', maxItems: 0 }`, and the JSON schema accordingly
|
|
12
|
+
accepts `"marks": []` on `paragraph`, `heading`, `extension`, `codeBlock` and `expand`. The
|
|
13
|
+
spec-based validator rejected it: mark validation has nothing to reject in an empty array, so it
|
|
14
|
+
reported the node valid with an empty `marksValidationOutput`, which reads to the parent's
|
|
15
|
+
`validateChildMarks` as every mark on the child having been rejected, and the candidate spec was
|
|
16
|
+
declined. Without an error callback that surfaced as a thrown `undefined`; with one the document
|
|
17
|
+
was silently repaired and no error was reported. The five reference documents that carry
|
|
18
|
+
`marks: []` (`paragraph-with-empty-marks`, `heading-with-empty-marks`,
|
|
19
|
+
`extension-with-empty-marks`, `nestedExpand-with-codeBlock`, `panel-with-codeBlock`) were on an
|
|
20
|
+
ignore list in `src/validator/__tests__/unit/validate.ts` because of it, and are now validated.
|
|
21
|
+
|
|
22
|
+
A node with no `marks` property at all keeps rejecting an empty array as `REDUNDANT_MARKS`,
|
|
23
|
+
because `marks` is then a property ADF does not define on it: `rule`, `panel`, `mediaGroup`,
|
|
24
|
+
`hardBreak`, `doc`, `blockquote` and the list nodes all stay invalid, as do `mention` and `emoji`,
|
|
25
|
+
which declare a mark rather than an empty list. The declaration is read off the node's base spec,
|
|
26
|
+
since a variant only widens the mark types — `doc` offers a root `extension` as
|
|
27
|
+
`extension_with_marks`, which adds `dataConsumer` and `fragment`, and that cannot make the empty
|
|
28
|
+
list illegal.
|
|
29
|
+
|
|
30
|
+
`codeBlock` and `expand` declare `noMarks` without listing any marks, and `adfToValidatorSpec`
|
|
31
|
+
compared mark lists alone, so the flag was dropped and their validator specs read as taking no
|
|
32
|
+
`marks` property — the same thing `rule` means, which is why an empty array on them was reported
|
|
33
|
+
as redundant. The generator now honours `noMarks` on its own, so both emit
|
|
34
|
+
`marks: { type: 'array', items: [], maxItems: 0, optional: true }`, matching their JSON schema.
|
|
35
|
+
That part is generated data and is not gated: a real mark on a `codeBlock` or an `expand` is still
|
|
36
|
+
rejected, now as an unsupported mark type rather than as a redundant `marks` property, so the
|
|
37
|
+
error code reported for an already-invalid document changes.
|
|
38
|
+
|
|
39
|
+
Gate off preserves today's acceptance behaviour. Covered by
|
|
40
|
+
`src/validator/__tests__/unit/empty-marks.ts`.
|
|
41
|
+
|
|
42
|
+
- Updated dependencies
|
|
43
|
+
|
|
3
44
|
## 57.0.4
|
|
4
45
|
|
|
5
46
|
### Patch Changes
|
|
@@ -408,6 +408,12 @@ var codeBlock = exports.codeBlock = {
|
|
|
408
408
|
optional: true,
|
|
409
409
|
type: 'array'
|
|
410
410
|
},
|
|
411
|
+
marks: {
|
|
412
|
+
items: [],
|
|
413
|
+
maxItems: 0,
|
|
414
|
+
optional: true,
|
|
415
|
+
type: 'array'
|
|
416
|
+
},
|
|
411
417
|
type: {
|
|
412
418
|
type: 'enum',
|
|
413
419
|
values: ['codeBlock']
|
|
@@ -643,6 +649,12 @@ var expand = exports.expand = {
|
|
|
643
649
|
minItems: 1,
|
|
644
650
|
type: 'array'
|
|
645
651
|
},
|
|
652
|
+
marks: {
|
|
653
|
+
items: [],
|
|
654
|
+
maxItems: 0,
|
|
655
|
+
optional: true,
|
|
656
|
+
type: 'array'
|
|
657
|
+
},
|
|
646
658
|
type: {
|
|
647
659
|
type: 'enum',
|
|
648
660
|
values: ['expand']
|
|
@@ -402,6 +402,12 @@ export const codeBlock = {
|
|
|
402
402
|
optional: true,
|
|
403
403
|
type: 'array'
|
|
404
404
|
},
|
|
405
|
+
marks: {
|
|
406
|
+
items: [],
|
|
407
|
+
maxItems: 0,
|
|
408
|
+
optional: true,
|
|
409
|
+
type: 'array'
|
|
410
|
+
},
|
|
405
411
|
type: {
|
|
406
412
|
type: 'enum',
|
|
407
413
|
values: ['codeBlock']
|
|
@@ -637,6 +643,12 @@ export const expand = {
|
|
|
637
643
|
minItems: 1,
|
|
638
644
|
type: 'array'
|
|
639
645
|
},
|
|
646
|
+
marks: {
|
|
647
|
+
items: [],
|
|
648
|
+
maxItems: 0,
|
|
649
|
+
optional: true,
|
|
650
|
+
type: 'array'
|
|
651
|
+
},
|
|
640
652
|
type: {
|
|
641
653
|
type: 'enum',
|
|
642
654
|
values: ['expand']
|
|
@@ -402,6 +402,12 @@ export var codeBlock = {
|
|
|
402
402
|
optional: true,
|
|
403
403
|
type: 'array'
|
|
404
404
|
},
|
|
405
|
+
marks: {
|
|
406
|
+
items: [],
|
|
407
|
+
maxItems: 0,
|
|
408
|
+
optional: true,
|
|
409
|
+
type: 'array'
|
|
410
|
+
},
|
|
405
411
|
type: {
|
|
406
412
|
type: 'enum',
|
|
407
413
|
values: ['codeBlock']
|
|
@@ -637,6 +643,12 @@ export var expand = {
|
|
|
637
643
|
minItems: 1,
|
|
638
644
|
type: 'array'
|
|
639
645
|
},
|
|
646
|
+
marks: {
|
|
647
|
+
items: [],
|
|
648
|
+
maxItems: 0,
|
|
649
|
+
optional: true,
|
|
650
|
+
type: 'array'
|
|
651
|
+
},
|
|
640
652
|
type: {
|
|
641
653
|
type: 'enum',
|
|
642
654
|
values: ['expand']
|
|
@@ -412,6 +412,12 @@ export declare const codeBlock: {
|
|
|
412
412
|
optional: boolean;
|
|
413
413
|
type: string;
|
|
414
414
|
};
|
|
415
|
+
marks: {
|
|
416
|
+
items: unknown[];
|
|
417
|
+
maxItems: number;
|
|
418
|
+
optional: boolean;
|
|
419
|
+
type: string;
|
|
420
|
+
};
|
|
415
421
|
type: {
|
|
416
422
|
type: string;
|
|
417
423
|
values: string[];
|
|
@@ -647,6 +653,12 @@ export declare const expand: {
|
|
|
647
653
|
minItems: number;
|
|
648
654
|
type: string;
|
|
649
655
|
};
|
|
656
|
+
marks: {
|
|
657
|
+
items: unknown[];
|
|
658
|
+
maxItems: number;
|
|
659
|
+
optional: boolean;
|
|
660
|
+
type: string;
|
|
661
|
+
};
|
|
650
662
|
type: {
|
|
651
663
|
type: string;
|
|
652
664
|
values: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/adf-schema",
|
|
3
|
-
"version": "57.0.
|
|
3
|
+
"version": "57.0.5",
|
|
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/"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/adf-schema-generator": "^4.0.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
43
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
43
|
+
"@atlaskit/tmp-editor-statsig": "^150.0.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"css-color-names": "0.0.4",
|
|
46
46
|
"linkify-it": "^5.0.2",
|