Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/ariakit/src/comments/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
FormattingToolbar,
FormattingToolbarController,
getFormattingToolbarItems,
useBlockNoteContext,
} from "@blocknote/react";
import { forwardRef } from "react";
import { BlockNoteView } from "../BlockNoteView.js";
Expand All @@ -17,6 +18,8 @@ export const Editor = forwardRef<

assertEmpty(rest, false);

const blockNoteContext = useBlockNoteContext();

return (
<BlockNoteView
autoFocus={autoFocus}
Expand All @@ -28,6 +31,7 @@ export const Editor = forwardRef<
filePanel={false}
formattingToolbar={false}
editable={editable}
theme={blockNoteContext?.colorSchemePreference}
ref={ref}
onFocus={onFocus}
onBlur={onBlur}
Expand Down
4 changes: 4 additions & 0 deletions packages/mantine/src/comments/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
FormattingToolbar,
FormattingToolbarController,
getFormattingToolbarItems,
useBlockNoteContext,
} from "@blocknote/react";
import { forwardRef } from "react";
import { BlockNoteView } from "../BlockNoteView.js";
Expand All @@ -17,6 +18,8 @@ export const Editor = forwardRef<

assertEmpty(rest, false);

const blockNoteContext = useBlockNoteContext();

return (
<BlockNoteView
autoFocus={autoFocus}
Expand All @@ -28,6 +31,7 @@ export const Editor = forwardRef<
filePanel={false}
formattingToolbar={false}
editable={editable}
theme={blockNoteContext?.colorSchemePreference}
ref={ref}
onFocus={onFocus}
onBlur={onBlur}
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/editor/BlockNoteView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ function BlockNoteViewComponent<
...existingContext,
editor,
setContentEditableProps,
colorSchemePreference: editorColorScheme,
};
}, [existingContext, editor]);
}, [existingContext, editor, editorColorScheme]);

// We set defaultUIProps and editorProps on a different context, the BlockNoteViewContext.
// This BlockNoteViewContext is used to render the editor and the default UI.
Expand Down
4 changes: 4 additions & 0 deletions packages/shadcn/src/comments/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
FormattingToolbar,
FormattingToolbarController,
getFormattingToolbarItems,
useBlockNoteContext,
} from "@blocknote/react";
import { forwardRef } from "react";

Expand All @@ -19,10 +20,13 @@ export const Editor = forwardRef<

assertEmpty(rest);

const blockNoteContext = useBlockNoteContext();

return (
<BlockNoteView
autoFocus={autoFocus}
className={cn(className, "")}
theme={blockNoteContext?.colorSchemePreference}
editor={props.editor}
sideMenu={false}
slashMenu={false}
Expand Down
Loading