diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dfc058..0ed6e67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased - [0.2.1] +## _May 27th, 2024_ - [0.2.1] ### Bug fixes @@ -46,5 +46,5 @@ - Elevate `leptos` to v0.6.5 - Added `event.preventDefault()`. -[0.2.1]: https://github.com/gaucho-labs/leptos-hotkeys/compare/v0.2.0...main +[0.2.1]: https://github.com/gaucho-labs/leptos-hotkeys/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/gaucho-labs/leptos-hotkeys/compare/b83afc96...v0.2.0 \ No newline at end of file diff --git a/README.md b/README.md index b35a521..2b5bf51 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,6 @@ Declaratively create and pair keybindings with callbacks for Leptos applications -# leptos-hotkeys - Leptos-hotkeys creates and manages keyboard shortcuts. It provides macros and functions that simplify the definition of keybindings, since the management of event lifecycle associated with keyboard interactions has been done for you! @@ -27,10 +25,10 @@ keybindings, since the management of event lifecycle associated with keyboard in Curious to see how it works? [See the demo](https://leptos-hotkeys.vercel.app). - To get started, follow the [Quick Start](#quick-start) section. ## Features + > [!NOTE] > This crate has three types of hotkeys: global, scoped, and focus-trapped. @@ -40,6 +38,7 @@ To get started, follow the [Quick Start](#quick-start) section. Use this macro to declare global and scoped hotkeys. This macro has js idioms while preserving Leptos standards. [More about the macro.](](#macro-api).) ### Global Hotkeys + This example creates two global hotkeys: `W` and `F`. ```rust @@ -112,7 +111,6 @@ pub fn SomeComponent() -> impl IntoView { > [!NOTE] > Scopes are case-insensitive. That means `my_scope` and `mY_sCoPe` are considered the same scope. - ### Focus trapped Hotkeys (the `use_hotkeys_ref!` macro) This example embeds a hotkey to a `
` tag. This hotkey will fire iff the element is focused and the scope is correct. @@ -188,7 +186,6 @@ You can bind multiple hotkeys to a callback. For example: "KeyG+KeyR,MetaLeft+KeyO,ControlLeft+keyK" ``` - Keys are case-agnostic and whitspace-agnostic. For a hotkey with multiple keys, use the `,` as a delimiter in a sequence of keys. ### `scopes!()` @@ -217,15 +214,15 @@ pub fn App() -> impl IntoView { ``` ## The `debug` feature flag + Improve developer experience by introducing the `debug` flag which adds logging to your console in CSR. It logs the current pressed key `code` values, hotkeys fires, and scopes toggling. Just simply: ```toml -leptos_hotkeys = { path = "0.2.0", features = ["debug"] } +leptos_hotkeys = { path = "0.2.1", features = ["debug"] } ``` - ## Contributors diff --git a/leptos_hotkeys/Cargo.toml b/leptos_hotkeys/Cargo.toml index 6f26cf4..8df6707 100644 --- a/leptos_hotkeys/Cargo.toml +++ b/leptos_hotkeys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leptos_hotkeys" -version = "0.2.0" +version = "0.2.1" edition = "2021" description = "A library that declaratively pairs keybindings with callbacks for Leptos applications." license = "MIT"