@manuscripts/track-changes-plugin 1.8.4 → 1.8.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.
@@ -127,7 +127,8 @@ function processChangeSteps(changes, startPos, newTr, emptyAttrs, schema) {
127
127
  d.status === change_1.CHANGE_STATUS.pending)) {
128
128
  newDataTracked.push(newUpdate);
129
129
  }
130
- newTr.setNodeMarkup(mapping.map(c.pos), undefined, Object.assign(Object.assign({}, c.newAttrs), { dataTracked: newDataTracked.length > 0 ? newDataTracked : null }), c.node.marks);
130
+ const finalDataTracked = newDataTracked.length > 0 ? newDataTracked : oldDataTracked;
131
+ newTr.setNodeMarkup(mapping.map(c.pos), undefined, Object.assign(Object.assign({}, c.newAttrs), { dataTracked: finalDataTracked.length > 0 ? finalDataTracked : null }), c.node.marks);
131
132
  break;
132
133
  default:
133
134
  logger_1.log.error(`processChangeSteps: unknown change type`, c);
@@ -101,7 +101,8 @@ export function processChangeSteps(changes, startPos, newTr, emptyAttrs, schema)
101
101
  d.status === CHANGE_STATUS.pending)) {
102
102
  newDataTracked.push(newUpdate);
103
103
  }
104
- newTr.setNodeMarkup(mapping.map(c.pos), undefined, Object.assign(Object.assign({}, c.newAttrs), { dataTracked: newDataTracked.length > 0 ? newDataTracked : null }), c.node.marks);
104
+ const finalDataTracked = newDataTracked.length > 0 ? newDataTracked : oldDataTracked;
105
+ newTr.setNodeMarkup(mapping.map(c.pos), undefined, Object.assign(Object.assign({}, c.newAttrs), { dataTracked: finalDataTracked.length > 0 ? finalDataTracked : null }), c.node.marks);
105
106
  break;
106
107
  default:
107
108
  log.error(`processChangeSteps: unknown change type`, c);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manuscripts/track-changes-plugin",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "author": "Atypon Systems LLC",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/Atypon-OpenSource/manuscripts-track-changes-plugin",