Block Restructuring#64
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
YousefED
left a comment
There was a problem hiding this comment.
Looks like a great improvement, but still some quirks to iron out. I'm running into some issues in the vercel build:
- list items are quite funky on chrome I think
- I also got into a state where nothing happens when clicking +. Not sure how I can reproduce
- pressing Tab focusses the URL bar of the browser
I think many of these are related to the commands in AddKeyboardShortcuts. Maybe we should go over these changes together?
I've also added some other thoughts / suggestions in this review.
* fix animations for headings and indents * remove submodule * fix css
| }; | ||
| }, | ||
|
|
||
| parseHTML() { |
There was a problem hiding this comment.
maybe remove this? Let's do it after tests work, and also create a test for pasting a or other unsupported tag
There was a problem hiding this comment.
Since copy/pasting from other sites doesn't work very well after the restructuring, I think we should just leave it as is for now and try to fix the issue later, since it's quite a bit more complex than originally expected.
…reated by the ordered list indexing plugin
…restructuring # Conflicts: # packages/core/src/extensions/Blocks/nodes/Block.ts # packages/core/src/extensions/Blocks/nodes/BlockTypes/HeadingBlock/HeadingContent.ts
…les." This reverts commit 5c5c448.
| tr.setNodeMarkup(currentBlock.pos, undefined, attributes); | ||
| // Finds the nearest previous block, prioritizing higher nesting levels. | ||
| while (prevBlockInfo.numChildBlocks > 0) { | ||
| prevBlockEndPos--; |
There was a problem hiding this comment.
We were not able to find a built-in Tiptap / PM function for this?
|
Referring to this |
* Restructured text & heading blocks (excluding drag handle add implementation) * Small cleanup * Cleaned up drag handle code * Added basic list item implementation * Updated block commands and keyboard handling * Added ordered list item indexing * Finished block manipulation logic * Fixed bug causing suggestion menu to not work properly in list item blocks * Refactoring changes * Minor fix * fix animations for headings and indents (TypeCellOS#67) * fix animations for headings and indents * remove submodule * fix css * Fixed bug where splitting a block created an additional empty block * Cleaned up drag handle code * Fixed bug where the suggestion plugin tried to process transactions created by the ordered list indexing plugin * Improvements to block content naming and file structure * Code style changes and small fix to block keyboard shortcuts * Fixed bugs regarding selection when deleting blocks and using the suggestion menu with the keyboard * Block content attribute naming fixes * Fixed list item copy/pasting within the editor * Updated element selectors for tests * Updated snapshots for copy/paste and drag/drop tests * Adjusted enter key handler behavior * Changed ordered list item indices to start at 1 instead of 0 * Fixed list styling (no animations) * Updated remaining test snapshots * try clean playwright cache * Fixed bug where splitting a block duplicates its ID * Fixed bug where ordered list item indices were being updated unnecessarily * clean up OrderedListItemIndexPlugin * Fixed animation issue caused by change in naming convention * Added animations for unordered lists * Added animations for ordered lists * Added dispatch to block commands * Made backspace revert all block typing instead of just list items * Removed redundant conditions in block keyboard handlers * Changed ordered list index type from number to string in plugin * Optimized `getPosFromBlock` function * Fixed multiple block dragging * Improved transaction filtering for `PreviousBlockTypePlugin` * Improved paste behaviour for content outside the editor * Removed dispatch calls from block commands * Added edge cases for block commands (not currently being triggered) * Added test for Enter keyboard handler with selection spanning multiple blocks * Added functions to allow testing block IDs * Tests in which blocks are deleted/moved now verify block IDs * Added updated snapshots * Added updated screenshots for drag handle menu * Removed `joinBackward` as it is no longer used * Improved paste reliability from other sites, broke inline styles. * Improved paste reliability from other sites, broke inline styles. * Revert "Improved paste reliability from other sites, broke inline styles." This reverts commit 5c5c448. * Small fixes * Improved block ID mocking implementation. * Updated snapshot Co-authored-by: Yousef <yousefdardiry@gmail.com> Co-authored-by: Matthew Lipski <matthewlipski@Matthews-Mac-mini.local>
Currently, the way block types are handled by BlockNote is through setting custom attributes on blocks. This heavily restricts how extensible blocks can be as the custom attributes only affect styling and block contents are always expected to be made up of
divs. This PR restructures blocks so that it's possible to easily extend what kind of content they can contain.