@rpg-engine/long-bow 0.7.76 → 0.7.79

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.
@@ -27701,10 +27701,8 @@ var ItemSlotDetailsProvider = function ItemSlotDetailsProvider(_ref) {
27701
27701
  setDetailsState(initialDetailsState);
27702
27702
  }, [setDetailsState]);
27703
27703
  var setContextActions = useCallback(function (item, containerType, isDepotSystem, isContextMenuDisabled) {
27704
- console.log('ITEM SLOT: Set context actions for', item == null ? void 0 : item.key);
27705
27704
  if (item && containerType && !isContextMenuDisabled) {
27706
27705
  var newContextActions = generateContextMenu(item, containerType, isDepotSystem);
27707
- console.log('ITEM SLOT: New context actions:', newContextActions);
27708
27706
  updateDetailsState({
27709
27707
  contextActions: newContextActions
27710
27708
  });
@@ -27909,21 +27907,24 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
27909
27907
  /**
27910
27908
  * Handles the logic when an item has been dragged.
27911
27909
  */
27912
- var handleDraggedItem = function handleDraggedItem(e, data) {
27913
- requestAnimationFrame(function () {
27914
- var targetClasses = Array.from(e.target.classList);
27915
- var isOutsideDrop = targetClasses.some(function (elm) {
27916
- return elm.includes('rpgui-content');
27917
- }) || targetClasses.length === 0;
27918
- if (isOutsideDrop) {
27919
- updateDraggingState({
27920
- dropPosition: {
27921
- x: data.x,
27922
- y: data.y
27923
- }
27924
- });
27925
- }
27910
+ var handleDraggedItem = useCallback(function (e, data) {
27911
+ var targetClasses = Array.from(e.target.classList);
27912
+ var isOutsideDrop = targetClasses.some(function (elm) {
27913
+ return elm.includes('rpgui-content');
27914
+ }) || targetClasses.length === 0;
27915
+ if (isOutsideDrop && draggingState.isDragging && draggingState.item) {
27916
+ console.log('ITEM SLOT: Outside drop', draggingState.item.key);
27917
+ onDrop == null ? void 0 : onDrop(draggingState.item, {
27918
+ x: data.x,
27919
+ y: data.y
27920
+ });
27921
+ clearDraggingState();
27922
+ } else {
27926
27923
  updateDraggingState({
27924
+ dropPosition: {
27925
+ x: data.x,
27926
+ y: data.y
27927
+ },
27927
27928
  isDragging: false
27928
27929
  });
27929
27930
  var targetElement = dragContainer.current;
@@ -27938,8 +27939,8 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
27938
27939
  }
27939
27940
  });
27940
27941
  processDragEnd(item);
27941
- });
27942
- };
27942
+ }
27943
+ }, [draggingState.isDragging, draggingState.item, onDrop, clearDraggingState, updateDraggingState]);
27943
27944
  /**
27944
27945
  * Retrieves the current transform position of the dragged element.
27945
27946
  */