@manuscripts/track-changes-plugin 2.1.1 → 2.2.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.
Files changed (122) hide show
  1. package/dist/cjs/ChangeSet.js +23 -9
  2. package/dist/cjs/actions.js +3 -1
  3. package/dist/cjs/{changes/applyChanges.js → applyChanges.js} +16 -16
  4. package/dist/cjs/{changes → changeHelpers}/revertChange.js +3 -4
  5. package/dist/cjs/{mutate/dropStructureChange.js → changeHelpers/structureChange.js} +23 -17
  6. package/dist/cjs/{changes → changeHelpers}/updateChangeAttrs.js +4 -5
  7. package/dist/cjs/{changes → changeHelpers}/updateChangesStatus.js +5 -5
  8. package/dist/cjs/{changes/findChanges.js → findChanges.js} +5 -5
  9. package/dist/cjs/helpers/attributes.js +157 -0
  10. package/dist/cjs/{compute/setFragmentAsInserted.js → helpers/fragment.js} +71 -79
  11. package/dist/cjs/helpers/mark.js +19 -0
  12. package/dist/cjs/plugin.js +13 -22
  13. package/dist/cjs/trackChanges.js +47 -0
  14. package/dist/cjs/{change-steps → tracking/change-step}/diffChangeSteps.js +23 -28
  15. package/dist/cjs/{utils/mapChangeStep.js → tracking/change-step/mapChangeSteps.js} +1 -1
  16. package/dist/cjs/{change-steps → tracking/change-step}/processChangeSteps.js +14 -48
  17. package/dist/cjs/tracking/fixAndHandleSelection.js +54 -0
  18. package/dist/cjs/{mutate → tracking/lib}/deleteAndMergeSplitNodes.js +7 -40
  19. package/dist/cjs/{mutate → tracking/lib}/deleteNode.js +8 -9
  20. package/dist/cjs/{mutate/deleteText.js → tracking/lib/deleteTextIfInserted.js} +4 -4
  21. package/dist/cjs/{change-steps → tracking/lib}/matchInserted.js +15 -23
  22. package/dist/cjs/{mutate → tracking/lib}/mergeTrackedMarks.js +3 -3
  23. package/dist/cjs/tracking/lib/processStepsBeforeTracking.js +17 -0
  24. package/dist/cjs/{steps/utils.js → tracking/steps-trackers/qualifiers.js} +37 -10
  25. package/dist/cjs/{steps/trackAttrsChange.js → tracking/steps-trackers/trackAttrsChangeStep.js} +3 -3
  26. package/dist/cjs/{steps → tracking/steps-trackers}/trackMarkSteps.js +14 -11
  27. package/dist/cjs/{steps → tracking/steps-trackers}/trackReplaceAroundStep.js +12 -46
  28. package/dist/cjs/tracking/steps-trackers/trackReplaceStep.js +85 -0
  29. package/dist/cjs/tracking/trackTransaction.js +93 -0
  30. package/dist/cjs/tracking/transactionProcessing.js +164 -0
  31. package/dist/cjs/tracking/types.js +17 -0
  32. package/dist/es/ChangeSet.js +23 -9
  33. package/dist/es/actions.js +1 -0
  34. package/dist/es/{changes/applyChanges.js → applyChanges.js} +10 -10
  35. package/dist/es/{changes → changeHelpers}/revertChange.js +1 -2
  36. package/dist/es/{mutate/dropStructureChange.js → changeHelpers/structureChange.js} +10 -5
  37. package/dist/es/{changes → changeHelpers}/updateChangeAttrs.js +2 -3
  38. package/dist/es/{changes → changeHelpers}/updateChangesStatus.js +4 -4
  39. package/dist/es/{changes/findChanges.js → findChanges.js} +3 -3
  40. package/dist/es/helpers/attributes.js +136 -0
  41. package/dist/es/{compute/setFragmentAsInserted.js → helpers/fragment.js} +66 -42
  42. package/dist/es/helpers/mark.js +15 -0
  43. package/dist/es/plugin.js +12 -21
  44. package/dist/es/trackChanges.js +44 -0
  45. package/dist/es/{change-steps → tracking/change-step}/diffChangeSteps.js +23 -28
  46. package/dist/es/{utils/mapChangeStep.js → tracking/change-step/mapChangeSteps.js} +1 -1
  47. package/dist/es/{change-steps → tracking/change-step}/processChangeSteps.js +10 -11
  48. package/dist/es/tracking/fixAndHandleSelection.js +49 -0
  49. package/dist/es/{mutate → tracking/lib}/deleteAndMergeSplitNodes.js +7 -7
  50. package/dist/es/{mutate → tracking/lib}/deleteNode.js +4 -5
  51. package/dist/es/{mutate/deleteText.js → tracking/lib/deleteTextIfInserted.js} +1 -1
  52. package/dist/es/{change-steps → tracking/lib}/matchInserted.js +15 -23
  53. package/dist/es/{mutate → tracking/lib}/mergeTrackedMarks.js +2 -2
  54. package/dist/es/tracking/lib/processStepsBeforeTracking.js +14 -0
  55. package/dist/es/{steps/utils.js → tracking/steps-trackers/qualifiers.js} +32 -7
  56. package/dist/es/{steps/trackAttrsChange.js → tracking/steps-trackers/trackAttrsChangeStep.js} +3 -3
  57. package/dist/es/{steps → tracking/steps-trackers}/trackMarkSteps.js +6 -3
  58. package/dist/es/{steps → tracking/steps-trackers}/trackReplaceAroundStep.js +9 -10
  59. package/dist/es/{steps → tracking/steps-trackers}/trackReplaceStep.js +34 -26
  60. package/dist/es/tracking/trackTransaction.js +87 -0
  61. package/dist/es/tracking/transactionProcessing.js +153 -0
  62. package/dist/es/tracking/types.js +16 -0
  63. package/dist/types/ChangeSet.d.ts +4 -1
  64. package/dist/types/actions.d.ts +1 -0
  65. package/dist/types/applyChanges.d.ts +6 -0
  66. package/dist/types/{mutate/dropStructureChange.d.ts → changeHelpers/structureChange.d.ts} +2 -1
  67. package/dist/types/{changes/findChanges.d.ts → findChanges.d.ts} +1 -1
  68. package/dist/types/helpers/attributes.d.ts +47 -0
  69. package/dist/types/{compute/setFragmentAsInserted.d.ts → helpers/fragment.d.ts} +3 -1
  70. package/dist/types/helpers/mark.d.ts +3 -0
  71. package/dist/types/trackChanges.d.ts +17 -0
  72. package/dist/types/tracking/change-step/diffChangeSteps.d.ts +17 -0
  73. package/dist/types/{utils/mapChangeStep.d.ts → tracking/change-step/mapChangeSteps.d.ts} +2 -2
  74. package/dist/types/tracking/change-step/processChangeSteps.d.ts +6 -0
  75. package/dist/types/tracking/fixAndHandleSelection.d.ts +20 -0
  76. package/dist/types/{mutate → tracking/lib}/deleteAndMergeSplitNodes.d.ts +4 -5
  77. package/dist/types/{mutate → tracking/lib}/deleteNode.d.ts +2 -2
  78. package/dist/types/{mutate/deleteText.d.ts → tracking/lib/deleteTextIfInserted.d.ts} +1 -1
  79. package/dist/types/tracking/lib/matchInserted.d.ts +18 -0
  80. package/dist/types/tracking/lib/processStepsBeforeTracking.d.ts +4 -0
  81. package/dist/types/{compute → tracking/lib}/splitSliceIntoMergedParts.d.ts +1 -1
  82. package/dist/types/{steps/utils.d.ts → tracking/steps-trackers/qualifiers.d.ts} +5 -3
  83. package/dist/types/{steps/trackAttrsChange.d.ts → tracking/steps-trackers/trackAttrsChangeStep.d.ts} +4 -4
  84. package/dist/types/{steps → tracking/steps-trackers}/trackMarkSteps.d.ts +1 -1
  85. package/dist/types/{steps → tracking/steps-trackers}/trackReplaceAroundStep.d.ts +2 -2
  86. package/dist/types/tracking/steps-trackers/trackReplaceStep.d.ts +5 -0
  87. package/dist/types/tracking/trackTransaction.d.ts +4 -0
  88. package/dist/types/tracking/transactionProcessing.d.ts +12 -0
  89. package/dist/types/tracking/types.d.ts +65 -0
  90. package/dist/types/types/change.d.ts +1 -1
  91. package/dist/types/types/track.d.ts +0 -30
  92. package/package.json +2 -2
  93. package/dist/cjs/compute/nodeHelpers.js +0 -83
  94. package/dist/cjs/steps/trackReplaceStep.js +0 -110
  95. package/dist/cjs/steps/trackTransaction.js +0 -162
  96. package/dist/cjs/types/step.js +0 -2
  97. package/dist/cjs/utils/track-utils.js +0 -239
  98. package/dist/es/compute/nodeHelpers.js +0 -73
  99. package/dist/es/steps/trackTransaction.js +0 -156
  100. package/dist/es/types/step.js +0 -1
  101. package/dist/es/utils/track-utils.js +0 -217
  102. package/dist/types/change-steps/diffChangeSteps.d.ts +0 -2
  103. package/dist/types/change-steps/matchInserted.d.ts +0 -3
  104. package/dist/types/change-steps/processChangeSteps.d.ts +0 -6
  105. package/dist/types/changes/applyChanges.d.ts +0 -6
  106. package/dist/types/compute/nodeHelpers.d.ts +0 -14
  107. package/dist/types/steps/trackReplaceStep.d.ts +0 -6
  108. package/dist/types/steps/trackTransaction.d.ts +0 -3
  109. package/dist/types/types/step.d.ts +0 -40
  110. package/dist/types/utils/track-utils.d.ts +0 -24
  111. /package/dist/cjs/{changes → changeHelpers}/fixInconsistentChanges.js +0 -0
  112. /package/dist/cjs/{mutate → tracking/lib}/mergeNode.js +0 -0
  113. /package/dist/cjs/{compute → tracking/lib}/splitSliceIntoMergedParts.js +0 -0
  114. /package/dist/es/{changes → changeHelpers}/fixInconsistentChanges.js +0 -0
  115. /package/dist/es/{mutate → tracking/lib}/mergeNode.js +0 -0
  116. /package/dist/es/{compute → tracking/lib}/splitSliceIntoMergedParts.js +0 -0
  117. /package/dist/types/{changes → changeHelpers}/fixInconsistentChanges.d.ts +0 -0
  118. /package/dist/types/{changes → changeHelpers}/revertChange.d.ts +0 -0
  119. /package/dist/types/{changes → changeHelpers}/updateChangeAttrs.d.ts +0 -0
  120. /package/dist/types/{changes → changeHelpers}/updateChangesStatus.d.ts +0 -0
  121. /package/dist/types/{mutate → tracking/lib}/mergeNode.d.ts +0 -0
  122. /package/dist/types/{mutate → tracking/lib}/mergeTrackedMarks.d.ts +0 -0
