@aiszlab/relax 1.2.37 → 1.2.38
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.js +2 -0
- package/dist/hooks/{use-controlled-state.mjs → use-controlled-state.js} +3 -3
- package/dist/hooks/{use-counter.mjs → use-counter.js} +2 -2
- package/dist/hooks/{use-debounce-callback.mjs → use-debounce-callback.js} +4 -4
- package/dist/hooks/{use-default.mjs → use-default.js} +1 -1
- package/dist/hooks/{use-focus.mjs → use-focus.js} +2 -2
- package/dist/hooks/{use-hover.mjs → use-hover.js} +2 -2
- package/dist/hooks/{use-mount.mjs → use-mount.js} +1 -1
- package/dist/hooks/{use-mounted.mjs → use-mounted.js} +1 -1
- package/dist/hooks/{use-refs.mjs → use-refs.js} +1 -1
- package/dist/hooks/{use-scroll-locker.mjs → use-scroll-locker.js} +2 -2
- package/dist/hooks/{use-scrollable.mjs → use-scrollable.js} +1 -1
- package/dist/hooks/{use-throttle-callback.mjs → use-throttle-callback.js} +4 -4
- package/dist/hooks/{use-toggleable.mjs → use-toggleable.js} +1 -1
- package/dist/hooks/{use-update-effect.mjs → use-update-effect.js} +2 -2
- package/dist/index.js +42 -0
- package/dist/is/{is-empty.mjs → is-empty.js} +2 -2
- package/dist/is/{is-void.mjs → is-void.js} +2 -2
- package/dist/utils/{debounce.mjs → debounce.js} +1 -1
- package/dist/utils/{effect.mjs → effect.js} +1 -1
- package/dist/utils/{throttle.mjs → throttle.js} +2 -2
- package/dist/utils/{to-function.mjs → to-function.js} +1 -1
- package/package.json +3 -3
- package/dist/dom/index.mjs +0 -2
- package/dist/index.mjs +0 -42
- /package/dist/dom/{contains.mjs → contains.js} +0 -0
- /package/dist/dom/{scroll-to.mjs → scroll-to.js} +0 -0
- /package/dist/hooks/{use-boolean.mjs → use-boolean.js} +0 -0
- /package/dist/hooks/{use-event.mjs → use-event.js} +0 -0
- /package/dist/hooks/{use-force-update.mjs → use-force-update.js} +0 -0
- /package/dist/hooks/{use-image-loader.mjs → use-image-loader.js} +0 -0
- /package/dist/hooks/{use-memorable.mjs → use-memorable.js} +0 -0
- /package/dist/hooks/{use-timeout.mjs → use-timeout.js} +0 -0
- /package/dist/is/{is-array.mjs → is-array.js} +0 -0
- /package/dist/is/{is-complex.mjs → is-complex.js} +0 -0
- /package/dist/is/{is-dom-usable.mjs → is-dom-usable.js} +0 -0
- /package/dist/is/{is-function.mjs → is-function.js} +0 -0
- /package/dist/is/{is-mobile.mjs → is-mobile.js} +0 -0
- /package/dist/is/{is-null.mjs → is-null.js} +0 -0
- /package/dist/is/{is-overflow.mjs → is-overflow.js} +0 -0
- /package/dist/is/{is-refable.mjs → is-refable.js} +0 -0
- /package/dist/is/{is-state-getter.mjs → is-state-getter.js} +0 -0
- /package/dist/is/{is-style-element.mjs → is-style-element.js} +0 -0
- /package/dist/is/{is-thenable.mjs → is-thenable.js} +0 -0
- /package/dist/is/{is-undefined.mjs → is-undefined.js} +0 -0
- /package/dist/utils/{chain.mjs → chain.js} +0 -0
- /package/dist/utils/{clamp.mjs → clamp.js} +0 -0
- /package/dist/utils/{range.mjs → range.js} +0 -0
- /package/dist/utils/{set-style.mjs → set-style.js} +0 -0
- /package/dist/utils/{to-array.mjs → to-array.js} +0 -0
- /package/dist/utils/{unique.mjs → unique.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
-
import { isStateGetter } from '../is/is-state-getter.
|
|
3
|
-
import { isUndefined } from '../is/is-undefined.
|
|
4
|
-
import { useUpdateEffect } from './use-update-effect.
|
|
2
|
+
import { isStateGetter } from '../is/is-state-getter.js';
|
|
3
|
+
import { isUndefined } from '../is/is-undefined.js';
|
|
4
|
+
import { useUpdateEffect } from './use-update-effect.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @author murukal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useCallback, useMemo } from 'react';
|
|
2
|
-
import { clamp } from '../utils/clamp.
|
|
3
|
-
import { useDefault } from './use-default.
|
|
2
|
+
import { clamp } from '../utils/clamp.js';
|
|
3
|
+
import { useDefault } from './use-default.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @author murukal
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useRef, useEffect, useMemo } from 'react';
|
|
2
|
-
import { debounce } from '../utils/debounce.
|
|
3
|
-
import { useEvent } from './use-event.
|
|
4
|
-
import { isFunction } from '../is/is-function.
|
|
5
|
-
import { useDefault } from './use-default.
|
|
2
|
+
import { debounce } from '../utils/debounce.js';
|
|
3
|
+
import { useEvent } from './use-event.js';
|
|
4
|
+
import { isFunction } from '../is/is-function.js';
|
|
5
|
+
import { useDefault } from './use-default.js';
|
|
6
6
|
|
|
7
7
|
const useDebouncer = (debouncer) => {
|
|
8
8
|
const _debouncer = useMemo(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
-
import { useBoolean } from './use-boolean.
|
|
3
|
-
import { chain } from '../utils/chain.
|
|
2
|
+
import { useBoolean } from './use-boolean.js';
|
|
3
|
+
import { chain } from '../utils/chain.js';
|
|
4
4
|
|
|
5
5
|
const useFocus = (props) => {
|
|
6
6
|
const [isFocused, { turnOn, turnOff }] = useBoolean(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
-
import { useBoolean } from './use-boolean.
|
|
3
|
-
import { chain } from '../utils/chain.
|
|
2
|
+
import { useBoolean } from './use-boolean.js';
|
|
3
|
+
import { chain } from '../utils/chain.js';
|
|
4
4
|
|
|
5
5
|
const useHover = (props) => {
|
|
6
6
|
const [isHovered, { turnOn, turnOff }] = useBoolean(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useLayoutEffect } from 'react';
|
|
2
|
-
import { isOverflow } from '../is/is-overflow.
|
|
3
|
-
import { setStyle } from '../utils/set-style.
|
|
2
|
+
import { isOverflow } from '../is/is-overflow.js';
|
|
3
|
+
import { setStyle } from '../utils/set-style.js';
|
|
4
4
|
|
|
5
5
|
class ScrollLocker {
|
|
6
6
|
// singleton mode
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useRef, useEffect, useMemo } from 'react';
|
|
2
|
-
import { throttle } from '../utils/throttle.
|
|
3
|
-
import { useEvent } from './use-event.
|
|
4
|
-
import { isFunction } from '../is/is-function.
|
|
5
|
-
import { useDefault } from './use-default.
|
|
2
|
+
import { throttle } from '../utils/throttle.js';
|
|
3
|
+
import { useEvent } from './use-event.js';
|
|
4
|
+
import { isFunction } from '../is/is-function.js';
|
|
5
|
+
import { useDefault } from './use-default.js';
|
|
6
6
|
|
|
7
7
|
const useThrottler = (debouncer) => {
|
|
8
8
|
const _debouncer = useMemo(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef, useEffect } from 'react';
|
|
2
|
-
import { useMounted } from './use-mounted.
|
|
3
|
-
import { effect } from '../utils/effect.
|
|
2
|
+
import { useMounted } from './use-mounted.js';
|
|
3
|
+
import { effect } from '../utils/effect.js';
|
|
4
4
|
|
|
5
5
|
const useUpdateEffect = (callback, deps) => {
|
|
6
6
|
const isMounted = useRef(false);
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export { useBoolean } from './hooks/use-boolean.js';
|
|
2
|
+
export { useDebounceCallback } from './hooks/use-debounce-callback.js';
|
|
3
|
+
export { useThrottleCallback } from './hooks/use-throttle-callback.js';
|
|
4
|
+
export { useImageLoader } from './hooks/use-image-loader.js';
|
|
5
|
+
export { useMount } from './hooks/use-mount.js';
|
|
6
|
+
export { useMounted } from './hooks/use-mounted.js';
|
|
7
|
+
export { useTimeout } from './hooks/use-timeout.js';
|
|
8
|
+
export { useControlledState } from './hooks/use-controlled-state.js';
|
|
9
|
+
export { useDefault } from './hooks/use-default.js';
|
|
10
|
+
export { useScrollLocker } from './hooks/use-scroll-locker.js';
|
|
11
|
+
export { useForceUpdate } from './hooks/use-force-update.js';
|
|
12
|
+
export { useScrollable } from './hooks/use-scrollable.js';
|
|
13
|
+
export { useRefs } from './hooks/use-refs.js';
|
|
14
|
+
export { useToggleable } from './hooks/use-toggleable.js';
|
|
15
|
+
export { useEvent } from './hooks/use-event.js';
|
|
16
|
+
export { useUpdateEffect } from './hooks/use-update-effect.js';
|
|
17
|
+
export { useCounter } from './hooks/use-counter.js';
|
|
18
|
+
export { useHover } from './hooks/use-hover.js';
|
|
19
|
+
export { useFocus } from './hooks/use-focus.js';
|
|
20
|
+
export { useMemorable } from './hooks/use-memorable.js';
|
|
21
|
+
export { isRefable } from './is/is-refable.js';
|
|
22
|
+
export { isUndefined } from './is/is-undefined.js';
|
|
23
|
+
export { isStateGetter } from './is/is-state-getter.js';
|
|
24
|
+
export { isNull } from './is/is-null.js';
|
|
25
|
+
export { isVoid } from './is/is-void.js';
|
|
26
|
+
export { isArray } from './is/is-array.js';
|
|
27
|
+
export { isComplex } from './is/is-complex.js';
|
|
28
|
+
export { isEmpty } from './is/is-empty.js';
|
|
29
|
+
export { isDomUsable } from './is/is-dom-usable.js';
|
|
30
|
+
export { isMobile } from './is/is-mobile.js';
|
|
31
|
+
export { isOverflow } from './is/is-overflow.js';
|
|
32
|
+
export { isStyleElement } from './is/is-style-element.js';
|
|
33
|
+
export { isFunction } from './is/is-function.js';
|
|
34
|
+
export { isThenable } from './is/is-thenable.js';
|
|
35
|
+
export { effect } from './utils/effect.js';
|
|
36
|
+
export { unique, uniqueBy } from './utils/unique.js';
|
|
37
|
+
export { range } from './utils/range.js';
|
|
38
|
+
export { clamp } from './utils/clamp.js';
|
|
39
|
+
export { chain } from './utils/chain.js';
|
|
40
|
+
export { debounce } from './utils/debounce.js';
|
|
41
|
+
export { toArray } from './utils/to-array.js';
|
|
42
|
+
export { toFunction } from './utils/to-function.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Trigger } from './debounce.
|
|
2
|
-
import { isFunction } from '../is/is-function.
|
|
1
|
+
import { Trigger } from './debounce.js';
|
|
2
|
+
import { isFunction } from '../is/is-function.js';
|
|
3
3
|
|
|
4
4
|
const throttle = (throttler, duration) => {
|
|
5
5
|
const _isFunction = isFunction(throttler);
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiszlab/relax",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.38",
|
|
4
4
|
"description": "react utils collection",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
-
"default": "./dist/index.
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"./dom": {
|
|
12
12
|
"types": "./dist/dom/index.d.ts",
|
|
13
|
-
"default": "./dist/dom/index.
|
|
13
|
+
"default": "./dist/dom/index.js"
|
|
14
14
|
},
|
|
15
15
|
"./types": "./dist/types/index.d.ts"
|
|
16
16
|
},
|
package/dist/dom/index.mjs
DELETED
package/dist/index.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export { useBoolean } from './hooks/use-boolean.mjs';
|
|
2
|
-
export { useDebounceCallback } from './hooks/use-debounce-callback.mjs';
|
|
3
|
-
export { useThrottleCallback } from './hooks/use-throttle-callback.mjs';
|
|
4
|
-
export { useImageLoader } from './hooks/use-image-loader.mjs';
|
|
5
|
-
export { useMount } from './hooks/use-mount.mjs';
|
|
6
|
-
export { useMounted } from './hooks/use-mounted.mjs';
|
|
7
|
-
export { useTimeout } from './hooks/use-timeout.mjs';
|
|
8
|
-
export { useControlledState } from './hooks/use-controlled-state.mjs';
|
|
9
|
-
export { useDefault } from './hooks/use-default.mjs';
|
|
10
|
-
export { useScrollLocker } from './hooks/use-scroll-locker.mjs';
|
|
11
|
-
export { useForceUpdate } from './hooks/use-force-update.mjs';
|
|
12
|
-
export { useScrollable } from './hooks/use-scrollable.mjs';
|
|
13
|
-
export { useRefs } from './hooks/use-refs.mjs';
|
|
14
|
-
export { useToggleable } from './hooks/use-toggleable.mjs';
|
|
15
|
-
export { useEvent } from './hooks/use-event.mjs';
|
|
16
|
-
export { useUpdateEffect } from './hooks/use-update-effect.mjs';
|
|
17
|
-
export { useCounter } from './hooks/use-counter.mjs';
|
|
18
|
-
export { useHover } from './hooks/use-hover.mjs';
|
|
19
|
-
export { useFocus } from './hooks/use-focus.mjs';
|
|
20
|
-
export { useMemorable } from './hooks/use-memorable.mjs';
|
|
21
|
-
export { isRefable } from './is/is-refable.mjs';
|
|
22
|
-
export { isUndefined } from './is/is-undefined.mjs';
|
|
23
|
-
export { isStateGetter } from './is/is-state-getter.mjs';
|
|
24
|
-
export { isNull } from './is/is-null.mjs';
|
|
25
|
-
export { isVoid } from './is/is-void.mjs';
|
|
26
|
-
export { isArray } from './is/is-array.mjs';
|
|
27
|
-
export { isComplex } from './is/is-complex.mjs';
|
|
28
|
-
export { isEmpty } from './is/is-empty.mjs';
|
|
29
|
-
export { isDomUsable } from './is/is-dom-usable.mjs';
|
|
30
|
-
export { isMobile } from './is/is-mobile.mjs';
|
|
31
|
-
export { isOverflow } from './is/is-overflow.mjs';
|
|
32
|
-
export { isStyleElement } from './is/is-style-element.mjs';
|
|
33
|
-
export { isFunction } from './is/is-function.mjs';
|
|
34
|
-
export { isThenable } from './is/is-thenable.mjs';
|
|
35
|
-
export { effect } from './utils/effect.mjs';
|
|
36
|
-
export { unique, uniqueBy } from './utils/unique.mjs';
|
|
37
|
-
export { range } from './utils/range.mjs';
|
|
38
|
-
export { clamp } from './utils/clamp.mjs';
|
|
39
|
-
export { chain } from './utils/chain.mjs';
|
|
40
|
-
export { debounce } from './utils/debounce.mjs';
|
|
41
|
-
export { toArray } from './utils/to-array.mjs';
|
|
42
|
-
export { toFunction } from './utils/to-function.mjs';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|