@rpg-engine/long-bow 0.7.77 → 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
  });
@@ -27839,12 +27837,10 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
27839
27837
  }, [containerType, isDepotSystem, setContextActions, clearContextActions, isContextMenuDisabled]);
27840
27838
  useEffect(function () {
27841
27839
  // Handle outside drop
27842
- if (onDrop && draggingState.item && dropPosition) {
27843
- console.log('ITEM SLOT: Outside drop', draggingState.item.key);
27844
- onDrop(draggingState.item, dropPosition);
27845
- clearDraggingState();
27840
+ if (onDrop && item && dropPosition) {
27841
+ onDrop(item, dropPosition);
27846
27842
  }
27847
- }, [dropPosition, onDrop, draggingState.item]);
27843
+ }, [dropPosition, onDrop, item]);
27848
27844
  var resetItem = function resetItem() {
27849
27845
  clearDraggingState();
27850
27846
  updateDetailsState({
@@ -27911,21 +27907,24 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
27911
27907
  /**
27912
27908
  * Handles the logic when an item has been dragged.
27913
27909
  */
27914
- var handleDraggedItem = function handleDraggedItem(e, data) {
27915
- requestAnimationFrame(function () {
27916
- var targetClasses = Array.from(e.target.classList);
27917
- var isOutsideDrop = targetClasses.some(function (elm) {
27918
- return elm.includes('rpgui-content');
27919
- }) || targetClasses.length === 0;
27920
- if (isOutsideDrop) {
27921
- updateDraggingState({
27922
- dropPosition: {
27923
- x: data.x,
27924
- y: data.y
27925
- }
27926
- });
27927
- }
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 {
27928
27923
  updateDraggingState({
27924
+ dropPosition: {
27925
+ x: data.x,
27926
+ y: data.y
27927
+ },
27929
27928
  isDragging: false
27930
27929
  });
27931
27930
  var targetElement = dragContainer.current;
@@ -27940,8 +27939,8 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
27940
27939
  }
27941
27940
  });
27942
27941
  processDragEnd(item);
27943
- });
27944
- };
27942
+ }
27943
+ }, [draggingState.isDragging, draggingState.item, onDrop, clearDraggingState, updateDraggingState]);
27945
27944
  /**
27946
27945
  * Retrieves the current transform position of the dragged element.
27947
27946
  */