@pyreon/hotkeys 0.24.6 → 0.25.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.
@@ -5386,7 +5386,7 @@ var drawChart = (function (exports) {
5386
5386
  </script>
5387
5387
  <script>
5388
5388
  /*<!--*/
5389
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"fb969f01-1","name":"parse.ts"},{"uid":"fb969f01-3","name":"registry.ts"},{"uid":"fb969f01-5","name":"use-hotkey.ts"},{"uid":"fb969f01-7","name":"use-hotkey-scope.ts"},{"uid":"fb969f01-9","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"fb969f01-1":{"renderedLength":1941,"gzipLength":838,"brotliLength":0,"metaUid":"fb969f01-0"},"fb969f01-3":{"renderedLength":3276,"gzipLength":1146,"brotliLength":0,"metaUid":"fb969f01-2"},"fb969f01-5":{"renderedLength":496,"gzipLength":295,"brotliLength":0,"metaUid":"fb969f01-4"},"fb969f01-7":{"renderedLength":421,"gzipLength":264,"brotliLength":0,"metaUid":"fb969f01-6"},"fb969f01-9":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"fb969f01-8"}},"nodeMetas":{"fb969f01-0":{"id":"/src/parse.ts","moduleParts":{"index.js":"fb969f01-1"},"imported":[],"importedBy":[{"uid":"fb969f01-8"},{"uid":"fb969f01-2"}]},"fb969f01-2":{"id":"/src/registry.ts","moduleParts":{"index.js":"fb969f01-3"},"imported":[{"uid":"fb969f01-11"},{"uid":"fb969f01-0"}],"importedBy":[{"uid":"fb969f01-8"},{"uid":"fb969f01-4"},{"uid":"fb969f01-6"}]},"fb969f01-4":{"id":"/src/use-hotkey.ts","moduleParts":{"index.js":"fb969f01-5"},"imported":[{"uid":"fb969f01-10"},{"uid":"fb969f01-2"}],"importedBy":[{"uid":"fb969f01-8"}]},"fb969f01-6":{"id":"/src/use-hotkey-scope.ts","moduleParts":{"index.js":"fb969f01-7"},"imported":[{"uid":"fb969f01-10"},{"uid":"fb969f01-2"}],"importedBy":[{"uid":"fb969f01-8"}]},"fb969f01-8":{"id":"/src/index.ts","moduleParts":{"index.js":"fb969f01-9"},"imported":[{"uid":"fb969f01-4"},{"uid":"fb969f01-6"},{"uid":"fb969f01-2"},{"uid":"fb969f01-0"}],"importedBy":[],"isEntry":true},"fb969f01-10":{"id":"@pyreon/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"fb969f01-4"},{"uid":"fb969f01-6"}]},"fb969f01-11":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"fb969f01-2"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
5389
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"bbd8b690-1","name":"parse.ts"},{"uid":"bbd8b690-3","name":"registry.ts"},{"uid":"bbd8b690-5","name":"use-hotkey.ts"},{"uid":"bbd8b690-7","name":"use-hotkey-scope.ts"},{"uid":"bbd8b690-9","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"bbd8b690-1":{"renderedLength":1941,"gzipLength":838,"brotliLength":0,"metaUid":"bbd8b690-0"},"bbd8b690-3":{"renderedLength":3276,"gzipLength":1146,"brotliLength":0,"metaUid":"bbd8b690-2"},"bbd8b690-5":{"renderedLength":496,"gzipLength":295,"brotliLength":0,"metaUid":"bbd8b690-4"},"bbd8b690-7":{"renderedLength":421,"gzipLength":264,"brotliLength":0,"metaUid":"bbd8b690-6"},"bbd8b690-9":{"renderedLength":774,"gzipLength":462,"brotliLength":0,"metaUid":"bbd8b690-8"}},"nodeMetas":{"bbd8b690-0":{"id":"/src/parse.ts","moduleParts":{"index.js":"bbd8b690-1"},"imported":[],"importedBy":[{"uid":"bbd8b690-8"},{"uid":"bbd8b690-2"}]},"bbd8b690-2":{"id":"/src/registry.ts","moduleParts":{"index.js":"bbd8b690-3"},"imported":[{"uid":"bbd8b690-10"},{"uid":"bbd8b690-0"}],"importedBy":[{"uid":"bbd8b690-8"},{"uid":"bbd8b690-4"},{"uid":"bbd8b690-6"}]},"bbd8b690-4":{"id":"/src/use-hotkey.ts","moduleParts":{"index.js":"bbd8b690-5"},"imported":[{"uid":"bbd8b690-11"},{"uid":"bbd8b690-2"}],"importedBy":[{"uid":"bbd8b690-8"}]},"bbd8b690-6":{"id":"/src/use-hotkey-scope.ts","moduleParts":{"index.js":"bbd8b690-7"},"imported":[{"uid":"bbd8b690-11"},{"uid":"bbd8b690-2"}],"importedBy":[{"uid":"bbd8b690-8"}]},"bbd8b690-8":{"id":"/src/index.ts","moduleParts":{"index.js":"bbd8b690-9"},"imported":[{"uid":"bbd8b690-10"},{"uid":"bbd8b690-4"},{"uid":"bbd8b690-6"},{"uid":"bbd8b690-2"},{"uid":"bbd8b690-0"}],"importedBy":[],"isEntry":true},"bbd8b690-10":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"bbd8b690-8"},{"uid":"bbd8b690-2"}]},"bbd8b690-11":{"id":"@pyreon/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"bbd8b690-4"},{"uid":"bbd8b690-6"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
5390
5390
 
5391
5391
  const run = () => {
5392
5392
  const width = window.innerWidth;
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
+ import { registerSingleton, signal } from "@pyreon/reactivity";
1
2
  import { onUnmount } from "@pyreon/core";
2
- import { signal } from "@pyreon/reactivity";
3
3
 
4
4
  //#region src/parse.ts
5
5
  const KEY_ALIASES = {
@@ -227,6 +227,32 @@ function useHotkeyScope(scope) {
227
227
  onUnmount(() => disableScope(scope));
228
228
  }
229
229
 
230
+ //#endregion
231
+ //#region src/index.ts
232
+ /**
233
+ * @pyreon/hotkeys — Reactive keyboard shortcut management for Pyreon.
234
+ *
235
+ * Register global or scoped keyboard shortcuts with automatic lifecycle
236
+ * management. Supports modifier keys, aliases, input filtering, and
237
+ * scope-based activation.
238
+ *
239
+ * @example
240
+ * ```ts
241
+ * import { useHotkey, useHotkeyScope } from '@pyreon/hotkeys'
242
+ *
243
+ * // Global shortcut
244
+ * useHotkey('ctrl+s', () => save(), { description: 'Save' })
245
+ *
246
+ * // Scoped shortcut — only active when scope is enabled
247
+ * useHotkeyScope('editor')
248
+ * useHotkey('ctrl+z', () => undo(), { scope: 'editor' })
249
+ *
250
+ * // Platform-aware — mod = ⌘ on Mac, Ctrl elsewhere
251
+ * useHotkey('mod+k', () => openCommandPalette())
252
+ * ```
253
+ */
254
+ registerSingleton("@pyreon/hotkeys", "0.24.6", import.meta.url);
255
+
230
256
  //#endregion
231
257
  export { _resetHotkeys, disableScope, enableScope, formatCombo, getActiveScopes, getRegisteredHotkeys, matchesCombo, parseShortcut, registerHotkey, useHotkey, useHotkeyScope };
232
258
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyreon/hotkeys",
3
- "version": "0.24.6",
3
+ "version": "0.25.0",
4
4
  "description": "Reactive keyboard shortcut management for Pyreon — scope-aware, conflict detection",
5
5
  "homepage": "https://github.com/pyreon/pyreon/tree/main/packages/hotkeys#readme",
6
6
  "bugs": {
@@ -41,13 +41,13 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@happy-dom/global-registrator": "^20.8.9",
44
- "@pyreon/core": "^0.24.6",
44
+ "@pyreon/core": "^0.25.0",
45
45
  "@pyreon/manifest": "0.13.1",
46
- "@pyreon/reactivity": "^0.24.6",
46
+ "@pyreon/reactivity": "^0.25.0",
47
47
  "@vitus-labs/tools-lint": "^2.4.0"
48
48
  },
49
49
  "dependencies": {
50
- "@pyreon/core": "^0.24.6",
51
- "@pyreon/reactivity": "^0.24.6"
50
+ "@pyreon/core": "^0.25.0",
51
+ "@pyreon/reactivity": "^0.25.0"
52
52
  }
53
53
  }