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.
Files changed (97) hide show
  1. package/DESIGN.md +9 -11
  2. package/dist/assets.d.ts +7 -0
  3. package/dist/assets.js +11 -0
  4. package/dist/components/AnalyzerExplorer.d.ts +4 -1
  5. package/dist/components/AnalyzerExplorer.js +14 -48
  6. package/dist/components/GameCard.js +8 -7
  7. package/dist/components/JamlAestheticSelector.d.ts +4 -0
  8. package/dist/components/JamlAestheticSelector.js +6 -19
  9. package/dist/components/JamlAnalyzerFullscreen.d.ts +7 -1
  10. package/dist/components/JamlAnalyzerFullscreen.js +18 -47
  11. package/dist/components/JamlIde.js +12 -24
  12. package/dist/components/JamlIdeVisual.js +3 -56
  13. package/dist/components/JamlMapPreview.d.ts +6 -1
  14. package/dist/components/JamlMapPreview.js +99 -21
  15. package/dist/components/JamlSeedInput.d.ts +5 -0
  16. package/dist/components/JamlSeedInput.js +11 -14
  17. package/dist/components/MotelyVersionBadge.d.ts +1 -3
  18. package/dist/components/MotelyVersionBadge.js +4 -16
  19. package/dist/components/jamlMap/JamlMapEditorDemo.d.ts +8 -0
  20. package/dist/components/jamlMap/JamlMapEditorDemo.js +170 -0
  21. package/dist/components/jamlMap/JokerPicker.d.ts +7 -0
  22. package/dist/components/jamlMap/JokerPicker.js +258 -0
  23. package/dist/components/jamlMap/MysterySlot.d.ts +32 -0
  24. package/dist/components/jamlMap/MysterySlot.js +109 -0
  25. package/dist/components/jamlMap/index.d.ts +3 -0
  26. package/dist/components/jamlMap/index.js +3 -0
  27. package/dist/core.d.ts +0 -2
  28. package/dist/core.js +0 -2
  29. package/dist/decode/motelyItemDecoder.d.ts +10 -23
  30. package/dist/decode/motelyItemDecoder.js +103 -248
  31. package/dist/decode/motelySprite.d.ts +19 -0
  32. package/dist/decode/motelySprite.js +84 -0
  33. package/dist/hooks/analyzerStreamRegistry.js +30 -82
  34. package/dist/hooks/useAnalyzer.d.ts +10 -3
  35. package/dist/hooks/useAnalyzer.js +11 -6
  36. package/dist/hooks/useIntersectionObserver.d.ts +14 -0
  37. package/dist/hooks/useIntersectionObserver.js +50 -0
  38. package/dist/index.d.ts +3 -8
  39. package/dist/index.js +2 -7
  40. package/dist/motely.d.ts +2 -1
  41. package/dist/motely.js +2 -1
  42. package/dist/motelyDisplay.d.ts +4 -623
  43. package/dist/motelyDisplay.js +26 -165
  44. package/dist/r3f/Card3D.d.ts +2 -2
  45. package/dist/r3f/Card3D.js +13 -46
  46. package/dist/r3f/JimboBillboard.d.ts +10 -0
  47. package/dist/r3f/JimboBillboard.js +29 -0
  48. package/dist/r3f/JimboText3D.d.ts +9 -0
  49. package/dist/r3f/JimboText3D.js +8 -0
  50. package/dist/r3f.d.ts +2 -0
  51. package/dist/r3f.js +2 -0
  52. package/dist/render/CanvasRenderer.js +7 -171
  53. package/dist/sprites/spriteData.d.ts +1 -0
  54. package/dist/sprites/spriteData.js +1 -0
  55. package/dist/sprites/spriteMapper.d.ts +78 -1
  56. package/dist/sprites/spriteMapper.js +52 -0
  57. package/dist/ui/JimboBadge.d.ts +13 -0
  58. package/dist/ui/JimboBadge.js +8 -0
  59. package/dist/ui/JimboFloating.d.ts +8 -0
  60. package/dist/ui/JimboFloating.js +17 -0
  61. package/dist/ui/JimboToggleList.d.ts +11 -0
  62. package/dist/ui/JimboToggleList.js +5 -0
  63. package/dist/ui/codeBlock.js +2 -3
  64. package/dist/ui/footer.d.ts +4 -0
  65. package/dist/ui/footer.js +6 -4
  66. package/dist/ui/hooks.d.ts +89 -0
  67. package/dist/ui/hooks.js +551 -0
  68. package/dist/ui/jimboBackground.js +2 -131
  69. package/dist/ui/jimboCopyRow.d.ts +4 -0
  70. package/dist/ui/jimboCopyRow.js +5 -22
  71. package/dist/ui/jimboFilterBar.d.ts +1 -4
  72. package/dist/ui/jimboFilterBar.js +2 -61
  73. package/dist/ui/jimboFlankNav.d.ts +1 -2
  74. package/dist/ui/jimboFlankNav.js +5 -30
  75. package/dist/ui/jimboTabs.d.ts +1 -5
  76. package/dist/ui/jimboTabs.js +6 -41
  77. package/dist/ui/jimboText.d.ts +1 -1
  78. package/dist/ui/jimboText.js +15 -32
  79. package/dist/ui/jimboTooltip.d.ts +1 -12
  80. package/dist/ui/jimboTooltip.js +6 -82
  81. package/dist/ui/panel.d.ts +3 -1
  82. package/dist/ui/panel.js +11 -47
  83. package/dist/ui/showcase.d.ts +4 -0
  84. package/dist/ui/showcase.js +9 -36
  85. package/dist/ui/sprites.d.ts +14 -0
  86. package/dist/ui/sprites.js +54 -13
  87. package/dist/ui.d.ts +4 -0
  88. package/dist/ui.js +5 -0
  89. package/package.json +130 -122
  90. package/dist/components/JamlSpeedometer.d.ts +0 -11
  91. package/dist/components/JamlSpeedometer.js +0 -54
  92. package/dist/decode/packedBalatroItem.d.ts +0 -13
  93. package/dist/decode/packedBalatroItem.js +0 -26
  94. package/dist/hooks/loadMotelyWasm.d.ts +0 -7
  95. package/dist/hooks/loadMotelyWasm.js +0 -16
  96. package/dist/utils/itemUtils.d.ts +0 -11
  97. package/dist/utils/itemUtils.js +0 -71
