@aiszlab/relax 1.2.75 → 1.3.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,5 +1,5 @@
|
|
|
1
1
|
import { useRef, useCallback } from 'react';
|
|
2
|
-
import { scrollTo } from '
|
|
2
|
+
import { scrollTo as _scrollTo } from '../dom/scroll-to.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @description
|
|
@@ -11,12 +11,12 @@ var useScrollable = function useScrollable() {
|
|
|
11
11
|
orientation = _ref$orientation === void 0 ? "vertical" : _ref$orientation;
|
|
12
12
|
var targetRef = useRef(null);
|
|
13
13
|
var triggerRefs = useRef(new Map());
|
|
14
|
-
var scrollTo
|
|
14
|
+
var scrollTo = useCallback(function (to) {
|
|
15
15
|
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
16
16
|
var target = targetRef.current;
|
|
17
17
|
if (!target) return;
|
|
18
18
|
// use animated scroll
|
|
19
|
-
|
|
19
|
+
_scrollTo(target, to, {
|
|
20
20
|
duration: duration,
|
|
21
21
|
orientation: orientation
|
|
22
22
|
});
|
|
@@ -34,7 +34,7 @@ var useScrollable = function useScrollable() {
|
|
|
34
34
|
return {
|
|
35
35
|
targetRef: targetRef,
|
|
36
36
|
triggerRefs: triggerRefs,
|
|
37
|
-
scrollTo: scrollTo
|
|
37
|
+
scrollTo: scrollTo,
|
|
38
38
|
to: to,
|
|
39
39
|
setTrigger: setTrigger
|
|
40
40
|
};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import type { Voidable } from "../types";
|
|
2
|
-
export type Node = {
|
|
3
|
-
nodeType?: number;
|
|
4
|
-
};
|
|
5
1
|
/**
|
|
6
2
|
* @description
|
|
7
3
|
* is html element
|
|
8
4
|
*/
|
|
9
|
-
export declare const isHTMLElement: (value:
|
|
5
|
+
export declare const isHTMLElement: (value: unknown) => value is HTMLElement;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Voidable } from "../types";
|
|
2
|
-
import { type Node } from "./is-html-element";
|
|
3
2
|
/**
|
|
4
3
|
* @param value - The element being tested
|
|
5
4
|
* @returns Returns true if x is an HTML input tag, false otherwise
|
|
6
5
|
*/
|
|
7
|
-
export declare const isHTMLInputElement: (value: Voidable<
|
|
6
|
+
export declare const isHTMLInputElement: (value: Voidable<EventTarget>) => value is HTMLInputElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiszlab/relax",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "react utils collection",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"publish:npm": "npm publish"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@babel/runtime": "^7.25.
|
|
26
|
+
"@babel/runtime": "^7.25.6",
|
|
27
27
|
"react-is": "^18.3.1",
|
|
28
28
|
"rxjs": "^7.8.1"
|
|
29
29
|
},
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"@rollup/plugin-babel": "^6.0.4",
|
|
38
38
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
39
39
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
40
|
-
"@testing-library/react": "^16.0.
|
|
41
|
-
"@types/react": "^18.3.
|
|
40
|
+
"@testing-library/react": "^16.0.1",
|
|
41
|
+
"@types/react": "^18.3.5",
|
|
42
42
|
"@types/react-dom": "^18.3.0",
|
|
43
43
|
"@types/react-is": "^18.3.0",
|
|
44
44
|
"jest": "^29.7.0",
|
|
45
45
|
"jest-environment-jsdom": "^29.7.0",
|
|
46
46
|
"react": "^18.3.1",
|
|
47
47
|
"react-dom": "^18.3.1",
|
|
48
|
-
"rollup": "^4.21.
|
|
48
|
+
"rollup": "^4.21.2",
|
|
49
49
|
"typescript": "5.5.4"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|