From a386d4c56bcbfb8336a9e995e7740ac521c3f17a Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Fri, 9 Feb 2024 09:09:09 +0200 Subject: [PATCH] find cases --- .../src/utilities/track-changes/helpers/markDeletion.js | 3 +++ .../src/utilities/track-changes/helpers/markInsertion.js | 3 +++ .../src/utilities/track-changes/trackedTransaction.js | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wax-prosemirror-core/src/utilities/track-changes/helpers/markDeletion.js b/wax-prosemirror-core/src/utilities/track-changes/helpers/markDeletion.js index 8b4dce4c8..85f582802 100644 --- a/wax-prosemirror-core/src/utilities/track-changes/helpers/markDeletion.js +++ b/wax-prosemirror-core/src/utilities/track-changes/helpers/markDeletion.js @@ -20,6 +20,9 @@ const markDeletion = (tr, from, to, user, date, group, viewId) => { if (node.type.name.includes('table')) { return; } + if (node.type.name === 'figure') { + console.log('delete figure'); + } if ( node.isInline && node.marks.find( diff --git a/wax-prosemirror-core/src/utilities/track-changes/helpers/markInsertion.js b/wax-prosemirror-core/src/utilities/track-changes/helpers/markInsertion.js index d66ad1ae3..f8b533330 100644 --- a/wax-prosemirror-core/src/utilities/track-changes/helpers/markInsertion.js +++ b/wax-prosemirror-core/src/utilities/track-changes/helpers/markInsertion.js @@ -54,6 +54,9 @@ const markInsertion = (tr, from, to, user, date, group, viewId) => { // A table was inserted. We don't add track marks to elements inside of it. return false; } + if (node.type.name === 'figure') { + // TODO delete placeholder + } }); }; diff --git a/wax-prosemirror-core/src/utilities/track-changes/trackedTransaction.js b/wax-prosemirror-core/src/utilities/track-changes/trackedTransaction.js index 25e832403..dfa99b2c4 100644 --- a/wax-prosemirror-core/src/utilities/track-changes/trackedTransaction.js +++ b/wax-prosemirror-core/src/utilities/track-changes/trackedTransaction.js @@ -30,7 +30,7 @@ const trackedTransaction = ( } } } - console.log('up', tr); + console.log(tr); if ( !tr.steps.length || (tr.meta && @@ -46,7 +46,7 @@ const trackedTransaction = ( const newTr = state.tr; const map = new Mapping(); const date = Math.floor(Date.now()); - console.log(tr); + tr.steps.forEach((originalStep, originalStepIndex) => { const step = originalStep.map(map); const { doc } = newTr; -- GitLab