@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.
- package/dist/long-bow.cjs.development.js +19 -27
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +19 -27
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +32 -35
- package/src/components/Item/Inventory/context/ItemSlotDetailsContext.tsx +0 -2
|
@@ -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
|
});
|
|
@@ -27830,7 +27828,6 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
27830
27828
|
updateDraggingState = _useItemSlotDragging.updateDraggingState,
|
|
27831
27829
|
clearDraggingState = _useItemSlotDragging.clearDraggingState;
|
|
27832
27830
|
var isFocused = draggingState.isFocused,
|
|
27833
|
-
dropPosition = draggingState.dropPosition,
|
|
27834
27831
|
isDragging = draggingState.isDragging,
|
|
27835
27832
|
draggingDistance = draggingState.draggingDistance;
|
|
27836
27833
|
React.useEffect(function () {
|
|
@@ -27843,14 +27840,6 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
27843
27840
|
isFocused: false
|
|
27844
27841
|
});
|
|
27845
27842
|
}, [containerType, isDepotSystem, setContextActions, clearContextActions, isContextMenuDisabled]);
|
|
27846
|
-
React.useEffect(function () {
|
|
27847
|
-
// 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();
|
|
27852
|
-
}
|
|
27853
|
-
}, [dropPosition, onDrop, draggingState.item]);
|
|
27854
27843
|
var resetItem = function resetItem() {
|
|
27855
27844
|
clearDraggingState();
|
|
27856
27845
|
updateDetailsState({
|
|
@@ -27917,21 +27906,24 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
27917
27906
|
/**
|
|
27918
27907
|
* Handles the logic when an item has been dragged.
|
|
27919
27908
|
*/
|
|
27920
|
-
var handleDraggedItem = function
|
|
27921
|
-
|
|
27922
|
-
|
|
27923
|
-
|
|
27924
|
-
|
|
27925
|
-
|
|
27926
|
-
|
|
27927
|
-
|
|
27928
|
-
|
|
27929
|
-
|
|
27930
|
-
|
|
27931
|
-
|
|
27932
|
-
|
|
27933
|
-
}
|
|
27909
|
+
var handleDraggedItem = React.useCallback(function (e, data) {
|
|
27910
|
+
var targetClasses = Array.from(e.target.classList);
|
|
27911
|
+
var isOutsideDrop = targetClasses.some(function (elm) {
|
|
27912
|
+
return elm.includes('rpgui-content');
|
|
27913
|
+
}) || targetClasses.length === 0;
|
|
27914
|
+
if (isOutsideDrop && draggingState.isDragging && draggingState.item) {
|
|
27915
|
+
console.log('ITEM SLOT: Outside drop', draggingState.item.key);
|
|
27916
|
+
onDrop == null ? void 0 : onDrop(draggingState.item, {
|
|
27917
|
+
x: data.x,
|
|
27918
|
+
y: data.y
|
|
27919
|
+
});
|
|
27920
|
+
clearDraggingState();
|
|
27921
|
+
} else {
|
|
27934
27922
|
updateDraggingState({
|
|
27923
|
+
dropPosition: {
|
|
27924
|
+
x: data.x,
|
|
27925
|
+
y: data.y
|
|
27926
|
+
},
|
|
27935
27927
|
isDragging: false
|
|
27936
27928
|
});
|
|
27937
27929
|
var targetElement = dragContainer.current;
|
|
@@ -27946,8 +27938,8 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
27946
27938
|
}
|
|
27947
27939
|
});
|
|
27948
27940
|
processDragEnd(item);
|
|
27949
|
-
}
|
|
27950
|
-
};
|
|
27941
|
+
}
|
|
27942
|
+
}, [draggingState.isDragging, draggingState.item, onDrop, clearDraggingState, updateDraggingState]);
|
|
27951
27943
|
/**
|
|
27952
27944
|
* Retrieves the current transform position of the dragged element.
|
|
27953
27945
|
*/
|