jaml-ui 4.0.1 → 4.1.1

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/README.md CHANGED
@@ -37,12 +37,16 @@ export default function App() {
37
37
 
38
38
  ## Boot motely-wasm
39
39
 
40
+ `motely-wasm` ships embedded — the boot resources travel inside the module, so `boot()` takes no argument.
41
+
40
42
  ```tsx
41
43
  import bootsharp from "motely-wasm";
42
44
 
43
- await bootsharp.boot("/motely-wasm/bin");
45
+ if (bootsharp.getStatus() === bootsharp.BootStatus.Standby) await bootsharp.boot();
44
46
  ```
45
47
 
48
+ Boot once per JS realm. Each web worker is its own realm, so a worker fleet boots one engine apiece — see the fleet section in the [motely-wasm README](https://www.npmjs.com/package/motely-wasm) for the module-worker and `MessagePort` rules that keep a worker from hanging.
49
+
46
50
  ## MCP App example
47
51
 
48
52
  ```bash
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { MotelyJamlyzerSeedResult } from 'motely-wasm';
3
+ import { ParsedJamlClause } from '../lib/jaml/parseClauses.js';
4
+ export interface JamlyzerBulkProps {
5
+ results: MotelyJamlyzerSeedResult[];
6
+ /** Raw JAML text; used to derive clause identities if `clauses` is not provided. */
7
+ jamlText?: string;
8
+ /** Pre-parsed clauses (alternative to `jamlText`). */
9
+ clauses?: ParsedJamlClause[];
10
+ /** Per-seed per-should-clause tally values, in JAML order. */
11
+ tallies?: (number[] | Int32Array)[];
12
+ /** Optional deck/stake applied to every seed in the bulk view. */
13
+ deck?: number;
14
+ stake?: number;
15
+ }
16
+ export declare function JamlyzerBulk({ results, jamlText, clauses: clausesProp, tallies, deck, stake }: JamlyzerBulkProps): React.JSX.Element;
@@ -1,9 +1,17 @@
1
1
  import { default as React } from 'react';
2
2
  import { MotelyJamlyzerSeedResult, MotelyDeck, MotelyStake } from 'motely-wasm';
3
+ import { ParsedJamlClause } from '../lib/jaml/parseClauses.js';
3
4
  export interface JamlyzerViewProps {
4
5
  result: MotelyJamlyzerSeedResult;
5
6
  deck?: MotelyDeck;
6
7
  stake?: MotelyStake;
7
- maxAnte?: number;
8
+ /** Raw JAML text used to derive clause identities for highlighting. */
9
+ jamlText?: string;
10
+ /** Pre-parsed clauses (alternative to `jamlText`). */
11
+ clauses?: ParsedJamlClause[];
12
+ /** Per-should-clause tally values, in JAML order. */
13
+ tallies?: number[] | Int32Array;
14
+ /** Called when the user hovers a clause in the scoreboard. */
15
+ onHoverClause?: (clause: ParsedJamlClause | null) => void;
8
16
  }
9
- export declare function JamlyzerView({ result, deck, stake, maxAnte }: JamlyzerViewProps): React.JSX.Element;
17
+ export declare function JamlyzerView({ result, deck, stake, jamlText, clauses: clausesProp, tallies, onHoverClause }: JamlyzerViewProps): React.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export { JamlCardRenderer, type JamlCardRendererProps, } from './render/CanvasRenderer.js';
2
2
  export { JamlGameCard, JamlVoucher, JamlTag, JamlBoss, resolveAnalyzerShopItem, type JamlGameCardProps, type AnalyzerShopItem, type AnalyzerResolvedItem, } from './components/GameCard.js';
3
3
  export { JamlyzerView, type JamlyzerViewProps, } from './components/JamlyzerView.js';
4
+ export { JamlyzerBulk, type JamlyzerBulkProps, } from './components/JamlyzerBulk.js';
5
+ export { parseJamlClauses, type ParsedJamlClause, type JamlClauseKind, type JamlItemType, type ParsedJamlFilters, matchClauseToItem, matchClauseToAnte, matchMotelyItemToClause, } from './lib/jaml/parseClauses.js';
4
6
  export { DeckSprite, DECK_SPRITE_POS, STAKE_SPRITE_POS, type DeckSpriteProps, } from './components/DeckSprite.js';
5
7
  export { StandardCard } from './components/StandardCard.js';
6
8
  export { CardSuit, CardRank, CardEnhancement, CardSeal, CardEdition, } from './components/cardEnums.js';