jaml-ui 2.5.1 → 3.0.2
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 +38 -225
- package/dist/chunks/Layer-B5y9UIAt.js +19 -0
- package/dist/chunks/Layer-B5y9UIAt.js.map +1 -0
- package/dist/chunks/motelySprite-BYsaes3N.js +753 -0
- package/dist/chunks/motelySprite-BYsaes3N.js.map +1 -0
- package/dist/chunks/spriteMapper-BiDkbZrD.js +480 -0
- package/dist/chunks/spriteMapper-BiDkbZrD.js.map +1 -0
- package/dist/components/DeckSprite.d.ts +1 -1
- package/dist/components/GameCard.d.ts +5 -4
- package/dist/components/JamlyzerView.d.ts +9 -0
- package/dist/components/StandardCard.d.ts +4 -3
- package/dist/core.d.ts +0 -1
- package/dist/core.js +38 -26
- package/dist/core.js.map +1 -1
- package/dist/decode/motelyItemDecoder.d.ts +5 -0
- package/dist/index.d.ts +5 -28
- package/dist/index.js +3180 -27606
- package/dist/index.js.map +1 -1
- package/dist/json-render/catalog.d.ts +26 -1
- package/dist/json-render/components/domain.d.ts +8 -8
- package/dist/json-render/components/game.d.ts +3 -7
- package/dist/json-render/components/jammySeedMascotImage.d.ts +1 -0
- package/dist/json-render/components/layout.d.ts +2 -1
- package/dist/json-render/components/mascot.d.ts +22 -0
- package/dist/json-render/components/reference.d.ts +7 -7
- package/dist/json-render/engine.d.ts +4 -4
- package/dist/json-render/index.d.ts +2 -0
- package/dist/motely.d.ts +2 -5
- package/dist/motely.js +22 -173
- package/dist/motely.js.map +1 -1
- package/dist/render/CanvasRenderer.d.ts +2 -1
- package/dist/render/useJamlCardRenderer.d.ts +15 -0
- package/dist/ui/jimbo.css +1 -2
- package/dist/ui.d.ts +0 -39
- package/dist/ui.js +58 -3
- package/dist/ui.js.map +1 -0
- package/package.json +13 -53
- package/dist/assets/searchPoolWorker-DA5uFkl3.js +0 -2
- package/dist/assets/searchPoolWorker-DA5uFkl3.js.map +0 -1
- package/dist/chunks/jamlSeeds-CRthre97.js +0 -69
- package/dist/chunks/jamlSeeds-CRthre97.js.map +0 -1
- package/dist/chunks/runtime-D7eHq1kP.js +0 -2060
- package/dist/chunks/runtime-D7eHq1kP.js.map +0 -1
- package/dist/chunks/searchPoolWorker-649yzf3l.js +0 -11
- package/dist/chunks/searchPoolWorker-649yzf3l.js.map +0 -1
- package/dist/chunks/spriteMapper-BqG15k6f.js +0 -2496
- package/dist/chunks/spriteMapper-BqG15k6f.js.map +0 -1
- package/dist/chunks/ui-DwggmAYr.js +0 -3399
- package/dist/chunks/ui-DwggmAYr.js.map +0 -1
- package/dist/components/CardFan.d.ts +0 -13
- package/dist/components/JamlAestheticSelector.d.ts +0 -12
- package/dist/components/JamlCodeEditor.d.ts +0 -7
- package/dist/components/JamlCurator.d.ts +0 -1
- package/dist/components/JamlIde.d.ts +0 -44
- package/dist/components/JamlIdeToolbar.d.ts +0 -14
- package/dist/components/JamlIdeVisual.d.ts +0 -30
- package/dist/components/JamlMapPreview.d.ts +0 -11
- package/dist/components/JamlSeedInput.d.ts +0 -24
- package/dist/components/JamlSeedSpinner.d.ts +0 -9
- package/dist/components/JamlSpeedometer.d.ts +0 -16
- package/dist/components/Jamlyzer.d.ts +0 -8
- package/dist/components/JimmolateEditor.d.ts +0 -47
- package/dist/components/MotelyHello.d.ts +0 -5
- package/dist/components/MotelyVersionBadge.d.ts +0 -28
- package/dist/components/PaginatedFilterBrowser.d.ts +0 -26
- package/dist/components/RunConfigModal.d.ts +0 -8
- package/dist/components/SeedFinderApp.d.ts +0 -7
- package/dist/components/jamlMap/CategoryPicker.d.ts +0 -32
- package/dist/components/jamlMap/JamlMapEditor.d.ts +0 -14
- package/dist/components/jamlMap/JokerPicker.d.ts +0 -8
- package/dist/components/jamlMap/MysterySlot.d.ts +0 -37
- package/dist/components/jamlMap/index.d.ts +0 -4
- package/dist/components/jamlMap/jokerRarity.d.ts +0 -6
- package/dist/components/jamlSeedUtils.d.ts +0 -1
- package/dist/hooks/searchPoolWorker.d.ts +0 -61
- package/dist/hooks/searchWorker.d.ts +0 -1
- package/dist/hooks/useAnalyzer.d.ts +0 -10
- package/dist/hooks/useIntersectionObserver.d.ts +0 -14
- package/dist/hooks/useJamlLibrary.d.ts +0 -13
- package/dist/hooks/useSearch.d.ts +0 -31
- package/dist/hooks/useSearchPool.d.ts +0 -43
- package/dist/hooks/useShopStream.d.ts +0 -22
- package/dist/lib/SpriteMapper.d.ts +0 -10
- package/dist/lib/cardParser.d.ts +0 -8
- package/dist/lib/classes/BuyMetaData.d.ts +0 -11
- package/dist/lib/config.d.ts +0 -13
- package/dist/lib/const.d.ts +0 -70
- package/dist/lib/data/constants.d.ts +0 -11
- package/dist/lib/hooks/useDragScroll.d.ts +0 -4
- package/dist/lib/hooks/useJamlFilter.d.ts +0 -48
- package/dist/lib/hooks/useSeedAnalyzer.d.ts +0 -5
- package/dist/lib/jaml/jamlCompletion.d.ts +0 -12
- package/dist/lib/jaml/jamlData.d.ts +0 -4
- package/dist/lib/jaml/jamlLangCodemirror.d.ts +0 -13
- package/dist/lib/jaml/jamlObjectives.d.ts +0 -13
- package/dist/lib/jaml/jamlParser.d.ts +0 -14
- package/dist/lib/jaml/jamlPresets.d.ts +0 -8
- package/dist/lib/jaml/jamlSchema.d.ts +0 -19
- package/dist/lib/jaml/jamlSeeds.d.ts +0 -7
- package/dist/lib/motely/runtime.d.ts +0 -40
- package/dist/lib/parseDailyRitual.d.ts +0 -45
- package/dist/lib/tts/getRevealPos.d.ts +0 -5
- package/dist/lib/tts/splitTtsDisplay.d.ts +0 -19
- package/dist/lib/types.d.ts +0 -122
- package/dist/lib/utils.d.ts +0 -2
- package/dist/motelyDisplay.d.ts +0 -10
- package/dist/ui/JimboBadge.d.ts +0 -12
- package/dist/ui/JimboBalatroFooter.d.ts +0 -16
- package/dist/ui/JimboCopyButton.d.ts +0 -27
- package/dist/ui/JimboDeckAndStakeSelectorModal.d.ts +0 -30
- package/dist/ui/JimboDualChip.d.ts +0 -17
- package/dist/ui/JimboIconButton.d.ts +0 -15
- package/dist/ui/JimboInlineEdit.d.ts +0 -16
- package/dist/ui/JimboInputModal.d.ts +0 -13
- package/dist/ui/JimboListItem.d.ts +0 -11
- package/dist/ui/JimboPanelSpinner.d.ts +0 -15
- package/dist/ui/JimboPanelSplitter.d.ts +0 -8
- package/dist/ui/JimboPicker.d.ts +0 -28
- package/dist/ui/JimboSeedCopyChip.d.ts +0 -16
- package/dist/ui/JimboSelect.d.ts +0 -30
- package/dist/ui/JimboSlider.d.ts +0 -11
- package/dist/ui/JimboSpinner.d.ts +0 -18
- package/dist/ui/JimboStepper.d.ts +0 -22
- package/dist/ui/JimboTextInput.d.ts +0 -5
- package/dist/ui/JimboToggleList.d.ts +0 -12
- package/dist/ui/JimboValueBadge.d.ts +0 -19
- package/dist/ui/codeBlock.d.ts +0 -11
- package/dist/ui/hooks.d.ts +0 -126
- package/dist/ui/ide/JamlEditor.d.ts +0 -7
- package/dist/ui/jimboApp.d.ts +0 -9
- package/dist/ui/jimboBackground.d.ts +0 -17
- package/dist/ui/jimboCopyRow.d.ts +0 -9
- package/dist/ui/jimboFilterBar.d.ts +0 -22
- package/dist/ui/jimboFlankNav.d.ts +0 -17
- package/dist/ui/jimboInfoCard.d.ts +0 -31
- package/dist/ui/jimboInset.d.ts +0 -9
- package/dist/ui/jimboLayout.d.ts +0 -25
- package/dist/ui/jimboLink.d.ts +0 -12
- package/dist/ui/jimboSectionHeader.d.ts +0 -11
- package/dist/ui/jimboStatGrid.d.ts +0 -13
- package/dist/ui/jimboTabs.d.ts +0 -21
- package/dist/ui/jimboText.d.ts +0 -25
- package/dist/ui/jimboTooltip.d.ts +0 -33
- package/dist/ui/jimboWordmark.d.ts +0 -10
- package/dist/ui/mascot/JammySpeechBox.d.ts +0 -9
- package/dist/ui/mascot/SeedMascot.d.ts +0 -37
- package/dist/ui/mascot/index.d.ts +0 -3
- package/dist/ui/mascot/menuConfig.d.ts +0 -102
- package/dist/ui/panel.d.ts +0 -32
- package/dist/ui/radial/RadialBadge.d.ts +0 -16
- package/dist/ui/radial/RadialBreadcrumb.d.ts +0 -12
- package/dist/ui/radial/RadialButton.d.ts +0 -60
- package/dist/ui/radial/RadialMenu.d.ts +0 -38
- package/dist/ui/radial/RadialPill.d.ts +0 -17
- package/dist/ui/radial/index.d.ts +0 -16
- package/dist/ui/radial/radialMenuStore.d.ts +0 -31
- package/dist/ui/radial/radialMenuViewport.d.ts +0 -6
- package/dist/ui/radial/useRadialMenu.d.ts +0 -35
- package/dist/ui/showcase.d.ts +0 -38
- package/dist/ui/sprites.d.ts +0 -25
- package/dist/utils/jamlMapPreview.d.ts +0 -12
- package/dist/utils/jamlVisualFilter.d.ts +0 -3
|
@@ -42,9 +42,10 @@ export interface DividerProps {
|
|
|
42
42
|
className?: string;
|
|
43
43
|
}
|
|
44
44
|
export declare const Divider: React.FC<DividerProps>;
|
|
45
|
+
export type BadgeTone = "red" | "blue" | "green" | "orange" | "gold" | "purple" | "grey";
|
|
45
46
|
export interface BadgeProps {
|
|
46
47
|
label: string;
|
|
47
|
-
tone?:
|
|
48
|
+
tone?: BadgeTone;
|
|
48
49
|
className?: string;
|
|
49
50
|
}
|
|
50
51
|
export declare const Badge: React.FC<BadgeProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BadgeTone } from './layout.js';
|
|
3
|
+
export interface JammyOrbitalMenuItem {
|
|
4
|
+
label: string;
|
|
5
|
+
action: string;
|
|
6
|
+
tone?: BadgeTone;
|
|
7
|
+
}
|
|
8
|
+
export interface JammyOrbitalMenuProps {
|
|
9
|
+
items: JammyOrbitalMenuItem[];
|
|
10
|
+
onAction?: (action: string) => void;
|
|
11
|
+
radius?: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const JammyOrbitalMenu: FC<JammyOrbitalMenuProps>;
|
|
15
|
+
export interface JammyMascotProps {
|
|
16
|
+
mood?: "idle" | "happy" | "surprised";
|
|
17
|
+
size?: number;
|
|
18
|
+
menuItems?: JammyOrbitalMenuItem[];
|
|
19
|
+
onMenuAction?: (action: string) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const JammyMascot: FC<JammyMascotProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Reference Components — Encyclopedia UI for Balatro entities.
|
|
4
4
|
*
|
|
@@ -10,29 +10,29 @@ export interface JokerCardProps {
|
|
|
10
10
|
showSynergies?: boolean;
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const JokerCard:
|
|
13
|
+
export declare const JokerCard: FC<JokerCardProps>;
|
|
14
14
|
export interface SynergyCardProps {
|
|
15
15
|
name: string;
|
|
16
16
|
className?: string;
|
|
17
17
|
}
|
|
18
|
-
export declare const SynergyCard:
|
|
18
|
+
export declare const SynergyCard: FC<SynergyCardProps>;
|
|
19
19
|
export interface BossBlindCardProps {
|
|
20
20
|
name: string;
|
|
21
21
|
className?: string;
|
|
22
22
|
}
|
|
23
|
-
export declare const BossBlindCard:
|
|
23
|
+
export declare const BossBlindCard: FC<BossBlindCardProps>;
|
|
24
24
|
export interface DeckCardProps {
|
|
25
25
|
name: string;
|
|
26
26
|
className?: string;
|
|
27
27
|
}
|
|
28
|
-
export declare const DeckCard:
|
|
28
|
+
export declare const DeckCard: FC<DeckCardProps>;
|
|
29
29
|
export interface StakeCardProps {
|
|
30
30
|
name: string;
|
|
31
31
|
className?: string;
|
|
32
32
|
}
|
|
33
|
-
export declare const StakeCard:
|
|
33
|
+
export declare const StakeCard: FC<StakeCardProps>;
|
|
34
34
|
export interface StrategyAdvisorProps {
|
|
35
35
|
jokers: string[];
|
|
36
36
|
className?: string;
|
|
37
37
|
}
|
|
38
|
-
export declare const StrategyAdvisor:
|
|
38
|
+
export declare const StrategyAdvisor: FC<StrategyAdvisorProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* json-render — Zero-dependency JSON-to-React engine.
|
|
4
4
|
*
|
|
@@ -12,7 +12,7 @@ export interface JsonNode {
|
|
|
12
12
|
children?: JsonNode[];
|
|
13
13
|
}
|
|
14
14
|
export type ComponentProps<P = Record<string, unknown>> = P & {
|
|
15
|
-
children?:
|
|
15
|
+
children?: ReactNode;
|
|
16
16
|
};
|
|
17
17
|
export type Registry = Record<string, React.ComponentType<any>>;
|
|
18
18
|
/**
|
|
@@ -21,11 +21,11 @@ export type Registry = Record<string, React.ComponentType<any>>;
|
|
|
21
21
|
* Unknown types log a warning and render null (graceful degradation).
|
|
22
22
|
* Each child gets a stable key from its index in the children array.
|
|
23
23
|
*/
|
|
24
|
-
export declare function render(node: JsonNode, registry: Registry):
|
|
24
|
+
export declare function render(node: JsonNode, registry: Registry): ReactNode;
|
|
25
25
|
/**
|
|
26
26
|
* Render a list of JsonNode trees.
|
|
27
27
|
*/
|
|
28
|
-
export declare function renderList(nodes: JsonNode[], registry: Registry):
|
|
28
|
+
export declare function renderList(nodes: JsonNode[], registry: Registry): ReactNode[];
|
|
29
29
|
/**
|
|
30
30
|
* Type-safe catalog builder.
|
|
31
31
|
*
|
|
@@ -10,6 +10,8 @@ export { SearchStats, ErrorBanner, LoadingPulse, SeedCard, SeedList, JokerBadge,
|
|
|
10
10
|
export type { SearchStatsProps, ErrorBannerProps, LoadingPulseProps, SeedCardProps, SeedListProps, JokerBadgeProps, EditionBadgeProps, } from './components/domain.js';
|
|
11
11
|
export { JamlGameCard } from './components/game.js';
|
|
12
12
|
export type { JamlGameCardProps } from './components/game.js';
|
|
13
|
+
export { JammyMascot, JammyOrbitalMenu } from './components/mascot.js';
|
|
14
|
+
export type { JammyMascotProps, JammyOrbitalMenuProps, JammyOrbitalMenuItem, } from './components/mascot.js';
|
|
13
15
|
export { JokerCard, SynergyCard, BossBlindCard, DeckCard, StakeCard, StrategyAdvisor, } from './components/reference.js';
|
|
14
16
|
export type { JokerCardProps, SynergyCardProps, BossBlindCardProps, DeckCardProps, StakeCardProps, StrategyAdvisorProps, } from './components/reference.js';
|
|
15
17
|
export { buildSearchSpec } from './builders/search.js';
|
package/dist/motely.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export { default as bootsharp
|
|
2
|
-
export
|
|
1
|
+
export { default as bootsharp } from 'motely-wasm';
|
|
2
|
+
export * as Motely from 'motely-wasm';
|
|
3
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
4
|
export { motelyItemToSprite, getMotelySpriteByName, type MotelySpriteData, } from './decode/motelySprite.js';
|
|
5
|
-
export { motelyBossDisplayName, motelyBossDisplayNameFromKey, motelyBoosterPackDisplayName, motelyBoosterPackDisplayNameFromKey, motelyItemDisplayNameFromKey, motelyItemDisplayNameFromValue, motelyTagDisplayName, motelyTagDisplayNameFromKey, motelyVoucherDisplayName, motelyVoucherDisplayNameFromKey, } from './motelyDisplay.js';
|
|
6
|
-
export { useJamlLibrary, type JamlLibraryStatus, type UseJamlLibraryState, } from './hooks/useJamlLibrary.js';
|
|
7
|
-
export { ensureMotelyReady, parseJaml, tallyLabelsFor, runSearch, aestheticSeeds, analyzeSeeds, setJimmolateProbe, clearJimmolateProbe, enableJimmolate, isFileSystemReady, getFileSystemError, MOTELY_BIN_PATH, type MotelyRuntimeStatus, type EngineSearchMode, type RunSearchOptions, } from './lib/motely/runtime.js';
|
package/dist/motely.js
CHANGED
|
@@ -1,174 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let s = r(o.displayName);
|
|
23
|
-
if (!s) return null;
|
|
24
|
-
let c = i[s.type];
|
|
25
|
-
return c ? {
|
|
26
|
-
atlasPath: e(c.assetKey),
|
|
27
|
-
gridCol: s.pos.x,
|
|
28
|
-
gridRow: s.pos.y,
|
|
29
|
-
gridCols: c.cols,
|
|
30
|
-
gridRows: c.rows,
|
|
31
|
-
displayName: o.displayName,
|
|
32
|
-
category: o.category
|
|
33
|
-
} : null;
|
|
34
|
-
}
|
|
35
|
-
function ue(a, o = "unknown") {
|
|
36
|
-
if (o === "playing") {
|
|
37
|
-
let r = /^(.*?)\s+of\s+(.*?)$/i.exec(a);
|
|
38
|
-
if (r) {
|
|
39
|
-
let i = r[1], o = r[2], s = t[i], c = n[o];
|
|
40
|
-
if (s !== void 0 && c !== void 0) return {
|
|
41
|
-
atlasPath: e("deck"),
|
|
42
|
-
gridCol: s,
|
|
43
|
-
gridRow: c,
|
|
44
|
-
gridCols: 13,
|
|
45
|
-
gridRows: 4,
|
|
46
|
-
displayName: a,
|
|
47
|
-
category: "playing"
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
let s = r(a);
|
|
52
|
-
if (!s) return null;
|
|
53
|
-
let c = i[s.type];
|
|
54
|
-
return c ? {
|
|
55
|
-
atlasPath: e(c.assetKey),
|
|
56
|
-
gridCol: s.pos.x,
|
|
57
|
-
gridRow: s.pos.y,
|
|
58
|
-
gridCols: c.cols,
|
|
59
|
-
gridRows: c.rows,
|
|
60
|
-
displayName: a,
|
|
61
|
-
category: o
|
|
62
|
-
} : null;
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/motelyDisplay.ts
|
|
66
|
-
var Y = {
|
|
67
|
-
MotelyBossBlind: z,
|
|
68
|
-
MotelyVoucher: se,
|
|
69
|
-
MotelyTag: q,
|
|
70
|
-
MotelyBoosterPack: L
|
|
1
|
+
import * as e from "motely-wasm";
|
|
2
|
+
import { default as m } from "motely-wasm";
|
|
3
|
+
import { d as l, a as y, b as s, g as r, m as d, c as I, e as p, f as n, h as N, i, j as c, k as M, l as S, n as f, r as g } from "./chunks/motelySprite-BYsaes3N.js";
|
|
4
|
+
export {
|
|
5
|
+
e as Motely,
|
|
6
|
+
m as bootsharp,
|
|
7
|
+
l as decodeMotelyItem,
|
|
8
|
+
y as decodeMotelyItemName,
|
|
9
|
+
s as decodeMotelyItemToJamlCard,
|
|
10
|
+
r as getMotelySpriteByName,
|
|
11
|
+
d as motelyItemCategory,
|
|
12
|
+
I as motelyItemDisplayName,
|
|
13
|
+
p as motelyItemEditionName,
|
|
14
|
+
n as motelyItemEnhancementName,
|
|
15
|
+
N as motelyItemRenderCategory,
|
|
16
|
+
i as motelyItemSealName,
|
|
17
|
+
c as motelyItemToSprite,
|
|
18
|
+
M as motelyItemTypeName,
|
|
19
|
+
S as motelyStandardcardRankName,
|
|
20
|
+
f as motelyStandardcardSuitName,
|
|
21
|
+
g as resolveMotelyItemType
|
|
71
22
|
};
|
|
72
|
-
|
|
73
|
-
let n = e[String(t)];
|
|
74
|
-
return typeof n == "string" && n.length > 0 ? n : null;
|
|
75
|
-
}
|
|
76
|
-
function de(e) {
|
|
77
|
-
return X(Y.MotelyBossBlind, e & 255) ?? `boss#${e}`;
|
|
78
|
-
}
|
|
79
|
-
function fe(e) {
|
|
80
|
-
return e;
|
|
81
|
-
}
|
|
82
|
-
function pe(e) {
|
|
83
|
-
return X(Y.MotelyVoucher, e) ?? `voucher#${e}`;
|
|
84
|
-
}
|
|
85
|
-
function me(e) {
|
|
86
|
-
return e;
|
|
87
|
-
}
|
|
88
|
-
function he(e) {
|
|
89
|
-
return X(Y.MotelyTag, e) ?? `tag#${e}`;
|
|
90
|
-
}
|
|
91
|
-
function Z(e) {
|
|
92
|
-
return e;
|
|
93
|
-
}
|
|
94
|
-
function ge(e) {
|
|
95
|
-
return X(Y.MotelyBoosterPack, e) ?? `pack#${e}`;
|
|
96
|
-
}
|
|
97
|
-
function _e(e) {
|
|
98
|
-
return `${e} Pack`;
|
|
99
|
-
}
|
|
100
|
-
function ve(e) {
|
|
101
|
-
return e;
|
|
102
|
-
}
|
|
103
|
-
function ye(e) {
|
|
104
|
-
return l[e & 65535]?.displayName ?? `item#${e}`;
|
|
105
|
-
}
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/hooks/useJamlLibrary.ts
|
|
108
|
-
var be = /\.(jaml|ya?ml)$/i;
|
|
109
|
-
function xe() {
|
|
110
|
-
return m() ? window.showDirectoryPicker : null;
|
|
111
|
-
}
|
|
112
|
-
function Q(e) {
|
|
113
|
-
return e instanceof Error ? e.message : String(e);
|
|
114
|
-
}
|
|
115
|
-
async function $(e) {
|
|
116
|
-
let t = [];
|
|
117
|
-
for await (let [n, r] of e.entries()) r.kind === "file" && be.test(n) && t.push(n);
|
|
118
|
-
return t.sort((e, t) => e.localeCompare(t));
|
|
119
|
-
}
|
|
120
|
-
function Se() {
|
|
121
|
-
let [e, t] = M(() => m() ? "idle" : "unsupported"), [n, r] = M(null), [i, a] = M([]), [o, s] = M(null), c = j(null), l = A(() => {
|
|
122
|
-
let e = c.current;
|
|
123
|
-
e && $(e).then(a).catch((e) => s(Q(e)));
|
|
124
|
-
}, []);
|
|
125
|
-
return {
|
|
126
|
-
status: e,
|
|
127
|
-
rootId: n,
|
|
128
|
-
files: i,
|
|
129
|
-
error: o,
|
|
130
|
-
mount: A(async () => {
|
|
131
|
-
let e = xe();
|
|
132
|
-
if (!e) {
|
|
133
|
-
t("unsupported"), s(Q(C()));
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
t("mounting"), s(null);
|
|
137
|
-
try {
|
|
138
|
-
let n = await e({
|
|
139
|
-
id: "jaml-library",
|
|
140
|
-
mode: "readwrite"
|
|
141
|
-
});
|
|
142
|
-
c.current = n, r(n.name), a(await $(n)), t("ready");
|
|
143
|
-
} catch (e) {
|
|
144
|
-
if (e instanceof DOMException && e.name === "AbortError") {
|
|
145
|
-
t(c.current ? "ready" : "idle");
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
t("error"), s(Q(e));
|
|
149
|
-
}
|
|
150
|
-
}, []),
|
|
151
|
-
unmount: A(async () => {
|
|
152
|
-
c.current = null, r(null), a([]), t(m() ? "idle" : "unsupported");
|
|
153
|
-
}, []),
|
|
154
|
-
loadFile: A(async (e) => {
|
|
155
|
-
let t = c.current;
|
|
156
|
-
if (!t) throw Error("JAML library is not mounted.");
|
|
157
|
-
return (await (await t.getFileHandle(e)).getFile()).text();
|
|
158
|
-
}, []),
|
|
159
|
-
saveFile: A(async (e, t) => {
|
|
160
|
-
let n = c.current;
|
|
161
|
-
if (!n) throw Error("JAML library is not mounted.");
|
|
162
|
-
let r = await (await n.getFileHandle(e, { create: !0 })).createWritable();
|
|
163
|
-
await r.write(t), await r.close(), a((t) => t.includes(e) ? t : [...t, e].sort((e, t) => e.localeCompare(t)));
|
|
164
|
-
}, []),
|
|
165
|
-
refresh: l
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
//#endregion
|
|
169
|
-
//#region src/motely.ts
|
|
170
|
-
h();
|
|
171
|
-
//#endregion
|
|
172
|
-
export { P as JamlAesthetic, F as Jimmolate, w as MOTELY_BIN_PATH, I as MotelyBoosterPack, R as MotelyBossBlind, B as MotelyDeck, V as MotelyItemEdition, H as MotelyJaml, U as MotelyJamlyzer, ae as MotelyJummy, W as MotelySearch, G as MotelyStake, K as MotelyTag, J as MotelyUtilities, oe as MotelyVoucher, ce as MotelyWasm, y as aestheticSeeds, S as analyzeSeeds, N as bootsharp, g as clearJimmolateProbe, x as decodeMotelyItem, v as decodeMotelyItemName, ie as decodeMotelyItemToJamlCard, f as enableJimmolate, b as ensureMotelyReady, C as getFileSystemError, ue as getMotelySpriteByName, m as isFileSystemReady, ge as motelyBoosterPackDisplayName, _e as motelyBoosterPackDisplayNameFromKey, de as motelyBossDisplayName, fe as motelyBossDisplayNameFromKey, d as motelyItemCategory, E as motelyItemDisplayName, ve as motelyItemDisplayNameFromKey, ye as motelyItemDisplayNameFromValue, k as motelyItemEditionName, p as motelyItemEnhancementName, O as motelyItemRenderCategory, te as motelyItemSealName, le as motelyItemToSprite, s as motelyItemTypeName, D as motelyStandardcardRankName, u as motelyStandardcardSuitName, he as motelyTagDisplayName, Z as motelyTagDisplayNameFromKey, pe as motelyVoucherDisplayName, me as motelyVoucherDisplayNameFromKey, _ as parseJaml, c as resolveMotelyItemType, T as runSearch, ne as setJimmolateProbe, re as tallyLabelsFor, Se as useJamlLibrary };
|
|
173
|
-
|
|
174
|
-
//# sourceMappingURL=motely.js.map
|
|
23
|
+
//# sourceMappingURL=motely.js.map
|
package/dist/motely.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motely.js","names":[],"sources":["../src/decode/motelySprite.ts","../src/motelyDisplay.ts","../src/hooks/useJamlLibrary.ts","../src/motely.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","import { MotelyBossBlind, MotelyVoucher, MotelyTag, MotelyBoosterPack } from \"motely-wasm\";\nimport { MOTELY_ITEM_FORMATS_BY_VALUE } from \"./decode/motelyItemFormats.js\";\n\ntype RuntimeEnum = Record<string, string | number>;\n\n// motely-wasm@23 exposes the enums as top-level runtime objects (numeric → name\n// reverse maps) instead of `Program.MotelyBossBlind` etc. Bundle them so the\n// runtimeEnumKey lookups below stay unchanged.\nconst MotelyEnums = {\n MotelyBossBlind,\n MotelyVoucher,\n MotelyTag,\n MotelyBoosterPack,\n} as unknown as Record<string, RuntimeEnum>;\n\nfunction runtimeEnumKey(\n enumObject: Record<string, unknown>,\n value: number,\n): string | null {\n const key = enumObject[String(value)];\n return typeof key === \"string\" && key.length > 0 ? key : null;\n}\n\nexport function motelyBossDisplayName(value: number): string {\n const key = runtimeEnumKey(MotelyEnums.MotelyBossBlind, value & 0xff);\n return key ?? `boss#${value}`;\n}\n\nexport function motelyBossDisplayNameFromKey(key: string): string {\n return key;\n}\n\nexport function motelyVoucherDisplayName(value: number): string {\n const key = runtimeEnumKey(MotelyEnums.MotelyVoucher, value);\n return key ?? `voucher#${value}`;\n}\n\nexport function motelyVoucherDisplayNameFromKey(key: string): string {\n return key;\n}\n\nexport function motelyTagDisplayName(value: number): string {\n const key = runtimeEnumKey(MotelyEnums.MotelyTag, value);\n return key ?? `tag#${value}`;\n}\n\nexport function motelyTagDisplayNameFromKey(key: string): string {\n return key;\n}\n\nexport function motelyBoosterPackDisplayName(value: number): string {\n const key = runtimeEnumKey(MotelyEnums.MotelyBoosterPack, value);\n return key ?? `pack#${value}`;\n}\n\nexport function motelyBoosterPackDisplayNameFromKey(key: string): string {\n return `${key} Pack`;\n}\n\nexport function motelyItemDisplayNameFromKey(key: string): string {\n return key;\n}\n\nexport function motelyItemDisplayNameFromValue(value: number): string {\n const itemType = value & 0xffff;\n return MOTELY_ITEM_FORMATS_BY_VALUE[itemType as keyof typeof MOTELY_ITEM_FORMATS_BY_VALUE]?.displayName ?? `item#${value}`;\n}\n","\"use client\";\n\nimport { useCallback, useRef, useState } from \"react\";\nimport { isFileSystemReady, getFileSystemError } from \"../lib/motely/runtime.js\";\n\n// motely-wasm@23 removed the engine-side filesystem ops, so the JAML library is\n// backed directly by the browser File System Access API. JAML files are plain\n// text, so mounting a folder, listing its .jaml/.yaml files, and reading/writing\n// them needs no engine round-trip. Where the API is unavailable (non-Chromium or\n// insecure context) status is \"unsupported\" — reported honestly via\n// isFileSystemReady() in runtime.ts, not a faked mount.\n\n// Minimal typings for the slice of the File System Access API we use (keeps us\n// off lib.dom shipping these and clear of the repo's no-explicit-any rule).\ninterface FsWritable {\n write(data: string): Promise<void>;\n close(): Promise<void>;\n}\ninterface FsFileHandle {\n kind: \"file\";\n getFile(): Promise<File>;\n createWritable(): Promise<FsWritable>;\n}\ninterface FsDirectoryHandle {\n kind: \"directory\";\n name: string;\n entries(): AsyncIterableIterator<[string, { kind: string }]>;\n getFileHandle(name: string, options?: { create?: boolean }): Promise<FsFileHandle>;\n}\ntype DirectoryPicker = (options?: { id?: string; mode?: \"read\" | \"readwrite\" }) => Promise<FsDirectoryHandle>;\n\nconst JAML_FILE = /\\.(jaml|ya?ml)$/i;\n\nfunction directoryPicker(): DirectoryPicker | null {\n if (!isFileSystemReady()) return null;\n return (window as unknown as { showDirectoryPicker: DirectoryPicker }).showDirectoryPicker;\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport type JamlLibraryStatus = \"idle\" | \"unsupported\" | \"mounting\" | \"ready\" | \"error\";\n\nexport interface UseJamlLibraryState {\n status: JamlLibraryStatus;\n rootId: string | null;\n files: string[];\n error: string | null;\n mount: () => Promise<void>;\n unmount: () => Promise<void>;\n loadFile: (uri: string) => Promise<string>;\n saveFile: (uri: string, content: string) => Promise<void>;\n refresh: () => void;\n}\n\nasync function listJamlFiles(dir: FsDirectoryHandle): Promise<string[]> {\n const names: string[] = [];\n for await (const [name, handle] of dir.entries()) {\n if (handle.kind === \"file\" && JAML_FILE.test(name)) names.push(name);\n }\n return names.sort((a, b) => a.localeCompare(b));\n}\n\nexport function useJamlLibrary(): UseJamlLibraryState {\n const [status, setStatus] = useState<JamlLibraryStatus>(() => (isFileSystemReady() ? \"idle\" : \"unsupported\"));\n const [rootId, setRootId] = useState<string | null>(null);\n const [files, setFiles] = useState<string[]>([]);\n const [error, setError] = useState<string | null>(null);\n const dirRef = useRef<FsDirectoryHandle | null>(null);\n\n const refresh = useCallback(() => {\n const dir = dirRef.current;\n if (!dir) return;\n void listJamlFiles(dir).then(setFiles).catch((e) => setError(errorMessage(e)));\n }, []);\n\n const mount = useCallback(async () => {\n const pick = directoryPicker();\n if (!pick) {\n setStatus(\"unsupported\");\n setError(errorMessage(getFileSystemError()));\n return;\n }\n setStatus(\"mounting\");\n setError(null);\n try {\n const dir = await pick({ id: \"jaml-library\", mode: \"readwrite\" });\n dirRef.current = dir;\n setRootId(dir.name);\n setFiles(await listJamlFiles(dir));\n setStatus(\"ready\");\n } catch (err) {\n // The user dismissing the directory picker raises AbortError — not a failure.\n if (err instanceof DOMException && err.name === \"AbortError\") {\n setStatus(dirRef.current ? \"ready\" : \"idle\");\n return;\n }\n setStatus(\"error\");\n setError(errorMessage(err));\n }\n }, []);\n\n const unmount = useCallback(async () => {\n dirRef.current = null;\n setRootId(null);\n setFiles([]);\n setStatus(isFileSystemReady() ? \"idle\" : \"unsupported\");\n }, []);\n\n const loadFile = useCallback(async (uri: string): Promise<string> => {\n const dir = dirRef.current;\n if (!dir) throw new Error(\"JAML library is not mounted.\");\n const handle = await dir.getFileHandle(uri);\n const file = await handle.getFile();\n return file.text();\n }, []);\n\n const saveFile = useCallback(async (uri: string, content: string): Promise<void> => {\n const dir = dirRef.current;\n if (!dir) throw new Error(\"JAML library is not mounted.\");\n const handle = await dir.getFileHandle(uri, { create: true });\n const writable = await handle.createWritable();\n await writable.write(content);\n await writable.close();\n setFiles((prev) => (prev.includes(uri) ? prev : [...prev, uri].sort((a, b) => a.localeCompare(b))));\n }, []);\n\n return { status, rootId, files, error, mount, unmount, loadFile, saveFile, refresh };\n}\n","\"use client\";\n\n// motely-wasm@23 ships a single root entry: the bootsharp default export plus the\n// flattened namespaces (MotelyJaml / MotelySearch / MotelyJamlyzer / MotelyUtilities\n// / Jimmolate), enums, and types. The old `Program` aggregate is gone; re-export the\n// real v23 surface so `jaml-ui/motely` consumers reach the engine directly.\nexport {\n default as bootsharp,\n MotelyWasm,\n MotelyJaml,\n MotelyJummy,\n MotelyUtilities,\n MotelyJamlyzer,\n MotelySearch,\n Jimmolate,\n MotelyDeck,\n MotelyStake,\n MotelyBossBlind,\n MotelyVoucher,\n MotelyTag,\n MotelyBoosterPack,\n MotelyItemEdition,\n JamlAesthetic,\n} from \"motely-wasm\";\nexport type {\n JamlConfig,\n IJamlClause,\n JamlSearchPlan,\n MotelyProgress,\n MotelyScoredSeedResult,\n MotelyItem,\n MotelyJamlyzerSeedResult,\n MotelyJamlyzerAnteResult,\n} from \"motely-wasm\";\n\nexport {\n decodeMotelyItem,\n decodeMotelyItemToJamlCard,\n motelyItemTypeName,\n motelyItemCategory,\n motelyItemDisplayName,\n motelyItemRenderCategory,\n motelyItemEditionName,\n motelyItemSealName,\n motelyItemEnhancementName,\n motelyStandardcardRankName,\n motelyStandardcardSuitName,\n decodeMotelyItemName,\n resolveMotelyItemType,\n type DecodedMotelyItem,\n type MotelyItemInput,\n type MotelyJamlCard,\n type MotelyRenderableCategory,\n type MotelyRuntimeItem,\n} from \"./decode/motelyItemDecoder.js\";\n\nexport {\n motelyItemToSprite,\n getMotelySpriteByName,\n type MotelySpriteData,\n} from \"./decode/motelySprite.js\";\n\nexport {\n motelyBossDisplayName,\n motelyBossDisplayNameFromKey,\n motelyBoosterPackDisplayName,\n motelyBoosterPackDisplayNameFromKey,\n motelyItemDisplayNameFromKey,\n motelyItemDisplayNameFromValue,\n motelyTagDisplayName,\n motelyTagDisplayNameFromKey,\n motelyVoucherDisplayName,\n motelyVoucherDisplayNameFromKey,\n} from \"./motelyDisplay.js\";\n\nexport {\n useJamlLibrary,\n type JamlLibraryStatus,\n type UseJamlLibraryState,\n} from \"./hooks/useJamlLibrary.js\";\nexport {\n ensureMotelyReady,\n parseJaml,\n tallyLabelsFor,\n runSearch,\n aestheticSeeds,\n analyzeSeeds,\n setJimmolateProbe,\n clearJimmolateProbe,\n enableJimmolate,\n isFileSystemReady,\n getFileSystemError,\n MOTELY_BIN_PATH,\n type MotelyRuntimeStatus,\n type EngineSearchMode,\n type RunSearchOptions,\n} from \"./lib/motely/runtime.js\";\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"motely.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { Layer } from './Layer.js';
|
|
2
3
|
export interface JamlCardRendererProps {
|
|
3
4
|
layers: Layer[];
|
|
@@ -5,4 +6,4 @@ export interface JamlCardRendererProps {
|
|
|
5
6
|
className?: string;
|
|
6
7
|
hoverTilt?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function JamlCardRenderer({ layers, invert, className, hoverTilt }: JamlCardRendererProps):
|
|
9
|
+
export declare function JamlCardRenderer({ layers, invert, className, hoverTilt }: JamlCardRendererProps): React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Layer } from './Layer.js';
|
|
2
|
+
export declare function useJamlCardRenderer({ layers, invert, hoverTilt, }: {
|
|
3
|
+
layers: Layer[];
|
|
4
|
+
invert?: boolean;
|
|
5
|
+
hoverTilt?: boolean;
|
|
6
|
+
}): {
|
|
7
|
+
canvasRef: import('react').RefObject<HTMLCanvasElement | null>;
|
|
8
|
+
containerRef: import('react').RefObject<HTMLDivElement | null>;
|
|
9
|
+
ratio: number;
|
|
10
|
+
handlers: {
|
|
11
|
+
onPointerEnter: ((event: React.PointerEvent) => void) | undefined;
|
|
12
|
+
onPointerLeave: (() => void) | undefined;
|
|
13
|
+
onPointerMove: ((event: React.PointerEvent<HTMLDivElement>) => void) | undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|