minecraft-inventory 0.1.36 → 0.1.37
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
|
@@ -81,6 +81,7 @@ export function JEI({
|
|
|
81
81
|
const { hoveredSlot } = useInventoryContext()
|
|
82
82
|
const [search, setSearch] = useState('')
|
|
83
83
|
const [page, setPage] = useState(0)
|
|
84
|
+
const [showAllItems, setShowAllItems] = useState(false)
|
|
84
85
|
const [showFavorites, setShowFavorites] = useState(false)
|
|
85
86
|
const [favorites, setFavorites] = useState<Set<string>>(loadFavorites)
|
|
86
87
|
// Map from negative slot index → JEI item (to enable F-key and R/U on hover)
|
|
@@ -187,7 +188,7 @@ export function JEI({
|
|
|
187
188
|
}, [items, showFavorites, favorites])
|
|
188
189
|
|
|
189
190
|
const filteredItems = useMemo(() => {
|
|
190
|
-
if (!search.trim()) return baseList
|
|
191
|
+
if (!search.trim()) return showAllItems ? baseList : []
|
|
191
192
|
const q = search.toLowerCase()
|
|
192
193
|
return baseList.filter(
|
|
193
194
|
(item) =>
|
|
@@ -195,7 +196,7 @@ export function JEI({
|
|
|
195
196
|
item.name.toLowerCase().includes(q) ||
|
|
196
197
|
String(item.type).includes(q),
|
|
197
198
|
)
|
|
198
|
-
}, [baseList, search])
|
|
199
|
+
}, [baseList, search, showAllItems])
|
|
199
200
|
|
|
200
201
|
const totalPages = Math.ceil(filteredItems.length / itemsPerPage)
|
|
201
202
|
const visibleItems = filteredItems.slice(page * itemsPerPage, (page + 1) * itemsPerPage)
|
|
@@ -310,6 +311,16 @@ export function JEI({
|
|
|
310
311
|
>
|
|
311
312
|
<StarIcon size={Math.max(1, Math.round(6 * scale))} />
|
|
312
313
|
</button>
|
|
314
|
+
{!showAllItems && (
|
|
315
|
+
<button
|
|
316
|
+
className={styles.pageBtn}
|
|
317
|
+
onClick={() => { setShowAllItems(true); setPage(0) }}
|
|
318
|
+
style={{ fontSize: 6 * scale, padding: `${scale}px ${2 * scale}px` }}
|
|
319
|
+
title="Show all items"
|
|
320
|
+
>
|
|
321
|
+
👁
|
|
322
|
+
</button>
|
|
323
|
+
)}
|
|
313
324
|
</div>
|
|
314
325
|
</div>
|
|
315
326
|
|