@uxf/core-react 11.51.2 → 11.52.0
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BodyScrollOptions } from "@uxf/core/utils/
|
|
1
|
+
import { BodyScrollOptions } from "@uxf/core/utils/body-scroll-lock";
|
|
2
2
|
import { RefObject } from "react";
|
|
3
3
|
export interface UseBodyScrollLockOptions extends BodyScrollOptions {
|
|
4
4
|
clearAllOnClose?: boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useBodyScrollLock = useBodyScrollLock;
|
|
4
|
-
const
|
|
4
|
+
const body_scroll_lock_1 = require("@uxf/core/utils/body-scroll-lock");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
function useBodyScrollLock(containerRef, isOpen, { allowTouchMove, clearAllOnClose, reserveScrollBarGap } = {}) {
|
|
7
7
|
(0, react_1.useEffect)(() => {
|
|
8
8
|
const node = containerRef.current;
|
|
9
9
|
if (isOpen && node) {
|
|
10
|
-
(0,
|
|
10
|
+
(0, body_scroll_lock_1.disableBodyScroll)(node, {
|
|
11
11
|
allowTouchMove: allowTouchMove ||
|
|
12
12
|
((element) => {
|
|
13
13
|
var _a;
|
|
@@ -24,10 +24,10 @@ function useBodyScrollLock(containerRef, isOpen, { allowTouchMove, clearAllOnClo
|
|
|
24
24
|
}
|
|
25
25
|
return () => {
|
|
26
26
|
if (node) {
|
|
27
|
-
(0,
|
|
27
|
+
(0, body_scroll_lock_1.enableBodyScroll)(node);
|
|
28
28
|
}
|
|
29
29
|
if (clearAllOnClose) {
|
|
30
|
-
(0,
|
|
30
|
+
(0, body_scroll_lock_1.clearAllBodyScrollLocks)();
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
}, [allowTouchMove, clearAllOnClose, containerRef, isOpen, reserveScrollBarGap]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useIsomorphicLayoutEffect = void 0;
|
|
4
|
-
const
|
|
4
|
+
const is_browser_1 = require("@uxf/core/utils/is-browser");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
exports.useIsomorphicLayoutEffect =
|
|
6
|
+
exports.useIsomorphicLayoutEffect = is_browser_1.isBrowser ? react_1.useLayoutEffect : react_1.useEffect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/core-react",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.52.0",
|
|
4
4
|
"description": "UXF Core",
|
|
5
5
|
"author": "UX Fans s.r.o",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@uxf/core": "11.
|
|
15
|
+
"@uxf/core": "11.52.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": ">=18.2.0"
|