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
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { getRevealPos } from "./getRevealPos";
|
|
2
|
-
/** Strip markdown markers only — do not collapse whitespace (TTS highlight indices are raw offsets). */
|
|
3
|
-
export function stripMarkdownForTtsDisplay(text) {
|
|
4
|
-
return text
|
|
5
|
-
.replace(/```[\s\S]*?```/g, "")
|
|
6
|
-
.replace(/\*\*/g, "")
|
|
7
|
-
.trim();
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Split plain text into spoken vs pending regions for TTS word sync.
|
|
11
|
-
* When `stripMarkdown` is false, indices must refer to `text` as-is (matches streaming TTS offsets).
|
|
12
|
-
*/
|
|
13
|
-
export function splitTtsDisplay(text, highlightPos, activeSentenceRange, options) {
|
|
14
|
-
const body = options?.stripMarkdown ? stripMarkdownForTtsDisplay(text) : text;
|
|
15
|
-
if (!body)
|
|
16
|
-
return null;
|
|
17
|
-
const ttsDisabled = highlightPos === null || highlightPos === undefined;
|
|
18
|
-
if (ttsDisabled)
|
|
19
|
-
return null;
|
|
20
|
-
const hasTtsHighlight = typeof highlightPos === "number" && highlightPos >= 0;
|
|
21
|
-
const hasActiveSentence = Boolean(activeSentenceRange && activeSentenceRange.start >= 0 && activeSentenceRange.end > activeSentenceRange.start);
|
|
22
|
-
const sentenceStart = hasActiveSentence ? Math.min(activeSentenceRange.start, body.length) : 0;
|
|
23
|
-
const sentenceEnd = hasActiveSentence ? Math.min(activeSentenceRange.end, body.length) : body.length;
|
|
24
|
-
const revealPos = hasTtsHighlight
|
|
25
|
-
? Math.min(Math.max(getRevealPos(body, highlightPos), sentenceStart), sentenceEnd)
|
|
26
|
-
: 0;
|
|
27
|
-
const useWindowedView = hasTtsHighlight && hasActiveSentence;
|
|
28
|
-
const displayStart = useWindowedView ? sentenceStart : 0;
|
|
29
|
-
const displayEnd = useWindowedView ? sentenceEnd : body.length;
|
|
30
|
-
const prefix = useWindowedView ? "" : body.slice(0, sentenceStart);
|
|
31
|
-
const spoken = body.slice(displayStart, Math.min(revealPos, displayEnd));
|
|
32
|
-
const pending = body.slice(Math.min(revealPos, displayEnd), displayEnd);
|
|
33
|
-
const suffix = useWindowedView ? "" : body.slice(sentenceEnd);
|
|
34
|
-
return { prefix, spoken, pending, suffix, useWindowedView };
|
|
35
|
-
}
|
package/dist/lib/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/lib/utils.js
DELETED
package/dist/motelyDisplay.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// Setter pattern: consumers boot motely-wasm and call `setMotelyEnums(Motely)`
|
|
2
|
-
// once after boot. Display functions degrade gracefully (return placeholder
|
|
3
|
-
// strings) before the setter is called rather than throwing.
|
|
4
|
-
let _motely = null;
|
|
5
|
-
export function setMotelyEnums(motely) {
|
|
6
|
-
_motely = motely;
|
|
7
|
-
}
|
|
8
|
-
function runtimeEnumKey(enumObject, value) {
|
|
9
|
-
if (!enumObject || typeof enumObject !== "object")
|
|
10
|
-
return null;
|
|
11
|
-
const key = enumObject[String(value)];
|
|
12
|
-
return typeof key === "string" && key.length > 0 ? key : null;
|
|
13
|
-
}
|
|
14
|
-
// ─── Public API ──────────────────────────────────────────────────────────────
|
|
15
|
-
export function motelyBossDisplayName(value) {
|
|
16
|
-
if (!_motely)
|
|
17
|
-
return `boss#${value}`;
|
|
18
|
-
const key = runtimeEnumKey(_motely.MotelyBossBlind, value & 0xff);
|
|
19
|
-
return key === null ? `boss#${value}` : key;
|
|
20
|
-
}
|
|
21
|
-
export function motelyBossDisplayNameFromKey(key) {
|
|
22
|
-
return key;
|
|
23
|
-
}
|
|
24
|
-
export function motelyVoucherDisplayName(value) {
|
|
25
|
-
if (!_motely)
|
|
26
|
-
return `voucher#${value}`;
|
|
27
|
-
const key = runtimeEnumKey(_motely.MotelyVoucher, value);
|
|
28
|
-
return key === null ? `voucher#${value}` : key;
|
|
29
|
-
}
|
|
30
|
-
export function motelyVoucherDisplayNameFromKey(key) {
|
|
31
|
-
return key;
|
|
32
|
-
}
|
|
33
|
-
export function motelyTagDisplayName(value) {
|
|
34
|
-
if (!_motely)
|
|
35
|
-
return `tag#${value}`;
|
|
36
|
-
const key = runtimeEnumKey(_motely.MotelyTag, value);
|
|
37
|
-
return key === null ? `tag#${value}` : key;
|
|
38
|
-
}
|
|
39
|
-
export function motelyTagDisplayNameFromKey(key) {
|
|
40
|
-
return key;
|
|
41
|
-
}
|
|
42
|
-
export function motelyBoosterPackDisplayName(value) {
|
|
43
|
-
if (!_motely)
|
|
44
|
-
return `pack#${value}`;
|
|
45
|
-
const key = runtimeEnumKey(_motely.MotelyBoosterPack, value);
|
|
46
|
-
return key === null ? `pack#${value}` : key;
|
|
47
|
-
}
|
|
48
|
-
export function motelyBoosterPackDisplayNameFromKey(key) {
|
|
49
|
-
return `${key} Pack`;
|
|
50
|
-
}
|
|
51
|
-
export function motelyItemDisplayNameFromKey(key) {
|
|
52
|
-
return key;
|
|
53
|
-
}
|
|
54
|
-
export function motelyItemDisplayNameFromValue(value) {
|
|
55
|
-
if (!_motely)
|
|
56
|
-
return `item#${value}`;
|
|
57
|
-
const key = runtimeEnumKey(_motely.MotelyItemType, value & 0xffff);
|
|
58
|
-
return key === null ? `item#${value}` : key;
|
|
59
|
-
}
|
package/dist/r3f/Card3D.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useRef, useMemo, useState, memo } from 'react';
|
|
4
|
-
import { useFrame, useLoader } from '@react-three/fiber';
|
|
5
|
-
import { useSpring, animated } from '@react-spring/three';
|
|
6
|
-
import * as THREE from 'three';
|
|
7
|
-
// eslint-disable-next-line react-refresh/only-export-components
|
|
8
|
-
export const CARD_DIMENSIONS = { WIDTH: 0.7, HEIGHT: 0.95, DEPTH: 0.02 };
|
|
9
|
-
// eslint-disable-next-line react-refresh/only-export-components
|
|
10
|
-
export const CARD_MAGNET = {
|
|
11
|
-
MAX_TILT_X: 0.36,
|
|
12
|
-
MAX_TILT_Y: 0.42,
|
|
13
|
-
MAX_SHIFT: 0.038,
|
|
14
|
-
TWIST_Z: 0.11,
|
|
15
|
-
LERP_IN: 18,
|
|
16
|
-
LERP_OUT: 10,
|
|
17
|
-
};
|
|
18
|
-
function useSpriteTexture(sprite) {
|
|
19
|
-
const texture = useLoader(THREE.TextureLoader, sprite.atlasPath);
|
|
20
|
-
return useMemo(() => {
|
|
21
|
-
const t = texture.clone();
|
|
22
|
-
t.colorSpace = THREE.SRGBColorSpace;
|
|
23
|
-
t.magFilter = THREE.NearestFilter;
|
|
24
|
-
t.minFilter = THREE.NearestFilter;
|
|
25
|
-
t.repeat.set(1 / sprite.gridCols, 1 / sprite.gridRows);
|
|
26
|
-
t.offset.set(sprite.gridCol / sprite.gridCols, 1 - ((sprite.gridRow + 1) / sprite.gridRows));
|
|
27
|
-
t.needsUpdate = true;
|
|
28
|
-
return t;
|
|
29
|
-
}, [texture, sprite.gridCol, sprite.gridRow, sprite.gridCols, sprite.gridRows]);
|
|
30
|
-
}
|
|
31
|
-
export const Card3D = memo(function Card3D({ sprite, position = [0, 0, 0], rotation = [0, 0, 0], selected = false, highlighted = false, onClick, onPointerEnter, onPointerLeave, }) {
|
|
32
|
-
const tiltRef = useRef(null);
|
|
33
|
-
const target = useRef({ rx: 0, ry: 0, rz: 0, ox: 0, oy: 0 });
|
|
34
|
-
const [hovered, setHovered] = useState(false);
|
|
35
|
-
const texture = useSpriteTexture(sprite);
|
|
36
|
-
const { posY, scale } = useSpring({
|
|
37
|
-
posY: selected ? 0.3 : hovered ? 0.15 : 0,
|
|
38
|
-
scale: hovered ? 1.08 : selected ? 1.05 : 1,
|
|
39
|
-
config: { tension: 300, friction: 20 },
|
|
40
|
-
});
|
|
41
|
-
useFrame((_state, dt) => {
|
|
42
|
-
const g = tiltRef.current;
|
|
43
|
-
if (!g)
|
|
44
|
-
return;
|
|
45
|
-
const t = target.current;
|
|
46
|
-
const rate = hovered ? CARD_MAGNET.LERP_IN : CARD_MAGNET.LERP_OUT;
|
|
47
|
-
const a = 1 - Math.exp(-rate * dt);
|
|
48
|
-
g.rotation.x = THREE.MathUtils.lerp(g.rotation.x, t.rx, a);
|
|
49
|
-
g.rotation.y = THREE.MathUtils.lerp(g.rotation.y, t.ry, a);
|
|
50
|
-
g.rotation.z = THREE.MathUtils.lerp(g.rotation.z, t.rz, a);
|
|
51
|
-
g.position.x = THREE.MathUtils.lerp(g.position.x, t.ox, a);
|
|
52
|
-
g.position.y = THREE.MathUtils.lerp(g.position.y, t.oy, a);
|
|
53
|
-
});
|
|
54
|
-
const glowColor = useMemo(() => highlighted ? '#e4b643' : '#ffffff', [highlighted]);
|
|
55
|
-
const onMove = (e) => {
|
|
56
|
-
e.stopPropagation();
|
|
57
|
-
const uv = e.uv;
|
|
58
|
-
if (!uv)
|
|
59
|
-
return;
|
|
60
|
-
const nx = THREE.MathUtils.clamp((uv.x - 0.5) * 2, -1, 1);
|
|
61
|
-
const ny = THREE.MathUtils.clamp((uv.y - 0.5) * 2, -1, 1);
|
|
62
|
-
target.current.ry = -nx * CARD_MAGNET.MAX_TILT_Y;
|
|
63
|
-
target.current.rx = ny * CARD_MAGNET.MAX_TILT_X;
|
|
64
|
-
target.current.rz = -nx * ny * CARD_MAGNET.TWIST_Z;
|
|
65
|
-
target.current.ox = nx * CARD_MAGNET.MAX_SHIFT;
|
|
66
|
-
target.current.oy = -ny * CARD_MAGNET.MAX_SHIFT * 0.65;
|
|
67
|
-
};
|
|
68
|
-
const reset = () => { target.current = { rx: 0, ry: 0, rz: 0, ox: 0, oy: 0 }; };
|
|
69
|
-
if (!texture)
|
|
70
|
-
return null;
|
|
71
|
-
return (_jsxs(animated.group, { "position-x": position[0], "position-y": posY.to((y) => position[1] + y), "position-z": position[2], "rotation-x": rotation[0], "rotation-y": rotation[1], "rotation-z": rotation[2], scale: scale, children: [_jsxs("mesh", { visible: false, onClick: (e) => { e.stopPropagation(); onClick?.(); }, onPointerMove: onMove, onPointerEnter: (e) => { e.stopPropagation(); setHovered(true); onPointerEnter?.(); document.body.style.cursor = 'pointer'; }, onPointerLeave: (e) => { e.stopPropagation(); setHovered(false); reset(); onPointerLeave?.(); document.body.style.cursor = 'auto'; }, children: [_jsx("boxGeometry", { args: [CARD_DIMENSIONS.WIDTH, CARD_DIMENSIONS.HEIGHT, CARD_DIMENSIONS.DEPTH * 2] }), _jsx("meshBasicMaterial", {})] }), _jsxs("group", { ref: tiltRef, children: [highlighted && (_jsx("pointLight", { color: glowColor, intensity: 1.5, distance: 1, position: [0, 0, 0.1] })), _jsxs("mesh", { castShadow: true, receiveShadow: true, children: [_jsx("boxGeometry", { args: [CARD_DIMENSIONS.WIDTH, CARD_DIMENSIONS.HEIGHT, CARD_DIMENSIONS.DEPTH] }), _jsx("meshBasicMaterial", { attach: "material-4", map: texture, toneMapped: false }), _jsx("meshStandardMaterial", { attach: "material-5", color: "#1a1a2e", metalness: 0.2, roughness: 0.8 }), _jsx("meshStandardMaterial", { attach: "material-0", color: "#f5f5dc" }), _jsx("meshStandardMaterial", { attach: "material-1", color: "#f5f5dc" }), _jsx("meshStandardMaterial", { attach: "material-2", color: "#f5f5dc" }), _jsx("meshStandardMaterial", { attach: "material-3", color: "#f5f5dc" })] }), selected && (_jsxs("mesh", { position: [0, 0, -CARD_DIMENSIONS.DEPTH], children: [_jsx("ringGeometry", { args: [0.45, 0.5, 32] }), _jsx("meshBasicMaterial", { color: "#e4b643", transparent: true, opacity: 0.8 })] }))] })] }));
|
|
72
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { Billboard } from '@react-three/drei';
|
|
4
|
-
import { useLoader } from '@react-three/fiber';
|
|
5
|
-
import * as THREE from 'three';
|
|
6
|
-
export function JimboBillboard(props) {
|
|
7
|
-
if (!props.sprite)
|
|
8
|
-
return null;
|
|
9
|
-
return _jsx(JimboBillboardInner, { ...props, sprite: props.sprite });
|
|
10
|
-
}
|
|
11
|
-
function JimboBillboardInner({ sprite, width = 3.4, height = 4.5, yLockOnly = false, position = [0, 0, 0] }) {
|
|
12
|
-
// Memoize texture to avoid per-render allocation
|
|
13
|
-
const texture = useLoader(THREE.TextureLoader, sprite.atlasPath);
|
|
14
|
-
const clonedTexture = useMemo(() => {
|
|
15
|
-
const tex = texture.clone();
|
|
16
|
-
tex.magFilter = THREE.NearestFilter;
|
|
17
|
-
tex.minFilter = THREE.NearestFilter;
|
|
18
|
-
// Set up sprite cropping
|
|
19
|
-
tex.repeat.set(1 / sprite.gridCols, 1 / sprite.gridRows);
|
|
20
|
-
tex.offset.set(sprite.gridCol / sprite.gridCols, 1 - ((sprite.gridRow + 1) / sprite.gridRows));
|
|
21
|
-
tex.needsUpdate = true;
|
|
22
|
-
return tex;
|
|
23
|
-
}, [texture, sprite.gridCol, sprite.gridRow, sprite.gridCols, sprite.gridRows]);
|
|
24
|
-
const material = useMemo(() => {
|
|
25
|
-
return new THREE.MeshBasicMaterial({
|
|
26
|
-
map: clonedTexture,
|
|
27
|
-
transparent: true,
|
|
28
|
-
alphaTest: 0.5
|
|
29
|
-
});
|
|
30
|
-
}, [clonedTexture]);
|
|
31
|
-
return (_jsx(Billboard, { lockY: yLockOnly, lockX: false, lockZ: false, position: position, children: _jsx("mesh", { material: material, children: _jsx("planeGeometry", { args: [width, height] }) }) }));
|
|
32
|
-
}
|
package/dist/r3f/JimboText3D.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from '@react-three/drei';
|
|
3
|
-
import { resolveJamlAssetUrl } from '../assets.js';
|
|
4
|
-
import { JimboColorOption } from '../ui/tokens.js';
|
|
5
|
-
export function JimboText3D({ children, color = JimboColorOption.WHITE, outlineColor = JimboColorOption.BLACK, outlineWidth = 0.05, position = [0, 0, 0], fontSize = 1 }) {
|
|
6
|
-
// We use the m6x11plus font from assets if possible, or fallback
|
|
7
|
-
return (_jsx(Text, { position: position, fontSize: fontSize, color: color, outlineColor: outlineColor, outlineWidth: outlineWidth, font: resolveJamlAssetUrl('font'), anchorX: "center", anchorY: "middle", children: children }));
|
|
8
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useJamlCardRenderer } from "../ui/hooks.js";
|
|
4
|
-
export function JamlCardRenderer({ layers, invert = false, className = "", hoverTilt = false }) {
|
|
5
|
-
const { canvasRef, containerStyle, canvasStyle, handlers } = useJamlCardRenderer({
|
|
6
|
-
layers,
|
|
7
|
-
invert,
|
|
8
|
-
hoverTilt
|
|
9
|
-
});
|
|
10
|
-
return (_jsxs("div", { className: className, style: { ...containerStyle, position: "relative" }, children: [_jsx("canvas", { ref: canvasRef, style: canvasStyle }), hoverTilt && (_jsx("div", { style: { position: "absolute", inset: "-15px", zIndex: 10, cursor: "pointer" }, ...handlers })), !hoverTilt && (_jsx("div", { style: { position: "absolute", inset: "0", zIndex: 10 }, ...handlers }))] }));
|
|
11
|
-
}
|
package/dist/render/Layer.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export class Layer {
|
|
2
|
-
pos;
|
|
3
|
-
name;
|
|
4
|
-
order;
|
|
5
|
-
source;
|
|
6
|
-
rows;
|
|
7
|
-
columns;
|
|
8
|
-
animated;
|
|
9
|
-
constructor({ pos, name, order, source, rows, columns, animated = false }) {
|
|
10
|
-
this.pos = pos;
|
|
11
|
-
this.name = name;
|
|
12
|
-
this.order = order;
|
|
13
|
-
this.source = source;
|
|
14
|
-
this.rows = rows;
|
|
15
|
-
this.columns = columns;
|
|
16
|
-
this.animated = animated;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
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 { JAML_ASSET_FILES, resolveJamlAssetUrl } from "../assets.js";
|
|
7
|
-
function defineSpriteSheet(asset, columns, rows) {
|
|
8
|
-
return {
|
|
9
|
-
asset,
|
|
10
|
-
fileName: JAML_ASSET_FILES[asset],
|
|
11
|
-
columns,
|
|
12
|
-
rows,
|
|
13
|
-
get src() {
|
|
14
|
-
return resolveJamlAssetUrl(asset);
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
/** Sprite sheet grid dimensions */
|
|
19
|
-
export const SPRITE_SHEETS = {
|
|
20
|
-
jokers: defineSpriteSheet("jokers", 10, 16),
|
|
21
|
-
tarots: defineSpriteSheet("tarots", 10, 6),
|
|
22
|
-
deck: defineSpriteSheet("deck", 13, 4),
|
|
23
|
-
enhancers: defineSpriteSheet("enhancers", 7, 5),
|
|
24
|
-
editions: defineSpriteSheet("editions", 5, 1),
|
|
25
|
-
stickers: defineSpriteSheet("stickers", 5, 3),
|
|
26
|
-
blinds: defineSpriteSheet("blinds", 21, 31),
|
|
27
|
-
vouchers: defineSpriteSheet("vouchers", 9, 4),
|
|
28
|
-
tags: defineSpriteSheet("tags", 6, 5),
|
|
29
|
-
boosters: defineSpriteSheet("boosters", 4, 9),
|
|
30
|
-
stakes: defineSpriteSheet("stakes", 5, 2),
|
|
31
|
-
};
|
|
32
|
-
export const JOKERS = [
|
|
33
|
-
{ name: "Joker", pos: { x: 0, y: 0 } }, { name: "Greedy Joker", pos: { x: 6, y: 1 } }, { name: "Lusty Joker", pos: { x: 7, y: 1 } }, { name: "Wrathful Joker", pos: { x: 8, y: 1 } }, { name: "Gluttonous Joker", pos: { x: 9, y: 1 } }, { name: "Jolly Joker", pos: { x: 2, y: 0 } }, { name: "Zany Joker", pos: { x: 3, y: 0 } }, { name: "Mad Joker", pos: { x: 4, y: 0 } }, { name: "Crazy Joker", pos: { x: 5, y: 0 } }, { name: "Droll Joker", pos: { x: 6, y: 0 } }, { name: "Sly Joker", pos: { x: 0, y: 14 } }, { name: "Wily Joker", pos: { x: 1, y: 14 } }, { name: "Clever Joker", pos: { x: 2, y: 14 } }, { name: "Devious Joker", pos: { x: 3, y: 14 } }, { name: "Crafty Joker", pos: { x: 4, y: 14 } }, { name: "Half Joker", pos: { x: 7, y: 0 } }, { name: "Joker Stencil", pos: { x: 2, y: 5 } }, { name: "Four Fingers", pos: { x: 6, y: 6 } }, { name: "Mime", pos: { x: 4, y: 1 } }, { name: "Credit Card", pos: { x: 5, y: 1 } }, { name: "Ceremonial Dagger", pos: { x: 5, y: 5 } }, { name: "Banner", pos: { x: 1, y: 2 } }, { name: "Mystic Summit", pos: { x: 2, y: 2 } }, { name: "Marble Joker", pos: { x: 3, y: 2 } }, { name: "Loyalty Card", pos: { x: 4, y: 2 } }, { name: "8 Ball", pos: { x: 0, y: 5 } }, { name: "Misprint", pos: { x: 6, y: 2 } }, { name: "Dusk", pos: { x: 4, y: 7 } }, { name: "Raised Fist", pos: { x: 8, y: 2 } }, { name: "Chaos the Clown", pos: { x: 1, y: 0 } }, { name: "Fibonacci", pos: { x: 1, y: 5 } }, { name: "Steel Joker", pos: { x: 7, y: 2 } }, { name: "Scary Face", pos: { x: 2, y: 3 } }, { name: "Abstract Joker", pos: { x: 3, y: 3 } }, { name: "Delayed Gratification", pos: { x: 4, y: 3 } }, { name: "Hack", pos: { x: 5, y: 2 } }, { name: "Pareidolia", pos: { x: 6, y: 3 } }, { name: "Gros Michel", pos: { x: 7, y: 6 } }, { name: "Even Steven", pos: { x: 8, y: 3 } }, { name: "Odd Todd", pos: { x: 9, y: 3 } }, { name: "Scholar", pos: { x: 3, y: 6 } }, { name: "Business Card", pos: { x: 1, y: 4 } }, { name: "Supernova", pos: { x: 2, y: 4 } }, { name: "Ride the Bus", pos: { x: 1, y: 6 } }, { name: "Space Joker", pos: { x: 3, y: 5 } }, { name: "Egg", pos: { x: 0, y: 10 } }, { name: "Burglar", pos: { x: 1, y: 10 } }, { name: "Blackboard", pos: { x: 2, y: 10 } }, { name: "Runner", pos: { x: 3, y: 10 } }, { name: "Ice Cream", pos: { x: 4, y: 10 } }, { name: "DNA", pos: { x: 5, y: 10 } }, { name: "Splash", pos: { x: 6, y: 10 } }, { name: "Blue Joker", pos: { x: 7, y: 10 } }, { name: "Sixth Sense", pos: { x: 8, y: 10 } }, { name: "Constellation", pos: { x: 9, y: 10 } }, { name: "Hiker", pos: { x: 0, y: 11 } }, { name: "Faceless Joker", pos: { x: 1, y: 11 } }, { name: "Green Joker", pos: { x: 2, y: 11 } }, { name: "Superposition", pos: { x: 3, y: 11 } }, { name: "To Do List", pos: { x: 4, y: 11 } }, { name: "Cavendish", pos: { x: 5, y: 11 } }, { name: "Card Sharp", pos: { x: 6, y: 11 } }, { name: "Red Card", pos: { x: 7, y: 11 } }, { name: "Madness", pos: { x: 8, y: 11 } }, { name: "Square Joker", pos: { x: 9, y: 11 } }, { name: "Seance", pos: { x: 0, y: 12 } }, { name: "Riff-raff", pos: { x: 1, y: 12 } }, { name: "Vampire", pos: { x: 2, y: 12 } }, { name: "Shortcut", pos: { x: 3, y: 12 } }, { name: "Hologram", pos: { x: 4, y: 12 } }, { name: "Vagabond", pos: { x: 5, y: 12 } }, { name: "Baron", pos: { x: 6, y: 12 } }, { name: "Cloud 9", pos: { x: 7, y: 12 } }, { name: "Rocket", pos: { x: 8, y: 12 } }, { name: "Obelisk", pos: { x: 9, y: 12 } }, { name: "Midas Mask", pos: { x: 0, y: 13 } }, { name: "Luchador", pos: { x: 1, y: 13 } }, { name: "Photograph", pos: { x: 2, y: 13 } }, { name: "Gift Card", pos: { x: 3, y: 13 } }, { name: "Turtle Bean", pos: { x: 4, y: 13 } }, { name: "Erosion", pos: { x: 5, y: 13 } }, { name: "Reserved Parking", pos: { x: 6, y: 13 } }, { name: "Mail In Rebate", pos: { x: 7, y: 13 } }, { name: "To the Moon", pos: { x: 8, y: 13 } }, { name: "Hallucination", pos: { x: 9, y: 13 } }, { name: "Fortune Teller", pos: { x: 7, y: 5 } }, { name: "Juggler", pos: { x: 0, y: 1 } }, { name: "Drunkard", pos: { x: 1, y: 1 } }, { name: "Stone Joker", pos: { x: 9, y: 0 } }, { name: "Golden Joker", pos: { x: 9, y: 2 } }, { name: "Lucky Cat", pos: { x: 5, y: 14 } }, { name: "Baseball Card", pos: { x: 6, y: 14 } }, { name: "Bull", pos: { x: 7, y: 14 } }, { name: "Diet Cola", pos: { x: 8, y: 14 } }, { name: "Trading Card", pos: { x: 9, y: 14 } }, { name: "Flash Card", pos: { x: 0, y: 15 } }, { name: "Popcorn", pos: { x: 1, y: 15 } }, { name: "Spare Trousers", pos: { x: 4, y: 15 } }, { name: "Ancient Joker", pos: { x: 7, y: 15 } }, { name: "Ramen", pos: { x: 2, y: 15 } }, { name: "Walkie Talkie", pos: { x: 8, y: 15 } }, { name: "Seltzer", pos: { x: 3, y: 15 } }, { name: "Castle", pos: { x: 9, y: 15 } }, { name: "Smiley Face", pos: { x: 6, y: 15 } }, { name: "Campfire", pos: { x: 5, y: 15 } }, { name: "Golden Ticket", pos: { x: 5, y: 3 } }, { name: "Mr. Bones", pos: { x: 3, y: 4 } }, { name: "Acrobat", pos: { x: 2, y: 1 } }, { name: "Sock and Buskin", pos: { x: 3, y: 1 } }, { name: "Swashbuckler", pos: { x: 9, y: 5 } }, { name: "Troubadour", pos: { x: 0, y: 2 } }, { name: "Certificate", pos: { x: 8, y: 8 } }, { name: "Smeared Joker", pos: { x: 4, y: 6 } }, { name: "Throwback", pos: { x: 5, y: 7 } }, { name: "Hanging Chad", pos: { x: 9, y: 6 } }, { name: "Rough Gem", pos: { x: 9, y: 7 } }, { name: "Bloodstone", pos: { x: 0, y: 8 } }, { name: "Arrowhead", pos: { x: 1, y: 8 } }, { name: "Onyx Agate", pos: { x: 2, y: 8 } }, { name: "Glass Joker", pos: { x: 1, y: 3 } }, { name: "Showman", pos: { x: 6, y: 5 } }, { name: "Flower Pot", pos: { x: 0, y: 6 } }, { name: "Blueprint", pos: { x: 0, y: 3 } }, { name: "Wee Joker", pos: { x: 0, y: 4 } }, { name: "Merry Andy", pos: { x: 8, y: 0 } }, { name: "Oops! All 6s", pos: { x: 5, y: 6 } }, { name: "The Idol", pos: { x: 6, y: 7 } }, { name: "Seeing Double", pos: { x: 4, y: 4 } }, { name: "Matador", pos: { x: 4, y: 5 } }, { name: "Hit the Road", pos: { x: 8, y: 5 } }, { name: "The Duo", pos: { x: 5, y: 4 } }, { name: "The Trio", pos: { x: 6, y: 4 } }, { name: "The Family", pos: { x: 7, y: 4 } }, { name: "The Order", pos: { x: 8, y: 4 } }, { name: "The Tribe", pos: { x: 9, y: 4 } }, { name: "Stuntman", pos: { x: 8, y: 6 } }, { name: "Invisible Joker", pos: { x: 1, y: 7 } }, { name: "Brainstorm", pos: { x: 7, y: 7 } }, { name: "Satellite", pos: { x: 8, y: 7 } }, { name: "Shoot the Moon", pos: { x: 2, y: 6 } }, { name: "Drivers License", pos: { x: 0, y: 7 } }, { name: "Cartomancer", pos: { x: 7, y: 3 } }, { name: "Astronomer", pos: { x: 2, y: 7 } }, { name: "Burnt Joker", pos: { x: 3, y: 7 } }, { name: "Bootstraps", pos: { x: 9, y: 8 } }, { name: "Canio", pos: { x: 3, y: 8 } }, { name: "Triboulet", pos: { x: 4, y: 8 } }, { name: "Yorick", pos: { x: 5, y: 8 } }, { name: "Chicot", pos: { x: 6, y: 8 } }, { name: "Perkeo", pos: { x: 7, y: 8 } },
|
|
34
|
-
];
|
|
35
|
-
export const JOKER_FACES = [
|
|
36
|
-
{ name: "Hologram", pos: { x: 2, y: 9 }, animated: true },
|
|
37
|
-
{ name: "Canio", pos: { x: 3, y: 9 }, animated: true },
|
|
38
|
-
{ name: "Triboulet", pos: { x: 4, y: 9 }, animated: true },
|
|
39
|
-
{ name: "Yorick", pos: { x: 5, y: 9 }, animated: true },
|
|
40
|
-
{ name: "Chicot", pos: { x: 6, y: 9 }, animated: true },
|
|
41
|
-
{ name: "Perkeo", pos: { x: 7, y: 9 }, animated: true },
|
|
42
|
-
];
|
|
43
|
-
export const CONSUMABLE_FACES = [
|
|
44
|
-
{ name: "The Soul", pos: { x: 0, y: 1 }, animated: true },
|
|
45
|
-
];
|
|
46
|
-
export const TAROTS_AND_PLANETS = [
|
|
47
|
-
{ name: "The Fool", pos: { x: 0, y: 0 } }, { name: "The Magician", pos: { x: 1, y: 0 } }, { name: "The High Priestess", pos: { x: 2, y: 0 } }, { name: "The Empress", pos: { x: 3, y: 0 } }, { name: "The Emperor", pos: { x: 4, y: 0 } }, { name: "The Hierophant", pos: { x: 5, y: 0 } }, { name: "The Lovers", pos: { x: 6, y: 0 } }, { name: "The Chariot", pos: { x: 7, y: 0 } }, { name: "Justice", pos: { x: 8, y: 0 } }, { name: "The Hermit", pos: { x: 9, y: 0 } }, { name: "The Wheel of Fortune", pos: { x: 0, y: 1 } }, { name: "Strength", pos: { x: 1, y: 1 } }, { name: "The Hanged Man", pos: { x: 2, y: 1 } }, { name: "Death", pos: { x: 3, y: 1 } }, { name: "Temperance", pos: { x: 4, y: 1 } }, { name: "The Devil", pos: { x: 5, y: 1 } }, { name: "The Tower", pos: { x: 6, y: 1 } }, { name: "The Star", pos: { x: 7, y: 1 } }, { name: "The Moon", pos: { x: 8, y: 1 } }, { name: "The Sun", pos: { x: 9, y: 1 } }, { name: "Judgement", pos: { x: 0, y: 2 } }, { name: "The World", pos: { x: 1, y: 2 } }, { name: "Mercury", pos: { x: 0, y: 3 } }, { name: "Venus", pos: { x: 1, y: 3 } }, { name: "Earth", pos: { x: 2, y: 3 } }, { name: "Mars", pos: { x: 3, y: 3 } }, { name: "Jupiter", pos: { x: 4, y: 3 } }, { name: "Saturn", pos: { x: 5, y: 3 } }, { name: "Uranus", pos: { x: 6, y: 3 } }, { name: "Neptune", pos: { x: 7, y: 3 } }, { name: "Pluto", pos: { x: 8, y: 3 } }, { name: "Planet X", pos: { x: 9, y: 2 } }, { name: "Ceres", pos: { x: 8, y: 2 } }, { name: "Eris", pos: { x: 3, y: 2 } }, { name: "Familiar", pos: { x: 0, y: 4 } }, { name: "Grim", pos: { x: 1, y: 4 } }, { name: "Incantation", pos: { x: 2, y: 4 } }, { name: "Talisman", pos: { x: 3, y: 4 } }, { name: "Aura", pos: { x: 4, y: 4 } }, { name: "Wraith", pos: { x: 5, y: 4 } }, { name: "Sigil", pos: { x: 6, y: 4 } }, { name: "Ouija", pos: { x: 7, y: 4 } }, { name: "Ectoplasm", pos: { x: 8, y: 4 } }, { name: "Immolate", pos: { x: 9, y: 4 } }, { name: "Ankh", pos: { x: 0, y: 5 } }, { name: "Deja Vu", pos: { x: 1, y: 5 } }, { name: "Hex", pos: { x: 2, y: 5 } }, { name: "Trance", pos: { x: 3, y: 5 } }, { name: "Medium", pos: { x: 4, y: 5 } }, { name: "Cryptid", pos: { x: 5, y: 5 } }, { name: "The Soul", pos: { x: 2, y: 2 } }, { name: "Black Hole", pos: { x: 9, y: 3 } },
|
|
48
|
-
];
|
|
49
|
-
export const TAGS = [
|
|
50
|
-
{ name: "Uncommon Tag", pos: { x: 0, y: 0 } }, { name: "Rare Tag", pos: { x: 1, y: 0 } }, { name: "Negative Tag", pos: { x: 2, y: 0 } }, { name: "Foil Tag", pos: { x: 3, y: 0 } }, { name: "Holographic Tag", pos: { x: 0, y: 1 } }, { name: "Polychrome Tag", pos: { x: 1, y: 1 } }, { name: "Investment Tag", pos: { x: 2, y: 1 } }, { name: "Voucher Tag", pos: { x: 3, y: 1 } }, { name: "Boss Tag", pos: { x: 0, y: 2 } }, { name: "Standard Tag", pos: { x: 1, y: 2 } }, { name: "Charm Tag", pos: { x: 2, y: 2 } }, { name: "Meteor Tag", pos: { x: 3, y: 2 } }, { name: "Buffoon Tag", pos: { x: 4, y: 2 } }, { name: "Handy Tag", pos: { x: 1, y: 3 } }, { name: "Garbage Tag", pos: { x: 2, y: 3 } }, { name: "Ethereal Tag", pos: { x: 3, y: 3 } }, { name: "Coupon Tag", pos: { x: 4, y: 0 } }, { name: "Double Tag", pos: { x: 5, y: 0 } }, { name: "Juggle Tag", pos: { x: 5, y: 1 } }, { name: "D6 Tag", pos: { x: 5, y: 3 } }, { name: "Top-up Tag", pos: { x: 4, y: 1 } }, { name: "Speed Tag", pos: { x: 0, y: 3 } }, { name: "Orbital Tag", pos: { x: 5, y: 2 } }, { name: "Economy Tag", pos: { x: 4, y: 3 } },
|
|
51
|
-
];
|
|
52
|
-
export const VOUCHERS = [
|
|
53
|
-
{ name: "Overstock", pos: { x: 0, y: 0 } }, { name: "Clearance Sale", pos: { x: 3, y: 0 } }, { name: "Hone", pos: { x: 4, y: 0 } }, { name: "Reroll Surplus", pos: { x: 0, y: 2 } }, { name: "Crystal Ball", pos: { x: 2, y: 2 } }, { name: "Telescope", pos: { x: 3, y: 2 } }, { name: "Grabber", pos: { x: 5, y: 0 } }, { name: "Wasteful", pos: { x: 6, y: 0 } }, { name: "Tarot Merchant", pos: { x: 1, y: 0 } }, { name: "Planet Merchant", pos: { x: 2, y: 0 } }, { name: "Seed Money", pos: { x: 1, y: 2 } }, { name: "Blank", pos: { x: 7, y: 0 } }, { name: "Magic Trick", pos: { x: 4, y: 2 } }, { name: "Hieroglyph", pos: { x: 5, y: 2 } }, { name: "Director's Cut", pos: { x: 6, y: 2 } }, { name: "Paint Brush", pos: { x: 7, y: 2 } }, { name: "Overstock Plus", pos: { x: 0, y: 1 } }, { name: "Liquidation", pos: { x: 3, y: 1 } }, { name: "Glow Up", pos: { x: 4, y: 1 } }, { name: "Reroll Glut", pos: { x: 0, y: 3 } }, { name: "Omen Globe", pos: { x: 2, y: 3 } }, { name: "Observatory", pos: { x: 3, y: 3 } }, { name: "Nacho Tong", pos: { x: 5, y: 1 } }, { name: "Recyclomancy", pos: { x: 6, y: 1 } }, { name: "Tarot Tycoon", pos: { x: 1, y: 1 } }, { name: "Planet Tycoon", pos: { x: 2, y: 1 } }, { name: "Money Tree", pos: { x: 1, y: 3 } }, { name: "Antimatter", pos: { x: 7, y: 1 } }, { name: "Illusion", pos: { x: 4, y: 3 } }, { name: "Petroglyph", pos: { x: 5, y: 3 } }, { name: "Retcon", pos: { x: 6, y: 3 } }, { name: "Palette", pos: { x: 7, y: 3 } },
|
|
54
|
-
];
|
|
55
|
-
export const BOSSES = [
|
|
56
|
-
{ name: "Small Blind", pos: { x: 0, y: 0 } }, { name: "Big Blind", pos: { x: 0, y: 1 } }, { name: "The Ox", pos: { x: 0, y: 2 } }, { name: "The Hook", pos: { x: 0, y: 7 } }, { name: "The Mouth", pos: { x: 0, y: 18 } }, { name: "The Fish", pos: { x: 0, y: 5 } }, { name: "The Club", pos: { x: 0, y: 4 } }, { name: "The Manacle", pos: { x: 0, y: 8 } }, { name: "The Tooth", pos: { x: 0, y: 22 } }, { name: "The Wall", pos: { x: 0, y: 9 } }, { name: "The House", pos: { x: 0, y: 3 } }, { name: "The Mark", pos: { x: 0, y: 23 } }, { name: "Cerulean Bell", pos: { x: 0, y: 26 } }, { name: "The Wheel", pos: { x: 0, y: 10 } }, { name: "The Arm", pos: { x: 0, y: 11 } }, { name: "The Psychic", pos: { x: 0, y: 12 } }, { name: "The Goad", pos: { x: 0, y: 13 } }, { name: "The Water", pos: { x: 0, y: 14 } }, { name: "The Eye", pos: { x: 0, y: 17 } }, { name: "The Plant", pos: { x: 0, y: 19 } }, { name: "The Needle", pos: { x: 0, y: 20 } }, { name: "The Head", pos: { x: 0, y: 21 } }, { name: "Verdant Leaf", pos: { x: 0, y: 28 } }, { name: "Violet Vessel", pos: { x: 0, y: 29 } }, { name: "The Window", pos: { x: 0, y: 6 } }, { name: "The Serpent", pos: { x: 0, y: 15 } }, { name: "The Pillar", pos: { x: 0, y: 16 } }, { name: "The Flint", pos: { x: 0, y: 24 } }, { name: "Amber Acorn", pos: { x: 0, y: 27 } }, { name: "Crimson Heart", pos: { x: 0, y: 25 } },
|
|
57
|
-
];
|
|
58
|
-
export const BOOSTER_PACKS = [
|
|
59
|
-
{ name: "Arcana Pack", pos: { x: 0, y: 0 } }, { name: "Celestial Pack", pos: { x: 0, y: 1 } }, { name: "Jumbo Arcana Pack", pos: { x: 0, y: 2 } }, { name: "Mega Arcana Pack", pos: { x: 2, y: 2 } }, { name: "Jumbo Celestial Pack", pos: { x: 0, y: 3 } }, { name: "Mega Celestial Pack", pos: { x: 2, y: 3 } }, { name: "Spectral Pack", pos: { x: 0, y: 4 } }, { name: "Jumbo Spectral Pack", pos: { x: 2, y: 4 } }, { name: "Mega Spectral Pack", pos: { x: 3, y: 4 } }, { name: "Standard Pack", pos: { x: 0, y: 6 } }, { name: "Jumbo Standard Pack", pos: { x: 0, y: 7 } }, { name: "Mega Standard Pack", pos: { x: 2, y: 7 } }, { name: "Buffoon Pack", pos: { x: 0, y: 8 } }, { name: "Jumbo Buffoon Pack", pos: { x: 2, y: 8 } }, { name: "Mega Buffoon Pack", pos: { x: 3, y: 8 } },
|
|
60
|
-
];
|
|
61
|
-
export const EDITION_MAP = {
|
|
62
|
-
Foil: 1,
|
|
63
|
-
Holographic: 2,
|
|
64
|
-
Polychrome: 3,
|
|
65
|
-
};
|
|
66
|
-
export const STICKER_MAP = {
|
|
67
|
-
Eternal: { x: 0, y: 0 },
|
|
68
|
-
Perishable: { x: 0, y: 2 },
|
|
69
|
-
Rental: { x: 1, y: 2 },
|
|
70
|
-
};
|
|
71
|
-
export const RANK_MAP = {
|
|
72
|
-
"2": 0, "3": 1, "4": 2, "5": 3, "6": 4, "7": 5, "8": 6, "9": 7, "10": 8, Jack: 9, Queen: 10, King: 11, Ace: 12,
|
|
73
|
-
};
|
|
74
|
-
export const SUIT_MAP = {
|
|
75
|
-
Hearts: 0, Clubs: 1, Diamonds: 2, Spades: 3,
|
|
76
|
-
};
|
|
77
|
-
export const ENHANCER_MAP = {
|
|
78
|
-
Bonus: { x: 1, y: 1 }, Mult: { x: 2, y: 1 }, Wild: { x: 3, y: 1 }, Glass: { x: 5, y: 1 }, Steel: { x: 6, y: 1 }, Stone: { x: 5, y: 0 }, Gold: { x: 6, y: 0 }, Lucky: { x: 4, y: 1 },
|
|
79
|
-
};
|
|
80
|
-
export const SEAL_MAP = {
|
|
81
|
-
"Gold Seal": { x: 2, y: 0 }, "Purple Seal": { x: 4, y: 4 }, "Red Seal": { x: 5, y: 4 }, "Blue Seal": { x: 6, y: 4 },
|
|
82
|
-
Gold: { x: 2, y: 0 }, Purple: { x: 4, y: 4 }, Red: { x: 5, y: 4 }, Blue: { x: 6, y: 4 },
|
|
83
|
-
};
|
|
84
|
-
/** Build fast lookup maps */
|
|
85
|
-
const jokerMap = new Map(JOKERS.map((j) => [j.name, j]));
|
|
86
|
-
const jokerFaceMap = new Map(JOKER_FACES.map((j) => [j.name, j]));
|
|
87
|
-
const consumableMap = new Map(TAROTS_AND_PLANETS.map((t) => [t.name, t]));
|
|
88
|
-
const consumableFaceMap = new Map(CONSUMABLE_FACES.map((c) => [c.name, c]));
|
|
89
|
-
const tagMap = new Map(TAGS.map((t) => [t.name, t]));
|
|
90
|
-
const voucherMap = new Map(VOUCHERS.map((v) => [v.name, v]));
|
|
91
|
-
const bossMap = new Map(BOSSES.map((b) => [b.name, b]));
|
|
92
|
-
const boosterMap = new Map(BOOSTER_PACKS.map((b) => [b.name, b]));
|
|
93
|
-
export function findJoker(name) { return jokerMap.get(name); }
|
|
94
|
-
export function findJokerFace(name) { return jokerFaceMap.get(name); }
|
|
95
|
-
export function findConsumable(name) { return consumableMap.get(name); }
|
|
96
|
-
export function findConsumableFace(name) { return consumableFaceMap.get(name); }
|
|
97
|
-
export function findTag(name) { return tagMap.get(name); }
|
|
98
|
-
export function findVoucher(name) { return voucherMap.get(name); }
|
|
99
|
-
export function findBoss(name) { return bossMap.get(name); }
|
|
100
|
-
export function findBooster(name) { return boosterMap.get(name); }
|
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
};
|
|
14
|
-
const normalize = (name) => name.toLowerCase().replace(/\s+/g, "");
|
|
15
|
-
const stripPrefix = (name) => name.replace(/^(Joker|Tarot|Planet|Voucher|Pack|Edition|Tag) [|:] /i, "").trim();
|
|
16
|
-
const ITEM_MAP = new Map();
|
|
17
|
-
function registerAll(items, type) {
|
|
18
|
-
for (const item of items) {
|
|
19
|
-
if (!item.name || !item.pos)
|
|
20
|
-
continue;
|
|
21
|
-
ITEM_MAP.set(normalize(item.name), { pos: item.pos, type });
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
registerAll(JOKERS, "Jokers");
|
|
25
|
-
registerAll(JOKER_FACES, "Jokers");
|
|
26
|
-
registerAll(TAROTS_AND_PLANETS, "Tarots");
|
|
27
|
-
registerAll(CONSUMABLE_FACES ?? [], "Tarots");
|
|
28
|
-
registerAll(VOUCHERS, "Vouchers");
|
|
29
|
-
registerAll(BOSSES, "BlindChips");
|
|
30
|
-
registerAll(TAGS, "tags");
|
|
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
|
-
}
|
|
48
|
-
/** Look up sprite data by name. Accepts display names ("Icy Joker"), enum keys ("IcyJoker"), and "Joker | Name" prefixed forms. */
|
|
49
|
-
export function getSpriteData(name) {
|
|
50
|
-
return ITEM_MAP.get(normalize(stripPrefix(name))) ?? ITEM_MAP.get(normalize(name)) ?? null;
|
|
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
|
-
}
|
package/dist/stories/Button.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import './button.css';
|
|
2
|
-
export interface ButtonProps {
|
|
3
|
-
/** Is this the principal call to action on the page? */
|
|
4
|
-
primary?: boolean;
|
|
5
|
-
/** What background color to use */
|
|
6
|
-
backgroundColor?: string;
|
|
7
|
-
/** How large should the button be? */
|
|
8
|
-
size?: 'small' | 'medium' | 'large';
|
|
9
|
-
/** Button contents */
|
|
10
|
-
label: string;
|
|
11
|
-
/** Optional click handler */
|
|
12
|
-
onClick?: () => void;
|
|
13
|
-
}
|
|
14
|
-
/** Primary UI component for user interaction */
|
|
15
|
-
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/stories/Button.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import './button.css';
|
|
3
|
-
/** Primary UI component for user interaction */
|
|
4
|
-
export const Button = ({ primary = false, size = 'medium', backgroundColor, label, ...props }) => {
|
|
5
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
6
|
-
return (_jsx("button", { type: "button", className: ['storybook-button', `storybook-button--${size}`, mode].join(' '), style: { backgroundColor }, ...props, children: label }));
|
|
7
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: ({ primary, size, backgroundColor, label, ...props }: import("./Button").ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: string;
|
|
7
|
-
};
|
|
8
|
-
tags: string[];
|
|
9
|
-
argTypes: {
|
|
10
|
-
backgroundColor: {
|
|
11
|
-
control: "color";
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
args: {
|
|
15
|
-
onClick: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
export declare const Primary: Story;
|
|
21
|
-
export declare const Secondary: Story;
|
|
22
|
-
export declare const Large: Story;
|
|
23
|
-
export declare const Small: Story;
|
|
24
|
-
export declare const JAMLUI: Story;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { fn } from 'storybook/test';
|
|
2
|
-
import { Button } from './Button';
|
|
3
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Example/Button',
|
|
6
|
-
component: Button,
|
|
7
|
-
parameters: {
|
|
8
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
},
|
|
11
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
14
|
-
argTypes: {
|
|
15
|
-
backgroundColor: { control: 'color' },
|
|
16
|
-
},
|
|
17
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
|
|
18
|
-
args: { onClick: fn() },
|
|
19
|
-
};
|
|
20
|
-
export default meta;
|
|
21
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
22
|
-
export const Primary = {
|
|
23
|
-
args: {
|
|
24
|
-
primary: true,
|
|
25
|
-
label: 'Button',
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
export const Secondary = {
|
|
29
|
-
args: {
|
|
30
|
-
label: 'Button',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
export const Large = {
|
|
34
|
-
args: {
|
|
35
|
-
size: 'large',
|
|
36
|
-
label: 'Button',
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
export const Small = {
|
|
40
|
-
args: {
|
|
41
|
-
size: 'small',
|
|
42
|
-
label: 'Button',
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
export const JAMLUI = {
|
|
46
|
-
args: {
|
|
47
|
-
primary: false,
|
|
48
|
-
label: "Button"
|
|
49
|
-
}
|
|
50
|
-
};
|
package/dist/stories/Header.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import './header.css';
|
|
2
|
-
type User = {
|
|
3
|
-
name: string;
|
|
4
|
-
};
|
|
5
|
-
export interface HeaderProps {
|
|
6
|
-
user?: User;
|
|
7
|
-
onLogin?: () => void;
|
|
8
|
-
onLogout?: () => void;
|
|
9
|
-
onCreateAccount?: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
package/dist/stories/Header.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from './Button';
|
|
3
|
-
import './header.css';
|
|
4
|
-
export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (_jsx("header", { children: _jsxs("div", { className: "storybook-header", children: [_jsxs("div", { children: [_jsx("svg", { width: "32", height: "32", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", children: _jsxs("g", { fill: "none", fillRule: "evenodd", children: [_jsx("path", { d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z", fill: "#FFF" }), _jsx("path", { d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z", fill: "#555AB9" }), _jsx("path", { d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z", fill: "#91BAF8" })] }) }), _jsx("h1", { children: "Acme" })] }), _jsx("div", { children: user ? (_jsxs(_Fragment, { children: [_jsxs("span", { className: "welcome", children: ["Welcome, ", _jsx("b", { children: user.name }), "!"] }), _jsx(Button, { size: "small", onClick: onLogout, label: "Log out" })] })) : (_jsxs(_Fragment, { children: [_jsx(Button, { size: "small", onClick: onLogin, label: "Log in" }), _jsx(Button, { primary: true, size: "small", onClick: onCreateAccount, label: "Sign up" })] })) })] }) }));
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: ({ user, onLogin, onLogout, onCreateAccount }: import("./Header").HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
tags: string[];
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: string;
|
|
8
|
-
};
|
|
9
|
-
args: {
|
|
10
|
-
onLogin: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
11
|
-
onLogout: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
12
|
-
onCreateAccount: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default meta;
|
|
16
|
-
type Story = StoryObj<typeof meta>;
|
|
17
|
-
export declare const LoggedIn: Story;
|
|
18
|
-
export declare const LoggedOut: Story;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { fn } from 'storybook/test';
|
|
2
|
-
import { Header } from './Header';
|
|
3
|
-
const meta = {
|
|
4
|
-
title: 'Example/Header',
|
|
5
|
-
component: Header,
|
|
6
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
},
|
|
12
|
-
args: {
|
|
13
|
-
onLogin: fn(),
|
|
14
|
-
onLogout: fn(),
|
|
15
|
-
onCreateAccount: fn(),
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
export default meta;
|
|
19
|
-
export const LoggedIn = {
|
|
20
|
-
args: {
|
|
21
|
-
user: {
|
|
22
|
-
name: 'Jane Doe',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export const LoggedOut = {};
|
package/dist/stories/Page.d.ts
DELETED