diff --git a/.changeset/dnd-major.md b/.changeset/dnd-major.md deleted file mode 100644 index bd2cef4d9d..0000000000 --- a/.changeset/dnd-major.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'@udecode/plate-dnd': major ---- - -- Removed `useDndBlock`, `useDragBlock`, and `useDropBlock` hooks in favor of `useDndNode`, `useDragNode`, and `useDropNode`. -- Removed `DndProvider` and `useDraggableStore`. Drop line state is now managed by `DndPlugin` as a single state object `dropTarget` containing both `id` and `line`. -- `useDropNode`: removed `onChangeDropLine` and `dropLine` options - -Migration steps: - -- Remove `DndProvider` from your draggable component (e.g. `draggable.tsx`) -- Replace `useDraggableStore` with `useEditorPlugin(DndPlugin).useOption` diff --git a/.changeset/dnd-minor.md b/.changeset/dnd-minor.md deleted file mode 100644 index 2adbe2dbfd..0000000000 --- a/.changeset/dnd-minor.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@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 diff --git a/packages/dnd/CHANGELOG.md b/packages/dnd/CHANGELOG.md index bf0d0582af..e3bf2ee79a 100644 --- a/packages/dnd/CHANGELOG.md +++ b/packages/dnd/CHANGELOG.md @@ -1,5 +1,31 @@ # @udecode/plate-dnd +## 41.0.0 + +### Major Changes + +- [#3861](https://github.com/udecode/plate/pull/3861) by [@zbeyens](https://github.com/zbeyens) – + + - Removed `useDndBlock`, `useDragBlock`, and `useDropBlock` hooks in favor of `useDndNode`, `useDragNode`, and `useDropNode`. + - Removed `DndProvider` and `useDraggableStore`. Drop line state is now managed by `DndPlugin` as a single state object `dropTarget` containing both `id` and `line`. + - `useDropNode`: removed `onChangeDropLine` and `dropLine` options + + Migration steps: + + - Remove `DndProvider` from your draggable component (e.g. `draggable.tsx`) + - Replace `useDraggableStore` with `useEditorPlugin(DndPlugin).useOption` + +### Minor Changes + +- [#3861](https://github.com/udecode/plate/pull/3861) by [@zbeyens](https://github.com/zbeyens) – + - `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 + ## 40.0.0 ### Minor Changes diff --git a/packages/dnd/package.json b/packages/dnd/package.json index 19b7e4aa20..5d541e2689 100644 --- a/packages/dnd/package.json +++ b/packages/dnd/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-dnd", - "version": "40.0.0", + "version": "41.0.0", "description": "React drag and drop feature for Plate", "keywords": [ "plate",