@rpg-engine/long-bow 0.5.17 → 0.5.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.5.17",
3
+ "version": "0.5.19",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -13,6 +13,7 @@ interface IProps {
13
13
  onOutsideClick?: () => void;
14
14
  initialPosition?: IPosition;
15
15
  scale?: number;
16
+ width?: string;
16
17
  }
17
18
 
18
19
  export const SlotsContainer: React.FC<IProps> = ({
@@ -25,6 +26,7 @@ export const SlotsContainer: React.FC<IProps> = ({
25
26
  onOutsideClick,
26
27
  initialPosition,
27
28
  scale,
29
+ width,
28
30
  }) => {
29
31
  return (
30
32
  <DraggableContainer
@@ -35,7 +37,7 @@ export const SlotsContainer: React.FC<IProps> = ({
35
37
  onClose();
36
38
  }
37
39
  }}
38
- width="400px"
40
+ width={width ?? '415px'}
39
41
  cancelDrag=".item-container-body, #shortcuts_list"
40
42
  onPositionChange={({ x, y }) => {
41
43
  if (onPositionChange) {
@@ -84,7 +84,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
84
84
  const [quantitySelect, setQuantitySelect] = useState({
85
85
  isOpen: false,
86
86
  maxQuantity: 1,
87
- callback: (_quantity: number) => { },
87
+ callback: (_quantity: number) => {},
88
88
  });
89
89
  const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);
90
90
 
@@ -192,7 +192,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
192
192
  setQuantitySelect({
193
193
  isOpen: false,
194
194
  maxQuantity: 1,
195
- callback: () => { },
195
+ callback: () => {},
196
196
  });
197
197
  }}
198
198
  onClose={() => {
@@ -200,7 +200,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
200
200
  setQuantitySelect({
201
201
  isOpen: false,
202
202
  maxQuantity: 1,
203
- callback: () => { },
203
+ callback: () => {},
204
204
  });
205
205
  }}
206
206
  />
@@ -215,8 +215,10 @@ const ItemsContainer = styled.div`
215
215
  display: flex;
216
216
  justify-content: center;
217
217
  flex-wrap: wrap;
218
- max-height: 270px; /* Defina a altura máxima desejada */
219
- overflow-y: auto; /* Adicione uma barra de rolagem vertical quando necessário */
218
+ max-height: 270px;
219
+ overflow-y: auto;
220
+ overflow-x: hidden;
221
+ width: 415px;
220
222
  `;
221
223
 
222
224
  const QuantitySelectorContainer = styled.div`
@@ -123,6 +123,13 @@ export const ItemSlot: React.FC<IProps> = observer(
123
123
  const [dropPosition, setDropPosition] = useState<IPosition | null>(null);
124
124
  const dragContainer = useRef<HTMLDivElement>(null);
125
125
 
126
+ useEffect(() => {
127
+ // This fixes an issue where if you drag an item inside of a scrollable container (overflow), its cut out
128
+ if (dragContainer.current) {
129
+ dragContainer.current.style.position = 'fixed';
130
+ }
131
+ }, []);
132
+
126
133
  const [contextActions, setContextActions] = useState<IContextMenuItem[]>(
127
134
  []
128
135
  );
@@ -523,6 +530,12 @@ interface ContainerTypes {
523
530
 
524
531
  const Container = styled.div<ContainerTypes>`
525
532
  margin: 0.1rem;
533
+
534
+ .react-draggable-dragging {
535
+ opacity: 0.5;
536
+ }
537
+
538
+
526
539
  .sprite-from-atlas-img--item {
527
540
  position: relative;
528
541
  top: 1.5rem;
@@ -563,10 +576,8 @@ const Container = styled.div<ContainerTypes>`
563
576
  `;
564
577
 
565
578
  const ItemContainer = styled.div<{ isFocused?: boolean }>`
566
- width: 100%;
567
- height: 100%;
568
- position: relative;
569
-
579
+ width: 64px;
580
+ height: 64px;
570
581
  ${props => props.isFocused && 'z-index: 100; pointer-events: none;'}
571
582
  `;
572
583