- {/* The actual contentEditable that Prosemirror mounts to */}
+const EditorElement = React.forwardRef(
+ (
+ props: {
+ className?: string;
+ editorColorScheme?: string;
+ autoFocus?: boolean;
+ mount: (element: HTMLElement | null) => void;
+ contentEditableProps?: Record
;
+ children: ReactNode;
+ } & HTMLAttributes,
+ ref: React.Ref
+ ) => {
+ const {
+ className,
+ editorColorScheme,
+ autoFocus,
+ mount,
+ children,
+ contentEditableProps,
+ ...rest
+ } = props;
+ return (
+ // The container wraps the contentEditable div and UI Elements such as sidebar, formatting toolbar, etc.
- {/* The UI elements such as sidebar, formatting toolbar, etc. */}
- {children}
-
- );
-};
+ className={mergeCSSClasses(
+ "bn-container",
+ editorColorScheme,
+ className
+ )}
+ data-color-scheme={editorColorScheme}
+ {...rest}
+ ref={ref}>
+ {/* The actual contentEditable that Prosemirror mounts to */}
+