@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.modern.js
CHANGED
|
@@ -13903,6 +13903,11 @@ function useViewPortIntersectionObserver() {
|
|
|
13903
13903
|
};
|
|
13904
13904
|
}
|
|
13905
13905
|
|
|
13906
|
+
const isJestEnvironment = () => {
|
|
13907
|
+
var _process;
|
|
13908
|
+
return typeof process !== 'undefined' && ((_process = process) == null || (_process = _process.env) == null ? void 0 : _process.JEST_WORKER_ID) !== undefined;
|
|
13909
|
+
};
|
|
13910
|
+
|
|
13906
13911
|
/**
|
|
13907
13912
|
* Custom React hook that monitors the visibility of a referenced DOM element within the viewport
|
|
13908
13913
|
* using the Browser Intersection Observer API.
|
|
@@ -13910,7 +13915,6 @@ function useViewPortIntersectionObserver() {
|
|
|
13910
13915
|
* @returns {IsVisibleInViewPortResult}
|
|
13911
13916
|
*/
|
|
13912
13917
|
function useIsVisibleInViewPort() {
|
|
13913
|
-
var _process;
|
|
13914
13918
|
const wrapperRef = useRef(null);
|
|
13915
13919
|
const [isVisible, setIsVisible] = useState(false);
|
|
13916
13920
|
const {
|
|
@@ -13929,9 +13933,8 @@ function useIsVisibleInViewPort() {
|
|
|
13929
13933
|
setIsVisible(false);
|
|
13930
13934
|
wrapperRef.current = target;
|
|
13931
13935
|
}, [observeElement, unobserveElement]);
|
|
13932
|
-
const isJestEnvironment = typeof process !== 'undefined' && ((_process = process) == null || (_process = _process.env) == null ? void 0 : _process.JEST_WORKER_ID) !== undefined;
|
|
13933
13936
|
return {
|
|
13934
|
-
isVisible: isJestEnvironment ? true : isVisible,
|
|
13937
|
+
isVisible: isJestEnvironment() ? true : isVisible,
|
|
13935
13938
|
elementRef: handleRefUpdate
|
|
13936
13939
|
};
|
|
13937
13940
|
}
|