@rpg-engine/long-bow 0.7.77 → 0.7.80

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
  });
@@ -27824,7 +27822,6 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
27824
27822
  updateDraggingState = _useItemSlotDragging.updateDraggingState,
27825
27823
  clearDraggingState = _useItemSlotDragging.clearDraggingState;
27826
27824
  var isFocused = draggingState.isFocused,
27827
- dropPosition = draggingState.dropPosition,
27828
27825
  isDragging = draggingState.isDragging,
27829
27826
  draggingDistance = draggingState.draggingDistance;
27830
27827
  useEffect(function () {
@@ -27837,14 +27834,6 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
27837
27834
  isFocused: false
27838
27835
  });
27839
27836
  }, [containerType, isDepotSystem, setContextActions, clearContextActions, isContextMenuDisabled]);
27840
- useEffect(function () {
27841
- // 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();
27846
- }
27847
- }, [dropPosition, onDrop, draggingState.item]);
27848
27837
  var resetItem = function resetItem() {
27849
27838
  clearDraggingState();
27850
27839
  updateDetailsState({
@@ -27911,21 +27900,24 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
27911
27900
  /**
27912
27901
  * Handles the logic when an item has been dragged.
27913
27902
  */
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
- }
27903
+ var handleDraggedItem = useCallback(function (e, data) {
27904
+ var targetClasses = Array.from(e.target.classList);
27905
+ var isOutsideDrop = targetClasses.some(function (elm) {
27906
+ return elm.includes('rpgui-content');
27907
+ }) || targetClasses.length === 0;
27908
+ if (isOutsideDrop && draggingState.isDragging && draggingState.item) {
27909
+ console.log('ITEM SLOT: Outside drop', draggingState.item.key);
27910
+ onDrop == null ? void 0 : onDrop(draggingState.item, {
27911
+ x: data.x,
27912
+ y: data.y
27913
+ });
27914
+ clearDraggingState();
27915
+ } else {
27928
27916
  updateDraggingState({
27917
+ dropPosition: {
27918
+ x: data.x,
27919
+ y: data.y
27920
+ },
27929
27921
  isDragging: false
27930
27922
  });
27931
27923
  var targetElement = dragContainer.current;
@@ -27940,8 +27932,8 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
27940
27932
  }
27941
27933
  });
27942
27934
  processDragEnd(item);
27943
- });
27944
- };
27935
+ }
27936
+ }, [draggingState.isDragging, draggingState.item, onDrop, clearDraggingState, updateDraggingState]);
27945
27937
  /**
27946
27938
  * Retrieves the current transform position of the dragged element.
27947
27939
  */