@atlaskit/editor-json-transformer 8.22.0 → 8.22.1

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,11 @@
1
1
  # @atlaskit/editor-json-transformer
2
2
 
3
+ ## 8.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 8.22.0
4
10
 
5
11
  ### Minor Changes
package/dist/cjs/index.js CHANGED
@@ -54,7 +54,7 @@ var isFragmentMark = isType('fragment');
54
54
  var isHardBreak = isType('hardBreak');
55
55
 
56
56
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
- var filterNull = function filterNull(subject) {
57
+ var _filterNull = function filterNull(subject) {
58
58
  var output = _objectSpread({}, subject);
59
59
  // eslint-disable-next-line guard-for-in
60
60
  for (var key in output) {
@@ -65,7 +65,7 @@ var filterNull = function filterNull(subject) {
65
65
  filteredObj = (0, _objectWithoutProperties2.default)(_output, [key].map(_toPropertyKey));
66
66
  output = filteredObj;
67
67
  } else if ((0, _typeof2.default)(current) === 'object' && !Array.isArray(current)) {
68
- output[key] = filterNull(current);
68
+ output[key] = _filterNull(current);
69
69
  }
70
70
  }
71
71
  return output;
@@ -81,7 +81,7 @@ var emptyDoc = createDocFromContent([{
81
81
  type: 'paragraph',
82
82
  content: []
83
83
  }]);
84
- var toJSON = function toJSON(node, mentionMap) {
84
+ var _toJSON = function toJSON(node, mentionMap) {
85
85
  var obj = {
86
86
  type: node.type.name
87
87
  };
@@ -109,7 +109,7 @@ var toJSON = function toJSON(node, mentionMap) {
109
109
  obj.attrs = node.attrs;
110
110
  }
111
111
  if (obj.attrs) {
112
- obj.attrs = filterNull(obj.attrs);
112
+ obj.attrs = _filterNull(obj.attrs);
113
113
  }
114
114
  if (isMentionNode(node) && mentionMap) {
115
115
  var _text, _obj$attrs;
@@ -139,7 +139,7 @@ var toJSON = function toJSON(node, mentionMap) {
139
139
  } else {
140
140
  node.content.forEach(function (child) {
141
141
  obj.content = obj.content || [];
142
- obj.content.push(toJSON(child, mentionMap));
142
+ obj.content.push(_toJSON(child, mentionMap));
143
143
  });
144
144
  }
145
145
  if (isParagraph(node) || isHeading(node)) {
@@ -224,7 +224,7 @@ var JSONTransformer = exports.JSONTransformer = /*#__PURE__*/function () {
224
224
  var _this = this;
225
225
  var content = [];
226
226
  node.content.forEach(function (child) {
227
- content.push((0, _sanitizeNode.sanitizeNode)(toJSON(child, _this.mentionMap)));
227
+ content.push((0, _sanitizeNode.sanitizeNode)(_toJSON(child, _this.mentionMap)));
228
228
  });
229
229
  if (!content || (0, _isEqual.default)(content, emptyDoc.content)) {
230
230
  return createDocFromContent([]);
@@ -257,7 +257,7 @@ var JSONTransformer = exports.JSONTransformer = /*#__PURE__*/function () {
257
257
  }, {
258
258
  key: "encodeNode",
259
259
  value: function encodeNode(node) {
260
- return (0, _sanitizeNode.sanitizeNode)(toJSON(node, this.mentionMap));
260
+ return (0, _sanitizeNode.sanitizeNode)(_toJSON(node, this.mentionMap));
261
261
  }
262
262
  }]);
263
263
  }();
package/dist/esm/index.js CHANGED
@@ -48,7 +48,7 @@ var isFragmentMark = isType('fragment');
48
48
  var isHardBreak = isType('hardBreak');
49
49
 
50
50
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
- var filterNull = function filterNull(subject) {
51
+ var _filterNull = function filterNull(subject) {
52
52
  var output = _objectSpread({}, subject);
53
53
  // eslint-disable-next-line guard-for-in
54
54
  for (var key in output) {
@@ -59,7 +59,7 @@ var filterNull = function filterNull(subject) {
59
59
  filteredObj = _objectWithoutProperties(_output, [key].map(_toPropertyKey));
60
60
  output = filteredObj;
61
61
  } else if (_typeof(current) === 'object' && !Array.isArray(current)) {
62
- output[key] = filterNull(current);
62
+ output[key] = _filterNull(current);
63
63
  }
64
64
  }
65
65
  return output;
@@ -75,7 +75,7 @@ var emptyDoc = createDocFromContent([{
75
75
  type: 'paragraph',
76
76
  content: []
77
77
  }]);
78
- var toJSON = function toJSON(node, mentionMap) {
78
+ var _toJSON = function toJSON(node, mentionMap) {
79
79
  var obj = {
80
80
  type: node.type.name
81
81
  };
@@ -103,7 +103,7 @@ var toJSON = function toJSON(node, mentionMap) {
103
103
  obj.attrs = node.attrs;
104
104
  }
105
105
  if (obj.attrs) {
106
- obj.attrs = filterNull(obj.attrs);
106
+ obj.attrs = _filterNull(obj.attrs);
107
107
  }
108
108
  if (isMentionNode(node) && mentionMap) {
109
109
  var _text, _obj$attrs;
@@ -133,7 +133,7 @@ var toJSON = function toJSON(node, mentionMap) {
133
133
  } else {
134
134
  node.content.forEach(function (child) {
135
135
  obj.content = obj.content || [];
136
- obj.content.push(toJSON(child, mentionMap));
136
+ obj.content.push(_toJSON(child, mentionMap));
137
137
  });
138
138
  }
139
139
  if (isParagraph(node) || isHeading(node)) {
@@ -218,7 +218,7 @@ export var JSONTransformer = /*#__PURE__*/function () {
218
218
  var _this = this;
219
219
  var content = [];
220
220
  node.content.forEach(function (child) {
221
- content.push(sanitizeNode(toJSON(child, _this.mentionMap)));
221
+ content.push(sanitizeNode(_toJSON(child, _this.mentionMap)));
222
222
  });
223
223
  if (!content || isEqual(content, emptyDoc.content)) {
224
224
  return createDocFromContent([]);
@@ -251,7 +251,7 @@ export var JSONTransformer = /*#__PURE__*/function () {
251
251
  }, {
252
252
  key: "encodeNode",
253
253
  value: function encodeNode(node) {
254
- return sanitizeNode(toJSON(node, this.mentionMap));
254
+ return sanitizeNode(_toJSON(node, this.mentionMap));
255
255
  }
256
256
  }]);
257
257
  }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-json-transformer",
3
- "version": "8.22.0",
3
+ "version": "8.22.1",
4
4
  "description": "JSON transformer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,12 +39,12 @@
39
39
  "@atlaskit/adf-schema": "^46.1.0",
40
40
  "@atlaskit/adf-utils": "^19.18.0",
41
41
  "@atlaskit/editor-prosemirror": "6.2.1",
42
- "@atlaskit/platform-feature-flags": "^0.3.0",
42
+ "@atlaskit/platform-feature-flags": "^1.0.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "lodash": "^4.17.21"
45
45
  },
46
46
  "devDependencies": {
47
- "@atlaskit/editor-plugin-highlight": "1.19.11",
47
+ "@atlaskit/editor-plugin-highlight": "1.19.12",
48
48
  "react": "^18.2.0",
49
49
  "typescript": "~5.4.2"
50
50
  },