@rpg-engine/long-bow 0.7.53 → 0.7.61

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.
@@ -17,7 +17,6 @@ interface IProps {
17
17
  onOutsideDrop?: (item: IItem, position: IPosition) => void;
18
18
  dragScale?: number;
19
19
  checkIfItemCanBeMoved?: () => boolean;
20
- checkIfItemShouldDragEnd?: () => boolean;
21
20
  openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;
22
21
  onPlaceDrop?: (item: IItem | null, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
23
22
  atlasJSON: any;
@@ -42,7 +41,7 @@ export declare type DragState = {
42
41
  position: IPosition;
43
42
  dropPosition: IPosition | null;
44
43
  };
45
- export declare const ItemSlot: React.MemoExoticComponent<(({ slotIndex, item, itemContainerType: containerType, slotSpriteMask, onMouseOver, onMouseOut, onPointerDown, onSelected, atlasJSON, atlasIMG, isContextMenuDisabled, onDragEnd, onDragStart, onPlaceDrop, onOutsideDrop: onDrop, checkIfItemCanBeMoved, openQuantitySelector, checkIfItemShouldDragEnd, dragScale, isSelectingShortcut, equipmentSet, setItemShortcut, isDepotSystem, }: IProps) => JSX.Element) & {
44
+ export declare const ItemSlot: React.MemoExoticComponent<(({ slotIndex, item, itemContainerType: containerType, slotSpriteMask, onMouseOver, onMouseOut, onPointerDown, onSelected, atlasJSON, atlasIMG, isContextMenuDisabled, onDragEnd, onDragStart, onPlaceDrop, onOutsideDrop: onDrop, checkIfItemCanBeMoved, openQuantitySelector, dragScale, isSelectingShortcut, equipmentSet, setItemShortcut, isDepotSystem, }: IProps) => JSX.Element) & {
46
45
  displayName: string;
47
46
  }>;
48
47
  export {};
@@ -0,0 +1,43 @@
1
+ /// <reference types="react" />
2
+ import { IItem, ItemContainerType, ItemType } from '@rpg-engine/shared';
3
+ import { DraggableEventHandler } from 'react-draggable';
4
+ import { ContextMenuState, DragState, TooltipState } from '../ItemSlot';
5
+ interface IUseItemSlotDragAndDrop {
6
+ isDepotSystem: boolean;
7
+ item: IItem;
8
+ onDrop: (item: IItem, dropPosition: {
9
+ x: number;
10
+ y: number;
11
+ }) => void;
12
+ onDragEnd?: (quantity?: number) => void;
13
+ checkIfItemCanBeMoved?: () => boolean;
14
+ checkIfItemShouldDragEnd?: () => boolean;
15
+ setItemShortcut?: (item: IItem, index: number) => void;
16
+ isSelectingShortcut?: boolean;
17
+ onDragStart?: (item: IItem, slotIndex: number, containerType: ItemContainerType) => void;
18
+ onPointerDown: (ItemType: ItemType, itemContainerType: ItemContainerType | null, item: IItem) => void;
19
+ containerType: ItemContainerType;
20
+ slotIndex: number;
21
+ openQuantitySelector: (quantity: number, onSuccess: (quantity?: number) => void) => void;
22
+ isContextMenuDisabled: boolean;
23
+ setTooltipState: React.Dispatch<React.SetStateAction<TooltipState>>;
24
+ setContextMenuState: React.Dispatch<React.SetStateAction<ContextMenuState>>;
25
+ contextMenuState: ContextMenuState;
26
+ }
27
+ export declare const useItemSlotDragAndDrop: ({ isDepotSystem, item, onDrop, onDragEnd, checkIfItemCanBeMoved, checkIfItemShouldDragEnd, setItemShortcut, isSelectingShortcut, onDragStart, onPointerDown, containerType, slotIndex, openQuantitySelector, isContextMenuDisabled, setTooltipState, setContextMenuState, }: IUseItemSlotDragAndDrop) => {
28
+ dragContainer: import("react").RefObject<HTMLDivElement>;
29
+ dragState: DragState;
30
+ draggingItem: IItem | null;
31
+ setDraggingItem: import("react").Dispatch<import("react").SetStateAction<IItem | null>>;
32
+ getContainerBounds: () => {
33
+ left: number;
34
+ top: number;
35
+ right: number;
36
+ bottom: number;
37
+ };
38
+ onDraggableStart: DraggableEventHandler;
39
+ onDraggableProgress: DraggableEventHandler;
40
+ onDraggableStop: DraggableEventHandler;
41
+ resetItem: () => void;
42
+ };
43
+ export {};