@atlaskit/adf-utils 19.0.1 → 19.0.3

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/adf-utils
2
2
 
3
+ ## 19.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`106c54b0ce4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/106c54b0ce4) - [ux] ED-15896 - Added support for unsupported nodes in listItem
8
+ - Updated dependencies
9
+
10
+ ## 19.0.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [`9064e2d0f28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9064e2d0f28) - [ux] HOT-104783 Reverting https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37639
15
+ - Updated dependencies
16
+
3
17
  ## 19.0.1
4
18
 
5
19
  ### Patch Changes
@@ -153,11 +153,17 @@ var transformNodesMissingContent = function transformNodesMissingContent(adf) {
153
153
  var transformedAdf = (0, _traverse.traverse)(adf, {
154
154
  tableCell: fixIfTableCellInvalidEmpty(reportTransform)
155
155
  });
156
+
157
+ // Empty mediaSingle nodes get stripped from the document and so this transform
158
+ // will create an empty listItem if the media node is in a list. Empty listItems
159
+ // are invalid adf, so we need to transform the mediaSingle nodes first.
160
+ transformedAdf = (0, _traverse.traverse)(transformedAdf || adf, {
161
+ mediaSingle: removeMediaSingleWithNoContent(reportTransform)
162
+ });
156
163
  transformedAdf = (0, _traverse.traverse)(transformedAdf || adf, {
157
164
  bulletList: fixIfListParentWithInvalidListItemChildren(reportTransform),
158
165
  orderedList: fixIfListParentWithInvalidListItemChildren(reportTransform),
159
- table: fixIfTableParentWithInvalidTableRowChildren(reportTransform),
160
- mediaSingle: removeMediaSingleWithNoContent(reportTransform)
166
+ table: fixIfTableParentWithInvalidTableRowChildren(reportTransform)
161
167
  });
162
168
  return {
163
169
  transformedAdf: transformedAdf,
@@ -14,7 +14,8 @@ var _default = {
14
14
  type: 'array',
15
15
  items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList']],
16
16
  isTupleLike: true,
17
- minItems: 1
17
+ minItems: 1,
18
+ allowUnsupportedBlock: true
18
19
  }
19
20
  }
20
21
  };
@@ -36,8 +36,7 @@ var _default = {
36
36
  content: {
37
37
  type: 'array',
38
38
  items: ['tableRow'],
39
- minItems: 1,
40
- allowUnsupportedBlock: true
39
+ minItems: 1
41
40
  },
42
41
  marks: {
43
42
  type: 'array',
@@ -12,8 +12,7 @@ var _default = {
12
12
  },
13
13
  content: {
14
14
  type: 'array',
15
- items: [['tableCell', 'tableHeader']],
16
- allowUnsupportedBlock: true
15
+ items: [['tableCell', 'tableHeader']]
17
16
  }
18
17
  }
19
18
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "19.0.1",
3
+ "version": "19.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -133,11 +133,17 @@ export const transformNodesMissingContent = adf => {
133
133
  let transformedAdf = traverse(adf, {
134
134
  tableCell: fixIfTableCellInvalidEmpty(reportTransform)
135
135
  });
136
+
137
+ // Empty mediaSingle nodes get stripped from the document and so this transform
138
+ // will create an empty listItem if the media node is in a list. Empty listItems
139
+ // are invalid adf, so we need to transform the mediaSingle nodes first.
140
+ transformedAdf = traverse(transformedAdf || adf, {
141
+ mediaSingle: removeMediaSingleWithNoContent(reportTransform)
142
+ });
136
143
  transformedAdf = traverse(transformedAdf || adf, {
137
144
  bulletList: fixIfListParentWithInvalidListItemChildren(reportTransform),
138
145
  orderedList: fixIfListParentWithInvalidListItemChildren(reportTransform),
139
- table: fixIfTableParentWithInvalidTableRowChildren(reportTransform),
140
- mediaSingle: removeMediaSingleWithNoContent(reportTransform)
146
+ table: fixIfTableParentWithInvalidTableRowChildren(reportTransform)
141
147
  });
142
148
  return {
143
149
  transformedAdf,
@@ -8,7 +8,8 @@ export default {
8
8
  type: 'array',
9
9
  items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList']],
10
10
  isTupleLike: true,
11
- minItems: 1
11
+ minItems: 1,
12
+ allowUnsupportedBlock: true
12
13
  }
13
14
  }
14
15
  };
