diff --git a/apps/client/public/locales/en-US/translation.json b/apps/client/public/locales/en-US/translation.json index c0578d2b..f3620316 100644 --- a/apps/client/public/locales/en-US/translation.json +++ b/apps/client/public/locales/en-US/translation.json @@ -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", diff --git a/apps/client/src/features/page-history/components/history-editor.tsx b/apps/client/src/features/page-history/components/history-editor.tsx index 5ef65c7f..72e78d53 100644 --- a/apps/client/src/features/page-history/components/history-editor.tsx +++ b/apps/client/src/features/page-history/components/history-editor.tsx @@ -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, diff --git a/apps/client/src/features/page-history/components/history-modal-body.tsx b/apps/client/src/features/page-history/components/history-modal-body.tsx index 7d5b3a24..a2c03868 100644 --- a/apps/client/src/features/page-history/components/history-modal-body.tsx +++ b/apps/client/src/features/page-history/components/history-modal-body.tsx @@ -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) { )} setHighlightChanges(e.currentTarget.checked)} + style={{ userSelect: "none" }} /> - {diffCounts && diffCounts.total > 0 && ( + {highlightChanges && diffCounts && diffCounts.total > 0 && ( {currentChangeIndex} of {diffCounts.total} diff --git a/package.json b/package.json index efed7d63..077af85f 100644 --- a/package.json +++ b/package.json @@ -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": [] diff --git a/packages/editor-ext/package.json b/packages/editor-ext/package.json index 98ae2745..022c4b6a 100644 --- a/packages/editor-ext/package.json +++ b/packages/editor-ext/package.json @@ -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": {} } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1982f561..9f1c2ac8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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: