jaml-ui 0.24.20 → 0.25.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 +0 -13
- package/assets/WeeJokerExampleDAilyGame.png +0 -0
- package/assets/balatro-stake-chips.png +0 -0
- package/dist/assets.d.ts +1 -2
- package/dist/chunks/Layer-BBPJFHfs.js +17 -0
- package/dist/chunks/Layer-BBPJFHfs.js.map +1 -0
- package/dist/chunks/assets-RWUiFSTc.js +37 -0
- package/dist/chunks/assets-RWUiFSTc.js.map +1 -0
- package/dist/chunks/motelyItemDecoder-CueyZ0XD.js +6039 -0
- package/dist/chunks/motelyItemDecoder-CueyZ0XD.js.map +1 -0
- package/dist/chunks/spriteMapper-CFjN0_TV.js +2415 -0
- package/dist/chunks/spriteMapper-CFjN0_TV.js.map +1 -0
- package/dist/chunks/tokens-B65Fzble.js +57 -0
- package/dist/chunks/tokens-B65Fzble.js.map +1 -0
- package/dist/chunks/ui-5cBy3zAm.js +1387 -0
- package/dist/chunks/ui-5cBy3zAm.js.map +1 -0
- package/dist/components/AnalyzerExplorer.d.ts +1 -1
- package/dist/components/CardFan.d.ts +1 -1
- package/dist/components/CardList.d.ts +1 -1
- package/dist/components/DeckSprite.d.ts +1 -1
- package/dist/components/JamlAestheticSelector.d.ts +1 -1
- package/dist/components/JamlAnalyzerFullscreen.d.ts +5 -5
- package/dist/components/JamlCurator.d.ts +1 -6
- package/dist/components/JamlIde.d.ts +5 -5
- package/dist/components/JamlSeedInput.d.ts +1 -1
- package/dist/components/JamlSpeedometer.d.ts +1 -1
- package/dist/components/MotelyVersionBadge.d.ts +1 -1
- package/dist/components/Standardcard.d.ts +1 -1
- package/dist/components/jamlMap/CategoryPicker.d.ts +3 -3
- package/dist/components/jamlMap/JamlMapEditor.d.ts +1 -1
- package/dist/components/jamlMap/JokerPicker.d.ts +1 -1
- package/dist/components/jamlMap/MysterySlot.d.ts +2 -2
- package/dist/components/jamlMap/index.d.ts +4 -4
- package/dist/core.d.ts +5 -5
- package/dist/core.js +27 -5
- package/dist/core.js.map +1 -0
- package/dist/decode/motelyItemDecoder.d.ts +0 -10
- package/dist/decode/motelySprite.d.ts +1 -1
- package/dist/fonts/m6x11plus.otf +0 -0
- package/dist/hooks/analyzerStreamRegistry.d.ts +2 -2
- package/dist/hooks/useAnalyzer.d.ts +3 -3
- package/dist/hooks/useSearch.d.ts +2 -2
- package/dist/index.d.ts +29 -31
- package/dist/index.js +16721 -34
- package/dist/index.js.map +1 -0
- package/dist/lib/const.d.ts +2 -2
- package/dist/lib/hooks/useDragScroll.d.ts +1 -1
- package/dist/lib/hooks/useJamlFilter.d.ts +2 -2
- package/dist/lib/hooks/useSeedAnalyzer.d.ts +2 -2
- package/dist/lib/utils.d.ts +1 -1
- package/dist/motely.d.ts +4 -3
- package/dist/motely.js +65 -3
- package/dist/motely.js.map +1 -0
- package/dist/motelyBoot.d.ts +2 -0
- package/dist/motelyDisplay.d.ts +0 -2
- package/dist/r3f/Card3D.d.ts +2 -2
- package/dist/r3f/JimboBillboard.d.ts +1 -1
- package/dist/r3f.js +235 -3
- package/dist/r3f.js.map +1 -0
- package/dist/render/CanvasRenderer.d.ts +1 -1
- package/dist/sprites/spriteData.d.ts +1 -6
- package/dist/sprites/spriteMapper.d.ts +1 -1
- package/dist/ui/JimboBadge.d.ts +1 -1
- package/dist/ui/JimboFloating.d.ts +1 -1
- package/dist/ui/JimboIconButton.d.ts +1 -1
- package/dist/ui/JimboSelect.d.ts +1 -1
- package/dist/ui/footer.d.ts +2 -3
- package/dist/ui/hooks.d.ts +1 -1
- package/dist/ui/ide/DeckSprite.d.ts +1 -1
- package/dist/ui/jimbo.css +2 -1856
- package/dist/ui/jimboApp.d.ts +1 -1
- package/dist/ui/jimboFilterBar.d.ts +1 -1
- package/dist/ui/jimboFlankNav.d.ts +1 -1
- package/dist/ui/jimboInfoCard.d.ts +1 -1
- package/dist/ui/jimboInset.d.ts +1 -1
- package/dist/ui/jimboStatGrid.d.ts +1 -1
- package/dist/ui/jimboText.d.ts +1 -1
- package/dist/ui/jimboTooltip.d.ts +2 -2
- package/dist/ui/mascot/SeedMascot.d.ts +2 -2
- package/dist/ui/panel.d.ts +1 -1
- package/dist/ui/radial/RadialBadge.d.ts +1 -2
- package/dist/ui/radial/RadialButton.d.ts +1 -2
- package/dist/ui/radial/RadialMenu.d.ts +2 -2
- package/dist/ui/radial/RadialPill.d.ts +1 -2
- package/dist/ui/radial/index.d.ts +16 -16
- package/dist/ui/radial/radialMenuStore.d.ts +1 -1
- package/dist/ui/showcase.d.ts +1 -1
- package/dist/ui/sprites.d.ts +2 -2
- package/dist/ui.d.ts +0 -1
- package/dist/ui.js +3 -36
- package/dist/utils/gameCardUtils.d.ts +1 -1
- package/dist/utils/jamlVisualFilter.d.ts +1 -7
- package/package.json +13 -25
- package/dist/assets.js +0 -48
- package/dist/components/AnalyzerExplorer.js +0 -391
- package/dist/components/CardFan.js +0 -80
- package/dist/components/CardList.js +0 -5
- package/dist/components/DeckSprite.js +0 -75
- package/dist/components/GameCard.js +0 -355
- package/dist/components/JamlAestheticSelector.js +0 -22
- package/dist/components/JamlAnalyzerFullscreen.js +0 -263
- package/dist/components/JamlCodeEditor.js +0 -137
- package/dist/components/JamlCurator.js +0 -64
- package/dist/components/JamlCurator.stories.d.ts +0 -6
- package/dist/components/JamlCurator.stories.js +0 -14
- package/dist/components/JamlIde.js +0 -193
- package/dist/components/JamlIdeToolbar.js +0 -23
- package/dist/components/JamlIdeVisual.js +0 -218
- package/dist/components/JamlMapPreview.js +0 -121
- package/dist/components/JamlSeedInput.js +0 -26
- package/dist/components/JamlSpeedometer.js +0 -70
- package/dist/components/Jimbolate.js +0 -17
- package/dist/components/MotelyVersionBadge.js +0 -19
- package/dist/components/PaginatedFilterBrowser.js +0 -54
- package/dist/components/RunConfigModal.js +0 -59
- package/dist/components/Standardcard.js +0 -80
- package/dist/components/jamlMap/CategoryPicker.js +0 -135
- package/dist/components/jamlMap/JamlMapEditor.js +0 -304
- package/dist/components/jamlMap/JamlMapEditor.stories.d.ts +0 -7
- package/dist/components/jamlMap/JamlMapEditor.stories.js +0 -26
- package/dist/components/jamlMap/JamlMapEditorDemo.d.ts +0 -8
- package/dist/components/jamlMap/JamlMapEditorDemo.js +0 -323
- package/dist/components/jamlMap/JokerPicker.js +0 -113
- package/dist/components/jamlMap/MysterySlot.js +0 -128
- package/dist/components/jamlMap/MysterySlot.stories.d.ts +0 -7
- package/dist/components/jamlMap/MysterySlot.stories.js +0 -31
- package/dist/components/jamlMap/index.js +0 -4
- package/dist/decode/motelyItemDecoder.js +0 -164
- package/dist/decode/motelySprite.js +0 -84
- package/dist/hooks/analyzerStreamRegistry.js +0 -96
- package/dist/hooks/searchWorker.d.ts +0 -1
- package/dist/hooks/searchWorker.js +0 -119
- package/dist/hooks/searchWorkerCode.d.ts +0 -1
- package/dist/hooks/searchWorkerCode.js +0 -85
- package/dist/hooks/useAnalyzer.js +0 -91
- package/dist/hooks/useIntersectionObserver.js +0 -52
- package/dist/hooks/useSearch.js +0 -161
- package/dist/hooks/useShopStream.js +0 -85
- package/dist/lib/SpriteMapper.js +0 -48
- package/dist/lib/cardParser.js +0 -67
- package/dist/lib/classes/BuyMetaData.js +0 -1
- package/dist/lib/config.js +0 -15
- package/dist/lib/const.js +0 -521
- package/dist/lib/data/constants.js +0 -14
- package/dist/lib/hooks/useDragScroll.js +0 -48
- package/dist/lib/hooks/useJamlFilter.js +0 -219
- package/dist/lib/hooks/useSeedAnalyzer.js +0 -50
- package/dist/lib/jaml/jamlCompletion.js +0 -13
- package/dist/lib/jaml/jamlData.js +0 -6
- package/dist/lib/jaml/jamlObjectives.js +0 -97
- package/dist/lib/jaml/jamlParser.js +0 -47
- package/dist/lib/jaml/jamlPresets.js +0 -61
- package/dist/lib/jaml/jamlSchema.js +0 -91
- package/dist/lib/parseDailyRitual.js +0 -70
- package/dist/lib/tts/getRevealPos.js +0 -16
- package/dist/lib/tts/splitTtsDisplay.js +0 -35
- package/dist/lib/types.js +0 -1
- package/dist/lib/utils.js +0 -5
- package/dist/motelyDisplay.js +0 -59
- package/dist/r3f/Card3D.js +0 -72
- package/dist/r3f/JimboBillboard.js +0 -32
- package/dist/r3f/JimboText3D.js +0 -8
- package/dist/render/CanvasRenderer.js +0 -11
- package/dist/render/Layer.js +0 -18
- package/dist/sprites/spriteData.js +0 -100
- package/dist/sprites/spriteMapper.js +0 -75
- package/dist/stories/Button.d.ts +0 -15
- package/dist/stories/Button.js +0 -7
- package/dist/stories/Button.stories.d.ts +0 -24
- package/dist/stories/Button.stories.js +0 -50
- package/dist/stories/Header.d.ts +0 -12
- package/dist/stories/Header.js +0 -4
- package/dist/stories/Header.stories.d.ts +0 -18
- package/dist/stories/Header.stories.js +0 -26
- package/dist/stories/Page.d.ts +0 -3
- package/dist/stories/Page.js +0 -8
- package/dist/stories/Page.stories.d.ts +0 -12
- package/dist/stories/Page.stories.js +0 -24
- package/dist/ui/Jimbo.stories.d.ts +0 -7
- package/dist/ui/Jimbo.stories.js +0 -28
- package/dist/ui/JimboBadge.js +0 -8
- package/dist/ui/JimboFloating.js +0 -17
- package/dist/ui/JimboIconButton.js +0 -28
- package/dist/ui/JimboInputModal.js +0 -66
- package/dist/ui/JimboSelect.js +0 -43
- package/dist/ui/JimboToggleList.js +0 -5
- package/dist/ui/PanelSplitter.js +0 -78
- package/dist/ui/codeBlock.js +0 -14
- package/dist/ui/footer.js +0 -20
- package/dist/ui/hooks.js +0 -634
- package/dist/ui/ide/AgnosticSeedCard.d.ts +0 -19
- package/dist/ui/ide/AgnosticSeedCard.js +0 -48
- package/dist/ui/ide/DeckSprite.js +0 -2
- package/dist/ui/ide/JamlBuilder.d.ts +0 -1
- package/dist/ui/ide/JamlBuilder.js +0 -112
- package/dist/ui/ide/JamlEditor.js +0 -486
- package/dist/ui/ide/JamlEditorMonaco.d.ts +0 -8
- package/dist/ui/ide/JamlEditorMonaco.js +0 -78
- package/dist/ui/ide/WasmStatus.d.ts +0 -1
- package/dist/ui/ide/WasmStatus.js +0 -42
- package/dist/ui/jimboApp.js +0 -15
- package/dist/ui/jimboBackground.js +0 -27
- package/dist/ui/jimboCopyRow.js +0 -18
- package/dist/ui/jimboFilterBar.js +0 -16
- package/dist/ui/jimboFlankNav.js +0 -18
- package/dist/ui/jimboInfoCard.js +0 -26
- package/dist/ui/jimboInset.js +0 -9
- package/dist/ui/jimboSectionHeader.js +0 -9
- package/dist/ui/jimboStatGrid.js +0 -9
- package/dist/ui/jimboTabs.js +0 -22
- package/dist/ui/jimboText.js +0 -33
- package/dist/ui/jimboTooltip.js +0 -39
- package/dist/ui/jimboWordmark.js +0 -9
- package/dist/ui/mascot/JammySpeechBox.js +0 -30
- package/dist/ui/mascot/SeedMascot.js +0 -17
- package/dist/ui/mascot/index.js +0 -3
- package/dist/ui/mascot/menuConfig.js +0 -12
- package/dist/ui/panel.js +0 -24
- package/dist/ui/radial/RadialBadge.js +0 -43
- package/dist/ui/radial/RadialBreadcrumb.js +0 -18
- package/dist/ui/radial/RadialButton.js +0 -102
- package/dist/ui/radial/RadialMenu.js +0 -168
- package/dist/ui/radial/RadialPill.js +0 -15
- package/dist/ui/radial/index.js +0 -18
- package/dist/ui/radial/radialMenuStore.js +0 -122
- package/dist/ui/radial/radialMenuViewport.js +0 -59
- package/dist/ui/radial/useRadialMenu.js +0 -107
- package/dist/ui/showcase.js +0 -20
- package/dist/ui/sprites.js +0 -77
- package/dist/ui/tokens.js +0 -64
- package/dist/utils/gameCardUtils.js +0 -15
- package/dist/utils/jamlMapPreview.js +0 -106
- package/dist/utils/jamlVisualFilter.js +0 -210
package/dist/lib/const.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DECK_OPTIONS, STAKE_OPTIONS, ANTE_OPTIONS, SLOT_OPTIONS, CLAUSE_TYPES, SOURCE_OPTIONS, EDITION_OPTIONS, SEAL_OPTIONS, ENHANCEMENT_OPTIONS } from '../data/constants.js';
|
|
1
2
|
export interface JamlClause {
|
|
2
3
|
type: string;
|
|
3
4
|
value: string;
|
|
@@ -27,7 +28,6 @@ export interface JamlFilter {
|
|
|
27
28
|
should: JamlClause[];
|
|
28
29
|
mustNot: JamlClause[];
|
|
29
30
|
}
|
|
30
|
-
import { DECK_OPTIONS, STAKE_OPTIONS, ANTE_OPTIONS, SLOT_OPTIONS, CLAUSE_TYPES, SOURCE_OPTIONS, EDITION_OPTIONS, SEAL_OPTIONS, ENHANCEMENT_OPTIONS } from '../data/constants.js';
|
|
31
31
|
export { DECK_OPTIONS, STAKE_OPTIONS, ANTE_OPTIONS, SLOT_OPTIONS, CLAUSE_TYPES, SOURCE_OPTIONS, EDITION_OPTIONS, SEAL_OPTIONS, ENHANCEMENT_OPTIONS };
|
|
32
32
|
export declare function useJamlFilter(initialJaml?: string): {
|
|
33
33
|
filter: JamlFilter;
|
|
@@ -41,7 +41,7 @@ export declare function useJamlFilter(initialJaml?: string): {
|
|
|
41
41
|
bucket: keyof Pick<JamlFilter, "must" | "should" | "mustNot">;
|
|
42
42
|
index: number | null;
|
|
43
43
|
} | null;
|
|
44
|
-
setEditingClause: import(
|
|
44
|
+
setEditingClause: import('react').Dispatch<import('react').SetStateAction<{
|
|
45
45
|
bucket: keyof Pick<JamlFilter, "must" | "should" | "mustNot">;
|
|
46
46
|
index: number | null;
|
|
47
47
|
} | null>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Motely } from 'motely-wasm';
|
|
2
2
|
export declare function useSeedAnalyzer(motely: typeof Motely | null, seed: string | null): {
|
|
3
|
-
data:
|
|
3
|
+
data: any;
|
|
4
4
|
loading: boolean;
|
|
5
5
|
error: string | null;
|
|
6
6
|
};
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
2
|
export declare function cn(...inputs: ClassValue[]): string;
|
package/dist/motely.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { Motely } from './motelyBoot.js';
|
|
2
|
+
export { decodeMotelyItem, decodeMotelyItemToJamlCard, motelyItemTypeName, motelyItemCategory, motelyItemDisplayName, motelyItemRenderCategory, motelyItemEditionName, motelyItemSealName, motelyItemEnhancementName, motelyStandardcardRankName, motelyStandardcardSuitName, decodeMotelyItemName, resolveMotelyItemType, warmMotelyItemCache, motelyItemCacheSize, type DecodedMotelyItem, type MotelyItemInput, type MotelyJamlCard, type MotelyRenderableCategory, type MotelyRuntimeItem, } from './decode/motelyItemDecoder.js';
|
|
3
|
+
export { motelyItemToSprite, getMotelySpriteByName, type MotelySpriteData, } from './decode/motelySprite.js';
|
|
4
|
+
export { motelyBossDisplayName, motelyBossDisplayNameFromKey, motelyBoosterPackDisplayName, motelyBoosterPackDisplayNameFromKey, motelyItemDisplayNameFromKey, motelyItemDisplayNameFromValue, motelyTagDisplayName, motelyTagDisplayNameFromKey, motelyVoucherDisplayName, motelyVoucherDisplayNameFromKey, } from './motelyDisplay.js';
|
package/dist/motely.js
CHANGED
|
@@ -1,4 +1,66 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { n as e } from "./chunks/assets-RWUiFSTc.js";
|
|
3
|
+
import { d as t, h as n, r, t as i } from "./chunks/spriteMapper-CFjN0_TV.js";
|
|
4
|
+
import { C as a, E as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, l as v, m as y, n as b, o as x, p as S, r as C, s as w, t as T, u as E, v as D, w as O, x as k, y as A } from "./chunks/motelyItemDecoder-CueyZ0XD.js";
|
|
5
|
+
//#region src/decode/motelySprite.ts
|
|
6
|
+
function j(a) {
|
|
7
|
+
let o = T(a);
|
|
8
|
+
if (!o) return null;
|
|
9
|
+
if (o.category === "playing" && o.rank && o.suit) {
|
|
10
|
+
let r = t[o.rank], i = n[o.suit];
|
|
11
|
+
if (r !== void 0 && i !== void 0) return {
|
|
12
|
+
atlasPath: e("deck"),
|
|
13
|
+
gridCol: r,
|
|
14
|
+
gridRow: i,
|
|
15
|
+
gridCols: 13,
|
|
16
|
+
gridRows: 4,
|
|
17
|
+
displayName: o.displayName,
|
|
18
|
+
category: "playing"
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
let s = r(o.displayName);
|
|
22
|
+
if (!s) return null;
|
|
23
|
+
let c = i[s.type];
|
|
24
|
+
return c ? {
|
|
25
|
+
atlasPath: e(c.assetKey),
|
|
26
|
+
gridCol: s.pos.x,
|
|
27
|
+
gridRow: s.pos.y,
|
|
28
|
+
gridCols: c.cols,
|
|
29
|
+
gridRows: c.rows,
|
|
30
|
+
displayName: o.displayName,
|
|
31
|
+
category: o.category
|
|
32
|
+
} : null;
|
|
33
|
+
}
|
|
34
|
+
function M(a, o = "unknown") {
|
|
35
|
+
if (o === "playing") {
|
|
36
|
+
let r = /^(.*?)\s+of\s+(.*?)$/i.exec(a);
|
|
37
|
+
if (r) {
|
|
38
|
+
let i = r[1], o = r[2], s = t[i], c = n[o];
|
|
39
|
+
if (s !== void 0 && c !== void 0) return {
|
|
40
|
+
atlasPath: e("deck"),
|
|
41
|
+
gridCol: s,
|
|
42
|
+
gridRow: c,
|
|
43
|
+
gridCols: 13,
|
|
44
|
+
gridRows: 4,
|
|
45
|
+
displayName: a,
|
|
46
|
+
category: "playing"
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
let s = r(a);
|
|
51
|
+
if (!s) return null;
|
|
52
|
+
let c = i[s.type];
|
|
53
|
+
return c ? {
|
|
54
|
+
atlasPath: e(c.assetKey),
|
|
55
|
+
gridCol: s.pos.x,
|
|
56
|
+
gridRow: s.pos.y,
|
|
57
|
+
gridCols: c.cols,
|
|
58
|
+
gridRows: c.rows,
|
|
59
|
+
displayName: a,
|
|
60
|
+
category: o
|
|
61
|
+
} : null;
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { o as Motely, T as decodeMotelyItem, b as decodeMotelyItemName, C as decodeMotelyItemToJamlCard, M as getMotelySpriteByName, h as motelyBoosterPackDisplayName, l as motelyBoosterPackDisplayNameFromKey, D as motelyBossDisplayName, A as motelyBossDisplayNameFromKey, _ as motelyItemCacheSize, u as motelyItemCategory, x as motelyItemDisplayName, d as motelyItemDisplayNameFromKey, k as motelyItemDisplayNameFromValue, w as motelyItemEditionName, f as motelyItemEnhancementName, v as motelyItemRenderCategory, E as motelyItemSealName, j as motelyItemToSprite, p as motelyItemTypeName, m as motelyStandardcardRankName, S as motelyStandardcardSuitName, s as motelyTagDisplayName, a as motelyTagDisplayNameFromKey, O as motelyVoucherDisplayName, c as motelyVoucherDisplayNameFromKey, y as resolveMotelyItemType, g as warmMotelyItemCache };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=motely.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motely.js","names":[],"sources":["../src/decode/motelySprite.ts"],"sourcesContent":["import { decodeMotelyItem, type MotelyRenderableCategory } from \"./motelyItemDecoder.js\";\r\nimport { getSpriteData, SHEET_META } from \"../sprites/spriteMapper.js\";\r\nimport { RANK_MAP, SUIT_MAP } from \"../sprites/spriteData.js\";\r\nimport { resolveJamlAssetUrl } from \"../assets.js\";\r\n\r\nexport interface MotelySpriteData {\r\n atlasPath: string;\r\n gridCol: number;\r\n gridRow: number;\r\n gridCols: number;\r\n gridRows: number;\r\n displayName: string;\r\n category: MotelyRenderableCategory;\r\n}\r\n\r\n/**\r\n * Given a raw motely-wasm item value (which may be a bitpacked integer or raw MotelyItemType),\r\n * resolves it to a sprite atlas path and grid coordinates for rendering.\r\n */\r\nexport function motelyItemToSprite(rawValue: number): MotelySpriteData | null {\r\n const decoded = decodeMotelyItem(rawValue);\r\n if (!decoded) return null;\r\n\r\n if (decoded.category === \"playing\" && decoded.rank && decoded.suit) {\r\n const col = RANK_MAP[decoded.rank];\r\n const row = SUIT_MAP[decoded.suit];\r\n if (col !== undefined && row !== undefined) {\r\n return {\r\n atlasPath: resolveJamlAssetUrl('deck'),\r\n gridCol: col,\r\n gridRow: row,\r\n gridCols: 13,\r\n gridRows: 4,\r\n displayName: decoded.displayName,\r\n category: \"playing\"\r\n };\r\n }\r\n }\r\n\r\n const sprite = getSpriteData(decoded.displayName);\r\n if (!sprite) return null;\r\n\r\n const meta = SHEET_META[sprite.type];\r\n if (!meta) return null;\r\n\r\n return {\r\n atlasPath: resolveJamlAssetUrl(meta.assetKey),\r\n gridCol: sprite.pos.x,\r\n gridRow: sprite.pos.y,\r\n gridCols: meta.cols,\r\n gridRows: meta.rows,\r\n displayName: decoded.displayName,\r\n category: decoded.category\r\n };\r\n}\r\n\r\n/**\r\n * Resolves a sprite by name and category without needing a Motely integer.\r\n */\r\nexport function getMotelySpriteByName(name: string, category: MotelyRenderableCategory = \"unknown\"): MotelySpriteData | null {\r\n if (category === \"playing\") {\r\n // Attempt to parse \"Rank of Suit\"\r\n const match = /^(.*?)\\s+of\\s+(.*?)$/i.exec(name);\r\n if (match) {\r\n const rank = match[1];\r\n const suit = match[2];\r\n const col = RANK_MAP[rank];\r\n const row = SUIT_MAP[suit];\r\n if (col !== undefined && row !== undefined) {\r\n return {\r\n atlasPath: resolveJamlAssetUrl('deck'),\r\n gridCol: col,\r\n gridRow: row,\r\n gridCols: 13,\r\n gridRows: 4,\r\n displayName: name,\r\n category: \"playing\"\r\n };\r\n }\r\n }\r\n }\r\n\r\n const sprite = getSpriteData(name);\r\n if (!sprite) return null;\r\n\r\n const meta = SHEET_META[sprite.type];\r\n if (!meta) return null;\r\n\r\n return {\r\n atlasPath: resolveJamlAssetUrl(meta.assetKey),\r\n gridCol: sprite.pos.x,\r\n gridRow: sprite.pos.y,\r\n gridCols: meta.cols,\r\n gridRows: meta.rows,\r\n displayName: name,\r\n category\r\n };\r\n}\r\n"],"mappings":";;;;;AAmBA,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ACf,aAAa;EACb;EACD,GAViB"}
|
package/dist/motelyDisplay.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { Motely as MotelyEnumsType } from "motely-wasm";
|
|
2
|
-
export declare function setMotelyEnums(motely: typeof MotelyEnumsType): void;
|
|
3
1
|
export declare function motelyBossDisplayName(value: number): string;
|
|
4
2
|
export declare function motelyBossDisplayNameFromKey(key: string): string;
|
|
5
3
|
export declare function motelyVoucherDisplayName(value: number): string;
|
package/dist/r3f/Card3D.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { MotelySpriteData } from '../decode/motelySprite.js';
|
|
2
2
|
export declare const CARD_DIMENSIONS: {
|
|
3
3
|
readonly WIDTH: 0.7;
|
|
4
4
|
readonly HEIGHT: 0.95;
|
|
@@ -22,4 +22,4 @@ export interface Card3DProps {
|
|
|
22
22
|
onPointerEnter?: () => void;
|
|
23
23
|
onPointerLeave?: () => void;
|
|
24
24
|
}
|
|
25
|
-
export declare const Card3D: import(
|
|
25
|
+
export declare const Card3D: import('react').NamedExoticComponent<Card3DProps>;
|
package/dist/r3f.js
CHANGED
|
@@ -1,3 +1,235 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { n as e } from "./chunks/assets-RWUiFSTc.js";
|
|
2
|
+
import { n as t } from "./chunks/tokens-B65Fzble.js";
|
|
3
|
+
import { memo as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import { useFrame as c, useLoader as l } from "@react-three/fiber";
|
|
6
|
+
import { animated as u, useSpring as d } from "@react-spring/three";
|
|
7
|
+
import * as f from "three";
|
|
8
|
+
import { Billboard as p, Text as m } from "@react-three/drei";
|
|
9
|
+
//#region src/r3f/Card3D.tsx
|
|
10
|
+
var h = {
|
|
11
|
+
WIDTH: .7,
|
|
12
|
+
HEIGHT: .95,
|
|
13
|
+
DEPTH: .02
|
|
14
|
+
}, g = {
|
|
15
|
+
MAX_TILT_X: .36,
|
|
16
|
+
MAX_TILT_Y: .42,
|
|
17
|
+
MAX_SHIFT: .038,
|
|
18
|
+
TWIST_Z: .11,
|
|
19
|
+
LERP_IN: 18,
|
|
20
|
+
LERP_OUT: 10
|
|
21
|
+
};
|
|
22
|
+
function _(e) {
|
|
23
|
+
let t = l(f.TextureLoader, e.atlasPath);
|
|
24
|
+
return r(() => {
|
|
25
|
+
let n = t.clone();
|
|
26
|
+
return n.colorSpace = f.SRGBColorSpace, n.magFilter = f.NearestFilter, n.minFilter = f.NearestFilter, n.repeat.set(1 / e.gridCols, 1 / e.gridRows), n.offset.set(e.gridCol / e.gridCols, 1 - (e.gridRow + 1) / e.gridRows), n.needsUpdate = !0, n;
|
|
27
|
+
}, [
|
|
28
|
+
t,
|
|
29
|
+
e.gridCol,
|
|
30
|
+
e.gridRow,
|
|
31
|
+
e.gridCols,
|
|
32
|
+
e.gridRows
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
35
|
+
var v = n(function({ sprite: e, position: t = [
|
|
36
|
+
0,
|
|
37
|
+
0,
|
|
38
|
+
0
|
|
39
|
+
], rotation: n = [
|
|
40
|
+
0,
|
|
41
|
+
0,
|
|
42
|
+
0
|
|
43
|
+
], selected: l = !1, highlighted: p = !1, onClick: m, onPointerEnter: v, onPointerLeave: y }) {
|
|
44
|
+
let b = i(null), x = i({
|
|
45
|
+
rx: 0,
|
|
46
|
+
ry: 0,
|
|
47
|
+
rz: 0,
|
|
48
|
+
ox: 0,
|
|
49
|
+
oy: 0
|
|
50
|
+
}), [S, C] = a(!1), w = _(e), { posY: T, scale: E } = d({
|
|
51
|
+
posY: l ? .3 : S ? .15 : 0,
|
|
52
|
+
scale: S ? 1.08 : l ? 1.05 : 1,
|
|
53
|
+
config: {
|
|
54
|
+
tension: 300,
|
|
55
|
+
friction: 20
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
c((e, t) => {
|
|
59
|
+
let n = b.current;
|
|
60
|
+
if (!n) return;
|
|
61
|
+
let r = x.current, i = S ? g.LERP_IN : g.LERP_OUT, a = 1 - Math.exp(-i * t);
|
|
62
|
+
n.rotation.x = f.MathUtils.lerp(n.rotation.x, r.rx, a), n.rotation.y = f.MathUtils.lerp(n.rotation.y, r.ry, a), n.rotation.z = f.MathUtils.lerp(n.rotation.z, r.rz, a), n.position.x = f.MathUtils.lerp(n.position.x, r.ox, a), n.position.y = f.MathUtils.lerp(n.position.y, r.oy, a);
|
|
63
|
+
});
|
|
64
|
+
let D = r(() => p ? "#e4b643" : "#ffffff", [p]), O = (e) => {
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
let t = e.uv;
|
|
67
|
+
if (!t) return;
|
|
68
|
+
let n = f.MathUtils.clamp((t.x - .5) * 2, -1, 1), r = f.MathUtils.clamp((t.y - .5) * 2, -1, 1);
|
|
69
|
+
x.current.ry = -n * g.MAX_TILT_Y, x.current.rx = r * g.MAX_TILT_X, x.current.rz = -n * r * g.TWIST_Z, x.current.ox = n * g.MAX_SHIFT, x.current.oy = -r * g.MAX_SHIFT * .65;
|
|
70
|
+
}, k = () => {
|
|
71
|
+
x.current = {
|
|
72
|
+
rx: 0,
|
|
73
|
+
ry: 0,
|
|
74
|
+
rz: 0,
|
|
75
|
+
ox: 0,
|
|
76
|
+
oy: 0
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
return w ? /* @__PURE__ */ s(u.group, {
|
|
80
|
+
"position-x": t[0],
|
|
81
|
+
"position-y": T.to((e) => t[1] + e),
|
|
82
|
+
"position-z": t[2],
|
|
83
|
+
"rotation-x": n[0],
|
|
84
|
+
"rotation-y": n[1],
|
|
85
|
+
"rotation-z": n[2],
|
|
86
|
+
scale: E,
|
|
87
|
+
children: [/* @__PURE__ */ s("mesh", {
|
|
88
|
+
visible: !1,
|
|
89
|
+
onClick: (e) => {
|
|
90
|
+
e.stopPropagation(), m?.();
|
|
91
|
+
},
|
|
92
|
+
onPointerMove: O,
|
|
93
|
+
onPointerEnter: (e) => {
|
|
94
|
+
e.stopPropagation(), C(!0), v?.(), document.body.style.cursor = "pointer";
|
|
95
|
+
},
|
|
96
|
+
onPointerLeave: (e) => {
|
|
97
|
+
e.stopPropagation(), C(!1), k(), y?.(), document.body.style.cursor = "auto";
|
|
98
|
+
},
|
|
99
|
+
children: [/* @__PURE__ */ o("boxGeometry", { args: [
|
|
100
|
+
h.WIDTH,
|
|
101
|
+
h.HEIGHT,
|
|
102
|
+
h.DEPTH * 2
|
|
103
|
+
] }), /* @__PURE__ */ o("meshBasicMaterial", {})]
|
|
104
|
+
}), /* @__PURE__ */ s("group", {
|
|
105
|
+
ref: b,
|
|
106
|
+
children: [
|
|
107
|
+
p && /* @__PURE__ */ o("pointLight", {
|
|
108
|
+
color: D,
|
|
109
|
+
intensity: 1.5,
|
|
110
|
+
distance: 1,
|
|
111
|
+
position: [
|
|
112
|
+
0,
|
|
113
|
+
0,
|
|
114
|
+
.1
|
|
115
|
+
]
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ s("mesh", {
|
|
118
|
+
castShadow: !0,
|
|
119
|
+
receiveShadow: !0,
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ o("boxGeometry", { args: [
|
|
122
|
+
h.WIDTH,
|
|
123
|
+
h.HEIGHT,
|
|
124
|
+
h.DEPTH
|
|
125
|
+
] }),
|
|
126
|
+
/* @__PURE__ */ o("meshBasicMaterial", {
|
|
127
|
+
attach: "material-4",
|
|
128
|
+
map: w,
|
|
129
|
+
toneMapped: !1
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ o("meshStandardMaterial", {
|
|
132
|
+
attach: "material-5",
|
|
133
|
+
color: "#1a1a2e",
|
|
134
|
+
metalness: .2,
|
|
135
|
+
roughness: .8
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ o("meshStandardMaterial", {
|
|
138
|
+
attach: "material-0",
|
|
139
|
+
color: "#f5f5dc"
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ o("meshStandardMaterial", {
|
|
142
|
+
attach: "material-1",
|
|
143
|
+
color: "#f5f5dc"
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ o("meshStandardMaterial", {
|
|
146
|
+
attach: "material-2",
|
|
147
|
+
color: "#f5f5dc"
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ o("meshStandardMaterial", {
|
|
150
|
+
attach: "material-3",
|
|
151
|
+
color: "#f5f5dc"
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
l && /* @__PURE__ */ s("mesh", {
|
|
156
|
+
position: [
|
|
157
|
+
0,
|
|
158
|
+
0,
|
|
159
|
+
-h.DEPTH
|
|
160
|
+
],
|
|
161
|
+
children: [/* @__PURE__ */ o("ringGeometry", { args: [
|
|
162
|
+
.45,
|
|
163
|
+
.5,
|
|
164
|
+
32
|
|
165
|
+
] }), /* @__PURE__ */ o("meshBasicMaterial", {
|
|
166
|
+
color: "#e4b643",
|
|
167
|
+
transparent: !0,
|
|
168
|
+
opacity: .8
|
|
169
|
+
})]
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
})]
|
|
173
|
+
}) : null;
|
|
174
|
+
});
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/r3f/JimboBillboard.tsx
|
|
177
|
+
function y(e) {
|
|
178
|
+
return e.sprite ? /* @__PURE__ */ o(b, {
|
|
179
|
+
...e,
|
|
180
|
+
sprite: e.sprite
|
|
181
|
+
}) : null;
|
|
182
|
+
}
|
|
183
|
+
function b({ sprite: e, width: t = 3.4, height: n = 4.5, yLockOnly: i = !1, position: a = [
|
|
184
|
+
0,
|
|
185
|
+
0,
|
|
186
|
+
0
|
|
187
|
+
] }) {
|
|
188
|
+
let s = l(f.TextureLoader, e.atlasPath), c = r(() => {
|
|
189
|
+
let t = s.clone();
|
|
190
|
+
return t.magFilter = f.NearestFilter, t.minFilter = f.NearestFilter, t.repeat.set(1 / e.gridCols, 1 / e.gridRows), t.offset.set(e.gridCol / e.gridCols, 1 - (e.gridRow + 1) / e.gridRows), t.needsUpdate = !0, t;
|
|
191
|
+
}, [
|
|
192
|
+
s,
|
|
193
|
+
e.gridCol,
|
|
194
|
+
e.gridRow,
|
|
195
|
+
e.gridCols,
|
|
196
|
+
e.gridRows
|
|
197
|
+
]);
|
|
198
|
+
return /* @__PURE__ */ o(p, {
|
|
199
|
+
lockY: i,
|
|
200
|
+
lockX: !1,
|
|
201
|
+
lockZ: !1,
|
|
202
|
+
position: a,
|
|
203
|
+
children: /* @__PURE__ */ o("mesh", {
|
|
204
|
+
material: r(() => new f.MeshBasicMaterial({
|
|
205
|
+
map: c,
|
|
206
|
+
transparent: !0,
|
|
207
|
+
alphaTest: .5
|
|
208
|
+
}), [c]),
|
|
209
|
+
children: /* @__PURE__ */ o("planeGeometry", { args: [t, n] })
|
|
210
|
+
})
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region src/r3f/JimboText3D.tsx
|
|
215
|
+
function x({ children: n, color: r = t.WHITE, outlineColor: i = t.BLACK, outlineWidth: a = .05, position: s = [
|
|
216
|
+
0,
|
|
217
|
+
0,
|
|
218
|
+
0
|
|
219
|
+
], fontSize: c = 1 }) {
|
|
220
|
+
return /* @__PURE__ */ o(m, {
|
|
221
|
+
position: s,
|
|
222
|
+
fontSize: c,
|
|
223
|
+
color: r,
|
|
224
|
+
outlineColor: i,
|
|
225
|
+
outlineWidth: a,
|
|
226
|
+
font: e("font"),
|
|
227
|
+
anchorX: "center",
|
|
228
|
+
anchorY: "middle",
|
|
229
|
+
children: n
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
export { h as CARD_DIMENSIONS, g as CARD_MAGNET, v as Card3D, y as JimboBillboard, x as JimboText3D };
|
|
234
|
+
|
|
235
|
+
//# sourceMappingURL=r3f.js.map
|
package/dist/r3f.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"r3f.js","names":[],"sources":["../src/r3f/Card3D.tsx","../src/r3f/JimboBillboard.tsx","../src/r3f/JimboText3D.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { useRef, useMemo, useState, memo } from 'react'\r\nimport { useFrame, useLoader, type ThreeEvent } from '@react-three/fiber'\r\nimport { useSpring, animated } from '@react-spring/three'\r\nimport * as THREE from 'three'\r\nimport type { MotelySpriteData } from '../decode/motelySprite.js'\r\n\r\n// eslint-disable-next-line react-refresh/only-export-components\r\nexport const CARD_DIMENSIONS = { WIDTH: 0.7, HEIGHT: 0.95, DEPTH: 0.02 } as const\r\n// eslint-disable-next-line react-refresh/only-export-components\r\nexport const CARD_MAGNET = {\r\n MAX_TILT_X: 0.36,\r\n MAX_TILT_Y: 0.42,\r\n MAX_SHIFT: 0.038,\r\n TWIST_Z: 0.11,\r\n LERP_IN: 18,\r\n LERP_OUT: 10,\r\n} as const\r\n\r\nfunction useSpriteTexture(sprite: MotelySpriteData) {\r\n const texture = useLoader(THREE.TextureLoader, sprite.atlasPath);\r\n \r\n return useMemo(() => {\r\n const t = texture.clone();\r\n t.colorSpace = THREE.SRGBColorSpace;\r\n t.magFilter = THREE.NearestFilter;\r\n t.minFilter = THREE.NearestFilter;\r\n t.repeat.set(1 / sprite.gridCols, 1 / sprite.gridRows);\r\n t.offset.set(\r\n sprite.gridCol / sprite.gridCols,\r\n 1 - ((sprite.gridRow + 1) / sprite.gridRows)\r\n );\r\n t.needsUpdate = true;\r\n return t;\r\n }, [texture, sprite.gridCol, sprite.gridRow, sprite.gridCols, sprite.gridRows]);\r\n}\r\n\r\nexport interface Card3DProps {\r\n sprite: MotelySpriteData\r\n position?: [number, number, number]\r\n rotation?: [number, number, number]\r\n selected?: boolean\r\n highlighted?: boolean\r\n onClick?: () => void\r\n onPointerEnter?: () => void\r\n onPointerLeave?: () => void\r\n}\r\n\r\nexport const Card3D = memo(function Card3D({\r\n sprite,\r\n position = [0, 0, 0],\r\n rotation = [0, 0, 0],\r\n selected = false,\r\n highlighted = false,\r\n onClick,\r\n onPointerEnter,\r\n onPointerLeave,\r\n}: Card3DProps) {\r\n const tiltRef = useRef<THREE.Group>(null)\r\n const target = useRef({ rx: 0, ry: 0, rz: 0, ox: 0, oy: 0 })\r\n const [hovered, setHovered] = useState(false)\r\n\r\n const texture = useSpriteTexture(sprite)\r\n\r\n const { posY, scale } = useSpring({\r\n posY: selected ? 0.3 : hovered ? 0.15 : 0,\r\n scale: hovered ? 1.08 : selected ? 1.05 : 1,\r\n config: { tension: 300, friction: 20 },\r\n })\r\n\r\n useFrame((_state, dt) => {\r\n const g = tiltRef.current\r\n if (!g) return\r\n const t = target.current\r\n const rate = hovered ? CARD_MAGNET.LERP_IN : CARD_MAGNET.LERP_OUT\r\n const a = 1 - Math.exp(-rate * dt)\r\n g.rotation.x = THREE.MathUtils.lerp(g.rotation.x, t.rx, a)\r\n g.rotation.y = THREE.MathUtils.lerp(g.rotation.y, t.ry, a)\r\n g.rotation.z = THREE.MathUtils.lerp(g.rotation.z, t.rz, a)\r\n g.position.x = THREE.MathUtils.lerp(g.position.x, t.ox, a)\r\n g.position.y = THREE.MathUtils.lerp(g.position.y, t.oy, a)\r\n })\r\n\r\n const glowColor = useMemo(() => highlighted ? '#e4b643' : '#ffffff', [highlighted])\r\n\r\n const onMove = (e: ThreeEvent<PointerEvent>) => {\r\n e.stopPropagation()\r\n const uv = e.uv\r\n if (!uv) return\r\n const nx = THREE.MathUtils.clamp((uv.x - 0.5) * 2, -1, 1)\r\n const ny = THREE.MathUtils.clamp((uv.y - 0.5) * 2, -1, 1)\r\n target.current.ry = -nx * CARD_MAGNET.MAX_TILT_Y\r\n target.current.rx = ny * CARD_MAGNET.MAX_TILT_X\r\n target.current.rz = -nx * ny * CARD_MAGNET.TWIST_Z\r\n target.current.ox = nx * CARD_MAGNET.MAX_SHIFT\r\n target.current.oy = -ny * CARD_MAGNET.MAX_SHIFT * 0.65\r\n }\r\n\r\n const reset = () => { target.current = { rx: 0, ry: 0, rz: 0, ox: 0, oy: 0 } }\r\n\r\n if (!texture) return null\r\n\r\n return (\r\n <animated.group\r\n position-x={position[0]}\r\n position-y={posY.to((y) => position[1] + y)}\r\n position-z={position[2]}\r\n rotation-x={rotation[0]}\r\n rotation-y={rotation[1]}\r\n rotation-z={rotation[2]}\r\n scale={scale}\r\n >\r\n {/* Invisible hit mesh that does not shift or twist, preventing boop-cancel loops */}\r\n <mesh\r\n visible={false}\r\n onClick={(e) => { e.stopPropagation(); onClick?.() }}\r\n onPointerMove={onMove}\r\n onPointerEnter={(e) => { e.stopPropagation(); setHovered(true); onPointerEnter?.(); document.body.style.cursor = 'pointer' }}\r\n onPointerLeave={(e) => { e.stopPropagation(); setHovered(false); reset(); onPointerLeave?.(); document.body.style.cursor = 'auto' }}\r\n >\r\n <boxGeometry args={[CARD_DIMENSIONS.WIDTH, CARD_DIMENSIONS.HEIGHT, CARD_DIMENSIONS.DEPTH * 2]} />\r\n <meshBasicMaterial />\r\n </mesh>\r\n\r\n <group ref={tiltRef}>\r\n {highlighted && (\r\n <pointLight color={glowColor} intensity={1.5} distance={1} position={[0, 0, 0.1]} />\r\n )}\r\n <mesh castShadow receiveShadow>\r\n <boxGeometry args={[CARD_DIMENSIONS.WIDTH, CARD_DIMENSIONS.HEIGHT, CARD_DIMENSIONS.DEPTH]} />\r\n <meshBasicMaterial attach=\"material-4\" map={texture} toneMapped={false} />\r\n <meshStandardMaterial attach=\"material-5\" color=\"#1a1a2e\" metalness={0.2} roughness={0.8} />\r\n <meshStandardMaterial attach=\"material-0\" color=\"#f5f5dc\" />\r\n <meshStandardMaterial attach=\"material-1\" color=\"#f5f5dc\" />\r\n <meshStandardMaterial attach=\"material-2\" color=\"#f5f5dc\" />\r\n <meshStandardMaterial attach=\"material-3\" color=\"#f5f5dc\" />\r\n </mesh>\r\n {selected && (\r\n <mesh position={[0, 0, -CARD_DIMENSIONS.DEPTH]}>\r\n <ringGeometry args={[0.45, 0.5, 32]} />\r\n <meshBasicMaterial color=\"#e4b643\" transparent opacity={0.8} />\r\n </mesh>\r\n )}\r\n </group>\r\n </animated.group>\r\n )\r\n})\r\n","import React, { useMemo } from 'react'\r\nimport { Billboard } from '@react-three/drei'\r\nimport { useLoader } from '@react-three/fiber'\r\nimport * as THREE from 'three'\r\nimport type { MotelySpriteData } from '../decode/motelySprite.js'\r\n\r\nexport interface JimboBillboardProps {\r\n sprite: MotelySpriteData | null\r\n label?: string\r\n width?: number\r\n height?: number\r\n yLockOnly?: boolean\r\n position?: [number, number, number]\r\n}\r\n\r\nexport function JimboBillboard(props: JimboBillboardProps) {\r\n if (!props.sprite) return null;\r\n return <JimboBillboardInner {...props} sprite={props.sprite} />;\r\n}\r\n\r\nfunction JimboBillboardInner({\r\n sprite,\r\n width = 3.4,\r\n height = 4.5,\r\n yLockOnly = false,\r\n position = [0, 0, 0]\r\n}: Omit<JimboBillboardProps, 'sprite'> & { sprite: MotelySpriteData }) {\r\n // Memoize texture to avoid per-render allocation\r\n const texture = useLoader(THREE.TextureLoader, sprite.atlasPath);\r\n\r\n const clonedTexture = useMemo(() => {\r\n const tex = texture.clone();\r\n tex.magFilter = THREE.NearestFilter;\r\n tex.minFilter = THREE.NearestFilter;\r\n // Set up sprite cropping\r\n tex.repeat.set(1 / sprite.gridCols, 1 / sprite.gridRows);\r\n tex.offset.set(\r\n sprite.gridCol / sprite.gridCols,\r\n 1 - ((sprite.gridRow + 1) / sprite.gridRows)\r\n );\r\n tex.needsUpdate = true;\r\n return tex;\r\n }, [texture, sprite.gridCol, sprite.gridRow, sprite.gridCols, sprite.gridRows]);\r\n\r\n const material = useMemo(() => {\r\n return new THREE.MeshBasicMaterial({\r\n map: clonedTexture,\r\n transparent: true,\r\n alphaTest: 0.5\r\n });\r\n }, [clonedTexture]);\r\n\r\n return (\r\n <Billboard\r\n lockY={yLockOnly}\r\n lockX={false}\r\n lockZ={false}\r\n position={position}\r\n >\r\n <mesh material={material}>\r\n <planeGeometry args={[width, height]} />\r\n </mesh>\r\n </Billboard>\r\n )\r\n}\r\n","import React from 'react'\r\nimport { Text } from '@react-three/drei'\r\nimport { resolveJamlAssetUrl } from '../assets.js'\r\nimport { JimboColorOption } from '../ui/tokens.js'\r\n\r\nexport interface JimboText3DProps {\r\n children: string\r\n color?: string\r\n outlineColor?: string\r\n outlineWidth?: number\r\n position?: [number, number, number]\r\n fontSize?: number\r\n}\r\n\r\nexport function JimboText3D({\r\n children,\r\n color = JimboColorOption.WHITE,\r\n outlineColor = JimboColorOption.BLACK,\r\n outlineWidth = 0.05,\r\n position = [0, 0, 0],\r\n fontSize = 1\r\n}: JimboText3DProps) {\r\n // We use the m6x11plus font from assets if possible, or fallback\r\n return (\r\n <Text\r\n position={position}\r\n fontSize={fontSize}\r\n color={color}\r\n outlineColor={outlineColor}\r\n outlineWidth={outlineWidth}\r\n font={resolveJamlAssetUrl('font')}\r\n anchorX=\"center\"\r\n anchorY=\"middle\"\r\n >\r\n {children}\r\n </Text>\r\n )\r\n}\r\n"],"mappings":";;;;;;;;;AASA,IAAa,IAAkB;CAAE,OAAO;CAAK,QAAQ;CAAM,OAAO;CAAM,EAE3D,IAAc;CACzB,YAAY;CACZ,YAAY;CACZ,WAAW;CACX,SAAS;CACT,SAAS;CACT,UAAU;CACX;AAED,SAAS,EAAiB,GAA0B;CAClD,IAAM,IAAU,EAAU,EAAM,eAAe,EAAO,UAAU;CAEhE,OAAO,QAAc;EACnB,IAAM,IAAI,EAAQ,OAAO;EAUzB,OATA,EAAE,aAAa,EAAM,gBACrB,EAAE,YAAY,EAAM,eACpB,EAAE,YAAY,EAAM,eACpB,EAAE,OAAO,IAAI,IAAI,EAAO,UAAU,IAAI,EAAO,SAAS,EACtD,EAAE,OAAO,IACP,EAAO,UAAU,EAAO,UACxB,KAAM,EAAO,UAAU,KAAK,EAAO,SACpC,EACD,EAAE,cAAc,IACT;IACN;EAAC;EAAS,EAAO;EAA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eACtB,EAAI,YAAY,EAAM,eAEtB,EAAI,OAAO,IAAI,IAAI,EAAO,UAAU,IAAI,EAAO,SAAS,EACxD,EAAI,OAAO,IACT,EAAO,UAAU,EAAO,UACxB,KAAM,EAAO,UAAU,KAAK,EAAO,SACpC,EACD,EAAI,cAAc,IACX;IACN;EAAC;EAAS,EAAO;EAAS,EAAO;EAAS,EAAO;EAAU,EAAO;EAAS,CAAC;CAU/E,OACE,kBAAC,GAAD;EACE,OAAO;EACP,OAAO;EACP,OAAO;EACG;YAEV,kBAAC,QAAD;GAAgB,UAfH,QACR,IAAI,EAAM,kBAAkB;IACjC,KAAK;IACL,aAAa;IACb,WAAW;IACZ,CAAC,EACD,CAAC,EAAc,CASE;aACd,kBAAC,iBAAD,EAAe,MAAM,CAAC,GAAO,EAAO,EAAI,CAAA;GACnC,CAAA;EACG,CAAA;;;;AChDhB,SAAgB,EAAY,EAC1B,aACA,WAAQ,EAAiB,OACzB,kBAAe,EAAiB,OAChC,kBAAe,KACf,cAAW;CAAC;CAAG;CAAG;CAAE,EACpB,cAAW,KACQ;CAEnB,OACE,kBAAC,GAAD;EACY;EACA;EACH;EACO;EACA;EACd,MAAM,EAAoB,OAAO;EACjC,SAAQ;EACR,SAAQ;EAEP;EACI,CAAA"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Sprite sheet position data for all Balatro game elements.
|
|
3
|
-
* Extracted from Blueprint's const.ts — maps item names to {x, y} grid positions
|
|
4
|
-
* within their respective sprite sheets.
|
|
5
|
-
*/
|
|
6
|
-
import { type JamlAssetKey } from "../assets.js";
|
|
1
|
+
import { JamlAssetKey } from '../assets.js';
|
|
7
2
|
export interface SpritePos {
|
|
8
3
|
x: number;
|
|
9
4
|
y: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { JamlAssetKey } from '../assets.js';
|
|
1
2
|
export interface SpritePos {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
4
5
|
}
|
|
5
6
|
export type SpriteSheetType = "Jokers" | "Tarots" | "Vouchers" | "Boosters" | "Enhancers" | "Editions" | "BlindChips" | "tags" | "Stakes" | "Decks";
|
|
6
|
-
import type { JamlAssetKey } from '../assets.js';
|
|
7
7
|
export declare const SHEET_META: Record<SpriteSheetType, {
|
|
8
8
|
cols: number;
|
|
9
9
|
rows: number;
|
package/dist/ui/JimboBadge.d.ts
CHANGED
package/dist/ui/JimboSelect.d.ts
CHANGED
package/dist/ui/footer.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export interface JimboBalatroFooterProps {
|
|
2
|
-
hidden?: boolean;
|
|
3
2
|
className?: string;
|
|
4
3
|
}
|
|
5
4
|
/**
|
|
6
5
|
* Attribution footer with animated suit cycle.
|
|
7
|
-
*
|
|
6
|
+
* Always rendered — required attribution for using Balatro art.
|
|
8
7
|
*/
|
|
9
|
-
export declare function JimboBalatroFooter({
|
|
8
|
+
export declare function JimboBalatroFooter({ className }: JimboBalatroFooterProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/ui/hooks.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DeckSprite, DECK_SPRITE_POS as DECK_MAP, STAKE_SPRITE_POS as STAKE_MAP, type DeckSpriteProps, } from
|
|
1
|
+
export { DeckSprite, DECK_SPRITE_POS as DECK_MAP, STAKE_SPRITE_POS as STAKE_MAP, type DeckSpriteProps, } from '../../components/DeckSprite.js';
|