@@ -25,7 +25,7 @@ type TextCursorPosition = {
25
25
block: Block ;
26
26
prevBlock: Block | undefined ;
27
27
nextBlock: Block | undefined ;
28
- }
28
+ };
29
29
```
30
30
31
31
` block: ` The block currently containing the text cursor. If the cursor is in a nested block, this is the block at the deepest possible nesting level.
@@ -61,7 +61,7 @@ You can set the text cursor position to the start or end of an existing block us
61
61
class BlockNoteEditor {
62
62
...
63
63
public setTextCursorPosition(
64
- targetBlock : BlockIdentifier ,
64
+ targetBlock : BlockIdentifier ,
65
65
placement : " start" | " end" = " start"
66
66
): void ;
67
67
...
@@ -94,15 +94,15 @@ export default function App() {
94
94
// Listens for when the text cursor position changes.
95
95
onTextCursorPositionChange : (editor ) => {
96
96
// Gets the block currently hovered by the text cursor.
97
- const hoveredBlock: Block = editor .getTextCursorPosition ().block ;
97
+ const hoveredBlock = editor .getTextCursorPosition ().block ;
98
98
99
99
// Traverses all blocks.
100
100
editor .forEachBlock ((block ) => {
101
101
if (
102
102
block .id === hoveredBlock .id &&
103
103
block .props .backgroundColor !== " blue"
104
104
) {
105
- // If the block is currently hovered by the text cursor, makes its
105
+ // If the block is currently hovered by the text cursor, makes its
106
106
// background blue if it isn't already.
107
107
editor .updateBlock (block , {
108
108
props: {backgroundColor: " blue" },
@@ -111,18 +111,18 @@ export default function App() {
111
111
block .id !== hoveredBlock .id &&
112
112
block .props .backgroundColor === " blue"
113
113
) {
114
- // If the block is not currently hovered by the text cursor, resets
114
+ // If the block is not currently hovered by the text cursor, resets
115
115
// its background if it's blue.
116
116
editor .updateBlock (block , {
117
117
props: {backgroundColor: " default" },
118
118
});
119
119
}
120
-
120
+
121
121
return true ;
122
122
});
123
123
}
124
124
})
125
-
125
+
126
126
// Renders the editor instance.
127
127
return <BlockNoteView editor = { editor } theme = { " {{ getTheme(isDark) }}" } />;
128
128
}
@@ -141,7 +141,7 @@ When you highlight content using the mouse or keyboard, this is called a selecti
141
141
``` typescript
142
142
type Selection = {
143
143
blocks: Block [];
144
- }
144
+ };
145
145
```
146
146
147
147
` blocks: ` The blocks currently spanned by the selection, including nested blocks.
@@ -232,4 +232,4 @@ export default function App() {
232
232
{{ getStyles (isDark ) }}
233
233
```
234
234
235
- :::
235
+ :::
0 commit comments