@rpg-engine/long-bow 0.5.30 → 0.5.32

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.
@@ -13866,6 +13866,7 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
13866
13866
  setDropPosition = _useState8[1];
13867
13867
  var dragContainer = React.useRef(null);
13868
13868
  var _useDragging = useDragging(),
13869
+ draggingItem = _useDragging.item,
13869
13870
  setDraggingItem = _useDragging.setDraggingItem;
13870
13871
  var _useState9 = React.useState([]),
13871
13872
  contextActions = _useState9[0],
@@ -13910,6 +13911,9 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
13910
13911
  setItemShortcut(item, index);
13911
13912
  }
13912
13913
  }
13914
+ // remove the class react-draggable-dragging from the element
13915
+ // to prevent the item from being dragged again
13916
+ target.classList.remove('react-draggable-dragging');
13913
13917
  if (wasDragged && item && !isSelectingShortcut) {
13914
13918
  var _e$target;
13915
13919
  //@ts-ignore
@@ -13971,7 +13975,6 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
13971
13975
  return;
13972
13976
  }
13973
13977
  if (onDragStart && containerType) {
13974
- setDraggingItem(item);
13975
13978
  onDragStart(item, slotIndex, containerType);
13976
13979
  }
13977
13980
  };
@@ -13980,8 +13983,12 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
13980
13983
  setWasDragged(true);
13981
13984
  setIsFocused(true);
13982
13985
  }
13986
+ if (!draggingItem) {
13987
+ setDraggingItem(item);
13988
+ }
13983
13989
  };
13984
13990
  return React__default.createElement(Container$a, {
13991
+ isDraggingItem: !!draggingItem,
13985
13992
  item: item,
13986
13993
  className: "rpgui-icon empty-slot",
13987
13994
  onMouseUp: function onMouseUp() {
@@ -14060,17 +14067,20 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
14060
14067
  var Container$a = /*#__PURE__*/styled.div.withConfig({
14061
14068
  displayName: "ItemSlot__Container",
14062
14069
  componentId: "sc-l2j5ef-0"
14063
- })(["margin:0.1rem;.react-draggable-dragging{opacity:0;}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 (_ref2) {
14064
- var item = _ref2.item;
14065
- return rarityColor(item);
14070
+ })(["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 (_ref2) {
14071
+ var isDraggingItem = _ref2.isDraggingItem;
14072
+ return isDraggingItem ? 0 : 1;
14066
14073
  }, function (_ref3) {
14067
14074
  var item = _ref3.item;
14068
- return "0 0 5px 2px " + rarityColor(item);
14075
+ return rarityColor(item);
14069
14076
  }, function (_ref4) {
14070
14077
  var item = _ref4.item;
14071
- return "0 0 4px 3px " + rarityColor(item);
14078
+ return "0 0 5px 2px " + rarityColor(item);
14072
14079
  }, function (_ref5) {
14073
- var isSelectingShortcut = _ref5.isSelectingShortcut;
14080
+ var item = _ref5.item;
14081
+ return "0 0 4px 3px " + rarityColor(item);
14082
+ }, function (_ref6) {
14083
+ var isSelectingShortcut = _ref6.isSelectingShortcut;
14074
14084
  return isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none';
14075
14085
  });
14076
14086
  var ItemContainer = /*#__PURE__*/styled.div.withConfig({