jaml-ui 0.8.0 → 0.9.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.
Files changed (38) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +135 -135
  3. package/dist/components/JamlCodeEditor.d.ts +7 -0
  4. package/dist/components/JamlCodeEditor.js +58 -0
  5. package/dist/components/JamlIde.js +2 -14
  6. package/dist/components/JamlIdeVisual.js +4 -4
  7. package/dist/hooks/searchWorkerCode.js +59 -59
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +1 -0
  10. package/dist/ui/footer.js +5 -5
  11. package/package.json +9 -2
  12. package/dist/data/balatro-jokers.json +0 -1241
  13. package/dist/r3f/BalatroJokerMesh3D.d.ts +0 -8
  14. package/dist/r3f/BalatroJokerMesh3D.js +0 -98
  15. package/dist/r3f/BalatroJokerPreview3D.d.ts +0 -14
  16. package/dist/r3f/BalatroJokerPreview3D.js +0 -30
  17. package/dist/r3f/BalatroPlayingCard3D.d.ts +0 -22
  18. package/dist/r3f/BalatroPlayingCard3D.js +0 -62
  19. package/dist/r3f/cardConstants.d.ts +0 -16
  20. package/dist/r3f/cardConstants.js +0 -14
  21. package/dist/r3f/compositedAtlas.d.ts +0 -5
  22. package/dist/r3f/compositedAtlas.js +0 -56
  23. package/dist/r3f/gridUV.d.ts +0 -22
  24. package/dist/r3f/gridUV.js +0 -30
  25. package/dist/r3f/index.d.ts +0 -12
  26. package/dist/r3f/index.js +0 -13
  27. package/dist/r3f/jokerRegistry.d.ts +0 -28
  28. package/dist/r3f/jokerRegistry.js +0 -40
  29. package/dist/r3f/jokerTilt.d.ts +0 -8
  30. package/dist/r3f/jokerTilt.js +0 -41
  31. package/dist/r3f/magneticTilt.d.ts +0 -18
  32. package/dist/r3f/magneticTilt.js +0 -34
  33. package/dist/r3f/playingCardTypes.d.ts +0 -24
  34. package/dist/r3f/playingCardTypes.js +0 -32
  35. package/dist/r3f/playingCardVisuals.d.ts +0 -7
  36. package/dist/r3f/playingCardVisuals.js +0 -45
  37. package/dist/r3f/usePlayingCardTexture.d.ts +0 -7
  38. package/dist/r3f/usePlayingCardTexture.js +0 -92
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 pifreak
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 pifreak
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,135 +1,135 @@
1
- # jaml-ui
2
-
3
- React components, UI tokens, sprites, and utilities for Balatro/JAML apps.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install jaml-ui react react-dom
9
- ```
10
-
11
- ## Package exports
12
-
13
- | Entry | Contents |
14
- |-------|----------|
15
- | `jaml-ui` | Game card components, JAML IDE, Analyzer Explorer, hooks |
16
- | `jaml-ui/ui` | Jimbo design system — JimboPanel, JimboButton, JimboModal, tokens |
17
- | `jaml-ui/core` | Pure asset helpers, sprite metadata, decode utilities (no React) |
18
- | `jaml-ui/motely` | motely-wasm decode helpers (requires `motely-wasm` peer) |
19
- | `jaml-ui/r3f` | 3D card component via React Three Fiber (requires r3f peers) |
20
-
21
- ## Quick start
22
-
23
- ```tsx
24
- import { JamlGameCard, AnalyzerExplorer, JamlIde } from "jaml-ui";
25
- import { JimboPanel, JimboButton } from "jaml-ui/ui";
26
- ```
27
-
28
- ### Game card
29
-
30
- ```tsx
31
- import { JamlGameCard } from "jaml-ui";
32
-
33
- <JamlGameCard
34
- type="joker"
35
- card={{ name: "Blueprint", edition: "Foil", isEternal: true, scale: 1.5 }}
36
- />
37
- ```
38
-
39
- ### Jimbo UI (Balatro design system)
40
-
41
- ```tsx
42
- import { JimboPanel, JimboButton, JimboModal } from "jaml-ui/ui";
43
- import { JimboColorOption } from "jaml-ui/ui";
44
-
45
- <JimboPanel sway onBack={() => setOpen(false)}>
46
- <JimboButton variant="primary" onClick={handleSearch}>Search</JimboButton>
47
- </JimboPanel>
48
- ```
49
-
50
- Available variants: `primary`, `secondary`, `danger`, `back`, `ghost`
51
-
52
- ### JAML IDE
53
-
54
- ```tsx
55
- import { JamlIde } from "jaml-ui";
56
-
57
- <JamlIde
58
- jaml={jaml}
59
- onChange={setJaml}
60
- searchResults={results}
61
- onSearch={handleSearch}
62
- isSearching={isSearching}
63
- />
64
- ```
65
-
66
- ### Analyzer Explorer
67
-
68
- ```tsx
69
- import { AnalyzerExplorer } from "jaml-ui";
70
-
71
- // antes: AnalyzerAnteView[] — stream from motely-wasm createSearchContext
72
- <AnalyzerExplorer antes={antes} totalAntes={8} highlights={highlights} />
73
- ```
74
-
75
- ### JAML Map Preview
76
-
77
- ```tsx
78
- import { JamlMapPreview } from "jaml-ui";
79
-
80
- <JamlMapPreview jaml={jaml} />
81
- ```
82
-
83
- ## Asset handling
84
-
85
- By default sprites resolve from the package `assets/` directory via `import.meta.url`.
86
-
87
- Override at app startup:
88
-
89
- ```ts
90
- import { setJamlAssetBaseUrl, clearJamlAssetBaseUrl } from "jaml-ui";
91
-
92
- setJamlAssetBaseUrl("/vendor/jaml-ui/"); // custom CDN
93
- clearJamlAssetBaseUrl(); // back to default
94
- ```
95
-
96
- ## Core utilities
97
-
98
- ```ts
99
- import { SPRITE_SHEETS, getSpriteData, resolveJamlAssetUrl } from "jaml-ui/core";
100
- ```
101
-
102
- ## Motely decode helpers
103
-
104
- ```ts
105
- import { decodeMotelyItemName, motelyItemTypeName } from "jaml-ui/motely";
106
- ```
107
-
108
- ## 3D card (optional)
109
-
110
- ```bash
111
- npm install three @react-three/fiber @react-three/drei @react-spring/three
112
- ```
113
-
114
- ```tsx
115
- import { Card3D } from "jaml-ui/r3f";
116
-
117
- <Card3D itemName="Blueprint" />
118
- ```
119
-
120
- ## Next.js
121
-
122
- Import pure helpers from `jaml-ui/core` for server components. For local workspace installs add:
123
-
124
- ```ts
125
- // next.config.ts
126
- const nextConfig = { transpilePackages: ["jaml-ui"] };
127
- ```
128
-
129
- ## Peer dependencies
130
-
131
- | Peer | Required for |
132
- |------|-------------|
133
- | `react`, `react-dom` | All components |
134
- | `motely-wasm ^10 \|\| ^11 \|\| ^12` | `jaml-ui/motely`, `AnalyzerExplorer` data |
135
- | `three`, `@react-three/fiber`, `@react-three/drei`, `@react-spring/three` | `jaml-ui/r3f` only |
1
+ # jaml-ui
2
+
3
+ React components, UI tokens, sprites, and utilities for Balatro/JAML apps.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install jaml-ui react react-dom
9
+ ```
10
+
11
+ ## Package exports
12
+
13
+ | Entry | Contents |
14
+ |-------|----------|
15
+ | `jaml-ui` | Game card components, JAML IDE, Analyzer Explorer, hooks |
16
+ | `jaml-ui/ui` | Jimbo design system — JimboPanel, JimboButton, JimboModal, tokens |
17
+ | `jaml-ui/core` | Pure asset helpers, sprite metadata, decode utilities (no React) |
18
+ | `jaml-ui/motely` | motely-wasm decode helpers (requires `motely-wasm` peer) |
19
+ | `jaml-ui/r3f` | 3D card component via React Three Fiber (requires r3f peers) |
20
+
21
+ ## Quick start
22
+
23
+ ```tsx
24
+ import { JamlGameCard, AnalyzerExplorer, JamlIde } from "jaml-ui";
25
+ import { JimboPanel, JimboButton } from "jaml-ui/ui";
26
+ ```
27
+
28
+ ### Game card
29
+
30
+ ```tsx
31
+ import { JamlGameCard } from "jaml-ui";
32
+
33
+ <JamlGameCard
34
+ type="joker"
35
+ card={{ name: "Blueprint", edition: "Foil", isEternal: true, scale: 1.5 }}
36
+ />
37
+ ```
38
+
39
+ ### Jimbo UI (Balatro design system)
40
+
41
+ ```tsx
42
+ import { JimboPanel, JimboButton, JimboModal } from "jaml-ui/ui";
43
+ import { JimboColorOption } from "jaml-ui/ui";
44
+
45
+ <JimboPanel sway onBack={() => setOpen(false)}>
46
+ <JimboButton variant="primary" onClick={handleSearch}>Search</JimboButton>
47
+ </JimboPanel>
48
+ ```
49
+
50
+ Available variants: `primary`, `secondary`, `danger`, `back`, `ghost`
51
+
52
+ ### JAML IDE
53
+
54
+ ```tsx
55
+ import { JamlIde } from "jaml-ui";
56
+
57
+ <JamlIde
58
+ jaml={jaml}
59
+ onChange={setJaml}
60
+ searchResults={results}
61
+ onSearch={handleSearch}
62
+ isSearching={isSearching}
63
+ />
64
+ ```
65
+
66
+ ### Analyzer Explorer
67
+
68
+ ```tsx
69
+ import { AnalyzerExplorer } from "jaml-ui";
70
+
71
+ // antes: AnalyzerAnteView[] — stream from motely-wasm createSearchContext
72
+ <AnalyzerExplorer antes={antes} totalAntes={8} highlights={highlights} />
73
+ ```
74
+
75
+ ### JAML Map Preview
76
+
77
+ ```tsx
78
+ import { JamlMapPreview } from "jaml-ui";
79
+
80
+ <JamlMapPreview jaml={jaml} />
81
+ ```
82
+
83
+ ## Asset handling
84
+
85
+ By default sprites resolve from the package `assets/` directory via `import.meta.url`.
86
+
87
+ Override at app startup:
88
+
89
+ ```ts
90
+ import { setJamlAssetBaseUrl, clearJamlAssetBaseUrl } from "jaml-ui";
91
+
92
+ setJamlAssetBaseUrl("/vendor/jaml-ui/"); // custom CDN
93
+ clearJamlAssetBaseUrl(); // back to default
94
+ ```
95
+
96
+ ## Core utilities
97
+
98
+ ```ts
99
+ import { SPRITE_SHEETS, getSpriteData, resolveJamlAssetUrl } from "jaml-ui/core";
100
+ ```
101
+
102
+ ## Motely decode helpers
103
+
104
+ ```ts
105
+ import { decodeMotelyItemName, motelyItemTypeName } from "jaml-ui/motely";
106
+ ```
107
+
108
+ ## 3D card (optional)
109
+
110
+ ```bash
111
+ npm install three @react-three/fiber @react-three/drei @react-spring/three
112
+ ```
113
+
114
+ ```tsx
115
+ import { Card3D } from "jaml-ui/r3f";
116
+
117
+ <Card3D itemName="Blueprint" />
118
+ ```
119
+
120
+ ## Next.js
121
+
122
+ Import pure helpers from `jaml-ui/core` for server components. For local workspace installs add:
123
+
124
+ ```ts
125
+ // next.config.ts
126
+ const nextConfig = { transpilePackages: ["jaml-ui"] };
127
+ ```
128
+
129
+ ## Peer dependencies
130
+
131
+ | Peer | Required for |
132
+ |------|-------------|
133
+ | `react`, `react-dom` | All components |
134
+ | `motely-wasm ^10 \|\| ^11 \|\| ^12` | `jaml-ui/motely`, `AnalyzerExplorer` data |
135
+ | `three`, `@react-three/fiber`, `@react-three/drei`, `@react-spring/three` | `jaml-ui/r3f` only |
@@ -0,0 +1,7 @@
1
+ export interface JamlCodeEditorProps {
2
+ value: string;
3
+ onChange: (value: string) => void;
4
+ placeholder?: string;
5
+ minHeight?: number;
6
+ }
7
+ export declare function JamlCodeEditor({ value, onChange, minHeight, }: JamlCodeEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import Editor from "@monaco-editor/react";
4
+ import { JimboColorOption } from "../ui/tokens.js";
5
+ // Monaco needs hex strings for its colors API. We strip the leading `#` from
6
+ // JimboColor tokens where Monaco expects raw hex for syntax rules (token
7
+ // foreground), and pass the full `#...` form for UI colors. Alpha suffix
8
+ // (e.g. WHITE + "20") is valid for Monaco colors but not for rules.
9
+ const hex = (token) => token.replace(/^#/, "");
10
+ const defineBalatroTheme = (monaco) => {
11
+ monaco.editor.defineTheme("jaml-balatro-dark", {
12
+ base: "vs-dark",
13
+ inherit: true,
14
+ rules: [
15
+ { token: "comment", foreground: hex(JimboColorOption.GREY), fontStyle: "italic" },
16
+ { token: "keyword", foreground: hex(JimboColorOption.RED) },
17
+ { token: "string", foreground: hex(JimboColorOption.GOLD_TEXT) },
18
+ { token: "number", foreground: hex(JimboColorOption.BLUE) },
19
+ { token: "type", foreground: hex(JimboColorOption.GREEN_TEXT) },
20
+ ],
21
+ colors: {
22
+ "editor.background": JimboColorOption.DARKEST,
23
+ "editor.foreground": JimboColorOption.WHITE,
24
+ "editorLineNumber.foreground": JimboColorOption.GREY,
25
+ "editorLineNumber.activeForeground": JimboColorOption.GOLD_TEXT,
26
+ "editor.selectionBackground": `${JimboColorOption.WHITE}20`,
27
+ "editor.inactiveSelectionBackground": `${JimboColorOption.WHITE}10`,
28
+ "editor.lineHighlightBackground": `${JimboColorOption.BLACK}20`,
29
+ "editorCursor.foreground": JimboColorOption.GOLD_TEXT,
30
+ "editorWidget.background": JimboColorOption.DARK_GREY,
31
+ "editorWidget.border": `${JimboColorOption.WHITE}20`,
32
+ "editorWidget.foreground": JimboColorOption.WHITE,
33
+ "list.activeSelectionBackground": JimboColorOption.GOLD,
34
+ "list.activeSelectionForeground": JimboColorOption.DARKEST,
35
+ "list.hoverBackground": JimboColorOption.PANEL_EDGE,
36
+ "list.hoverForeground": JimboColorOption.WHITE,
37
+ "list.focusBackground": JimboColorOption.GOLD,
38
+ "list.focusForeground": JimboColorOption.DARKEST,
39
+ },
40
+ });
41
+ };
42
+ export function JamlCodeEditor({ value, onChange, minHeight = 320, }) {
43
+ return (_jsx("div", { style: { width: "100%", minHeight, background: JimboColorOption.DARKEST }, children: _jsx(Editor, { height: `${minHeight}px`, defaultLanguage: "yaml", value: value, theme: "jaml-balatro-dark", onChange: (next) => onChange(next ?? ""), beforeMount: defineBalatroTheme, options: {
44
+ minimap: { enabled: false },
45
+ scrollBeyondLastLine: false,
46
+ fontSize: 13,
47
+ lineHeight: 22,
48
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
49
+ lineNumbers: "on",
50
+ automaticLayout: true,
51
+ padding: { top: 12, bottom: 12 },
52
+ wordWrap: "on",
53
+ formatOnPaste: true,
54
+ formatOnType: true,
55
+ renderLineHighlight: "line",
56
+ scrollbar: { verticalScrollbarSize: 8, horizontalScrollbarSize: 8 },
57
+ } }) }));
58
+ }
@@ -4,6 +4,7 @@ import { useMemo, useState } from "react";
4
4
  import { JamlMapPreview } from "./JamlMapPreview.js";
5
5
  import { JamlIdeToolbar } from "./JamlIdeToolbar.js";
6
6
  import { JamlIdeVisual } from "./JamlIdeVisual.js";
7
+ import { JamlCodeEditor } from "./JamlCodeEditor.js";
7
8
  import { JimboColorOption } from "../ui/tokens.js";
8
9
  import { jamlTextToVisualFilter, visualFilterToJamlText } from "../utils/jamlVisualFilter.js";
9
10
  function TallyBar({ value, max }) {
@@ -156,18 +157,5 @@ export function JamlIde({ jaml, defaultJaml, onChange, defaultMode = "code", sea
156
157
  padding: "10px 14px",
157
158
  borderBottom: `1px solid ${JimboColorOption.PANEL_EDGE}`,
158
159
  background: JimboColorOption.TEAL_GREY,
159
- }, children: [_jsxs("div", { children: [_jsx("div", { style: { fontSize: 14, fontWeight: 800, fontFamily: "m6x11plus, monospace", color: JimboColorOption.GOLD_TEXT }, children: title }), _jsx("div", { style: { fontSize: 11, color: JimboColorOption.GREY }, children: "Jimbo's Ante Markup Language" })] }), actions ? _jsx("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: actions }) : null] }), _jsx(JamlIdeToolbar, { mode: mode, onModeChange: setMode, resultCount: results.length, onSearch: onSearch, isSearching: isSearching }), _jsxs("div", { style: { flex: 1, minHeight: 0, overflow: "auto", background: JimboColorOption.DARKEST }, children: [mode === "visual" ? (_jsx(JamlIdeVisual, { filter: activeFilter, onChange: handleVisualFilterChange })) : null, mode === "code" ? (_jsx("textarea", { title: "JAML IDE Editor", value: text, onChange: (event) => handleTextChange(event.target.value), placeholder: codePlaceholder, spellCheck: false, autoCapitalize: "off", autoCorrect: "off", style: {
160
- width: "100%",
161
- minHeight: 320,
162
- resize: "vertical",
163
- border: 0,
164
- outline: 0,
165
- padding: 16,
166
- background: "transparent",
167
- color: JimboColorOption.WHITE,
168
- fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
169
- fontSize: 13,
170
- lineHeight: 1.7,
171
- boxSizing: "border-box",
172
- } })) : null, mode === "map" ? _jsx(JamlMapPreview, { jaml: text }) : null, mode === "results" ? (_jsx("div", { style: { padding: 12 }, children: _jsx(ResultsView, { results: results }) })) : null] })] }));
160
+ }, children: [_jsxs("div", { children: [_jsx("div", { style: { fontSize: 14, fontWeight: 800, fontFamily: "m6x11plus, monospace", color: JimboColorOption.GOLD_TEXT }, children: title }), _jsx("div", { style: { fontSize: 11, color: JimboColorOption.GREY }, children: "Jimbo's Ante Markup Language" })] }), actions ? _jsx("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: actions }) : null] }), _jsx(JamlIdeToolbar, { mode: mode, onModeChange: setMode, resultCount: results.length, onSearch: onSearch, isSearching: isSearching }), _jsxs("div", { style: { flex: 1, minHeight: 0, overflow: "auto", background: JimboColorOption.DARKEST }, children: [mode === "visual" ? (_jsx(JamlIdeVisual, { filter: activeFilter, onChange: handleVisualFilterChange })) : null, mode === "code" ? (_jsx(JamlCodeEditor, { value: text, onChange: handleTextChange, placeholder: codePlaceholder })) : null, mode === "map" ? _jsx(JamlMapPreview, { jaml: text }) : null, mode === "results" ? (_jsx("div", { style: { padding: 12 }, children: _jsx(ResultsView, { results: results }) })) : null] })] }));
173
161
  }
@@ -35,7 +35,7 @@ function DragClausePill({ clause, zone, onDragStart, }) {
35
35
  borderRadius: 6, padding: "5px 8px 5px 4px",
36
36
  boxShadow: `0 2px 0 ${JimboColorOption.BLACK}`,
37
37
  cursor: "grab", userSelect: "none", touchAction: "none",
38
- }, children: [_jsx("div", { style: { color: JimboColorOption.GREY, fontSize: 12, lineHeight: 1, padding: "0 2px" }, children: "\u22EE\u22EE" }), _jsx(ClauseSprite, { clause: clause, size: 26 }), _jsx("div", { style: { fontSize: 10, color: JimboColorOption.WHITE, letterSpacing: 1, textShadow: "1px 1px 0 rgba(0,0,0,.8)" }, children: clause.label || clause.value }), clause.antes && clause.antes.length > 0 && (_jsxs("div", { style: { display: "flex", gap: 2 }, children: [clause.antes.slice(0, 3).map((a) => (_jsx("div", { style: { fontSize: 8, padding: "0 3px", background: JimboColorOption.DARKEST, color: z.color, borderRadius: 2 }, children: a }, a))), clause.antes.length > 3 && _jsxs("div", { style: { fontSize: 8, color: JimboColorOption.GREY }, children: ["+", clause.antes.length - 3] })] })), clause.score != null && (_jsxs("div", { style: { fontSize: 9, padding: "0 4px", background: JimboColorOption.RED, color: JimboColorOption.WHITE, borderRadius: 2 }, children: ["+", clause.score] }))] }));
38
+ }, children: [_jsx("div", { style: { color: JimboColorOption.GREY, fontSize: 12, lineHeight: 1, padding: "0 2px" }, children: "\u22EE\u22EE" }), _jsx(ClauseSprite, { clause: clause, size: 26 }), _jsx("div", { style: { fontSize: 10, color: JimboColorOption.WHITE, letterSpacing: 1, textShadow: `1px 1px 0 ${JimboColorOption.BLACK}cc` }, children: clause.label || clause.value }), clause.antes && clause.antes.length > 0 && (_jsxs("div", { style: { display: "flex", gap: 2 }, children: [clause.antes.slice(0, 3).map((a) => (_jsx("div", { style: { fontSize: 8, padding: "0 3px", background: JimboColorOption.DARKEST, color: z.color, borderRadius: 2 }, children: a }, a))), clause.antes.length > 3 && _jsxs("div", { style: { fontSize: 8, color: JimboColorOption.GREY }, children: ["+", clause.antes.length - 3] })] })), clause.score != null && (_jsxs("div", { style: { fontSize: 9, padding: "0 4px", background: JimboColorOption.RED, color: JimboColorOption.WHITE, borderRadius: 2 }, children: ["+", clause.score] }))] }));
39
39
  }
