ninja-keys
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -199,5 +199,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
event.preventDefault(); | ||
this._actionSelected({ | ||
detail: this._actionMatches[this._selectedIndex], | ||
}); | ||
if (this._selectedIndex > -1) { | ||
this._actionSelected({ | ||
detail: this._actionMatches[this._selectedIndex], | ||
}); | ||
} | ||
}); | ||
@@ -204,0 +206,0 @@ } |
{ | ||
"name": "ninja-keys", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Ninja Keys", | ||
@@ -33,5 +33,5 @@ "main": "dist/ninja-keys.js", | ||
"dependencies": { | ||
"@material/mwc-icon": "0.25.2", | ||
"@material/mwc-icon": "0.25.3", | ||
"hotkeys-js": "3.8.7", | ||
"lit": "^2.0.0" | ||
"lit": "2.0.2" | ||
}, | ||
@@ -38,0 +38,0 @@ "customElements": "custom-elements.json", |
@@ -11,5 +11,6 @@ # Ninja Keys | ||
[https://ninja-keys-demo.vercel.app/](https://ninja-keys-demo.vercel.app/) | ||
![Demo](./docs/demo-min.gif) | ||
## Why? | ||
## Motivation | ||
A lot of applications support that pattern, user hit <kbd>ā</kbd>+<kbd>k</kbd> (or <kbd>ctrl</kbd>+<kbd>k</kbd>) and search UI dialog appear. | ||
@@ -26,3 +27,20 @@ I've seen recently in Notion, Slack, Linear, Vercel and Agolia, but I'm sure there are plenty more. | ||
## Why "Ninja" ? | ||
## Integrations | ||
- [Vue Example - Codesandbox](https://codesandbox.io/s/ninja-keys-demo-vue3-bps5w?file=/public/index.html) | ||
- [React Example - Codesandbox](https://codesandbox.io/s/ninja-keys-demo-reactjs-rlv4b?file=/src/App.js) | ||
- [React/NextJS](https://github.com/ssleptsov/ninja-keys-demo/blob/master/components/LayoutWrapper.js#L14-L71) | ||
- [Static Html - Codesandbox](https://codesandbox.io/s/ninja-keys-demo-html-cf9wy?file=/index.html) | ||
## Features | ||
- Keyboard navigation | ||
- Light and dark theme build in | ||
- Build-in icons support from Material font, can support custom svg icons too. | ||
- Nested menu. Tree or flat data structure can be used | ||
- Auto register your shortcuts | ||
- Root search, for example, if search "Dark" it will find it within the "Theme" submenu | ||
- CSS variable to customize the view | ||
- Customizable hotkeys to open/close and etc. Choose what fit your website more. | ||
## Why "Ninja" name? | ||
Because it appears from nowhere and executes any actions quickly. | ||
@@ -37,3 +55,3 @@ Or because it allows your users to become keyboard ninja's š | ||
```js | ||
import from 'ninja-keys'; | ||
import 'ninja-keys'; | ||
``` | ||
@@ -185,4 +203,4 @@ | ||
|------------------------------------|------------------------------------| | ||
| --ninja-width | 640px; | | ||
| --ninja-backdrop-filter | saturate(180%) blur(2px); | | ||
| --ninja-width | 640px; | | ||
| --ninja-backdrop-filter | none; | | ||
| --ninja-overflow-background | rgba(255, 255, 255, 0.5); | | ||
@@ -189,0 +207,0 @@ | --ninja-text-color | rgb(60, 65, 73); | |
@@ -232,5 +232,7 @@ import {LitElement, html, TemplateResult, PropertyValues} from 'lit'; | ||
event.preventDefault(); | ||
this._actionSelected({ | ||
detail: this._actionMatches[this._selectedIndex], | ||
}); | ||
if (this._selectedIndex > -1){ | ||
this._actionSelected({ | ||
detail: this._actionMatches[this._selectedIndex], | ||
}); | ||
} | ||
}); | ||
@@ -237,0 +239,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149166
2858
290
+ Added@material/mwc-icon@0.25.3(transitive)
+ Addedlit@2.0.2(transitive)
- Removed@material/mwc-icon@0.25.2(transitive)
- Removedlit@2.8.0(transitive)
Updated@material/mwc-icon@0.25.3
Updatedlit@2.0.2