@smakss/react-scroll-direction 2.1.1 → 3.0.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/Readme.md +2 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +15 -4
package/Readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# React Scroll Direction Hook
|
|
2
2
|
|
|
3
|
-
     
|
|
4
4
|
|
|
5
5
|
`@smakss/react-scroll-direction` is a versatile, lightweight React hook that detects scroll direction in your application with ease. You can fine-tune its sensitivity using an adjustable threshold, catering to your application's unique needs.
|
|
6
6
|
|
|
@@ -60,7 +60,7 @@ The `useDetectScroll` hook takes an options object that can include the followin
|
|
|
60
60
|
To detect upward or downward scroll:
|
|
61
61
|
|
|
62
62
|
```js
|
|
63
|
-
const scrollDir = useDetectScroll(
|
|
63
|
+
const scrollDir = useDetectScroll();
|
|
64
64
|
|
|
65
65
|
// Returns: "up", "down", or "still"
|
|
66
66
|
```
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -54,5 +54,5 @@ type ScrollProps = {
|
|
|
54
54
|
*
|
|
55
55
|
* @returns {Direction} - The current direction of scrolling.
|
|
56
56
|
*/
|
|
57
|
-
declare function useDetectScroll(props
|
|
57
|
+
declare function useDetectScroll(props?: ScrollProps): Direction;
|
|
58
58
|
export default useDetectScroll;
|
package/dist/cjs/index.js
CHANGED
|
@@ -54,12 +54,12 @@ exports.Direction = void 0;
|
|
|
54
54
|
*
|
|
55
55
|
* @returns {Direction} - The current direction of scrolling.
|
|
56
56
|
*/
|
|
57
|
-
function useDetectScroll(props) {
|
|
57
|
+
function useDetectScroll(props = {}) {
|
|
58
58
|
const { thr = 0, axis = exports.Axis.Y, scrollUp = axis === exports.Axis.Y ? exports.Direction.Up : exports.Direction.Left, scrollDown = axis === exports.Axis.Y ? exports.Direction.Down : exports.Direction.Right, still = exports.Direction.Still, } = props;
|
|
59
59
|
const [scrollDir, setScrollDir] = react.useState(still);
|
|
60
60
|
const threshold = Math.max(0, thr);
|
|
61
61
|
let ticking = false;
|
|
62
|
-
let lastScroll =
|
|
62
|
+
let lastScroll = 0;
|
|
63
63
|
/** Function to update scroll direction */
|
|
64
64
|
const updateScrollDir = react.useCallback(() => {
|
|
65
65
|
const scroll = axis === exports.Axis.Y ? window.scrollY : window.scrollX;
|
|
@@ -70,6 +70,7 @@ function useDetectScroll(props) {
|
|
|
70
70
|
ticking = false;
|
|
71
71
|
}, [axis, threshold, scrollDown, scrollUp]);
|
|
72
72
|
react.useEffect(() => {
|
|
73
|
+
lastScroll = axis === exports.Axis.Y ? window.scrollY : window.scrollX;
|
|
73
74
|
/** Function to handle onScroll event */
|
|
74
75
|
const onScroll = () => {
|
|
75
76
|
if (!ticking) {
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from \"react\";\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from \"react\";\n/** Enumeration for axis values */\nexport var Axis;\n(function (Axis) {\n Axis[\"X\"] = \"x\";\n Axis[\"Y\"] = \"y\";\n})(Axis || (Axis = {}));\n/** Enumeration for direction values */\nexport var Direction;\n(function (Direction) {\n Direction[\"Up\"] = \"up\";\n Direction[\"Down\"] = \"down\";\n Direction[\"Left\"] = \"left\";\n Direction[\"Right\"] = \"right\";\n Direction[\"Still\"] = \"still\";\n})(Direction || (Direction = {}));\n/**\n * useDetectScroll hook.\n *\n * This hook provides a mechanism to detect the scroll direction.\n * It will return the scroll direction as a string (up, down, left, right, or still) based on user scrolling.\n *\n * @example\n *\n * import useDetectScroll, { Axis, Direction } from '@smakss/react-scroll-direction';\n *\n * function App() {\n * const scrollDirection = 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: {scrollDirection}</p>\n * </div>\n * );\n * }\n *\n * @param {ScrollProps} props - The properties related to scrolling.\n * @property {number} props.thr - The threshold value which the scroll difference must exceed to update scroll direction.\n * @property {Axis} props.axis - The axis along which to detect scroll. Can be 'x' or 'y'.\n * @property {Direction} props.scrollUp - The direction to set when scrolling up or left. By default, 'up' for y-axis and 'left' for x-axis.\n * @property {Direction} props.scrollDown - The direction to set when scrolling down or right. By default, 'down' for y-axis and 'right' for x-axis.\n * @property {Direction} props.still - The direction to set when there is no scrolling. By default, 'still'.\n *\n * @returns {Direction} - The current direction of scrolling.\n */\nfunction useDetectScroll(props = {}) {\n const { thr = 0, axis = Axis.Y, scrollUp = axis === Axis.Y ? Direction.Up : Direction.Left, scrollDown = axis === Axis.Y ? Direction.Down : Direction.Right, still = Direction.Still, } = props;\n const [scrollDir, setScrollDir] = useState(still);\n const threshold = Math.max(0, thr);\n let ticking = false;\n let lastScroll = 0;\n /** Function to update scroll direction */\n const updateScrollDir = useCallback(() => {\n const scroll = axis === Axis.Y ? window.scrollY : window.scrollX;\n if (Math.abs(scroll - lastScroll) >= threshold) {\n setScrollDir(scroll > lastScroll ? scrollDown : scrollUp);\n lastScroll = Math.max(0, scroll);\n }\n ticking = false;\n }, [axis, threshold, scrollDown, scrollUp]);\n useEffect(() => {\n lastScroll = axis === Axis.Y ? window.scrollY : window.scrollX;\n /** Function to handle onScroll event */\n const onScroll = () => {\n if (!ticking) {\n window.requestAnimationFrame(updateScrollDir);\n ticking = true;\n }\n };\n window.addEventListener(\"scroll\", onScroll);\n return () => window.removeEventListener(\"scroll\", onScroll);\n }, [updateScrollDir]);\n return scrollDir;\n}\nexport default useDetectScroll;\n//# sourceMappingURL=index.js.map"],"names":["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,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACpE,KAAK,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;AAC1B,IAAI,OAAO,SAAS,CAAC;AACrB;;;;"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -54,5 +54,5 @@ type ScrollProps = {
|
|
|
54
54
|
*
|
|
55
55
|
* @returns {Direction} - The current direction of scrolling.
|
|
56
56
|
*/
|
|
57
|
-
declare function useDetectScroll(props
|
|
57
|
+
declare function useDetectScroll(props?: ScrollProps): Direction;
|
|
58
58
|
export default useDetectScroll;
|
package/dist/esm/index.js
CHANGED
|
@@ -50,12 +50,12 @@ var Direction;
|
|
|
50
50
|
*
|
|
51
51
|
* @returns {Direction} - The current direction of scrolling.
|
|
52
52
|
*/
|
|
53
|
-
function useDetectScroll(props) {
|
|
53
|
+
function useDetectScroll(props = {}) {
|
|
54
54
|
const { thr = 0, axis = Axis.Y, scrollUp = axis === Axis.Y ? Direction.Up : Direction.Left, scrollDown = axis === Axis.Y ? Direction.Down : Direction.Right, still = Direction.Still, } = props;
|
|
55
55
|
const [scrollDir, setScrollDir] = useState(still);
|
|
56
56
|
const threshold = Math.max(0, thr);
|
|
57
57
|
let ticking = false;
|
|
58
|
-
let lastScroll =
|
|
58
|
+
let lastScroll = 0;
|
|
59
59
|
/** Function to update scroll direction */
|
|
60
60
|
const updateScrollDir = useCallback(() => {
|
|
61
61
|
const scroll = axis === Axis.Y ? window.scrollY : window.scrollX;
|
|
@@ -66,6 +66,7 @@ function useDetectScroll(props) {
|
|
|
66
66
|
ticking = false;
|
|
67
67
|
}, [axis, threshold, scrollDown, scrollUp]);
|
|
68
68
|
useEffect(() => {
|
|
69
|
+
lastScroll = axis === Axis.Y ? window.scrollY : window.scrollX;
|
|
69
70
|
/** Function to handle onScroll event */
|
|
70
71
|
const onScroll = () => {
|
|
71
72
|
if (!ticking) {
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from \"react\";\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from \"react\";\n/** Enumeration for axis values */\nexport var Axis;\n(function (Axis) {\n Axis[\"X\"] = \"x\";\n Axis[\"Y\"] = \"y\";\n})(Axis || (Axis = {}));\n/** Enumeration for direction values */\nexport var Direction;\n(function (Direction) {\n Direction[\"Up\"] = \"up\";\n Direction[\"Down\"] = \"down\";\n Direction[\"Left\"] = \"left\";\n Direction[\"Right\"] = \"right\";\n Direction[\"Still\"] = \"still\";\n})(Direction || (Direction = {}));\n/**\n * useDetectScroll hook.\n *\n * This hook provides a mechanism to detect the scroll direction.\n * It will return the scroll direction as a string (up, down, left, right, or still) based on user scrolling.\n *\n * @example\n *\n * import useDetectScroll, { Axis, Direction } from '@smakss/react-scroll-direction';\n *\n * function App() {\n * const scrollDirection = 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: {scrollDirection}</p>\n * </div>\n * );\n * }\n *\n * @param {ScrollProps} props - The properties related to scrolling.\n * @property {number} props.thr - The threshold value which the scroll difference must exceed to update scroll direction.\n * @property {Axis} props.axis - The axis along which to detect scroll. Can be 'x' or 'y'.\n * @property {Direction} props.scrollUp - The direction to set when scrolling up or left. By default, 'up' for y-axis and 'left' for x-axis.\n * @property {Direction} props.scrollDown - The direction to set when scrolling down or right. By default, 'down' for y-axis and 'right' for x-axis.\n * @property {Direction} props.still - The direction to set when there is no scrolling. By default, 'still'.\n *\n * @returns {Direction} - The current direction of scrolling.\n */\nfunction useDetectScroll(props = {}) {\n const { thr = 0, axis = Axis.Y, scrollUp = axis === Axis.Y ? Direction.Up : Direction.Left, scrollDown = axis === Axis.Y ? Direction.Down : Direction.Right, still = Direction.Still, } = props;\n const [scrollDir, setScrollDir] = useState(still);\n const threshold = Math.max(0, thr);\n let ticking = false;\n let lastScroll = 0;\n /** Function to update scroll direction */\n const updateScrollDir = useCallback(() => {\n const scroll = axis === Axis.Y ? window.scrollY : window.scrollX;\n if (Math.abs(scroll - lastScroll) >= threshold) {\n setScrollDir(scroll > lastScroll ? scrollDown : scrollUp);\n lastScroll = Math.max(0, scroll);\n }\n ticking = false;\n }, [axis, threshold, scrollDown, scrollUp]);\n useEffect(() => {\n lastScroll = axis === Axis.Y ? window.scrollY : window.scrollX;\n /** Function to handle onScroll event */\n const onScroll = () => {\n if (!ticking) {\n window.requestAnimationFrame(updateScrollDir);\n ticking = true;\n }\n };\n window.addEventListener(\"scroll\", onScroll);\n return () => window.removeEventListener(\"scroll\", onScroll);\n }, [updateScrollDir]);\n return scrollDir;\n}\nexport default useDetectScroll;\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;AACA;AACU,IAAC,KAAK;AAChB,CAAC,UAAU,IAAI,EAAE;AACjB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AACpB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AACpB,CAAC,EAAE,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC;AACxB;AACU,IAAC,UAAU;AACrB,CAAC,UAAU,SAAS,EAAE;AACtB,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAC3B,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAC/B,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAC/B,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACjC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACjC,CAAC,EAAE,SAAS,KAAK,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC;AAClC;AAC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OAAO,GAAG,KAAK,CAAC;AACxB,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAChD,IAAI,SAAS,CAAC,MAAM;AACpB,QAAQ,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACvE;AACA,QAAQ,MAAM,QAAQ,GAAG,MAAM;AAC/B,YAAY,IAAI,CAAC,OAAO,EAAE;AAC1B,gBAAgB,MAAM,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;AAC9D,gBAAgB,OAAO,GAAG,IAAI,CAAC;AAC/B,aAAa;AACb,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACpD,QAAQ,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACpE,KAAK,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;AAC1B,IAAI,OAAO,SAAS,CAAC;AACrB;;;;"}
|
package/package.json
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
},
|
|
6
6
|
"description": "Detect scroll direction in react applications.",
|
|
7
7
|
"devDependencies": {
|
|
8
|
+
"@commitlint/cli": "^17.7.1",
|
|
9
|
+
"@commitlint/config-conventional": "^17.7.0",
|
|
8
10
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
9
11
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
10
12
|
"@rollup/plugin-typescript": "^11.1.1",
|
|
@@ -12,8 +14,10 @@
|
|
|
12
14
|
"@typescript-eslint/eslint-plugin": "^5.59.6",
|
|
13
15
|
"@typescript-eslint/parser": "^5.59.6",
|
|
14
16
|
"eslint": "^8.41.0",
|
|
15
|
-
"eslint-config-prettier": "
|
|
17
|
+
"eslint-config-prettier": "8.8.0",
|
|
16
18
|
"eslint-plugin-prettier": "^4.2.1",
|
|
19
|
+
"husky": "^8.0.3",
|
|
20
|
+
"lint-staged": "^14.0.1",
|
|
17
21
|
"prettier": "^2.8.8",
|
|
18
22
|
"rollup": "^3.2.3",
|
|
19
23
|
"typescript": "^5.0.4"
|
|
@@ -30,6 +34,9 @@
|
|
|
30
34
|
"npm",
|
|
31
35
|
"yarn",
|
|
32
36
|
"react",
|
|
37
|
+
"remix",
|
|
38
|
+
"nextjs",
|
|
39
|
+
"gatsby",
|
|
33
40
|
"scroll",
|
|
34
41
|
"direction",
|
|
35
42
|
"SMAKSS",
|
|
@@ -52,10 +59,14 @@
|
|
|
52
59
|
"url": "git+https://github.com/SMAKSS/react-scroll-direction.git"
|
|
53
60
|
},
|
|
54
61
|
"scripts": {
|
|
62
|
+
"format": "prettier --write \"**/*.+(js|jsx|json|yml|yaml|css|ts|tsx|md|gql|graphql|mdx)\"",
|
|
63
|
+
"format:check": "prettier -l \"**/*.+(js|jsx|json|yml|yaml|css|ts|tsx|md|gql|graphql|mdx)\"",
|
|
55
64
|
"generate": "rollup -c",
|
|
56
|
-
"lint": "
|
|
57
|
-
"lint:fix": "eslint src/**/*.ts --fix"
|
|
65
|
+
"lint": "eslint --cache --cache-location ./node_modules/.cache/.eslintcache --ext js,jsx,ts,tsx --max-warnings=0 .",
|
|
66
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
67
|
+
"postinstall": "husky install",
|
|
68
|
+
"typecheck": "tsc -b ."
|
|
58
69
|
},
|
|
59
70
|
"type": "module",
|
|
60
|
-
"version": "
|
|
71
|
+
"version": "3.0.0"
|
|
61
72
|
}
|