react-simplikit 0.0.53 → 0.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/CHANGELOG.md +106 -0
- package/README.md +2 -2
- package/dist/hooks/useAsyncEffect/useAsyncEffect.cjs +1 -0
- package/dist/hooks/useAsyncEffect/useAsyncEffect.mjs +1 -0
- package/dist/hooks/useCallbackOncePerRender/useCallbackOncePerRender.cjs +1 -0
- package/dist/hooks/useCallbackOncePerRender/useCallbackOncePerRender.mjs +1 -0
- package/dist/hooks/useConditionalEffect/useConditionalEffect.cjs +1 -0
- package/dist/hooks/useConditionalEffect/useConditionalEffect.mjs +1 -0
- package/dist/hooks/useInputState/useInputState.cjs +9 -3
- package/dist/hooks/useInputState/useInputState.d.cts +11 -4
- package/dist/hooks/useInputState/useInputState.d.mts +11 -4
- package/dist/hooks/useInputState/useInputState.mjs +9 -3
- package/dist/hooks/useLoading/useLoading.cjs +3 -5
- package/dist/hooks/useLoading/useLoading.d.cts +2 -5
- package/dist/hooks/useLoading/useLoading.d.mts +2 -5
- package/dist/hooks/useLoading/useLoading.mjs +3 -5
- package/dist/hooks/usePreservedReference/usePreservedReference.cjs +1 -0
- package/dist/hooks/usePreservedReference/usePreservedReference.mjs +1 -0
- package/dist/hooks/useRefEffect/useRefEffect.cjs +1 -0
- package/dist/hooks/useRefEffect/useRefEffect.mjs +1 -0
- package/dist/hooks/useStorageState/useStorageState.cjs +1 -0
- package/dist/hooks/useStorageState/useStorageState.mjs +1 -0
- package/dist/index.cjs +34 -0
- package/dist/index.d.cts +19 -1
- package/dist/index.d.mts +19 -1
- package/dist/index.mjs +18 -1
- package/dist/mobile/hooks/useAvoidKeyboard/index.d.cts +3 -0
- package/dist/mobile/hooks/useAvoidKeyboard/index.d.mts +3 -0
- package/dist/mobile/hooks/useAvoidKeyboard/useAvoidKeyboard.cjs +75 -0
- package/dist/mobile/hooks/useAvoidKeyboard/useAvoidKeyboard.d.cts +89 -0
- package/dist/mobile/hooks/useAvoidKeyboard/useAvoidKeyboard.d.mts +89 -0
- package/dist/mobile/hooks/useAvoidKeyboard/useAvoidKeyboard.mjs +75 -0
- package/dist/mobile/hooks/useBodyScrollLock/useBodyScrollLock.cjs +47 -0
- package/dist/mobile/hooks/useBodyScrollLock/useBodyScrollLock.d.cts +37 -0
- package/dist/mobile/hooks/useBodyScrollLock/useBodyScrollLock.d.mts +37 -0
- package/dist/mobile/hooks/useBodyScrollLock/useBodyScrollLock.mjs +47 -0
- package/dist/mobile/hooks/useKeyboardHeight/useKeyboardHeight.cjs +41 -0
- package/dist/mobile/hooks/useKeyboardHeight/useKeyboardHeight.d.cts +41 -0
- package/dist/mobile/hooks/useKeyboardHeight/useKeyboardHeight.d.mts +41 -0
- package/dist/mobile/hooks/useKeyboardHeight/useKeyboardHeight.mjs +41 -0
- package/dist/mobile/hooks/useNetworkStatus/useNetworkStatus.cjs +88 -0
- package/dist/mobile/hooks/useNetworkStatus/useNetworkStatus.d.cts +77 -0
- package/dist/mobile/hooks/useNetworkStatus/useNetworkStatus.d.mts +77 -0
- package/dist/mobile/hooks/useNetworkStatus/useNetworkStatus.mjs +88 -0
- package/dist/mobile/hooks/usePageVisibility/usePageVisibility.cjs +73 -0
- package/dist/mobile/hooks/usePageVisibility/usePageVisibility.d.cts +62 -0
- package/dist/mobile/hooks/usePageVisibility/usePageVisibility.d.mts +62 -0
- package/dist/mobile/hooks/usePageVisibility/usePageVisibility.mjs +73 -0
- package/dist/mobile/hooks/useSafeAreaInset/useSafeAreaInset.cjs +74 -0
- package/dist/mobile/hooks/useSafeAreaInset/useSafeAreaInset.d.cts +55 -0
- package/dist/mobile/hooks/useSafeAreaInset/useSafeAreaInset.d.mts +55 -0
- package/dist/mobile/hooks/useSafeAreaInset/useSafeAreaInset.mjs +74 -0
- package/dist/mobile/hooks/useScrollDirection/useScrollDirection.cjs +79 -0
- package/dist/mobile/hooks/useScrollDirection/useScrollDirection.d.cts +40 -0
- package/dist/mobile/hooks/useScrollDirection/useScrollDirection.d.mts +40 -0
- package/dist/mobile/hooks/useScrollDirection/useScrollDirection.mjs +79 -0
- package/dist/mobile/hooks/useVisualViewport/useVisualViewport.cjs +77 -0
- package/dist/mobile/hooks/useVisualViewport/useVisualViewport.d.cts +89 -0
- package/dist/mobile/hooks/useVisualViewport/useVisualViewport.d.mts +89 -0
- package/dist/mobile/hooks/useVisualViewport/useVisualViewport.mjs +77 -0
- package/dist/mobile/utils/disableBodyScrollLock/disableBodyScrollLock.cjs +55 -0
- package/dist/mobile/utils/disableBodyScrollLock/disableBodyScrollLock.d.cts +22 -0
- package/dist/mobile/utils/disableBodyScrollLock/disableBodyScrollLock.d.mts +22 -0
- package/dist/mobile/utils/disableBodyScrollLock/disableBodyScrollLock.mjs +55 -0
- package/dist/mobile/utils/enableBodyScrollLock/enableBodyScrollLock.cjs +49 -0
- package/dist/mobile/utils/enableBodyScrollLock/enableBodyScrollLock.d.cts +23 -0
- package/dist/mobile/utils/enableBodyScrollLock/enableBodyScrollLock.d.mts +23 -0
- package/dist/mobile/utils/enableBodyScrollLock/enableBodyScrollLock.mjs +49 -0
- package/dist/mobile/utils/getKeyboardHeight/getKeyboardHeight.cjs +35 -0
- package/dist/mobile/utils/getKeyboardHeight/getKeyboardHeight.d.cts +28 -0
- package/dist/mobile/utils/getKeyboardHeight/getKeyboardHeight.d.mts +28 -0
- package/dist/mobile/utils/getKeyboardHeight/getKeyboardHeight.mjs +35 -0
- package/dist/mobile/utils/getSafeAreaInset/getSafeAreaInset.cjs +58 -0
- package/dist/mobile/utils/getSafeAreaInset/getSafeAreaInset.d.cts +44 -0
- package/dist/mobile/utils/getSafeAreaInset/getSafeAreaInset.d.mts +44 -0
- package/dist/mobile/utils/getSafeAreaInset/getSafeAreaInset.mjs +58 -0
- package/dist/mobile/utils/isAndroid/isAndroid.cjs +32 -0
- package/dist/mobile/utils/isAndroid/isAndroid.d.cts +27 -0
- package/dist/mobile/utils/isAndroid/isAndroid.d.mts +27 -0
- package/dist/mobile/utils/isAndroid/isAndroid.mjs +32 -0
- package/dist/mobile/utils/isIOS/isIOS.cjs +37 -0
- package/dist/mobile/utils/isIOS/isIOS.d.cts +30 -0
- package/dist/mobile/utils/isIOS/isIOS.d.mts +30 -0
- package/dist/mobile/utils/isIOS/isIOS.mjs +37 -0
- package/dist/mobile/utils/isKeyboardVisible/isKeyboardVisible.cjs +28 -0
- package/dist/mobile/utils/isKeyboardVisible/isKeyboardVisible.d.cts +25 -0
- package/dist/mobile/utils/isKeyboardVisible/isKeyboardVisible.d.mts +25 -0
- package/dist/mobile/utils/isKeyboardVisible/isKeyboardVisible.mjs +28 -0
- package/dist/mobile/utils/isServer/isServer.cjs +24 -0
- package/dist/mobile/utils/isServer/isServer.d.cts +22 -0
- package/dist/mobile/utils/isServer/isServer.d.mts +22 -0
- package/dist/mobile/utils/isServer/isServer.mjs +24 -0
- package/dist/mobile/utils/subscribeKeyboardHeight/subscribeKeyboardHeight.cjs +71 -0
- package/dist/mobile/utils/subscribeKeyboardHeight/subscribeKeyboardHeight.d.cts +64 -0
- package/dist/mobile/utils/subscribeKeyboardHeight/subscribeKeyboardHeight.d.mts +64 -0
- package/dist/mobile/utils/subscribeKeyboardHeight/subscribeKeyboardHeight.mjs +71 -0
- package/dist/utils/buildContext/buildContext.cjs +1 -0
- package/dist/utils/buildContext/buildContext.mjs +1 -0
- package/package.json +22 -8
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# react-simplikit
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#437](https://github.com/toss/react-simplikit/pull/437) [`fe2226d`](https://github.com/toss/react-simplikit/commit/fe2226d5fbfcd305ab888cef83450f7f0e1caa77) Thanks [@mnxmnz](https://github.com/mnxmnz)! - Absorb `@react-simplikit/mobile` into the root export of `react-simplikit`. Update imports from `@react-simplikit/mobile` to `react-simplikit`; the exported APIs are unchanged. The `@react-simplikit/mobile` npm package will be deprecated with a pointer to `react-simplikit` after this release.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#423](https://github.com/toss/react-simplikit/pull/423) [`36e3e4c`](https://github.com/toss/react-simplikit/commit/36e3e4ccbd9c7a45bda18f33dcb514c97f387cbb) Thanks [@Antoliny0919](https://github.com/Antoliny0919)! - The returned handler was typed as `ChangeEventHandler<HTMLInputElement>`, so passing it to a `<textarea>` raised a type error even though the runtime behavior was identical. The handler is now typed as `ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>`, so it can be attached to both `<input>` and `<textarea>` elements.
|
|
12
|
+
|
|
13
|
+
- [#424](https://github.com/toss/react-simplikit/pull/424) [`1ac0166`](https://github.com/toss/react-simplikit/commit/1ac0166d8f41c1159d004bd9c8192f2e59f6efc8) Thanks [@hyesungoh](https://github.com/hyesungoh)! - fix(core): opt the remaining React Compiler-incompatible hooks out with `'use no memo'`
|
|
14
|
+
|
|
15
|
+
## 0.0.53
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#379](https://github.com/toss/react-simplikit/pull/379) [`e2030a2`](https://github.com/toss/react-simplikit/commit/e2030a2deac81fb247b9f601fab19d87a067cc9c) Thanks [@lumirlumir](https://github.com/lumirlumir)! - fix(usePrevious): opt out `usePrevious` hook from React Compiler
|
|
20
|
+
|
|
21
|
+
- [#404](https://github.com/toss/react-simplikit/pull/404) [`cac80cb`](https://github.com/toss/react-simplikit/commit/cac80cb41897b834bb3661336faa84197c558c1e) Thanks [@bbjbc](https://github.com/bbjbc)! - fix(useThrottledCallback): invoke the callback when the first value is `false`
|
|
22
|
+
|
|
23
|
+
The hook skips redundant invocations by comparing the incoming value against the last one it forwarded, but that comparison was seeded with `false`. Because the hook takes no initial value from the caller, a first call of `false` looked redundant and was dropped — so consumers whose state starts as `true` lost the transition back to `false`. The comparison now starts from a sentinel, so the first call is always forwarded regardless of its value.
|
|
24
|
+
|
|
25
|
+
## 0.0.52
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- [#401](https://github.com/toss/react-simplikit/pull/401) [`9b93d29`](https://github.com/toss/react-simplikit/commit/9b93d299e9b105d060f2700b27ffb63001b88de3) Thanks [@hyesungoh](https://github.com/hyesungoh)! - Switched the build output from a single bundled file per package to per-module files, so bundlers can tree-shake unused exports at file granularity instead of relying on dead-code elimination inside one large bundle.
|
|
30
|
+
|
|
31
|
+
The public API and runtime behavior are unchanged. For an app importing a single hook, this cuts the amount of code a bundler has to include: `react-simplikit`'s `useToggle` drops from 5363 B to 102 B minified, and `@react-simplikit/mobile`'s `useNetworkStatus` drops from 981 B to 570 B minified.
|
|
32
|
+
|
|
33
|
+
The only user-visible change is packaging: output files are now `.mjs`/`.cjs` with `.d.mts`/`.d.cts` type declarations instead of a flat bundle, and for `react-simplikit` the `esm/` directory has been removed (`@react-simplikit/mobile` never had one — it always emitted to `dist/`). This does not affect the published `exports` map, so `import`/`require` usage is unaffected — only projects that deep-imported internal build paths (which were never part of the public `exports`) would be impacted.
|
|
34
|
+
|
|
35
|
+
## 0.0.51
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- [#351](https://github.com/toss/react-simplikit/pull/351) [`da1f51c`](https://github.com/toss/react-simplikit/commit/da1f51cc9b860dde91dcfd120605eb6a93de3b55) Thanks [@eunwoo-levi](https://github.com/eunwoo-levi)! - fix(core/hooks): call cleanup when unmount occurs before async effect resolves
|
|
40
|
+
|
|
41
|
+
- [#352](https://github.com/toss/react-simplikit/pull/352) [`fa3daa5`](https://github.com/toss/react-simplikit/commit/fa3daa52d18644ac90a35fc8a79501eae7bb0269) Thanks [@eunwoo-levi](https://github.com/eunwoo-levi)! - fix(core/hooks): prevent immediate callback from re-firing when enabled is toggled
|
|
42
|
+
|
|
43
|
+
## 0.0.50
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- [#362](https://github.com/toss/react-simplikit/pull/362) [`fc9b1dc`](https://github.com/toss/react-simplikit/commit/fc9b1dcc2be7902ffe487c5868180317b9f07730) Thanks [@guesung](https://github.com/guesung)! - refactor(core): narrow types in `debounce` utility to reduce `any` usage
|
|
48
|
+
|
|
49
|
+
- [#259](https://github.com/toss/react-simplikit/pull/259) [`1d9ec79`](https://github.com/toss/react-simplikit/commit/1d9ec7984899d1d8dcda16d15efa66f458c347fa) Thanks [@wo-o29](https://github.com/wo-o29)! - refactor(useCounter): extract validateValue as pure function and remove unnecessary useCallback
|
|
50
|
+
|
|
51
|
+
- [#272](https://github.com/toss/react-simplikit/pull/272) [`75ab148`](https://github.com/toss/react-simplikit/commit/75ab1484a1af68a2f27fa31da8f6094f0c63d37f) Thanks [@wo-o29](https://github.com/wo-o29)! - refactor(usePrevious): remove unnecessary `undefined` from compare argument and return type
|
|
52
|
+
|
|
53
|
+
## 0.0.49
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- [#339](https://github.com/toss/react-simplikit/pull/339) [`e5f6cac`](https://github.com/toss/react-simplikit/commit/e5f6cacd0bc93c03f361d0c825424937bc141809) Thanks [@sukvvon](https://github.com/sukvvon)! - feat(core/hooks): add 'useSet' hook
|
|
58
|
+
|
|
59
|
+
- [#219](https://github.com/toss/react-simplikit/pull/219) [`2a901bb`](https://github.com/toss/react-simplikit/commit/2a901bb903f4663571c7649769d3e29c9e844332) Thanks [@sukvvon](https://github.com/sukvvon)! - feat(core/hooks): add 'useIsClient' hook
|
|
60
|
+
|
|
61
|
+
- [#273](https://github.com/toss/react-simplikit/pull/273) [`ffc61bb`](https://github.com/toss/react-simplikit/commit/ffc61bb998fdaf129fff12e5e7515007ca5eeb51) Thanks [@wo-o29](https://github.com/wo-o29)! - docs: Add generic type support to useRefEffect interface
|
|
62
|
+
|
|
63
|
+
- [#278](https://github.com/toss/react-simplikit/pull/278) [`278b117`](https://github.com/toss/react-simplikit/commit/278b117152f8f01c54a66fc91c7c4c03fc74f7d9) Thanks [@wo-o29](https://github.com/wo-o29)! - fix: Replace array index keys with child keys in Separated
|
|
64
|
+
|
|
65
|
+
- [#347](https://github.com/toss/react-simplikit/pull/347) [`9a358e2`](https://github.com/toss/react-simplikit/commit/9a358e28e5407ab93c41dec486d932bbc9c42a64) Thanks [@eunwoo-levi](https://github.com/eunwoo-levi)! - use named functions in useEffect callbacks for better stack traces
|
|
66
|
+
|
|
67
|
+
- [#345](https://github.com/toss/react-simplikit/pull/345) [`35d13f8`](https://github.com/toss/react-simplikit/commit/35d13f8fb0aa12dd2c1e5aa15ae18f823ec323fd) Thanks [@eunwoo-levi](https://github.com/eunwoo-levi)! - fix useInterval to use globalThis instead of window for platform independence
|
|
68
|
+
|
|
69
|
+
- [`68e7ac8`](https://github.com/toss/react-simplikit/commit/68e7ac86650026709f2be7498c830dfe5cfdc2e1) Thanks [@sukvvon](https://github.com/sukvvon)! - feat(core/hooks): add 'useList' hook
|
|
70
|
+
|
|
71
|
+
- [`4b0c59e`](https://github.com/toss/react-simplikit/commit/4b0c59edb599406535a479c1f099a272c399ee99) Thanks [@sukvvon](https://github.com/sukvvon)! - feat(core/hooks): add 'useThrottledCallback' hook
|
|
72
|
+
|
|
73
|
+
- [#333](https://github.com/toss/react-simplikit/pull/333) [`4254542`](https://github.com/toss/react-simplikit/commit/4254542e481374c7f0e4de6dbacdfd10f076e529) Thanks [@dlsxjzld](https://github.com/dlsxjzld)! - remove window prefix from setTimeout and clearTimeout for platform-independent
|
|
74
|
+
|
|
75
|
+
## 0.0.48
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- [#318](https://github.com/toss/react-simplikit/pull/318) [`466e3ce`](https://github.com/toss/react-simplikit/commit/466e3ceab51a499abb141bc1fe138d9109cc0df5) Thanks [@kimyouknow](https://github.com/kimyouknow)! - Fix broken package exports by moving main/types/module/exports from publishConfig to top-level package.json fields
|
|
80
|
+
|
|
81
|
+
npm does not support publishConfig field overrides for manifest fields like main, types, and exports. The previous versions (react-simplikit@0.0.47, @react-simplikit/mobile@0.0.1) were published with incorrect entry points because publishConfig overrides were not applied during `npm publish`.
|
|
82
|
+
|
|
83
|
+
## 0.0.47
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- [#316](https://github.com/toss/react-simplikit/pull/316) [`5b2eeba`](https://github.com/toss/react-simplikit/commit/5b2eeba659206cf9577dd57796a4770d07a33f62) Thanks [@kimyouknow](https://github.com/kimyouknow)! - Deprecate hooks that depend on browser-specific APIs
|
|
88
|
+
|
|
89
|
+
The following hooks are now marked as deprecated:
|
|
90
|
+
|
|
91
|
+
- `useDoubleClick`
|
|
92
|
+
- `useGeolocation`
|
|
93
|
+
- `useImpressionRef`
|
|
94
|
+
- `useIntersectionObserver`
|
|
95
|
+
- `useLongPress`
|
|
96
|
+
- `useOutsideClickEffect`
|
|
97
|
+
- `useStorageState`
|
|
98
|
+
- `useVisibilityEvent`
|
|
99
|
+
|
|
100
|
+
These hooks will be removed in a future major version as react-simplikit is now focused on platform-independent, pure state/logic hooks.
|
|
101
|
+
|
|
102
|
+
## 0.0.46
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- [#292](https://github.com/toss/react-simplikit/pull/292) [`afaafd3`](https://github.com/toss/react-simplikit/commit/afaafd397a8c23caf26d8eb3167a31a06a864b2f) Thanks [@kimyouknow](https://github.com/kimyouknow)! - verify changeset automation workflow
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://github.com/toss/react-simplikit/blob/main/LICENSE)
|
|
5
5
|
[](https://codecov.io/gh/toss/react-simplikit)
|
|
6
6
|
|
|
7
|
-
English | [한국어](./README-ko_kr.md)
|
|
7
|
+
English | [한국어](./README-ko_kr.md) | [日本語](./README-ja_jp.md)
|
|
8
8
|
|
|
9
9
|
A lightweight, zero-dependency React utilities library providing hooks, components, and utilities.
|
|
10
10
|
|
|
@@ -132,7 +132,7 @@ Visit [react-simplikit.slash.page](https://react-simplikit.slash.page) for full
|
|
|
132
132
|
|
|
133
133
|
## Related Packages
|
|
134
134
|
|
|
135
|
-
- [
|
|
135
|
+
- [Mobile web utilities](https://react-simplikit.slash.page/mobile/intro.html) - included in `react-simplikit`
|
|
136
136
|
|
|
137
137
|
## Contributing
|
|
138
138
|
|
|
@@ -40,6 +40,7 @@ let react = require("react");
|
|
|
40
40
|
*
|
|
41
41
|
*/
|
|
42
42
|
function useConditionalEffect(effect, deps, condition) {
|
|
43
|
+
"use no memo";
|
|
43
44
|
const prevDepsRef = (0, react.useRef)(void 0);
|
|
44
45
|
const memoizedCondition = (0, react.useCallback)(condition, deps);
|
|
45
46
|
if (deps.length === 0) console.warn("useConditionalEffect received an empty dependency array. This may indicate missing dependencies and could lead to unexpected behavior.");
|
|
@@ -40,6 +40,7 @@ import { useCallback, useEffect, useRef } from "react";
|
|
|
40
40
|
*
|
|
41
41
|
*/
|
|
42
42
|
function useConditionalEffect(effect, deps, condition) {
|
|
43
|
+
"use no memo";
|
|
43
44
|
const prevDepsRef = useRef(void 0);
|
|
44
45
|
const memoizedCondition = useCallback(condition, deps);
|
|
45
46
|
if (deps.length === 0) console.warn("useConditionalEffect received an empty dependency array. This may indicate missing dependencies and could lead to unexpected behavior.");
|
|
@@ -4,19 +4,25 @@ let react = require("react");
|
|
|
4
4
|
/**
|
|
5
5
|
* @description
|
|
6
6
|
* `useInputState` is a React hook that manages an input state with optional value transformation.
|
|
7
|
+
* The returned `onChange` handler works with both `<input>` and `<textarea>` elements.
|
|
7
8
|
*
|
|
8
9
|
* @param {string} [initialValue=""] - The initial value of the input. Defaults to an empty string (`""`).
|
|
9
10
|
* @param {(value: string) => string} [transformValue=(v: string) => v] - A function to transform the input value.
|
|
10
11
|
* Defaults to an identity function that returns the input unchanged.
|
|
11
12
|
*
|
|
12
|
-
* @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement>]} A tuple containing:
|
|
13
|
+
* @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>]} A tuple containing:
|
|
13
14
|
* - value `string` - The current state value;
|
|
14
|
-
* - onChange `ChangeEventHandler<HTMLInputElement>` - A function to update the state;
|
|
15
|
+
* - onChange `ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>` - A function to update the state;
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* function Example() {
|
|
18
19
|
* const [value, onChange] = useInputState('');
|
|
19
|
-
* return
|
|
20
|
+
* return (
|
|
21
|
+
* <>
|
|
22
|
+
* <input type="text" value={value} onChange={onChange} />
|
|
23
|
+
* <textarea value={value} onChange={onChange} />
|
|
24
|
+
* </>
|
|
25
|
+
* );
|
|
20
26
|
* }
|
|
21
27
|
*/
|
|
22
28
|
function useInputState(initialValue = "", transformValue = echo) {
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
|
|
2
2
|
import { ChangeEventHandler } from "react";
|
|
3
3
|
//#region src/hooks/useInputState/useInputState.d.ts
|
|
4
|
+
type InputLikeElement = HTMLInputElement | HTMLTextAreaElement;
|
|
4
5
|
/**
|
|
5
6
|
* @description
|
|
6
7
|
* `useInputState` is a React hook that manages an input state with optional value transformation.
|
|
8
|
+
* The returned `onChange` handler works with both `<input>` and `<textarea>` elements.
|
|
7
9
|
*
|
|
8
10
|
* @param {string} [initialValue=""] - The initial value of the input. Defaults to an empty string (`""`).
|
|
9
11
|
* @param {(value: string) => string} [transformValue=(v: string) => v] - A function to transform the input value.
|
|
10
12
|
* Defaults to an identity function that returns the input unchanged.
|
|
11
13
|
*
|
|
12
|
-
* @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement>]} A tuple containing:
|
|
14
|
+
* @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>]} A tuple containing:
|
|
13
15
|
* - value `string` - The current state value;
|
|
14
|
-
* - onChange `ChangeEventHandler<HTMLInputElement>` - A function to update the state;
|
|
16
|
+
* - onChange `ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>` - A function to update the state;
|
|
15
17
|
*
|
|
16
18
|
* @example
|
|
17
19
|
* function Example() {
|
|
18
20
|
* const [value, onChange] = useInputState('');
|
|
19
|
-
* return
|
|
21
|
+
* return (
|
|
22
|
+
* <>
|
|
23
|
+
* <input type="text" value={value} onChange={onChange} />
|
|
24
|
+
* <textarea value={value} onChange={onChange} />
|
|
25
|
+
* </>
|
|
26
|
+
* );
|
|
20
27
|
* }
|
|
21
28
|
*/
|
|
22
|
-
declare function useInputState(initialValue?: string, transformValue?: (value: string) => string): readonly [string, ChangeEventHandler<
|
|
29
|
+
declare function useInputState(initialValue?: string, transformValue?: (value: string) => string): readonly [string, ChangeEventHandler<InputLikeElement>];
|
|
23
30
|
//#endregion
|
|
24
31
|
export { useInputState };
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
|
|
2
2
|
import { ChangeEventHandler } from "react";
|
|
3
3
|
//#region src/hooks/useInputState/useInputState.d.ts
|
|
4
|
+
type InputLikeElement = HTMLInputElement | HTMLTextAreaElement;
|
|
4
5
|
/**
|
|
5
6
|
* @description
|
|
6
7
|
* `useInputState` is a React hook that manages an input state with optional value transformation.
|
|
8
|
+
* The returned `onChange` handler works with both `<input>` and `<textarea>` elements.
|
|
7
9
|
*
|
|
8
10
|
* @param {string} [initialValue=""] - The initial value of the input. Defaults to an empty string (`""`).
|
|
9
11
|
* @param {(value: string) => string} [transformValue=(v: string) => v] - A function to transform the input value.
|
|
10
12
|
* Defaults to an identity function that returns the input unchanged.
|
|
11
13
|
*
|
|
12
|
-
* @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement>]} A tuple containing:
|
|
14
|
+
* @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>]} A tuple containing:
|
|
13
15
|
* - value `string` - The current state value;
|
|
14
|
-
* - onChange `ChangeEventHandler<HTMLInputElement>` - A function to update the state;
|
|
16
|
+
* - onChange `ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>` - A function to update the state;
|
|
15
17
|
*
|
|
16
18
|
* @example
|
|
17
19
|
* function Example() {
|
|
18
20
|
* const [value, onChange] = useInputState('');
|
|
19
|
-
* return
|
|
21
|
+
* return (
|
|
22
|
+
* <>
|
|
23
|
+
* <input type="text" value={value} onChange={onChange} />
|
|
24
|
+
* <textarea value={value} onChange={onChange} />
|
|
25
|
+
* </>
|
|
26
|
+
* );
|
|
20
27
|
* }
|
|
21
28
|
*/
|
|
22
|
-
declare function useInputState(initialValue?: string, transformValue?: (value: string) => string): readonly [string, ChangeEventHandler<
|
|
29
|
+
declare function useInputState(initialValue?: string, transformValue?: (value: string) => string): readonly [string, ChangeEventHandler<InputLikeElement>];
|
|
23
30
|
//#endregion
|
|
24
31
|
export { useInputState };
|
|
@@ -4,19 +4,25 @@ import { useCallback, useState } from "react";
|
|
|
4
4
|
/**
|
|
5
5
|
* @description
|
|
6
6
|
* `useInputState` is a React hook that manages an input state with optional value transformation.
|
|
7
|
+
* The returned `onChange` handler works with both `<input>` and `<textarea>` elements.
|
|
7
8
|
*
|
|
8
9
|
* @param {string} [initialValue=""] - The initial value of the input. Defaults to an empty string (`""`).
|
|
9
10
|
* @param {(value: string) => string} [transformValue=(v: string) => v] - A function to transform the input value.
|
|
10
11
|
* Defaults to an identity function that returns the input unchanged.
|
|
11
12
|
*
|
|
12
|
-
* @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement>]} A tuple containing:
|
|
13
|
+
* @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>]} A tuple containing:
|
|
13
14
|
* - value `string` - The current state value;
|
|
14
|
-
* - onChange `ChangeEventHandler<HTMLInputElement>` - A function to update the state;
|
|
15
|
+
* - onChange `ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>` - A function to update the state;
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* function Example() {
|
|
18
19
|
* const [value, onChange] = useInputState('');
|
|
19
|
-
* return
|
|
20
|
+
* return (
|
|
21
|
+
* <>
|
|
22
|
+
* <input type="text" value={value} onChange={onChange} />
|
|
23
|
+
* <textarea value={value} onChange={onChange} />
|
|
24
|
+
* </>
|
|
25
|
+
* );
|
|
20
26
|
* }
|
|
21
27
|
*/
|
|
22
28
|
function useInputState(initialValue = "", transformValue = echo) {
|
|
@@ -7,12 +7,9 @@ let react = require("react");
|
|
|
7
7
|
* It provides a state to track whether an asynchronous operation is in progress and a function to handle the loading state automatically.
|
|
8
8
|
*
|
|
9
9
|
* @returns {[loading: boolean, startLoading: <T>(promise: Promise<T>) => Promise<T>]} A tuple containing:
|
|
10
|
-
* - loading `boolean` - Represents the current loading state.
|
|
11
|
-
* : The initial value is `false`.
|
|
12
|
-
* : It is set to `true` when an asynchronous task is in progress;
|
|
10
|
+
* - loading `boolean` - Represents the current loading state. The initial value is `false`. It is set to `true` when an asynchronous task is in progress;
|
|
13
11
|
*
|
|
14
|
-
* - startLoading `<T>(promise: Promise<T>) => Promise<T>` - A function that executes asynchronous tasks while managing the loading state.
|
|
15
|
-
* : This function takes a `Promise` as an argument and automatically resets the `isLoading` state to `false` when the `Promise` completes;
|
|
12
|
+
* - startLoading `<T>(promise: Promise<T>) => Promise<T>` - A function that executes asynchronous tasks while managing the loading state. This function takes a `Promise` as an argument and automatically resets the `isLoading` state to `false` when the `Promise` completes;
|
|
16
13
|
*
|
|
17
14
|
* @example
|
|
18
15
|
* function ConfirmButton() {
|
|
@@ -48,6 +45,7 @@ function useLoading() {
|
|
|
48
45
|
return (0, react.useMemo)(() => [loading, startTransition], [loading, startTransition]);
|
|
49
46
|
}
|
|
50
47
|
function useIsMountedRef() {
|
|
48
|
+
"use no memo";
|
|
51
49
|
const ref = (0, react.useRef)({ isMounted: true }).current;
|
|
52
50
|
(0, react.useEffect)(function trackMountedState() {
|
|
53
51
|
ref.isMounted = true;
|
|
@@ -6,12 +6,9 @@
|
|
|
6
6
|
* It provides a state to track whether an asynchronous operation is in progress and a function to handle the loading state automatically.
|
|
7
7
|
*
|
|
8
8
|
* @returns {[loading: boolean, startLoading: <T>(promise: Promise<T>) => Promise<T>]} A tuple containing:
|
|
9
|
-
* - loading `boolean` - Represents the current loading state.
|
|
10
|
-
* : The initial value is `false`.
|
|
11
|
-
* : It is set to `true` when an asynchronous task is in progress;
|
|
9
|
+
* - loading `boolean` - Represents the current loading state. The initial value is `false`. It is set to `true` when an asynchronous task is in progress;
|
|
12
10
|
*
|
|
13
|
-
* - startLoading `<T>(promise: Promise<T>) => Promise<T>` - A function that executes asynchronous tasks while managing the loading state.
|
|
14
|
-
* : This function takes a `Promise` as an argument and automatically resets the `isLoading` state to `false` when the `Promise` completes;
|
|
11
|
+
* - startLoading `<T>(promise: Promise<T>) => Promise<T>` - A function that executes asynchronous tasks while managing the loading state. This function takes a `Promise` as an argument and automatically resets the `isLoading` state to `false` when the `Promise` completes;
|
|
15
12
|
*
|
|
16
13
|
* @example
|
|
17
14
|
* function ConfirmButton() {
|
|
@@ -6,12 +6,9 @@
|
|
|
6
6
|
* It provides a state to track whether an asynchronous operation is in progress and a function to handle the loading state automatically.
|
|
7
7
|
*
|
|
8
8
|
* @returns {[loading: boolean, startLoading: <T>(promise: Promise<T>) => Promise<T>]} A tuple containing:
|
|
9
|
-
* - loading `boolean` - Represents the current loading state.
|
|
10
|
-
* : The initial value is `false`.
|
|
11
|
-
* : It is set to `true` when an asynchronous task is in progress;
|
|
9
|
+
* - loading `boolean` - Represents the current loading state. The initial value is `false`. It is set to `true` when an asynchronous task is in progress;
|
|
12
10
|
*
|
|
13
|
-
* - startLoading `<T>(promise: Promise<T>) => Promise<T>` - A function that executes asynchronous tasks while managing the loading state.
|
|
14
|
-
* : This function takes a `Promise` as an argument and automatically resets the `isLoading` state to `false` when the `Promise` completes;
|
|
11
|
+
* - startLoading `<T>(promise: Promise<T>) => Promise<T>` - A function that executes asynchronous tasks while managing the loading state. This function takes a `Promise` as an argument and automatically resets the `isLoading` state to `false` when the `Promise` completes;
|
|
15
12
|
*
|
|
16
13
|
* @example
|
|
17
14
|
* function ConfirmButton() {
|
|
@@ -7,12 +7,9 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
7
7
|
* It provides a state to track whether an asynchronous operation is in progress and a function to handle the loading state automatically.
|
|
8
8
|
*
|
|
9
9
|
* @returns {[loading: boolean, startLoading: <T>(promise: Promise<T>) => Promise<T>]} A tuple containing:
|
|
10
|
-
* - loading `boolean` - Represents the current loading state.
|
|
11
|
-
* : The initial value is `false`.
|
|
12
|
-
* : It is set to `true` when an asynchronous task is in progress;
|
|
10
|
+
* - loading `boolean` - Represents the current loading state. The initial value is `false`. It is set to `true` when an asynchronous task is in progress;
|
|
13
11
|
*
|
|
14
|
-
* - startLoading `<T>(promise: Promise<T>) => Promise<T>` - A function that executes asynchronous tasks while managing the loading state.
|
|
15
|
-
* : This function takes a `Promise` as an argument and automatically resets the `isLoading` state to `false` when the `Promise` completes;
|
|
12
|
+
* - startLoading `<T>(promise: Promise<T>) => Promise<T>` - A function that executes asynchronous tasks while managing the loading state. This function takes a `Promise` as an argument and automatically resets the `isLoading` state to `false` when the `Promise` completes;
|
|
16
13
|
*
|
|
17
14
|
* @example
|
|
18
15
|
* function ConfirmButton() {
|
|
@@ -48,6 +45,7 @@ function useLoading() {
|
|
|
48
45
|
return useMemo(() => [loading, startTransition], [loading, startTransition]);
|
|
49
46
|
}
|
|
50
47
|
function useIsMountedRef() {
|
|
48
|
+
"use no memo";
|
|
51
49
|
const ref = useRef({ isMounted: true }).current;
|
|
52
50
|
useEffect(function trackMountedState() {
|
|
53
51
|
ref.isMounted = true;
|
|
@@ -42,6 +42,7 @@ let react = require("react");
|
|
|
42
42
|
* }
|
|
43
43
|
*/
|
|
44
44
|
function usePreservedReference(value, areValuesEqual = areDeeplyEqual) {
|
|
45
|
+
"use no memo";
|
|
45
46
|
const ref = (0, react.useRef)(value);
|
|
46
47
|
return (0, react.useMemo)(() => {
|
|
47
48
|
if (!areValuesEqual(ref.current, value)) ref.current = value;
|
|
@@ -42,6 +42,7 @@ import { useMemo, useRef } from "react";
|
|
|
42
42
|
* }
|
|
43
43
|
*/
|
|
44
44
|
function usePreservedReference(value, areValuesEqual = areDeeplyEqual) {
|
|
45
|
+
"use no memo";
|
|
45
46
|
const ref = useRef(value);
|
|
46
47
|
return useMemo(() => {
|
|
47
48
|
if (!areValuesEqual(ref.current, value)) ref.current = value;
|
|
@@ -28,6 +28,7 @@ let react = require("react");
|
|
|
28
28
|
* }
|
|
29
29
|
*/
|
|
30
30
|
function useRefEffect(callback, deps) {
|
|
31
|
+
"use no memo";
|
|
31
32
|
const preservedCallback = require_usePreservedCallback.usePreservedCallback(callback);
|
|
32
33
|
const cleanupCallbackRef = (0, react.useRef)(() => {});
|
|
33
34
|
return (0, react.useCallback)((element) => {
|
|
@@ -28,6 +28,7 @@ import { useCallback, useRef } from "react";
|
|
|
28
28
|
* }
|
|
29
29
|
*/
|
|
30
30
|
function useRefEffect(callback, deps) {
|
|
31
|
+
"use no memo";
|
|
31
32
|
const preservedCallback = usePreservedCallback(callback);
|
|
32
33
|
const cleanupCallbackRef = useRef(() => {});
|
|
33
34
|
return useCallback((element) => {
|
|
@@ -20,6 +20,7 @@ const ensureSerializable = (value) => {
|
|
|
20
20
|
return value;
|
|
21
21
|
};
|
|
22
22
|
function useStorageState(key, { storage = require_storage.safeLocalStorage, defaultValue, ...options } = {}) {
|
|
23
|
+
"use no memo";
|
|
23
24
|
const serializedDefaultValue = defaultValue;
|
|
24
25
|
const cache = (0, react.useRef)({
|
|
25
26
|
data: null,
|
|
@@ -20,6 +20,7 @@ const ensureSerializable = (value) => {
|
|
|
20
20
|
return value;
|
|
21
21
|
};
|
|
22
22
|
function useStorageState(key, { storage = safeLocalStorage, defaultValue, ...options } = {}) {
|
|
23
|
+
"use no memo";
|
|
23
24
|
const serializedDefaultValue = defaultValue;
|
|
24
25
|
const cache = useRef({
|
|
25
26
|
data: null,
|
package/dist/index.cjs
CHANGED
|
@@ -36,15 +36,43 @@ const require_useThrottle = require("./hooks/useThrottle/useThrottle.cjs");
|
|
|
36
36
|
const require_useThrottledCallback = require("./hooks/useThrottledCallback/useThrottledCallback.cjs");
|
|
37
37
|
const require_useTimeout = require("./hooks/useTimeout/useTimeout.cjs");
|
|
38
38
|
const require_useToggle = require("./hooks/useToggle/useToggle.cjs");
|
|
39
|
+
const require_isServer = require("./mobile/utils/isServer/isServer.cjs");
|
|
40
|
+
const require_getKeyboardHeight = require("./mobile/utils/getKeyboardHeight/getKeyboardHeight.cjs");
|
|
41
|
+
const require_subscribeKeyboardHeight = require("./mobile/utils/subscribeKeyboardHeight/subscribeKeyboardHeight.cjs");
|
|
42
|
+
const require_useKeyboardHeight = require("./mobile/hooks/useKeyboardHeight/useKeyboardHeight.cjs");
|
|
43
|
+
const require_useAvoidKeyboard = require("./mobile/hooks/useAvoidKeyboard/useAvoidKeyboard.cjs");
|
|
44
|
+
const require_disableBodyScrollLock = require("./mobile/utils/disableBodyScrollLock/disableBodyScrollLock.cjs");
|
|
45
|
+
const require_enableBodyScrollLock = require("./mobile/utils/enableBodyScrollLock/enableBodyScrollLock.cjs");
|
|
46
|
+
const require_useBodyScrollLock = require("./mobile/hooks/useBodyScrollLock/useBodyScrollLock.cjs");
|
|
47
|
+
const require_useNetworkStatus = require("./mobile/hooks/useNetworkStatus/useNetworkStatus.cjs");
|
|
48
|
+
const require_usePageVisibility = require("./mobile/hooks/usePageVisibility/usePageVisibility.cjs");
|
|
49
|
+
const require_getSafeAreaInset = require("./mobile/utils/getSafeAreaInset/getSafeAreaInset.cjs");
|
|
50
|
+
const require_useSafeAreaInset = require("./mobile/hooks/useSafeAreaInset/useSafeAreaInset.cjs");
|
|
51
|
+
const require_useScrollDirection = require("./mobile/hooks/useScrollDirection/useScrollDirection.cjs");
|
|
52
|
+
const require_useVisualViewport = require("./mobile/hooks/useVisualViewport/useVisualViewport.cjs");
|
|
53
|
+
const require_isAndroid = require("./mobile/utils/isAndroid/isAndroid.cjs");
|
|
54
|
+
const require_isIOS = require("./mobile/utils/isIOS/isIOS.cjs");
|
|
55
|
+
const require_isKeyboardVisible = require("./mobile/utils/isKeyboardVisible/isKeyboardVisible.cjs");
|
|
39
56
|
const require_buildContext = require("./utils/buildContext/buildContext.cjs");
|
|
40
57
|
const require_mergeProps = require("./utils/mergeProps/mergeProps.cjs");
|
|
41
58
|
exports.ImpressionArea = require_ImpressionArea.ImpressionArea;
|
|
42
59
|
exports.Separated = require_Separated.Separated;
|
|
43
60
|
exports.SwitchCase = require_SwitchCase.SwitchCase;
|
|
44
61
|
exports.buildContext = require_buildContext.buildContext;
|
|
62
|
+
exports.disableBodyScrollLock = require_disableBodyScrollLock.disableBodyScrollLock;
|
|
63
|
+
exports.enableBodyScrollLock = require_enableBodyScrollLock.enableBodyScrollLock;
|
|
64
|
+
exports.getKeyboardHeight = require_getKeyboardHeight.getKeyboardHeight;
|
|
65
|
+
exports.getSafeAreaInset = require_getSafeAreaInset.getSafeAreaInset;
|
|
66
|
+
exports.isAndroid = require_isAndroid.isAndroid;
|
|
67
|
+
exports.isIOS = require_isIOS.isIOS;
|
|
68
|
+
exports.isKeyboardVisible = require_isKeyboardVisible.isKeyboardVisible;
|
|
69
|
+
exports.isServer = require_isServer.isServer;
|
|
45
70
|
exports.mergeProps = require_mergeProps.mergeProps;
|
|
46
71
|
exports.mergeRefs = require_mergeRefs.mergeRefs;
|
|
72
|
+
exports.subscribeKeyboardHeight = require_subscribeKeyboardHeight.subscribeKeyboardHeight;
|
|
47
73
|
exports.useAsyncEffect = require_useAsyncEffect.useAsyncEffect;
|
|
74
|
+
exports.useAvoidKeyboard = require_useAvoidKeyboard.useAvoidKeyboard;
|
|
75
|
+
exports.useBodyScrollLock = require_useBodyScrollLock.useBodyScrollLock;
|
|
48
76
|
exports.useBooleanState = require_useBooleanState.useBooleanState;
|
|
49
77
|
exports.useCallbackOncePerRender = require_useCallbackOncePerRender.useCallbackOncePerRender;
|
|
50
78
|
exports.useConditionalEffect = require_useConditionalEffect.useConditionalEffect;
|
|
@@ -60,15 +88,20 @@ exports.useIntersectionObserver = require_useIntersectionObserver.useIntersectio
|
|
|
60
88
|
exports.useInterval = require_useInterval.useInterval;
|
|
61
89
|
exports.useIsClient = require_useIsClient.useIsClient;
|
|
62
90
|
exports.useIsomorphicLayoutEffect = require_useIsomorphicLayoutEffect.useIsomorphicLayoutEffect;
|
|
91
|
+
exports.useKeyboardHeight = require_useKeyboardHeight.useKeyboardHeight;
|
|
63
92
|
exports.useList = require_useList.useList;
|
|
64
93
|
exports.useLoading = require_useLoading.useLoading;
|
|
65
94
|
exports.useLongPress = require_useLongPress.useLongPress;
|
|
66
95
|
exports.useMap = require_useMap.useMap;
|
|
96
|
+
exports.useNetworkStatus = require_useNetworkStatus.useNetworkStatus;
|
|
67
97
|
exports.useOutsideClickEffect = require_useOutsideClickEffect.useOutsideClickEffect;
|
|
98
|
+
exports.usePageVisibility = require_usePageVisibility.usePageVisibility;
|
|
68
99
|
exports.usePreservedCallback = require_usePreservedCallback.usePreservedCallback;
|
|
69
100
|
exports.usePreservedReference = require_usePreservedReference.usePreservedReference;
|
|
70
101
|
exports.usePrevious = require_usePrevious.usePrevious;
|
|
71
102
|
exports.useRefEffect = require_useRefEffect.useRefEffect;
|
|
103
|
+
exports.useSafeAreaInset = require_useSafeAreaInset.useSafeAreaInset;
|
|
104
|
+
exports.useScrollDirection = require_useScrollDirection.useScrollDirection;
|
|
72
105
|
exports.useSet = require_useSet.useSet;
|
|
73
106
|
exports.useStorageState = require_useStorageState.useStorageState;
|
|
74
107
|
exports.useThrottle = require_useThrottle.useThrottle;
|
|
@@ -76,3 +109,4 @@ exports.useThrottledCallback = require_useThrottledCallback.useThrottledCallback
|
|
|
76
109
|
exports.useTimeout = require_useTimeout.useTimeout;
|
|
77
110
|
exports.useToggle = require_useToggle.useToggle;
|
|
78
111
|
exports.useVisibilityEvent = require_useVisibilityEvent.useVisibilityEvent;
|
|
112
|
+
exports.useVisualViewport = require_useVisualViewport.useVisualViewport;
|
package/dist/index.d.cts
CHANGED
|
@@ -47,10 +47,28 @@ import { useThrottledCallback } from "./hooks/useThrottledCallback/useThrottledC
|
|
|
47
47
|
import { useTimeout } from "./hooks/useTimeout/useTimeout.cjs";
|
|
48
48
|
import { useToggle } from "./hooks/useToggle/useToggle.cjs";
|
|
49
49
|
import { useVisibilityEvent } from "./hooks/useVisibilityEvent/useVisibilityEvent.cjs";
|
|
50
|
+
import { useAvoidKeyboard } from "./mobile/hooks/useAvoidKeyboard/useAvoidKeyboard.cjs";
|
|
51
|
+
import "./mobile/hooks/useAvoidKeyboard/index.cjs";
|
|
52
|
+
import { useBodyScrollLock } from "./mobile/hooks/useBodyScrollLock/useBodyScrollLock.cjs";
|
|
53
|
+
import { useKeyboardHeight } from "./mobile/hooks/useKeyboardHeight/useKeyboardHeight.cjs";
|
|
54
|
+
import { ConnectionType, EffectiveConnectionType, NetworkStatus, useNetworkStatus } from "./mobile/hooks/useNetworkStatus/useNetworkStatus.cjs";
|
|
55
|
+
import { PageVisibility, VisibilityState, usePageVisibility } from "./mobile/hooks/usePageVisibility/usePageVisibility.cjs";
|
|
56
|
+
import { getSafeAreaInset } from "./mobile/utils/getSafeAreaInset/getSafeAreaInset.cjs";
|
|
57
|
+
import { useSafeAreaInset } from "./mobile/hooks/useSafeAreaInset/useSafeAreaInset.cjs";
|
|
58
|
+
import { useScrollDirection } from "./mobile/hooks/useScrollDirection/useScrollDirection.cjs";
|
|
59
|
+
import { useVisualViewport } from "./mobile/hooks/useVisualViewport/useVisualViewport.cjs";
|
|
60
|
+
import { disableBodyScrollLock } from "./mobile/utils/disableBodyScrollLock/disableBodyScrollLock.cjs";
|
|
61
|
+
import { enableBodyScrollLock } from "./mobile/utils/enableBodyScrollLock/enableBodyScrollLock.cjs";
|
|
62
|
+
import { getKeyboardHeight } from "./mobile/utils/getKeyboardHeight/getKeyboardHeight.cjs";
|
|
63
|
+
import { isAndroid } from "./mobile/utils/isAndroid/isAndroid.cjs";
|
|
64
|
+
import { isIOS } from "./mobile/utils/isIOS/isIOS.cjs";
|
|
65
|
+
import { isKeyboardVisible } from "./mobile/utils/isKeyboardVisible/isKeyboardVisible.cjs";
|
|
66
|
+
import { isServer } from "./mobile/utils/isServer/isServer.cjs";
|
|
67
|
+
import { subscribeKeyboardHeight } from "./mobile/utils/subscribeKeyboardHeight/subscribeKeyboardHeight.cjs";
|
|
50
68
|
import { buildContext } from "./utils/buildContext/buildContext.cjs";
|
|
51
69
|
import "./utils/buildContext/index.cjs";
|
|
52
70
|
import { mergeProps } from "./utils/mergeProps/mergeProps.cjs";
|
|
53
71
|
import "./utils/mergeProps/index.cjs";
|
|
54
72
|
import { mergeRefs } from "./utils/mergeRefs/mergeRefs.cjs";
|
|
55
73
|
import "./utils/mergeRefs/index.cjs";
|
|
56
|
-
export { ImpressionArea, Separated, SwitchCase, buildContext, mergeProps, mergeRefs, useAsyncEffect, useBooleanState, useCallbackOncePerRender, useConditionalEffect, useControlledState, useCounter, useDebounce, useDebouncedCallback, useDoubleClick, useGeolocation, useImpressionRef, useInputState, useIntersectionObserver, useInterval, useIsClient, useIsomorphicLayoutEffect, useList, useLoading, useLongPress, useMap, useOutsideClickEffect, usePreservedCallback, usePreservedReference, usePrevious, useRefEffect, useSet, useStorageState, useThrottle, useThrottledCallback, useTimeout, useToggle, useVisibilityEvent };
|
|
74
|
+
export { type ConnectionType, type EffectiveConnectionType, ImpressionArea, type NetworkStatus, type PageVisibility, Separated, SwitchCase, type VisibilityState, buildContext, disableBodyScrollLock, enableBodyScrollLock, getKeyboardHeight, getSafeAreaInset, isAndroid, isIOS, isKeyboardVisible, isServer, mergeProps, mergeRefs, subscribeKeyboardHeight, useAsyncEffect, useAvoidKeyboard, useBodyScrollLock, useBooleanState, useCallbackOncePerRender, useConditionalEffect, useControlledState, useCounter, useDebounce, useDebouncedCallback, useDoubleClick, useGeolocation, useImpressionRef, useInputState, useIntersectionObserver, useInterval, useIsClient, useIsomorphicLayoutEffect, useKeyboardHeight, useList, useLoading, useLongPress, useMap, useNetworkStatus, useOutsideClickEffect, usePageVisibility, usePreservedCallback, usePreservedReference, usePrevious, useRefEffect, useSafeAreaInset, useScrollDirection, useSet, useStorageState, useThrottle, useThrottledCallback, useTimeout, useToggle, useVisibilityEvent, useVisualViewport };
|
package/dist/index.d.mts
CHANGED
|
@@ -47,10 +47,28 @@ import { useThrottledCallback } from "./hooks/useThrottledCallback/useThrottledC
|
|
|
47
47
|
import { useTimeout } from "./hooks/useTimeout/useTimeout.mjs";
|
|
48
48
|
import { useToggle } from "./hooks/useToggle/useToggle.mjs";
|
|
49
49
|
import { useVisibilityEvent } from "./hooks/useVisibilityEvent/useVisibilityEvent.mjs";
|
|
50
|
+
import { useAvoidKeyboard } from "./mobile/hooks/useAvoidKeyboard/useAvoidKeyboard.mjs";
|
|
51
|
+
import "./mobile/hooks/useAvoidKeyboard/index.mjs";
|
|
52
|
+
import { useBodyScrollLock } from "./mobile/hooks/useBodyScrollLock/useBodyScrollLock.mjs";
|
|
53
|
+
import { useKeyboardHeight } from "./mobile/hooks/useKeyboardHeight/useKeyboardHeight.mjs";
|
|
54
|
+
import { ConnectionType, EffectiveConnectionType, NetworkStatus, useNetworkStatus } from "./mobile/hooks/useNetworkStatus/useNetworkStatus.mjs";
|
|
55
|
+
import { PageVisibility, VisibilityState, usePageVisibility } from "./mobile/hooks/usePageVisibility/usePageVisibility.mjs";
|
|
56
|
+
import { getSafeAreaInset } from "./mobile/utils/getSafeAreaInset/getSafeAreaInset.mjs";
|
|
57
|
+
import { useSafeAreaInset } from "./mobile/hooks/useSafeAreaInset/useSafeAreaInset.mjs";
|
|
58
|
+
import { useScrollDirection } from "./mobile/hooks/useScrollDirection/useScrollDirection.mjs";
|
|
59
|
+
import { useVisualViewport } from "./mobile/hooks/useVisualViewport/useVisualViewport.mjs";
|
|
60
|
+
import { disableBodyScrollLock } from "./mobile/utils/disableBodyScrollLock/disableBodyScrollLock.mjs";
|
|
61
|
+
import { enableBodyScrollLock } from "./mobile/utils/enableBodyScrollLock/enableBodyScrollLock.mjs";
|
|
62
|
+
import { getKeyboardHeight } from "./mobile/utils/getKeyboardHeight/getKeyboardHeight.mjs";
|
|
63
|
+
import { isAndroid } from "./mobile/utils/isAndroid/isAndroid.mjs";
|
|
64
|
+
import { isIOS } from "./mobile/utils/isIOS/isIOS.mjs";
|
|
65
|
+
import { isKeyboardVisible } from "./mobile/utils/isKeyboardVisible/isKeyboardVisible.mjs";
|
|
66
|
+
import { isServer } from "./mobile/utils/isServer/isServer.mjs";
|
|
67
|
+
import { subscribeKeyboardHeight } from "./mobile/utils/subscribeKeyboardHeight/subscribeKeyboardHeight.mjs";
|
|
50
68
|
import { buildContext } from "./utils/buildContext/buildContext.mjs";
|
|
51
69
|
import "./utils/buildContext/index.mjs";
|
|
52
70
|
import { mergeProps } from "./utils/mergeProps/mergeProps.mjs";
|
|
53
71
|
import "./utils/mergeProps/index.mjs";
|
|
54
72
|
import { mergeRefs } from "./utils/mergeRefs/mergeRefs.mjs";
|
|
55
73
|
import "./utils/mergeRefs/index.mjs";
|
|
56
|
-
export { ImpressionArea, Separated, SwitchCase, buildContext, mergeProps, mergeRefs, useAsyncEffect, useBooleanState, useCallbackOncePerRender, useConditionalEffect, useControlledState, useCounter, useDebounce, useDebouncedCallback, useDoubleClick, useGeolocation, useImpressionRef, useInputState, useIntersectionObserver, useInterval, useIsClient, useIsomorphicLayoutEffect, useList, useLoading, useLongPress, useMap, useOutsideClickEffect, usePreservedCallback, usePreservedReference, usePrevious, useRefEffect, useSet, useStorageState, useThrottle, useThrottledCallback, useTimeout, useToggle, useVisibilityEvent };
|
|
74
|
+
export { type ConnectionType, type EffectiveConnectionType, ImpressionArea, type NetworkStatus, type PageVisibility, Separated, SwitchCase, type VisibilityState, buildContext, disableBodyScrollLock, enableBodyScrollLock, getKeyboardHeight, getSafeAreaInset, isAndroid, isIOS, isKeyboardVisible, isServer, mergeProps, mergeRefs, subscribeKeyboardHeight, useAsyncEffect, useAvoidKeyboard, useBodyScrollLock, useBooleanState, useCallbackOncePerRender, useConditionalEffect, useControlledState, useCounter, useDebounce, useDebouncedCallback, useDoubleClick, useGeolocation, useImpressionRef, useInputState, useIntersectionObserver, useInterval, useIsClient, useIsomorphicLayoutEffect, useKeyboardHeight, useList, useLoading, useLongPress, useMap, useNetworkStatus, useOutsideClickEffect, usePageVisibility, usePreservedCallback, usePreservedReference, usePrevious, useRefEffect, useSafeAreaInset, useScrollDirection, useSet, useStorageState, useThrottle, useThrottledCallback, useTimeout, useToggle, useVisibilityEvent, useVisualViewport };
|