@rpg-engine/long-bow 0.7.68 → 0.7.71
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/dist/components/Item/Inventory/ItemSlot.d.ts +2 -17
- package/dist/components/Item/Inventory/ItemSlotTooltips.d.ts +10 -7
- package/dist/components/Item/Inventory/context/DraggingContext.d.ts +2 -17
- package/dist/long-bow.cjs.development.js +334 -354
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +335 -355
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemContainer.tsx +2 -2
- package/src/components/Item/Inventory/ItemSlot.tsx +441 -252
- package/src/components/Item/Inventory/ItemSlotTooltips.tsx +22 -18
- package/src/components/Item/Inventory/context/DraggingContext.tsx +5 -31
- package/src/mocks/skills.mocks.ts +0 -4
- package/src/stories/UI/containers/ItemContainer.stories.tsx +3 -30
- package/dist/components/Item/Inventory/hooks/useItemSlotDragAndDrop.d.ts +0 -43
- package/src/components/Item/Inventory/hooks/useItemSlotDragAndDrop.ts +0 -228
|
@@ -17,6 +17,7 @@ interface IProps {
|
|
|
17
17
|
onOutsideDrop?: (item: IItem, position: IPosition) => void;
|
|
18
18
|
dragScale?: number;
|
|
19
19
|
checkIfItemCanBeMoved?: () => boolean;
|
|
20
|
+
checkIfItemShouldDragEnd?: () => boolean;
|
|
20
21
|
openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;
|
|
21
22
|
onPlaceDrop?: (item: IItem | null, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
|
|
22
23
|
atlasJSON: any;
|
|
@@ -27,21 +28,5 @@ interface IProps {
|
|
|
27
28
|
setItemShortcut?: (item: IItem, shortcutIndex: number) => void;
|
|
28
29
|
isDepotSystem?: boolean;
|
|
29
30
|
}
|
|
30
|
-
export declare
|
|
31
|
-
visible: boolean;
|
|
32
|
-
mobileVisible: boolean;
|
|
33
|
-
};
|
|
34
|
-
export declare type ContextMenuState = {
|
|
35
|
-
position: IPosition;
|
|
36
|
-
visible: boolean;
|
|
37
|
-
};
|
|
38
|
-
export declare type DragState = {
|
|
39
|
-
isFocused: boolean;
|
|
40
|
-
wasDragged: boolean;
|
|
41
|
-
position: IPosition;
|
|
42
|
-
dropPosition: IPosition | null;
|
|
43
|
-
};
|
|
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) & {
|
|
45
|
-
displayName: string;
|
|
46
|
-
}>;
|
|
31
|
+
export declare const ItemSlot: React.FC<IProps>;
|
|
47
32
|
export {};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { IEquipmentSet, IItem } from '@rpg-engine/shared';
|
|
2
|
-
import
|
|
3
|
+
import { IPosition } from '../../../types/eventTypes';
|
|
3
4
|
import { IContextMenuItem } from './itemContainerHelper';
|
|
4
|
-
import type { ContextMenuState, TooltipState } from './ItemSlot';
|
|
5
5
|
interface IProps {
|
|
6
|
-
|
|
7
|
-
setTooltipState: React.Dispatch<React.SetStateAction<TooltipState>>;
|
|
8
|
-
contextMenuState: ContextMenuState;
|
|
9
|
-
setContextMenuState: React.Dispatch<React.SetStateAction<ContextMenuState>>;
|
|
6
|
+
isTooltipVisible: boolean;
|
|
10
7
|
isFocused: boolean;
|
|
8
|
+
isContextMenuVisible: boolean;
|
|
11
9
|
isContextMenuDisabled: boolean;
|
|
12
10
|
item: IItem | null;
|
|
11
|
+
isTooltipMobileVisible: boolean;
|
|
13
12
|
contextActions: IContextMenuItem[];
|
|
13
|
+
contextMenuPosition: IPosition;
|
|
14
14
|
dragScale: number | undefined;
|
|
15
|
+
setIsContextMenuVisible: (visible: boolean) => void;
|
|
16
|
+
setIsTooltipMobileVisible: (visible: boolean) => void;
|
|
17
|
+
setIsTooltipVisible: (visible: boolean) => void;
|
|
15
18
|
onSelected?: (optionId: string, item: IItem) => void;
|
|
16
19
|
atlasIMG: any;
|
|
17
20
|
atlasJSON: any;
|
|
18
21
|
equipmentSet?: IEquipmentSet | null;
|
|
19
22
|
}
|
|
20
|
-
export declare const ItemSlotToolTips: ({
|
|
23
|
+
export declare const ItemSlotToolTips: ({ isTooltipVisible, isFocused, isContextMenuVisible, isContextMenuDisabled, item, contextActions, contextMenuPosition, dragScale, setIsContextMenuVisible, setIsTooltipMobileVisible, isTooltipMobileVisible, onSelected, atlasIMG, atlasJSON, equipmentSet, }: IProps) => JSX.Element;
|
|
21
24
|
export {};
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import { IItem } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export
|
|
4
|
-
isFocused: boolean;
|
|
5
|
-
wasDragged: boolean;
|
|
6
|
-
position: {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
};
|
|
10
|
-
dropPosition: {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
} | null;
|
|
14
|
-
}
|
|
15
|
-
interface DraggingContextType {
|
|
3
|
+
export declare const useDragging: () => {
|
|
16
4
|
item: IItem | null;
|
|
17
5
|
setDraggingItem: React.Dispatch<React.SetStateAction<IItem | null>>;
|
|
18
|
-
|
|
19
|
-
setDragState: React.Dispatch<React.SetStateAction<DragState>>;
|
|
20
|
-
}
|
|
6
|
+
};
|
|
21
7
|
interface IProps {
|
|
22
8
|
children: React.ReactNode;
|
|
23
9
|
}
|
|
24
10
|
export declare const DraggingProvider: ({ children }: IProps) => JSX.Element;
|
|
25
|
-
export declare const useDragging: () => DraggingContextType;
|
|
26
11
|
export {};
|