@dnd-kit/dom 0.4.0-beta-20260412020809 → 0.4.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.
package/index.d.cts CHANGED
@@ -258,12 +258,13 @@ type DropAnimationFunction = (context: {
258
258
  type DropAnimation = DropAnimationOptions | DropAnimationFunction;
259
259
 
260
260
  type FeedbackType = 'default' | 'move' | 'clone' | 'none';
261
+ type FeedbackInput = FeedbackType | ((source: Draggable, manager: DragDropManager) => FeedbackType);
261
262
  interface KeyboardTransition {
262
263
  duration?: number;
263
264
  easing?: string;
264
265
  }
265
266
  interface FeedbackOptions {
266
- feedback?: FeedbackType;
267
+ feedback?: FeedbackInput;
267
268
  rootElement?: Element | ((source: Draggable) => Element);
268
269
  dropAnimation?: DropAnimation | null;
269
270
  keyboardTransition?: KeyboardTransition | null;
@@ -371,4 +372,4 @@ declare class StyleInjector extends CorePlugin<DragDropManager, StyleInjectorOpt
371
372
  static configure: (options: StyleInjectorOptions) => _dnd_kit_abstract.PluginDescriptor<any, any, typeof StyleInjector>;
372
373
  }
373
374
 
374
- export { Accessibility, AutoScroller, type BeforeDragStartEvent, type CollisionEvent, Cursor, DragDropManager, type Input as DragDropManagerInput, type DragEndEvent, type DragMoveEvent, type DragOverEvent, type DragStartEvent, Draggable, type Input$2 as DraggableInput, type DropAnimation, type DropAnimationFunction, type DropAnimationOptions, Droppable, type Input$1 as DroppableInput, Feedback, type FeedbackOptions, type FeedbackType, KeyboardSensor, type KeyboardSensorOptions, PointerActivationConstraints, PointerSensor, type PointerSensorOptions, PreventSelection, ScrollListener, Scroller, type Sensors, StyleInjector, type Transition, defaultPreset };
375
+ export { Accessibility, AutoScroller, type BeforeDragStartEvent, type CollisionEvent, Cursor, DragDropManager, type Input as DragDropManagerInput, type DragEndEvent, type DragMoveEvent, type DragOverEvent, type DragStartEvent, Draggable, type Input$2 as DraggableInput, type DropAnimation, type DropAnimationFunction, type DropAnimationOptions, Droppable, type Input$1 as DroppableInput, Feedback, type FeedbackInput, type FeedbackOptions, type FeedbackType, KeyboardSensor, type KeyboardSensorOptions, PointerActivationConstraints, PointerSensor, type PointerSensorOptions, PreventSelection, ScrollListener, Scroller, type Sensors, StyleInjector, type Transition, defaultPreset };
package/index.d.ts CHANGED
@@ -258,12 +258,13 @@ type DropAnimationFunction = (context: {
258
258
  type DropAnimation = DropAnimationOptions | DropAnimationFunction;
259
259
 
260
260
  type FeedbackType = 'default' | 'move' | 'clone' | 'none';
261
+ type FeedbackInput = FeedbackType | ((source: Draggable, manager: DragDropManager) => FeedbackType);
261
262
  interface KeyboardTransition {
262
263
  duration?: number;
263
264
  easing?: string;
264
265
  }
265
266
  interface FeedbackOptions {
266
- feedback?: FeedbackType;
267
+ feedback?: FeedbackInput;
267
268
  rootElement?: Element | ((source: Draggable) => Element);
268
269
  dropAnimation?: DropAnimation | null;
269
270
  keyboardTransition?: KeyboardTransition | null;
@@ -371,4 +372,4 @@ declare class StyleInjector extends CorePlugin<DragDropManager, StyleInjectorOpt
371
372
  static configure: (options: StyleInjectorOptions) => _dnd_kit_abstract.PluginDescriptor<any, any, typeof StyleInjector>;
372
373
  }
373
374
 
374
- export { Accessibility, AutoScroller, type BeforeDragStartEvent, type CollisionEvent, Cursor, DragDropManager, type Input as DragDropManagerInput, type DragEndEvent, type DragMoveEvent, type DragOverEvent, type DragStartEvent, Draggable, type Input$2 as DraggableInput, type DropAnimation, type DropAnimationFunction, type DropAnimationOptions, Droppable, type Input$1 as DroppableInput, Feedback, type FeedbackOptions, type FeedbackType, KeyboardSensor, type KeyboardSensorOptions, PointerActivationConstraints, PointerSensor, type PointerSensorOptions, PreventSelection, ScrollListener, Scroller, type Sensors, StyleInjector, type Transition, defaultPreset };
375
+ export { Accessibility, AutoScroller, type BeforeDragStartEvent, type CollisionEvent, Cursor, DragDropManager, type Input as DragDropManagerInput, type DragEndEvent, type DragMoveEvent, type DragOverEvent, type DragStartEvent, Draggable, type Input$2 as DraggableInput, type DropAnimation, type DropAnimationFunction, type DropAnimationOptions, Droppable, type Input$1 as DroppableInput, Feedback, type FeedbackInput, type FeedbackOptions, type FeedbackType, KeyboardSensor, type KeyboardSensorOptions, PointerActivationConstraints, PointerSensor, type PointerSensorOptions, PreventSelection, ScrollListener, Scroller, type Sensors, StyleInjector, type Transition, defaultPreset };
package/index.js CHANGED
@@ -911,7 +911,8 @@ render_fn = function() {
911
911
  if (!source) return;
912
912
  const { element } = source;
913
913
  const entityOptions = source.pluginConfig(_Feedback);
914
- const feedback = (_b2 = (_a5 = entityOptions == null ? void 0 : entityOptions.feedback) != null ? _a5 : options == null ? void 0 : options.feedback) != null ? _b2 : "default";
914
+ const feedbackOption = (_b2 = (_a5 = entityOptions == null ? void 0 : entityOptions.feedback) != null ? _a5 : options == null ? void 0 : options.feedback) != null ? _b2 : "default";
915
+ const feedback = typeof feedbackOption === "function" ? feedbackOption(source, manager) : feedbackOption;
915
916
  if (!element || feedback === "none" || !status.initialized || status.initializing) {
916
917
  return;
917
918
  }