File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 44 FormattingToolbar ,
55 FormattingToolbarController ,
66 getFormattingToolbarItems ,
7+ useBlockNoteContext ,
78} from "@blocknote/react" ;
89import { forwardRef } from "react" ;
910import { BlockNoteView } from "../BlockNoteView.js" ;
@@ -17,6 +18,8 @@ export const Editor = forwardRef<
1718
1819 assertEmpty ( rest , false ) ;
1920
21+ const blockNoteContext = useBlockNoteContext ( ) ;
22+
2023 return (
2124 < BlockNoteView
2225 autoFocus = { autoFocus }
@@ -28,6 +31,7 @@ export const Editor = forwardRef<
2831 filePanel = { false }
2932 formattingToolbar = { false }
3033 editable = { editable }
34+ theme = { blockNoteContext ?. colorSchemePreference }
3135 ref = { ref }
3236 onFocus = { onFocus }
3337 onBlur = { onBlur }
Original file line number Diff line number Diff line change 44 FormattingToolbar ,
55 FormattingToolbarController ,
66 getFormattingToolbarItems ,
7+ useBlockNoteContext ,
78} from "@blocknote/react" ;
89import { forwardRef } from "react" ;
910import { BlockNoteView } from "../BlockNoteView.js" ;
@@ -17,6 +18,8 @@ export const Editor = forwardRef<
1718
1819 assertEmpty ( rest , false ) ;
1920
21+ const blockNoteContext = useBlockNoteContext ( ) ;
22+
2023 return (
2124 < BlockNoteView
2225 autoFocus = { autoFocus }
@@ -28,6 +31,7 @@ export const Editor = forwardRef<
2831 filePanel = { false }
2932 formattingToolbar = { false }
3033 editable = { editable }
34+ theme = { blockNoteContext ?. colorSchemePreference }
3135 ref = { ref }
3236 onFocus = { onFocus }
3337 onBlur = { onBlur }
Original file line number Diff line number Diff line change @@ -159,8 +159,9 @@ function BlockNoteViewComponent<
159159 ...existingContext ,
160160 editor,
161161 setContentEditableProps,
162+ colorSchemePreference : editorColorScheme ,
162163 } ;
163- } , [ existingContext , editor ] ) ;
164+ } , [ existingContext , editor , editorColorScheme ] ) ;
164165
165166 // We set defaultUIProps and editorProps on a different context, the BlockNoteViewContext.
166167 // This BlockNoteViewContext is used to render the editor and the default UI.
Original file line number Diff line number Diff line change 44 FormattingToolbar ,
55 FormattingToolbarController ,
66 getFormattingToolbarItems ,
7+ useBlockNoteContext ,
78} from "@blocknote/react" ;
89import { forwardRef } from "react" ;
910
@@ -19,10 +20,13 @@ export const Editor = forwardRef<
1920
2021 assertEmpty ( rest ) ;
2122
23+ const blockNoteContext = useBlockNoteContext ( ) ;
24+
2225 return (
2326 < BlockNoteView
2427 autoFocus = { autoFocus }
2528 className = { cn ( className , "" ) }
29+ theme = { blockNoteContext ?. colorSchemePreference }
2630 editor = { props . editor }
2731 sideMenu = { false }
2832 slashMenu = { false }
You can’t perform that action at this time.
0 commit comments