@7shifts/sous-chef 3.65.1-beta.0 → 3.65.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +6 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/environment.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13822,6 +13822,11 @@ function useViewPortIntersectionObserver() {
|
|
|
13822
13822
|
};
|
|
13823
13823
|
}
|
|
13824
13824
|
|
|
13825
|
+
var isJestEnvironment = function isJestEnvironment() {
|
|
13826
|
+
var _process;
|
|
13827
|
+
return typeof process !== 'undefined' && ((_process = process) == null || (_process = _process.env) == null ? void 0 : _process.JEST_WORKER_ID) !== undefined;
|
|
13828
|
+
};
|
|
13829
|
+
|
|
13825
13830
|
/**
|
|
13826
13831
|
* Custom React hook that monitors the visibility of a referenced DOM element within the viewport
|
|
13827
13832
|
* using the Browser Intersection Observer API.
|
|
@@ -13829,7 +13834,6 @@ function useViewPortIntersectionObserver() {
|
|
|
13829
13834
|
* @returns {IsVisibleInViewPortResult}
|
|
13830
13835
|
*/
|
|
13831
13836
|
function useIsVisibleInViewPort() {
|
|
13832
|
-
var _process;
|
|
13833
13837
|
var wrapperRef = React.useRef(null);
|
|
13834
13838
|
var _useState = React.useState(false),
|
|
13835
13839
|
isVisible = _useState[0],
|
|
@@ -13849,9 +13853,8 @@ function useIsVisibleInViewPort() {
|
|
|
13849
13853
|
setIsVisible(false);
|
|
13850
13854
|
wrapperRef.current = target;
|
|
13851
13855
|
}, [observeElement, unobserveElement]);
|
|
13852
|
-
var isJestEnvironment = typeof process !== 'undefined' && ((_process = process) == null || (_process = _process.env) == null ? void 0 : _process.JEST_WORKER_ID) !== undefined;
|
|
13853
13856
|
return {
|
|
13854
|
-
isVisible: isJestEnvironment ? true : isVisible,
|
|
13857
|
+
isVisible: isJestEnvironment() ? true : isVisible,
|
|
13855
13858
|
elementRef: handleRefUpdate
|
|
13856
13859
|
};
|
|
13857
13860
|
}
|