jaml-ui 1.0.2 → 2.0.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 (49) hide show
  1. package/README.md +1 -15
  2. package/dist/assets/searchPoolWorker-CGxhF1pC.js +2 -0
  3. package/dist/assets/searchPoolWorker-CGxhF1pC.js.map +1 -0
  4. package/dist/chunks/{motelyItemFormats-Dyq1BINO.js → runtime-CW7XHgOy.js} +465 -278
  5. package/dist/chunks/runtime-CW7XHgOy.js.map +1 -0
  6. package/dist/chunks/searchPoolWorker-CEdClSPb.js +11 -0
  7. package/dist/chunks/searchPoolWorker-CEdClSPb.js.map +1 -0
  8. package/dist/chunks/{ui-LfKBGL5-.js → ui-CyhuNM51.js} +736 -680
  9. package/dist/chunks/ui-CyhuNM51.js.map +1 -0
  10. package/dist/components/JamlAestheticSelector.d.ts +1 -1
  11. package/dist/components/JamlIdeToolbar.d.ts +2 -3
  12. package/dist/components/JimmolateEditor.d.ts +47 -0
  13. package/dist/components/SeedFinderApp.d.ts +1 -1
  14. package/dist/components/jamlMap/JokerPicker.d.ts +2 -2
  15. package/dist/components/jamlMap/MysterySlot.d.ts +2 -2
  16. package/dist/components/jamlMap/jokerRarity.d.ts +6 -0
  17. package/dist/decode/motelyItemDecoder.d.ts +0 -2
  18. package/dist/hooks/useSearch.d.ts +3 -3
  19. package/dist/hooks/useSearchPool.d.ts +1 -1
  20. package/dist/index.d.ts +1 -4
  21. package/dist/index.js +12835 -4177
  22. package/dist/index.js.map +1 -1
  23. package/dist/lib/jaml/jamlLangCodemirror.d.ts +13 -0
  24. package/dist/lib/motely/motelyCompatEnums.d.ts +349 -0
  25. package/dist/lib/motely/runtime.d.ts +7 -4
  26. package/dist/lib/types.d.ts +1 -1
  27. package/dist/motely.d.ts +3 -2
  28. package/dist/motely.js +48 -220
  29. package/dist/motely.js.map +1 -1
  30. package/dist/r3f/Card3D.d.ts +55 -0
  31. package/dist/r3f/CardTable.d.ts +35 -0
  32. package/dist/r3f.d.ts +2 -0
  33. package/dist/ui/JimboPicker.d.ts +28 -0
  34. package/dist/ui/hooks.d.ts +1 -3
  35. package/dist/ui/jimbo.css +1 -1
  36. package/dist/ui.d.ts +1 -0
  37. package/dist/ui.js +3 -2
  38. package/package.json +25 -19
  39. package/dist/assets/searchPoolWorker-DHh9a5GD.js +0 -40
  40. package/dist/assets/searchPoolWorker-DHh9a5GD.js.map +0 -1
  41. package/dist/chunks/motelyItemFormats-Dyq1BINO.js.map +0 -1
  42. package/dist/chunks/searchPoolWorker-DgRqVj_q.js +0 -8
  43. package/dist/chunks/searchPoolWorker-DgRqVj_q.js.map +0 -1
  44. package/dist/chunks/ui-LfKBGL5-.js.map +0 -1
  45. package/dist/components/JamlCurator.d.ts +0 -1
  46. package/dist/components/Jamlyzer.d.ts +0 -8
  47. package/dist/hooks/useAnalyzer.d.ts +0 -16
  48. package/dist/lib/hooks/useSeedAnalyzer.d.ts +0 -13
  49. package/dist/lib/utils.d.ts +0 -2
