@zendeskgarden/container-focusjail
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.3.2](https://github.com/zendeskgarden/react-containers/compare/@zendeskgarden/container-focusjail@1.3.1...@zendeskgarden/container-focusjail@1.3.2) (2020-02-20) | ||
### Bug Fixes | ||
* **build:** improve bundle size with @babel/runtime ([#162](https://github.com/zendeskgarden/react-containers/issues/162)) ([506504c](https://github.com/zendeskgarden/react-containers/commit/506504c840795f34e420b016b94cef10440a30cb)) | ||
## [1.3.1](https://github.com/zendeskgarden/react-containers/compare/@zendeskgarden/container-focusjail@1.3.0...@zendeskgarden/container-focusjail@1.3.1) (2020-02-14) | ||
@@ -8,0 +19,0 @@ |
@@ -19,49 +19,15 @@ /** | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
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] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
} | ||
return target; | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
@@ -74,3 +40,2 @@ | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
@@ -81,69 +46,5 @@ key = sourceKeys[i]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
} | ||
function _arrayWithHoles(arr) { | ||
if (Array.isArray(arr)) return arr; | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
return; | ||
} | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _e = undefined; | ||
try { | ||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
if (i && _arr.length === i) break; | ||
} | ||
} catch (err) { | ||
_d = true; | ||
_e = err; | ||
} finally { | ||
try { | ||
if (!_n && _i["return"] != null) _i["return"](); | ||
} finally { | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
} | ||
function ownerDocument(node) { | ||
@@ -166,6 +67,6 @@ return node && node.ownerDocument || document; | ||
var useFocusJail = function useFocusJail() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { | ||
var useFocusJail = function useFocusJail(_temp) { | ||
var _ref = _temp === void 0 ? { | ||
containerRef: react.createRef() | ||
}, | ||
} : _temp, | ||
_ref$focusOnMount = _ref.focusOnMount, | ||
@@ -177,5 +78,4 @@ focusOnMount = _ref$focusOnMount === void 0 ? true : _ref$focusOnMount, | ||
var _useState = react.useState(containerRef.current), | ||
_useState2 = _slicedToArray(_useState, 2), | ||
currentRef = _useState2[0], | ||
setCurrentRef = _useState2[1]; | ||
currentRef = _useState[0], | ||
setCurrentRef = _useState[1]; | ||
react.useEffect(function () { | ||
@@ -211,7 +111,10 @@ if (containerRef.current !== currentRef) { | ||
}; | ||
var getContainerProps = function getContainerProps() { | ||
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var onKeyDown = _ref2.onKeyDown, | ||
other = _objectWithoutProperties(_ref2, ["onKeyDown"]); | ||
return _objectSpread2({ | ||
var getContainerProps = function getContainerProps(_ref2) { | ||
if (_ref2 === void 0) { | ||
_ref2 = {}; | ||
} | ||
var _ref3 = _ref2, | ||
onKeyDown = _ref3.onKeyDown, | ||
other = _objectWithoutPropertiesLoose(_ref3, ["onKeyDown"]); | ||
return _extends({ | ||
onKeyDown: containerUtilities.composeEventHandlers(onKeyDown, function (event) { | ||
@@ -233,3 +136,3 @@ if (event.keyCode !== containerUtilities.KEY_CODES.TAB) { | ||
'data-garden-container-id': 'containers.focusjail', | ||
'data-garden-container-version': '1.3.1' | ||
'data-garden-container-version': '1.3.2' | ||
}, other); | ||
@@ -252,3 +155,3 @@ }; | ||
render = _ref$render === void 0 ? children : _ref$render, | ||
options = _objectWithoutProperties(_ref, ["children", "render"]); | ||
options = _objectWithoutPropertiesLoose(_ref, ["children", "render"]); | ||
return render(useFocusJail(options)); | ||
@@ -255,0 +158,0 @@ }; |
@@ -13,49 +13,15 @@ /** | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
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] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
} | ||
return target; | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
@@ -68,3 +34,2 @@ | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
@@ -75,69 +40,5 @@ key = sourceKeys[i]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
} | ||
function _arrayWithHoles(arr) { | ||
if (Array.isArray(arr)) return arr; | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
return; | ||
} | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _e = undefined; | ||
try { | ||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
if (i && _arr.length === i) break; | ||
} | ||
} catch (err) { | ||
_d = true; | ||
_e = err; | ||
} finally { | ||
try { | ||
if (!_n && _i["return"] != null) _i["return"](); | ||
} finally { | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
} | ||
function ownerDocument(node) { | ||
@@ -160,6 +61,6 @@ return node && node.ownerDocument || document; | ||
var useFocusJail = function useFocusJail() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { | ||
var useFocusJail = function useFocusJail(_temp) { | ||
var _ref = _temp === void 0 ? { | ||
containerRef: createRef() | ||
}, | ||
} : _temp, | ||
_ref$focusOnMount = _ref.focusOnMount, | ||
@@ -171,5 +72,4 @@ focusOnMount = _ref$focusOnMount === void 0 ? true : _ref$focusOnMount, | ||
var _useState = useState(containerRef.current), | ||
_useState2 = _slicedToArray(_useState, 2), | ||
currentRef = _useState2[0], | ||
setCurrentRef = _useState2[1]; | ||
currentRef = _useState[0], | ||
setCurrentRef = _useState[1]; | ||
useEffect(function () { | ||
@@ -205,7 +105,10 @@ if (containerRef.current !== currentRef) { | ||
}; | ||
var getContainerProps = function getContainerProps() { | ||
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var onKeyDown = _ref2.onKeyDown, | ||
other = _objectWithoutProperties(_ref2, ["onKeyDown"]); | ||
return _objectSpread2({ | ||
var getContainerProps = function getContainerProps(_ref2) { | ||
if (_ref2 === void 0) { | ||
_ref2 = {}; | ||
} | ||
var _ref3 = _ref2, | ||
onKeyDown = _ref3.onKeyDown, | ||
other = _objectWithoutPropertiesLoose(_ref3, ["onKeyDown"]); | ||
return _extends({ | ||
onKeyDown: composeEventHandlers(onKeyDown, function (event) { | ||
@@ -227,3 +130,3 @@ if (event.keyCode !== KEY_CODES.TAB) { | ||
'data-garden-container-id': 'containers.focusjail', | ||
'data-garden-container-version': '1.3.1' | ||
'data-garden-container-version': '1.3.2' | ||
}, other); | ||
@@ -246,3 +149,3 @@ }; | ||
render = _ref$render === void 0 ? children : _ref$render, | ||
options = _objectWithoutProperties(_ref, ["children", "render"]); | ||
options = _objectWithoutPropertiesLoose(_ref, ["children", "render"]); | ||
return render(useFocusJail(options)); | ||
@@ -249,0 +152,0 @@ }; |
@@ -11,3 +11,3 @@ { | ||
}, | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"main": "dist/index.cjs.js", | ||
@@ -24,3 +24,4 @@ "module": "dist/index.esm.js", | ||
"dependencies": { | ||
"@zendeskgarden/container-utilities": "^0.5.1", | ||
"@babel/runtime": "^7.8.4", | ||
"@zendeskgarden/container-utilities": "^0.5.2", | ||
"dom-helpers": "^5.1.0", | ||
@@ -50,3 +51,3 @@ "tabbable": "^4.0.0" | ||
"zendeskgarden:src": "src/index.ts", | ||
"gitHead": "81501ce8b32df63d3ffaa086c9a359a9fcf42d9a" | ||
"gitHead": "c215af13d13a909cf924eba2cb95a11038b054f6" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
30551
7
335