minecraft-inventory 0.1.2 → 0.1.3

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.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "release": {
@@ -220,7 +220,7 @@ export function InventoryOverlay({
220
220
  onPushFrame={handleRecipePushFrame}
221
221
  />
222
222
  ) : (
223
- <InventoryWindow type={type} title={title} properties={properties} />
223
+ <InventoryWindow type={type} title={title} properties={properties} showDebug={debugBounds} />
224
224
  )}
225
225
  </div>
226
226
  </div>
@@ -8,12 +8,14 @@ interface InventoryBackgroundProps {
8
8
  definition: InventoryTypeDefinition
9
9
  children: React.ReactNode
10
10
  title?: string
11
+ showDebug?: boolean
11
12
  }
12
13
 
13
14
  export function InventoryBackground({
14
15
  definition,
15
16
  children,
16
17
  title,
18
+ showDebug
17
19
  }: InventoryBackgroundProps) {
18
20
  const textures = useTextures()
19
21
  const { scale } = useScale()
@@ -35,7 +37,7 @@ export function InventoryBackground({
35
37
  height: h,
36
38
  imageRendering: 'pixelated',
37
39
  display: 'inline-block',
38
- outline: '1px solid rgba(255, 0, 0, 0.7)',
40
+ outline: showDebug ? '1px solid rgba(255, 0, 0, 0.7)' : 'none',
39
41
  outlineOffset: 0,
40
42
  }}
41
43
  >
@@ -19,6 +19,7 @@ interface InventoryWindowProps {
19
19
  className?: string
20
20
  style?: React.CSSProperties
21
21
  enableKeyboardShortcuts?: boolean
22
+ showDebug?: boolean
22
23
  }
23
24
 
24
25
  export function InventoryWindow({
@@ -29,6 +30,7 @@ export function InventoryWindow({
29
30
  className,
30
31
  style,
31
32
  enableKeyboardShortcuts = true,
33
+ showDebug = false,
32
34
  }: InventoryWindowProps) {
33
35
  const def = getInventoryType(type)
34
36
  const { windowState, getSlot } = useInventoryContext()
@@ -72,7 +74,7 @@ export function InventoryWindow({
72
74
  className={['mc-inv-root', className].filter(Boolean).join(' ')}
73
75
  style={{ position: 'relative', display: 'inline-block', ...style }}
74
76
  >
75
- <InventoryBackground definition={def} title={effectiveTitle}>
77
+ <InventoryBackground definition={def} title={effectiveTitle} showDebug={showDebug}>
76
78
  {/* Render slots */}
77
79
  {def.slots.map((slotDef) => (
78
80
  <div