kira-arts 1.4.2 → 1.6.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/README.md CHANGED
@@ -24,13 +24,15 @@ A TypeScript library for generating Discord-style visual cards — profiles, wel
24
24
 
25
25
  ## ✨ Features
26
26
 
27
- - 🖼️ Profile, Welcome/Leave, Level Up, Achievement, Leaderboard, Ship (compatibility), Now Playing, and Giveaway cards
27
+ - 🖼️ Profile, Welcome/Leave, Level Up, Achievement, Leaderboard, Ship (compatibility), Now Playing, Giveaway, Birthday, Marriage, Weekly Recap, and Code Snippet cards
28
28
  - 🎵 Now Playing card ships with adapters for moonlink.js, Lavalink-based clients (erela.js, Shoukaku, Kazagumo, Riffy, Magmastream, lavalink-client), discord-player, and distube
29
+ - 💻 Code Snippet card renders syntax-highlighted code screenshots (JavaScript, TypeScript, Python, Java, C#, JSON, Bash, plaintext) in 6 built-in editor themes, without needing a Discord user ID
29
30
  - 🎨 8 built-in themes (`discord`, `midnight`, `sunset`, `neon`, `forest`, `sakura`, `monochrome`, `gold`), Nitro/role-color aware borders, and up to 4-color custom gradients
30
31
  - 🧾 Output as `png`, `jpeg`, or `webp`, ready to use as a discord.js `AttachmentBuilder` via `toAttachment()`
31
32
  - ⚡ Built-in, configurable in-memory cache for fetched user data (`setCacheOptions`, `clearCache`, `getCacheSize`)
32
33
  - 🛡️ Typed error handling with `KiraError` and `KiraErrorCode`, instead of opaque runtime failures
33
34
  - 📦 Dual package: ESM and CommonJS builds, both with full type declarations, no extra config needed
35
+ - 📐 Selectable `size` (`compact`, `standard`, `wide`) for Level Up cards, rendered as vectors so every size stays sharp
34
36
 
35
37
  ## 📦 Installation
36
38
 
@@ -81,17 +83,21 @@ Every other card, the music adapters, theming, caching, error handling, and outp
81
83
 
82
84
  ## 🃏 Cards at a glance
83
85
 
84
- | Card | Function | What it's for |
85
- | ----------- | --------------------------------------------- | ------------------------------------------- |
86
- | Profile | `profileImage(userId, options)` | Avatar, badges, nameplate, server tag, rank |
87
- | Welcome | `welcomeImage(userId, guildName, options)` | Member join events |
88
- | Leave | `leaveImage(userId, guildName, options)` | Member leave events |
89
- | Level Up | `levelUpImage(userId, level, options)` | XP progress bar on level-up |
90
- | Achievement | `achievementImage(userId, title, options)` | Unlockable achievements with rarity tiers |
91
- | Leaderboard | `leaderboardImage(entries, options)` | Server ranking table |
92
- | Ship | `shipImage(leftUserId, rightUserId, options)` | Compatibility between two users |
93
- | Now Playing | `nowPlayingImage(track, options)` | Music player card with source detection |
94
- | Giveaway | `giveawayImage(prize, options)` | Prize, host, entry count, winners on end |
86
+ | Card | Function | What it's for |
87
+ | ------------ | ------------------------------------------------- | ----------------------------------------------------------- |
88
+ | Profile | `profileImage(userId, options)` | Avatar, badges, nameplate, server tag, rank |
89
+ | Welcome | `welcomeImage(userId, guildName, options)` | Member join events |
90
+ | Leave | `leaveImage(userId, guildName, options)` | Member leave events |
91
+ | Level Up | `levelUpImage(userId, level, options)` | XP progress bar on level-up, in compact/standard/wide sizes |
92
+ | Achievement | `achievementImage(userId, title, options)` | Unlockable achievements with rarity tiers |
93
+ | Leaderboard | `leaderboardImage(entries, options)` | Server ranking table |
94
+ | Ship | `shipImage(leftUserId, rightUserId, options)` | Compatibility between two users |
95
+ | Now Playing | `nowPlayingImage(track, options)` | Music player card with source detection |
96
+ | Giveaway | `giveawayImage(prize, options)` | Prize, host, entry count, winners on end |
97
+ | Birthday | `birthdayImage(userId, options)` | Balloons, confetti, and an optional age/years counter |
98
+ | Marriage | `marriageImage(leftUserId, rightUserId, options)` | Certificate-style card with automatic days-together count |
99
+ | Weekly Recap | `weeklyRecapImage(userId, options)` | Wrapped-style weekly summary with a 7-day activity chart |
100
+ | Code Snippet | `codeSnippetImage(code, options)` | Carbon-style syntax-highlighted code screenshot |
95
101
 
96
102
  ## 🛠️ Utilities
97
103
 
@@ -105,7 +111,7 @@ Every other card, the music adapters, theming, caching, error handling, and outp
105
111
  | `clearCache()` | Clears the internal user-data cache |
106
112
  | `getCacheSize()` | Returns the number of entries currently cached |
107
113
  | `computeCompatibility(leftUserId, rightUserId)` | Deterministic compatibility percentage for the Ship card |
108
- | `pickShipMessage(percentage)` | Flavor text matching a compatibility percentage |
114
+ | `pickShipMessage(leftId, rightId, percentage)` | Flavor text matching a compatibility percentage |
109
115
  | `getThemePalette(theme)` | Resolves a `KiraThemeName` to its full color palette |
110
116
  | `fromMoonlinkTrack(track)` | Adapter: moonlink.js track → `NowPlayingTrack` |
111
117
  | `fromLavalinkTrack(track)` | Adapter: Lavalink-based clients → `NowPlayingTrack` |
@@ -18,7 +18,7 @@ with others.
18
18
 
19
19
  The OFL allows the licensed fonts to be used, studied, modified and
20
20
  redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
21
+ fonts, including any derivative works, can be bundled, embedded,
22
22
  redistributed and/or sold with any software provided that any reserved
23
23
  names are not used by derivative works. The fonts and derivatives,
24
24
  however, cannot be released under any other type of license. The
@@ -18,7 +18,7 @@ with others.
18
18
 
19
19
  The OFL allows the licensed fonts to be used, studied, modified and
20
20
  redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
21
+ fonts, including any derivative works, can be bundled, embedded,
22
22
  redistributed and/or sold with any software provided that any reserved
23
23
  names are not used by derivative works. The fonts and derivatives,
24
24
  however, cannot be released under any other type of license. The
@@ -18,7 +18,7 @@ with others.
18
18
 
19
19
  The OFL allows the licensed fonts to be used, studied, modified and
20
20
  redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
21
+ fonts, including any derivative works, can be bundled, embedded,
22
22
  redistributed and/or sold with any software provided that any reserved
23
23
  names are not used by derivative works. The fonts and derivatives,
24
24
  however, cannot be released under any other type of license. The
@@ -90,4 +90,4 @@ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
90
  INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
91
  DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
92
  FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
- OTHER DEALINGS IN THE FONT SOFTWARE.
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -18,7 +18,7 @@ with others.
18
18
 
19
19
  The OFL allows the licensed fonts to be used, studied, modified and
20
20
  redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
21
+ fonts, including any derivative works, can be bundled, embedded,
22
22
  redistributed and/or sold with any software provided that any reserved
23
23
  names are not used by derivative works. The fonts and derivatives,
24
24
  however, cannot be released under any other type of license. The