@dnd-kit/react 0.3.0-beta-20260216011636 → 0.3.0

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.
Files changed (3) hide show
  1. package/index.cjs +7 -4
  2. package/index.js +8 -5
  3. package/package.json +4 -4
package/index.cjs CHANGED
@@ -99,7 +99,10 @@ function DragDropProvider(_a2) {
99
99
  "onDragEnd"
100
100
  ]);
101
101
  const rendererRef = react.useRef(null);
102
- const { plugins, modifiers, sensors } = input;
102
+ const { plugins: pluginsInput, modifiers: modifiersInput, sensors: sensorsInput } = input;
103
+ const plugins = dom.resolveCustomizable(pluginsInput, dom.defaultPreset.plugins);
104
+ const sensors = dom.resolveCustomizable(sensorsInput, dom.defaultPreset.sensors);
105
+ const modifiers = dom.resolveCustomizable(modifiersInput, dom.defaultPreset.modifiers);
103
106
  const handleBeforeDragStart = hooks.useLatest(onBeforeDragStart);
104
107
  const handleDragStart = hooks.useLatest(onDragStart);
105
108
  const handleDragOver = hooks.useLatest(onDragOver);
@@ -159,17 +162,17 @@ function DragDropProvider(_a2) {
159
162
  }, [manager]);
160
163
  hooks.useOnValueChange(
161
164
  plugins,
162
- () => manager && (manager.plugins = plugins != null ? plugins : dom.defaultPreset.plugins),
165
+ () => manager && (manager.plugins = plugins),
163
166
  ...options
164
167
  );
165
168
  hooks.useOnValueChange(
166
169
  sensors,
167
- () => manager && (manager.sensors = sensors != null ? sensors : dom.defaultPreset.sensors),
170
+ () => manager && (manager.sensors = sensors),
168
171
  ...options
169
172
  );
170
173
  hooks.useOnValueChange(
171
174
  modifiers,
172
- () => manager && (manager.modifiers = modifiers != null ? modifiers : dom.defaultPreset.modifiers),
175
+ () => manager && (manager.modifiers = modifiers),
173
176
  ...options
174
177
  );
175
178
  return /* @__PURE__ */ jsxRuntime.jsxs(DragDropContext.Provider, { value: manager, children: [
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createContext, memo, forwardRef, useState, useRef, useMemo, startTransition, useImperativeHandle, useEffect, useInsertionEffect, useContext, useCallback, createElement } from 'react';
2
- import { DragDropManager, defaultPreset, Draggable, Feedback, Droppable } from '@dnd-kit/dom';
2
+ import { DragDropManager, resolveCustomizable, defaultPreset, Draggable, Feedback, Droppable } from '@dnd-kit/dom';
3
3
  export { KeyboardSensor, PointerSensor } from '@dnd-kit/dom';
4
4
  import { useIsomorphicLayoutEffect, useLatest, useOnValueChange, useDeepSignal, useOnElementChange, useComputed } from '@dnd-kit/react/hooks';
5
5
  import { deepEqual, ValueHistory, derived, batch } from '@dnd-kit/state';
@@ -98,7 +98,10 @@ function DragDropProvider(_a2) {
98
98
  "onDragEnd"
99
99
  ]);
100
100
  const rendererRef = useRef(null);
101
- const { plugins, modifiers, sensors } = input;
101
+ const { plugins: pluginsInput, modifiers: modifiersInput, sensors: sensorsInput } = input;
102
+ const plugins = resolveCustomizable(pluginsInput, defaultPreset.plugins);
103
+ const sensors = resolveCustomizable(sensorsInput, defaultPreset.sensors);
104
+ const modifiers = resolveCustomizable(modifiersInput, defaultPreset.modifiers);
102
105
  const handleBeforeDragStart = useLatest(onBeforeDragStart);
103
106
  const handleDragStart = useLatest(onDragStart);
104
107
  const handleDragOver = useLatest(onDragOver);
@@ -158,17 +161,17 @@ function DragDropProvider(_a2) {
158
161
  }, [manager]);
159
162
  useOnValueChange(
160
163
  plugins,
161
- () => manager && (manager.plugins = plugins != null ? plugins : defaultPreset.plugins),
164
+ () => manager && (manager.plugins = plugins),
162
165
  ...options
163
166
  );
164
167
  useOnValueChange(
165
168
  sensors,
166
- () => manager && (manager.sensors = sensors != null ? sensors : defaultPreset.sensors),
169
+ () => manager && (manager.sensors = sensors),
167
170
  ...options
168
171
  );
169
172
  useOnValueChange(
170
173
  modifiers,
171
- () => manager && (manager.modifiers = modifiers != null ? modifiers : defaultPreset.modifiers),
174
+ () => manager && (manager.modifiers = modifiers),
172
175
  ...options
173
176
  );
174
177
  return /* @__PURE__ */ jsxs(DragDropContext.Provider, { value: manager, children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnd-kit/react",
3
- "version": "0.3.0-beta-20260216011636",
3
+ "version": "0.3.0",
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-20260216011636",
60
- "@dnd-kit/dom": "0.3.0-beta-20260216011636",
61
- "@dnd-kit/state": "0.3.0-beta-20260216011636",
59
+ "@dnd-kit/abstract": "^0.3.0",
60
+ "@dnd-kit/dom": "^0.3.0",
61
+ "@dnd-kit/state": "^0.3.0",
62
62
  "tslib": "^2.6.2"
63
63
  },
64
64
  "peerDependencies": {