@@ -25,7 +25,7 @@ type TextCursorPosition = {
2525 block: Block ;
2626 prevBlock: Block | undefined ;
2727 nextBlock: Block | undefined ;
28- }
28+ };
2929```
3030
3131` 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
6161class BlockNoteEditor {
6262...
6363 public setTextCursorPosition(
64- targetBlock : BlockIdentifier ,
64+ targetBlock : BlockIdentifier ,
6565 placement : " start" | " end" = " start"
6666 ): void ;
6767...
@@ -94,15 +94,15 @@ export default function App() {
9494 // Listens for when the text cursor position changes.
9595 onTextCursorPositionChange : (editor ) => {
9696 // Gets the block currently hovered by the text cursor.
97- const hoveredBlock: Block = editor .getTextCursorPosition ().block ;
97+ const hoveredBlock = editor .getTextCursorPosition ().block ;
9898
9999 // Traverses all blocks.
100100 editor .forEachBlock ((block ) => {
101101 if (
102102 block .id === hoveredBlock .id &&
103103 block .props .backgroundColor !== " blue"
104104 ) {
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
106106 // background blue if it isn't already.
107107 editor .updateBlock (block , {
108108 props: {backgroundColor: " blue" },
@@ -111,18 +111,18 @@ export default function App() {
111111 block .id !== hoveredBlock .id &&
112112 block .props .backgroundColor === " blue"
113113 ) {
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
115115 // its background if it's blue.
116116 editor .updateBlock (block , {
117117 props: {backgroundColor: " default" },
118118 });
119119 }
120-
120+
121121 return true ;
122122 });
123123 }
124124 })
125-
125+
126126 // Renders the editor instance.
127127 return <BlockNoteView editor = { editor } theme = { " {{ getTheme(isDark) }}" } />;
128128}
@@ -141,7 +141,7 @@ When you highlight content using the mouse or keyboard, this is called a selecti
141141``` typescript
142142type Selection = {
143143 blocks: Block [];
144- }
144+ };
145145```
146146
147147` blocks: ` The blocks currently spanned by the selection, including nested blocks.
@@ -232,4 +232,4 @@ export default function App() {
232232{{ getStyles (isDark ) }}
233233```
234234
235- :::
235+ :::
0 commit comments