@dnd-kit/react 0.1.1-beta-20250418141545 → 0.1.1-beta-20250418163929
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/hooks.d.ts +5 -3
- package/index.d.ts +6 -4
- package/package.json +4 -4
- package/sortable.d.ts +4 -1
package/hooks.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { EffectCallback, DependencyList, useLayoutEffect, useEffect } from 'react';
|
|
3
|
-
import { RefOrValue } from '@dnd-kit/react/utilities';
|
|
2
|
+
import { EffectCallback, DependencyList, useLayoutEffect, useEffect, RefObject, MutableRefObject } from 'react';
|
|
4
3
|
|
|
5
4
|
declare function useConstant<T = any>(initializer: () => T): T;
|
|
6
5
|
|
|
7
6
|
declare function useComputed<T = any>(compute: () => T, dependencies?: any[], sync?: boolean): {
|
|
8
|
-
readonly value:
|
|
7
|
+
readonly value: T_1;
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
/** Trigger a re-render when reading signal properties of an object. */
|
|
@@ -23,6 +22,9 @@ declare function useLatest<T>(value: T): react.RefObject<T | undefined>;
|
|
|
23
22
|
|
|
24
23
|
declare function useOnValueChange<T>(value: T, onChange: (value: T, oldValue: T) => void, effect?: typeof useEffect, compare?: (value1: any, value2: any) => boolean): void;
|
|
25
24
|
|
|
25
|
+
type Ref<T> = RefObject<T | null | undefined> | MutableRefObject<T>;
|
|
26
|
+
type RefOrValue<T> = T | Ref<T> | null | undefined;
|
|
27
|
+
|
|
26
28
|
declare function useOnElementChange(value: RefOrValue<Element>, onChange: (value: Element | undefined) => void): void;
|
|
27
29
|
|
|
28
30
|
export { useComputed, useConstant, useDeepSignal, useImmediateEffect, useIsomorphicLayoutEffect, useLatest, useOnElementChange, useOnValueChange };
|
package/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { PropsWithChildren, RefObject, MutableRefObject, ReactNode } from 'react';
|
|
3
3
|
import * as _dnd_kit_abstract from '@dnd-kit/abstract';
|
|
4
4
|
import { Data, DragDropEvents, DragDropManager as DragDropManager$1 } from '@dnd-kit/abstract';
|
|
5
5
|
import * as _dnd_kit_dom from '@dnd-kit/dom';
|
|
6
6
|
import { Draggable, Droppable, DragDropManager, DragDropManagerInput, DraggableInput, DroppableInput } from '@dnd-kit/dom';
|
|
7
7
|
export { KeyboardSensor, PointerSensor } from '@dnd-kit/dom';
|
|
8
|
-
import { RefOrValue } from '@dnd-kit/react/utilities';
|
|
9
8
|
import { CleanupFunction } from '@dnd-kit/state';
|
|
10
9
|
|
|
11
10
|
type Events$1<T extends Data = Data> = DragDropEvents<Draggable<T>, Droppable<T>, DragDropManager<Draggable<T>, Droppable<T>>>;
|
|
@@ -20,6 +19,9 @@ interface Props$1<T extends Data = Data> extends DragDropManagerInput, PropsWith
|
|
|
20
19
|
}
|
|
21
20
|
declare function DragDropProvider<T extends Data = Data>({ children, onCollision, onBeforeDragStart, onDragStart, onDragMove, onDragOver, onDragEnd, ...input }: Props$1<T>): react_jsx_runtime.JSX.Element;
|
|
22
21
|
|
|
22
|
+
type Ref<T> = RefObject<T | null | undefined> | MutableRefObject<T>;
|
|
23
|
+
type RefOrValue<T> = T | Ref<T> | null | undefined;
|
|
24
|
+
|
|
23
25
|
interface UseDraggableInput<T extends Data = Data> extends Omit<DraggableInput<T>, 'handle' | 'element'> {
|
|
24
26
|
handle?: RefOrValue<Element>;
|
|
25
27
|
element?: RefOrValue<Element>;
|
|
@@ -70,8 +72,8 @@ type EventHandlers<T extends Data = Data> = {
|
|
|
70
72
|
declare function useDragDropMonitor<T extends Data = Data>(handlers: Partial<EventHandlers<T>>): void;
|
|
71
73
|
|
|
72
74
|
declare function useDragOperation(): {
|
|
73
|
-
readonly source:
|
|
74
|
-
readonly target:
|
|
75
|
+
readonly source: T_1;
|
|
76
|
+
readonly target: T_1;
|
|
75
77
|
};
|
|
76
78
|
|
|
77
79
|
interface Instance<T extends DragDropManager$1<any, any> = DragDropManager$1<any, any>> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnd-kit/react",
|
|
3
|
-
"version": "0.1.1-beta-
|
|
3
|
+
"version": "0.1.1-beta-20250418163929",
|
|
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.1.1-beta-
|
|
60
|
-
"@dnd-kit/dom": "0.1.1-beta-
|
|
61
|
-
"@dnd-kit/state": "0.1.1-beta-
|
|
59
|
+
"@dnd-kit/abstract": "0.1.1-beta-20250418163929",
|
|
60
|
+
"@dnd-kit/dom": "0.1.1-beta-20250418163929",
|
|
61
|
+
"@dnd-kit/state": "0.1.1-beta-20250418163929",
|
|
62
62
|
"tslib": "^2.6.2"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
package/sortable.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Data } from '@dnd-kit/abstract';
|
|
2
2
|
import { SortableInput, Sortable } from '@dnd-kit/dom/sortable';
|
|
3
3
|
export { isSortable } from '@dnd-kit/dom/sortable';
|
|
4
|
-
import {
|
|
4
|
+
import { RefObject, MutableRefObject } from 'react';
|
|
5
|
+
|
|
6
|
+
type Ref<T> = RefObject<T | null | undefined> | MutableRefObject<T>;
|
|
7
|
+
type RefOrValue<T> = T | Ref<T> | null | undefined;
|
|
5
8
|
|
|
6
9
|
interface UseSortableInput<T extends Data = Data> extends Omit<SortableInput<T>, 'handle' | 'element' | 'target'> {
|
|
7
10
|
handle?: RefOrValue<Element>;
|