minecraft-inventory 0.1.16 → 0.1.17

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": "minecraft-inventory",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "release": {
@@ -304,7 +304,7 @@ export function InventoryOverlay({
304
304
  lineHeight: 1,
305
305
  }}
306
306
  >
307
- INV 0.1.16
307
+ INV 0.1.17
308
308
  </a>
309
309
  )}
310
310
 
@@ -17,6 +17,10 @@
17
17
  font-family: inherit;
18
18
  font-size: inherit;
19
19
  transition: background 0.1s;
20
+ display: inline-flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ line-height: 1;
20
24
  }
21
25
 
22
26
  .pageBtn:hover:not(:disabled) {
@@ -280,8 +280,7 @@ export function JEI({
280
280
  >
281
281
  <button
282
282
  className={styles.pageBtn}
283
- onClick={() => setPage((p) => Math.max(0, p - 1))}
284
- disabled={page === 0}
283
+ onClick={() => setPage((p) => (p > 0 ? p - 1 : Math.max(0, totalPages - 1)))}
285
284
  style={{ fontSize: 6 * scale, padding: `${scale}px ${2 * scale}px` }}
286
285
  title="Previous page"
287
286
  >
@@ -292,8 +291,7 @@ export function JEI({
292
291
  </span>
293
292
  <button
294
293
  className={styles.pageBtn}
295
- onClick={() => setPage((p) => Math.min(totalPages - 1, p + 1))}
296
- disabled={page >= totalPages - 1}
294
+ onClick={() => setPage((p) => (p < totalPages - 1 ? p + 1 : 0))}
297
295
  style={{ fontSize: 6 * scale, padding: `${scale}px ${2 * scale}px` }}
298
296
  title="Next page"
299
297
  >
@@ -185,16 +185,14 @@ export function RecipeInventoryView({
185
185
  <>
186
186
  <NavBtn
187
187
  scale={scale}
188
- onClick={() => onGuideIndexChange(Math.max(0, frame.guideIndex - 1))}
189
- disabled={frame.guideIndex === 0}
188
+ onClick={() => onGuideIndexChange(frame.guideIndex > 0 ? frame.guideIndex - 1 : totalGuides - 1)}
190
189
  >◀</NavBtn>
191
190
  <span style={{ color: '#404040', minWidth: 40 * scale, textAlign: 'center' }}>
192
191
  {frame.guideIndex + 1} / {totalGuides}
193
192
  </span>
194
193
  <NavBtn
195
194
  scale={scale}
196
- onClick={() => onGuideIndexChange(Math.min(totalGuides - 1, frame.guideIndex + 1))}
197
- disabled={frame.guideIndex >= totalGuides - 1}
195
+ onClick={() => onGuideIndexChange(frame.guideIndex < totalGuides - 1 ? frame.guideIndex + 1 : 0)}
198
196
  >▶</NavBtn>
199
197
  </>
200
198
  )}
@@ -523,6 +521,9 @@ function NavBtn({
523
521
  lineHeight: 1,
524
522
  outline: 'none',
525
523
  flexShrink: 0,
524
+ display: 'inline-flex',
525
+ alignItems: 'center',
526
+ justifyContent: 'center',
526
527
  }}
527
528
  >
528
529
  {children}