@pkhex-everywhere/react 0.5.0 → 0.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @pkhex-everywhere/react
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Patch Changes
6
+
7
+ - de5202d: New `game.enableFormat(id)` turns on a save format the host registered off. Until then, `game.formats()` leaves it out, `game.load()` with its id fails with `not-found`, and a save it recognizes fails with `invalid-save`.
8
+ - Updated dependencies [de5202d]
9
+ - Updated dependencies [344875d]
10
+ - Updated dependencies [4118f50]
11
+ - Updated dependencies [5cd1cac]
12
+ - Updated dependencies [e850702]
13
+ - Updated dependencies [3bbcace]
14
+ - Updated dependencies [4888600]
15
+ - Updated dependencies [fda0ba5]
16
+ - Updated dependencies [563b057]
17
+ - @pkhex-everywhere/engine@0.7.0
18
+
19
+ ## 0.6.0
20
+
21
+ ### Minor Changes
22
+
23
+ - bf74352: Unknown items, such as a ROM hack's own items, now have ids of their own. `OwnedItem` gets `isUnknown`, and `inventory.setItem` can change the count of an unknown item or remove it in its pouch. `pokemon.options()` returns `heldItems`, typed as the new `ItemChoice` with `isUnknown`, which lists the unknown item only for the Pokémon already holding it. `EditablePokemon.unknownHeldItem` is replaced by `heldItemIsUnknown`, and setting `heldItem` to 0 now removes an unknown held item.
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [9781875]
28
+ - Updated dependencies [bf74352]
29
+ - Updated dependencies [a9062a7]
30
+ - Updated dependencies [52d8956]
31
+ - @pkhex-everywhere/engine@0.6.0
32
+
3
33
  ## 0.5.0
4
34
 
5
35
  ### Patch Changes
@@ -19,6 +19,12 @@ export declare function useEvents(): {
19
19
  };
20
20
  export declare function useLoadedGame(): {
21
21
  close: () => Promise<void>;
22
+ /**
23
+ * Turns on a save format that's registered off, such as a ROM hack that hasn't been validated yet. Until then, `game.formats()` leaves it out and a save it recognizes fails with `invalid-save`.
24
+ *
25
+ * @param id The format's id. An unknown id fails with `not-found`.
26
+ */
27
+ enableFormat: (id: string) => Promise<void>;
22
28
  /** Requires a loaded save; throws `no-save` otherwise. Wrap in `<RequireGame>`. */
23
29
  export: () => Promise<import("@pkhex-everywhere/engine").ExportedSave>;
24
30
  file: () => Promise<import("@pkhex-everywhere/engine").LoadedSave | null>;
package/dist/index.js CHANGED
@@ -162,6 +162,12 @@ function useLoadedGame() {
162
162
  game: useQuery("game.get"),
163
163
  ...useMemo(() => ({
164
164
  close: () => engine.game.close(),
165
+ /**
166
+ * Turns on a save format that's registered off, such as a ROM hack that hasn't been validated yet. Until then, `game.formats()` leaves it out and a save it recognizes fails with `invalid-save`.
167
+ *
168
+ * @param id The format's id. An unknown id fails with `not-found`.
169
+ */
170
+ enableFormat: (id) => engine.game.enableFormat(id),
165
171
  /** Requires a loaded save; throws `no-save` otherwise. Wrap in `<RequireGame>`. */
166
172
  export: () => engine.game.export(),
167
173
  file: () => engine.game.file(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pkhex-everywhere/react",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "React hooks for @pkhex-everywhere/engine.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "homepage": "https://docs.pkhex-everywhere.fyi/docs/",
@@ -30,7 +30,7 @@
30
30
  "test": "vitest run"
31
31
  },
32
32
  "peerDependencies": {
33
- "@pkhex-everywhere/engine": "^0.5.0",
33
+ "@pkhex-everywhere/engine": "^0.7.0",
34
34
  "react": "^19.0.0"
35
35
  },
36
36
  "devDependencies": {