jaml-ui 4.3.1 → 4.6.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 (104) hide show
  1. package/assets/jammy-seed-mascot.png +0 -0
  2. package/dist/assets/8BitDeck-B09C1jGy.png +0 -0
  3. package/dist/assets/BlindChips-Bnvhn76w.png +0 -0
  4. package/dist/assets/Boosters-Bqv_YhIn.png +0 -0
  5. package/dist/assets/Editions-B3YPqPOl.png +0 -0
  6. package/dist/assets/Enhancers-DhIlUuTX.png +0 -0
  7. package/dist/assets/Jokers-1egXSFFQ.png +0 -0
  8. package/dist/assets/Tarots-DkrFk7iW.png +0 -0
  9. package/dist/assets/Vouchers-Cdp8BeSE.png +0 -0
  10. package/dist/assets/balatro-stake-chips-BdO-bw7c.png +0 -0
  11. package/dist/assets/jammy-seed-mascot-BdoW3O33.png +0 -0
  12. package/dist/assets/m6x11plus-C8RqtTtG.ttf +0 -0
  13. package/dist/assets/stickers-B6y5vEyc.png +0 -0
  14. package/dist/assets/tags-BdxcVWR4.png +0 -0
  15. package/dist/chunks/JimboSwipeDeck-DbzWak3V.js +2051 -0
  16. package/dist/chunks/JimboSwipeDeck-DbzWak3V.js.map +1 -0
  17. package/dist/chunks/spriteMapper-gImEz0wa.js +501 -0
  18. package/dist/chunks/spriteMapper-gImEz0wa.js.map +1 -0
  19. package/dist/components/DailyRitualView.d.ts +17 -0
  20. package/dist/components/DeckStakePicker.d.ts +12 -0
  21. package/dist/components/JamlIde.d.ts +9 -0
  22. package/dist/components/JamlIdeToolbar.d.ts +2 -5
  23. package/dist/components/JamlIdeVisual.d.ts +30 -0
  24. package/dist/components/JamlMapPreview.d.ts +12 -0
  25. package/dist/components/Jamlyzer.d.ts +14 -2
  26. package/dist/components/JamlyzerBulk.d.ts +5 -4
  27. package/dist/components/JamlyzerView.d.ts +1 -12
  28. package/dist/components/SeedLab.d.ts +12 -0
  29. package/dist/components/jamlSeedUtils.d.ts +1 -0
  30. package/dist/components/jamlyzer/JamlyzerAnteDetails.d.ts +4 -0
  31. package/dist/components/jamlyzer/JamlyzerErraticDeck.d.ts +2 -2
  32. package/dist/components/jamlyzer/JamlyzerPackSection.d.ts +1 -5
  33. package/dist/components/jamlyzer/JamlyzerPulls.d.ts +2 -2
  34. package/dist/components/jamlyzer/JamlyzerSeedCard.d.ts +21 -0
  35. package/dist/components/jamlyzer/JamlyzerTape.d.ts +10 -0
  36. package/dist/components/jamlyzer/highlight.d.ts +3 -3
  37. package/dist/core.js +2 -2
  38. package/dist/decode/motelyItemDecoder.d.ts +1 -0
  39. package/dist/decode/motelySprite.d.ts +10 -13
  40. package/dist/decode/motelySpriteLut.generated.d.ts +2 -0
  41. package/dist/index.d.ts +13 -1
  42. package/dist/index.js +20903 -17732
  43. package/dist/index.js.map +1 -1
  44. package/dist/json-render/JimboJsonRenderer.d.ts +21 -0
  45. package/dist/json-render/catalog.d.ts +304 -180
  46. package/dist/json-render/index.d.ts +5 -30
  47. package/dist/json-render/registry.d.ts +2 -12
  48. package/dist/lib/daily/ritual.d.ts +43 -0
  49. package/dist/lib/jaml/{parseClauses.d.ts → jaml.d.ts} +17 -13
  50. package/dist/lib/jaml/rarity.d.ts +53 -0
  51. package/dist/lib/jaml/rarityData.generated.d.ts +727 -0
  52. package/dist/ui/JimboApp.d.ts +8 -6
  53. package/dist/ui/JimboBackground.d.ts +5 -13
  54. package/dist/ui/JimboBox.d.ts +16 -0
  55. package/dist/ui/JimboButton.d.ts +1 -1
  56. package/dist/ui/JimboCanvas.d.ts +12 -0
  57. package/dist/ui/JimboDock.d.ts +21 -0
  58. package/dist/ui/JimboInline.d.ts +11 -0
  59. package/dist/ui/JimboLink.d.ts +11 -0
  60. package/dist/ui/JimboMascot.d.ts +51 -5
  61. package/dist/ui/JimboOrbitalMenu.d.ts +81 -9
  62. package/dist/ui/JimboPanelSpinner.d.ts +14 -0
  63. package/dist/ui/JimboPicker.d.ts +1 -1
  64. package/dist/ui/JimboSeedCopyChip.d.ts +1 -2
  65. package/dist/ui/JimboShopBelt.d.ts +9 -0
  66. package/dist/ui/dockTree.d.ts +31 -0
  67. package/dist/ui/hooks.d.ts +1 -1
  68. package/dist/ui/jammySeedMascotImage.d.ts +1 -1
  69. package/dist/ui/jimbo.css +1 -1
  70. package/dist/ui/orbitalLayout.d.ts +149 -0
  71. package/dist/ui/orbitalMenuStore.d.ts +70 -0
  72. package/dist/ui/tokens.d.ts +9 -36
  73. package/dist/ui/useMotionPreference.d.ts +19 -0
  74. package/dist/ui.d.ts +20 -2
  75. package/dist/ui.js +77 -30
  76. package/dist/vocab.d.ts +26 -0
  77. package/package.json +36 -40
  78. package/README.md +0 -78
  79. package/assets/fonts/README.md +0 -14
  80. package/dist/chunks/JimboSwipeDeck-D2AVuZep.js +0 -967
  81. package/dist/chunks/JimboSwipeDeck-D2AVuZep.js.map +0 -1
  82. package/dist/chunks/motelyItemDecoder-Cb-RjvQ0.js +0 -692
  83. package/dist/chunks/motelyItemDecoder-Cb-RjvQ0.js.map +0 -1
  84. package/dist/chunks/spriteMapper-Dfr2_j0_.js +0 -501
  85. package/dist/chunks/spriteMapper-Dfr2_j0_.js.map +0 -1
  86. package/dist/components/jamlyzer/JamlyzerRail.d.ts +0 -14
  87. package/dist/json-render/builders/analyzer.d.ts +0 -23
  88. package/dist/json-render/builders/encyclopedia.d.ts +0 -14
  89. package/dist/json-render/builders/search.d.ts +0 -24
  90. package/dist/json-render/components/domain.d.ts +0 -59
  91. package/dist/json-render/components/game.d.ts +0 -18
  92. package/dist/json-render/components/layout.d.ts +0 -47
  93. package/dist/json-render/components/mascot.d.ts +0 -23
  94. package/dist/json-render/components/reference.d.ts +0 -39
  95. package/dist/json-render/engine.d.ts +0 -38
  96. package/dist/json-render/knowledge/bosses.d.ts +0 -18
  97. package/dist/json-render/knowledge/decks.d.ts +0 -22
  98. package/dist/json-render/knowledge/jokers.d.ts +0 -23
  99. package/dist/json-render/knowledge/synergies.d.ts +0 -21
  100. package/dist/lib/motely/jamlParse.d.ts +0 -4
  101. package/dist/lib/motely/runtime.d.ts +0 -1
  102. package/dist/motely.d.ts +0 -4
  103. package/dist/motely.js +0 -84
  104. package/dist/motely.js.map +0 -1
@@ -1,14 +0,0 @@
1
- import { ParsedJamlClause } from '../../lib/jaml/parseClauses.js';
2
- export interface JamlyzerRailProps {
3
- /** All parsed JAML clauses; the scoreboard lists them above the ante buttons. */
4
- clauses: ParsedJamlClause[];
5
- /** Per-should-clause tally values, in JAML order. */
6
- tallies?: number[] | Int32Array;
7
- anteNumbers: number[];
8
- availableAntes: Set<number>;
9
- selectedAnte: number;
10
- onSelectAnte: (ante: number) => void;
11
- onHoverClause: (clause: ParsedJamlClause | null) => void;
12
- }
13
- /** Left rail: clause scoreboard (hover to spotlight matches) + ante picker. */
14
- export declare function JamlyzerRail({ clauses, tallies, anteNumbers, availableAntes, selectedAnte, onSelectAnte, onHoverClause, }: JamlyzerRailProps): import("react").JSX.Element;
@@ -1,23 +0,0 @@
1
- import { JsonNode } from '../engine.js';
2
- /**
3
- * Build a json-render spec for seed analysis results.
4
- *
5
- * Shows the full breakdown of a single seed: jokers, shop, blinds, etc.
6
- */
7
- export interface AnalyzerResult {
8
- seed: string;
9
- jokers: Array<{
10
- name: string;
11
- edition?: string;
12
- seal?: string;
13
- isEternal?: boolean;
14
- }>;
15
- shopItems?: Array<{
16
- name: string;
17
- type: string;
18
- edition?: string;
19
- }>;
20
- score?: number;
21
- notes?: string[];
22
- }
23
- export declare function buildAnalyzerSpec(result: AnalyzerResult): JsonNode;
@@ -1,14 +0,0 @@
1
- import { JsonNode } from '../engine.js';
2
- /**
3
- * Build a json-render spec for the encyclopedia view.
4
- *
5
- * Shows joker info, synergies, and strategy advice for a set of jokers.
6
- */
7
- export interface EncyclopediaParams {
8
- jokers: string[];
9
- decks?: string[];
10
- stakes?: string[];
11
- bosses?: string[];
12
- showStrategies?: boolean;
13
- }
14
- export declare function buildEncyclopediaSpec(params: EncyclopediaParams): JsonNode;
@@ -1,24 +0,0 @@
1
- import { JsonNode } from '../engine.js';
2
- /**
3
- * Build a json-render spec for search results.
4
- *
5
- * Pure function. Converts raw Motely search data into a JsonNode tree.
6
- * The tree renders into a full search UI via `render(spec, registry)`.
7
- */
8
- export interface SearchResult {
9
- seed: string;
10
- score: number;
11
- highlights?: string[];
12
- jokers?: string[];
13
- edition?: string;
14
- }
15
- export interface SearchParams {
16
- status: "idle" | "running" | "completed" | "error";
17
- seedsSearched?: string;
18
- matchesFound?: number;
19
- seedsPerSecond?: number;
20
- elapsed?: string;
21
- error?: string | null;
22
- results: SearchResult[];
23
- }
24
- export declare function buildSearchSpec(params: SearchParams): JsonNode;
@@ -1,59 +0,0 @@
1
- import { FC } from 'react';
2
- /**
3
- * Domain components — SearchStats, ErrorBanner, LoadingPulse, SeedCard, etc.
4
- *
5
- * Balatro-specific json-render nodes, composed from Jimbo primitives.
6
- * Interactive controls are the real Jimbo button primitives; status, error,
7
- * and layout chrome come from src/ui/ so there is one grammar, not two.
8
- */
9
- export interface SearchStatsProps {
10
- status: "idle" | "running" | "completed" | "error";
11
- seedsSearched?: string;
12
- matchesFound?: number;
13
- seedsPerSecond?: number;
14
- elapsed?: string;
15
- className?: string;
16
- }
17
- export declare const SearchStats: FC<SearchStatsProps>;
18
- export interface ErrorBannerProps {
19
- message: string;
20
- onDismiss?: boolean;
21
- className?: string;
22
- }
23
- export declare const ErrorBanner: FC<ErrorBannerProps>;
24
- export interface LoadingPulseProps {
25
- text?: string;
26
- className?: string;
27
- }
28
- export declare const LoadingPulse: FC<LoadingPulseProps>;
29
- export interface SeedCardProps {
30
- seed: string;
31
- score?: number;
32
- rank?: number;
33
- highlights?: string[];
34
- jokers?: string[];
35
- edition?: string;
36
- onClick?: boolean;
37
- className?: string;
38
- }
39
- export declare const SeedCard: FC<SeedCardProps>;
40
- export interface SeedListProps {
41
- seeds: string[];
42
- scores?: number[];
43
- total?: number;
44
- pageSize?: number;
45
- className?: string;
46
- }
47
- export declare const SeedList: FC<SeedListProps>;
48
- export interface JokerBadgeProps {
49
- name: string;
50
- edition?: "Foil" | "Holographic" | "Polychrome" | "Negative";
51
- rarity?: "Common" | "Uncommon" | "Rare" | "Legendary";
52
- className?: string;
53
- }
54
- export declare const JokerBadge: FC<JokerBadgeProps>;
55
- export interface EditionBadgeProps {
56
- edition: "Foil" | "Holographic" | "Polychrome" | "Negative";
57
- className?: string;
58
- }
59
- export declare const EditionBadge: FC<EditionBadgeProps>;
@@ -1,18 +0,0 @@
1
- import { FC } from 'react';
2
- /**
3
- * Game Card wrapper — bridges json-render to jaml-ui's sprite system.
4
- */
5
- export interface JamlGameCardProps {
6
- type: "joker" | "consumable" | "playing";
7
- card: {
8
- name: string;
9
- edition?: string;
10
- seal?: string;
11
- isEternal?: boolean;
12
- isPerishable?: boolean;
13
- isRental?: boolean;
14
- scale?: number;
15
- };
16
- className?: string;
17
- }
18
- export declare const JamlGameCard: FC<JamlGameCardProps>;
@@ -1,47 +0,0 @@
1
- import { default as React } from 'react';
2
- import { JimboBadgeTone } from '../../ui/JimboBadge.js';
3
- export interface PanelProps {
4
- title?: string;
5
- subtitle?: string;
6
- variant?: "default" | "accent" | "muted";
7
- className?: string;
8
- children?: React.ReactNode;
9
- }
10
- export declare const Panel: React.FC<PanelProps>;
11
- export interface StackProps {
12
- gap?: number;
13
- align?: "start" | "center" | "end" | "stretch";
14
- className?: string;
15
- children?: React.ReactNode;
16
- }
17
- export declare const Stack: React.FC<StackProps>;
18
- export interface GridProps {
19
- columns?: number;
20
- gap?: number;
21
- className?: string;
22
- children?: React.ReactNode;
23
- }
24
- export declare const Grid: React.FC<GridProps>;
25
- export interface TextProps {
26
- body: string;
27
- variant?: "title" | "body" | "muted" | "accent" | "error";
28
- className?: string;
29
- children?: React.ReactNode;
30
- }
31
- export declare const Text: React.FC<TextProps>;
32
- export interface SpacerProps {
33
- size?: number;
34
- }
35
- export declare const Spacer: React.FC<SpacerProps>;
36
- export interface DividerProps {
37
- className?: string;
38
- }
39
- export declare const Divider: React.FC<DividerProps>;
40
- export type BadgeTone = "red" | "blue" | "green" | "orange" | "gold" | "purple" | "grey";
41
- export interface BadgeProps {
42
- label: string;
43
- tone?: BadgeTone;
44
- className?: string;
45
- }
46
- export declare function badgeToneToJimbo(tone: BadgeTone): JimboBadgeTone;
47
- export declare const Badge: React.FC<BadgeProps>;
@@ -1,23 +0,0 @@
1
- import { FC } from 'react';
2
- import { JimboMascotProps } from '../../ui/JimboMascot.js';
3
- import { JimboOrbitalMenuProps } from '../../ui/JimboOrbitalMenu.js';
4
- import { BadgeTone } from './layout.js';
5
- /**
6
- * json-render mascot nodes — thin adapters over the JimboMascot /
7
- * JimboOrbitalMenu primitives in src/ui/. The adapter exists so json-render
8
- * schemas can keep using the badge-tone vocabulary ("gold" included) while
9
- * the primitive speaks real Jimbo tones.
10
- */
11
- export interface JammyOrbitalMenuItem {
12
- label: string;
13
- action: string;
14
- tone?: BadgeTone;
15
- }
16
- export interface JammyOrbitalMenuProps extends Omit<JimboOrbitalMenuProps, "items"> {
17
- items: JammyOrbitalMenuItem[];
18
- }
19
- export declare const JammyOrbitalMenu: FC<JammyOrbitalMenuProps>;
20
- export interface JammyMascotProps extends Omit<JimboMascotProps, "menuItems"> {
21
- menuItems?: JammyOrbitalMenuItem[];
22
- }
23
- export declare const JammyMascot: FC<JammyMascotProps>;
@@ -1,39 +0,0 @@
1
- import { FC } from 'react';
2
- /**
3
- * Reference Components — Encyclopedia UI for Balatro entities.
4
- *
5
- * Composed from Jimbo primitives: JimboRow (between / wrap) for header and
6
- * pill rows, JimboInnerPanel for the code snippet, Panel/Stack/Text/Badge/
7
- * Divider from the layout adapters.
8
- */
9
- export interface JokerCardProps {
10
- name: string;
11
- showSynergies?: boolean;
12
- className?: string;
13
- }
14
- export declare const JokerCard: FC<JokerCardProps>;
15
- export interface SynergyCardProps {
16
- name: string;
17
- className?: string;
18
- }
19
- export declare const SynergyCard: FC<SynergyCardProps>;
20
- export interface BossBlindCardProps {
21
- name: string;
22
- className?: string;
23
- }
24
- export declare const BossBlindCard: FC<BossBlindCardProps>;
25
- export interface DeckCardProps {
26
- name: string;
27
- className?: string;
28
- }
29
- export declare const DeckCard: FC<DeckCardProps>;
30
- export interface StakeCardProps {
31
- name: string;
32
- className?: string;
33
- }
34
- export declare const StakeCard: FC<StakeCardProps>;
35
- export interface StrategyAdvisorProps {
36
- jokers: string[];
37
- className?: string;
38
- }
39
- export declare const StrategyAdvisor: FC<StrategyAdvisorProps>;
@@ -1,38 +0,0 @@
1
- import { default as React, ReactNode } from 'react';
2
- /**
3
- * json-render — Zero-dependency JSON-to-React engine.
4
- *
5
- * A JsonNode is a plain JSON object describing a UI tree.
6
- * A Registry maps type names to React components.
7
- * render() walks the tree and returns React nodes.
8
- */
9
- export interface JsonNode {
10
- type: string;
11
- props?: Record<string, unknown>;
12
- children?: JsonNode[];
13
- }
14
- export type ComponentProps<P = Record<string, unknown>> = P & {
15
- children?: ReactNode;
16
- };
17
- export type Registry = Record<string, React.ComponentType<any>>;
18
- /**
19
- * Render a JsonNode tree using the provided Registry.
20
- *
21
- * Unknown types log a warning and render null (graceful degradation).
22
- * Each child gets a stable key from its index in the children array.
23
- */
24
- export declare function render(node: JsonNode, registry: Registry): ReactNode;
25
- /**
26
- * Render a list of JsonNode trees.
27
- */
28
- export declare function renderList(nodes: JsonNode[], registry: Registry): ReactNode[];
29
- /**
30
- * Type-safe catalog builder.
31
- *
32
- * Just returns the catalog object as-is, but enforces types at compile time.
33
- * No runtime overhead. No zod. Just TypeScript.
34
- */
35
- export declare function defineCatalog<C extends Record<string, {
36
- props?: object;
37
- description?: string;
38
- }>>(catalog: C): C;
@@ -1,18 +0,0 @@
1
- /**
2
- * Balatro Boss Blind Knowledge Base
3
- */
4
- export type BossCategory = "Debuffer" | "Restrictor" | "Obfuscator" | "Scaler" | "Economic";
5
- export interface BossInfo {
6
- name: string;
7
- jamlKey: string;
8
- category: BossCategory;
9
- effect: string;
10
- counters: string[];
11
- jamlAvoid: string;
12
- threatLevel: "Low" | "Medium" | "High" | "Lethal";
13
- }
14
- export declare const BOSSES: Record<string, BossInfo>;
15
- export declare const FINISHERS: BossInfo[];
16
- export declare function getBoss(name: string): BossInfo | undefined;
17
- export declare function getBossesByCategory(category: BossCategory): BossInfo[];
18
- export declare function getAllBosses(): BossInfo[];
@@ -1,22 +0,0 @@
1
- /**
2
- * Balatro Deck & Stake Knowledge Base
3
- */
4
- export interface DeckInfo {
5
- name: string;
6
- jamlKey: string;
7
- effect: string;
8
- strategy: string;
9
- synergies: string[];
10
- difficulty: "Easy" | "Medium" | "Hard";
11
- }
12
- export declare const DECKS: Record<string, DeckInfo>;
13
- export interface StakeInfo {
14
- name: string;
15
- jamlKey: string;
16
- effect: string;
17
- strategy: string;
18
- difficulty: "Easy" | "Medium" | "Hard" | "Expert";
19
- }
20
- export declare const STAKES: StakeInfo[];
21
- export declare function getDeck(name: string): DeckInfo | undefined;
22
- export declare function getStake(name: string): StakeInfo | undefined;
@@ -1,23 +0,0 @@
1
- /**
2
- * Balatro Joker Knowledge Base
3
- * Extracted from the Master Encyclopedia for json-render reference components.
4
- */
5
- export type JokerRarity = "Common" | "Uncommon" | "Rare" | "Legendary";
6
- export type JokerCategory = "Copy" | "X-Mult" | "Flat" | "Economy" | "Retrigger" | "Utility";
7
- export interface JokerInfo {
8
- name: string;
9
- rarity: JokerRarity;
10
- cost: number;
11
- effect: string;
12
- category: JokerCategory;
13
- synergies: string[];
14
- strategy: string;
15
- jamlKey: string;
16
- }
17
- export declare const JOKERS: Record<string, JokerInfo>;
18
- /** Get joker info by name. Returns undefined if not found. */
19
- export declare function getJoker(name: string): JokerInfo | undefined;
20
- /** Get all jokers in a category. */
21
- export declare function getJokersByCategory(category: JokerCategory): JokerInfo[];
22
- /** Get jokers that synergize with a given joker. */
23
- export declare function getSynergies(jokerName: string): JokerInfo[];
@@ -1,21 +0,0 @@
1
- /**
2
- * Balatro Synergy Knowledge Base
3
- * Meta combinations and their mathematical breakdowns.
4
- */
5
- export interface SynergyInfo {
6
- name: string;
7
- jokers: string[];
8
- description: string;
9
- math: string;
10
- setup: string[];
11
- difficulty: "Easy" | "Medium" | "Hard" | "Legendary";
12
- bossCounters: string[];
13
- tags: string[];
14
- }
15
- export declare const SYNERGIES: SynergyInfo[];
16
- /** Find synergies that involve a specific joker. */
17
- export declare function findSynergies(jokerName: string): SynergyInfo[];
18
- /** Find synergies by tag. */
19
- export declare function findSynergiesByTag(tag: string): SynergyInfo[];
20
- /** Get recommended synergies for a set of jokers. */
21
- export declare function getRecommendedSynergies(jokerNames: string[]): SynergyInfo[];
@@ -1,4 +0,0 @@
1
- import { MotelyJamlyzer } from 'motely-wasm';
2
- type JamlConfig = Parameters<typeof MotelyJamlyzer.analyzeSeeds>[0];
3
- export declare const fromJaml: (content: string) => JamlConfig;
4
- export {};
@@ -1 +0,0 @@
1
- export declare function ensureMotelyReady(): Promise<void>;
package/dist/motely.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { default as bootsharp } from 'motely-wasm';
2
- export * as Motely from 'motely-wasm';
3
- export { decodeMotelyItem, decodeMotelyItemToJamlCard, motelyItemTypeName, motelyItemCategory, motelyItemDisplayName, motelyItemRenderCategory, motelyItemEditionName, motelyItemSealName, motelyItemEnhancementName, motelyStandardcardRankName, motelyStandardcardSuitName, decodeMotelyItemName, resolveMotelyItemType, type DecodedMotelyItem, type MotelyItemInput, type MotelyJamlCard, type MotelyRenderableCategory, type MotelyRuntimeItem, } from './decode/motelyItemDecoder.js';
4
- export { motelyItemToSprite, getMotelySpriteByName, type MotelySpriteData, } from './decode/motelySprite.js';
package/dist/motely.js DELETED
@@ -1,84 +0,0 @@
1
- import * as u from "motely-wasm";
2
- import { default as h } from "motely-wasm";
3
- import { d as g } from "./chunks/motelyItemDecoder-Cb-RjvQ0.js";
4
- import { a as S, b as k, m as x, c as T, e as v, f as P, g as A, h as E, i as b, j as K, k as _, r as j } from "./chunks/motelyItemDecoder-Cb-RjvQ0.js";
5
- import { R as d, a as n, r as i, i as y, j as c } from "./chunks/spriteMapper-Dfr2_j0_.js";
6
- function w(a) {
7
- const e = g(a);
8
- if (!e) return null;
9
- if (e.category === "playing" && e.rank && e.suit) {
10
- const s = d[e.rank], r = n[e.suit];
11
- if (s !== void 0 && r !== void 0)
12
- return {
13
- atlasPath: i("deck"),
14
- gridCol: s,
15
- gridRow: r,
16
- gridCols: 13,
17
- gridRows: 4,
18
- displayName: e.displayName,
19
- category: "playing"
20
- };
21
- }
22
- const t = y(e.displayName);
23
- if (!t) return null;
24
- const o = c[t.type];
25
- return o ? {
26
- atlasPath: i(o.assetKey),
27
- gridCol: t.pos.x,
28
- gridRow: t.pos.y,
29
- gridCols: o.cols,
30
- gridRows: o.rows,
31
- displayName: e.displayName,
32
- category: e.category
33
- } : null;
34
- }
35
- function I(a, e = "unknown") {
36
- if (e === "playing") {
37
- const s = /^(.*?)\s+of\s+(.*?)$/i.exec(a);
38
- if (s) {
39
- const r = s[1], p = s[2], l = d[r], m = n[p];
40
- if (l !== void 0 && m !== void 0)
41
- return {
42
- atlasPath: i("deck"),
43
- gridCol: l,
44
- gridRow: m,
45
- gridCols: 13,
46
- gridRows: 4,
47
- displayName: a,
48
- category: "playing"
49
- };
50
- }
51
- }
52
- const t = y(a);
53
- if (!t) return null;
54
- const o = c[t.type];
55
- return o ? {
56
- atlasPath: i(o.assetKey),
57
- gridCol: t.pos.x,
58
- gridRow: t.pos.y,
59
- gridCols: o.cols,
60
- gridRows: o.rows,
61
- displayName: a,
62
- category: e
63
- } : null;
64
- }
65
- export {
66
- u as Motely,
67
- h as bootsharp,
68
- g as decodeMotelyItem,
69
- S as decodeMotelyItemName,
70
- k as decodeMotelyItemToJamlCard,
71
- I as getMotelySpriteByName,
72
- x as motelyItemCategory,
73
- T as motelyItemDisplayName,
74
- v as motelyItemEditionName,
75
- P as motelyItemEnhancementName,
76
- A as motelyItemRenderCategory,
77
- E as motelyItemSealName,
78
- w as motelyItemToSprite,
79
- b as motelyItemTypeName,
80
- K as motelyStandardcardRankName,
81
- _ as motelyStandardcardSuitName,
82
- j as resolveMotelyItemType
83
- };
84
- //# sourceMappingURL=motely.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"motely.js","sources":["../src/decode/motelySprite.ts"],"sourcesContent":["import { decodeMotelyItem, type MotelyRenderableCategory } from \"./motelyItemDecoder.js\";\nimport { getSpriteData, SHEET_META } from \"../sprites/spriteMapper.js\";\nimport { RANK_MAP, SUIT_MAP } from \"../sprites/spriteData.js\";\nimport { resolveJamlAssetUrl } from \"../assets.js\";\n\nexport interface MotelySpriteData {\n atlasPath: string;\n gridCol: number;\n gridRow: number;\n gridCols: number;\n gridRows: number;\n displayName: string;\n category: MotelyRenderableCategory;\n}\n\n/**\n * Given a raw motely-wasm item value (which may be a bitpacked integer or raw MotelyItemType),\n * resolves it to a sprite atlas path and grid coordinates for rendering.\n */\nexport function motelyItemToSprite(rawValue: number): MotelySpriteData | null {\n const decoded = decodeMotelyItem(rawValue);\n if (!decoded) return null;\n\n if (decoded.category === \"playing\" && decoded.rank && decoded.suit) {\n const col = RANK_MAP[decoded.rank];\n const row = SUIT_MAP[decoded.suit];\n if (col !== undefined && row !== undefined) {\n return {\n atlasPath: resolveJamlAssetUrl('deck'),\n gridCol: col,\n gridRow: row,\n gridCols: 13,\n gridRows: 4,\n displayName: decoded.displayName,\n category: \"playing\"\n };\n }\n }\n\n const sprite = getSpriteData(decoded.displayName);\n if (!sprite) return null;\n\n const meta = SHEET_META[sprite.type];\n if (!meta) return null;\n\n return {\n atlasPath: resolveJamlAssetUrl(meta.assetKey),\n gridCol: sprite.pos.x,\n gridRow: sprite.pos.y,\n gridCols: meta.cols,\n gridRows: meta.rows,\n displayName: decoded.displayName,\n category: decoded.category\n };\n}\n\n/**\n * Resolves a sprite by name and category without needing a Motely integer.\n */\nexport function getMotelySpriteByName(name: string, category: MotelyRenderableCategory = \"unknown\"): MotelySpriteData | null {\n if (category === \"playing\") {\n // Attempt to parse \"Rank of Suit\"\n const match = /^(.*?)\\s+of\\s+(.*?)$/i.exec(name);\n if (match) {\n const rank = match[1];\n const suit = match[2];\n const col = RANK_MAP[rank];\n const row = SUIT_MAP[suit];\n if (col !== undefined && row !== undefined) {\n return {\n atlasPath: resolveJamlAssetUrl('deck'),\n gridCol: col,\n gridRow: row,\n gridCols: 13,\n gridRows: 4,\n displayName: name,\n category: \"playing\"\n };\n }\n }\n }\n\n const sprite = getSpriteData(name);\n if (!sprite) return null;\n\n const meta = SHEET_META[sprite.type];\n if (!meta) return null;\n\n return {\n atlasPath: resolveJamlAssetUrl(meta.assetKey),\n gridCol: sprite.pos.x,\n gridRow: sprite.pos.y,\n gridCols: meta.cols,\n gridRows: meta.rows,\n displayName: name,\n category\n };\n}\n"],"names":["motelyItemToSprite","rawValue","decoded","decodeMotelyItem","col","RANK_MAP","row","SUIT_MAP","resolveJamlAssetUrl","sprite","getSpriteData","meta","SHEET_META","getMotelySpriteByName","name","category","match","rank","suit"],"mappings":";;;;;AAmBO,SAASA,EAAmBC,GAA2C;AAC5E,QAAMC,IAAUC,EAAiBF,CAAQ;AACzC,MAAI,CAACC,EAAS,QAAO;AAErB,MAAIA,EAAQ,aAAa,aAAaA,EAAQ,QAAQA,EAAQ,MAAM;AAClE,UAAME,IAAMC,EAASH,EAAQ,IAAI,GAC3BI,IAAMC,EAASL,EAAQ,IAAI;AACjC,QAAIE,MAAQ,UAAaE,MAAQ;AAC/B,aAAO;AAAA,QACL,WAAWE,EAAoB,MAAM;AAAA,QACrC,SAASJ;AAAA,QACT,SAASE;AAAA,QACT,UAAU;AAAA,QACV,UAAU;AAAA,QACV,aAAaJ,EAAQ;AAAA,QACrB,UAAU;AAAA,MAAA;AAAA,EAGhB;AAEA,QAAMO,IAASC,EAAcR,EAAQ,WAAW;AAChD,MAAI,CAACO,EAAQ,QAAO;AAEpB,QAAME,IAAOC,EAAWH,EAAO,IAAI;AACnC,SAAKE,IAEE;AAAA,IACL,WAAWH,EAAoBG,EAAK,QAAQ;AAAA,IAC5C,SAASF,EAAO,IAAI;AAAA,IACpB,SAASA,EAAO,IAAI;AAAA,IACpB,UAAUE,EAAK;AAAA,IACf,UAAUA,EAAK;AAAA,IACf,aAAaT,EAAQ;AAAA,IACrB,UAAUA,EAAQ;AAAA,EAAA,IATF;AAWpB;AAKO,SAASW,EAAsBC,GAAcC,IAAqC,WAAoC;AAC3H,MAAIA,MAAa,WAAW;AAE1B,UAAMC,IAAQ,wBAAwB,KAAKF,CAAI;AAC/C,QAAIE,GAAO;AACP,YAAMC,IAAOD,EAAM,CAAC,GACdE,IAAOF,EAAM,CAAC,GACdZ,IAAMC,EAASY,CAAI,GACnBX,IAAMC,EAASW,CAAI;AACzB,UAAId,MAAQ,UAAaE,MAAQ;AAC/B,eAAO;AAAA,UACL,WAAWE,EAAoB,MAAM;AAAA,UACrC,SAASJ;AAAA,UACT,SAASE;AAAA,UACT,UAAU;AAAA,UACV,UAAU;AAAA,UACV,aAAaQ;AAAA,UACb,UAAU;AAAA,QAAA;AAAA,IAGlB;AAAA,EACF;AAEA,QAAML,IAASC,EAAcI,CAAI;AACjC,MAAI,CAACL,EAAQ,QAAO;AAEpB,QAAME,IAAOC,EAAWH,EAAO,IAAI;AACnC,SAAKE,IAEE;AAAA,IACL,WAAWH,EAAoBG,EAAK,QAAQ;AAAA,IAC5C,SAASF,EAAO,IAAI;AAAA,IACpB,SAASA,EAAO,IAAI;AAAA,IACpB,UAAUE,EAAK;AAAA,IACf,UAAUA,EAAK;AAAA,IACf,aAAaG;AAAA,IACb,UAAAC;AAAA,EAAA,IATgB;AAWpB;"}