@versini/ui-hooks 4.2.1 → 4.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.
- package/dist/index.d.ts +4 -2
- package/dist/index.js +16 -15
- package/package.json +4 -8
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import * as react from 'react';
|
|
|
3
3
|
interface HotkeyItemOptions {
|
|
4
4
|
preventDefault?: boolean;
|
|
5
5
|
}
|
|
6
|
+
type HotkeyItem$1 = [string, (event: any) => void, HotkeyItemOptions?];
|
|
7
|
+
declare function getHotkeyHandler(hotkeys: HotkeyItem$1[]): (event: React.KeyboardEvent<HTMLElement> | KeyboardEvent) => void;
|
|
6
8
|
|
|
7
9
|
type HotkeyItem = [
|
|
8
10
|
string,
|
|
@@ -87,7 +89,7 @@ type ObserverRect = Omit<DOMRectReadOnly, "toJSON">;
|
|
|
87
89
|
* Observed: <code>{JSON.stringify(rect)}</code>
|
|
88
90
|
* </div>
|
|
89
91
|
*/
|
|
90
|
-
declare function useResizeObserver<T extends HTMLElement = any>(options?: ResizeObserverOptions): readonly [react.RefObject<T>, ObserverRect];
|
|
92
|
+
declare function useResizeObserver<T extends HTMLElement = any>(options?: ResizeObserverOptions): readonly [react.RefObject<T | null>, ObserverRect];
|
|
91
93
|
|
|
92
94
|
interface UseUncontrolledInput<T> {
|
|
93
95
|
/** Value for controlled state */
|
|
@@ -140,4 +142,4 @@ type UseUniqueIdOptions = string | number | {
|
|
|
140
142
|
};
|
|
141
143
|
declare function useUniqueId(options?: UseUniqueIdOptions): string | undefined;
|
|
142
144
|
|
|
143
|
-
export { useHotkeys, useIsMounted, useLocalStorage, useMergeRefs, useResizeObserver, useUncontrolled, useUniqueId };
|
|
145
|
+
export { getHotkeyHandler, useHotkeys, useIsMounted, useLocalStorage, useMergeRefs, useResizeObserver, useUncontrolled, useUniqueId };
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useIsMounted as
|
|
3
|
-
import { useLocalStorage as
|
|
4
|
-
import { useMergeRefs as
|
|
5
|
-
import { useResizeObserver as
|
|
6
|
-
import { useUncontrolled as
|
|
7
|
-
import { useUniqueId as
|
|
1
|
+
import { getHotkeyHandler as r, useHotkeys as t } from "./hooks/useHotkeys.js";
|
|
2
|
+
import { useIsMounted as u } from "./hooks/useIsMounted.js";
|
|
3
|
+
import { useLocalStorage as m } from "./hooks/useLocalStorage.js";
|
|
4
|
+
import { useMergeRefs as x } from "./hooks/useMergeRefs.js";
|
|
5
|
+
import { useResizeObserver as d } from "./hooks/useResizeObserver.js";
|
|
6
|
+
import { useUncontrolled as a } from "./hooks/useUncontrolled.js";
|
|
7
|
+
import { useUniqueId as H } from "./hooks/useUniqueId.js";
|
|
8
8
|
/*!
|
|
9
|
-
@versini/ui-hooks v4.
|
|
9
|
+
@versini/ui-hooks v4.3.0
|
|
10
10
|
© 2024 gizmette.com
|
|
11
11
|
*/
|
|
12
12
|
export {
|
|
13
|
-
r as
|
|
14
|
-
t as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
r as getHotkeyHandler,
|
|
14
|
+
t as useHotkeys,
|
|
15
|
+
u as useIsMounted,
|
|
16
|
+
m as useLocalStorage,
|
|
17
|
+
x as useMergeRefs,
|
|
18
|
+
d as useResizeObserver,
|
|
19
|
+
a as useUncontrolled,
|
|
20
|
+
H as useUniqueId
|
|
20
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-hooks",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,12 +34,8 @@
|
|
|
34
34
|
"test": "vitest run"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"react": "^18.3.1",
|
|
38
|
-
"react-dom": "^18.3.1"
|
|
37
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
38
|
+
"react-dom": "^18.3.1 || ^19.0.0"
|
|
39
39
|
},
|
|
40
|
-
"
|
|
41
|
-
"react": "18.3.1",
|
|
42
|
-
"react-dom": "18.3.1"
|
|
43
|
-
},
|
|
44
|
-
"gitHead": "b4cbab083052f7f45b00e98c2992fffa31d05c1f"
|
|
40
|
+
"gitHead": "413e5c7cd8228d2f135f54fa897101401207229b"
|
|
45
41
|
}
|