feat: make all editor blocks draggable#134
Merged
Merged
Conversation
…le nodes with different depths
Collaborator
|
@sehyod found this bug working this lists |
Collaborator
Author
Thanks for the catch! But to fix this, the best way would be to extend the List component to add custom behaviour, so I think it would be better to do it in another PR. That's actually the same with collapsible blocks: if you try to press Enter inside a collapsible block with the code of this PR, the result will be very buggy |
cguedes
previously approved these changes
Jun 12, 2023
cguedes
approved these changes
Jun 13, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes #133
Root document can now only contain draggable blocks. A draggable block is a wrapper for any block, thats adds a handle on the left:
This also adds rules when pressing enter:
These rules were what felt the most natural to me, but if you feel like anything seems weird when playing around with it, please let me know.
Note: This PR does not change the behaviour of blocks, which means that collapsible blocks are still hard to work with (no proper way to create a collapsible block, pressing Enter doesn't work, ...) and bullet points list are considered a whole block, which means you can only drag and drop the whole list. These components will be reworked in future PRs