- Updated dependencies [
e00be08]:- @dnd-kit/dom@0.5.1
- @dnd-kit/abstract@0.5.1
- @dnd-kit/state@0.5.1
- #2058
2dd8d0eThanks @timagixe! - AllowuseSortable,createSortableandSortableto disable dragging and dropping independently with adisabledobject while preserving the existing boolean behavior.
-
#2031
33ce050Thanks @clauderic! - FixedDragDropProviderevaluating itschildrenJSX twice on initial mount in@dnd-kit/solid. The provider now stripschildrenfrom the props it forwards toDragDropManager, preventing the manager constructor's spread ({...input}) from invoking Solid'schildrengetter and synthesizing an orphan component subtree whose reactive scope was never disposed. -
#2043
a6bd445Thanks @clauderic! - Include sourcemap files in published packages. The build emits.mapfiles alongside each entry point and writes//# sourceMappingURL=...comments into the bundles, but thefilesfield inpackage.jsondid not list the maps, so they were excluded from the npm tarball. Bundlers attempting to load the referenced maps would fail withENOENT, producing warnings (or build failures in strict CI setups). -
Updated dependencies [
e4d1a7e,e25b1b1,00fd955,e4792f3,f23afe0,2dd8d0e]:- @dnd-kit/abstract@0.5.0
- @dnd-kit/dom@0.5.0
- @dnd-kit/state@0.5.0
-
#1915
9b24dffThanks @clauderic! - Redesign event type system to follow the DOM EventMap pattern. IntroducesDragDropEventMapfor event object types andDragDropEventHandlersfor event handler signatures, replacing the ambiguously namedDragDropEvents. Event type aliases (CollisionEvent,DragStartEvent, etc.) now derive directly fromDragDropEventMaprather than usingParameters<>extraction.DragDropEventshas been split into two types:DragDropEventMap— maps event names to event object types (likeWindowEventMap)DragDropEventHandlers— maps event names to(event, manager) => voidhandler signatures
- If you were importing
DragDropEventsto type event objects, useDragDropEventMapinstead:// Before type MyEvent = Parameters<DragDropEvents<D, P, M>['dragend']>[0]; // After type MyEvent = DragDropEventMap<D, P, M>['dragend'];
- If you were importing
DragDropEventsto type event handlers, useDragDropEventHandlersinstead:// Before const handler: DragDropEvents<D, P, M>['dragend'] = (event, manager) => {}; // After const handler: DragDropEventHandlers<D, P, M>['dragend'] = ( event, manager ) => {};
- The
DragDropEventsre-export from@dnd-kit/reactand@dnd-kit/solidhas been removed. ImportDragDropEventMaporDragDropEventHandlersfrom@dnd-kit/abstractdirectly if needed. - Convenience aliases (
CollisionEvent,DragStartEvent,DragEndEvent, etc.) are unchanged and continue to work as before.
-
#1938
e69387dThanks @clauderic! - Added per-entity plugin configuration and movedfeedbackfrom the Draggable entity to the Feedback plugin.Draggable entities now accept a
pluginsproperty for per-entity plugin configuration, using the existingPlugin.configure()pattern. Plugins can read per-entity options viasource.pluginConfig(PluginClass).The
feedbackproperty ('default' | 'move' | 'clone' | 'none') has been moved from the Draggable entity toFeedbackOptions. Drop animation can also now be configured per-draggable.Plugins listed in an entity's
pluginsarray are auto-registered on the manager if not already present. The Sortable class now uses this generic mechanism instead of its own custom registration logic.The
feedbackproperty has been moved from the draggable/sortable hook input to per-entity Feedback plugin configuration.Before:
import {FeedbackType} from '@dnd-kit/dom'; useDraggable({id: 'item', feedback: 'clone'}); useSortable({id: 'item', index: 0, feedback: 'clone'});
After:
import {Feedback} from '@dnd-kit/dom'; useDraggable({ id: 'item', plugins: [Feedback.configure({feedback: 'clone'})], }); useSortable({ id: 'item', index: 0, plugins: (defaults) => [ ...defaults, Feedback.configure({feedback: 'clone'}), ], });
Drop animation can now be configured per-draggable:
useDraggable({ id: 'item', plugins: [Feedback.configure({feedback: 'clone', dropAnimation: null})], });
-
#1971
8fc1962Thanks @clauderic! - Added LICENSE file to all published packages. -
Updated dependencies [
4bc7e71,87bf1e6,521f760,c001272,cde61e4,78af13b,1328af8,532ae9b,267c97c,bfff7de,a5935e0,462e435,9b24dff,8fc1962,88d5ef9,8115a57,688e00f,cdaebff,e69387d,11ff2eb,7489265,4e35963,5a2ed80]:- @dnd-kit/dom@0.4.0
- @dnd-kit/abstract@0.4.0
- @dnd-kit/state@0.4.0
- Updated dependencies [
7260746]:- @dnd-kit/dom@0.3.2
- @dnd-kit/abstract@0.3.2
- @dnd-kit/state@0.3.2
- Updated dependencies [
4341114]:- @dnd-kit/abstract@0.3.1
- @dnd-kit/dom@0.3.1
- @dnd-kit/state@0.3.1
-
6a59647Thanks @clauderic! - Allowplugins,sensors, andmodifiersto accept a function that receives the defaults, making it easy to extend or configure them without replacing the entire array.// Add a plugin alongside the defaults const manager = new DragDropManager({ plugins: (defaults) => [...defaults, MyPlugin], });
// Configure a default plugin in React <DragDropProvider plugins={(defaults) => [ ...defaults, Feedback.configure({dropAnimation: null}), ]} />
Previously, passing
plugins,sensors, ormodifierswould replace the defaults entirely, requiring consumers to import and spreaddefaultPreset. The function form receives the default values as an argument, so consumers can add, remove, or configure individual entries without needing to know or maintain the full default list. -
#1881
69f2772Thanks @clauderic! - Add @dnd-kit/solid adapter package for SolidJS -
68e44deThanks @clauderic! - AddisSortableOperationtype guard and exportSortableDraggable/SortableDroppabletypes.isSortableOperation(operation)narrows aDragOperationSnapshotso thatsourceis typed asSortableDraggableandtargetasSortableDroppable, providing typed access to sortable-specific properties likeindex,initialIndex,group, andinitialGroup.Re-exported from all framework packages (
@dnd-kit/react/sortable,@dnd-kit/vue/sortable,@dnd-kit/svelte/sortable,@dnd-kit/solid/sortable).
-
5d64078Thanks @clauderic! - AdddropAnimationprop to theDragOverlaycomponent to allow consumers to disable or customize the drop animation that plays when a drag operation ends. Set tonullto disable, pass{duration, easing}to customize timing, or provide a custom animation function for full control. -
Updated dependencies [
6a59647,5d64078,863ce2b,863ce2b,e8ae539,41d7e27,68e44de]:- @dnd-kit/abstract@0.3.0
- @dnd-kit/dom@0.3.0
- @dnd-kit/state@0.3.0