@reactuses/core 6.1.8 → 6.1.10
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 +2 -0
- package/dist/index.cjs +27 -16
- package/dist/index.d.cts +7 -6
- package/dist/index.d.mts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.mjs +27 -16
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -52,7 +52,9 @@ Refer to [documentations](https://reactuse.com/) for more details.
|
|
|
52
52
|
## Who's Using This
|
|
53
53
|
|
|
54
54
|
[](https://www.pinduoduo.com/)
|
|
55
|
+
[](https://shopee.com/)
|
|
55
56
|
[](https://www.ctrip.com/)
|
|
57
|
+
[](https://bambulab.com/)
|
|
56
58
|
|
|
57
59
|
---
|
|
58
60
|
|
package/dist/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ function isString(val) {
|
|
|
23
23
|
const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
|
|
24
24
|
const isBrowser = typeof window !== 'undefined';
|
|
25
25
|
const isNavigator = typeof navigator !== 'undefined';
|
|
26
|
-
function noop() {}
|
|
26
|
+
function noop$1() {}
|
|
27
27
|
const isIOS = isBrowser && ((_window = window) == null ? void 0 : (_window_navigator = _window.navigator) == null ? void 0 : _window_navigator.userAgent) && /iP(?:ad|hone|od)/.test(window.navigator.userAgent);
|
|
28
28
|
|
|
29
29
|
const useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useEffect;
|
|
@@ -113,10 +113,10 @@ const useDeepCompareEffect = (effect, deps)=>{
|
|
|
113
113
|
useCustomCompareEffect(effect, deps, lodashEs.isEqual);
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
function
|
|
116
|
+
function useEventListenerImpl(eventName, handler, element, options = defaultOptions$1) {
|
|
117
117
|
const savedHandler = useLatest(handler);
|
|
118
|
+
const targetElement = getTargetElement(element, defaultWindow);
|
|
118
119
|
useDeepCompareEffect(()=>{
|
|
119
|
-
const targetElement = getTargetElement(element, defaultWindow);
|
|
120
120
|
if (!(targetElement && targetElement.addEventListener)) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
@@ -130,10 +130,12 @@ function useEventListener(eventName, handler, element, options = defaultOptions$
|
|
|
130
130
|
};
|
|
131
131
|
}, [
|
|
132
132
|
eventName,
|
|
133
|
-
|
|
133
|
+
targetElement,
|
|
134
134
|
options
|
|
135
135
|
]);
|
|
136
136
|
}
|
|
137
|
+
function noop() {}
|
|
138
|
+
const useEventListener = isBrowser ? useEventListenerImpl : noop;
|
|
137
139
|
|
|
138
140
|
const useMount = (fn)=>{
|
|
139
141
|
if (isDev) {
|
|
@@ -203,7 +205,7 @@ function _async_to_generator$7(fn) {
|
|
|
203
205
|
});
|
|
204
206
|
};
|
|
205
207
|
}
|
|
206
|
-
const useAsyncEffect = (effect, cleanup = noop, deps)=>{
|
|
208
|
+
const useAsyncEffect = (effect, cleanup = noop$1, deps)=>{
|
|
207
209
|
const mounted = useMountedState();
|
|
208
210
|
React.useEffect(()=>{
|
|
209
211
|
const execute = ()=>_async_to_generator$7(function*() {
|
|
@@ -1774,7 +1776,7 @@ const defaultListerOptions = {
|
|
|
1774
1776
|
passive: true
|
|
1775
1777
|
};
|
|
1776
1778
|
const useScroll = (target, options = defaultOptions$1)=>{
|
|
1777
|
-
const { throttle = 0, idle = 200, onStop = noop, onScroll = noop, offset = {
|
|
1779
|
+
const { throttle = 0, idle = 200, onStop = noop$1, onScroll = noop$1, offset = {
|
|
1778
1780
|
left: 0,
|
|
1779
1781
|
right: 0,
|
|
1780
1782
|
top: 0,
|
|
@@ -2112,7 +2114,7 @@ const useMediaDevices = (options = {})=>{
|
|
|
2112
2114
|
label
|
|
2113
2115
|
}))
|
|
2114
2116
|
});
|
|
2115
|
-
}).catch(noop);
|
|
2117
|
+
}).catch(noop$1);
|
|
2116
2118
|
}, []);
|
|
2117
2119
|
const ensurePermissions = React.useCallback(()=>_async_to_generator$3(function*() {
|
|
2118
2120
|
if (!isSupported) {
|
|
@@ -2214,10 +2216,19 @@ const useMediaQuery = (query, defaultState)=>{
|
|
|
2214
2216
|
function useRafState(initialState) {
|
|
2215
2217
|
const frame = React.useRef(0);
|
|
2216
2218
|
const [state, setState] = React.useState(initialState);
|
|
2219
|
+
const pendingUpdates = React.useRef([]);
|
|
2217
2220
|
const setRafState = React.useCallback((value)=>{
|
|
2221
|
+
pendingUpdates.current.push(value);
|
|
2218
2222
|
cancelAnimationFrame(frame.current);
|
|
2219
2223
|
frame.current = requestAnimationFrame(()=>{
|
|
2220
|
-
|
|
2224
|
+
const updates = pendingUpdates.current.splice(0);
|
|
2225
|
+
setState((prevState)=>{
|
|
2226
|
+
let newState = prevState;
|
|
2227
|
+
for (const update of updates){
|
|
2228
|
+
newState = typeof update === 'function' ? update(newState) : update;
|
|
2229
|
+
}
|
|
2230
|
+
return newState;
|
|
2231
|
+
});
|
|
2221
2232
|
});
|
|
2222
2233
|
}, []);
|
|
2223
2234
|
useUnmount(()=>{
|
|
@@ -2506,13 +2517,13 @@ function usePageLeave() {
|
|
|
2506
2517
|
const from = event.relatedTarget || event.toElement;
|
|
2507
2518
|
setIsLeft(!from);
|
|
2508
2519
|
};
|
|
2509
|
-
useEventListener('mouseout', handler,
|
|
2520
|
+
useEventListener('mouseout', handler, defaultWindow, {
|
|
2510
2521
|
passive: true
|
|
2511
2522
|
});
|
|
2512
|
-
useEventListener('mouseleave', handler,
|
|
2523
|
+
useEventListener('mouseleave', handler, defaultDocument, {
|
|
2513
2524
|
passive: true
|
|
2514
2525
|
});
|
|
2515
|
-
useEventListener('mouseenter', handler,
|
|
2526
|
+
useEventListener('mouseenter', handler, defaultDocument, {
|
|
2516
2527
|
passive: true
|
|
2517
2528
|
});
|
|
2518
2529
|
return isLeft;
|
|
@@ -2540,7 +2551,7 @@ const usePermission = (permissionDesc)=>{
|
|
|
2540
2551
|
permissionStatus = status;
|
|
2541
2552
|
on(permissionStatus, 'change', onChange);
|
|
2542
2553
|
onChange();
|
|
2543
|
-
}).catch(noop);
|
|
2554
|
+
}).catch(noop$1);
|
|
2544
2555
|
return ()=>{
|
|
2545
2556
|
permissionStatus && off(permissionStatus, 'change', onChange);
|
|
2546
2557
|
mounted = false;
|
|
@@ -2678,7 +2689,7 @@ const useScratch = (target, options = {})=>{
|
|
|
2678
2689
|
isScratching: true
|
|
2679
2690
|
});
|
|
2680
2691
|
refState.current = newState;
|
|
2681
|
-
(optionsRef.current.onScratch || noop)(newState);
|
|
2692
|
+
(optionsRef.current.onScratch || noop$1)(newState);
|
|
2682
2693
|
return newState;
|
|
2683
2694
|
});
|
|
2684
2695
|
});
|
|
@@ -2692,7 +2703,7 @@ const useScratch = (target, options = {})=>{
|
|
|
2692
2703
|
isScratching: false
|
|
2693
2704
|
});
|
|
2694
2705
|
refState.current = endState;
|
|
2695
|
-
(optionsRef.current.onScratchEnd || noop)(endState);
|
|
2706
|
+
(optionsRef.current.onScratchEnd || noop$1)(endState);
|
|
2696
2707
|
setState(endState);
|
|
2697
2708
|
};
|
|
2698
2709
|
const startScratching = (docX, docY)=>{
|
|
@@ -2725,7 +2736,7 @@ const useScratch = (target, options = {})=>{
|
|
|
2725
2736
|
posY: elY
|
|
2726
2737
|
};
|
|
2727
2738
|
refState.current = newState;
|
|
2728
|
-
(optionsRef.current.onScratchStart || noop)(newState);
|
|
2739
|
+
(optionsRef.current.onScratchStart || noop$1)(newState);
|
|
2729
2740
|
setState(newState);
|
|
2730
2741
|
};
|
|
2731
2742
|
useEventListener('mousedown', (event)=>{
|
|
@@ -2752,7 +2763,7 @@ const useScratch = (target, options = {})=>{
|
|
|
2752
2763
|
return state;
|
|
2753
2764
|
};
|
|
2754
2765
|
|
|
2755
|
-
const useScriptTag = (src, onLoaded = noop, options = defaultOptions$1)=>{
|
|
2766
|
+
const useScriptTag = (src, onLoaded = noop$1, options = defaultOptions$1)=>{
|
|
2756
2767
|
const { immediate = true, manual = false, type = 'text/javascript', async = true, crossOrigin, referrerPolicy, noModule, defer, attrs = {} } = options;
|
|
2757
2768
|
const scriptTag = React.useRef(null);
|
|
2758
2769
|
const _promise = React.useRef(null);
|
package/dist/index.d.cts
CHANGED
|
@@ -888,12 +888,13 @@ interface UseEventEmitterReturn<T, U = void> {
|
|
|
888
888
|
declare function useEventEmitter<T, U = void>(): readonly [UseEventEmitterEvent<T, U>, (arg1: T, arg2: U) => void, () => void];
|
|
889
889
|
|
|
890
890
|
type Target = BasicTarget<HTMLElement | Element | Window | Document | EventTarget>;
|
|
891
|
-
declare function
|
|
892
|
-
declare function
|
|
893
|
-
declare function
|
|
894
|
-
declare function
|
|
895
|
-
declare function
|
|
896
|
-
declare function
|
|
891
|
+
declare function useEventListenerImpl<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: Window, options?: boolean | AddEventListenerOptions): void;
|
|
892
|
+
declare function useEventListenerImpl<K extends keyof DocumentEventMap>(eventName: K, handler: (event: DocumentEventMap[K]) => void, element: Document, options?: boolean | AddEventListenerOptions): void;
|
|
893
|
+
declare function useEventListenerImpl<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLDivElement>(eventName: K, handler: (event: HTMLElementEventMap[K]) => void, element: T, options?: boolean | AddEventListenerOptions): void;
|
|
894
|
+
declare function useEventListenerImpl<K extends keyof ElementEventMap>(eventName: K, handler: (event: ElementEventMap[K]) => void, element: Element, options?: boolean | AddEventListenerOptions): void;
|
|
895
|
+
declare function useEventListenerImpl<K = Event>(eventName: string, handler: (event: K) => void, element: EventTarget | null | undefined, options?: boolean | AddEventListenerOptions): void;
|
|
896
|
+
declare function useEventListenerImpl(eventName: string, handler: (...p: any) => void, element?: Target, options?: boolean | AddEventListenerOptions): void;
|
|
897
|
+
declare const useEventListener: typeof useEventListenerImpl;
|
|
897
898
|
|
|
898
899
|
/**
|
|
899
900
|
* @title useEyeDropper
|
package/dist/index.d.mts
CHANGED
|
@@ -888,12 +888,13 @@ interface UseEventEmitterReturn<T, U = void> {
|
|
|
888
888
|
declare function useEventEmitter<T, U = void>(): readonly [UseEventEmitterEvent<T, U>, (arg1: T, arg2: U) => void, () => void];
|
|
889
889
|
|
|
890
890
|
type Target = BasicTarget<HTMLElement | Element | Window | Document | EventTarget>;
|
|
891
|
-
declare function
|
|
892
|
-
declare function
|
|
893
|
-
declare function
|
|
894
|
-
declare function
|
|
895
|
-
declare function
|
|
896
|
-
declare function
|
|
891
|
+
declare function useEventListenerImpl<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: Window, options?: boolean | AddEventListenerOptions): void;
|
|
892
|
+
declare function useEventListenerImpl<K extends keyof DocumentEventMap>(eventName: K, handler: (event: DocumentEventMap[K]) => void, element: Document, options?: boolean | AddEventListenerOptions): void;
|
|
893
|
+
declare function useEventListenerImpl<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLDivElement>(eventName: K, handler: (event: HTMLElementEventMap[K]) => void, element: T, options?: boolean | AddEventListenerOptions): void;
|
|
894
|
+
declare function useEventListenerImpl<K extends keyof ElementEventMap>(eventName: K, handler: (event: ElementEventMap[K]) => void, element: Element, options?: boolean | AddEventListenerOptions): void;
|
|
895
|
+
declare function useEventListenerImpl<K = Event>(eventName: string, handler: (event: K) => void, element: EventTarget | null | undefined, options?: boolean | AddEventListenerOptions): void;
|
|
896
|
+
declare function useEventListenerImpl(eventName: string, handler: (...p: any) => void, element?: Target, options?: boolean | AddEventListenerOptions): void;
|
|
897
|
+
declare const useEventListener: typeof useEventListenerImpl;
|
|
897
898
|
|
|
898
899
|
/**
|
|
899
900
|
* @title useEyeDropper
|
package/dist/index.d.ts
CHANGED
|
@@ -888,12 +888,13 @@ interface UseEventEmitterReturn<T, U = void> {
|
|
|
888
888
|
declare function useEventEmitter<T, U = void>(): readonly [UseEventEmitterEvent<T, U>, (arg1: T, arg2: U) => void, () => void];
|
|
889
889
|
|
|
890
890
|
type Target = BasicTarget<HTMLElement | Element | Window | Document | EventTarget>;
|
|
891
|
-
declare function
|
|
892
|
-
declare function
|
|
893
|
-
declare function
|
|
894
|
-
declare function
|
|
895
|
-
declare function
|
|
896
|
-
declare function
|
|
891
|
+
declare function useEventListenerImpl<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: Window, options?: boolean | AddEventListenerOptions): void;
|
|
892
|
+
declare function useEventListenerImpl<K extends keyof DocumentEventMap>(eventName: K, handler: (event: DocumentEventMap[K]) => void, element: Document, options?: boolean | AddEventListenerOptions): void;
|
|
893
|
+
declare function useEventListenerImpl<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLDivElement>(eventName: K, handler: (event: HTMLElementEventMap[K]) => void, element: T, options?: boolean | AddEventListenerOptions): void;
|
|
894
|
+
declare function useEventListenerImpl<K extends keyof ElementEventMap>(eventName: K, handler: (event: ElementEventMap[K]) => void, element: Element, options?: boolean | AddEventListenerOptions): void;
|
|
895
|
+
declare function useEventListenerImpl<K = Event>(eventName: string, handler: (event: K) => void, element: EventTarget | null | undefined, options?: boolean | AddEventListenerOptions): void;
|
|
896
|
+
declare function useEventListenerImpl(eventName: string, handler: (...p: any) => void, element?: Target, options?: boolean | AddEventListenerOptions): void;
|
|
897
|
+
declare const useEventListener: typeof useEventListenerImpl;
|
|
897
898
|
|
|
898
899
|
/**
|
|
899
900
|
* @title useEyeDropper
|
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ function isString(val) {
|
|
|
15
15
|
const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
|
|
16
16
|
const isBrowser = typeof window !== 'undefined';
|
|
17
17
|
const isNavigator = typeof navigator !== 'undefined';
|
|
18
|
-
function noop() {}
|
|
18
|
+
function noop$1() {}
|
|
19
19
|
const isIOS = isBrowser && ((_window = window) == null ? void 0 : (_window_navigator = _window.navigator) == null ? void 0 : _window_navigator.userAgent) && /iP(?:ad|hone|od)/.test(window.navigator.userAgent);
|
|
20
20
|
|
|
21
21
|
const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;
|
|
@@ -105,10 +105,10 @@ const useDeepCompareEffect = (effect, deps)=>{
|
|
|
105
105
|
useCustomCompareEffect(effect, deps, isEqual);
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
-
function
|
|
108
|
+
function useEventListenerImpl(eventName, handler, element, options = defaultOptions$1) {
|
|
109
109
|
const savedHandler = useLatest(handler);
|
|
110
|
+
const targetElement = getTargetElement(element, defaultWindow);
|
|
110
111
|
useDeepCompareEffect(()=>{
|
|
111
|
-
const targetElement = getTargetElement(element, defaultWindow);
|
|
112
112
|
if (!(targetElement && targetElement.addEventListener)) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
@@ -122,10 +122,12 @@ function useEventListener(eventName, handler, element, options = defaultOptions$
|
|
|
122
122
|
};
|
|
123
123
|
}, [
|
|
124
124
|
eventName,
|
|
125
|
-
|
|
125
|
+
targetElement,
|
|
126
126
|
options
|
|
127
127
|
]);
|
|
128
128
|
}
|
|
129
|
+
function noop() {}
|
|
130
|
+
const useEventListener = isBrowser ? useEventListenerImpl : noop;
|
|
129
131
|
|
|
130
132
|
const useMount = (fn)=>{
|
|
131
133
|
if (isDev) {
|
|
@@ -195,7 +197,7 @@ function _async_to_generator$7(fn) {
|
|
|
195
197
|
});
|
|
196
198
|
};
|
|
197
199
|
}
|
|
198
|
-
const useAsyncEffect = (effect, cleanup = noop, deps)=>{
|
|
200
|
+
const useAsyncEffect = (effect, cleanup = noop$1, deps)=>{
|
|
199
201
|
const mounted = useMountedState();
|
|
200
202
|
useEffect(()=>{
|
|
201
203
|
const execute = ()=>_async_to_generator$7(function*() {
|
|
@@ -1766,7 +1768,7 @@ const defaultListerOptions = {
|
|
|
1766
1768
|
passive: true
|
|
1767
1769
|
};
|
|
1768
1770
|
const useScroll = (target, options = defaultOptions$1)=>{
|
|
1769
|
-
const { throttle = 0, idle = 200, onStop = noop, onScroll = noop, offset = {
|
|
1771
|
+
const { throttle = 0, idle = 200, onStop = noop$1, onScroll = noop$1, offset = {
|
|
1770
1772
|
left: 0,
|
|
1771
1773
|
right: 0,
|
|
1772
1774
|
top: 0,
|
|
@@ -2104,7 +2106,7 @@ const useMediaDevices = (options = {})=>{
|
|
|
2104
2106
|
label
|
|
2105
2107
|
}))
|
|
2106
2108
|
});
|
|
2107
|
-
}).catch(noop);
|
|
2109
|
+
}).catch(noop$1);
|
|
2108
2110
|
}, []);
|
|
2109
2111
|
const ensurePermissions = useCallback(()=>_async_to_generator$3(function*() {
|
|
2110
2112
|
if (!isSupported) {
|
|
@@ -2206,10 +2208,19 @@ const useMediaQuery = (query, defaultState)=>{
|
|
|
2206
2208
|
function useRafState(initialState) {
|
|
2207
2209
|
const frame = useRef(0);
|
|
2208
2210
|
const [state, setState] = useState(initialState);
|
|
2211
|
+
const pendingUpdates = useRef([]);
|
|
2209
2212
|
const setRafState = useCallback((value)=>{
|
|
2213
|
+
pendingUpdates.current.push(value);
|
|
2210
2214
|
cancelAnimationFrame(frame.current);
|
|
2211
2215
|
frame.current = requestAnimationFrame(()=>{
|
|
2212
|
-
|
|
2216
|
+
const updates = pendingUpdates.current.splice(0);
|
|
2217
|
+
setState((prevState)=>{
|
|
2218
|
+
let newState = prevState;
|
|
2219
|
+
for (const update of updates){
|
|
2220
|
+
newState = typeof update === 'function' ? update(newState) : update;
|
|
2221
|
+
}
|
|
2222
|
+
return newState;
|
|
2223
|
+
});
|
|
2213
2224
|
});
|
|
2214
2225
|
}, []);
|
|
2215
2226
|
useUnmount(()=>{
|
|
@@ -2498,13 +2509,13 @@ function usePageLeave() {
|
|
|
2498
2509
|
const from = event.relatedTarget || event.toElement;
|
|
2499
2510
|
setIsLeft(!from);
|
|
2500
2511
|
};
|
|
2501
|
-
useEventListener('mouseout', handler,
|
|
2512
|
+
useEventListener('mouseout', handler, defaultWindow, {
|
|
2502
2513
|
passive: true
|
|
2503
2514
|
});
|
|
2504
|
-
useEventListener('mouseleave', handler,
|
|
2515
|
+
useEventListener('mouseleave', handler, defaultDocument, {
|
|
2505
2516
|
passive: true
|
|
2506
2517
|
});
|
|
2507
|
-
useEventListener('mouseenter', handler,
|
|
2518
|
+
useEventListener('mouseenter', handler, defaultDocument, {
|
|
2508
2519
|
passive: true
|
|
2509
2520
|
});
|
|
2510
2521
|
return isLeft;
|
|
@@ -2532,7 +2543,7 @@ const usePermission = (permissionDesc)=>{
|
|
|
2532
2543
|
permissionStatus = status;
|
|
2533
2544
|
on(permissionStatus, 'change', onChange);
|
|
2534
2545
|
onChange();
|
|
2535
|
-
}).catch(noop);
|
|
2546
|
+
}).catch(noop$1);
|
|
2536
2547
|
return ()=>{
|
|
2537
2548
|
permissionStatus && off(permissionStatus, 'change', onChange);
|
|
2538
2549
|
mounted = false;
|
|
@@ -2670,7 +2681,7 @@ const useScratch = (target, options = {})=>{
|
|
|
2670
2681
|
isScratching: true
|
|
2671
2682
|
});
|
|
2672
2683
|
refState.current = newState;
|
|
2673
|
-
(optionsRef.current.onScratch || noop)(newState);
|
|
2684
|
+
(optionsRef.current.onScratch || noop$1)(newState);
|
|
2674
2685
|
return newState;
|
|
2675
2686
|
});
|
|
2676
2687
|
});
|
|
@@ -2684,7 +2695,7 @@ const useScratch = (target, options = {})=>{
|
|
|
2684
2695
|
isScratching: false
|
|
2685
2696
|
});
|
|
2686
2697
|
refState.current = endState;
|
|
2687
|
-
(optionsRef.current.onScratchEnd || noop)(endState);
|
|
2698
|
+
(optionsRef.current.onScratchEnd || noop$1)(endState);
|
|
2688
2699
|
setState(endState);
|
|
2689
2700
|
};
|
|
2690
2701
|
const startScratching = (docX, docY)=>{
|
|
@@ -2717,7 +2728,7 @@ const useScratch = (target, options = {})=>{
|
|
|
2717
2728
|
posY: elY
|
|
2718
2729
|
};
|
|
2719
2730
|
refState.current = newState;
|
|
2720
|
-
(optionsRef.current.onScratchStart || noop)(newState);
|
|
2731
|
+
(optionsRef.current.onScratchStart || noop$1)(newState);
|
|
2721
2732
|
setState(newState);
|
|
2722
2733
|
};
|
|
2723
2734
|
useEventListener('mousedown', (event)=>{
|
|
@@ -2744,7 +2755,7 @@ const useScratch = (target, options = {})=>{
|
|
|
2744
2755
|
return state;
|
|
2745
2756
|
};
|
|
2746
2757
|
|
|
2747
|
-
const useScriptTag = (src, onLoaded = noop, options = defaultOptions$1)=>{
|
|
2758
|
+
const useScriptTag = (src, onLoaded = noop$1, options = defaultOptions$1)=>{
|
|
2748
2759
|
const { immediate = true, manual = false, type = 'text/javascript', async = true, crossOrigin, referrerPolicy, noModule, defer, attrs = {} } = options;
|
|
2749
2760
|
const scriptTag = useRef(null);
|
|
2750
2761
|
const _promise = useRef(null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactuses/core",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.10",
|
|
4
4
|
"license": "Unlicense",
|
|
5
5
|
"homepage": "https://www.reactuse.com/",
|
|
6
6
|
"repository": {
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@microsoft/fetch-event-source": "^2.0.1",
|
|
78
|
-
"@testing-library/dom": "^10.4.0",
|
|
79
78
|
"js-cookie": "^3.0.5",
|
|
80
79
|
"lodash-es": "^4.17.21",
|
|
81
80
|
"screenfull": "^5.0.0",
|
|
@@ -84,6 +83,7 @@
|
|
|
84
83
|
"devDependencies": {
|
|
85
84
|
"@jsdevtools/version-bump-prompt": "^6.1.0",
|
|
86
85
|
"@reactuses/ts-document": "workspace:*",
|
|
86
|
+
"@testing-library/dom": "^10.4.0",
|
|
87
87
|
"@testing-library/react": "^16.1.0",
|
|
88
88
|
"@types/jest": "^27.5.2",
|
|
89
89
|
"@types/js-cookie": "^3.0.3",
|