svelte-incant 0.7.0 → 0.7.1

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.
@@ -94,7 +94,6 @@
94
94
  };
95
95
  } = $props();
96
96
 
97
- let open = $derived(paletteState.open);
98
97
  let tooltip_open = $state(false);
99
98
 
100
99
  const pressed_keys = new PressedKeys();
@@ -144,7 +143,7 @@
144
143
  });
145
144
  </script>
146
145
 
147
- <Shortcut keys={[['?'], ['/']]} description={texts.shortcutDescription} action={togglePalette} />
146
+ <Shortcut keys={[['?']]} description={texts.shortcutDescription} action={togglePalette} />
148
147
 
149
148
  <Tooltip.Provider delayDuration={0}>
150
149
  <!-- <Tooltip.Root bind:open={tooltip_open}> -->
@@ -163,7 +162,7 @@
163
162
  </Tooltip.Root>
164
163
  </Tooltip.Provider>
165
164
 
166
- <Dialog.Root bind:open>
165
+ <Dialog.Root bind:open={paletteState.open}>
167
166
  <Dialog.Content portalProps={{ disabled: true }}>
168
167
  <Dialog.Header>
169
168
  <Dialog.Title>{texts.dialogTitle}</Dialog.Title>
@@ -49,11 +49,16 @@ class ShortcutRegistry {
49
49
  }
50
50
  }
51
51
  startListening() {
52
- if (this.isListening)
52
+ if (this.isListening) {
53
+ console.warn('Keyboard listeners already started');
53
54
  return;
55
+ }
54
56
  this.isListening = true;
55
57
  $effect(() => {
56
58
  this.syncKeyboardListeners();
59
+ return () => {
60
+ this.isListening = false;
61
+ };
57
62
  });
58
63
  }
59
64
  normalizeKeys(keys) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-incant",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "url": "https://github.com/mastermakrela/svelte-incant"