unite-lib 1.1.0 → 1.2.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 +15 -6
- package/dist/i18n/index.cjs +89 -4
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +11 -1
- package/dist/i18n/index.d.ts +11 -1
- package/dist/i18n/index.global.js +87 -4
- package/dist/i18n/index.global.js.map +1 -1
- package/dist/i18n/index.js +87 -4
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.cjs +85 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.global.js +82 -15
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +82 -15
- 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/package.json +1 -1
- package/maps/groudon.png +0 -0
package/dist/index.js
CHANGED
|
@@ -2393,22 +2393,37 @@ var moves_default = moves;
|
|
|
2393
2393
|
// src/maps.ts
|
|
2394
2394
|
var maps = [
|
|
2395
2395
|
{
|
|
2396
|
-
id: "
|
|
2397
|
-
name: "
|
|
2398
|
-
image: "maps/
|
|
2399
|
-
|
|
2396
|
+
id: "map-groudon",
|
|
2397
|
+
name: "Theia Sky Ruins",
|
|
2398
|
+
image: "maps/map-groudon/map-groudon@4x.png",
|
|
2399
|
+
images: {
|
|
2400
|
+
"1": "maps/map-groudon/map-groudon@1x.png",
|
|
2401
|
+
"2": "maps/map-groudon/map-groudon@2x.png",
|
|
2402
|
+
"4": "maps/map-groudon/map-groudon@4x.png"
|
|
2403
|
+
},
|
|
2404
|
+
description: "Map with Groudon."
|
|
2400
2405
|
},
|
|
2401
2406
|
{
|
|
2402
|
-
id: "
|
|
2407
|
+
id: "map-kyogre",
|
|
2403
2408
|
name: "Theia Sky Ruins",
|
|
2404
|
-
image: "maps/
|
|
2405
|
-
|
|
2409
|
+
image: "maps/map-kyogre/map-kyogre@4x.png",
|
|
2410
|
+
images: {
|
|
2411
|
+
"1": "maps/map-kyogre/map-kyogre@1x.png",
|
|
2412
|
+
"2": "maps/map-kyogre/map-kyogre@2x.png",
|
|
2413
|
+
"4": "maps/map-kyogre/map-kyogre@4x.png"
|
|
2414
|
+
},
|
|
2415
|
+
description: "Map with Kyogre."
|
|
2406
2416
|
},
|
|
2407
2417
|
{
|
|
2408
|
-
id: "
|
|
2409
|
-
name: "
|
|
2410
|
-
image: "maps/
|
|
2411
|
-
|
|
2418
|
+
id: "map-rayquaza",
|
|
2419
|
+
name: "Theia Sky Ruins",
|
|
2420
|
+
image: "maps/map-rayquaza/map-rayquaza@4x.png",
|
|
2421
|
+
images: {
|
|
2422
|
+
"1": "maps/map-rayquaza/map-rayquaza@1x.png",
|
|
2423
|
+
"2": "maps/map-rayquaza/map-rayquaza@2x.png",
|
|
2424
|
+
"4": "maps/map-rayquaza/map-rayquaza@4x.png"
|
|
2425
|
+
},
|
|
2426
|
+
description: "Map with Rayquaza."
|
|
2412
2427
|
}
|
|
2413
2428
|
];
|
|
2414
2429
|
var maps_default = maps;
|
|
@@ -2420,6 +2435,12 @@ function getImageUrl(pokemon, imageKey, options) {
|
|
|
2420
2435
|
const base = options?.baseUrl?.replace(/\/$/, "");
|
|
2421
2436
|
return base ? `${base}/${path}` : path;
|
|
2422
2437
|
}
|
|
2438
|
+
function getMapImageUrl(map, resolution, options) {
|
|
2439
|
+
const path = resolution && map.images?.[resolution] != null ? map.images[resolution] : map.image;
|
|
2440
|
+
if (path == null || path === "") return "";
|
|
2441
|
+
const base = options?.baseUrl?.replace(/\/$/, "");
|
|
2442
|
+
return base ? `${base}/${path}` : path;
|
|
2443
|
+
}
|
|
2423
2444
|
function getPokemonByName(name) {
|
|
2424
2445
|
return pokemons_default.find((p) => p.name === name);
|
|
2425
2446
|
}
|
|
@@ -2450,10 +2471,23 @@ var names = {};
|
|
|
2450
2471
|
for (const p of pokemons_default) {
|
|
2451
2472
|
names[slugFromMain(p.images.main)] = p.name;
|
|
2452
2473
|
}
|
|
2474
|
+
for (const m of maps_default) {
|
|
2475
|
+
names[m.id] = m.name;
|
|
2476
|
+
if (m.description) names[`${m.id}.description`] = m.description;
|
|
2477
|
+
}
|
|
2453
2478
|
var en_default = names;
|
|
2454
2479
|
|
|
2455
2480
|
// src/i18n/pt-BR.ts
|
|
2456
|
-
var ptBR = {
|
|
2481
|
+
var ptBR = {
|
|
2482
|
+
...en_default,
|
|
2483
|
+
// Maps — names and descriptions
|
|
2484
|
+
"map-groudon": "Ru\xEDnas Celestes de Theia",
|
|
2485
|
+
"map-groudon.description": "Mapa 5v5 com Groudon.",
|
|
2486
|
+
"map-kyogre": "Ru\xEDnas Celestes de Theia",
|
|
2487
|
+
"map-kyogre.description": "Mapa 5v5 com Kyogre.",
|
|
2488
|
+
"map-rayquaza": "Ru\xEDnas Celestes de Theia",
|
|
2489
|
+
"map-rayquaza.description": "Mapa 5v5 com Rayquaza."
|
|
2490
|
+
};
|
|
2457
2491
|
var pt_BR_default = ptBR;
|
|
2458
2492
|
|
|
2459
2493
|
// src/i18n/ja-JP.ts
|
|
@@ -2544,7 +2578,14 @@ var jaJP = {
|
|
|
2544
2578
|
armarouge: "\u30B0\u30EC\u30F3\u30A2\u30EB\u30DE",
|
|
2545
2579
|
ceruledge: "\u30BD\u30A6\u30D6\u30EC\u30A4\u30BA",
|
|
2546
2580
|
tinkaton: "\u30C7\u30AB\u30CC\u30C1\u30E3\u30F3",
|
|
2547
|
-
miraidon: "\u30DF\u30E9\u30A4\u30C9\u30F3"
|
|
2581
|
+
miraidon: "\u30DF\u30E9\u30A4\u30C9\u30F3",
|
|
2582
|
+
// Maps — names and descriptions
|
|
2583
|
+
"map-groudon": "\u30C6\u30A4\u30A2\u306E\u5929\u7A7A\u907A\u8DE1",
|
|
2584
|
+
"map-groudon.description": "\u30B0\u30E9\u30FC\u30C9\u30F3\u304C\u767B\u5834\u3059\u308B5v5\u30DE\u30C3\u30D7\u3002",
|
|
2585
|
+
"map-kyogre": "\u30C6\u30A4\u30A2\u306E\u5929\u7A7A\u907A\u8DE1",
|
|
2586
|
+
"map-kyogre.description": "\u30AB\u30A4\u30AA\u30FC\u30AC\u304C\u767B\u5834\u3059\u308B5v5\u30DE\u30C3\u30D7\u3002",
|
|
2587
|
+
"map-rayquaza": "\u30C6\u30A4\u30A2\u306E\u5929\u7A7A\u907A\u8DE1",
|
|
2588
|
+
"map-rayquaza.description": "\u30EC\u30C3\u30AF\u30A6\u30B6\u304C\u767B\u5834\u3059\u308B5v5\u30DE\u30C3\u30D7\u3002"
|
|
2548
2589
|
};
|
|
2549
2590
|
var ja_JP_default = jaJP;
|
|
2550
2591
|
|
|
@@ -2636,7 +2677,14 @@ var fr = {
|
|
|
2636
2677
|
armarouge: "Carmadura",
|
|
2637
2678
|
ceruledge: "Malvalame",
|
|
2638
2679
|
tinkaton: "Forgerette",
|
|
2639
|
-
miraidon: "Miraidon"
|
|
2680
|
+
miraidon: "Miraidon",
|
|
2681
|
+
// Maps — names and descriptions
|
|
2682
|
+
"map-groudon": "Ruines C\xE9lestes de Theia",
|
|
2683
|
+
"map-groudon.description": "Carte 5v5 avec Groudon.",
|
|
2684
|
+
"map-kyogre": "Ruines C\xE9lestes de Theia",
|
|
2685
|
+
"map-kyogre.description": "Carte 5v5 avec Kyogre.",
|
|
2686
|
+
"map-rayquaza": "Ruines C\xE9lestes de Theia",
|
|
2687
|
+
"map-rayquaza.description": "Carte 5v5 avec Rayquaza."
|
|
2640
2688
|
};
|
|
2641
2689
|
var fr_default = fr;
|
|
2642
2690
|
|
|
@@ -2728,7 +2776,14 @@ var es = {
|
|
|
2728
2776
|
armarouge: "Armarouge",
|
|
2729
2777
|
ceruledge: "Ceruledge",
|
|
2730
2778
|
tinkaton: "Tinkaton",
|
|
2731
|
-
miraidon: "Miraidon"
|
|
2779
|
+
miraidon: "Miraidon",
|
|
2780
|
+
// Maps — names and descriptions
|
|
2781
|
+
"map-groudon": "Ruinas Celestiales de Theia",
|
|
2782
|
+
"map-groudon.description": "Mapa 5v5 con Groudon.",
|
|
2783
|
+
"map-kyogre": "Ruinas Celestiales de Theia",
|
|
2784
|
+
"map-kyogre.description": "Mapa 5v5 con Kyogre.",
|
|
2785
|
+
"map-rayquaza": "Ruinas Celestiales de Theia",
|
|
2786
|
+
"map-rayquaza.description": "Mapa 5v5 con Rayquaza."
|
|
2732
2787
|
};
|
|
2733
2788
|
var es_default = es;
|
|
2734
2789
|
|
|
@@ -2744,11 +2799,23 @@ function getPokemonName(id, locale = "en") {
|
|
|
2744
2799
|
const map = locales[locale] ?? en_default;
|
|
2745
2800
|
return map[id] ?? en_default[id] ?? id;
|
|
2746
2801
|
}
|
|
2802
|
+
function getMapName(mapId, locale = "en") {
|
|
2803
|
+
const map = locales[locale] ?? en_default;
|
|
2804
|
+
return map[mapId] ?? en_default[mapId] ?? mapId;
|
|
2805
|
+
}
|
|
2806
|
+
function getMapDescription(mapId, locale = "en") {
|
|
2807
|
+
const key = `${mapId}.description`;
|
|
2808
|
+
const map = locales[locale] ?? en_default;
|
|
2809
|
+
return map[key] ?? en_default[key] ?? "";
|
|
2810
|
+
}
|
|
2747
2811
|
export {
|
|
2748
2812
|
BattleType,
|
|
2749
2813
|
Tag,
|
|
2750
2814
|
getActivePokemons,
|
|
2751
2815
|
getImageUrl,
|
|
2816
|
+
getMapDescription,
|
|
2817
|
+
getMapImageUrl,
|
|
2818
|
+
getMapName,
|
|
2752
2819
|
getPokemonByDex,
|
|
2753
2820
|
getPokemonByName,
|
|
2754
2821
|
getPokemonBySlug,
|