jaml-ui 0.24.20 → 0.25.2

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.
Files changed (233) hide show
  1. package/README.md +0 -13
  2. package/assets/WeeJokerExampleDAilyGame.png +0 -0
  3. package/assets/balatro-stake-chips.png +0 -0
  4. package/dist/assets.d.ts +1 -2
  5. package/dist/chunks/Layer-BBPJFHfs.js +17 -0
  6. package/dist/chunks/Layer-BBPJFHfs.js.map +1 -0
  7. package/dist/chunks/assets-RWUiFSTc.js +37 -0
  8. package/dist/chunks/assets-RWUiFSTc.js.map +1 -0
  9. package/dist/chunks/motelyItemDecoder-CueyZ0XD.js +6039 -0
  10. package/dist/chunks/motelyItemDecoder-CueyZ0XD.js.map +1 -0
  11. package/dist/chunks/spriteMapper-CFjN0_TV.js +2415 -0
  12. package/dist/chunks/spriteMapper-CFjN0_TV.js.map +1 -0
  13. package/dist/chunks/tokens-B65Fzble.js +57 -0
  14. package/dist/chunks/tokens-B65Fzble.js.map +1 -0
  15. package/dist/chunks/ui-5cBy3zAm.js +1387 -0
  16. package/dist/chunks/ui-5cBy3zAm.js.map +1 -0
  17. package/dist/components/AnalyzerExplorer.d.ts +1 -1
  18. package/dist/components/CardFan.d.ts +1 -1
  19. package/dist/components/CardList.d.ts +1 -1
  20. package/dist/components/DeckSprite.d.ts +1 -1
  21. package/dist/components/JamlAestheticSelector.d.ts +1 -1
  22. package/dist/components/JamlAnalyzerFullscreen.d.ts +5 -5
  23. package/dist/components/JamlCurator.d.ts +1 -6
  24. package/dist/components/JamlIde.d.ts +5 -5
  25. package/dist/components/JamlSeedInput.d.ts +1 -1
  26. package/dist/components/JamlSpeedometer.d.ts +1 -1
  27. package/dist/components/MotelyVersionBadge.d.ts +1 -1
  28. package/dist/components/Standardcard.d.ts +1 -1
  29. package/dist/components/jamlMap/CategoryPicker.d.ts +3 -3
  30. package/dist/components/jamlMap/JamlMapEditor.d.ts +1 -1
  31. package/dist/components/jamlMap/JokerPicker.d.ts +1 -1
  32. package/dist/components/jamlMap/MysterySlot.d.ts +2 -2
  33. package/dist/components/jamlMap/index.d.ts +4 -4
  34. package/dist/core.d.ts +5 -5
  35. package/dist/core.js +27 -5
  36. package/dist/core.js.map +1 -0
  37. package/dist/decode/motelyItemDecoder.d.ts +0 -10
  38. package/dist/decode/motelySprite.d.ts +1 -1
  39. package/dist/fonts/m6x11plus.otf +0 -0
  40. package/dist/hooks/analyzerStreamRegistry.d.ts +2 -2
  41. package/dist/hooks/useAnalyzer.d.ts +3 -3
  42. package/dist/hooks/useSearch.d.ts +2 -2
  43. package/dist/index.d.ts +29 -31
  44. package/dist/index.js +16721 -34
  45. package/dist/index.js.map +1 -0
  46. package/dist/lib/const.d.ts +2 -2
  47. package/dist/lib/hooks/useDragScroll.d.ts +1 -1
  48. package/dist/lib/hooks/useJamlFilter.d.ts +2 -2
  49. package/dist/lib/hooks/useSeedAnalyzer.d.ts +2 -2
  50. package/dist/lib/utils.d.ts +1 -1
  51. package/dist/motely.d.ts +4 -3
  52. package/dist/motely.js +65 -3
  53. package/dist/motely.js.map +1 -0
  54. package/dist/motelyBoot.d.ts +2 -0
  55. package/dist/motelyDisplay.d.ts +0 -2
  56. package/dist/r3f/Card3D.d.ts +2 -2
  57. package/dist/r3f/JimboBillboard.d.ts +1 -1
  58. package/dist/r3f.js +235 -3
  59. package/dist/r3f.js.map +1 -0
  60. package/dist/render/CanvasRenderer.d.ts +1 -1
  61. package/dist/sprites/spriteData.d.ts +1 -6
  62. package/dist/sprites/spriteMapper.d.ts +1 -1
  63. package/dist/ui/JimboBadge.d.ts +1 -1
  64. package/dist/ui/JimboFloating.d.ts +1 -1
  65. package/dist/ui/JimboIconButton.d.ts +1 -1
  66. package/dist/ui/JimboSelect.d.ts +1 -1
  67. package/dist/ui/footer.d.ts +2 -3
  68. package/dist/ui/hooks.d.ts +1 -1
  69. package/dist/ui/ide/DeckSprite.d.ts +1 -1
  70. package/dist/ui/jimbo.css +2 -1856
  71. package/dist/ui/jimboApp.d.ts +1 -1
  72. package/dist/ui/jimboFilterBar.d.ts +1 -1
  73. package/dist/ui/jimboFlankNav.d.ts +1 -1
  74. package/dist/ui/jimboInfoCard.d.ts +1 -1
  75. package/dist/ui/jimboInset.d.ts +1 -1
  76. package/dist/ui/jimboStatGrid.d.ts +1 -1
  77. package/dist/ui/jimboText.d.ts +1 -1
  78. package/dist/ui/jimboTooltip.d.ts +2 -2
  79. package/dist/ui/mascot/SeedMascot.d.ts +2 -2
  80. package/dist/ui/panel.d.ts +1 -1
  81. package/dist/ui/radial/RadialBadge.d.ts +1 -2
  82. package/dist/ui/radial/RadialButton.d.ts +1 -2
  83. package/dist/ui/radial/RadialMenu.d.ts +2 -2
  84. package/dist/ui/radial/RadialPill.d.ts +1 -2
  85. package/dist/ui/radial/index.d.ts +16 -16
  86. package/dist/ui/radial/radialMenuStore.d.ts +1 -1
  87. package/dist/ui/showcase.d.ts +1 -1
  88. package/dist/ui/sprites.d.ts +2 -2
  89. package/dist/ui.d.ts +0 -1
  90. package/dist/ui.js +3 -36
  91. package/dist/utils/gameCardUtils.d.ts +1 -1
  92. package/dist/utils/jamlVisualFilter.d.ts +1 -7
  93. package/package.json +13 -25
  94. package/dist/assets.js +0 -48
  95. package/dist/components/AnalyzerExplorer.js +0 -391
  96. package/dist/components/CardFan.js +0 -80
  97. package/dist/components/CardList.js +0 -5
  98. package/dist/components/DeckSprite.js +0 -75
  99. package/dist/components/GameCard.js +0 -355
  100. package/dist/components/JamlAestheticSelector.js +0 -22
  101. package/dist/components/JamlAnalyzerFullscreen.js +0 -263
  102. package/dist/components/JamlCodeEditor.js +0 -137
  103. package/dist/components/JamlCurator.js +0 -64
  104. package/dist/components/JamlCurator.stories.d.ts +0 -6
  105. package/dist/components/JamlCurator.stories.js +0 -14
  106. package/dist/components/JamlIde.js +0 -193
  107. package/dist/components/JamlIdeToolbar.js +0 -23
  108. package/dist/components/JamlIdeVisual.js +0 -218
  109. package/dist/components/JamlMapPreview.js +0 -121
  110. package/dist/components/JamlSeedInput.js +0 -26
  111. package/dist/components/JamlSpeedometer.js +0 -70
  112. package/dist/components/Jimbolate.js +0 -17
  113. package/dist/components/MotelyVersionBadge.js +0 -19
  114. package/dist/components/PaginatedFilterBrowser.js +0 -54
  115. package/dist/components/RunConfigModal.js +0 -59
  116. package/dist/components/Standardcard.js +0 -80
  117. package/dist/components/jamlMap/CategoryPicker.js +0 -135
  118. package/dist/components/jamlMap/JamlMapEditor.js +0 -304
  119. package/dist/components/jamlMap/JamlMapEditor.stories.d.ts +0 -7
  120. package/dist/components/jamlMap/JamlMapEditor.stories.js +0 -26
  121. package/dist/components/jamlMap/JamlMapEditorDemo.d.ts +0 -8
  122. package/dist/components/jamlMap/JamlMapEditorDemo.js +0 -323
  123. package/dist/components/jamlMap/JokerPicker.js +0 -113
  124. package/dist/components/jamlMap/MysterySlot.js +0 -128
  125. package/dist/components/jamlMap/MysterySlot.stories.d.ts +0 -7
  126. package/dist/components/jamlMap/MysterySlot.stories.js +0 -31
  127. package/dist/components/jamlMap/index.js +0 -4
  128. package/dist/decode/motelyItemDecoder.js +0 -164
  129. package/dist/decode/motelySprite.js +0 -84
  130. package/dist/hooks/analyzerStreamRegistry.js +0 -96
  131. package/dist/hooks/searchWorker.d.ts +0 -1
  132. package/dist/hooks/searchWorker.js +0 -119
  133. package/dist/hooks/searchWorkerCode.d.ts +0 -1
  134. package/dist/hooks/searchWorkerCode.js +0 -85
  135. package/dist/hooks/useAnalyzer.js +0 -91
  136. package/dist/hooks/useIntersectionObserver.js +0 -52
  137. package/dist/hooks/useSearch.js +0 -161
  138. package/dist/hooks/useShopStream.js +0 -85
  139. package/dist/lib/SpriteMapper.js +0 -48
  140. package/dist/lib/cardParser.js +0 -67
  141. package/dist/lib/classes/BuyMetaData.js +0 -1
  142. package/dist/lib/config.js +0 -15
  143. package/dist/lib/const.js +0 -521
  144. package/dist/lib/data/constants.js +0 -14
  145. package/dist/lib/hooks/useDragScroll.js +0 -48
  146. package/dist/lib/hooks/useJamlFilter.js +0 -219
  147. package/dist/lib/hooks/useSeedAnalyzer.js +0 -50
  148. package/dist/lib/jaml/jamlCompletion.js +0 -13
  149. package/dist/lib/jaml/jamlData.js +0 -6
  150. package/dist/lib/jaml/jamlObjectives.js +0 -97
  151. package/dist/lib/jaml/jamlParser.js +0 -47
  152. package/dist/lib/jaml/jamlPresets.js +0 -61
  153. package/dist/lib/jaml/jamlSchema.js +0 -91
  154. package/dist/lib/parseDailyRitual.js +0 -70
  155. package/dist/lib/tts/getRevealPos.js +0 -16
  156. package/dist/lib/tts/splitTtsDisplay.js +0 -35
  157. package/dist/lib/types.js +0 -1
  158. package/dist/lib/utils.js +0 -5
  159. package/dist/motelyDisplay.js +0 -59
  160. package/dist/r3f/Card3D.js +0 -72
  161. package/dist/r3f/JimboBillboard.js +0 -32
  162. package/dist/r3f/JimboText3D.js +0 -8
  163. package/dist/render/CanvasRenderer.js +0 -11
  164. package/dist/render/Layer.js +0 -18
  165. package/dist/sprites/spriteData.js +0 -100
  166. package/dist/sprites/spriteMapper.js +0 -75
  167. package/dist/stories/Button.d.ts +0 -15
  168. package/dist/stories/Button.js +0 -7
  169. package/dist/stories/Button.stories.d.ts +0 -24
  170. package/dist/stories/Button.stories.js +0 -50
  171. package/dist/stories/Header.d.ts +0 -12
  172. package/dist/stories/Header.js +0 -4
  173. package/dist/stories/Header.stories.d.ts +0 -18
  174. package/dist/stories/Header.stories.js +0 -26
  175. package/dist/stories/Page.d.ts +0 -3
  176. package/dist/stories/Page.js +0 -8
  177. package/dist/stories/Page.stories.d.ts +0 -12
  178. package/dist/stories/Page.stories.js +0 -24
  179. package/dist/ui/Jimbo.stories.d.ts +0 -7
  180. package/dist/ui/Jimbo.stories.js +0 -28
  181. package/dist/ui/JimboBadge.js +0 -8
  182. package/dist/ui/JimboFloating.js +0 -17
  183. package/dist/ui/JimboIconButton.js +0 -28
  184. package/dist/ui/JimboInputModal.js +0 -66
  185. package/dist/ui/JimboSelect.js +0 -43
  186. package/dist/ui/JimboToggleList.js +0 -5
  187. package/dist/ui/PanelSplitter.js +0 -78
  188. package/dist/ui/codeBlock.js +0 -14
  189. package/dist/ui/footer.js +0 -20
  190. package/dist/ui/hooks.js +0 -634
  191. package/dist/ui/ide/AgnosticSeedCard.d.ts +0 -19
  192. package/dist/ui/ide/AgnosticSeedCard.js +0 -48
  193. package/dist/ui/ide/DeckSprite.js +0 -2
  194. package/dist/ui/ide/JamlBuilder.d.ts +0 -1
  195. package/dist/ui/ide/JamlBuilder.js +0 -112
  196. package/dist/ui/ide/JamlEditor.js +0 -486
  197. package/dist/ui/ide/JamlEditorMonaco.d.ts +0 -8
  198. package/dist/ui/ide/JamlEditorMonaco.js +0 -78
  199. package/dist/ui/ide/WasmStatus.d.ts +0 -1
  200. package/dist/ui/ide/WasmStatus.js +0 -42
  201. package/dist/ui/jimboApp.js +0 -15
  202. package/dist/ui/jimboBackground.js +0 -27
  203. package/dist/ui/jimboCopyRow.js +0 -18
  204. package/dist/ui/jimboFilterBar.js +0 -16
  205. package/dist/ui/jimboFlankNav.js +0 -18
  206. package/dist/ui/jimboInfoCard.js +0 -26
  207. package/dist/ui/jimboInset.js +0 -9
  208. package/dist/ui/jimboSectionHeader.js +0 -9
  209. package/dist/ui/jimboStatGrid.js +0 -9
  210. package/dist/ui/jimboTabs.js +0 -22
  211. package/dist/ui/jimboText.js +0 -33
  212. package/dist/ui/jimboTooltip.js +0 -39
  213. package/dist/ui/jimboWordmark.js +0 -9
  214. package/dist/ui/mascot/JammySpeechBox.js +0 -30
  215. package/dist/ui/mascot/SeedMascot.js +0 -17
  216. package/dist/ui/mascot/index.js +0 -3
  217. package/dist/ui/mascot/menuConfig.js +0 -12
  218. package/dist/ui/panel.js +0 -24
  219. package/dist/ui/radial/RadialBadge.js +0 -43
  220. package/dist/ui/radial/RadialBreadcrumb.js +0 -18
  221. package/dist/ui/radial/RadialButton.js +0 -102
  222. package/dist/ui/radial/RadialMenu.js +0 -168
  223. package/dist/ui/radial/RadialPill.js +0 -15
  224. package/dist/ui/radial/index.js +0 -18
  225. package/dist/ui/radial/radialMenuStore.js +0 -122
  226. package/dist/ui/radial/radialMenuViewport.js +0 -59
  227. package/dist/ui/radial/useRadialMenu.js +0 -107
  228. package/dist/ui/showcase.js +0 -20
  229. package/dist/ui/sprites.js +0 -77
  230. package/dist/ui/tokens.js +0 -64
  231. package/dist/utils/gameCardUtils.js +0 -15
  232. package/dist/utils/jamlMapPreview.js +0 -106
  233. package/dist/utils/jamlVisualFilter.js +0 -210
