@tanstack/svelte-hotkeys 0.25.5 → 0.25.6

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.
@@ -1,5 +1,5 @@
1
1
  import { HotkeyRecorder } from '@tanstack/hotkeys';
2
- import { withDefaults } from '@tanstack/hotkeys/adapter';
2
+ import { syncRecorderOptions, withDefaults } from '@tanstack/hotkeys/adapter';
3
3
  import { getDefaultHotkeysOptions } from './HotkeysCtx.js';
4
4
  import { createStoreSubscriber, resolveMaybeGetter } from './internal.svelte.js';
5
5
  class SvelteHotkeyRecorderState {
@@ -7,6 +7,9 @@ class SvelteHotkeyRecorderState {
7
7
  #subscribe;
8
8
  constructor(options) {
9
9
  this.#recorder = new HotkeyRecorder(options);
10
+ // Records the starting keys, so an option dropped before the first effect
11
+ // stops applying
12
+ syncRecorderOptions(this.#recorder, options);
10
13
  this.#subscribe = createStoreSubscriber(this.#recorder.store);
11
14
  }
12
15
  get isRecording() {
@@ -22,7 +25,7 @@ class SvelteHotkeyRecorderState {
22
25
  return this.#recorder.store.state.recordedHotkey;
23
26
  }
24
27
  setOptions(options) {
25
- this.#recorder.setOptions(options);
28
+ syncRecorderOptions(this.#recorder, options);
26
29
  }
27
30
  // Arrow functions keep the receiver when used directly as event handlers.
28
31
  startRecording = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/svelte-hotkeys",
3
- "version": "0.25.5",
3
+ "version": "0.25.6",
4
4
  "description": "Svelte adapter for TanStack Hotkeys",
5
5
  "author": "Kunal Rao",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "skills"
42
42
  ],
43
43
  "dependencies": {
44
- "@tanstack/hotkeys": "0.35.0"
44
+ "@tanstack/hotkeys": "0.36.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@sveltejs/package": "^3.0.2",