unite-lib 1.1.0 → 1.3.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 +27 -6
- package/dist/i18n/index.cjs +420 -4
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +30 -1
- package/dist/i18n/index.d.ts +30 -1
- package/dist/i18n/index.global.js +415 -4
- package/dist/i18n/index.global.js.map +1 -1
- package/dist/i18n/index.js +415 -4
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.cjs +2820 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -3
- package/dist/index.d.ts +52 -3
- package/dist/index.global.js +2808 -18
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +2806 -16
- package/dist/index.js.map +1 -1
- package/maps/map-groudon/map-groudon@1x.png +0 -0
- package/maps/map-groudon/map-groudon@2x.png +0 -0
- package/maps/map-groudon/map-groudon@4x.png +0 -0
- package/maps/map-kyogre/map-kyogre@1x.png +0 -0
- package/maps/map-kyogre/map-kyogre@2x.png +0 -0
- package/maps/map-kyogre/map-kyogre@4x.png +0 -0
- package/maps/map-rayquaza/map-rayquaza@1x.png +0 -0
- package/maps/map-rayquaza/map-rayquaza@2x.png +0 -0
- package/maps/map-rayquaza/map-rayquaza@4x.png +0 -0
- package/neutrals/accelgor.png +0 -0
- package/neutrals/altaria.png +0 -0
- package/neutrals/baltoy.png +0 -0
- package/neutrals/bunnelby.png +0 -0
- package/neutrals/escavalier.png +0 -0
- package/neutrals/groudon.png +0 -0
- package/neutrals/indeedee.png +0 -0
- package/neutrals/kyogre.png +0 -0
- package/neutrals/natu.png +0 -0
- package/neutrals/rayquaza.png +0 -0
- package/neutrals/regice.png +0 -0
- package/neutrals/regidrago.png +0 -0
- package/neutrals/regieleki.png +0 -0
- package/neutrals/regirock.png +0 -0
- package/neutrals/registeel.png +0 -0
- package/neutrals/salac.png +0 -0
- package/neutrals/sitrus.png +0 -0
- package/neutrals/xatu.png +0 -0
- package/package.json +3 -2
- package/maps/groudon.png +0 -0
package/README.md
CHANGED
|
@@ -47,18 +47,24 @@ const cdnImg = getImageUrl(pikachu, "main", {
|
|
|
47
47
|
### i18n (localized names)
|
|
48
48
|
|
|
49
49
|
```js
|
|
50
|
-
import { getPokemonName } from "unite-lib";
|
|
50
|
+
import { getPokemonName, getMapName, getMapDescription } from "unite-lib";
|
|
51
51
|
// or
|
|
52
|
-
import { getPokemonName } from "unite-lib/i18n";
|
|
52
|
+
import { getPokemonName, getMapName, getMapDescription } from "unite-lib/i18n";
|
|
53
53
|
|
|
54
|
+
// Pokémon names
|
|
54
55
|
getPokemonName("venusaur", "en"); // "Venusaur"
|
|
55
56
|
getPokemonName("venusaur", "pt-BR"); // "Venusaur"
|
|
56
57
|
getPokemonName("venusaur", "ja-JP"); // "フシギバナ"
|
|
57
58
|
getPokemonName("venusaur", "fr"); // "Florizarre"
|
|
58
59
|
getPokemonName("venusaur", "es"); // "Venusaur"
|
|
60
|
+
|
|
61
|
+
// Map names and descriptions (optional — use when you need localized UI)
|
|
62
|
+
getMapName("map-groudon", "en"); // "Theia Sky Ruins"
|
|
63
|
+
getMapName("map-groudon", "pt-BR"); // "Ruínas Celestes de Theia"
|
|
64
|
+
getMapDescription("map-groudon", "es"); // "Mapa 5v5 con Groudon."
|
|
59
65
|
```
|
|
60
66
|
|
|
61
|
-
Supported locales: `en`, `pt-BR`, `ja-JP`, `fr`, `es`.
|
|
67
|
+
Supported locales: `en`, `pt-BR`, `ja-JP`, `fr`, `es`. Each map in `maps` has a default `name` and `description` (English); use `getMapName(mapId, locale)` and `getMapDescription(mapId, locale)` when you want to show them in another language.
|
|
62
68
|
|
|
63
69
|
## Content
|
|
64
70
|
|
|
@@ -84,10 +90,14 @@ Move images (slot 1 and 2, variants 1 and 2) per Pokémon.
|
|
|
84
90
|
|
|
85
91
|
### Maps
|
|
86
92
|
|
|
87
|
-
Game map images (
|
|
93
|
+
Game map images (Theia Sky Ruins variants: Groudon, Kyogre, Rayquaza). Each map has multiple resolutions (1x, 2x, 4x); use `getMapImageUrl(map, resolution?, options?)` to pick one. Names and descriptions are available in all supported locales via `getMapName(mapId, locale)` and `getMapDescription(mapId, locale)` (see [i18n](#i18n-localized-names)).
|
|
88
94
|
|
|
89
95
|

|
|
90
96
|
|
|
97
|
+
### Neutrals and spawns
|
|
98
|
+
|
|
99
|
+
The library includes a **neutrals** catalog (wild Pokémon and items that spawn on maps) with images in `neutrals/`, and a unified **spawns** list in `src/spawns.ts` (same pattern as `pokemons.ts`) linking each spawn to a map and a neutral. Use `getSpawnsByMap(mapId)` to get all spawns for a map (e.g. `"map-groudon"`, `"map-kyogre"`, `"map-rayquaza"`), `getNeutralById(id)` to resolve the neutral (e.g. for its image), and `getNeutralImageUrl(neutral, options?)` for the image URL.
|
|
100
|
+
|
|
91
101
|
---
|
|
92
102
|
|
|
93
103
|
## Local development (testing without publishing to npm)
|
|
@@ -173,17 +183,27 @@ Asset URLs via jsDelivr (substitua `@latest` por uma versão se quiser):
|
|
|
173
183
|
|--------|-------------|
|
|
174
184
|
| `pokemons` | Full roster (name, dex, images, battleType, stats, tags, difficulty) |
|
|
175
185
|
| `moves` | Move list (pokemonId, slotId, name, image) |
|
|
176
|
-
| `maps` | Map list (id, name, image, description) |
|
|
186
|
+
| `maps` | Map list (id, name, image, images by resolution, description) |
|
|
187
|
+
| `neutrals` | Neutral catalog (id, image; wild Pokémon/items for spawns) |
|
|
188
|
+
| `spawns` | All map spawns (mapId, neutralId, left, top, spawnTime, respawnTime, etc.) |
|
|
177
189
|
| `BattleType` | `attacker`, `defender`, `allrounder`, `speedster`, `supporter` |
|
|
178
190
|
| `Tag` | Role + style: `attacker`, `defender`, `melee`, `ranged`, … |
|
|
179
191
|
| `getImageUrl(pokemon, key, options?)` | Image path or full URL with `baseUrl` |
|
|
192
|
+
| `getMapImageUrl(map, resolution?, options?)` | Map image URL (resolution: `"1"`, `"2"`, `"4"`) |
|
|
193
|
+
| `getNeutralImageUrl(neutral, options?)` | Neutral image path or full URL |
|
|
194
|
+
| `getSpawnsByMap(mapId)` | Spawns for a map (e.g. `"map-groudon"`) |
|
|
195
|
+
| `getNeutralById(id)` | Find neutral by id |
|
|
180
196
|
| `getPokemonByName(name)` | Find by display name |
|
|
181
197
|
| `getPokemonByDex(dex)` | Find by Pokédex number |
|
|
182
198
|
| `getPokemonBySlug(slug)` | Find by slug (e.g. `venusaur`) |
|
|
183
199
|
| `getPokemonsByBattleType(type)` | Filter by BattleType |
|
|
184
200
|
| `getPokemonsByTag(tag)` | Filter by Tag |
|
|
185
201
|
| `getActivePokemons()` | Only active roster entries |
|
|
186
|
-
| `getPokemonName(slug, locale)` | Localized name (from main package or `unite-lib/i18n`) |
|
|
202
|
+
| `getPokemonName(slug, locale)` | Localized Pokémon name (from main package or `unite-lib/i18n`) |
|
|
203
|
+
| `getMapName(mapId, locale)` | Localized map name |
|
|
204
|
+
| `getMapDescription(mapId, locale)` | Localized map description |
|
|
205
|
+
|
|
206
|
+
Types: `Neutral`, `MapSpawn` (see also `Map`, `MapResolution`, `Pokemon`, `Move`, etc.).
|
|
187
207
|
|
|
188
208
|
## Project structure
|
|
189
209
|
|
|
@@ -191,6 +211,7 @@ Asset URLs via jsDelivr (substitua `@latest` por uma versão se quiser):
|
|
|
191
211
|
- **`pokemons/`** — Roster and stat images
|
|
192
212
|
- **`moves/`** — Move images
|
|
193
213
|
- **`maps/`** — Map images
|
|
214
|
+
- **`neutrals/`** — Wild Pokémon and item images used in map spawns
|
|
194
215
|
- **`.cursor/skills/`** — [Cursor Agent Skills](https://docs.cursor.com/context/agent-skills) for use with AI agents in this repo (e.g. syncing roster from images in `pokemons/` and `moves/`).
|
|
195
216
|
- **`mcp/`** — [MCP server](mcp/README.md) (Model Context Protocol) para consumir a library em agentes de IA: tools para listar e buscar pokémons, moves, mapas, URLs de imagens e nomes localizados (Cursor, Claude Desktop, etc.).
|
|
196
217
|
|