@rpg-engine/long-bow 0.7.75 → 0.7.76
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 +10 -10
- 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 +10 -10
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +57 -14
- 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,13 @@ 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
27842
|
if (onDrop && item && dropPosition) {
|
|
27847
27843
|
onDrop(item, dropPosition);
|
|
27848
27844
|
}
|
|
27849
|
-
}, [dropPosition]);
|
|
27845
|
+
}, [dropPosition, onDrop, item]);
|
|
27850
27846
|
var resetItem = function resetItem() {
|
|
27851
27847
|
clearDraggingState();
|
|
27852
27848
|
updateDetailsState({
|
|
@@ -27868,6 +27864,9 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
27868
27864
|
onDragEnd == null ? void 0 : onDragEnd(quantity);
|
|
27869
27865
|
}
|
|
27870
27866
|
};
|
|
27867
|
+
var refreshContextActions = function refreshContextActions() {
|
|
27868
|
+
setContextActions(item, containerType, isDepotSystem != null ? isDepotSystem : false, isContextMenuDisabled);
|
|
27869
|
+
};
|
|
27871
27870
|
var onDraggableStop = function onDraggableStop(e, data) {
|
|
27872
27871
|
requestAnimationFrame(function () {
|
|
27873
27872
|
updateDraggingState({
|
|
@@ -28007,6 +28006,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
28007
28006
|
if (!item || isSelectingShortcut) {
|
|
28008
28007
|
return;
|
|
28009
28008
|
}
|
|
28009
|
+
refreshContextActions();
|
|
28010
28010
|
if (onDragStart && containerType) {
|
|
28011
28011
|
onDragStart(item, slotIndex, containerType);
|
|
28012
28012
|
}
|