-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add drag and drop to List View in Navigation Screen (#23952)
* Split useBlockDropZone into multiple hooks * Add Draggable to block navigation block component * Add block navigation drop zone hook * Allow tree grid component to take a ref * Add drop zone to block navigation tree * Allow custom elementId in BlockDraggable component * Move block draggable to block contents and add simple initial drop indicator * Fix block drop index * Try allowing blocks to be nested when dragging below, first attempt * Break early when cursor is contained by block * Improve drop zone detection * Fix issue where incorrect drop position selected when blocks overlap * Improve drop zone indicators * Hide dragged block in list view * Refactor selector * Hide dragged block children in list view * Hide appender when dragging parent * Fix block draggable chip error * Refactor block drop event handlers into a single hook * Disallow dropping in invalid block context * Allow nesting from both above and below the insertion point * remove unused data * Fix comment * Try a separate fixed position element for the drop indicator * Update styles to improve drop zone indicator * Fix media dragging and dropping * Fix incorrect import * Fix dropping blocks with no drop indicators * Tidy up nesting code * Fix useRef/useEffect anti-pattern, replace with useMemo * Wrap up selectors in an object * Convert getDropTargetBlocksData into a hook so that selectors can be colocated * Add doc blocks * Revert "Update styles to improve drop zone indicator" This reverts commit 753008a. * Avoid showing drop zone on dragged block * Improve styles * Try making the list view popover a modal drop zone * Adjust drop indicator styles * Use __experimentalFeatures to disable drag and drop outside of navigation editor * Revert "Try making the list view popover a modal drop zone" This reverts commit 2bc3dbb. * Make selectors more succinct * Change useMemo back to useEffect to ensure blocksData is recomputed correctly * Fix incorrect conditional setting of target * Specify all the deps * Add comment
- Loading branch information
Showing
10 changed files
with
516 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.