Skip to content

fix: small issues related to comments #1520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/comments/threadstore/ThreadStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export abstract class ThreadStore {
head: number;
anchor: number;
};
yjs: {
yjs?: {
head: any;
anchor: any;
};
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/editor/BlockNoteEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,6 @@ export class BlockNoteEditor<
);
}

if (newOptions.comments && !collaborationEnabled) {
throw new Error(
"Comments are only supported when collaboration is enabled, please set the collaboration option"
);
}

const initialContent =
newOptions.initialContent ||
(collaborationEnabled
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/extensions/Comments/CommentMark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const CommentMark = Mark.create({
excludes: "",
inclusive: false,
keepOnSplit: true,
group: "blocknoteIgnore", // ignore in blocknote json

addAttributes() {
// Return an object with attribute configuration
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/extensions/Comments/CommentsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ export class CommentsPlugin extends EventEmitter<any> {
head: pmSelection.head,
anchor: pmSelection.anchor,
},
yjs: getRelativeSelection(ystate.binding, view.state),
yjs: ystate
? getRelativeSelection(ystate.binding, view.state)
: undefined, // if we're not using yjs
};

await this.threadStore.addThreadToDocument({
Expand Down
Loading