@@ -1,4 +1,4 @@
1
- import { JamlAesthetic } from 'motely-wasm';
1
+ import { JamlAesthetic } from 'motely-wasm/motely/filters/jaml';
2
2
  export interface JamlAestheticSelectorProps {
3
3
  value?: JamlAesthetic | null;
4
4
  onChange: (aesthetic: JamlAesthetic | null) => void;
@@ -1,14 +1,13 @@
1
- export type JamlIdeMode = "visual" | "code" | "map" | "results" | "jamlyzer";
1
+ export type JamlIdeMode = "visual" | "code" | "map" | "results";
2
2
  export interface JamlIdeToolbarProps {
3
3
  mode: JamlIdeMode;
4
4
  onModeChange: (mode: JamlIdeMode) => void;
5
5
  resultCount?: number;
6
6
  showResultsTab?: boolean;
7
- showJamlyzerTab?: boolean;
8
7
  className?: string;
9
8
  onSearch?: () => void;
10
9
  isSearching?: boolean;
11
10
  onLoadFile?: () => void;
12
11
  isLoadingFile?: boolean;
13
12
  }
14
- export declare function JamlIdeToolbar({ mode, onModeChange, resultCount, showResultsTab, showJamlyzerTab, className, onSearch, isSearching, onLoadFile, isLoadingFile, }: JamlIdeToolbarProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function JamlIdeToolbar({ mode, onModeChange, resultCount, showResultsTab, className, onSearch, isSearching, onLoadFile, isLoadingFile, }: JamlIdeToolbarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * A Jimmolate predicate: per-seed JavaScript that runs over each SCORED result
3
+ * from the Motely search (bound to `Motely.jimmolatePredicate` pre-boot — see
4
+ * lib/motely/runtime.ts), layered on top of the JAML must/should/mustNot
5
+ * clauses. Return `true` to keep a seed, `false` to reject it.
6
+ */
7
+ export type JimmolatePredicate = (seed: string, score?: number, tallies?: number[]) => boolean;
8
+ /** Result of compiling the predicate source. */
9
+ export interface JimmolateCompileResult {
10
+ predicate: JimmolatePredicate | null;
11
+ error: string | null;
12
+ }
13
+ /**
14
+ * Compile a Jimmolate source body into a callable predicate. The body runs with
15
+ * `seed`, `score`, and `tallies` in scope and is expected to `return` a boolean.
16
+ *
17
+ * NOTE: this evaluates user-authored JavaScript via `new Function` BY DESIGN —
18
+ * Jimmolate is "bring your own filter". It runs only on the author's machine
19
+ * against their own seeds, exactly like the C#-side predicate it feeds.
20
+ */
21
+ export declare function compileJimmolate(source: string): JimmolateCompileResult;
22
+ export interface JimmolateEditorProps {
23
+ /** Initial predicate source (uncontrolled). Defaults to a worked example. */
24
+ defaultValue?: string;
25
+ /** Fired whenever the source text changes. */
26
+ onChange?: (source: string) => void;
27
+ /** Fired whenever the source compiles (or fails to). */
28
+ onPredicateChange?: (result: JimmolateCompileResult) => void;
29
+ /** Initial enabled state (uncontrolled). Defaults to true. */
30
+ defaultEnabled?: boolean;
31
+ /** Fired when the enable toggle flips. */
32
+ onEnabledChange?: (enabled: boolean) => void;
33
+ /** Seed prefilled into the test row. */
34
+ testSeed?: string;
35
+ /** Min height of the code area in px. */
36
+ minHeight?: number;
37
+ className?: string;
38
+ }
39
+ /**
40
+ * JimmolateEditor — author, compile, and smoke-test a Jimmolate predicate.
41
+ *
42
+ * Emits the compiled predicate via `onPredicateChange`; wire that into
43
+ * `useSearch().startAesthetic(jaml, aesthetic, predicate)` (or the seedlist /
44
+ * random variants) when enabled. Purely an authoring surface — it does not boot
45
+ * Motely or run a search itself.
46
+ */
47
+ export declare function JimmolateEditor({ defaultValue, onChange, onPredicateChange, defaultEnabled, onEnabledChange, testSeed, minHeight, className, }: JimmolateEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { MotelyDeck, MotelyStake } from 'motely-wasm';
1
+ import { MotelyDeck, MotelyStake } from 'motely-wasm/motely/enums';
2
2
  export interface SeedFinderAppProps {
3
3
  initialJaml?: string;
4
4
  initialDeck?: keyof typeof MotelyDeck;
@@ -1,6 +1,6 @@
1
- import { MotelyJokerRarity } from 'motely-wasm';
1
+ import { JokerRarityTier } from './jokerRarity.js';
2
2
  import { SlotSelection } from './MysterySlot.js';
3
- export type JokerRarity = MotelyJokerRarity;
3
+ export type JokerRarity = JokerRarityTier;
4
4
  export interface JokerPickerProps {
5
5
  onSelect: (selection: SlotSelection) => void;
6
6
  onCancel?: () => void;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { MotelyJokerRarity } from 'motely-wasm';
2
+ import { JokerRarityTier } from './jokerRarity.js';
3
3
  import { SpriteSheetType } from '../../sprites/spriteMapper.js';
4
4
  export type JamlZone = "must" | "should" | "mustnot";
5
5
  /** The item category that can appear in a slot. */
@@ -16,7 +16,7 @@ export interface SlotSelection {
16
16
  /** Optional source pack indices for pack-derived item clauses. */
17
17
  boosterPacks?: number[];
18
18
  /** Optional rarity for jokers. */
19
- rarity?: MotelyJokerRarity;
19
+ rarity?: JokerRarityTier;
20
20
  }
21
21
  export interface MysterySlotProps {
22
22
  /** Which zone this slot belongs to — determines border color. */
@@ -0,0 +1,6 @@
1
+ export declare enum JokerRarityTier {
2
+ Common = 0,
3
+ Uncommon = 1,
4
+ Rare = 2,
5
+ Legendary = 3
6
+ }
@@ -52,5 +52,3 @@ export declare function motelyStandardcardSuitName(input: MotelyItemInput): "Clu
52
52
  export declare function decodeMotelyItemName(input: MotelyItemInput): string;
53
53
  export declare function decodeMotelyItem(input: MotelyItemInput): DecodedMotelyItem | null;
54
54
  export declare function decodeMotelyItemToJamlCard(input: MotelyItemInput, scale?: number): MotelyJamlCard | null;
55
- export declare function warmMotelyItemCache(): void;
56
- export declare function motelyItemCacheSize(): number;
@@ -15,9 +15,9 @@ export interface UseSearchState {
15
15
  tallyLabels: string[];
16
16
  }
17
17
  export declare function useSearch(): {
18
- startAesthetic: (jaml: string, aesthetic: number, predicate?: (seed: string, deck?: number, stake?: number) => boolean) => Promise<void>;
19
- startSeedList: (jaml: string, seeds: string[], predicate?: (seed: string, deck?: number, stake?: number) => boolean) => Promise<void>;
20
- startRandom: (jaml: string, count: number, predicate?: (seed: string, deck?: number, stake?: number) => boolean) => Promise<void>;
18
+ startAesthetic: (jaml: string, aesthetic: number, predicate?: (seed: string, score?: number, tallies?: number[]) => boolean) => Promise<void>;
19
+ startSeedList: (jaml: string, seeds: string[], predicate?: (seed: string, score?: number, tallies?: number[]) => boolean) => Promise<void>;
20
+ startRandom: (jaml: string, count: number, predicate?: (seed: string, score?: number, tallies?: number[]) => boolean) => Promise<void>;
21
21
  cancel: () => void;
22
22
  reset: () => void;
23
23
  clearError: () => void;
@@ -1,4 +1,4 @@
1
- import { JamlAesthetic } from 'motely-wasm';
1
+ import { JamlAesthetic } from 'motely-wasm/motely/filters/jaml';
2
2
  import { SearchResult, SearchStatus } from './useSearch.js';
3
3
  export interface UseSearchPoolState {
4
4
  results: SearchResult[];
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ export { JamlCardRenderer, type JamlCardRendererProps } from './render/CanvasRen
2
2
  export { JamlGameCard, JamlVoucher, JamlTag, JamlBoss, resolveAnalyzerShopItem, type JamlGameCardProps, type AnalyzerShopItem, type AnalyzerResolvedItem, } from './components/GameCard.js';
3
3
  export { JamlMapPreview, type JamlMapPreviewProps } from './components/JamlMapPreview.js';
4
4
  export { JamlIde, type JamlIdeProps, type JamlIdeSearchResult, type JamlVisualFilter, type JamlVisualClause, type JamlZone, } from './components/JamlIde.js';
5
- export { JamlCurator } from './components/JamlCurator.js';
6
5
  export { JamlIdeVisual, type JamlIdeVisualProps, } from './components/JamlIdeVisual.js';
7
6
  export { JamlCodeEditor, type JamlCodeEditorProps, } from './components/JamlCodeEditor.js';
8
7
  export * from './ui.js';
@@ -18,13 +17,11 @@ export { extractVisualJamlItems, type JamlPreviewGroups, type JamlPreviewItem, t
18
17
  export { useMotelyStream, type StreamItem, type StreamState } from './hooks/useShopStream.js';
19
18
  export { useSearch, type SearchResult, type SearchMode, type SearchStatus, type UseSearchState, } from './hooks/useSearch.js';
20
19
  export { useSearchPool, type StartPoolOptions, type UseSearchPoolOptions, type UseSearchPoolState, } from './hooks/useSearchPool.js';
21
- export { useAnalyzer, type AnalyzerStatus, } from './hooks/useAnalyzer.js';
22
20
  export { PaginatedFilterBrowser, type PaginatedFilterBrowserProps, type FilterItem, } from './components/PaginatedFilterBrowser.js';
23
21
  export { JamlAestheticSelector, type JamlAestheticSelectorProps, } from './components/JamlAestheticSelector.js';
24
- export { JamlAesthetic } from 'motely-wasm';
22
+ export { JamlAesthetic } from 'motely-wasm/motely/filters/jaml';
25
23
  export { JamlSeedInput, type JamlSeedInputProps, type JamlSeedInputVariant, } from './components/JamlSeedInput.js';
26
24
  export { normalizeJamlSeed } from './components/jamlSeedUtils.js';
27
25
  export { JamlSeedSpinner, type JamlSeedSpinnerProps, } from './components/JamlSeedSpinner.js';
28
- export { Jamlyzer, type JamlyzerProps } from './components/Jamlyzer.js';
29
26
  export { RunConfigModal, type RunConfigModalProps } from './components/RunConfigModal.js';
30
27
  export { JamlMapEditor, JokerPicker, MysterySlot, CategoryPicker, type JamlMapEditorProps, type JokerPickerProps, type JokerRarity, type MysterySlotProps, type SlotCategory, type SlotSelection, type CategoryPickerConfig, type CategoryPickerProps, VOUCHER_PICKER_CONFIG, TAG_PICKER_CONFIG, BOSS_PICKER_CONFIG, TAROT_PICKER_CONFIG, PLANET_PICKER_CONFIG, SPECTRAL_PICKER_CONFIG, PACK_PICKER_CONFIG, } from './components/jamlMap/index.js';