@rpg-engine/long-bow 0.7.93 → 0.7.94

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.7.93",
3
+ "version": "0.7.94",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -123,23 +123,27 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
123
123
  };
124
124
 
125
125
  const categoryOptions: IOptionsProps[] = [
126
- 'Suggested',
127
- ...(pinnedItems.length > 0 ? ['Pinned'] : []),
128
- ...Object.keys(ItemSubType),
129
- ]
130
- .filter(type => type !== 'DeadBody')
131
- .sort((a, b) => {
132
- if (a === 'Suggested') return -1;
133
- if (b === 'Suggested') return 1;
134
- if (a === 'Pinned') return -1;
135
- if (b === 'Pinned') return 1;
136
- return a.localeCompare(b);
137
- })
138
- .map((type, index) => ({
139
- id: index,
140
- value: type,
141
- option: type,
142
- }));
126
+ { id: 0, value: 'Suggested', option: 'Suggested' },
127
+ ...(pinnedItems.length > 0
128
+ ? [{ id: 1, value: 'Pinned', option: 'Pinned' }]
129
+ : []),
130
+ ...Object.keys(ItemSubType)
131
+ .filter(type => type !== 'DeadBody')
132
+ .map((type, index) => ({
133
+ id: index + (pinnedItems.length > 0 ? 2 : 1),
134
+ value: type,
135
+ option:
136
+ type === 'CraftingResources' || type === 'CraftingResource'
137
+ ? 'Resources'
138
+ : type,
139
+ })),
140
+ ].sort((a, b) => {
141
+ if (a.value === 'Suggested') return -1;
142
+ if (b.value === 'Suggested') return 1;
143
+ if (a.value === 'Pinned') return -1;
144
+ if (b.value === 'Pinned') return 1;
145
+ return a.value.localeCompare(b.value);
146
+ });
143
147
 
144
148
  const filteredCraftableItems = items?.filter(item => {
145
149
  const matchesSearch = item.name
@@ -246,25 +250,27 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
246
250
  </RadioInputScroller>
247
251
  </ContentContainer>
248
252
 
249
- <PaginationContainer>
250
- <PaginationButton
251
- onClick={() => setCurrentPage(prev => Math.max(1, prev - 1))}
252
- disabled={currentPage === 1}
253
- >
254
- <FaChevronLeft size={12} />
255
- </PaginationButton>
256
- <PageInfo>
257
- Page {currentPage} of {totalPages}
258
- </PageInfo>
259
- <PaginationButton
260
- onClick={() =>
261
- setCurrentPage(prev => Math.min(totalPages, prev + 1))
262
- }
263
- disabled={currentPage === totalPages}
264
- >
265
- <FaChevronRight size={12} />
266
- </PaginationButton>
267
- </PaginationContainer>
253
+ {totalPages > 1 && (
254
+ <PaginationContainer>
255
+ <PaginationButton
256
+ onClick={() => setCurrentPage(prev => Math.max(1, prev - 1))}
257
+ disabled={currentPage === 1}
258
+ >
259
+ <FaChevronLeft size={12} />
260
+ </PaginationButton>
261
+ <PageInfo>
262
+ Page {currentPage} of {totalPages}
263
+ </PageInfo>
264
+ <PaginationButton
265
+ onClick={() =>
266
+ setCurrentPage(prev => Math.min(totalPages, prev + 1))
267
+ }
268
+ disabled={currentPage === totalPages}
269
+ >
270
+ <FaChevronRight size={12} />
271
+ </PaginationButton>
272
+ </PaginationContainer>
273
+ )}
268
274
 
269
275
  <Footer>
270
276
  <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>
@@ -403,7 +409,7 @@ const RadioInputScroller = styled.div`
403
409
  display: grid;
404
410
  grid-template-columns: repeat(2, minmax(0, 1fr));
405
411
  gap: 16px;
406
- align-items: start;
412
+ align-content: start;
407
413
 
408
414
  @media (max-width: ${mobilePortrait.width}) {
409
415
  grid-template-columns: 1fr;