@atlaskit/editor-json-transformer 8.20.2 → 8.20.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,13 @@
1
1
  # @atlaskit/editor-json-transformer
2
2
 
3
+ ## 8.20.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#159176](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159176)
8
+ [`8f1d77592a9dc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f1d77592a9dc) -
9
+ Bump adf-schema to 44.2.0
10
+
3
11
  ## 8.20.2
4
12
 
5
13
  ### Patch Changes
@@ -5,8 +5,7 @@
5
5
  "target": "es5",
6
6
  "composite": true,
7
7
  "outDir": "../dist",
8
- "rootDir": "../",
9
- "baseUrl": "../"
8
+ "rootDir": "../"
10
9
  },
11
10
  "include": [
12
11
  "../src/**/*.ts",
package/dist/cjs/index.js CHANGED
@@ -50,6 +50,7 @@ var isUnsupportedNode = function isUnsupportedNode(node) {
50
50
  };
51
51
  var isDataConsumer = isType('dataConsumer');
52
52
  var isFragmentMark = isType('fragment');
53
+ var isHardBreak = isType('hardBreak');
53
54
 
54
55
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
56
  var filterNull = function filterNull(subject) {
@@ -113,6 +114,12 @@ var toJSON = function toJSON(node) {
113
114
  if (isParagraph(node) && obj.attrs && !Object.keys(obj.attrs).length) {
114
115
  delete obj.attrs;
115
116
  }
117
+
118
+ // Hard break has optional attr.text which was added for PM <-> ADF compatibility.
119
+ // No need to preserve it.
120
+ if (isHardBreak(node)) {
121
+ delete obj.attrs;
122
+ }
116
123
  if (node.isText) {
117
124
  obj.text = node.textContent;
118
125
  } else {
@@ -27,6 +27,7 @@ const isNestedExpand = isType('nestedExpand');
27
27
  const isUnsupportedNode = node => isType('unsupportedBlock')(node) || isType('unsupportedInline')(node);
28
28
  const isDataConsumer = isType('dataConsumer');
29
29
  const isFragmentMark = isType('fragment');
30
+ const isHardBreak = isType('hardBreak');
30
31
 
31
32
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
33
  const filterNull = subject => {
@@ -93,6 +94,12 @@ const toJSON = node => {
93
94
  if (isParagraph(node) && obj.attrs && !Object.keys(obj.attrs).length) {
94
95
  delete obj.attrs;
95
96
  }
97
+
98
+ // Hard break has optional attr.text which was added for PM <-> ADF compatibility.
99
+ // No need to preserve it.
100
+ if (isHardBreak(node)) {
101
+ delete obj.attrs;
102
+ }
96
103
  if (node.isText) {
97
104
  obj.text = node.textContent;
98
105
  } else {
package/dist/esm/index.js CHANGED
@@ -42,6 +42,7 @@ var isUnsupportedNode = function isUnsupportedNode(node) {
42
42
  };
43
43
  var isDataConsumer = isType('dataConsumer');
44
44
  var isFragmentMark = isType('fragment');
45
+ var isHardBreak = isType('hardBreak');
45
46
 
46
47
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
48
  var filterNull = function filterNull(subject) {
@@ -105,6 +106,12 @@ var toJSON = function toJSON(node) {
105
106
  if (isParagraph(node) && obj.attrs && !Object.keys(obj.attrs).length) {
106
107
  delete obj.attrs;
107
108
  }
109
+
110
+ // Hard break has optional attr.text which was added for PM <-> ADF compatibility.
111
+ // No need to preserve it.
112
+ if (isHardBreak(node)) {
113
+ delete obj.attrs;
114
+ }
108
115
  if (node.isText) {
109
116
  obj.text = node.textContent;
110
117
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-json-transformer",
3
- "version": "8.20.2",
3
+ "version": "8.20.3",
4
4
  "description": "JSON transformer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,14 +36,14 @@
36
36
  "./types": "./src/types.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@atlaskit/adf-schema": "^42.3.1",
39
+ "@atlaskit/adf-schema": "^44.2.0",
40
40
  "@atlaskit/adf-utils": "^19.10.0",
41
41
  "@atlaskit/editor-prosemirror": "6.0.0",
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "lodash": "^4.17.21"
44
44
  },
45
45
  "devDependencies": {
46
- "@atlaskit/editor-plugin-highlight": "1.18.3",
46
+ "@atlaskit/editor-plugin-highlight": "1.18.6",
47
47
  "@atlaskit/platform-feature-flags": "^0.3.0",
48
48
  "react": "^16.8.0",
49
49
  "typescript": "~5.4.2"