react-hook-toolkit 1.0.1 → 1.0.3
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/README.md +1 -4
- package/dist/hookExecuter/hookExecuter.d.ts +20 -0
- package/dist/hookExecuter/hookExecuter.js +58 -0
- package/dist/hooks/hooksComp.d.ts +8 -38
- package/dist/hooks/hooksComp.js +24 -202
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -116,10 +116,7 @@ Install the package with npm:
|
|
|
116
116
|
|
|
117
117
|
- **`useUpdateEffect`**: Executes a side effect on updates after the initial render, skipping the effect during the first render to avoid unnecessary executions.
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
- **Shivaji** : (Sr. React Developer)
|
|
122
|
-
- **Shyamal** : (Sr. React Developer)
|
|
119
|
+
- **`DynamicLoader`**: A Higher-Order Component (HOC) that dynamically loads a React component using `React.lazy()` with `Suspense`, while wrapping it in an `ErrorBoundary` to handle potential errors gracefully. It ensures that the component is loaded only when needed, reducing the initial bundle size and improving performance.
|
|
123
120
|
|
|
124
121
|
## License
|
|
125
122
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license HEXE
|
|
3
|
+
* Copyright (c) 2020-2024 Shivaji & Collaborators
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
type HookFunction = () => any;
|
|
9
|
+
declare class HEXE {
|
|
10
|
+
private hs;
|
|
11
|
+
private ss;
|
|
12
|
+
constructor();
|
|
13
|
+
setHook(name: string, hookFunction: HookFunction): this;
|
|
14
|
+
private putHooks;
|
|
15
|
+
component(): React.FC;
|
|
16
|
+
getHook(name: string): any;
|
|
17
|
+
}
|
|
18
|
+
declare const ReactHooksWrapper: React.FC<{}>;
|
|
19
|
+
declare const getHook: (name: string) => any, setHook: (name: string, hookFunction: HookFunction) => HEXE;
|
|
20
|
+
export { ReactHooksWrapper, getHook, setHook };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license HEXE
|
|
3
|
+
* Copyright (c) 2020-2024 Shivaji & Collaborators
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
var HEXE = /** @class */ (function () {
|
|
9
|
+
function HEXE() {
|
|
10
|
+
this.hs = {};
|
|
11
|
+
this.ss = {};
|
|
12
|
+
this.setHook = this.setHook.bind(this);
|
|
13
|
+
this.getHook = this.getHook.bind(this);
|
|
14
|
+
this.putHooks = this.putHooks.bind(this);
|
|
15
|
+
}
|
|
16
|
+
HEXE.prototype.setHook = function (name, hookFunction) {
|
|
17
|
+
[
|
|
18
|
+
{ value: name, id: 'name', type: 'string' },
|
|
19
|
+
{ value: hookFunction, id: 'hook', type: 'function' },
|
|
20
|
+
].forEach(function (_a) {
|
|
21
|
+
var value = _a.value, id = _a.id, type = _a.type;
|
|
22
|
+
if (type === 'string' && typeof value !== 'string') {
|
|
23
|
+
throw new TypeError("\"".concat(id, "\" expected to be of type ").concat(type));
|
|
24
|
+
}
|
|
25
|
+
if (type === 'function' && typeof value !== 'function') {
|
|
26
|
+
throw new TypeError("\"".concat(id, "\" expected to be of type ").concat(type));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
this.hs[name] = {
|
|
30
|
+
name: name,
|
|
31
|
+
hook: hookFunction,
|
|
32
|
+
};
|
|
33
|
+
return this;
|
|
34
|
+
};
|
|
35
|
+
HEXE.prototype.putHooks = function (name, value) {
|
|
36
|
+
this.ss[name] = value;
|
|
37
|
+
};
|
|
38
|
+
HEXE.prototype.component = function () {
|
|
39
|
+
var _this = this;
|
|
40
|
+
/* Author: Shivaji & Shyamal */
|
|
41
|
+
var Component = function () {
|
|
42
|
+
Object.values(_this.hs).forEach(function (_a) {
|
|
43
|
+
var name = _a.name, hook = _a.hook;
|
|
44
|
+
_this.putHooks(name, hook());
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null);
|
|
47
|
+
};
|
|
48
|
+
return Component;
|
|
49
|
+
};
|
|
50
|
+
HEXE.prototype.getHook = function (name) {
|
|
51
|
+
return this.ss[name];
|
|
52
|
+
};
|
|
53
|
+
return HEXE;
|
|
54
|
+
}());
|
|
55
|
+
var o = new HEXE();
|
|
56
|
+
var ReactHooksWrapper = o.component();
|
|
57
|
+
var getHook = o.getHook, setHook = o.setHook;
|
|
58
|
+
export { ReactHooksWrapper, getHook, setHook };
|
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function useHover<T extends HTMLElement>(): [RefObject<T>, boolean];
|
|
3
|
-
export declare function useOnClickOutside<T extends HTMLElement>(ref: RefObject<T>, handler: (event: MouseEvent | TouchEvent) => void): void;
|
|
4
|
-
interface IntersectionObserverArgs {
|
|
5
|
-
root?: Element | null;
|
|
6
|
-
rootMargin?: string;
|
|
7
|
-
threshold?: number | number[];
|
|
8
|
-
}
|
|
9
|
-
export declare function useIntersectionObserver<T extends HTMLElement>(ref: RefObject<T>, { root, rootMargin, threshold }?: IntersectionObserverArgs): boolean;
|
|
10
|
-
export declare function useHoverIntent<T extends HTMLElement>(): [RefObject<T>, boolean];
|
|
11
|
-
export interface DragDropState {
|
|
12
|
-
isDragging: boolean;
|
|
13
|
-
isOver: boolean;
|
|
14
|
-
draggedItemId: string | null;
|
|
15
|
-
overDropId: string | null;
|
|
16
|
-
}
|
|
17
|
-
export declare const useDragDrop: (onDrop: (dragId: string, dropId: string) => void) => {
|
|
18
|
-
state: DragDropState;
|
|
19
|
-
bindDrag: (dragId: string) => {
|
|
20
|
-
draggable: boolean;
|
|
21
|
-
onDragStart: (e: React.DragEvent) => void;
|
|
22
|
-
};
|
|
23
|
-
bindDrop: (dropId: string) => {
|
|
24
|
-
onDragOver: (e: React.DragEvent) => void;
|
|
25
|
-
onDragEnter: (e: React.DragEvent) => void;
|
|
26
|
-
onDragLeave: (e: React.DragEvent) => void;
|
|
27
|
-
onDrop: (e: React.DragEvent) => void;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export declare function useFocusTrap(ref: React.RefObject<HTMLElement>): void;
|
|
31
|
-
export declare function useFocus<T extends HTMLElement>(): [React.RefObject<T>, boolean];
|
|
32
|
-
interface WindowSize {
|
|
33
|
-
width: number;
|
|
34
|
-
height: number;
|
|
35
|
-
}
|
|
36
|
-
export declare function useElementSize<T extends HTMLElement = HTMLDivElement>(): [(node: T | null) => void, WindowSize];
|
|
37
|
-
export declare function useLockBodyScroll(lock?: boolean): void;
|
|
1
|
+
import { FC } from 'react';
|
|
38
2
|
export declare const DynamicLoader: (Component: any) => (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
|
|
3
|
+
interface PropsType {
|
|
4
|
+
type: string;
|
|
5
|
+
msg: string;
|
|
6
|
+
duration?: number;
|
|
7
|
+
}
|
|
8
|
+
declare const AlertMessage: FC<PropsType>;
|
|
9
|
+
export default AlertMessage;
|
package/dist/hooks/hooksComp.js
CHANGED
|
@@ -10,211 +10,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import {
|
|
14
|
-
import { Box, Alert, AlertTitle } from '@mui/material';
|
|
13
|
+
import { useEffect, useCallback, useRef, Suspense } from 'react';
|
|
14
|
+
import { Box, Alert, AlertTitle, IconButton } from '@mui/material';
|
|
15
|
+
import { Close } from '@mui/icons-material';
|
|
15
16
|
import NProgress from 'nprogress';
|
|
16
17
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
17
18
|
import { promise } from '../utils';
|
|
18
|
-
|
|
19
|
-
var _a = useState(false), isHovered = _a[0], setIsHovered = _a[1];
|
|
20
|
-
var ref = useRef(null);
|
|
21
|
-
useEffect(function () {
|
|
22
|
-
var node = ref.current;
|
|
23
|
-
if (!node)
|
|
24
|
-
return;
|
|
25
|
-
var handleMouseOver = function () { return setIsHovered(true); };
|
|
26
|
-
var handleMouseOut = function () { return setIsHovered(false); };
|
|
27
|
-
node.addEventListener('mouseover', handleMouseOver);
|
|
28
|
-
node.addEventListener('mouseout', handleMouseOut);
|
|
29
|
-
return function () {
|
|
30
|
-
node.removeEventListener('mouseover', handleMouseOver);
|
|
31
|
-
node.removeEventListener('mouseout', handleMouseOut);
|
|
32
|
-
};
|
|
33
|
-
}, []);
|
|
34
|
-
return [ref, isHovered];
|
|
35
|
-
}
|
|
36
|
-
export function useOnClickOutside(ref, handler) {
|
|
37
|
-
useEffect(function () {
|
|
38
|
-
var listener = function (event) {
|
|
39
|
-
if (!ref.current || ref.current.contains(event.target))
|
|
40
|
-
return;
|
|
41
|
-
handler(event);
|
|
42
|
-
};
|
|
43
|
-
document.addEventListener('mousedown', listener);
|
|
44
|
-
document.addEventListener('touchstart', listener);
|
|
45
|
-
return function () {
|
|
46
|
-
document.removeEventListener('mousedown', listener);
|
|
47
|
-
document.removeEventListener('touchstart', listener);
|
|
48
|
-
};
|
|
49
|
-
}, [ref, handler]);
|
|
50
|
-
}
|
|
51
|
-
export function useIntersectionObserver(ref, _a) {
|
|
52
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.root, root = _c === void 0 ? null : _c, _d = _b.rootMargin, rootMargin = _d === void 0 ? '0px' : _d, _e = _b.threshold, threshold = _e === void 0 ? 0 : _e;
|
|
53
|
-
var _f = useState(false), isIntersecting = _f[0], setIsIntersecting = _f[1];
|
|
54
|
-
useEffect(function () {
|
|
55
|
-
var observer = new IntersectionObserver(function (_a) {
|
|
56
|
-
var entry = _a[0];
|
|
57
|
-
return setIsIntersecting(entry.isIntersecting);
|
|
58
|
-
}, {
|
|
59
|
-
root: root,
|
|
60
|
-
rootMargin: rootMargin,
|
|
61
|
-
threshold: threshold,
|
|
62
|
-
});
|
|
63
|
-
var current = ref.current;
|
|
64
|
-
if (current)
|
|
65
|
-
observer.observe(current);
|
|
66
|
-
return function () {
|
|
67
|
-
if (current)
|
|
68
|
-
observer.unobserve(current);
|
|
69
|
-
};
|
|
70
|
-
}, [ref, root, rootMargin, threshold]);
|
|
71
|
-
return isIntersecting;
|
|
72
|
-
}
|
|
73
|
-
export function useHoverIntent() {
|
|
74
|
-
var _a = useState(false), isHovering = _a[0], setIsHovering = _a[1];
|
|
75
|
-
var ref = useRef(null);
|
|
76
|
-
useEffect(function () {
|
|
77
|
-
var node = ref.current;
|
|
78
|
-
if (!node)
|
|
79
|
-
return;
|
|
80
|
-
var timeout;
|
|
81
|
-
var handleMouseEnter = function () {
|
|
82
|
-
timeout = setTimeout(function () { return setIsHovering(true); }, 100);
|
|
83
|
-
};
|
|
84
|
-
var handleMouseLeave = function () {
|
|
85
|
-
clearTimeout(timeout);
|
|
86
|
-
setIsHovering(false);
|
|
87
|
-
};
|
|
88
|
-
node.addEventListener('mouseenter', handleMouseEnter);
|
|
89
|
-
node.addEventListener('mouseleave', handleMouseLeave);
|
|
90
|
-
return function () {
|
|
91
|
-
node.removeEventListener('mouseenter', handleMouseEnter);
|
|
92
|
-
node.removeEventListener('mouseleave', handleMouseLeave);
|
|
93
|
-
};
|
|
94
|
-
}, []);
|
|
95
|
-
return [ref, isHovering];
|
|
96
|
-
}
|
|
97
|
-
export var useDragDrop = function (onDrop) {
|
|
98
|
-
var _a = useState({
|
|
99
|
-
isDragging: false,
|
|
100
|
-
isOver: false,
|
|
101
|
-
draggedItemId: null,
|
|
102
|
-
overDropId: null,
|
|
103
|
-
}), state = _a[0], setState = _a[1];
|
|
104
|
-
var handleDragStart = useCallback(function (e, dragId) {
|
|
105
|
-
e.dataTransfer.setData('text/plain', dragId);
|
|
106
|
-
e.dataTransfer.effectAllowed = 'move';
|
|
107
|
-
setState({ isDragging: true, isOver: false, draggedItemId: dragId, overDropId: null });
|
|
108
|
-
}, []);
|
|
109
|
-
var handleDragOver = useCallback(function (e, dropId) {
|
|
110
|
-
e.preventDefault();
|
|
111
|
-
if (state.overDropId !== dropId) {
|
|
112
|
-
setState(function (s) { return (__assign(__assign({}, s), { isOver: true, overDropId: dropId })); });
|
|
113
|
-
}
|
|
114
|
-
}, [state.overDropId]);
|
|
115
|
-
var handleDragEnter = useCallback(function (e, dropId) {
|
|
116
|
-
e.preventDefault();
|
|
117
|
-
setState(function (s) { return (__assign(__assign({}, s), { isOver: true, overDropId: dropId })); });
|
|
118
|
-
}, []);
|
|
119
|
-
var handleDragLeave = useCallback(function (e, dropId) {
|
|
120
|
-
e.preventDefault();
|
|
121
|
-
if (state.overDropId === dropId) {
|
|
122
|
-
setState(function (s) { return (__assign(__assign({}, s), { isOver: false, overDropId: null })); });
|
|
123
|
-
}
|
|
124
|
-
}, [state.overDropId]);
|
|
125
|
-
var handleDrop = useCallback(function (e, dropId) {
|
|
126
|
-
e.preventDefault();
|
|
127
|
-
var dragId = e.dataTransfer.getData('text/plain');
|
|
128
|
-
setState({ isDragging: false, isOver: false, draggedItemId: dragId, overDropId: dropId });
|
|
129
|
-
onDrop(dragId, dropId);
|
|
130
|
-
}, [onDrop]);
|
|
131
|
-
return {
|
|
132
|
-
state: state,
|
|
133
|
-
bindDrag: function (dragId) { return ({
|
|
134
|
-
draggable: true,
|
|
135
|
-
onDragStart: function (e) { return handleDragStart(e, dragId); },
|
|
136
|
-
}); },
|
|
137
|
-
bindDrop: function (dropId) { return ({
|
|
138
|
-
onDragOver: function (e) { return handleDragOver(e, dropId); },
|
|
139
|
-
onDragEnter: function (e) { return handleDragEnter(e, dropId); },
|
|
140
|
-
onDragLeave: function (e) { return handleDragLeave(e, dropId); },
|
|
141
|
-
onDrop: function (e) { return handleDrop(e, dropId); },
|
|
142
|
-
}); },
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
export function useFocusTrap(ref) {
|
|
146
|
-
useEffect(function () {
|
|
147
|
-
var handleFocus = function (event) {
|
|
148
|
-
var _a, _b, _c;
|
|
149
|
-
if (!((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
150
|
-
var focusableElements = (_b = ref.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll('a, button, input, textarea, select, [tabindex]:not([tabindex="-1"])');
|
|
151
|
-
(_c = focusableElements === null || focusableElements === void 0 ? void 0 : focusableElements[0]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
152
|
-
event.preventDefault();
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
document.addEventListener('focusin', handleFocus);
|
|
156
|
-
return function () {
|
|
157
|
-
document.removeEventListener('focusin', handleFocus);
|
|
158
|
-
};
|
|
159
|
-
}, [ref]);
|
|
160
|
-
}
|
|
161
|
-
export function useFocus() {
|
|
162
|
-
var _a = useState(false), isFocused = _a[0], setIsFocused = _a[1];
|
|
163
|
-
var ref = useRef(null);
|
|
164
|
-
useEffect(function () {
|
|
165
|
-
var element = ref.current;
|
|
166
|
-
if (!element)
|
|
167
|
-
return;
|
|
168
|
-
var handleFocus = function () { return setIsFocused(true); };
|
|
169
|
-
var handleBlur = function () { return setIsFocused(false); };
|
|
170
|
-
element.addEventListener('focus', handleFocus);
|
|
171
|
-
element.addEventListener('blur', handleBlur);
|
|
172
|
-
return function () {
|
|
173
|
-
element.removeEventListener('focus', handleFocus);
|
|
174
|
-
element.removeEventListener('blur', handleBlur);
|
|
175
|
-
};
|
|
176
|
-
}, []);
|
|
177
|
-
return [ref, isFocused];
|
|
178
|
-
}
|
|
179
|
-
export function useElementSize() {
|
|
180
|
-
var _a = useState(null), ref = _a[0], setRef = _a[1];
|
|
181
|
-
var _b = useState({ width: 0, height: 0 }), size = _b[0], setSize = _b[1];
|
|
182
|
-
var handleSize = useCallback(function () {
|
|
183
|
-
if (ref) {
|
|
184
|
-
setSize({
|
|
185
|
-
width: ref.offsetWidth,
|
|
186
|
-
height: ref.offsetHeight,
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}, [ref]);
|
|
190
|
-
var useEnviromentEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
191
|
-
useEnviromentEffect(function () {
|
|
192
|
-
if (!ref)
|
|
193
|
-
return;
|
|
194
|
-
handleSize();
|
|
195
|
-
var resizeObserver = new ResizeObserver(handleSize);
|
|
196
|
-
resizeObserver.observe(ref);
|
|
197
|
-
return function () { return resizeObserver.disconnect(); };
|
|
198
|
-
}, [ref, handleSize]);
|
|
199
|
-
return [setRef, size];
|
|
200
|
-
}
|
|
201
|
-
export function useLockBodyScroll(lock) {
|
|
202
|
-
if (lock === void 0) { lock = true; }
|
|
203
|
-
useLayoutEffect(function () {
|
|
204
|
-
if (typeof document === 'undefined') {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
var originalStyle = window.getComputedStyle(document.body).overflow;
|
|
208
|
-
if (lock) {
|
|
209
|
-
document.body.style.overflow = 'hidden';
|
|
210
|
-
}
|
|
211
|
-
return function () {
|
|
212
|
-
if (lock) {
|
|
213
|
-
document.body.style.overflow = originalStyle;
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
}, [lock]);
|
|
217
|
-
}
|
|
19
|
+
import { getHook } from '../hookExecuter/hookExecuter';
|
|
218
20
|
function Fallback(_a) {
|
|
219
21
|
var error = _a.error;
|
|
220
22
|
return (_jsxs(Box, { sx: { padding: 2 }, children: [process.env.NODE_ENV === 'production' && (_jsxs(Alert, { sx: { py: 0, borderLeft: '2px solid #00abff !important', border: '1px solid #d0cfcf' }, severity: "info", children: [_jsx(AlertTitle, { children: "Page Loading Error" }), "Please check your network connection..."] })), process.env.NODE_ENV !== 'production' && (_jsxs(Alert, { severity: "error", sx: { py: 0, borderTop: '2px solid #791212ad !important', border: '1px solid #d0cfcf' }, children: [_jsx(AlertTitle, { children: "Error" }), error.message] }))] }));
|
|
@@ -250,3 +52,23 @@ var LoadingScreen = function () {
|
|
|
250
52
|
};
|
|
251
53
|
// prettier-ignore
|
|
252
54
|
export var DynamicLoader = function (Component) { return function (props) { return (_jsx(Error, { children: _jsx(Suspense, { fallback: _jsx(LoadingScreen, {}), children: _jsx(Component, __assign({}, props)) }) })); }; };
|
|
55
|
+
var AlertMessage = function (_a) {
|
|
56
|
+
var type = _a.type, msg = _a.msg, duration = _a.duration;
|
|
57
|
+
var _b = getHook('snackBar'), enqueueSnackbar = _b.enqueueSnackbar, closeSnackbar = _b.closeSnackbar;
|
|
58
|
+
if (msg !== undefined && msg !== '') {
|
|
59
|
+
enqueueSnackbar(msg !== null && msg !== void 0 ? msg : '', {
|
|
60
|
+
anchorOrigin: {
|
|
61
|
+
// @shivaji perpose dyanamic global alert.
|
|
62
|
+
horizontal: 'right',
|
|
63
|
+
vertical: 'top',
|
|
64
|
+
},
|
|
65
|
+
variant: type,
|
|
66
|
+
preventDuplicate: true,
|
|
67
|
+
// persist: true, whenever you want to close.
|
|
68
|
+
action: function (key) { return (_jsx(IconButton, { "aria-label": "close", size: "small", onClick: function () { return closeSnackbar(key); }, children: _jsx(Close, { fontSize: "small", sx: { color: '#fff' } }) })); },
|
|
69
|
+
autoHideDuration: duration !== null && duration !== void 0 ? duration : 6000,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
};
|
|
74
|
+
export default AlertMessage;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import 'nprogress/nprogress.css';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactHooksWrapper, getHook, setHook } from "./hookExecuter/hookExecuter";
|
|
3
3
|
import { DynamicLoader } from './hooks/hooksComp';
|
|
4
|
-
|
|
4
|
+
import { useAxios, useAdvReducer, useFetch, useLocalStorage, useToggle, useDebounce, useThrottle, usePrevious, useMediaQuery, useClipboard, useInterval, useWindowSize, useKeyPress, useOnlineStatus, useScrollPosition, useTimeout, useDarkMode, useForm, useArray, useStepper, useUpdateEffect, useTouch, useSound, useSessionStorage, usePreferredLanguage, useHistory, useEventListener, useBattery, useDebouncedCallback, useScrollLock, useResizeObserver, useMousePosition, useScrollDirection, useImageLoader, usePersistedState, useReducedMotion, useCookie, useFetchRetry, useDelay, useVisibilityChange, useDebouncedValue, useAsync, useScript, useIndexedDB, useGeoLocation, useTimer, useIsMounted, useCss, useSpeak, useCountUp, useCountDown } from './hooks/hooks';
|
|
5
|
+
export default ReactHooksWrapper;
|
|
6
|
+
export { getHook, setHook, useAxios, useAdvReducer, useFetch, useLocalStorage, useToggle, useDebounce, useThrottle, usePrevious, useMediaQuery, useClipboard, useInterval, useWindowSize, useKeyPress, useOnlineStatus, useScrollPosition, useTimeout, useDarkMode, useForm, useArray, useStepper, useUpdateEffect, useTouch, useSound, useSessionStorage, usePreferredLanguage, useHistory, useEventListener, useBattery, useDebouncedCallback, useScrollLock, useResizeObserver, useMousePosition, useScrollDirection, useImageLoader, usePersistedState, useReducedMotion, useCookie, useFetchRetry, useDelay, useVisibilityChange, useDebouncedValue, useAsync, useScript, useIndexedDB, useGeoLocation, useTimer, useIsMounted, useCss, useSpeak, useCountUp, useCountDown, DynamicLoader };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import 'nprogress/nprogress.css';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactHooksWrapper, getHook, setHook } from "./hookExecuter/hookExecuter";
|
|
3
3
|
import { DynamicLoader } from './hooks/hooksComp';
|
|
4
|
-
|
|
4
|
+
import { useAxios, useAdvReducer, useFetch, useLocalStorage, useToggle, useDebounce, useThrottle, usePrevious, useMediaQuery, useClipboard, useInterval, useWindowSize, useKeyPress, useOnlineStatus, useScrollPosition, useTimeout, useDarkMode, useForm, useArray, useStepper, useUpdateEffect, useTouch, useSound, useSessionStorage, usePreferredLanguage, useHistory, useEventListener, useBattery, useDebouncedCallback, useScrollLock, useResizeObserver, useMousePosition, useScrollDirection, useImageLoader, usePersistedState, useReducedMotion, useCookie, useFetchRetry, useDelay, useVisibilityChange, useDebouncedValue, useAsync, useScript, useIndexedDB, useGeoLocation, useTimer, useIsMounted, useCss, useSpeak, useCountUp, useCountDown, } from './hooks/hooks';
|
|
5
|
+
export default ReactHooksWrapper;
|
|
6
|
+
export { getHook, setHook, useAxios, useAdvReducer, useFetch, useLocalStorage, useToggle, useDebounce, useThrottle, usePrevious, useMediaQuery, useClipboard, useInterval, useWindowSize, useKeyPress, useOnlineStatus, useScrollPosition, useTimeout, useDarkMode, useForm, useArray, useStepper, useUpdateEffect, useTouch, useSound, useSessionStorage, usePreferredLanguage, useHistory, useEventListener, useBattery, useDebouncedCallback, useScrollLock, useResizeObserver, useMousePosition, useScrollDirection, useImageLoader, usePersistedState, useReducedMotion, useCookie, useFetchRetry, useDelay, useVisibilityChange, useDebouncedValue, useAsync, useScript, useIndexedDB, useGeoLocation, useTimer, useIsMounted, useCss, useSpeak, useCountUp, useCountDown, DynamicLoader };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-hook-toolkit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Ultimate package for React developers, offering a powerful collection of hooks and components to enhance their development experience.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@emotion/react": "^11.14.0",
|
|
30
30
|
"@emotion/styled": "^11.14.0",
|
|
31
|
+
"@mui/icons-material": "^7.0.1",
|
|
31
32
|
"@mui/material": "^5.14.0",
|
|
32
33
|
"axios": "^1.7.8",
|
|
33
34
|
"nprogress": "^0.2.0",
|