@atlaskit/editor-json-transformer 8.11.4 → 8.12.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/editor-json-transformer
2
2
 
3
+ ## 8.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#98129](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98129)
8
+ [`78612a7edba4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/78612a7edba4) -
9
+ [ux] [ED-23101] Updated Editor JSON, Slack, Confluence and Email transformers to support the new
10
+ `backgroundColor` mark
11
+
12
+ ## 8.11.5
13
+
14
+ ### Patch Changes
15
+
16
+ - [#98083](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98083)
17
+ [`d22da28a5f6c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d22da28a5f6c) -
18
+ Added step to ADF JSON transformer to remove empty attributes property from paragraph nodes
19
+ - Updated dependencies
20
+
3
21
  ## 8.11.4
4
22
 
5
23
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -106,6 +106,11 @@ var toJSON = function toJSON(node) {
106
106
  if (obj.attrs) {
107
107
  obj.attrs = filterNull(obj.attrs);
108
108
  }
109
+
110
+ // Remove the attrs property if it's empty, this is currently limited to paragraph nodes.
111
+ if (isParagraph(node) && obj.attrs && !Object.keys(obj.attrs).length) {
112
+ delete obj.attrs;
113
+ }
109
114
  if (node.isText) {
110
115
  obj.text = node.textContent;
111
116
  } else {
@@ -24,6 +24,7 @@ var markOverrideRuleFor = exports.markOverrideRuleFor = function markOverrideRul
24
24
  case 'underline':
25
25
  case 'code':
26
26
  case 'textColor':
27
+ case 'backgroundColor':
27
28
  case 'confluenceInlineComment':
28
29
  case 'breakout':
29
30
  case 'alignment':
@@ -86,6 +86,11 @@ const toJSON = node => {
86
86
  if (obj.attrs) {
87
87
  obj.attrs = filterNull(obj.attrs);
88
88
  }
89
+
90
+ // Remove the attrs property if it's empty, this is currently limited to paragraph nodes.
91
+ if (isParagraph(node) && obj.attrs && !Object.keys(obj.attrs).length) {
92
+ delete obj.attrs;
93
+ }
89
94
  if (node.isText) {
90
95
  obj.text = node.textContent;
91
96
  } else {
@@ -18,6 +18,7 @@ export const markOverrideRuleFor = type => {
18
18
  case 'underline':
19
19
  case 'code':
20
20
  case 'textColor':
21
+ case 'backgroundColor':
21
22
  case 'confluenceInlineComment':
22
23
  case 'breakout':
23
24
  case 'alignment':
package/dist/esm/index.js CHANGED
@@ -98,6 +98,11 @@ var toJSON = function toJSON(node) {
98
98
  if (obj.attrs) {
99
99
  obj.attrs = filterNull(obj.attrs);
100
100
  }
101
+
102
+ // Remove the attrs property if it's empty, this is currently limited to paragraph nodes.
103
+ if (isParagraph(node) && obj.attrs && !Object.keys(obj.attrs).length) {
104
+ delete obj.attrs;
105
+ }
101
106
  if (node.isText) {
102
107
  obj.text = node.textContent;
103
108
  } else {
@@ -18,6 +18,7 @@ export var markOverrideRuleFor = function markOverrideRuleFor(type) {
18
18
  case 'underline':
19
19
  case 'code':
20
20
  case 'textColor':
21
+ case 'backgroundColor':
21
22
  case 'confluenceInlineComment':
22
23
  case 'breakout':
23
24
  case 'alignment':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-json-transformer",
3
- "version": "8.11.4",
3
+ "version": "8.12.0",
4
4
  "description": "JSON transformer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,12 +42,13 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@atlaskit/adf-schema": "^35.12.2",
45
- "@atlaskit/adf-utils": "^19.0.0",
45
+ "@atlaskit/adf-utils": "^19.1.0",
46
46
  "@atlaskit/editor-prosemirror": "4.0.1",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "lodash": "^4.17.21"
49
49
  },
50
50
  "devDependencies": {
51
+ "@atlaskit/editor-plugin-highlight": "1.0.4",
51
52
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
52
53
  "react": "^16.8.0",
53
54
  "typescript": "~5.4.2"