@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.
@@ -13861,6 +13861,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13861
13861
  setDropPosition = _useState8[1];
13862
13862
  var dragContainer = useRef(null);
13863
13863
  var _useDragging = useDragging(),
13864
+ draggingItem = _useDragging.item,
13864
13865
  setDraggingItem = _useDragging.setDraggingItem;
13865
13866
  var _useState9 = useState([]),
13866
13867
  contextActions = _useState9[0],
@@ -13905,6 +13906,9 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13905
13906
  setItemShortcut(item, index);
13906
13907
  }
13907
13908
  }
13909
+ // remove the class react-draggable-dragging from the element
13910
+ // to prevent the item from being dragged again
13911
+ target.classList.remove('react-draggable-dragging');
13908
13912
  if (wasDragged && item && !isSelectingShortcut) {
13909
13913
  var _e$target;
13910
13914
  //@ts-ignore
@@ -13966,7 +13970,6 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13966
13970
  return;
13967
13971
  }
13968
13972
  if (onDragStart && containerType) {
13969
- setDraggingItem(item);
13970
13973
  onDragStart(item, slotIndex, containerType);
13971
13974
  }
13972
13975
  };
@@ -13975,8 +13978,12 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13975
13978
  setWasDragged(true);
13976
13979
  setIsFocused(true);
13977
13980
  }
13981
+ if (!draggingItem) {
13982
+ setDraggingItem(item);
13983
+ }
13978
13984
  };
13979
13985
  return React.createElement(Container$a, {
13986
+ isDraggingItem: !!draggingItem,
13980
13987
  item: item,
13981
13988
  className: "rpgui-icon empty-slot",
13982
13989
  onMouseUp: function onMouseUp() {
@@ -14055,17 +14062,20 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
14055
14062
  var Container$a = /*#__PURE__*/styled.div.withConfig({
14056
14063
  displayName: "ItemSlot__Container",
14057
14064
  componentId: "sc-l2j5ef-0"
14058
- })(["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) {
14059
- var item = _ref2.item;
14060
- return rarityColor(item);
14065
+ })(["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) {
14066
+ var isDraggingItem = _ref2.isDraggingItem;
14067
+ return isDraggingItem ? 0 : 1;
14061
14068
  }, function (_ref3) {
14062
14069
  var item = _ref3.item;
14063
- return "0 0 5px 2px " + rarityColor(item);
14070
+ return rarityColor(item);
14064
14071
  }, function (_ref4) {
14065
14072
  var item = _ref4.item;
14066
- return "0 0 4px 3px " + rarityColor(item);
14073
+ return "0 0 5px 2px " + rarityColor(item);
14067
14074
  }, function (_ref5) {
14068
- var isSelectingShortcut = _ref5.isSelectingShortcut;
14075
+ var item = _ref5.item;
14076
+ return "0 0 4px 3px " + rarityColor(item);
14077
+ }, function (_ref6) {
14078
+ var isSelectingShortcut = _ref6.isSelectingShortcut;
14069
14079
  return isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none';
14070
14080
  });
14071
14081
  var ItemContainer = /*#__PURE__*/styled.div.withConfig({