jaml-ui 0.22.1 → 0.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/searchWorker.js +14 -14
- package/dist/hooks/useAnalyzer.d.ts +5 -5
- package/dist/hooks/useSearch.js +3 -2
- package/dist/lib/hooks/useSeedAnalyzer.d.ts +4 -4
- package/dist/ui/ide/AgnosticSeedCard.js +2 -2
- package/dist/ui/ide/WasmStatus.js +2 -2
- package/jaml.schema.json +1 -1
- package/package.json +3 -3
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import motely, {
|
|
1
|
+
import motely, { Motely } from "motely-wasm";
|
|
2
2
|
// Boot motely immediately when this module is loaded
|
|
3
3
|
motely.boot().catch(console.error);
|
|
4
4
|
let activeSearch = null;
|
|
5
5
|
self.addEventListener('message', function (e) {
|
|
6
6
|
const msg = e.data;
|
|
7
7
|
if (msg.type === 'start') {
|
|
8
|
-
const validation = MotelyWasm.validateJaml(msg.jaml);
|
|
8
|
+
const validation = Motely.MotelyWasm.validateJaml(msg.jaml);
|
|
9
9
|
if (validation !== 'valid') {
|
|
10
10
|
self.postMessage({ type: 'error', message: validation });
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
function cleanup() {
|
|
14
|
-
MotelyWasmEvents.notifyResult = () => { };
|
|
15
|
-
MotelyWasmEvents.notifyProgress = () => { };
|
|
16
|
-
MotelyWasmEvents.notifyComplete = () => { };
|
|
14
|
+
Motely.MotelyWasmEvents.notifyResult = () => { };
|
|
15
|
+
Motely.MotelyWasmEvents.notifyProgress = () => { };
|
|
16
|
+
Motely.MotelyWasmEvents.notifyComplete = () => { };
|
|
17
17
|
activeSearch = null;
|
|
18
18
|
}
|
|
19
|
-
MotelyWasmEvents.notifyResult = function (seed, score, tallyColumns) {
|
|
19
|
+
Motely.MotelyWasmEvents.notifyResult = function (seed, score, tallyColumns) {
|
|
20
20
|
self.postMessage({ type: 'result', seed, score, tallyColumns: Array.from(tallyColumns) });
|
|
21
21
|
};
|
|
22
|
-
MotelyWasmEvents.notifyProgress = function (searched, matching) {
|
|
22
|
+
Motely.MotelyWasmEvents.notifyProgress = function (searched, matching) {
|
|
23
23
|
self.postMessage({ type: 'progress', searched: searched.toString(), matching: matching.toString() });
|
|
24
24
|
};
|
|
25
|
-
MotelyWasmEvents.notifyComplete = function (status, searched, matched) {
|
|
25
|
+
Motely.MotelyWasmEvents.notifyComplete = function (status, searched, matched) {
|
|
26
26
|
cleanup();
|
|
27
27
|
self.postMessage({ type: 'complete', status, searched: searched.toString(), matched: matched.toString() });
|
|
28
28
|
};
|
|
29
29
|
try {
|
|
30
30
|
const mode = msg.mode || 'random';
|
|
31
31
|
if (mode === 'random') {
|
|
32
|
-
activeSearch = MotelyWasm.startRandomSearch(msg.jaml, msg.count);
|
|
32
|
+
activeSearch = Motely.MotelyWasm.startRandomSearch(msg.jaml, msg.count);
|
|
33
33
|
}
|
|
34
34
|
else if (mode === 'aesthetic') {
|
|
35
|
-
activeSearch = MotelyWasm.startAestheticSearch(msg.jaml, msg.aesthetic);
|
|
35
|
+
activeSearch = Motely.MotelyWasm.startAestheticSearch(msg.jaml, msg.aesthetic);
|
|
36
36
|
}
|
|
37
37
|
else if (mode === 'seedList') {
|
|
38
|
-
activeSearch = MotelyWasm.startSeedListSearch(msg.jaml, msg.seeds);
|
|
38
|
+
activeSearch = Motely.MotelyWasm.startSeedListSearch(msg.jaml, msg.seeds);
|
|
39
39
|
}
|
|
40
40
|
else if (mode === 'keyword') {
|
|
41
|
-
activeSearch = MotelyWasm.startKeywordSearch(msg.jaml, msg.keywords, msg.padding || '');
|
|
41
|
+
activeSearch = Motely.MotelyWasm.startKeywordSearch(msg.jaml, msg.keywords, msg.padding || '');
|
|
42
42
|
}
|
|
43
43
|
else if (mode === 'sequential') {
|
|
44
|
-
activeSearch = MotelyWasm.startSequentialSearch(msg.jaml, msg.batchCharCount, BigInt(msg.startBatch), BigInt(msg.endBatch));
|
|
44
|
+
activeSearch = Motely.MotelyWasm.startSequentialSearch(msg.jaml, msg.batchCharCount, BigInt(msg.startBatch), BigInt(msg.endBatch));
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
catch (err) {
|
|
@@ -58,7 +58,7 @@ self.addEventListener('message', function (e) {
|
|
|
58
58
|
}
|
|
59
59
|
else if (msg.type === 'get_tally_labels') {
|
|
60
60
|
try {
|
|
61
|
-
const labels = MotelyWasm.getTallyLabels(msg.jaml);
|
|
61
|
+
const labels = Motely.MotelyWasm.getTallyLabels(msg.jaml);
|
|
62
62
|
self.postMessage({ type: 'tally_labels', labels: Array.from(labels) });
|
|
63
63
|
}
|
|
64
64
|
catch (err) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Motely } from "motely-wasm";
|
|
2
2
|
import type { AnalyzerAnteView } from "../components/AnalyzerExplorer.js";
|
|
3
3
|
export type AnalyzerStatus = "idle" | "running" | "done" | "error";
|
|
4
4
|
export type MotelyJsRunState = {
|
|
@@ -12,12 +12,12 @@ export type MotelyJsRunState = {
|
|
|
12
12
|
* into their main bundle.
|
|
13
13
|
*/
|
|
14
14
|
export interface MotelyRuntime {
|
|
15
|
-
MotelyWasm: typeof
|
|
16
|
-
Motely: typeof
|
|
15
|
+
MotelyWasm: typeof Motely.MotelyWasm;
|
|
16
|
+
Motely: typeof Motely;
|
|
17
17
|
}
|
|
18
18
|
export interface AnalyzerLive {
|
|
19
|
-
ctx: ReturnType<typeof
|
|
20
|
-
Motely: typeof
|
|
19
|
+
ctx: ReturnType<typeof Motely.MotelyWasm.createSearchContext>;
|
|
20
|
+
Motely: typeof Motely;
|
|
21
21
|
runStates: Record<number, MotelyJsRunState>;
|
|
22
22
|
desiredNames: ReadonlySet<string>;
|
|
23
23
|
seed: string;
|
package/dist/hooks/useSearch.js
CHANGED
|
@@ -21,8 +21,9 @@ self.addEventListener('message', async function(e) {
|
|
|
21
21
|
try {
|
|
22
22
|
const mod = await import(msg.url);
|
|
23
23
|
await mod.default.boot();
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
const motely = mod.Motely;
|
|
25
|
+
MotelyWasm = motely.MotelyWasm;
|
|
26
|
+
MotelyWasmEvents = motely.MotelyWasmEvents;
|
|
26
27
|
self.postMessage({ type: 'ready' });
|
|
27
28
|
} catch (err) {
|
|
28
29
|
self.postMessage({ type: 'error', message: String(err) });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Motely } from "motely-wasm";
|
|
2
2
|
export interface MotelyRuntime {
|
|
3
|
-
MotelyWasm: typeof
|
|
4
|
-
Motely: typeof
|
|
3
|
+
MotelyWasm: typeof Motely.MotelyWasm;
|
|
4
|
+
Motely: typeof Motely;
|
|
5
5
|
}
|
|
6
6
|
export declare function useSeedAnalyzer(runtime: MotelyRuntime | null, seed: string | null): {
|
|
7
|
-
data: Analysis.MotelyLegacyTextAnalyzer | null | undefined;
|
|
7
|
+
data: Motely.Analysis.MotelyLegacyTextAnalyzer | null | undefined;
|
|
8
8
|
loading: boolean;
|
|
9
9
|
error: string | null;
|
|
10
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
|
-
import motely, {
|
|
4
|
+
import motely, { Motely } from 'motely-wasm';
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
6
|
import { DeckSprite } from './DeckSprite';
|
|
7
7
|
import { Loader2, Sparkles } from 'lucide-react';
|
|
@@ -17,7 +17,7 @@ export function AgnosticSeedCard({ seed, deckSlug = 'Erratic', stakeSlug = 'Whit
|
|
|
17
17
|
try {
|
|
18
18
|
await motely.boot();
|
|
19
19
|
const jaml = `version: 1\nconfig:\n deck: ${deckSlug}\n stake: ${stakeSlug}\n`;
|
|
20
|
-
const rawData = MotelyWasm.analyzeJamlSeeds(jaml, [seed]);
|
|
20
|
+
const rawData = Motely.MotelyWasm.analyzeJamlSeeds(jaml, [seed]);
|
|
21
21
|
if (rawData && rawData.seeds.length > 0) {
|
|
22
22
|
const seedData = rawData.seeds[0];
|
|
23
23
|
// The UI needs score and matches. The WASM provides score and tallies, but no matches yet.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
|
-
import motely, {
|
|
4
|
+
import motely, { Motely } from 'motely-wasm';
|
|
5
5
|
import { Cpu, Loader2, CheckCircle2, XCircle } from 'lucide-react';
|
|
6
6
|
import { cn } from '../../lib/utils';
|
|
7
7
|
export function WasmStatus() {
|
|
@@ -16,7 +16,7 @@ export function WasmStatus() {
|
|
|
16
16
|
await motely.boot();
|
|
17
17
|
if (cancelled)
|
|
18
18
|
return;
|
|
19
|
-
setVersion(MotelyWasm.getVersion());
|
|
19
|
+
setVersion(Motely.MotelyWasm.getVersion());
|
|
20
20
|
setStatus('ready');
|
|
21
21
|
}
|
|
22
22
|
catch (err) {
|
package/jaml.schema.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://www.seedfinder.app/jaml.schema.json",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.4.0",
|
|
5
5
|
"title": "JAML — Jimbo's Ante Markup Language",
|
|
6
6
|
"description": "JSON Schema for JAML (.jaml), Motely's Balatro seed search language. Use it for validation, completions, and editor tooling.",
|
|
7
7
|
"type": "object",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jaml-ui",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.3",
|
|
4
4
|
"description": "Balatro rendering components, sprite metadata, and optional Motely helpers for React apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@react-three/drei": ">=9.0.0",
|
|
77
77
|
"@react-three/fiber": ">=8.0.0",
|
|
78
78
|
"monaco-editor": ">=0.50.0",
|
|
79
|
-
"motely-wasm": "^14.
|
|
79
|
+
"motely-wasm": "^14.4.0",
|
|
80
80
|
"react": "^18.2.0 || ^19.0.0",
|
|
81
81
|
"react-dom": "^18.2.0 || ^19.0.0",
|
|
82
82
|
"react-icons": ">=5.0.0",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"@vitest/browser-playwright": "^4.1.5",
|
|
122
122
|
"@vitest/coverage-v8": "^4.1.5",
|
|
123
123
|
"monaco-editor": "^0.55.1",
|
|
124
|
-
"motely-wasm": "^14.
|
|
124
|
+
"motely-wasm": "^14.4.0",
|
|
125
125
|
"playwright": "^1.59.1",
|
|
126
126
|
"react": "^19.2.4",
|
|
127
127
|
"react-dom": "^19.2.4",
|