minecraft-inventory 0.1.1 → 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.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"release": {
|
|
@@ -18,15 +18,17 @@
|
|
|
18
18
|
"@types/react": "^19.2.14",
|
|
19
19
|
"@types/react-dom": "^19.2.3",
|
|
20
20
|
"mc-assets": "*",
|
|
21
|
-
"minecraft-data": "^3.105.0",
|
|
22
|
-
"typescript": "^5.9.3"
|
|
23
|
-
},
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"@xmcl/text-component": "^2.1.3",
|
|
26
21
|
"react": "^19.2.4",
|
|
27
|
-
"react-dom": "^19.2.4"
|
|
22
|
+
"react-dom": "^19.2.4",
|
|
23
|
+
"minecraft-data": "^3.105.0",
|
|
24
|
+
"typescript": "^5.9.3",
|
|
25
|
+
"@xmcl/text-component": "^2.1.3"
|
|
28
26
|
},
|
|
27
|
+
"dependencies": {},
|
|
29
28
|
"peerDependencies": {
|
|
29
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
30
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
31
|
+
"@xmcl/text-component": "*",
|
|
30
32
|
"mc-assets": "*"
|
|
31
33
|
},
|
|
32
34
|
"peerDependenciesMeta": {
|
|
@@ -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
|
package/src/index.tsx
CHANGED
|
@@ -47,7 +47,7 @@ export type { ActionLogEntry, DemoConnectorOptions } from './connector/demo'
|
|
|
47
47
|
|
|
48
48
|
// Registry
|
|
49
49
|
export { registerInventoryType, getInventoryType, getAllInventoryTypes } from './registry'
|
|
50
|
-
export type { InventoryTypeDefinition } from './registry'
|
|
50
|
+
export type { InventoryTypeDefinition, WindowType } from './registry'
|
|
51
51
|
|
|
52
52
|
// Types
|
|
53
53
|
export type {
|
package/src/registry/index.ts
CHANGED