jaml-ui 0.14.4 → 0.17.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.
- package/DESIGN.md +9 -11
- package/dist/assets.d.ts +7 -0
- package/dist/assets.js +11 -0
- package/dist/components/AnalyzerExplorer.d.ts +4 -1
- package/dist/components/AnalyzerExplorer.js +14 -48
- package/dist/components/GameCard.js +8 -7
- package/dist/components/JamlAestheticSelector.d.ts +4 -0
- package/dist/components/JamlAestheticSelector.js +6 -19
- package/dist/components/JamlAnalyzerFullscreen.d.ts +7 -1
- package/dist/components/JamlAnalyzerFullscreen.js +18 -47
- package/dist/components/JamlIde.js +12 -24
- package/dist/components/JamlIdeVisual.js +3 -56
- package/dist/components/JamlMapPreview.d.ts +6 -1
- package/dist/components/JamlMapPreview.js +99 -21
- package/dist/components/JamlSeedInput.d.ts +5 -0
- package/dist/components/JamlSeedInput.js +11 -14
- package/dist/components/MotelyVersionBadge.d.ts +1 -3
- package/dist/components/MotelyVersionBadge.js +4 -16
- package/dist/components/jamlMap/JamlMapEditorDemo.d.ts +8 -0
- package/dist/components/jamlMap/JamlMapEditorDemo.js +170 -0
- package/dist/components/jamlMap/JokerPicker.d.ts +7 -0
- package/dist/components/jamlMap/JokerPicker.js +258 -0
- package/dist/components/jamlMap/MysterySlot.d.ts +32 -0
- package/dist/components/jamlMap/MysterySlot.js +109 -0
- package/dist/components/jamlMap/index.d.ts +3 -0
- package/dist/components/jamlMap/index.js +3 -0
- package/dist/core.d.ts +0 -2
- package/dist/core.js +0 -2
- package/dist/decode/motelyItemDecoder.d.ts +10 -23
- package/dist/decode/motelyItemDecoder.js +103 -248
- package/dist/decode/motelySprite.d.ts +19 -0
- package/dist/decode/motelySprite.js +84 -0
- package/dist/hooks/analyzerStreamRegistry.js +30 -82
- package/dist/hooks/useAnalyzer.d.ts +10 -3
- package/dist/hooks/useAnalyzer.js +11 -6
- package/dist/hooks/useIntersectionObserver.d.ts +14 -0
- package/dist/hooks/useIntersectionObserver.js +50 -0
- package/dist/index.d.ts +3 -8
- package/dist/index.js +2 -7
- package/dist/motely.d.ts +2 -1
- package/dist/motely.js +2 -1
- package/dist/motelyDisplay.d.ts +4 -623
- package/dist/motelyDisplay.js +26 -165
- package/dist/r3f/Card3D.d.ts +2 -2
- package/dist/r3f/Card3D.js +13 -46
- package/dist/r3f/JimboBillboard.d.ts +10 -0
- package/dist/r3f/JimboBillboard.js +29 -0
- package/dist/r3f/JimboText3D.d.ts +9 -0
- package/dist/r3f/JimboText3D.js +8 -0
- package/dist/r3f.d.ts +2 -0
- package/dist/r3f.js +2 -0
- package/dist/render/CanvasRenderer.js +7 -171
- package/dist/sprites/spriteData.d.ts +1 -0
- package/dist/sprites/spriteData.js +1 -0
- package/dist/sprites/spriteMapper.d.ts +78 -1
- package/dist/sprites/spriteMapper.js +52 -0
- package/dist/ui/JimboBadge.d.ts +13 -0
- package/dist/ui/JimboBadge.js +8 -0
- package/dist/ui/JimboFloating.d.ts +8 -0
- package/dist/ui/JimboFloating.js +17 -0
- package/dist/ui/JimboToggleList.d.ts +11 -0
- package/dist/ui/JimboToggleList.js +5 -0
- package/dist/ui/codeBlock.js +2 -3
- package/dist/ui/footer.d.ts +4 -0
- package/dist/ui/footer.js +6 -4
- package/dist/ui/hooks.d.ts +89 -0
- package/dist/ui/hooks.js +551 -0
- package/dist/ui/jimboBackground.js +2 -131
- package/dist/ui/jimboCopyRow.d.ts +4 -0
- package/dist/ui/jimboCopyRow.js +5 -22
- package/dist/ui/jimboFilterBar.d.ts +1 -4
- package/dist/ui/jimboFilterBar.js +2 -61
- package/dist/ui/jimboFlankNav.d.ts +1 -2
- package/dist/ui/jimboFlankNav.js +5 -30
- package/dist/ui/jimboTabs.d.ts +1 -5
- package/dist/ui/jimboTabs.js +6 -41
- package/dist/ui/jimboText.d.ts +1 -1
- package/dist/ui/jimboText.js +15 -32
- package/dist/ui/jimboTooltip.d.ts +1 -12
- package/dist/ui/jimboTooltip.js +6 -82
- package/dist/ui/panel.d.ts +3 -1
- package/dist/ui/panel.js +11 -47
- package/dist/ui/showcase.d.ts +4 -0
- package/dist/ui/showcase.js +9 -36
- package/dist/ui/sprites.d.ts +14 -0
- package/dist/ui/sprites.js +54 -13
- package/dist/ui.d.ts +4 -0
- package/dist/ui.js +5 -0
- package/package.json +130 -122
- package/dist/components/JamlSpeedometer.d.ts +0 -11
- package/dist/components/JamlSpeedometer.js +0 -54
- package/dist/decode/packedBalatroItem.d.ts +0 -13
- package/dist/decode/packedBalatroItem.js +0 -26
- package/dist/hooks/loadMotelyWasm.d.ts +0 -7
- package/dist/hooks/loadMotelyWasm.js +0 -16
- package/dist/utils/itemUtils.d.ts +0 -11
- package/dist/utils/itemUtils.js +0 -71
|
@@ -2,10 +2,87 @@ export interface SpritePos {
|
|
|
2
2
|
x: number;
|
|
3
3
|
y: number;
|
|
4
4
|
}
|
|
5
|
-
export type SpriteSheetType = "Jokers" | "Tarots" | "Vouchers" | "Boosters" | "Enhancers" | "Editions" | "BlindChips" | "tags";
|
|
5
|
+
export type SpriteSheetType = "Jokers" | "Tarots" | "Vouchers" | "Boosters" | "Enhancers" | "Editions" | "BlindChips" | "tags" | "Stakes" | "Decks";
|
|
6
|
+
import type { JamlAssetKey } from '../assets.js';
|
|
7
|
+
export declare const SHEET_META: Record<SpriteSheetType, {
|
|
8
|
+
cols: number;
|
|
9
|
+
rows: number;
|
|
10
|
+
assetKey: JamlAssetKey;
|
|
11
|
+
}>;
|
|
6
12
|
export interface SpriteData {
|
|
7
13
|
pos: SpritePos;
|
|
8
14
|
type: SpriteSheetType;
|
|
9
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Per-sheet mystery/back card positions for unknown items.
|
|
18
|
+
* Used as fallback when an item name can't be resolved.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MYSTERY_SPRITES: Partial<Record<SpriteSheetType, SpritePos>>;
|
|
21
|
+
/** Get the mystery/fallback sprite for a given sheet type. */
|
|
22
|
+
export declare function getMysterySprite(sheet: SpriteSheetType): SpriteData;
|
|
10
23
|
/** Look up sprite data by name. Accepts display names ("Icy Joker"), enum keys ("IcyJoker"), and "Joker | Name" prefixed forms. */
|
|
11
24
|
export declare function getSpriteData(name: string): SpriteData | null;
|
|
25
|
+
/**
|
|
26
|
+
* Wildcard "Any" sprites from the Enhancers sheet.
|
|
27
|
+
* Used in the JAML visual editor when a clause value is "Any" (e.g. `legendaryJoker: Any`).
|
|
28
|
+
*/
|
|
29
|
+
export declare const WILDCARD_SPRITES: {
|
|
30
|
+
/** Grey silhouette — Enhancers row 3 col 5. For generic "Any" items. */
|
|
31
|
+
readonly anySilhouette: {
|
|
32
|
+
readonly pos: {
|
|
33
|
+
readonly x: 5;
|
|
34
|
+
readonly y: 3;
|
|
35
|
+
};
|
|
36
|
+
readonly type: SpriteSheetType;
|
|
37
|
+
};
|
|
38
|
+
/** Grey ? circle — Enhancers row 3 col 6. For "boss: Any" etc. */
|
|
39
|
+
readonly anyMystery: {
|
|
40
|
+
readonly pos: {
|
|
41
|
+
readonly x: 6;
|
|
42
|
+
readonly y: 3;
|
|
43
|
+
};
|
|
44
|
+
readonly type: SpriteSheetType;
|
|
45
|
+
};
|
|
46
|
+
/** Red X debuff — Editions row 0 col 4. For mustNot zone indicator. */
|
|
47
|
+
readonly mustNotDebuff: {
|
|
48
|
+
readonly pos: {
|
|
49
|
+
readonly x: 4;
|
|
50
|
+
readonly y: 0;
|
|
51
|
+
};
|
|
52
|
+
readonly type: SpriteSheetType;
|
|
53
|
+
};
|
|
54
|
+
/** The Soul card — Tarots row 2 col 2. Base for "legendaryJoker: Any" (they spawn from Soul). */
|
|
55
|
+
readonly anyLegendary: {
|
|
56
|
+
readonly pos: {
|
|
57
|
+
readonly x: 2;
|
|
58
|
+
readonly y: 2;
|
|
59
|
+
};
|
|
60
|
+
readonly type: SpriteSheetType;
|
|
61
|
+
};
|
|
62
|
+
/** Blank spectral back — Tarots row 2 col 5. For "spectralCard: Any". */
|
|
63
|
+
readonly anySpectral: {
|
|
64
|
+
readonly pos: {
|
|
65
|
+
readonly x: 5;
|
|
66
|
+
readonly y: 2;
|
|
67
|
+
};
|
|
68
|
+
readonly type: SpriteSheetType;
|
|
69
|
+
};
|
|
70
|
+
/** Blank tarot back — Tarots row 2 col 6. For "tarotCard: Any". */
|
|
71
|
+
readonly anyTarot: {
|
|
72
|
+
readonly pos: {
|
|
73
|
+
readonly x: 6;
|
|
74
|
+
readonly y: 2;
|
|
75
|
+
};
|
|
76
|
+
readonly type: SpriteSheetType;
|
|
77
|
+
};
|
|
78
|
+
/** Blank planet back — Tarots row 2 col 7. For "planetCard: Any". */
|
|
79
|
+
readonly anyPlanet: {
|
|
80
|
+
readonly pos: {
|
|
81
|
+
readonly x: 7;
|
|
82
|
+
readonly y: 2;
|
|
83
|
+
};
|
|
84
|
+
readonly type: SpriteSheetType;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/** Look up sprite data by name, falling back to the mystery card for the given sheet if not found. */
|
|
88
|
+
export declare function getSpriteDataOrMystery(name: string, fallbackSheet?: SpriteSheetType): SpriteData;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { JOKERS, JOKER_FACES, TAROTS_AND_PLANETS, CONSUMABLE_FACES, VOUCHERS, BOSSES, TAGS, BOOSTER_PACKS, } from "./spriteData.js";
|
|
2
|
+
export const SHEET_META = {
|
|
3
|
+
Jokers: { cols: 10, rows: 16, assetKey: 'jokers' },
|
|
4
|
+
Tarots: { cols: 10, rows: 6, assetKey: 'tarots' },
|
|
5
|
+
Vouchers: { cols: 9, rows: 4, assetKey: 'vouchers' },
|
|
6
|
+
Boosters: { cols: 4, rows: 9, assetKey: 'boosters' },
|
|
7
|
+
BlindChips: { cols: 21, rows: 31, assetKey: 'blinds' },
|
|
8
|
+
tags: { cols: 6, rows: 5, assetKey: 'tags' },
|
|
9
|
+
Enhancers: { cols: 7, rows: 5, assetKey: 'enhancers' },
|
|
10
|
+
Editions: { cols: 5, rows: 1, assetKey: 'editions' },
|
|
11
|
+
Stakes: { cols: 5, rows: 2, assetKey: 'stakes' },
|
|
12
|
+
Decks: { cols: 13, rows: 4, assetKey: 'deck' },
|
|
13
|
+
};
|
|
2
14
|
const normalize = (name) => name.toLowerCase().replace(/\s+/g, "");
|
|
3
15
|
const stripPrefix = (name) => name.replace(/^(Joker|Tarot|Planet|Voucher|Pack|Edition|Tag) [|:] /i, "").trim();
|
|
4
16
|
const ITEM_MAP = new Map();
|
|
@@ -17,7 +29,47 @@ registerAll(VOUCHERS, "Vouchers");
|
|
|
17
29
|
registerAll(BOSSES, "BlindChips");
|
|
18
30
|
registerAll(TAGS, "tags");
|
|
19
31
|
registerAll(BOOSTER_PACKS ?? [], "Boosters");
|
|
32
|
+
/**
|
|
33
|
+
* Per-sheet mystery/back card positions for unknown items.
|
|
34
|
+
* Used as fallback when an item name can't be resolved.
|
|
35
|
+
*/
|
|
36
|
+
export const MYSTERY_SPRITES = {
|
|
37
|
+
Jokers: { x: 9, y: 9 }, // grey card back (legendary face row)
|
|
38
|
+
Tarots: { x: 4, y: 2 }, // blank consumable
|
|
39
|
+
Vouchers: { x: 8, y: 2 }, // mystery voucher
|
|
40
|
+
Boosters: { x: 0, y: 5 }, // grey empty pack
|
|
41
|
+
tags: { x: 3, y: 4 }, // grey ? tag
|
|
42
|
+
BlindChips: { x: 0, y: 30 }, // grey ? blind
|
|
43
|
+
};
|
|
44
|
+
/** Get the mystery/fallback sprite for a given sheet type. */
|
|
45
|
+
export function getMysterySprite(sheet) {
|
|
46
|
+
return { pos: MYSTERY_SPRITES[sheet] ?? { x: 0, y: 0 }, type: sheet };
|
|
47
|
+
}
|
|
20
48
|
/** Look up sprite data by name. Accepts display names ("Icy Joker"), enum keys ("IcyJoker"), and "Joker | Name" prefixed forms. */
|
|
21
49
|
export function getSpriteData(name) {
|
|
22
50
|
return ITEM_MAP.get(normalize(stripPrefix(name))) ?? ITEM_MAP.get(normalize(name)) ?? null;
|
|
23
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Wildcard "Any" sprites from the Enhancers sheet.
|
|
54
|
+
* Used in the JAML visual editor when a clause value is "Any" (e.g. `legendaryJoker: Any`).
|
|
55
|
+
*/
|
|
56
|
+
export const WILDCARD_SPRITES = {
|
|
57
|
+
/** Grey silhouette — Enhancers row 3 col 5. For generic "Any" items. */
|
|
58
|
+
anySilhouette: { pos: { x: 5, y: 3 }, type: "Enhancers" },
|
|
59
|
+
/** Grey ? circle — Enhancers row 3 col 6. For "boss: Any" etc. */
|
|
60
|
+
anyMystery: { pos: { x: 6, y: 3 }, type: "Enhancers" },
|
|
61
|
+
/** Red X debuff — Editions row 0 col 4. For mustNot zone indicator. */
|
|
62
|
+
mustNotDebuff: { pos: { x: 4, y: 0 }, type: "Editions" },
|
|
63
|
+
/** The Soul card — Tarots row 2 col 2. Base for "legendaryJoker: Any" (they spawn from Soul). */
|
|
64
|
+
anyLegendary: { pos: { x: 2, y: 2 }, type: "Tarots" },
|
|
65
|
+
/** Blank spectral back — Tarots row 2 col 5. For "spectralCard: Any". */
|
|
66
|
+
anySpectral: { pos: { x: 5, y: 2 }, type: "Tarots" },
|
|
67
|
+
/** Blank tarot back — Tarots row 2 col 6. For "tarotCard: Any". */
|
|
68
|
+
anyTarot: { pos: { x: 6, y: 2 }, type: "Tarots" },
|
|
69
|
+
/** Blank planet back — Tarots row 2 col 7. For "planetCard: Any". */
|
|
70
|
+
anyPlanet: { pos: { x: 7, y: 2 }, type: "Tarots" },
|
|
71
|
+
};
|
|
72
|
+
/** Look up sprite data by name, falling back to the mystery card for the given sheet if not found. */
|
|
73
|
+
export function getSpriteDataOrMystery(name, fallbackSheet = "Jokers") {
|
|
74
|
+
return getSpriteData(name) ?? getMysterySprite(fallbackSheet);
|
|
75
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type JimboBadgeTone = 'dark' | 'blue' | 'red' | 'green' | 'gold' | 'grey' | 'orange' | 'purple';
|
|
3
|
+
export interface JimboBadgeProps {
|
|
4
|
+
size?: 'sm' | 'md';
|
|
5
|
+
tone?: JimboBadgeTone;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Small colored label pill. Matches Balatro's in-game tag/rarity badges.
|
|
11
|
+
* All styling via jimbo.css `.j-badge` classes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function JimboBadge({ size, tone, className, children }: JimboBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Small colored label pill. Matches Balatro's in-game tag/rarity badges.
|
|
4
|
+
* All styling via jimbo.css `.j-badge` classes.
|
|
5
|
+
*/
|
|
6
|
+
export function JimboBadge({ size = 'sm', tone = 'dark', className, children }) {
|
|
7
|
+
return (_jsx("span", { className: `j-badge j-badge--${size} j-badge--${tone} ${className ?? ''}`, children: children }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface JimboFloatingProps {
|
|
3
|
+
anchor?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
|
|
4
|
+
offset?: number;
|
|
5
|
+
zIndex?: number;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function JimboFloating({ anchor, offset, zIndex, children }: JimboFloatingProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function JimboFloating({ anchor = 'top-right', offset = 12, zIndex = 20, children }) {
|
|
3
|
+
const pos = { position: 'absolute', zIndex };
|
|
4
|
+
if (anchor.includes('top'))
|
|
5
|
+
pos.top = offset;
|
|
6
|
+
if (anchor.includes('bottom'))
|
|
7
|
+
pos.bottom = offset;
|
|
8
|
+
if (anchor.includes('left'))
|
|
9
|
+
pos.left = offset;
|
|
10
|
+
if (anchor.includes('right'))
|
|
11
|
+
pos.right = offset;
|
|
12
|
+
if (anchor.includes('center')) {
|
|
13
|
+
pos.left = '50%';
|
|
14
|
+
pos.transform = 'translateX(-50%)';
|
|
15
|
+
}
|
|
16
|
+
return (_jsx("div", { style: pos, children: children }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ToggleItem {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
on: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface JimboToggleListProps {
|
|
7
|
+
items: ToggleItem[];
|
|
8
|
+
onToggle: (id: string) => void;
|
|
9
|
+
title?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function JimboToggleList({ items, onToggle, title }: JimboToggleListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { JimboPanel } from './panel.js';
|
|
3
|
+
export function JimboToggleList({ items, onToggle, title }) {
|
|
4
|
+
return (_jsx(JimboPanel, { children: _jsxs("div", { className: "j-toggle-list", children: [title && _jsx("div", { className: "j-toggle-list__title", children: title }), items.map(item => (_jsxs("button", { type: "button", className: "j-toggle-item", onClick: () => onToggle(item.id), children: [_jsx("div", { className: "j-toggle-check", "data-on": item.on }), item.label] }, item.id)))] }) }));
|
|
5
|
+
}
|
package/dist/ui/codeBlock.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { JimboColorOption } from './tokens.js';
|
|
5
4
|
export function JimboCodeBlock({ code, language, filename, className = '' }) {
|
|
6
5
|
const [copied, setCopied] = useState(false);
|
|
7
6
|
const copy = () => {
|
|
@@ -9,7 +8,7 @@ export function JimboCodeBlock({ code, language, filename, className = '' }) {
|
|
|
9
8
|
setCopied(true);
|
|
10
9
|
setTimeout(() => setCopied(false), 2000);
|
|
11
10
|
};
|
|
12
|
-
return (_jsxs("div", { className:
|
|
11
|
+
return (_jsxs("div", { className: `j-code-block ${className}`, children: [_jsxs("div", { className: "j-code-block__header", children: [_jsxs("div", { className: "j-code-block__meta", children: [filename && _jsx("span", { className: "j-code-block__filename", children: filename }), language && _jsx("span", { className: "j-code-block__lang", children: language })] }), _jsx("button", { onClick: copy, title: "Copy", className: "j-code-block__copy", "data-copied": copied, children: copied
|
|
13
12
|
? _jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "20 6 9 17 4 12" }) })
|
|
14
|
-
: _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }), _jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] }) })] }), _jsx("pre", {
|
|
13
|
+
: _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }), _jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] }) })] }), _jsx("pre", { className: "j-code-block__pre", children: _jsx("code", { children: code }) })] }));
|
|
15
14
|
}
|
package/dist/ui/footer.d.ts
CHANGED
|
@@ -2,4 +2,8 @@ export interface JimboBalatroFooterProps {
|
|
|
2
2
|
hidden?: boolean;
|
|
3
3
|
className?: string;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Attribution footer with animated suit cycle.
|
|
7
|
+
* All styling via jimbo.css `.j-footer` classes — zero inline styles.
|
|
8
|
+
*/
|
|
5
9
|
export declare function JimboBalatroFooter({ hidden, className }: JimboBalatroFooterProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/ui/footer.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { JimboColorOption } from './tokens.js';
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
4
3
|
const SUITS = [
|
|
5
4
|
{ char: '♥️', kf: 'jaml-heart' },
|
|
6
5
|
{ char: '♠️', kf: 'jaml-spade' },
|
|
7
6
|
{ char: '♦️', kf: 'jaml-diamond' },
|
|
8
7
|
{ char: '♣️', kf: 'jaml-club' },
|
|
9
8
|
];
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Attribution footer with animated suit cycle.
|
|
11
|
+
* All styling via jimbo.css `.j-footer` classes — zero inline styles.
|
|
12
|
+
*/
|
|
11
13
|
export function JimboBalatroFooter({ hidden = false, className = '' }) {
|
|
12
|
-
return (_jsxs("div", { className:
|
|
14
|
+
return (_jsxs("div", { className: `j-footer ${hidden ? 'j-footer--hidden' : ''} ${className}`, children: [_jsx("div", { className: "j-footer__bar", children: _jsxs("p", { className: "j-footer__text", children: [_jsxs("span", { children: ["Not affiliated with LocalThunk or PlayStack \u2022", ' '] }), _jsx("a", { href: "https://store.steampowered.com/app/2379780/Balatro/", target: "_blank", rel: "noopener noreferrer", className: "j-footer__link", children: "BUY BALATRO" }), _jsxs("span", { children: [' ', "\u2022 Created with", ' '] }), _jsxs("span", { className: "j-footer__suits", children: [_jsx("span", { className: "j-footer__suit-stage", children: SUITS.map(({ char, kf }) => (_jsx("span", { className: "j-footer__suit-char", style: { animationName: kf }, children: char }, char))) }), ' ', "for the Balatro community"] })] }) }), _jsx("style", { children: `
|
|
13
15
|
@keyframes jaml-heart { 0%{opacity:0;transform:scale(1)} 1%{opacity:1;transform:scale(1.45)} 3.5%{opacity:1;transform:scale(1)} 61.5%{opacity:1;transform:scale(1)} 62%{opacity:0} 100%{opacity:0} }
|
|
14
16
|
@keyframes jaml-spade { 0%,61.5%{opacity:0} 62%{opacity:1;transform:scale(1.45)} 64.5%{opacity:1;transform:scale(1)} 71.5%{opacity:1} 72%{opacity:0} 100%{opacity:0} }
|
|
15
17
|
@keyframes jaml-diamond { 0%,71.5%{opacity:0} 72%{opacity:1;transform:scale(1.45)} 74.5%{opacity:1;transform:scale(1)} 81.5%{opacity:1} 82%{opacity:0} 100%{opacity:0} }
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { JamlVisualClause, JamlVisualFilter, JamlZone } from '../components/JamlIdeVisual.js';
|
|
3
|
+
import { Layer } from '../render/Layer.js';
|
|
4
|
+
/**
|
|
5
|
+
* Sway animation for Balatro-style UI elements.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSway(active: boolean): React.RefObject<HTMLDivElement | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Handles delayed visibility for transitions (e.g. modals).
|
|
10
|
+
*/
|
|
11
|
+
export declare function useDelayedVisibility(open: boolean, delay: number): {
|
|
12
|
+
visible: boolean;
|
|
13
|
+
opacity: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Hook for the Balatro hypnotic swirl background.
|
|
17
|
+
* Manages WebGL context, shader compilation, and animation loop.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useBalatroBackground(): React.RefObject<HTMLCanvasElement | null>;
|
|
20
|
+
export type JimboTooltipMode = 'snap' | 'mouse';
|
|
21
|
+
export type JimboTooltipPlacement = 'top' | 'bottom' | 'auto';
|
|
22
|
+
/**
|
|
23
|
+
* Hook for managing JimboTooltip state and positioning.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useJimboTooltip({ mode, placement, delay, disabled, }: {
|
|
26
|
+
mode?: JimboTooltipMode;
|
|
27
|
+
placement?: JimboTooltipPlacement;
|
|
28
|
+
delay?: number;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
}): {
|
|
31
|
+
visible: boolean;
|
|
32
|
+
pos: {
|
|
33
|
+
left: number;
|
|
34
|
+
top: number;
|
|
35
|
+
align: "top" | "bottom";
|
|
36
|
+
} | null;
|
|
37
|
+
targetRef: React.RefObject<HTMLElement | null>;
|
|
38
|
+
tooltipRef: React.RefObject<HTMLDivElement | null>;
|
|
39
|
+
show: () => void;
|
|
40
|
+
hide: () => void;
|
|
41
|
+
handleMouseMove: (e: React.MouseEvent | React.PointerEvent) => void;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Hook for managing the JamlCardRenderer logic.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useJamlCardRenderer({ layers, invert, hoverTilt, }: {
|
|
47
|
+
layers: Layer[];
|
|
48
|
+
invert?: boolean;
|
|
49
|
+
hoverTilt?: boolean;
|
|
50
|
+
}): {
|
|
51
|
+
canvasRef: React.RefObject<HTMLCanvasElement | null>;
|
|
52
|
+
containerStyle: React.CSSProperties;
|
|
53
|
+
canvasStyle: React.CSSProperties;
|
|
54
|
+
handlers: {
|
|
55
|
+
onPointerEnter: ((event: React.PointerEvent) => void) | undefined;
|
|
56
|
+
onPointerLeave: (() => void) | undefined;
|
|
57
|
+
onPointerMove: ((event: React.PointerEvent<HTMLDivElement>) => void) | undefined;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Tracks which 'ante' section is currently most visible in a scrollable container.
|
|
62
|
+
* Used in JamlAnalyzerFullscreen and AnalyzerExplorer.
|
|
63
|
+
*/
|
|
64
|
+
export declare function useAnteTracker(antes: {
|
|
65
|
+
ante: number;
|
|
66
|
+
}[], options?: {
|
|
67
|
+
threshold?: number[];
|
|
68
|
+
}): {
|
|
69
|
+
currentAnte: number;
|
|
70
|
+
scrollRef: React.RefObject<HTMLDivElement | null>;
|
|
71
|
+
scrollToAnte: (ante: number) => void;
|
|
72
|
+
registerAnteRef: (ante: number, el: HTMLElement | null) => void;
|
|
73
|
+
};
|
|
74
|
+
export interface DragState {
|
|
75
|
+
clause: JamlVisualClause;
|
|
76
|
+
fromZone: JamlZone;
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
offX: number;
|
|
80
|
+
offY: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Manages drag-and-drop state for the Jaml IDE visual filter editor.
|
|
84
|
+
*/
|
|
85
|
+
export declare function useJamlIdeDrag(filter: JamlVisualFilter, onChange: (filter: JamlVisualFilter) => void, rootRef: React.RefObject<HTMLDivElement | null>): {
|
|
86
|
+
drag: DragState | null;
|
|
87
|
+
hoverZone: string | null;
|
|
88
|
+
onDragStart: (e: React.MouseEvent | React.TouchEvent, clause: JamlVisualClause, fromZone: JamlZone) => void;
|
|
89
|
+
};
|