@rpg-engine/long-bow 0.7.75 → 0.7.77
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/components/Item/Inventory/ItemSlot.d.ts +25 -0
- package/dist/components/Item/Inventory/context/ItemSlotDetailsContext.d.ts +1 -1
- package/dist/long-bow.cjs.development.js +14 -12
- 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 +14 -12
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +63 -21
- package/src/components/Item/Inventory/context/ItemSlotDetailsContext.tsx +7 -3
package/dist/long-bow.esm.js
CHANGED
|
@@ -27700,9 +27700,11 @@ var ItemSlotDetailsProvider = function ItemSlotDetailsProvider(_ref) {
|
|
|
27700
27700
|
var clearDetailsState = useCallback(function () {
|
|
27701
27701
|
setDetailsState(initialDetailsState);
|
|
27702
27702
|
}, [setDetailsState]);
|
|
27703
|
-
var setContextActions = useCallback(function (item, containerType, isDepotSystem) {
|
|
27704
|
-
|
|
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
|
+
if (item && containerType && !isContextMenuDisabled) {
|
|
27705
27706
|
var newContextActions = generateContextMenu(item, containerType, isDepotSystem);
|
|
27707
|
+
console.log('ITEM SLOT: New context actions:', newContextActions);
|
|
27706
27708
|
updateDetailsState({
|
|
27707
27709
|
contextActions: newContextActions
|
|
27708
27710
|
});
|
|
@@ -27834,19 +27836,15 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
27834
27836
|
},
|
|
27835
27837
|
isFocused: false
|
|
27836
27838
|
});
|
|
27837
|
-
|
|
27838
|
-
if (item && containerType && !isContextMenuDisabled) {
|
|
27839
|
-
setContextActions(item, containerType, isDepotSystem != null ? isDepotSystem : false);
|
|
27840
|
-
} else {
|
|
27841
|
-
clearContextActions();
|
|
27842
|
-
}
|
|
27843
|
-
}, [item, containerType, isDepotSystem, setContextActions, clearContextActions]);
|
|
27839
|
+
}, [containerType, isDepotSystem, setContextActions, clearContextActions, isContextMenuDisabled]);
|
|
27844
27840
|
useEffect(function () {
|
|
27845
27841
|
// Handle outside drop
|
|
27846
|
-
if (onDrop && item && dropPosition) {
|
|
27847
|
-
|
|
27842
|
+
if (onDrop && draggingState.item && dropPosition) {
|
|
27843
|
+
console.log('ITEM SLOT: Outside drop', draggingState.item.key);
|
|
27844
|
+
onDrop(draggingState.item, dropPosition);
|
|
27845
|
+
clearDraggingState();
|
|
27848
27846
|
}
|
|
27849
|
-
}, [dropPosition]);
|
|
27847
|
+
}, [dropPosition, onDrop, draggingState.item]);
|
|
27850
27848
|
var resetItem = function resetItem() {
|
|
27851
27849
|
clearDraggingState();
|
|
27852
27850
|
updateDetailsState({
|
|
@@ -27868,6 +27866,9 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
27868
27866
|
onDragEnd == null ? void 0 : onDragEnd(quantity);
|
|
27869
27867
|
}
|
|
27870
27868
|
};
|
|
27869
|
+
var refreshContextActions = function refreshContextActions() {
|
|
27870
|
+
setContextActions(item, containerType, isDepotSystem != null ? isDepotSystem : false, isContextMenuDisabled);
|
|
27871
|
+
};
|
|
27871
27872
|
var onDraggableStop = function onDraggableStop(e, data) {
|
|
27872
27873
|
requestAnimationFrame(function () {
|
|
27873
27874
|
updateDraggingState({
|
|
@@ -28007,6 +28008,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
28007
28008
|
if (!item || isSelectingShortcut) {
|
|
28008
28009
|
return;
|
|
28009
28010
|
}
|
|
28011
|
+
refreshContextActions();
|
|
28010
28012
|
if (onDragStart && containerType) {
|
|
28011
28013
|
onDragStart(item, slotIndex, containerType);
|
|
28012
28014
|
}
|