40
40
  function ZoneDropRail({ zone, clauses, onDragStart, highlight, }) {
41
41
  const z = ZONE_META[zone];
@@ -47,7 +47,7 @@ function ZoneDropRail({ zone, clauses, onDragStart, highlight, }) {
47
47
  }, children: [_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 6 }, children: [_jsx("div", { style: {
48
48
  fontSize: 10, letterSpacing: 2, padding: "2px 8px",
49
49
  background: z.color, color: JimboColorOption.WHITE, borderRadius: 3,
50
- textShadow: "1px 1px 0 rgba(0,0,0,.8)",
50
+ textShadow: `1px 1px 0 ${JimboColorOption.BLACK}cc`,
51
51
  }, children: z.label }), _jsx("div", { style: { flex: 1, height: 1, background: `${z.color}44` } }), _jsx("div", { style: { fontSize: 8, color: JimboColorOption.GREY }, children: clauses.length })] }), _jsxs("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [clauses.map((c) => (_jsx(DragClausePill, { clause: c, zone: zone, onDragStart: onDragStart }, c.id))), clauses.length === 0 && (_jsx("div", { style: { fontSize: 10, color: JimboColorOption.GREY, padding: 10, fontStyle: "italic" }, children: "drop clauses here" }))] })] }));
52
52
  }
