@versini/ui-hooks 4.6.0 → 4.6.1
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/index.d.ts +15 -1
- package/dist/index.js +11 -9
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -194,4 +194,18 @@ type UseUniqueIdOptions = string | number | {
|
|
|
194
194
|
};
|
|
195
195
|
declare function useUniqueId(options?: UseUniqueIdOptions): string | undefined;
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Custom hook that returns the current viewport size. It will update
|
|
199
|
+
* when the window is resized or the orientation changes.
|
|
200
|
+
*
|
|
201
|
+
* @returns The current viewport size
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* const { width, height } = useViewportSize();
|
|
205
|
+
*/
|
|
206
|
+
declare function useViewportSize(): {
|
|
207
|
+
width: number;
|
|
208
|
+
height: number;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export { type HotkeyItem, type HotkeyItemOptions, type StorageProperties, type UseUniqueIdOptions, getHotkeyHandler, shouldFireEvent, useClickOutside, useHotkeys, useInViewport, useInterval, useIsMounted, useLocalStorage, useMergeRefs, useResizeObserver, useUncontrolled, useUniqueId, useViewportSize };
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { useClickOutside as r } from "./hooks/useClickOutside.js";
|
|
2
|
-
import { getHotkeyHandler as s, shouldFireEvent as u, useHotkeys as
|
|
2
|
+
import { getHotkeyHandler as s, shouldFireEvent as u, useHotkeys as p } from "./hooks/useHotkeys.js";
|
|
3
3
|
import { useInterval as m } from "./hooks/useInterval.js";
|
|
4
|
-
import { useInViewport as
|
|
5
|
-
import { useIsMounted as
|
|
4
|
+
import { useInViewport as i } from "./hooks/useInViewport.js";
|
|
5
|
+
import { useIsMounted as l } from "./hooks/useIsMounted.js";
|
|
6
6
|
import { useLocalStorage as a } from "./hooks/useLocalStorage.js";
|
|
7
7
|
import { useMergeRefs as c } from "./hooks/useMergeRefs.js";
|
|
8
8
|
import { useResizeObserver as k } from "./hooks/useResizeObserver.js";
|
|
9
9
|
import { useUncontrolled as H } from "./hooks/useUncontrolled.js";
|
|
10
|
-
import { useUniqueId as
|
|
10
|
+
import { useUniqueId as y } from "./hooks/useUniqueId.js";
|
|
11
|
+
import { useViewportSize as M } from "./hooks/useViewportSize.js";
|
|
11
12
|
/*!
|
|
12
|
-
@versini/ui-hooks v4.6.
|
|
13
|
+
@versini/ui-hooks v4.6.1
|
|
13
14
|
© 2025 gizmette.com
|
|
14
15
|
*/
|
|
15
16
|
export {
|
|
16
17
|
s as getHotkeyHandler,
|
|
17
18
|
u as shouldFireEvent,
|
|
18
19
|
r as useClickOutside,
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
p as useHotkeys,
|
|
21
|
+
i as useInViewport,
|
|
21
22
|
m as useInterval,
|
|
22
|
-
|
|
23
|
+
l as useIsMounted,
|
|
23
24
|
a as useLocalStorage,
|
|
24
25
|
c as useMergeRefs,
|
|
25
26
|
k as useResizeObserver,
|
|
26
27
|
H as useUncontrolled,
|
|
27
|
-
|
|
28
|
+
y as useUniqueId,
|
|
29
|
+
M as useViewportSize
|
|
28
30
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-hooks",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"react": "^18.3.1 || ^19.0.0",
|
|
38
38
|
"react-dom": "^18.3.1 || ^19.0.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "b6bd4ab8c8999a80520b12bff719a22a03d2e52b"
|
|
41
41
|
}
|