Skip to content

Commit 9041e17

Browse files
authored
fix(ai): upgrade prosemirror-suggest-changes (#2235)
1 parent e0a2de2 commit 9041e17

File tree

5 files changed

+27
-23
lines changed

5 files changed

+27
-23
lines changed

packages/xl-ai/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
"@ai-sdk/react": "^2.0.102",
7474
"@blocknote/core": "0.44.1",
7575
"@blocknote/mantine": "0.44.1",
76-
"@blocknote/prosemirror-suggest-changes": "^0.1.3",
7776
"@blocknote/react": "0.44.1",
7877
"@floating-ui/react": "^0.26.28",
78+
"@handlewithcare/prosemirror-suggest-changes": "^0.1.8",
7979
"@tiptap/core": "^3.11.0",
8080
"ai": "^5.0.102",
8181
"lodash.isequal": "^4.5.0",

packages/xl-ai/src/AIExtension.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
applySuggestions,
1515
revertSuggestions,
1616
suggestChanges,
17-
} from "@blocknote/prosemirror-suggest-changes";
17+
} from "@handlewithcare/prosemirror-suggest-changes";
1818
import { UIMessage } from "ai";
1919
import { Fragment, Slice } from "prosemirror-model";
2020
import { Plugin, PluginKey } from "prosemirror-state";
@@ -75,6 +75,10 @@ export const AIExtension = createExtension(
7575
| undefined;
7676
let autoScroll = false;
7777

78+
const suggestChangesPlugin = suggestChanges();
79+
// disable decorations for suggest changes, not needed
80+
// (and the pilcrows are ugly)
81+
suggestChangesPlugin.props.decorations = undefined;
7882
return {
7983
key: "ai",
8084
options,
@@ -129,7 +133,7 @@ export const AIExtension = createExtension(
129133
return true;
130134
},
131135
}),
132-
suggestChanges(),
136+
suggestChangesPlugin,
133137
createAgentCursorPlugin(
134138
editorOptions?.agentCursor || { name: "AI", color: "#8bc6ff" },
135139
),

packages/xl-ai/src/prosemirror/rebaseTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BlockNoteEditor } from "@blocknote/core";
2-
import { applySuggestions } from "@blocknote/prosemirror-suggest-changes";
2+
import { applySuggestions } from "@handlewithcare/prosemirror-suggest-changes";
33
import { Transaction } from "prosemirror-state";
44
import { Transform } from "prosemirror-transform";
55

packages/xl-ai/src/testUtil/suggestChangesTestUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BlockNoteEditor } from "@blocknote/core";
2-
import { revertSuggestions } from "@blocknote/prosemirror-suggest-changes";
2+
import { revertSuggestions } from "@handlewithcare/prosemirror-suggest-changes";
33
import { Node } from "prosemirror-model";
44
import { expect } from "vitest";
55

pnpm-lock.yaml

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)