Skip to content

Commit df567b9

Browse files
authored
fix(commentss): small comment issues (#1520)
1 parent 6064fa0 commit df567b9

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

packages/core/src/comments/threadstore/ThreadStore.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export abstract class ThreadStore {
2727
head: number;
2828
anchor: number;
2929
};
30-
yjs: {
30+
yjs?: {
3131
head: any;
3232
anchor: any;
3333
};

packages/core/src/editor/BlockNoteEditor.ts

-6
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,6 @@ export class BlockNoteEditor<
587587
);
588588
}
589589

590-
if (newOptions.comments && !collaborationEnabled) {
591-
throw new Error(
592-
"Comments are only supported when collaboration is enabled, please set the collaboration option"
593-
);
594-
}
595-
596590
const initialContent =
597591
newOptions.initialContent ||
598592
(collaborationEnabled

packages/core/src/extensions/Comments/CommentMark.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export const CommentMark = Mark.create({
55
excludes: "",
66
inclusive: false,
77
keepOnSplit: true,
8-
group: "blocknoteIgnore", // ignore in blocknote json
98

109
addAttributes() {
1110
// Return an object with attribute configuration

packages/core/src/extensions/Comments/CommentsPlugin.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ export class CommentsPlugin extends EventEmitter<any> {
283283
head: pmSelection.head,
284284
anchor: pmSelection.anchor,
285285
},
286-
yjs: getRelativeSelection(ystate.binding, view.state),
286+
yjs: ystate
287+
? getRelativeSelection(ystate.binding, view.state)
288+
: undefined, // if we're not using yjs
287289
};
288290

289291
await this.threadStore.addThreadToDocument({

0 commit comments

Comments
 (0)