Skip to content

Commit 1add324

Browse files
authored
fix: upgrade y-prosemirror and remove clientID hack (#1497)
1 parent 6f230c2 commit 1add324

File tree

4 files changed

+12
-21
lines changed

4 files changed

+12
-21
lines changed

package-lock.json

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

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"shiki": "^1.22.0",
103103
"unified": "^10.1.2",
104104
"uuid": "^8.3.2",
105-
"y-prosemirror": "1.2.13",
105+
"y-prosemirror": "1.2.17",
106106
"y-protocols": "^1.0.6",
107107
"yjs": "^13.6.15"
108108
},

packages/core/src/extensions/Collaboration/createCollaborationExtensions.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,10 @@ export const createCollaborationExtensions = (collaboration: {
8787
return cursorElement;
8888
};
8989

90-
const render = (user: { color: string; name: string }) => {
91-
const clientState = [...awareness.getStates().entries()].find(
92-
(state) => state[1].user === user
93-
);
94-
95-
if (!clientState) {
96-
throw new Error(
97-
"Could not find client state for user, " + JSON.stringify(user)
98-
);
99-
}
100-
101-
const clientID = clientState[0];
102-
90+
const render = (
91+
user: { color: string; name: string },
92+
clientID: number
93+
) => {
10394
let cursorData = cursors.get(clientID);
10495

10596
if (!cursorData) {
@@ -146,7 +137,7 @@ export const createCollaborationExtensions = (collaboration: {
146137
tiptapExtensions.push(
147138
CollaborationCursor.configure({
148139
user: collaboration.user,
149-
render,
140+
render: render as any, // tiptap type not compatible with latest y-prosemirror
150141
provider: collaboration.provider,
151142
})
152143
);

packages/server-util/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@tiptap/core": "^2.7.1",
5656
"@tiptap/pm": "^2.7.1",
5757
"jsdom": "^25.0.1",
58-
"y-prosemirror": "1.2.13",
58+
"y-prosemirror": "1.2.17",
5959
"y-protocols": "^1.0.6",
6060
"yjs": "^13.6.15"
6161
},

0 commit comments

Comments
 (0)