@aiszlab/relax 2.0.1 → 2.0.3
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/dom/index.cjs +2 -0
- package/dist/dom/index.d.ts +2 -0
- package/dist/dom/index.mjs +1 -0
- package/dist/dom/stop-propagation.cjs +10 -0
- package/dist/dom/stop-propagation.d.ts +8 -0
- package/dist/dom/stop-propagation.mjs +8 -0
- package/dist/hooks/use-async-effect.cjs +11 -0
- package/dist/hooks/use-async-effect.d.ts +1 -0
- package/dist/hooks/use-async-effect.mjs +9 -0
- package/dist/hooks/use-scrollable.d.ts +5 -4
- package/dist/index.cjs +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +2 -0
- package/package.json +2 -3
package/dist/dom/index.cjs
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
var scrollTo = require('./scroll-to.cjs');
|
|
4
4
|
var contains = require('./contains.cjs');
|
|
5
5
|
var clipboard = require('./clipboard.cjs');
|
|
6
|
+
var stopPropagation = require('./stop-propagation.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
exports.scrollTo = scrollTo.scrollTo;
|
|
10
11
|
exports.contains = contains.contains;
|
|
11
12
|
exports.clipboard = clipboard.clipboard;
|
|
13
|
+
exports.stopPropagation = stopPropagation.stopPropagation;
|
package/dist/dom/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { scrollTo, type Orientation } from "./scroll-to";
|
|
2
2
|
import { contains, type Containable } from "./contains";
|
|
3
3
|
import { clipboard } from "./clipboard";
|
|
4
|
+
import { stopPropagation } from "./stop-propagation";
|
|
4
5
|
export { clipboard };
|
|
5
6
|
export { scrollTo, contains };
|
|
7
|
+
export { stopPropagation };
|
|
6
8
|
export type { Containable, Orientation };
|
package/dist/dom/index.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useAsyncEffect: (effect: () => Promise<void>, deps?: unknown[]) => void;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { type Key } from "react";
|
|
2
2
|
import { type Orientation } from "../dom";
|
|
3
|
-
|
|
3
|
+
import type { Nullable } from "../types";
|
|
4
|
+
interface UsingScrollable {
|
|
4
5
|
orientation?: Orientation;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* @description
|
|
8
9
|
* scrollable hook
|
|
9
10
|
*/
|
|
10
|
-
export declare const useScrollable: <P extends HTMLElement, C extends HTMLElement>({ orientation, }?:
|
|
11
|
+
export declare const useScrollable: <P extends HTMLElement, C extends HTMLElement>({ orientation, }?: UsingScrollable) => {
|
|
11
12
|
targetRef: import("react").RefObject<P | null>;
|
|
12
|
-
triggerRefs: import("react").RefObject<Map<Key, C
|
|
13
|
+
triggerRefs: import("react").RefObject<Map<Key, Nullable<C>>>;
|
|
13
14
|
scrollTo: (to: number, duration?: number) => void;
|
|
14
15
|
to: (key: Key) => number;
|
|
15
|
-
setTrigger: (key: Key, trigger: C) => void;
|
|
16
|
+
setTrigger: (key: Key, trigger: Nullable<C>) => void;
|
|
16
17
|
};
|
|
17
18
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -39,6 +39,7 @@ var useDrag = require('./hooks/use-drag.cjs');
|
|
|
39
39
|
var useEventSource = require('./hooks/use-event-source.cjs');
|
|
40
40
|
var useResize = require('./hooks/use-resize.cjs');
|
|
41
41
|
var useDraggable = require('./hooks/use-draggable.cjs');
|
|
42
|
+
var useAsyncEffect = require('./hooks/use-async-effect.cjs');
|
|
42
43
|
var isRefable = require('./is/is-refable.cjs');
|
|
43
44
|
var isUndefined = require('./is/is-undefined.cjs');
|
|
44
45
|
var isNull = require('./is/is-null.cjs');
|
|
@@ -77,6 +78,7 @@ var merge = require('./utils/merge.cjs');
|
|
|
77
78
|
var max = require('./utils/max.cjs');
|
|
78
79
|
var min = require('./utils/min.cjs');
|
|
79
80
|
var load = require('./utils/load.cjs');
|
|
81
|
+
var at = require('./utils/at.cjs');
|
|
80
82
|
|
|
81
83
|
|
|
82
84
|
|
|
@@ -119,6 +121,7 @@ exports.useDrag = useDrag.useDrag;
|
|
|
119
121
|
exports.useEventSource = useEventSource.useEventSource;
|
|
120
122
|
exports.useResize = useResize.useResize;
|
|
121
123
|
exports.useDraggable = useDraggable.useDraggable;
|
|
124
|
+
exports.useAsyncEffect = useAsyncEffect.useAsyncEffect;
|
|
122
125
|
exports.isRefable = isRefable.isRefable;
|
|
123
126
|
exports.isUndefined = isUndefined.isUndefined;
|
|
124
127
|
exports.isNull = isNull.isNull;
|
|
@@ -157,3 +160,4 @@ exports.merge = merge.merge;
|
|
|
157
160
|
exports.max = max.max;
|
|
158
161
|
exports.min = min.min;
|
|
159
162
|
exports.load = load.load;
|
|
163
|
+
exports.at = at.at;
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export { useDrag } from "./hooks/use-drag";
|
|
|
41
41
|
export { useEventSource } from "./hooks/use-event-source";
|
|
42
42
|
export { useResize } from "./hooks/use-resize";
|
|
43
43
|
export { useDraggable } from "./hooks/use-draggable";
|
|
44
|
+
export { useAsyncEffect } from "./hooks/use-async-effect";
|
|
44
45
|
/**
|
|
45
46
|
* @description
|
|
46
47
|
* is
|
|
@@ -87,3 +88,4 @@ export { merge } from "./utils/merge";
|
|
|
87
88
|
export { max } from "./utils/max";
|
|
88
89
|
export { min } from "./utils/min";
|
|
89
90
|
export { load } from "./utils/load";
|
|
91
|
+
export { at } from "./utils/at";
|
package/dist/index.mjs
CHANGED
|
@@ -37,6 +37,7 @@ export { useDrag } from './hooks/use-drag.mjs';
|
|
|
37
37
|
export { useEventSource } from './hooks/use-event-source.mjs';
|
|
38
38
|
export { useResize } from './hooks/use-resize.mjs';
|
|
39
39
|
export { useDraggable } from './hooks/use-draggable.mjs';
|
|
40
|
+
export { useAsyncEffect } from './hooks/use-async-effect.mjs';
|
|
40
41
|
export { isRefable } from './is/is-refable.mjs';
|
|
41
42
|
export { isUndefined } from './is/is-undefined.mjs';
|
|
42
43
|
export { isNull } from './is/is-null.mjs';
|
|
@@ -75,3 +76,4 @@ export { merge } from './utils/merge.mjs';
|
|
|
75
76
|
export { max } from './utils/max.mjs';
|
|
76
77
|
export { min } from './utils/min.mjs';
|
|
77
78
|
export { load } from './utils/load.mjs';
|
|
79
|
+
export { at } from './utils/at.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiszlab/relax",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "react utils collection",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"build": "rollup -c",
|
|
70
70
|
"clean:build": "rm -rf dist",
|
|
71
71
|
"test": "jest",
|
|
72
|
-
"test:coverage": "jest --coverage"
|
|
73
|
-
"publish:npm": "npm publish"
|
|
72
|
+
"test:coverage": "jest --coverage"
|
|
74
73
|
}
|
|
75
74
|
}
|