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

reakit-utils

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reakit-utils - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

es/hasFocusWithin.js

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

## [0.6.3](https://github.com/reakit/reakit/tree/master/packages/reakit-utils/compare/reakit-utils@0.6.2...reakit-utils@0.6.3) (2019-08-25)
### Features
* **reakit-utils:** Move `tabbable` internal module to `reakit-utils` package ([b84acce](https://github.com/reakit/reakit/tree/master/packages/reakit-utils/commit/b84acce))
* Support nested `Tabbable` and `Rover` components ([#417](https://github.com/reakit/reakit/tree/master/packages/reakit-utils/issues/417)) ([ee9623e](https://github.com/reakit/reakit/tree/master/packages/reakit-utils/commit/ee9623e)), closes [#376](https://github.com/reakit/reakit/tree/master/packages/reakit-utils/issues/376)
## [0.6.2](https://github.com/reakit/reakit/tree/master/packages/reakit-utils/compare/reakit-utils@0.6.1...reakit-utils@0.6.2) (2019-06-27)

@@ -8,0 +20,0 @@

1

createOnKeyDown/package.json
{
"name": "reakit-utils/createOnKeyDown",
"private": true,
"sideEffects": false,
"main": "../lib/createOnKeyDown",

@@ -5,0 +6,0 @@ "module": "../es/createOnKeyDown",

{
"name": "reakit-utils/cx",
"private": true,
"sideEffects": false,
"main": "../lib/cx",

@@ -5,0 +6,0 @@ "module": "../es/cx",

2

dist/reakit-utils.min.js

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

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],r):r((e=e||self).ReakitUtils={},e.React)}(this,function(e,r){"use strict";function n(e){return"object"==typeof e&&null!=e}function t(e,r){return-1===r?e:[].concat(e.slice(0,r),e.slice(r+1))}var o="id-",u=r.createContext(function(e){return void 0===e&&(e=o),""+e+Math.random().toString(32).substr(2,6)});e.IdProvider=function(e){var n=e.children,t=e.unstable_prefix,i=void 0===t?"":t,f=r.useRef(0),a=r.useMemo(function(){return function(e){return void 0===e&&(e=o),""+i+e+ ++f.current}},[i]);return r.createElement(u.Provider,{value:a},n)},e.createOnKeyDown=function(e){var r=void 0===e?{}:e,n=r.keyMap,t=r.onKey,o=r.stopPropagation,u=r.onKeyDown,i=r.shouldKeyDown,f=void 0===i?function(){return!0}:i,a=r.preventDefault,c=void 0===a||a;return function(e){if(n){var r="function"==typeof n?n(e):n,i="function"==typeof c?c(e):c,a="function"==typeof o?o(e):o;if(e.key in r){var l=r[e.key];if("function"==typeof l&&f(e))return i&&e.preventDefault(),a&&e.stopPropagation(),t&&t(e),void l(e)}u&&u(e)}}},e.cx=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.filter(Boolean).join(" ")||void 0},e.isEmpty=function(e){return Array.isArray(e)?!e.length:n(e)?!Object.keys(e).length:null==e||""===e},e.isInteger=function(e){return"number"==typeof e?Math.floor(e)===e:String(Math.floor(Number(e)))===e},e.isObject=n,e.isPromise=function(e){return Boolean(e&&e.then)},e.mergeRefs=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var t=r.filter(Boolean);return t.length?0===t.length?t[0]:function(e){var r=t,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var u;if(n){if(o>=r.length)break;u=r[o++]}else{if((o=r.next()).done)break;u=o.value}var i=u;"function"==typeof i?i(e):i&&(i.current=e)}}:null},e.omit=function(e,r){for(var n=Object.keys(e),t={},o=0;o<n.length;o+=1){var u=n[o];-1===r.indexOf(u)&&(t[u]=e[u])}return t},e.pick=function(e,r){for(var n=Object.keys(e),t={},o=0;o<n.length;o+=1){var u=n[o];r.indexOf(u)>=0&&(t[u]=e[u])}return t},e.removeIndexFromArray=t,e.removeItemFromArray=function(e,r){var n=e.indexOf(r);return t(e,n)},e.splitProps=function(e,r){for(var n={},t={},o=0,u=Object.keys(e);o<u.length;o++){var i=u[o];r.indexOf(i)>=0?n[i]=e[i]:t[i]=e[i]}return[n,t]},e.toArray=function(e){return Array.isArray(e)?e:void 0!==e?[e]:[]},e.useAllCallbacks=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return r.useCallback(function(){var e=n.filter(Boolean),r=Array.isArray(e),t=0;for(e=r?e:e[Symbol.iterator]();;){var o;if(r){if(t>=e.length)break;o=e[t++]}else{if((t=e.next()).done)break;o=t.value}o.apply(void 0,arguments)}},n)},e.useId=function(e){void 0===e&&(e=o);var n=r.useContext(u);return r.useState(function(){return n(e)})[0]},e.useLiveRef=function(e){var n=r.useRef(e);return r.useEffect(function(){n.current=e}),n},e.usePipe=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return r.useCallback(function(e){return n.filter(Boolean).reduce(function(e,r){return r(e)},e)},n)},e.useSealedState=function(e){return r.useState(e)[0]},e.useUpdateEffect=function(e,n){var t=r.useRef(!1);r.useEffect(function(){if(t.current)return e();t.current=!0},n)},e.warning=function(e,r){},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e=e||self).ReakitUtils={},e.React)}(this,function(e,n){"use strict";function t(e){return"object"==typeof e&&null!=e}function r(e,n){return-1===n?e:[].concat(e.slice(0,n),e.slice(n+1))}var o="input, select, textarea, a[href], button, [tabindex], audio[controls], video[controls], [contenteditable]:not([contenteditable=false])";function u(e){return e instanceof HTMLElement}function i(e){return e.hasAttribute("tabindex")}function a(e){if(!u(e))return!1;if(function e(n){return!(!n.parentElement||!e(n.parentElement))||n.hidden}(e))return!1;if(function(e){return Boolean(e.disabled)}(e))return!1;var n=e.localName;if(["input","select","textarea","button"].indexOf(n)>=0)return!0;var t={a:function(){return e.hasAttribute("href")},audio:function(){return e.hasAttribute("controls")},video:function(){return e.hasAttribute("controls")}};return n in t?t[n]():!!function(e){var n=e.getAttribute("contenteditable");return"false"!==n&&null!=n}(e)||i(e)}function f(e){return!!u(e)&&(!!a(e)&&!function(e){return i(e)&&e.tabIndex<0}(e))}function c(e){return Array.from(e.querySelectorAll(o)).filter(a)}function l(e,n){var t=Array.from(e.querySelectorAll(o)),r=t.filter(f);return!r.length&&n?t:r}function s(e,n){var t=c(e),r=t.indexOf(document.activeElement),o=t.slice(r+1);return o.find(f)||t.find(f)||(n?o[0]:null)}function v(e,n){var t=c(e).reverse(),r=t.indexOf(document.activeElement),o=t.slice(r+1);return o.find(f)||t.find(f)||(n?o[0]:null)}var d="id-",b=n.createContext(function(e){return void 0===e&&(e=d),""+e+Math.random().toString(32).substr(2,6)});e.IdProvider=function(e){var t=e.children,r=e.unstable_prefix,o=void 0===r?"":r,u=n.useRef(0),i=n.useMemo(function(){return function(e){return void 0===e&&(e=d),""+o+e+ ++u.current}},[o]);return n.createElement(b.Provider,{value:i},t)},e.createOnKeyDown=function(e){var n=void 0===e?{}:e,t=n.keyMap,r=n.onKey,o=n.stopPropagation,u=n.onKeyDown,i=n.shouldKeyDown,a=void 0===i?function(){return!0}:i,f=n.preventDefault,c=void 0===f||f;return function(e){if(t){var n="function"==typeof t?t(e):t,i="function"==typeof c?c(e):c,f="function"==typeof o?o(e):o;if(e.key in n){var l=n[e.key];if("function"==typeof l&&a(e))return i&&e.preventDefault(),f&&e.stopPropagation(),r&&r(e),void l(e)}u&&u(e)}}},e.cx=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return n.filter(Boolean).join(" ")||void 0},e.focusNextTabbableIn=function(e,n){var t=s(e,n);t&&u(t)&&t.focus()},e.focusPreviousTabbableIn=function(e,n){var t=v(e,n);t&&u(t)&&t.focus()},e.getAllFocusableIn=c,e.getAllTabbableIn=l,e.getFirstFocusableIn=function(e){var n=c(e);return n.length?n[0]:null},e.getFirstTabbableIn=function(e,n){return l(e,n)[0]||null},e.getLastTabbableIn=function(e,n){var t=l(e,n);return t[t.length-1]||null},e.getNextTabbableIn=s,e.getPreviousTabbableIn=v,e.hasFocusWithin=function(e){return!!document.activeElement&&e.contains(document.activeElement)},e.isEmpty=function(e){return Array.isArray(e)?!e.length:t(e)?!Object.keys(e).length:null==e||""===e},e.isFocusable=a,e.isInteger=function(e){return"number"==typeof e?Math.floor(e)===e:String(Math.floor(Number(e)))===e},e.isObject=t,e.isPromise=function(e){return Boolean(e&&e.then)},e.isTabbable=f,e.mergeRefs=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r=n.filter(Boolean);return r.length?0===r.length?r[0]:function(e){var n=r,t=Array.isArray(n),o=0;for(n=t?n:n[Symbol.iterator]();;){var u;if(t){if(o>=n.length)break;u=n[o++]}else{if((o=n.next()).done)break;u=o.value}var i=u;"function"==typeof i?i(e):i&&(i.current=e)}}:null},e.omit=function(e,n){for(var t=Object.keys(e),r={},o=0;o<t.length;o+=1){var u=t[o];-1===n.indexOf(u)&&(r[u]=e[u])}return r},e.pick=function(e,n){for(var t=Object.keys(e),r={},o=0;o<t.length;o+=1){var u=t[o];n.indexOf(u)>=0&&(r[u]=e[u])}return r},e.removeIndexFromArray=r,e.removeItemFromArray=function(e,n){var t=e.indexOf(n);return r(e,t)},e.splitProps=function(e,n){for(var t={},r={},o=0,u=Object.keys(e);o<u.length;o++){var i=u[o];n.indexOf(i)>=0?t[i]=e[i]:r[i]=e[i]}return[t,r]},e.toArray=function(e){return Array.isArray(e)?e:void 0!==e?[e]:[]},e.useAllCallbacks=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useCallback(function(){var e=t.filter(Boolean),n=e,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var u;if(r){if(o>=n.length)break;u=n[o++]}else{if((o=n.next()).done)break;u=o.value}var i=u;i.apply(void 0,arguments)}},t)},e.useId=function(e){void 0===e&&(e=d);var t=n.useContext(b);return n.useState(function(){return t(e)})[0]},e.useLiveRef=function(e){var t=n.useRef(e);return n.useEffect(function(){t.current=e}),t},e.usePipe=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useCallback(function(e){return t.filter(Boolean).reduce(function(e,n){return n(e)},e)},t)},e.useSealedState=function(e){return n.useState(e)[0]},e.useUpdateEffect=function(e,t){var r=n.useRef(!1);n.useEffect(function(){if(r.current)return e();r.current=!0},t)},e.warning=function(e,n){},Object.defineProperty(e,"__esModule",{value:!0})});

