@rpg-engine/long-bow 0.7.49 → 0.7.51

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.
@@ -28017,6 +28017,10 @@ var ItemSlot = /*#__PURE__*/React__default.memo( /*#__PURE__*/mobxReactLite.obse
28017
28017
  // remove the class react-draggable-dragging from the element
28018
28018
  // to prevent the item from being dragged again
28019
28019
  target.classList.remove('react-draggable-dragging');
28020
+ var isTouch = e.type.startsWith('touch');
28021
+ // Threshold for considering a tap/click as a drag
28022
+ var dragThreshold = 5; // pixels
28023
+ var isDrag = Math.abs(data.x) > dragThreshold || Math.abs(data.y) > dragThreshold;
28020
28024
  if (dragState.wasDragged && item && !isSelectingShortcut) {
28021
28025
  var _e$target;
28022
28026
  //@ts-ignore
@@ -28073,16 +28077,13 @@ var ItemSlot = /*#__PURE__*/React__default.memo( /*#__PURE__*/mobxReactLite.obse
28073
28077
  }
28074
28078
  }, 50);
28075
28079
  } else if (item) {
28076
- var isTouch = false;
28077
- if (!isContextMenuDisabled && e.type === 'touchend' && !isSelectingShortcut) {
28078
- isTouch = true;
28080
+ if (isTouch && !isDrag) {
28079
28081
  setTooltipState(function (prev) {
28080
28082
  return _extends({}, prev, {
28081
28083
  mobileVisible: true
28082
28084
  });
28083
28085
  });
28084
- }
28085
- if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch && !dragState.wasDragged) {
28086
+ } else if (!isTouch && !isContextMenuDisabled && !isSelectingShortcut) {
28086
28087
  setContextMenuState(function (prev) {
28087
28088
  return _extends({}, prev, {
28088
28089
  visible: !contextMenuState.visible
@@ -28100,8 +28101,17 @@ var ItemSlot = /*#__PURE__*/React__default.memo( /*#__PURE__*/mobxReactLite.obse
28100
28101
  });
28101
28102
  }
28102
28103
  }
28103
- onPointerDown(item.type, containerType != null ? containerType : null, item);
28104
+ if (!isDrag || !isTouch) {
28105
+ console.log('Calling onPointerDown');
28106
+ onPointerDown(item.type, containerType != null ? containerType : null, item);
28107
+ }
28104
28108
  }
28109
+ setDragState(function (prev) {
28110
+ return _extends({}, prev, {
28111
+ wasDragged: false
28112
+ });
28113
+ });
28114
+ console.log('Final dragState:', dragState);
28105
28115
  };
28106
28116
  var onDraggableStart = function onDraggableStart() {
28107
28117
  if (!item || isSelectingShortcut) {