@atlaskit/width-detector
Advanced tools
Comparing version 4.1.8 to 4.1.9
# @atlaskit/width-detector | ||
## 4.1.9 | ||
### Patch Changes | ||
- [#81900](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81900) [`4de6e56a074b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4de6e56a074b) - Explicitly coerce value in `useInView` to improve compatibility with TypeScript 5 | ||
## 4.1.8 | ||
@@ -4,0 +10,0 @@ |
@@ -23,3 +23,3 @@ "use strict"; | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
var containerDivStyle = { | ||
@@ -26,0 +26,0 @@ width: '100%', |
@@ -32,3 +32,5 @@ "use strict"; | ||
if (intersectionRatio >= 0) { | ||
var inView = intersectionRatio >= (threshold || 0); | ||
// Note: `0` will be used here when an array of numbers is passed as the threshold, which doesn't feel right | ||
var numericThreshold = typeof threshold === 'number' ? threshold : 0; | ||
var inView = intersectionRatio >= numericThreshold; | ||
if (isIntersecting !== undefined) { | ||
@@ -35,0 +37,0 @@ inView = inView && isIntersecting; |
@@ -1,5 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
"use strict"; |
@@ -27,2 +27,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
// since HTMLElements do not have this. | ||
/** | ||
@@ -29,0 +30,0 @@ * @deprecated use WidthObserver instead |
@@ -24,3 +24,5 @@ import React from 'react'; | ||
if (intersectionRatio >= 0) { | ||
let inView = intersectionRatio >= (threshold || 0); | ||
// Note: `0` will be used here when an array of numbers is passed as the threshold, which doesn't feel right | ||
const numericThreshold = typeof threshold === 'number' ? threshold : 0; | ||
let inView = intersectionRatio >= numericThreshold; | ||
if (isIntersecting !== undefined) { | ||
@@ -27,0 +29,0 @@ inView = inView && isIntersecting; |
@@ -14,3 +14,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
import React from 'react'; | ||
@@ -17,0 +17,0 @@ import rafSchedule from 'raf-schd'; |
@@ -25,3 +25,5 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; | ||
if (intersectionRatio >= 0) { | ||
var inView = intersectionRatio >= (threshold || 0); | ||
// Note: `0` will be used here when an array of numbers is passed as the threshold, which doesn't feel right | ||
var numericThreshold = typeof threshold === 'number' ? threshold : 0; | ||
var inView = intersectionRatio >= numericThreshold; | ||
if (isIntersecting !== undefined) { | ||
@@ -28,0 +30,0 @@ inView = inView && isIntersecting; |
{ | ||
"name": "@atlaskit/width-detector", | ||
"version": "4.1.8", | ||
"version": "4.1.9", | ||
"description": "Wrapper for components that need to respond to width changes", | ||
@@ -45,2 +45,3 @@ "publishConfig": { | ||
"@af/integration-testing": "*", | ||
"@atlaskit/ds-lib": "^2.2.0", | ||
"@atlaskit/ssr": "*", | ||
@@ -68,2 +69,2 @@ "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1", | ||
} | ||
} | ||
} |
58623
1114
12