mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
WIP
This commit is contained in:
@@ -123,6 +123,7 @@
|
|||||||
"page": "page",
|
"page": "page",
|
||||||
"Page deleted successfully": "Page deleted successfully",
|
"Page deleted successfully": "Page deleted successfully",
|
||||||
"Page history": "Page history",
|
"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.",
|
"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",
|
||||||
"pages": "pages",
|
"pages": "pages",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Decoration, DecorationSet } from "@tiptap/pm/view";
|
|||||||
import historyClasses from "./history.module.css";
|
import historyClasses from "./history.module.css";
|
||||||
import { recreateTransform } from "@docmost/editor-ext";
|
import { recreateTransform } from "@docmost/editor-ext";
|
||||||
import { DOMSerializer, Node } from "@tiptap/pm/model";
|
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 { useAtom } from "jotai";
|
||||||
import {
|
import {
|
||||||
diffCountsAtom,
|
diffCountsAtom,
|
||||||
|
|||||||
@@ -19,12 +19,14 @@ import {
|
|||||||
import HistoryView from "@/features/page-history/components/history-view";
|
import HistoryView from "@/features/page-history/components/history-view";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { IconChevronUp, IconChevronDown } from "@tabler/icons-react";
|
import { IconChevronUp, IconChevronDown } from "@tabler/icons-react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
pageId: string;
|
pageId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function HistoryModalBody({ pageId }: Props) {
|
export default function HistoryModalBody({ pageId }: Props) {
|
||||||
|
const { t } = useTranslation();
|
||||||
const [activeHistoryId, setActiveHistoryId] = useAtom(activeHistoryIdAtom);
|
const [activeHistoryId, setActiveHistoryId] = useAtom(activeHistoryIdAtom);
|
||||||
const [activeHistoryPrevId, setActiveHistoryPrevId] = useAtom(
|
const [activeHistoryPrevId, setActiveHistoryPrevId] = useAtom(
|
||||||
activeHistoryPrevIdAtom,
|
activeHistoryPrevIdAtom,
|
||||||
@@ -125,11 +127,12 @@ export default function HistoryModalBody({ pageId }: Props) {
|
|||||||
</Group>
|
</Group>
|
||||||
)}
|
)}
|
||||||
<Switch
|
<Switch
|
||||||
label="Highlight changes"
|
label={t("Highlight changes")}
|
||||||
checked={highlightChanges}
|
checked={highlightChanges}
|
||||||
onChange={(e) => setHighlightChanges(e.currentTarget.checked)}
|
onChange={(e) => setHighlightChanges(e.currentTarget.checked)}
|
||||||
|
style={{ userSelect: "none" }}
|
||||||
/>
|
/>
|
||||||
{diffCounts && diffCounts.total > 0 && (
|
{highlightChanges && diffCounts && diffCounts.total > 0 && (
|
||||||
<Group gap="xs">
|
<Group gap="xs">
|
||||||
<Text size="sm" c="dimmed">
|
<Text size="sm" c="dimmed">
|
||||||
{currentChangeIndex} of {diffCounts.total}
|
{currentChangeIndex} of {diffCounts.total}
|
||||||
|
|||||||
+3
-1
@@ -60,6 +60,7 @@
|
|||||||
"bytes": "^3.1.2",
|
"bytes": "^3.1.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
|
"diff": "8.0.3",
|
||||||
"dompurify": "^3.2.6",
|
"dompurify": "^3.2.6",
|
||||||
"fractional-indexing-jittered": "^1.0.0",
|
"fractional-indexing-jittered": "^1.0.0",
|
||||||
"highlight.js": "^11.11.1",
|
"highlight.js": "^11.11.1",
|
||||||
@@ -69,8 +70,8 @@
|
|||||||
"linkifyjs": "^4.3.2",
|
"linkifyjs": "^4.3.2",
|
||||||
"marked": "13.0.3",
|
"marked": "13.0.3",
|
||||||
"ms": "3.0.0-canary.1",
|
"ms": "3.0.0-canary.1",
|
||||||
"prosemirror-changeset": "2.3.1",
|
|
||||||
"qrcode": "^1.5.4",
|
"qrcode": "^1.5.4",
|
||||||
|
"rfc6902": "5.1.2",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^11.1.0",
|
||||||
"y-indexeddb": "^9.0.12",
|
"y-indexeddb": "^9.0.12",
|
||||||
"y-prosemirror": "1.3.7",
|
"y-prosemirror": "1.3.7",
|
||||||
@@ -99,6 +100,7 @@
|
|||||||
"overrides": {
|
"overrides": {
|
||||||
"jsdom": "25.0.1",
|
"jsdom": "25.0.1",
|
||||||
"jsonwebtoken": "9.0.3",
|
"jsonwebtoken": "9.0.3",
|
||||||
|
"prosemirror-changeset": "2.3.1",
|
||||||
"y-prosemirror": "1.3.7"
|
"y-prosemirror": "1.3.7"
|
||||||
},
|
},
|
||||||
"neverBuiltDependencies": []
|
"neverBuiltDependencies": []
|
||||||
|
|||||||
@@ -9,9 +9,5 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"dependencies": {
|
"dependencies": {}
|
||||||
"diff": "8.0.3",
|
|
||||||
"prosemirror-changeset": "2.3.1",
|
|
||||||
"rfc6902": "5.1.2"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+8
-14
@@ -7,6 +7,7 @@ settings:
|
|||||||
overrides:
|
overrides:
|
||||||
jsdom: 25.0.1
|
jsdom: 25.0.1
|
||||||
jsonwebtoken: 9.0.3
|
jsonwebtoken: 9.0.3
|
||||||
|
prosemirror-changeset: 2.3.1
|
||||||
y-prosemirror: 1.3.7
|
y-prosemirror: 1.3.7
|
||||||
|
|
||||||
patchedDependencies:
|
patchedDependencies:
|
||||||
@@ -141,6 +142,9 @@ importers:
|
|||||||
date-fns:
|
date-fns:
|
||||||
specifier: ^4.1.0
|
specifier: ^4.1.0
|
||||||
version: 4.1.0
|
version: 4.1.0
|
||||||
|
diff:
|
||||||
|
specifier: 8.0.3
|
||||||
|
version: 8.0.3
|
||||||
dompurify:
|
dompurify:
|
||||||
specifier: ^3.2.6
|
specifier: ^3.2.6
|
||||||
version: 3.2.6
|
version: 3.2.6
|
||||||
@@ -168,12 +172,12 @@ importers:
|
|||||||
ms:
|
ms:
|
||||||
specifier: 3.0.0-canary.1
|
specifier: 3.0.0-canary.1
|
||||||
version: 3.0.0-canary.1
|
version: 3.0.0-canary.1
|
||||||
prosemirror-changeset:
|
|
||||||
specifier: 2.3.1
|
|
||||||
version: 2.3.1
|
|
||||||
qrcode:
|
qrcode:
|
||||||
specifier: ^1.5.4
|
specifier: ^1.5.4
|
||||||
version: 1.5.4
|
version: 1.5.4
|
||||||
|
rfc6902:
|
||||||
|
specifier: 5.1.2
|
||||||
|
version: 5.1.2
|
||||||
uuid:
|
uuid:
|
||||||
specifier: ^11.1.0
|
specifier: ^11.1.0
|
||||||
version: 11.1.0
|
version: 11.1.0
|
||||||
@@ -745,17 +749,7 @@ importers:
|
|||||||
specifier: ^8.24.1
|
specifier: ^8.24.1
|
||||||
version: 8.24.1(eslint@9.20.1(jiti@1.21.0))(typescript@5.7.3)
|
version: 8.24.1(eslint@9.20.1(jiti@1.21.0))(typescript@5.7.3)
|
||||||
|
|
||||||
packages/editor-ext:
|
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:
|
packages:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user