53
53
  export function JamlIdeVisual({ filter, onChange, onSave, onBack }) {
@@ -103,11 +103,11 @@ export function JamlIdeVisual({ filter, onChange, onSave, onBack }) {
103
103
  return (_jsxs("div", { ref: rootRef, style: { display: "flex", flexDirection: "column", gap: 10, padding: 10 }, children: [_jsxs("div", { style: {
104
104
  background: JimboColorOption.DARK_GREY, border: `2px solid ${JimboColorOption.PANEL_EDGE}`,
105
105
  borderRadius: 6, padding: 8, boxShadow: `0 2px 0 ${JimboColorOption.BLACK}`,
106
- }, children: [_jsx("div", { style: { fontSize: 9, color: JimboColorOption.GREY, letterSpacing: 2 }, children: "FILE" }), _jsxs("div", { style: { fontSize: 14, color: JimboColorOption.WHITE, textShadow: "1px 1px 0 rgba(0,0,0,.8)" }, children: [filter.name || "Untitled", ".jaml"] }), filter.author && (_jsxs("div", { style: { fontSize: 9, color: JimboColorOption.GOLD_TEXT, marginTop: 2 }, children: ["by ", filter.author] }))] }), _jsx("div", { style: { fontSize: 9, color: JimboColorOption.GREY, letterSpacing: 1, textAlign: "center" }, children: "\u22EE\u22EE drag clauses between zones \u00B7 tap to edit" }), _jsx(ZoneDropRail, { zone: "must", clauses: filter.must, onDragStart: onDragStart, highlight: hoverZone === "must" }), _jsx(ZoneDropRail, { zone: "should", clauses: filter.should, onDragStart: onDragStart, highlight: hoverZone === "should" }), _jsx(ZoneDropRail, { zone: "mustnot", clauses: filter.mustnot, onDragStart: onDragStart, highlight: hoverZone === "mustnot" }), drag && (_jsx("div", { style: {
106
+ }, children: [_jsx("div", { style: { fontSize: 9, color: JimboColorOption.GREY, letterSpacing: 2 }, children: "FILE" }), _jsxs("div", { style: { fontSize: 14, color: JimboColorOption.WHITE, textShadow: `1px 1px 0 ${JimboColorOption.BLACK}cc` }, children: [filter.name || "Untitled", ".jaml"] }), filter.author && (_jsxs("div", { style: { fontSize: 9, color: JimboColorOption.GOLD_TEXT, marginTop: 2 }, children: ["by ", filter.author] }))] }), _jsx(ZoneDropRail, { zone: "must", clauses: filter.must, onDragStart: onDragStart, highlight: hoverZone === "must" }), _jsx(ZoneDropRail, { zone: "should", clauses: filter.should, onDragStart: onDragStart, highlight: hoverZone === "should" }), _jsx(ZoneDropRail, { zone: "mustnot", clauses: filter.mustnot, onDragStart: onDragStart, highlight: hoverZone === "mustnot" }), drag && (_jsx("div", { style: {
107
107
  position: "fixed",
108
108
  left: drag.x - drag.offX, top: drag.y - drag.offY,
109
109
  pointerEvents: "none", zIndex: 999,
110
110
  transform: "rotate(-2deg) scale(1.05)",
111
- filter: "drop-shadow(0 4px 6px rgba(0,0,0,.6))", opacity: 0.92,
111
+ filter: `drop-shadow(0 4px 6px ${JimboColorOption.BLACK}99)`, opacity: 0.92,
112
112
  }, children: _jsx(DragClausePill, { clause: drag.clause, zone: drag.fromZone, onDragStart: () => { } }) }))] }));
113
113
  }
@@ -1,62 +1,62 @@
1
1
  // Worker code as an inline string — created as a Blob URL at runtime.
2
2
  // This avoids bundler/import.meta.url issues when shipped as an npm package.
3
- export const SEARCH_WORKER_CODE = `
4
- let MotelyWasm = null;
5
- let MotelyWasmEvents = null;
6
- let activeSearch = null;
7
-
8
- self.addEventListener('message', async function(e) {
9
- const msg = e.data;
10
-
11
- if (msg.type === 'init') {
12
- try {
13
- const mod = await import(msg.url);
14
- await mod.default.boot();
15
- MotelyWasm = mod.MotelyWasm;
16
- MotelyWasmEvents = mod.MotelyWasmEvents;
17
- self.postMessage({ type: 'ready' });
18
- } catch (err) {
19
- self.postMessage({ type: 'error', message: String(err) });
20
- }
21
- return;
22
- }
23
-
24
- if (msg.type === 'start') {
25
- if (!MotelyWasm) { self.postMessage({ type: 'error', message: 'Not initialized' }); return; }
26
- const validation = MotelyWasm.validateJaml(msg.jaml);
27
- if (validation !== 'valid') { self.postMessage({ type: 'error', message: validation }); return; }
28
-
29
- let rId, pId, cId;
30
- function cleanup() {
31
- MotelyWasmEvents.onResult.unsubscribeById(rId);
32
- MotelyWasmEvents.onProgress.unsubscribeById(pId);
33
- MotelyWasmEvents.onComplete.unsubscribeById(cId);
34
- activeSearch = null;
35
- }
36
-
37
- rId = MotelyWasmEvents.onResult.subscribe(function(seed, score) {
38
- self.postMessage({ type: 'result', seed, score });
39
- });
40
- pId = MotelyWasmEvents.onProgress.subscribe(function(searched, matching) {
41
- self.postMessage({ type: 'progress', searched: searched.toString(), matching: matching.toString() });
42
- });
43
- cId = MotelyWasmEvents.onComplete.subscribe(function(status, searched, matched) {
44
- cleanup();
45
- self.postMessage({ type: 'complete', status, searched: searched.toString(), matched: matched.toString() });
46
- });
47
-
48
- try {
49
- activeSearch = MotelyWasm.startRandomSearch(msg.jaml, msg.count);
50
- } catch (err) {
51
- cleanup();
52
- self.postMessage({ type: 'error', message: String(err) });
53
- }
54
- return;
55
- }
56
-
57
- if (msg.type === 'stop') {
58
- if (activeSearch) { activeSearch.cancel(); activeSearch = null; }
59
- self.postMessage({ type: 'cancelled' });
60
- }
61
- });
3
+ export const SEARCH_WORKER_CODE = `
4
+ let MotelyWasm = null;
5
+ let MotelyWasmEvents = null;
6
+ let activeSearch = null;
7
+
8
+ self.addEventListener('message', async function(e) {
9
+ const msg = e.data;
10
+
11
+ if (msg.type === 'init') {
12
+ try {
13
+ const mod = await import(msg.url);
14
+ await mod.default.boot();
15
+ MotelyWasm = mod.MotelyWasm;
16
+ MotelyWasmEvents = mod.MotelyWasmEvents;
17
+ self.postMessage({ type: 'ready' });
18
+ } catch (err) {
19
+ self.postMessage({ type: 'error', message: String(err) });
20
+ }
21
+ return;
22
+ }
23
+
24
+ if (msg.type === 'start') {
25
+ if (!MotelyWasm) { self.postMessage({ type: 'error', message: 'Not initialized' }); return; }
26
+ const validation = MotelyWasm.validateJaml(msg.jaml);
27
+ if (validation !== 'valid') { self.postMessage({ type: 'error', message: validation }); return; }
28
+
29
+ let rId, pId, cId;
30
+ function cleanup() {
31
+ MotelyWasmEvents.onResult.unsubscribeById(rId);
32
+ MotelyWasmEvents.onProgress.unsubscribeById(pId);
33
+ MotelyWasmEvents.onComplete.unsubscribeById(cId);
34
+ activeSearch = null;
35
+ }
36
+
37
+ rId = MotelyWasmEvents.onResult.subscribe(function(seed, score) {
38
+ self.postMessage({ type: 'result', seed, score });
39
+ });
40
+ pId = MotelyWasmEvents.onProgress.subscribe(function(searched, matching) {
41
+ self.postMessage({ type: 'progress', searched: searched.toString(), matching: matching.toString() });
42
+ });
43
+ cId = MotelyWasmEvents.onComplete.subscribe(function(status, searched, matched) {
44
+ cleanup();
45
+ self.postMessage({ type: 'complete', status, searched: searched.toString(), matched: matched.toString() });
46
+ });
47
+
48
+ try {
49
+ activeSearch = MotelyWasm.startRandomSearch(msg.jaml, msg.count);
50
+ } catch (err) {
51
+ cleanup();
52
+ self.postMessage({ type: 'error', message: String(err) });
53
+ }
54
+ return;
55
+ }
56
+
57
+ if (msg.type === 'stop') {
58
+ if (activeSearch) { activeSearch.cancel(); activeSearch = null; }
59
+ self.postMessage({ type: 'cancelled' });
60
+ }
61
+ });
62
62
  `;
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export { AnalyzerExplorer, type AnalyzerAnteView, type AnalyzerBadge, type Analy
6
6
  export { JamlMapPreview, type JamlMapPreviewProps } from "./components/JamlMapPreview.js";
7
7
  export { JamlIde, type JamlIdeProps, type JamlIdeSearchResult, type JamlVisualFilter, type JamlVisualClause, type JamlZone, } from "./components/JamlIde.js";
8
8
  export { JamlIdeVisual, type JamlIdeVisualProps, } from "./components/JamlIdeVisual.js";
9
+ export { JamlCodeEditor, type JamlCodeEditorProps, } from "./components/JamlCodeEditor.js";
9
10
  export { JamlIdeToolbar, type JamlIdeMode, type JamlIdeToolbarProps, } from "./components/JamlIdeToolbar.js";
10
11
  export { CardList, type CardListProps } from "./components/CardList.js";
11
12
  export { extractVisualJamlItems, type JamlPreviewGroups, type JamlPreviewItem, type JamlPreviewSection, type JamlPreviewVisualType, } from "./utils/jamlMapPreview.js";
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export { AnalyzerExplorer, } from "./components/AnalyzerExplorer.js";
7
7
  export { JamlMapPreview } from "./components/JamlMapPreview.js";
8
8
  export { JamlIde, } from "./components/JamlIde.js";
9
9
  export { JamlIdeVisual, } from "./components/JamlIdeVisual.js";
10
+ export { JamlCodeEditor, } from "./components/JamlCodeEditor.js";
10
11
  export { JamlIdeToolbar, } from "./components/JamlIdeToolbar.js";
11
12
  export { CardList } from "./components/CardList.js";
12
13
  export { extractVisualJamlItems, } from "./utils/jamlMapPreview.js";
package/dist/ui/footer.js CHANGED
@@ -9,10 +9,10 @@ const SUITS = [
9
9
  ];
10
10
  const CYCLE = '5s';
11
11
  export function JimboBalatroFooter({ hidden = false, className = '' }) {
12
- return (_jsxs("div", { className: ['fixed right-0 bottom-0 left-0 w-screen min-w-full transition-opacity duration-200', hidden ? 'pointer-events-none opacity-0' : 'opacity-100', className].filter(Boolean).join(' '), children: [_jsx("div", { style: { width: '100%', borderTop: '1px solid rgba(255,255,255,0.1)', background: 'rgba(0,0,0,0.9)', padding: '0 1rem 3px', textAlign: 'center' }, children: _jsxs("p", { style: { fontFamily: 'm6x11plus, monospace', fontSize: 'clamp(11px, 0.8vw + 8px, 14px)', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center', gap: '0 0.5rem', color: 'white', margin: 0 }, children: [_jsx("span", { children: "Not affiliated with LocalThunk or PlayStack" }), _jsxs("span", { style: { display: 'inline-flex', alignItems: 'center', gap: '0.25rem' }, children: ["Made with", ' ', _jsx("span", { style: { position: 'relative', display: 'inline-block', width: '1.5em', height: '1em', verticalAlign: 'middle' }, children: SUITS.map(({ char, kf }) => (_jsx("span", { style: { position: 'absolute', inset: 0, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', opacity: 0, animationName: kf, animationDuration: CYCLE, animationDelay: '0s', animationIterationCount: 'infinite', animationTimingFunction: 'ease-out' }, children: char }, char))) }), ' ', "for the", ' ', _jsx("a", { href: "https://playbalatro.com", target: "_blank", rel: "noopener noreferrer", style: { color: JimboColorOption.GOLD, textDecoration: 'none' }, children: "Balatro" }), ' ', "community"] })] }) }), _jsx("style", { children: `
13
- @keyframes jaml-heart { 0%{opacity:0;transform:scale(1)} 1%{opacity:1;transform:scale(1.45)} 3.5%{opacity:1;transform:scale(1)} 61.5%{opacity:1;transform:scale(1)} 62%{opacity:0} 100%{opacity:0} }
14
- @keyframes jaml-spade { 0%,61.5%{opacity:0} 62%{opacity:1;transform:scale(1.45)} 64.5%{opacity:1;transform:scale(1)} 71.5%{opacity:1} 72%{opacity:0} 100%{opacity:0} }
15
- @keyframes jaml-diamond { 0%,71.5%{opacity:0} 72%{opacity:1;transform:scale(1.45)} 74.5%{opacity:1;transform:scale(1)} 81.5%{opacity:1} 82%{opacity:0} 100%{opacity:0} }
16
- @keyframes jaml-club { 0%,81.5%{opacity:0} 82%{opacity:1;transform:scale(1.45)} 84.5%{opacity:1;transform:scale(1)} 95%{opacity:1} 96%{opacity:0} 100%{opacity:0} }
12
+ return (_jsxs("div", { className: ['fixed right-0 bottom-0 left-0 w-screen min-w-full transition-opacity duration-200', hidden ? 'pointer-events-none opacity-0' : 'opacity-100', className].filter(Boolean).join(' '), children: [_jsx("div", { style: { width: '100%', borderTop: '1px solid rgba(255,255,255,0.1)', background: 'rgba(0,0,0,0.9)', padding: '0 1rem 3px', textAlign: 'center' }, children: _jsxs("p", { style: { fontFamily: 'm6x11plus, monospace', fontSize: 'clamp(11px, 0.8vw + 8px, 14px)', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center', gap: '0 0.5rem', color: 'white', margin: 0 }, children: [_jsx("span", { children: "Not affiliated with LocalThunk or PlayStack" }), _jsxs("span", { style: { display: 'inline-flex', alignItems: 'center', gap: '0.25rem' }, children: ["Made with", ' ', _jsx("span", { style: { position: 'relative', display: 'inline-block', width: '1.5em', height: '1em', verticalAlign: 'middle' }, children: SUITS.map(({ char, kf }) => (_jsx("span", { style: { position: 'absolute', inset: 0, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', opacity: 0, animationName: kf, animationDuration: CYCLE, animationDelay: '0s', animationIterationCount: 'infinite', animationTimingFunction: 'ease-out' }, children: char }, char))) }), ' ', "for the", ' ', _jsx("a", { href: "https://playbalatro.com", target: "_blank", rel: "noopener noreferrer", style: { color: JimboColorOption.GOLD, textDecoration: 'none' }, children: "Balatro" }), ' ', "community"] })] }) }), _jsx("style", { children: `
13
+ @keyframes jaml-heart { 0%{opacity:0;transform:scale(1)} 1%{opacity:1;transform:scale(1.45)} 3.5%{opacity:1;transform:scale(1)} 61.5%{opacity:1;transform:scale(1)} 62%{opacity:0} 100%{opacity:0} }
14
+ @keyframes jaml-spade { 0%,61.5%{opacity:0} 62%{opacity:1;transform:scale(1.45)} 64.5%{opacity:1;transform:scale(1)} 71.5%{opacity:1} 72%{opacity:0} 100%{opacity:0} }
15
+ @keyframes jaml-diamond { 0%,71.5%{opacity:0} 72%{opacity:1;transform:scale(1.45)} 74.5%{opacity:1;transform:scale(1)} 81.5%{opacity:1} 82%{opacity:0} 100%{opacity:0} }
16
+ @keyframes jaml-club { 0%,81.5%{opacity:0} 82%{opacity:1;transform:scale(1.45)} 84.5%{opacity:1;transform:scale(1)} 95%{opacity:1} 96%{opacity:0} 100%{opacity:0} }
17
17
  ` })] }));
18
18
  }