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/dist/index.cjs CHANGED
@@ -24,6 +24,9 @@ __export(src_exports, {
24
24
  Tag: () => Tag,
25
25
  getActivePokemons: () => getActivePokemons,
26
26
  getImageUrl: () => getImageUrl,
27
+ getMapDescription: () => getMapDescription,
28
+ getMapImageUrl: () => getMapImageUrl,
29
+ getMapName: () => getMapName,
27
30
  getPokemonByDex: () => getPokemonByDex,
28
31
  getPokemonByName: () => getPokemonByName,
29
32
  getPokemonBySlug: () => getPokemonBySlug,
@@ -2431,22 +2434,37 @@ var moves_default = moves;
2431
2434
  // src/maps.ts
2432
2435
  var maps = [
2433
2436
  {
2434
- id: "remoat-stadium",
2435
- name: "Remoat Stadium",
2436
- image: "maps/remoat-stadium.png",
2437
- description: "Standard 5v5 map."
2437
+ id: "map-groudon",
2438
+ name: "Theia Sky Ruins",
2439
+ image: "maps/map-groudon/map-groudon@4x.png",
2440
+ images: {
2441
+ "1": "maps/map-groudon/map-groudon@1x.png",
2442
+ "2": "maps/map-groudon/map-groudon@2x.png",
2443
+ "4": "maps/map-groudon/map-groudon@4x.png"
2444
+ },
2445
+ description: "Map with Groudon."
2438
2446
  },
2439
2447
  {
2440
- id: "theia-sky-ruins",
2448
+ id: "map-kyogre",
2441
2449
  name: "Theia Sky Ruins",
2442
- image: "maps/theia-sky-ruins.png",
2443
- description: "5v5 map with Rayquaza."
2450
+ image: "maps/map-kyogre/map-kyogre@4x.png",
2451
+ images: {
2452
+ "1": "maps/map-kyogre/map-kyogre@1x.png",
2453
+ "2": "maps/map-kyogre/map-kyogre@2x.png",
2454
+ "4": "maps/map-kyogre/map-kyogre@4x.png"
2455
+ },
2456
+ description: "Map with Kyogre."
2444
2457
  },
2445
2458
  {
2446
- id: "mer-stadium",
2447
- name: "Mer Stadium",
2448
- image: "maps/mer-stadium.png",
2449
- description: "Quick battle map."
2459
+ id: "map-rayquaza",
2460
+ name: "Theia Sky Ruins",
2461
+ image: "maps/map-rayquaza/map-rayquaza@4x.png",
2462
+ images: {
2463
+ "1": "maps/map-rayquaza/map-rayquaza@1x.png",
2464
+ "2": "maps/map-rayquaza/map-rayquaza@2x.png",
2465
+ "4": "maps/map-rayquaza/map-rayquaza@4x.png"
2466
+ },
2467
+ description: "Map with Rayquaza."
2450
2468
  }
2451
2469
  ];
2452
2470
  var maps_default = maps;
@@ -2458,6 +2476,12 @@ function getImageUrl(pokemon, imageKey, options) {
2458
2476
  const base = options?.baseUrl?.replace(/\/$/, "");
2459
2477
  return base ? `${base}/${path}` : path;
2460
2478
  }
2479
+ function getMapImageUrl(map, resolution, options) {
2480
+ const path = resolution && map.images?.[resolution] != null ? map.images[resolution] : map.image;
2481
+ if (path == null || path === "") return "";
2482
+ const base = options?.baseUrl?.replace(/\/$/, "");
2483
+ return base ? `${base}/${path}` : path;
2484
+ }
2461
2485
  function getPokemonByName(name) {
2462
2486
  return pokemons_default.find((p) => p.name === name);
2463
2487
  }
@@ -2488,10 +2512,23 @@ var names = {};
2488
2512
  for (const p of pokemons_default) {
2489
2513
  names[slugFromMain(p.images.main)] = p.name;
2490
2514
  }
2515
+ for (const m of maps_default) {
2516
+ names[m.id] = m.name;
2517
+ if (m.description) names[`${m.id}.description`] = m.description;
2518
+ }
2491
2519
  var en_default = names;
2492
2520
 
2493
2521
  // src/i18n/pt-BR.ts
2494
- var ptBR = { ...en_default };
2522
+ var ptBR = {
2523
+ ...en_default,
2524
+ // Maps — names and descriptions
2525
+ "map-groudon": "Ru\xEDnas Celestes de Theia",
2526
+ "map-groudon.description": "Mapa 5v5 com Groudon.",
2527
+ "map-kyogre": "Ru\xEDnas Celestes de Theia",
2528
+ "map-kyogre.description": "Mapa 5v5 com Kyogre.",
2529
+ "map-rayquaza": "Ru\xEDnas Celestes de Theia",
2530
+ "map-rayquaza.description": "Mapa 5v5 com Rayquaza."
2531
+ };
2495
2532
  var pt_BR_default = ptBR;
2496
2533
 
2497
2534
  // src/i18n/ja-JP.ts
@@ -2582,7 +2619,14 @@ var jaJP = {
2582
2619
  armarouge: "\u30B0\u30EC\u30F3\u30A2\u30EB\u30DE",
2583
2620
  ceruledge: "\u30BD\u30A6\u30D6\u30EC\u30A4\u30BA",
2584
2621
  tinkaton: "\u30C7\u30AB\u30CC\u30C1\u30E3\u30F3",
2585
- miraidon: "\u30DF\u30E9\u30A4\u30C9\u30F3"
2622
+ miraidon: "\u30DF\u30E9\u30A4\u30C9\u30F3",
2623
+ // Maps — names and descriptions
2624
+ "map-groudon": "\u30C6\u30A4\u30A2\u306E\u5929\u7A7A\u907A\u8DE1",
2625
+ "map-groudon.description": "\u30B0\u30E9\u30FC\u30C9\u30F3\u304C\u767B\u5834\u3059\u308B5v5\u30DE\u30C3\u30D7\u3002",
2626
+ "map-kyogre": "\u30C6\u30A4\u30A2\u306E\u5929\u7A7A\u907A\u8DE1",
2627
+ "map-kyogre.description": "\u30AB\u30A4\u30AA\u30FC\u30AC\u304C\u767B\u5834\u3059\u308B5v5\u30DE\u30C3\u30D7\u3002",
2628
+ "map-rayquaza": "\u30C6\u30A4\u30A2\u306E\u5929\u7A7A\u907A\u8DE1",
2629
+ "map-rayquaza.description": "\u30EC\u30C3\u30AF\u30A6\u30B6\u304C\u767B\u5834\u3059\u308B5v5\u30DE\u30C3\u30D7\u3002"
2586
2630
  };
2587
2631
  var ja_JP_default = jaJP;
2588
2632
 
@@ -2674,7 +2718,14 @@ var fr = {
2674
2718
  armarouge: "Carmadura",
2675
2719
  ceruledge: "Malvalame",
2676
2720
  tinkaton: "Forgerette",
2677
- miraidon: "Miraidon"
2721
+ miraidon: "Miraidon",
2722
+ // Maps — names and descriptions
2723
+ "map-groudon": "Ruines C\xE9lestes de Theia",
2724
+ "map-groudon.description": "Carte 5v5 avec Groudon.",
2725
+ "map-kyogre": "Ruines C\xE9lestes de Theia",
2726
+ "map-kyogre.description": "Carte 5v5 avec Kyogre.",
2727
+ "map-rayquaza": "Ruines C\xE9lestes de Theia",
2728
+ "map-rayquaza.description": "Carte 5v5 avec Rayquaza."
2678
2729
  };
2679
2730
  var fr_default = fr;
2680
2731
 
@@ -2766,7 +2817,14 @@ var es = {
2766
2817
  armarouge: "Armarouge",
2767
2818
  ceruledge: "Ceruledge",
2768
2819
  tinkaton: "Tinkaton",
2769
- miraidon: "Miraidon"
2820
+ miraidon: "Miraidon",
2821
+ // Maps — names and descriptions
2822
+ "map-groudon": "Ruinas Celestiales de Theia",
2823
+ "map-groudon.description": "Mapa 5v5 con Groudon.",
2824
+ "map-kyogre": "Ruinas Celestiales de Theia",
2825
+ "map-kyogre.description": "Mapa 5v5 con Kyogre.",
2826
+ "map-rayquaza": "Ruinas Celestiales de Theia",
2827
+ "map-rayquaza.description": "Mapa 5v5 con Rayquaza."
2770
2828
  };
2771
2829
  var es_default = es;
2772
2830
 
@@ -2782,12 +2840,24 @@ function getPokemonName(id, locale = "en") {
2782
2840
  const map = locales[locale] ?? en_default;
2783
2841
  return map[id] ?? en_default[id] ?? id;
2784
2842
  }
2843
+ function getMapName(mapId, locale = "en") {
2844
+ const map = locales[locale] ?? en_default;
2845
+ return map[mapId] ?? en_default[mapId] ?? mapId;
2846
+ }
2847
+ function getMapDescription(mapId, locale = "en") {
2848
+ const key = `${mapId}.description`;
2849
+ const map = locales[locale] ?? en_default;
2850
+ return map[key] ?? en_default[key] ?? "";
2851
+ }
2785
2852
  // Annotate the CommonJS export names for ESM import in node:
2786
2853
  0 && (module.exports = {
2787
2854
  BattleType,
2788
2855
  Tag,
2789
2856
  getActivePokemons,
2790
2857
  getImageUrl,
2858
+ getMapDescription,
2859
+ getMapImageUrl,
2860
+ getMapName,
2791
2861
  getPokemonByDex,
2792
2862
  getPokemonByName,
2793
2863
  getPokemonBySlug,