@reactuses/core 4.0.0 → 4.0.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.cjs +8 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +8 -9
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4894,10 +4894,13 @@ function useClipBorad() {
|
|
|
4894
4894
|
return [text, copy];
|
|
4895
4895
|
}
|
|
4896
4896
|
|
|
4897
|
-
|
|
4897
|
+
const listerOptions = {
|
|
4898
|
+
passive: true
|
|
4899
|
+
};
|
|
4900
|
+
function useClickOutside(target, handler) {
|
|
4898
4901
|
const savedHandler = useLatest(handler);
|
|
4899
|
-
const element = useLatestElement(target);
|
|
4900
4902
|
const listener = (event) => {
|
|
4903
|
+
const element = getTargetElement(target);
|
|
4901
4904
|
if (!element) {
|
|
4902
4905
|
return;
|
|
4903
4906
|
}
|
|
@@ -4907,12 +4910,8 @@ function useClickOutSide(target, handler) {
|
|
|
4907
4910
|
}
|
|
4908
4911
|
savedHandler.current(event);
|
|
4909
4912
|
};
|
|
4910
|
-
useEventListener("mousedown", listener, defaultWindow,
|
|
4911
|
-
|
|
4912
|
-
});
|
|
4913
|
-
useEventListener("touchstart", listener, defaultWindow, {
|
|
4914
|
-
passive: true
|
|
4915
|
-
});
|
|
4913
|
+
useEventListener("mousedown", listener, defaultWindow, listerOptions);
|
|
4914
|
+
useEventListener("touchstart", listener, defaultWindow, listerOptions);
|
|
4916
4915
|
}
|
|
4917
4916
|
|
|
4918
4917
|
function useCycleList(list, i = 0) {
|
|
@@ -5627,7 +5626,7 @@ function useMeasure(target, options = defaultOptions) {
|
|
|
5627
5626
|
exports.getHMSTime = getHMSTime;
|
|
5628
5627
|
exports.useActiveElement = useActiveElement;
|
|
5629
5628
|
exports.useAsyncEffect = useAsyncEffect;
|
|
5630
|
-
exports.useClickOutside =
|
|
5629
|
+
exports.useClickOutside = useClickOutside;
|
|
5631
5630
|
exports.useClipboard = useClipBorad;
|
|
5632
5631
|
exports.useControlled = useControlled;
|
|
5633
5632
|
exports.useCookie = useCookie;
|
package/dist/index.d.ts
CHANGED
|
@@ -767,7 +767,7 @@ declare function useClipBorad(): readonly [
|
|
|
767
767
|
];
|
|
768
768
|
|
|
769
769
|
type EventType = MouseEvent | TouchEvent;
|
|
770
|
-
declare function
|
|
770
|
+
declare function useClickOutside(target: BasicTarget, handler: (evt: EventType) => void): void;
|
|
771
771
|
|
|
772
772
|
declare function useCycleList<T>(list: T[], i?: number): readonly [T, (i?: number) => void, (i?: number) => void];
|
|
773
773
|
|
|
@@ -852,4 +852,4 @@ declare function useSetState<T extends Record<string, any>>(initialState: T): re
|
|
|
852
852
|
type UseMeasureRect = Omit<DOMRectReadOnly, "toJSON">;
|
|
853
853
|
declare function useMeasure(target: BasicTarget, options?: ResizeObserverOptions): readonly [UseMeasureRect, () => void];
|
|
854
854
|
|
|
855
|
-
export { ColorScheme, Contrast, CursorState, EyeDropperOpenReturnType, GeneralPermissionDescriptor, IDisposable, IEvent, IEventOnce, IListener, INetworkInformation, IState, IUseNetworkState, KeyModifier, MousePressedOptions, MouseSourceType, OrientationState, RafLoopReturns, ScrollIntoViewAnimation, ScrollIntoViewParams, Status, Target, UseCookieState, UseDarkOptions, UseDraggableOptions, UseElementBoundingOptions, UseEventEmitterReturn, UseEyeDropperReturn, UseFileDialogOptions, UseFpsOptions, UseFullScreenOptions, UseInfiniteScrollOptions, UseLongPressOptions, UseMeasureRect, UseMediaDeviceOptions, UseModifierOptions, UseScriptTagOptions, UseScrollOptions, UseStickyParams, UseTextDirectionOptions, UseTextDirectionValue, UseTimeoutFnOptions, UseVirtualListItem, UseVirtualListOptions, UseVirtualListReturn, UseWindowScrollState, WindowSize, getHMSTime, useActiveElement, useAsyncEffect,
|
|
855
|
+
export { ColorScheme, Contrast, CursorState, EyeDropperOpenReturnType, GeneralPermissionDescriptor, IDisposable, IEvent, IEventOnce, IListener, INetworkInformation, IState, IUseNetworkState, KeyModifier, MousePressedOptions, MouseSourceType, OrientationState, RafLoopReturns, ScrollIntoViewAnimation, ScrollIntoViewParams, Status, Target, UseCookieState, UseDarkOptions, UseDraggableOptions, UseElementBoundingOptions, UseEventEmitterReturn, UseEyeDropperReturn, UseFileDialogOptions, UseFpsOptions, UseFullScreenOptions, UseInfiniteScrollOptions, UseLongPressOptions, UseMeasureRect, UseMediaDeviceOptions, UseModifierOptions, UseScriptTagOptions, UseScrollOptions, UseStickyParams, UseTextDirectionOptions, UseTextDirectionValue, UseTimeoutFnOptions, UseVirtualListItem, UseVirtualListOptions, UseVirtualListReturn, UseWindowScrollState, WindowSize, getHMSTime, useActiveElement, useAsyncEffect, useClickOutside, useClipBorad as useClipboard, useControlled, useCookie, useCountDown, useCounter, useCustomCompareEffect, useCycleList, useDarkMode, useDebounce, useDebounceFn, useDeepCompareEffect, useDocumentVisibility, useDoubleClick, useDraggable, useDropZone, useElementBounding, useElementSize, useElementVisibility, useEvent, useEventEmitter, useEventListener, useEyeDropper, useFavicon, useFileDialog, useFirstMountState, useFocus, _default$2 as useFps, useFullscreen, useGeolocation, useIdle, useInfiniteScroll, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyModifier, useLatest, useLocalStorage, useLongPress, useMeasure, useMediaDevices, useMediaQuery, useMount, useMountedState, useMouse, useMousePressed, useMutationObserver, useNetwork, useObjectUrl, _default$1 as useOnceEffect, _default as useOnceLayoutEffect, useOnline, useOrientation, usePageLeave, usePermission, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePrevious, useRafFn, useRafState, useReducedMotion, useResizeObserver, useScriptTag, useScroll, useScrollIntoView, useScrollLock, useSessionStorage, useSetState, useSticky, useSupported, useTextDirection, useTextSelection, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useTitle, useToggle, useUnmount, useUpdate, _default$4 as useUpdateEffect, _default$3 as useUpdateLayoutEffect, useVirtualList, useWindowScroll, useWindowSize, useWindowsFocus };
|
package/dist/index.mjs
CHANGED
|
@@ -4886,10 +4886,13 @@ function useClipBorad() {
|
|
|
4886
4886
|
return [text, copy];
|
|
4887
4887
|
}
|
|
4888
4888
|
|
|
4889
|
-
|
|
4889
|
+
const listerOptions = {
|
|
4890
|
+
passive: true
|
|
4891
|
+
};
|
|
4892
|
+
function useClickOutside(target, handler) {
|
|
4890
4893
|
const savedHandler = useLatest(handler);
|
|
4891
|
-
const element = useLatestElement(target);
|
|
4892
4894
|
const listener = (event) => {
|
|
4895
|
+
const element = getTargetElement(target);
|
|
4893
4896
|
if (!element) {
|
|
4894
4897
|
return;
|
|
4895
4898
|
}
|
|
@@ -4899,12 +4902,8 @@ function useClickOutSide(target, handler) {
|
|
|
4899
4902
|
}
|
|
4900
4903
|
savedHandler.current(event);
|
|
4901
4904
|
};
|
|
4902
|
-
useEventListener("mousedown", listener, defaultWindow,
|
|
4903
|
-
|
|
4904
|
-
});
|
|
4905
|
-
useEventListener("touchstart", listener, defaultWindow, {
|
|
4906
|
-
passive: true
|
|
4907
|
-
});
|
|
4905
|
+
useEventListener("mousedown", listener, defaultWindow, listerOptions);
|
|
4906
|
+
useEventListener("touchstart", listener, defaultWindow, listerOptions);
|
|
4908
4907
|
}
|
|
4909
4908
|
|
|
4910
4909
|
function useCycleList(list, i = 0) {
|
|
@@ -5616,4 +5615,4 @@ function useMeasure(target, options = defaultOptions) {
|
|
|
5616
5615
|
return [rect, stop];
|
|
5617
5616
|
}
|
|
5618
5617
|
|
|
5619
|
-
export { getHMSTime, useActiveElement, useAsyncEffect,
|
|
5618
|
+
export { getHMSTime, useActiveElement, useAsyncEffect, useClickOutside, useClipBorad as useClipboard, useControlled, useCookie, useCountDown, useCounter, useCustomCompareEffect, useCycleList, useDarkMode, useDebounce, useDebounceFn, useDeepCompareEffect, useDocumentVisibility, useDoubleClick, useDraggable, useDropZone, useElementBounding, useElementSize, useElementVisibility, useEvent, useEventEmitter, useEventListener, useEyeDropper, useFavicon, useFileDialog, useFirstMountState, useFocus, index$2 as useFps, useFullscreen, useGeolocation, useIdle, useInfiniteScroll, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyModifier, useLatest, useLocalStorage, useLongPress, useMeasure, useMediaDevices, useMediaQuery, useMount, useMountedState, useMouse, useMousePressed, useMutationObserver, useNetwork, useObjectUrl, index$1 as useOnceEffect, index as useOnceLayoutEffect, useOnline, useOrientation, usePageLeave, usePermission, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePrevious, useRafFn, useRafState, useReducedMotion, useResizeObserver, useScriptTag, useScroll, useScrollIntoView, useScrollLock, useSessionStorage, useSetState, useSticky, useSupported, useTextDirection, useTextSelection, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useTitle, useToggle, useUnmount, useUpdate, useUpdateEffect, index$3 as useUpdateLayoutEffect, useVirtualList, useWindowScroll, useWindowSize, useWindowsFocus };
|