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,48 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useState, useEffect } from 'react';
4
- import motely, { Motely } from 'motely-wasm';
5
- import { cn } from '../../lib/utils';
6
- import { DeckSprite } from './DeckSprite';
7
- import { Loader2, Sparkles } from 'lucide-react';
8
- export function AgnosticSeedCard({ seed, deckSlug = 'Erratic', stakeSlug = 'White', isLocked, dayNumber, className, onClick, analysis: propAnalysis, result: propResult, filter }) {
9
- const [loading, setLoading] = useState(false);
10
- const [fetchedAnalysis, setFetchedAnalysis] = useState(null);
11
- const result = propAnalysis || propResult || fetchedAnalysis;
12
- useEffect(() => {
13
- if (propAnalysis || propResult)
14
- return;
15
- const analyze = async () => {
16
- setLoading(true);
17
- try {
18
- await motely.boot();
19
- const jaml = `version: 1\nconfig:\n deck: ${deckSlug}\n stake: ${stakeSlug}\n`;
20
- const rawData = Motely.MotelyWasm.analyzeJamlSeeds(jaml, [seed]);
21
- if (rawData && rawData.seeds.length > 0) {
22
- const seedData = rawData.seeds[0];
23
- // The UI needs score and matches. The WASM provides score and tallies, but no matches yet.
24
- // If filter logic is still desired, it needs to be updated. For now, pass what we have.
25
- setFetchedAnalysis({
26
- score: seedData.score,
27
- matches: [], // TODO: C# Agent needs to provide matches in the WASM response if required.
28
- analysis: seedData.analysis
29
- });
30
- }
31
- }
32
- catch (err) {
33
- console.error(err);
34
- }
35
- finally {
36
- setLoading(false);
37
- }
38
- };
39
- analyze();
40
- }, [seed, deckSlug, stakeSlug, propAnalysis, propResult, filter]);
41
- if (isLocked) {
42
- return (_jsxs("div", { className: cn("balatro-panel flex flex-col items-center justify-center text-center", "w-[315px] h-[340px] shrink-0", "border-dashed border-white/10 opacity-60 grayscale", "animate-sway", // Move sway to container
43
- className), children: [_jsx("div", { className: "mb-4", children: _jsx(DeckSprite, { deck: deckSlug, stake: stakeSlug, size: 84 }) }), _jsx("h3", { className: "font-header text-2xl text-[var(--balatro-grey)] tracking-widest uppercase mb-2", children: "PREVIEW ONLY" }), _jsx("p", { className: "font-pixel text-[10px] text-white/30 max-w-[200px]", children: "This seed unlocks tomorrow. You can view the deck, but the strategy is hidden!" }), _jsx("div", { className: "mt-6 px-4 py-2 bg-black/60 rounded-xl border-2 border-white/10 shadow-[0_4px_0_rgba(0,0,0,0.5)]", children: _jsxs("span", { className: "font-header text-xl text-[var(--balatro-gold)] text-shadow-balatro", children: ["UNLOCKS DAY ", dayNumber] }) })] }));
44
- }
45
- return (_jsxs("div", { className: cn("balatro-panel flex flex-col cursor-pointer", "w-[315px] h-[340px] shrink-0", // ONE SIZE RULE
46
- "animate-sway", // Preserve the cute breathing/sway
47
- className), onClick: onClick, children: [_jsxs("div", { className: "flex items-start gap-3 pb-4 border-b border-white/10", children: [_jsx("div", { className: "animate-juice-pop", children: _jsx(DeckSprite, { deck: deckSlug, stake: stakeSlug, size: 64 }) }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("h3", { className: "font-header text-3xl text-white leading-tight mb-1 truncate", children: seed }), _jsxs("p", { className: "font-pixel text-xs text-white/40 tracking-wider", children: [deckSlug, " \u2022 ", stakeSlug] })] }), loading ? (_jsx(Loader2, { className: "animate-spin text-[var(--balatro-gold)] shrink-0", size: 28 })) : (_jsx(Sparkles, { className: "text-[var(--balatro-gold)] shrink-0", size: 28 }))] }), _jsxs("div", { className: "grid grid-cols-2 gap-3 py-6", children: [_jsxs("div", { className: "bg-black/40 rounded-xl p-5 border border-white/5 flex flex-col items-center justify-center", children: [_jsx("span", { className: "block text-[11px] font-pixel text-white/30 mb-2", children: "PRIMARY MATCH" }), _jsx("div", { className: "font-header text-xl text-[var(--balatro-blue)] leading-tight text-center", children: result?.matches?.[0]?.item?.name || result?.matches?.[0]?.name || "N/A" })] }), _jsxs("div", { className: "bg-black/40 rounded-xl p-5 border border-white/5 flex flex-col items-center justify-center", children: [_jsx("span", { className: "block text-[11px] font-pixel text-white/30 mb-2", children: "SIM SCORE" }), _jsx("div", { className: "font-header text-xl text-[var(--balatro-green)] leading-tight text-center", children: result?.score?.toLocaleString() || "0" })] })] }), _jsx("div", { className: "mt-auto flex items-center justify-center pt-3 border-t border-white/5", children: _jsx("span", { className: "font-header text-lg text-[var(--balatro-gold)] group-hover:text-white transition-colors text-shadow-balatro", children: "CLICK TO VIEW STRATEGY" }) })] }));
48
- }
@@ -1,2 +0,0 @@
1
- "use client";
2
- export { DeckSprite, DECK_SPRITE_POS as DECK_MAP, STAKE_SPRITE_POS as STAKE_MAP, } from "../../components/DeckSprite.js";
@@ -1 +0,0 @@
1
- export default function JamlBuilder(): import("react/jsx-runtime").JSX.Element;
@@ -1,112 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useState, useRef, useEffect } from 'react';
4
- import { useJamlFilter } from '../../lib/hooks/useJamlFilter';
5
- import JamlEditor from './JamlEditor';
6
- import { Loader2, Search, Copy, RotateCcw, Sparkles } from 'lucide-react';
7
- import { AgnosticSeedCard } from './AgnosticSeedCard';
8
- import { WasmStatus } from './WasmStatus';
9
- export default function JamlBuilder() {
10
- const { filter, jamlText, setFromJaml, updateFilter, addClause, editClause, deleteClause, editingClause, setEditingClause } = useJamlFilter();
11
- const [isSearching, setIsSearching] = useState(false);
12
- const [searchResults, setSearchResults] = useState([]);
13
- const [searchError, setSearchError] = useState(null);
14
- const [seedsProcessed, setSeedsProcessed] = useState(0);
15
- const stopRef = useRef(false);
16
- const searchCleanupRef = useRef(null);
17
- useEffect(() => {
18
- return () => {
19
- if (searchCleanupRef.current)
20
- searchCleanupRef.current();
21
- handleStop();
22
- };
23
- }, []);
24
- const pollRef = useRef(null);
25
- const workerRef = useRef(null);
26
- const handleSearch = async () => {
27
- // Stop any existing search
28
- if (isSearching) {
29
- handleStop();
30
- }
31
- setIsSearching(true);
32
- setSearchError(null);
33
- setSearchResults([]);
34
- setSeedsProcessed(0);
35
- stopRef.current = false;
36
- try {
37
- // Import worker using Vite's ?worker syntax
38
- const Worker = (await import('../../hooks/searchWorker?worker')).default;
39
- const worker = new Worker();
40
- workerRef.current = worker;
41
- worker.onmessage = (e) => {
42
- const event = e.data;
43
- if (event.type === 'result') {
44
- setSearchResults(prev => {
45
- // Prevent duplicates
46
- if (prev.some(r => r.seed === event.seed))
47
- return prev;
48
- return [...prev, {
49
- seed: event.seed,
50
- score: event.score,
51
- tallies: event.tallyColumns || []
52
- }];
53
- });
54
- }
55
- else if (event.type === 'progress') {
56
- setSeedsProcessed(Number(event.searched) || 0);
57
- }
58
- else if (event.type === 'complete') {
59
- setIsSearching(false);
60
- worker.terminate();
61
- workerRef.current = null;
62
- }
63
- else if (event.type === 'error') {
64
- setSearchError(event.message || 'Unknown error');
65
- setIsSearching(false);
66
- worker.terminate();
67
- workerRef.current = null;
68
- }
69
- else if (event.type === 'cancelled') {
70
- worker.terminate();
71
- workerRef.current = null;
72
- }
73
- };
74
- worker.postMessage({
75
- type: 'start',
76
- mode: 'random',
77
- jaml: jamlText,
78
- count: 1000 // A default random count, adjust as needed
79
- });
80
- }
81
- catch (e) {
82
- console.error("Local search error:", e);
83
- setSearchError(e.message || 'Local search failed');
84
- setIsSearching(false);
85
- }
86
- };
87
- const handleStop = async () => {
88
- stopRef.current = true;
89
- setIsSearching(false);
90
- if (workerRef.current) {
91
- workerRef.current.postMessage({ type: 'stop' });
92
- // The worker will reply with 'cancelled' and terminate itself
93
- }
94
- if (searchCleanupRef.current) {
95
- searchCleanupRef.current();
96
- searchCleanupRef.current = null;
97
- }
98
- };
99
- const handleCopyJaml = () => {
100
- if (typeof navigator !== 'undefined' && navigator.clipboard) {
101
- navigator.clipboard.writeText(jamlText).catch(err => {
102
- console.error('Failed to copy text: ', err);
103
- });
104
- }
105
- };
106
- const handleResetJaml = () => {
107
- if (confirm("Reset editor to default JAML?")) {
108
- setFromJaml(""); // useJamlFilter handles the default
109
- }
110
- };
111
- return (_jsxs("div", { className: "w-full max-w-[1400px] mx-auto p-4 flex-1 overflow-hidden flex flex-col gap-4 bg-[var(--balatro-black)]/40", children: [_jsxs("div", { className: "flex flex-col lg:grid lg:grid-cols-[1fr_400px] gap-6 h-full overflow-hidden", children: [_jsxs("div", { className: "flex flex-col gap-6 overflow-hidden min-h-0", children: [_jsx("div", { className: "balatro-panel border-[var(--balatro-grey)] bg-black/40 py-4", children: _jsxs("div", { className: "flex justify-between items-center", children: [_jsxs("div", { className: "flex gap-4 items-center", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-white text-xl font-header mb-1 uppercase tracking-widest leading-none", children: "JAML IDE" }), _jsx("p", { className: "text-white/60 font-pixel text-[10px] uppercase tracking-wide", children: "Ritual Factory v2.0" })] }), _jsx("div", { className: "h-8 w-px bg-white/10 mx-2" }), _jsxs("div", { className: "flex gap-1", children: [_jsx("button", { onClick: handleCopyJaml, className: "p-2 hover:bg-white/5 rounded text-white/30 hover:text-white/80 transition-colors", title: "Copy JAML", children: _jsx(Copy, { size: 16 }) }), _jsx("button", { onClick: handleResetJaml, className: "p-2 hover:bg-white/5 rounded text-white/30 hover:text-white/80 transition-colors", title: "Reset Editor", children: _jsx(RotateCcw, { size: 16 }) })] })] }), _jsxs("div", { className: "flex gap-2 items-center", children: [isSearching && (_jsxs("div", { className: "flex items-center gap-2 mr-2 px-3 py-1 bg-black/40 rounded border border-white/5 font-pixel text-[10px] text-white/50", children: [_jsx(Loader2, { size: 12, className: "animate-spin text-[var(--balatro-gold)]" }), _jsx("span", { children: "SEARCHING..." })] })), _jsxs("button", { onClick: handleSearch, disabled: isSearching, className: "balatro-button balatro-button-gold !py-2 !px-4 !text-sm flex items-center gap-2", children: [isSearching ? _jsx(Loader2, { size: 14, className: "animate-spin" }) : _jsx(Search, { size: 14 }), "RUN SEARCH"] }), isSearching && (_jsx("button", { onClick: handleStop, className: "balatro-button balatro-button-red !py-2 !px-4 !text-sm", children: "STOP" }))] })] }) }), _jsx("div", { className: "flex-1 min-h-0 bg-black/20 rounded-2xl border border-white/5 overflow-hidden shadow-inner flex flex-col", children: _jsx(JamlEditor, { initialJaml: jamlText, onJamlChange: (val) => setFromJaml(val), className: "flex-1" }) })] }), _jsx("div", { className: "flex flex-col gap-6 overflow-hidden pb-10", children: _jsxs("div", { className: "h-full balatro-panel border-[var(--balatro-gold)] overflow-hidden flex flex-col", children: [_jsxs("div", { className: "flex justify-between items-center mb-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("h3", { className: "text-[var(--balatro-gold)] text-xl font-header drop-shadow-md uppercase", children: ["Results ", searchResults.length > 0 && `(${searchResults.length})`] }), isSearching && (_jsxs("div", { className: "flex items-center gap-2 font-pixel text-[10px] text-[var(--balatro-blue)] animate-pulse", children: [_jsx(Sparkles, { size: 12, className: "animate-spin" }), _jsx("span", { children: seedsProcessed })] }))] }), isSearching && _jsx(Loader2, { size: 16, className: "animate-spin text-[var(--balatro-blue)]" })] }), isSearching && (_jsx("div", { className: "w-full h-1 bg-black/40 rounded-full mb-4 overflow-hidden border border-white/5", children: _jsx("div", { className: "h-full bg-gradient-to-r from-blue-500 via-purple-500 to-pink-500 animate-gradient-x transition-all duration-300", style: { width: `${Math.min((searchResults.length / 50) * 100, 100)}%` } }) })), _jsx("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-1", children: searchResults.length > 0 ? (_jsx("div", { className: "grid grid-cols-1 gap-4", children: searchResults.map((result) => (_jsx(AgnosticSeedCard, { seed: result.seed, result: result, className: "!scale-95 !origin-top" }, result.seed))) })) : (_jsx("div", { className: "h-full flex flex-col items-center justify-center italic font-pixel text-sm border-2 border-dashed border-white/5 rounded-2xl p-4 text-center", children: searchError ? (_jsxs("div", { className: "text-[var(--balatro-red)] bg-red-950/20 p-4 rounded text-center", children: [_jsx("div", { className: "font-header text-lg mb-1", children: "SEARCH FAILED" }), _jsx("div", { className: "opacity-60", children: searchError })] })) : (_jsx("div", { className: "opacity-30 text-white/50", children: isSearching ? 'SEEKING...' : 'RESULTS WILL APPEAR HERE' })) })) })] }) })] }), _jsx(WasmStatus, {})] }));
112
- }