@manuscripts/track-changes-plugin 1.6.1-LEAN-2850 → 1.6.1-LEAN-2850-v2
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/dist/index.cjs +11 -3
- package/dist/index.js +11 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -161,13 +161,14 @@ const enableDebug = (enabled) => {
|
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
-
var _ChangeSet_changes;
|
|
164
|
+
var _ChangeSet_instances, _ChangeSet_changes, _ChangeSet_isSameNodeChange;
|
|
165
165
|
/**
|
|
166
166
|
* ChangeSet is a data structure to contain the tracked changes with some utility methods and computed
|
|
167
167
|
* values to allow easier operability.
|
|
168
168
|
*/
|
|
169
169
|
class ChangeSet {
|
|
170
170
|
constructor(changes = []) {
|
|
171
|
+
_ChangeSet_instances.add(this);
|
|
171
172
|
_ChangeSet_changes.set(this, void 0);
|
|
172
173
|
__classPrivateFieldSet(this, _ChangeSet_changes, changes, "f");
|
|
173
174
|
}
|
|
@@ -198,7 +199,9 @@ class ChangeSet {
|
|
|
198
199
|
rootNodes.push(currentNodeChange);
|
|
199
200
|
currentNodeChange = undefined;
|
|
200
201
|
}
|
|
201
|
-
if (currentNodeChange &&
|
|
202
|
+
if (currentNodeChange &&
|
|
203
|
+
c.from < currentNodeChange.to &&
|
|
204
|
+
!__classPrivateFieldGet(this, _ChangeSet_instances, "m", _ChangeSet_isSameNodeChange).call(this, currentNodeChange, c)) {
|
|
202
205
|
currentNodeChange.children.push(c);
|
|
203
206
|
}
|
|
204
207
|
else if (c.type === 'node-change') {
|
|
@@ -320,7 +323,12 @@ class ChangeSet {
|
|
|
320
323
|
return change.type === 'node-attr-change';
|
|
321
324
|
}
|
|
322
325
|
}
|
|
323
|
-
_ChangeSet_changes = new WeakMap()
|
|
326
|
+
_ChangeSet_changes = new WeakMap(), _ChangeSet_instances = new WeakSet(), _ChangeSet_isSameNodeChange = function _ChangeSet_isSameNodeChange(currentChange, nextChange) {
|
|
327
|
+
return (currentChange.from === nextChange.from &&
|
|
328
|
+
currentChange.to === nextChange.to &&
|
|
329
|
+
currentChange.dataTracked.operation !== exports.CHANGE_OPERATION.delete &&
|
|
330
|
+
currentChange.dataTracked.status !== exports.CHANGE_STATUS.pending);
|
|
331
|
+
};
|
|
324
332
|
|
|
325
333
|
/*!
|
|
326
334
|
* © 2021 Atypon Systems LLC
|
package/dist/index.js
CHANGED
|
@@ -153,13 +153,14 @@ const enableDebug = (enabled) => {
|
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
-
var _ChangeSet_changes;
|
|
156
|
+
var _ChangeSet_instances, _ChangeSet_changes, _ChangeSet_isSameNodeChange;
|
|
157
157
|
/**
|
|
158
158
|
* ChangeSet is a data structure to contain the tracked changes with some utility methods and computed
|
|
159
159
|
* values to allow easier operability.
|
|
160
160
|
*/
|
|
161
161
|
class ChangeSet {
|
|
162
162
|
constructor(changes = []) {
|
|
163
|
+
_ChangeSet_instances.add(this);
|
|
163
164
|
_ChangeSet_changes.set(this, void 0);
|
|
164
165
|
__classPrivateFieldSet(this, _ChangeSet_changes, changes, "f");
|
|
165
166
|
}
|
|
@@ -190,7 +191,9 @@ class ChangeSet {
|
|
|
190
191
|
rootNodes.push(currentNodeChange);
|
|
191
192
|
currentNodeChange = undefined;
|
|
192
193
|
}
|
|
193
|
-
if (currentNodeChange &&
|
|
194
|
+
if (currentNodeChange &&
|
|
195
|
+
c.from < currentNodeChange.to &&
|
|
196
|
+
!__classPrivateFieldGet(this, _ChangeSet_instances, "m", _ChangeSet_isSameNodeChange).call(this, currentNodeChange, c)) {
|
|
194
197
|
currentNodeChange.children.push(c);
|
|
195
198
|
}
|
|
196
199
|
else if (c.type === 'node-change') {
|
|
@@ -312,7 +315,12 @@ class ChangeSet {
|
|
|
312
315
|
return change.type === 'node-attr-change';
|
|
313
316
|
}
|
|
314
317
|
}
|
|
315
|
-
_ChangeSet_changes = new WeakMap()
|
|
318
|
+
_ChangeSet_changes = new WeakMap(), _ChangeSet_instances = new WeakSet(), _ChangeSet_isSameNodeChange = function _ChangeSet_isSameNodeChange(currentChange, nextChange) {
|
|
319
|
+
return (currentChange.from === nextChange.from &&
|
|
320
|
+
currentChange.to === nextChange.to &&
|
|
321
|
+
currentChange.dataTracked.operation !== CHANGE_OPERATION.delete &&
|
|
322
|
+
currentChange.dataTracked.status !== CHANGE_STATUS.pending);
|
|
323
|
+
};
|
|
316
324
|
|
|
317
325
|
/*!
|
|
318
326
|
* © 2021 Atypon Systems LLC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/track-changes-plugin",
|
|
3
|
-
"version": "1.6.1-LEAN-2850",
|
|
3
|
+
"version": "1.6.1-LEAN-2850-v2",
|
|
4
4
|
"author": "Atypon Systems LLC",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/Atypon-OpenSource/manuscripts-quarterback/tree/main/quarterback-packages/track-changes-plugin",
|