@smakss/react-scroll-direction 4.0.4 → 4.1.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.
- package/dist/index.d.ts +54 -0
- package/dist/index.js +32 -11
- package/dist/index.js.map +1 -1
- package/package.json +13 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,87 @@
|
|
|
1
1
|
/** Enumeration for axis values */
|
|
2
2
|
export declare enum Axis {
|
|
3
|
+
/**
|
|
4
|
+
* The x-axis represents the horizontal direction.
|
|
5
|
+
*/
|
|
3
6
|
X = "x",
|
|
7
|
+
/**
|
|
8
|
+
* The y-axis represents the vertical direction.
|
|
9
|
+
*/
|
|
4
10
|
Y = "y"
|
|
5
11
|
}
|
|
6
12
|
/** Enumeration for direction values */
|
|
7
13
|
export declare enum Direction {
|
|
14
|
+
/**
|
|
15
|
+
* The up direction represents the scroll direction moving towards the top.
|
|
16
|
+
*/
|
|
8
17
|
Up = "up",
|
|
18
|
+
/**
|
|
19
|
+
* The down direction represents the scroll direction moving towards the bottom.
|
|
20
|
+
*/
|
|
9
21
|
Down = "down",
|
|
22
|
+
/**
|
|
23
|
+
* The left direction represents the scroll direction moving towards the left.
|
|
24
|
+
*/
|
|
10
25
|
Left = "left",
|
|
26
|
+
/**
|
|
27
|
+
* The right direction represents the scroll direction moving towards the right.
|
|
28
|
+
*/
|
|
11
29
|
Right = "right",
|
|
30
|
+
/**
|
|
31
|
+
* The still direction represents the scroll direction when the user is not scrolling.
|
|
32
|
+
*/
|
|
12
33
|
Still = "still"
|
|
13
34
|
}
|
|
14
35
|
type ScrollPosition = {
|
|
36
|
+
/**
|
|
37
|
+
* The top position represents the distance from the top edge of the page.
|
|
38
|
+
*/
|
|
15
39
|
top: number;
|
|
40
|
+
/**
|
|
41
|
+
* The bottom position represents the distance from the bottom edge of the page.
|
|
42
|
+
*/
|
|
16
43
|
bottom: number;
|
|
44
|
+
/**
|
|
45
|
+
* The left position represents the distance from the left edge of the page.
|
|
46
|
+
*/
|
|
17
47
|
left: number;
|
|
48
|
+
/**
|
|
49
|
+
* The right position represents the distance from the right edge of the page.
|
|
50
|
+
*/
|
|
18
51
|
right: number;
|
|
19
52
|
};
|
|
20
53
|
/** Type declaration for the returned scroll information */
|
|
21
54
|
type ScrollInfo = {
|
|
55
|
+
/**
|
|
56
|
+
* The scrollDir represents the current scroll direction.
|
|
57
|
+
*/
|
|
22
58
|
scrollDir: Direction;
|
|
59
|
+
/**
|
|
60
|
+
* The scrollPosition represents the current scroll position.
|
|
61
|
+
*/
|
|
23
62
|
scrollPosition: ScrollPosition;
|
|
24
63
|
};
|
|
25
64
|
/** Type declaration for scroll properties */
|
|
26
65
|
type ScrollProps = {
|
|
66
|
+
/**
|
|
67
|
+
* The thr represents the threshold value for scroll detection.
|
|
68
|
+
*/
|
|
27
69
|
thr?: number;
|
|
70
|
+
/**
|
|
71
|
+
* The axis represents the scroll axis (x or y).
|
|
72
|
+
*/
|
|
28
73
|
axis?: Axis;
|
|
74
|
+
/**
|
|
75
|
+
* The scrollUp represents the scroll direction when moving up.
|
|
76
|
+
*/
|
|
29
77
|
scrollUp?: Direction;
|
|
78
|
+
/**
|
|
79
|
+
* The scrollDown represents the scroll direction when moving down.
|
|
80
|
+
*/
|
|
30
81
|
scrollDown?: Direction;
|
|
82
|
+
/**
|
|
83
|
+
* The still represents the scroll direction when the user is not scrolling.
|
|
84
|
+
*/
|
|
31
85
|
still?: Direction;
|
|
32
86
|
};
|
|
33
87
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,39 @@
|
|
|
1
|
-
import { useState, useCallback, useEffect } from 'react';
|
|
1
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
/** Enumeration for axis values */
|
|
4
4
|
var Axis;
|
|
5
5
|
(function (Axis) {
|
|
6
|
+
/**
|
|
7
|
+
* The x-axis represents the horizontal direction.
|
|
8
|
+
*/
|
|
6
9
|
Axis["X"] = "x";
|
|
10
|
+
/**
|
|
11
|
+
* The y-axis represents the vertical direction.
|
|
12
|
+
*/
|
|
7
13
|
Axis["Y"] = "y";
|
|
8
14
|
})(Axis || (Axis = {}));
|
|
9
15
|
/** Enumeration for direction values */
|
|
10
16
|
var Direction;
|
|
11
17
|
(function (Direction) {
|
|
18
|
+
/**
|
|
19
|
+
* The up direction represents the scroll direction moving towards the top.
|
|
20
|
+
*/
|
|
12
21
|
Direction["Up"] = "up";
|
|
22
|
+
/**
|
|
23
|
+
* The down direction represents the scroll direction moving towards the bottom.
|
|
24
|
+
*/
|
|
13
25
|
Direction["Down"] = "down";
|
|
26
|
+
/**
|
|
27
|
+
* The left direction represents the scroll direction moving towards the left.
|
|
28
|
+
*/
|
|
14
29
|
Direction["Left"] = "left";
|
|
30
|
+
/**
|
|
31
|
+
* The right direction represents the scroll direction moving towards the right.
|
|
32
|
+
*/
|
|
15
33
|
Direction["Right"] = "right";
|
|
34
|
+
/**
|
|
35
|
+
* The still direction represents the scroll direction when the user is not scrolling.
|
|
36
|
+
*/
|
|
16
37
|
Direction["Still"] = "still";
|
|
17
38
|
})(Direction || (Direction = {}));
|
|
18
39
|
/**
|
|
@@ -57,16 +78,16 @@ function useDetectScroll(props = {}) {
|
|
|
57
78
|
right: 0
|
|
58
79
|
});
|
|
59
80
|
const threshold = Math.max(0, thr);
|
|
60
|
-
|
|
61
|
-
|
|
81
|
+
const ticking = useRef(false);
|
|
82
|
+
const lastScroll = useRef(0);
|
|
62
83
|
/** Function to update scroll direction */
|
|
63
84
|
const updateScrollDir = useCallback(() => {
|
|
64
85
|
const scroll = axis === Axis.Y ? window.scrollY : window.scrollX;
|
|
65
|
-
if (Math.abs(scroll - lastScroll) >= threshold) {
|
|
66
|
-
setScrollDir(scroll > lastScroll ? scrollDown : scrollUp);
|
|
67
|
-
lastScroll = Math.max(0, scroll);
|
|
86
|
+
if (Math.abs(scroll - lastScroll.current) >= threshold) {
|
|
87
|
+
setScrollDir(scroll > lastScroll.current ? scrollDown : scrollUp);
|
|
88
|
+
lastScroll.current = Math.max(0, scroll);
|
|
68
89
|
}
|
|
69
|
-
ticking = false;
|
|
90
|
+
ticking.current = false;
|
|
70
91
|
}, [axis, threshold, scrollDown, scrollUp]);
|
|
71
92
|
useEffect(() => {
|
|
72
93
|
/** Function to update scroll position */
|
|
@@ -85,17 +106,17 @@ function useDetectScroll(props = {}) {
|
|
|
85
106
|
};
|
|
86
107
|
}, []);
|
|
87
108
|
useEffect(() => {
|
|
88
|
-
lastScroll = axis === Axis.Y ? window.scrollY : window.scrollX;
|
|
109
|
+
lastScroll.current = axis === Axis.Y ? window.scrollY : window.scrollX;
|
|
89
110
|
/** Function to handle onScroll event */
|
|
90
111
|
const onScroll = () => {
|
|
91
|
-
if (!ticking) {
|
|
112
|
+
if (!ticking.current) {
|
|
92
113
|
window.requestAnimationFrame(updateScrollDir);
|
|
93
|
-
ticking = true;
|
|
114
|
+
ticking.current = true;
|
|
94
115
|
}
|
|
95
116
|
};
|
|
96
117
|
window.addEventListener('scroll', onScroll);
|
|
97
118
|
return () => window.removeEventListener('scroll', onScroll);
|
|
98
|
-
}, [updateScrollDir]);
|
|
119
|
+
}, [axis, updateScrollDir]);
|
|
99
120
|
return { scrollDir, scrollPosition };
|
|
100
121
|
}
|
|
101
122
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react';\n\n/** Enumeration for axis values */\nexport enum Axis {\n X = 'x',\n Y = 'y'\n}\n\n/** Enumeration for direction values */\nexport enum Direction {\n Up = 'up',\n Down = 'down',\n Left = 'left',\n Right = 'right',\n Still = 'still'\n}\n\ntype ScrollPosition = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\n/** Type declaration for the returned scroll information */\ntype ScrollInfo = {\n scrollDir: Direction;\n scrollPosition: ScrollPosition;\n};\n\n/** Type declaration for scroll properties */\ntype ScrollProps = {\n thr?: number;\n axis?: Axis;\n scrollUp?: Direction;\n scrollDown?: Direction;\n still?: Direction;\n};\n\n/**\n * useDetectScroll hook.\n *\n * This hook provides a mechanism to detect the scroll direction and position.\n * It will return the scroll direction as a string (up, down, left, right, or still) based on user scrolling,\n * as well as the scroll position from the top, bottom, left, and right edges of the page.\n *\n * @example\n *\n * import useDetectScroll, { Axis, Direction } from '@smakss/react-scroll-direction';\n *\n * function App() {\n * const { scrollDir, scrollPosition } = useDetectScroll({\n * thr: 100,\n * axis: Axis.Y,\n * scrollUp: Direction.Up,\n * scrollDown: Direction.Down,\n * still: Direction.Still\n * });\n *\n * return (\n * <div>\n * <p>Current scroll direction: {scrollDir}</p>\n * <p>Scroll position - Top: {scrollPosition.top}, Bottom: {scrollPosition.bottom},\n * Left: {scrollPosition.left}, Right: {scrollPosition.right}</p>\n * </div>\n * );\n * }\n *\n * @param {ScrollProps} props - The properties related to scrolling.\n * @returns {ScrollInfo} - The current direction and position of scrolling.\n */\nfunction useDetectScroll(props: ScrollProps = {}): ScrollInfo {\n const {\n thr = 0,\n axis = Axis.Y,\n scrollUp = axis === Axis.Y ? Direction.Up : Direction.Left,\n scrollDown = axis === Axis.Y ? Direction.Down : Direction.Right,\n still = Direction.Still\n } = props;\n\n const [scrollDir, setScrollDir] = useState<Direction>(still);\n const [scrollPosition, setScrollPosition] = useState<ScrollPosition>({\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n });\n\n const threshold = Math.max(0, thr);\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef } from 'react';\n\n/** Enumeration for axis values */\nexport enum Axis {\n /**\n * The x-axis represents the horizontal direction.\n */\n X = 'x',\n /**\n * The y-axis represents the vertical direction.\n */\n Y = 'y'\n}\n\n/** Enumeration for direction values */\nexport enum Direction {\n /**\n * The up direction represents the scroll direction moving towards the top.\n */\n Up = 'up',\n /**\n * The down direction represents the scroll direction moving towards the bottom.\n */\n Down = 'down',\n /**\n * The left direction represents the scroll direction moving towards the left.\n */\n Left = 'left',\n /**\n * The right direction represents the scroll direction moving towards the right.\n */\n Right = 'right',\n /**\n * The still direction represents the scroll direction when the user is not scrolling.\n */\n Still = 'still'\n}\n\ntype ScrollPosition = {\n /**\n * The top position represents the distance from the top edge of the page.\n */\n top: number;\n /**\n * The bottom position represents the distance from the bottom edge of the page.\n */\n bottom: number;\n /**\n * The left position represents the distance from the left edge of the page.\n */\n left: number;\n /**\n * The right position represents the distance from the right edge of the page.\n */\n right: number;\n};\n\n/** Type declaration for the returned scroll information */\ntype ScrollInfo = {\n /**\n * The scrollDir represents the current scroll direction.\n */\n scrollDir: Direction;\n /**\n * The scrollPosition represents the current scroll position.\n */\n scrollPosition: ScrollPosition;\n};\n\n/** Type declaration for scroll properties */\ntype ScrollProps = {\n /**\n * The thr represents the threshold value for scroll detection.\n */\n thr?: number;\n /**\n * The axis represents the scroll axis (x or y).\n */\n axis?: Axis;\n /**\n * The scrollUp represents the scroll direction when moving up.\n */\n scrollUp?: Direction;\n /**\n * The scrollDown represents the scroll direction when moving down.\n */\n scrollDown?: Direction;\n /**\n * The still represents the scroll direction when the user is not scrolling.\n */\n still?: Direction;\n};\n\n/**\n * useDetectScroll hook.\n *\n * This hook provides a mechanism to detect the scroll direction and position.\n * It will return the scroll direction as a string (up, down, left, right, or still) based on user scrolling,\n * as well as the scroll position from the top, bottom, left, and right edges of the page.\n *\n * @example\n *\n * import useDetectScroll, { Axis, Direction } from '@smakss/react-scroll-direction';\n *\n * function App() {\n * const { scrollDir, scrollPosition } = useDetectScroll({\n * thr: 100,\n * axis: Axis.Y,\n * scrollUp: Direction.Up,\n * scrollDown: Direction.Down,\n * still: Direction.Still\n * });\n *\n * return (\n * <div>\n * <p>Current scroll direction: {scrollDir}</p>\n * <p>Scroll position - Top: {scrollPosition.top}, Bottom: {scrollPosition.bottom},\n * Left: {scrollPosition.left}, Right: {scrollPosition.right}</p>\n * </div>\n * );\n * }\n *\n * @param {ScrollProps} props - The properties related to scrolling.\n * @returns {ScrollInfo} - The current direction and position of scrolling.\n */\nfunction useDetectScroll(props: ScrollProps = {}): ScrollInfo {\n const {\n thr = 0,\n axis = Axis.Y,\n scrollUp = axis === Axis.Y ? Direction.Up : Direction.Left,\n scrollDown = axis === Axis.Y ? Direction.Down : Direction.Right,\n still = Direction.Still\n } = props;\n\n const [scrollDir, setScrollDir] = useState<Direction>(still);\n const [scrollPosition, setScrollPosition] = useState<ScrollPosition>({\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n });\n\n const threshold = Math.max(0, thr);\n const ticking = useRef(false);\n const lastScroll = useRef(0);\n\n /** Function to update scroll direction */\n const updateScrollDir = useCallback(() => {\n const scroll = axis === Axis.Y ? window.scrollY : window.scrollX;\n\n if (Math.abs(scroll - lastScroll.current) >= threshold) {\n setScrollDir(scroll > lastScroll.current ? scrollDown : scrollUp);\n lastScroll.current = Math.max(0, scroll);\n }\n ticking.current = false;\n }, [axis, threshold, scrollDown, scrollUp]);\n\n useEffect(() => {\n /** Function to update scroll position */\n const updateScrollPosition = () => {\n const top = window.scrollY;\n const left = window.scrollX;\n const bottom =\n document.documentElement.scrollHeight - window.innerHeight - top;\n const right =\n document.documentElement.scrollWidth - window.innerWidth - left;\n\n setScrollPosition({ top, bottom, left, right });\n };\n\n /** Call the update function when the component mounts */\n updateScrollPosition();\n\n window.addEventListener('scroll', updateScrollPosition);\n\n return () => {\n window.removeEventListener('scroll', updateScrollPosition);\n };\n }, []);\n\n useEffect(() => {\n lastScroll.current = axis === Axis.Y ? window.scrollY : window.scrollX;\n\n /** Function to handle onScroll event */\n const onScroll = () => {\n if (!ticking.current) {\n window.requestAnimationFrame(updateScrollDir);\n ticking.current = true;\n }\n };\n\n window.addEventListener('scroll', onScroll);\n\n return () => window.removeEventListener('scroll', onScroll);\n }, [axis, updateScrollDir]);\n\n return { scrollDir, scrollPosition };\n}\n\nexport default useDetectScroll;\n"],"names":[],"mappings":";;AAE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,QAAQ,CAAC,eAAe,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;YAElE,iBAAiB,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAClD,SAAC,CAAC;;AAGF,QAAA,oBAAoB,EAAE,CAAC;AAEvB,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;AAExD,QAAA,OAAO,MAAK;AACV,YAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;AAC7D,SAAC,CAAC;KACH,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,MAAK;QACb,UAAU,CAAC,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;;QAGvE,MAAM,QAAQ,GAAG,MAAK;AACpB,YAAA,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;AACpB,gBAAA,MAAM,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;AAC9C,gBAAA,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;aACxB;AACH,SAAC,CAAC;AAEF,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAE5C,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC9D,KAAC,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;AAE5B,IAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AACvC;;;;"}
|
package/package.json
CHANGED
|
@@ -5,21 +5,22 @@
|
|
|
5
5
|
},
|
|
6
6
|
"description": "Enhance your React apps with advanced scroll detection using @smakss/react-scroll-direction. This powerful hook not only detects scroll direction but also provides scroll position information. Ideal for React, Remix, Next.js, and Gatsby projects, it comes with adjustable sensitivity and supports ES Modules.",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@commitlint/cli": "^
|
|
9
|
-
"@commitlint/config-conventional": "^
|
|
8
|
+
"@commitlint/cli": "^19.2.1",
|
|
9
|
+
"@commitlint/config-conventional": "^19.1.0",
|
|
10
10
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
11
11
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
12
|
-
"@types/react": "^18.2.
|
|
13
|
-
"@typescript-eslint/eslint-plugin": "^7.0
|
|
14
|
-
"@typescript-eslint/parser": "^7.0
|
|
15
|
-
"eslint": "^8.
|
|
12
|
+
"@types/react": "^18.2.74",
|
|
13
|
+
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
14
|
+
"@typescript-eslint/parser": "^7.5.0",
|
|
15
|
+
"eslint": "^8.57.0",
|
|
16
16
|
"eslint-config-prettier": "^9.1.0",
|
|
17
17
|
"eslint-plugin-prettier": "^5.1.3",
|
|
18
|
-
"
|
|
18
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
19
|
+
"husky": "^9.0.11",
|
|
19
20
|
"lint-staged": "^15.2.2",
|
|
20
21
|
"prettier": "^3.2.5",
|
|
21
|
-
"rollup": "^4.
|
|
22
|
-
"typescript": "^5.
|
|
22
|
+
"rollup": "^4.14.0",
|
|
23
|
+
"typescript": "^5.4.4"
|
|
23
24
|
},
|
|
24
25
|
"engines": {
|
|
25
26
|
"node": ">=18.0.0"
|
|
@@ -74,9 +75,10 @@
|
|
|
74
75
|
"lint": "eslint --cache --cache-location ./node_modules/.cache/.eslintcache --ext js,jsx,ts,tsx --max-warnings=0 .",
|
|
75
76
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
76
77
|
"setup": "yarn && husky install",
|
|
77
|
-
"typecheck": "tsc -b ."
|
|
78
|
+
"typecheck": "tsc -b .",
|
|
79
|
+
"update:deps": "rm -rf node_modules yarn.lock && ncu -u && yarn"
|
|
78
80
|
},
|
|
79
81
|
"type": "module",
|
|
80
82
|
"types": "./dist/index.d.ts",
|
|
81
|
-
"version": "4.0
|
|
83
|
+
"version": "4.1.0"
|
|
82
84
|
}
|