@dnd-kit/react 0.3.0-beta-20260212014643 → 0.3.0-beta-20260212022709
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +12 -0
- package/index.d.ts +11 -2
- package/index.js +12 -0
- package/package.json +4 -4
package/index.cjs
CHANGED
|
@@ -279,6 +279,7 @@ function shouldUpdateSynchronously(key, oldValue, newValue) {
|
|
|
279
279
|
function DragOverlay({
|
|
280
280
|
children,
|
|
281
281
|
className,
|
|
282
|
+
dropAnimation,
|
|
282
283
|
style,
|
|
283
284
|
tag,
|
|
284
285
|
disabled
|
|
@@ -299,6 +300,17 @@ function DragOverlay({
|
|
|
299
300
|
feedback.overlay = void 0;
|
|
300
301
|
};
|
|
301
302
|
}, [manager, isDisabled]);
|
|
303
|
+
react.useEffect(() => {
|
|
304
|
+
if (!manager) return;
|
|
305
|
+
const feedback = manager.plugins.find(
|
|
306
|
+
(plugin) => plugin instanceof dom.Feedback
|
|
307
|
+
);
|
|
308
|
+
if (!feedback) return;
|
|
309
|
+
feedback.dropAnimation = dropAnimation;
|
|
310
|
+
return () => {
|
|
311
|
+
feedback.dropAnimation = void 0;
|
|
312
|
+
};
|
|
313
|
+
}, [manager, dropAnimation]);
|
|
302
314
|
const patchedManager = react.useMemo(() => {
|
|
303
315
|
if (!manager) return null;
|
|
304
316
|
const patchedRegistry = new Proxy(manager.registry, {
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { PropsWithChildren, RefObject, MutableRefObject, ReactNode } from 'react';
|
|
3
3
|
import { Data, DragDropEvents, DragDropManager as DragDropManager$1 } from '@dnd-kit/abstract';
|
|
4
|
-
import { Draggable, Droppable, DragDropManager, DragDropManagerInput, DraggableInput, DroppableInput } from '@dnd-kit/dom';
|
|
4
|
+
import { Draggable, Droppable, DragDropManager, DragDropManagerInput, DraggableInput, DropAnimation, DroppableInput } from '@dnd-kit/dom';
|
|
5
5
|
export { BeforeDragStartEvent, CollisionEvent, DragDropManager, DragEndEvent, DragMoveEvent, DragOverEvent, DragStartEvent, KeyboardSensor, PointerSensor } from '@dnd-kit/dom';
|
|
6
6
|
import { CleanupFunction } from '@dnd-kit/state';
|
|
7
7
|
|
|
@@ -36,11 +36,20 @@ declare function useDraggable<T extends Data = Data>(input: UseDraggableInput<T>
|
|
|
36
36
|
interface Props<T extends Data, U extends Draggable<T>> {
|
|
37
37
|
className?: string;
|
|
38
38
|
children: ReactNode | ((source: U) => ReactNode);
|
|
39
|
+
/**
|
|
40
|
+
* Customize or disable the drop animation that plays when a drag operation ends.
|
|
41
|
+
*
|
|
42
|
+
* - `undefined` – use the default animation (250ms ease)
|
|
43
|
+
* - `null` – disable the drop animation entirely
|
|
44
|
+
* - `{duration, easing}` – customize the animation timing
|
|
45
|
+
* - `(context) => Promise<void> | void` – provide a fully custom animation function
|
|
46
|
+
*/
|
|
47
|
+
dropAnimation?: DropAnimation | null;
|
|
39
48
|
style?: React.CSSProperties;
|
|
40
49
|
tag?: string;
|
|
41
50
|
disabled?: boolean | ((source: U | null) => boolean);
|
|
42
51
|
}
|
|
43
|
-
declare function DragOverlay<T extends Data, U extends Draggable<T>>({ children, className, style, tag, disabled, }: Props<T, U>): react_jsx_runtime.JSX.Element;
|
|
52
|
+
declare function DragOverlay<T extends Data, U extends Draggable<T>>({ children, className, dropAnimation, style, tag, disabled, }: Props<T, U>): react_jsx_runtime.JSX.Element;
|
|
44
53
|
|
|
45
54
|
interface UseDroppableInput<T extends Data = Data> extends Omit<DroppableInput<T>, 'element'> {
|
|
46
55
|
element?: RefOrValue<Element>;
|
package/index.js
CHANGED
|
@@ -278,6 +278,7 @@ function shouldUpdateSynchronously(key, oldValue, newValue) {
|
|
|
278
278
|
function DragOverlay({
|
|
279
279
|
children,
|
|
280
280
|
className,
|
|
281
|
+
dropAnimation,
|
|
281
282
|
style,
|
|
282
283
|
tag,
|
|
283
284
|
disabled
|
|
@@ -298,6 +299,17 @@ function DragOverlay({
|
|
|
298
299
|
feedback.overlay = void 0;
|
|
299
300
|
};
|
|
300
301
|
}, [manager, isDisabled]);
|
|
302
|
+
useEffect(() => {
|
|
303
|
+
if (!manager) return;
|
|
304
|
+
const feedback = manager.plugins.find(
|
|
305
|
+
(plugin) => plugin instanceof Feedback
|
|
306
|
+
);
|
|
307
|
+
if (!feedback) return;
|
|
308
|
+
feedback.dropAnimation = dropAnimation;
|
|
309
|
+
return () => {
|
|
310
|
+
feedback.dropAnimation = void 0;
|
|
311
|
+
};
|
|
312
|
+
}, [manager, dropAnimation]);
|
|
301
313
|
const patchedManager = useMemo(() => {
|
|
302
314
|
if (!manager) return null;
|
|
303
315
|
const patchedRegistry = new Proxy(manager.registry, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnd-kit/react",
|
|
3
|
-
"version": "0.3.0-beta-
|
|
3
|
+
"version": "0.3.0-beta-20260212022709",
|
|
4
4
|
"main": "./index.cjs",
|
|
5
5
|
"module": "./index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@dnd-kit/abstract": "0.3.0-beta-
|
|
60
|
-
"@dnd-kit/dom": "0.3.0-beta-
|
|
61
|
-
"@dnd-kit/state": "0.3.0-beta-
|
|
59
|
+
"@dnd-kit/abstract": "0.3.0-beta-20260212022709",
|
|
60
|
+
"@dnd-kit/dom": "0.3.0-beta-20260212022709",
|
|
61
|
+
"@dnd-kit/state": "0.3.0-beta-20260212022709",
|
|
62
62
|
"tslib": "^2.6.2"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|