-
-
Notifications
You must be signed in to change notification settings - Fork 600
Docs Update #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs Update #116
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! few comments
@@ -17,23 +17,56 @@ The text cursor is the blinking vertical line you see when typing in the editor. | |||
```typescript | |||
type TextCursorPosition = { | |||
block: Block; | |||
prevBlock: Block | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious; what do you see as main usecase for prevBlock / nextBlock? Why did we add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was necessary to add nextBlock to retain the old functionality for slash menu items. Since we changed how slash menu items are defined, I had to change the execute
callback from using TipTap editor commands to BlockNote editor functions. One command that we used a lot was BNUpdateOrCreateBlock
, in which the selection is set to the start of the next block. So I needed to add functions for changing the selection and getting the next block, and added prevBlock since it looked weird having only 1 of the 2 in the docs.
* Added new text cursor fields & functions docs * Made website and JS docs have same information + minor changes/fixes * More minor changes & fixes * More minor changes & fixes * Added block structure diagram * remove margin from editor (this is now built-in) * Added PR feedback and cleaned up links --------- Co-authored-by: yousefed <yousefdardiry@gmail.com>
This PR adds documentation for the remaining fields in
TextCursorPosition
objects and for setting the text cursor position. Also makes the JS Docs content match what's on the website and comes with a number of minor fixes/changes for things that were changed in code.