Skip to content

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

Merged
merged 8 commits into from
Mar 14, 2023
Merged

Docs Update #116

merged 8 commits into from
Mar 14, 2023

Conversation

matthewlipski
Copy link
Collaborator

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.

@vercel
Copy link

vercel bot commented Mar 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
blocknote ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 13, 2023 at 1:47PM (UTC)
blocknote-website ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 13, 2023 at 1:47PM (UTC)

Copy link
Collaborator

@YousefED YousefED left a 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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@YousefED YousefED merged commit d4cd37a into main Mar 14, 2023
fogle pushed a commit to fogle/BlockNote that referenced this pull request May 20, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants