@rpg-engine/long-bow 0.7.64 → 0.7.66
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 +8 -7
- 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 +8 -7
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +5 -0
- package/src/components/Item/Inventory/hooks/useItemSlotDragAndDrop.ts +23 -6
|
@@ -27826,6 +27826,7 @@ var useItemSlotDragAndDrop = function useItemSlotDragAndDrop(_ref) {
|
|
|
27826
27826
|
}
|
|
27827
27827
|
});
|
|
27828
27828
|
});
|
|
27829
|
+
setDraggingItem(null);
|
|
27829
27830
|
}, [setTooltipState]);
|
|
27830
27831
|
var handleSuccessfulDrag = React.useCallback(function (quantity) {
|
|
27831
27832
|
resetDragState();
|
|
@@ -27843,22 +27844,21 @@ var useItemSlotDragAndDrop = function useItemSlotDragAndDrop(_ref) {
|
|
|
27843
27844
|
var _dragState$position = dragState.position,
|
|
27844
27845
|
x = _dragState$position.x,
|
|
27845
27846
|
y = _dragState$position.y;
|
|
27846
|
-
if (Math.abs(data.x - x) >
|
|
27847
|
+
if (Math.abs(data.x - x) > 20 || Math.abs(data.y - y) > 20) {
|
|
27847
27848
|
setDragState(function (prev) {
|
|
27848
27849
|
return _extends({}, prev, {
|
|
27849
27850
|
wasDragged: true,
|
|
27850
27851
|
isFocused: true
|
|
27851
27852
|
});
|
|
27852
27853
|
});
|
|
27854
|
+
} else {
|
|
27855
|
+
resetDragState();
|
|
27853
27856
|
}
|
|
27854
27857
|
if (!draggingItem) {
|
|
27855
27858
|
setDraggingItem(item);
|
|
27856
27859
|
}
|
|
27857
27860
|
}, [dragState.position, draggingItem, item, setDraggingItem]);
|
|
27858
27861
|
var onDraggableStop = React.useCallback(function (e, data) {
|
|
27859
|
-
setTimeout(function () {
|
|
27860
|
-
setDraggingItem(null);
|
|
27861
|
-
}, 50);
|
|
27862
27862
|
var target = e.target;
|
|
27863
27863
|
if (!target) return;
|
|
27864
27864
|
target.classList.remove('react-draggable-dragging');
|
|
@@ -27901,13 +27901,14 @@ var useItemSlotDragAndDrop = function useItemSlotDragAndDrop(_ref) {
|
|
|
27901
27901
|
}, 50);
|
|
27902
27902
|
} else if (item) {
|
|
27903
27903
|
var isTouch = e.type === 'touchend';
|
|
27904
|
-
|
|
27904
|
+
console.log("Debug: \n isTouch: " + isTouch + ",\n isSelectingShortcut: " + isSelectingShortcut + ",\n draggingItem: " + draggingItem + ",\n dragState.wasDragged: " + dragState.wasDragged + ",\n dragState.isFocused: " + dragState.isFocused + "\n ");
|
|
27905
|
+
if (!isContextMenuDisabled && isTouch && !isSelectingShortcut && !draggingItem && !dragState.wasDragged && !dragState.isFocused) {
|
|
27905
27906
|
setTooltipState(function (prev) {
|
|
27906
27907
|
return _extends({}, prev, {
|
|
27907
27908
|
mobileVisible: true
|
|
27908
27909
|
});
|
|
27909
27910
|
});
|
|
27910
|
-
} else if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch) {
|
|
27911
|
+
} else if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch && !dragState.wasDragged && !dragState.isFocused) {
|
|
27911
27912
|
var event = e;
|
|
27912
27913
|
setContextMenuState(function (prev) {
|
|
27913
27914
|
return {
|
|
@@ -28282,7 +28283,7 @@ var ItemSlot = /*#__PURE__*/React__default.memo( /*#__PURE__*/mobxReactLite.obse
|
|
|
28282
28283
|
var Container$b = /*#__PURE__*/styled__default.div.withConfig({
|
|
28283
28284
|
displayName: "ItemSlot__Container",
|
|
28284
28285
|
componentId: "sc-l2j5ef-0"
|
|
28285
|
-
})(["margin:0.1rem;.react-draggable-dragging{opacity:", ";}position:relative;.sprite-from-atlas-img--item{position:relative;top:1.5rem;left:1.5rem;border-color:", ";box-shadow:", " inset,", ";}&::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;border-radius:12px;pointer-events:none;animation:", ";@keyframes bg-color-change{0%{background-color:rgba(255 255 255 / 0.5);}50%{background-color:transparent;}100%{background-color:rgba(255 255 255 / 0.5);}}}"], function (_ref3) {
|
|
28286
|
+
})(["*{border:1px solid red;}margin:0.1rem;.react-draggable-dragging{opacity:", ";}position:relative;.sprite-from-atlas-img--item{position:relative;top:1.5rem;left:1.5rem;border-color:", ";box-shadow:", " inset,", ";}&::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;border-radius:12px;pointer-events:none;animation:", ";@keyframes bg-color-change{0%{background-color:rgba(255 255 255 / 0.5);}50%{background-color:transparent;}100%{background-color:rgba(255 255 255 / 0.5);}}}"], function (_ref3) {
|
|
28286
28287
|
var isDraggingItem = _ref3.isDraggingItem;
|
|
28287
28288
|
return isDraggingItem ? 0 : 1;
|
|
28288
28289
|
}, function (_ref4) {
|