Patch Changes
-
#1874
de27fbcThanks @clauderic! - Expose ergonomic type aliases for drag and drop event handlers:CollisionEvent,BeforeDragStartEvent,DragStartEvent,DragMoveEvent,DragOverEvent, andDragEndEvent. These types are re-exported from@dnd-kit/domand@dnd-kit/reactfor convenience. -
#1854
c2097c9Thanks @du33169! - Fixed Feedback plugin style injection in Shadow DOM (fix #1765) -
#1875
6d80680Thanks @clauderic! - Feedback plugin: Fix table cell width handling during drag operations. UsegetBoundingClientRect().widthinstead ofoffsetWidthfor sub-pixel precision, and restore original cell widths after dragging ends instead of leaving hardcoded values permanently. -
#1877
0923bc6Thanks @clauderic! - Respectprefers-reduced-motionmedia query across all animations. When the user prefers reduced motion, the following animations are disabled:- Keyboard drag move transitions (250ms translate)
- Drop animation (250ms slide-back)
- Sortable item swap transitions (250ms position shift)
-
#1876
5f1b19aThanks @clauderic! - Refactor the Feedback plugin for improved modularity and extensibility.StyleSheetManager – Introduced a new generic
CorePluginthat manages CSS stylesheet injection into document and shadow roots. Plugins can callregister(cssRules)to declare styles andaddRoot(root)to track additional roots. The manager reactively injects and cleans up adopted stylesheets as the drag operation's source and target roots change. The Feedback plugin now delegates all stylesheet management to the StyleSheetManager.Configurable drop animation – The
Feedbackplugin now accepts adropAnimationoption:- Pass
{ duration, easing }to customize the built-in animation timing - Pass a function for full custom animation control (receives context, return a promise)
- Pass
nullto disable the drop animation entirely - Omit for the default 250ms ease animation
Extracted helpers – Observer setup (
createElementMutationObserver,createDocumentMutationObserver,createResizeObserver) and the drop animation logic (runDropAnimation) are now in dedicated modules within the feedback plugin directory. - Pass
-
Updated dependencies [
de27fbc,256432d,be7cfe3]:- @dnd-kit/abstract@0.2.4
- @dnd-kit/collision@0.2.4
- @dnd-kit/geometry@0.2.4
- @dnd-kit/state@0.2.4