@@ -1,391 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useEffect, useRef } from "react";
4
- import { useAnteTracker } from "../ui/hooks.js";
5
- import { JamlBoss, JamlGameCard, JamlTag, JamlVoucher, resolveAnalyzerShopItem, } from "./GameCard.js";
6
- import { JamlMapPreview } from "./JamlMapPreview.js";
7
- export function AnalyzerExplorer({ antes, highlights = [], visibleAntes, totalAntes, className = "", jaml, tallyColumns, tallyLabels, }) {
8
- const { currentAnte, scrollRef, scrollToAnte, registerAnteRef } = useAnteTracker(antes, {
9
- threshold: [0.45, 0.72, 0.9],
10
- });
11
- const highlightRefs = useRef(new Map());
12
- useEffect(() => {
13
- const activeHighlight = highlights.find((highlight) => highlight.ante === currentAnte);
14
- if (!activeHighlight) {
15
- return;
16
- }
17
- const element = highlightRefs.current.get(activeHighlight.id);
18
- element?.scrollIntoView({
19
- behavior: "smooth",
20
- inline: "center",
21
- block: "nearest",
22
- });
23
- }, [currentAnte, highlights]);
24
- const currentAnteIndex = antes.findIndex((ante) => ante.ante === currentAnte);
25
- const previousAnte = currentAnteIndex > 0 ? antes[currentAnteIndex - 1]?.ante ?? null : null;
26
- const nextAnte = currentAnteIndex >= 0 && currentAnteIndex < antes.length - 1 ? antes[currentAnteIndex + 1]?.ante ?? null : null;
27
- const shownAntes = visibleAntes ?? antes.length;
28
- const availableAntes = totalAntes ?? shownAntes;
29
- return (_jsxs("div", { className: className, style: styles.root, children: [jaml ? (_jsxs("section", { style: styles.jamlSection, children: [_jsx("div", { style: styles.highlightHeader, children: _jsx("span", { style: styles.highlightTitle, children: "JAML Map" }) }), _jsx(JamlMapPreview, { jaml: jaml, tallyColumns: tallyColumns?.[0], tallyLabels: tallyLabels, compact: true })] })) : null, highlights.length > 0 ? (_jsxs("section", { style: styles.highlightSection, children: [_jsxs("div", { style: styles.highlightHeader, children: [_jsx("span", { style: styles.highlightTitle, children: "Highlights" }), _jsx("span", { style: styles.highlightSubtitle, children: "Swipe, tap, jump" })] }), _jsx("div", { style: styles.highlightRail, children: highlights.map((highlight) => {
30
- const isActive = highlight.ante === currentAnte;
31
- return (_jsxs("button", { ref: (element) => {
32
- if (element) {
33
- highlightRefs.current.set(highlight.id, element);
34
- }
35
- else {
36
- highlightRefs.current.delete(highlight.id);
37
- }
38
- }, type: "button", onClick: () => scrollToAnte(highlight.ante), style: isActive ? styles.highlightCardActive : styles.highlightCard, children: [_jsx("div", { style: styles.highlightVisual, children: renderHighlightVisual(highlight) }), _jsxs("div", { style: styles.highlightMeta, children: [_jsxs("span", { style: styles.highlightAnte, children: ["Ante ", highlight.ante] }), _jsx("span", { style: styles.highlightLabel, children: highlight.title }), highlight.subtitle ? (_jsx("span", { style: styles.highlightDescription, children: highlight.subtitle })) : null, _jsx(BadgeRow, { badges: highlight.badges, desired: highlight.desired })] })] }, highlight.id));
39
- }) })] })) : null, _jsxs("div", { style: styles.navBar, children: [_jsx("button", { type: "button", onClick: () => previousAnte !== null && scrollToAnte(previousAnte), disabled: previousAnte === null, style: {
40
- ...styles.navButton,
41
- opacity: previousAnte !== null ? 1 : 0.25,
42
- }, children: "\u25B2" }), _jsxs("div", { style: styles.navLabel, children: ["Ante ", currentAnte, _jsxs("span", { style: styles.navSubLabel, children: ["of ", shownAntes, availableAntes > shownAntes ? ` / ${availableAntes}` : ""] })] }), _jsx("button", { type: "button", onClick: () => nextAnte !== null && scrollToAnte(nextAnte), disabled: nextAnte === null, style: {
43
- ...styles.navButton,
44
- opacity: nextAnte !== null ? 1 : 0.25,
45
- }, children: "\u25BC" })] }), _jsx("div", { ref: scrollRef, style: styles.scrollRegion, children: antes.map((ante) => (_jsx("div", { "data-ante": ante.ante, ref: (element) => registerAnteRef(ante.ante, element), style: styles.antePage, children: _jsx(AnteSection, { ante: ante }) }, ante.ante))) })] }));
46
- }
47
- function AnteSection({ ante }) {
48
- return (_jsxs("section", { style: styles.anteSection, children: [_jsxs("div", { style: styles.anteHeader, children: [_jsxs("span", { style: styles.anteHeading, children: ["Ante ", ante.ante] }), ante.boss ? (_jsxs("div", { style: styles.bossRow, children: [_jsx(JamlBoss, { bossName: ante.boss, scale: 0.62 }), _jsx("span", { style: styles.bossName, children: ante.boss })] })) : null] }), ante.smallBlindTag || ante.bigBlindTag ? (_jsxs(AnalyzerRow, { label: "Tags", children: [ante.smallBlindTag ? (_jsx(CompactCard, { label: "Small", visual: _jsx(JamlTag, { tagName: ante.smallBlindTag, scale: 0.58, hoverTilt: true }), text: ante.smallBlindTag })) : null, ante.bigBlindTag ? (_jsx(CompactCard, { label: "Big", visual: _jsx(JamlTag, { tagName: ante.bigBlindTag, scale: 0.58, hoverTilt: true }), text: ante.bigBlindTag })) : null] })) : null, ante.voucher ? (_jsx(AnalyzerRow, { label: "Voucher", children: _jsx(CompactCard, { visual: _jsx(JamlVoucher, { voucherName: ante.voucher, scale: 0.58, hoverTilt: true }), text: ante.voucher }) })) : null, ante.shop && ante.shop.length > 0 ? (_jsx(AnalyzerRow, { label: "Shop", dense: true, children: ante.shop.map((item) => (_jsx(ResolvedItemCard, { item: item }, `${ante.ante}-${item.id}-${item.name}`))) })) : null, ante.packs && ante.packs.length > 0 ? (_jsx(AnalyzerRow, { label: "Packs", children: ante.packs.map((pack) => (_jsx("div", { style: styles.packChip, children: pack }, `${ante.ante}-${pack}`))) })) : null, ante.facts && ante.facts.length > 0 ? (_jsx(AnalyzerRow, { label: "Facts", children: ante.facts.map((fact) => (_jsxs("div", { style: styles.factCard, children: [_jsx("span", { style: styles.factLabel, children: fact.label }), _jsx("span", { style: styles.factValue, children: fact.value })] }, `${ante.ante}-${fact.label}-${fact.value}`))) })) : null] }));
49
- }
50
- function AnalyzerRow({ label, children, dense = false, }) {
51
- return (_jsxs("div", { style: styles.row, children: [_jsx("div", { style: styles.rowLabel, children: label }), _jsx("div", { style: dense ? styles.denseGrid : styles.cardFlow, children: children })] }));
52
- }
53
- function CompactCard({ label, visual, text, }) {
54
- return (_jsxs("div", { style: styles.compactCard, children: [label ? _jsx("span", { style: styles.compactLabel, children: label }) : null, visual, _jsx("span", { style: styles.itemText, children: text })] }));
55
- }
56
- function ResolvedItemCard({ item }) {
57
- const resolved = resolveAnalyzerShopItem(item, 0.58);
58
- const wrapperStyle = item.desired ? styles.itemCardDesired : styles.itemCard;
59
- if (resolved.kind === "joker" || resolved.kind === "consumable" || resolved.kind === "playing") {
60
- return (_jsxs("div", { style: wrapperStyle, children: [_jsx(JamlGameCard, { card: resolved.card, type: resolved.type, hoverTilt: true }), _jsx("span", { style: styles.itemText, children: item.name }), _jsx(BadgeRow, { badges: item.badges, desired: item.desired }), item.detail ? _jsx("span", { style: styles.itemDetail, children: item.detail }) : null] }));
61
- }
62
- if (resolved.kind === "voucher") {
63
- return (_jsxs("div", { style: wrapperStyle, children: [_jsx(JamlVoucher, { voucherName: resolved.voucherName, scale: 0.58, hoverTilt: true }), _jsx("span", { style: styles.itemText, children: item.name }), _jsx(BadgeRow, { badges: item.badges, desired: item.desired }), item.detail ? _jsx("span", { style: styles.itemDetail, children: item.detail }) : null] }));
64
- }
65
- return (_jsxs("div", { style: wrapperStyle, children: [_jsx("div", { style: styles.packChip, children: item.name }), _jsx(BadgeRow, { badges: item.badges, desired: item.desired }), item.detail ? _jsx("span", { style: styles.itemDetail, children: item.detail }) : null] }));
66
- }
67
- function BadgeRow({ badges, desired = false }) {
68
- const combinedBadges = desired
69
- ? [{ label: "desired", tone: "accent" }, ...(badges ?? [])]
70
- : (badges ?? []);
71
- if (combinedBadges.length === 0) {
72
- return null;
73
- }
74
- return (_jsx("div", { style: styles.badgeRow, children: combinedBadges.map((badge) => {
75
- const badgeStyle = badge.tone === "accent"
76
- ? styles.badgeAccent
77
- : badge.tone === "muted"
78
- ? styles.badgeMuted
79
- : styles.badge;
80
- return (_jsx("span", { style: badgeStyle, children: badge.label }, `${badge.label}-${badge.tone ?? "default"}`));
81
- }) }));
82
- }
83
- function renderHighlightVisual(highlight) {
84
- if (highlight.item) {
85
- return _jsx(ResolvedItemCard, { item: highlight.item });
86
- }
87
- if (highlight.boss) {
88
- return _jsx(JamlBoss, { bossName: highlight.boss, scale: 0.92, hoverTilt: true });
89
- }
90
- if (highlight.voucher) {
91
- return _jsx(JamlVoucher, { voucherName: highlight.voucher, scale: 0.92, hoverTilt: true });
92
- }
93
- if (highlight.tag) {
94
- return _jsx(JamlTag, { tagName: highlight.tag, scale: 0.92, hoverTilt: true });
95
- }
96
- return _jsx("div", { style: styles.packChip, children: highlight.title });
97
- }
98
- const styles = {
99
- root: {
100
- display: "flex",
101
- flexDirection: "column",
102
- height: "100%",
103
- minHeight: 0,
104
- fontFamily: "m6x11plus, monospace",
105
- },
106
- highlightSection: {
107
- padding: "6px 8px",
108
- borderBottom: "1px solid #1a1a34",
109
- background: "#0f0f22",
110
- },
111
- jamlSection: {
112
- padding: "6px 8px",
113
- borderBottom: "1px solid #1a1a34",
114
- background: "#0f0f22",
115
- },
116
- highlightHeader: {
117
- display: "flex",
118
- alignItems: "center",
119
- justifyContent: "space-between",
120
- gap: 8,
121
- marginBottom: 4,
122
- },
123
- highlightTitle: {
124
- fontSize: 12,
125
- color: "#6f6fa1",
126
- letterSpacing: "0.05em",
127
- },
128
- highlightSubtitle: {
129
- fontSize: 11,
130
- color: "#6f6fa1",
131
- },
132
- highlightRail: {
133
- display: "flex",
134
- gap: 6,
135
- overflowX: "auto",
136
- paddingBottom: 2,
137
- scrollSnapType: "x mandatory",
138
- },
139
- highlightCard: {
140
- minWidth: 120,
141
- maxWidth: 120,
142
- display: "flex",
143
- flexDirection: "column",
144
- gap: 4,
145
- padding: 4,
146
- borderRadius: 8,
147
- border: "1px solid #2a2a55",
148
- background: "#131326",
149
- scrollSnapAlign: "center",
150
- cursor: "pointer",
151
- },
152
- highlightCardActive: {
153
- minWidth: 120,
154
- maxWidth: 120,
155
- display: "flex",
156
- flexDirection: "column",
157
- gap: 4,
158
- padding: 4,
159
- borderRadius: 8,
160
- border: "1px solid rgba(245,200,66,0.45)",
161
- background: "rgba(245,200,66,0.08)",
162
- scrollSnapAlign: "center",
163
- cursor: "pointer",
164
- },
165
- highlightVisual: {
166
- display: "flex",
167
- justifyContent: "center",
168
- alignItems: "flex-start",
169
- minHeight: 80,
170
- },
171
- highlightMeta: {
172
- display: "flex",
173
- flexDirection: "column",
174
- gap: 2,
175
- alignItems: "flex-start",
176
- },
177
- highlightAnte: {
178
- fontSize: 11,
179
- color: "#a855f7",
180
- letterSpacing: "0.05em",
181
- },
182
- highlightLabel: {
183
- fontSize: 13,
184
- color: "#ececff",
185
- lineHeight: 1.2,
186
- textAlign: "left",
187
- },
188
- highlightDescription: {
189
- fontSize: 11,
190
- color: "#8e8eb6",
191
- lineHeight: 1.2,
192
- textAlign: "left",
193
- },
194
- navBar: {
195
- display: "flex",
196
- alignItems: "center",
197
- justifyContent: "center",
198
- gap: 8,
199
- padding: "4px 8px",
200
- background: "#0f0f22",
201
- borderBottom: "1px solid #1a1a34",
202
- },
203
- navButton: {
204
- background: "none",
205
- border: "1px solid #2a2a55",
206
- borderRadius: 4,
207
- color: "#9898c0",
208
- fontSize: 14,
209
- padding: "2px 8px",
210
- cursor: "pointer",
211
- },
212
- navLabel: {
213
- fontSize: 13,
214
- color: "#a855f7",
215
- letterSpacing: "0.05em",
216
- minWidth: 110,
217
- textAlign: "center",
218
- },
219
- navSubLabel: {
220
- color: "#5a5a88",
221
- letterSpacing: "normal",
222
- fontSize: 11,
223
- marginLeft: 4,
224
- },
225
- scrollRegion: {
226
- flex: 1,
227
- overflowY: "auto",
228
- overflowX: "hidden",
229
- scrollSnapType: "y mandatory",
230
- scrollBehavior: "smooth",
231
- },
232
- antePage: {
233
- scrollSnapAlign: "start",
234
- scrollSnapStop: "always",
235
- minHeight: "100%",
236
- boxSizing: "border-box",
237
- paddingBottom: 8,
238
- borderBottom: "1px solid #1a1a34",
239
- },
240
- anteSection: {
241
- paddingBottom: 4,
242
- },
243
- anteHeader: {
244
- display: "flex",
245
- alignItems: "center",
246
- gap: 8,
247
- padding: "6px 8px",
248
- },
249
- anteHeading: {
250
- fontSize: 14,
251
- color: "#a855f7",
252
- letterSpacing: "0.05em",
253
- },
254
- bossRow: {
255
- display: "flex",
256
- alignItems: "center",
257
- gap: 4,
258
- },
259
- bossName: {
260
- fontSize: 14,
261
- color: "#e84040",
262
- },
263
- row: {
264
- padding: "2px 8px 4px",
265
- },
266
- rowLabel: {
267
- fontSize: 11,
268
- color: "#5a5a88",
269
- letterSpacing: "0.05em",
270
- marginBottom: 4,
271
- },
272
- cardFlow: {
273
- display: "flex",
274
- flexWrap: "wrap",
275
- gap: 6,
276
- alignItems: "flex-start",
277
- },
278
- denseGrid: {
279
- display: "grid",
280
- gridTemplateColumns: "repeat(auto-fit, minmax(70px, 1fr))",
281
- gap: 6,
282
- alignItems: "start",
283
- },
284
- compactCard: {
285
- display: "flex",
286
- flexDirection: "column",
287
- alignItems: "center",
288
- gap: 2,
289
- minWidth: 50,
290
- },
291
- compactLabel: {
292
- padding: "1px 4px",
293
- borderRadius: 999,
294
- background: "#18182e",
295
- color: "#7f7fa7",
296
- border: "1px solid #2a2a55",
297
- fontSize: 11,
298
- },
299
- itemCard: {
300
- display: "flex",
301
- flexDirection: "column",
302
- alignItems: "center",
303
- gap: 2,
304
- width: "100%",
305
- minWidth: 0,
306
- },
307
- itemCardDesired: {
308
- display: "flex",
309
- flexDirection: "column",
310
- alignItems: "center",
311
- gap: 2,
312
- width: "100%",
313
- minWidth: 0,
314
- padding: "2px",
315
- borderRadius: 8,
316
- border: "1px solid rgba(245,200,66,0.6)",
317
- background: "rgba(245,200,66,0.15)",
318
- },
319
- itemText: {
320
- fontSize: 11,
321
- color: "#8e8eb6",
322
- textAlign: "center",
323
- lineHeight: 1.1,
324
- maxWidth: 84,
325
- overflow: "hidden",
326
- textOverflow: "ellipsis",
327
- whiteSpace: "nowrap",
328
- },
329
- itemDetail: {
330
- fontSize: 11,
331
- color: "#d8d8ea",
332
- textAlign: "center",
333
- lineHeight: 1.1,
334
- },
335
- badgeRow: {
336
- display: "flex",
337
- flexWrap: "wrap",
338
- gap: 2,
339
- justifyContent: "center",
340
- },
341
- badge: {
342
- padding: "1px 4px",
343
- borderRadius: 999,
344
- background: "#202043",
345
- color: "#c7c7ef",
346
- border: "1px solid #35356d",
347
- fontSize: 11,
348
- },
349
- badgeAccent: {
350
- padding: "1px 4px",
351
- borderRadius: 999,
352
- background: "rgba(245,200,66,0.2)",
353
- color: "#f5c842",
354
- border: "1px solid rgba(245,200,66,0.35)",
355
- fontSize: 11,
356
- },
357
- badgeMuted: {
358
- padding: "1px 4px",
359
- borderRadius: 999,
360
- background: "#18182e",
361
- color: "#7f7fa7",
362
- border: "1px solid #2a2a55",
363
- fontSize: 11,
364
- },
365
- packChip: {
366
- fontSize: 13,
367
- color: "#5a5a88",
368
- background: "#131326",
369
- border: "1px solid #2a2a55",
370
- borderRadius: 4,
371
- padding: "2px 6px",
372
- },
373
- factCard: {
374
- display: "flex",
375
- flexDirection: "column",
376
- gap: 1,
377
- minWidth: 90,
378
- padding: "4px 6px",
379
- borderRadius: 6,
380
- background: "#131326",
381
- border: "1px solid #2a2a55",
382
- },
383
- factLabel: {
384
- fontSize: 11,
385
- color: "#7f7fa7",
386
- },
387
- factValue: {
388
- fontSize: 13,
389
- color: "#ececff",
390
- },
391
- };
@@ -1,80 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { RealStandardcard } from './Standardcard.js';
4
- import { JimboColorOption } from '../ui/tokens.js';
5
- import { JimboText } from '../ui/jimboText.js';
6
- const RANK_MAP = {
7
- '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9', '10': '10',
8
- J: 'Jack', Q: 'Queen', K: 'King', A: 'Ace',
9
- };
10
- const SUIT_MAP = {
11
- H: 'Hearts', C: 'Clubs', D: 'Diamonds', S: 'Spades',
12
- };
13
- function parseJamlCard(input) {
14
- const [r, s] = input.split('_');
15
- return {
16
- rank: RANK_MAP[r] ?? '2',
17
- suit: SUIT_MAP[s] ?? 'Clubs',
18
- };
19
- }
20
- /**
21
- * Parabolic card fan with rotation + arc overlap. Ported from weejoker's
22
- * CardFan.tsx. Uses mathematical transforms (inline style, not Tailwind)
23
- * to produce the authentic Balatro spread: cards overlap toward the
24
- * center, tilt outward, sit higher at the edges.
25
- *
26
- * Sizing, overlap, and max rotation auto-scale with card count so full
27
- * 52-card decks render cleanly and tiny 3-card hands look deliberate.
28
- */
29
- export function CardFan({ count = 0, cards, className = '', style, label, showLabel = true }) {
30
- const displayCount = cards ? cards.length : count;
31
- const cardSize = displayCount > 40 ? 46
32
- : displayCount > 30 ? 32
33
- : displayCount > 12 ? 36
34
- : displayCount > 8 ? 42
35
- : displayCount > 5 ? 48
36
- : 54;
37
- const overlap = displayCount > 40 ? 0.88
38
- : displayCount > 30 ? 0.85
39
- : displayCount > 15 ? 0.75
40
- : displayCount > 6 ? 0.60
41
- : 0.45;
42
- const cardSpacing = cardSize * (1 - overlap);
43
- const maxRotation = displayCount > 40 ? 40
44
- : displayCount > 20 ? 30
45
- : displayCount > 10 ? 15
46
- : 25;
47
- const cardsHeight = 120;
48
- return (_jsxs("div", { className: className, style: {
49
- display: 'flex',
50
- flexDirection: 'column',
51
- alignItems: 'center',
52
- gap: 4,
53
- ...style,
54
- }, children: [_jsx("div", { style: { position: 'relative', width: '100%', height: cardsHeight }, children: displayCount > 0 ? (Array.from({ length: displayCount }).map((_, i) => {
55
- const centerIndex = (displayCount - 1) / 2;
56
- const offset = i - centerIndex;
57
- const xPos = offset * cardSpacing;
58
- // Parabolic lift — outer cards sit higher than center (bowed upward)
59
- const yOffset = Math.pow(Math.abs(offset / (centerIndex || 1)), 2) * (displayCount > 20 ? 20 : 10);
60
- const rotation = (offset / (centerIndex || 1)) * maxRotation;
61
- const parsed = cards ? parseJamlCard(cards[i]) : { rank: '2', suit: 'Clubs' };
62
- return (_jsx("div", { style: {
63
- position: 'absolute',
64
- left: '50%',
65
- bottom: 0,
66
- transform: `translateX(calc(-50% + ${xPos}px)) translateY(${yOffset}px) rotate(${rotation}deg)`,
67
- transformOrigin: 'bottom center',
68
- zIndex: i,
69
- }, children: _jsx(RealStandardcard, { rank: parsed.rank, suit: parsed.suit, size: cardSize, style: { filter: `drop-shadow(0 2px 3px ${JimboColorOption.BLACK}66)` } }) }, i));
70
- })) : (_jsx("div", { style: {
71
- display: 'flex',
72
- alignItems: 'center',
73
- justifyContent: 'center',
74
- width: '100%',
75
- height: '100%',
76
- background: `${JimboColorOption.WHITE}0d`,
77
- border: `1px solid ${JimboColorOption.WHITE}0d`,
78
- borderRadius: 8,
79
- }, children: _jsx(JimboText, { size: "xs", uppercase: true, tone: "grey", children: "Deck Empty" }) })) }), label && showLabel ? _jsx(JimboText, { size: "xs", uppercase: true, tone: "grey", children: label }) : null] }));
80
- }
@@ -1,5 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- export function CardList({ title, subtitle, children, className = "" }) {
4
- return (_jsxs("div", { className: className, children: [_jsxs("div", { style: { marginBottom: 4 }, children: [_jsx("span", { style: { fontWeight: 600, fontSize: 12 }, children: title }), subtitle && _jsx("span", { style: { fontSize: 10, opacity: 0.6, marginLeft: 4 }, children: subtitle })] }), _jsx("div", { style: { display: "flex", gap: 4, overflowX: "auto", paddingBottom: 4 }, children: children })] }));
5
- }
@@ -1,75 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { resolveJamlAssetUrl } from '../assets.js';
4
- // eslint-disable-next-line react-refresh/only-export-components
5
- export const DECK_SPRITE_POS = {
6
- red: { x: 0, y: 0 },
7
- nebula: { x: 3, y: 0 },
8
- locked: { x: 4, y: 0 },
9
- blue: { x: 0, y: 2 },
10
- yellow: { x: 1, y: 2 },
11
- green: { x: 2, y: 2 },
12
- black: { x: 3, y: 2 },
13
- plasma: { x: 4, y: 2 },
14
- ghost: { x: 6, y: 2 },
15
- magic: { x: 0, y: 3 },
16
- checkered: { x: 1, y: 3 },
17
- erratic: { x: 2, y: 3 },
18
- abandoned: { x: 3, y: 3 },
19
- painted: { x: 4, y: 3 },
20
- challenge: { x: 0, y: 4 },
21
- anaglyph: { x: 2, y: 4 },
22
- zodiac: { x: 3, y: 4 },
23
- };
24
- // eslint-disable-next-line react-refresh/only-export-components
25
- export const STAKE_SPRITE_POS = {
26
- white: { x: 1, y: 0 },
27
- red: { x: 2, y: 0 },
28
- green: { x: 3, y: 0 },
29
- blue: { x: 4, y: 0 },
30
- black: { x: 0, y: 1 },
31
- purple: { x: 1, y: 1 },
32
- orange: { x: 2, y: 1 },
33
- gold: { x: 3, y: 1 },
34
- };
35
- const SPRITE_WIDTH = 142;
36
- const SPRITE_HEIGHT = 190;
37
- const DECK_COLS = 7;
38
- const DECK_ROWS = 5;
39
- const STICKER_COLS = 5;
40
- const STICKER_ROWS = 3;
41
- /**
42
- * Balatro deck box sprite — optionally overlaid with a stake sticker.
43
- * Draws from the Enhancers.png atlas (deck thumbnails live in the bottom
44
- * two rows) and stickers.png for the stake band. Uses jaml-ui's
45
- * `resolveJamlAssetUrl` so consumers can override the asset base URL.
46
- */
47
- export function DeckSprite({ deck, stake, size = 50, className = '', style }) {
48
- const deckKey = (deck || 'erratic').toLowerCase().replace(/\s*deck$/, '').trim();
49
- const deckPos = DECK_SPRITE_POS[deckKey] ?? DECK_SPRITE_POS.erratic;
50
- const stakePos = stake ? STAKE_SPRITE_POS[stake.toLowerCase().replace(/\s*stake$/, '').trim()] : null;
51
- const scale = size / SPRITE_WIDTH;
52
- const displayHeight = SPRITE_HEIGHT * scale;
53
- return (_jsxs("div", { className: className, style: {
54
- position: 'relative',
55
- width: size,
56
- height: displayHeight,
57
- ...style,
58
- }, children: [_jsx("div", { style: {
59
- position: 'absolute',
60
- inset: 0,
61
- backgroundImage: `url(${resolveJamlAssetUrl('enhancers')})`,
62
- backgroundSize: `${DECK_COLS * 100}% ${DECK_ROWS * 100}%`,
63
- backgroundPosition: `${(deckPos.x / (DECK_COLS - 1)) * 100}% ${(deckPos.y / (DECK_ROWS - 1)) * 100}%`,
64
- backgroundRepeat: 'no-repeat',
65
- imageRendering: 'pixelated',
66
- } }), stakePos ? (_jsx("div", { style: {
67
- position: 'absolute',
68
- inset: 0,
69
- backgroundImage: `url(${resolveJamlAssetUrl('stickers')})`,
70
- backgroundSize: `${STICKER_COLS * 100}% ${STICKER_ROWS * 100}%`,
71
- backgroundPosition: `${(stakePos.x / (STICKER_COLS - 1)) * 100}% ${(stakePos.y / (STICKER_ROWS - 1)) * 100}%`,
72
- backgroundRepeat: 'no-repeat',
73
- imageRendering: 'pixelated',
74
- } })) : null] }));
75
- }