@rpg-engine/long-bow 0.7.49 → 0.7.50

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.
@@ -27930,6 +27930,9 @@ var ItemSlot = /*#__PURE__*/React.memo( /*#__PURE__*/observer(function (_ref) {
27930
27930
  var _useState4 = useState([]),
27931
27931
  contextActions = _useState4[0],
27932
27932
  setContextActions = _useState4[1];
27933
+ var _useState5 = useState(null),
27934
+ dragStartTime = _useState5[0],
27935
+ setDragStartTime = _useState5[1];
27933
27936
  useEffect(function () {
27934
27937
  setDragState(function (prev) {
27935
27938
  return _extends({}, prev, {
@@ -28011,6 +28014,8 @@ var ItemSlot = /*#__PURE__*/React.memo( /*#__PURE__*/observer(function (_ref) {
28011
28014
  // remove the class react-draggable-dragging from the element
28012
28015
  // to prevent the item from being dragged again
28013
28016
  target.classList.remove('react-draggable-dragging');
28017
+ var dragEndTime = Date.now();
28018
+ var dragDuration = dragStartTime ? dragEndTime - dragStartTime : 0;
28014
28019
  if (dragState.wasDragged && item && !isSelectingShortcut) {
28015
28020
  var _e$target;
28016
28021
  //@ts-ignore
@@ -28066,7 +28071,8 @@ var ItemSlot = /*#__PURE__*/React.memo( /*#__PURE__*/observer(function (_ref) {
28066
28071
  });
28067
28072
  }
28068
28073
  }, 50);
28069
- } else if (item) {
28074
+ } else if (item && dragDuration < 200) {
28075
+ // Consider it a click if drag duration is less than 200ms
28070
28076
  var isTouch = false;
28071
28077
  if (!isContextMenuDisabled && e.type === 'touchend' && !isSelectingShortcut) {
28072
28078
  isTouch = true;
@@ -28101,6 +28107,7 @@ var ItemSlot = /*#__PURE__*/React.memo( /*#__PURE__*/observer(function (_ref) {
28101
28107
  if (!item || isSelectingShortcut) {
28102
28108
  return;
28103
28109
  }
28110
+ setDragStartTime(Date.now());
28104
28111
  if (onDragStart && containerType) {
28105
28112
  onDragStart(item, slotIndex, containerType);
28106
28113
  }