@@ -1,15 +1,26 @@
1
1
  import { Slice } from 'prosemirror-model';
2
- import { getAction, TrackChangesAction } from '../actions';
3
- import { setFragmentAsInserted, setFragmentAsMoveChange, setFragmentAsNodeSplit, } from '../compute/setFragmentAsInserted';
4
- import { deleteAndMergeSplitNodes } from '../mutate/deleteAndMergeSplitNodes';
5
- import { joinStructureChanges } from '../mutate/dropStructureChange';
6
- import { log } from '../utils/logger';
7
- import * as trackUtils from '../utils/track-utils';
8
- import { isSplitStep, isStructureSteps } from './utils';
9
- export function trackReplaceStep(step, oldState, newTr, attrsTemplate, stepResult, currentStepDoc, tr, moveID) {
2
+ import { ReplaceStep } from 'prosemirror-transform';
3
+ import { getAction, TrackChangesAction } from '../../actions';
4
+ import { isStructuralChange, joinStructureChanges } from '../../changeHelpers/structureChange';
5
+ import { createNewInsertAttrs, createNewMoveAttrs } from '../../helpers/attributes';
6
+ import { setFragmentAsInserted, setFragmentAsMoveChange, setFragmentAsNodeSplit, } from '../../helpers/fragment';
7
+ import { log } from '../../utils/logger';
8
+ import { mapChangeSteps } from '../change-step/mapChangeSteps';
9
+ import { deleteAndMergeSplitNodes } from '../lib/deleteAndMergeSplitNodes';
10
+ import { isSplitStep } from './qualifiers';
11
+ export function trackReplaceStep(i, oldState, newTr, attrsTemplate, tr, deletedNodeMapping, trContext) {
12
+ const step = tr.steps[i];
13
+ const moveID = trContext.stepsByGroupIDMap.get(step);
14
+ const invertedStep = step.invert(tr.docs[i]);
15
+ const newStep = new ReplaceStep(deletedNodeMapping.map(invertedStep.from), deletedNodeMapping.map(invertedStep.to), invertedStep.slice);
16
+ const stepResult = newTr.maybeStep(newStep);
10
17
  log.info('###### ReplaceStep ######');
11
18
  let selectionPos = 0;
12
19
  const changeSteps = [];
20
+ if (stepResult.failed) {
21
+ log.error(`invert ReplaceStep failed: "${stepResult.failed}"`);
22
+ return [changeSteps, undefined];
23
+ }
13
24
  const attrs = Object.assign({}, attrsTemplate);
14
25
  if (moveID) {
15
26
  attrs.moveNodeId = moveID;
@@ -19,30 +30,18 @@ export function trackReplaceStep(step, oldState, newTr, attrsTemplate, stepResul
19
30
  log.info(`changed ranges: ${fromA} ${toA} ${fromB} ${toB}`);
20
31
  const { slice } = step;
21
32
  log.info('TR: steps before applying delete', [...newTr.steps]);
22
- if (stepResult.failed) {
23
- log.error(`invert ReplaceStep failed: "${stepResult.failed}"`);
24
- return;
25
- }
26
- const { sliceWasSplit, newSliceContent, steps: deleteSteps, } = deleteAndMergeSplitNodes(fromA, toA, undefined, currentStepDoc, newTr, oldState.schema, attrs, slice);
33
+ const { sliceWasSplit, newSliceContent, steps: deleteSteps, } = deleteAndMergeSplitNodes(fromA, toA, undefined, tr.docs[i], oldState.schema, attrs, slice);
27
34
  changeSteps.push(...deleteSteps);
28
35
  log.info('TR: steps after applying delete', [...newTr.steps]);
29
36
  log.info('DELETE STEPS: ', [...changeSteps]);
30
- function sameThingBackSpaced() {
31
- if (changeSteps.length == 2 && newSliceContent.size > 0) {
32
- const correspondingDeletion = changeSteps.find((step) => step.type === 'delete-text' && step.node.text === newSliceContent.content[0].text);
33
- return correspondingDeletion;
34
- }
35
- return undefined;
36
- }
37
- const backSpacedText = sameThingBackSpaced();
37
+ const backSpacedText = sameThingBackSpaced(changeSteps, newSliceContent);
38
38
  if (backSpacedText) {
39
- console.log('Detected backspacing');
40
39
  changeSteps.splice(changeSteps.indexOf(backSpacedText));
41
40
  }
42
41
  if (!backSpacedText && newSliceContent.size > 0) {
43
42
  log.info('newSliceContent', newSliceContent);
44
- let fragment = setFragmentAsInserted(newSliceContent, trackUtils.createNewInsertAttrs(attrs), oldState.schema);
45
- if (isStructureSteps(tr)) {
43
+ let fragment = setFragmentAsInserted(newSliceContent, createNewInsertAttrs(attrs), oldState.schema);
44
+ if (isStructuralChange(tr)) {
46
45
  fragment = joinStructureChanges(attrs, newSliceContent, fragment, tr, newTr);
47
46
  }
48
47
  else if (isSplitStep(step, oldState.selection, tr.getMeta('uiEvent'))) {
@@ -50,7 +49,7 @@ export function trackReplaceStep(step, oldState, newTr, attrsTemplate, stepResul
50
49
  }
51
50
  else if (moveID) {
52
51
  const indentationType = (_a = getAction(tr, TrackChangesAction.indentationAction)) === null || _a === void 0 ? void 0 : _a.action;
53
- fragment = setFragmentAsMoveChange(newSliceContent, trackUtils.createNewMoveAttrs(attrs, indentationType));
52
+ fragment = setFragmentAsMoveChange(newSliceContent, createNewMoveAttrs(attrs, indentationType));
54
53
  }
55
54
  const openStart = slice.openStart !== slice.openEnd ? 0 : slice.openStart;
56
55
  const openEnd = slice.openStart !== slice.openEnd ? 0 : slice.openEnd;
@@ -70,5 +69,14 @@ export function trackReplaceStep(step, oldState, newTr, attrsTemplate, stepResul
70
69
  selectionPos = isDeleteEvent || isDeleteContentForward ? toA : fromA;
71
70
  }
72
71
  });
73
- return [changeSteps, selectionPos];
72
+ selectionPos = deletedNodeMapping.map(selectionPos);
73
+ const doneSteps = mapChangeSteps(changeSteps, deletedNodeMapping);
74
+ return [doneSteps, selectionPos];
75
+ }
76
+ function sameThingBackSpaced(changeSteps, newSliceContent) {
77
+ if (changeSteps.length == 2 && newSliceContent.size > 0) {
78
+ const correspondingDeletion = changeSteps.find((step) => step.type === 'delete-text' && step.node.text === newSliceContent.content[0].text);
79
+ return correspondingDeletion;
80
+ }
81
+ return undefined;
74
82
  }
@@ -0,0 +1,87 @@
1
+ import { AddMarkStep, AddNodeMarkStep, AttrStep, Mapping, RemoveMarkStep, RemoveNodeMarkStep, ReplaceAroundStep, ReplaceStep, } from 'prosemirror-transform';
2
+ import { isStructuralChange } from '../changeHelpers/structureChange';
3
+ import { updateChangeAttrs } from '../changeHelpers/updateChangeAttrs';
4
+ import { createNewPendingAttrs, getNodeTrackedData } from '../helpers/attributes';
5
+ import { log } from '../utils/logger';
6
+ import { uuidv4 } from '../utils/uuidv4';
7
+ import { diffChangeSteps } from './change-step/diffChangeSteps';
8
+ import { processChangeSteps } from './change-step/processChangeSteps';
9
+ import { fixAndSetSelectionAfterTracking } from './fixAndHandleSelection';
10
+ import { isDeleteStep } from './steps-trackers/qualifiers';
11
+ import trackAttrsChangeStep from './steps-trackers/trackAttrsChangeStep';
12
+ import { trackAddMarkStep, trackAddNodeMarkStep, trackRemoveMarkStep, trackRemoveNodeMarkStep, } from './steps-trackers/trackMarkSteps';
13
+ import { trackReplaceAroundStep } from './steps-trackers/trackReplaceAroundStep';
14
+ import { trackReplaceStep } from './steps-trackers/trackReplaceStep';
15
+ import { excludeFromTracking, iterationIsValid, passThroughMeta } from './transactionProcessing';
16
+ export function trackTransaction(tr, oldState, newTr, authorID, clearedSteps, trContext) {
17
+ var _a, _b, _c, _d, _e;
18
+ const emptyAttrs = createNewPendingAttrs(tr.time, authorID);
19
+ const deletedNodeMapping = new Mapping();
20
+ trContext = Object.assign(Object.assign({}, trContext), { deletedNodeMapping });
21
+ let iterations = 0;
22
+ log.info('ORIGINAL transaction', tr);
23
+ for (let i = clearedSteps.length - 1; i >= 0; i--) {
24
+ const step = clearedSteps[i];
25
+ if (!step) {
26
+ continue;
27
+ }
28
+ log.info('transaction step', step);
29
+ iterations++;
30
+ if (!iterationIsValid(iterations, tr, newTr, step)) {
31
+ continue;
32
+ }
33
+ else if (step instanceof ReplaceStep) {
34
+ const { slice } = step;
35
+ if (((_b = (_a = slice === null || slice === void 0 ? void 0 : slice.content) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.length) === 1 && excludeFromTracking(slice.content.content[0])) {
36
+ continue;
37
+ }
38
+ let thisStepMapping = tr.mapping.slice(i + 1, i + 1);
39
+ if (isDeleteStep(step) || isStructuralChange(tr)) {
40
+ thisStepMapping = deletedNodeMapping;
41
+ }
42
+ let [steps, newSelectionPos] = trackReplaceStep(i, oldState, newTr, emptyAttrs, tr, thisStepMapping, trContext);
43
+ if (steps.length === 1) {
44
+ const step = steps[0];
45
+ if (excludeFromTracking((step === null || step === void 0 ? void 0 : step.node) || ((_d = (_c = step === null || step === void 0 ? void 0 : step.slice) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.content[0]))) {
46
+ continue;
47
+ }
48
+ }
49
+ log.info('TRACK REPLACE CHANGES: ', [...steps]);
50
+ steps = diffChangeSteps(steps);
51
+ log.info('DIFFED STEPS: ', steps);
52
+ const [_, updatedSelectionPos] = processChangeSteps(steps, newTr, trContext.stepsByGroupIDMap.has(step)
53
+ ? Object.assign(Object.assign({}, emptyAttrs), { moveNodeId: trContext.stepsByGroupIDMap.get(step) }) : emptyAttrs, oldState.schema, deletedNodeMapping);
54
+ trContext.selectionPosFromInsertion = updatedSelectionPos || newSelectionPos || tr.selection.head;
55
+ }
56
+ else if (step instanceof ReplaceAroundStep) {
57
+ let steps = trackReplaceAroundStep(step, oldState, tr, newTr, emptyAttrs, tr.docs[i], trContext);
58
+ steps = diffChangeSteps(steps);
59
+ log.info('DIFFED STEPS: ', steps);
60
+ processChangeSteps(steps, newTr, emptyAttrs, oldState.schema, deletedNodeMapping);
61
+ }
62
+ else if (step instanceof AttrStep) {
63
+ const changeSteps = trackAttrsChangeStep(step, oldState, tr, newTr, emptyAttrs, tr.docs[i]);
64
+ processChangeSteps(changeSteps, newTr, emptyAttrs, oldState.schema, deletedNodeMapping);
65
+ }
66
+ else if (step instanceof AddMarkStep) {
67
+ trackAddMarkStep(step, emptyAttrs, newTr, tr.docs[i]);
68
+ const dataTracked = (_e = getNodeTrackedData(newTr.doc.nodeAt(step.from), oldState.schema)) === null || _e === void 0 ? void 0 : _e.pop();
69
+ if (dataTracked) {
70
+ updateChangeAttrs(newTr, { id: dataTracked.id, from: step.from, to: step.to, type: 'text-change', dataTracked }, Object.assign(Object.assign({}, dataTracked), { id: uuidv4() }), oldState.schema);
71
+ }
72
+ }
73
+ else if (step instanceof RemoveMarkStep) {
74
+ trackRemoveMarkStep(step, emptyAttrs, newTr, tr.docs[i]);
75
+ }
76
+ else if (step instanceof RemoveNodeMarkStep) {
77
+ trackRemoveNodeMarkStep(step, emptyAttrs, newTr, tr.docs[i]);
78
+ }
79
+ else if (step instanceof AddNodeMarkStep) {
80
+ trackAddNodeMarkStep(step, emptyAttrs, newTr, tr.docs[i]);
81
+ }
82
+ }
83
+ newTr = passThroughMeta(tr, newTr);
84
+ newTr = fixAndSetSelectionAfterTracking(newTr, tr, deletedNodeMapping, trContext);
85
+ log.info('NEW transaction', newTr);
86
+ return newTr;
87
+ }
@@ -0,0 +1,153 @@
1
+ import { ReplaceStep } from 'prosemirror-transform';
2
+ import { isIndentationAction, TrackChangesAction } from '../actions';
3
+ import { ChangeSet } from '../ChangeSet';
4
+ import { CHANGE_OPERATION, CHANGE_STATUS } from '../types/change';
5
+ import { uuidv4 } from '../utils/uuidv4';
6
+ import { isDeletingPendingMovedNode, isDirectPendingMoveDeletion } from './steps-trackers/qualifiers';
7
+ export function getIndentationOperationSteps(tr, trContext) {
8
+ if (isIndentationAction(trContext.action)) {
9
+ const moveId = uuidv4();
10
+ for (let i = 0; i < tr.steps.length; i++) {
11
+ const step = tr.steps[i];
12
+ if (step instanceof ReplaceStep) {
13
+ trContext.stepsByGroupIDMap.set(step, moveId);
14
+ }
15
+ }
16
+ }
17
+ }
18
+ export const excludeFromTracking = (node) => {
19
+ var _a;
20
+ if (node.isText) {
21
+ return false;
22
+ }
23
+ return node && !((_a = node.type.spec.attrs) === null || _a === void 0 ? void 0 : _a.dataTracked);
24
+ };
25
+ export function passThroughMeta(oldTr, newTr) {
26
+ oldTr.getMeta('inputType') && newTr.setMeta('inputType', oldTr.getMeta('inputType'));
27
+ oldTr.getMeta('uiEvent') && newTr.setMeta('uiEvent', oldTr.getMeta('uiEvent'));
28
+ return newTr;
29
+ }
30
+ export function iterationIsValid(iterations, oldTr, newTr, step) {
31
+ const uiEvent = oldTr.getMeta('uiEvent');
32
+ const isMassReplace = oldTr.getMeta('massSearchReplace');
33
+ if (iterations > 20 && uiEvent != 'cut' && !isMassReplace) {
34
+ console.error('@manuscripts/track-changes-plugin: Possible infinite loop in iterating tr.steps, tracking skipped!\n' +
35
+ 'This is probably an error with the library, please report back to maintainers with a reproduction if possible', newTr);
36
+ return false;
37
+ }
38
+ else if (!(step instanceof ReplaceStep) && step.constructor.name === 'ReplaceStep') {
39
+ console.error('@manuscripts/track-changes-plugin: Multiple prosemirror-transform packages imported, alias/dedupe them ' +
40
+ 'or instanceof checks fail as well as creating new steps');
41
+ return false;
42
+ }
43
+ return true;
44
+ }
45
+ export const getMoveOperationsSteps = (tr, context) => {
46
+ const movingAssoc = context.stepsByGroupIDMap;
47
+ if (tr.steps.length < 2) {
48
+ return movingAssoc;
49
+ }
50
+ if (tr.getMeta(TrackChangesAction.structuralChangeAction)) {
51
+ const commonID = uuidv4();
52
+ movingAssoc.set(tr.steps[0], commonID);
53
+ movingAssoc.set(tr.steps[1], commonID);
54
+ return movingAssoc;
55
+ }
56
+ const matched = [];
57
+ for (let i = 0; i < tr.steps.length; i++) {
58
+ if (matched.includes(i)) {
59
+ continue;
60
+ }
61
+ const step = tr.steps[i];
62
+ const doc = tr.docs[i];
63
+ if (!step.slice) {
64
+ continue;
65
+ }
66
+ const stepDeletesContent = step.from !== step.to && step.slice.size === 0;
67
+ const stepInsertsContent = step.slice.size && step.slice.content.firstChild ? true : false;
68
+ for (let g = 0; g < tr.steps.length; g++) {
69
+ if (g === i || matched.includes(g)) {
70
+ continue;
71
+ }
72
+ const peerStep = tr.steps[g];
73
+ if (!peerStep.slice) {
74
+ continue;
75
+ }
76
+ const peerStepInsertsContent = peerStep.slice.size && peerStep.slice.content.firstChild;
77
+ const peerStepDeletesContent = peerStep.from !== peerStep.to && peerStep.slice.size === 0;
78
+ if (stepDeletesContent) {
79
+ const deletedContent = doc.slice(step.from, step.to);
80
+ if (peerStepInsertsContent &&
81
+ deletedContent.content.firstChild &&
82
+ peerStep.slice.content.firstChild.toString() === deletedContent.content.firstChild.toString()) {
83
+ const commonID = uuidv4();
84
+ movingAssoc.set(peerStep, commonID);
85
+ movingAssoc.set(step, commonID);
86
+ matched.push(i, g);
87
+ }
88
+ continue;
89
+ }
90
+ if (stepInsertsContent && peerStepDeletesContent) {
91
+ const insertedContent = step.slice;
92
+ const deletedPeerContent = tr.docs[g].slice(peerStep.from, peerStep.to);
93
+ if (insertedContent.content.firstChild &&
94
+ deletedPeerContent.content.firstChild &&
95
+ insertedContent.content.firstChild.toString() === deletedPeerContent.content.firstChild.toString()) {
96
+ const commonID = uuidv4();
97
+ movingAssoc.set(peerStep, commonID);
98
+ movingAssoc.set(step, commonID);
99
+ }
100
+ matched.push(i, g);
101
+ }
102
+ }
103
+ }
104
+ };
105
+ export const changeMovedToInsertsOnSourceDeletion = (tr, newTr, trContext) => {
106
+ for (let i = 0; i < tr.steps.length; i++) {
107
+ const step = tr.steps[i];
108
+ if (step instanceof ReplaceStep) {
109
+ const doc = tr.docs[tr.steps.indexOf(step)];
110
+ if (isDirectPendingMoveDeletion(step, doc, trContext.stepsByGroupIDMap)) {
111
+ const node = doc.nodeAt(step.from);
112
+ if (node === null || node === void 0 ? void 0 : node.attrs.dataTracked) {
113
+ newTr.setNodeMarkup(step.from, undefined, Object.assign(Object.assign({}, node.attrs), { dataTracked: node.attrs.dataTracked.filter((t) => !(t.operation === CHANGE_OPERATION.move && t.status === CHANGE_STATUS.pending)) }));
114
+ }
115
+ }
116
+ }
117
+ }
118
+ };
119
+ export const filterMeaninglessMoveSteps = (tr, context) => {
120
+ var _a;
121
+ const cleanSteps = [];
122
+ for (let i = 0; i < tr.steps.length; i++) {
123
+ const step = tr.steps[i];
124
+ const moveID = context.stepsByGroupIDMap.get(step);
125
+ if (moveID) {
126
+ const prevMoveID = isDeletingPendingMovedNode(step, tr.docs[i]);
127
+ if (prevMoveID) {
128
+ context.stepsByGroupIDMap.forEach((replaceStepMoveID, replaceStep) => {
129
+ if (replaceStep !== step && moveID === replaceStepMoveID) {
130
+ context.stepsByGroupIDMap.set(replaceStep, prevMoveID);
131
+ }
132
+ });
133
+ cleanSteps.push(null);
134
+ continue;
135
+ }
136
+ if (step instanceof ReplaceStep && !tr.getMeta(TrackChangesAction.structuralChangeAction)) {
137
+ const { slice } = step;
138
+ if ((_a = slice === null || slice === void 0 ? void 0 : slice.content) === null || _a === void 0 ? void 0 : _a.firstChild) {
139
+ const insertedNode = slice.content.firstChild;
140
+ if (insertedNode.attrs.dataTracked) {
141
+ const isPendingInsert = ChangeSet.isPendingChange(insertedNode.attrs.dataTracked, CHANGE_OPERATION.insert);
142
+ if (isPendingInsert) {
143
+ continue;
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+ cleanSteps.push(step);
150
+ }
151
+ return cleanSteps;
152
+ };
153
+ export const trFromHistory = (tr) => Object.keys(tr.meta).find((s) => s.startsWith('history$'));
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * © 2025 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -1,4 +1,4 @@
1
- import { IncompleteChange, MarkChange, NodeAttrChange, NodeChange, ReferenceChange, RootChanges, TextChange, TrackedAttrs, TrackedChange } from './types/change';
1
+ import { CHANGE_OPERATION, IncompleteChange, MarkChange, NodeAttrChange, NodeChange, ReferenceChange, RootChanges, TextChange, TrackedAttrs, TrackedChange } from './types/change';
2
2
  export declare class ChangeSet {
3
3
  #private;
4
4
  constructor(changes?: (TrackedChange | IncompleteChange)[]);
@@ -29,9 +29,12 @@ export declare class ChangeSet {
29
29
  static flattenTreeToIds(changes: TrackedChange[]): string[];
30
30
  static shouldDeleteChange(change: TrackedChange): boolean;
31
31
  static isValidDataTracked(dataTracked?: Partial<TrackedAttrs>): boolean;
32
+ static isInlineMarkChange(change: TrackedChange): boolean;
33
+ static isInline(c: TrackedChange): boolean;
32
34
  static isTextChange(change: TrackedChange): change is TextChange;
33
35
  static isMarkChange(change: TrackedChange): change is MarkChange;
34
36
  static isNodeChange(change: TrackedChange): change is NodeChange;
35
37
  static isNodeAttrChange(change: TrackedChange): change is NodeAttrChange;
36
38
  static isReferenceChange(change: TrackedChange): change is ReferenceChange;
39
+ static isPendingChange(trackedAttrs: TrackedAttrs[] | undefined, operation: CHANGE_OPERATION): boolean;
37
40
  }
@@ -30,3 +30,4 @@ export declare function hasAction(tr: Transaction): boolean;
30
30
  export declare function getAction<K extends keyof TrackChangesActionParams>(tr: Transaction, action: K): TrackChangesActionParams[K] | undefined;
31
31
  export declare function setAction<K extends keyof TrackChangesActionParams>(tr: Transaction, action: K, payload: TrackChangesActionParams[K]): Transaction;
32
32
  export declare const skipTracking: (tr: Transaction) => Transaction;
33
+ export declare const isIndentationAction: (action: ReturnType<typeof getAction>) => action is "indent" | "unindent";
@@ -0,0 +1,6 @@
1
+ import { Schema } from 'prosemirror-model';
2
+ import { Transaction } from 'prosemirror-state';
3
+ import { Mapping } from 'prosemirror-transform';
4
+ import { ChangeSet } from './ChangeSet';
5
+ import { TrackedChange } from './types/change';
6
+ export declare function applyChanges(tr: Transaction, schema: Schema, changes: TrackedChange[], changeSet: ChangeSet, deleteMap?: Mapping): Mapping;
@@ -1,6 +1,7 @@
1
1
  import { Fragment } from 'prosemirror-model';
2
2
  import { Transaction } from 'prosemirror-state';
3
- import { NewEmptyAttrs } from '../types/track';
3
+ import { NewEmptyAttrs } from '../helpers/attributes';
4
4
  export declare const dropStructuralChangeShadow: (moveNodeId: string | undefined, tr: Transaction) => Transaction;
5
5
  export declare const dropOrphanChanges: (newTr: Transaction) => void;
6
6
  export declare const joinStructureChanges: (attrs: NewEmptyAttrs, sliceContent: Fragment, content: Fragment, tr: Transaction, newTr: Transaction) => Fragment;
7
+ export declare const isStructuralChange: (tr: Transaction) => any;
@@ -1,3 +1,3 @@
1
1
  import { EditorState } from 'prosemirror-state';
2
- import { ChangeSet } from '../ChangeSet';
2
+ import { ChangeSet } from './ChangeSet';
3
3
  export declare function findChanges(state: EditorState): ChangeSet;
@@ -0,0 +1,47 @@
1
+ import { Attrs, Fragment, Mark, Node as PMNode, Schema } from 'prosemirror-model';
2
+ import { CHANGE_OPERATION, TrackedAttrs } from '../types/change';
3
+ export type NewEmptyAttrs = Omit<TrackedAttrs, 'id' | 'operation'>;
4
+ export type NewInsertAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
5
+ operation: CHANGE_OPERATION.insert | CHANGE_OPERATION.wrap_with_node | CHANGE_OPERATION.structure;
6
+ };
7
+ export type NewDeleteAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
8
+ operation: CHANGE_OPERATION.delete;
9
+ };
10
+ export type NewUpdateAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
11
+ operation: CHANGE_OPERATION.set_node_attributes;
12
+ oldAttrs: Record<string, any>;
13
+ };
14
+ export type NewSplitNodeAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
15
+ operation: CHANGE_OPERATION.node_split;
16
+ };
17
+ export type NewMoveAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
18
+ operation: CHANGE_OPERATION.move;
19
+ indentationType?: 'indent' | 'unindent';
20
+ };
21
+ export type NewReferenceAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
22
+ operation: CHANGE_OPERATION.reference;
23
+ referenceId: string;
24
+ };
25
+ export type NewTrackedAttrs = NewInsertAttrs | NewDeleteAttrs | NewUpdateAttrs | NewMoveAttrs;
26
+ export declare function createNewInsertAttrs(attrs: NewEmptyAttrs): NewInsertAttrs;
27
+ export declare function createNewWrapAttrs(attrs: NewEmptyAttrs): NewInsertAttrs;
28
+ export declare function createNewSplitAttrs(attrs: NewEmptyAttrs): NewSplitNodeAttrs;
29
+ export declare function createNewReferenceAttrs(attrs: NewEmptyAttrs, id: string): NewReferenceAttrs;
30
+ export declare function createNewDeleteAttrs(attrs: NewEmptyAttrs): NewDeleteAttrs;
31
+ export declare function createNewMoveAttrs(attrs: NewEmptyAttrs, indentationType?: 'indent' | 'unindent'): NewMoveAttrs;
32
+ export declare function createNewUpdateAttrs(attrs: NewEmptyAttrs, oldAttrs: Record<string, any>): NewUpdateAttrs;
33
+ export declare function createNewStructureAttrs(attrs: NewEmptyAttrs): NewInsertAttrs;
34
+ export declare function createNewPendingAttrs(time: number, authorID: string): NewEmptyAttrs;
35
+ export declare function addTrackIdIfDoesntExist(attrs: Partial<TrackedAttrs>): Partial<TrackedAttrs>;
36
+ export declare function getTextNodeTrackedMarkData(node: PMNode | null, schema: Schema): (Omit<Partial<TrackedAttrs>, "operation"> & {
37
+ operation: CHANGE_OPERATION;
38
+ }) | undefined;
39
+ export declare function getBlockInlineTrackedData(node: PMNode): Partial<TrackedAttrs>[] | undefined;
40
+ export declare function getMarkTrackedData(node: PMNode | undefined | null): Map<Mark, Partial<TrackedAttrs>[]>;
41
+ export declare function getNodeTrackedData(node: PMNode | undefined | null, schema: Schema): Partial<TrackedAttrs>[] | undefined;
42
+ export declare function shouldMergeTrackedAttributes(left?: Partial<TrackedAttrs>, right?: Partial<TrackedAttrs>): boolean;
43
+ export declare function getMergeableMarkTrackedAttrs(node: PMNode | null, attrs: Partial<TrackedAttrs>, schema: Schema): (Omit<Partial<TrackedAttrs>, "operation"> & {
44
+ operation: CHANGE_OPERATION;
45
+ }) | null;
46
+ export declare const updateBlockNodesAttrs: (fragment: Fragment, predicate: (attrs: Attrs, node: PMNode) => Attrs) => Fragment;
47
+ export declare function excludeFromTracked(dataTracked: TrackedAttrs[] | null, changeIdToExclude: string): TrackedAttrs[] | null;
@@ -1,7 +1,9 @@
1
1
  import { Fragment, ResolvedPos, Schema } from 'prosemirror-model';
2
2
  import { Transaction } from 'prosemirror-state';
3
- import { NewEmptyAttrs, NewInsertAttrs, NewMoveAttrs } from '../types/track';
3
+ import { ExposedFragment } from '../types/pm';
4
+ import { NewEmptyAttrs, NewInsertAttrs, NewMoveAttrs } from './attributes';
4
5
  export declare function setFragmentAsInserted(inserted: Fragment, insertAttrs: NewInsertAttrs, schema: Schema): Fragment;
5
6
  export declare function setFragmentAsWrapChange(inserted: Fragment, attrs: NewEmptyAttrs, schema: Schema): Fragment;
6
7
  export declare function setFragmentAsMoveChange(fragment: Fragment, moveAttrs: NewMoveAttrs): Fragment;
7
8
  export declare function setFragmentAsNodeSplit($pos: ResolvedPos, newTr: Transaction, inserted: Fragment, attrs: NewEmptyAttrs): Fragment;
9
+ export declare function cutFragment(matched: number, deleted: number, content: Fragment): [number, ExposedFragment];
@@ -0,0 +1,3 @@
1
+ import { Mark, Node as PMNode } from 'prosemirror-model';
2
+ export declare function isValidTrackableMark(mark: Mark): boolean;
3
+ export declare function equalMarks(n1: PMNode, n2: PMNode): boolean;
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * © 2025 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { EditorState, PluginKey, Transaction } from 'prosemirror-state';
17
+ export declare function trackChanges(tr: Transaction, createdTr: Transaction, oldState: EditorState, userID: string, skipTrsWithMetas: (string | PluginKey<any>)[]): Transaction | undefined;
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * © 2025 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { ChangeStep } from '../types';
17
+ export declare function diffChangeSteps(steps: ChangeStep[]): ChangeStep[];
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * © 2023 Atypon Systems LLC
2
+ * © 2025 Atypon Systems LLC
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Mapping } from 'prosemirror-transform';
17
- import { ChangeStep } from '../types/step';
17
+ import { ChangeStep } from '../types';
18
18
  export declare function mapChangeSteps(steps: ChangeStep[], mapping: Mapping): ChangeStep[];
@@ -0,0 +1,6 @@
1
+ import { Schema } from 'prosemirror-model';
2
+ import type { Transaction } from 'prosemirror-state';
3
+ import { Mapping } from 'prosemirror-transform';
4
+ import { NewEmptyAttrs } from '../../helpers/attributes';
5
+ import { ChangeStep } from '../types';
6
+ export declare function processChangeSteps(changes: ChangeStep[], newTr: Transaction, emptyAttrs: NewEmptyAttrs, schema: Schema, deletedNodeMapping: Mapping): [Mapping, number | undefined];
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * © 2025 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Selection, Transaction } from 'prosemirror-state';
17
+ import { Mapping } from 'prosemirror-transform';
18
+ import { TrTrackingContext } from './types';
19
+ export declare const getSelectionStaticConstructor: (sel: Selection) => any;
20
+ export declare function fixAndSetSelectionAfterTracking(newTr: Transaction, oldTr: Transaction, deletedNodeMapping: Mapping, trContext: TrTrackingContext): Transaction;
@@ -1,14 +1,13 @@
1
1
  import { Fragment, Node as PMNode, Schema, Slice } from 'prosemirror-model';
2
- import type { Transaction } from 'prosemirror-state';
3
- import { ExposedSlice } from '../types/pm';
4
- import { ChangeStep } from '../types/step';
5
- import { NewEmptyAttrs } from '../types/track';
2
+ import { NewEmptyAttrs } from '../../helpers/attributes';
3
+ import { ExposedSlice } from '../../types/pm';
4
+ import { ChangeStep } from '../types';
6
5
  export declare function deleteAndMergeSplitNodes(from: number, to: number, gap: {
7
6
  start: number;
8
7
  end: number;
9
8
  slice: Slice;
10
9
  insert: number;
11
- } | undefined, startDoc: PMNode, newTr: Transaction, schema: Schema, trackAttrs: NewEmptyAttrs, insertSlice: ExposedSlice): {
10
+ } | undefined, startDoc: PMNode, schema: Schema, trackAttrs: NewEmptyAttrs, insertSlice: ExposedSlice): {
12
11
  sliceWasSplit: boolean;
13
12
  newSliceContent: Fragment;
14
13
  steps: ChangeStep[];
@@ -1,6 +1,6 @@
1
1
  import { Node as PMNode } from 'prosemirror-model';
2
2
  import { Transaction } from 'prosemirror-state';
3
- import { NewDeleteAttrs } from '../types/track';
3
+ import { NewDeleteAttrs } from '../../helpers/attributes';
4
4
  export declare function deleteNode(node: PMNode, pos: number, tr: Transaction): Transaction;
5
5
  export declare function deleteOrSetNodeDeleted(node: PMNode, pos: number, newTr: Transaction, deleteAttrs: NewDeleteAttrs): Transaction | undefined;
6
- export declare const keepPairedChanges: (node: PMNode) => Partial<import("../types/change").TrackedAttrs>[] | null;
6
+ export declare const keepPairedChanges: (node: PMNode) => Partial<import("../../types/change").TrackedAttrs>[] | null;
@@ -1,4 +1,4 @@
1
1
  import { Node as PMNode, Schema } from 'prosemirror-model';
2
2
  import type { Transaction } from 'prosemirror-state';
3
- import { NewDeleteAttrs } from '../types/track';
3
+ import { NewDeleteAttrs } from '../../helpers/attributes';
4
4
  export declare function deleteTextIfInserted(node: PMNode, pos: number, newTr: Transaction, schema: Schema, deleteAttrs: NewDeleteAttrs, from?: number, to?: number): number;
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * © 2023 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { ExposedFragment } from '../../types/pm';
17
+ import { ChangeStep } from '../types';
18
+ export declare function matchInserted(matchedDeleted: number, deleted: ChangeStep[], inserted: ExposedFragment): [number, ChangeStep[]];
@@ -0,0 +1,4 @@
1
+ import { Transaction } from 'prosemirror-state';
2
+ import { Step } from 'prosemirror-transform';
3
+ import { TrTrackingContext } from '../types';
4
+ export declare function processStepsBeforeTracking(tr: Transaction, trContext: TrTrackingContext, processors: Array<(tr: Transaction, context: TrTrackingContext) => Step[] | void>): Step[];
@@ -1,5 +1,5 @@
1
1
  import { Node as PMNode } from 'prosemirror-model';
2
- import { ExposedFragment, ExposedSlice } from '../types/pm';
2
+ import { ExposedFragment, ExposedSlice } from '../../types/pm';
3
3
  export declare function splitSliceIntoMergedParts(insertSlice: ExposedSlice, mergeEqualSides?: boolean): {
4
4
  updatedSliceNodes: readonly PMNode[] & PMNode[];
5
5
  firstMergedNode: {