jaml-ui 0.10.0 → 0.11.0
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/LICENSE +21 -21
- package/README.md +135 -135
- package/assets/8BitDeck.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/.design-canvas.state.json +1 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/BlindChips.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Boosters/Boosters.json +303 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Boosters/boosters.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Boosters.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Bosses/BlindChips.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Bosses/blinds_metadata.json +51 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Decks/8BitDeck.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Decks/Enhancers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Decks/balatro-stake-chips.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Decks/enhancers_metadata.json +52 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Decks/playing_cards_metadata.json +74 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Decks/stakes.json +19 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Editions.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Enhancers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Jokers/Editions.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Jokers/Jokers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Jokers/jokers.json +1087 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Jokers/stickers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Jokers/stickers_metadata.json +25 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Jokers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Tags/tags.json +191 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Tags/tags.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Tarots/Tarots.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Tarots/planets.json +15 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Tarots/spectrals.json +21 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Tarots/tarots.json +163 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Tarots.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Vouchers/Vouchers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Vouchers/vouchers.json +130 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/Vouchers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/blinds.json +51 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/boosters.json +303 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/fonts/m6x11plusplus.otf +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/jokers.json +1087 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/planets.json +15 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/spectrals.json +21 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/stakes.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/stickers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/tags.json +191 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/tags.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/tarots.json +163 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Assets/vouchers.json +130 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Seed Detail v2.html +40 -0
- package/assets/Balatro Seed Curator (DesignsV2)/Seed Detail.html +34 -0
- package/assets/Balatro Seed Curator (DesignsV2)/public/fonts/m6x11plusplus.otf +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/AntePage.jsx +228 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/SeedDetail.jsx +222 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/app.jsx +35 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/mockData.js +185 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/sprites.jsx +259 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/tokens.js +49 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/AntePageV2.jsx +290 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/BalButton.jsx +107 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/JamlBuilderV2.jsx +594 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/JamlIde.jsx +302 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/SearchResultsV2.jsx +286 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/SeedDetailV2.jsx +336 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/SeedOGCard.jsx +251 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/Showcase.jsx +131 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/app.jsx +55 -0
- package/assets/Balatro Seed Curator (DesignsV2)/src/v2/data.js +296 -0
- package/assets/Balatro Seed Curator (DesignsV2)/starters/design-canvas.jsx +622 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/8BitDeck.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/BlindChips.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/Boosters.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/Editions.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/Enhancers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/Jokers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/Tarots.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776749540653-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776749644934-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776749661871-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776749674748-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776749703076-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776749882759-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776750354200-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776750733265-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776751928925-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/pasted-1776800975060-0.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/stickers.png +0 -0
- package/assets/Balatro Seed Curator (DesignsV2)/uploads/tags.png +0 -0
- package/assets/BlindChips.png +0 -0
- package/assets/Boosters.png +0 -0
- package/assets/Editions.png +0 -0
- package/assets/Enhancers.png +0 -0
- package/assets/Jokers.png +0 -0
- package/assets/Tarots.png +0 -0
- package/assets/Vouchers.png +0 -0
- package/assets/fonts/m6x11plusplus.otf +0 -0
- package/assets/stickers.png +0 -0
- package/assets/tags.png +0 -0
- package/dist/assets.js +10 -13
- package/dist/components/GameCard.js +7 -5
- package/dist/components/JamlCodeEditor.js +28 -16
- package/dist/components/JamlIdeVisual.d.ts +5 -3
- package/dist/components/JamlIdeVisual.js +194 -36
- package/dist/components/JamlMapPreview.d.ts +1 -5
- package/dist/components/JamlMapPreview.js +67 -107
- package/dist/components/PlayingCard.js +15 -50
- package/dist/data/balatro-jokers.json +1241 -0
- package/dist/decode/motelyItemDecoder.js +1 -1
- package/dist/hooks/searchWorkerCode.js +59 -59
- package/dist/hooks/useAnalyzer.d.ts +1 -0
- package/dist/hooks/useAnalyzer.js +5 -1
- package/dist/hooks/useSearch.d.ts +1 -0
- package/dist/hooks/useSearch.js +4 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/motelyDisplay.js +2 -0
- package/dist/r3f/BalatroJokerMesh3D.d.ts +8 -0
- package/dist/r3f/BalatroJokerMesh3D.js +98 -0
- package/dist/r3f/BalatroJokerPreview3D.d.ts +14 -0
- package/dist/r3f/BalatroJokerPreview3D.js +30 -0
- package/dist/r3f/BalatroPlayingCard3D.d.ts +22 -0
- package/dist/r3f/BalatroPlayingCard3D.js +62 -0
- package/dist/r3f/cardConstants.d.ts +16 -0
- package/dist/r3f/cardConstants.js +14 -0
- package/dist/r3f/compositedAtlas.d.ts +5 -0
- package/dist/r3f/compositedAtlas.js +56 -0
- package/dist/r3f/gridUV.d.ts +22 -0
- package/dist/r3f/gridUV.js +30 -0
- package/dist/r3f/index.d.ts +12 -0
- package/dist/r3f/index.js +13 -0
- package/dist/r3f/jokerRegistry.d.ts +28 -0
- package/dist/r3f/jokerRegistry.js +40 -0
- package/dist/r3f/jokerTilt.d.ts +8 -0
- package/dist/r3f/jokerTilt.js +41 -0
- package/dist/r3f/magneticTilt.d.ts +18 -0
- package/dist/r3f/magneticTilt.js +34 -0
- package/dist/r3f/playingCardTypes.d.ts +24 -0
- package/dist/r3f/playingCardTypes.js +32 -0
- package/dist/r3f/playingCardVisuals.d.ts +7 -0
- package/dist/r3f/playingCardVisuals.js +45 -0
- package/dist/r3f/usePlayingCardTexture.d.ts +7 -0
- package/dist/r3f/usePlayingCardTexture.js +92 -0
- package/dist/sprites/spriteMapper.d.ts +1 -1
- package/dist/sprites/spriteMapper.js +14 -33
- package/dist/ui/footer.js +5 -5
- package/dist/ui/jimboBackground.js +55 -55
- package/dist/ui/jimboCopyRow.d.ts +5 -0
- package/dist/ui/jimboCopyRow.js +36 -0
- package/dist/ui/jimboTabs.js +5 -5
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +1 -0
- package/dist/utils/gameCardUtils.d.ts +4 -12
- package/dist/utils/gameCardUtils.js +9 -43
- package/fonts.css +5 -5
- package/package.json +4 -3
|
@@ -1,117 +1,77 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { JimboSprite } from "../ui/sprites.js";
|
|
5
|
+
import { JimboColorOption } from "../ui/tokens.js";
|
|
6
|
+
import { extractVisualJamlItems, } from "../utils/jamlMapPreview.js";
|
|
7
|
+
const C = JimboColorOption;
|
|
8
|
+
const ZONES = {
|
|
9
|
+
must: { label: "MUST", color: C.BLUE },
|
|
10
|
+
should: { label: "SHOULD", color: C.RED },
|
|
11
|
+
mustNot: { label: "MUST NOT", color: C.ORANGE },
|
|
11
12
|
};
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const SECTION_ORDER = ["must", "should", "mustNot"];
|
|
14
|
+
const SHEET_FOR_VISUAL = {
|
|
15
|
+
joker: "Jokers",
|
|
16
|
+
consumable: "Tarots",
|
|
17
|
+
voucher: "Vouchers",
|
|
18
|
+
tag: "tags",
|
|
19
|
+
boss: "BlindChips",
|
|
16
20
|
};
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
function ClausePill({ item, color }) {
|
|
22
|
+
return (_jsxs("div", { style: {
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
gap: 6,
|
|
26
|
+
background: C.DARK_GREY,
|
|
27
|
+
border: `2px solid ${color}`,
|
|
28
|
+
borderRadius: 6,
|
|
29
|
+
padding: "5px 8px 5px 4px",
|
|
30
|
+
boxShadow: `0 2px 0 ${C.BLACK}`,
|
|
31
|
+
}, title: `${item.clauseKey}: ${item.value}`, children: [_jsx("div", { style: { color: C.GREY, fontSize: 12, lineHeight: 1, padding: "0 2px" }, children: "\u22EE\u22EE" }), _jsx(JimboSprite, { name: item.value, sheet: SHEET_FOR_VISUAL[item.visualType], width: 26 }), _jsx("div", { style: {
|
|
32
|
+
fontSize: 10,
|
|
33
|
+
color: C.WHITE,
|
|
34
|
+
letterSpacing: 1,
|
|
35
|
+
textShadow: "1px 1px 0 rgba(0,0,0,.8)",
|
|
36
|
+
}, children: item.value })] }));
|
|
37
|
+
}
|
|
38
|
+
function ZoneRail({ zone, items }) {
|
|
39
|
+
const meta = ZONES[zone];
|
|
40
|
+
return (_jsxs("div", { style: {
|
|
41
|
+
border: `2px dashed ${meta.color}55`,
|
|
42
|
+
borderRadius: 6,
|
|
43
|
+
padding: 8,
|
|
44
|
+
}, children: [_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 6 }, children: [_jsx("div", { style: {
|
|
45
|
+
fontSize: 10,
|
|
46
|
+
letterSpacing: 2,
|
|
47
|
+
padding: "2px 8px",
|
|
48
|
+
background: meta.color,
|
|
49
|
+
color: C.WHITE,
|
|
50
|
+
borderRadius: 3,
|
|
51
|
+
textShadow: "1px 1px 0 rgba(0,0,0,.8)",
|
|
52
|
+
}, children: meta.label }), _jsx("div", { style: { flex: 1, height: 1, background: `${meta.color}44` } }), _jsx("div", { style: { fontSize: 8, color: C.GREY }, children: items.length })] }), _jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: items.length === 0 ? (_jsx("div", { style: { fontSize: 10, color: C.GREY, padding: 10, fontStyle: "italic" }, children: "drop clauses here" })) : (items.map((item) => _jsx(ClausePill, { item: item, color: meta.color }, item.id))) })] }));
|
|
32
53
|
}
|
|
33
|
-
export function JamlMapPreview({ jaml, className = "",
|
|
54
|
+
export function JamlMapPreview({ jaml, className = "", emptyMessage = "No visual JAML clauses found yet.", }) {
|
|
34
55
|
const groups = useMemo(() => extractVisualJamlItems(jaml), [jaml]);
|
|
35
|
-
const totalItems = SECTION_ORDER.reduce((sum,
|
|
36
|
-
|
|
56
|
+
const totalItems = SECTION_ORDER.reduce((sum, s) => sum + groups[s].length, 0);
|
|
57
|
+
if (totalItems === 0) {
|
|
58
|
+
return (_jsx("div", { className: className, style: {
|
|
59
|
+
background: C.DARKEST,
|
|
60
|
+
border: `2px solid ${C.PANEL_EDGE}`,
|
|
61
|
+
borderRadius: 6,
|
|
62
|
+
padding: 16,
|
|
63
|
+
color: C.GREY,
|
|
64
|
+
fontSize: 11,
|
|
65
|
+
fontStyle: "italic",
|
|
66
|
+
textAlign: "center",
|
|
67
|
+
}, children: emptyMessage }));
|
|
68
|
+
}
|
|
69
|
+
return (_jsx("div", { className: className, style: {
|
|
37
70
|
display: "flex",
|
|
38
71
|
flexDirection: "column",
|
|
39
|
-
gap:
|
|
40
|
-
padding:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
background: "linear-gradient(180deg, rgba(28,26,52,0.96) 0%, rgba(18,16,36,0.96) 100%)",
|
|
45
|
-
boxShadow: "0 14px 32px rgba(0,0,0,0.16)",
|
|
46
|
-
}, children: [_jsxs("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12, flexWrap: "wrap" }, children: [_jsxs("div", { children: [_jsx("div", { style: { fontSize: 14, fontWeight: 700, marginBottom: 4 }, children: title }), _jsx("div", { style: { fontSize: 12, opacity: 0.74, maxWidth: 520 }, children: "Preview the visual targets described directly in your JAML without running a full search." })] }), _jsxs("div", { style: {
|
|
47
|
-
display: "inline-flex",
|
|
48
|
-
alignItems: "center",
|
|
49
|
-
gap: 6,
|
|
50
|
-
borderRadius: 999,
|
|
51
|
-
border: "1px solid rgba(141,125,255,0.3)",
|
|
52
|
-
background: "rgba(141,125,255,0.12)",
|
|
53
|
-
padding: "6px 10px",
|
|
54
|
-
fontSize: 11,
|
|
55
|
-
fontWeight: 700,
|
|
56
|
-
color: "#c8bcff",
|
|
57
|
-
letterSpacing: "0.04em",
|
|
58
|
-
textTransform: "uppercase",
|
|
59
|
-
}, children: [_jsx("span", { children: totalItems }), _jsx("span", { children: totalItems === 1 ? "visual target" : "visual targets" })] })] }), totalItems === 0 ? (_jsx("div", { style: {
|
|
60
|
-
border: "1px dashed rgba(152,152,192,0.28)",
|
|
61
|
-
borderRadius: 16,
|
|
62
|
-
padding: 16,
|
|
63
|
-
fontSize: 12,
|
|
64
|
-
opacity: 0.72,
|
|
65
|
-
background: "rgba(255,255,255,0.035)",
|
|
66
|
-
}, children: emptyMessage })) : null, SECTION_ORDER.map((section) => {
|
|
67
|
-
const items = groups[section];
|
|
68
|
-
if (items.length === 0)
|
|
69
|
-
return null;
|
|
70
|
-
const accent = SECTION_ACCENTS[section];
|
|
71
|
-
return (_jsxs("section", { style: {
|
|
72
|
-
display: "flex",
|
|
73
|
-
flexDirection: "column",
|
|
74
|
-
gap: 10,
|
|
75
|
-
borderRadius: 18,
|
|
76
|
-
border: `1px solid ${accent.border}`,
|
|
77
|
-
background: `linear-gradient(180deg, ${accent.panel} 0%, rgba(255,255,255,0.02) 100%)`,
|
|
78
|
-
padding: 12,
|
|
79
|
-
}, children: [_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [_jsx("div", { style: {
|
|
80
|
-
width: 6,
|
|
81
|
-
height: 18,
|
|
82
|
-
borderRadius: 999,
|
|
83
|
-
background: accent.color,
|
|
84
|
-
} }), _jsx("div", { style: { fontSize: 12, fontWeight: 700, color: accent.color }, children: SECTION_LABELS[section] }), _jsx("div", { style: {
|
|
85
|
-
marginLeft: "auto",
|
|
86
|
-
borderRadius: 999,
|
|
87
|
-
padding: "3px 8px",
|
|
88
|
-
fontSize: 10,
|
|
89
|
-
fontWeight: 700,
|
|
90
|
-
color: accent.color,
|
|
91
|
-
background: "rgba(255,255,255,0.04)",
|
|
92
|
-
}, children: items.length })] }), _jsx("div", { style: {
|
|
93
|
-
display: "flex",
|
|
94
|
-
flexWrap: "wrap",
|
|
95
|
-
gap: 12,
|
|
96
|
-
}, children: items.map((item) => (_jsxs("div", { style: {
|
|
97
|
-
display: "flex",
|
|
98
|
-
flexDirection: "column",
|
|
99
|
-
alignItems: "center",
|
|
100
|
-
gap: 8,
|
|
101
|
-
minWidth: 96,
|
|
102
|
-
padding: 12,
|
|
103
|
-
borderRadius: 16,
|
|
104
|
-
border: `1px solid ${accent.border}`,
|
|
105
|
-
background: "rgba(10,10,20,0.24)",
|
|
106
|
-
boxShadow: "inset 0 1px 0 rgba(255,255,255,0.04)",
|
|
107
|
-
}, title: `${item.clauseKey}: ${item.value}`, children: [_jsx("div", { style: { minHeight: 72, display: "flex", alignItems: "center", justifyContent: "center" }, children: renderPreviewItem(item, cardScale, tagScale, bossScale) }), _jsx("div", { style: { fontSize: 11, textAlign: "center", lineHeight: 1.35, fontWeight: 600 }, children: item.value }), _jsx("div", { style: { fontSize: 10, opacity: 0.62, textTransform: "uppercase", letterSpacing: "0.06em" }, children: item.clauseKey })] }, item.id))) })] }, section));
|
|
108
|
-
}), _jsx("div", { style: {
|
|
109
|
-
borderRadius: 16,
|
|
110
|
-
border: "1px dashed rgba(141,125,255,0.28)",
|
|
111
|
-
background: "rgba(141,125,255,0.08)",
|
|
112
|
-
padding: 14,
|
|
113
|
-
fontSize: 11,
|
|
114
|
-
lineHeight: 1.5,
|
|
115
|
-
opacity: 0.84,
|
|
116
|
-
}, children: "This preview shows direct visual targets that can be read from the JAML text itself. Advanced scoring logic, positional constraints, nested groups, and runtime-only search behavior are not fully represented here yet." })] }));
|
|
72
|
+
gap: 10,
|
|
73
|
+
padding: 10,
|
|
74
|
+
background: C.DARKEST,
|
|
75
|
+
color: C.WHITE,
|
|
76
|
+
}, children: SECTION_ORDER.map((section) => (_jsx(ZoneRail, { zone: section, items: groups[section] }, section))) }));
|
|
117
77
|
}
|
|
@@ -1,52 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { resolveJamlAssetUrl } from '../assets.js';
|
|
4
|
+
import { RANK_MAP, SUIT_MAP, ENHANCER_MAP, SEAL_MAP, EDITION_MAP } from '../sprites/spriteData.js';
|
|
4
5
|
function cn(...classes) { return classes.filter(Boolean).join(" "); }
|
|
5
6
|
const CARD_WIDTH = 71;
|
|
6
7
|
const CARD_HEIGHT = 95;
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
'Ace': 0, 'A': 0,
|
|
10
|
-
'2': 1, '3': 2, '4': 3, '5': 4, '6': 5, '7': 6, '8': 7, '9': 8,
|
|
11
|
-
'10': 9,
|
|
12
|
-
'Jack': 10, 'J': 10,
|
|
13
|
-
'Queen': 11, 'Q': 11,
|
|
14
|
-
'King': 12, 'K': 12,
|
|
15
|
-
};
|
|
16
|
-
const SUIT_TO_ROW = {
|
|
17
|
-
'Spades': 0, 'spades': 0,
|
|
18
|
-
'Hearts': 1, 'hearts': 1,
|
|
19
|
-
'Clubs': 2, 'clubs': 2,
|
|
20
|
-
'Diamonds': 3, 'diamonds': 3,
|
|
21
|
-
};
|
|
22
|
-
// Enhancers.png is 7 columns x 5 rows
|
|
23
|
-
// Row 0: Base, Bonus, Mult, Wild, Glass, Steel, Stone
|
|
24
|
-
// Row 1: Gold, Lucky, (seals start)
|
|
25
|
-
const ENHANCEMENT_TO_POS = {
|
|
26
|
-
'bonus': { x: 1, y: 0 },
|
|
27
|
-
'mult': { x: 2, y: 0 },
|
|
28
|
-
'wild': { x: 3, y: 0 },
|
|
29
|
-
'glass': { x: 4, y: 0 },
|
|
30
|
-
'steel': { x: 5, y: 0 },
|
|
31
|
-
'stone': { x: 6, y: 0 },
|
|
32
|
-
'gold': { x: 0, y: 1 },
|
|
33
|
-
'lucky': { x: 1, y: 1 },
|
|
34
|
-
};
|
|
35
|
-
const SEAL_TO_POS = {
|
|
36
|
-
'gold': { x: 2, y: 1 },
|
|
37
|
-
'red': { x: 3, y: 1 },
|
|
38
|
-
'blue': { x: 4, y: 1 },
|
|
39
|
-
'purple': { x: 5, y: 1 },
|
|
40
|
-
};
|
|
41
|
-
const EDITION_TO_POS = {
|
|
42
|
-
'Foil': { x: 0, y: 0 },
|
|
43
|
-
'Holographic': { x: 1, y: 0 },
|
|
44
|
-
'Polychrome': { x: 2, y: 0 },
|
|
45
|
-
'Negative': { x: 3, y: 0 },
|
|
46
|
-
};
|
|
8
|
+
const RANK_ALIAS = { A: 'Ace', K: 'King', Q: 'Queen', J: 'Jack' };
|
|
9
|
+
const pascal = (s) => s[0].toUpperCase() + s.slice(1).toLowerCase();
|
|
47
10
|
export function RealPlayingCard({ suit, rank, enhancement, seal, edition, className, size = 71, style }) {
|
|
48
|
-
const
|
|
49
|
-
const
|
|
11
|
+
const rankKey = RANK_ALIAS[rank] ?? rank;
|
|
12
|
+
const suitKey = pascal(suit);
|
|
13
|
+
const col = RANK_MAP[rankKey];
|
|
14
|
+
const row = SUIT_MAP[suitKey];
|
|
50
15
|
if (col === undefined || row === undefined) {
|
|
51
16
|
console.warn(`Invalid card: ${rank} of ${suit}`);
|
|
52
17
|
return null;
|
|
@@ -56,18 +21,18 @@ export function RealPlayingCard({ suit, rank, enhancement, seal, edition, classN
|
|
|
56
21
|
// Base card position
|
|
57
22
|
const bgX = -col * CARD_WIDTH;
|
|
58
23
|
const bgY = -row * CARD_HEIGHT;
|
|
59
|
-
// Enhancement background (if any)
|
|
60
|
-
const enhPos = enhancement ?
|
|
24
|
+
// Enhancement background (if any) — ENHANCER_MAP is PascalCase, prop is lowercase
|
|
25
|
+
const enhPos = enhancement ? ENHANCER_MAP[pascal(enhancement)] ?? { x: 0, y: 0 } : { x: 0, y: 0 };
|
|
61
26
|
const enhBgX = -enhPos.x * CARD_WIDTH;
|
|
62
27
|
const enhBgY = -enhPos.y * CARD_HEIGHT;
|
|
63
|
-
// Seal overlay
|
|
64
|
-
const sealPos = seal ?
|
|
28
|
+
// Seal overlay — SEAL_MAP is keyed by "Gold"/"Red"/"Blue"/"Purple"
|
|
29
|
+
const sealPos = seal ? SEAL_MAP[pascal(seal)] ?? null : null;
|
|
65
30
|
const sealBgX = sealPos ? -sealPos.x * CARD_WIDTH : 0;
|
|
66
31
|
const sealBgY = sealPos ? -sealPos.y * CARD_HEIGHT : 0;
|
|
67
|
-
// Edition overlay
|
|
68
|
-
const
|
|
69
|
-
const editionBgX =
|
|
70
|
-
const editionBgY =
|
|
32
|
+
// Edition overlay — EDITION_MAP gives column index on 5-wide editions sheet
|
|
33
|
+
const editionCol = edition ? EDITION_MAP[edition] : undefined;
|
|
34
|
+
const editionBgX = editionCol !== undefined ? -editionCol * CARD_WIDTH : 0;
|
|
35
|
+
const editionBgY = 0;
|
|
71
36
|
const isNegative = edition === 'Negative';
|
|
72
37
|
const baseFilter = isNegative ? 'invert(0.94)' : 'none';
|
|
73
38
|
const enhancersUrl = resolveJamlAssetUrl('enhancers');
|