File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -512,6 +512,7 @@ export class BlockNoteEditor<
512512 private onUploadEndCallbacks : ( ( blockId ?: string ) => void ) [ ] = [ ] ;
513513
514514 public readonly resolveFileUrl ?: ( url : string ) => Promise < string > ;
515+ public readonly resolveUsers ?: ( userIds : string [ ] ) => Promise < User [ ] > ;
515516 /**
516517 * Editor settings
517518 */
@@ -609,10 +610,8 @@ export class BlockNoteEditor<
609610 provider : newOptions . collaboration ?. provider || null ,
610611 renderCursor : newOptions . collaboration ?. renderCursor ,
611612 showCursorLabels : newOptions . collaboration ?. showCursorLabels ,
612- // If comments are configured separately, use those instead of collaboration.comments
613- comments : newOptions . comments , // || newOptions.collaboration?.comments,
614- // If resolveUsers is configured separately, use that instead of collaboration.resolveUsers
615- resolveUsers : newOptions . resolveUsers , //|| newOptions.collaboration?.resolveUsers,
613+ comments : newOptions . comments ,
614+ resolveUsers : newOptions . resolveUsers ,
616615 } ;
617616 this . _collaborationManager = new CollaborationManager (
618617 this as any ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import * as Y from "yjs";
99import { createDropFileExtension } from "../api/clipboard/fromClipboard/fileDropExtension.js" ;
1010import { createPasteFromClipboardExtension } from "../api/clipboard/fromClipboard/pasteExtension.js" ;
1111import { createCopyToClipboardExtension } from "../api/clipboard/toClipboard/copyExtension.js" ;
12- import type { ThreadStore } from "../comments/index.js" ;
12+ import type { ThreadStore , User } from "../comments/index.js" ;
1313import { BackgroundColorExtension } from "../extensions/BackgroundColor/BackgroundColorExtension.js" ;
1414import { BlockChangePlugin } from "../extensions/BlockChange/BlockChangePlugin.js" ;
1515import { CursorPlugin } from "../extensions/Collaboration/CursorPlugin.js" ;
@@ -96,6 +96,7 @@ type ExtensionOptions<
9696 comments ?: {
9797 schema ?: BlockNoteSchema < any , any , any > ;
9898 threadStore : ThreadStore ;
99+ resolveUsers ?: ( userIds : string [ ] ) => Promise < User [ ] > ;
99100 } ;
100101 pasteHandler : BlockNoteEditorOptions < any , any , any > [ "pasteHandler" ] ;
101102} ;
@@ -162,6 +163,7 @@ export const getBlockNoteExtensions = <
162163 opts . editor ,
163164 opts . comments . threadStore ,
164165 CommentMark . name ,
166+ opts . comments . resolveUsers ,
165167 opts . comments . schema ,
166168 ) ;
167169 }
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ export class ServerBlockNoteEditor<
292292 public async tryParseMarkdownToBlocks (
293293 markdown : string ,
294294 ) : Promise < Block < BSchema , ISchema , SSchema > [ ] > {
295- return this . _withJSDOM ( ( ) => {
295+ return this . _withJSDOM ( async ( ) => {
296296 return this . editor . tryParseMarkdownToBlocks ( markdown ) ;
297297 } ) ;
298298 }
You can’t perform that action at this time.
0 commit comments