@versini/ui-hooks 4.2.0 → 4.2.2
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 +14 -1
- package/dist/index.js +16 -13
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
|
+
interface HotkeyItemOptions {
|
|
4
|
+
preventDefault?: boolean;
|
|
5
|
+
}
|
|
6
|
+
type HotkeyItem$1 = [string, (event: any) => void, HotkeyItemOptions?];
|
|
7
|
+
declare function getHotkeyHandler(hotkeys: HotkeyItem$1[]): (event: React.KeyboardEvent<HTMLElement> | KeyboardEvent) => void;
|
|
8
|
+
|
|
9
|
+
type HotkeyItem = [
|
|
10
|
+
string,
|
|
11
|
+
(event: KeyboardEvent) => void,
|
|
12
|
+
HotkeyItemOptions?
|
|
13
|
+
];
|
|
14
|
+
declare function useHotkeys(hotkeys: HotkeyItem[], tagsToIgnore?: string[], triggerOnContentEditable?: boolean): void;
|
|
15
|
+
|
|
3
16
|
/**
|
|
4
17
|
* Custom hook that returns a function indicating whether the component
|
|
5
18
|
* is mounted or not.
|
|
@@ -129,4 +142,4 @@ type UseUniqueIdOptions = string | number | {
|
|
|
129
142
|
};
|
|
130
143
|
declare function useUniqueId(options?: UseUniqueIdOptions): string | undefined;
|
|
131
144
|
|
|
132
|
-
export { useIsMounted, useLocalStorage, useMergeRefs, useResizeObserver, useUncontrolled, useUniqueId };
|
|
145
|
+
export { getHotkeyHandler, useHotkeys, useIsMounted, useLocalStorage, useMergeRefs, useResizeObserver, useUncontrolled, useUniqueId };
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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";
|
|
7
8
|
/*!
|
|
8
|
-
@versini/ui-hooks v4.2.
|
|
9
|
+
@versini/ui-hooks v4.2.2
|
|
9
10
|
© 2024 gizmette.com
|
|
10
11
|
*/
|
|
11
12
|
export {
|
|
12
|
-
r as
|
|
13
|
-
t as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
18
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-hooks",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"react": "18.3.1",
|
|
42
42
|
"react-dom": "18.3.1"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "cf5736be5f4a60df72f9517adf44f98769ff8d45"
|
|
45
45
|
}
|