@@ -10,2 +10,3 @@ export { warning } from './warning.js';

export { toArray } from './toArray.js';
export { focusNextTabbableIn, focusPreviousTabbableIn, getAllFocusableIn, getAllTabbableIn, getFirstFocusableIn, getFirstTabbableIn, getLastTabbableIn, getNextTabbableIn, getPreviousTabbableIn, isFocusable, isTabbable } from './tabbable.js';
export { splitProps } from './splitProps.js';

@@ -23,1 +24,2 @@ export { removeIndexFromArray } from './removeIndexFromArray.js';

export { cx } from './cx.js';
export { hasFocusWithin } from './hasFocusWithin.js';

@@ -18,16 +18,31 @@ import { isObject } from './isObject.js';

function _objectSpread(target) {
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}

@@ -48,5 +63,5 @@

}).reduce(function (acc, curr) {
var _objectSpread2;
var _objectSpread2$1;
return _objectSpread({}, acc, (_objectSpread2 = {}, _objectSpread2[curr] = val[curr], _objectSpread2));
return _objectSpread2({}, acc, (_objectSpread2$1 = {}, _objectSpread2$1[curr] = val[curr], _objectSpread2$1));
}, {}));

@@ -53,0 +68,0 @@ }

{
"name": "reakit-utils/isEmpty",
"private": true,
"sideEffects": false,
"main": "../lib/isEmpty",

@@ -5,0 +6,0 @@ "module": "../es/isEmpty",

{
"name": "reakit-utils/isInteger",
"private": true,
"sideEffects": false,
"main": "../lib/isInteger",

@@ -5,0 +6,0 @@ "module": "../es/isInteger",

{
"name": "reakit-utils/isObject",
"private": true,
"sideEffects": false,
"main": "../lib/isObject",

@@ -5,0 +6,0 @@ "module": "../es/isObject",

{
"name": "reakit-utils/isPromise",
"private": true,
"sideEffects": false,
"main": "../lib/isPromise",

@@ -5,0 +6,0 @@ "module": "../es/isPromise",

{
"name": "reakit-utils/jestSerializerStripFunctions",
"private": true,
"sideEffects": false,
"main": "../lib/jestSerializerStripFunctions",

@@ -5,0 +6,0 @@ "module": "../es/jestSerializerStripFunctions",

@@ -14,2 +14,3 @@ 'use strict';

var toArray = require('./toArray.js');
var tabbable = require('./tabbable.js');
var splitProps = require('./splitProps.js');

@@ -27,2 +28,3 @@ var removeIndexFromArray = require('./removeIndexFromArray.js');

var cx = require('./cx.js');
var hasFocusWithin = require('./hasFocusWithin.js');

@@ -40,2 +42,13 @@

exports.toArray = toArray.toArray;
exports.focusNextTabbableIn = tabbable.focusNextTabbableIn;
exports.focusPreviousTabbableIn = tabbable.focusPreviousTabbableIn;
exports.getAllFocusableIn = tabbable.getAllFocusableIn;
exports.getAllTabbableIn = tabbable.getAllTabbableIn;
exports.getFirstFocusableIn = tabbable.getFirstFocusableIn;
exports.getFirstTabbableIn = tabbable.getFirstTabbableIn;
exports.getLastTabbableIn = tabbable.getLastTabbableIn;
exports.getNextTabbableIn = tabbable.getNextTabbableIn;
exports.getPreviousTabbableIn = tabbable.getPreviousTabbableIn;
exports.isFocusable = tabbable.isFocusable;
exports.isTabbable = tabbable.isTabbable;
exports.splitProps = splitProps.splitProps;

@@ -53,1 +66,2 @@ exports.removeIndexFromArray = removeIndexFromArray.removeIndexFromArray;

exports.cx = cx.cx;
exports.hasFocusWithin = hasFocusWithin.hasFocusWithin;

@@ -22,16 +22,31 @@ 'use strict';

function _objectSpread(target) {
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}

@@ -52,5 +67,5 @@

}).reduce(function (acc, curr) {
var _objectSpread2;
var _objectSpread2$1;
return _objectSpread({}, acc, (_objectSpread2 = {}, _objectSpread2[curr] = val[curr], _objectSpread2));
return _objectSpread2({}, acc, (_objectSpread2$1 = {}, _objectSpread2$1[curr] = val[curr], _objectSpread2$1));
}, {}));

@@ -57,0 +72,0 @@ }

{
"name": "reakit-utils/mergeRefs",
"private": true,
"sideEffects": false,
"main": "../lib/mergeRefs",

@@ -5,0 +6,0 @@ "module": "../es/mergeRefs",

{
"name": "reakit-utils/omit",
"private": true,
"sideEffects": false,
"main": "../lib/omit",

@@ -5,0 +6,0 @@ "module": "../es/omit",

{
"name": "reakit-utils",
"version": "0.6.2",
"version": "0.6.3",
"description": "Reakit utils",

@@ -37,3 +37,3 @@ "sideEffects": false,

},
"gitHead": "f0edc09db25e86b822cb7072410145c7d990efbe"
"gitHead": "c2fb790b3a92211382c7e7a2bf751d0d723f62c3"
}
{
"name": "reakit-utils/pick",
"private": true,
"sideEffects": false,
"main": "../lib/pick",

@@ -5,0 +6,0 @@ "module": "../es/pick",

{
"name": "reakit-utils/removeIndexFromArray",
"private": true,
"sideEffects": false,
"main": "../lib/removeIndexFromArray",

@@ -5,0 +6,0 @@ "module": "../es/removeIndexFromArray",

{
"name": "reakit-utils/removeItemFromArray",
"private": true,
"sideEffects": false,
"main": "../lib/removeItemFromArray",

@@ -5,0 +6,0 @@ "module": "../es/removeItemFromArray",

{
"name": "reakit-utils/splitProps",
"private": true,
"sideEffects": false,
"main": "../lib/splitProps",

@@ -5,0 +6,0 @@ "module": "../es/splitProps",

export * from "./createOnKeyDown";
export * from "./cx";
export * from "./hasFocusWithin";
export * from "./isEmpty";

@@ -13,2 +14,3 @@ export * from "./isInteger";

export * from "./splitProps";
export * from "./tabbable";
export * from "./toArray";

@@ -15,0 +17,0 @@ export * from "./types";

{
"name": "reakit-utils/toArray",
"private": true,
"sideEffects": false,
"main": "../lib/toArray",

@@ -5,0 +6,0 @@ "module": "../es/toArray",

export * from "./createOnKeyDown";
export * from "./cx";
export * from "./hasFocusWithin";
export * from "./isEmpty";

@@ -13,2 +14,3 @@ export * from "./isInteger";

export * from "./splitProps";
export * from "./tabbable";
export * from "./toArray";

@@ -15,0 +17,0 @@ export * from "./types";

{
"name": "reakit-utils/types",
"private": true,
"sideEffects": false,
"main": "../lib/types",

@@ -5,0 +6,0 @@ "module": "../es/types",

{
"name": "reakit-utils/useAllCallbacks",
"private": true,
"sideEffects": false,
"main": "../lib/useAllCallbacks",

@@ -5,0 +6,0 @@ "module": "../es/useAllCallbacks",

{
"name": "reakit-utils/useId",
"private": true,
"sideEffects": false,
"main": "../lib/useId",

@@ -5,0 +6,0 @@ "module": "../es/useId",

{
"name": "reakit-utils/useLiveRef",
"private": true,
"sideEffects": false,
"main": "../lib/useLiveRef",

@@ -5,0 +6,0 @@ "module": "../es/useLiveRef",

{
"name": "reakit-utils/usePipe",
"private": true,
"sideEffects": false,
"main": "../lib/usePipe",

@@ -5,0 +6,0 @@ "module": "../es/usePipe",

{
"name": "reakit-utils/useSealedState",
"private": true,
"sideEffects": false,
"main": "../lib/useSealedState",

@@ -5,0 +6,0 @@ "module": "../es/useSealedState",

{
"name": "reakit-utils/useUpdateEffect",
"private": true,
"sideEffects": false,
"main": "../lib/useUpdateEffect",

@@ -5,0 +6,0 @@ "module": "../es/useUpdateEffect",

{
"name": "reakit-utils/warning",
"private": true,
"sideEffects": false,
"main": "../lib/warning",

@@ -5,0 +6,0 @@ "module": "../es/warning",

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