@@ -114,11 +114,13 @@ import {
114114import { nestedListsToBlockNoteStructure } from "../api/parsers/html/util/nestedLists.js" ;
115115import { CodeBlockOptions } from "../blocks/CodeBlockContent/CodeBlockContent.js" ;
116116import type { ThreadStore , User } from "../comments/index.js" ;
117- import { CursorPlugin } from "../extensions/Collaboration/CursorPlugin.js" ;
118- import "../style.css " ;
117+ import type { CursorPlugin } from "../extensions/Collaboration/CursorPlugin.js" ;
118+ import type { ForkYDocPlugin } from "../extensions/Collaboration/ForkYDocPlugin.js " ;
119119import { EventEmitter } from "../util/EventEmitter.js" ;
120120import { BlockNoteExtension } from "./BlockNoteExtension.js" ;
121121
122+ import "../style.css" ;
123+
122124/**
123125 * A factory function that returns a BlockNoteExtension
124126 * This is useful so we can create extensions that require an editor instance
@@ -416,7 +418,7 @@ export class BlockNoteEditor<
416418 /**
417419 * extensions that are added to the editor, can be tiptap extensions or prosemirror plugins
418420 */
419- public readonly extensions : Record < string , SupportedExtension > = { } ;
421+ public extensions : Record < string , SupportedExtension > = { } ;
420422
421423 /**
422424 * Boolean indicating whether the editor is in headless mode.
@@ -485,8 +487,10 @@ export class BlockNoteEditor<
485487
486488 private readonly showSelectionPlugin : ShowSelectionPlugin ;
487489
488- private readonly cursorPlugin : CursorPlugin ;
489-
490+ /**
491+ * The plugin for forking a document, only defined if in collaboration mode
492+ */
493+ public readonly forkYDocPlugin ?: ForkYDocPlugin ;
490494 /**
491495 * The `uploadFile` method is what the editor uses when files need to be uploaded (for example when selecting an image to upload).
492496 * This method should set when creating the editor as this is application-specific.
@@ -647,7 +651,7 @@ export class BlockNoteEditor<
647651 this . tableHandles = this . extensions [ "tableHandles" ] as any ;
648652 this . comments = this . extensions [ "comments" ] as any ;
649653 this . showSelectionPlugin = this . extensions [ "showSelection" ] as any ;
650- this . cursorPlugin = this . extensions [ "yCursorPlugin " ] as any ;
654+ this . forkYDocPlugin = this . extensions [ "forkYDocPlugin " ] as any ;
651655
652656 if ( newOptions . uploadFile ) {
653657 const uploadFile = newOptions . uploadFile ;
@@ -1547,7 +1551,7 @@ export class BlockNoteEditor<
15471551 ) ;
15481552 }
15491553
1550- this . cursorPlugin . updateUser ( user ) ;
1554+ ( this . extensions [ "yCursorPlugin" ] as CursorPlugin ) . updateUser ( user ) ;
15511555 }
15521556
15531557 /**
0 commit comments