mirror of
https://github.com/docmost/docmost.git
synced 2026-05-17 23:14:07 +08:00
WIP 3
This commit is contained in:
@@ -26,26 +26,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
:global(.history-diff-deleted) {
|
:global(.history-diff-deleted) {
|
||||||
position: relative;
|
|
||||||
z-index: 0;
|
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
opacity: 0.9;
|
color: light-dark(var(--mantine-color-red-7), var(--mantine-color-red-4));
|
||||||
}
|
background: light-dark(var(--mantine-color-red-0), rgba(255, 0, 0, 0.1));
|
||||||
|
border-radius: rem(2px);
|
||||||
:global(.history-diff-deleted)::before {
|
padding: 0 rem(2px);
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
z-index: -1;
|
|
||||||
inset: 0;
|
|
||||||
left: rem(-12px);
|
|
||||||
right: 0;
|
|
||||||
border-top: rem(1px) dashed
|
|
||||||
light-dark(var(--mantine-color-red-4), var(--mantine-color-red-6));
|
|
||||||
border-right: rem(1px) dashed
|
|
||||||
light-dark(var(--mantine-color-red-4), var(--mantine-color-red-6));
|
|
||||||
border-bottom: rem(1px) dashed
|
|
||||||
light-dark(var(--mantine-color-red-4), var(--mantine-color-red-6));
|
|
||||||
background: light-dark(var(--mantine-color-red-0), rgba(255, 0, 0, 0.08));
|
|
||||||
border-radius: rem(6px);
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,17 @@ export function HistoryEditor({
|
|||||||
addedCount += 1;
|
addedCount += 1;
|
||||||
}
|
}
|
||||||
if (change.toA > change.fromA) {
|
if (change.toA > change.fromA) {
|
||||||
|
const deletedText = docOld.textBetween(change.fromA, change.toA, "");
|
||||||
|
if (deletedText) {
|
||||||
|
decorations.push(
|
||||||
|
Decoration.widget(change.fromB, () => {
|
||||||
|
const span = document.createElement("span");
|
||||||
|
span.className = "history-diff-deleted";
|
||||||
|
span.textContent = deletedText;
|
||||||
|
return span;
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
deletedCount += 1;
|
deletedCount += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user