@@ -30,38 +30,44 @@ const emptyFn = () => {
30
30
// noop
31
31
} ;
32
32
33
+ export type BlockNoteViewProps <
34
+ BSchema extends BlockSchema ,
35
+ ISchema extends InlineContentSchema ,
36
+ SSchema extends StyleSchema
37
+ > = {
38
+ editor : BlockNoteEditor < BSchema , ISchema , SSchema > ;
39
+
40
+ theme ?: "light" | "dark" ;
41
+
42
+ /**
43
+ * Locks the editor from being editable by the user if set to `false`.
44
+ */
45
+ editable ?: boolean ;
46
+ /**
47
+ * A callback function that runs whenever the text cursor position or selection changes.
48
+ */
49
+ onSelectionChange ?: ( ) => void ;
50
+
51
+ /**
52
+ * A callback function that runs whenever the editor's contents change.
53
+ */
54
+ onChange ?: ( ) => void ;
55
+
56
+ children ?: ReactNode ;
57
+
58
+ ref ?: Ref < HTMLDivElement > | undefined ; // only here to get types working with the generics. Regular form doesn't work
59
+ } & Omit <
60
+ HTMLAttributes < HTMLDivElement > ,
61
+ "onChange" | "onSelectionChange" | "children"
62
+ > &
63
+ BlockNoteDefaultUIProps ;
64
+
33
65
function BlockNoteViewComponent <
34
66
BSchema extends BlockSchema ,
35
67
ISchema extends InlineContentSchema ,
36
68
SSchema extends StyleSchema
37
69
> (
38
- props : {
39
- editor : BlockNoteEditor < BSchema , ISchema , SSchema > ;
40
-
41
- theme ?: "light" | "dark" ;
42
-
43
- /**
44
- * Locks the editor from being editable by the user if set to `false`.
45
- */
46
- editable ?: boolean ;
47
- /**
48
- * A callback function that runs whenever the text cursor position or selection changes.
49
- */
50
- onSelectionChange ?: ( ) => void ;
51
-
52
- /**
53
- * A callback function that runs whenever the editor's contents change.
54
- */
55
- onChange ?: ( ) => void ;
56
-
57
- children ?: ReactNode ;
58
-
59
- ref ?: Ref < HTMLDivElement > | undefined ; // only here to get types working with the generics. Regular form doesn't work
60
- } & Omit <
61
- HTMLAttributes < HTMLDivElement > ,
62
- "onChange" | "onSelectionChange" | "children"
63
- > &
64
- BlockNoteDefaultUIProps ,
70
+ props : BlockNoteViewProps < BSchema , ISchema , SSchema > ,
65
71
ref : React . Ref < HTMLDivElement >
66
72
) {
67
73
const {
0 commit comments