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

add deletion

parent 105bb598
No related branches found
No related tags found
1 merge request!472Upgrade pm
/* eslint-disable prefer-object-spread */
/* eslint-disable consistent-return */
import { Selection, TextSelection } from 'prosemirror-state';
import { v4 as uuidv4 } from 'uuid';
import { Slice } from 'prosemirror-model';
import { ReplaceStep, Mapping } from 'prosemirror-transform';
import removeNode from './removeNode';
......@@ -97,13 +99,19 @@ const markDeletion = (tr, from, to, user, date, group, viewId) => {
user: user.userId,
username: user.username,
style: `color: ${user.userColor.deletion};`,
// date
date,
group,
viewid: viewId,
});
tr.setNodeMarkup(
deletionMap.map(pos),
null,
Object.assign(node.attrs.track, { track }),
Object.assign({}, node.attrs, {
track,
group,
id: uuidv4(),
}),
// Object.assign(node.attrs.track, { track }),
node.marks,
);
}
......
/* eslint-disable no-else-return */
import { v4 as uuidv4 } from 'uuid';
const markInsertion = (tr, from, to, user, date, group, viewId) => {
......@@ -39,6 +40,7 @@ const markInsertion = (tr, from, to, user, date, group, viewId) => {
tr.setNodeMarkup(
pos,
null,
// eslint-disable-next-line prefer-object-spread
Object.assign({}, node.attrs, {
track,
group,
......
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