@dnd-kit/react 0.0.9-beta-20250208041250 → 0.0.9-beta-20250209014617
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 +6 -2
- package/index.d.ts +3 -1
- package/index.js +7 -3
- package/package.json +4 -4
package/index.cjs
CHANGED
|
@@ -252,7 +252,7 @@ function shouldUpdateSynchronously(key, oldValue, newValue) {
|
|
|
252
252
|
if (key === "isDragSource" && !newValue && oldValue) return true;
|
|
253
253
|
return false;
|
|
254
254
|
}
|
|
255
|
-
function DragOverlay({ children, className }) {
|
|
255
|
+
function DragOverlay({ children, className, style, tag }) {
|
|
256
256
|
const ref = react.useRef(null);
|
|
257
257
|
const manager = useDragDropManager();
|
|
258
258
|
const source = hooks.useComputed(
|
|
@@ -289,7 +289,11 @@ function DragOverlay({ children, className }) {
|
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
291
|
}, [manager]);
|
|
292
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
292
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DragDropContext.Provider, { value: patchedManager, children: react.createElement(
|
|
293
|
+
tag || "div",
|
|
294
|
+
{ ref, className, style, "data-dnd-overlay": true },
|
|
295
|
+
renderChildren()
|
|
296
|
+
) });
|
|
293
297
|
function renderChildren() {
|
|
294
298
|
if (!source) return null;
|
|
295
299
|
if (typeof children === "function") {
|
package/index.d.ts
CHANGED
|
@@ -35,8 +35,10 @@ declare function useDraggable<T extends Data = Data>(input: UseDraggableInput<T>
|
|
|
35
35
|
interface Props {
|
|
36
36
|
className?: string;
|
|
37
37
|
children: ReactNode | ((source: Draggable) => ReactNode);
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
tag?: string;
|
|
38
40
|
}
|
|
39
|
-
declare function DragOverlay({ children, className }: Props): react_jsx_runtime.JSX.Element;
|
|
41
|
+
declare function DragOverlay({ children, className, style, tag }: Props): react_jsx_runtime.JSX.Element;
|
|
40
42
|
|
|
41
43
|
interface UseDroppableInput<T extends Data = Data> extends Omit<DroppableInput<T>, 'element'> {
|
|
42
44
|
element?: RefOrValue<Element>;
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext, useState, useEffect, startTransition, useContext, useCallback, useRef, useMemo, useTransition, useLayoutEffect } from 'react';
|
|
1
|
+
import { createContext, useState, useEffect, startTransition, useContext, useCallback, useRef, useMemo, createElement, useTransition, useLayoutEffect } from 'react';
|
|
2
2
|
import { DragDropManager, defaultPreset, Draggable, Feedback, Droppable } from '@dnd-kit/dom';
|
|
3
3
|
import { useLatest, useOnValueChange, useIsomorphicLayoutEffect, useDeepSignal, useOnElementChange, useComputed, useConstant } from '@dnd-kit/react/hooks';
|
|
4
4
|
import { deepEqual } from '@dnd-kit/state';
|
|
@@ -250,7 +250,7 @@ function shouldUpdateSynchronously(key, oldValue, newValue) {
|
|
|
250
250
|
if (key === "isDragSource" && !newValue && oldValue) return true;
|
|
251
251
|
return false;
|
|
252
252
|
}
|
|
253
|
-
function DragOverlay({ children, className }) {
|
|
253
|
+
function DragOverlay({ children, className, style, tag }) {
|
|
254
254
|
const ref = useRef(null);
|
|
255
255
|
const manager = useDragDropManager();
|
|
256
256
|
const source = useComputed(
|
|
@@ -287,7 +287,11 @@ function DragOverlay({ children, className }) {
|
|
|
287
287
|
}
|
|
288
288
|
});
|
|
289
289
|
}, [manager]);
|
|
290
|
-
return /* @__PURE__ */ jsx(
|
|
290
|
+
return /* @__PURE__ */ jsx(DragDropContext.Provider, { value: patchedManager, children: createElement(
|
|
291
|
+
tag || "div",
|
|
292
|
+
{ ref, className, style, "data-dnd-overlay": true },
|
|
293
|
+
renderChildren()
|
|
294
|
+
) });
|
|
291
295
|
function renderChildren() {
|
|
292
296
|
if (!source) return null;
|
|
293
297
|
if (typeof children === "function") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnd-kit/react",
|
|
3
|
-
"version": "0.0.9-beta-
|
|
3
|
+
"version": "0.0.9-beta-20250209014617",
|
|
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.0.9-beta-
|
|
60
|
-
"@dnd-kit/dom": "0.0.9-beta-
|
|
61
|
-
"@dnd-kit/state": "0.0.9-beta-
|
|
59
|
+
"@dnd-kit/abstract": "0.0.9-beta-20250209014617",
|
|
60
|
+
"@dnd-kit/dom": "0.0.9-beta-20250209014617",
|
|
61
|
+
"@dnd-kit/state": "0.0.9-beta-20250209014617",
|
|
62
62
|
"tslib": "^2.6.2"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|