Patch Changes
-
c3ec2caThanks
@segunadebayo! - - Addtargetoption to hotkey commands for scoping a command to
a DOM subtree. Accepts an element or a function returning one (resolved on every event, so late-mounted elements
work). The command only fires when the event originates within the target. Targeted commands take priority over global
ones on the same hotkey, and the same hotkey registered on different targets is no longer reported as a conflict.store.register({ id: "grid.down", hotkey: "ArrowDown", action: moveDown, options: { target: () => gridEl }, })
- Add Linux platform detection.
formatHotkeywithplatform: "auto"now resolveslinuxon Linux (formatting
MetaasSuper) instead of falling back towindows.
- Add Linux platform detection.
-
c3ec2caThanks
@segunadebayo! - - Fix issue whereisPressedalways returnedfalsefor bare
modifiers."shift","ctrl","alt","meta"and"mod"now parse as modifier flags instead of regular keys.- Fix issue where a command registered with
enabled: falsenever fired, even after callingenable()or
setEnabled(id, true). - Fix issue where
subscribecallers trackingpressedKeysreceived no updates until at least one command was
registered. - Fix issue where a command registered with
capture: falsenever fired if the store was already listening (e.g.
after a capture-phase command or a subscriber). - Fix issue where
HotkeyRecorder.stop()cleared the previously recorded value when nothing new was recorded. - Fix issue where
HotkeyRecorder.cancel()kept a partially recorded value instead of restoring the value from before
recording started. - Fix issue where
addScope,removeScopeandtoggleScopedid not reset in-progress sequences, unlikesetScope. - Fix issue where
getPlatformnever resolvedlinux, so thelinuxentry in the display map was unreachable.
formatHotkey("meta+K")now showsSuperon Linux instead ofWin. Android, which reports a Linux platform
string, still resolves towindows. - Add
normalizeHotkey, which resolves a hotkey to a canonical string so equivalent hotkeys written differently
(mod+k,Meta+K) compare equal. Useful as a stable identity key for a registered hotkey. - Export the
Platformtype, whichFormatHotkeyOptions.platformalready accepts.
- Fix issue where a command registered with
-
Updated dependencies []:
- @zag-js/dom-query@1.43.2