@rpg-engine/long-bow 0.1.92 → 0.1.96

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 (90) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +181 -181
  3. package/dist/components/Item/Inventory/ItemContainer.d.ts +1 -1
  4. package/dist/components/Item/Inventory/ItemSlot.d.ts +1 -1
  5. package/dist/components/Item/Inventory/itemContainerHelper.d.ts +1 -0
  6. package/dist/long-bow.cjs.development.js +13 -41
  7. package/dist/long-bow.cjs.development.js.map +1 -1
  8. package/dist/long-bow.cjs.production.min.js +1 -1
  9. package/dist/long-bow.cjs.production.min.js.map +1 -1
  10. package/dist/long-bow.esm.js +13 -41
  11. package/dist/long-bow.esm.js.map +1 -1
  12. package/package.json +98 -98
  13. package/src/components/Abstractions/SlotsContainer.tsx +42 -42
  14. package/src/components/Button.tsx +30 -30
  15. package/src/components/Chat/Chat.tsx +193 -193
  16. package/src/components/CheckButton.tsx +65 -65
  17. package/src/components/DraggableContainer.tsx +150 -150
  18. package/src/components/Dropdown.tsx +57 -57
  19. package/src/components/Equipment/EquipmentSet.tsx +134 -134
  20. package/src/components/Input.tsx +11 -11
  21. package/src/components/Item/Cards/ItemTooltip.tsx +32 -32
  22. package/src/components/Item/Inventory/ItemContainer.tsx +65 -65
  23. package/src/components/Item/Inventory/ItemContainerTypes.ts +4 -4
  24. package/src/components/Item/Inventory/ItemSlot.tsx +198 -199
  25. package/src/components/Item/Inventory/itemContainerHelper.ts +86 -94
  26. package/src/components/ListMenu.tsx +65 -65
  27. package/src/components/Multitab/Tab.tsx +57 -57
  28. package/src/components/Multitab/TabBody.tsx +13 -13
  29. package/src/components/Multitab/TabsContainer.tsx +97 -97
  30. package/src/components/NPCDialog/NPCDialog.tsx +145 -145
  31. package/src/components/NPCDialog/NPCDialogText.tsx +53 -53
  32. package/src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx +239 -239
  33. package/src/components/ProgressBar.tsx +91 -91
  34. package/src/components/PropertySelect/PropertySelect.tsx +101 -101
  35. package/src/components/PropertySelect/img/ui-arrows/arrow01-left-clicked.png +0 -0
  36. package/src/components/PropertySelect/img/ui-arrows/arrow01-left.png +0 -0
  37. package/src/components/PropertySelect/img/ui-arrows/arrow01-right-clicked.png +0 -0
  38. package/src/components/PropertySelect/img/ui-arrows/arrow01-right.png +0 -0
  39. package/src/components/PropertySelect/img/ui-arrows/arrow02-left-clicked.png +0 -0
  40. package/src/components/PropertySelect/img/ui-arrows/arrow02-left.png +0 -0
  41. package/src/components/PropertySelect/img/ui-arrows/arrow02-right-clicked.png +0 -0
  42. package/src/components/PropertySelect/img/ui-arrows/arrow02-right.png +0 -0
  43. package/src/components/QuestInfo/QuestInfo.tsx +143 -143
  44. package/src/components/RPGUIContainer.tsx +47 -47
  45. package/src/components/RPGUIRoot.tsx +14 -14
  46. package/src/components/RadioButton.tsx +53 -53
  47. package/src/components/RangeSlider.tsx +68 -68
  48. package/src/components/RelativeListMenu.tsx +83 -83
  49. package/src/components/ScrollList.tsx +77 -77
  50. package/src/components/SimpleProgressBar.tsx +62 -62
  51. package/src/components/SkillProgressBar.tsx +123 -123
  52. package/src/components/SkillsContainer.tsx +196 -196
  53. package/src/components/TextArea.tsx +11 -11
  54. package/src/components/Truncate.tsx +25 -25
  55. package/src/components/shared/Column.tsx +16 -16
  56. package/src/components/shared/SpriteFromAtlas.tsx +99 -99
  57. package/src/components/typography/DynamicText.tsx +49 -49
  58. package/src/constants/uiColors.ts +10 -10
  59. package/src/hooks/useEventListener.ts +21 -21
  60. package/src/hooks/useOutsideAlerter.ts +25 -25
  61. package/src/index.tsx +25 -25
  62. package/src/libs/StringHelpers.ts +3 -3
  63. package/src/mocks/atlas/icons/icons.json +735 -735
  64. package/src/mocks/atlas/items/items.json +5215 -5215
  65. package/src/mocks/equipmentSet.mocks.ts +347 -347
  66. package/src/mocks/itemContainer.mocks.ts +249 -249
  67. package/src/mocks/skills.mocks.ts +122 -122
  68. package/src/stories/Button.stories.tsx +36 -36
  69. package/src/stories/Chat.stories.tsx +170 -170
  70. package/src/stories/CheckButton.stories.tsx +48 -48
  71. package/src/stories/DraggableContainer.stories.tsx +28 -28
  72. package/src/stories/Dropdown.stories.tsx +46 -46
  73. package/src/stories/EquipmentSet.stories.tsx +50 -50
  74. package/src/stories/ItemContainer.stories.tsx +50 -50
  75. package/src/stories/ListMenu.stories.tsx +56 -56
  76. package/src/stories/Multitab.stories.tsx +51 -51
  77. package/src/stories/NPCDialog.stories.tsx +130 -130
  78. package/src/stories/ProgressBar.stories.tsx +23 -23
  79. package/src/stories/PropertySelect.stories.tsx +41 -41
  80. package/src/stories/QuestInfo.stories.tsx +76 -76
  81. package/src/stories/RPGUIContainers.stories.tsx +42 -42
  82. package/src/stories/RadioButton.stories.tsx +49 -49
  83. package/src/stories/RangeSlider.stories.tsx +60 -60
  84. package/src/stories/ScrollList.stories.tsx +85 -85
  85. package/src/stories/SimpleProgressBar.stories.tsx +22 -22
  86. package/src/stories/SkillProgressBar.stories.tsx +30 -30
  87. package/src/stories/SkillsContainer.stories.tsx +31 -31
  88. package/src/stories/Text.stories.tsx +42 -42
  89. package/src/types/eventTypes.ts +4 -4
  90. package/src/types/index.d.ts +2 -2
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Joao Paulo Furtado
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Joao Paulo Furtado
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,181 +1,181 @@
1
- # TSDX React w/ Storybook User Guide
2
-
3
- Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.
4
-
5
- > This TSDX setup is meant for developing React component libraries (not apps!) that can be published to NPM. If you’re looking to build a React-based app, you should use `create-react-app`, `razzle`, `nextjs`, `gatsby`, or `react-static`.
6
-
7
- > If you’re new to TypeScript and React, checkout [this handy cheatsheet](https://github.com/sw-yx/react-typescript-cheatsheet/)
8
-
9
- ## Commands
10
-
11
- TSDX scaffolds your new library inside `/src`, and also sets up a [Parcel-based](https://parceljs.org) playground for it inside `/example`.
12
-
13
- The recommended workflow is to run TSDX in one terminal:
14
-
15
- ```bash
16
- npm start # or yarn start
17
- ```
18
-
19
- This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
20
-
21
- Then run either Storybook or the example playground:
22
-
23
- ### Storybook
24
-
25
- Run inside another terminal:
26
-
27
- ```bash
28
- yarn storybook
29
- ```
30
-
31
- This loads the stories from `./stories`.
32
-
33
- > NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.
34
-
35
- ### Example
36
-
37
- Then run the example inside another:
38
-
39
- ```bash
40
- cd example
41
- npm i # or yarn to install dependencies
42
- npm start # or yarn start
43
- ```
44
-
45
- The default example imports and live reloads whatever is in `/dist`, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. **No symlinking required**, we use [Parcel's aliasing](https://parceljs.org/module_resolution.html#aliases).
46
-
47
- To do a one-off build, use `npm run build` or `yarn build`.
48
-
49
- To run tests, use `npm test` or `yarn test`.
50
-
51
- ## Configuration
52
-
53
- Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.
54
-
55
- ### Jest
56
-
57
- Jest tests are set up to run with `npm test` or `yarn test`.
58
-
59
- ### Bundle analysis
60
-
61
- Calculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `npm run size` and visulize it with `npm run analyze`.
62
-
63
- #### Setup Files
64
-
65
- This is the folder structure we set up for you:
66
-
67
- ```txt
68
- /example
69
- index.html
70
- index.tsx # test your component here in a demo app
71
- package.json
72
- tsconfig.json
73
- /src
74
- index.tsx # EDIT THIS
75
- /test
76
- blah.test.tsx # EDIT THIS
77
- /stories
78
- Thing.stories.tsx # EDIT THIS
79
- /.storybook
80
- main.js
81
- preview.js
82
- .gitignore
83
- package.json
84
- README.md # EDIT THIS
85
- tsconfig.json
86
- ```
87
-
88
- #### React Testing Library
89
-
90
- We do not set up `react-testing-library` for you yet, we welcome contributions and documentation on this.
91
-
92
- ### Rollup
93
-
94
- TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.
95
-
96
- ### TypeScript
97
-
98
- `tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.
99
-
100
- ## Continuous Integration
101
-
102
- ### GitHub Actions
103
-
104
- Two actions are added by default:
105
-
106
- - `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
107
- - `size` which comments cost comparison of your library on every pull request using [size-limit](https://github.com/ai/size-limit)
108
-
109
- ## Optimizations
110
-
111
- Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:
112
-
113
- ```js
114
- // ./types/index.d.ts
115
- declare var __DEV__: boolean;
116
-
117
- // inside your code...
118
- if (__DEV__) {
119
- console.log('foo');
120
- }
121
- ```
122
-
123
- You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.
124
-
125
- ## Module Formats
126
-
127
- CJS, ESModules, and UMD module formats are supported.
128
-
129
- The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.
130
-
131
- ## Deploying the Example Playground
132
-
133
- The Playground is just a simple [Parcel](https://parceljs.org) app, you can deploy it anywhere you would normally deploy that. Here are some guidelines for **manually** deploying with the Netlify CLI (`npm i -g netlify-cli`):
134
-
135
- ```bash
136
- cd example # if not already in the example folder
137
- npm run build # builds to dist
138
- netlify deploy # deploy the dist folder
139
- ```
140
-
141
- Alternatively, if you already have a git repo connected, you can set up continuous deployment with Netlify:
142
-
143
- ```bash
144
- netlify init
145
- # build command: yarn build && cd example && yarn && yarn build
146
- # directory to deploy: example/dist
147
- # pick yes for netlify.toml
148
- ```
149
-
150
- ## Named Exports
151
-
152
- Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.
153
-
154
- ## Including Styles
155
-
156
- There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.
157
-
158
- For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.
159
-
160
- ## Publishing to NPM
161
-
162
- We recommend using [np](https://github.com/sindresorhus/np).
163
-
164
- ## Usage with Lerna
165
-
166
- When creating a new package with TSDX within a project set up with Lerna, you might encounter a `Cannot resolve dependency` error when trying to run the `example` project. To fix that you will need to make changes to the `package.json` file _inside the `example` directory_.
167
-
168
- The problem is that due to the nature of how dependencies are installed in Lerna projects, the aliases in the example project's `package.json` might not point to the right place, as those dependencies might have been installed in the root of your Lerna project.
169
-
170
- Change the `alias` to point to where those packages are actually installed. This depends on the directory structure of your Lerna project, so the actual path might be different from the diff below.
171
-
172
- ```diff
173
- "alias": {
174
- - "react": "../node_modules/react",
175
- - "react-dom": "../node_modules/react-dom"
176
- + "react": "../../../node_modules/react",
177
- + "react-dom": "../../../node_modules/react-dom"
178
- },
179
- ```
180
-
181
- An alternative to fixing this problem would be to remove aliases altogether and define the dependencies referenced as aliases as dev dependencies instead. [However, that might cause other problems.](https://github.com/palmerhq/tsdx/issues/64)
1
+ # TSDX React w/ Storybook User Guide
2
+
3
+ Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.
4
+
5
+ > This TSDX setup is meant for developing React component libraries (not apps!) that can be published to NPM. If you’re looking to build a React-based app, you should use `create-react-app`, `razzle`, `nextjs`, `gatsby`, or `react-static`.
6
+
7
+ > If you’re new to TypeScript and React, checkout [this handy cheatsheet](https://github.com/sw-yx/react-typescript-cheatsheet/)
8
+
9
+ ## Commands
10
+
11
+ TSDX scaffolds your new library inside `/src`, and also sets up a [Parcel-based](https://parceljs.org) playground for it inside `/example`.
12
+
13
+ The recommended workflow is to run TSDX in one terminal:
14
+
15
+ ```bash
16
+ npm start # or yarn start
17
+ ```
18
+
19
+ This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
20
+
21
+ Then run either Storybook or the example playground:
22
+
23
+ ### Storybook
24
+
25
+ Run inside another terminal:
26
+
27
+ ```bash
28
+ yarn storybook
29
+ ```
30
+
31
+ This loads the stories from `./stories`.
32
+
33
+ > NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.
34
+
35
+ ### Example
36
+
37
+ Then run the example inside another:
38
+
39
+ ```bash
40
+ cd example
41
+ npm i # or yarn to install dependencies
42
+ npm start # or yarn start
43
+ ```
44
+
45
+ The default example imports and live reloads whatever is in `/dist`, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. **No symlinking required**, we use [Parcel's aliasing](https://parceljs.org/module_resolution.html#aliases).
46
+
47
+ To do a one-off build, use `npm run build` or `yarn build`.
48
+
49
+ To run tests, use `npm test` or `yarn test`.
50
+
51
+ ## Configuration
52
+
53
+ Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.
54
+
55
+ ### Jest
56
+
57
+ Jest tests are set up to run with `npm test` or `yarn test`.
58
+
59
+ ### Bundle analysis
60
+
61
+ Calculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `npm run size` and visulize it with `npm run analyze`.
62
+
63
+ #### Setup Files
64
+
65
+ This is the folder structure we set up for you:
66
+
67
+ ```txt
68
+ /example
69
+ index.html
70
+ index.tsx # test your component here in a demo app
71
+ package.json
72
+ tsconfig.json
73
+ /src
74
+ index.tsx # EDIT THIS
75
+ /test
76
+ blah.test.tsx # EDIT THIS
77
+ /stories
78
+ Thing.stories.tsx # EDIT THIS
79
+ /.storybook
80
+ main.js
81
+ preview.js
82
+ .gitignore
83
+ package.json
84
+ README.md # EDIT THIS
85
+ tsconfig.json
86
+ ```
87
+
88
+ #### React Testing Library
89
+
90
+ We do not set up `react-testing-library` for you yet, we welcome contributions and documentation on this.
91
+
92
+ ### Rollup
93
+
94
+ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.
95
+
96
+ ### TypeScript
97
+
98
+ `tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.
99
+
100
+ ## Continuous Integration
101
+
102
+ ### GitHub Actions
103
+
104
+ Two actions are added by default:
105
+
106
+ - `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
107
+ - `size` which comments cost comparison of your library on every pull request using [size-limit](https://github.com/ai/size-limit)
108
+
109
+ ## Optimizations
110
+
111
+ Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:
112
+
113
+ ```js
114
+ // ./types/index.d.ts
115
+ declare var __DEV__: boolean;
116
+
117
+ // inside your code...
118
+ if (__DEV__) {
119
+ console.log('foo');
120
+ }
121
+ ```
122
+
123
+ You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.
124
+
125
+ ## Module Formats
126
+
127
+ CJS, ESModules, and UMD module formats are supported.
128
+
129
+ The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.
130
+
131
+ ## Deploying the Example Playground
132
+
133
+ The Playground is just a simple [Parcel](https://parceljs.org) app, you can deploy it anywhere you would normally deploy that. Here are some guidelines for **manually** deploying with the Netlify CLI (`npm i -g netlify-cli`):
134
+
135
+ ```bash
136
+ cd example # if not already in the example folder
137
+ npm run build # builds to dist
138
+ netlify deploy # deploy the dist folder
139
+ ```
140
+
141
+ Alternatively, if you already have a git repo connected, you can set up continuous deployment with Netlify:
142
+
143
+ ```bash
144
+ netlify init
145
+ # build command: yarn build && cd example && yarn && yarn build
146
+ # directory to deploy: example/dist
147
+ # pick yes for netlify.toml
148
+ ```
149
+
150
+ ## Named Exports
151
+
152
+ Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.
153
+
154
+ ## Including Styles
155
+
156
+ There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.
157
+
158
+ For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.
159
+
160
+ ## Publishing to NPM
161
+
162
+ We recommend using [np](https://github.com/sindresorhus/np).
163
+
164
+ ## Usage with Lerna
165
+
166
+ When creating a new package with TSDX within a project set up with Lerna, you might encounter a `Cannot resolve dependency` error when trying to run the `example` project. To fix that you will need to make changes to the `package.json` file _inside the `example` directory_.
167
+
168
+ The problem is that due to the nature of how dependencies are installed in Lerna projects, the aliases in the example project's `package.json` might not point to the right place, as those dependencies might have been installed in the root of your Lerna project.
169
+
170
+ Change the `alias` to point to where those packages are actually installed. This depends on the directory structure of your Lerna project, so the actual path might be different from the diff below.
171
+
172
+ ```diff
173
+ "alias": {
174
+ - "react": "../node_modules/react",
175
+ - "react-dom": "../node_modules/react-dom"
176
+ + "react": "../../../node_modules/react",
177
+ + "react-dom": "../../../node_modules/react-dom"
178
+ },
179
+ ```
180
+
181
+ An alternative to fixing this problem would be to remove aliases altogether and define the dependencies referenced as aliases as dev dependencies instead. [However, that might cause other problems.](https://github.com/palmerhq/tsdx/issues/64)
@@ -6,6 +6,6 @@ export interface IItemContainerProps {
6
6
  onClose?: () => void;
7
7
  onItemClick?: (item: IItem, slotContainerType: SlotContainerType | null) => void;
8
8
  onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
9
- onSelected?: (optionId: string) => void;
9
+ onSelected?: (optionId: string, item: IItem) => void;
10
10
  }
11
11
  export declare const ItemContainer: React.FC<IItemContainerProps>;
@@ -7,7 +7,7 @@ interface IProps {
7
7
  itemContainer?: IItemContainer | null;
8
8
  slotContainerType: SlotContainerType | null;
9
9
  slotSpriteMask?: ItemSlotType | null;
10
- onSelected: (payload: any) => void;
10
+ onSelected: (selectedOption: string, item: IItem) => void;
11
11
  onMouseOver: (event: any, slotIndex: number, item: IItem | null, x: number, y: number) => void;
12
12
  onMouseOut?: () => void;
13
13
  onClick: (item: IItem, slotContainerType: SlotContainerType | null) => void;
@@ -9,3 +9,4 @@ export declare enum ContainerType {
9
9
  EQUIPMENT_SET = "EquipmentSet"
10
10
  }
11
11
  export declare const handleContextMenuList: (itemType: ItemType, slotContainerType: SlotContainerType | null) => IContextMenuItem[];
12
+ export declare const handleEquipmentContextMenuList: (itemType: ItemType) => IContextMenuItem[];
@@ -5815,19 +5815,8 @@ var ContainerType;
5815
5815
  (function (ContainerType) {
5816
5816
  ContainerType["INVENTORY"] = "Inventory";
5817
5817
  ContainerType["EQUIPMENT_SET"] = "EquipmentSet";
5818
- })(ContainerType || (ContainerType = {}));
5818
+ })(ContainerType || (ContainerType = {})); // TODO: Refactor this file
5819
5819
 
5820
- var handleContextMenuList = function handleContextMenuList(itemType, slotContainerType) {
5821
- var contextActionMenu = [];
5822
-
5823
- if (slotContainerType === SlotContainerType.INVENTORY) {
5824
- contextActionMenu = handleItemContainerContextMenuList(itemType);
5825
- } else {
5826
- contextActionMenu = handleEquipmentContextMenuList(itemType);
5827
- }
5828
-
5829
- return contextActionMenu;
5830
- }; // TODO: Refactor this file
5831
5820
 
5832
5821
  var generateContextList = function generateContextList(actionsByTypeList) {
5833
5822
  var contextMenu = actionsByTypeList.map(function (action) {
@@ -5839,7 +5828,7 @@ var generateContextList = function generateContextList(actionsByTypeList) {
5839
5828
  return contextMenu;
5840
5829
  };
5841
5830
 
5842
- var handleItemContainerContextMenuList = function handleItemContainerContextMenuList(itemType) {
5831
+ var handleContextMenuList = function handleContextMenuList(itemType, slotContainerType) {
5843
5832
  var contextActionMenu = [];
5844
5833
 
5845
5834
  switch (itemType) {
@@ -5848,7 +5837,12 @@ var handleItemContainerContextMenuList = function handleItemContainerContextMenu
5848
5837
  case shared.ItemType.Accessory:
5849
5838
  case shared.ItemType.Jewelry:
5850
5839
  case shared.ItemType.Tool:
5851
- contextActionMenu = generateContextList(shared.ActionsByItemType.Equipment);
5840
+ if (slotContainerType === SlotContainerType.EQUIPMENT_SET) {
5841
+ contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmentSetItems);
5842
+ } else {
5843
+ contextActionMenu = generateContextList(shared.ActionsByItemType.Equipment);
5844
+ }
5845
+
5852
5846
  break;
5853
5847
 
5854
5848
  case shared.ItemType.Consumable:
@@ -5874,30 +5868,6 @@ var handleItemContainerContextMenuList = function handleItemContainerContextMenu
5874
5868
  return contextActionMenu;
5875
5869
  };
5876
5870
 
5877
- var handleEquipmentContextMenuList = function handleEquipmentContextMenuList(itemType) {
5878
- var contextActionMenu = [];
5879
-
5880
- switch (itemType) {
5881
- case shared.ItemType.Weapon:
5882
- case shared.ItemType.Armor:
5883
- case shared.ItemType.Accessory:
5884
- case shared.ItemType.Jewelry:
5885
- case shared.ItemType.Tool:
5886
- contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
5887
- break;
5888
-
5889
- case shared.ItemType.Container:
5890
- contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetContainer);
5891
- break;
5892
-
5893
- default:
5894
- contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
5895
- break;
5896
- }
5897
-
5898
- return contextActionMenu;
5899
- };
5900
-
5901
5871
  var EquipmentSlotSpriteByType = {
5902
5872
  Neck: 'accessories/corruption-necklace.png',
5903
5873
  LeftHand: 'swords/broad-sword.png',
@@ -6022,7 +5992,9 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
6022
5992
  onSelected: function onSelected(optionId) {
6023
5993
  setIsContextMenuVisible(false);
6024
5994
 
6025
- _onSelected(optionId);
5995
+ if (item) {
5996
+ _onSelected(optionId, item);
5997
+ }
6026
5998
  },
6027
5999
  onOutsideClick: function onOutsideClick() {
6028
6000
  setIsContextMenuVisible(false);
@@ -6165,8 +6137,8 @@ var ItemContainer = function ItemContainer(_ref) {
6165
6137
  onClick: function onClick(item, slotContainerType) {
6166
6138
  if (onItemClick) onItemClick(item, slotContainerType);
6167
6139
  },
6168
- onSelected: function onSelected(optionId) {
6169
- if (_onSelected) _onSelected(optionId);
6140
+ onSelected: function onSelected(optionId, item) {
6141
+ if (_onSelected) _onSelected(optionId, item);
6170
6142
  }
6171
6143
  }));
6172
6144
  }