@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.
@@ -27707,10 +27707,8 @@ var ItemSlotDetailsProvider = function ItemSlotDetailsProvider(_ref) {
27707
27707
  setDetailsState(initialDetailsState);
27708
27708
  }, [setDetailsState]);
27709
27709
  var setContextActions = React.useCallback(function (item, containerType, isDepotSystem, isContextMenuDisabled) {
27710
- console.log('ITEM SLOT: Set context actions for', item == null ? void 0 : item.key);
27711
27710
  if (item && containerType && !isContextMenuDisabled) {
27712
27711
  var newContextActions = generateContextMenu(item, containerType, isDepotSystem);
27713
- console.log('ITEM SLOT: New context actions:', newContextActions);
27714
27712
  updateDetailsState({
27715
27713
  contextActions: newContextActions
27716
27714
  });
@@ -27845,12 +27843,10 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
27845
27843
  }, [containerType, isDepotSystem, setContextActions, clearContextActions, isContextMenuDisabled]);
27846
27844
  React.useEffect(function () {
27847
27845
  // Handle outside drop
27848
- if (onDrop && draggingState.item && dropPosition) {
27849
- console.log('ITEM SLOT: Outside drop', draggingState.item.key);
27850
- onDrop(draggingState.item, dropPosition);
27851
- clearDraggingState();
27846
+ if (onDrop && item && dropPosition) {
27847
+ onDrop(item, dropPosition);
27852
27848
  }
27853
- }, [dropPosition, onDrop, draggingState.item]);
27849
+ }, [dropPosition, onDrop, item]);
27854
27850
  var resetItem = function resetItem() {
27855
27851
  clearDraggingState();
27856
27852
  updateDetailsState({
@@ -27917,21 +27913,24 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
27917
27913
  /**
27918
27914
  * Handles the logic when an item has been dragged.
27919
27915
  */
27920
- var handleDraggedItem = function handleDraggedItem(e, data) {
27921
- requestAnimationFrame(function () {
27922
- var targetClasses = Array.from(e.target.classList);
27923
- var isOutsideDrop = targetClasses.some(function (elm) {
27924
- return elm.includes('rpgui-content');
27925
- }) || targetClasses.length === 0;
27926
- if (isOutsideDrop) {
27927
- updateDraggingState({
27928
- dropPosition: {
27929
- x: data.x,
27930
- y: data.y
27931
- }
27932
- });
27933
- }
27916
+ var handleDraggedItem = React.useCallback(function (e, data) {
27917
+ var targetClasses = Array.from(e.target.classList);
27918
+ var isOutsideDrop = targetClasses.some(function (elm) {
27919
+ return elm.includes('rpgui-content');
27920
+ }) || targetClasses.length === 0;
27921
+ if (isOutsideDrop && draggingState.isDragging && draggingState.item) {
27922
+ console.log('ITEM SLOT: Outside drop', draggingState.item.key);
27923
+ onDrop == null ? void 0 : onDrop(draggingState.item, {
27924
+ x: data.x,
27925
+ y: data.y
27926
+ });
27927
+ clearDraggingState();
27928
+ } else {
27934
27929
  updateDraggingState({
27930
+ dropPosition: {
27931
+ x: data.x,
27932
+ y: data.y
27933
+ },
27935
27934
  isDragging: false
27936
27935
  });
27937
27936
  var targetElement = dragContainer.current;
@@ -27946,8 +27945,8 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
27946
27945
  }
27947
27946
  });
27948
27947
  processDragEnd(item);
27949
- });
27950
- };
27948
+ }
27949
+ }, [draggingState.isDragging, draggingState.item, onDrop, clearDraggingState, updateDraggingState]);
27951
27950
  /**
27952
27951
  * Retrieves the current transform position of the dragged element.
27953
27952
  */