mirror of
https://github.com/docmost/docmost.git
synced 2026-08-28 01:07:08 +08:00
WIP
This commit is contained in:
@@ -8,7 +8,7 @@ import { Decoration, DecorationSet } from "@tiptap/pm/view";
|
||||
import historyClasses from "./history.module.css";
|
||||
import { recreateTransform } from "@docmost/editor-ext";
|
||||
import { DOMSerializer, Node } from "@tiptap/pm/model";
|
||||
import { ChangeSet, simplifyChanges } from "prosemirror-changeset";
|
||||
import { ChangeSet, simplifyChanges } from "@tiptap/pm/changeset";
|
||||
import { useAtom } from "jotai";
|
||||
import {
|
||||
diffCountsAtom,
|
||||
|
||||
@@ -19,12 +19,14 @@ import {
|
||||
import HistoryView from "@/features/page-history/components/history-view";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { IconChevronUp, IconChevronDown } from "@tabler/icons-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface Props {
|
||||
pageId: string;
|
||||
}
|
||||
|
||||
export default function HistoryModalBody({ pageId }: Props) {
|
||||
const { t } = useTranslation();
|
||||
const [activeHistoryId, setActiveHistoryId] = useAtom(activeHistoryIdAtom);
|
||||
const [activeHistoryPrevId, setActiveHistoryPrevId] = useAtom(
|
||||
activeHistoryPrevIdAtom,
|
||||
@@ -125,11 +127,12 @@ export default function HistoryModalBody({ pageId }: Props) {
|
||||
</Group>
|
||||
)}
|
||||
<Switch
|
||||
label="Highlight changes"
|
||||
label={t("Highlight changes")}
|
||||
checked={highlightChanges}
|
||||
onChange={(e) => setHighlightChanges(e.currentTarget.checked)}
|
||||
style={{ userSelect: "none" }}
|
||||
/>
|
||||
{diffCounts && diffCounts.total > 0 && (
|
||||
{highlightChanges && diffCounts && diffCounts.total > 0 && (
|
||||
<Group gap="xs">
|
||||
<Text size="sm" c="dimmed">
|
||||
{currentChangeIndex} of {diffCounts.total}
|
||||
|
||||
Reference in New Issue
Block a user