@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.
- package/dist/long-bow.cjs.development.js +19 -18
- 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 -18
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +26 -18
- 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
|
});
|
|
@@ -27915,21 +27913,24 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
27915
27913
|
/**
|
|
27916
27914
|
* Handles the logic when an item has been dragged.
|
|
27917
27915
|
*/
|
|
27918
|
-
var handleDraggedItem = function
|
|
27919
|
-
|
|
27920
|
-
|
|
27921
|
-
|
|
27922
|
-
|
|
27923
|
-
|
|
27924
|
-
|
|
27925
|
-
|
|
27926
|
-
|
|
27927
|
-
|
|
27928
|
-
|
|
27929
|
-
|
|
27930
|
-
|
|
27931
|
-
}
|
|
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 {
|
|
27932
27929
|
updateDraggingState({
|
|
27930
|
+
dropPosition: {
|
|
27931
|
+
x: data.x,
|
|
27932
|
+
y: data.y
|
|
27933
|
+
},
|
|
27933
27934
|
isDragging: false
|
|
27934
27935
|
});
|
|
27935
27936
|
var targetElement = dragContainer.current;
|
|
@@ -27944,8 +27945,8 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
27944
27945
|
}
|
|
27945
27946
|
});
|
|
27946
27947
|
processDragEnd(item);
|
|
27947
|
-
}
|
|
27948
|
-
};
|
|
27948
|
+
}
|
|
27949
|
+
}, [draggingState.isDragging, draggingState.item, onDrop, clearDraggingState, updateDraggingState]);
|
|
27949
27950
|
/**
|
|
27950
27951
|
* Retrieves the current transform position of the dragged element.
|
|
27951
27952
|
*/
|