@rpg-engine/long-bow 0.1.69 → 0.1.72

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.
Files changed (41) hide show
  1. package/dist/components/Abstractions/SlotsContainer.d.ts +11 -0
  2. package/dist/components/DraggableContainer.d.ts +2 -1
  3. package/dist/components/Equipment/EquipmentSet.d.ts +13 -0
  4. package/dist/components/Item/Inventory/ItemSlot.d.ts +10 -2
  5. package/dist/components/Item/Inventory/itemContainerHelper.d.ts +6 -2
  6. package/dist/components/Multitab/Tab.d.ts +9 -0
  7. package/dist/components/Multitab/TabBody.d.ts +7 -0
  8. package/dist/components/Multitab/TabsContainer.d.ts +17 -0
  9. package/dist/components/{Item → shared}/SpriteFromAtlas.d.ts +4 -1
  10. package/dist/components/shared/SpriteIcon.d.ts +9 -0
  11. package/dist/components/store/UI.store.d.ts +34 -0
  12. package/dist/index.d.ts +3 -1
  13. package/dist/long-bow.cjs.development.js +2137 -449
  14. package/dist/long-bow.cjs.development.js.map +1 -1
  15. package/dist/long-bow.cjs.production.min.js +1 -1
  16. package/dist/long-bow.cjs.production.min.js.map +1 -1
  17. package/dist/long-bow.esm.js +2139 -451
  18. package/dist/long-bow.esm.js.map +1 -1
  19. package/dist/mocks/equipmentSet.mocks.d.ts +3 -0
  20. package/package.json +4 -2
  21. package/src/components/Abstractions/SlotsContainer.tsx +42 -0
  22. package/src/components/DraggableContainer.tsx +63 -36
  23. package/src/components/Equipment/EquipmentSet.tsx +179 -0
  24. package/src/components/Item/Inventory/ItemContainer.tsx +70 -178
  25. package/src/components/Item/Inventory/ItemSlot.tsx +93 -25
  26. package/src/components/Item/Inventory/itemContainerHelper.ts +48 -11
  27. package/src/components/ListMenu.tsx +4 -4
  28. package/src/components/Multitab/Tab.tsx +57 -0
  29. package/src/components/Multitab/TabBody.tsx +13 -0
  30. package/src/components/Multitab/TabsContainer.tsx +99 -0
  31. package/src/components/SkillProgressBar.tsx +2 -2
  32. package/src/components/{Item → shared}/SpriteFromAtlas.tsx +24 -4
  33. package/src/components/shared/SpriteIcon.tsx +67 -0
  34. package/src/components/store/UI.store.ts +192 -0
  35. package/src/index.tsx +3 -1
  36. package/src/mocks/atlas/icons/icons.json +303 -0
  37. package/src/mocks/atlas/icons/icons.png +0 -0
  38. package/src/mocks/atlas/items/items.json +1209 -181
  39. package/src/mocks/atlas/items/items.png +0 -0
  40. package/src/mocks/equipmentSet.mocks.ts +347 -0
  41. package/src/mocks/itemContainer.mocks.ts +33 -33
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { IPosition } from '../../types/eventTypes';
3
+ interface IProps {
4
+ children: React.ReactNode;
5
+ title: string;
6
+ onClose?: () => void;
7
+ onPositionChange?: (position: IPosition) => void;
8
+ onOutsideClick?: () => void;
9
+ }
10
+ export declare const SlotsContainer: React.FC<IProps>;
11
+ export {};
@@ -7,11 +7,12 @@ export interface IDraggableContainerProps {
7
7
  height?: string;
8
8
  className?: string;
9
9
  type?: RPGUIContainerTypes;
10
- title: string;
10
+ title?: string;
11
11
  imgSrc?: string;
12
12
  imgWidth?: string;
13
13
  onCloseButton?: () => void;
14
14
  cancelDrag?: string;
15
15
  onPositionChange?: (position: IPosition) => void;
16
+ onOutsideClick?: () => void;
16
17
  }
17
18
  export declare const DraggableContainer: React.FC<IDraggableContainerProps>;
@@ -0,0 +1,13 @@
1
+ import { IEquipementSet, IItem } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ export interface IEquipmentSetProps {
4
+ equipmentSet: IEquipementSet;
5
+ onClose?: () => void;
6
+ onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
7
+ onActionSelected?: (payload: any) => void;
8
+ initialPosition?: {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ }
13
+ export declare const EquipmentSet: React.FC<IEquipmentSetProps>;
@@ -1,10 +1,18 @@
1
- import { IItem } from '@rpg-engine/shared';
1
+ import { IItem, IItemContainer, ItemSlotType } from '@rpg-engine/shared';
2
2
  import React from 'react';
3
+ export declare enum SlotContainerType {
4
+ INVENTORY = "Inventory",
5
+ EQUIPMENT_SET = "EquipmentSet"
6
+ }
3
7
  interface IProps {
4
8
  slotIndex: number;
5
9
  item: IItem | null;
10
+ itemContainer?: IItemContainer | null;
11
+ slotContainerType: SlotContainerType | null;
12
+ slotSpriteMask?: ItemSlotType | null;
6
13
  onMouseOver: (event: any, slotIndex: number, item: IItem | null, x: number, y: number) => void;
7
- onClick: (item: IItem, posX: number, posY: number) => void;
14
+ onMouseOut: () => void;
15
+ onClick: (item: IItem, posX: number, posY: number, slotContainerType: SlotContainerType | null) => void;
8
16
  onCancelContextMenu: () => void;
9
17
  }
10
18
  export declare const ItemSlot: React.FC<IProps>;
@@ -1,7 +1,11 @@
1
1
  import { ItemType } from '@rpg-engine/shared';
2
- interface IContextMenuItem {
2
+ export interface IContextMenuItem {
3
3
  id: string;
4
4
  text: string;
5
5
  }
6
+ export declare enum ContainerType {
7
+ INVENTORY = "Inventory",
8
+ EQUIPMENT_SET = "EquipmentSet"
9
+ }
6
10
  export declare const handleContextMenuList: (itemType: ItemType) => IContextMenuItem[];
7
- export {};
11
+ export declare const handleEquipmentContextMenuList: (itemType: ItemType) => IContextMenuItem[];
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { MultitabType } from './TabsContainer';
3
+ export interface ISingleTab {
4
+ active: boolean;
5
+ label: string;
6
+ onClick: () => void;
7
+ type: MultitabType;
8
+ }
9
+ export declare const Tab: React.FC<ISingleTab>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ id: string;
4
+ children: React.ReactNode;
5
+ }
6
+ export declare const TabBody: React.FC<IProps>;
7
+ export {};
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ interface ITab {
3
+ label: string;
4
+ id: string;
5
+ }
6
+ export declare enum MultitabType {
7
+ Brown = "brown",
8
+ Gray = "gray"
9
+ }
10
+ export interface ITabsContainer {
11
+ children: React.ReactNode;
12
+ onCloseButton?: () => void;
13
+ tabs: ITab[];
14
+ type: MultitabType;
15
+ }
16
+ export declare const TabsContainer: React.FC<ITabsContainer>;
17
+ export {};
@@ -5,9 +5,12 @@ interface IProps {
5
5
  spriteKey: string;
6
6
  width?: number;
7
7
  height?: number;
8
- scale?: number;
9
8
  grayScale?: boolean;
10
9
  opacity?: number;
10
+ onClick?: () => void;
11
+ containerStyle?: any;
12
+ imgStyle?: any;
13
+ imgScale?: number;
11
14
  }
12
15
  export declare const SpriteFromAtlas: React.FC<IProps>;
13
16
  export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ onClick?: () => void;
4
+ spriteKey: string;
5
+ baseSpriteKey?: string;
6
+ imgStyle?: any;
7
+ }
8
+ export declare const SpriteIcon: React.FC<IProps>;
9
+ export {};
@@ -0,0 +1,34 @@
1
+ import { IItem, ItemSocketEvents, ItemType } from '@rpg-engine/shared';
2
+ import { IContextMenuItem } from '../Item/Inventory/itemContainerHelper';
3
+ import { SlotContainerType } from '../Item/Inventory/ItemSlot';
4
+ interface IContextMenu {
5
+ visible: boolean;
6
+ posX: number;
7
+ posY: number;
8
+ slotItem: IItem | null;
9
+ slotIndex?: number | null;
10
+ contextActions: IContextMenuItem[];
11
+ }
12
+ interface IHoverDetail {
13
+ visible: boolean;
14
+ posX: number;
15
+ posY: number;
16
+ item: IItem | null;
17
+ }
18
+ interface ISetContextMenu extends Omit<IContextMenu, 'contextActions'> {
19
+ }
20
+ declare class UIStore {
21
+ contextMenu: IContextMenu | null;
22
+ onHoverDetail: IHoverDetail | null;
23
+ constructor();
24
+ setContextMenu(contextMenu: ISetContextMenu, itemType: ItemType): void;
25
+ setEquipContextMenu(contextMenu: ISetContextMenu, itemType: ItemType, isItemContainer: boolean | undefined): void;
26
+ clearContextMenu(): void;
27
+ setItemHoverDetail(hoverDetail: IHoverDetail): void;
28
+ clearItemHoverDetail(): void;
29
+ handleOnItemClick: (item: IItem, posX: number, posY: number, slotContainerType: SlotContainerType | null) => void;
30
+ handleOnMouseHover: (event: any, slotIndex: number, item: IItem | null, posX: number, posY: number, onMouseOver: any) => void;
31
+ onSelected(selectedActionId: ItemSocketEvents | string, onActionSelected: any): void;
32
+ }
33
+ export declare const uiStore: UIStore;
34
+ export {};
package/dist/index.d.ts CHANGED
@@ -3,10 +3,10 @@ export * from './components/Chat/Chat';
3
3
  export * from './components/CheckButton';
4
4
  export * from './components/DraggableContainer';
5
5
  export * from './components/Dropdown';
6
+ export * from './components/Equipment/EquipmentSet';
6
7
  export * from './components/Input';
7
8
  export * from './components/Item/Inventory/ItemContainer';
8
9
  export * from './components/Item/Inventory/ItemSlot';
9
- export * from './components/Item/SpriteFromAtlas';
10
10
  export * from './components/ListMenu';
11
11
  export * from './components/NPCDialog/NPCDialog';
12
12
  export * from './components/NPCDialog/QuestionDialog/QuestionDialog';
@@ -15,6 +15,8 @@ export * from './components/RadioButton';
15
15
  export * from './components/RangeSlider';
16
16
  export * from './components/RPGUIContainer';
17
17
  export * from './components/RPGUIRoot';
18
+ export * from './components/shared/SpriteFromAtlas';
19
+ export * from './components/shared/SpriteIcon';
18
20
  export * from './components/SkillProgressBar';
19
21
  export * from './components/TextArea';
20
22
  export * from './components/Truncate';