@dnd-kit/abstract 0.1.2 → 0.1.3-beta-20250425133001

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
@@ -918,6 +918,7 @@ declare class Droppable<T extends Data = Data, U extends DragDropManager<any, an
918
918
  * @template V - The type of drag and drop manager
919
919
  */
920
920
  declare class DragActions<T extends Draggable, U extends Droppable, V extends DragDropManager<T, U>> {
921
+ #private;
921
922
  private readonly manager;
922
923
  /**
923
924
  * Creates a new instance of drag actions.
package/index.d.ts CHANGED
@@ -918,6 +918,7 @@ declare class Droppable<T extends Data = Data, U extends DragDropManager<any, an
918
918
  * @template V - The type of drag and drop manager
919
919
  */
920
920
  declare class DragActions<T extends Draggable, U extends Droppable, V extends DragDropManager<T, U>> {
921
+ #private;
921
922
  private readonly manager;
922
923
  /**
923
924
  * Creates a new instance of drag actions.
package/index.js CHANGED
@@ -634,6 +634,7 @@ __decorateElement(_init2, 2, "dropped", _dropped_dec, Status);
634
634
  __decoratorMetadata(_init2, Status);
635
635
 
636
636
  // src/core/manager/actions.ts
637
+ var _animationFrame;
637
638
  var DragActions = class {
638
639
  /**
639
640
  * Creates a new instance of drag actions.
@@ -642,6 +643,7 @@ var DragActions = class {
642
643
  */
643
644
  constructor(manager) {
644
645
  this.manager = manager;
646
+ __privateAdd(this, _animationFrame);
645
647
  }
646
648
  /**
647
649
  * Sets the source of the drag operation.
@@ -717,15 +719,18 @@ var DragActions = class {
717
719
  return false;
718
720
  }
719
721
  this.manager.renderer.rendering.then(() => {
720
- dragOperation.status.set("initializing" /* Initializing */);
721
- requestAnimationFrame(() => {
722
+ const { status } = dragOperation;
723
+ if (status.current !== "initialization-pending" /* InitializationPending */) return;
724
+ status.set("initializing" /* Initializing */);
725
+ __privateSet(this, _animationFrame, requestAnimationFrame(() => {
726
+ if (status.current !== "initializing" /* Initializing */) return;
722
727
  dragOperation.status.set("dragging" /* Dragging */);
723
728
  this.manager.monitor.dispatch("dragstart", {
724
729
  nativeEvent,
725
730
  operation: dragOperation.snapshot(),
726
731
  cancelable: false
727
732
  });
728
- });
733
+ }));
729
734
  });
730
735
  return true;
731
736
  });
@@ -802,6 +807,7 @@ var DragActions = class {
802
807
  });
803
808
  return output;
804
809
  };
810
+ if (__privateGet(this, _animationFrame)) cancelAnimationFrame(__privateGet(this, _animationFrame));
805
811
  const end = () => {
806
812
  this.manager.renderer.rendering.then(() => {
807
813
  dragOperation.status.set("dropped" /* Dropped */);
@@ -843,6 +849,7 @@ var DragActions = class {
843
849
  });
844
850
  }
845
851
  };
852
+ _animationFrame = new WeakMap();
846
853
  var _disabled_dec2, _data_dec, _id_dec, _manager_dec, _init3, _manager, _id, _data, _disabled2;
847
854
  _manager_dec = [reactive], _id_dec = [reactive], _data_dec = [reactive], _disabled_dec2 = [reactive];
848
855
  var Entity = class {