From 8e2cf9bb0298b9f6edf6b646f36f278ff015227a Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:46:40 +0000 Subject: [PATCH] fix --- .../components/history-diff.module.css | 4 ---- .../components/history-editor.tsx | 19 +++++++++++++++---- .../components/history.module.css | 16 ++++++++-------- packages/editor-ext/package.json | 6 +++--- pnpm-lock.yaml | 6 +++--- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/apps/client/src/features/page-history/components/history-diff.module.css b/apps/client/src/features/page-history/components/history-diff.module.css index 389681bf..ebd6105e 100644 --- a/apps/client/src/features/page-history/components/history-diff.module.css +++ b/apps/client/src/features/page-history/components/history-diff.module.css @@ -1,7 +1,3 @@ -.container { - width: 100%; -} - .diffSummary { border: rem(1px) solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4)); 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 4232c29d..908efa46 100644 --- a/apps/client/src/features/page-history/components/history-editor.tsx +++ b/apps/client/src/features/page-history/components/history-editor.tsx @@ -6,6 +6,8 @@ import { Badge, Divider, Group, Text, Title } from "@mantine/core"; import { Decoration, DecorationSet } from "@tiptap/pm/view"; import { computeHistoryBlockDiff } from "@/features/page-history/utils/history-diff"; import classes from "./history-diff.module.css"; +import historyClasses from "./history.module.css"; + export interface HistoryEditorProps { title: string; @@ -23,7 +25,10 @@ export function HistoryEditor({ editable: false, }); - const [diffCounts, setDiffCounts] = useState<{ added: number; deleted: number }>({ + const [diffCounts, setDiffCounts] = useState<{ + added: number; + deleted: number; + }>({ added: 0, deleted: 0, }); @@ -58,7 +63,10 @@ export function HistoryEditor({ Decoration.node(r.from, r.to, { class: "history-diff-deleted" }), ); - decorationSet = DecorationSet.create(diffDoc, [...decos, ...deletedDecos]); + decorationSet = DecorationSet.create(diffDoc, [ + ...decos, + ...deletedDecos, + ]); } catch { decorationSet = DecorationSet.empty; addedCount = 0; @@ -83,7 +91,7 @@ export function HistoryEditor({ return ( <> -
+
{title} {previousContent && ( @@ -108,7 +116,10 @@ export function HistoryEditor({ )} {editor && ( - + )}
diff --git a/apps/client/src/features/page-history/components/history.module.css b/apps/client/src/features/page-history/components/history.module.css index dcbc9dd4..66415146 100644 --- a/apps/client/src/features/page-history/components/history.module.css +++ b/apps/client/src/features/page-history/components/history.module.css @@ -26,12 +26,12 @@ } .sidebar { - max-height: rem(700px); - width: rem(250px); - padding: var(--mantine-spacing-sm); - display: flex; - flex-direction: column; - border-right: rem(1px) solid + max-height: rem(700px); + width: rem(250px); + padding: var(--mantine-spacing-sm); + display: flex; + flex-direction: column; + border-right: rem(1px) solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4)); } @@ -44,6 +44,6 @@ } .sidebarRightSection { - flex: 1; - padding: rem(16px) rem(40px); + flex: 1; + padding: rem(16px) rem(40px); } diff --git a/packages/editor-ext/package.json b/packages/editor-ext/package.json index d6489d64..98ae2745 100644 --- a/packages/editor-ext/package.json +++ b/packages/editor-ext/package.json @@ -10,8 +10,8 @@ "module": "./src/index.ts", "types": "dist/index.d.ts", "dependencies": { - "diff": "^8.0.3", - "prosemirror-changeset": "^2.3.1", - "rfc6902": "^5.1.2" + "diff": "8.0.3", + "prosemirror-changeset": "2.3.1", + "rfc6902": "5.1.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9bef9483..8c891957 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -745,13 +745,13 @@ importers: packages/editor-ext: dependencies: diff: - specifier: ^8.0.3 + specifier: 8.0.3 version: 8.0.3 prosemirror-changeset: - specifier: ^2.3.1 + specifier: 2.3.1 version: 2.3.1 rfc6902: - specifier: ^5.1.2 + specifier: 5.1.2 version: 5.1.2 packages: