-
-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
974 additions
and
319 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
'@udecode/plate-dnd': major | ||
--- | ||
|
||
- Removed the `useDndBlock`, `useDragBlock`, and `useDropBlock` hooks in favor of `useDndNode` and `useDragNode`, `useDropNode`. | ||
- Remove `DndProvider` and `useDraggableStore`. The drop line state is now managed by `DndPlugin`: `dropTarget` as a single state object containing both `id` and `line`. Migration steps: | ||
- Remove `DndProvider` from your draggable component (e.g. `draggable.tsx`) | ||
- Replace `useDraggableStore` with `useEditorPlugin(DndPlugin).useOption`. | ||
- `useDropNode`: remove `onChangeDropLine`, `dropLine` options |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
'@udecode/plate-dnd': minor | ||
--- | ||
|
||
- `useDndNode` now supports horizontal orientation. New option is `orientation?: 'horizontal' | 'vertical'`. Default is `vertical`. | ||
- `useDraggableState`, `useDndNode`: add `canDropNode` callback option to query if a dragged node can be dropped onto a hovered node. | ||
- `useDropLine`: | ||
- Added `id` option to show dropline only for hovered element. Default is `useElement().id`. | ||
- Added `orientation` option to filter droplines by orientation (`'horizontal' | 'vertical'`). Default is `vertical`. | ||
- Returns empty dropline if orientation doesn't match (e.g., horizontal dropline in vertical orientation) | ||
- Returns empty dropline if elementId doesn't match current hovered element |
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.