jaml-ui 0.26.4 → 0.26.6

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 (34) hide show
  1. package/README.md +22 -7
  2. package/dist/assets/searchPoolWorker-CejAnH4a.js +35 -0
  3. package/dist/assets/searchPoolWorker-CejAnH4a.js.map +1 -0
  4. package/dist/chunks/motelyItemDecoder-Bg12hhB2.js +248 -0
  5. package/dist/chunks/motelyItemDecoder-Bg12hhB2.js.map +1 -0
  6. package/dist/chunks/searchPoolWorker-CTtPOuxF.js +8 -0
  7. package/dist/chunks/searchPoolWorker-CTtPOuxF.js.map +1 -0
  8. package/dist/chunks/{ui-BRMCKSX4.js → ui-ByciFBYB.js} +3 -3
  9. package/dist/chunks/{ui-BRMCKSX4.js.map → ui-ByciFBYB.js.map} +1 -1
  10. package/dist/components/JamlIde.d.ts +8 -1
  11. package/dist/components/JamlIdeToolbar.d.ts +3 -1
  12. package/dist/components/jamlMap/CategoryPicker.d.ts +1 -0
  13. package/dist/components/jamlMap/JokerPicker.d.ts +1 -0
  14. package/dist/config.d.ts +7 -0
  15. package/dist/hooks/searchPoolWorker.d.ts +60 -0
  16. package/dist/hooks/searchWorker.d.ts +1 -0
  17. package/dist/hooks/useAnalyzer.d.ts +17 -0
  18. package/dist/hooks/useJamlLibrary.d.ts +13 -0
  19. package/dist/hooks/useMotelyRuntime.d.ts +11 -0
  20. package/dist/hooks/useSearch.d.ts +5 -6
  21. package/dist/hooks/useSearchPool.d.ts +42 -0
  22. package/dist/index.d.ts +5 -1
  23. package/dist/index.js +3056 -3064
  24. package/dist/index.js.map +1 -1
  25. package/dist/lib/hooks/useSeedAnalyzer.d.ts +10 -3
  26. package/dist/motely.d.ts +3 -1
  27. package/dist/motely.js +22 -21
  28. package/dist/motely.js.map +1 -1
  29. package/dist/motelyBoot.d.ts +13 -0
  30. package/dist/ui/jimbo.css +1 -1
  31. package/dist/ui.js +1 -1
  32. package/package.json +7 -4
  33. package/dist/chunks/motelyItemDecoder-BFCFW_BF.js +0 -113
  34. package/dist/chunks/motelyItemDecoder-BFCFW_BF.js.map +0 -1
package/README.md CHANGED
@@ -11,7 +11,7 @@ npm install jaml-ui react react-dom
11
11
  ## Package exports
12
12
 
13
13
  | Entry | Contents |
14
- |-------|----------|
14
+ | ----- | -------- |
15
15
  | `jaml-ui` | Game card components, JAML IDE, Analyzer Explorer, hooks |
16
16
  | `jaml-ui/ui` | Jimbo design system — JimboPanel, JimboButton, JimboModal, tokens |
17
17
  | `jaml-ui/core` | Pure asset helpers, sprite metadata, decode utilities (no React) |
@@ -115,18 +115,33 @@ const nextConfig = { transpilePackages: ["jaml-ui"] };
115
115
 
116
116
  ## Search Worker Architecture
117
117
 
118
- The library provides `useAnalyzer` to interact with `motely-wasm`'s search context natively.
119
- Ensure `motely-wasm` is imported and booted at the module level in your application:
118
+ The library provides `useSearch` and `useAnalyzer` helpers that use `motely-wasm`'s Bootsharp-generated ES module directly.
119
+ Importing `jaml-ui/motely` boots `motely-wasm` once at module scope. Search results stay the plain Balatro seed shape: `seed`, `score`, and optional tally columns.
120
120
 
121
121
  ```tsx
122
- import { boot } from "motely-wasm";
123
- boot(); // Call early in your application lifecycle
122
+ import { useSearch, useJamlLibrary } from "jaml-ui/motely";
123
+
124
+ const search = useSearch();
125
+ search.start(jaml, 10_000);
126
+
127
+ // result: { seed: string, score: number, tallyColumns?: number[] }
128
+ ```
129
+
130
+ `useJamlLibrary` wires Bootsharp.FileSystem when `@rewaffle/bootsharp-file-system` is available, letting browser users pick a local JAML folder and read/write files through Motely's generated WASM API:
131
+
132
+ ```tsx
133
+ const library = useJamlLibrary();
134
+ await library.mount();
135
+
136
+ const source = await library.loadFile(library.files[0]);
137
+ await library.saveFile("filters/example.jaml", source);
124
138
  ```
125
139
 
126
140
  ## Peer dependencies
127
141
 
128
142
  | Peer | Required for |
129
- |------|-------------|
143
+ | ---- | ------------ |
130
144
  | `react`, `react-dom` | All components |
131
- | `motely-wasm ^14.3.3` | `jaml-ui/motely`, `AnalyzerExplorer`, `useAnalyzer` data |
145
+ | `motely-wasm ^16.0.1` | `jaml-ui/motely`, `AnalyzerExplorer`, `useSearch`, `useAnalyzer`, `useJamlLibrary` data |
146
+ | `@rewaffle/bootsharp-file-system` | Optional JAML library folder mount support |
132
147
  | `three`, `@react-three/fiber`, `@react-three/drei`, `@react-spring/three` | `jaml-ui/r3f` only |