@@ -30,8 +30,7 @@ export default {
30
30
  content: {
31
31
  type: 'array',
32
32
  items: ['tableRow'],
33
- minItems: 1,
34
- allowUnsupportedBlock: true
33
+ minItems: 1
35
34
  },
36
35
  marks: {
37
36
  type: 'array',
@@ -6,8 +6,7 @@ export default {
6
6
  },
7
7
  content: {
8
8
  type: 'array',
9
- items: [['tableCell', 'tableHeader']],
10
- allowUnsupportedBlock: true
9
+ items: [['tableCell', 'tableHeader']]
11
10
  }
12
11
  }
13
12
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "19.0.1",
3
+ "version": "19.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -146,11 +146,17 @@ export var transformNodesMissingContent = function transformNodesMissingContent(
146
146
  var transformedAdf = traverse(adf, {
147
147
  tableCell: fixIfTableCellInvalidEmpty(reportTransform)
148
148
  });
149
+
150
+ // Empty mediaSingle nodes get stripped from the document and so this transform
151
+ // will create an empty listItem if the media node is in a list. Empty listItems
152
+ // are invalid adf, so we need to transform the mediaSingle nodes first.
153
+ transformedAdf = traverse(transformedAdf || adf, {
154
+ mediaSingle: removeMediaSingleWithNoContent(reportTransform)
155
+ });
149
156
  transformedAdf = traverse(transformedAdf || adf, {
150
157
  bulletList: fixIfListParentWithInvalidListItemChildren(reportTransform),
151
158
  orderedList: fixIfListParentWithInvalidListItemChildren(reportTransform),
152
- table: fixIfTableParentWithInvalidTableRowChildren(reportTransform),
153
- mediaSingle: removeMediaSingleWithNoContent(reportTransform)
159
+ table: fixIfTableParentWithInvalidTableRowChildren(reportTransform)
154
160
  });
155
161
  return {
156
162
  transformedAdf: transformedAdf,
@@ -8,7 +8,8 @@ export default {
8
8
  type: 'array',
9
9
  items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList']],
10
10
  isTupleLike: true,
11
- minItems: 1
11
+ minItems: 1,
12
+ allowUnsupportedBlock: true
12
13
  }
13
14
  }
14
15
  };
@@ -30,8 +30,7 @@ export default {
30
30
  content: {
31
31
  type: 'array',
32
32
  items: ['tableRow'],
33
- minItems: 1,
34
- allowUnsupportedBlock: true
33
+ minItems: 1
35
34
  },
36
35
  marks: {
37
36
  type: 'array',
@@ -6,8 +6,7 @@ export default {
6
6
  },
7
7
  content: {
8
8
  type: 'array',
9
- items: [['tableCell', 'tableHeader']],
10
- allowUnsupportedBlock: true
9
+ items: [['tableCell', 'tableHeader']]
11
10
  }
12
11
  }
13
12
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "19.0.1",
3
+ "version": "19.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -9,6 +9,7 @@ declare const _default: {
9
9
  items: string[][];
10
10
  isTupleLike: boolean;
11
11
  minItems: number;
12
+ allowUnsupportedBlock: boolean;
12
13
  };
13
14
  };
14
15
  };
@@ -31,7 +31,6 @@ declare const _default: {
31
31
  type: string;
32
32
  items: string[];
33
33
  minItems: number;
34
- allowUnsupportedBlock: boolean;
35
34
  };
36
35
  marks: {
37
36
  type: string;
@@ -7,7 +7,6 @@ declare const _default: {
7
7
  content: {
8
8
  type: string;
9
9
  items: string[][];
10
- allowUnsupportedBlock: boolean;
11
10
  };
12
11
  };
13
12
  };
@@ -9,6 +9,7 @@ declare const _default: {
9
9
  items: string[][];
10
10
  isTupleLike: boolean;
11
11
  minItems: number;
12
+ allowUnsupportedBlock: boolean;
12
13
  };
13
14
  };
14
15
  };
@@ -31,7 +31,6 @@ declare const _default: {
31
31
  type: string;
32
32
  items: string[];
33
33
  minItems: number;
34
- allowUnsupportedBlock: boolean;
35
34
  };
36
35
  marks: {
37
36
  type: string;
@@ -7,7 +7,6 @@ declare const _default: {
7
7
  content: {
8
8
  type: string;
9
9
  items: string[][];
10
- allowUnsupportedBlock: boolean;
11
10
  };
12
11
  };
13
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "19.0.1",
3
+ "version": "19.0.3",
4
4
  "description": "Set of utilities to traverse, modify and create ADF documents.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,10 +38,10 @@
38
38
  "./validatorTypes": "./src/types/validatorTypes.ts"
39
39
  },
40
40
  "scripts": {
41
- "generate:spec": "rm -rf ./src/validator/specs/ && ../json-schema-generator/bin/json-schema-generator.js --outDir=./src/validator/specs/ --mode=Spec --stage=0 ./src/validator/entry.ts"
41
+ "generate:spec": "rm -rf ./src/validator/specs/ && ../json-schema-generator/bin.js --outDir=./src/validator/specs/ --mode=Spec --stage=0 ./src/validator/entry.ts"
42
42
  },
43
43
  "dependencies": {
44
- "@atlaskit/adf-schema": "^27.0.0",
44
+ "@atlaskit/adf-schema": "^28.1.0",
45
45
  "@atlaskit/codemod-utils": "^4.2.0",
46
46
  "@babel/runtime": "^7.0.0"
47
47
  },