@@ -1,71 +0,0 @@
1
- /** Map MotelyItemType enum names to display-friendly strings */
2
- export function getItemDisplayName(enumKey) {
3
- // Convert PascalCase to spaced: "GreedyJoker" -> "Greedy Joker"
4
- // Handle special cases first
5
- const specials = {
6
- ChaostheClown: "Chaos the Clown",
7
- OopsAll6s: "Oops! All 6s",
8
- EightBall: "8 Ball",
9
- DNA: "DNA",
10
- MrBones: "Mr. Bones",
11
- ToDoList: "To Do List",
12
- Cloud9: "Cloud 9",
13
- SockAndBuskin: "Sock and Buskin",
14
- TheSoul: "The Soul",
15
- BlackHole: "Black Hole",
16
- PlanetX: "Planet X",
17
- };
18
- if (specials[enumKey])
19
- return specials[enumKey];
20
- // Standard cards: C2 = 2 of Clubs, D10 = 10 of Diamonds, etc.
21
- const suitMap = { C: "♣", D: "♦", H: "♥", S: "♠" };
22
- const cardMatch = enumKey.match(/^([CDHS])([2-9JQKA]|10)$/);
23
- if (cardMatch) {
24
- const [, suit, rank] = cardMatch;
25
- const rankName = { J: "Jack", Q: "Queen", K: "King", A: "Ace" }[rank] ?? rank;
26
- return `${rankName} ${suitMap[suit]}`;
27
- }
28
- // General PascalCase split
29
- return enumKey.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
30
- }
31
- const TAROT_NAMES = new Set([
32
- "TheFool", "TheMagician", "TheHighPriestess", "TheEmpress", "TheEmperor",
33
- "TheHierophant", "TheLovers", "TheChariot", "Justice", "TheHermit",
34
- "TheWheelOfFortune", "Strength", "TheHangedMan", "Death", "Temperance",
35
- "TheDevil", "TheTower", "TheStar", "TheMoon", "TheSun", "Judgement", "TheWorld",
36
- ]);
37
- const PLANET_NAMES = new Set([
38
- "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn",
39
- "Uranus", "Neptune", "Pluto", "PlanetX", "Ceres", "Eris",
40
- ]);
41
- const SPECTRAL_NAMES = new Set([
42
- "Familiar", "Grim", "Incantation", "Talisman", "Aura", "Wraith",
43
- "Sigil", "Ouija", "Ectoplasm", "Immolate", "Ankh", "DejaVu",
44
- "Hex", "Trance", "Medium", "Cryptid", "TheSoul", "BlackHole",
45
- ]);
46
- export function getItemCategory(enumKey) {
47
- if (/^[CDHS]([2-9JQKA]|10)$/.test(enumKey))
48
- return "playing";
49
- if (TAROT_NAMES.has(enumKey))
50
- return "tarot";
51
- if (PLANET_NAMES.has(enumKey))
52
- return "planet";
53
- if (SPECTRAL_NAMES.has(enumKey))
54
- return "spectral";
55
- // Everything else between the standard cards and Invalid is a joker
56
- return "joker";
57
- }
58
- export const CATEGORY_COLORS = {
59
- joker: { bg: "bg-purple-900/30", border: "border-purple-500/50", text: "text-purple-200" },
60
- tarot: { bg: "bg-blue-900/30", border: "border-blue-500/50", text: "text-blue-200" },
61
- planet: { bg: "bg-amber-900/30", border: "border-amber-500/50", text: "text-amber-200" },
62
- spectral: { bg: "bg-cyan-900/30", border: "border-cyan-500/50", text: "text-cyan-200" },
63
- playing: { bg: "bg-neutral-100 dark:bg-neutral-800", border: "border-neutral-300 dark:border-neutral-600", text: "text-neutral-900 dark:text-neutral-100" },
64
- unknown: { bg: "bg-neutral-900/30", border: "border-neutral-500/50", text: "text-neutral-300" },
65
- };
66
- /** Suit color for standard cards */
67
- export function getSuitColor(enumKey) {
68
- if (enumKey.startsWith("H") || enumKey.startsWith("D"))
69
- return "text-red-500";
70
- return "text-neutral-900 dark:text-neutral-100";
71
- }