Skip to content
Snippets Groups Projects
Commit 33f1bf9c authored by chris's avatar chris
Browse files

remove deco

parent 335c7f34
No related branches found
No related tags found
No related merge requests found
Pipeline #58145 passed with stages
in 3 minutes and 20 seconds
...@@ -116,7 +116,7 @@ const WaxView = forwardRef((props, ref) => { ...@@ -116,7 +116,7 @@ const WaxView = forwardRef((props, ref) => {
const { TrackChange } = props; const { TrackChange } = props;
const tr = const tr =
TrackChange && TrackChange.enabled TrackChange && TrackChange.enabled
? trackedTransaction(transaction, view.state, user) ? trackedTransaction(transaction, view.state, user, context)
: transaction; : transaction;
previousDoc = view.state.doc; previousDoc = view.state.doc;
......
...@@ -54,10 +54,6 @@ const markInsertion = (tr, from, to, user, date, group, viewId) => { ...@@ -54,10 +54,6 @@ const markInsertion = (tr, from, to, user, date, group, viewId) => {
// A table was inserted. We don't add track marks to elements inside of it. // A table was inserted. We don't add track marks to elements inside of it.
return false; return false;
} }
if (node.type.name === 'figure') {
console.log('remove placeholder');
// TODO delete placeholder
}
}); });
}; };
......
...@@ -17,6 +17,7 @@ const trackedTransaction = ( ...@@ -17,6 +17,7 @@ const trackedTransaction = (
tr, tr,
state, state,
user, user,
context,
group = 'main', group = 'main',
viewId = 'main', viewId = 'main',
) => { ) => {
...@@ -180,7 +181,9 @@ const trackedTransaction = ( ...@@ -180,7 +181,9 @@ const trackedTransaction = (
if (tr.scrolledIntoView) newTr.scrollIntoView(); if (tr.scrolledIntoView) newTr.scrollIntoView();
return newTr; console.log(tr.meta);
const imagePlaceholder = context.app.PmPlugins.get('imagePlaceHolder');
return newTr.setMeta(imagePlaceholder, { remove: { id: {} } });
}; };
export default trackedTransaction; export default trackedTransaction;
...@@ -24,6 +24,11 @@ export default key => ...@@ -24,6 +24,11 @@ export default key =>
set = set.remove( set = set.remove(
set.find(null, null, spec => spec.id === action.remove.id), set.find(null, null, spec => spec.id === action.remove.id),
); );
// HACK to fix
if (set?.find().length >= 1) {
set = set.remove(set.find()[0]);
set.children = [];
}
} }
return set; return set;
}, },
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment