@rpg-engine/long-bow 0.1.82 → 0.1.85

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 (89) hide show
  1. package/dist/components/Button.d.ts +1 -0
  2. package/dist/components/Equipment/EquipmentSet.d.ts +3 -1
  3. package/dist/components/Item/Cards/ItemTooltip.d.ts +6 -0
  4. package/dist/components/Item/Inventory/ItemContainer.d.ts +3 -5
  5. package/dist/components/Item/Inventory/ItemContainerTypes.d.ts +4 -0
  6. package/dist/components/Item/Inventory/ItemSlot.d.ts +4 -7
  7. package/dist/components/PropertySelect/PropertySelect.d.ts +12 -0
  8. package/dist/components/QuestInfo/QuestInfo.d.ts +14 -0
  9. package/dist/components/RelativeListMenu.d.ts +13 -0
  10. package/dist/components/shared/SpriteIcon.d.ts +2 -0
  11. package/dist/index.d.ts +1 -0
  12. package/dist/long-bow.cjs.development.js +407 -813
  13. package/dist/long-bow.cjs.development.js.map +1 -1
  14. package/dist/long-bow.cjs.production.min.js +1 -1
  15. package/dist/long-bow.cjs.production.min.js.map +1 -1
  16. package/dist/long-bow.esm.js +402 -811
  17. package/dist/long-bow.esm.js.map +1 -1
  18. package/dist/stories/Button.stories.d.ts +5 -0
  19. package/dist/stories/Chat.stories.d.ts +5 -0
  20. package/dist/stories/CheckButton.stories.d.ts +5 -0
  21. package/dist/stories/DraggableContainer.stories.d.ts +5 -0
  22. package/dist/stories/Dropdown.stories.d.ts +5 -0
  23. package/dist/stories/EquipmentSet.stories.d.ts +5 -0
  24. package/dist/stories/ItemContainer.stories.d.ts +5 -0
  25. package/dist/stories/ListMenu.stories.d.ts +5 -0
  26. package/dist/stories/Multitab.stories.d.ts +6 -0
  27. package/dist/stories/NPCDialog.stories.d.ts +7 -0
  28. package/dist/stories/ProgressBar.stories.d.ts +8 -0
  29. package/dist/stories/PropertySelect.stories.d.ts +5 -0
  30. package/dist/stories/QuestInfo.stories.d.ts +5 -0
  31. package/dist/stories/RPGUIContainers.stories.d.ts +5 -0
  32. package/dist/stories/RadioButton.stories.d.ts +5 -0
  33. package/dist/stories/RangeSlider.stories.d.ts +5 -0
  34. package/dist/stories/ScrollList.stories.d.ts +5 -0
  35. package/dist/stories/SimpleProgressBar.stories.d.ts +5 -0
  36. package/dist/stories/SkillProgressBar.stories.d.ts +5 -0
  37. package/dist/stories/SkillsContainer.stories.d.ts +5 -0
  38. package/dist/stories/Text.stories.d.ts +7 -0
  39. package/package.json +2 -2
  40. package/src/components/Button.tsx +3 -2
  41. package/src/components/Equipment/EquipmentSet.tsx +97 -142
  42. package/src/components/Item/Cards/ItemTooltip.tsx +32 -0
  43. package/src/components/Item/Inventory/ItemContainer.tsx +47 -95
  44. package/src/components/Item/Inventory/ItemContainerTypes.ts +4 -0
  45. package/src/components/Item/Inventory/ItemSlot.tsx +145 -104
  46. package/src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx +0 -3
  47. package/src/components/PropertySelect/PropertySelect.tsx +101 -0
  48. package/src/components/PropertySelect/img/ui-arrows/arrow01-left-clicked.png +0 -0
  49. package/src/components/PropertySelect/img/ui-arrows/arrow01-left.png +0 -0
  50. package/src/components/PropertySelect/img/ui-arrows/arrow01-right-clicked.png +0 -0
  51. package/src/components/PropertySelect/img/ui-arrows/arrow01-right.png +0 -0
  52. package/src/components/PropertySelect/img/ui-arrows/arrow02-left-clicked.png +0 -0
  53. package/src/components/PropertySelect/img/ui-arrows/arrow02-left.png +0 -0
  54. package/src/components/PropertySelect/img/ui-arrows/arrow02-right-clicked.png +0 -0
  55. package/src/components/PropertySelect/img/ui-arrows/arrow02-right.png +0 -0
  56. package/src/components/QuestInfo/QuestInfo.tsx +143 -0
  57. package/src/components/QuestInfo/img/default.png +0 -0
  58. package/src/components/RelativeListMenu.tsx +83 -0
  59. package/src/components/SkillsContainer.tsx +15 -1
  60. package/src/components/shared/SpriteIcon.tsx +4 -2
  61. package/src/index.tsx +1 -0
  62. package/src/mocks/atlas/icons/icons.json +494 -62
  63. package/src/mocks/atlas/icons/icons.png +0 -0
  64. package/src/mocks/itemContainer.mocks.ts +1 -1
  65. package/src/stories/Button.stories.tsx +36 -0
  66. package/src/stories/Chat.stories.tsx +170 -0
  67. package/src/stories/CheckButton.stories.tsx +48 -0
  68. package/src/stories/DraggableContainer.stories.tsx +28 -0
  69. package/src/stories/Dropdown.stories.tsx +46 -0
  70. package/src/stories/EquipmentSet.stories.tsx +50 -0
  71. package/src/stories/ItemContainer.stories.tsx +50 -0
  72. package/src/stories/ListMenu.stories.tsx +56 -0
  73. package/src/stories/Multitab.stories.tsx +51 -0
  74. package/src/stories/NPCDialog.stories.tsx +130 -0
  75. package/src/stories/ProgressBar.stories.tsx +23 -0
  76. package/src/stories/PropertySelect.stories.tsx +41 -0
  77. package/src/stories/QuestInfo.stories.tsx +76 -0
  78. package/src/stories/RPGUIContainers.stories.tsx +42 -0
  79. package/src/stories/RadioButton.stories.tsx +49 -0
  80. package/src/stories/RangeSlider.stories.tsx +60 -0
  81. package/src/stories/ScrollList.stories.tsx +85 -0
  82. package/src/stories/SimpleProgressBar.stories.tsx +22 -0
  83. package/src/stories/SkillProgressBar.stories.tsx +30 -0
  84. package/src/stories/SkillsContainer.stories.tsx +31 -0
  85. package/src/stories/Text.stories.tsx +42 -0
  86. package/dist/components/Item/Cards/ItemCard.d.ts +0 -9
  87. package/dist/components/store/UI.store.d.ts +0 -34
  88. package/src/components/Item/Cards/ItemCard.tsx +0 -36
  89. package/src/components/store/UI.store.ts +0 -192
@@ -1,192 +0,0 @@
1
- import {
2
- IItem,
3
- IPayloadProps,
4
- ItemSocketEvents,
5
- ItemSocketEventsDisplayLabels,
6
- ItemType,
7
- } from '@rpg-engine/shared';
8
- import { makeAutoObservable, toJS } from 'mobx';
9
- import {
10
- handleContextMenuList,
11
- handleEquipmentContextMenuList,
12
- IContextMenuItem,
13
- } from '../Item/Inventory/itemContainerHelper';
14
- import { SlotContainerType } from '../Item/Inventory/ItemSlot';
15
-
16
- interface IContextMenu {
17
- visible: boolean;
18
- posX: number;
19
- posY: number;
20
- slotItem: IItem | null;
21
- slotIndex?: number | null;
22
- contextActions: IContextMenuItem[];
23
- }
24
-
25
- interface IHoverDetail {
26
- visible: boolean;
27
- posX: number;
28
- posY: number;
29
- item: IItem | null;
30
- }
31
-
32
- interface ISetContextMenu extends Omit<IContextMenu, 'contextActions'> {}
33
-
34
- const initialState = {
35
- visible: false,
36
- posX: 0,
37
- posY: 0,
38
- contextActions: [],
39
- slotItem: null,
40
- };
41
-
42
- const initialHoverState = {
43
- visible: false,
44
- posX: 0,
45
- posY: 0,
46
- item: null,
47
- };
48
- class UIStore {
49
- public contextMenu: IContextMenu | null = initialState;
50
-
51
- public onHoverDetail: IHoverDetail | null = initialHoverState;
52
-
53
- constructor() {
54
- makeAutoObservable(this);
55
- }
56
-
57
- public setContextMenu(contextMenu: ISetContextMenu, itemType: ItemType) {
58
- const contextActions = handleContextMenuList(itemType);
59
-
60
- this.contextMenu = {
61
- ...contextMenu,
62
- contextActions,
63
- };
64
-
65
- console.log(toJS(this.contextMenu));
66
- }
67
-
68
- public setEquipContextMenu(
69
- contextMenu: ISetContextMenu,
70
- itemType: ItemType,
71
- isItemContainer: boolean | undefined
72
- ) {
73
- const contextActions = handleEquipmentContextMenuList(itemType);
74
- if (isItemContainer)
75
- contextActions.push({
76
- id: ItemSocketEvents.ContainerOpen,
77
- text: ItemSocketEventsDisplayLabels[ItemSocketEvents.ContainerOpen],
78
- });
79
- this.contextMenu = {
80
- ...contextMenu,
81
- contextActions,
82
- };
83
-
84
- console.log(toJS(this.contextMenu));
85
- }
86
-
87
- public clearContextMenu() {
88
- this.contextMenu = initialState;
89
- }
90
-
91
- public setItemHoverDetail(hoverDetail: IHoverDetail) {
92
- if (hoverDetail?.item === null) this.clearItemHoverDetail();
93
-
94
- this.onHoverDetail = {
95
- ...hoverDetail,
96
- };
97
- }
98
-
99
- public clearItemHoverDetail() {
100
- this.onHoverDetail = initialHoverState;
101
- }
102
-
103
- public handleOnItemClick = (
104
- item: IItem,
105
- posX: number,
106
- posY: number,
107
- slotContainerType: SlotContainerType | null
108
- ): void => {
109
- if (
110
- !item ||
111
- JSON.stringify(this.contextMenu?.slotItem) === JSON.stringify(item)
112
- ) {
113
- this.clearContextMenu();
114
- this.clearItemHoverDetail();
115
- return;
116
- }
117
- switch (slotContainerType) {
118
- case SlotContainerType.EQUIPMENT_SET:
119
- this.setEquipContextMenu(
120
- {
121
- visible: true,
122
- posX,
123
- posY,
124
- slotItem: item,
125
- },
126
- item.type,
127
- item.isItemContainer
128
- );
129
- break;
130
- case SlotContainerType.INVENTORY:
131
- this.setContextMenu(
132
- {
133
- visible: true,
134
- posX,
135
- posY,
136
- slotItem: item,
137
- },
138
- item.type
139
- );
140
- break;
141
- default:
142
- this.setContextMenu(
143
- {
144
- visible: true,
145
- posX,
146
- posY,
147
- slotItem: item,
148
- },
149
- item.type
150
- );
151
- }
152
-
153
- this.clearItemHoverDetail();
154
- };
155
-
156
- public handleOnMouseHover = (
157
- event: any,
158
- slotIndex: number,
159
- item: IItem | null,
160
- posX: number,
161
- posY: number,
162
- onMouseOver: any
163
- ): void => {
164
- if (item) {
165
- this.setItemHoverDetail({
166
- visible: true,
167
- posX,
168
- posY,
169
- item: item,
170
- });
171
- }
172
- if (onMouseOver) {
173
- onMouseOver(event, slotIndex, item);
174
- }
175
- };
176
-
177
- public onSelected(
178
- selectedActionId: ItemSocketEvents | string,
179
- onActionSelected: any
180
- ) {
181
- let payloadData: IPayloadProps = {
182
- actionType: selectedActionId,
183
- item: this.contextMenu?.slotItem!,
184
- };
185
- if (onActionSelected) {
186
- onActionSelected(payloadData);
187
- }
188
- this.clearContextMenu!();
189
- }
190
- }
191
-
192
- export const uiStore = new UIStore();