Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-hotkeys-hook

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hotkeys-hook - npm Package Compare versions

Comparing version 2.3.1 to 2.4.0

9

dist/react-hotkeys-hook.cjs.development.js

@@ -20,3 +20,5 @@ 'use strict';

enableOnTags = _ref.enableOnTags,
filter = _ref.filter;
filter = _ref.filter,
keyup = _ref.keyup,
keydown = _ref.keydown;

@@ -44,2 +46,7 @@ var ref = react.useRef(null);

if (filter) hotkeys.filter = filter;
if (keyup && keydown !== true) {
options.keydown = false;
}
hotkeys(keys, options || {}, memoisedCallback);

@@ -46,0 +53,0 @@ return function () {

2

dist/react-hotkeys-hook.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";var e,t=(e=require("hotkeys-js"))&&"object"==typeof e&&"default"in e?e.default:e,n=require("react");exports.useHotkeys=function(e,r,u,s){u instanceof Array&&(s=u,u=void 0);var a=u||{},c=a.enableOnTags,i=a.filter,o=n.useRef(null),l=n.useCallback((function(e,t){return(null===o.current||document.activeElement===o.current)&&(r(e,t),!0)}),s?[o].concat(s):[o]);return n.useEffect((function(){return u&&u.enableOnTags&&(t.filter=function(e){var t=e.target,n=e.srcElement,r=t&&t.tagName||n&&n.tagName;return Boolean(r&&c&&c.includes(r))}),i&&(t.filter=i),t(e,u||{},l),function(){return t.unbind(e,l)}}),[l,u,c,i,e]),o},exports.useIsHotkeyPressed=function(){return t.isPressed};
"use strict";var e,t=(e=require("hotkeys-js"))&&"object"==typeof e&&"default"in e?e.default:e,n=require("react");exports.useHotkeys=function(e,r,u,s){u instanceof Array&&(s=u,u=void 0);var a=u||{},o=a.enableOnTags,c=a.filter,i=a.keyup,l=a.keydown,f=n.useRef(null),d=n.useCallback((function(e,t){return(null===f.current||document.activeElement===f.current)&&(r(e,t),!0)}),s?[f].concat(s):[f]);return n.useEffect((function(){return u&&u.enableOnTags&&(t.filter=function(e){var t=e.target,n=e.srcElement,r=t&&t.tagName||n&&n.tagName;return Boolean(r&&o&&o.includes(r))}),c&&(t.filter=c),i&&!0!==l&&(u.keydown=!1),t(e,u||{},d),function(){return t.unbind(e,d)}}),[d,u,o,c,e]),f},exports.useIsHotkeyPressed=function(){return t.isPressed};
//# sourceMappingURL=react-hotkeys-hook.cjs.production.min.js.map

@@ -16,3 +16,5 @@ import hotkeys from 'hotkeys-js';

enableOnTags = _ref.enableOnTags,
filter = _ref.filter;
filter = _ref.filter,
keyup = _ref.keyup,
keydown = _ref.keydown;

@@ -40,2 +42,7 @@ var ref = useRef(null);

if (filter) hotkeys.filter = filter;
if (keyup && keydown !== true) {
options.keydown = false;
}
hotkeys(keys, options || {}, memoisedCallback);

@@ -42,0 +49,0 @@ return function () {

{
"name": "react-hotkeys-hook",
"version": "2.3.1",
"version": "2.4.0",
"repository": "https://JohannesKlauss@github.com/JohannesKlauss/react-keymap-hook.git",

@@ -60,24 +60,24 @@ "author": "Johannes Klauss",

"devDependencies": {
"@babel/core": "7.11.6",
"@babel/preset-env": "7.11.5",
"@babel/preset-react": "7.10.4",
"@babel/preset-typescript": "7.10.4",
"@babel/core": "7.12.3",
"@babel/preset-env": "7.12.1",
"@babel/preset-react": "7.12.1",
"@babel/preset-typescript": "7.12.1",
"@emotion/core": "10.0.35",
"@testing-library/react": "11.0.2",
"@testing-library/react-hooks": "3.4.1",
"@types/jest": "26.0.13",
"@types/react": "16.9.49",
"@testing-library/react": "11.1.0",
"@testing-library/react-hooks": "3.4.2",
"@types/jest": "26.0.15",
"@types/react": "16.9.53",
"@types/react-dom": "16.9.8",
"@types/testing-library__react": "10.0.1",
"@types/testing-library__react-hooks": "3.4.0",
"@types/testing-library__react-hooks": "3.4.1",
"docz": "2.3.1",
"emotion-theming": "10.0.27",
"gatsby-plugin-emotion": "4.3.10",
"jest": "26.4.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-test-renderer": "16.13.1",
"tsdx": "0.13.3",
"tslib": "2.0.1",
"typescript": "4.0.2"
"gatsby-plugin-emotion": "4.3.14",
"jest": "26.6.1",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-test-renderer": "17.0.1",
"tsdx": "0.14.1",
"tslib": "2.0.3",
"typescript": "4.0.5"
},

@@ -89,4 +89,4 @@ "peerDependencies": {

"resolutions": {
"@types/react": "16.9.49"
"@types/react": "16.9.53"
}
}

@@ -47,5 +47,2 @@ # react-hotkeys-hook

The callback function takes the exact parameters as the callback function in the hotkeys package.
See [hotkeys] documentation for more info or look into the typings file.
### Parameters

@@ -52,0 +49,0 @@ - `keys: string`: Here you can set the key strokes you want the hook to listen to. You can use single or multiple keys,

@@ -23,4 +23,4 @@ import hotkeys, {HotkeysEvent, KeyHandler} from "hotkeys-js";

}
const {enableOnTags, filter} = options || {};
const {enableOnTags, filter, keyup, keydown} = options || {};
const ref = useRef<T | null>(null);

@@ -49,2 +49,6 @@

if (keyup && keydown !== true) {
(options as Options).keydown = false;
}
hotkeys(keys, (options as Options) || {}, memoisedCallback);

@@ -51,0 +55,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc