This commit is contained in:
Philipinho
2026-02-01 11:16:38 +00:00
parent 56f476649c
commit 483e39db1c
6 changed files with 19 additions and 23 deletions
@@ -123,6 +123,7 @@
"page": "page",
"Page deleted successfully": "Page deleted successfully",
"Page history": "Page history",
"Highlight changes": "Highlight changes",
"Page import is in progress. Please do not close this tab.": "Page import is in progress. Please do not close this tab.",
"Pages": "Pages",
"pages": "pages",
@@ -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}
+3 -1
View File
@@ -60,6 +60,7 @@
"bytes": "^3.1.2",
"cross-env": "^7.0.3",
"date-fns": "^4.1.0",
"diff": "8.0.3",
"dompurify": "^3.2.6",
"fractional-indexing-jittered": "^1.0.0",
"highlight.js": "^11.11.1",
@@ -69,8 +70,8 @@
"linkifyjs": "^4.3.2",
"marked": "13.0.3",
"ms": "3.0.0-canary.1",
"prosemirror-changeset": "2.3.1",
"qrcode": "^1.5.4",
"rfc6902": "5.1.2",
"uuid": "^11.1.0",
"y-indexeddb": "^9.0.12",
"y-prosemirror": "1.3.7",
@@ -99,6 +100,7 @@
"overrides": {
"jsdom": "25.0.1",
"jsonwebtoken": "9.0.3",
"prosemirror-changeset": "2.3.1",
"y-prosemirror": "1.3.7"
},
"neverBuiltDependencies": []
+1 -5
View File
@@ -9,9 +9,5 @@
"main": "dist/index.js",
"module": "./src/index.ts",
"types": "dist/index.d.ts",
"dependencies": {
"diff": "8.0.3",
"prosemirror-changeset": "2.3.1",
"rfc6902": "5.1.2"
}
"dependencies": {}
}
+8 -14
View File
@@ -7,6 +7,7 @@ settings:
overrides:
jsdom: 25.0.1
jsonwebtoken: 9.0.3
prosemirror-changeset: 2.3.1
y-prosemirror: 1.3.7
patchedDependencies:
@@ -141,6 +142,9 @@ importers:
date-fns:
specifier: ^4.1.0
version: 4.1.0
diff:
specifier: 8.0.3
version: 8.0.3
dompurify:
specifier: ^3.2.6
version: 3.2.6
@@ -168,12 +172,12 @@ importers:
ms:
specifier: 3.0.0-canary.1
version: 3.0.0-canary.1
prosemirror-changeset:
specifier: 2.3.1
version: 2.3.1
qrcode:
specifier: ^1.5.4
version: 1.5.4
rfc6902:
specifier: 5.1.2
version: 5.1.2
uuid:
specifier: ^11.1.0
version: 11.1.0
@@ -745,17 +749,7 @@ importers:
specifier: ^8.24.1
version: 8.24.1(eslint@9.20.1(jiti@1.21.0))(typescript@5.7.3)
packages/editor-ext:
dependencies:
diff:
specifier: 8.0.3
version: 8.0.3
prosemirror-changeset:
specifier: 2.3.1
version: 2.3.1
rfc6902:
specifier: 5.1.2
version: 5.1.2
packages/editor-ext: {}
packages: